diff --git a/assets/AnimatedWave-Co1wJ2Kd.js b/assets/AnimatedWave-1XImhiJl.js similarity index 52% rename from assets/AnimatedWave-Co1wJ2Kd.js rename to assets/AnimatedWave-1XImhiJl.js index 2435aebee2ff03d2813c8fffea16a1c83d89bbf8..0094c4f04a5982c8236708542ab0fd9c06b30287 100644 --- a/assets/AnimatedWave-Co1wJ2Kd.js +++ b/assets/AnimatedWave-1XImhiJl.js @@ -1,3 +1,3 @@ -import{b as e}from"./Basic-BIq-Of0k.js";import{A as t,B as n,H as r,S as i,T as a,W as o,a8 as s,aK as c,aO as l,aR as u,aV as d,aZ as f,af as p,ap as m,c$ as h,d3 as g,d5 as _,d6 as v,d9 as y,dD as b,dI as x,dN as S,dO as C,dP as w,da as T,de as E,dg as D,dh as O,di as k,dj as A,dk as j,dl as M,dm as N,dn as P,do as F,dp as I,ds as L,dt as R,du as z,dv as B,dx as V,dy as H,dz as U,s as W,t as G,u as K,v as q}from"./index-Bcb2irKh.js";import{b as J}from"./HeaderLink-BvOcNkh0.js";const ee={},te={class:`cross-background-container`};function ne(e,t){return k(),I(`div`,te,[_(e.$slots,`default`,{},void 0,!0)])}var re=c(ee,[[`render`,ne],[`__scopeId`,`data-v-455eb62c`]]);const Y={"mb-1":``,"w-full":``,"gap-2":``},X={"w-full":``};var ie=N({__name:`Header`,setup(e){return(e,t)=>(k(),I(`header`,Y,[z(`div`,X,[E(J)]),E(b(l),{class:`m-1 block max-h-[10lh] min-h-[1lh] rounded-lg bg-neutral-100 p-2 text-lg text-neutral-500 outline-none dark:bg-neutral-800 dark:text-neutral-400`,to:`/settings`},{default:F(()=>t[0]||=[z(`div`,{"i-solar:settings-minimalistic-bold-duotone":``},null,-1)]),_:1,__:[0]})]))}}),ae=ie,oe=`/assets/worker-Bv82ofgX.js`;const Z=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`.split(``),se=e=>{let t=typeof e;return t===`object`?e===null?`null`:e?.constructor?.name??`object`:t},ce=e=>{if(typeof e==`string`)return new TextEncoder().encode(e);if(e instanceof Uint8Array)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);throw TypeError(`The input must be a Uint8Array, a string, or an ArrayBuffer. Received a value of the type ${se(e)}.`)},le=e=>{let t=ce(e),n=``,r,i=t.length;for(r=2;r>2],n+=Z[(t[r-2]&3)<<4|t[r-1]>>4],n+=Z[(t[r-1]&15)<<2|t[r]>>6],n+=Z[t[r]&63];return r===i+1&&(n+=Z[t[r-2]>>2],n+=Z[(t[r-2]&3)<<4],n+=`==`),r===i&&(n+=Z[t[r-2]>>2],n+=Z[(t[r-2]&3)<<4|t[r-1]>>4],n+=Z[(t[r-1]&15)<<2],n+=`=`),n};function Q(e,t,n){for(let r=0;r{M().then(()=>{t.value&&(t.value.scrollTop=t.value.scrollHeight)})}),l(async()=>{M().then(()=>{t.value&&(t.value.scrollTop=t.value.scrollHeight)})}),(e,a)=>{let s=O(`auto-animate`);return k(),I(`div`,fe,[a[2]||=z(`div`,{"flex-1":``},null,-1),v((k(),I(`div`,{ref_key:`chatHistoryRef`,ref:t,"h-full":``,"w-full":``,flex:`~ col`,"overflow-scroll":``},[a[1]||=z(`div`,{"flex-1":``},null,-1),(k(!0),I(y,null,B(b(r),(e,t)=>(k(),I(`div`,{key:t,"mb-2":``},[e.role===`error`?(k(),I(`div`,pe,[z(`div`,me,[z(`div`,he,[z(`div`,ge,[z(`span`,_e,S(b(n)(`stage.chat.message.character-name.core-system`)),1)]),a[0]||=z(`div`,{"i-solar:danger-triangle-bold-duotone":``,"text-violet-500":``},null,-1)]),b(i)&&t===b(r).length-1?(k(),I(`div`,ve)):(k(),I(`div`,{key:1,class:`markdown-content break-words text-violet-500`,text:`base {if(!e||!e.trim())return;let t=h.getProviderConfig(_.value);await M(e,{chatProvider:await h.getProviderInstance(_.value),model:y.value,providerConfig:t})}});async function H(){if(!(!c.value.trim()||m.value))try{let e=h.getProviderConfig(_.value);await M(c.value,{chatProvider:await h.getProviderInstance(_.value),model:y.value,providerConfig:e})}catch(e){F.value.pop(),F.value.push({role:`error`,content:e.message})}}let{destroy:U,start:W}=i(A,{onSpeechStart:()=>{l.value=!0},onVADMisfire:()=>{l.value=!1},onSpeechEnd:e=>{l.value=!1,K(e.buffer)},auto:!1});async function K(e){await L.resume();let t=await de(e,L.sampleRate);B({type:`generate`,data:{audio:t,language:`en`}})}return D(O,async e=>{e===`false`&&(U(),V())}),D(p,async e=>{e&&await T()}),D([_,y],async()=>{_.value&&y.value&&await P(y.value,await h.getProviderInstance(_.value),[])}),j(()=>{W()}),N(async()=>{c.value=``}),(t,n)=>(k(),I(`div`,Me,[z(`fieldset`,Ne,[z(`label`,{class:C([f.value===`chat`?`bg-primary-100 dark:bg-primary-900`:`bg-white dark:bg-primary-950`,f.value===`chat`?`text-primary-500 dark:text-primary-500`:``,{"transition-colors-none ":b(w)}]),flex:`~ row`,checked:f.value===`chat`,"aria-checked":f.value===`chat`,border:`solid 2 primary-100 dark:primary-900`,text:`primary-300 hover:primary-500 dark:primary-300/50 dark:hover:primary-500`,transition:`all duration-250 ease-in-out`,"cursor-pointer":``,"items-center":``,"gap-1":``,"rounded-lg":``,"px-2":``},[v(z(`input`,{"onUpdate:modelValue":n[0]||=e=>f.value=e,type:`radio`,name:`tab`,value:`chat`,hidden:``},null,512),[[g,f.value]]),n[4]||=z(`div`,{"i-solar:dialog-2-bold-duotone":``,text:`2xl`,transform:`translate-y--2`},null,-1),z(`div`,Fe,[z(`span`,Ie,S(b(R)(`stage.chat.tabs.chat`)),1)])],10,Pe)]),z(`div`,Le,[z(`div`,Re,[E(je,{"h-full":``,"flex-1":``,"p-4":``,w:`full`,"max-h":`c.value=e,placeholder:b(R)(`stage.message`),text:`primary-500 hover:primary-600 dark:primary-300/50 dark:hover:primary-500 placeholder:primary-400 placeholder:hover:primary-500 placeholder:dark:primary-300/50 placeholder:dark:hover:primary-500`,bg:`primary-200/20 dark:primary-400/20`,"min-h":`[100px]`,"max-h":`[300px]`,"w-full":``,"rounded-t-xl":``,"p-4":``,"font-medium":``,"outline-none":``,transition:`all duration-250 ease-in-out placeholder:all placeholder:duration-250 placeholder:ease-in-out`,class:C({"transition-colors-none placeholder:transition-colors-none":b(w)}),onSubmit:H,onCompositionstart:n[2]||=e=>m.value=!0,onCompositionend:n[3]||=e=>m.value=!1},null,8,[`modelValue`,`placeholder`,`class`])])])])]))}}),Ve=Be;const He={"mb-1":``,"w-full":``,"gap-2":``},Ue={"w-full":``,flex:``,"translate-x--2":``,"justify-center":``};var We=N({__name:`MobileHeader`,setup(e){return(e,t)=>(k(),I(`header`,He,[z(`div`,Ue,[E(J)])]))}}),Ge=We;const Ke={flex:`~ col`,rounded:`lg`,"overflow-hidden":``},qe={key:0,flex:``,mr:`12`},Je={flex:`~ col`,shadow:`md violet-200/20 dark:none`,"min-w-20":``,"rounded-lg":``,"px-3":``,"py-2":``,h:`unset {M().then(()=>{t.value&&(t.value.scrollTop=t.value.scrollHeight)})}),c(async()=>{M().then(()=>{t.value&&(t.value.scrollTop=t.value.scrollHeight)})}),(e,a)=>{let o=O(`auto-animate`);return k(),I(`div`,Ke,[v((k(),I(`div`,{ref_key:`chatHistoryRef`,ref:t,"max-h":`35dvh`,"z-5":``,flex:`~ col`,"h-full":``,"w-full":``,"overflow-scroll":``,class:`chat-history`},[(k(!0),I(y,null,B(b(r),(e,t)=>(k(),I(`div`,{key:t,"mb-2":``},[e.role===`error`?(k(),I(`div`,qe,[z(`div`,Je,[z(`div`,Ye,[z(`div`,Xe,[z(`span`,Ze,S(b(n)(`stage.chat.message.character-name.core-system`)),1)]),a[0]||=z(`div`,{"i-solar:danger-triangle-bold-duotone":``,"text-violet-500":``},null,-1)]),e.content?(k(),I(`div`,{key:0,class:`markdown-content`,text:`base (k(),I(`div`,ft,[E(h,{name:`fade`},{default:F(()=>[b(i)?(k(),I(`div`,pt,[E(b(p),{variant:`secondary-muted`,toggled:a.value===`x`,"w-full":``,onClick:t[0]||=e=>o(`x`)},{default:F(()=>t[5]||=[A(` X `)]),_:1,__:[5]},8,[`toggled`]),E(b(p),{variant:`secondary-muted`,toggled:a.value===`y`,"w-full":``,onClick:t[1]||=e=>o(`y`)},{default:F(()=>t[6]||=[A(` Y `)]),_:1,__:[6]},8,[`toggled`]),b(r)===`3d`?(k(),H(b(p),{key:0,variant:`secondary-muted`,toggled:a.value===`z`,"w-full":``,onClick:t[2]||=e=>o(`z`)},{default:F(()=>t[7]||=[A(` Z `)]),_:1,__:[7]},8,[`toggled`])):P(``,!0),E(b(p),{variant:`secondary-muted`,toggled:a.value===`scale`,"w-full":``,onClick:t[3]||=e=>o(`scale`)},{default:F(()=>t[8]||=[A(` Scale `)]),_:1,__:[8]},8,[`toggled`])])):P(``,!0)]),_:1}),z(`button`,{"w-fit":``,flex:``,"items-center":``,"self-end":``,"justify-center":``,"justify-self-end":``,"rounded-xl":``,"p-2":``,"backdrop-blur-md":``,border:`2 solid neutral-100/60 dark:neutral-800/30`,bg:`neutral-50/70 dark:neutral-800/70`,title:`View`,text:`neutral-500 dark:neutral-400`,onClick:t[4]||=e=>i.value=!b(i)},[E(h,{name:`fade`,mode:`out-in`},{default:F(()=>[b(i)?(k(),I(`div`,ht)):(k(),I(`div`,mt))]),_:1})])]))}}),_t=c(gt,[[`__scopeId`,`data-v-35df7db7`]]);const vt={key:0},yt={key:0,relative:``,class:`[&_.round-range-tooltip]:hover:opacity-100`},bt={class:`round-range-tooltip`,top:`50%`,"translate-y":`[-50%]`,absolute:``,"left-10":``,"font-mono":``,"op-0":``,transition:`all duration-200 ease-in-out`},xt={key:1,relative:``,class:`[&_.round-range-tooltip]:hover:opacity-100`},St={class:`round-range-tooltip`,top:`50%`,"translate-y":`[-50%]`,absolute:``,"left-10":``,"font-mono":``,"op-0":``,transition:`all duration-200 ease-in-out`},Ct={key:2,relative:``,class:`[&_.round-range-tooltip]:hover:opacity-100`},wt={class:`round-range-tooltip`,top:`50%`,"translate-y":`[-50%]`,absolute:``,"left-10":``,"font-mono":``,"op-0":``,transition:`all duration-200 ease-in-out`},Tt={key:3,relative:``,class:`[&_.round-range-tooltip]:hover:opacity-100`},Et={class:`round-range-tooltip`,top:`50%`,"translate-y":`[-50%]`,absolute:``,"left-10":``,"font-mono":``,"op-0":``,transition:`all duration-200 ease-in-out`};var Dt=N({__name:`Inputs`,props:{mode:{}},setup(e,{expose:t}){let n=e,{stageView:r,stageViewControlsEnabled:i}=u(G()),{scale:a,position:o,modelSize:s}=u(W()),{scale:c,position:l}=u(K()),d=T({get:()=>{switch(r.value){case`2d`:return l.value.x;case`3d`:return o.value.x;default:return 0}},set:e=>{switch(r.value){case`2d`:l.value.x=e;break;case`3d`:o.value.x=e;break;default:break}}}),f=T(()=>r.value===`2d`?-500:-s.value.x-10),p=T(()=>r.value===`2d`?500:s.value.x+10),g=T({get:()=>{switch(r.value){case`2d`:return l.value.y;case`3d`:return o.value.y;default:return 0}},set:e=>{switch(r.value){case`2d`:l.value.y=e;break;case`3d`:o.value.y=e;break;default:break}}}),_=T(()=>r.value===`2d`?-500:-s.value.y-10),v=T(()=>r.value===`2d`?500:s.value.y+10),y=T({get:()=>{switch(r.value){case`2d`:return 0;case`3d`:return o.value.z;default:return 0}},set:e=>{switch(r.value){case`2d`:break;case`3d`:o.value.z=e;break;default:break}}}),x=T(()=>r.value===`2d`?-500:-s.value.z-10),C=T(()=>r.value===`2d`?500:s.value.z+10),w=T({get:()=>r.value===`2d`?c.value:a.value,set:e=>{r.value===`2d`?c.value=e:a.value=e}});function D(){switch(n.mode){case`x`:d.value=0;break;case`y`:g.value=0;break;case`z`:y.value=0;break;case`scale`:w.value=1;break}}return t({resetOnMode:D}),(e,t)=>(k(),H(h,{name:`fade-side-pops-in`},{default:F(()=>[b(i)?(k(),I(`div`,vt,[E(h,{name:`fade-side-pops-in`,mode:`out-in`},{default:F(()=>[n.mode===`x`?(k(),I(`div`,yt,[E(b(m),{modelValue:d.value,"onUpdate:modelValue":t[0]||=e=>d.value=e,min:f.value,max:p.value,step:.01,"data-direction":`vertical`,h:`50%`,"write-vertical-left":``},null,8,[`modelValue`,`min`,`max`]),z(`div`,bt,S(d.value.toFixed(2)),1)])):n.mode===`y`?(k(),I(`div`,xt,[E(b(m),{modelValue:g.value,"onUpdate:modelValue":t[1]||=e=>g.value=e,min:_.value,max:v.value,step:.01,"write-vertical-left":``,h:`50%`,"data-direction":`vertical`},null,8,[`modelValue`,`min`,`max`]),z(`div`,St,S(g.value.toFixed(2)),1)])):b(r)===`3d`&&n.mode===`z`?(k(),I(`div`,Ct,[E(b(m),{modelValue:y.value,"onUpdate:modelValue":t[2]||=e=>y.value=e,min:x.value,max:C.value,step:.01,"write-vertical-left":``,h:`50%`,"data-direction":`vertical`},null,8,[`modelValue`,`min`,`max`]),z(`div`,wt,S(y.value.toFixed(2)),1)])):n.mode===`scale`?(k(),I(`div`,Tt,[E(b(m),{modelValue:w.value,"onUpdate:modelValue":t[3]||=e=>w.value=e,min:0,max:3,step:1e-4,"write-vertical-left":``,h:`50%`,"data-direction":`vertical`},null,8,[`modelValue`]),z(`div`,Et,S(w.value.toFixed(2)),1)])):P(``,!0)]),_:1})])):P(``,!0)]),_:1}))}}),Ot=c(Dt,[[`__scopeId`,`data-v-d116bf35`]]);const kt={fixed:``,"bottom-0":``,"w-full":``,flex:``,"flex-col":``},At={relative:``,"w-full":``,"self-end":``},jt={fixed:``,top:`50%`,"translate-y":`[-50%]`,"px-2":``},Mt={"translate-y":`[-100%]`,absolute:``,"right-0":``,"w-full":``,"px-2":``,"pb-2":``,"font-sans":``},Nt={flex:`~ col`,"w-full":``,"gap-1":``},$={key:0,"i-solar:moon-outline":``,"size-5":``,text:`neutral-500 dark:neutral-400`},Pt={key:1,"i-solar:sun-2-outline":``,"size-5":``,text:`neutral-500 dark:neutral-400`},Ft={key:0,"size-5":``,text:`neutral-500 dark:neutral-400`,"inline-flex":``,"items-center":``,"justify-center":``},It={key:1,"size-5":``,text:`neutral-500 dark:neutral-400`,"inline-flex":``,"items-center":``,"justify-center":``},Lt={bg:`white dark:neutral-800`,"w-full":``,flex:``,"gap-1":``,"px-2":``,"py-2":``};var Rt=N({__name:`MobileInteractiveArea`,setup(r){let a=f({disableTransition:!1}),o=x(`scale`),c=V(`viewControlsInputs`),d=x(``),p=x(!1),m=x(!1),g=n(),{activeProvider:_,activeModel:v}=u(t()),{isAudioInputOn:y,selectedAudioDeviceId:S,themeColorsHueDynamic:w,stageView:T,stageViewControlsEnabled:O}=u(G()),{send:A,onAfterSend:M,discoverToolsCompatibility:N}=q(),{messages:L}=u(q()),{t:B}=s();async function U(){if(!(!d.value.trim()||m.value))try{let e=g.getProviderConfig(_.value);await A(d.value,{chatProvider:await g.getProviderInstance(_.value),model:v.value,providerConfig:e})}catch(e){L.value.pop(),L.value.push({role:`error`,content:e.message})}}let{destroy:W,start:K}=i(S,{onSpeechStart:()=>{p.value=!0},onVADMisfire:()=>{p.value=!1},onSpeechEnd:e=>{p.value=!1,J(e)},auto:!1});function J(e){alert(`Transcription is not implemented yet`)}return D(y,async e=>{e===`false`&&W()}),M(async()=>{d.value=``}),D([_,v],async()=>{_.value&&v.value&&await N(v.value,await g.getProviderInstance(_.value),[])}),j(()=>{K()}),(t,n)=>(k(),I(`div`,kt,[(k(),H(R,null,[E(h,{name:`fade`},{default:F(()=>[b(O)?P(``,!0):(k(),H(dt,{key:0,"max-w":`[calc(100%-3.5rem)]`,"w-full":``,"self-start":``,"pl-2":``}))]),_:1})],1024)),z(`div`,At,[z(`div`,jt,[E(Ot,{ref:`viewControlsInputs`,mode:o.value},null,8,[`mode`])]),z(`div`,Mt,[z(`div`,Nt,[n[10]||=z(`button`,{border:`2 solid neutral-100/60 dark:neutral-800/30`,bg:`neutral-50/70 dark:neutral-800/70`,"w-fit":``,flex:``,"items-center":``,"self-end":``,"justify-center":``,"rounded-xl":``,"p-2":``,"backdrop-blur-md":``,title:`About`},[z(`div`,{"i-solar:info-circle-outline":``,"size-5":``,text:`neutral-500 dark:neutral-400`})],-1),z(`button`,{border:`2 solid neutral-100/60 dark:neutral-800/30`,bg:`neutral-50/70 dark:neutral-800/70`,"w-fit":``,flex:``,"items-center":``,"self-end":``,"justify-center":``,"rounded-xl":``,"p-2":``,"backdrop-blur-md":``,title:`Theme`,onClick:n[0]||=e=>a.value=!b(a)},[E(h,{name:`fade`,mode:`out-in`},{default:F(()=>[b(a)?(k(),I(`div`,$)):(k(),I(`div`,Pt))]),_:1})]),n[11]||=z(`button`,{border:`2 solid neutral-100/60 dark:neutral-800/30`,bg:`neutral-50/70 dark:neutral-800/70`,"w-fit":``,flex:``,"items-center":``,"self-end":``,"justify-center":``,"rounded-xl":``,"p-2":``,"backdrop-blur-md":``,title:`Language`},[z(`div`,{"i-solar:earth-outline":``,"size-5":``,text:`neutral-500 dark:neutral-400`})],-1),E(b(l),{to:`/settings`,border:`2 solid neutral-100/60 dark:neutral-800/30`,bg:`neutral-50/70 dark:neutral-800/70`,"w-fit":``,flex:``,"items-center":``,"self-end":``,"justify-center":``,"rounded-xl":``,"p-2":``,"backdrop-blur-md":``,title:`Settings`},{default:F(()=>n[7]||=[z(`div`,{"i-solar:settings-outline":``,"size-5":``,text:`neutral-500 dark:neutral-400`},null,-1)]),_:1,__:[7]}),n[12]||=z(`button`,{border:`2 solid neutral-100/60 dark:neutral-800/30`,bg:`neutral-50/70 dark:neutral-800/70`,"w-fit":``,flex:``,"items-center":``,"self-end":``,"justify-center":``,"rounded-xl":``,"p-2":``,"backdrop-blur-md":``,title:`Model`},[z(`div`,{"i-solar:face-scan-circle-outline":``,"size-5":``,text:`neutral-500 dark:neutral-400`})],-1),z(`button`,{border:`2 solid neutral-100/60 dark:neutral-800/30`,bg:`neutral-50/70 dark:neutral-800/70`,"w-fit":``,flex:``,"items-center":``,"self-end":``,"justify-center":``,"rounded-xl":``,"p-2":``,"backdrop-blur-md":``,title:`Stage View`,onClick:n[1]||=e=>T.value=b(T)===`2d`?`3d`:`2d`},[b(T)===`2d`?(k(),I(`div`,Ft,n[8]||=[z(`span`,null,`2D`,-1)])):P(``,!0),b(T)===`3d`?(k(),I(`div`,It,n[9]||=[z(`span`,null,`3D`,-1)])):P(``,!0)]),E(_t,{modelValue:o.value,"onUpdate:modelValue":n[2]||=e=>o.value=e,onReset:n[3]||=()=>c.value?.resetOnMode()},null,8,[`modelValue`])])]),z(`div`,Lt,[E(b(e),{modelValue:d.value,"onUpdate:modelValue":n[4]||=e=>d.value=e,placeholder:b(B)(`stage.message`),border:`solid 2 primary-50 dark:primary-950/10`,text:`neutral-500 hover:neutral-600 dark:neutral-100 dark:hover:neutral-200 placeholder:neutral-400 placeholder:hover:neutral-500 placeholder:dark:neutral-300 placeholder:dark:hover:neutral-400`,bg:`neutral-100/80 dark:neutral-950/80`,"max-h":`[10lh]`,"min-h":`[calc(1lh+4px+4px)]`,"w-full":``,"resize-none":``,"overflow-y-scroll":``,rounded:`[1lh]`,"px-4":``,"py-0.5":``,"outline-none":``,"backdrop-blur-md":``,"scrollbar-none":``,transition:`all duration-250 ease-in-out placeholder:all placeholder:duration-250 placeholder:ease-in-out`,class:C([b(w)?`transition-colors-none placeholder:transition-colors-none`:``]),"default-height":`1lh`,onSubmit:U,onCompositionstart:n[5]||=e=>m.value=!0,onCompositionend:n[6]||=e=>m.value=!1},null,8,[`modelValue`,`placeholder`,`class`]),d.value.trim()||m.value?(k(),I(`button`,{key:0,w:`[calc(1lh+4px+4px)]`,h:`[calc(1lh+4px+4px)]`,"aspect-square":``,flex:``,"items-center":``,"self-end":``,"justify-center":``,"rounded-full":``,"outline-none":``,"backdrop-blur-md":``,text:`neutral-500 hover:neutral-600 dark:neutral-900 dark:hover:neutral-800`,bg:`primary-50/80 dark:neutral-100/80 hover:neutral-50`,transition:`all duration-250 ease-in-out`,onClick:U},n[13]||=[z(`div`,{"i-solar:arrow-up-outline":``},null,-1)])):P(``,!0)])])]))}}),zt=Rt;const Bt={class:`relative`},Vt={absolute:``,"left-0":``,"right-0":``,"top-0":``,"w-full":``,"overflow-hidden":``};var Ht=N({__name:`AnimatedWave`,props:{height:{default:40},amplitude:{default:14},waveLength:{default:250},fillColor:{default:`oklch(95% 0.10 var(--chromatic-hue))`},direction:{default:`down`},movementDirection:{default:`left`},animationSpeed:{default:50}},setup(e){let t=e,n=x(t.height),r=x(t.amplitude),i=x(t.waveLength),a=x(t.fillColor),o=x(t.direction),s=x(t.movementDirection);function c(e,t,n,r,i){let a=[],o=Math.ceil(e/r),s=o*r,c=1,l=i===`up`?n:t-n;a.push(`M 0 ${l}`);let u=Math.PI*2/r;for(let e=0;e<=s;e+=c){let t=n*Math.sin(u*e),r=i===`up`?l-t:l+t;a.push(`L ${e} ${r}`)}let d=i===`up`?t:0;return a.push(`L ${s} ${d}`),a.push(`L 0 ${d} Z`),a.join(` `)}let l=T(()=>n.value+r.value*2),u=T(()=>{let e=` +import{b as e}from"./Basic-8xhCMoI8.js";import{A as t,B as n,H as r,S as i,T as a,W as o,a8 as s,aK as c,aO as l,aR as u,aS as d,af as f,ap as p,b0 as m,d0 as h,d4 as g,d5 as _,d6 as v,d7 as y,d8 as b,d9 as x,dF as S,dK as C,dN as w,dO as T,dP as E,dc as D,dd as O,de as k,df as A,dh as j,di as M,dj as N,dk as P,dl as F,do as I,dp as L,dt as R,dv as z,dw as B,dx as V,dy as H,dz as U,s as W,t as G,u as K,v as q}from"./index-TXtvn0DM.js";import{b as J}from"./HeaderLink-BMtWjY7k.js";const ee={},te={class:`cross-background-container`};function ne(e,t){return V(),x(`div`,te,[P(e.$slots,`default`,{},void 0,!0)])}var re=c(ee,[[`render`,ne],[`__scopeId`,`data-v-455eb62c`]]);const Y={"mb-1":``,"w-full":``,"gap-2":``},X={"w-full":``};var ie=v({__name:`Header`,setup(e){return(e,t)=>(V(),x(`header`,Y,[k(`div`,X,[R(J)]),R(S(l),{class:`m-1 block max-h-[10lh] min-h-[1lh] rounded-lg bg-neutral-100 p-2 text-lg text-neutral-500 outline-none dark:bg-neutral-800 dark:text-neutral-400`,to:`/settings`},{default:b(()=>t[0]||=[k(`div`,{"i-solar:settings-minimalistic-bold-duotone":``},null,-1)]),_:1,__:[0]})]))}}),ae=ie,oe=`/assets/worker-Bv82ofgX.js`;const Z=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`.split(``),se=e=>{let t=typeof e;return t===`object`?e===null?`null`:e?.constructor?.name??`object`:t},ce=e=>{if(typeof e==`string`)return new TextEncoder().encode(e);if(e instanceof Uint8Array)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);throw TypeError(`The input must be a Uint8Array, a string, or an ArrayBuffer. Received a value of the type ${se(e)}.`)},le=e=>{let t=ce(e),n=``,r,i=t.length;for(r=2;r>2],n+=Z[(t[r-2]&3)<<4|t[r-1]>>4],n+=Z[(t[r-1]&15)<<2|t[r]>>6],n+=Z[t[r]&63];return r===i+1&&(n+=Z[t[r-2]>>2],n+=Z[(t[r-2]&3)<<4],n+=`==`),r===i&&(n+=Z[t[r-2]>>2],n+=Z[(t[r-2]&3)<<4|t[r-1]>>4],n+=Z[(t[r-1]&15)<<2],n+=`=`),n};function Q(e,t,n){for(let r=0;r{_().then(()=>{t.value&&(t.value.scrollTop=t.value.scrollHeight)})}),l(async()=>{_().then(()=>{t.value&&(t.value.scrollTop=t.value.scrollHeight)})}),(e,a)=>{let s=B(`auto-animate`);return V(),x(`div`,fe,[a[2]||=k(`div`,{"flex-1":``},null,-1),F((V(),x(`div`,{ref_key:`chatHistoryRef`,ref:t,"h-full":``,"w-full":``,flex:`~ col`,"overflow-scroll":``},[a[1]||=k(`div`,{"flex-1":``},null,-1),(V(!0),x(I,null,A(S(r),(e,t)=>(V(),x(`div`,{key:t,"mb-2":``},[e.role===`error`?(V(),x(`div`,pe,[k(`div`,me,[k(`div`,he,[k(`div`,ge,[k(`span`,_e,w(S(n)(`stage.chat.message.character-name.core-system`)),1)]),a[0]||=k(`div`,{"i-solar:danger-triangle-bold-duotone":``,"text-violet-500":``},null,-1)]),S(i)&&t===S(r).length-1?(V(),x(`div`,ve)):(V(),x(`div`,{key:1,class:`markdown-content break-words text-violet-500`,text:`base {if(!e||!e.trim())return;let t=h.getProviderConfig(_.value);await O(e,{chatProvider:await h.getProviderInstance(_.value),model:v.value,providerConfig:t})}});async function B(){if(!(!c.value.trim()||p.value))try{let e=h.getProviderConfig(_.value);await O(c.value,{chatProvider:await h.getProviderInstance(_.value),model:v.value,providerConfig:e})}catch(e){M.value.pop(),M.value.push({role:`error`,content:e.message})}}let{destroy:H,start:W}=i(D,{onSpeechStart:()=>{l.value=!0},onVADMisfire:()=>{l.value=!1},onSpeechEnd:e=>{l.value=!1,K(e.buffer)},auto:!1});async function K(e){await N.resume();let t=await de(e,N.sampleRate);I({type:`generate`,data:{audio:t,language:`en`}})}return z(E,async e=>{e===`false`&&(H(),L())}),z(f,async e=>{e&&await b()}),z([_,v],async()=>{_.value&&v.value&&await j(v.value,await h.getProviderInstance(_.value),[])}),U(()=>{W()}),A(async()=>{c.value=``}),(t,n)=>(V(),x(`div`,Me,[k(`fieldset`,Ne,[k(`label`,{class:T([d.value===`chat`?`bg-primary-100 dark:bg-primary-900`:`bg-white dark:bg-primary-950`,d.value===`chat`?`text-primary-500 dark:text-primary-500`:``,{"transition-colors-none ":S(y)}]),flex:`~ row`,checked:d.value===`chat`,"aria-checked":d.value===`chat`,border:`solid 2 primary-100 dark:primary-900`,text:`primary-300 hover:primary-500 dark:primary-300/50 dark:hover:primary-500`,transition:`all duration-250 ease-in-out`,"cursor-pointer":``,"items-center":``,"gap-1":``,"rounded-lg":``,"px-2":``},[F(k(`input`,{"onUpdate:modelValue":n[0]||=e=>d.value=e,type:`radio`,name:`tab`,value:`chat`,hidden:``},null,512),[[g,d.value]]),n[4]||=k(`div`,{"i-solar:dialog-2-bold-duotone":``,text:`2xl`,transform:`translate-y--2`},null,-1),k(`div`,Fe,[k(`span`,Ie,w(S(P)(`stage.chat.tabs.chat`)),1)])],10,Pe)]),k(`div`,Le,[k(`div`,Re,[R(je,{"h-full":``,"flex-1":``,"p-4":``,w:`full`,"max-h":`c.value=e,placeholder:S(P)(`stage.message`),text:`primary-500 hover:primary-600 dark:primary-300/50 dark:hover:primary-500 placeholder:primary-400 placeholder:hover:primary-500 placeholder:dark:primary-300/50 placeholder:dark:hover:primary-500`,bg:`primary-200/20 dark:primary-400/20`,"min-h":`[100px]`,"max-h":`[300px]`,"w-full":``,"rounded-t-xl":``,"p-4":``,"font-medium":``,"outline-none":``,transition:`all duration-250 ease-in-out placeholder:all placeholder:duration-250 placeholder:ease-in-out`,class:T({"transition-colors-none placeholder:transition-colors-none":S(y)}),onSubmit:B,onCompositionstart:n[2]||=e=>p.value=!0,onCompositionend:n[3]||=e=>p.value=!1},null,8,[`modelValue`,`placeholder`,`class`])])])])]))}}),Ve=Be;const He={"mb-1":``,"w-full":``,"gap-2":``},Ue={"w-full":``,flex:``,"translate-x--2":``,"justify-center":``};var We=v({__name:`MobileHeader`,setup(e){return(e,t)=>(V(),x(`header`,He,[k(`div`,Ue,[R(J)])]))}}),Ge=We;const Ke={flex:`~ col`,rounded:`lg`,"overflow-hidden":``},qe={key:0,flex:``,mr:`12`},Je={flex:`~ col`,shadow:`md violet-200/20 dark:none`,"min-w-20":``,"rounded-lg":``,"px-3":``,"py-2":``,h:`unset {_().then(()=>{t.value&&(t.value.scrollTop=t.value.scrollHeight)})}),c(async()=>{_().then(()=>{t.value&&(t.value.scrollTop=t.value.scrollHeight)})}),(e,a)=>{let o=B(`auto-animate`);return V(),x(`div`,Ke,[F((V(),x(`div`,{ref_key:`chatHistoryRef`,ref:t,"max-h":`35dvh`,"z-5":``,flex:`~ col`,"h-full":``,"w-full":``,"overflow-scroll":``,class:`chat-history`},[(V(!0),x(I,null,A(S(r),(e,t)=>(V(),x(`div`,{key:t,"mb-2":``},[e.role===`error`?(V(),x(`div`,qe,[k(`div`,Je,[k(`div`,Ye,[k(`div`,Xe,[k(`span`,Ze,w(S(n)(`stage.chat.message.character-name.core-system`)),1)]),a[0]||=k(`div`,{"i-solar:danger-triangle-bold-duotone":``,"text-violet-500":``},null,-1)]),e.content?(V(),x(`div`,{key:0,class:`markdown-content`,text:`base (V(),x(`div`,ft,[R(h,{name:`fade`},{default:b(()=>[S(i)?(V(),x(`div`,pt,[R(S(f),{variant:`secondary-muted`,toggled:a.value===`x`,"w-full":``,onClick:t[0]||=e=>o(`x`)},{default:b(()=>t[5]||=[H(` X `)]),_:1,__:[5]},8,[`toggled`]),R(S(f),{variant:`secondary-muted`,toggled:a.value===`y`,"w-full":``,onClick:t[1]||=e=>o(`y`)},{default:b(()=>t[6]||=[H(` Y `)]),_:1,__:[6]},8,[`toggled`]),S(r)===`3d`?(V(),M(S(f),{key:0,variant:`secondary-muted`,toggled:a.value===`z`,"w-full":``,onClick:t[2]||=e=>o(`z`)},{default:b(()=>t[7]||=[H(` Z `)]),_:1,__:[7]},8,[`toggled`])):y(``,!0),R(S(f),{variant:`secondary-muted`,toggled:a.value===`scale`,"w-full":``,onClick:t[3]||=e=>o(`scale`)},{default:b(()=>t[8]||=[H(` Scale `)]),_:1,__:[8]},8,[`toggled`])])):y(``,!0)]),_:1}),k(`button`,{"w-fit":``,flex:``,"items-center":``,"self-end":``,"justify-center":``,"justify-self-end":``,"rounded-xl":``,"p-2":``,"backdrop-blur-md":``,border:`2 solid neutral-100/60 dark:neutral-800/30`,bg:`neutral-50/70 dark:neutral-800/70`,title:`View`,text:`neutral-500 dark:neutral-400`,onClick:t[4]||=e=>i.value=!S(i)},[R(h,{name:`fade`,mode:`out-in`},{default:b(()=>[S(i)?(V(),x(`div`,ht)):(V(),x(`div`,mt))]),_:1})])]))}}),_t=c(gt,[[`__scopeId`,`data-v-35df7db7`]]);const vt={key:0},yt={key:0,relative:``,class:`[&_.round-range-tooltip]:hover:opacity-100`},bt={class:`round-range-tooltip`,top:`50%`,"translate-y":`[-50%]`,absolute:``,"left-10":``,"font-mono":``,"op-0":``,transition:`all duration-200 ease-in-out`},xt={key:1,relative:``,class:`[&_.round-range-tooltip]:hover:opacity-100`},St={class:`round-range-tooltip`,top:`50%`,"translate-y":`[-50%]`,absolute:``,"left-10":``,"font-mono":``,"op-0":``,transition:`all duration-200 ease-in-out`},Ct={key:2,relative:``,class:`[&_.round-range-tooltip]:hover:opacity-100`},wt={class:`round-range-tooltip`,top:`50%`,"translate-y":`[-50%]`,absolute:``,"left-10":``,"font-mono":``,"op-0":``,transition:`all duration-200 ease-in-out`},Tt={key:3,relative:``,class:`[&_.round-range-tooltip]:hover:opacity-100`},Et={class:`round-range-tooltip`,top:`50%`,"translate-y":`[-50%]`,absolute:``,"left-10":``,"font-mono":``,"op-0":``,transition:`all duration-200 ease-in-out`};var Dt=v({__name:`Inputs`,props:{mode:{}},setup(e,{expose:t}){let n=e,{stageView:r,stageViewControlsEnabled:i}=u(G()),{scale:a,position:o,modelSize:s}=u(W()),{scale:c,position:l}=u(K()),d=L({get:()=>{switch(r.value){case`2d`:return l.value.x;case`3d`:return o.value.x;default:return 0}},set:e=>{switch(r.value){case`2d`:l.value.x=e;break;case`3d`:o.value.x=e;break;default:break}}}),f=L(()=>r.value===`2d`?-500:-s.value.x-10),m=L(()=>r.value===`2d`?500:s.value.x+10),g=L({get:()=>{switch(r.value){case`2d`:return l.value.y;case`3d`:return o.value.y;default:return 0}},set:e=>{switch(r.value){case`2d`:l.value.y=e;break;case`3d`:o.value.y=e;break;default:break}}}),_=L(()=>r.value===`2d`?-500:-s.value.y-10),v=L(()=>r.value===`2d`?500:s.value.y+10),C=L({get:()=>{switch(r.value){case`2d`:return 0;case`3d`:return o.value.z;default:return 0}},set:e=>{switch(r.value){case`2d`:break;case`3d`:o.value.z=e;break;default:break}}}),T=L(()=>r.value===`2d`?-500:-s.value.z-10),E=L(()=>r.value===`2d`?500:s.value.z+10),D=L({get:()=>r.value===`2d`?c.value:a.value,set:e=>{r.value===`2d`?c.value=e:a.value=e}});function O(){switch(n.mode){case`x`:d.value=0;break;case`y`:g.value=0;break;case`z`:C.value=0;break;case`scale`:D.value=1;break}}return t({resetOnMode:O}),(e,t)=>(V(),M(h,{name:`fade-side-pops-in`},{default:b(()=>[S(i)?(V(),x(`div`,vt,[R(h,{name:`fade-side-pops-in`,mode:`out-in`},{default:b(()=>[n.mode===`x`?(V(),x(`div`,yt,[R(S(p),{modelValue:d.value,"onUpdate:modelValue":t[0]||=e=>d.value=e,min:f.value,max:m.value,step:.01,"data-direction":`vertical`,h:`50%`,"write-vertical-left":``},null,8,[`modelValue`,`min`,`max`]),k(`div`,bt,w(d.value.toFixed(2)),1)])):n.mode===`y`?(V(),x(`div`,xt,[R(S(p),{modelValue:g.value,"onUpdate:modelValue":t[1]||=e=>g.value=e,min:_.value,max:v.value,step:.01,"write-vertical-left":``,h:`50%`,"data-direction":`vertical`},null,8,[`modelValue`,`min`,`max`]),k(`div`,St,w(g.value.toFixed(2)),1)])):S(r)===`3d`&&n.mode===`z`?(V(),x(`div`,Ct,[R(S(p),{modelValue:C.value,"onUpdate:modelValue":t[2]||=e=>C.value=e,min:T.value,max:E.value,step:.01,"write-vertical-left":``,h:`50%`,"data-direction":`vertical`},null,8,[`modelValue`,`min`,`max`]),k(`div`,wt,w(C.value.toFixed(2)),1)])):n.mode===`scale`?(V(),x(`div`,Tt,[R(S(p),{modelValue:D.value,"onUpdate:modelValue":t[3]||=e=>D.value=e,min:0,max:3,step:1e-4,"write-vertical-left":``,h:`50%`,"data-direction":`vertical`},null,8,[`modelValue`]),k(`div`,Et,w(D.value.toFixed(2)),1)])):y(``,!0)]),_:1})])):y(``,!0)]),_:1}))}}),Ot=c(Dt,[[`__scopeId`,`data-v-d116bf35`]]);const kt={fixed:``,"bottom-0":``,"w-full":``,flex:``,"flex-col":``},At={relative:``,"w-full":``,"self-end":``},jt={fixed:``,top:`50%`,"translate-y":`[-50%]`,"px-2":``},Mt={"translate-y":`[-100%]`,absolute:``,"right-0":``,"w-full":``,"px-2":``,"pb-2":``,"font-sans":``},Nt={flex:`~ col`,"w-full":``,"gap-1":``},$={key:0,"i-solar:moon-outline":``,"size-5":``,text:`neutral-500 dark:neutral-400`},Pt={key:1,"i-solar:sun-2-outline":``,"size-5":``,text:`neutral-500 dark:neutral-400`},Ft={key:0,"size-5":``,text:`neutral-500 dark:neutral-400`,"inline-flex":``,"items-center":``,"justify-center":``},It={key:1,"size-5":``,text:`neutral-500 dark:neutral-400`,"inline-flex":``,"items-center":``,"justify-center":``},Lt={bg:`white dark:neutral-800`,"w-full":``,flex:``,"gap-1":``,"px-2":``,"py-2":``};var Rt=v({__name:`MobileInteractiveArea`,setup(r){let a=d({disableTransition:!1}),o=C(`scale`),c=j(`viewControlsInputs`),f=C(``),p=C(!1),m=C(!1),g=n(),{activeProvider:_,activeModel:v}=u(t()),{isAudioInputOn:w,selectedAudioDeviceId:E,themeColorsHueDynamic:D,stageView:A,stageViewControlsEnabled:N}=u(G()),{send:P,onAfterSend:F,discoverToolsCompatibility:I}=q(),{messages:L}=u(q()),{t:B}=s();async function H(){if(!(!f.value.trim()||m.value))try{let e=g.getProviderConfig(_.value);await P(f.value,{chatProvider:await g.getProviderInstance(_.value),model:v.value,providerConfig:e})}catch(e){L.value.pop(),L.value.push({role:`error`,content:e.message})}}let{destroy:W,start:K}=i(E,{onSpeechStart:()=>{p.value=!0},onVADMisfire:()=>{p.value=!1},onSpeechEnd:e=>{p.value=!1,J(e)},auto:!1});function J(e){alert(`Transcription is not implemented yet`)}return z(w,async e=>{e===`false`&&W()}),F(async()=>{f.value=``}),z([_,v],async()=>{_.value&&v.value&&await I(v.value,await g.getProviderInstance(_.value),[])}),U(()=>{K()}),(t,n)=>(V(),x(`div`,kt,[(V(),M(O,null,[R(h,{name:`fade`},{default:b(()=>[S(N)?y(``,!0):(V(),M(dt,{key:0,"max-w":`[calc(100%-3.5rem)]`,"w-full":``,"self-start":``,"pl-2":``}))]),_:1})],1024)),k(`div`,At,[k(`div`,jt,[R(Ot,{ref:`viewControlsInputs`,mode:o.value},null,8,[`mode`])]),k(`div`,Mt,[k(`div`,Nt,[n[10]||=k(`button`,{border:`2 solid neutral-100/60 dark:neutral-800/30`,bg:`neutral-50/70 dark:neutral-800/70`,"w-fit":``,flex:``,"items-center":``,"self-end":``,"justify-center":``,"rounded-xl":``,"p-2":``,"backdrop-blur-md":``,title:`About`},[k(`div`,{"i-solar:info-circle-outline":``,"size-5":``,text:`neutral-500 dark:neutral-400`})],-1),k(`button`,{border:`2 solid neutral-100/60 dark:neutral-800/30`,bg:`neutral-50/70 dark:neutral-800/70`,"w-fit":``,flex:``,"items-center":``,"self-end":``,"justify-center":``,"rounded-xl":``,"p-2":``,"backdrop-blur-md":``,title:`Theme`,onClick:n[0]||=e=>a.value=!S(a)},[R(h,{name:`fade`,mode:`out-in`},{default:b(()=>[S(a)?(V(),x(`div`,$)):(V(),x(`div`,Pt))]),_:1})]),n[11]||=k(`button`,{border:`2 solid neutral-100/60 dark:neutral-800/30`,bg:`neutral-50/70 dark:neutral-800/70`,"w-fit":``,flex:``,"items-center":``,"self-end":``,"justify-center":``,"rounded-xl":``,"p-2":``,"backdrop-blur-md":``,title:`Language`},[k(`div`,{"i-solar:earth-outline":``,"size-5":``,text:`neutral-500 dark:neutral-400`})],-1),R(S(l),{to:`/settings`,border:`2 solid neutral-100/60 dark:neutral-800/30`,bg:`neutral-50/70 dark:neutral-800/70`,"w-fit":``,flex:``,"items-center":``,"self-end":``,"justify-center":``,"rounded-xl":``,"p-2":``,"backdrop-blur-md":``,title:`Settings`},{default:b(()=>n[7]||=[k(`div`,{"i-solar:settings-outline":``,"size-5":``,text:`neutral-500 dark:neutral-400`},null,-1)]),_:1,__:[7]}),n[12]||=k(`button`,{border:`2 solid neutral-100/60 dark:neutral-800/30`,bg:`neutral-50/70 dark:neutral-800/70`,"w-fit":``,flex:``,"items-center":``,"self-end":``,"justify-center":``,"rounded-xl":``,"p-2":``,"backdrop-blur-md":``,title:`Model`},[k(`div`,{"i-solar:face-scan-circle-outline":``,"size-5":``,text:`neutral-500 dark:neutral-400`})],-1),k(`button`,{border:`2 solid neutral-100/60 dark:neutral-800/30`,bg:`neutral-50/70 dark:neutral-800/70`,"w-fit":``,flex:``,"items-center":``,"self-end":``,"justify-center":``,"rounded-xl":``,"p-2":``,"backdrop-blur-md":``,title:`Stage View`,onClick:n[1]||=e=>A.value=S(A)===`2d`?`3d`:`2d`},[S(A)===`2d`?(V(),x(`div`,Ft,n[8]||=[k(`span`,null,`2D`,-1)])):y(``,!0),S(A)===`3d`?(V(),x(`div`,It,n[9]||=[k(`span`,null,`3D`,-1)])):y(``,!0)]),R(_t,{modelValue:o.value,"onUpdate:modelValue":n[2]||=e=>o.value=e,onReset:n[3]||=()=>c.value?.resetOnMode()},null,8,[`modelValue`])])]),k(`div`,Lt,[R(S(e),{modelValue:f.value,"onUpdate:modelValue":n[4]||=e=>f.value=e,placeholder:S(B)(`stage.message`),border:`solid 2 primary-50 dark:primary-950/10`,text:`neutral-500 hover:neutral-600 dark:neutral-100 dark:hover:neutral-200 placeholder:neutral-400 placeholder:hover:neutral-500 placeholder:dark:neutral-300 placeholder:dark:hover:neutral-400`,bg:`neutral-100/80 dark:neutral-950/80`,"max-h":`[10lh]`,"min-h":`[calc(1lh+4px+4px)]`,"w-full":``,"resize-none":``,"overflow-y-scroll":``,rounded:`[1lh]`,"px-4":``,"py-0.5":``,"outline-none":``,"backdrop-blur-md":``,"scrollbar-none":``,transition:`all duration-250 ease-in-out placeholder:all placeholder:duration-250 placeholder:ease-in-out`,class:T([S(D)?`transition-colors-none placeholder:transition-colors-none`:``]),"default-height":`1lh`,onSubmit:H,onCompositionstart:n[5]||=e=>m.value=!0,onCompositionend:n[6]||=e=>m.value=!1},null,8,[`modelValue`,`placeholder`,`class`]),f.value.trim()||m.value?(V(),x(`button`,{key:0,w:`[calc(1lh+4px+4px)]`,h:`[calc(1lh+4px+4px)]`,"aspect-square":``,flex:``,"items-center":``,"self-end":``,"justify-center":``,"rounded-full":``,"outline-none":``,"backdrop-blur-md":``,text:`neutral-500 hover:neutral-600 dark:neutral-900 dark:hover:neutral-800`,bg:`primary-50/80 dark:neutral-100/80 hover:neutral-50`,transition:`all duration-250 ease-in-out`,onClick:H},n[13]||=[k(`div`,{"i-solar:arrow-up-outline":``},null,-1)])):y(``,!0)])])]))}}),zt=Rt;const Bt={class:`relative`},Vt={absolute:``,"left-0":``,"right-0":``,"top-0":``,"w-full":``,"overflow-hidden":``};var Ht=v({__name:`AnimatedWave`,props:{height:{default:40},amplitude:{default:14},waveLength:{default:250},fillColor:{default:`oklch(95% 0.10 var(--chromatic-hue))`},direction:{default:`down`},movementDirection:{default:`left`},animationSpeed:{default:50}},setup(e){let t=e,n=C(t.height),r=C(t.amplitude),i=C(t.waveLength),a=C(t.fillColor),o=C(t.direction),s=C(t.movementDirection);function c(e,t,n,r,i){let a=[],o=Math.ceil(e/r),s=o*r,c=1,l=i===`up`?n:t-n;a.push(`M 0 ${l}`);let u=Math.PI*2/r;for(let e=0;e<=s;e+=c){let t=n*Math.sin(u*e),r=i===`up`?l-t:l+t;a.push(`L ${e} ${r}`)}let d=i===`up`?t:0;return a.push(`L ${s} ${d}`),a.push(`L 0 ${d} Z`),a.join(` `)}let l=L(()=>n.value+r.value*2),u=L(()=>{let e=` - `;return`url(data:image/svg+xml;base64,${btoa(e)})`});return D(()=>[t.height,t.amplitude,t.waveLength,t.fillColor,t.direction,t.movementDirection],()=>{n.value=t.height,r.value=t.amplitude,i.value=t.waveLength,a.value=t.fillColor,o.value=t.direction,s.value=t.movementDirection},{immediate:!0}),(e,t)=>(k(),I(`div`,Bt,[_(e.$slots,`default`,{},void 0,!0),z(`div`,Vt,[z(`div`,{class:`colored-area wave`,style:w({background:a.value,height:`${l.value}px`,maskImage:u.value,WebkitMaskImage:u.value,"--wave-translate":`${-i.value}px`,"--animation-duration":`${i.value/e.animationSpeed}s`,"animation-direction":s.value===`left`?`normal`:`reverse`})},null,4)])]))}}),Ut=c(Ht,[[`__scopeId`,`data-v-33a54ad1`]]);export{Ut as b,zt as c,Ge as d,Ve as e,ae as f,re as g}; \ No newline at end of file + `;return`url(data:image/svg+xml;base64,${btoa(e)})`});return z(()=>[t.height,t.amplitude,t.waveLength,t.fillColor,t.direction,t.movementDirection],()=>{n.value=t.height,r.value=t.amplitude,i.value=t.waveLength,a.value=t.fillColor,o.value=t.direction,s.value=t.movementDirection},{immediate:!0}),(e,t)=>(V(),x(`div`,Bt,[P(e.$slots,`default`,{},void 0,!0),k(`div`,Vt,[k(`div`,{class:`colored-area wave`,style:E({background:a.value,height:`${l.value}px`,maskImage:u.value,WebkitMaskImage:u.value,"--wave-translate":`${-i.value}px`,"--animation-duration":`${i.value/e.animationSpeed}s`,"animation-direction":s.value===`left`?`normal`:`reverse`})},null,4)])]))}}),Ut=c(Ht,[[`__scopeId`,`data-v-33a54ad1`]]);export{Ut as b,zt as c,Ge as d,Ve as e,ae as f,re as g}; \ No newline at end of file diff --git a/assets/Basic-8xhCMoI8.js b/assets/Basic-8xhCMoI8.js new file mode 100644 index 0000000000000000000000000000000000000000..1414ee98b04dd6cf6d6c0b0f27f0756479e4be76 --- /dev/null +++ b/assets/Basic-8xhCMoI8.js @@ -0,0 +1 @@ +import{d1 as e,d6 as t,d9 as n,dK as r,dP as i,dc as a,dj as o,dl as s,dv as c,dx as l}from"./index-TXtvn0DM.js";var u=t({__name:`Basic`,props:a({defaultHeight:{}},{modelValue:{default:``},modelModifiers:{}}),emits:a([`submit`],[`update:modelValue`]),setup(t,{emit:a}){let u=t,d=a,f=o(t,`modelValue`),p=r(),m=r(`auto`);function h(e){e.code===`Enter`&&!e.shiftKey&&(e.preventDefault(),d(`submit`,f.value))}return c(f,()=>{m.value=`auto`,requestAnimationFrame(()=>{if(p.value){if(f.value===``){m.value=u.defaultHeight||`fit-content`;return}m.value=`${p.value.scrollHeight}px`}})},{immediate:!0}),(t,r)=>s((l(),n(`textarea`,{ref_key:`textareaRef`,ref:p,"onUpdate:modelValue":r[0]||=e=>f.value=e,style:i({height:m.value}),onKeydown:h},null,36)),[[e,f.value]])}}),d=u;export{d as b}; \ No newline at end of file diff --git a/assets/Basic-BIq-Of0k.js b/assets/Basic-BIq-Of0k.js deleted file mode 100644 index e0dc2505608ee25943c8e5eabc769bebce02e06c..0000000000000000000000000000000000000000 --- a/assets/Basic-BIq-Of0k.js +++ /dev/null @@ -1 +0,0 @@ -import{d0 as e,d6 as t,dI as n,dP as r,dg as i,di as a,dm as o,dp as s,ds as c,dz as l}from"./index-Bcb2irKh.js";var u=o({__name:`Basic`,props:c({defaultHeight:{}},{modelValue:{default:``},modelModifiers:{}}),emits:c([`submit`],[`update:modelValue`]),setup(o,{emit:c}){let u=o,d=c,f=l(o,`modelValue`),p=n(),m=n(`auto`);function h(e){e.code===`Enter`&&!e.shiftKey&&(e.preventDefault(),d(`submit`,f.value))}return i(f,()=>{m.value=`auto`,requestAnimationFrame(()=>{if(p.value){if(f.value===``){m.value=u.defaultHeight||`fit-content`;return}m.value=`${p.value.scrollHeight}px`}})},{immediate:!0}),(n,i)=>t((a(),s(`textarea`,{ref_key:`textareaRef`,ref:p,"onUpdate:modelValue":i[0]||=e=>f.value=e,style:r({height:m.value}),onKeydown:h},null,36)),[[e,f.value]])}}),d=u;export{d as b}; \ No newline at end of file diff --git a/assets/CardCreate-B9UkMPmr.js b/assets/CardCreate-B9UkMPmr.js deleted file mode 100644 index 89ae2aed73ae76637205377f15c7abb544efa32c..0000000000000000000000000000000000000000 --- a/assets/CardCreate-B9UkMPmr.js +++ /dev/null @@ -1 +0,0 @@ -import{b as e}from"./CardCreate-DUt9F6Lp.js";export{e as default}; \ No newline at end of file diff --git a/assets/CardCreate-BnBq88i7.js b/assets/CardCreate-BnBq88i7.js new file mode 100644 index 0000000000000000000000000000000000000000..a02ff4912758cf082db43ecc66f14557c502bc52 --- /dev/null +++ b/assets/CardCreate-BnBq88i7.js @@ -0,0 +1 @@ +import{b as e}from"./CardCreate-Cwl18tMa.js";export{e as default}; \ No newline at end of file diff --git a/assets/CardCreate-DUt9F6Lp.js b/assets/CardCreate-Cwl18tMa.js similarity index 54% rename from assets/CardCreate-DUt9F6Lp.js rename to assets/CardCreate-Cwl18tMa.js index 91f966ef10351b4ae17b2837fcebcb0fa02691c1..5e34dc6c95d296079b835c30cc65d3ef5e944870 100644 --- a/assets/CardCreate-DUt9F6Lp.js +++ b/assets/CardCreate-Cwl18tMa.js @@ -1 +1 @@ -import{a8 as e,dD as t,dN as n,di as r,dm as i,dp as a,du as o}from"./index-Bcb2irKh.js";const s={relative:``,class:`min-h-[120px] flex flex-col cursor-pointer items-center justify-center border-neutral-200 rounded-xl bg-white/60 p-6 dark:border-neutral-700 hover:border-primary-300 dark:bg-black/30 hover:bg-white/80 dark:hover:border-primary-700 dark:hover:bg-black/40`,border:`solid 2`,transition:`all duration-300`,"cursor-pointer":``,"opacity-95":``,hover:`scale-100 opacity-100 shadow-md dark:shadow-lg`},c={"font-medium":``,text:`neutral-600 dark:neutral-300`};var l=i({__name:`CardCreate`,setup(i){let{t:l}=e();return(e,i)=>(r(),a(`div`,s,[i[0]||=o(`div`,{"i-solar:add-square-line-duotone":``,"mb-4":``,"text-5xl":``,text:`neutral-400 dark:neutral-500`},null,-1),o(`p`,c,n(t(l)(`settings.pages.card.create_card`)),1)]))}}),u=l;export{u as b}; \ No newline at end of file +import{a8 as e,d6 as t,d9 as n,dF as r,dN as i,de as a,dx as o}from"./index-TXtvn0DM.js";const s={relative:``,class:`min-h-[120px] flex flex-col cursor-pointer items-center justify-center border-neutral-200 rounded-xl bg-white/60 p-6 dark:border-neutral-700 hover:border-primary-300 dark:bg-black/30 hover:bg-white/80 dark:hover:border-primary-700 dark:hover:bg-black/40`,border:`solid 2`,transition:`all duration-300`,"cursor-pointer":``,"opacity-95":``,hover:`scale-100 opacity-100 shadow-md dark:shadow-lg`},c={"font-medium":``,text:`neutral-600 dark:neutral-300`};var l=t({__name:`CardCreate`,setup(t){let{t:l}=e();return(e,t)=>(o(),n(`div`,s,[t[0]||=a(`div`,{"i-solar:add-square-line-duotone":``,"mb-4":``,"text-5xl":``,text:`neutral-400 dark:neutral-500`},null,-1),a(`p`,c,i(r(l)(`settings.pages.card.create_card`)),1)]))}}),u=l;export{u as b}; \ No newline at end of file diff --git a/assets/CardCreationDialog-C2t6nzce.js b/assets/CardCreationDialog-C2t6nzce.js deleted file mode 100644 index bd141837d7ac373b243a6094b34f0d485e8e5d0e..0000000000000000000000000000000000000000 --- a/assets/CardCreationDialog-C2t6nzce.js +++ /dev/null @@ -1 +0,0 @@ -import{b as e}from"./CardCreationDialog-vXdEoAe9.js";export{e as default}; \ No newline at end of file diff --git a/assets/CardCreationDialog-DBoOEet-.js b/assets/CardCreationDialog-DBoOEet-.js new file mode 100644 index 0000000000000000000000000000000000000000..6af58fd229f5882b899495c34f58718415d242f3 --- /dev/null +++ b/assets/CardCreationDialog-DBoOEet-.js @@ -0,0 +1,3 @@ +import{a8 as e,aK as t,af as n,ar as r,av as i,d as a,d6 as o,d7 as s,d8 as c,d9 as l,dC as ee,dF as u,dI as d,dK as f,dN as p,dO as m,dQ as h,dU as g,dc as _,de as v,df as y,di as te,dj as ne,do as re,dp as b,dt as x,dx as S,dy as C,h as w,l as T,m as E,o as D,x as ie}from"./index-TXtvn0DM.js";var O=h((exports,t)=>{function n(e){return e.toLowerCase()}t.exports=n}),k=h((exports,t)=>{var n=O();t.exports=n}),A=h((exports,t)=>{function n(e,t,n){return e.replace(t,n)}t.exports=n}),j=h((exports,t)=>{var n=A();t.exports=n}),M=h((exports,t)=>{var n=String.prototype.trim!==void 0;t.exports=n}),N=h((exports,t)=>{var n=String.prototype.trim;t.exports=n}),P=h((exports,t)=>{var n=N(),r=` + \r +\f\v            \u2028\u2029   `,i=`᠎`;function a(){return n.call(r)===``&&n.call(i)===i}t.exports=a}),F=h((exports,t)=>{var n=j(),r=/^[\u0020\f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]*([\S\s]*?)[\u0020\f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]*$/;function i(e){return n(e,r,`$1`)}t.exports=i}),I=h((exports,t)=>{var n=N();function r(e){return n.call(e)}t.exports=r}),L=h((exports,t)=>{var n=M(),r=P(),i=F(),a=I(),o;o=n&&r()?a:i,t.exports=o}),R=h((exports,t)=>{var n=k(),r=j(),i=L(),a=/\s+/g,o=/[!"'(),–.:;<>?`{}|~\/\\\[\]_#$*&^@%]+/g,s=/([a-z0-9])([A-Z])/g;function c(e){return e=r(e,o,` `),e=r(e,s,`$1 $2`),e=i(e),e=r(e,a,`-`),n(e)}t.exports=c}),z=h((exports,t)=>{var n=R();t.exports=n}),B=g(z());const V={class:`w-full flex flex-col gap-5`},H={class:`mt-4`},U={class:`border-b border-neutral-200 dark:border-neutral-700`},W={class:`flex justify-center -mb-px sm:justify-start space-x-1`},G=[`onClick`],K={class:`flex items-center gap-1`},ae={key:0,class:`w-full rounded-xl bg-red900`},oe={class:`w-full p-4`},se={key:1,class:`tab-content ml-auto mr-auto w-95%`},ce={class:`mb-3`},le={class:`input-list ml-auto mr-auto w-90% flex flex-row flex-wrap justify-center gap-8`},ue={key:2,class:`tab-content ml-auto mr-auto w-95%`},de={class:`input-list ml-auto mr-auto w-90% flex flex-row flex-wrap justify-center gap-8`},fe={key:3,class:`tab-content ml-auto mr-auto w-95%`},pe={class:`input-list ml-auto mr-auto w-90% flex flex-row flex-wrap justify-center gap-8`},me={class:`ml-auto mr-1 flex flex-row gap-2`};var q=o({__name:`CardCreationDialog`,props:_({modelValue:{type:Boolean}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:_([`update:modelValue`],[`update:modelValue`]),setup(t,{emit:o}){let h=o,g=ne(t,`modelValue`),{t:_}=e(),O=ie(),k=f(``),A=[{id:`identity`,label:_(`settings.pages.card.creation.identity`),icon:`i-solar:emoji-funny-square-bold-duotone`},{id:`behavior`,label:_(`settings.pages.card.creation.behavior`),icon:`i-solar:chat-round-line-bold-duotone`},{id:`settings`,label:_(`settings.pages.card.creation.settings`),icon:`i-solar:settings-bold-duotone`}],j=b({get:()=>A.find(e=>e.id===k.value)?k.value:A[0]?.id||``,set:e=>{k.value=e}}),M=f(!1),N=f(``);function P(e){let t=ee(e);if(t.name.length>0)if(/^(?:\d+\.)+\d+$/.test(t.version))if(t.description.length>0)if(t.personality.length>0)if(t.scenario.length>0)if(t.systemPrompt.length>0){if(!(t.postHistoryInstructions.length>0))return M.value=!0,N.value=_(`settings.pages.card.creation.errors.posthistoryinstructions`),!1}else return M.value=!0,N.value=_(`settings.pages.card.creation.errors.systemprompt`),!1;else return M.value=!0,N.value=_(`settings.pages.card.creation.errors.scenario`),!1;else return M.value=!0,N.value=_(`settings.pages.card.creation.errors.personality`),!1;else return M.value=!0,N.value=_(`settings.pages.card.creation.errors.description`),!1;else return M.value=!0,N.value=_(`settings.pages.card.creation.errors.version`),!1;else return M.value=!0,N.value=_(`settings.pages.card.creation.errors.name`),!1;return M.value=!1,O.addCard(t),g.value=!1,!0}let F=f({name:_(`settings.pages.card.creation.defaults.name`),nickname:void 0,version:`1.0`,description:``,notes:void 0,personality:_(`settings.pages.card.creation.defaults.personality`),scenario:_(`settings.pages.card.creation.defaults.scenario`),systemPrompt:_(`settings.pages.card.creation.defaults.systemprompt`),postHistoryInstructions:_(`settings.pages.card.creation.defaults.posthistoryinstructions`),greetings:[],messageExample:[]});function I(e,t){return b({get:()=>F.value[e]??``,set:n=>{let r=n.trim();F.value[e]=r.length>0?t?t(r):r:``}})}let L=I(`name`,e=>(0,B.default)(e)),R=I(`nickname`),z=I(`description`),q=I(`notes`),J=I(`personality`),Y=I(`scenario`),X=b({get:()=>F.value.greetings??[],set:e=>{F.value.greetings=e||[]}}),Z=I(`version`),Q=I(`systemPrompt`),$=I(`postHistoryInstructions`);return(e,t)=>(S(),te(u(E),{open:g.value,"onUpdate:open":t[12]||=e=>h(`update:modelValue`,e)},{default:c(()=>[x(u(T),null,{default:c(()=>[x(u(w),{class:`data-[state=open]:animate-fadeIn data-[state=closed]:animate-fadeOut fixed inset-0 z-100 bg-black/50 backdrop-blur-sm`}),x(u(D),{class:`data-[state=open]:animate-contentShow data-[state=closed]:animate-contentHide fixed left-1/2 top-1/2 z-100 m-0 max-h-[90vh] max-w-6xl w-[92vw] flex flex-col overflow-auto border border-neutral-200 rounded-xl bg-white p-5 shadow-xl 2xl:w-[60vw] lg:w-[80vw] md:w-[85vw] xl:w-[70vw] -translate-x-1/2 -translate-y-1/2 dark:border-neutral-700 dark:bg-neutral-800 sm:p-6`},{default:c(()=>[v(`div`,V,[x(u(a),{"text-2xl":``,"font-normal":``,class:`from-primary-500 to-primary-400 bg-gradient-to-r bg-clip-text text-transparent`},{default:c(()=>[C(p(u(_)(`settings.pages.card.create_card`)),1)]),_:1}),v(`div`,H,[v(`div`,U,[v(`div`,W,[(S(),l(re,null,y(A,e=>v(`button`,{key:e.id,class:m([`px-4 py-2 text-sm font-medium`,[j.value===e.id?`text-primary-600 dark:text-primary-400 border-b-2 border-primary-500 dark:border-primary-400`:`text-neutral-500 dark:text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-300`]]),onClick:t=>j.value=e.id},[v(`div`,K,[v(`div`,{class:m(e.icon)},null,2),C(` `+p(e.label),1)])],10,G)),64))])])]),M.value?(S(),l(`div`,ae,[v(`p`,oe,p(N.value),1)])):s(``,!0),j.value===`identity`?(S(),l(`div`,se,[v(`p`,ce,p(u(_)(`settings.pages.card.creation.fields_info.subtitle`)),1),v(`div`,le,[x(u(i),{modelValue:u(L),"onUpdate:modelValue":t[0]||=e=>d(L)?L.value=e:null,label:u(_)(`settings.pages.card.creation.name`),description:u(_)(`settings.pages.card.creation.fields_info.name`),required:!0},null,8,[`modelValue`,`label`,`description`]),x(u(i),{modelValue:u(R),"onUpdate:modelValue":t[1]||=e=>d(R)?R.value=e:null,label:u(_)(`settings.pages.card.creation.nickname`),description:u(_)(`settings.pages.card.creation.fields_info.nickname`)},null,8,[`modelValue`,`label`,`description`]),x(u(i),{modelValue:u(z),"onUpdate:modelValue":t[2]||=e=>d(z)?z.value=e:null,label:u(_)(`settings.pages.card.creation.description`),"single-line":!1,required:!0,description:u(_)(`settings.pages.card.creation.fields_info.description`)},null,8,[`modelValue`,`label`,`description`]),x(u(i),{modelValue:u(q),"onUpdate:modelValue":t[3]||=e=>d(q)?q.value=e:null,label:u(_)(`settings.pages.card.creator_notes`),"single-line":!1,description:u(_)(`settings.pages.card.creation.fields_info.notes`)},null,8,[`modelValue`,`label`,`description`])])])):j.value===`behavior`?(S(),l(`div`,ue,[v(`div`,de,[x(u(i),{modelValue:u(J),"onUpdate:modelValue":t[4]||=e=>d(J)?J.value=e:null,label:u(_)(`settings.pages.card.personality`),"single-line":!1,required:!0,description:u(_)(`settings.pages.card.creation.fields_info.personality`)},null,8,[`modelValue`,`label`,`description`]),x(u(i),{modelValue:u(Y),"onUpdate:modelValue":t[5]||=e=>d(Y)?Y.value=e:null,label:u(_)(`settings.pages.card.scenario`),"single-line":!1,required:!0,description:u(_)(`settings.pages.card.creation.fields_info.scenario`)},null,8,[`modelValue`,`label`,`description`]),x(u(r),{modelValue:X.value,"onUpdate:modelValue":t[6]||=e=>X.value=e,label:u(_)(`settings.pages.card.creation.greetings`),description:u(_)(`settings.pages.card.creation.fields_info.greetings`)},null,8,[`modelValue`,`label`,`description`])])])):j.value===`settings`?(S(),l(`div`,fe,[v(`div`,pe,[x(u(i),{modelValue:u(Q),"onUpdate:modelValue":t[7]||=e=>d(Q)?Q.value=e:null,label:u(_)(`settings.pages.card.systemprompt`),"single-line":!1,required:!0,description:u(_)(`settings.pages.card.creation.fields_info.systemprompt`)},null,8,[`modelValue`,`label`,`description`]),x(u(i),{modelValue:u($),"onUpdate:modelValue":t[8]||=e=>d($)?$.value=e:null,label:u(_)(`settings.pages.card.posthistoryinstructions`),"single-line":!1,required:!0,description:u(_)(`settings.pages.card.creation.fields_info.posthistoryinstructions`)},null,8,[`modelValue`,`label`,`description`]),x(u(i),{modelValue:u(Z),"onUpdate:modelValue":t[9]||=e=>d(Z)?Z.value=e:null,label:u(_)(`settings.pages.card.creation.version`),required:!0,description:u(_)(`settings.pages.card.creation.fields_info.version`)},null,8,[`modelValue`,`label`,`description`])])])):s(``,!0),v(`div`,me,[x(u(n),{variant:`secondary`,icon:`i-solar:undo-left-bold-duotone`,label:u(_)(`settings.pages.card.cancel`),disabled:!1,onClick:t[10]||=e=>g.value=!1},null,8,[`label`]),x(u(n),{variant:`primary`,icon:`i-solar:check-circle-bold-duotone`,label:u(_)(`settings.pages.card.creation.create`),disabled:!1,onClick:t[11]||=e=>P(F.value)},null,8,[`label`])])])]),_:1})]),_:1})]),_:1},8,[`open`]))}}),J=t(q,[[`__scopeId`,`data-v-c19882e9`]]);export{J as b}; \ No newline at end of file diff --git a/assets/CardCreationDialog-DNJ23ym3.js b/assets/CardCreationDialog-DNJ23ym3.js new file mode 100644 index 0000000000000000000000000000000000000000..e34968a3688497e7f70016453ce3ba10c9968ce7 --- /dev/null +++ b/assets/CardCreationDialog-DNJ23ym3.js @@ -0,0 +1 @@ +import{b as e}from"./CardCreationDialog-DBoOEet-.js";export{e as default}; \ No newline at end of file diff --git a/assets/CardCreationDialog-vXdEoAe9.js b/assets/CardCreationDialog-vXdEoAe9.js deleted file mode 100644 index 903be74e0f3c1e952169ed84909de9088e54aefc..0000000000000000000000000000000000000000 --- a/assets/CardCreationDialog-vXdEoAe9.js +++ /dev/null @@ -1,3 +0,0 @@ -import{a8 as e,aK as t,af as n,ar as r,av as i,d as a,d9 as o,dA as s,dD as c,dG as l,dI as u,dN as d,dO as f,dQ as p,dU as m,da as h,de as g,di as _,dj as v,dm as y,dn as b,do as x,dp as S,ds as C,du as w,dv as T,dy as E,dz as D,h as O,l as k,m as A,o as ee,x as te}from"./index-Bcb2irKh.js";var j=p((exports,t)=>{function n(e){return e.toLowerCase()}t.exports=n}),M=p((exports,t)=>{var n=j();t.exports=n}),N=p((exports,t)=>{function n(e,t,n){return e.replace(t,n)}t.exports=n}),P=p((exports,t)=>{var n=N();t.exports=n}),F=p((exports,t)=>{var n=String.prototype.trim!==void 0;t.exports=n}),I=p((exports,t)=>{var n=String.prototype.trim;t.exports=n}),L=p((exports,t)=>{var n=I(),r=` - \r -\f\v            \u2028\u2029   `,i=`᠎`;function a(){return n.call(r)===``&&n.call(i)===i}t.exports=a}),R=p((exports,t)=>{var n=P(),r=/^[\u0020\f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]*([\S\s]*?)[\u0020\f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]*$/;function i(e){return n(e,r,`$1`)}t.exports=i}),z=p((exports,t)=>{var n=I();function r(e){return n.call(e)}t.exports=r}),B=p((exports,t)=>{var n=F(),r=L(),i=R(),a=z(),o;o=n&&r()?a:i,t.exports=o}),V=p((exports,t)=>{var n=M(),r=P(),i=B(),a=/\s+/g,o=/[!"'(),–.:;<>?`{}|~\/\\\[\]_#$*&^@%]+/g,s=/([a-z0-9])([A-Z])/g;function c(e){return e=r(e,o,` `),e=r(e,s,`$1 $2`),e=i(e),e=r(e,a,`-`),n(e)}t.exports=c}),H=p((exports,t)=>{var n=V();t.exports=n}),U=m(H());const W={class:`w-full flex flex-col gap-5`},G={class:`mt-4`},K={class:`border-b border-neutral-200 dark:border-neutral-700`},ne={class:`flex justify-center -mb-px sm:justify-start space-x-1`},re=[`onClick`],ie={class:`flex items-center gap-1`},ae={key:0,class:`w-full rounded-xl bg-red900`},oe={class:`w-full p-4`},se={key:1,class:`tab-content ml-auto mr-auto w-95%`},ce={class:`mb-3`},le={class:`input-list ml-auto mr-auto w-90% flex flex-row flex-wrap justify-center gap-8`},ue={key:2,class:`tab-content ml-auto mr-auto w-95%`},de={class:`input-list ml-auto mr-auto w-90% flex flex-row flex-wrap justify-center gap-8`},fe={key:3,class:`tab-content ml-auto mr-auto w-95%`},pe={class:`input-list ml-auto mr-auto w-90% flex flex-row flex-wrap justify-center gap-8`},me={class:`ml-auto mr-1 flex flex-row gap-2`};var q=y({__name:`CardCreationDialog`,props:C({modelValue:{type:Boolean}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:C([`update:modelValue`],[`update:modelValue`]),setup(t,{emit:p}){let m=p,y=D(t,`modelValue`),{t:C}=e(),j=te(),M=u(``),N=[{id:`identity`,label:C(`settings.pages.card.creation.identity`),icon:`i-solar:emoji-funny-square-bold-duotone`},{id:`behavior`,label:C(`settings.pages.card.creation.behavior`),icon:`i-solar:chat-round-line-bold-duotone`},{id:`settings`,label:C(`settings.pages.card.creation.settings`),icon:`i-solar:settings-bold-duotone`}],P=h({get:()=>N.find(e=>e.id===M.value)?M.value:N[0]?.id||``,set:e=>{M.value=e}}),F=u(!1),I=u(``);function L(e){let t=s(e);if(t.name.length>0)if(/^(?:\d+\.)+\d+$/.test(t.version))if(t.description.length>0)if(t.personality.length>0)if(t.scenario.length>0)if(t.systemPrompt.length>0){if(!(t.postHistoryInstructions.length>0))return F.value=!0,I.value=C(`settings.pages.card.creation.errors.posthistoryinstructions`),!1}else return F.value=!0,I.value=C(`settings.pages.card.creation.errors.systemprompt`),!1;else return F.value=!0,I.value=C(`settings.pages.card.creation.errors.scenario`),!1;else return F.value=!0,I.value=C(`settings.pages.card.creation.errors.personality`),!1;else return F.value=!0,I.value=C(`settings.pages.card.creation.errors.description`),!1;else return F.value=!0,I.value=C(`settings.pages.card.creation.errors.version`),!1;else return F.value=!0,I.value=C(`settings.pages.card.creation.errors.name`),!1;return F.value=!1,j.addCard(t),y.value=!1,!0}let R=u({name:C(`settings.pages.card.creation.defaults.name`),nickname:void 0,version:`1.0`,description:``,notes:void 0,personality:C(`settings.pages.card.creation.defaults.personality`),scenario:C(`settings.pages.card.creation.defaults.scenario`),systemPrompt:C(`settings.pages.card.creation.defaults.systemprompt`),postHistoryInstructions:C(`settings.pages.card.creation.defaults.posthistoryinstructions`),greetings:[],messageExample:[]});function z(e,t){return h({get:()=>R.value[e]??``,set:n=>{let r=n.trim();R.value[e]=r.length>0?t?t(r):r:``}})}let B=z(`name`,e=>(0,U.default)(e)),V=z(`nickname`),H=z(`description`),q=z(`notes`),J=z(`personality`),Y=z(`scenario`),X=h({get:()=>R.value.greetings??[],set:e=>{R.value.greetings=e||[]}}),Z=z(`version`),Q=z(`systemPrompt`),$=z(`postHistoryInstructions`);return(e,t)=>(_(),E(c(A),{open:y.value,"onUpdate:open":t[12]||=e=>m(`update:modelValue`,e)},{default:x(()=>[g(c(k),null,{default:x(()=>[g(c(O),{class:`data-[state=open]:animate-fadeIn data-[state=closed]:animate-fadeOut fixed inset-0 z-100 bg-black/50 backdrop-blur-sm`}),g(c(ee),{class:`data-[state=open]:animate-contentShow data-[state=closed]:animate-contentHide fixed left-1/2 top-1/2 z-100 m-0 max-h-[90vh] max-w-6xl w-[92vw] flex flex-col overflow-auto border border-neutral-200 rounded-xl bg-white p-5 shadow-xl 2xl:w-[60vw] lg:w-[80vw] md:w-[85vw] xl:w-[70vw] -translate-x-1/2 -translate-y-1/2 dark:border-neutral-700 dark:bg-neutral-800 sm:p-6`},{default:x(()=>[w(`div`,W,[g(c(a),{"text-2xl":``,"font-normal":``,class:`from-primary-500 to-primary-400 bg-gradient-to-r bg-clip-text text-transparent`},{default:x(()=>[v(d(c(C)(`settings.pages.card.create_card`)),1)]),_:1}),w(`div`,G,[w(`div`,K,[w(`div`,ne,[(_(),S(o,null,T(N,e=>w(`button`,{key:e.id,class:f([`px-4 py-2 text-sm font-medium`,[P.value===e.id?`text-primary-600 dark:text-primary-400 border-b-2 border-primary-500 dark:border-primary-400`:`text-neutral-500 dark:text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-300`]]),onClick:t=>P.value=e.id},[w(`div`,ie,[w(`div`,{class:f(e.icon)},null,2),v(` `+d(e.label),1)])],10,re)),64))])])]),F.value?(_(),S(`div`,ae,[w(`p`,oe,d(I.value),1)])):b(``,!0),P.value===`identity`?(_(),S(`div`,se,[w(`p`,ce,d(c(C)(`settings.pages.card.creation.fields_info.subtitle`)),1),w(`div`,le,[g(c(i),{modelValue:c(B),"onUpdate:modelValue":t[0]||=e=>l(B)?B.value=e:null,label:c(C)(`settings.pages.card.creation.name`),description:c(C)(`settings.pages.card.creation.fields_info.name`),required:!0},null,8,[`modelValue`,`label`,`description`]),g(c(i),{modelValue:c(V),"onUpdate:modelValue":t[1]||=e=>l(V)?V.value=e:null,label:c(C)(`settings.pages.card.creation.nickname`),description:c(C)(`settings.pages.card.creation.fields_info.nickname`)},null,8,[`modelValue`,`label`,`description`]),g(c(i),{modelValue:c(H),"onUpdate:modelValue":t[2]||=e=>l(H)?H.value=e:null,label:c(C)(`settings.pages.card.creation.description`),"single-line":!1,required:!0,description:c(C)(`settings.pages.card.creation.fields_info.description`)},null,8,[`modelValue`,`label`,`description`]),g(c(i),{modelValue:c(q),"onUpdate:modelValue":t[3]||=e=>l(q)?q.value=e:null,label:c(C)(`settings.pages.card.creator_notes`),"single-line":!1,description:c(C)(`settings.pages.card.creation.fields_info.notes`)},null,8,[`modelValue`,`label`,`description`])])])):P.value===`behavior`?(_(),S(`div`,ue,[w(`div`,de,[g(c(i),{modelValue:c(J),"onUpdate:modelValue":t[4]||=e=>l(J)?J.value=e:null,label:c(C)(`settings.pages.card.personality`),"single-line":!1,required:!0,description:c(C)(`settings.pages.card.creation.fields_info.personality`)},null,8,[`modelValue`,`label`,`description`]),g(c(i),{modelValue:c(Y),"onUpdate:modelValue":t[5]||=e=>l(Y)?Y.value=e:null,label:c(C)(`settings.pages.card.scenario`),"single-line":!1,required:!0,description:c(C)(`settings.pages.card.creation.fields_info.scenario`)},null,8,[`modelValue`,`label`,`description`]),g(c(r),{modelValue:X.value,"onUpdate:modelValue":t[6]||=e=>X.value=e,label:c(C)(`settings.pages.card.creation.greetings`),description:c(C)(`settings.pages.card.creation.fields_info.greetings`)},null,8,[`modelValue`,`label`,`description`])])])):P.value===`settings`?(_(),S(`div`,fe,[w(`div`,pe,[g(c(i),{modelValue:c(Q),"onUpdate:modelValue":t[7]||=e=>l(Q)?Q.value=e:null,label:c(C)(`settings.pages.card.systemprompt`),"single-line":!1,required:!0,description:c(C)(`settings.pages.card.creation.fields_info.systemprompt`)},null,8,[`modelValue`,`label`,`description`]),g(c(i),{modelValue:c($),"onUpdate:modelValue":t[8]||=e=>l($)?$.value=e:null,label:c(C)(`settings.pages.card.posthistoryinstructions`),"single-line":!1,required:!0,description:c(C)(`settings.pages.card.creation.fields_info.posthistoryinstructions`)},null,8,[`modelValue`,`label`,`description`]),g(c(i),{modelValue:c(Z),"onUpdate:modelValue":t[9]||=e=>l(Z)?Z.value=e:null,label:c(C)(`settings.pages.card.creation.version`),required:!0,description:c(C)(`settings.pages.card.creation.fields_info.version`)},null,8,[`modelValue`,`label`,`description`])])])):b(``,!0),w(`div`,me,[g(c(n),{variant:`secondary`,icon:`i-solar:undo-left-bold-duotone`,label:c(C)(`settings.pages.card.cancel`),disabled:!1,onClick:t[10]||=e=>y.value=!1},null,8,[`label`]),g(c(n),{variant:`primary`,icon:`i-solar:check-circle-bold-duotone`,label:c(C)(`settings.pages.card.creation.create`),disabled:!1,onClick:t[11]||=e=>L(R.value)},null,8,[`label`])])])]),_:1})]),_:1})]),_:1},8,[`open`]))}}),J=t(q,[[`__scopeId`,`data-v-c19882e9`]]);export{J as b}; \ No newline at end of file diff --git a/assets/CardDetailDialog-C5NS6yu5.js b/assets/CardDetailDialog-C5NS6yu5.js deleted file mode 100644 index c86c31190cdd24329a8eb868ac2d25d53e4ec964..0000000000000000000000000000000000000000 --- a/assets/CardDetailDialog-C5NS6yu5.js +++ /dev/null @@ -1 +0,0 @@ -import"./DeleteCardDialog-CfSwu3w5.js";import{b as e}from"./CardDetailDialog-PAuW-O48.js";export{e as default}; \ No newline at end of file diff --git a/assets/CardDetailDialog-PAuW-O48.js b/assets/CardDetailDialog-CTqSCcym.js similarity index 55% rename from assets/CardDetailDialog-PAuW-O48.js rename to assets/CardDetailDialog-CTqSCcym.js index 598e901f0334456a7d3fd3ed28ca77276b12c9a2..cb9c3793f896df1c3820c133e55a9290f67640ad 100644 --- a/assets/CardDetailDialog-PAuW-O48.js +++ b/assets/CardDetailDialog-CTqSCcym.js @@ -1 +1 @@ -import{a8 as e,aR as t,af as ee,d as te,d9 as n,dD as r,dI as i,dN as a,dO as o,da as s,de as c,di as l,dj as u,dm as d,dn as f,do as p,dp as m,du as h,dv as g,h as ne,l as _,m as v,o as re,x as ie}from"./index-Bcb2irKh.js";import{b as ae}from"./DeleteCardDialog-CfSwu3w5.js";const oe={key:0,class:`w-full flex flex-col gap-5`},se={flex:`~ col`,"gap-3":``},ce={flex:`~ row`,"items-center":``,"justify-between":``},le={flex:`~ row`,"items-center":``,"gap-2":``},ue={key:0,class:`flex items-center gap-1 rounded-full bg-primary-100 px-2 py-0.5 text-xs text-primary-600 font-medium dark:bg-primary-900/40 dark:text-primary-400`},de={"mt-1":``,"text-sm":``,"text-neutral-500":``,"dark:text-neutral-400":``},fe={"font-medium":``},pe={flex:`~ row`,"gap-2":``},me={class:`mt-4`},he={class:`border-b border-neutral-200 dark:border-neutral-700`},y={class:`flex justify-center -mb-px sm:justify-start space-x-1`},b=[`onClick`],x={class:`flex items-center gap-1`},S={key:0},C=[`innerHTML`],w={key:1},T=[`innerHTML`],E={key:2},D={flex:`~ col`,"max-h-60":``,"gap-4":``,"overflow-auto":``,"pr-1":``,"sm:max-h-80":``},O={key:0,flex:`~ col`,"gap-2":``},k={"text-lg":``,"text-neutral-500":``,"font-medium":``,"dark:text-neutral-400":``},A=[`innerHTML`],j={key:3},M={grid:`~ cols-1 sm:cols-3`,"gap-4":``},N={flex:`~ col`,bg:`white/60 dark:black/30`,"gap-1":``,"rounded-lg":``,"p-3":``,border:`~ neutral-200/50 dark:neutral-700/30`,transition:`all duration-200`,hover:`bg-white/80 dark:bg-black/40`},P={flex:`~ row`,"items-center":``,"gap-2":``,"text-sm":``,"text-neutral-500":``,"dark:text-neutral-400":``},F={truncate:``,"font-medium":``},I={flex:`~ col`,bg:`white/60 dark:black/30`,"gap-2":``,"rounded-lg":``,"p-3":``,border:`~ neutral-200/50 dark:neutral-700/30`,transition:`all duration-200`,hover:`bg-white/80 dark:bg-black/40`},L={flex:`~ row`,"items-center":``,"gap-2":``,"text-sm":``,"text-neutral-500":``,"dark:text-neutral-400":``},ge={truncate:``,"font-medium":``},_e={flex:`~ col`,bg:`white/60 dark:black/30`,"gap-2":``,"rounded-lg":``,"p-3":``,border:`~ neutral-200/50 dark:neutral-700/30`,transition:`all duration-200`,hover:`bg-white/80 dark:bg-black/40`},ve={flex:`~ row`,"items-center":``,"gap-2":``,"text-sm":``,"text-neutral-500":``,"dark:text-neutral-400":``},ye={truncate:``,"font-medium":``},be={key:1,bg:`neutral-50/50 dark:neutral-900/50`,"rounded-xl":``,"p-8":``,"text-center":``,border:`~ neutral-200/50 dark:neutral-700/30`,shadow:`sm`};var R=d({__name:`CardDetailDialog`,props:{modelValue:{type:Boolean},cardId:{}},emits:[`update:modelValue`],setup(d,{emit:R}){let z=d,B=R,{t:V}=e(),H=ie(),{removeCard:xe}=H,{activeCardId:U}=t(H),W=s(()=>{if(z.cardId)return H.getCard(z.cardId)}),G=s(()=>{if(!W.value||!W.value.extensions?.airi?.modules)return{consciousness:``,speech:``,voice:``};let e=W.value.extensions.airi.modules;return{consciousness:e.consciousness?.model||``,speech:e.speech?.model||``,voice:e.speech?.voice_id||``}}),K=s(()=>W.value?{personality:W.value.personality,scenario:W.value.scenario,systemPrompt:W.value.systemPrompt,postHistoryInstructions:W.value.postHistoryInstructions}:{}),q=s(()=>z.cardId===U.value),J=i(!1);function Se(){J.value=!0,setTimeout(()=>{U.value=z.cardId,J.value=!1},300)}function Y(e){return e?.replace(/\{\{(.*?)\}\}/g,`{{ $1 }}`).trim()}let X=i(!1);function Ce(){W.value&&(xe(z.cardId),B(`update:modelValue`,!1)),X.value=!1}let Z=i(``),Q=s(()=>{let e=[];return W.value?.description&&e.push({id:`description`,label:V(`settings.pages.card.description_label`),icon:`i-solar:document-text-linear`}),W.value?.notes&&e.push({id:`notes`,label:V(`settings.pages.card.creator_notes`),icon:`i-solar:notes-linear`}),Object.values(K.value).some(e=>!!e)&&e.push({id:`character`,label:V(`settings.pages.card.character`),icon:`i-solar:user-rounded-linear`}),e.push({id:`modules`,label:V(`settings.pages.card.modules`),icon:`i-solar:tuning-square-linear`}),e}),$=s({get:()=>Q.value.find(e=>e.id===Z.value)?Z.value:Q.value[0]?.id||``,set:e=>{Z.value=e}});return(e,t)=>(l(),m(n,null,[c(r(v),{open:e.modelValue,"onUpdate:open":t[0]||=e=>B(`update:modelValue`,e)},{default:p(()=>[c(r(_),null,{default:p(()=>[c(r(ne),{class:`data-[state=open]:animate-fadeIn data-[state=closed]:animate-fadeOut fixed inset-0 z-100 bg-black/50 backdrop-blur-sm`}),c(r(re),{class:`data-[state=open]:animate-contentShow data-[state=closed]:animate-contentHide fixed left-1/2 top-1/2 z-100 m-0 max-h-[90vh] max-w-6xl w-[92vw] flex flex-col overflow-auto border border-neutral-200 rounded-xl bg-white p-5 shadow-xl 2xl:w-[60vw] lg:w-[80vw] md:w-[85vw] xl:w-[70vw] -translate-x-1/2 -translate-y-1/2 dark:border-neutral-700 dark:bg-neutral-800 sm:p-6`},{default:p(()=>[W.value?(l(),m(`div`,oe,[h(`div`,se,[h(`div`,ce,[h(`div`,null,[h(`div`,le,[c(r(te),{"text-2xl":``,"font-normal":``,class:`from-primary-500 to-primary-400 bg-gradient-to-r bg-clip-text text-transparent`},{default:p(()=>[u(a(W.value.name),1)]),_:1}),q.value?(l(),m(`div`,ue,[t[3]||=h(`div`,{"i-solar:check-circle-bold-duotone":``,"text-xs":``},null,-1),u(` `+a(r(V)(`settings.pages.card.active_badge`)),1)])):f(``,!0)]),h(`div`,de,[u(` v`+a(W.value.version)+` `,1),W.value.creator?(l(),m(n,{key:0},[u(` · `+a(r(V)(`settings.pages.card.created_by`))+` `,1),h(`span`,fe,a(W.value.creator),1)],64)):f(``,!0)])]),h(`div`,pe,[c(r(ee),{variant:`primary`,icon:q.value?`i-solar:check-circle-bold-duotone`:`i-solar:play-circle-broken`,label:q.value?r(V)(`settings.pages.card.active`):r(V)(`settings.pages.card.activate`),disabled:q.value,class:o({"animate-pulse":J.value}),onClick:Se},null,8,[`icon`,`label`,`disabled`,`class`])])]),h(`div`,me,[h(`div`,he,[h(`div`,y,[(l(!0),m(n,null,g(Q.value,e=>(l(),m(`button`,{key:e.id,class:o([`px-4 py-2 text-sm font-medium`,[$.value===e.id?`text-primary-600 dark:text-primary-400 border-b-2 border-primary-500 dark:border-primary-400`:`text-neutral-500 dark:text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-300`]]),onClick:t=>$.value=e.id},[h(`div`,x,[h(`div`,{class:o(e.icon)},null,2),u(` `+a(e.label),1)])],10,b))),128))])])]),$.value===`notes`&&W.value.notes?(l(),m(`div`,S,[h(`div`,{bg:`white/60 dark:black/30`,border:`~ neutral-200/50 dark:neutral-700/30`,"max-h-60":``,"overflow-auto":``,"whitespace-pre-line":``,"rounded-lg":``,"p-4":``,"text-neutral-700":``,"sm:max-h-80":``,"dark:text-neutral-300":``,transition:`all duration-200`,hover:`bg-white/80 dark:bg-black/40`,innerHTML:Y(W.value.notes)},null,8,C)])):f(``,!0),$.value===`description`&&W.value.description?(l(),m(`div`,w,[h(`div`,{bg:`white/60 dark:black/30`,"max-h-60":``,"overflow-auto":``,"whitespace-pre-line":``,"rounded-lg":``,"p-4":``,"sm:max-h-80":``,text:`neutral-600 dark:neutral-300`,border:`~ neutral-200/50 dark:neutral-700/30`,innerHTML:Y(W.value.description)},null,8,T)])):f(``,!0),$.value===`character`&&Object.values(K.value).some(e=>!!e)?(l(),m(`div`,E,[h(`div`,D,[(l(!0),m(n,null,g(K.value,(e,t)=>(l(),m(n,{key:t},[e?(l(),m(`div`,O,[h(`h2`,k,a(r(V)(`settings.pages.card.${t.toLowerCase()}`)),1),h(`div`,{bg:`white/60 dark:black/30`,border:`~ neutral-200/50 dark:neutral-700/30`,transition:`all duration-200`,hover:`bg-white/80 dark:bg-black/40`,"max-h-none":``,"overflow-auto":``,"whitespace-pre-line":``,"rounded-lg":``,"p-3":``,"text-neutral-700":``,"dark:text-neutral-300":``,innerHTML:Y(e)},null,8,A)])):f(``,!0)],64))),128))])])):f(``,!0),$.value===`modules`?(l(),m(`div`,j,[h(`div`,M,[h(`div`,N,[h(`span`,P,[t[4]||=h(`div`,{"i-lucide:ghost":``},null,-1),u(` `+a(r(V)(`settings.pages.card.consciousness.model`)),1)]),h(`div`,F,a(G.value.consciousness??`default`),1)]),h(`div`,I,[h(`span`,L,[t[5]||=h(`div`,{"i-lucide:mic":``},null,-1),u(` `+a(r(V)(`settings.pages.card.speech.model`)),1)]),h(`div`,ge,a(G.value.speech??`default`),1)]),h(`div`,_e,[h(`span`,ve,[t[6]||=h(`div`,{"i-lucide:music":``},null,-1),u(` `+a(r(V)(`settings.pages.card.speech.voice`)),1)]),h(`div`,ye,a(G.value.voice??`default`),1)])])])):f(``,!0)])])):(l(),m(`div`,be,[t[7]||=h(`div`,{"i-solar:card-search-broken":``,"mx-auto":``,"mb-3":``,"text-6xl":``,"text-neutral-400":``},null,-1),u(` `+a(r(V)(`settings.pages.card.card_not_found`)),1)]))]),_:1})]),_:1})]),_:1},8,[`open`]),c(ae,{modelValue:X.value,"onUpdate:modelValue":t[1]||=e=>X.value=e,"card-name":W.value?.name,onConfirm:Ce,onCancel:t[2]||=e=>X.value=!1},null,8,[`modelValue`,`card-name`])],64))}}),z=R;export{z as b}; \ No newline at end of file +import{a8 as e,aR as t,af as ee,d as te,d6 as n,d7 as r,d8 as i,d9 as a,dF as o,dK as s,dN as c,dO as l,de as u,df as d,do as f,dp as p,dt as m,dx as h,dy as g,h as ne,l as _,m as v,o as re,x as ie}from"./index-TXtvn0DM.js";import{b as ae}from"./DeleteCardDialog-DeUARo5-.js";const oe={key:0,class:`w-full flex flex-col gap-5`},se={flex:`~ col`,"gap-3":``},ce={flex:`~ row`,"items-center":``,"justify-between":``},le={flex:`~ row`,"items-center":``,"gap-2":``},ue={key:0,class:`flex items-center gap-1 rounded-full bg-primary-100 px-2 py-0.5 text-xs text-primary-600 font-medium dark:bg-primary-900/40 dark:text-primary-400`},de={"mt-1":``,"text-sm":``,"text-neutral-500":``,"dark:text-neutral-400":``},fe={"font-medium":``},pe={flex:`~ row`,"gap-2":``},me={class:`mt-4`},he={class:`border-b border-neutral-200 dark:border-neutral-700`},y={class:`flex justify-center -mb-px sm:justify-start space-x-1`},b=[`onClick`],x={class:`flex items-center gap-1`},S={key:0},C=[`innerHTML`],w={key:1},T=[`innerHTML`],E={key:2},D={flex:`~ col`,"max-h-60":``,"gap-4":``,"overflow-auto":``,"pr-1":``,"sm:max-h-80":``},O={key:0,flex:`~ col`,"gap-2":``},k={"text-lg":``,"text-neutral-500":``,"font-medium":``,"dark:text-neutral-400":``},A=[`innerHTML`],j={key:3},M={grid:`~ cols-1 sm:cols-3`,"gap-4":``},N={flex:`~ col`,bg:`white/60 dark:black/30`,"gap-1":``,"rounded-lg":``,"p-3":``,border:`~ neutral-200/50 dark:neutral-700/30`,transition:`all duration-200`,hover:`bg-white/80 dark:bg-black/40`},P={flex:`~ row`,"items-center":``,"gap-2":``,"text-sm":``,"text-neutral-500":``,"dark:text-neutral-400":``},F={truncate:``,"font-medium":``},I={flex:`~ col`,bg:`white/60 dark:black/30`,"gap-2":``,"rounded-lg":``,"p-3":``,border:`~ neutral-200/50 dark:neutral-700/30`,transition:`all duration-200`,hover:`bg-white/80 dark:bg-black/40`},L={flex:`~ row`,"items-center":``,"gap-2":``,"text-sm":``,"text-neutral-500":``,"dark:text-neutral-400":``},ge={truncate:``,"font-medium":``},_e={flex:`~ col`,bg:`white/60 dark:black/30`,"gap-2":``,"rounded-lg":``,"p-3":``,border:`~ neutral-200/50 dark:neutral-700/30`,transition:`all duration-200`,hover:`bg-white/80 dark:bg-black/40`},ve={flex:`~ row`,"items-center":``,"gap-2":``,"text-sm":``,"text-neutral-500":``,"dark:text-neutral-400":``},ye={truncate:``,"font-medium":``},be={key:1,bg:`neutral-50/50 dark:neutral-900/50`,"rounded-xl":``,"p-8":``,"text-center":``,border:`~ neutral-200/50 dark:neutral-700/30`,shadow:`sm`};var R=n({__name:`CardDetailDialog`,props:{modelValue:{type:Boolean},cardId:{}},emits:[`update:modelValue`],setup(n,{emit:R}){let z=n,B=R,{t:V}=e(),H=ie(),{removeCard:xe}=H,{activeCardId:U}=t(H),W=p(()=>{if(z.cardId)return H.getCard(z.cardId)}),G=p(()=>{if(!W.value||!W.value.extensions?.airi?.modules)return{consciousness:``,speech:``,voice:``};let e=W.value.extensions.airi.modules;return{consciousness:e.consciousness?.model||``,speech:e.speech?.model||``,voice:e.speech?.voice_id||``}}),K=p(()=>W.value?{personality:W.value.personality,scenario:W.value.scenario,systemPrompt:W.value.systemPrompt,postHistoryInstructions:W.value.postHistoryInstructions}:{}),q=p(()=>z.cardId===U.value),J=s(!1);function Se(){J.value=!0,setTimeout(()=>{U.value=z.cardId,J.value=!1},300)}function Y(e){return e?.replace(/\{\{(.*?)\}\}/g,`{{ $1 }}`).trim()}let X=s(!1);function Ce(){W.value&&(xe(z.cardId),B(`update:modelValue`,!1)),X.value=!1}let Z=s(``),Q=p(()=>{let e=[];return W.value?.description&&e.push({id:`description`,label:V(`settings.pages.card.description_label`),icon:`i-solar:document-text-linear`}),W.value?.notes&&e.push({id:`notes`,label:V(`settings.pages.card.creator_notes`),icon:`i-solar:notes-linear`}),Object.values(K.value).some(e=>!!e)&&e.push({id:`character`,label:V(`settings.pages.card.character`),icon:`i-solar:user-rounded-linear`}),e.push({id:`modules`,label:V(`settings.pages.card.modules`),icon:`i-solar:tuning-square-linear`}),e}),$=p({get:()=>Q.value.find(e=>e.id===Z.value)?Z.value:Q.value[0]?.id||``,set:e=>{Z.value=e}});return(e,t)=>(h(),a(f,null,[m(o(v),{open:e.modelValue,"onUpdate:open":t[0]||=e=>B(`update:modelValue`,e)},{default:i(()=>[m(o(_),null,{default:i(()=>[m(o(ne),{class:`data-[state=open]:animate-fadeIn data-[state=closed]:animate-fadeOut fixed inset-0 z-100 bg-black/50 backdrop-blur-sm`}),m(o(re),{class:`data-[state=open]:animate-contentShow data-[state=closed]:animate-contentHide fixed left-1/2 top-1/2 z-100 m-0 max-h-[90vh] max-w-6xl w-[92vw] flex flex-col overflow-auto border border-neutral-200 rounded-xl bg-white p-5 shadow-xl 2xl:w-[60vw] lg:w-[80vw] md:w-[85vw] xl:w-[70vw] -translate-x-1/2 -translate-y-1/2 dark:border-neutral-700 dark:bg-neutral-800 sm:p-6`},{default:i(()=>[W.value?(h(),a(`div`,oe,[u(`div`,se,[u(`div`,ce,[u(`div`,null,[u(`div`,le,[m(o(te),{"text-2xl":``,"font-normal":``,class:`from-primary-500 to-primary-400 bg-gradient-to-r bg-clip-text text-transparent`},{default:i(()=>[g(c(W.value.name),1)]),_:1}),q.value?(h(),a(`div`,ue,[t[3]||=u(`div`,{"i-solar:check-circle-bold-duotone":``,"text-xs":``},null,-1),g(` `+c(o(V)(`settings.pages.card.active_badge`)),1)])):r(``,!0)]),u(`div`,de,[g(` v`+c(W.value.version)+` `,1),W.value.creator?(h(),a(f,{key:0},[g(` · `+c(o(V)(`settings.pages.card.created_by`))+` `,1),u(`span`,fe,c(W.value.creator),1)],64)):r(``,!0)])]),u(`div`,pe,[m(o(ee),{variant:`primary`,icon:q.value?`i-solar:check-circle-bold-duotone`:`i-solar:play-circle-broken`,label:q.value?o(V)(`settings.pages.card.active`):o(V)(`settings.pages.card.activate`),disabled:q.value,class:l({"animate-pulse":J.value}),onClick:Se},null,8,[`icon`,`label`,`disabled`,`class`])])]),u(`div`,me,[u(`div`,he,[u(`div`,y,[(h(!0),a(f,null,d(Q.value,e=>(h(),a(`button`,{key:e.id,class:l([`px-4 py-2 text-sm font-medium`,[$.value===e.id?`text-primary-600 dark:text-primary-400 border-b-2 border-primary-500 dark:border-primary-400`:`text-neutral-500 dark:text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-300`]]),onClick:t=>$.value=e.id},[u(`div`,x,[u(`div`,{class:l(e.icon)},null,2),g(` `+c(e.label),1)])],10,b))),128))])])]),$.value===`notes`&&W.value.notes?(h(),a(`div`,S,[u(`div`,{bg:`white/60 dark:black/30`,border:`~ neutral-200/50 dark:neutral-700/30`,"max-h-60":``,"overflow-auto":``,"whitespace-pre-line":``,"rounded-lg":``,"p-4":``,"text-neutral-700":``,"sm:max-h-80":``,"dark:text-neutral-300":``,transition:`all duration-200`,hover:`bg-white/80 dark:bg-black/40`,innerHTML:Y(W.value.notes)},null,8,C)])):r(``,!0),$.value===`description`&&W.value.description?(h(),a(`div`,w,[u(`div`,{bg:`white/60 dark:black/30`,"max-h-60":``,"overflow-auto":``,"whitespace-pre-line":``,"rounded-lg":``,"p-4":``,"sm:max-h-80":``,text:`neutral-600 dark:neutral-300`,border:`~ neutral-200/50 dark:neutral-700/30`,innerHTML:Y(W.value.description)},null,8,T)])):r(``,!0),$.value===`character`&&Object.values(K.value).some(e=>!!e)?(h(),a(`div`,E,[u(`div`,D,[(h(!0),a(f,null,d(K.value,(e,t)=>(h(),a(f,{key:t},[e?(h(),a(`div`,O,[u(`h2`,k,c(o(V)(`settings.pages.card.${t.toLowerCase()}`)),1),u(`div`,{bg:`white/60 dark:black/30`,border:`~ neutral-200/50 dark:neutral-700/30`,transition:`all duration-200`,hover:`bg-white/80 dark:bg-black/40`,"max-h-none":``,"overflow-auto":``,"whitespace-pre-line":``,"rounded-lg":``,"p-3":``,"text-neutral-700":``,"dark:text-neutral-300":``,innerHTML:Y(e)},null,8,A)])):r(``,!0)],64))),128))])])):r(``,!0),$.value===`modules`?(h(),a(`div`,j,[u(`div`,M,[u(`div`,N,[u(`span`,P,[t[4]||=u(`div`,{"i-lucide:ghost":``},null,-1),g(` `+c(o(V)(`settings.pages.card.consciousness.model`)),1)]),u(`div`,F,c(G.value.consciousness??`default`),1)]),u(`div`,I,[u(`span`,L,[t[5]||=u(`div`,{"i-lucide:mic":``},null,-1),g(` `+c(o(V)(`settings.pages.card.speech.model`)),1)]),u(`div`,ge,c(G.value.speech??`default`),1)]),u(`div`,_e,[u(`span`,ve,[t[6]||=u(`div`,{"i-lucide:music":``},null,-1),g(` `+c(o(V)(`settings.pages.card.speech.voice`)),1)]),u(`div`,ye,c(G.value.voice??`default`),1)])])])):r(``,!0)])])):(h(),a(`div`,be,[t[7]||=u(`div`,{"i-solar:card-search-broken":``,"mx-auto":``,"mb-3":``,"text-6xl":``,"text-neutral-400":``},null,-1),g(` `+c(o(V)(`settings.pages.card.card_not_found`)),1)]))]),_:1})]),_:1})]),_:1},8,[`open`]),m(ae,{modelValue:X.value,"onUpdate:modelValue":t[1]||=e=>X.value=e,"card-name":W.value?.name,onConfirm:Ce,onCancel:t[2]||=e=>X.value=!1},null,8,[`modelValue`,`card-name`])],64))}}),z=R;export{z as b}; \ No newline at end of file diff --git a/assets/CardDetailDialog-DrRzlnwS.js b/assets/CardDetailDialog-DrRzlnwS.js new file mode 100644 index 0000000000000000000000000000000000000000..47785ff3de3f3cec3e5a3f1826bb44712958328a --- /dev/null +++ b/assets/CardDetailDialog-DrRzlnwS.js @@ -0,0 +1 @@ +import"./DeleteCardDialog-DeUARo5-.js";import{b as e}from"./CardDetailDialog-CTqSCcym.js";export{e as default}; \ No newline at end of file diff --git a/assets/CardListItem-Zshbg3UA.js b/assets/CardListItem-B9_yTni-.js similarity index 67% rename from assets/CardListItem-Zshbg3UA.js rename to assets/CardListItem-B9_yTni-.js index 6204ae4bfa1c074b4dc354fd42b0a1981a54b25b..bf9d555636a09aedb6861cb33529a63956ccf1aa 100644 --- a/assets/CardListItem-Zshbg3UA.js +++ b/assets/CardListItem-B9_yTni-.js @@ -1 +1 @@ -import{ab as e,d2 as t,dD as n,dN as r,dO as i,di as a,dm as o,dn as s,do as c,dp as l,du as u,dy as d}from"./index-Bcb2irKh.js";const f={relative:``,flex:`~ col 1`,"justify-between":``,"gap-3":``,"overflow-hidden":``,"rounded-lg":``,bg:`white dark:neutral-900`,"p-5":``,transition:`all ease-in-out duration-400`,after:`content-empty absolute inset-0 z--2 w-full h-full bg-dotted-[neutral-200/80] bg-size-10px mask-image-[linear-gradient(165deg,white_30%,transparent_50%)] transition-all duration-400 ease-in-out`,hover:`after:bg-dotted-[primary-300/50] dark:after:bg-dotted-[primary-200/20] text-primary-600/80 dark:text-primary-300/80`},p={"z-1":``,flex:``,"items-start":``,"justify-between":``,"gap-2":``},m={"flex-1":``,truncate:``,"text-lg":``,"font-normal":``},h={key:0,"shrink-0":``,"rounded-md":``,"p-1":``,bg:`primary-100 dark:primary-900/40`,text:`primary-600 dark:primary-400`},g={key:0,"line-clamp-3":``,"min-h-40px":``,"flex-1":``,"text-sm":``,text:`neutral-500 dark:neutral-400`},_={"z-1":``,flex:``,"items-center":``,"justify-between":``,"text-xs":``,text:`neutral-500 dark:neutral-400`},v={flex:``,"items-center":``,"gap-1.5":``},y={flex:``,"items-center":``,"gap-0.5":``},b={flex:``,"items-center":``,"gap-0.5":``},x={flex:``,"items-center":``,"justify-end":``,"px-2":``,"py-1.5":``},S=[`disabled`];var C=o({__name:`CardListItem`,props:{id:{},name:{},description:{},isActive:{type:Boolean},isSelected:{type:Boolean},version:{},consciousnessModel:{},voiceModel:{}},emits:[`select`,`activate`,`delete`],setup(o,{emit:C}){let w=C;return(o,C)=>(a(),d(n(e),{relative:``,"min-h-120px":``,flex:`~ col`,"cursor-pointer":``,"overflow-hidden":``,"rounded-xl":``,class:i([o.isSelected?`border-2 border-primary-400 dark:border-primary-600`:`border-2 border-neutral-100 dark:border-neutral-800/25`]),bg:`neutral-200/50 dark:neutral-800/50`,"drop-shadow":`none hover:[0px_4px_4px_rgba(220,220,220,0.4)] active:[0px_0px_0px_rgba(220,220,220,0.25)] dark:hover:none`,transition:`all ease-in-out duration-400`,before:`content-empty absolute inset-0 z-0 w-25% h-full transition-all duration-400 ease-in-out bg-gradient-to-r from-primary-500/0 to-primary-500/0 dark:from-primary-400/0 dark:to-primary-400/0 mask-image-[linear-gradient(120deg,white_100%)] opacity-0`,hover:`before:opacity-100 before:bg-gradient-to-r before:from-primary-500/20 before:via-primary-500/10 before:to-transparent before:dark:from-primary-400/20 before:dark:via-primary-400/10 before:dark:to-transparent`,onClick:C[2]||=e=>w(`select`)},{default:c(()=>[u(`div`,f,[u(`div`,p,[u(`h3`,m,r(o.name),1),o.isActive?(a(),l(`div`,h,C[3]||=[u(`div`,{"i-solar:check-circle-bold-duotone":``,"text-sm":``},null,-1)])):s(``,!0)]),o.description?(a(),l(`p`,g,r(o.description),1)):s(``,!0),u(`div`,_,[u(`div`,null,`v`+r(o.version),1),u(`div`,v,[u(`div`,y,[C[4]||=u(`div`,{"i-lucide:ghost":``,"text-xs":``},null,-1),u(`span`,null,r(o.consciousnessModel),1)]),u(`div`,b,[C[5]||=u(`div`,{"i-lucide:mic":``,"text-xs":``},null,-1),u(`span`,null,r(o.voiceModel),1)])])])]),u(`div`,x,[u(`button`,{"rounded-lg":``,"p-1.5":``,"transition-colors":``,hover:`bg-neutral-200 dark:bg-neutral-700/50`,disabled:o.isActive,onClick:C[0]||=t(e=>w(`activate`),[`stop`])},[u(`div`,{class:i([o.isActive?`i-solar:check-circle-bold-duotone text-primary-500 dark:text-primary-400`:`i-solar:play-circle-broken text-neutral-500 dark:text-neutral-400`])},null,2)],8,S),o.id===`default`?s(``,!0):(a(),l(`button`,{key:0,"rounded-lg":``,"p-1.5":``,"transition-colors":``,hover:`bg-neutral-200 dark:bg-neutral-700/50`,onClick:C[1]||=t(e=>w(`delete`),[`stop`])},C[6]||=[u(`div`,{"i-solar:trash-bin-trash-linear":``,text:`neutral-500 dark:neutral-400`},null,-1)]))])]),_:1},8,[`class`]))}}),w=C;export{w as b}; \ No newline at end of file +import{ab as e,d3 as t,d6 as n,d7 as r,d8 as i,d9 as a,dF as o,dN as s,dO as c,de as l,di as u,dx as d}from"./index-TXtvn0DM.js";const f={relative:``,flex:`~ col 1`,"justify-between":``,"gap-3":``,"overflow-hidden":``,"rounded-lg":``,bg:`white dark:neutral-900`,"p-5":``,transition:`all ease-in-out duration-400`,after:`content-empty absolute inset-0 z--2 w-full h-full bg-dotted-[neutral-200/80] bg-size-10px mask-image-[linear-gradient(165deg,white_30%,transparent_50%)] transition-all duration-400 ease-in-out`,hover:`after:bg-dotted-[primary-300/50] dark:after:bg-dotted-[primary-200/20] text-primary-600/80 dark:text-primary-300/80`},p={"z-1":``,flex:``,"items-start":``,"justify-between":``,"gap-2":``},m={"flex-1":``,truncate:``,"text-lg":``,"font-normal":``},h={key:0,"shrink-0":``,"rounded-md":``,"p-1":``,bg:`primary-100 dark:primary-900/40`,text:`primary-600 dark:primary-400`},g={key:0,"line-clamp-3":``,"min-h-40px":``,"flex-1":``,"text-sm":``,text:`neutral-500 dark:neutral-400`},_={"z-1":``,flex:``,"items-center":``,"justify-between":``,"text-xs":``,text:`neutral-500 dark:neutral-400`},v={flex:``,"items-center":``,"gap-1.5":``},y={flex:``,"items-center":``,"gap-0.5":``},b={flex:``,"items-center":``,"gap-0.5":``},x={flex:``,"items-center":``,"justify-end":``,"px-2":``,"py-1.5":``},S=[`disabled`];var C=n({__name:`CardListItem`,props:{id:{},name:{},description:{},isActive:{type:Boolean},isSelected:{type:Boolean},version:{},consciousnessModel:{},voiceModel:{}},emits:[`select`,`activate`,`delete`],setup(n,{emit:C}){let w=C;return(n,C)=>(d(),u(o(e),{relative:``,"min-h-120px":``,flex:`~ col`,"cursor-pointer":``,"overflow-hidden":``,"rounded-xl":``,class:c([n.isSelected?`border-2 border-primary-400 dark:border-primary-600`:`border-2 border-neutral-100 dark:border-neutral-800/25`]),bg:`neutral-200/50 dark:neutral-800/50`,"drop-shadow":`none hover:[0px_4px_4px_rgba(220,220,220,0.4)] active:[0px_0px_0px_rgba(220,220,220,0.25)] dark:hover:none`,transition:`all ease-in-out duration-400`,before:`content-empty absolute inset-0 z-0 w-25% h-full transition-all duration-400 ease-in-out bg-gradient-to-r from-primary-500/0 to-primary-500/0 dark:from-primary-400/0 dark:to-primary-400/0 mask-image-[linear-gradient(120deg,white_100%)] opacity-0`,hover:`before:opacity-100 before:bg-gradient-to-r before:from-primary-500/20 before:via-primary-500/10 before:to-transparent before:dark:from-primary-400/20 before:dark:via-primary-400/10 before:dark:to-transparent`,onClick:C[2]||=e=>w(`select`)},{default:i(()=>[l(`div`,f,[l(`div`,p,[l(`h3`,m,s(n.name),1),n.isActive?(d(),a(`div`,h,C[3]||=[l(`div`,{"i-solar:check-circle-bold-duotone":``,"text-sm":``},null,-1)])):r(``,!0)]),n.description?(d(),a(`p`,g,s(n.description),1)):r(``,!0),l(`div`,_,[l(`div`,null,`v`+s(n.version),1),l(`div`,v,[l(`div`,y,[C[4]||=l(`div`,{"i-lucide:ghost":``,"text-xs":``},null,-1),l(`span`,null,s(n.consciousnessModel),1)]),l(`div`,b,[C[5]||=l(`div`,{"i-lucide:mic":``,"text-xs":``},null,-1),l(`span`,null,s(n.voiceModel),1)])])])]),l(`div`,x,[l(`button`,{"rounded-lg":``,"p-1.5":``,"transition-colors":``,hover:`bg-neutral-200 dark:bg-neutral-700/50`,disabled:n.isActive,onClick:C[0]||=t(e=>w(`activate`),[`stop`])},[l(`div`,{class:c([n.isActive?`i-solar:check-circle-bold-duotone text-primary-500 dark:text-primary-400`:`i-solar:play-circle-broken text-neutral-500 dark:text-neutral-400`])},null,2)],8,S),n.id===`default`?r(``,!0):(d(),a(`button`,{key:0,"rounded-lg":``,"p-1.5":``,"transition-colors":``,hover:`bg-neutral-200 dark:bg-neutral-700/50`,onClick:C[1]||=t(e=>w(`delete`),[`stop`])},C[6]||=[l(`div`,{"i-solar:trash-bin-trash-linear":``,text:`neutral-500 dark:neutral-400`},null,-1)]))])]),_:1},8,[`class`]))}}),w=C;export{w as b}; \ No newline at end of file diff --git a/assets/CardListItem-B_X4U4tj.js b/assets/CardListItem-B_X4U4tj.js deleted file mode 100644 index 31f3fd9234122ab09157ea24d8447bdea87b7fe6..0000000000000000000000000000000000000000 --- a/assets/CardListItem-B_X4U4tj.js +++ /dev/null @@ -1 +0,0 @@ -import{b as e}from"./CardListItem-Zshbg3UA.js";export{e as default}; \ No newline at end of file diff --git a/assets/CardListItem-DeblkTcG.js b/assets/CardListItem-DeblkTcG.js new file mode 100644 index 0000000000000000000000000000000000000000..ef118141d1f8c69cc453735a90b19277630f4203 --- /dev/null +++ b/assets/CardListItem-DeblkTcG.js @@ -0,0 +1 @@ +import{b as e}from"./CardListItem-B9_yTni-.js";export{e as default}; \ No newline at end of file diff --git a/assets/DeleteCardDialog-CfSwu3w5.js b/assets/DeleteCardDialog-CfSwu3w5.js deleted file mode 100644 index f435a78c88182c41aa7b7c4b8cb03f8424ad14af..0000000000000000000000000000000000000000 --- a/assets/DeleteCardDialog-CfSwu3w5.js +++ /dev/null @@ -1 +0,0 @@ -import{a8 as e,af as t,c as n,dD as r,dN as i,de as a,di as o,dj as s,dm as c,do as l,du as u,dy as d,e as f,f as p,g as m,i as h,j as g,k as _,n as v}from"./index-Bcb2irKh.js";const y={class:`flex flex-row justify-end gap-3`};var b=c({__name:`DeleteCardDialog`,props:{modelValue:{type:Boolean},cardName:{}},emits:[`update:modelValue`,`confirm`,`cancel`],setup(c,{emit:b}){let x=b,{t:S}=e();function C(){x(`update:modelValue`,!1),x(`cancel`)}function w(){x(`update:modelValue`,!1),x(`confirm`)}return(e,c)=>(o(),d(r(h),{open:e.modelValue,"onUpdate:open":c[0]||=e=>x(`update:modelValue`,e)},{default:l(()=>[a(r(n),null,{default:l(()=>[a(r(_),{class:`data-[state=open]:animate-fadeIn data-[state=closed]:animate-fadeOut fixed inset-0 z-100 bg-black/50`}),a(r(p),{class:`data-[state=open]:animate-contentShow data-[state=closed]:animate-contentHide fixed left-1/2 top-1/2 z-100 max-w-md w-full border border-neutral-200 rounded-xl bg-white p-6 shadow-xl -translate-x-1/2 -translate-y-1/2 dark:border-neutral-700 dark:bg-neutral-800`},{default:l(()=>[a(r(f),{class:`mb-4 text-xl font-normal`},{default:l(()=>[s(i(r(S)(`settings.pages.card.delete_card`)),1)]),_:1}),a(r(m),{class:`mb-6`},{default:l(()=>[s(i(r(S)(`settings.pages.card.delete_confirmation`))+` `,1),u(`b`,null,`"`+i(e.cardName||``)+`"`,1)]),_:1}),u(`div`,y,[a(r(v),{"as-child":``},{default:l(()=>[a(r(t),{variant:`secondary`,label:r(S)(`settings.pages.card.cancel`),onClick:C},null,8,[`label`])]),_:1}),a(r(g),{"as-child":``},{default:l(()=>[a(r(t),{variant:`danger`,label:r(S)(`settings.pages.card.delete`),onClick:w},null,8,[`label`])]),_:1})])]),_:1})]),_:1})]),_:1},8,[`open`]))}}),x=b;export{x as b}; \ No newline at end of file diff --git a/assets/DeleteCardDialog-Cmxl4b8s.js b/assets/DeleteCardDialog-Cmxl4b8s.js deleted file mode 100644 index 6c32d709530a453b591380e1e119163fb87fd7c8..0000000000000000000000000000000000000000 --- a/assets/DeleteCardDialog-Cmxl4b8s.js +++ /dev/null @@ -1 +0,0 @@ -import{b as e}from"./DeleteCardDialog-CfSwu3w5.js";export{e as default}; \ No newline at end of file diff --git a/assets/DeleteCardDialog-Db_k2voK.js b/assets/DeleteCardDialog-Db_k2voK.js new file mode 100644 index 0000000000000000000000000000000000000000..8cd04dd434271b03149167d41c134e9d5378ab8a --- /dev/null +++ b/assets/DeleteCardDialog-Db_k2voK.js @@ -0,0 +1 @@ +import{b as e}from"./DeleteCardDialog-DeUARo5-.js";export{e as default}; \ No newline at end of file diff --git a/assets/DeleteCardDialog-DeUARo5-.js b/assets/DeleteCardDialog-DeUARo5-.js new file mode 100644 index 0000000000000000000000000000000000000000..8b0f1d8e44750579ae61472e028d17886fbf3bc3 --- /dev/null +++ b/assets/DeleteCardDialog-DeUARo5-.js @@ -0,0 +1 @@ +import{a8 as e,af as t,c as n,d6 as r,d8 as i,dF as a,dN as o,de as s,di as c,dt as l,dx as u,dy as d,e as f,f as p,g as m,i as h,j as g,k as _,n as v}from"./index-TXtvn0DM.js";const y={class:`flex flex-row justify-end gap-3`};var b=r({__name:`DeleteCardDialog`,props:{modelValue:{type:Boolean},cardName:{}},emits:[`update:modelValue`,`confirm`,`cancel`],setup(r,{emit:b}){let x=b,{t:S}=e();function C(){x(`update:modelValue`,!1),x(`cancel`)}function w(){x(`update:modelValue`,!1),x(`confirm`)}return(e,r)=>(u(),c(a(h),{open:e.modelValue,"onUpdate:open":r[0]||=e=>x(`update:modelValue`,e)},{default:i(()=>[l(a(n),null,{default:i(()=>[l(a(_),{class:`data-[state=open]:animate-fadeIn data-[state=closed]:animate-fadeOut fixed inset-0 z-100 bg-black/50`}),l(a(p),{class:`data-[state=open]:animate-contentShow data-[state=closed]:animate-contentHide fixed left-1/2 top-1/2 z-100 max-w-md w-full border border-neutral-200 rounded-xl bg-white p-6 shadow-xl -translate-x-1/2 -translate-y-1/2 dark:border-neutral-700 dark:bg-neutral-800`},{default:i(()=>[l(a(f),{class:`mb-4 text-xl font-normal`},{default:i(()=>[d(o(a(S)(`settings.pages.card.delete_card`)),1)]),_:1}),l(a(m),{class:`mb-6`},{default:i(()=>[d(o(a(S)(`settings.pages.card.delete_confirmation`))+` `,1),s(`b`,null,`"`+o(e.cardName||``)+`"`,1)]),_:1}),s(`div`,y,[l(a(v),{"as-child":``},{default:i(()=>[l(a(t),{variant:`secondary`,label:a(S)(`settings.pages.card.cancel`),onClick:C},null,8,[`label`])]),_:1}),l(a(g),{"as-child":``},{default:i(()=>[l(a(t),{variant:`danger`,label:a(S)(`settings.pages.card.delete`),onClick:w},null,8,[`label`])]),_:1})])]),_:1})]),_:1})]),_:1},8,[`open`]))}}),x=b;export{x as b}; \ No newline at end of file diff --git a/assets/HeaderLink-BMtWjY7k.js b/assets/HeaderLink-BMtWjY7k.js new file mode 100644 index 0000000000000000000000000000000000000000..e0957c6ab15c7ad2025fc5244fc37303e779c63b --- /dev/null +++ b/assets/HeaderLink-BMtWjY7k.js @@ -0,0 +1 @@ +import{aK as e,aO as t,aS as n,d6 as r,d8 as i,d9 as a,dF as o,de as s,di as c,dx as l}from"./index-TXtvn0DM.js";var u=`/assets/logo-dark-B0bvNYTh.svg`,d=`/assets/logo-B2aCU-bH.svg`;const f=[`src`],p=[`src`];var m=r({__name:`HeaderLink`,setup(e){let r=n();return(e,n)=>(l(),c(o(t),{to:`/`,flex:`~`,"items-center":``,"gap-2":``,"px-2":``,"text-nowrap":``,"text-2xl":``,"outline-none":``},{default:i(()=>[o(r)?(l(),a(`img`,{key:0,src:o(u),"h-8":``,"w-8":``,class:`theme-colored`},null,8,f)):(l(),a(`img`,{key:1,src:o(d),"h-8":``,"w-8":``,class:`theme-colored`},null,8,p)),n[0]||=s(`div`,{"translate-y":`[2px]`,"font-semibold":``,"font-quicksand":``},[s(`span`,null,`AIRI`)],-1)]),_:1,__:[0]}))}}),h=e(m,[[`__scopeId`,`data-v-2542c9d9`]]);export{h as b}; \ No newline at end of file diff --git a/assets/HeaderLink-BvOcNkh0.js b/assets/HeaderLink-BvOcNkh0.js deleted file mode 100644 index 53c46dd9167373df1dd48aee1e766dcef71626ab..0000000000000000000000000000000000000000 --- a/assets/HeaderLink-BvOcNkh0.js +++ /dev/null @@ -1 +0,0 @@ -import{aK as e,aO as t,aZ as n,dD as r,di as i,dm as a,do as o,dp as s,du as c,dy as l}from"./index-Bcb2irKh.js";var u=`/assets/logo-dark-B0bvNYTh.svg`,d=`/assets/logo-B2aCU-bH.svg`;const f=[`src`],p=[`src`];var m=a({__name:`HeaderLink`,setup(e){let a=n();return(e,n)=>(i(),l(r(t),{to:`/`,flex:`~`,"items-center":``,"gap-2":``,"px-2":``,"text-nowrap":``,"text-2xl":``,"outline-none":``},{default:o(()=>[r(a)?(i(),s(`img`,{key:0,src:r(u),"h-8":``,"w-8":``,class:`theme-colored`},null,8,f)):(i(),s(`img`,{key:1,src:r(d),"h-8":``,"w-8":``,class:`theme-colored`},null,8,p)),n[0]||=c(`div`,{"translate-y":`[2px]`,"font-semibold":``,"font-quicksand":``},[c(`span`,null,`AIRI`)],-1)]),_:1,__:[0]}))}}),h=e(m,[[`__scopeId`,`data-v-2542c9d9`]]);export{h as b}; \ No newline at end of file diff --git a/assets/IconAnimation-BSHXCi3V.js b/assets/IconAnimation-BSHXCi3V.js deleted file mode 100644 index 9e78b3f4a9e7c39213cf66bb72252b5d11ae94aa..0000000000000000000000000000000000000000 --- a/assets/IconAnimation-BSHXCi3V.js +++ /dev/null @@ -1 +0,0 @@ -import{dI as e,dO as t,dP as n,da as r,dg as i,di as a,dm as o,dp as s,du as c}from"./index-Bcb2irKh.js";var l=o({__name:`IconAnimation`,props:{icon:{},iconSize:{},position:{},duration:{},started:{type:Boolean},textColor:{},isReverse:{type:Boolean},zIndex:{}},emits:[`animationEnded`],setup(o,{emit:l}){let u=o,d=l,f=e(!1);i(()=>u.started,e=>{e&&requestAnimationFrame(()=>{f.value=!0})});let p=r(()=>({opacity:f.value===u.isReverse?0:1,size:f.value===u.isReverse?u.iconSize:25,position:f.value===u.isReverse?u.position:`calc(50dvw - 12.5rem), calc(50dvh - 12.5rem)`,textColor:f.value===u.isReverse?u.textColor:`text-white`})),m=e([]),h=e(!1);function g(e){m.value.push(e.propertyName),m.value.includes(`color`)&&m.value.includes(`width`)&&m.value.includes(`height`)&&m.value.includes(`transform`)&&(h.value=!0,d(`animationEnded`))}return(e,r)=>(a(),s(`div`,{"pointer-events-none":``,fixed:``,w:`100dvw`,h:`100dvh`,style:n({zIndex:h.value?e.zIndex:void 0})},[c(`div`,{fixed:``,"inset-0":``,"bg-primary-500":``,"transition-opacity":``,"ease-linear":``,style:n({opacity:p.value.opacity,transitionDuration:`${e.duration}ms`})},null,4),c(`div`,{fixed:``,"inset-0":``,"ease-in-out":``,style:n({width:`${p.value.size}rem`,height:`${p.value.size}rem`,transform:`translate(${p.value.position})`,transitionDuration:`${e.duration}ms`}),class:t([p.value.textColor,u.icon,{"transition-all":f.value}]),onTransitionend:g},null,38)],4))}}),u=l;export{u as b}; \ No newline at end of file diff --git a/assets/IconAnimation-Cx_ji59L.js b/assets/IconAnimation-Cx_ji59L.js new file mode 100644 index 0000000000000000000000000000000000000000..c7333a3079065a41b3f50bca8de649e53bc0dfab --- /dev/null +++ b/assets/IconAnimation-Cx_ji59L.js @@ -0,0 +1 @@ +import{d6 as e,d9 as t,dK as n,dO as r,dP as i,de as a,dp as o,dv as s,dx as c}from"./index-TXtvn0DM.js";var l=e({__name:`IconAnimation`,props:{icon:{},iconSize:{},position:{},duration:{},started:{type:Boolean},textColor:{},isReverse:{type:Boolean},zIndex:{}},emits:[`animationEnded`],setup(e,{emit:l}){let u=e,d=l,f=n(!1);s(()=>u.started,e=>{e&&requestAnimationFrame(()=>{f.value=!0})});let p=o(()=>({opacity:f.value===u.isReverse?0:1,size:f.value===u.isReverse?u.iconSize:25,position:f.value===u.isReverse?u.position:`calc(50dvw - 12.5rem), calc(50dvh - 12.5rem)`,textColor:f.value===u.isReverse?u.textColor:`text-white`})),m=n([]),h=n(!1);function g(e){m.value.push(e.propertyName),m.value.includes(`color`)&&m.value.includes(`width`)&&m.value.includes(`height`)&&m.value.includes(`transform`)&&(h.value=!0,d(`animationEnded`))}return(e,n)=>(c(),t(`div`,{"pointer-events-none":``,fixed:``,w:`100dvw`,h:`100dvh`,style:i({zIndex:h.value?e.zIndex:void 0})},[a(`div`,{fixed:``,"inset-0":``,"bg-primary-500":``,"transition-opacity":``,"ease-linear":``,style:i({opacity:p.value.opacity,transitionDuration:`${e.duration}ms`})},null,4),a(`div`,{fixed:``,"inset-0":``,"ease-in-out":``,style:i({width:`${p.value.size}rem`,height:`${p.value.size}rem`,transform:`translate(${p.value.position})`,transitionDuration:`${e.duration}ms`}),class:r([p.value.textColor,u.icon,{"transition-all":f.value}]),onTransitionend:g},null,38)],4))}}),u=l;export{u as b}; \ No newline at end of file diff --git a/assets/InputFile-BduVApi9.js b/assets/InputFile-BduVApi9.js new file mode 100644 index 0000000000000000000000000000000000000000..be389554f44a1264a0983aef2506548b4382c5e5 --- /dev/null +++ b/assets/InputFile-BduVApi9.js @@ -0,0 +1 @@ +import{b7 as e,d6 as t,d9 as n,dF as r,dK as i,dO as a,dc as o,de as s,dj as c,dk as l,dx as u}from"./index-TXtvn0DM.js";const d=[`accept`,`multiple`],f={key:0,text:`center`,"text-sm":``},p={key:1,text:`center`,"text-sm":``};var m=t({__name:`InputFile`,props:o({accept:{},multiple:{type:Boolean}},{modelValue:{required:!1,default:()=>[]},modelModifiers:{}}),emits:[`update:modelValue`],setup(t){let o=c(t,`modelValue`),m=i(),h=i(!1),g=e(h,150);function _(e){let t=e.target;t.files&&t.files.length>0&&(m.value=t.files[0]),o.value=Array.from(t.files||[]),h.value=!1}return(e,t)=>(u(),n(`label`,{relative:``,class:a([`min-h-[120px] flex flex-col cursor-pointer items-center justify-center rounded-xl p-6`,[r(g)?`border-primary-400 dark:border-primary-600 hover:border-primary-300 dark:hover:border-primary-700`:`border-neutral-200 dark:border-neutral-700 hover:border-primary-300 dark:hover:border-primary-700`,r(g)?`bg-primary-50/5 dark:bg-primary-900/5`:`bg-white/60 dark:bg-black/30 hover:bg-white/80 dark:hover:bg-black/40`]]),border:`dashed 2`,transition:`all duration-300`,"cursor-pointer":``,"opacity-95":``,hover:`scale-100 opacity-100 shadow-md dark:shadow-lg`,onDragover:t[0]||=e=>h.value=!0,onDragleave:t[1]||=e=>h.value=!1},[s(`input`,{type:`file`,accept:e.accept,multiple:e.multiple,"cursor-pointer":``,class:`absolute inset-0 h-full w-full opacity-0`,onChange:_},null,40,d),l(e.$slots,`default`,{isDragging:r(g),firstFile:m.value,files:o.value},()=>[s(`div`,{class:a([`flex flex-col items-center`,[r(g)?`text-primary-500 dark:text-primary-400`:`text-neutral-400 dark:text-neutral-500`]])},[t[2]||=s(`div`,{"i-solar:upload-square-line-duotone":``,"mb-2":``,"text-5xl":``},null,-1),t[3]||=s(`p`,{"font-medium":``,text:`center lg`},` Upload `,-1),r(g)?(u(),n(`p`,f,` Release to upload `)):(u(),n(`p`,p,` Click or drag and drop a file here `))],2)])],34))}}),h=m;export{h as b}; \ No newline at end of file diff --git a/assets/InputFile-DaDBm_4w.js b/assets/InputFile-DaDBm_4w.js deleted file mode 100644 index 49a22ea3a6b210bd977cec52cb1108b2b8e7af6e..0000000000000000000000000000000000000000 --- a/assets/InputFile-DaDBm_4w.js +++ /dev/null @@ -1 +0,0 @@ -import{b8 as e,d5 as t,dD as n,dI as r,dO as i,di as a,dm as o,dp as s,ds as c,du as l,dz as u}from"./index-Bcb2irKh.js";const d=[`accept`,`multiple`],f={key:0,text:`center`,"text-sm":``},p={key:1,text:`center`,"text-sm":``};var m=o({__name:`InputFile`,props:c({accept:{},multiple:{type:Boolean}},{modelValue:{required:!1,default:()=>[]},modelModifiers:{}}),emits:[`update:modelValue`],setup(o){let c=u(o,`modelValue`),m=r(),h=r(!1),g=e(h,150);function _(e){let t=e.target;t.files&&t.files.length>0&&(m.value=t.files[0]),c.value=Array.from(t.files||[]),h.value=!1}return(e,r)=>(a(),s(`label`,{relative:``,class:i([`min-h-[120px] flex flex-col cursor-pointer items-center justify-center rounded-xl p-6`,[n(g)?`border-primary-400 dark:border-primary-600 hover:border-primary-300 dark:hover:border-primary-700`:`border-neutral-200 dark:border-neutral-700 hover:border-primary-300 dark:hover:border-primary-700`,n(g)?`bg-primary-50/5 dark:bg-primary-900/5`:`bg-white/60 dark:bg-black/30 hover:bg-white/80 dark:hover:bg-black/40`]]),border:`dashed 2`,transition:`all duration-300`,"cursor-pointer":``,"opacity-95":``,hover:`scale-100 opacity-100 shadow-md dark:shadow-lg`,onDragover:r[0]||=e=>h.value=!0,onDragleave:r[1]||=e=>h.value=!1},[l(`input`,{type:`file`,accept:e.accept,multiple:e.multiple,"cursor-pointer":``,class:`absolute inset-0 h-full w-full opacity-0`,onChange:_},null,40,d),t(e.$slots,`default`,{isDragging:n(g),firstFile:m.value,files:c.value},()=>[l(`div`,{class:i([`flex flex-col items-center`,[n(g)?`text-primary-500 dark:text-primary-400`:`text-neutral-400 dark:text-neutral-500`]])},[r[2]||=l(`div`,{"i-solar:upload-square-line-duotone":``,"mb-2":``,"text-5xl":``},null,-1),r[3]||=l(`p`,{"font-medium":``,text:`center lg`},` Upload `,-1),n(g)?(a(),s(`p`,f,` Release to upload `)):(a(),s(`p`,p,` Click or drag and drop a file here `))],2)])],34))}}),h=m;export{h as b}; \ No newline at end of file diff --git a/assets/Scenes-ELpQ5xkP.js b/assets/Scenes-D6JBpdgW.js similarity index 90% rename from assets/Scenes-ELpQ5xkP.js rename to assets/Scenes-D6JBpdgW.js index 2f429bc82624afb1d2c0bb97c91c904815da5da9..99a7103034602dca433d3984732db94a85e96866 100644 --- a/assets/Scenes-ELpQ5xkP.js +++ b/assets/Scenes-D6JBpdgW.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/__vite-browser-external-hz9OYH6e.js","assets/index-Bcb2irKh.js","assets/index-DdvhN8Iu.css","assets/default-node-BiFBkIjL.js","assets/import-url-browser-CkMcxt8_.js","assets/import-url-browser-CzbE4_30.js","assets/duckdb-mvp-1eM9E9sB.js","assets/import-url-node-DmUEwuAI.js"])))=>i.map(i=>d[i]); -import{B as e,I as t,J as n,K as r,L as i,M as a,N as o,O as s,P as c,Q as l,R as u,W as d,X as f,Y as p,Z as m,_ as h,a2 as g,aB as _,aD as v,aE as y,aG as b,aH as x,aQ as S,aR as C,aS as w,aY as T,aZ as E,ad as D,b$ as O,b6 as k,b7 as A,b9 as j,bA as M,bB as N,bC as ee,bD as P,bE as F,bF as I,bG as L,bH as te,bI as R,bJ as ne,bK as z,bL as re,bM as ie,bN as ae,bO as oe,bP as se,bQ as ce,bR as le,bS as ue,bT as de,bU as fe,bV as pe,bW as me,bX as he,bY as ge,bZ as _e,b_ as ve,ba as ye,bb as be,bc as xe,bd as Se,be as Ce,bf as we,bg as Te,bh as Ee,bi as De,bj as Oe,bk as ke,bl as Ae,bm as je,bn as Me,bo as Ne,bp as Pe,bq as Fe,br as B,bs as Ie,bt as Le,bu as Re,bv as ze,bw as Be,bx as Ve,by as He,bz as Ue,c0 as We,c1 as Ge,c2 as Ke,c3 as qe,c4 as Je,c5 as Ye,c6 as Xe,c7 as Ze,c8 as Qe,c9 as $e,cA as et,cB as tt,cC as nt,cD as rt,cE as it,cF as at,cG as ot,cH as st,cI as ct,cJ as lt,cK as ut,cL as dt,cM as V,cN as ft,cO as pt,cP as mt,cQ as ht,cR as gt,cS as _t,cT as vt,cU as yt,cV as bt,cW as xt,cX as St,cY as Ct,cZ as wt,ca as Tt,cb as Et,cc as Dt,cd as Ot,ce as kt,cf as At,cg as jt,ch as Mt,ci as Nt,cj as Pt,ck as Ft,cl as It,cm as Lt,cn as Rt,co as zt,cp as Bt,cq as Vt,cr as Ht,cs as Ut,ct as Wt,cu as Gt,cv as Kt,cw as qt,cx as Jt,cy as Yt,cz as Xt,d1 as Zt,d5 as Qt,d7 as $t,d9 as en,dA as tn,dB as nn,dC as rn,dD as H,dE as an,dF as on,dG as sn,dH as cn,dI as U,dJ as W,dK as ln,dL as un,dM as dn,dQ as fn,dR as pn,dS as mn,dT as hn,dU as gn,da as _n,db as vn,dc as yn,dd as bn,de as xn,df as Sn,dg as G,di as K,dk as Cn,dl as wn,dm as Tn,dn as En,do as Dn,dp as On,dq as kn,dr as An,du as jn,dv as Mn,dw as Nn,dy as Pn,s as Fn,t as In,u as Ln,v as Rn,y as zn,z as Bn}from"./index-Bcb2irKh.js";import{b as Vn}from"./import-url-browser-CzbE4_30.js"; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/__vite-browser-external-C1t5aXtc.js","assets/index-TXtvn0DM.js","assets/index-DdvhN8Iu.css","assets/default-node-BI20WiOb.js","assets/import-url-browser-CkMcxt8_.js","assets/import-url-browser-CzbE4_30.js","assets/duckdb-mvp-1eM9E9sB.js","assets/import-url-node-DmUEwuAI.js"])))=>i.map(i=>d[i]); +import{B as e,I as t,J as n,K as r,L as i,M as a,N as o,O as s,P as c,Q as l,R as u,W as d,X as f,Y as p,Z as m,_ as h,a2 as g,aB as _,aD as v,aF as y,aG as b,aH as x,aQ as S,aR as C,aS as w,aZ as T,ad as E,b$ as D,b3 as O,b5 as k,b6 as A,b9 as j,bA as M,bB as N,bC as ee,bD as P,bE as F,bF as I,bG as L,bH as te,bI as R,bJ as ne,bK as z,bL as re,bM as ie,bN as ae,bO as oe,bP as se,bQ as ce,bR as le,bS as ue,bT as de,bU as fe,bV as pe,bW as me,bX as he,bY as ge,bZ as _e,b_ as ve,ba as ye,bb as be,bc as xe,bd as Se,be as Ce,bf as we,bg as Te,bh as Ee,bi as De,bj as Oe,bk as ke,bl as Ae,bm as je,bn as Me,bo as Ne,bp as Pe,bq as Fe,br as Ie,bs as B,bt as Le,bu as Re,bv as ze,bw as Be,bx as Ve,by as He,bz as Ue,c0 as We,c1 as Ge,c2 as Ke,c3 as qe,c4 as Je,c5 as Ye,c6 as Xe,c7 as Ze,c8 as Qe,c9 as $e,cA as et,cB as tt,cC as nt,cD as rt,cE as it,cF as at,cG as ot,cH as st,cI as ct,cJ as lt,cK as V,cL as ut,cM as dt,cN as ft,cO as pt,cP as mt,cQ as ht,cR as gt,cS as _t,cT as vt,cU as yt,cV as bt,cW as xt,cX as St,cY as Ct,cZ as wt,ca as Tt,cb as Et,cc as Dt,cd as Ot,ce as kt,cf as At,cg as jt,ch as Mt,ci as Nt,cj as Pt,ck as Ft,cl as It,cm as Lt,cn as Rt,co as zt,cp as Bt,cq as Vt,cr as Ht,cs as Ut,ct as Wt,cu as Gt,cv as Kt,cw as qt,cx as Jt,cy as Yt,cz as Xt,d2 as Zt,d5 as Qt,d6 as $t,d7 as en,d8 as tn,d9 as nn,dA as rn,dB as an,dC as on,dD as sn,dE as cn,dF as H,dG as ln,dH as un,dI as dn,dJ as fn,dK as U,dL as W,dM as pn,dQ as mn,dR as hn,dS as gn,dT as _n,dU as vn,da as yn,db as bn,de as xn,df as Sn,dg as Cn,di as wn,dk as Tn,dm as En,do as Dn,dp as On,dq as kn,dr as An,ds as jn,dt as Mn,du as Nn,dv as G,dx as K,dz as Pn,s as Fn,t as In,u as Ln,v as Rn,y as zn,z as Bn}from"./index-TXtvn0DM.js";import{b as Vn}from"./import-url-browser-CzbE4_30.js"; /*! * @pixi/constants - v6.5.10 * Compiled Thu, 06 Jul 2023 15:25:11 UTC @@ -7,8 +7,8 @@ import{B as e,I as t,J as n,K as r,L as i,M as a,N as o,O as s,P as c,Q as l,R a * @pixi/constants is licensed under the MIT License. * http://www.opensource.org/licenses/mit-license */ -var Hn;(function(e){e[e.WEBGL_LEGACY=0]=`WEBGL_LEGACY`,e[e.WEBGL=1]=`WEBGL`,e[e.WEBGL2=2]=`WEBGL2`})(Hn||={});var Un;(function(e){e[e.UNKNOWN=0]=`UNKNOWN`,e[e.WEBGL=1]=`WEBGL`,e[e.CANVAS=2]=`CANVAS`})(Un||={});var Wn;(function(e){e[e.COLOR=16384]=`COLOR`,e[e.DEPTH=256]=`DEPTH`,e[e.STENCIL=1024]=`STENCIL`})(Wn||={});var Gn;(function(e){e[e.NORMAL=0]=`NORMAL`,e[e.ADD=1]=`ADD`,e[e.MULTIPLY=2]=`MULTIPLY`,e[e.SCREEN=3]=`SCREEN`,e[e.OVERLAY=4]=`OVERLAY`,e[e.DARKEN=5]=`DARKEN`,e[e.LIGHTEN=6]=`LIGHTEN`,e[e.COLOR_DODGE=7]=`COLOR_DODGE`,e[e.COLOR_BURN=8]=`COLOR_BURN`,e[e.HARD_LIGHT=9]=`HARD_LIGHT`,e[e.SOFT_LIGHT=10]=`SOFT_LIGHT`,e[e.DIFFERENCE=11]=`DIFFERENCE`,e[e.EXCLUSION=12]=`EXCLUSION`,e[e.HUE=13]=`HUE`,e[e.SATURATION=14]=`SATURATION`,e[e.COLOR=15]=`COLOR`,e[e.LUMINOSITY=16]=`LUMINOSITY`,e[e.NORMAL_NPM=17]=`NORMAL_NPM`,e[e.ADD_NPM=18]=`ADD_NPM`,e[e.SCREEN_NPM=19]=`SCREEN_NPM`,e[e.NONE=20]=`NONE`,e[e.SRC_OVER=0]=`SRC_OVER`,e[e.SRC_IN=21]=`SRC_IN`,e[e.SRC_OUT=22]=`SRC_OUT`,e[e.SRC_ATOP=23]=`SRC_ATOP`,e[e.DST_OVER=24]=`DST_OVER`,e[e.DST_IN=25]=`DST_IN`,e[e.DST_OUT=26]=`DST_OUT`,e[e.DST_ATOP=27]=`DST_ATOP`,e[e.ERASE=26]=`ERASE`,e[e.SUBTRACT=28]=`SUBTRACT`,e[e.XOR=29]=`XOR`})(Gn||={});var Kn;(function(e){e[e.POINTS=0]=`POINTS`,e[e.LINES=1]=`LINES`,e[e.LINE_LOOP=2]=`LINE_LOOP`,e[e.LINE_STRIP=3]=`LINE_STRIP`,e[e.TRIANGLES=4]=`TRIANGLES`,e[e.TRIANGLE_STRIP=5]=`TRIANGLE_STRIP`,e[e.TRIANGLE_FAN=6]=`TRIANGLE_FAN`})(Kn||={});var qn;(function(e){e[e.RGBA=6408]=`RGBA`,e[e.RGB=6407]=`RGB`,e[e.RG=33319]=`RG`,e[e.RED=6403]=`RED`,e[e.RGBA_INTEGER=36249]=`RGBA_INTEGER`,e[e.RGB_INTEGER=36248]=`RGB_INTEGER`,e[e.RG_INTEGER=33320]=`RG_INTEGER`,e[e.RED_INTEGER=36244]=`RED_INTEGER`,e[e.ALPHA=6406]=`ALPHA`,e[e.LUMINANCE=6409]=`LUMINANCE`,e[e.LUMINANCE_ALPHA=6410]=`LUMINANCE_ALPHA`,e[e.DEPTH_COMPONENT=6402]=`DEPTH_COMPONENT`,e[e.DEPTH_STENCIL=34041]=`DEPTH_STENCIL`})(qn||={});var Jn;(function(e){e[e.TEXTURE_2D=3553]=`TEXTURE_2D`,e[e.TEXTURE_CUBE_MAP=34067]=`TEXTURE_CUBE_MAP`,e[e.TEXTURE_2D_ARRAY=35866]=`TEXTURE_2D_ARRAY`,e[e.TEXTURE_CUBE_MAP_POSITIVE_X=34069]=`TEXTURE_CUBE_MAP_POSITIVE_X`,e[e.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]=`TEXTURE_CUBE_MAP_NEGATIVE_X`,e[e.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]=`TEXTURE_CUBE_MAP_POSITIVE_Y`,e[e.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]=`TEXTURE_CUBE_MAP_NEGATIVE_Y`,e[e.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]=`TEXTURE_CUBE_MAP_POSITIVE_Z`,e[e.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]=`TEXTURE_CUBE_MAP_NEGATIVE_Z`})(Jn||={});var Yn;(function(e){e[e.UNSIGNED_BYTE=5121]=`UNSIGNED_BYTE`,e[e.UNSIGNED_SHORT=5123]=`UNSIGNED_SHORT`,e[e.UNSIGNED_SHORT_5_6_5=33635]=`UNSIGNED_SHORT_5_6_5`,e[e.UNSIGNED_SHORT_4_4_4_4=32819]=`UNSIGNED_SHORT_4_4_4_4`,e[e.UNSIGNED_SHORT_5_5_5_1=32820]=`UNSIGNED_SHORT_5_5_5_1`,e[e.UNSIGNED_INT=5125]=`UNSIGNED_INT`,e[e.UNSIGNED_INT_10F_11F_11F_REV=35899]=`UNSIGNED_INT_10F_11F_11F_REV`,e[e.UNSIGNED_INT_2_10_10_10_REV=33640]=`UNSIGNED_INT_2_10_10_10_REV`,e[e.UNSIGNED_INT_24_8=34042]=`UNSIGNED_INT_24_8`,e[e.UNSIGNED_INT_5_9_9_9_REV=35902]=`UNSIGNED_INT_5_9_9_9_REV`,e[e.BYTE=5120]=`BYTE`,e[e.SHORT=5122]=`SHORT`,e[e.INT=5124]=`INT`,e[e.FLOAT=5126]=`FLOAT`,e[e.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]=`FLOAT_32_UNSIGNED_INT_24_8_REV`,e[e.HALF_FLOAT=36193]=`HALF_FLOAT`})(Yn||={});var Xn;(function(e){e[e.FLOAT=0]=`FLOAT`,e[e.INT=1]=`INT`,e[e.UINT=2]=`UINT`})(Xn||={});var Zn;(function(e){e[e.NEAREST=0]=`NEAREST`,e[e.LINEAR=1]=`LINEAR`})(Zn||={});var Qn;(function(e){e[e.CLAMP=33071]=`CLAMP`,e[e.REPEAT=10497]=`REPEAT`,e[e.MIRRORED_REPEAT=33648]=`MIRRORED_REPEAT`})(Qn||={});var $n;(function(e){e[e.OFF=0]=`OFF`,e[e.POW2=1]=`POW2`,e[e.ON=2]=`ON`,e[e.ON_MANUAL=3]=`ON_MANUAL`})($n||={});var er;(function(e){e[e.NPM=0]=`NPM`,e[e.UNPACK=1]=`UNPACK`,e[e.PMA=2]=`PMA`,e[e.NO_PREMULTIPLIED_ALPHA=0]=`NO_PREMULTIPLIED_ALPHA`,e[e.PREMULTIPLY_ON_UPLOAD=1]=`PREMULTIPLY_ON_UPLOAD`,e[e.PREMULTIPLY_ALPHA=2]=`PREMULTIPLY_ALPHA`,e[e.PREMULTIPLIED_ALPHA=2]=`PREMULTIPLIED_ALPHA`})(er||={});var tr;(function(e){e[e.NO=0]=`NO`,e[e.YES=1]=`YES`,e[e.AUTO=2]=`AUTO`,e[e.BLEND=0]=`BLEND`,e[e.CLEAR=1]=`CLEAR`,e[e.BLIT=2]=`BLIT`})(tr||={});var nr;(function(e){e[e.AUTO=0]=`AUTO`,e[e.MANUAL=1]=`MANUAL`})(nr||={});var rr;(function(e){e.LOW=`lowp`,e.MEDIUM=`mediump`,e.HIGH=`highp`})(rr||={});var ir;(function(e){e[e.NONE=0]=`NONE`,e[e.SCISSOR=1]=`SCISSOR`,e[e.STENCIL=2]=`STENCIL`,e[e.SPRITE=3]=`SPRITE`,e[e.COLOR=4]=`COLOR`})(ir||={});var ar;(function(e){e[e.RED=1]=`RED`,e[e.GREEN=2]=`GREEN`,e[e.BLUE=4]=`BLUE`,e[e.ALPHA=8]=`ALPHA`})(ar||={});var or;(function(e){e[e.NONE=0]=`NONE`,e[e.LOW=2]=`LOW`,e[e.MEDIUM=4]=`MEDIUM`,e[e.HIGH=8]=`HIGH`})(or||={});var sr;(function(e){e[e.ELEMENT_ARRAY_BUFFER=34963]=`ELEMENT_ARRAY_BUFFER`,e[e.ARRAY_BUFFER=34962]=`ARRAY_BUFFER`,e[e.UNIFORM_BUFFER=35345]=`UNIFORM_BUFFER`})(sr||={});var cr={createCanvas:function(e,t){var n=document.createElement(`canvas`);return n.width=e,n.height=t,n},getWebGLRenderingContext:function(){return WebGLRenderingContext},getNavigator:function(){return navigator},getBaseUrl:function(){var e;return(e=document.baseURI)??window.location.href},fetch:function(e,t){return fetch(e,t)}},lr=/iPhone/i,ur=/iPod/i,dr=/iPad/i,fr=/\biOS-universal(?:.+)Mac\b/i,pr=/\bAndroid(?:.+)Mobile\b/i,mr=/Android/i,hr=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,gr=/Silk/i,_r=/Windows Phone/i,vr=/\bWindows(?:.+)ARM\b/i,yr=/BlackBerry/i,br=/BB10/i,xr=/Opera Mini/i,Sr=/\b(CriOS|Chrome)(?:.+)Mobile/i,Cr=/Mobile(?:.+)Firefox\b/i,wr=function(e){return e!==void 0&&e.platform===`MacIntel`&&typeof e.maxTouchPoints==`number`&&e.maxTouchPoints>1&&typeof MSStream>`u`};function Tr(e){return function(t){return t.test(e)}}function Er(e){var t={userAgent:``,platform:``,maxTouchPoints:0};!e&&typeof navigator<`u`?t={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof e==`string`?t.userAgent=e:e&&e.userAgent&&(t={userAgent:e.userAgent,platform:e.platform,maxTouchPoints:e.maxTouchPoints||0});var n=t.userAgent,r=n.split(`[FBAN`);r[1]!==void 0&&(n=r[0]),r=n.split(`Twitter`),r[1]!==void 0&&(n=r[0]);var i=Tr(n),a={apple:{phone:i(lr)&&!i(_r),ipod:i(ur),tablet:!i(lr)&&(i(dr)||wr(t))&&!i(_r),universal:i(fr),device:(i(lr)||i(ur)||i(dr)||i(fr)||wr(t))&&!i(_r)},amazon:{phone:i(hr),tablet:!i(hr)&&i(gr),device:i(hr)||i(gr)},android:{phone:!i(_r)&&i(hr)||!i(_r)&&i(pr),tablet:!i(_r)&&!i(hr)&&!i(pr)&&(i(gr)||i(mr)),device:!i(_r)&&(i(hr)||i(gr)||i(pr)||i(mr))||i(/\bokhttp\b/i)},windows:{phone:i(_r),tablet:i(vr),device:i(_r)||i(vr)},other:{blackberry:i(yr),blackberry10:i(br),opera:i(xr),firefox:i(Cr),chrome:i(Sr),device:i(yr)||i(br)||i(xr)||i(Cr)||i(Sr)},any:!1,phone:!1,tablet:!1};return a.any=a.apple.device||a.android.device||a.windows.device||a.other.device,a.phone=a.apple.phone||a.android.phone||a.windows.phone,a.tablet=a.apple.tablet||a.android.tablet||a.windows.tablet,a}var Dr=Er(globalThis.navigator);function Or(){return!Dr.apple.device}function kr(e){var t=!0;if(Dr.tablet||Dr.phone){if(Dr.apple.device){var n=navigator.userAgent.match(/OS (\d+)_(\d+)?/);if(n){var r=parseInt(n[1],10);r<11&&(t=!1)}}if(Dr.android.device){var n=navigator.userAgent.match(/Android\s([0-9.]*)/);if(n){var r=parseInt(n[1],10);r<7&&(t=!1)}}}return t?e:4}var Ar={ADAPTER:cr,MIPMAP_TEXTURES:$n.POW2,ANISOTROPIC_LEVEL:0,RESOLUTION:1,FILTER_RESOLUTION:1,FILTER_MULTISAMPLE:or.NONE,SPRITE_MAX_TEXTURES:kr(32),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,width:800,height:600,autoDensity:!1,backgroundColor:0,backgroundAlpha:1,useContextAlpha:!0,clearBeforeRender:!0,antialias:!1,preserveDrawingBuffer:!1},GC_MODE:nr.AUTO,GC_MAX_IDLE:60*60,GC_MAX_CHECK_COUNT:60*10,WRAP_MODE:Qn.CLAMP,SCALE_MODE:Zn.LINEAR,PRECISION_VERTEX:rr.HIGH,PRECISION_FRAGMENT:Dr.apple.device?rr.HIGH:rr.MEDIUM,CAN_UPLOAD_SAME_BUFFER:Or(),CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1},jr=fn((exports,t)=>{var n=Object.prototype.hasOwnProperty,r=`~`;function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(r=!1));function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,n,i,o){if(typeof n!=`function`)throw TypeError(`The listener must be a function`);var s=new a(n,i||e,o),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function s(e,t){--e._eventsCount===0?e._events=new i:delete e._events[t]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)n.call(t,i)&&e.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},c.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=Array(a);i{t.exports=n,t.exports.default=n;function n(e,t,n){n||=2;var i=t&&t.length,o=i?t[0]*n:e.length,s=r(e,0,o,n,!0),c=[];if(!s||s.next===s.prev)return c;var l,d,f,p,m,h,g;if(i&&(s=u(e,t,s,n)),e.length>80*n){l=f=e[0],d=p=e[1];for(var _=n;_f&&(f=m),h>p&&(p=h);g=Math.max(f-l,p-d),g=g===0?0:32767/g}return a(s,c,n,l,d,g,0),c}function r(e,t,n,r,i){var a,o;if(i===N(e,t,n,r)>0)for(a=t;a=t;a-=r)o=A(a,e[a],e[a+1],o);return o&&S(o,o.next)&&(j(o),o=o.next),o}function i(e,t){if(!e)return e;t||=e;var n=e,r;do if(r=!1,!n.steiner&&(S(n,n.next)||x(n.prev,n,n.next)===0)){if(j(n),n=t=n.prev,n===n.next)break;r=!0}else n=n.next;while(r||n!==t);return t}function a(e,t,n,r,u,d,f){if(e){!f&&d&&h(e,r,u,d);for(var p=e,m,g;e.prev!==e.next;){if(m=e.prev,g=e.next,d?s(e,r,u,d):o(e)){t.push(m.i/n|0),t.push(e.i/n|0),t.push(g.i/n|0),j(e),e=g.next,p=g.next;continue}if(e=g,e===p){f?f===1?(e=c(i(e),t,n),a(e,t,n,r,u,d,2)):f===2&&l(e,t,n,r,u,d):a(i(e),t,n,r,u,d,1);break}}}}function o(e){var t=e.prev,n=e,r=e.next;if(x(t,n,r)>=0)return!1;for(var i=t.x,a=n.x,o=r.x,s=t.y,c=n.y,l=r.y,u=ia?i>o?i:o:a>o?a:o,p=s>c?s>l?s:l:c>l?c:l,m=r.next;m!==t;){if(m.x>=u&&m.x<=f&&m.y>=d&&m.y<=p&&y(i,s,a,c,o,l,m.x,m.y)&&x(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function s(e,t,n,r){var i=e.prev,a=e,o=e.next;if(x(i,a,o)>=0)return!1;for(var s=i.x,c=a.x,l=o.x,u=i.y,d=a.y,f=o.y,p=sc?s>l?s:l:c>l?c:l,g=u>d?u>f?u:f:d>f?d:f,v=_(p,m,t,n,r),b=_(h,g,t,n,r),S=e.prevZ,C=e.nextZ;S&&S.z>=v&&C&&C.z<=b;){if(S.x>=p&&S.x<=h&&S.y>=m&&S.y<=g&&S!==i&&S!==o&&y(s,u,c,d,l,f,S.x,S.y)&&x(S.prev,S,S.next)>=0||(S=S.prevZ,C.x>=p&&C.x<=h&&C.y>=m&&C.y<=g&&C!==i&&C!==o&&y(s,u,c,d,l,f,C.x,C.y)&&x(C.prev,C,C.next)>=0))return!1;C=C.nextZ}for(;S&&S.z>=v;){if(S.x>=p&&S.x<=h&&S.y>=m&&S.y<=g&&S!==i&&S!==o&&y(s,u,c,d,l,f,S.x,S.y)&&x(S.prev,S,S.next)>=0)return!1;S=S.prevZ}for(;C&&C.z<=b;){if(C.x>=p&&C.x<=h&&C.y>=m&&C.y<=g&&C!==i&&C!==o&&y(s,u,c,d,l,f,C.x,C.y)&&x(C.prev,C,C.next)>=0)return!1;C=C.nextZ}return!0}function c(e,t,n){var r=e;do{var a=r.prev,o=r.next.next;!S(a,o)&&C(a,r,r.next,o)&&D(a,o)&&D(o,a)&&(t.push(a.i/n|0),t.push(r.i/n|0),t.push(o.i/n|0),j(r),j(r.next),r=e=o),r=r.next}while(r!==e);return i(r)}function l(e,t,n,r,o,s){var c=e;do{for(var l=c.next.next;l!==c.prev;){if(c.i!==l.i&&b(c,l)){var u=k(c,l);c=i(c,c.next),u=i(u,u.next),a(c,t,n,r,o,s,0),a(u,t,n,r,o,s,0);return}l=l.next}c=c.next}while(c!==e)}function u(e,t,n,i){var a=[],o,s,c,l,u;for(o=0,s=t.length;o=n.next.y&&n.next.y!==n.y){var s=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=r&&s>a&&(a=s,o=n.x=n.x&&n.x>=l&&r!==n.x&&y(io.x||n.x===o.x&&m(o,n)))&&(o=n,d=f)),n=n.next;while(n!==c);return o}function m(e,t){return x(e.prev,e,t.prev)<0&&x(t.next,e,e.next)<0}function h(e,t,n,r){var i=e;do i.z===0&&(i.z=_(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,g(i)}function g(e){var t,n,r,i,a,o,s,c,l=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,r=n,s=0,t=0;t0||c>0&&r;)s!==0&&(c===0||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,c--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;n=r}a.nextZ=null,l*=2}while(o>1);return e}function _(e,t,n,r,i){return e=(e-n)*i|0,t=(t-r)*i|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function v(e){var t=e,n=e;do(t.x=(e-o)*(a-s)&&(e-o)*(r-s)>=(n-o)*(t-s)&&(n-o)*(a-s)>=(i-o)*(r-s)}function b(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!E(e,t)&&(D(e,t)&&D(t,e)&&O(e,t)&&(x(e.prev,e,t.prev)||x(e,t.prev,t))||S(e,t)&&x(e.prev,e,e.next)>0&&x(t.prev,t,t.next)>0)}function x(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function S(e,t){return e.x===t.x&&e.y===t.y}function C(e,t,n,r){var i=T(x(e,t,n)),a=T(x(e,t,r)),o=T(x(n,r,e)),s=T(x(n,r,t));return!!(i!==a&&o!==s||i===0&&w(e,n,t)||a===0&&w(e,r,t)||o===0&&w(n,e,r)||s===0&&w(n,t,r))}function w(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function T(e){return e>0?1:e<0?-1:0}function E(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&C(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function D(e,t){return x(e.prev,e,e.next)<0?x(e,t,e.next)>=0&&x(e,e.prev,t)>=0:x(e,t,e.prev)<0||x(e,e.next,t)<0}function O(e,t){var n=e,r=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do n.y>a!=n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function k(e,t){var n=new M(e.i,e.x,e.y),r=new M(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function A(e,t,n,r){var i=new M(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function j(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function M(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}n.deviation=function(e,t,n,r){var i=t&&t.length,a=i?t[0]*n:e.length,o=Math.abs(N(e,0,a,n));if(i)for(var s=0,c=t.length;s0&&(r+=e[i-1].length,n.holes.push(r))}return n}}),Nr=fn((exports,t)=>{(function(n){var r=typeof exports==`object`&&exports&&!exports.nodeType&&exports,i=typeof t==`object`&&t&&!t.nodeType&&t,a=typeof global==`object`&&global;(a.global===a||a.window===a||a.self===a)&&(n=a);var o,s=2147483647,c=36,l=1,u=26,d=38,f=700,p=72,m=128,h=`-`,g=/^xn--/,_=/[^\x20-\x7E]/,v=/[\x2E\u3002\uFF0E\uFF61]/g,y={overflow:`Overflow: input needs wider integers to process`,"not-basic":`Illegal input >= 0x80 (not a basic code point)`,"invalid-input":`Invalid input`},b=c-l,x=Math.floor,S=String.fromCharCode,C;function w(e){throw RangeError(y[e])}function T(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function E(e,t){var n=e.split(`@`),r=``;n.length>1&&(r=n[0]+`@`,e=n[1]),e=e.replace(v,`.`);var i=e.split(`.`),a=T(i,t).join(`.`);return r+a}function D(e){for(var t=[],n=0,r=e.length,i,a;n=55296&&i<=56319&&n65535&&(e-=65536,t+=S(e>>>10&1023|55296),e=56320|e&1023),t+=S(e),t}).join(``)}function k(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:c}function A(e,t){return e+22+75*(e<26)-((t!=0)<<5)}function j(e,t,n){var r=0;for(e=n?x(e/f):e>>1,e+=x(e/t);e>b*u>>1;r+=c)e=x(e/b);return x(r+(b+1)*e/(e+d))}function M(e){var t=[],n=e.length,r,i=0,a=m,o=p,d,f,g,_,v,y,b,S,C;for(d=e.lastIndexOf(h),d<0&&(d=0),f=0;f=128&&w(`not-basic`),t.push(e.charCodeAt(f));for(g=d>0?d+1:0;g=n&&w(`invalid-input`),b=k(e.charCodeAt(g++)),(b>=c||b>x((s-i)/v))&&w(`overflow`),i+=b*v,S=y<=o?l:y>=o+u?u:y-o,!(bx(s/C)&&w(`overflow`),v*=C;r=t.length+1,o=j(i-_,r,_==0),x(i/r)>s-a&&w(`overflow`),a+=x(i/r),i%=r,t.splice(i++,0,a)}return O(t)}function N(e){var t,n,r,i,a,o,d,f,g,_,v,y=[],b,C,T,E;for(e=D(e),b=e.length,t=m,n=0,a=p,o=0;o=t&&vx((s-n)/C)&&w(`overflow`),n+=(d-t)*C,t=d,o=0;os&&w(`overflow`),v==t){for(f=n,g=c;_=g<=a?l:g>=a+u?u:g-a,!(f<_);g+=c)E=f-_,T=c-_,y.push(S(A(_+E%T,0))),f=x(E/T);y.push(S(A(f,0))),a=j(n,C,r==i),n=0,++r}++n,++t}return y.join(``)}function ee(e){return E(e,function(e){return g.test(e)?M(e.slice(4).toLowerCase()):e})}function P(e){return E(e,function(e){return _.test(e)?`xn--`+N(e):e})}if(o={version:`1.4.1`,ucs2:{decode:D,encode:O},decode:M,encode:N,toASCII:P,toUnicode:ee},typeof define==`function`&&typeof define.amd==`object`&&define.amd)define(`punycode`,function(){return o});else if(r&&i)if(t.exports==r)i.exports=o;else for(C in o)o.hasOwnProperty(C)&&(r[C]=o[C]);else n.punycode=o})(exports)}),Pr=fn((exports,t)=>{Object.defineProperty(exports,`__esModule`,{value:!0});function n(){let e,t,n=n=>{if(n&&(typeof n==`object`||typeof n==`function`)){if(e)return e.get(n)}else if(t)return t.get(n)},r=(n,r)=>{n&&(typeof n==`object`||typeof n==`function`)?(e||=new WeakMap,e.set(n,r)):(t||=new Map,t.set(n,r))},i=n=>{if(n&&(typeof n==`object`||typeof n==`function`)){if(e)return e.has(n)}else if(t)return t.has(n);return!1},a=e=>{if(!i(e))throw TypeError(`Side channel does not contain the given key`)};return{get:n,set:r,has:i,assert:a}}exports.default=n,(typeof exports.default==`object`&&exports.default!==null||typeof exports.default==`function`)&&(Object.assign(exports.default,exports),t.exports=exports.default)}),Fr=fn((exports,t)=>{var n=String.prototype.replace,r=/%20/g,i={RFC1738:`RFC1738`,RFC3986:`RFC3986`};t.exports={default:i.RFC3986,formatters:{RFC1738:function(e){return n.call(e,r,`+`)},RFC3986:function(e){return String(e)}},RFC1738:i.RFC1738,RFC3986:i.RFC3986}}),Ir=fn((exports,t)=>{var n=Fr(),r=Object.prototype.hasOwnProperty,i=Array.isArray,a=function(){for(var e=[],t=0;t<256;++t)e.push(`%`+((t<16?`0`:``)+t.toString(16)).toUpperCase());return e}(),o=function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(i(n)){for(var r=[],a=0;a=d?s.slice(l,l+d):s,f=[],p=0;p=48&&m<=57||m>=65&&m<=90||m>=97&&m<=122||o===n.RFC1738&&(m===40||m===41)){f[f.length]=u.charAt(p);continue}if(m<128){f[f.length]=a[m];continue}if(m<2048){f[f.length]=a[192|m>>6]+a[128|m&63];continue}if(m<55296||m>=57344){f[f.length]=a[224|m>>12]+a[128|m>>6&63]+a[128|m&63];continue}p+=1,m=65536+((m&1023)<<10|u.charCodeAt(p)&1023),f[f.length]=a[240|m>>18]+a[128|m>>12&63]+a[128|m>>6&63]+a[128|m&63]}c+=f.join(``)}return c},p=function(e){for(var t=[{obj:{o:e},prop:`o`}],n=[],r=0;r{var n=Pr(),r=Ir(),i=Fr(),a=Object.prototype.hasOwnProperty,o={brackets:function(e){return e+`[]`},comma:`comma`,indices:function(e,t){return e+`[`+t+`]`},repeat:function(e){return e}},s=Array.isArray,c=Array.prototype.push,l=function(e,t){c.apply(e,s(t)?t:[t])},u=Date.prototype.toISOString,d=i.default,f={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:`indices`,charset:`utf-8`,charsetSentinel:!1,commaRoundTrip:!1,delimiter:`&`,encode:!0,encodeDotInKeys:!1,encoder:r.encode,encodeValuesOnly:!1,filter:void 0,format:d,formatter:i.formatters[d],indices:!1,serializeDate:function(e){return u.call(e)},skipNulls:!1,strictNullHandling:!1},p=function(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||typeof e==`symbol`||typeof e==`bigint`},m={},h=function e(t,i,a,o,c,u,d,h,g,_,v,y,b,x,S,C,w,T){for(var E=t,D=T,O=0,k=!1;(D=D.get(m))!==void 0&&!k;){var A=D.get(t);if(O+=1,A!==void 0){if(A===O)throw RangeError(`Cyclic object value`);k=!0}D.get(m)===void 0&&(O=0)}if(typeof _==`function`?E=_(i,E):E instanceof Date?E=b(E):a===`comma`&&s(E)&&(E=r.maybeMap(E,function(e){return e instanceof Date?b(e):e})),E===null){if(u)return g&&!C?g(i,f.encoder,w,`key`,x):i;E=``}if(p(E)||r.isBuffer(E)){if(g){var j=C?i:g(i,f.encoder,w,`key`,x);return[S(j)+`=`+S(g(E,f.encoder,w,`value`,x))]}return[S(i)+`=`+S(String(E))]}var M=[];if(E===void 0)return M;var N;if(a===`comma`&&s(E))C&&g&&(E=r.maybeMap(E,g)),N=[{value:E.length>0?E.join(`,`)||null:void 0}];else if(s(_))N=_;else{var ee=Object.keys(E);N=v?ee.sort(v):ee}var P=h?String(i).replace(/\./g,`%2E`):String(i),F=o&&s(E)&&E.length===1?P+`[]`:P;if(c&&s(E)&&E.length===0)return F+`[]`;for(var I=0;I0?b+y:``}}),Rr=fn((exports,t)=>{var n=Ir(),r=Object.prototype.hasOwnProperty,i=Array.isArray,a={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:`utf-8`,charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:n.decode,delimiter:`&`,depth:5,duplicates:`combine`,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1,throwOnLimitExceeded:!1},o=function(e){return e.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},s=function(e,t,n){if(e&&typeof e==`string`&&t.comma&&e.indexOf(`,`)>-1)return e.split(`,`);if(t.throwOnLimitExceeded&&n>=t.arrayLimit)throw RangeError(`Array limit exceeded. Only `+t.arrayLimit+` element`+(t.arrayLimit===1?``:`s`)+` allowed in an array.`);return e},c=`utf8=%26%2310003%3B`,l=`utf8=%E2%9C%93`,u=function(e,t){var u={__proto__:null},d=t.ignoreQueryPrefix?e.replace(/^\?/,``):e;d=d.replace(/%5B/gi,`[`).replace(/%5D/gi,`]`);var f=t.parameterLimit===1/0?void 0:t.parameterLimit,p=d.split(t.delimiter,t.throwOnLimitExceeded?f+1:f);if(t.throwOnLimitExceeded&&p.length>f)throw RangeError(`Parameter limit exceeded. Only `+f+` parameter`+(f===1?``:`s`)+` allowed.`);var m=-1,h,g=t.charset;if(t.charsetSentinel)for(h=0;h-1&&(x=i(x)?[x]:x);var S=r.call(u,b);S&&t.duplicates===`combine`?u[b]=n.combine(u[b],x):(!S||t.duplicates===`last`)&&(u[b]=x)}return u},d=function(e,t,r,i){var a=0;if(e.length>0&&e[e.length-1]===`[]`){var o=e.slice(0,-1).join(``);a=Array.isArray(t)&&t[o]?t[o].length:0}for(var c=i?t:s(t,r,a),l=e.length-1;l>=0;--l){var u,d=e[l];if(d===`[]`&&r.parseArrays)u=r.allowEmptyArrays&&(c===``||r.strictNullHandling&&c===null)?[]:n.combine([],c);else{u=r.plainObjects?{__proto__:null}:{};var f=d.charAt(0)===`[`&&d.charAt(d.length-1)===`]`?d.slice(1,-1):d,p=r.decodeDotInKeys?f.replace(/%2E/g,`.`):f,m=parseInt(p,10);!r.parseArrays&&p===``?u={0:c}:!isNaN(m)&&d!==p&&String(m)===p&&m>=0&&r.parseArrays&&m<=r.arrayLimit?(u=[],u[m]=c):p!==`__proto__`&&(u[p]=c)}c=u}return c},f=function(e,t,n,i){if(e){var a=n.allowDots?e.replace(/\.([^.[]+)/g,`[$1]`):e,o=/(\[[^[\]]*])/,s=/(\[[^[\]]*])/g,c=n.depth>0&&o.exec(a),l=c?a.slice(0,c.index):a,u=[];if(l){if(!n.plainObjects&&r.call(Object.prototype,l)&&!n.allowPrototypes)return;u.push(l)}for(var f=0;n.depth>0&&(c=s.exec(a))!==null&&f{var n=Lr(),r=Rr(),i=Fr();t.exports={formats:i,parse:r,stringify:n}}),Br=fn(exports=>{var t=Nr();function n(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var r=/^([a-z0-9.+-]+:)/i,i=/:[0-9]*$/,a=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,o=[`<`,`>`,`"`,"`",` `,`\r`,` -`,` `],s=[`{`,`}`,`|`,`\\`,`^`,"`"].concat(o),c=[`'`].concat(s),l=[`%`,`/`,`?`,`;`,`#`].concat(c),u=[`/`,`?`,`#`],d=255,f=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},h={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},_=zr();function v(e,t,r){if(e&&typeof e==`object`&&e instanceof n)return e;var i=new n;return i.parse(e,t,r),i}n.prototype.parse=function(e,n,i){if(typeof e!=`string`)throw TypeError(`Parameter 'url' must be a string, not `+typeof e);var o=e.indexOf(`?`),s=o!==-1&&o127?ee+=`x`:ee+=N[P];if(!ee.match(f)){var I=j.slice(0,E),L=j.slice(E+1),te=N.match(p);te&&(I.push(te[1]),L.unshift(te[2])),L.length&&(b=`/`+L.join(`.`)+b),this.hostname=I.join(`.`);break}}}this.hostname.length>d?this.hostname=``:this.hostname=this.hostname.toLowerCase(),A||(this.hostname=t.toASCII(this.hostname));var R=this.port?`:`+this.port:``,ne=this.hostname||``;this.host=ne+R,this.href+=this.host,A&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),b[0]!==`/`&&(b=`/`+b))}if(!m[C])for(var E=0,M=c.length;E0?r.host.split(`@`):!1;w&&(r.auth=w.shift(),r.hostname=w.shift(),r.host=r.hostname)}return r.search=e.search,r.query=e.query,(r.pathname!==null||r.search!==null)&&(r.path=(r.pathname?r.pathname:``)+(r.search?r.search:``)),r.href=r.format(),r}if(!S.length)return r.pathname=null,r.search?r.path=`/`+r.search:r.path=null,r.href=r.format(),r;for(var T=S.slice(-1)[0],E=(r.host||e.host||S.length>1)&&(T===`.`||T===`..`)||T===``,D=0,O=S.length;O>=0;O--)T=S[O],T===`.`?S.splice(O,1):T===`..`?(S.splice(O,1),D++):D&&(S.splice(O,1),D--);if(!b&&!x)for(;D--;)S.unshift(`..`);b&&S[0]!==``&&(!S[0]||S[0].charAt(0)!==`/`)&&S.unshift(``),E&&S.join(`/`).substr(-1)!==`/`&&S.push(``);var k=S[0]===``||S[0]&&S[0].charAt(0)===`/`;if(C){r.hostname=k?``:S.length?S.shift():``,r.host=r.hostname;var w=r.host&&r.host.indexOf(`@`)>0?r.host.split(`@`):!1;w&&(r.auth=w.shift(),r.hostname=w.shift(),r.host=r.hostname)}return b||=r.host&&S.length,b&&!k&&S.unshift(``),S.length>0?r.pathname=S.join(`/`):(r.pathname=null,r.path=null),(r.pathname!==null||r.search!==null)&&(r.path=(r.pathname?r.pathname:``)+(r.search?r.search:``)),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},n.prototype.parseHost=function(){var e=this.host,t=i.exec(e);t&&(t=t[0],t!==`:`&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)},exports.parse=v,exports.resolve=b,exports.format=y}),Vr=gn(jr(),1),Hr=gn(Mr(),1),Ur=gn(Br(),1),Wr={parse:Ur.parse,format:Ur.format,resolve:Ur.resolve};Ar.RETINA_PREFIX=/@([0-9\.]+)x/,Ar.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var Gr=!1,Kr=`6.5.10`;function qr(e){var t;if(!Gr){if(Ar.ADAPTER.getNavigator().userAgent.toLowerCase().indexOf(`chrome`)>-1){var n=[` +var Hn;(function(e){e[e.WEBGL_LEGACY=0]=`WEBGL_LEGACY`,e[e.WEBGL=1]=`WEBGL`,e[e.WEBGL2=2]=`WEBGL2`})(Hn||={});var Un;(function(e){e[e.UNKNOWN=0]=`UNKNOWN`,e[e.WEBGL=1]=`WEBGL`,e[e.CANVAS=2]=`CANVAS`})(Un||={});var Wn;(function(e){e[e.COLOR=16384]=`COLOR`,e[e.DEPTH=256]=`DEPTH`,e[e.STENCIL=1024]=`STENCIL`})(Wn||={});var Gn;(function(e){e[e.NORMAL=0]=`NORMAL`,e[e.ADD=1]=`ADD`,e[e.MULTIPLY=2]=`MULTIPLY`,e[e.SCREEN=3]=`SCREEN`,e[e.OVERLAY=4]=`OVERLAY`,e[e.DARKEN=5]=`DARKEN`,e[e.LIGHTEN=6]=`LIGHTEN`,e[e.COLOR_DODGE=7]=`COLOR_DODGE`,e[e.COLOR_BURN=8]=`COLOR_BURN`,e[e.HARD_LIGHT=9]=`HARD_LIGHT`,e[e.SOFT_LIGHT=10]=`SOFT_LIGHT`,e[e.DIFFERENCE=11]=`DIFFERENCE`,e[e.EXCLUSION=12]=`EXCLUSION`,e[e.HUE=13]=`HUE`,e[e.SATURATION=14]=`SATURATION`,e[e.COLOR=15]=`COLOR`,e[e.LUMINOSITY=16]=`LUMINOSITY`,e[e.NORMAL_NPM=17]=`NORMAL_NPM`,e[e.ADD_NPM=18]=`ADD_NPM`,e[e.SCREEN_NPM=19]=`SCREEN_NPM`,e[e.NONE=20]=`NONE`,e[e.SRC_OVER=0]=`SRC_OVER`,e[e.SRC_IN=21]=`SRC_IN`,e[e.SRC_OUT=22]=`SRC_OUT`,e[e.SRC_ATOP=23]=`SRC_ATOP`,e[e.DST_OVER=24]=`DST_OVER`,e[e.DST_IN=25]=`DST_IN`,e[e.DST_OUT=26]=`DST_OUT`,e[e.DST_ATOP=27]=`DST_ATOP`,e[e.ERASE=26]=`ERASE`,e[e.SUBTRACT=28]=`SUBTRACT`,e[e.XOR=29]=`XOR`})(Gn||={});var Kn;(function(e){e[e.POINTS=0]=`POINTS`,e[e.LINES=1]=`LINES`,e[e.LINE_LOOP=2]=`LINE_LOOP`,e[e.LINE_STRIP=3]=`LINE_STRIP`,e[e.TRIANGLES=4]=`TRIANGLES`,e[e.TRIANGLE_STRIP=5]=`TRIANGLE_STRIP`,e[e.TRIANGLE_FAN=6]=`TRIANGLE_FAN`})(Kn||={});var qn;(function(e){e[e.RGBA=6408]=`RGBA`,e[e.RGB=6407]=`RGB`,e[e.RG=33319]=`RG`,e[e.RED=6403]=`RED`,e[e.RGBA_INTEGER=36249]=`RGBA_INTEGER`,e[e.RGB_INTEGER=36248]=`RGB_INTEGER`,e[e.RG_INTEGER=33320]=`RG_INTEGER`,e[e.RED_INTEGER=36244]=`RED_INTEGER`,e[e.ALPHA=6406]=`ALPHA`,e[e.LUMINANCE=6409]=`LUMINANCE`,e[e.LUMINANCE_ALPHA=6410]=`LUMINANCE_ALPHA`,e[e.DEPTH_COMPONENT=6402]=`DEPTH_COMPONENT`,e[e.DEPTH_STENCIL=34041]=`DEPTH_STENCIL`})(qn||={});var Jn;(function(e){e[e.TEXTURE_2D=3553]=`TEXTURE_2D`,e[e.TEXTURE_CUBE_MAP=34067]=`TEXTURE_CUBE_MAP`,e[e.TEXTURE_2D_ARRAY=35866]=`TEXTURE_2D_ARRAY`,e[e.TEXTURE_CUBE_MAP_POSITIVE_X=34069]=`TEXTURE_CUBE_MAP_POSITIVE_X`,e[e.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]=`TEXTURE_CUBE_MAP_NEGATIVE_X`,e[e.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]=`TEXTURE_CUBE_MAP_POSITIVE_Y`,e[e.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]=`TEXTURE_CUBE_MAP_NEGATIVE_Y`,e[e.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]=`TEXTURE_CUBE_MAP_POSITIVE_Z`,e[e.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]=`TEXTURE_CUBE_MAP_NEGATIVE_Z`})(Jn||={});var Yn;(function(e){e[e.UNSIGNED_BYTE=5121]=`UNSIGNED_BYTE`,e[e.UNSIGNED_SHORT=5123]=`UNSIGNED_SHORT`,e[e.UNSIGNED_SHORT_5_6_5=33635]=`UNSIGNED_SHORT_5_6_5`,e[e.UNSIGNED_SHORT_4_4_4_4=32819]=`UNSIGNED_SHORT_4_4_4_4`,e[e.UNSIGNED_SHORT_5_5_5_1=32820]=`UNSIGNED_SHORT_5_5_5_1`,e[e.UNSIGNED_INT=5125]=`UNSIGNED_INT`,e[e.UNSIGNED_INT_10F_11F_11F_REV=35899]=`UNSIGNED_INT_10F_11F_11F_REV`,e[e.UNSIGNED_INT_2_10_10_10_REV=33640]=`UNSIGNED_INT_2_10_10_10_REV`,e[e.UNSIGNED_INT_24_8=34042]=`UNSIGNED_INT_24_8`,e[e.UNSIGNED_INT_5_9_9_9_REV=35902]=`UNSIGNED_INT_5_9_9_9_REV`,e[e.BYTE=5120]=`BYTE`,e[e.SHORT=5122]=`SHORT`,e[e.INT=5124]=`INT`,e[e.FLOAT=5126]=`FLOAT`,e[e.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]=`FLOAT_32_UNSIGNED_INT_24_8_REV`,e[e.HALF_FLOAT=36193]=`HALF_FLOAT`})(Yn||={});var Xn;(function(e){e[e.FLOAT=0]=`FLOAT`,e[e.INT=1]=`INT`,e[e.UINT=2]=`UINT`})(Xn||={});var Zn;(function(e){e[e.NEAREST=0]=`NEAREST`,e[e.LINEAR=1]=`LINEAR`})(Zn||={});var Qn;(function(e){e[e.CLAMP=33071]=`CLAMP`,e[e.REPEAT=10497]=`REPEAT`,e[e.MIRRORED_REPEAT=33648]=`MIRRORED_REPEAT`})(Qn||={});var $n;(function(e){e[e.OFF=0]=`OFF`,e[e.POW2=1]=`POW2`,e[e.ON=2]=`ON`,e[e.ON_MANUAL=3]=`ON_MANUAL`})($n||={});var er;(function(e){e[e.NPM=0]=`NPM`,e[e.UNPACK=1]=`UNPACK`,e[e.PMA=2]=`PMA`,e[e.NO_PREMULTIPLIED_ALPHA=0]=`NO_PREMULTIPLIED_ALPHA`,e[e.PREMULTIPLY_ON_UPLOAD=1]=`PREMULTIPLY_ON_UPLOAD`,e[e.PREMULTIPLY_ALPHA=2]=`PREMULTIPLY_ALPHA`,e[e.PREMULTIPLIED_ALPHA=2]=`PREMULTIPLIED_ALPHA`})(er||={});var tr;(function(e){e[e.NO=0]=`NO`,e[e.YES=1]=`YES`,e[e.AUTO=2]=`AUTO`,e[e.BLEND=0]=`BLEND`,e[e.CLEAR=1]=`CLEAR`,e[e.BLIT=2]=`BLIT`})(tr||={});var nr;(function(e){e[e.AUTO=0]=`AUTO`,e[e.MANUAL=1]=`MANUAL`})(nr||={});var rr;(function(e){e.LOW=`lowp`,e.MEDIUM=`mediump`,e.HIGH=`highp`})(rr||={});var ir;(function(e){e[e.NONE=0]=`NONE`,e[e.SCISSOR=1]=`SCISSOR`,e[e.STENCIL=2]=`STENCIL`,e[e.SPRITE=3]=`SPRITE`,e[e.COLOR=4]=`COLOR`})(ir||={});var ar;(function(e){e[e.RED=1]=`RED`,e[e.GREEN=2]=`GREEN`,e[e.BLUE=4]=`BLUE`,e[e.ALPHA=8]=`ALPHA`})(ar||={});var or;(function(e){e[e.NONE=0]=`NONE`,e[e.LOW=2]=`LOW`,e[e.MEDIUM=4]=`MEDIUM`,e[e.HIGH=8]=`HIGH`})(or||={});var sr;(function(e){e[e.ELEMENT_ARRAY_BUFFER=34963]=`ELEMENT_ARRAY_BUFFER`,e[e.ARRAY_BUFFER=34962]=`ARRAY_BUFFER`,e[e.UNIFORM_BUFFER=35345]=`UNIFORM_BUFFER`})(sr||={});var cr={createCanvas:function(e,t){var n=document.createElement(`canvas`);return n.width=e,n.height=t,n},getWebGLRenderingContext:function(){return WebGLRenderingContext},getNavigator:function(){return navigator},getBaseUrl:function(){var e;return(e=document.baseURI)??window.location.href},fetch:function(e,t){return fetch(e,t)}},lr=/iPhone/i,ur=/iPod/i,dr=/iPad/i,fr=/\biOS-universal(?:.+)Mac\b/i,pr=/\bAndroid(?:.+)Mobile\b/i,mr=/Android/i,hr=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,gr=/Silk/i,_r=/Windows Phone/i,vr=/\bWindows(?:.+)ARM\b/i,yr=/BlackBerry/i,br=/BB10/i,xr=/Opera Mini/i,Sr=/\b(CriOS|Chrome)(?:.+)Mobile/i,Cr=/Mobile(?:.+)Firefox\b/i,wr=function(e){return e!==void 0&&e.platform===`MacIntel`&&typeof e.maxTouchPoints==`number`&&e.maxTouchPoints>1&&typeof MSStream>`u`};function Tr(e){return function(t){return t.test(e)}}function Er(e){var t={userAgent:``,platform:``,maxTouchPoints:0};!e&&typeof navigator<`u`?t={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof e==`string`?t.userAgent=e:e&&e.userAgent&&(t={userAgent:e.userAgent,platform:e.platform,maxTouchPoints:e.maxTouchPoints||0});var n=t.userAgent,r=n.split(`[FBAN`);r[1]!==void 0&&(n=r[0]),r=n.split(`Twitter`),r[1]!==void 0&&(n=r[0]);var i=Tr(n),a={apple:{phone:i(lr)&&!i(_r),ipod:i(ur),tablet:!i(lr)&&(i(dr)||wr(t))&&!i(_r),universal:i(fr),device:(i(lr)||i(ur)||i(dr)||i(fr)||wr(t))&&!i(_r)},amazon:{phone:i(hr),tablet:!i(hr)&&i(gr),device:i(hr)||i(gr)},android:{phone:!i(_r)&&i(hr)||!i(_r)&&i(pr),tablet:!i(_r)&&!i(hr)&&!i(pr)&&(i(gr)||i(mr)),device:!i(_r)&&(i(hr)||i(gr)||i(pr)||i(mr))||i(/\bokhttp\b/i)},windows:{phone:i(_r),tablet:i(vr),device:i(_r)||i(vr)},other:{blackberry:i(yr),blackberry10:i(br),opera:i(xr),firefox:i(Cr),chrome:i(Sr),device:i(yr)||i(br)||i(xr)||i(Cr)||i(Sr)},any:!1,phone:!1,tablet:!1};return a.any=a.apple.device||a.android.device||a.windows.device||a.other.device,a.phone=a.apple.phone||a.android.phone||a.windows.phone,a.tablet=a.apple.tablet||a.android.tablet||a.windows.tablet,a}var Dr=Er(globalThis.navigator);function Or(){return!Dr.apple.device}function kr(e){var t=!0;if(Dr.tablet||Dr.phone){if(Dr.apple.device){var n=navigator.userAgent.match(/OS (\d+)_(\d+)?/);if(n){var r=parseInt(n[1],10);r<11&&(t=!1)}}if(Dr.android.device){var n=navigator.userAgent.match(/Android\s([0-9.]*)/);if(n){var r=parseInt(n[1],10);r<7&&(t=!1)}}}return t?e:4}var Ar={ADAPTER:cr,MIPMAP_TEXTURES:$n.POW2,ANISOTROPIC_LEVEL:0,RESOLUTION:1,FILTER_RESOLUTION:1,FILTER_MULTISAMPLE:or.NONE,SPRITE_MAX_TEXTURES:kr(32),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,width:800,height:600,autoDensity:!1,backgroundColor:0,backgroundAlpha:1,useContextAlpha:!0,clearBeforeRender:!0,antialias:!1,preserveDrawingBuffer:!1},GC_MODE:nr.AUTO,GC_MAX_IDLE:60*60,GC_MAX_CHECK_COUNT:60*10,WRAP_MODE:Qn.CLAMP,SCALE_MODE:Zn.LINEAR,PRECISION_VERTEX:rr.HIGH,PRECISION_FRAGMENT:Dr.apple.device?rr.HIGH:rr.MEDIUM,CAN_UPLOAD_SAME_BUFFER:Or(),CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1},jr=mn((exports,t)=>{var n=Object.prototype.hasOwnProperty,r=`~`;function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(r=!1));function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,n,i,o){if(typeof n!=`function`)throw TypeError(`The listener must be a function`);var s=new a(n,i||e,o),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function s(e,t){--e._eventsCount===0?e._events=new i:delete e._events[t]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)n.call(t,i)&&e.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},c.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=Array(a);i{t.exports=n,t.exports.default=n;function n(e,t,n){n||=2;var i=t&&t.length,o=i?t[0]*n:e.length,s=r(e,0,o,n,!0),c=[];if(!s||s.next===s.prev)return c;var l,d,f,p,m,h,g;if(i&&(s=u(e,t,s,n)),e.length>80*n){l=f=e[0],d=p=e[1];for(var _=n;_f&&(f=m),h>p&&(p=h);g=Math.max(f-l,p-d),g=g===0?0:32767/g}return a(s,c,n,l,d,g,0),c}function r(e,t,n,r,i){var a,o;if(i===N(e,t,n,r)>0)for(a=t;a=t;a-=r)o=A(a,e[a],e[a+1],o);return o&&S(o,o.next)&&(j(o),o=o.next),o}function i(e,t){if(!e)return e;t||=e;var n=e,r;do if(r=!1,!n.steiner&&(S(n,n.next)||x(n.prev,n,n.next)===0)){if(j(n),n=t=n.prev,n===n.next)break;r=!0}else n=n.next;while(r||n!==t);return t}function a(e,t,n,r,u,d,f){if(e){!f&&d&&h(e,r,u,d);for(var p=e,m,g;e.prev!==e.next;){if(m=e.prev,g=e.next,d?s(e,r,u,d):o(e)){t.push(m.i/n|0),t.push(e.i/n|0),t.push(g.i/n|0),j(e),e=g.next,p=g.next;continue}if(e=g,e===p){f?f===1?(e=c(i(e),t,n),a(e,t,n,r,u,d,2)):f===2&&l(e,t,n,r,u,d):a(i(e),t,n,r,u,d,1);break}}}}function o(e){var t=e.prev,n=e,r=e.next;if(x(t,n,r)>=0)return!1;for(var i=t.x,a=n.x,o=r.x,s=t.y,c=n.y,l=r.y,u=ia?i>o?i:o:a>o?a:o,p=s>c?s>l?s:l:c>l?c:l,m=r.next;m!==t;){if(m.x>=u&&m.x<=f&&m.y>=d&&m.y<=p&&y(i,s,a,c,o,l,m.x,m.y)&&x(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function s(e,t,n,r){var i=e.prev,a=e,o=e.next;if(x(i,a,o)>=0)return!1;for(var s=i.x,c=a.x,l=o.x,u=i.y,d=a.y,f=o.y,p=sc?s>l?s:l:c>l?c:l,g=u>d?u>f?u:f:d>f?d:f,v=_(p,m,t,n,r),b=_(h,g,t,n,r),S=e.prevZ,C=e.nextZ;S&&S.z>=v&&C&&C.z<=b;){if(S.x>=p&&S.x<=h&&S.y>=m&&S.y<=g&&S!==i&&S!==o&&y(s,u,c,d,l,f,S.x,S.y)&&x(S.prev,S,S.next)>=0||(S=S.prevZ,C.x>=p&&C.x<=h&&C.y>=m&&C.y<=g&&C!==i&&C!==o&&y(s,u,c,d,l,f,C.x,C.y)&&x(C.prev,C,C.next)>=0))return!1;C=C.nextZ}for(;S&&S.z>=v;){if(S.x>=p&&S.x<=h&&S.y>=m&&S.y<=g&&S!==i&&S!==o&&y(s,u,c,d,l,f,S.x,S.y)&&x(S.prev,S,S.next)>=0)return!1;S=S.prevZ}for(;C&&C.z<=b;){if(C.x>=p&&C.x<=h&&C.y>=m&&C.y<=g&&C!==i&&C!==o&&y(s,u,c,d,l,f,C.x,C.y)&&x(C.prev,C,C.next)>=0)return!1;C=C.nextZ}return!0}function c(e,t,n){var r=e;do{var a=r.prev,o=r.next.next;!S(a,o)&&C(a,r,r.next,o)&&D(a,o)&&D(o,a)&&(t.push(a.i/n|0),t.push(r.i/n|0),t.push(o.i/n|0),j(r),j(r.next),r=e=o),r=r.next}while(r!==e);return i(r)}function l(e,t,n,r,o,s){var c=e;do{for(var l=c.next.next;l!==c.prev;){if(c.i!==l.i&&b(c,l)){var u=k(c,l);c=i(c,c.next),u=i(u,u.next),a(c,t,n,r,o,s,0),a(u,t,n,r,o,s,0);return}l=l.next}c=c.next}while(c!==e)}function u(e,t,n,i){var a=[],o,s,c,l,u;for(o=0,s=t.length;o=n.next.y&&n.next.y!==n.y){var s=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=r&&s>a&&(a=s,o=n.x=n.x&&n.x>=l&&r!==n.x&&y(io.x||n.x===o.x&&m(o,n)))&&(o=n,d=f)),n=n.next;while(n!==c);return o}function m(e,t){return x(e.prev,e,t.prev)<0&&x(t.next,e,e.next)<0}function h(e,t,n,r){var i=e;do i.z===0&&(i.z=_(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,g(i)}function g(e){var t,n,r,i,a,o,s,c,l=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,r=n,s=0,t=0;t0||c>0&&r;)s!==0&&(c===0||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,c--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;n=r}a.nextZ=null,l*=2}while(o>1);return e}function _(e,t,n,r,i){return e=(e-n)*i|0,t=(t-r)*i|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function v(e){var t=e,n=e;do(t.x=(e-o)*(a-s)&&(e-o)*(r-s)>=(n-o)*(t-s)&&(n-o)*(a-s)>=(i-o)*(r-s)}function b(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!E(e,t)&&(D(e,t)&&D(t,e)&&O(e,t)&&(x(e.prev,e,t.prev)||x(e,t.prev,t))||S(e,t)&&x(e.prev,e,e.next)>0&&x(t.prev,t,t.next)>0)}function x(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function S(e,t){return e.x===t.x&&e.y===t.y}function C(e,t,n,r){var i=T(x(e,t,n)),a=T(x(e,t,r)),o=T(x(n,r,e)),s=T(x(n,r,t));return!!(i!==a&&o!==s||i===0&&w(e,n,t)||a===0&&w(e,r,t)||o===0&&w(n,e,r)||s===0&&w(n,t,r))}function w(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function T(e){return e>0?1:e<0?-1:0}function E(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&C(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function D(e,t){return x(e.prev,e,e.next)<0?x(e,t,e.next)>=0&&x(e,e.prev,t)>=0:x(e,t,e.prev)<0||x(e,e.next,t)<0}function O(e,t){var n=e,r=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do n.y>a!=n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function k(e,t){var n=new M(e.i,e.x,e.y),r=new M(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function A(e,t,n,r){var i=new M(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function j(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function M(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}n.deviation=function(e,t,n,r){var i=t&&t.length,a=i?t[0]*n:e.length,o=Math.abs(N(e,0,a,n));if(i)for(var s=0,c=t.length;s0&&(r+=e[i-1].length,n.holes.push(r))}return n}}),Nr=mn((exports,t)=>{(function(n){var r=typeof exports==`object`&&exports&&!exports.nodeType&&exports,i=typeof t==`object`&&t&&!t.nodeType&&t,a=typeof global==`object`&&global;(a.global===a||a.window===a||a.self===a)&&(n=a);var o,s=2147483647,c=36,l=1,u=26,d=38,f=700,p=72,m=128,h=`-`,g=/^xn--/,_=/[^\x20-\x7E]/,v=/[\x2E\u3002\uFF0E\uFF61]/g,y={overflow:`Overflow: input needs wider integers to process`,"not-basic":`Illegal input >= 0x80 (not a basic code point)`,"invalid-input":`Invalid input`},b=c-l,x=Math.floor,S=String.fromCharCode,C;function w(e){throw RangeError(y[e])}function T(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function E(e,t){var n=e.split(`@`),r=``;n.length>1&&(r=n[0]+`@`,e=n[1]),e=e.replace(v,`.`);var i=e.split(`.`),a=T(i,t).join(`.`);return r+a}function D(e){for(var t=[],n=0,r=e.length,i,a;n=55296&&i<=56319&&n65535&&(e-=65536,t+=S(e>>>10&1023|55296),e=56320|e&1023),t+=S(e),t}).join(``)}function k(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:c}function A(e,t){return e+22+75*(e<26)-((t!=0)<<5)}function j(e,t,n){var r=0;for(e=n?x(e/f):e>>1,e+=x(e/t);e>b*u>>1;r+=c)e=x(e/b);return x(r+(b+1)*e/(e+d))}function M(e){var t=[],n=e.length,r,i=0,a=m,o=p,d,f,g,_,v,y,b,S,C;for(d=e.lastIndexOf(h),d<0&&(d=0),f=0;f=128&&w(`not-basic`),t.push(e.charCodeAt(f));for(g=d>0?d+1:0;g=n&&w(`invalid-input`),b=k(e.charCodeAt(g++)),(b>=c||b>x((s-i)/v))&&w(`overflow`),i+=b*v,S=y<=o?l:y>=o+u?u:y-o,!(bx(s/C)&&w(`overflow`),v*=C;r=t.length+1,o=j(i-_,r,_==0),x(i/r)>s-a&&w(`overflow`),a+=x(i/r),i%=r,t.splice(i++,0,a)}return O(t)}function N(e){var t,n,r,i,a,o,d,f,g,_,v,y=[],b,C,T,E;for(e=D(e),b=e.length,t=m,n=0,a=p,o=0;o=t&&vx((s-n)/C)&&w(`overflow`),n+=(d-t)*C,t=d,o=0;os&&w(`overflow`),v==t){for(f=n,g=c;_=g<=a?l:g>=a+u?u:g-a,!(f<_);g+=c)E=f-_,T=c-_,y.push(S(A(_+E%T,0))),f=x(E/T);y.push(S(A(f,0))),a=j(n,C,r==i),n=0,++r}++n,++t}return y.join(``)}function ee(e){return E(e,function(e){return g.test(e)?M(e.slice(4).toLowerCase()):e})}function P(e){return E(e,function(e){return _.test(e)?`xn--`+N(e):e})}if(o={version:`1.4.1`,ucs2:{decode:D,encode:O},decode:M,encode:N,toASCII:P,toUnicode:ee},typeof define==`function`&&typeof define.amd==`object`&&define.amd)define(`punycode`,function(){return o});else if(r&&i)if(t.exports==r)i.exports=o;else for(C in o)o.hasOwnProperty(C)&&(r[C]=o[C]);else n.punycode=o})(exports)}),Pr=mn((exports,t)=>{Object.defineProperty(exports,`__esModule`,{value:!0});function n(){let e,t,n=n=>{if(n&&(typeof n==`object`||typeof n==`function`)){if(e)return e.get(n)}else if(t)return t.get(n)},r=(n,r)=>{n&&(typeof n==`object`||typeof n==`function`)?(e||=new WeakMap,e.set(n,r)):(t||=new Map,t.set(n,r))},i=n=>{if(n&&(typeof n==`object`||typeof n==`function`)){if(e)return e.has(n)}else if(t)return t.has(n);return!1},a=e=>{if(!i(e))throw TypeError(`Side channel does not contain the given key`)};return{get:n,set:r,has:i,assert:a}}exports.default=n,(typeof exports.default==`object`&&exports.default!==null||typeof exports.default==`function`)&&(Object.assign(exports.default,exports),t.exports=exports.default)}),Fr=mn((exports,t)=>{var n=String.prototype.replace,r=/%20/g,i={RFC1738:`RFC1738`,RFC3986:`RFC3986`};t.exports={default:i.RFC3986,formatters:{RFC1738:function(e){return n.call(e,r,`+`)},RFC3986:function(e){return String(e)}},RFC1738:i.RFC1738,RFC3986:i.RFC3986}}),Ir=mn((exports,t)=>{var n=Fr(),r=Object.prototype.hasOwnProperty,i=Array.isArray,a=function(){for(var e=[],t=0;t<256;++t)e.push(`%`+((t<16?`0`:``)+t.toString(16)).toUpperCase());return e}(),o=function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(i(n)){for(var r=[],a=0;a=d?s.slice(l,l+d):s,f=[],p=0;p=48&&m<=57||m>=65&&m<=90||m>=97&&m<=122||o===n.RFC1738&&(m===40||m===41)){f[f.length]=u.charAt(p);continue}if(m<128){f[f.length]=a[m];continue}if(m<2048){f[f.length]=a[192|m>>6]+a[128|m&63];continue}if(m<55296||m>=57344){f[f.length]=a[224|m>>12]+a[128|m>>6&63]+a[128|m&63];continue}p+=1,m=65536+((m&1023)<<10|u.charCodeAt(p)&1023),f[f.length]=a[240|m>>18]+a[128|m>>12&63]+a[128|m>>6&63]+a[128|m&63]}c+=f.join(``)}return c},p=function(e){for(var t=[{obj:{o:e},prop:`o`}],n=[],r=0;r{var n=Pr(),r=Ir(),i=Fr(),a=Object.prototype.hasOwnProperty,o={brackets:function(e){return e+`[]`},comma:`comma`,indices:function(e,t){return e+`[`+t+`]`},repeat:function(e){return e}},s=Array.isArray,c=Array.prototype.push,l=function(e,t){c.apply(e,s(t)?t:[t])},u=Date.prototype.toISOString,d=i.default,f={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:`indices`,charset:`utf-8`,charsetSentinel:!1,commaRoundTrip:!1,delimiter:`&`,encode:!0,encodeDotInKeys:!1,encoder:r.encode,encodeValuesOnly:!1,filter:void 0,format:d,formatter:i.formatters[d],indices:!1,serializeDate:function(e){return u.call(e)},skipNulls:!1,strictNullHandling:!1},p=function(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||typeof e==`symbol`||typeof e==`bigint`},m={},h=function e(t,i,a,o,c,u,d,h,g,_,v,y,b,x,S,C,w,T){for(var E=t,D=T,O=0,k=!1;(D=D.get(m))!==void 0&&!k;){var A=D.get(t);if(O+=1,A!==void 0){if(A===O)throw RangeError(`Cyclic object value`);k=!0}D.get(m)===void 0&&(O=0)}if(typeof _==`function`?E=_(i,E):E instanceof Date?E=b(E):a===`comma`&&s(E)&&(E=r.maybeMap(E,function(e){return e instanceof Date?b(e):e})),E===null){if(u)return g&&!C?g(i,f.encoder,w,`key`,x):i;E=``}if(p(E)||r.isBuffer(E)){if(g){var j=C?i:g(i,f.encoder,w,`key`,x);return[S(j)+`=`+S(g(E,f.encoder,w,`value`,x))]}return[S(i)+`=`+S(String(E))]}var M=[];if(E===void 0)return M;var N;if(a===`comma`&&s(E))C&&g&&(E=r.maybeMap(E,g)),N=[{value:E.length>0?E.join(`,`)||null:void 0}];else if(s(_))N=_;else{var ee=Object.keys(E);N=v?ee.sort(v):ee}var P=h?String(i).replace(/\./g,`%2E`):String(i),F=o&&s(E)&&E.length===1?P+`[]`:P;if(c&&s(E)&&E.length===0)return F+`[]`;for(var I=0;I0?b+y:``}}),Rr=mn((exports,t)=>{var n=Ir(),r=Object.prototype.hasOwnProperty,i=Array.isArray,a={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:`utf-8`,charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:n.decode,delimiter:`&`,depth:5,duplicates:`combine`,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1,throwOnLimitExceeded:!1},o=function(e){return e.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},s=function(e,t,n){if(e&&typeof e==`string`&&t.comma&&e.indexOf(`,`)>-1)return e.split(`,`);if(t.throwOnLimitExceeded&&n>=t.arrayLimit)throw RangeError(`Array limit exceeded. Only `+t.arrayLimit+` element`+(t.arrayLimit===1?``:`s`)+` allowed in an array.`);return e},c=`utf8=%26%2310003%3B`,l=`utf8=%E2%9C%93`,u=function(e,t){var u={__proto__:null},d=t.ignoreQueryPrefix?e.replace(/^\?/,``):e;d=d.replace(/%5B/gi,`[`).replace(/%5D/gi,`]`);var f=t.parameterLimit===1/0?void 0:t.parameterLimit,p=d.split(t.delimiter,t.throwOnLimitExceeded?f+1:f);if(t.throwOnLimitExceeded&&p.length>f)throw RangeError(`Parameter limit exceeded. Only `+f+` parameter`+(f===1?``:`s`)+` allowed.`);var m=-1,h,g=t.charset;if(t.charsetSentinel)for(h=0;h-1&&(x=i(x)?[x]:x);var S=r.call(u,b);S&&t.duplicates===`combine`?u[b]=n.combine(u[b],x):(!S||t.duplicates===`last`)&&(u[b]=x)}return u},d=function(e,t,r,i){var a=0;if(e.length>0&&e[e.length-1]===`[]`){var o=e.slice(0,-1).join(``);a=Array.isArray(t)&&t[o]?t[o].length:0}for(var c=i?t:s(t,r,a),l=e.length-1;l>=0;--l){var u,d=e[l];if(d===`[]`&&r.parseArrays)u=r.allowEmptyArrays&&(c===``||r.strictNullHandling&&c===null)?[]:n.combine([],c);else{u=r.plainObjects?{__proto__:null}:{};var f=d.charAt(0)===`[`&&d.charAt(d.length-1)===`]`?d.slice(1,-1):d,p=r.decodeDotInKeys?f.replace(/%2E/g,`.`):f,m=parseInt(p,10);!r.parseArrays&&p===``?u={0:c}:!isNaN(m)&&d!==p&&String(m)===p&&m>=0&&r.parseArrays&&m<=r.arrayLimit?(u=[],u[m]=c):p!==`__proto__`&&(u[p]=c)}c=u}return c},f=function(e,t,n,i){if(e){var a=n.allowDots?e.replace(/\.([^.[]+)/g,`[$1]`):e,o=/(\[[^[\]]*])/,s=/(\[[^[\]]*])/g,c=n.depth>0&&o.exec(a),l=c?a.slice(0,c.index):a,u=[];if(l){if(!n.plainObjects&&r.call(Object.prototype,l)&&!n.allowPrototypes)return;u.push(l)}for(var f=0;n.depth>0&&(c=s.exec(a))!==null&&f{var n=Lr(),r=Rr(),i=Fr();t.exports={formats:i,parse:r,stringify:n}}),Br=mn(exports=>{var t=Nr();function n(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var r=/^([a-z0-9.+-]+:)/i,i=/:[0-9]*$/,a=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,o=[`<`,`>`,`"`,"`",` `,`\r`,` +`,` `],s=[`{`,`}`,`|`,`\\`,`^`,"`"].concat(o),c=[`'`].concat(s),l=[`%`,`/`,`?`,`;`,`#`].concat(c),u=[`/`,`?`,`#`],d=255,f=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},h={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},_=zr();function v(e,t,r){if(e&&typeof e==`object`&&e instanceof n)return e;var i=new n;return i.parse(e,t,r),i}n.prototype.parse=function(e,n,i){if(typeof e!=`string`)throw TypeError(`Parameter 'url' must be a string, not `+typeof e);var o=e.indexOf(`?`),s=o!==-1&&o127?ee+=`x`:ee+=N[P];if(!ee.match(f)){var I=j.slice(0,E),L=j.slice(E+1),te=N.match(p);te&&(I.push(te[1]),L.unshift(te[2])),L.length&&(b=`/`+L.join(`.`)+b),this.hostname=I.join(`.`);break}}}this.hostname.length>d?this.hostname=``:this.hostname=this.hostname.toLowerCase(),A||(this.hostname=t.toASCII(this.hostname));var R=this.port?`:`+this.port:``,ne=this.hostname||``;this.host=ne+R,this.href+=this.host,A&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),b[0]!==`/`&&(b=`/`+b))}if(!m[C])for(var E=0,M=c.length;E0?r.host.split(`@`):!1;w&&(r.auth=w.shift(),r.hostname=w.shift(),r.host=r.hostname)}return r.search=e.search,r.query=e.query,(r.pathname!==null||r.search!==null)&&(r.path=(r.pathname?r.pathname:``)+(r.search?r.search:``)),r.href=r.format(),r}if(!S.length)return r.pathname=null,r.search?r.path=`/`+r.search:r.path=null,r.href=r.format(),r;for(var T=S.slice(-1)[0],E=(r.host||e.host||S.length>1)&&(T===`.`||T===`..`)||T===``,D=0,O=S.length;O>=0;O--)T=S[O],T===`.`?S.splice(O,1):T===`..`?(S.splice(O,1),D++):D&&(S.splice(O,1),D--);if(!b&&!x)for(;D--;)S.unshift(`..`);b&&S[0]!==``&&(!S[0]||S[0].charAt(0)!==`/`)&&S.unshift(``),E&&S.join(`/`).substr(-1)!==`/`&&S.push(``);var k=S[0]===``||S[0]&&S[0].charAt(0)===`/`;if(C){r.hostname=k?``:S.length?S.shift():``,r.host=r.hostname;var w=r.host&&r.host.indexOf(`@`)>0?r.host.split(`@`):!1;w&&(r.auth=w.shift(),r.hostname=w.shift(),r.host=r.hostname)}return b||=r.host&&S.length,b&&!k&&S.unshift(``),S.length>0?r.pathname=S.join(`/`):(r.pathname=null,r.path=null),(r.pathname!==null||r.search!==null)&&(r.path=(r.pathname?r.pathname:``)+(r.search?r.search:``)),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},n.prototype.parseHost=function(){var e=this.host,t=i.exec(e);t&&(t=t[0],t!==`:`&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)},exports.parse=v,exports.resolve=b,exports.format=y}),Vr=vn(jr(),1),Hr=vn(Mr(),1),Ur=vn(Br(),1),Wr={parse:Ur.parse,format:Ur.format,resolve:Ur.resolve};Ar.RETINA_PREFIX=/@([0-9\.]+)x/,Ar.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var Gr=!1,Kr=`6.5.10`;function qr(e){var t;if(!Gr){if(Ar.ADAPTER.getNavigator().userAgent.toLowerCase().indexOf(`chrome`)>-1){var n=[` %c %c %c PixiJS `+Kr+` - ✰ `+e+` ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ `,`background: #ff66a5; padding:5px 0;`,`background: #ff66a5; padding:5px 0;`,`color: #ff66a5; background: #030307; padding:5px 0;`,`background: #ff66a5; padding:5px 0;`,`background: #ffc3dc; padding:5px 0;`,`background: #ff66a5; padding:5px 0;`,`color: #ff2424; background: #fff; padding:5px 0;`,`color: #ff2424; background: #fff; padding:5px 0;`,`color: #ff2424; background: #fff; padding:5px 0;`];(t=globalThis.console).log.apply(t,n)}else globalThis.console&&globalThis.console.log(`PixiJS `+Kr+` - `+e+` - http://www.pixijs.com/`);Gr=!0}}var Jr;function Yr(){return Jr===void 0&&(Jr=function(){var e={stencil:!0,failIfMajorPerformanceCaveat:Ar.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!Ar.ADAPTER.getWebGLRenderingContext())return!1;var t=Ar.ADAPTER.createCanvas(),n=t.getContext(`webgl`,e)||t.getContext(`experimental-webgl`,e),r=!!(n&&n.getContextAttributes().stencil);if(n){var i=n.getExtension(`WEBGL_lose_context`);i&&i.loseContext()}return n=null,r}catch{return!1}}()),Jr}function Xr(e,t){return t===void 0&&(t=[]),t[0]=(e>>16&255)/255,t[1]=(e>>8&255)/255,t[2]=(e&255)/255,t}function Zr(e){var t=e.toString(16);return t=`000000`.substring(0,6-t.length)+t,`#`+t}function Qr(e){return(e[0]*255<<16)+(e[1]*255<<8)+(e[2]*255|0)}function $r(){for(var e=[],t=[],n=0;n<32;n++)e[n]=n,t[n]=n;e[Gn.NORMAL_NPM]=Gn.NORMAL,e[Gn.ADD_NPM]=Gn.ADD,e[Gn.SCREEN_NPM]=Gn.SCREEN,t[Gn.NORMAL]=Gn.NORMAL_NPM,t[Gn.ADD]=Gn.ADD_NPM,t[Gn.SCREEN]=Gn.SCREEN_NPM;var r=[];return r.push(t),r.push(e),r}var ei=$r();function ti(e,t){if(t===1)return(t*255<<24)+e;if(t===0)return 0;var n=e>>16&255,r=e>>8&255,i=e&255;return n=n*t+.5|0,r=r*t+.5|0,i=i*t+.5|0,(t*255<<24)+(n<<16)+(r<<8)+i}function ni(e){if(e.BYTES_PER_ELEMENT===4)return e instanceof Float32Array?`Float32Array`:e instanceof Uint32Array?`Uint32Array`:`Int32Array`;if(e.BYTES_PER_ELEMENT===2){if(e instanceof Uint16Array)return`Uint16Array`}else if(e.BYTES_PER_ELEMENT===1&&e instanceof Uint8Array)return`Uint8Array`;return null}function ri(e){return e+=e===0?1:0,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e+1}function ii(e){return!(e&e-1)&&!!e}function ai(e){var t=(e>65535?1:0)<<4;e>>>=t;var n=(e>255?1:0)<<3;return e>>>=n,t|=n,n=(e>15?1:0)<<2,e>>>=n,t|=n,n=(e>3?1:0)<<1,e>>>=n,t|=n,t|e>>1}function oi(e,t,n){var r=e.length,i;if(!(t>=r||n===0)){n=t+n>r?r-t:n;var a=r-n;for(i=t;ie.emit(`expressionLoadError`,t,n);try{let i=e.definitions[t];if(!i)return Promise.resolve(void 0);e.listeners(`destroy`).includes(rd.releaseTasks)||e.once(`destroy`,rd.releaseTasks);let a=rd.expressionTasksMap.get(e);a||(a=[],rd.expressionTasksMap.set(e,a));let o=e.getExpressionFile(i);return(n=a[t])??(a[t]=Ju.load({url:o,settings:e.settings,type:`json`,target:e}).then(n=>{let r=rd.expressionTasksMap.get(e);r&&delete r[t];let a=e.createExpression(n,i);return e.emit(`expressionLoaded`,t,a),a}).catch(t=>{wu.warn(e.tag,`Failed to load expression: ${o} `,t),r(t)})),a[t]}catch(n){wu.warn(e.tag,`Failed to load expression at [${t}] -`,n),r(n)}return Promise.resolve(void 0)}static releaseTasks(){this instanceof Bu?rd.motionTasksMap.delete(this):rd.expressionTasksMap.delete(this)}};let id=rd;id.runtimes=[],id.urlToJSON=Zu,id.jsonToSettings=Qu,id.waitUntilReady=$u,id.setupOptionals=ed,id.setupEssentials=td,id.createInternalModel=nd,id.live2DModelMiddlewares=[Zu,Qu,$u,ed,td,nd],id.motionTasksMap=new WeakMap,id.expressionTasksMap=new WeakMap,Bu.prototype._loadMotion=function(e,t){return id.loadMotion(this,e,t)},ku.prototype._loadExpression=function(e){return id.loadExpression(this,e)};var ad=class{constructor(){this._autoInteract=!1}get autoInteract(){return this._autoInteract}set autoInteract(e){e!==this._autoInteract&&(e?this.on(`pointertap`,od,this):this.off(`pointertap`,od,this),this._autoInteract=e)}registerInteraction(e){e!==this.interactionManager&&(this.unregisterInteraction(),this._autoInteract&&e&&(this.interactionManager=e,e.on(`pointermove`,sd,this)))}unregisterInteraction(){var e;this.interactionManager&&((e=this.interactionManager)==null||e.off(`pointermove`,sd,this),this.interactionManager=void 0)}};function od(e){this.tap(e.data.global.x,e.data.global.y)}function sd(e){this.focus(e.data.global.x,e.data.global.y)}var cd=class extends Yi{};const ld=new ji,ud=new zi;let dd;var fd=class extends oc{constructor(e){super(),this.tag=`Live2DModel(uninitialized)`,this.textures=[],this.transform=new cd,this.anchor=new Ri(this.onAnchorChange,this,0,0),this.glContextID=-1,this.elapsedTime=performance.now(),this.deltaTime=0,this._autoUpdate=!1,this.once(`modelLoaded`,()=>this.init(e))}static from(e,t){let n=new this(t);return id.setupLive2DModel(n,e,t).then(()=>n)}static fromSync(e,t){let n=new this(t);return id.setupLive2DModel(n,e,t).then(t?.onLoad).catch(t?.onError),n}static registerTicker(e){dd=e}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){var t;dd||=(t=window.PIXI)?.Ticker,e?this._destroyed||(dd?(dd.shared.add(this.onTickerUpdate,this),this._autoUpdate=!0):wu.warn(this.tag,`No Ticker registered, please call Live2DModel.registerTicker(Ticker).`)):(dd?.shared.remove(this.onTickerUpdate,this),this._autoUpdate=!1)}init(e){this.tag=`Live2DModel(${this.internalModel.settings.name})`;let t=Object.assign({autoUpdate:!0,autoInteract:!0},e);t.autoInteract&&(this.interactive=!0),this.autoInteract=t.autoInteract,this.autoUpdate=t.autoUpdate}onAnchorChange(){this.pivot.set(this.anchor.x*this.internalModel.width,this.anchor.y*this.internalModel.height)}motion(e,t,n){return t===void 0?this.internalModel.motionManager.startRandomMotion(e,n):this.internalModel.motionManager.startMotion(e,t,n)}expression(e){return this.internalModel.motionManager.expressionManager?e===void 0?this.internalModel.motionManager.expressionManager.setRandomExpression():this.internalModel.motionManager.expressionManager.setExpression(e):Promise.resolve(!1)}focus(e,t,n=!1){ld.x=e,ld.y=t,this.toModelPosition(ld,ld,!0);let r=ld.x/this.internalModel.originalWidth*2-1,i=ld.y/this.internalModel.originalHeight*2-1,a=Math.atan2(i,r);this.internalModel.focusController.focus(Math.cos(a),-Math.sin(a),n)}tap(e,t){let n=this.hitTest(e,t);n.length&&(wu.log(this.tag,`Hit`,n),this.emit(`hit`,n))}hitTest(e,t){return ld.x=e,ld.y=t,this.toModelPosition(ld,ld),this.internalModel.hitTest(ld.x,ld.y)}toModelPosition(e,t=e.clone(),n){return n||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.transform.worldTransform.applyInverse(e,t),this.internalModel.localTransform.applyInverse(t,t),t}containsPoint(e){return this.getBounds(!0).contains(e.x,e.y)}_calculateBounds(){this._bounds.addFrame(this.transform,0,0,this.internalModel.width,this.internalModel.height)}onTickerUpdate(){this.update(dd.shared.deltaMS)}update(e){this.deltaTime+=e,this.elapsedTime+=e}_render(e){this.registerInteraction(e.plugins.interaction),e.batch.reset(),e.geometry.reset(),e.shader.reset(),e.state.reset();let t=!1;this.glContextID!==e.CONTEXT_UID&&(this.glContextID=e.CONTEXT_UID,this.internalModel.updateWebGLContext(e.gl,this.glContextID),t=!0);for(let n=0;nt.destroy(e.baseTexture)),this.internalModel.destroy(),super.destroy(e)}};Eu(fd,[ad]);const pd=class{static resolveURL(e,t){var n;let r=(n=pd.filesMap[e])?.[t];if(r===void 0)throw Error(`Cannot find this file from uploaded files: `+t);return r}static upload(e,t){return uc(this,null,function*(){let n={};for(let r of t.getDefinedFiles()){let i=decodeURI(Wr.resolve(t.url,r)),a=e.find(e=>e.webkitRelativePath===i);a&&(n[r]=URL.createObjectURL(a))}pd.filesMap[t._objectURL]=n})}static createSettings(e){return uc(this,null,function*(){let t=e.find(e=>e.name.endsWith(`model.json`)||e.name.endsWith(`model3.json`));if(!t)throw TypeError(`Settings file not found`);let n=yield pd.readText(t),r=JSON.parse(n);r.url=t.webkitRelativePath;let i=id.findRuntime(r);if(!i)throw Error(`Unknown settings JSON`);let a=i.createModelSettings(r);return a._objectURL=URL.createObjectURL(t),a})}static readText(e){return uc(this,null,function*(){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(r.result),r.onerror=n,r.readAsText(e,`utf8`)})})}};let md=pd;md.filesMap={},md.factory=(e,t)=>uc(void 0,null,function*(){if(Array.isArray(e.source)&&e.source[0]instanceof File){let t=e.source,n=t.settings;if(!n)n=yield pd.createSettings(t);else if(!n._objectURL)throw Error(`"_objectURL" must be specified in ModelSettings`);n.validateFiles(t.map(e=>encodeURI(e.webkitRelativePath))),yield pd.upload(t,n),n.resolveURL=function(e){return pd.resolveURL(this._objectURL,e)},e.source=n,e.live2dModel.once(`modelLoaded`,e=>{e.once(`destroy`,function(){let e=this.settings._objectURL;if(URL.revokeObjectURL(e),pd.filesMap[e])for(let t of Object.values(pd.filesMap[e]))URL.revokeObjectURL(t);delete pd.filesMap[e]})})}return t()}),id.live2DModelMiddlewares.unshift(md.factory);const hd=class{static unzip(e,t){return uc(this,null,function*(){let n=yield hd.getFilePaths(e),r=[];for(let e of t.getDefinedFiles()){let i=decodeURI(Wr.resolve(t.url,e));n.includes(i)&&r.push(i)}let i=yield hd.getFiles(e,r);for(let e=0;ee.endsWith(`model.json`)||e.endsWith(`model3.json`));if(!n)throw Error(`Settings file not found`);let r=yield hd.readText(e,n);if(!r)throw Error(`Empty settings file: `+n);let i=JSON.parse(r);i.url=n;let a=id.findRuntime(i);if(!a)throw Error(`Unknown settings JSON`);return a.createModelSettings(i)})}static zipReader(e,t){return uc(this,null,function*(){throw Error(`Not implemented`)})}static getFilePaths(e){return uc(this,null,function*(){throw Error(`Not implemented`)})}static getFiles(e,t){return uc(this,null,function*(){throw Error(`Not implemented`)})}static readText(e,t){return uc(this,null,function*(){throw Error(`Not implemented`)})}static releaseReader(e){}};let gd=hd;if(gd.ZIP_PROTOCOL=`zip://`,gd.uid=0,gd.factory=(e,t)=>uc(void 0,null,function*(){let n=e.source,r,i,a;if(typeof n==`string`&&(n.endsWith(`.zip`)||n.startsWith(hd.ZIP_PROTOCOL))?(r=n.startsWith(hd.ZIP_PROTOCOL)?n.slice(hd.ZIP_PROTOCOL.length):n,i=yield Ju.load({url:r,type:`blob`,target:e.live2dModel})):Array.isArray(n)&&n.length===1&&n[0]instanceof File&&n[0].name.endsWith(`.zip`)&&(i=n[0],r=URL.createObjectURL(i),a=n.settings),i){if(!i.size)throw Error(`Empty zip file`);let t=yield hd.zipReader(i,r);a||=yield hd.createSettings(t),a._objectURL=hd.ZIP_PROTOCOL+hd.uid+`/`+a.url;let n=yield hd.unzip(t,a);n.settings=a,e.source=n,r.startsWith(`blob:`)&&e.live2dModel.once(`modelLoaded`,e=>{e.once(`destroy`,function(){URL.revokeObjectURL(r)})}),hd.releaseReader(t)}return t()}),id.live2DModelMiddlewares.unshift(gd.factory),!window.Live2DCubismCore)throw Error(`Could not find Cubism 4 runtime. This plugin requires live2dcubismcore.js to be loaded.`);var _d=class extends ku{constructor(e,t){var n;super(e,t),this.queueManager=new gl,this.definitions=(n=e.expressions)??[],this.init()}isFinished(){return this.queueManager.isFinished()}getExpressionIndex(e){return this.definitions.findIndex(t=>t.Name===e)}getExpressionFile(e){return e.File}createExpression(e,t){return Uc.create(e)}_setExpression(e){return this.queueManager.startMotion(e,!1,performance.now())}stopAllExpressions(){this.queueManager.stopAllMotions()}updateParameters(e,t){return this.queueManager.doUpdateMotion(e,t)}},vd=class e extends Pu{constructor(t){if(super(t),!e.isValidJSON(t))throw TypeError(`Invalid JSON.`);Object.assign(this,new pu(t))}static isValidJSON(e){var t;return!!e?.FileReferences&&typeof e.FileReferences.Moc==`string`&&(t=e.FileReferences.Textures)?.length>0&&e.FileReferences.Textures.every(e=>typeof e==`string`)}replaceFiles(e){if(super.replaceFiles(e),this.motions)for(let[t,n]of Object.entries(this.motions))for(let r=0;r{this.emit(`motion:`+t)})}isFinished(){return this.queueManager.isFinished()}_startMotion(e,t){return e.setFinishedMotionHandler(t),this.queueManager.stopAllMotions(),this.queueManager.startMotion(e,!1,performance.now())}_stopAllMotions(){this.queueManager.stopAllMotions()}createMotion(e,t,n){let r=ml.create(e),i=new $c(e),a=(t===this.groups.idle?Cu.idleMotionFadingDuration:Cu.motionFadingDuration)/1e3;return i.getMotionFadeInTime()===void 0&&r.setFadeInTime(n.FadeInTime>0?n.FadeInTime:a),i.getMotionFadeOutTime()===void 0&&r.setFadeOutTime(n.FadeOutTime>0?n.FadeOutTime:a),r.setEffectIds(this.eyeBlinkIds,this.lipSyncIds),r}getMotionFile(e){return e.File}getMotionName(e){return e.File}getSoundFile(e){return e.Sound}updateParameters(e,t){return this.queueManager.doUpdateMotion(e,t)}destroy(){super.destroy(),this.queueManager.release(),this.queueManager=void 0}};const bd=new Cc;var xd=class extends Hu{constructor(e,t,n){super(),this.lipSync=!0,this.breath=dc.create(),this.renderer=new fu,this.idParamAngleX=mu,this.idParamAngleY=hu,this.idParamAngleZ=gu,this.idParamEyeBallX=_u,this.idParamEyeBallY=vu,this.idParamBodyAngleX=yu,this.idParamBreath=bu,this.pixelsPerUnit=1,this.centeringTransform=new zi,this.coreModel=e,this.settings=t,this.motionManager=new yd(t,n),this.init()}init(){var e;super.init(),(e=this.settings.getEyeBlinkParameters())?.length>0&&(this.eyeBlink=mc.create(this.settings)),this.breath.setParameters([new fc(this.idParamAngleX,0,15,6.5345,.5),new fc(this.idParamAngleY,0,8,3.5345,.5),new fc(this.idParamAngleZ,0,10,5.5345,.5),new fc(this.idParamBodyAngleX,0,4,15.5345,.5),new fc(this.idParamBreath,0,.5,3.2345,.5)]),this.renderer.initialize(this.coreModel),this.renderer.setIsPremultipliedAlpha(!0)}getSize(){return[this.coreModel.getModel().canvasinfo.CanvasWidth,this.coreModel.getModel().canvasinfo.CanvasHeight]}getLayout(){let e={};if(this.settings.layout)for(let t of Object.keys(this.settings.layout)){let n=t.charAt(0).toLowerCase()+t.slice(1);e[n]=this.settings.layout[t]}return e}setupLayout(){super.setupLayout(),this.pixelsPerUnit=this.coreModel.getModel().canvasinfo.PixelsPerUnit,this.centeringTransform.scale(this.pixelsPerUnit,this.pixelsPerUnit).translate(this.originalWidth/2,this.originalHeight/2)}updateWebGLContext(e,t){this.renderer.firstDraw=!0,this.renderer._bufferData={vertex:null,uv:null,index:null},this.renderer.startUp(e),this.renderer._clippingManager._currentFrameNo=t,this.renderer._clippingManager._maskTexture=void 0,ru.getInstance()._shaderSets=[]}bindTexture(e,t){this.renderer.bindTexture(e,t)}getHitAreaDefs(){var e,t;return(t=(e=this.settings.hitAreas)?.map(e=>({id:e.Id,name:e.Name,index:this.coreModel.getDrawableIndex(e.Id)})))??[]}getDrawableIDs(){return this.coreModel.getDrawableIds()}getDrawableIndex(e){return this.coreModel.getDrawableIndex(e)}getDrawableVertices(e){if(typeof e==`string`&&(e=this.coreModel.getDrawableIndex(e),e===-1))throw TypeError(`Unable to find drawable ID: `+e);let t=this.coreModel.getDrawableVertices(e).slice();for(let e=0;e{function n(){try{Td(),e()}catch(e){if(Cd--,Cd<0){let n=Error(`Failed to start up Cubism 4 framework.`);n.cause=e,t(n);return}wu.log(`Cubism4`,`Startup failed, retrying 10ms later...`),setTimeout(n,10)}}n()}),Sd)}function Td(e){e=Object.assign({logFunction:console.log,loggingLevel:Mc.LogLevel_Verbose},e),jc.startUp(e),jc.initialize()}id.registerRuntime({version:4,ready:wd,test(e){return e instanceof vd||vd.isValidJSON(e)},isValidMoc(e){if(e.byteLength<4)return!1;let t=new Int8Array(e,0,4);return String.fromCharCode(...t)===`MOC3`},createModelSettings(e){return new vd(e)},createCoreModel(e){let t=Bc.create(e);try{let e=t.createModel();return e.__moc=t,e}catch(e){try{t.release()}catch{}throw e}},createInternalModel(e,t,n){let r=new xd(e,t,n),i=e;return i.__moc&&(r.__moc=i.__moc,delete i.__moc,r.once(`destroy`,Ed)),r},createPhysics(e,t){return Ml.create(t)},createPose(e,t){return vc.create(t)}});function Ed(){var e;(e=this.__moc)==null||e.release()}var Dd=Tn({__name:`Canvas`,props:{width:{},height:{},resolution:{default:2}},setup(e,{expose:t}){let n=e,r=U(),i=U(),a=U();async function o(e){fd.registerTicker(Ti),xi.add(Ei),i.value=new cc({width:n.width*n.resolution,height:n.height*n.resolution,backgroundAlpha:0,preserveDrawingBuffer:!0}),a.value=i.value.view,a.value.style.width=`100%`,a.value.style.height=`100%`,a.value.style.objectFit=`cover`,a.value.style.display=`block`,e.appendChild(i.value.view)}function s(){i.value&&i.value.renderer.resize(n.width,n.height)}G([()=>n.width,()=>n.height],()=>s()),G(()=>n.resolution,e=>{i.value&&e&&(i.value.renderer.resolution=e,s())}),Cn(async()=>r.value&&await o(r.value)),An(()=>i.value?.destroy());async function c(){let e=new Promise(e=>{if(!a.value||!i.value)return e(null);i.value.render(),a.value.toBlob(e)});return e}function l(){return a.value}return t({captureFrame:c,canvasElement:l}),(e,t)=>(K(),On(`div`,{ref_key:`containerRef`,ref:r,"h-full":``,"w-full":``},[Qt(e.$slots,`default`,{app:i.value})],512))}}),Od=Dd,kd=fn((exports,t)=>{ +`,n),r(n)}return Promise.resolve(void 0)}static releaseTasks(){this instanceof Bu?rd.motionTasksMap.delete(this):rd.expressionTasksMap.delete(this)}};let id=rd;id.runtimes=[],id.urlToJSON=Zu,id.jsonToSettings=Qu,id.waitUntilReady=$u,id.setupOptionals=ed,id.setupEssentials=td,id.createInternalModel=nd,id.live2DModelMiddlewares=[Zu,Qu,$u,ed,td,nd],id.motionTasksMap=new WeakMap,id.expressionTasksMap=new WeakMap,Bu.prototype._loadMotion=function(e,t){return id.loadMotion(this,e,t)},ku.prototype._loadExpression=function(e){return id.loadExpression(this,e)};var ad=class{constructor(){this._autoInteract=!1}get autoInteract(){return this._autoInteract}set autoInteract(e){e!==this._autoInteract&&(e?this.on(`pointertap`,od,this):this.off(`pointertap`,od,this),this._autoInteract=e)}registerInteraction(e){e!==this.interactionManager&&(this.unregisterInteraction(),this._autoInteract&&e&&(this.interactionManager=e,e.on(`pointermove`,sd,this)))}unregisterInteraction(){var e;this.interactionManager&&((e=this.interactionManager)==null||e.off(`pointermove`,sd,this),this.interactionManager=void 0)}};function od(e){this.tap(e.data.global.x,e.data.global.y)}function sd(e){this.focus(e.data.global.x,e.data.global.y)}var cd=class extends Yi{};const ld=new ji,ud=new zi;let dd;var fd=class extends oc{constructor(e){super(),this.tag=`Live2DModel(uninitialized)`,this.textures=[],this.transform=new cd,this.anchor=new Ri(this.onAnchorChange,this,0,0),this.glContextID=-1,this.elapsedTime=performance.now(),this.deltaTime=0,this._autoUpdate=!1,this.once(`modelLoaded`,()=>this.init(e))}static from(e,t){let n=new this(t);return id.setupLive2DModel(n,e,t).then(()=>n)}static fromSync(e,t){let n=new this(t);return id.setupLive2DModel(n,e,t).then(t?.onLoad).catch(t?.onError),n}static registerTicker(e){dd=e}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){var t;dd||=(t=window.PIXI)?.Ticker,e?this._destroyed||(dd?(dd.shared.add(this.onTickerUpdate,this),this._autoUpdate=!0):wu.warn(this.tag,`No Ticker registered, please call Live2DModel.registerTicker(Ticker).`)):(dd?.shared.remove(this.onTickerUpdate,this),this._autoUpdate=!1)}init(e){this.tag=`Live2DModel(${this.internalModel.settings.name})`;let t=Object.assign({autoUpdate:!0,autoInteract:!0},e);t.autoInteract&&(this.interactive=!0),this.autoInteract=t.autoInteract,this.autoUpdate=t.autoUpdate}onAnchorChange(){this.pivot.set(this.anchor.x*this.internalModel.width,this.anchor.y*this.internalModel.height)}motion(e,t,n){return t===void 0?this.internalModel.motionManager.startRandomMotion(e,n):this.internalModel.motionManager.startMotion(e,t,n)}expression(e){return this.internalModel.motionManager.expressionManager?e===void 0?this.internalModel.motionManager.expressionManager.setRandomExpression():this.internalModel.motionManager.expressionManager.setExpression(e):Promise.resolve(!1)}focus(e,t,n=!1){ld.x=e,ld.y=t,this.toModelPosition(ld,ld,!0);let r=ld.x/this.internalModel.originalWidth*2-1,i=ld.y/this.internalModel.originalHeight*2-1,a=Math.atan2(i,r);this.internalModel.focusController.focus(Math.cos(a),-Math.sin(a),n)}tap(e,t){let n=this.hitTest(e,t);n.length&&(wu.log(this.tag,`Hit`,n),this.emit(`hit`,n))}hitTest(e,t){return ld.x=e,ld.y=t,this.toModelPosition(ld,ld),this.internalModel.hitTest(ld.x,ld.y)}toModelPosition(e,t=e.clone(),n){return n||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.transform.worldTransform.applyInverse(e,t),this.internalModel.localTransform.applyInverse(t,t),t}containsPoint(e){return this.getBounds(!0).contains(e.x,e.y)}_calculateBounds(){this._bounds.addFrame(this.transform,0,0,this.internalModel.width,this.internalModel.height)}onTickerUpdate(){this.update(dd.shared.deltaMS)}update(e){this.deltaTime+=e,this.elapsedTime+=e}_render(e){this.registerInteraction(e.plugins.interaction),e.batch.reset(),e.geometry.reset(),e.shader.reset(),e.state.reset();let t=!1;this.glContextID!==e.CONTEXT_UID&&(this.glContextID=e.CONTEXT_UID,this.internalModel.updateWebGLContext(e.gl,this.glContextID),t=!0);for(let n=0;nt.destroy(e.baseTexture)),this.internalModel.destroy(),super.destroy(e)}};Eu(fd,[ad]);const pd=class{static resolveURL(e,t){var n;let r=(n=pd.filesMap[e])?.[t];if(r===void 0)throw Error(`Cannot find this file from uploaded files: `+t);return r}static upload(e,t){return uc(this,null,function*(){let n={};for(let r of t.getDefinedFiles()){let i=decodeURI(Wr.resolve(t.url,r)),a=e.find(e=>e.webkitRelativePath===i);a&&(n[r]=URL.createObjectURL(a))}pd.filesMap[t._objectURL]=n})}static createSettings(e){return uc(this,null,function*(){let t=e.find(e=>e.name.endsWith(`model.json`)||e.name.endsWith(`model3.json`));if(!t)throw TypeError(`Settings file not found`);let n=yield pd.readText(t),r=JSON.parse(n);r.url=t.webkitRelativePath;let i=id.findRuntime(r);if(!i)throw Error(`Unknown settings JSON`);let a=i.createModelSettings(r);return a._objectURL=URL.createObjectURL(t),a})}static readText(e){return uc(this,null,function*(){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(r.result),r.onerror=n,r.readAsText(e,`utf8`)})})}};let md=pd;md.filesMap={},md.factory=(e,t)=>uc(void 0,null,function*(){if(Array.isArray(e.source)&&e.source[0]instanceof File){let t=e.source,n=t.settings;if(!n)n=yield pd.createSettings(t);else if(!n._objectURL)throw Error(`"_objectURL" must be specified in ModelSettings`);n.validateFiles(t.map(e=>encodeURI(e.webkitRelativePath))),yield pd.upload(t,n),n.resolveURL=function(e){return pd.resolveURL(this._objectURL,e)},e.source=n,e.live2dModel.once(`modelLoaded`,e=>{e.once(`destroy`,function(){let e=this.settings._objectURL;if(URL.revokeObjectURL(e),pd.filesMap[e])for(let t of Object.values(pd.filesMap[e]))URL.revokeObjectURL(t);delete pd.filesMap[e]})})}return t()}),id.live2DModelMiddlewares.unshift(md.factory);const hd=class{static unzip(e,t){return uc(this,null,function*(){let n=yield hd.getFilePaths(e),r=[];for(let e of t.getDefinedFiles()){let i=decodeURI(Wr.resolve(t.url,e));n.includes(i)&&r.push(i)}let i=yield hd.getFiles(e,r);for(let e=0;ee.endsWith(`model.json`)||e.endsWith(`model3.json`));if(!n)throw Error(`Settings file not found`);let r=yield hd.readText(e,n);if(!r)throw Error(`Empty settings file: `+n);let i=JSON.parse(r);i.url=n;let a=id.findRuntime(i);if(!a)throw Error(`Unknown settings JSON`);return a.createModelSettings(i)})}static zipReader(e,t){return uc(this,null,function*(){throw Error(`Not implemented`)})}static getFilePaths(e){return uc(this,null,function*(){throw Error(`Not implemented`)})}static getFiles(e,t){return uc(this,null,function*(){throw Error(`Not implemented`)})}static readText(e,t){return uc(this,null,function*(){throw Error(`Not implemented`)})}static releaseReader(e){}};let gd=hd;if(gd.ZIP_PROTOCOL=`zip://`,gd.uid=0,gd.factory=(e,t)=>uc(void 0,null,function*(){let n=e.source,r,i,a;if(typeof n==`string`&&(n.endsWith(`.zip`)||n.startsWith(hd.ZIP_PROTOCOL))?(r=n.startsWith(hd.ZIP_PROTOCOL)?n.slice(hd.ZIP_PROTOCOL.length):n,i=yield Ju.load({url:r,type:`blob`,target:e.live2dModel})):Array.isArray(n)&&n.length===1&&n[0]instanceof File&&n[0].name.endsWith(`.zip`)&&(i=n[0],r=URL.createObjectURL(i),a=n.settings),i){if(!i.size)throw Error(`Empty zip file`);let t=yield hd.zipReader(i,r);a||=yield hd.createSettings(t),a._objectURL=hd.ZIP_PROTOCOL+hd.uid+`/`+a.url;let n=yield hd.unzip(t,a);n.settings=a,e.source=n,r.startsWith(`blob:`)&&e.live2dModel.once(`modelLoaded`,e=>{e.once(`destroy`,function(){URL.revokeObjectURL(r)})}),hd.releaseReader(t)}return t()}),id.live2DModelMiddlewares.unshift(gd.factory),!window.Live2DCubismCore)throw Error(`Could not find Cubism 4 runtime. This plugin requires live2dcubismcore.js to be loaded.`);var _d=class extends ku{constructor(e,t){var n;super(e,t),this.queueManager=new gl,this.definitions=(n=e.expressions)??[],this.init()}isFinished(){return this.queueManager.isFinished()}getExpressionIndex(e){return this.definitions.findIndex(t=>t.Name===e)}getExpressionFile(e){return e.File}createExpression(e,t){return Uc.create(e)}_setExpression(e){return this.queueManager.startMotion(e,!1,performance.now())}stopAllExpressions(){this.queueManager.stopAllMotions()}updateParameters(e,t){return this.queueManager.doUpdateMotion(e,t)}},vd=class e extends Pu{constructor(t){if(super(t),!e.isValidJSON(t))throw TypeError(`Invalid JSON.`);Object.assign(this,new pu(t))}static isValidJSON(e){var t;return!!e?.FileReferences&&typeof e.FileReferences.Moc==`string`&&(t=e.FileReferences.Textures)?.length>0&&e.FileReferences.Textures.every(e=>typeof e==`string`)}replaceFiles(e){if(super.replaceFiles(e),this.motions)for(let[t,n]of Object.entries(this.motions))for(let r=0;r{this.emit(`motion:`+t)})}isFinished(){return this.queueManager.isFinished()}_startMotion(e,t){return e.setFinishedMotionHandler(t),this.queueManager.stopAllMotions(),this.queueManager.startMotion(e,!1,performance.now())}_stopAllMotions(){this.queueManager.stopAllMotions()}createMotion(e,t,n){let r=ml.create(e),i=new $c(e),a=(t===this.groups.idle?Cu.idleMotionFadingDuration:Cu.motionFadingDuration)/1e3;return i.getMotionFadeInTime()===void 0&&r.setFadeInTime(n.FadeInTime>0?n.FadeInTime:a),i.getMotionFadeOutTime()===void 0&&r.setFadeOutTime(n.FadeOutTime>0?n.FadeOutTime:a),r.setEffectIds(this.eyeBlinkIds,this.lipSyncIds),r}getMotionFile(e){return e.File}getMotionName(e){return e.File}getSoundFile(e){return e.Sound}updateParameters(e,t){return this.queueManager.doUpdateMotion(e,t)}destroy(){super.destroy(),this.queueManager.release(),this.queueManager=void 0}};const bd=new Cc;var xd=class extends Hu{constructor(e,t,n){super(),this.lipSync=!0,this.breath=dc.create(),this.renderer=new fu,this.idParamAngleX=mu,this.idParamAngleY=hu,this.idParamAngleZ=gu,this.idParamEyeBallX=_u,this.idParamEyeBallY=vu,this.idParamBodyAngleX=yu,this.idParamBreath=bu,this.pixelsPerUnit=1,this.centeringTransform=new zi,this.coreModel=e,this.settings=t,this.motionManager=new yd(t,n),this.init()}init(){var e;super.init(),(e=this.settings.getEyeBlinkParameters())?.length>0&&(this.eyeBlink=mc.create(this.settings)),this.breath.setParameters([new fc(this.idParamAngleX,0,15,6.5345,.5),new fc(this.idParamAngleY,0,8,3.5345,.5),new fc(this.idParamAngleZ,0,10,5.5345,.5),new fc(this.idParamBodyAngleX,0,4,15.5345,.5),new fc(this.idParamBreath,0,.5,3.2345,.5)]),this.renderer.initialize(this.coreModel),this.renderer.setIsPremultipliedAlpha(!0)}getSize(){return[this.coreModel.getModel().canvasinfo.CanvasWidth,this.coreModel.getModel().canvasinfo.CanvasHeight]}getLayout(){let e={};if(this.settings.layout)for(let t of Object.keys(this.settings.layout)){let n=t.charAt(0).toLowerCase()+t.slice(1);e[n]=this.settings.layout[t]}return e}setupLayout(){super.setupLayout(),this.pixelsPerUnit=this.coreModel.getModel().canvasinfo.PixelsPerUnit,this.centeringTransform.scale(this.pixelsPerUnit,this.pixelsPerUnit).translate(this.originalWidth/2,this.originalHeight/2)}updateWebGLContext(e,t){this.renderer.firstDraw=!0,this.renderer._bufferData={vertex:null,uv:null,index:null},this.renderer.startUp(e),this.renderer._clippingManager._currentFrameNo=t,this.renderer._clippingManager._maskTexture=void 0,ru.getInstance()._shaderSets=[]}bindTexture(e,t){this.renderer.bindTexture(e,t)}getHitAreaDefs(){var e,t;return(t=(e=this.settings.hitAreas)?.map(e=>({id:e.Id,name:e.Name,index:this.coreModel.getDrawableIndex(e.Id)})))??[]}getDrawableIDs(){return this.coreModel.getDrawableIds()}getDrawableIndex(e){return this.coreModel.getDrawableIndex(e)}getDrawableVertices(e){if(typeof e==`string`&&(e=this.coreModel.getDrawableIndex(e),e===-1))throw TypeError(`Unable to find drawable ID: `+e);let t=this.coreModel.getDrawableVertices(e).slice();for(let e=0;e{function n(){try{Td(),e()}catch(e){if(Cd--,Cd<0){let n=Error(`Failed to start up Cubism 4 framework.`);n.cause=e,t(n);return}wu.log(`Cubism4`,`Startup failed, retrying 10ms later...`),setTimeout(n,10)}}n()}),Sd)}function Td(e){e=Object.assign({logFunction:console.log,loggingLevel:Mc.LogLevel_Verbose},e),jc.startUp(e),jc.initialize()}id.registerRuntime({version:4,ready:wd,test(e){return e instanceof vd||vd.isValidJSON(e)},isValidMoc(e){if(e.byteLength<4)return!1;let t=new Int8Array(e,0,4);return String.fromCharCode(...t)===`MOC3`},createModelSettings(e){return new vd(e)},createCoreModel(e){let t=Bc.create(e);try{let e=t.createModel();return e.__moc=t,e}catch(e){try{t.release()}catch{}throw e}},createInternalModel(e,t,n){let r=new xd(e,t,n),i=e;return i.__moc&&(r.__moc=i.__moc,delete i.__moc,r.once(`destroy`,Ed)),r},createPhysics(e,t){return Ml.create(t)},createPose(e,t){return vc.create(t)}});function Ed(){var e;(e=this.__moc)==null||e.release()}var Dd=$t({__name:`Canvas`,props:{width:{},height:{},resolution:{default:2}},setup(e,{expose:t}){let n=e,r=U(),i=U(),a=U();async function o(e){fd.registerTicker(Ti),xi.add(Ei),i.value=new cc({width:n.width*n.resolution,height:n.height*n.resolution,backgroundAlpha:0,preserveDrawingBuffer:!0}),a.value=i.value.view,a.value.style.width=`100%`,a.value.style.height=`100%`,a.value.style.objectFit=`cover`,a.value.style.display=`block`,e.appendChild(i.value.view)}function s(){i.value&&i.value.renderer.resize(n.width,n.height)}G([()=>n.width,()=>n.height],()=>s()),G(()=>n.resolution,e=>{i.value&&e&&(i.value.renderer.resolution=e,s())}),Pn(async()=>r.value&&await o(r.value)),bn(()=>i.value?.destroy());async function c(){let e=new Promise(e=>{if(!a.value||!i.value)return e(null);i.value.render(),a.value.toBlob(e)});return e}function l(){return a.value}return t({captureFrame:c,canvasElement:l}),(e,t)=>(K(),nn(`div`,{ref_key:`containerRef`,ref:r,"h-full":``,"w-full":``},[Tn(e.$slots,`default`,{app:i.value})],512))}}),Od=Dd,kd=mn((exports,t)=>{ /*! localForage -- Offline Storage, Improved Version 1.10.0 https://localforage.github.io/localForage (c) 2013-2017 Mozilla, Apache License 2.0 */ -(function(n){if(typeof exports==`object`&&t!==void 0)t.exports=n();else if(typeof define==`function`&&define.amd)define([],n);else{var r;r=typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:this,r.localforage=n()}})(function(){var e,t,n;return function e(t,n,r){function i(o,s){if(!n[o]){if(!t[o]){var c=typeof hn==`function`&&hn;if(!s&&c)return c(o,!0);if(a)return a(o,!0);var l=Error(`Cannot find module '`+o+`'`);throw l.code=`MODULE_NOT_FOUND`,l}var u=n[o]={exports:{}};t[o][0].call(u.exports,function(e){var n=t[o][1][e];return i(n||e)},u,u.exports,e,t,n,r)}return n[o].exports}for(var a=typeof hn==`function`&&hn,o=0;o`u`&&e(3);var l=Promise;function u(e,t){t&&e.then(function(e){t(null,e)},function(e){t(e)})}function d(e,t,n){typeof t==`function`&&e.then(t),typeof n==`function`&&e.catch(n)}function f(e){return typeof e!=`string`&&(console.warn(e+` used as a key, but it is not a string.`),e=String(e)),e}function p(){if(arguments.length&&typeof arguments[arguments.length-1]==`function`)return arguments[arguments.length-1]}var m=`local-forage-detect-blob-support`,h=void 0,g={},_=Object.prototype.toString,v=`readonly`,y=`readwrite`;function b(e){for(var t=e.length,n=new ArrayBuffer(t),r=new Uint8Array(n),i=0;i=43)}}).catch(function(){return!1})}function S(e){return typeof h==`boolean`?l.resolve(h):x(e).then(function(e){return h=e,h})}function C(e){var t=g[e.name],n={};n.promise=new l(function(e,t){n.resolve=e,n.reject=t}),t.deferredOperations.push(n),t.dbReady?t.dbReady=t.dbReady.then(function(){return n.promise}):t.dbReady=n.promise}function w(e){var t=g[e.name],n=t.deferredOperations.pop();if(n)return n.resolve(),n.promise}function T(e,t){var n=g[e.name],r=n.deferredOperations.pop();if(r)return r.reject(t),r.promise}function E(e,t){return new l(function(n,r){if(g[e.name]=g[e.name]||F(),e.db)if(t)C(e),e.db.close();else return n(e.db);var i=[e.name];t&&i.push(e.version);var a=o.open.apply(o,i);t&&(a.onupgradeneeded=function(t){var n=a.result;try{n.createObjectStore(e.storeName),t.oldVersion<=1&&n.createObjectStore(m)}catch(n){if(n.name===`ConstraintError`)console.warn(`The database "`+e.name+`" has been upgraded from version `+t.oldVersion+` to version `+t.newVersion+`, but the storage "`+e.storeName+`" already exists.`);else throw n}}),a.onerror=function(e){e.preventDefault(),r(a.error)},a.onsuccess=function(){var t=a.result;t.onversionchange=function(e){e.target.close()},n(t),w(e)}})}function D(e){return E(e,!1)}function O(e){return E(e,!0)}function k(e,t){if(!e.db)return!0;var n=!e.db.objectStoreNames.contains(e.storeName),r=e.versione.db.version;if(r&&(e.version!==t&&console.warn(`The database "`+e.name+`" can't be downgraded from version `+e.db.version+` to version `+e.version+`.`),e.version=e.db.version),i||n){if(n){var a=e.db.version+1;a>e.version&&(e.version=a)}return!0}return!1}function A(e){return new l(function(t,n){var r=new FileReader;r.onerror=n,r.onloadend=function(n){var r=btoa(n.target.result||``);t({__local_forage_encoded_blob:!0,data:r,type:e.type})},r.readAsBinaryString(e)})}function j(e){var t=b(atob(e.data));return c([t],{type:e.type})}function M(e){return e&&e.__local_forage_encoded_blob}function N(e){var t=this,n=t._initReady().then(function(){var e=g[t._dbInfo.name];if(e&&e.dbReady)return e.dbReady});return d(n,e,e),n}function ee(e){C(e);for(var t=g[e.name],n=t.forages,r=0;r0&&(!e.db||i.name===`InvalidStateError`||i.name===`NotFoundError`))return l.resolve().then(function(){if(!e.db||i.name===`NotFoundError`&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),O(e)}).then(function(){return ee(e).then(function(){P(e,t,n,r-1)})}).catch(n);n(i)}}function F(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function I(e){var t=this,n={db:null};if(e)for(var r in e)n[r]=e[r];var i=g[n.name];i||(i=F(),g[n.name]=i),i.forages.push(t),t._initReady||(t._initReady=t.ready,t.ready=N);var a=[];function o(){return l.resolve()}for(var s=0;s>4,u[i++]=(o&15)<<4|s>>2,u[i++]=(s&3)<<6|c&63;return l}function Oe(e){var t=new Uint8Array(e),n=``,r;for(r=0;r>2],n+=le[(t[r]&3)<<4|t[r+1]>>4],n+=le[(t[r+1]&15)<<2|t[r+2]>>6],n+=le[t[r+2]&63];return t.length%3==2?n=n.substring(0,n.length-1)+`=`:t.length%3==1&&(n=n.substring(0,n.length-2)+`==`),n}function ke(e,t){var n=``;if(e&&(n=Ee.call(e)),e&&(n===`[object ArrayBuffer]`||e.buffer&&Ee.call(e.buffer)===`[object ArrayBuffer]`)){var r,i=fe;e instanceof ArrayBuffer?(r=e,i+=me):(r=e.buffer,n===`[object Int8Array]`?i+=ge:n===`[object Uint8Array]`?i+=_e:n===`[object Uint8ClampedArray]`?i+=ve:n===`[object Int16Array]`?i+=ye:n===`[object Uint16Array]`?i+=xe:n===`[object Int32Array]`?i+=be:n===`[object Uint32Array]`?i+=Se:n===`[object Float32Array]`?i+=Ce:n===`[object Float64Array]`?i+=we:t(Error(`Failed to get type for BinaryArray`))),t(i+Oe(r))}else if(n===`[object Blob]`){var a=new FileReader;a.onload=function(){var n=ue+e.type+`~`+Oe(this.result);t(fe+he+n)},a.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(n){console.error(`Couldn't convert value into a JSON string: `,e),t(null,n)}}function Ae(e){if(e.substring(0,pe)!==fe)return JSON.parse(e);var t=e.substring(Te),n=e.substring(pe,Te),r;if(n===he&&de.test(t)){var i=t.match(de);r=i[1],t=t.substring(i[0].length)}var a=De(t);switch(n){case me:return a;case he:return c([a],{type:r});case ge:return new Int8Array(a);case _e:return new Uint8Array(a);case ve:return new Uint8ClampedArray(a);case ye:return new Int16Array(a);case xe:return new Uint16Array(a);case be:return new Int32Array(a);case Se:return new Uint32Array(a);case Ce:return new Float32Array(a);case we:return new Float64Array(a);default:throw Error(`Unkown type: `+n)}}var je={serialize:ke,deserialize:Ae,stringToBuffer:De,bufferToString:Oe};function Me(e,t,n,r){e.executeSql(`CREATE TABLE IF NOT EXISTS `+t.storeName+` (id INTEGER PRIMARY KEY, key unique, value)`,[],n,r)}function Ne(e){var t=this,n={db:null};if(e)for(var r in e)n[r]=typeof e[r]==`string`?e[r]:e[r].toString();var i=new l(function(e,r){try{n.db=openDatabase(n.name,String(n.version),n.description,n.size)}catch(e){return r(e)}n.db.transaction(function(i){Me(i,n,function(){t._dbInfo=n,e()},function(e,t){r(t)})},r)});return n.serializer=je,i}function Pe(e,t,n,r,i,a){e.executeSql(n,r,i,function(e,o){o.code===o.SYNTAX_ERR?e.executeSql(`SELECT name FROM sqlite_master WHERE type='table' AND name = ?`,[t.storeName],function(e,s){s.rows.length?a(e,o):Me(e,t,function(){e.executeSql(n,r,i,a)},a)},a):a(e,o)},a)}function Fe(e,t){var n=this;e=f(e);var r=new l(function(t,r){n.ready().then(function(){var i=n._dbInfo;i.db.transaction(function(n){Pe(n,i,`SELECT * FROM `+i.storeName+` WHERE key = ? LIMIT 1`,[e],function(e,n){var r=n.rows.length?n.rows.item(0).value:null;r&&=i.serializer.deserialize(r),t(r)},function(e,t){r(t)})})}).catch(r)});return u(r,t),r}function B(e,t){var n=this,r=new l(function(t,r){n.ready().then(function(){var i=n._dbInfo;i.db.transaction(function(n){Pe(n,i,`SELECT * FROM `+i.storeName,[],function(n,r){for(var a=r.rows,o=a.length,s=0;s0){a(Ie.apply(i,[e,s,n,r-1]));return}o(t)}})})}).catch(o)});return u(a,n),a}function Le(e,t,n){return Ie.apply(this,[e,t,n,1])}function Re(e,t){var n=this;e=f(e);var r=new l(function(t,r){n.ready().then(function(){var i=n._dbInfo;i.db.transaction(function(n){Pe(n,i,`DELETE FROM `+i.storeName+` WHERE key = ?`,[e],function(){t()},function(e,t){r(t)})})}).catch(r)});return u(r,t),r}function ze(e){var t=this,n=new l(function(e,n){t.ready().then(function(){var r=t._dbInfo;r.db.transaction(function(t){Pe(t,r,`DELETE FROM `+r.storeName,[],function(){e()},function(e,t){n(t)})})}).catch(n)});return u(n,e),n}function Be(e){var t=this,n=new l(function(e,n){t.ready().then(function(){var r=t._dbInfo;r.db.transaction(function(t){Pe(t,r,`SELECT COUNT(key) as c FROM `+r.storeName,[],function(t,n){var r=n.rows.item(0).c;e(r)},function(e,t){n(t)})})}).catch(n)});return u(n,e),n}function Ve(e,t){var n=this,r=new l(function(t,r){n.ready().then(function(){var i=n._dbInfo;i.db.transaction(function(n){Pe(n,i,`SELECT key FROM `+i.storeName+` WHERE id = ? LIMIT 1`,[e+1],function(e,n){var r=n.rows.length?n.rows.item(0).key:null;t(r)},function(e,t){r(t)})})}).catch(r)});return u(r,t),r}function He(e){var t=this,n=new l(function(e,n){t.ready().then(function(){var r=t._dbInfo;r.db.transaction(function(t){Pe(t,r,`SELECT key FROM `+r.storeName,[],function(t,n){for(var r=[],i=0;i '__WebKitDatabaseInfoTable__'`,[],function(n,r){for(var i=[],a=0;a0}function Xe(e){var t=this,n={};if(e)for(var r in e)n[r]=e[r];return n.keyPrefix=qe(e,t._defaultConfig),Ye()?(t._dbInfo=n,n.serializer=je,l.resolve()):l.reject()}function Ze(e){var t=this,n=t.ready().then(function(){for(var e=t._dbInfo.keyPrefix,n=localStorage.length-1;n>=0;n--){var r=localStorage.key(n);r.indexOf(e)===0&&localStorage.removeItem(r)}});return u(n,e),n}function Qe(e,t){var n=this;e=f(e);var r=n.ready().then(function(){var t=n._dbInfo,r=localStorage.getItem(t.keyPrefix+e);return r&&=t.serializer.deserialize(r),r});return u(r,t),r}function $e(e,t){var n=this,r=n.ready().then(function(){for(var t=n._dbInfo,r=t.keyPrefix,i=r.length,a=localStorage.length,o=1,s=0;s=0;t--){var n=localStorage.key(t);n.indexOf(e)===0&&localStorage.removeItem(n)}}):l.reject(`Invalid arguments`),u(i,t),i}var ot={_driver:`localStorageWrapper`,_initStorage:Xe,_support:Ke(),iterate:$e,getItem:Qe,setItem:it,removeItem:rt,clear:Ze,length:nt,key:et,keys:tt,dropInstance:at},st=function(e,t){return e===t||typeof e==`number`&&typeof t==`number`&&isNaN(e)&&isNaN(t)},ct=function(e,t){for(var n=e.length,r=0;r=0;f--){var p=d[f],m=this.recursiveFindHit(e,p,n,r,c);if(m){if(!p.parent)continue;c=!1,m&&(e.target&&(r=!1),s=!0)}}return i&&(r&&!e.target&&!t.hitArea&&t.containsPoint&&t.containsPoint(o)&&(s=!0),t.interactive&&(s&&!e.target&&(e.target=t),n&&n(e,t,!!s))),s},e.prototype.findHit=function(e,t,n,r){this.recursiveFindHit(e,t,n,r,!1)},e}(),Id={interactive:!1,interactiveChildren:!0,hitArea:null,get buttonMode(){return this.cursor===`pointer`},set buttonMode(e){e?this.cursor=`pointer`:this.cursor===`pointer`&&(this.cursor=null)},cursor:null,get trackedPointers(){return this._trackedPointers===void 0&&(this._trackedPointers={}),this._trackedPointers},_trackedPointers:void 0};rc.mixin(Id);var Ld=1,Rd={target:null,data:{global:null}},zd=function(e){Md(t,e);function t(t,n){var r=e.call(this)||this;return n||={},r.renderer=t,r.autoPreventDefault=n.autoPreventDefault===void 0?!0:n.autoPreventDefault,r.interactionFrequency=n.interactionFrequency||10,r.mouse=new Ad,r.mouse.identifier=Ld,r.mouse.global.set(-999999),r.activeInteractionData={},r.activeInteractionData[Ld]=r.mouse,r.interactionDataPool=[],r.eventData=new Nd,r.interactionDOMElement=null,r.moveWhenInside=!1,r.eventsAdded=!1,r.tickerAdded=!1,r.mouseOverRenderer=!(`PointerEvent`in globalThis),r.supportsTouchEvents=`ontouchstart`in globalThis,r.supportsPointerEvents=!!globalThis.PointerEvent,r.onPointerUp=r.onPointerUp.bind(r),r.processPointerUp=r.processPointerUp.bind(r),r.onPointerCancel=r.onPointerCancel.bind(r),r.processPointerCancel=r.processPointerCancel.bind(r),r.onPointerDown=r.onPointerDown.bind(r),r.processPointerDown=r.processPointerDown.bind(r),r.onPointerMove=r.onPointerMove.bind(r),r.processPointerMove=r.processPointerMove.bind(r),r.onPointerOut=r.onPointerOut.bind(r),r.processPointerOverOut=r.processPointerOverOut.bind(r),r.onPointerOver=r.onPointerOver.bind(r),r.cursorStyles={default:`inherit`,pointer:`pointer`},r.currentCursorMode=null,r.cursor=null,r.resolution=1,r.delayedEvents=[],r.search=new Fd,r._tempDisplayObject=new ic,r._eventListenerOptions={capture:!0,passive:!1},r._useSystemTicker=n.useSystemTicker===void 0?!0:n.useSystemTicker,r.setTargetElement(r.renderer.view,r.renderer.resolution),r}return Object.defineProperty(t.prototype,`useSystemTicker`,{get:function(){return this._useSystemTicker},set:function(e){this._useSystemTicker=e,e?this.addTickerListener():this.removeTickerListener()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`lastObjectRendered`,{get:function(){return this.renderer._lastObjectRendered||this._tempDisplayObject},enumerable:!1,configurable:!0}),t.prototype.hitTest=function(e,t){return Rd.target=null,Rd.data.global=e,t||=this.lastObjectRendered,this.processInteractive(Rd,t,null,!0),Rd.target},t.prototype.setTargetElement=function(e,t){t===void 0&&(t=1),this.removeTickerListener(),this.removeEvents(),this.interactionDOMElement=e,this.resolution=t,this.addEvents(),this.addTickerListener()},t.prototype.addTickerListener=function(){this.tickerAdded||!this.interactionDOMElement||!this._useSystemTicker||(Ti.system.add(this.tickerUpdate,this,Ci.INTERACTION),this.tickerAdded=!0)},t.prototype.removeTickerListener=function(){this.tickerAdded&&(Ti.system.remove(this.tickerUpdate,this),this.tickerAdded=!1)},t.prototype.addEvents=function(){if(!(this.eventsAdded||!this.interactionDOMElement)){var e=this.interactionDOMElement.style;globalThis.navigator.msPointerEnabled?(e.msContentZooming=`none`,e.msTouchAction=`none`):this.supportsPointerEvents&&(e.touchAction=`none`),this.supportsPointerEvents?(globalThis.document.addEventListener(`pointermove`,this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.addEventListener(`pointerdown`,this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener(`pointerleave`,this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.addEventListener(`pointerover`,this.onPointerOver,this._eventListenerOptions),globalThis.addEventListener(`pointercancel`,this.onPointerCancel,this._eventListenerOptions),globalThis.addEventListener(`pointerup`,this.onPointerUp,this._eventListenerOptions)):(globalThis.document.addEventListener(`mousemove`,this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.addEventListener(`mousedown`,this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener(`mouseout`,this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.addEventListener(`mouseover`,this.onPointerOver,this._eventListenerOptions),globalThis.addEventListener(`mouseup`,this.onPointerUp,this._eventListenerOptions)),this.supportsTouchEvents&&(this.interactionDOMElement.addEventListener(`touchstart`,this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener(`touchcancel`,this.onPointerCancel,this._eventListenerOptions),this.interactionDOMElement.addEventListener(`touchend`,this.onPointerUp,this._eventListenerOptions),this.interactionDOMElement.addEventListener(`touchmove`,this.onPointerMove,this._eventListenerOptions)),this.eventsAdded=!0}},t.prototype.removeEvents=function(){if(!(!this.eventsAdded||!this.interactionDOMElement)){var e=this.interactionDOMElement.style;globalThis.navigator.msPointerEnabled?(e.msContentZooming=``,e.msTouchAction=``):this.supportsPointerEvents&&(e.touchAction=``),this.supportsPointerEvents?(globalThis.document.removeEventListener(`pointermove`,this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.removeEventListener(`pointerdown`,this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener(`pointerleave`,this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.removeEventListener(`pointerover`,this.onPointerOver,this._eventListenerOptions),globalThis.removeEventListener(`pointercancel`,this.onPointerCancel,this._eventListenerOptions),globalThis.removeEventListener(`pointerup`,this.onPointerUp,this._eventListenerOptions)):(globalThis.document.removeEventListener(`mousemove`,this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.removeEventListener(`mousedown`,this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener(`mouseout`,this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.removeEventListener(`mouseover`,this.onPointerOver,this._eventListenerOptions),globalThis.removeEventListener(`mouseup`,this.onPointerUp,this._eventListenerOptions)),this.supportsTouchEvents&&(this.interactionDOMElement.removeEventListener(`touchstart`,this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener(`touchcancel`,this.onPointerCancel,this._eventListenerOptions),this.interactionDOMElement.removeEventListener(`touchend`,this.onPointerUp,this._eventListenerOptions),this.interactionDOMElement.removeEventListener(`touchmove`,this.onPointerMove,this._eventListenerOptions)),this.interactionDOMElement=null,this.eventsAdded=!1}},t.prototype.tickerUpdate=function(e){this._deltaTime+=e,!(this._deltaTime0&&(a=e.composedPath()[0]);for(var o=a===this.interactionDOMElement?``:`outside`,s=0;s`u`&&e(3);var l=Promise;function u(e,t){t&&e.then(function(e){t(null,e)},function(e){t(e)})}function d(e,t,n){typeof t==`function`&&e.then(t),typeof n==`function`&&e.catch(n)}function f(e){return typeof e!=`string`&&(console.warn(e+` used as a key, but it is not a string.`),e=String(e)),e}function p(){if(arguments.length&&typeof arguments[arguments.length-1]==`function`)return arguments[arguments.length-1]}var m=`local-forage-detect-blob-support`,h=void 0,g={},_=Object.prototype.toString,v=`readonly`,y=`readwrite`;function b(e){for(var t=e.length,n=new ArrayBuffer(t),r=new Uint8Array(n),i=0;i=43)}}).catch(function(){return!1})}function S(e){return typeof h==`boolean`?l.resolve(h):x(e).then(function(e){return h=e,h})}function C(e){var t=g[e.name],n={};n.promise=new l(function(e,t){n.resolve=e,n.reject=t}),t.deferredOperations.push(n),t.dbReady?t.dbReady=t.dbReady.then(function(){return n.promise}):t.dbReady=n.promise}function w(e){var t=g[e.name],n=t.deferredOperations.pop();if(n)return n.resolve(),n.promise}function T(e,t){var n=g[e.name],r=n.deferredOperations.pop();if(r)return r.reject(t),r.promise}function E(e,t){return new l(function(n,r){if(g[e.name]=g[e.name]||F(),e.db)if(t)C(e),e.db.close();else return n(e.db);var i=[e.name];t&&i.push(e.version);var a=o.open.apply(o,i);t&&(a.onupgradeneeded=function(t){var n=a.result;try{n.createObjectStore(e.storeName),t.oldVersion<=1&&n.createObjectStore(m)}catch(n){if(n.name===`ConstraintError`)console.warn(`The database "`+e.name+`" has been upgraded from version `+t.oldVersion+` to version `+t.newVersion+`, but the storage "`+e.storeName+`" already exists.`);else throw n}}),a.onerror=function(e){e.preventDefault(),r(a.error)},a.onsuccess=function(){var t=a.result;t.onversionchange=function(e){e.target.close()},n(t),w(e)}})}function D(e){return E(e,!1)}function O(e){return E(e,!0)}function k(e,t){if(!e.db)return!0;var n=!e.db.objectStoreNames.contains(e.storeName),r=e.versione.db.version;if(r&&(e.version!==t&&console.warn(`The database "`+e.name+`" can't be downgraded from version `+e.db.version+` to version `+e.version+`.`),e.version=e.db.version),i||n){if(n){var a=e.db.version+1;a>e.version&&(e.version=a)}return!0}return!1}function A(e){return new l(function(t,n){var r=new FileReader;r.onerror=n,r.onloadend=function(n){var r=btoa(n.target.result||``);t({__local_forage_encoded_blob:!0,data:r,type:e.type})},r.readAsBinaryString(e)})}function j(e){var t=b(atob(e.data));return c([t],{type:e.type})}function M(e){return e&&e.__local_forage_encoded_blob}function N(e){var t=this,n=t._initReady().then(function(){var e=g[t._dbInfo.name];if(e&&e.dbReady)return e.dbReady});return d(n,e,e),n}function ee(e){C(e);for(var t=g[e.name],n=t.forages,r=0;r0&&(!e.db||i.name===`InvalidStateError`||i.name===`NotFoundError`))return l.resolve().then(function(){if(!e.db||i.name===`NotFoundError`&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),O(e)}).then(function(){return ee(e).then(function(){P(e,t,n,r-1)})}).catch(n);n(i)}}function F(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function I(e){var t=this,n={db:null};if(e)for(var r in e)n[r]=e[r];var i=g[n.name];i||(i=F(),g[n.name]=i),i.forages.push(t),t._initReady||(t._initReady=t.ready,t.ready=N);var a=[];function o(){return l.resolve()}for(var s=0;s>4,u[i++]=(o&15)<<4|s>>2,u[i++]=(s&3)<<6|c&63;return l}function Oe(e){var t=new Uint8Array(e),n=``,r;for(r=0;r>2],n+=le[(t[r]&3)<<4|t[r+1]>>4],n+=le[(t[r+1]&15)<<2|t[r+2]>>6],n+=le[t[r+2]&63];return t.length%3==2?n=n.substring(0,n.length-1)+`=`:t.length%3==1&&(n=n.substring(0,n.length-2)+`==`),n}function ke(e,t){var n=``;if(e&&(n=Ee.call(e)),e&&(n===`[object ArrayBuffer]`||e.buffer&&Ee.call(e.buffer)===`[object ArrayBuffer]`)){var r,i=fe;e instanceof ArrayBuffer?(r=e,i+=me):(r=e.buffer,n===`[object Int8Array]`?i+=ge:n===`[object Uint8Array]`?i+=_e:n===`[object Uint8ClampedArray]`?i+=ve:n===`[object Int16Array]`?i+=ye:n===`[object Uint16Array]`?i+=xe:n===`[object Int32Array]`?i+=be:n===`[object Uint32Array]`?i+=Se:n===`[object Float32Array]`?i+=Ce:n===`[object Float64Array]`?i+=we:t(Error(`Failed to get type for BinaryArray`))),t(i+Oe(r))}else if(n===`[object Blob]`){var a=new FileReader;a.onload=function(){var n=ue+e.type+`~`+Oe(this.result);t(fe+he+n)},a.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(n){console.error(`Couldn't convert value into a JSON string: `,e),t(null,n)}}function Ae(e){if(e.substring(0,pe)!==fe)return JSON.parse(e);var t=e.substring(Te),n=e.substring(pe,Te),r;if(n===he&&de.test(t)){var i=t.match(de);r=i[1],t=t.substring(i[0].length)}var a=De(t);switch(n){case me:return a;case he:return c([a],{type:r});case ge:return new Int8Array(a);case _e:return new Uint8Array(a);case ve:return new Uint8ClampedArray(a);case ye:return new Int16Array(a);case xe:return new Uint16Array(a);case be:return new Int32Array(a);case Se:return new Uint32Array(a);case Ce:return new Float32Array(a);case we:return new Float64Array(a);default:throw Error(`Unkown type: `+n)}}var je={serialize:ke,deserialize:Ae,stringToBuffer:De,bufferToString:Oe};function Me(e,t,n,r){e.executeSql(`CREATE TABLE IF NOT EXISTS `+t.storeName+` (id INTEGER PRIMARY KEY, key unique, value)`,[],n,r)}function Ne(e){var t=this,n={db:null};if(e)for(var r in e)n[r]=typeof e[r]==`string`?e[r]:e[r].toString();var i=new l(function(e,r){try{n.db=openDatabase(n.name,String(n.version),n.description,n.size)}catch(e){return r(e)}n.db.transaction(function(i){Me(i,n,function(){t._dbInfo=n,e()},function(e,t){r(t)})},r)});return n.serializer=je,i}function Pe(e,t,n,r,i,a){e.executeSql(n,r,i,function(e,o){o.code===o.SYNTAX_ERR?e.executeSql(`SELECT name FROM sqlite_master WHERE type='table' AND name = ?`,[t.storeName],function(e,s){s.rows.length?a(e,o):Me(e,t,function(){e.executeSql(n,r,i,a)},a)},a):a(e,o)},a)}function Fe(e,t){var n=this;e=f(e);var r=new l(function(t,r){n.ready().then(function(){var i=n._dbInfo;i.db.transaction(function(n){Pe(n,i,`SELECT * FROM `+i.storeName+` WHERE key = ? LIMIT 1`,[e],function(e,n){var r=n.rows.length?n.rows.item(0).value:null;r&&=i.serializer.deserialize(r),t(r)},function(e,t){r(t)})})}).catch(r)});return u(r,t),r}function Ie(e,t){var n=this,r=new l(function(t,r){n.ready().then(function(){var i=n._dbInfo;i.db.transaction(function(n){Pe(n,i,`SELECT * FROM `+i.storeName,[],function(n,r){for(var a=r.rows,o=a.length,s=0;s0){a(B.apply(i,[e,s,n,r-1]));return}o(t)}})})}).catch(o)});return u(a,n),a}function Le(e,t,n){return B.apply(this,[e,t,n,1])}function Re(e,t){var n=this;e=f(e);var r=new l(function(t,r){n.ready().then(function(){var i=n._dbInfo;i.db.transaction(function(n){Pe(n,i,`DELETE FROM `+i.storeName+` WHERE key = ?`,[e],function(){t()},function(e,t){r(t)})})}).catch(r)});return u(r,t),r}function ze(e){var t=this,n=new l(function(e,n){t.ready().then(function(){var r=t._dbInfo;r.db.transaction(function(t){Pe(t,r,`DELETE FROM `+r.storeName,[],function(){e()},function(e,t){n(t)})})}).catch(n)});return u(n,e),n}function Be(e){var t=this,n=new l(function(e,n){t.ready().then(function(){var r=t._dbInfo;r.db.transaction(function(t){Pe(t,r,`SELECT COUNT(key) as c FROM `+r.storeName,[],function(t,n){var r=n.rows.item(0).c;e(r)},function(e,t){n(t)})})}).catch(n)});return u(n,e),n}function Ve(e,t){var n=this,r=new l(function(t,r){n.ready().then(function(){var i=n._dbInfo;i.db.transaction(function(n){Pe(n,i,`SELECT key FROM `+i.storeName+` WHERE id = ? LIMIT 1`,[e+1],function(e,n){var r=n.rows.length?n.rows.item(0).key:null;t(r)},function(e,t){r(t)})})}).catch(r)});return u(r,t),r}function He(e){var t=this,n=new l(function(e,n){t.ready().then(function(){var r=t._dbInfo;r.db.transaction(function(t){Pe(t,r,`SELECT key FROM `+r.storeName,[],function(t,n){for(var r=[],i=0;i '__WebKitDatabaseInfoTable__'`,[],function(n,r){for(var i=[],a=0;a0}function Xe(e){var t=this,n={};if(e)for(var r in e)n[r]=e[r];return n.keyPrefix=qe(e,t._defaultConfig),Ye()?(t._dbInfo=n,n.serializer=je,l.resolve()):l.reject()}function Ze(e){var t=this,n=t.ready().then(function(){for(var e=t._dbInfo.keyPrefix,n=localStorage.length-1;n>=0;n--){var r=localStorage.key(n);r.indexOf(e)===0&&localStorage.removeItem(r)}});return u(n,e),n}function Qe(e,t){var n=this;e=f(e);var r=n.ready().then(function(){var t=n._dbInfo,r=localStorage.getItem(t.keyPrefix+e);return r&&=t.serializer.deserialize(r),r});return u(r,t),r}function $e(e,t){var n=this,r=n.ready().then(function(){for(var t=n._dbInfo,r=t.keyPrefix,i=r.length,a=localStorage.length,o=1,s=0;s=0;t--){var n=localStorage.key(t);n.indexOf(e)===0&&localStorage.removeItem(n)}}):l.reject(`Invalid arguments`),u(i,t),i}var ot={_driver:`localStorageWrapper`,_initStorage:Xe,_support:Ke(),iterate:$e,getItem:Qe,setItem:it,removeItem:rt,clear:Ze,length:nt,key:et,keys:tt,dropInstance:at},st=function(e,t){return e===t||typeof e==`number`&&typeof t==`number`&&isNaN(e)&&isNaN(t)},ct=function(e,t){for(var n=e.length,r=0;r=0;f--){var p=d[f],m=this.recursiveFindHit(e,p,n,r,c);if(m){if(!p.parent)continue;c=!1,m&&(e.target&&(r=!1),s=!0)}}return i&&(r&&!e.target&&!t.hitArea&&t.containsPoint&&t.containsPoint(o)&&(s=!0),t.interactive&&(s&&!e.target&&(e.target=t),n&&n(e,t,!!s))),s},e.prototype.findHit=function(e,t,n,r){this.recursiveFindHit(e,t,n,r,!1)},e}(),Id={interactive:!1,interactiveChildren:!0,hitArea:null,get buttonMode(){return this.cursor===`pointer`},set buttonMode(e){e?this.cursor=`pointer`:this.cursor===`pointer`&&(this.cursor=null)},cursor:null,get trackedPointers(){return this._trackedPointers===void 0&&(this._trackedPointers={}),this._trackedPointers},_trackedPointers:void 0};rc.mixin(Id);var Ld=1,Rd={target:null,data:{global:null}},zd=function(e){Md(t,e);function t(t,n){var r=e.call(this)||this;return n||={},r.renderer=t,r.autoPreventDefault=n.autoPreventDefault===void 0?!0:n.autoPreventDefault,r.interactionFrequency=n.interactionFrequency||10,r.mouse=new Ad,r.mouse.identifier=Ld,r.mouse.global.set(-999999),r.activeInteractionData={},r.activeInteractionData[Ld]=r.mouse,r.interactionDataPool=[],r.eventData=new Nd,r.interactionDOMElement=null,r.moveWhenInside=!1,r.eventsAdded=!1,r.tickerAdded=!1,r.mouseOverRenderer=!(`PointerEvent`in globalThis),r.supportsTouchEvents=`ontouchstart`in globalThis,r.supportsPointerEvents=!!globalThis.PointerEvent,r.onPointerUp=r.onPointerUp.bind(r),r.processPointerUp=r.processPointerUp.bind(r),r.onPointerCancel=r.onPointerCancel.bind(r),r.processPointerCancel=r.processPointerCancel.bind(r),r.onPointerDown=r.onPointerDown.bind(r),r.processPointerDown=r.processPointerDown.bind(r),r.onPointerMove=r.onPointerMove.bind(r),r.processPointerMove=r.processPointerMove.bind(r),r.onPointerOut=r.onPointerOut.bind(r),r.processPointerOverOut=r.processPointerOverOut.bind(r),r.onPointerOver=r.onPointerOver.bind(r),r.cursorStyles={default:`inherit`,pointer:`pointer`},r.currentCursorMode=null,r.cursor=null,r.resolution=1,r.delayedEvents=[],r.search=new Fd,r._tempDisplayObject=new ic,r._eventListenerOptions={capture:!0,passive:!1},r._useSystemTicker=n.useSystemTicker===void 0?!0:n.useSystemTicker,r.setTargetElement(r.renderer.view,r.renderer.resolution),r}return Object.defineProperty(t.prototype,`useSystemTicker`,{get:function(){return this._useSystemTicker},set:function(e){this._useSystemTicker=e,e?this.addTickerListener():this.removeTickerListener()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`lastObjectRendered`,{get:function(){return this.renderer._lastObjectRendered||this._tempDisplayObject},enumerable:!1,configurable:!0}),t.prototype.hitTest=function(e,t){return Rd.target=null,Rd.data.global=e,t||=this.lastObjectRendered,this.processInteractive(Rd,t,null,!0),Rd.target},t.prototype.setTargetElement=function(e,t){t===void 0&&(t=1),this.removeTickerListener(),this.removeEvents(),this.interactionDOMElement=e,this.resolution=t,this.addEvents(),this.addTickerListener()},t.prototype.addTickerListener=function(){this.tickerAdded||!this.interactionDOMElement||!this._useSystemTicker||(Ti.system.add(this.tickerUpdate,this,Ci.INTERACTION),this.tickerAdded=!0)},t.prototype.removeTickerListener=function(){this.tickerAdded&&(Ti.system.remove(this.tickerUpdate,this),this.tickerAdded=!1)},t.prototype.addEvents=function(){if(!(this.eventsAdded||!this.interactionDOMElement)){var e=this.interactionDOMElement.style;globalThis.navigator.msPointerEnabled?(e.msContentZooming=`none`,e.msTouchAction=`none`):this.supportsPointerEvents&&(e.touchAction=`none`),this.supportsPointerEvents?(globalThis.document.addEventListener(`pointermove`,this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.addEventListener(`pointerdown`,this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener(`pointerleave`,this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.addEventListener(`pointerover`,this.onPointerOver,this._eventListenerOptions),globalThis.addEventListener(`pointercancel`,this.onPointerCancel,this._eventListenerOptions),globalThis.addEventListener(`pointerup`,this.onPointerUp,this._eventListenerOptions)):(globalThis.document.addEventListener(`mousemove`,this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.addEventListener(`mousedown`,this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener(`mouseout`,this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.addEventListener(`mouseover`,this.onPointerOver,this._eventListenerOptions),globalThis.addEventListener(`mouseup`,this.onPointerUp,this._eventListenerOptions)),this.supportsTouchEvents&&(this.interactionDOMElement.addEventListener(`touchstart`,this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener(`touchcancel`,this.onPointerCancel,this._eventListenerOptions),this.interactionDOMElement.addEventListener(`touchend`,this.onPointerUp,this._eventListenerOptions),this.interactionDOMElement.addEventListener(`touchmove`,this.onPointerMove,this._eventListenerOptions)),this.eventsAdded=!0}},t.prototype.removeEvents=function(){if(!(!this.eventsAdded||!this.interactionDOMElement)){var e=this.interactionDOMElement.style;globalThis.navigator.msPointerEnabled?(e.msContentZooming=``,e.msTouchAction=``):this.supportsPointerEvents&&(e.touchAction=``),this.supportsPointerEvents?(globalThis.document.removeEventListener(`pointermove`,this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.removeEventListener(`pointerdown`,this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener(`pointerleave`,this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.removeEventListener(`pointerover`,this.onPointerOver,this._eventListenerOptions),globalThis.removeEventListener(`pointercancel`,this.onPointerCancel,this._eventListenerOptions),globalThis.removeEventListener(`pointerup`,this.onPointerUp,this._eventListenerOptions)):(globalThis.document.removeEventListener(`mousemove`,this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.removeEventListener(`mousedown`,this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener(`mouseout`,this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.removeEventListener(`mouseover`,this.onPointerOver,this._eventListenerOptions),globalThis.removeEventListener(`mouseup`,this.onPointerUp,this._eventListenerOptions)),this.supportsTouchEvents&&(this.interactionDOMElement.removeEventListener(`touchstart`,this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener(`touchcancel`,this.onPointerCancel,this._eventListenerOptions),this.interactionDOMElement.removeEventListener(`touchend`,this.onPointerUp,this._eventListenerOptions),this.interactionDOMElement.removeEventListener(`touchmove`,this.onPointerMove,this._eventListenerOptions)),this.interactionDOMElement=null,this.eventsAdded=!1}},t.prototype.tickerUpdate=function(e){this._deltaTime+=e,!(this._deltaTime0&&(a=e.composedPath()[0]);for(var o=a===this.interactionDOMElement?``:`outside`,s=0;s=e||i({x:0,y:0})},disableFocusAt:{type:Boolean,default:!1},xOffset:{},yOffset:{},scale:{default:1}},emits:[`modelLoaded`],setup(e,{expose:t,emit:n}){let r=e,i=n;function a(){let e=Number.parseFloat(String(r.xOffset))||0,t=Number.parseFloat(String(r.yOffset))||0;return String(r.xOffset).endsWith(`%`)&&(e=Number.parseFloat(String(r.xOffset).replace(`%`,``))/100*r.width),String(r.yOffset).endsWith(`%`)&&(t=Number.parseFloat(String(r.yOffset).replace(`%`,``))/100*r.height),{xOffset:e,yOffset:t}}let o=_n(()=>a()),s=cn(()=>r.app),c=cn(()=>r.paused),l=cn(()=>r.focusAt),u=U(),d=U(0),f=U(0),p=_n(()=>Math.max(0,Math.min(100,r.mouthOpenSize))),m=E(),h=T(w),g=_n(()=>h.between(`sm`,`md`).value||h.smaller(`sm`).value),_=oh(),v=W(new Cp({alpha:.2,blur:0,distance:20,rotation:45}));function y(){return u.value.internalModel.coreModel}function b(){if(!u.value)return;let e=2.2;g.value&&(e=2.2);let t=r.height*.95/f.value*e,n=r.width*.95/d.value*e,i=Math.min(t,n);u.value.scale.set(i*r.scale,i*r.scale),u.value.x=r.width/2+o.value.xOffset,u.value.y=r.height+o.value.yOffset}let{modelFile:S,loadingModel:D,currentMotion:O,availableMotions:j,loadSource:M,modelUrl:N}=C(Ln()),{themeColorsHue:ee,themeColorsHueDynamic:P}=C(In()),F=U({group:`Idle`,index:0});async function I(){if(!s.value)return;u.value&&(s.value.stage.removeChild(u.value),u.value.destroy(),u.value=void 0);let e=new fd;M.value===`file`?await id.setupLive2DModel(e,[S.value],{autoInteract:!1}):M.value===`url`&&await id.setupLive2DModel(e,N.value,{autoInteract:!1}),u.value=e,s.value.stage.addChild(u.value),d.value=u.value.width,f.value=u.value.height,u.value.anchor.set(.5,.5),b(),u.value.on(`hit`,e=>{u.value&&e.includes(`body`)&&u.value.motion(`tap_body`)});let t=u.value.internalModel,n=t.coreModel,r=t.motionManager;n.setParameterValueById(`ParamMouthOpenY`,p.value),j.value=Object.entries(r.definitions).flatMap(([e,t])=>t?t.map((t,n)=>({motionName:e,motionIndex:n,fileName:t.File})):[]).filter(Boolean),r.groups.idle&&r.motionGroups[r.groups.idle]?.forEach(e=>{e._motionData.curves.forEach(e=>{(e.id===`ParamEyeBallX`||e.id===`ParamEyeBallY`)&&(e.id=`_${e.id}`)})});let a=r.update;r.update=function(e,n){return a?.call(this,e,n),r.state.currentGroup===r.groups.idle&&_.update(t,n),!0},r.on(`motionStart`,(e,t)=>{F.value={group:e,index:t}}),S.value&&await sh.default.setItem(`live2dModel`,S.value),i(`modelLoaded`),D.value=!1}async function L(){if(!s.value)return;fd.registerTicker(Ti),xi.add(Ei),xi.add(zd);let e=await sh.default.getItem(`live2dModel`);if(e){S.value=e,M.value=`file`,D.value=!0;return}if(N.value){M.value=`url`,D.value=!0;return}D.value=!1}async function te(e,t){await u.value?.motion(e,t,Fu.FORCE)}let R=A(b,100),ne=U(),z=U(0);function re(){if(u.value){let e=getComputedStyle(ne.value).backgroundColor;v.value.color=Number(x(e).replace(`#`,`0x`)),u.value.filters=[v.value]}}G([()=>r.width,()=>r.height],()=>R()),G(m,re,{immediate:!0}),G([u,ee],re),G(o,b),G(()=>r.scale,b);function ie(){re(),z.value=requestAnimationFrame(ie)}G(P,()=>{P.value?z.value=requestAnimationFrame(ie):(cancelAnimationFrame(z.value),z.value=0)},{immediate:!0}),G(p,e=>y().setParameterValueById(`ParamMouthOpenY`,e)),G(s,L),G(O,e=>te(e.group,e.index)),G(c,e=>e?s.value?.stop():s.value?.start()),G(l,e=>{u.value&&(r.disableFocusAt||u.value.focus(e.x,e.y))}),k(D,e=>{e&&I()},{debounce:1e3}),Cn(re),An(()=>{cancelAnimationFrame(z.value),u.value&&s.value?.stage.removeChild(u.value)});function ae(){return j.value}return t({setMotion:te,listMotionGroups:ae}),(e,t)=>(K(),On(en,null,[jn(`div`,{ref_key:`dropShadowColorComputer`,ref:ne,hidden:``,bg:`primary-400 dark:primary-500`},null,512),Qt(e.$slots,`default`)],64))}}),lh=ch,uh=fn((exports,t)=>{ +`,ah=function(e){th(t,e);function t(n){var r=this,i=Object.assign(t.defaults,n),a=i.maxKernelSize,o=nh(i,[`maxKernelSize`]);return r=e.call(this,rh,ih.replace("${maxKernelSize}",a.toFixed(1)))||this,Object.assign(r,o),r}return Object.defineProperty(t.prototype,`center`,{get:function(){return this.uniforms.uCenter},set:function(e){this.uniforms.uCenter=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`strength`,{get:function(){return this.uniforms.uStrength},set:function(e){this.uniforms.uStrength=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`innerRadius`,{get:function(){return this.uniforms.uInnerRadius},set:function(e){this.uniforms.uInnerRadius=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,`radius`,{get:function(){return this.uniforms.uRadius},set:function(e){(e<0||e===1/0)&&(e=-1),this.uniforms.uRadius=e},enumerable:!1,configurable:!0}),t.defaults={strength:.1,center:[0,0],innerRadius:0,radius:-1,maxKernelSize:32},t}(zo);function oh(){let e=-1,t,n=-1;function r(r,i){(i>=e||i({x:0,y:0})},disableFocusAt:{type:Boolean,default:!1},xOffset:{},yOffset:{},scale:{default:1}},emits:[`modelLoaded`],setup(e,{expose:t,emit:n}){let r=e,i=n;function a(){let e=Number.parseFloat(String(r.xOffset))||0,t=Number.parseFloat(String(r.yOffset))||0;return String(r.xOffset).endsWith(`%`)&&(e=Number.parseFloat(String(r.xOffset).replace(`%`,``))/100*r.width),String(r.yOffset).endsWith(`%`)&&(t=Number.parseFloat(String(r.yOffset).replace(`%`,``))/100*r.height),{xOffset:e,yOffset:t}}let o=On(()=>a()),s=fn(()=>r.app),c=fn(()=>r.paused),l=fn(()=>r.focusAt),u=U(),d=U(0),f=U(0),p=On(()=>Math.max(0,Math.min(100,r.mouthOpenSize))),m=w(),h=O(T),g=On(()=>h.between(`sm`,`md`).value||h.smaller(`sm`).value),_=oh(),v=W(new Cp({alpha:.2,blur:0,distance:20,rotation:45}));function y(){return u.value.internalModel.coreModel}function b(){if(!u.value)return;let e=2.2;g.value&&(e=2.2);let t=r.height*.95/f.value*e,n=r.width*.95/d.value*e,i=Math.min(t,n);u.value.scale.set(i*r.scale,i*r.scale),u.value.x=r.width/2+o.value.xOffset,u.value.y=r.height+o.value.yOffset}let{modelFile:S,loadingModel:E,currentMotion:D,availableMotions:j,loadSource:M,modelUrl:N}=C(Ln()),{themeColorsHue:ee,themeColorsHueDynamic:P}=C(In()),F=U({group:`Idle`,index:0});async function I(){if(!s.value)return;u.value&&(s.value.stage.removeChild(u.value),u.value.destroy(),u.value=void 0);let e=new fd;M.value===`file`?await id.setupLive2DModel(e,[S.value],{autoInteract:!1}):M.value===`url`&&await id.setupLive2DModel(e,N.value,{autoInteract:!1}),u.value=e,s.value.stage.addChild(u.value),d.value=u.value.width,f.value=u.value.height,u.value.anchor.set(.5,.5),b(),u.value.on(`hit`,e=>{u.value&&e.includes(`body`)&&u.value.motion(`tap_body`)});let t=u.value.internalModel,n=t.coreModel,r=t.motionManager;n.setParameterValueById(`ParamMouthOpenY`,p.value),j.value=Object.entries(r.definitions).flatMap(([e,t])=>t?t.map((t,n)=>({motionName:e,motionIndex:n,fileName:t.File})):[]).filter(Boolean),r.groups.idle&&r.motionGroups[r.groups.idle]?.forEach(e=>{e._motionData.curves.forEach(e=>{(e.id===`ParamEyeBallX`||e.id===`ParamEyeBallY`)&&(e.id=`_${e.id}`)})});let a=r.update;r.update=function(e,n){return a?.call(this,e,n),r.state.currentGroup===r.groups.idle&&_.update(t,n),!0},r.on(`motionStart`,(e,t)=>{F.value={group:e,index:t}}),S.value&&await sh.default.setItem(`live2dModel`,S.value),i(`modelLoaded`),E.value=!1}async function L(){if(!s.value)return;fd.registerTicker(Ti),xi.add(Ei),xi.add(zd);let e=await sh.default.getItem(`live2dModel`);if(e){S.value=e,M.value=`file`,E.value=!0;return}if(N.value){M.value=`url`,E.value=!0;return}E.value=!1}async function te(e,t){await u.value?.motion(e,t,Fu.FORCE)}let R=A(b,100),ne=U(),z=U(0);function re(){if(u.value){let e=getComputedStyle(ne.value).backgroundColor;v.value.color=Number(x(e).replace(`#`,`0x`)),u.value.filters=[v.value]}}G([()=>r.width,()=>r.height],()=>R()),G(m,re,{immediate:!0}),G([u,ee],re),G(o,b),G(()=>r.scale,b);function ie(){re(),z.value=requestAnimationFrame(ie)}G(P,()=>{P.value?z.value=requestAnimationFrame(ie):(cancelAnimationFrame(z.value),z.value=0)},{immediate:!0}),G(p,e=>y().setParameterValueById(`ParamMouthOpenY`,e)),G(s,L),G(D,e=>te(e.group,e.index)),G(c,e=>e?s.value?.stop():s.value?.start()),G(l,e=>{u.value&&(r.disableFocusAt||u.value.focus(e.x,e.y))}),k(E,e=>{e&&I()},{debounce:1e3}),Pn(re),bn(()=>{cancelAnimationFrame(z.value),u.value&&s.value?.stage.removeChild(u.value)});function ae(){return j.value}return t({setMotion:te,listMotionGroups:ae}),(e,t)=>(K(),nn(Dn,null,[xn(`div`,{ref_key:`dropShadowColorComputer`,ref:ne,hidden:``,bg:`primary-400 dark:primary-500`},null,512),Tn(e.$slots,`default`)],64))}}),lh=ch,uh=mn((exports,t)=>{ /*! JSZip v3.10.1 - A JavaScript class for generating and reading zip files @@ -2402,16 +2402,16 @@ Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/js JSZip uses the library pako released under the MIT license : https://github.com/nodeca/pako/blob/main/LICENSE */ -(function(n){typeof exports==`object`&&t!==void 0?t.exports=n():typeof define==`function`&&define.amd?define([],n):(typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:this).JSZip=n()})(function(){return function e(t,n,r){function i(o,s){if(!n[o]){if(!t[o]){var c=typeof hn==`function`&&hn;if(!s&&c)return c(o,!0);if(a)return a(o,!0);var l=Error(`Cannot find module '`+o+`'`);throw l.code=`MODULE_NOT_FOUND`,l}var u=n[o]={exports:{}};t[o][0].call(u.exports,function(e){var n=t[o][1][e];return i(n||e)},u,u.exports,e,t,n,r)}return n[o].exports}for(var a=typeof hn==`function`&&hn,o=0;o>2,s=(3&t)<<4|n>>4,c=1>6:64,l=2>4,n=(15&o)<<4|(s=a.indexOf(e.charAt(l++)))>>2,r=(3&s)<<6|(c=a.indexOf(e.charAt(l++))),f[u++]=t,s!==64&&(f[u++]=n),c!==64&&(f[u++]=r);return f}},{"./support":30,"./utils":32}],2:[function(e,t,n){"use strict";var r=e(`./external`),i=e(`./stream/DataWorker`),a=e(`./stream/Crc32Probe`),o=e(`./stream/DataLengthProbe`);function s(e,t,n,r,i){this.compressedSize=e,this.uncompressedSize=t,this.crc32=n,this.compression=r,this.compressedContent=i}s.prototype={getContentWorker:function(){var e=new i(r.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new o(`data_length`)),t=this;return e.on(`end`,function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw Error(`Bug : uncompressed data size mismatch`)}),e},getCompressedWorker:function(){return new i(r.Promise.resolve(this.compressedContent)).withStreamInfo(`compressedSize`,this.compressedSize).withStreamInfo(`uncompressedSize`,this.uncompressedSize).withStreamInfo(`crc32`,this.crc32).withStreamInfo(`compression`,this.compression)}},s.createWorkerFrom=function(e,t,n){return e.pipe(new a).pipe(new o(`uncompressedSize`)).pipe(t.compressWorker(n)).pipe(new o(`compressedSize`)).withStreamInfo(`compression`,t)},t.exports=s},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,t,n){"use strict";var r=e(`./stream/GenericWorker`);n.STORE={magic:`\0\0`,compressWorker:function(){return new r(`STORE compression`)},uncompressWorker:function(){return new r(`STORE decompression`)}},n.DEFLATE=e(`./flate`)},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,t,n){"use strict";var r=e(`./utils`),i=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t){return e!==void 0&&e.length?r.getTypeOf(e)===`string`?function(e,t,n,r){var a=i,o=r+n;e^=-1;for(var s=r;s>>8^a[255&(e^t.charCodeAt(s))];return-1^e}(0|t,e,e.length,0):function(e,t,n,r){var a=i,o=r+n;e^=-1;for(var s=r;s>>8^a[255&(e^t[s])];return-1^e}(0|t,e,e.length,0):0}},{"./utils":32}],5:[function(e,t,n){"use strict";n.base64=!1,n.binary=!1,n.dir=!1,n.createFolders=!0,n.date=null,n.compression=null,n.compressionOptions=null,n.comment=null,n.unixPermissions=null,n.dosPermissions=null},{}],6:[function(e,t,n){"use strict";var r=null;r=typeof Promise<`u`?Promise:e(`lie`),t.exports={Promise:r}},{lie:37}],7:[function(e,t,n){"use strict";var r=typeof Uint8Array<`u`&&typeof Uint16Array<`u`&&typeof Uint32Array<`u`,i=e(`pako`),a=e(`./utils`),o=e(`./stream/GenericWorker`),s=r?`uint8array`:`array`;function c(e,t){o.call(this,`FlateWorker/`+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}n.magic=`\b\0`,a.inherits(c,o),c.prototype.processChunk=function(e){this.meta=e.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(s,e.data),!1)},c.prototype.flush=function(){o.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},c.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this._pako=null},c.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}},n.compressWorker=function(e){return new c(`Deflate`,e)},n.uncompressWorker=function(){return new c(`Inflate`,{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,t,n){"use strict";function r(e,t){var n,r=``;for(n=0;n>>=8;return r}function i(e,t,n,i,o,u){var d,f,p=e.file,m=e.compression,h=u!==s.utf8encode,g=a.transformTo(`string`,u(p.name)),_=a.transformTo(`string`,s.utf8encode(p.name)),v=p.comment,y=a.transformTo(`string`,u(v)),b=a.transformTo(`string`,s.utf8encode(v)),x=_.length!==p.name.length,S=b.length!==v.length,C=``,w=``,T=``,E=p.dir,D=p.date,O={crc32:0,compressedSize:0,uncompressedSize:0};t&&!n||(O.crc32=e.crc32,O.compressedSize=e.compressedSize,O.uncompressedSize=e.uncompressedSize);var k=0;t&&(k|=8),h||!x&&!S||(k|=2048);var A=0,j=0;E&&(A|=16),o===`UNIX`?(j=798,A|=function(e,t){var n=e;return e||(n=t?16893:33204),(65535&n)<<16}(p.unixPermissions,E)):(j=20,A|=function(e){return 63&(e||0)}(p.dosPermissions)),d=D.getUTCHours(),d<<=6,d|=D.getUTCMinutes(),d<<=5,d|=D.getUTCSeconds()/2,f=D.getUTCFullYear()-1980,f<<=4,f|=D.getUTCMonth()+1,f<<=5,f|=D.getUTCDate(),x&&(w=r(1,1)+r(c(g),4)+_,C+=`up`+r(w.length,2)+w),S&&(T=r(1,1)+r(c(y),4)+b,C+=`uc`+r(T.length,2)+T);var M=``;return M+=` -\0`,M+=r(k,2),M+=m.magic,M+=r(d,2),M+=r(f,2),M+=r(O.crc32,4),M+=r(O.compressedSize,4),M+=r(O.uncompressedSize,4),M+=r(g.length,2),M+=r(C.length,2),{fileRecord:l.LOCAL_FILE_HEADER+M+g+C,dirRecord:l.CENTRAL_FILE_HEADER+r(j,2)+M+r(y.length,2)+`\0\0\0\0`+r(A,4)+r(i,4)+g+C+y}}var a=e(`../utils`),o=e(`../stream/GenericWorker`),s=e(`../utf8`),c=e(`../crc32`),l=e(`../signature`);function u(e,t,n,r){o.call(this,`ZipFileWorker`),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=n,this.encodeFileName=r,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(u,o),u.prototype.push=function(e){var t=e.meta.percent||0,n=this.entriesCount,r=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,o.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:n?(t+100*(n-r-1))/n:100}}))},u.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var n=i(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:n.fileRecord,meta:{percent:0}})}else this.accumulate=!0},u.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,n=i(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(n.dirRecord),t)this.push({data:function(e){return l.DATA_DESCRIPTOR+r(e.crc32,4)+r(e.compressedSize,4)+r(e.uncompressedSize,4)}(e),meta:{percent:100}});else for(this.push({data:n.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},u.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t=this.index;t--)n=(n<<8)+this.byteAt(t);return this.index+=e,n},readString:function(e){return r.transformTo(`string`,this.readData(e))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},t.exports=i},{"../utils":32}],19:[function(e,t,n){"use strict";var r=e(`./Uint8ArrayReader`);function i(e){r.call(this,e)}e(`../utils`).inherits(i,r),i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,t,n){"use strict";var r=e(`./DataReader`);function i(e){r.call(this,e)}e(`../utils`).inherits(i,r),i.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},i.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},i.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./DataReader":18}],21:[function(e,t,n){"use strict";var r=e(`./ArrayReader`);function i(e){r.call(this,e)}e(`../utils`).inherits(i,r),i.prototype.readData=function(e){if(this.checkOffset(e),e===0)return new Uint8Array;var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(e,t,n){"use strict";var r=e(`../utils`),i=e(`../support`),a=e(`./ArrayReader`),o=e(`./StringReader`),s=e(`./NodeBufferReader`),c=e(`./Uint8ArrayReader`);t.exports=function(e){var t=r.getTypeOf(e);return r.checkSupport(t),t!==`string`||i.uint8array?t===`nodebuffer`?new s(e):i.uint8array?new c(r.transformTo(`uint8array`,e)):new a(r.transformTo(`array`,e)):new o(e)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,t,n){"use strict";n.LOCAL_FILE_HEADER=`PK`,n.CENTRAL_FILE_HEADER=`PK`,n.CENTRAL_DIRECTORY_END=`PK`,n.ZIP64_CENTRAL_DIRECTORY_LOCATOR=`PK\x07`,n.ZIP64_CENTRAL_DIRECTORY_END=`PK`,n.DATA_DESCRIPTOR=`PK\x07\b`},{}],24:[function(e,t,n){"use strict";var r=e(`./GenericWorker`),i=e(`../utils`);function a(e){r.call(this,`ConvertWorker to `+e),this.destType=e}i.inherits(a,r),a.prototype.processChunk=function(e){this.push({data:i.transformTo(this.destType,e.data),meta:e.meta})},t.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(e,t,n){"use strict";var r=e(`./GenericWorker`),i=e(`../crc32`);function a(){r.call(this,`Crc32Probe`),this.withStreamInfo(`crc32`,0)}e(`../utils`).inherits(a,r),a.prototype.processChunk=function(e){this.streamInfo.crc32=i(e.data,this.streamInfo.crc32||0),this.push(e)},t.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,t,n){"use strict";var r=e(`../utils`),i=e(`./GenericWorker`);function a(e){i.call(this,`DataLengthProbe for `+e),this.propName=e,this.withStreamInfo(e,0)}r.inherits(a,i),a.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}i.prototype.processChunk.call(this,e)},t.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(e,t,n){"use strict";var r=e(`../utils`),i=e(`./GenericWorker`);function a(e){i.call(this,`DataWorker`);var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type=``,this._tickScheduled=!1,e.then(function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=r.getTypeOf(e),t.isPaused||t._tickAndRepeat()},function(e){t.error(e)})}r.inherits(a,i),a.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,r.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(r.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case`string`:e=this.data.substring(this.index,t);break;case`uint8array`:e=this.data.subarray(this.index,t);break;case`array`:case`nodebuffer`:e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(e,t,n){"use strict";function r(e){this.name=e||`default`,this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}r.prototype={push:function(e){this.emit(`data`,e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit(`end`),this.cleanUp(),this.isFinished=!0}catch(e){this.emit(`error`,e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit(`error`,e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var n=0;n `+e:e}},t.exports=r},{}],29:[function(e,t,n){"use strict";var r=e(`../utils`),i=e(`./ConvertWorker`),a=e(`./GenericWorker`),o=e(`../base64`),s=e(`../support`),c=e(`../external`),l=null;if(s.nodestream)try{l=e(`../nodejs/NodejsStreamOutputAdapter`)}catch{}function u(e,t){return new c.Promise(function(n,i){var a=[],s=e._internalType,c=e._outputType,l=e._mimeType;e.on(`data`,function(e,n){a.push(e),t&&t(n)}).on(`error`,function(e){a=[],i(e)}).on(`end`,function(){try{var e=function(e,t,n){switch(e){case`blob`:return r.newBlob(r.transformTo(`arraybuffer`,t),n);case`base64`:return o.encode(t);default:return r.transformTo(e,t)}}(c,function(e,t){var n,r=0,i=null,a=0;for(n=0;n`u`)n.blob=!1;else{var r=new ArrayBuffer(0);try{n.blob=new Blob([r],{type:`application/zip`}).size===0}catch{try{var i=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);i.append(r),n.blob=i.getBlob(`application/zip`).size===0}catch{n.blob=!1}}}try{n.nodestream=!!e(`readable-stream`).Readable}catch{n.nodestream=!1}},{"readable-stream":16}],31:[function(e,t,n){"use strict";for(var r=e(`./utils`),i=e(`./support`),a=e(`./nodejsUtils`),o=e(`./stream/GenericWorker`),s=Array(256),c=0;c<256;c++)s[c]=252<=c?6:248<=c?5:240<=c?4:224<=c?3:192<=c?2:1;s[254]=s[254]=1;function l(){o.call(this,`utf-8 decode`),this.leftOver=null}function u(){o.call(this,`utf-8 encode`)}n.utf8encode=function(e){return i.nodebuffer?a.newBufferFrom(e,`utf-8`):function(e){var t,n,r,a,o,s=e.length,c=0;for(a=0;a>>6:(n<65536?t[o++]=224|n>>>12:(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63),t[o++]=128|n>>>6&63),t[o++]=128|63&n);return t}(e)},n.utf8decode=function(e){return i.nodebuffer?r.transformTo(`nodebuffer`,e).toString(`utf-8`):function(e){var t,n,i,a,o=e.length,c=Array(2*o);for(t=n=0;t>10&1023,c[n++]=56320|1023&i)}return c.length!==n&&(c.subarray?c=c.subarray(0,n):c.length=n),r.applyFromCharCode(c)}(e=r.transformTo(i.uint8array?`uint8array`:`array`,e))},r.inherits(l,o),l.prototype.processChunk=function(e){var t=r.transformTo(i.uint8array?`uint8array`:`array`,e.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var a=t;(t=new Uint8Array(a.length+this.leftOver.length)).set(this.leftOver,0),t.set(a,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var o=function(e,t){var n;for((t||=e.length)>e.length&&(t=e.length),n=t-1;0<=n&&(192&e[n])==128;)n--;return n<0||n===0?t:n+s[e[n]]>t?n:t}(t),c=t;o!==t.length&&(i.uint8array?(c=t.subarray(0,o),this.leftOver=t.subarray(o,t.length)):(c=t.slice(0,o),this.leftOver=t.slice(o,t.length))),this.push({data:n.utf8decode(c),meta:e.meta})},l.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:n.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},n.Utf8DecodeWorker=l,r.inherits(u,o),u.prototype.processChunk=function(e){this.push({data:n.utf8encode(e.data),meta:e.meta})},n.Utf8EncodeWorker=u},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,t,n){"use strict";var r=e(`./support`),i=e(`./base64`),a=e(`./nodejsUtils`),o=e(`./external`);function s(e){return e}function c(e,t){for(var n=0;n>8;this.dir=!!(16&this.externalFileAttributes),e==0&&(this.dosPermissions=63&this.externalFileAttributes),e==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!==`/`||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var e=r(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(e){var t,n,r,i=e.index+this.extraFieldsLength;for(this.extraFields||={};e.index+4>>6:(n<65536?t[o++]=224|n>>>12:(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63),t[o++]=128|n>>>6&63),t[o++]=128|63&n);return t},n.buf2binstring=function(e){return c(e,e.length)},n.binstring2buf=function(e){for(var t=new r.Buf8(e.length),n=0,i=t.length;n>10&1023,l[r++]=56320|1023&i)}return c(l,r)},n.utf8border=function(e,t){var n;for((t||=e.length)>e.length&&(t=e.length),n=t-1;0<=n&&(192&e[n])==128;)n--;return n<0||n===0?t:n+o[e[n]]>t?n:t}},{"./common":41}],43:[function(e,t,n){"use strict";t.exports=function(e,t,n,r){for(var i=65535&e|0,a=e>>>16&65535|0,o=0;n!==0;){for(n-=o=2e3>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t,n,i){var a=r,o=i+n;e^=-1;for(var s=i;s>>8^a[255&(e^t[s])];return-1^e}},{}],46:[function(e,t,n){"use strict";var r,i=e(`../utils/common`),a=e(`./trees`),o=e(`./adler32`),s=e(`./crc32`),c=e(`./messages`),l=0,u=4,d=0,f=-2,p=-1,m=4,h=2,g=8,_=9,v=286,y=30,b=19,x=2*v+1,S=15,C=3,w=258,T=w+C+1,E=42,D=113,O=1,k=2,A=3,j=4;function M(e,t){return e.msg=c[t],t}function N(e){return(e<<1)-(4e.avail_out&&(n=e.avail_out),n!==0&&(i.arraySet(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))}function F(e,t){a._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,P(e.strm)}function I(e,t){e.pending_buf[e.pending++]=t}function L(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function te(e,t){var n,r,i=e.max_chain_length,a=e.strstart,o=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-T?e.strstart-(e.w_size-T):0,l=e.window,u=e.w_mask,d=e.prev,f=e.strstart+w,p=l[a+o-1],m=l[a+o];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do if(l[(n=t)+o]===m&&l[n+o-1]===p&&l[n]===l[a]&&l[++n]===l[a+1]){a+=2,n++;do;while(l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&ac&&--i!=0);return o<=e.lookahead?o:e.lookahead}function R(e){var t,n,r,a,c,l,u,d,f,p,m=e.w_size;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=m+(m-T)){for(i.arraySet(e.window,e.window,m,m,0),e.match_start-=m,e.strstart-=m,e.block_start-=m,t=n=e.hash_size;r=e.head[--t],e.head[t]=m<=r?r-m:0,--n;);for(t=n=m;r=e.prev[--t],e.prev[t]=m<=r?r-m:0,--n;);a+=m}if(e.strm.avail_in===0)break;if(l=e.strm,u=e.window,d=e.strstart+e.lookahead,f=a,p=void 0,p=l.avail_in,f=C)for(c=e.strstart-e.insert,e.ins_h=e.window[c],e.ins_h=(e.ins_h<=C&&(e.ins_h=(e.ins_h<=C)if(r=a._tr_tally(e,e.strstart-e.match_start,e.match_length-C),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=C){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<=C&&(e.ins_h=(e.ins_h<=C&&e.match_length<=e.prev_length){for(i=e.strstart+e.lookahead-C,r=a._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-C),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=i&&(e.ins_h=(e.ins_h<e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(R(e),e.lookahead===0&&t===l)return O;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+n;if((e.strstart===0||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,F(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-T&&(F(e,!1),e.strm.avail_out===0))return O}return e.insert=0,t===u?(F(e,!0),e.strm.avail_out===0?A:j):(e.strstart>e.block_start&&(F(e,!1),e.strm.avail_out),O)}),new re(4,4,8,4,ne),new re(4,5,16,8,ne),new re(4,6,32,32,ne),new re(4,4,16,16,z),new re(8,16,32,32,z),new re(8,16,128,128,z),new re(8,32,128,256,z),new re(32,128,258,1024,z),new re(32,258,258,4096,z)],n.deflateInit=function(e,t){return se(e,t,g,15,8,0)},n.deflateInit2=se,n.deflateReset=oe,n.deflateResetKeep=ae,n.deflateSetHeader=function(e,t){return e&&e.state&&e.state.wrap===2?(e.state.gzhead=t,d):f},n.deflate=function(e,t){var n,i,o,c;if(!e||!e.state||5>8&255),I(i,i.gzhead.time>>16&255),I(i,i.gzhead.time>>24&255),I(i,i.level===9?2:2<=i.strategy||i.level<2?4:0),I(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(I(i,255&i.gzhead.extra.length),I(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=s(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(I(i,0),I(i,0),I(i,0),I(i,0),I(i,0),I(i,i.level===9?2:2<=i.strategy||i.level<2?4:0),I(i,3),i.status=D);else{var p=g+(i.w_bits-8<<4)<<8;p|=(2<=i.strategy||i.level<2?0:i.level<6?1:i.level===6?2:3)<<6,i.strstart!==0&&(p|=32),p+=31-p%31,i.status=D,L(i,p),i.strstart!==0&&(L(i,e.adler>>>16),L(i,65535&e.adler)),e.adler=1}if(i.status===69)if(i.gzhead.extra){for(o=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),P(e),o=i.pending,i.pending!==i.pending_buf_size));)I(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(i.status===73)if(i.gzhead.name){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),P(e),o=i.pending,i.pending===i.pending_buf_size)){c=1;break}c=i.gzindexo&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),c===0&&(i.gzindex=0,i.status=91)}else i.status=91;if(i.status===91)if(i.gzhead.comment){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),P(e),o=i.pending,i.pending===i.pending_buf_size)){c=1;break}c=i.gzindexo&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),c===0&&(i.status=103)}else i.status=103;if(i.status===103&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&P(e),i.pending+2<=i.pending_buf_size&&(I(i,255&e.adler),I(i,e.adler>>8&255),e.adler=0,i.status=D)):i.status=D),i.pending!==0){if(P(e),e.avail_out===0)return i.last_flush=-1,d}else if(e.avail_in===0&&N(t)<=N(n)&&t!==u)return M(e,-5);if(i.status===666&&e.avail_in!==0)return M(e,-5);if(e.avail_in!==0||i.lookahead!==0||t!==l&&i.status!==666){var m=i.strategy===2?function(e,t){for(var n;;){if(e.lookahead===0&&(R(e),e.lookahead===0)){if(t===l)return O;break}if(e.match_length=0,n=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(F(e,!1),e.strm.avail_out===0))return O}return e.insert=0,t===u?(F(e,!0),e.strm.avail_out===0?A:j):e.last_lit&&(F(e,!1),e.strm.avail_out===0)?O:k}(i,t):i.strategy===3?function(e,t){for(var n,r,i,o,s=e.window;;){if(e.lookahead<=w){if(R(e),e.lookahead<=w&&t===l)return O;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=C&&0e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=C?(n=a._tr_tally(e,1,e.match_length-C),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(F(e,!1),e.strm.avail_out===0))return O}return e.insert=0,t===u?(F(e,!0),e.strm.avail_out===0?A:j):e.last_lit&&(F(e,!1),e.strm.avail_out===0)?O:k}(i,t):r[i.level].func(i,t);if(m!==A&&m!==j||(i.status=666),m===O||m===A)return e.avail_out===0&&(i.last_flush=-1),d;if(m===k&&(t===1?a._tr_align(i):t!==5&&(a._tr_stored_block(i,0,0,!1),t===3&&(ee(i.head),i.lookahead===0&&(i.strstart=0,i.block_start=0,i.insert=0))),P(e),e.avail_out===0))return i.last_flush=-1,d}return t===u?i.wrap<=0?1:(i.wrap===2?(I(i,255&e.adler),I(i,e.adler>>8&255),I(i,e.adler>>16&255),I(i,e.adler>>24&255),I(i,255&e.total_in),I(i,e.total_in>>8&255),I(i,e.total_in>>16&255),I(i,e.total_in>>24&255)):(L(i,e.adler>>>16),L(i,65535&e.adler)),P(e),0=n.w_size&&(s===0&&(ee(n.head),n.strstart=0,n.block_start=0,n.insert=0),p=new i.Buf8(n.w_size),i.arraySet(p,t,m-n.w_size,n.w_size,0),t=p,m=n.w_size),c=e.avail_in,l=e.next_in,u=e.input,e.avail_in=m,e.next_in=0,e.input=t,R(n);n.lookahead>=C;){for(r=n.strstart,a=n.lookahead-(C-1);n.ins_h=(n.ins_h<>>=b=y>>>24,m-=b,(b=y>>>16&255)==0)E[a++]=65535&y;else{if(!(16&b)){if(!(64&b)){y=h[(65535&y)+(p&(1<>>=b,m-=b),m<15&&(p+=T[r++]<>>=b=y>>>24,m-=b,!(16&(b=y>>>16&255))){if(!(64&b)){y=g[(65535&y)+(p&(1<>>=b,m-=b,(b=a-o)>3,p&=(1<<(m-=x<<3))-1,e.next_in=r,e.next_out=a,e.avail_in=r>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function g(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function _(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg=``,t.wrap&&(e.adler=1&t.wrap),t.mode=f,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new r.Buf32(p),t.distcode=t.distdyn=new r.Buf32(m),t.sane=1,t.back=-1,u):d}function v(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,_(e)):d}function y(e,t){var n,r;return e&&e.state?(r=e.state,t<0?(n=0,t=-t):(n=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15=o.wsize?(r.arraySet(o.window,t,n-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(i<(a=o.wsize-o.wnext)&&(a=i),r.arraySet(o.window,t,n-i,a,o.wnext),(i-=a)?(r.arraySet(o.window,t,n-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=a,o.wnext===o.wsize&&(o.wnext=0),o.whave>>8&255,n.check=a(n.check,R,2,0),x=b=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&b)<<8)+(b>>8))%31){e.msg=`incorrect header check`,n.mode=30;break}if((15&b)!=8){e.msg=`unknown compression method`,n.mode=30;break}if(x-=4,P=8+(15&(b>>>=4)),n.wbits===0)n.wbits=P;else if(P>n.wbits){e.msg=`invalid window size`,n.mode=30;break}n.dmax=1<>8&1),512&n.flags&&(R[0]=255&b,R[1]=b>>>8&255,n.check=a(n.check,R,2,0)),x=b=0,n.mode=3;case 3:for(;x<32;){if(v===0)break e;v--,b+=p[g++]<>>8&255,R[2]=b>>>16&255,R[3]=b>>>24&255,n.check=a(n.check,R,4,0)),x=b=0,n.mode=4;case 4:for(;x<16;){if(v===0)break e;v--,b+=p[g++]<>8),512&n.flags&&(R[0]=255&b,R[1]=b>>>8&255,n.check=a(n.check,R,2,0)),x=b=0,n.mode=5;case 5:if(1024&n.flags){for(;x<16;){if(v===0)break e;v--,b+=p[g++]<>>8&255,n.check=a(n.check,R,2,0)),x=b=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&(v<(E=n.length)&&(E=v),E&&(n.head&&(P=n.head.extra_len-n.length,n.head.extra||(n.head.extra=Array(n.head.extra_len)),r.arraySet(n.head.extra,p,g,E,P)),512&n.flags&&(n.check=a(n.check,p,E,g)),v-=E,g+=E,n.length-=E),n.length))break e;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(v===0)break e;for(E=0;P=p[g+ E++],n.head&&P&&n.length<65536&&(n.head.name+=String.fromCharCode(P)),P&&E>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=12;break;case 10:for(;x<32;){if(v===0)break e;v--,b+=p[g++]<>>=7&x,x-=7&x,n.mode=27;break}for(;x<3;){if(v===0)break e;v--,b+=p[g++]<>>=1)){case 0:n.mode=14;break;case 1:if(w(n),n.mode=20,t!==6)break;b>>>=2,x-=2;break e;case 2:n.mode=17;break;case 3:e.msg=`invalid block type`,n.mode=30}b>>>=2,x-=2;break;case 14:for(b>>>=7&x,x-=7&x;x<32;){if(v===0)break e;v--,b+=p[g++]<>>16^65535)){e.msg=`invalid stored block lengths`,n.mode=30;break}if(n.length=65535&b,x=b=0,n.mode=15,t===6)break e;case 15:n.mode=16;case 16:if(E=n.length){if(v>>=5,x-=5,n.ndist=1+(31&b),b>>>=5,x-=5,n.ncode=4+(15&b),b>>>=4,x-=4,286>>=3,x-=3}for(;n.have<19;)n.lens[ne[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,I={bits:n.lenbits},F=s(0,n.lens,0,19,n.lencode,0,n.work,I),n.lenbits=I.bits,F){e.msg=`invalid code lengths set`,n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have>>16&255,j=65535&te,!((k=te>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>>=k,x-=k,n.lens[n.have++]=j;else{if(j===16){for(L=k+2;x>>=k,x-=k,n.have===0){e.msg=`invalid bit length repeat`,n.mode=30;break}P=n.lens[n.have-1],E=3+(3&b),b>>>=2,x-=2}else if(j===17){for(L=k+3;x>>=k)),b>>>=3,x-=3}else{for(L=k+7;x>>=k)),b>>>=7,x-=7}if(n.have+E>n.nlen+n.ndist){e.msg=`invalid bit length repeat`,n.mode=30;break}for(;E--;)n.lens[n.have++]=P}}if(n.mode===30)break;if(n.lens[256]===0){e.msg=`invalid code -- missing end-of-block`,n.mode=30;break}if(n.lenbits=9,I={bits:n.lenbits},F=s(c,n.lens,0,n.nlen,n.lencode,0,n.work,I),n.lenbits=I.bits,F){e.msg=`invalid literal/lengths set`,n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,I={bits:n.distbits},F=s(l,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,I),n.distbits=I.bits,F){e.msg=`invalid distances set`,n.mode=30;break}if(n.mode=20,t===6)break e;case 20:n.mode=21;case 21:if(6<=v&&258<=y){e.next_out=_,e.avail_out=y,e.next_in=g,e.avail_in=v,n.hold=b,n.bits=x,o(e,C),_=e.next_out,m=e.output,y=e.avail_out,g=e.next_in,p=e.input,v=e.avail_in,b=n.hold,x=n.bits,n.mode===12&&(n.back=-1);break}for(n.back=0;A=(te=n.lencode[b&(1<>>16&255,j=65535&te,!((k=te>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>M)])>>>16&255,j=65535&te,!(M+(k=te>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>>=M,x-=M,n.back+=M}if(b>>>=k,x-=k,n.back+=k,n.length=j,A===0){n.mode=26;break}if(32&A){n.back=-1,n.mode=12;break}if(64&A){e.msg=`invalid literal/length code`,n.mode=30;break}n.extra=15&A,n.mode=22;case 22:if(n.extra){for(L=n.extra;x>>=n.extra,x-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;A=(te=n.distcode[b&(1<>>16&255,j=65535&te,!((k=te>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>M)])>>>16&255,j=65535&te,!(M+(k=te>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>>=M,x-=M,n.back+=M}if(b>>>=k,x-=k,n.back+=k,64&A){e.msg=`invalid distance code`,n.mode=30;break}n.offset=j,n.extra=15&A,n.mode=24;case 24:if(n.extra){for(L=n.extra;x>>=n.extra,x-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg=`invalid distance too far back`,n.mode=30;break}n.mode=25;case 25:if(y===0)break e;if(E=C-y,n.offset>E){if((E=n.offset-E)>n.whave&&n.sane){e.msg=`invalid distance too far back`,n.mode=30;break}D=E>n.wnext?(E-=n.wnext,n.wsize-E):n.wnext-E,E>n.length&&(E=n.length),O=n.window}else O=m,D=_-n.offset,E=n.length;for(yv?(b=I[L+d[w]],N[ee+d[w]]):(b=96,0),p=1<>k)+(m-=p)]=y<<24|b<<16|x|0,m!==0;);for(p=1<>=1;if(p===0?M=0:(M&=p-1,M+=p),w++,--P[C]==0){if(C===E)break;C=t[n+d[w]]}if(D>>7)]}function I(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function L(e,t,n){e.bi_valid>h-n?(e.bi_buf|=t<>h-e.bi_valid,e.bi_valid+=n-h):(e.bi_buf|=t<>>=1,n<<=1,0<--t;);return n>>>1}function ne(e,t,n){var r,i,a=Array(m+1),o=0;for(r=1;r<=m;r++)a[r]=o=o+n[r-1]<<1;for(i=0;i<=t;i++){var s=e[2*i+1];s!==0&&(e[2*i]=R(a[s]++,s))}}function z(e){var t;for(t=0;t>1;1<=n;n--)ae(e,a,n);for(i=c;n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],ae(e,a,1),r=e.heap[1],e.heap[--e.heap_max]=n,e.heap[--e.heap_max]=r,a[2*i]=a[2*n]+a[2*r],e.depth[i]=(e.depth[n]>=e.depth[r]?e.depth[n]:e.depth[r])+1,a[2*n+1]=a[2*r+1]=i,e.heap[1]=i++,ae(e,a,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var n,r,i,a,o,s,c=t.dyn_tree,l=t.max_code,u=t.stat_desc.static_tree,d=t.stat_desc.has_stree,f=t.stat_desc.extra_bits,h=t.stat_desc.extra_base,g=t.stat_desc.max_length,_=0;for(a=0;a<=m;a++)e.bl_count[a]=0;for(c[2*e.heap[e.heap_max]+1]=0,n=e.heap_max+1;n>=7;r>>=1)if(1&n&&e.dyn_ltree[2*t]!==0)return i;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return a;for(t=32;t>>3,(s=e.static_len+3+7>>>3)<=o&&(o=s)):o=s=n+5,n+4<=o&&t!==-1?de(e,t,n,r):e.strategy===4||s===o?(L(e,2+(r?1:0),3),oe(e,T,E)):(L(e,4+(r?1:0),3),function(e,t,n,r){var i;for(L(e,t-257,5),L(e,n-1,5),L(e,r-4,4),i=0;i>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&n,e.last_lit++,t===0?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(O[n]+l+1)]++,e.dyn_dtree[2*F(t)]++),e.last_lit===e.lit_bufsize-1},n._tr_align=function(e){L(e,2,3),te(e,_,T),function(e){e.bi_valid===16?(I(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},{"../utils/common":41}],53:[function(e,t,n){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=``,this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(e,t,n){(function(e){(function(e,t){"use strict";if(!e.setImmediate){var n,r,i,a,o=1,s={},c=!1,l=e.document,u=Object.getPrototypeOf&&Object.getPrototypeOf(e);u=u&&u.setTimeout?u:e,n={}.toString.call(e.process)===`[object process]`?function(e){process.nextTick(function(){f(e)})}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage(``,`*`),e.onmessage=n,t}}()?(a=`setImmediate$`+Math.random()+`$`,e.addEventListener?e.addEventListener(`message`,p,!1):e.attachEvent(`onmessage`,p),function(t){e.postMessage(a+t,`*`)}):e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){f(e.data)},function(e){i.port2.postMessage(e)}):l&&`onreadystatechange`in l.createElement(`script`)?(r=l.documentElement,function(e){var t=l.createElement(`script`);t.onreadystatechange=function(){f(e),t.onreadystatechange=null,r.removeChild(t),t=null},r.appendChild(t)}):function(e){setTimeout(f,0,e)},u.setImmediate=function(e){typeof e!=`function`&&(e=Function(``+e));for(var t=Array(arguments.length-1),r=0;r`u`?e===void 0?this:e:self)}).call(this,typeof global<`u`?global:typeof self<`u`?self:typeof window<`u`?window:{})},{}]},{},[10])(10)})}),dh=gn(uh());gd.zipReader=(e,t)=>dh.default.loadAsync(e);const fh=gd.createSettings;gd.createSettings=async e=>{let t=Object.keys(e.files);return t.find(e=>ph(e))?fh(e):gh(t)};function ph(e){return e.endsWith(`model3.json`)}function mh(e){return e.endsWith(`.moc3`)}function hh(e){return e.split(/[\\/]/).pop()}function gh(e){let t=e.filter(e=>mh(e));if(t.length!==1){let e=t.length?`(${t.map(e=>`"${e}"`).join(`,`)})`:``;throw Error(`Expected exactly one moc file, got ${t.length} ${e}`)}let n=t[0],r=hh(n).replace(/\.moc3?/,``),i=e.filter(e=>e.endsWith(`.png`));if(!i.length)throw Error(`Textures not found`);let a=e.filter(e=>e.endsWith(`.mtn`)||e.endsWith(`.motion3.json`)),o=e.find(e=>e.includes(`physics`)),s=e.find(e=>e.includes(`pose`)),c=new vd({url:`${r}.model3.json`,Version:3,FileReferences:{Moc:n,Textures:i,Physics:o,Pose:s,Motions:a.length?{"":a.map(e=>({File:e}))}:void 0}});return c.name=r,c._objectURL=`example://${c.url}`,c}gd.readText=(e,t)=>{let n=e.file(t);if(!n)throw Error(`Cannot find file: ${t}`);return n.async(`text`)},gd.getFilePaths=e=>{let t=[];return e.forEach(e=>t.push(e)),Promise.resolve(t)},gd.getFiles=(e,t)=>Promise.all(t.map(async t=>{let n=t.slice(t.lastIndexOf(`/`)+1),r=await e.file(t).async(`blob`);return new File([r],n)}));var _h=Tn({__name:`Live2D`,props:{paused:{type:Boolean,default:!1},mouthOpenSize:{default:0},focusAt:{default:()=>({x:0,y:0})},xOffset:{},yOffset:{},scale:{default:1}},setup(e){return(e,t)=>(K(),Pn(D,{relative:``},{default:Dn(({width:t,height:n})=>[xn(Od,{width:t,height:n,resolution:2,"max-h":`100dvh`},{default:Dn(({app:r})=>[xn(lh,{app:r,"mouth-open-size":e.mouthOpenSize,width:t,height:n,paused:e.paused,"focus-at":e.focusAt,"x-offset":e.xOffset,"y-offset":e.yOffset,scale:e.scale},null,8,[`app`,`mouth-open-size`,`width`,`height`,`paused`,`focus-at`,`x-offset`,`y-offset`,`scale`])]),_:2},1032,[`width`,`height`])]),_:1}))}}),vh=_h;function yh(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function bh(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)}function xh(e){return this instanceof xh?(this.v=e,this):new xh(e)}function Sh(e,t,n){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var r=n.apply(e,t||[]),i,a=[];return i=Object.create((typeof AsyncIterator==`function`?AsyncIterator:Object).prototype),s(`next`),s(`throw`),s(`return`,o),i[Symbol.asyncIterator]=function(){return this},i;function o(e){return function(t){return Promise.resolve(t).then(e,d)}}function s(e,t){r[e]&&(i[e]=function(t){return new Promise(function(n,r){a.push([e,t,n,r])>1||c(e,t)})},t&&(i[e]=t(i[e])))}function c(e,t){try{l(r[e](t))}catch(e){f(a[0][3],e)}}function l(e){e.value instanceof xh?Promise.resolve(e.value.v).then(u,d):f(a[0][2],e)}function u(e){c(`next`,e)}function d(e){c(`throw`,e)}function f(e,t){e(t),a.shift(),a.length&&c(a[0][0],a[0][1])}}function Ch(e){var t,n;return t={},r(`next`),r(`throw`,function(e){throw e}),r(`return`),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:xh(e[r](t)),done:!1}:i?i(t):t}:i}}function wh(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof bh==`function`?bh(e):e[Symbol.iterator](),n={},r(`next`),r(`throw`),r(`return`),n[Symbol.asyncIterator]=function(){return this},n);function r(t){n[t]=e[t]&&function(n){return new Promise(function(r,a){n=e[t](n),i(r,a,n.done,n.value)})}}function i(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}}const Th=new TextDecoder(`utf-8`),Eh=e=>Th.decode(e),Dh=new TextEncoder,Oh=e=>Dh.encode(e),kh=e=>typeof e==`number`,Ah=e=>typeof e==`boolean`,jh=e=>typeof e==`function`,Mh=e=>e!=null&&Object(e)===e,Nh=e=>Mh(e)&&jh(e.then),Ph=e=>Mh(e)&&jh(e[Symbol.iterator]),Fh=e=>Mh(e)&&jh(e[Symbol.asyncIterator]),Ih=e=>Mh(e)&&Mh(e.schema),Lh=e=>Mh(e)&&`done`in e&&`value`in e,Rh=e=>Mh(e)&&jh(e.stat)&&kh(e.fd),zh=e=>Mh(e)&&Hh(e.body),Bh=e=>`_getDOMStream`in e&&`_getNodeStream`in e,Vh=e=>Mh(e)&&jh(e.abort)&&jh(e.getWriter)&&!Bh(e),Hh=e=>Mh(e)&&jh(e.cancel)&&jh(e.getReader)&&!Bh(e),Uh=e=>Mh(e)&&jh(e.end)&&jh(e.write)&&Ah(e.writable)&&!Bh(e),Wh=e=>Mh(e)&&jh(e.read)&&jh(e.pipe)&&Ah(e.readable)&&!Bh(e),Gh=e=>Mh(e)&&jh(e.clear)&&jh(e.bytes)&&jh(e.position)&&jh(e.setPosition)&&jh(e.capacity)&&jh(e.getBufferIdentifier)&&jh(e.createLong),Kh=typeof SharedArrayBuffer<`u`?SharedArrayBuffer:ArrayBuffer;function qh(e){let t=e[0]?[e[0]]:[],n,r,i,a;for(let o,s,c=0,l=0,u=e.length;++ce+t.byteLength,0),i,a,o,s=0,c=-1,l=Math.min(t||1/0,r);for(let e=n.length;++cXh(Int32Array,e),Qh=e=>Xh(BigInt64Array,e),$h=e=>Xh(Uint8Array,e),eg=e=>(e.next(),e);function*tg(e,t){let n=function*(e){yield e},r=typeof t==`string`||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Kh?n(t):Ph(t)?t:n(t);return yield*eg(function*(t){let n=null;do n=t.next(yield Xh(e,n));while(!n.done)}(r[Symbol.iterator]())),new e}const ng=e=>tg(Uint8Array,e);function rg(e,t){return Sh(this,arguments,function*(){if(Nh(t))return yield xh(yield xh(yield*Ch(wh(rg(e,yield xh(t))))));let n=function(e){return Sh(this,arguments,function*(){yield yield xh(yield xh(e))})},r=function(e){return Sh(this,arguments,function*(){yield xh(yield*Ch(wh(eg(function*(e){let t=null;do t=e.next(yield t?.value);while(!t.done)}(e[Symbol.iterator]())))))})},i=typeof t==`string`||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Kh?n(t):Ph(t)?r(t):Fh(t)?t:n(t);return yield xh(yield*Ch(wh(eg(function(t){return Sh(this,arguments,function*(){let n=null;do n=yield xh(t.next(yield yield xh(Xh(e,n))));while(!n.done)})}(i[Symbol.asyncIterator]()))))),yield xh(new e)})}const ig=e=>rg(Uint8Array,e);function ag(e,t,n){if(e!==0){n=n.slice(0,t);for(let t=-1,r=n.length;++t0)do if(e[n]!==t[n])return!1;while(++n(e.next(),e);function*lg(e){let t,n=!1,r=[],i,a,o,s=0;function c(){return a===`peek`?Yh(r,o)[0]:([i,r,s]=Yh(r,o),i)}({cmd:a,size:o}=(yield(()=>null)())||{cmd:`read`,size:0});let l=ng(e)[Symbol.iterator]();try{do if({done:t,value:i}=Number.isNaN(o-s)?l.next():l.next(o-s),!t&&i.byteLength>0&&(r.push(i),s+=i.byteLength),t||o<=s)do({cmd:a,size:o}=yield c());while(onull)()))||{cmd:`read`,size:0});let l=ig(e)[Symbol.asyncIterator]();try{do if({done:t,value:i}=Number.isNaN(o-s)?yield xh(l.next()):yield xh(l.next(o-s)),!t&&i.byteLength>0&&(r.push(i),s+=i.byteLength),t||o<=s)do({cmd:a,size:o}=yield yield xh(c()));while(onull)()))||{cmd:`read`,size:0});let l=new fg(e);try{do if({done:t,value:i}=Number.isNaN(o-s)?yield xh(l.read()):yield xh(l.read(o-s)),!t&&i.byteLength>0&&(r.push($h(i)),s+=i.byteLength),t||o<=s)do({cmd:a,size:o}=yield yield xh(c()));while(o{})}get closed(){return this.reader?this.reader.closed.catch(()=>{}):Promise.resolve()}releaseLock(){this.reader&&this.reader.releaseLock(),this.reader=null}cancel(e){return yh(this,void 0,void 0,function*(){let{reader:t,source:n}=this;t&&(yield t.cancel(e).catch(()=>{})),n&&n.locked&&this.releaseLock()})}read(e){return yh(this,void 0,void 0,function*(){if(e===0)return{done:this.reader==null,value:new Uint8Array};let t=yield this.reader.read();return!t.done&&(t.value=$h(t)),t})}};const pg=(e,t)=>{let n=e=>r([t,e]),r;return[t,n,new Promise(i=>(r=i)&&e.once(t,n))]};function mg(e){return Sh(this,arguments,function*(){let t=[],n=`error`,r=!1,i=null,a,o,s=0,c=[],l;function u(){return a===`peek`?Yh(c,o)[0]:([l,c,s]=Yh(c,o),l)}if({cmd:a,size:o}=(yield yield xh((()=>null)()))||{cmd:`read`,size:0},e.isTTY)return yield yield xh(new Uint8Array),yield xh(null);try{t[0]=pg(e,`end`),t[1]=pg(e,`error`);do{if(t[2]=pg(e,`readable`),[n,i]=yield xh(Promise.race(t.map(e=>e[2]))),n===`error`)break;if((r=n===`end`)||(Number.isFinite(o-s)?(l=$h(e.read(o-s)),l.byteLength0&&(c.push(l),s+=l.byteLength)),r||o<=s)do({cmd:a,size:o}=yield yield xh(u()));while(o{for(let[n,r]of t)e.off(n,r);try{let t=e.destroy;t&&t.call(e,n),n=void 0}catch(e){n=e||n}finally{n==null?r():i(n)}})}})}var hg;(function(e){e[e.V1=0]=`V1`,e[e.V2=1]=`V2`,e[e.V3=2]=`V3`,e[e.V4=3]=`V4`,e[e.V5=4]=`V5`})(hg||={});var gg;(function(e){e[e.Sparse=0]=`Sparse`,e[e.Dense=1]=`Dense`})(gg||={});var _g;(function(e){e[e.HALF=0]=`HALF`,e[e.SINGLE=1]=`SINGLE`,e[e.DOUBLE=2]=`DOUBLE`})(_g||={});var vg;(function(e){e[e.DAY=0]=`DAY`,e[e.MILLISECOND=1]=`MILLISECOND`})(vg||={});var yg;(function(e){e[e.SECOND=0]=`SECOND`,e[e.MILLISECOND=1]=`MILLISECOND`,e[e.MICROSECOND=2]=`MICROSECOND`,e[e.NANOSECOND=3]=`NANOSECOND`})(yg||={});var bg;(function(e){e[e.YEAR_MONTH=0]=`YEAR_MONTH`,e[e.DAY_TIME=1]=`DAY_TIME`,e[e.MONTH_DAY_NANO=2]=`MONTH_DAY_NANO`})(bg||={});const xg=2,Sg=4,Cg=4,wg=4,Tg=new Int32Array(2),Eg=new Float32Array(Tg.buffer),Dg=new Float64Array(Tg.buffer),Og=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;var kg;(function(e){e[e.UTF8_BYTES=1]=`UTF8_BYTES`,e[e.UTF16_STRING=2]=`UTF16_STRING`})(kg||={});var Ag=class e{constructor(e){this.bytes_=e,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(t){return new e(new Uint8Array(t))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(e){this.position_=e}capacity(){return this.bytes_.length}readInt8(e){return this.readUint8(e)<<24>>24}readUint8(e){return this.bytes_[e]}readInt16(e){return this.readUint16(e)<<16>>16}readUint16(e){return this.bytes_[e]|this.bytes_[e+1]<<8}readInt32(e){return this.bytes_[e]|this.bytes_[e+1]<<8|this.bytes_[e+2]<<16|this.bytes_[e+3]<<24}readUint32(e){return this.readInt32(e)>>>0}readInt64(e){return BigInt.asIntN(64,BigInt(this.readUint32(e))+(BigInt(this.readUint32(e+4))<>8}writeUint16(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8}writeInt32(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24}writeUint32(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24}writeInt64(e,t){this.writeInt32(e,Number(BigInt.asIntN(32,t))),this.writeInt32(e+4,Number(BigInt.asIntN(32,t>>BigInt(32))))}writeUint64(e,t){this.writeUint32(e,Number(BigInt.asUintN(32,t))),this.writeUint32(e+4,Number(BigInt.asUintN(32,t>>BigInt(32))))}writeFloat32(e,t){Eg[0]=t,this.writeInt32(e,Tg[0])}writeFloat64(e,t){Dg[0]=t,this.writeInt32(e,Tg[Og?0:1]),this.writeInt32(e+4,Tg[Og?1:0])}getBufferIdentifier(){if(this.bytes_.lengththis.minalign&&(this.minalign=t);let r=~(this.bb.capacity()-this.space+n)+1&t-1;for(;this.space=0&&this.vtable[t]==0;t--);let n=t+1;for(;t>=0;t--)this.addInt16(this.vtable[t]==0?0:e-this.vtable[t]);let r=2;this.addInt16(e-this.object_start);let i=(n+r)*xg;this.addInt16(i);let a=0,o=this.space;outer_loop:for(t=0;t=0;t--)this.writeInt8(e.charCodeAt(t))}this.prep(this.minalign,Sg+r),this.addOffset(e),r&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(e,t){this.finish(e,t,!0)}requiredField(e,t){let n=this.bb.capacity()-e,r=n-this.bb.readInt32(n),i=t=0;n--)e.addInt32(t[n]);return e.endVector()}static startTypeIdsVector(e,t){e.startVector(4,t,4)}static endUnion(e){let t=e.endObject();return t}static createUnion(t,n,r){return e.startUnion(t),e.addMode(t,n),e.addTypeIds(t,r),e.endUnion(t)}},c_=class e{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsUtf8(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUtf8(t,n){return t.setPosition(t.position()+wg),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static startUtf8(e){e.startObject(0)}static endUtf8(e){let t=e.endObject();return t}static createUtf8(t){return e.startUtf8(t),e.endUtf8(t)}},l_;(function(e){e[e.NONE=0]=`NONE`,e[e.Null=1]=`Null`,e[e.Int=2]=`Int`,e[e.FloatingPoint=3]=`FloatingPoint`,e[e.Binary=4]=`Binary`,e[e.Utf8=5]=`Utf8`,e[e.Bool=6]=`Bool`,e[e.Decimal=7]=`Decimal`,e[e.Date=8]=`Date`,e[e.Time=9]=`Time`,e[e.Timestamp=10]=`Timestamp`,e[e.Interval=11]=`Interval`,e[e.List=12]=`List`,e[e.Struct_=13]=`Struct_`,e[e.Union=14]=`Union`,e[e.FixedSizeBinary=15]=`FixedSizeBinary`,e[e.FixedSizeList=16]=`FixedSizeList`,e[e.Map=17]=`Map`,e[e.Duration=18]=`Duration`,e[e.LargeBinary=19]=`LargeBinary`,e[e.LargeUtf8=20]=`LargeUtf8`,e[e.LargeList=21]=`LargeList`,e[e.RunEndEncoded=22]=`RunEndEncoded`})(l_||={});var u_=class e{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsField(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsField(t,n){return t.setPosition(t.position()+wg),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}name(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}nullable(){let e=this.bb.__offset(this.bb_pos,6);return e?!!this.bb.readInt8(this.bb_pos+e):!1}typeType(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readUint8(this.bb_pos+e):l_.NONE}type(e){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__union(e,this.bb_pos+t):null}dictionary(e){let t=this.bb.__offset(this.bb_pos,12);return t?(e||new Hg).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}children(t,n){let r=this.bb.__offset(this.bb_pos,14);return r?(n||new e).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+t*4),this.bb):null}childrenLength(){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,t){let n=this.bb.__offset(this.bb_pos,16);return n?(t||new Ug).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,16);return e?this.bb.__vector_len(this.bb_pos+e):0}static startField(e){e.startObject(7)}static addName(e,t){e.addFieldOffset(0,t,0)}static addNullable(e,t){e.addFieldInt8(1,+t,0)}static addTypeType(e,t){e.addFieldInt8(2,t,l_.NONE)}static addType(e,t){e.addFieldOffset(3,t,0)}static addDictionary(e,t){e.addFieldOffset(4,t,0)}static addChildren(e,t){e.addFieldOffset(5,t,0)}static createChildrenVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startChildrenVector(e,t){e.startVector(4,t,4)}static addCustomMetadata(e,t){e.addFieldOffset(6,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static endField(e){let t=e.endObject();return t}},d_=class e{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsSchema(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSchema(t,n){return t.setPosition(t.position()+wg),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}endianness(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):zg.Little}fields(e,t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new u_).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}fieldsLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,t){let n=this.bb.__offset(this.bb_pos,8);return n?(t||new Ug).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}features(e){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt64(this.bb.__vector(this.bb_pos+t)+e*8):BigInt(0)}featuresLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__vector_len(this.bb_pos+e):0}static startSchema(e){e.startObject(4)}static addEndianness(e,t){e.addFieldInt16(0,t,zg.Little)}static addFields(e,t){e.addFieldOffset(1,t,0)}static createFieldsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startFieldsVector(e,t){e.startVector(4,t,4)}static addCustomMetadata(e,t){e.addFieldOffset(2,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static addFeatures(e,t){e.addFieldOffset(3,t,0)}static createFeaturesVector(e,t){e.startVector(8,t.length,8);for(let n=t.length-1;n>=0;n--)e.addInt64(t[n]);return e.endVector()}static startFeaturesVector(e,t){e.startVector(8,t,8)}static endSchema(e){let t=e.endObject();return t}static finishSchemaBuffer(e,t){e.finish(t)}static finishSizePrefixedSchemaBuffer(e,t){e.finish(t,void 0,!0)}static createSchema(t,n,r,i,a){return e.startSchema(t),e.addEndianness(t,n),e.addFields(t,r),e.addCustomMetadata(t,i),e.addFeatures(t,a),e.endSchema(t)}},f_;(function(e){e[e.NONE=0]=`NONE`,e[e.Schema=1]=`Schema`,e[e.DictionaryBatch=2]=`DictionaryBatch`,e[e.RecordBatch=3]=`RecordBatch`,e[e.Tensor=4]=`Tensor`,e[e.SparseTensor=5]=`SparseTensor`})(f_||={});var q;(function(e){e[e.NONE=0]=`NONE`,e[e.Null=1]=`Null`,e[e.Int=2]=`Int`,e[e.Float=3]=`Float`,e[e.Binary=4]=`Binary`,e[e.Utf8=5]=`Utf8`,e[e.Bool=6]=`Bool`,e[e.Decimal=7]=`Decimal`,e[e.Date=8]=`Date`,e[e.Time=9]=`Time`,e[e.Timestamp=10]=`Timestamp`,e[e.Interval=11]=`Interval`,e[e.List=12]=`List`,e[e.Struct=13]=`Struct`,e[e.Union=14]=`Union`,e[e.FixedSizeBinary=15]=`FixedSizeBinary`,e[e.FixedSizeList=16]=`FixedSizeList`,e[e.Map=17]=`Map`,e[e.Duration=18]=`Duration`,e[e.LargeBinary=19]=`LargeBinary`,e[e.LargeUtf8=20]=`LargeUtf8`,e[e.Dictionary=-1]=`Dictionary`,e[e.Int8=-2]=`Int8`,e[e.Int16=-3]=`Int16`,e[e.Int32=-4]=`Int32`,e[e.Int64=-5]=`Int64`,e[e.Uint8=-6]=`Uint8`,e[e.Uint16=-7]=`Uint16`,e[e.Uint32=-8]=`Uint32`,e[e.Uint64=-9]=`Uint64`,e[e.Float16=-10]=`Float16`,e[e.Float32=-11]=`Float32`,e[e.Float64=-12]=`Float64`,e[e.DateDay=-13]=`DateDay`,e[e.DateMillisecond=-14]=`DateMillisecond`,e[e.TimestampSecond=-15]=`TimestampSecond`,e[e.TimestampMillisecond=-16]=`TimestampMillisecond`,e[e.TimestampMicrosecond=-17]=`TimestampMicrosecond`,e[e.TimestampNanosecond=-18]=`TimestampNanosecond`,e[e.TimeSecond=-19]=`TimeSecond`,e[e.TimeMillisecond=-20]=`TimeMillisecond`,e[e.TimeMicrosecond=-21]=`TimeMicrosecond`,e[e.TimeNanosecond=-22]=`TimeNanosecond`,e[e.DenseUnion=-23]=`DenseUnion`,e[e.SparseUnion=-24]=`SparseUnion`,e[e.IntervalDayTime=-25]=`IntervalDayTime`,e[e.IntervalYearMonth=-26]=`IntervalYearMonth`,e[e.DurationSecond=-27]=`DurationSecond`,e[e.DurationMillisecond=-28]=`DurationMillisecond`,e[e.DurationMicrosecond=-29]=`DurationMicrosecond`,e[e.DurationNanosecond=-30]=`DurationNanosecond`})(q||={});var p_;(function(e){e[e.OFFSET=0]=`OFFSET`,e[e.DATA=1]=`DATA`,e[e.VALIDITY=2]=`VALIDITY`,e[e.TYPE=3]=`TYPE`})(p_||={});const m_=void 0;function h_(e){if(e===null)return`null`;if(e===m_)return`undefined`;switch(typeof e){case`number`:return`${e}`;case`bigint`:return`${e}`;case`string`:return`"${e}"`}return typeof e[Symbol.toPrimitive]==`function`?e[Symbol.toPrimitive](`string`):ArrayBuffer.isView(e)?e instanceof BigInt64Array||e instanceof BigUint64Array?`[${[...e].map(e=>h_(e))}]`:`[${e}]`:ArrayBuffer.isView(e)?`[${e}]`:JSON.stringify(e,(e,t)=>typeof t==`bigint`?`${t}`:t)}function g_(e){if(typeof e==`bigint`&&(e<-(2**53-1)||e>2**53-1))throw TypeError(`${e} is not safe to convert to a number.`);return Number(e)}function __(e,t){return g_(e/t)+g_(e%t)/g_(t)}const v_=Symbol.for(`isArrowBigNum`);function y_(e,...t){return t.length===0?Object.setPrototypeOf(Xh(this.TypedArray,e),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(e,...t),this.constructor.prototype)}y_.prototype[v_]=!0,y_.prototype.toJSON=function(){return`"${E_(this)}"`},y_.prototype.valueOf=function(e){return T_(this,e)},y_.prototype.toString=function(){return E_(this)},y_.prototype[Symbol.toPrimitive]=function(e=`default`){switch(e){case`number`:return T_(this);case`string`:return E_(this);case`default`:return D_(this)}return E_(this)};function b_(...e){return y_.apply(this,e)}function x_(...e){return y_.apply(this,e)}function S_(...e){return y_.apply(this,e)}Object.setPrototypeOf(b_.prototype,Object.create(Int32Array.prototype)),Object.setPrototypeOf(x_.prototype,Object.create(Uint32Array.prototype)),Object.setPrototypeOf(S_.prototype,Object.create(Uint32Array.prototype)),Object.assign(b_.prototype,y_.prototype,{constructor:b_,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array}),Object.assign(x_.prototype,y_.prototype,{constructor:x_,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array}),Object.assign(S_.prototype,y_.prototype,{constructor:S_,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});const C_=BigInt(4294967296)*BigInt(4294967296),w_=C_-BigInt(1);function T_(e,t){let{buffer:n,byteOffset:r,byteLength:i,signed:a}=e,o=new BigUint64Array(n,r,i/8),s=a&&o.at(-1)&BigInt(1)<=0)return O_(e);t=t.slice();let r=1;for(let e=0;e(e.children=null,e.ArrayType=Array,e.OffsetArrayType=Int32Array,e[Symbol.toStringTag]=`DataType`))(Q_.prototype);var $_=class extends Q_{constructor(){super(q.Null)}toString(){return`Null`}};j_=Symbol.toStringTag,$_[j_]=(e=>e[Symbol.toStringTag]=`Null`)($_.prototype);var ev=class extends Q_{constructor(e,t){super(q.Int),this.isSigned=e,this.bitWidth=t}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:return this.isSigned?Int32Array:Uint32Array;case 64:return this.isSigned?BigInt64Array:BigUint64Array}throw Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?`I`:`Ui`}nt${this.bitWidth}`}};M_=Symbol.toStringTag,ev[M_]=(e=>(e.isSigned=null,e.bitWidth=null,e[Symbol.toStringTag]=`Int`))(ev.prototype);var tv=class extends ev{constructor(){super(!0,8)}get ArrayType(){return Int8Array}},nv=class extends ev{constructor(){super(!0,16)}get ArrayType(){return Int16Array}},rv=class extends ev{constructor(){super(!0,32)}get ArrayType(){return Int32Array}},iv=class extends ev{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}},av=class extends ev{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}},ov=class extends ev{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}},sv=class extends ev{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}},cv=class extends ev{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}};Object.defineProperty(tv.prototype,`ArrayType`,{value:Int8Array}),Object.defineProperty(nv.prototype,`ArrayType`,{value:Int16Array}),Object.defineProperty(rv.prototype,`ArrayType`,{value:Int32Array}),Object.defineProperty(iv.prototype,`ArrayType`,{value:BigInt64Array}),Object.defineProperty(av.prototype,`ArrayType`,{value:Uint8Array}),Object.defineProperty(ov.prototype,`ArrayType`,{value:Uint16Array}),Object.defineProperty(sv.prototype,`ArrayType`,{value:Uint32Array}),Object.defineProperty(cv.prototype,`ArrayType`,{value:BigUint64Array});var lv=class extends Q_{constructor(e){super(q.Float),this.precision=e}get ArrayType(){switch(this.precision){case _g.HALF:return Uint16Array;case _g.SINGLE:return Float32Array;case _g.DOUBLE:return Float64Array}throw Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};N_=Symbol.toStringTag,lv[N_]=(e=>(e.precision=null,e[Symbol.toStringTag]=`Float`))(lv.prototype);var uv=class extends lv{constructor(){super(_g.HALF)}},dv=class extends lv{constructor(){super(_g.SINGLE)}},fv=class extends lv{constructor(){super(_g.DOUBLE)}};Object.defineProperty(uv.prototype,`ArrayType`,{value:Uint16Array}),Object.defineProperty(dv.prototype,`ArrayType`,{value:Float32Array}),Object.defineProperty(fv.prototype,`ArrayType`,{value:Float64Array});var pv=class extends Q_{constructor(){super(q.Binary)}toString(){return`Binary`}};P_=Symbol.toStringTag,pv[P_]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`Binary`))(pv.prototype);var mv=class extends Q_{constructor(){super(q.LargeBinary)}toString(){return`LargeBinary`}};F_=Symbol.toStringTag,mv[F_]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]=`LargeBinary`))(mv.prototype);var hv=class extends Q_{constructor(){super(q.Utf8)}toString(){return`Utf8`}};I_=Symbol.toStringTag,hv[I_]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`Utf8`))(hv.prototype);var gv=class extends Q_{constructor(){super(q.LargeUtf8)}toString(){return`LargeUtf8`}};L_=Symbol.toStringTag,gv[L_]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]=`LargeUtf8`))(gv.prototype);var _v=class extends Q_{constructor(){super(q.Bool)}toString(){return`Bool`}};R_=Symbol.toStringTag,_v[R_]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`Bool`))(_v.prototype);var vv=class extends Q_{constructor(e,t,n=128){super(q.Decimal),this.scale=e,this.precision=t,this.bitWidth=n}toString(){return`Decimal[${this.precision}e${this.scale>0?`+`:``}${this.scale}]`}};z_=Symbol.toStringTag,vv[z_]=(e=>(e.scale=null,e.precision=null,e.ArrayType=Uint32Array,e[Symbol.toStringTag]=`Decimal`))(vv.prototype);var yv=class extends Q_{constructor(e){super(q.Date),this.unit=e}toString(){return`Date${(this.unit+1)*32}<${vg[this.unit]}>`}get ArrayType(){return this.unit===vg.DAY?Int32Array:BigInt64Array}};B_=Symbol.toStringTag,yv[B_]=(e=>(e.unit=null,e[Symbol.toStringTag]=`Date`))(yv.prototype);var bv=class extends Q_{constructor(e,t){super(q.Time),this.unit=e,this.bitWidth=t}toString(){return`Time${this.bitWidth}<${yg[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}};V_=Symbol.toStringTag,bv[V_]=(e=>(e.unit=null,e.bitWidth=null,e[Symbol.toStringTag]=`Time`))(bv.prototype);var xv=class extends Q_{constructor(e,t){super(q.Timestamp),this.unit=e,this.timezone=t}toString(){return`Timestamp<${yg[this.unit]}${this.timezone?`, ${this.timezone}`:``}>`}};H_=Symbol.toStringTag,xv[H_]=(e=>(e.unit=null,e.timezone=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]=`Timestamp`))(xv.prototype);var Sv=class extends Q_{constructor(e){super(q.Interval),this.unit=e}toString(){return`Interval<${bg[this.unit]}>`}};U_=Symbol.toStringTag,Sv[U_]=(e=>(e.unit=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]=`Interval`))(Sv.prototype);var Cv=class extends Q_{constructor(e){super(q.Duration),this.unit=e}toString(){return`Duration<${yg[this.unit]}>`}};W_=Symbol.toStringTag,Cv[W_]=(e=>(e.unit=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]=`Duration`))(Cv.prototype);var wv=class extends Q_{constructor(e){super(q.List),this.children=[e]}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};G_=Symbol.toStringTag,wv[G_]=(e=>(e.children=null,e[Symbol.toStringTag]=`List`))(wv.prototype);var Tv=class extends Q_{constructor(e){super(q.Struct),this.children=e}toString(){return`Struct<{${this.children.map(e=>`${e.name}:${e.type}`).join(`, `)}}>`}};K_=Symbol.toStringTag,Tv[K_]=(e=>(e.children=null,e[Symbol.toStringTag]=`Struct`))(Tv.prototype);var Ev=class extends Q_{constructor(e,t,n){super(q.Union),this.mode=e,this.children=n,this.typeIds=t=Int32Array.from(t),this.typeIdToChildIndex=t.reduce((e,t,n)=>(e[t]=n)&&e||e,Object.create(null))}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(e=>`${e.type}`).join(` | `)}>`}};q_=Symbol.toStringTag,Ev[q_]=(e=>(e.mode=null,e.typeIds=null,e.children=null,e.typeIdToChildIndex=null,e.ArrayType=Int8Array,e[Symbol.toStringTag]=`Union`))(Ev.prototype);var Dv=class extends Q_{constructor(e){super(q.FixedSizeBinary),this.byteWidth=e}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};J_=Symbol.toStringTag,Dv[J_]=(e=>(e.byteWidth=null,e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`FixedSizeBinary`))(Dv.prototype);var Ov=class extends Q_{constructor(e,t){super(q.FixedSizeList),this.listSize=e,this.children=[t]}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}};Y_=Symbol.toStringTag,Ov[Y_]=(e=>(e.children=null,e.listSize=null,e[Symbol.toStringTag]=`FixedSizeList`))(Ov.prototype);var kv=class extends Q_{constructor(e,t=!1){var n,r,i;if(super(q.Map),this.children=[e],this.keysSorted=t,e&&(e.name=`entries`,(n=e?.type)?.children)){let t=(r=e?.type)?.children[0];t&&(t.name=`key`);let n=(i=e?.type)?.children[1];n&&(n.name=`value`)}}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}get childType(){return this.children[0].type}toString(){return`Map<{${this.children[0].type.children.map(e=>`${e.name}:${e.type}`).join(`, `)}}>`}};X_=Symbol.toStringTag,kv[X_]=(e=>(e.children=null,e.keysSorted=null,e[Symbol.toStringTag]=`Map_`))(kv.prototype);const Av=(e=>()=>++e)(-1);var jv=class extends Q_{constructor(e,t,n,r){super(q.Dictionary),this.indices=t,this.dictionary=e,this.isOrdered=r||!1,this.id=n==null?Av():g_(n)}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}};Z_=Symbol.toStringTag,jv[Z_]=(e=>(e.id=null,e.indices=null,e.isOrdered=null,e.dictionary=null,e[Symbol.toStringTag]=`Dictionary`))(jv.prototype);function Mv(e){let t=e;switch(e.typeId){case q.Decimal:return e.bitWidth/32;case q.Interval:return 1+t.unit;case q.FixedSizeList:return t.listSize;case q.FixedSizeBinary:return t.byteWidth;default:return 1}}var Nv=class{visitMany(e,...t){return e.map((e,n)=>this.visit(e,...t.map(e=>e[n])))}visit(...e){return this.getVisitFn(e[0],!1).apply(this,e)}getVisitFn(e,t=!0){return Pv(this,e,t)}getVisitFnByTypeId(e,t=!0){return Fv(this,e,t)}visitNull(e,...t){return null}visitBool(e,...t){return null}visitInt(e,...t){return null}visitFloat(e,...t){return null}visitUtf8(e,...t){return null}visitLargeUtf8(e,...t){return null}visitBinary(e,...t){return null}visitLargeBinary(e,...t){return null}visitFixedSizeBinary(e,...t){return null}visitDate(e,...t){return null}visitTimestamp(e,...t){return null}visitTime(e,...t){return null}visitDecimal(e,...t){return null}visitList(e,...t){return null}visitStruct(e,...t){return null}visitUnion(e,...t){return null}visitDictionary(e,...t){return null}visitInterval(e,...t){return null}visitDuration(e,...t){return null}visitFixedSizeList(e,...t){return null}visitMap(e,...t){return null}};function Pv(e,t,n=!0){return typeof t==`number`?Fv(e,t,n):typeof t==`string`&&t in q?Fv(e,q[t],n):t&&t instanceof Q_?Fv(e,Iv(t),n):t?.type&&t.type instanceof Q_?Fv(e,Iv(t.type),n):Fv(e,q.NONE,n)}function Fv(e,t,n=!0){let r=null;switch(t){case q.Null:r=e.visitNull;break;case q.Bool:r=e.visitBool;break;case q.Int:r=e.visitInt;break;case q.Int8:r=e.visitInt8||e.visitInt;break;case q.Int16:r=e.visitInt16||e.visitInt;break;case q.Int32:r=e.visitInt32||e.visitInt;break;case q.Int64:r=e.visitInt64||e.visitInt;break;case q.Uint8:r=e.visitUint8||e.visitInt;break;case q.Uint16:r=e.visitUint16||e.visitInt;break;case q.Uint32:r=e.visitUint32||e.visitInt;break;case q.Uint64:r=e.visitUint64||e.visitInt;break;case q.Float:r=e.visitFloat;break;case q.Float16:r=e.visitFloat16||e.visitFloat;break;case q.Float32:r=e.visitFloat32||e.visitFloat;break;case q.Float64:r=e.visitFloat64||e.visitFloat;break;case q.Utf8:r=e.visitUtf8;break;case q.LargeUtf8:r=e.visitLargeUtf8;break;case q.Binary:r=e.visitBinary;break;case q.LargeBinary:r=e.visitLargeBinary;break;case q.FixedSizeBinary:r=e.visitFixedSizeBinary;break;case q.Date:r=e.visitDate;break;case q.DateDay:r=e.visitDateDay||e.visitDate;break;case q.DateMillisecond:r=e.visitDateMillisecond||e.visitDate;break;case q.Timestamp:r=e.visitTimestamp;break;case q.TimestampSecond:r=e.visitTimestampSecond||e.visitTimestamp;break;case q.TimestampMillisecond:r=e.visitTimestampMillisecond||e.visitTimestamp;break;case q.TimestampMicrosecond:r=e.visitTimestampMicrosecond||e.visitTimestamp;break;case q.TimestampNanosecond:r=e.visitTimestampNanosecond||e.visitTimestamp;break;case q.Time:r=e.visitTime;break;case q.TimeSecond:r=e.visitTimeSecond||e.visitTime;break;case q.TimeMillisecond:r=e.visitTimeMillisecond||e.visitTime;break;case q.TimeMicrosecond:r=e.visitTimeMicrosecond||e.visitTime;break;case q.TimeNanosecond:r=e.visitTimeNanosecond||e.visitTime;break;case q.Decimal:r=e.visitDecimal;break;case q.List:r=e.visitList;break;case q.Struct:r=e.visitStruct;break;case q.Union:r=e.visitUnion;break;case q.DenseUnion:r=e.visitDenseUnion||e.visitUnion;break;case q.SparseUnion:r=e.visitSparseUnion||e.visitUnion;break;case q.Dictionary:r=e.visitDictionary;break;case q.Interval:r=e.visitInterval;break;case q.IntervalDayTime:r=e.visitIntervalDayTime||e.visitInterval;break;case q.IntervalYearMonth:r=e.visitIntervalYearMonth||e.visitInterval;break;case q.Duration:r=e.visitDuration;break;case q.DurationSecond:r=e.visitDurationSecond||e.visitDuration;break;case q.DurationMillisecond:r=e.visitDurationMillisecond||e.visitDuration;break;case q.DurationMicrosecond:r=e.visitDurationMicrosecond||e.visitDuration;break;case q.DurationNanosecond:r=e.visitDurationNanosecond||e.visitDuration;break;case q.FixedSizeList:r=e.visitFixedSizeList;break;case q.Map:r=e.visitMap;break}if(typeof r==`function`)return r;if(!n)return()=>null;throw Error(`Unrecognized type '${q[t]}'`)}function Iv(e){switch(e.typeId){case q.Null:return q.Null;case q.Int:{let{bitWidth:t,isSigned:n}=e;switch(t){case 8:return n?q.Int8:q.Uint8;case 16:return n?q.Int16:q.Uint16;case 32:return n?q.Int32:q.Uint32;case 64:return n?q.Int64:q.Uint64}return q.Int}case q.Float:switch(e.precision){case _g.HALF:return q.Float16;case _g.SINGLE:return q.Float32;case _g.DOUBLE:return q.Float64}return q.Float;case q.Binary:return q.Binary;case q.LargeBinary:return q.LargeBinary;case q.Utf8:return q.Utf8;case q.LargeUtf8:return q.LargeUtf8;case q.Bool:return q.Bool;case q.Decimal:return q.Decimal;case q.Time:switch(e.unit){case yg.SECOND:return q.TimeSecond;case yg.MILLISECOND:return q.TimeMillisecond;case yg.MICROSECOND:return q.TimeMicrosecond;case yg.NANOSECOND:return q.TimeNanosecond}return q.Time;case q.Timestamp:switch(e.unit){case yg.SECOND:return q.TimestampSecond;case yg.MILLISECOND:return q.TimestampMillisecond;case yg.MICROSECOND:return q.TimestampMicrosecond;case yg.NANOSECOND:return q.TimestampNanosecond}return q.Timestamp;case q.Date:switch(e.unit){case vg.DAY:return q.DateDay;case vg.MILLISECOND:return q.DateMillisecond}return q.Date;case q.Interval:switch(e.unit){case bg.DAY_TIME:return q.IntervalDayTime;case bg.YEAR_MONTH:return q.IntervalYearMonth}return q.Interval;case q.Duration:switch(e.unit){case yg.SECOND:return q.DurationSecond;case yg.MILLISECOND:return q.DurationMillisecond;case yg.MICROSECOND:return q.DurationMicrosecond;case yg.NANOSECOND:return q.DurationNanosecond}return q.Duration;case q.Map:return q.Map;case q.List:return q.List;case q.Struct:return q.Struct;case q.Union:switch(e.mode){case gg.Dense:return q.DenseUnion;case gg.Sparse:return q.SparseUnion}return q.Union;case q.FixedSizeBinary:return q.FixedSizeBinary;case q.FixedSizeList:return q.FixedSizeList;case q.Dictionary:return q.Dictionary}throw Error(`Unrecognized type '${q[e.typeId]}'`)}Nv.prototype.visitInt8=null,Nv.prototype.visitInt16=null,Nv.prototype.visitInt32=null,Nv.prototype.visitInt64=null,Nv.prototype.visitUint8=null,Nv.prototype.visitUint16=null,Nv.prototype.visitUint32=null,Nv.prototype.visitUint64=null,Nv.prototype.visitFloat16=null,Nv.prototype.visitFloat32=null,Nv.prototype.visitFloat64=null,Nv.prototype.visitDateDay=null,Nv.prototype.visitDateMillisecond=null,Nv.prototype.visitTimestampSecond=null,Nv.prototype.visitTimestampMillisecond=null,Nv.prototype.visitTimestampMicrosecond=null,Nv.prototype.visitTimestampNanosecond=null,Nv.prototype.visitTimeSecond=null,Nv.prototype.visitTimeMillisecond=null,Nv.prototype.visitTimeMicrosecond=null,Nv.prototype.visitTimeNanosecond=null,Nv.prototype.visitDenseUnion=null,Nv.prototype.visitSparseUnion=null,Nv.prototype.visitIntervalDayTime=null,Nv.prototype.visitIntervalYearMonth=null,Nv.prototype.visitDuration=null,Nv.prototype.visitDurationSecond=null,Nv.prototype.visitDurationMillisecond=null,Nv.prototype.visitDurationMicrosecond=null,Nv.prototype.visitDurationNanosecond=null;const Lv=new Float64Array(1),Rv=new Uint32Array(Lv.buffer);function zv(e){let t=(e&31744)>>10,n=(e&1023)/1024,r=(-1)**((e&32768)>>15);switch(t){case 31:return r*(n?NaN:1/0);case 0:return r*(n?6103515625e-14*n:0)}return r*2**(t-15)*(1+n)}function Bv(e){if(e!==e)return 32256;Lv[0]=e;let t=(Rv[1]&2147483648)>>16&65535,n=Rv[1]&2146435072,r=0;return n>=1089470464?Rv[0]>0?n=31744:(n=(n&2080374784)>>16,r=(Rv[1]&1048575)>>10):n<=1056964608?(r=1048576+(Rv[1]&1048575),r=1048576+(r<<(n>>20)-998)>>21,n=0):(n=n-1056964608>>10,r=(Rv[1]&1048575)+512>>10),t|n|r&65535}var Vv=class extends Nv{};function Hv(e){return(t,n,r)=>{if(t.setValid(n,r!=null))return e(t,n,r)}}const Uv=(e,t,n)=>{e[t]=Math.floor(n/864e5)},Wv=(e,t,n,r)=>{if(n+1{let i=e+n;r?t[i>>3]|=1<>3]&=~(1<{e[t]=n},qv=({values:e},t,n)=>{e[t]=n},Jv=({values:e},t,n)=>{e[t]=Bv(n)},Yv=(e,t,n)=>{switch(e.type.precision){case _g.HALF:return Jv(e,t,n);case _g.SINGLE:case _g.DOUBLE:return qv(e,t,n)}},Xv=({values:e},t,n)=>{Uv(e,t,n.valueOf())},Zv=({values:e},t,n)=>{e[t]=BigInt(n)},Qv=({stride:e,values:t},n,r)=>{t.set(r.subarray(0,e),e*n)},$v=({values:e,valueOffsets:t},n,r)=>Wv(e,t,n,r),ey=({values:e,valueOffsets:t},n,r)=>Wv(e,t,n,Oh(r)),ty=(e,t,n)=>{e.type.unit===vg.DAY?Xv(e,t,n):Zv(e,t,n)},ny=({values:e},t,n)=>{e[t]=BigInt(n/1e3)},ry=({values:e},t,n)=>{e[t]=BigInt(n)},iy=({values:e},t,n)=>{e[t]=BigInt(n*1e3)},ay=({values:e},t,n)=>{e[t]=BigInt(n*1e6)},oy=(e,t,n)=>{switch(e.type.unit){case yg.SECOND:return ny(e,t,n);case yg.MILLISECOND:return ry(e,t,n);case yg.MICROSECOND:return iy(e,t,n);case yg.NANOSECOND:return ay(e,t,n)}},sy=({values:e},t,n)=>{e[t]=n},cy=({values:e},t,n)=>{e[t]=n},ly=({values:e},t,n)=>{e[t]=n},uy=({values:e},t,n)=>{e[t]=n},dy=(e,t,n)=>{switch(e.type.unit){case yg.SECOND:return sy(e,t,n);case yg.MILLISECOND:return cy(e,t,n);case yg.MICROSECOND:return ly(e,t,n);case yg.NANOSECOND:return uy(e,t,n)}},fy=({values:e,stride:t},n,r)=>{e.set(r.subarray(0,t),t*n)},py=(e,t,n)=>{let r=e.children[0],i=e.valueOffsets,a=Ny.getVisitFn(r);if(Array.isArray(n))for(let e=-1,o=i[t],s=i[t+1];o{let r=e.children[0],{valueOffsets:i}=e,a=Ny.getVisitFn(r),{[t]:o,[t+1]:s}=i,c=n instanceof Map?n.entries():Object.entries(n);for(let e of c)if(a(r,o,e),++o>=s)break},hy=(e,t)=>(n,r,i,a)=>r&&n(r,e,t[a]),gy=(e,t)=>(n,r,i,a)=>r&&n(r,e,t.get(a)),_y=(e,t)=>(n,r,i,a)=>r&&n(r,e,t.get(i.name)),vy=(e,t)=>(n,r,i,a)=>r&&n(r,e,t[i.name]),yy=(e,t,n)=>{let r=e.type.children.map(e=>Ny.getVisitFn(e.type)),i=n instanceof Map?_y(t,n):n instanceof Mx?gy(t,n):Array.isArray(n)?hy(t,n):vy(t,n);e.type.children.forEach((t,n)=>i(r[n],e.children[n],t,n))},by=(e,t,n)=>{e.type.mode===gg.Dense?xy(e,t,n):Sy(e,t,n)},xy=(e,t,n)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[r];Ny.visit(i,e.valueOffsets[t],n)},Sy=(e,t,n)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[r];Ny.visit(i,t,n)},Cy=(e,t,n)=>{var r;(r=e.dictionary)==null||r.set(e.values[t],n)},wy=(e,t,n)=>{e.type.unit===bg.DAY_TIME?Ty(e,t,n):Ey(e,t,n)},Ty=({values:e},t,n)=>{e.set(n.subarray(0,2),2*t)},Ey=({values:e},t,n)=>{e[t]=n[0]*12+n[1]%12},Dy=({values:e},t,n)=>{e[t]=n},Oy=({values:e},t,n)=>{e[t]=n},ky=({values:e},t,n)=>{e[t]=n},Ay=({values:e},t,n)=>{e[t]=n},jy=(e,t,n)=>{switch(e.type.unit){case yg.SECOND:return Dy(e,t,n);case yg.MILLISECOND:return Oy(e,t,n);case yg.MICROSECOND:return ky(e,t,n);case yg.NANOSECOND:return Ay(e,t,n)}},My=(e,t,n)=>{let{stride:r}=e,i=e.children[0],a=Ny.getVisitFn(i);if(Array.isArray(n))for(let e=-1,o=t*r;++e`${h_(e)}: ${h_(t)}`).join(`, `)}}`}[Symbol.for(`nodejs.util.inspect.custom`)](){return this.toString()}[Symbol.iterator](){return new Ly(this[Py],this[Fy])}},Ly=class{constructor(e,t){this.childIndex=0,this.children=e.children,this.rowIndex=t,this.childFields=e.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){let e=this.childIndex;return ee.name)}has(e,t){return e[Py].type.children.findIndex(e=>e.name===t)!==-1}getOwnPropertyDescriptor(e,t){if(e[Py].type.children.findIndex(e=>e.name===t)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(e,t){if(Reflect.has(e,t))return e[t];let n=e[Py].type.children.findIndex(e=>e.name===t);if(n!==-1){let r=kb.visit(e[Py].children[n],e[Fy]);return Reflect.set(e,t,r),r}}set(e,t,n){let r=e[Py].type.children.findIndex(e=>e.name===t);return r===-1?Reflect.has(e,t)||typeof t==`symbol`?Reflect.set(e,t,n):!1:(Ny.visit(e[Py].children[r],e[Fy],n),Reflect.set(e,t,n))}},zy=class extends Nv{};function By(e){return(t,n)=>t.getValid(n)?e(t,n):null}const Vy=(e,t)=>864e5*e[t],Hy=(e,t)=>null,Uy=(e,t,n)=>{if(n+1>=t.length)return null;let r=g_(t[n]),i=g_(t[n+1]);return e.subarray(r,i)},Wy=({offset:e,values:t},n)=>{let r=e+n,i=t[r>>3];return(i&1<Vy(e,t),Ky=({values:e},t)=>g_(e[t]),qy=({stride:e,values:t},n)=>t[e*n],Jy=({stride:e,values:t},n)=>zv(t[e*n]),Yy=({values:e},t)=>e[t],Xy=({stride:e,values:t},n)=>t.subarray(e*n,e*(n+1)),Zy=({values:e,valueOffsets:t},n)=>Uy(e,t,n),Qy=({values:e,valueOffsets:t},n)=>{let r=Uy(e,t,n);return r===null?null:Eh(r)},$y=({values:e},t)=>e[t],eb=({type:e,values:t},n)=>e.precision===_g.HALF?zv(t[n]):t[n],tb=(e,t)=>e.type.unit===vg.DAY?Gy(e,t):Ky(e,t),nb=({values:e},t)=>1e3*g_(e[t]),rb=({values:e},t)=>g_(e[t]),ib=({values:e},t)=>__(e[t],BigInt(1e3)),ab=({values:e},t)=>__(e[t],BigInt(1e6)),ob=(e,t)=>{switch(e.type.unit){case yg.SECOND:return nb(e,t);case yg.MILLISECOND:return rb(e,t);case yg.MICROSECOND:return ib(e,t);case yg.NANOSECOND:return ab(e,t)}},sb=({values:e},t)=>e[t],cb=({values:e},t)=>e[t],lb=({values:e},t)=>e[t],ub=({values:e},t)=>e[t],db=(e,t)=>{switch(e.type.unit){case yg.SECOND:return sb(e,t);case yg.MILLISECOND:return cb(e,t);case yg.MICROSECOND:return lb(e,t);case yg.NANOSECOND:return ub(e,t)}},fb=({values:e,stride:t},n)=>k_.decimal(e.subarray(t*n,t*(n+1))),pb=(e,t)=>{let{valueOffsets:n,stride:r,children:i}=e,{[t*r]:a,[t*r+1]:o}=n,s=i[0],c=s.slice(a,o-a);return new Mx([c])},mb=(e,t)=>{let{valueOffsets:n,children:r}=e,{[t]:i,[t+1]:a}=n,o=r[0];return new Pb(o.slice(i,a-i))},hb=(e,t)=>new Iy(e,t),gb=(e,t)=>e.type.mode===gg.Dense?_b(e,t):vb(e,t),_b=(e,t)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],r=e.children[n];return kb.visit(r,e.valueOffsets[t])},vb=(e,t)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],r=e.children[n];return kb.visit(r,t)},yb=(e,t)=>{var n;return(n=e.dictionary)?.get(e.values[t])},bb=(e,t)=>e.type.unit===bg.DAY_TIME?xb(e,t):Sb(e,t),xb=({values:e},t)=>e.subarray(2*t,2*(t+1)),Sb=({values:e},t)=>{let n=e[t],r=new Int32Array(2);return r[0]=Math.trunc(n/12),r[1]=Math.trunc(n%12),r},Cb=({values:e},t)=>e[t],wb=({values:e},t)=>e[t],Tb=({values:e},t)=>e[t],Eb=({values:e},t)=>e[t],Db=(e,t)=>{switch(e.type.unit){case yg.SECOND:return Cb(e,t);case yg.MILLISECOND:return wb(e,t);case yg.MICROSECOND:return Tb(e,t);case yg.NANOSECOND:return Eb(e,t)}},Ob=(e,t)=>{let{stride:n,children:r}=e,i=r[0],a=i.slice(t*n,n);return new Mx([a])};zy.prototype.visitNull=By(Hy),zy.prototype.visitBool=By(Wy),zy.prototype.visitInt=By($y),zy.prototype.visitInt8=By(qy),zy.prototype.visitInt16=By(qy),zy.prototype.visitInt32=By(qy),zy.prototype.visitInt64=By(Yy),zy.prototype.visitUint8=By(qy),zy.prototype.visitUint16=By(qy),zy.prototype.visitUint32=By(qy),zy.prototype.visitUint64=By(Yy),zy.prototype.visitFloat=By(eb),zy.prototype.visitFloat16=By(Jy),zy.prototype.visitFloat32=By(qy),zy.prototype.visitFloat64=By(qy),zy.prototype.visitUtf8=By(Qy),zy.prototype.visitLargeUtf8=By(Qy),zy.prototype.visitBinary=By(Zy),zy.prototype.visitLargeBinary=By(Zy),zy.prototype.visitFixedSizeBinary=By(Xy),zy.prototype.visitDate=By(tb),zy.prototype.visitDateDay=By(Gy),zy.prototype.visitDateMillisecond=By(Ky),zy.prototype.visitTimestamp=By(ob),zy.prototype.visitTimestampSecond=By(nb),zy.prototype.visitTimestampMillisecond=By(rb),zy.prototype.visitTimestampMicrosecond=By(ib),zy.prototype.visitTimestampNanosecond=By(ab),zy.prototype.visitTime=By(db),zy.prototype.visitTimeSecond=By(sb),zy.prototype.visitTimeMillisecond=By(cb),zy.prototype.visitTimeMicrosecond=By(lb),zy.prototype.visitTimeNanosecond=By(ub),zy.prototype.visitDecimal=By(fb),zy.prototype.visitList=By(pb),zy.prototype.visitStruct=By(hb),zy.prototype.visitUnion=By(gb),zy.prototype.visitDenseUnion=By(_b),zy.prototype.visitSparseUnion=By(vb),zy.prototype.visitDictionary=By(yb),zy.prototype.visitInterval=By(bb),zy.prototype.visitIntervalDayTime=By(xb),zy.prototype.visitIntervalYearMonth=By(Sb),zy.prototype.visitDuration=By(Db),zy.prototype.visitDurationSecond=By(Cb),zy.prototype.visitDurationMillisecond=By(wb),zy.prototype.visitDurationMicrosecond=By(Tb),zy.prototype.visitDurationNanosecond=By(Eb),zy.prototype.visitFixedSizeList=By(Ob),zy.prototype.visitMap=By(mb);const kb=new zy,Ab=Symbol.for(`keys`),jb=Symbol.for(`vals`),Mb=Symbol.for(`kKeysAsStrings`),Nb=Symbol.for(`_kKeysAsStrings`);var Pb=class{constructor(e){return this[Ab]=new Mx([e.children[0]]).memoize(),this[jb]=e.children[1],new Proxy(this,new Ib)}get[Mb](){return this[Nb]||(this[Nb]=Array.from(this[Ab].toArray(),String))}[Symbol.iterator](){return new Fb(this[Ab],this[jb])}get size(){return this[Ab].length}toArray(){return Object.values(this.toJSON())}toJSON(){let e=this[Ab],t=this[jb],n={};for(let r=-1,i=e.length;++r`${h_(e)}: ${h_(t)}`).join(`, `)}}`}[Symbol.for(`nodejs.util.inspect.custom`)](){return this.toString()}},Fb=class{constructor(e,t){this.keys=e,this.vals=t,this.keyIndex=0,this.numKeys=e.length}[Symbol.iterator](){return this}next(){let e=this.keyIndex;return e===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(e),kb.visit(this.vals,e)]})}},Ib=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(e){return e[Mb]}has(e,t){return e[Mb].includes(t)}getOwnPropertyDescriptor(e,t){let n=e[Mb].indexOf(t);if(n!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(e,t){if(Reflect.has(e,t))return e[t];let n=e[Mb].indexOf(t);if(n!==-1){let r=kb.visit(Reflect.get(e,jb),n);return Reflect.set(e,t,r),r}}set(e,t,n){let r=e[Mb].indexOf(t);return r===-1?Reflect.has(e,t)?Reflect.set(e,t,n):!1:(Ny.visit(Reflect.get(e,jb),r,n),Reflect.set(e,t,n))}};Object.defineProperties(Pb.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:`Row`},[Ab]:{writable:!0,enumerable:!1,configurable:!1,value:null},[jb]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Nb]:{writable:!0,enumerable:!1,configurable:!1,value:null}});let Lb;function Rb(e,t,n,r){let{length:i=0}=e,a=typeof t==`number`?t:0,o=typeof n==`number`?n:i;return a<0&&(a=(a%i+i)%i),o<0&&(o=(o%i+i)%i),oi&&(o=i),r?r(e,a,o):[a,o]}const zb=(e,t)=>e<0?t+e:e,Bb=e=>e!==e;function Vb(e){let t=typeof e;if(t!==`object`||e===null)return Bb(e)?Bb:t=>t===e;if(e instanceof Date){let t=e.valueOf();return e=>e instanceof Date?e.valueOf()===t:!1}return ArrayBuffer.isView(e)?t=>t?og(e,t):!1:e instanceof Map?Ub(e):Array.isArray(e)?Hb(e):e instanceof Mx?Wb(e):Gb(e,!0)}function Hb(e){let t=[];for(let n=-1,r=e.length;++n!1;let r=[];for(let t=-1,i=n.length;++t{if(!n||typeof n!=`object`)return!1;switch(n.constructor){case Array:return qb(e,n);case Map:return Yb(e,n,n.keys());case Pb:case Iy:case Object:case void 0:return Yb(e,n,t||Object.keys(n))}return n instanceof Mx?Jb(e,n):!1}}function qb(e,t){let n=e.length;if(t.length!==n)return!1;for(let r=-1;++r>r}function Qb(e,t,n){let r=n.byteLength+7&-8;if(e>0||n.byteLength>3):$b(new ex(n,e,t,null,Xb)).subarray(0,r)),i}return n}function $b(e){let t=[],n=0,r=0,i=0;for(let a of e)a&&(i|=1<0)&&(t[n++]=i);let a=new Uint8Array(t.length+7&-8);return a.set(t),a}var ex=class{constructor(e,t,n,r,i){this.bytes=e,this.length=n,this.context=r,this.get=i,this.bit=t%8,this.byteIndex=t>>3,this.byte=e[this.byteIndex++],this.index=0}next(){return this.index>3<<3,i=t+(t%8==0?0:8-t%8);return tx(e,t,i)+tx(e,r,n)+nx(e,i>>3,r-i>>3)}function nx(e,t,n){let r=0,i=Math.trunc(t),a=new DataView(e.buffer,e.byteOffset,e.byteLength),o=n===void 0?e.byteLength:i+n;for(;o-i>=4;)r+=rx(a.getUint32(i)),i+=4;for(;o-i>=2;)r+=rx(a.getUint16(i)),i+=2;for(;o-i>=1;)r+=rx(a.getUint8(i)),i+=1;return r}function rx(e){let t=Math.trunc(e);return t-=t>>>1&1431655765,t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}const ix=-1;var ax=class e{get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get nullable(){if(this._nullCount!==0){let{type:e}=this;return Q_.isSparseUnion(e)||Q_.isDenseUnion(e)?this.children.some(e=>e.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let e=0,{valueOffsets:t,values:n,nullBitmap:r,typeIds:i}=this;return t&&(e+=t.byteLength),n&&(e+=n.byteLength),r&&(e+=r.byteLength),i&&(e+=i.byteLength),this.children.reduce((e,t)=>e+t.byteLength,e)}get nullCount(){if(Q_.isUnion(this.type))return this.children.reduce((e,t)=>e+t.nullCount,0);let e=this._nullCount,t;return e<=ix&&(t=this.nullBitmap)&&(this._nullCount=e=t.length===0?0:this.length-tx(t,this.offset,this.offset+this.length)),e}constructor(t,n,r,i,a,o=[],s){this.type=t,this.children=o,this.dictionary=s,this.offset=Math.floor(Math.max(n||0,0)),this.length=Math.floor(Math.max(r||0,0)),this._nullCount=Math.floor(Math.max(i||0,-1));let c;a instanceof e?(this.stride=a.stride,this.values=a.values,this.typeIds=a.typeIds,this.nullBitmap=a.nullBitmap,this.valueOffsets=a.valueOffsets):(this.stride=Mv(t),a&&((c=a[0])&&(this.valueOffsets=c),(c=a[1])&&(this.values=c),(c=a[2])&&(this.nullBitmap=c),(c=a[3])&&(this.typeIds=c)))}getValid(e){let{type:t}=this;if(Q_.isUnion(t)){let n=t,r=this.children[n.typeIdToChildIndex[this.typeIds[e]]],i=n.mode===gg.Dense?this.valueOffsets[e]:e;return r.getValid(i)}if(this.nullable&&this.nullCount>0){let t=this.offset+e,n=this.nullBitmap[t>>3];return(n&1<>3;(!r||r.byteLength<=c)&&(r=new Uint8Array((i+a+63&-64)>>3).fill(255),this.nullCount>0?(r.set(Qb(i,a,this.nullBitmap),0),Object.assign(this,{nullBitmap:r})):Object.assign(this,{nullBitmap:r,_nullCount:0}));let l=r[c];n=(l&s)!==0,r[c]=t?l|s:l&~s}return n!==!!t&&(this._nullCount=this.nullCount+(t?-1:1)),t}clone(t=this.type,n=this.offset,r=this.length,i=this._nullCount,a=this,o=this.children){return new e(t,n,r,i,a,o,this.dictionary)}slice(e,t){let{stride:n,typeId:r,children:i}=this,a=(this._nullCount===0)-1,o=r===16?n:1,s=this._sliceBuffers(e,t,n,r);return this.clone(this.type,this.offset+e,t,a,s,i.length===0||this.valueOffsets?i:this._sliceChildren(i,o*e,o*t))}_changeLengthAndBackfillNullBitmap(e){if(this.typeId===q.Null)return this.clone(this.type,0,e,0);let{length:t,nullCount:n}=this,r=new Uint8Array((e+63&-64)>>3).fill(255,0,t>>3);r[t>>3]=(1<0&&r.set(Qb(this.offset,t,this.nullBitmap),0);let i=this.buffers;return i[p_.VALIDITY]=r,this.clone(this.type,0,e,n+(e-t),i)}_sliceBuffers(e,t,n,r){let i,{buffers:a}=this;return(i=a[p_.TYPE])&&(a[p_.TYPE]=i.subarray(e,e+t)),(i=a[p_.OFFSET])&&(a[p_.OFFSET]=i.subarray(e,e+t+1))||(i=a[p_.DATA])&&(a[p_.DATA]=r===6?i:i.subarray(n*e,n*(e+t))),a}_sliceChildren(e,t,n){return e.map(e=>e.slice(t,n))}};ax.prototype.children=Object.freeze([]);var ox=class e extends Nv{visit(e){return this.getVisitFn(e.type).call(this,e)}visitNull(e){let{type:t,offset:n=0,length:r=0}=e;return new ax(t,n,r,r)}visitBool(e){let{type:t,offset:n=0}=e,r=$h(e.nullBitmap),i=Xh(t.ArrayType,e.data),{length:a=i.length>>3,nullCount:o=e.nullBitmap?-1:0}=e;return new ax(t,n,a,o,[void 0,i,r])}visitInt(e){let{type:t,offset:n=0}=e,r=$h(e.nullBitmap),i=Xh(t.ArrayType,e.data),{length:a=i.length,nullCount:o=e.nullBitmap?-1:0}=e;return new ax(t,n,a,o,[void 0,i,r])}visitFloat(e){let{type:t,offset:n=0}=e,r=$h(e.nullBitmap),i=Xh(t.ArrayType,e.data),{length:a=i.length,nullCount:o=e.nullBitmap?-1:0}=e;return new ax(t,n,a,o,[void 0,i,r])}visitUtf8(e){let{type:t,offset:n=0}=e,r=$h(e.data),i=$h(e.nullBitmap),a=Zh(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new ax(t,n,o,s,[a,r,i])}visitLargeUtf8(e){let{type:t,offset:n=0}=e,r=$h(e.data),i=$h(e.nullBitmap),a=Qh(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new ax(t,n,o,s,[a,r,i])}visitBinary(e){let{type:t,offset:n=0}=e,r=$h(e.data),i=$h(e.nullBitmap),a=Zh(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new ax(t,n,o,s,[a,r,i])}visitLargeBinary(e){let{type:t,offset:n=0}=e,r=$h(e.data),i=$h(e.nullBitmap),a=Qh(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new ax(t,n,o,s,[a,r,i])}visitFixedSizeBinary(e){let{type:t,offset:n=0}=e,r=$h(e.nullBitmap),i=Xh(t.ArrayType,e.data),{length:a=i.length/Mv(t),nullCount:o=e.nullBitmap?-1:0}=e;return new ax(t,n,a,o,[void 0,i,r])}visitDate(e){let{type:t,offset:n=0}=e,r=$h(e.nullBitmap),i=Xh(t.ArrayType,e.data),{length:a=i.length/Mv(t),nullCount:o=e.nullBitmap?-1:0}=e;return new ax(t,n,a,o,[void 0,i,r])}visitTimestamp(e){let{type:t,offset:n=0}=e,r=$h(e.nullBitmap),i=Xh(t.ArrayType,e.data),{length:a=i.length/Mv(t),nullCount:o=e.nullBitmap?-1:0}=e;return new ax(t,n,a,o,[void 0,i,r])}visitTime(e){let{type:t,offset:n=0}=e,r=$h(e.nullBitmap),i=Xh(t.ArrayType,e.data),{length:a=i.length/Mv(t),nullCount:o=e.nullBitmap?-1:0}=e;return new ax(t,n,a,o,[void 0,i,r])}visitDecimal(e){let{type:t,offset:n=0}=e,r=$h(e.nullBitmap),i=Xh(t.ArrayType,e.data),{length:a=i.length/Mv(t),nullCount:o=e.nullBitmap?-1:0}=e;return new ax(t,n,a,o,[void 0,i,r])}visitList(e){let{type:t,offset:n=0,child:r}=e,i=$h(e.nullBitmap),a=Zh(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new ax(t,n,o,s,[a,void 0,i],[r])}visitStruct(e){let{type:t,offset:n=0,children:r=[]}=e,i=$h(e.nullBitmap),{length:a=r.reduce((e,{length:t})=>Math.max(e,t),0),nullCount:o=e.nullBitmap?-1:0}=e;return new ax(t,n,a,o,[void 0,void 0,i],r)}visitUnion(e){let{type:t,offset:n=0,children:r=[]}=e,i=Xh(t.ArrayType,e.typeIds),{length:a=i.length,nullCount:o=-1}=e;if(Q_.isSparseUnion(t))return new ax(t,n,a,o,[void 0,void 0,void 0,i],r);let s=Zh(e.valueOffsets);return new ax(t,n,a,o,[s,void 0,void 0,i],r)}visitDictionary(t){let{type:n,offset:r=0}=t,i=$h(t.nullBitmap),a=Xh(n.indices.ArrayType,t.data),{dictionary:o=new Mx([new e().visit({type:n.dictionary})])}=t,{length:s=a.length,nullCount:c=t.nullBitmap?-1:0}=t;return new ax(n,r,s,c,[void 0,a,i],[],o)}visitInterval(e){let{type:t,offset:n=0}=e,r=$h(e.nullBitmap),i=Xh(t.ArrayType,e.data),{length:a=i.length/Mv(t),nullCount:o=e.nullBitmap?-1:0}=e;return new ax(t,n,a,o,[void 0,i,r])}visitDuration(e){let{type:t,offset:n=0}=e,r=$h(e.nullBitmap),i=Xh(t.ArrayType,e.data),{length:a=i.length,nullCount:o=e.nullBitmap?-1:0}=e;return new ax(t,n,a,o,[void 0,i,r])}visitFixedSizeList(t){let{type:n,offset:r=0,child:i=new e().visit({type:n.valueType})}=t,a=$h(t.nullBitmap),{length:o=i.length/Mv(n),nullCount:s=t.nullBitmap?-1:0}=t;return new ax(n,r,o,s,[void 0,void 0,a],[i])}visitMap(t){let{type:n,offset:r=0,child:i=new e().visit({type:n.childType})}=t,a=$h(t.nullBitmap),o=Zh(t.valueOffsets),{length:s=o.length-1,nullCount:c=t.nullBitmap?-1:0}=t;return new ax(n,r,s,c,[o,void 0,a],[i])}};const sx=new ox;function cx(e){return sx.visit(e)}var lx=class{constructor(e=0,t){this.numChunks=e,this.getChunkIterator=t,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndexe.nullable)}function dx(e){return e.reduce((e,t)=>e+t.nullCount,0)}function fx(e){return e.reduce((e,t,n)=>(e[n+1]=e[n]+t.length,e),new Uint32Array(e.length+1))}function px(e,t,n,r){let i=[];for(let a=-1,o=e.length;++a=r)break;if(n>=s+c)continue;if(s>=n&&s+c<=r){i.push(o);continue}let l=Math.max(0,n-s),u=Math.min(r-s,c);i.push(o.slice(l,u-l))}return i.length===0&&i.push(e[0].slice(0,0)),i}function mx(e,t,n,r){let i=0,a=0,o=t.length-1;do{if(i>=o-1)return n0?0:-1}function xx(e,t){let{nullBitmap:n}=e;if(!n||e.nullCount<=0)return-1;let r=0;for(let i of new ex(n,e.offset+(t||0),e.length,n,Xb)){if(!i)return r;++r}return-1}function Sx(e,t,n){if(t===void 0)return-1;if(t===null)switch(e.typeId){case q.Union:break;case q.Dictionary:break;default:return xx(e,n)}let r=kb.getVisitFn(e),i=Vb(t);for(let t=(n||0)-1,a=e.length;++t{let n=e.data[t];return n.values.subarray(0,n.length)[Symbol.iterator]()});let n=0;return new lx(e.data.length,t=>{let r=e.data[t],i=r.length,a=e.slice(n,n+i);return n+=i,new Dx(a)})}var Dx=class{constructor(e){this.vector=e,this.index=0}next(){return this.indexe.data):t;if(a.length===0||a.some(e=>!(e instanceof ax)))throw TypeError(`Vector constructor expects an Array of Data instances.`);let o=(n=a[0])?.type;switch(a.length){case 0:this._offsets=[0];break;case 1:{let{get:e,set:t,indexOf:n}=Ax[o.typeId],r=a[0];this.isValid=e=>hx(r,e),this.get=t=>e(r,t),this.set=(e,n)=>t(r,e,n),this.indexOf=e=>n(r,e),this._offsets=[0,r.length];break}default:Object.setPrototypeOf(this,jx[o.typeId]),this._offsets=fx(a);break}this.data=a,this.type=o,this.stride=Mv(o),this.numChildren=(i=(r=o.children)?.length)??0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((e,t)=>e+t.byteLength,0)}get nullable(){return ux(this.data)}get nullCount(){return dx(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${q[this.type.typeId]}Vector`}isValid(e){return!1}get(e){return null}at(e){return this.get(zb(e,this.length))}set(e,t){}indexOf(e,t){return-1}includes(e,t){return this.indexOf(e,t)>-1}[Symbol.iterator](){return Ox.visit(this)}concat(...t){return new e(this.data.concat(t.flatMap(e=>e.data).flat(1/0)))}slice(t,n){return new e(Rb(this,t,n,({data:e,_offsets:t},n,r)=>px(e,t,n,r)))}toJSON(){return[...this]}toArray(){let{type:e,data:t,length:n,stride:r,ArrayType:i}=this;switch(e.typeId){case q.Int:case q.Float:case q.Decimal:case q.Time:case q.Timestamp:switch(t.length){case 0:return new i;case 1:return t[0].values.subarray(0,n*r);default:return t.reduce((e,{values:t,length:n})=>(e.array.set(t.subarray(0,n*r),e.offset),e.offset+=n*r,e),{array:new i(n*r),offset:0}).array}}return[...this]}toString(){return`[${[...this].join(`,`)}]`}getChild(e){var t;return this.getChildAt((t=this.type.children)?.findIndex(t=>t.name===e))}getChildAt(t){return t>-1&&te[t])):null}get isMemoized(){return Q_.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(Q_.isDictionary(this.type)){let t=new Nx(this.data[0].dictionary),n=this.data.map(e=>{let n=e.clone();return n.dictionary=t,n});return new e(n)}return new Nx(this)}unmemoize(){if(Q_.isDictionary(this.type)&&this.isMemoized){let t=this.data[0].dictionary.unmemoize(),n=this.data.map(e=>{let n=e.clone();return n.dictionary=t,n});return new e(n)}return this}};kx=Symbol.toStringTag,Mx[kx]=(e=>{e.type=Q_.prototype,e.data=[],e.length=0,e.stride=1,e.numChildren=0,e._offsets=new Uint32Array([0]),e[Symbol.isConcatSpreadable]=!0;let t=Object.keys(q).map(e=>q[e]).filter(e=>typeof e==`number`&&e!==q.NONE);for(let n of t){let t=kb.getVisitFnByTypeId(n),r=Ny.getVisitFnByTypeId(n),i=wx.getVisitFnByTypeId(n);Ax[n]={get:t,set:r,indexOf:i},jx[n]=Object.create(e,{isValid:{value:gx(hx)},get:{value:gx(kb.getVisitFnByTypeId(n))},set:{value:_x(Ny.getVisitFnByTypeId(n))},indexOf:{value:vx(wx.getVisitFnByTypeId(n))}})}return`Vector`})(Mx.prototype);var Nx=class e extends Mx{constructor(t){super(t.data);let n=this.get,r=this.set,i=this.slice,a=Array(this.length);Object.defineProperty(this,`get`,{value(e){let t=a[e];if(t!==void 0)return t;let r=n.call(this,e);return a[e]=r,r}}),Object.defineProperty(this,`set`,{value(e,t){r.call(this,e,t),a[e]=t}}),Object.defineProperty(this,`slice`,{value:(t,n)=>new e(i.call(this,t,n))}),Object.defineProperty(this,`isMemoized`,{value:!0}),Object.defineProperty(this,`unmemoize`,{value:()=>new Mx(this.data)}),Object.defineProperty(this,`memoize`,{value:()=>this})}},Px=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}offset(){return this.bb.readInt64(this.bb_pos)}metaDataLength(){return this.bb.readInt32(this.bb_pos+8)}bodyLength(){return this.bb.readInt64(this.bb_pos+16)}static sizeOf(){return 24}static createBlock(e,t,n,r){return e.prep(8,24),e.writeInt64(BigInt(r??0)),e.pad(4),e.writeInt32(n),e.writeInt64(BigInt(t??0)),e.offset()}},Fx=class e{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsFooter(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFooter(t,n){return t.setPosition(t.position()+wg),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}version(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):hg.V1}schema(e){let t=this.bb.__offset(this.bb_pos,6);return t?(e||new d_).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}dictionaries(e,t){let n=this.bb.__offset(this.bb_pos,8);return n?(t||new Px).__init(this.bb.__vector(this.bb_pos+n)+e*24,this.bb):null}dictionariesLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}recordBatches(e,t){let n=this.bb.__offset(this.bb_pos,10);return n?(t||new Px).__init(this.bb.__vector(this.bb_pos+n)+e*24,this.bb):null}recordBatchesLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,t){let n=this.bb.__offset(this.bb_pos,12);return n?(t||new Ug).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}static startFooter(e){e.startObject(5)}static addVersion(e,t){e.addFieldInt16(0,t,hg.V1)}static addSchema(e,t){e.addFieldOffset(1,t,0)}static addDictionaries(e,t){e.addFieldOffset(2,t,0)}static startDictionariesVector(e,t){e.startVector(24,t,8)}static addRecordBatches(e,t){e.addFieldOffset(3,t,0)}static startRecordBatchesVector(e,t){e.startVector(24,t,8)}static addCustomMetadata(e,t){e.addFieldOffset(4,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static endFooter(e){let t=e.endObject();return t}static finishFooterBuffer(e,t){e.finish(t)}static finishSizePrefixedFooterBuffer(e,t){e.finish(t,void 0,!0)}},Ix=class e{constructor(e=[],t,n,r=hg.V5){this.fields=e||[],this.metadata=t||new Map,n||=zx(this.fields),this.dictionaries=n,this.metadataVersion=r}get[Symbol.toStringTag](){return`Schema`}get names(){return this.fields.map(e=>e.name)}toString(){return`Schema<{ ${this.fields.map((e,t)=>`${t}: ${e}`).join(`, `)} }>`}select(t){let n=new Set(t),r=this.fields.filter(e=>n.has(e.name));return new e(r,this.metadata)}selectAt(t){let n=t.map(e=>this.fields[e]).filter(Boolean);return new e(n,this.metadata)}assign(...t){let n=t[0]instanceof e?t[0]:Array.isArray(t[0])?new e(t[0]):new e(t),r=[...this.fields],i=Rx(Rx(new Map,this.metadata),n.metadata),a=n.fields.filter(e=>{let t=r.findIndex(t=>t.name===e.name);return~t?(r[t]=e.clone({metadata:Rx(Rx(new Map,r[t].metadata),e.metadata)}))&&!1:!0}),o=zx(a,new Map);return new e([...r,...a],i,new Map([...this.dictionaries,...o]))}};Ix.prototype.fields=null,Ix.prototype.metadata=null,Ix.prototype.dictionaries=null;var Lx=class e{static new(...t){let[n,r,i,a]=t;return t[0]&&typeof t[0]==`object`&&({name:n}=t[0],r===void 0&&(r=t[0].type),i===void 0&&(i=t[0].nullable),a===void 0&&(a=t[0].metadata)),new e(`${n}`,r,i,a)}constructor(e,t,n=!1,r){this.name=e,this.type=t,this.nullable=n,this.metadata=r||new Map}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return`Field`}toString(){return`${this.name}: ${this.type}`}clone(...t){let[n,r,i,a]=t;return!t[0]||typeof t[0]!=`object`?[n=this.name,r=this.type,i=this.nullable,a=this.metadata]=t:{name:n=this.name,type:r=this.type,nullable:i=this.nullable,metadata:a=this.metadata}=t[0],e.new(n,r,i,a)}};Lx.prototype.type=null,Lx.prototype.name=null,Lx.prototype.nullable=null,Lx.prototype.metadata=null;function Rx(e,t){return new Map([...e||new Map,...t||new Map])}function zx(e,t=new Map){for(let n=-1,r=e.length;++n0&&zx(i.children,t)}return t}var Bx=jg,Vx=Ag,Hx=class{static decode(e){e=new Vx($h(e));let t=Fx.getRootAsFooter(e),n=Ix.decode(t.schema(),new Map,t.version());return new Ux(n,t)}static encode(e){let t=new Bx,n=Ix.encode(t,e.schema);Fx.startRecordBatchesVector(t,e.numRecordBatches);for(let n of[...e.recordBatches()].slice().reverse())Wx.encode(t,n);let r=t.endVector();Fx.startDictionariesVector(t,e.numDictionaries);for(let n of[...e.dictionaryBatches()].slice().reverse())Wx.encode(t,n);let i=t.endVector();return Fx.startFooter(t),Fx.addSchema(t,n),Fx.addVersion(t,hg.V5),Fx.addRecordBatches(t,r),Fx.addDictionaries(t,i),Fx.finishFooterBuffer(t,Fx.endFooter(t)),t.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}constructor(e,t=hg.V5,n,r){this.schema=e,this.version=t,n&&(this._recordBatches=n),r&&(this._dictionaryBatches=r)}*recordBatches(){for(let e,t=-1,n=this.numRecordBatches;++t=0&&e=0&&e=0&&e=0&&ethis._closedPromiseResolve=e)}get closed(){return this._closedPromise}cancel(e){return yh(this,void 0,void 0,function*(){yield this.return(e)})}write(e){this._ensureOpen()&&(this.resolvers.length<=0?this._values.push(e):this.resolvers.shift().resolve({done:!1,value:e}))}abort(e){this._closedPromiseResolve&&(this.resolvers.length<=0?this._error={error:e}:this.resolvers.shift().reject({done:!0,value:e}))}close(){if(this._closedPromiseResolve){let{resolvers:e}=this;for(;e.length>0;)e.shift().resolve(Gx);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(e){return sg.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,e)}toNodeStream(e){return sg.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,e)}throw(e){return yh(this,void 0,void 0,function*(){return yield this.abort(e),Gx})}return(e){return yh(this,void 0,void 0,function*(){return yield this.close(),Gx})}read(e){return yh(this,void 0,void 0,function*(){return(yield this.next(e,`read`)).value})}peek(e){return yh(this,void 0,void 0,function*(){return(yield this.next(e,`peek`)).value})}next(...e){return this._values.length>0?Promise.resolve({done:!1,value:this._values.shift()}):this._error?Promise.reject({done:!0,value:this._error.error}):this._closedPromiseResolve?new Promise((e,t)=>{this.resolvers.push({resolve:e,reject:t})}):Promise.resolve(Gx)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw Error(`AsyncQueue is closed`)}},Yx=class extends Jx{write(e){if((e=$h(e)).byteLength>0)return super.write(e)}toString(e=!1){return e?Eh(this.toUint8Array(!0)):this.toUint8Array(!1).then(Eh)}toUint8Array(e=!1){return e?Yh(this._values)[0]:(()=>yh(this,void 0,void 0,function*(){var e,t,n,r;let i=[],a=0;try{for(var o=!0,s=wh(this),c;c=yield s.next(),e=c.done,!e;o=!0){r=c.value,o=!1;let e=r;i.push(e),a+=e.byteLength}}catch(e){t={error:e}}finally{try{!o&&!e&&(n=s.return)&&(yield n.call(s))}finally{if(t)throw t.error}}return Yh(i,a)[0]}))()}},Xx=class{constructor(e){e&&(this.source=new Qx(sg.fromIterable(e)))}[Symbol.iterator](){return this}next(e){return this.source.next(e)}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}peek(e){return this.source.peek(e)}read(e){return this.source.read(e)}},Zx=class e{constructor(t){t instanceof e?this.source=t.source:t instanceof Yx?this.source=new $x(sg.fromAsyncIterable(t)):Wh(t)?this.source=new $x(sg.fromNodeStream(t)):Hh(t)?this.source=new $x(sg.fromDOMStream(t)):zh(t)?this.source=new $x(sg.fromDOMStream(t.body)):Ph(t)?this.source=new $x(sg.fromIterable(t)):(Nh(t)||Fh(t))&&(this.source=new $x(sg.fromAsyncIterable(t)))}[Symbol.asyncIterator](){return this}next(e){return this.source.next(e)}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}get closed(){return this.source.closed}cancel(e){return this.source.cancel(e)}peek(e){return this.source.peek(e)}read(e){return this.source.read(e)}},Qx=class{constructor(e){this.source=e}cancel(e){this.return(e)}peek(e){return this.next(e,`peek`).value}read(e){return this.next(e,`read`).value}next(e,t=`read`){return this.source.next({cmd:t,size:e})}throw(e){return Object.create(this.source.throw&&this.source.throw(e)||Gx)}return(e){return Object.create(this.source.return&&this.source.return(e)||Gx)}},$x=class{constructor(e){this.source=e,this._closedPromise=new Promise(e=>this._closedPromiseResolve=e)}cancel(e){return yh(this,void 0,void 0,function*(){yield this.return(e)})}get closed(){return this._closedPromise}read(e){return yh(this,void 0,void 0,function*(){return(yield this.next(e,`read`)).value})}peek(e){return yh(this,void 0,void 0,function*(){return(yield this.next(e,`peek`)).value})}next(e){return yh(this,arguments,void 0,function*(e,t=`read`){return yield this.source.next({cmd:t,size:e})})}throw(e){return yh(this,void 0,void 0,function*(){let t=this.source.throw&&(yield this.source.throw(e))||Gx;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(t)})}return(e){return yh(this,void 0,void 0,function*(){let t=this.source.return&&(yield this.source.return(e))||Gx;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(t)})}},eS=class extends Xx{constructor(e,t){super(),this.position=0,this.buffer=$h(e),this.size=t===void 0?this.buffer.byteLength:t}readInt32(e){let{buffer:t,byteOffset:n}=this.readAt(e,4);return new DataView(t,n).getInt32(0,!0)}seek(e){return this.position=Math.min(e,this.size),eyh(this,void 0,void 0,function*(){this.size=(yield e.stat()).size,delete this._pending}))()}readInt32(e){return yh(this,void 0,void 0,function*(){let{buffer:t,byteOffset:n}=yield this.readAt(e,4);return new DataView(t,n).getInt32(0,!0)})}seek(e){return yh(this,void 0,void 0,function*(){return this._pending&&(yield this._pending),this.position=Math.min(e,this.size),e>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),n=new Uint32Array([e.buffer[1]>>>16,e.buffer[1]&65535,e.buffer[0]>>>16,e.buffer[0]&65535]),r=t[3]*n[3];this.buffer[0]=r&65535;let i=r>>>16;return r=t[2]*n[3],i+=r,r=t[3]*n[2]>>>0,i+=r,this.buffer[0]+=i<<16,this.buffer[1]=i>>>0>>16,this.buffer[1]+=t[1]*n[3]+t[2]*n[2]+t[3]*n[1],this.buffer[1]+=t[0]*n[3]+t[1]*n[2]+t[2]*n[1]+t[3]*n[0]<<16,this}_plus(e){let t=this.buffer[0]+e.buffer[0]>>>0;this.buffer[1]+=e.buffer[1],t>>0&&++this.buffer[1],this.buffer[0]=t}lessThan(e){return this.buffer[1]>>0,t[2]=this.buffer[2]+e.buffer[2]>>>0,t[1]=this.buffer[1]+e.buffer[1]>>>0,t[0]=this.buffer[0]+e.buffer[0]>>>0,t[0]>>0&&++t[1],t[1]>>0&&++t[2],t[2]>>0&&++t[3],this.buffer[3]=t[3],this.buffer[2]=t[2],this.buffer[1]=t[1],this.buffer[0]=t[0],this}hex(){return`${rS(this.buffer[3])} ${rS(this.buffer[2])} ${rS(this.buffer[1])} ${rS(this.buffer[0])}`}static multiply(t,n){let r=new e(new Uint32Array(t.buffer));return r.times(n)}static add(t,n){let r=new e(new Uint32Array(t.buffer));return r.plus(n)}static from(t,n=new Uint32Array(4)){return e.fromString(typeof t==`string`?t:t.toString(),n)}static fromNumber(t,n=new Uint32Array(4)){return e.fromString(t.toString(),n)}static fromString(t,n=new Uint32Array(4)){let r=t.startsWith(`-`),i=t.length,a=new e(n);for(let n=r?1:0;n0&&this.readData(e,n)||new Uint8Array}readOffsets(e,t){return this.readData(e,t)}readTypeIds(e,t){return this.readData(e,t)}readData(e,{length:t,offset:n}=this.nextBufferRange()){return this.bytes.subarray(n,n+t)}readDictionary(e){return this.dictionaries.get(e.id)}},dS=class extends uS{constructor(e,t,n,r,i){super(new Uint8Array,t,n,r,i),this.sources=e}readNullBitmap(e,t,{offset:n}=this.nextBufferRange()){return t<=0?new Uint8Array:$b(this.sources[n])}readOffsets(e,{offset:t}=this.nextBufferRange()){return Xh(Uint8Array,Xh(e.OffsetArrayType,this.sources[t]))}readTypeIds(e,{offset:t}=this.nextBufferRange()){return Xh(Uint8Array,Xh(e.ArrayType,this.sources[t]))}readData(e,{offset:t}=this.nextBufferRange()){let{sources:n}=this;return Q_.isTimestamp(e)||(Q_.isInt(e)||Q_.isTime(e))&&e.bitWidth===64||Q_.isDuration(e)||Q_.isDate(e)&&e.unit===vg.MILLISECOND?Xh(Uint8Array,cS.convertArray(n[t])):Q_.isDecimal(e)?Xh(Uint8Array,lS.convertArray(n[t])):Q_.isBinary(e)||Q_.isLargeBinary(e)||Q_.isFixedSizeBinary(e)?fS(n[t]):Q_.isBool(e)?$b(n[t]):Q_.isUtf8(e)||Q_.isLargeUtf8(e)?Oh(n[t].join(``)):Xh(Uint8Array,Xh(e.ArrayType,n[t].map(e=>+e)))}};function fS(e){let t=e.join(``),n=new Uint8Array(t.length/2);for(let e=0;e>1]=Number.parseInt(t.slice(e,e+2),16);return n}var pS=class extends Nv{compareSchemas(e,t){return e===t||t instanceof e.constructor&&this.compareManyFields(e.fields,t.fields)}compareManyFields(e,t){return e===t||Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every((e,n)=>this.compareFields(e,t[n]))}compareFields(e,t){return e===t||t instanceof e.constructor&&e.name===t.name&&e.nullable===t.nullable&&this.visit(e.type,t.type)}};function mS(e,t){return t instanceof e.constructor}function hS(e,t){return e===t||mS(e,t)}function gS(e,t){return e===t||mS(e,t)&&e.bitWidth===t.bitWidth&&e.isSigned===t.isSigned}function _S(e,t){return e===t||mS(e,t)&&e.precision===t.precision}function vS(e,t){return e===t||mS(e,t)&&e.byteWidth===t.byteWidth}function yS(e,t){return e===t||mS(e,t)&&e.unit===t.unit}function bS(e,t){return e===t||mS(e,t)&&e.unit===t.unit&&e.timezone===t.timezone}function xS(e,t){return e===t||mS(e,t)&&e.unit===t.unit&&e.bitWidth===t.bitWidth}function SS(e,t){return e===t||mS(e,t)&&e.children.length===t.children.length&&AS.compareManyFields(e.children,t.children)}function CS(e,t){return e===t||mS(e,t)&&e.children.length===t.children.length&&AS.compareManyFields(e.children,t.children)}function wS(e,t){return e===t||mS(e,t)&&e.mode===t.mode&&e.typeIds.every((e,n)=>e===t.typeIds[n])&&AS.compareManyFields(e.children,t.children)}function TS(e,t){return e===t||mS(e,t)&&e.id===t.id&&e.isOrdered===t.isOrdered&&AS.visit(e.indices,t.indices)&&AS.visit(e.dictionary,t.dictionary)}function ES(e,t){return e===t||mS(e,t)&&e.unit===t.unit}function DS(e,t){return e===t||mS(e,t)&&e.unit===t.unit}function OS(e,t){return e===t||mS(e,t)&&e.listSize===t.listSize&&e.children.length===t.children.length&&AS.compareManyFields(e.children,t.children)}function kS(e,t){return e===t||mS(e,t)&&e.keysSorted===t.keysSorted&&e.children.length===t.children.length&&AS.compareManyFields(e.children,t.children)}pS.prototype.visitNull=hS,pS.prototype.visitBool=hS,pS.prototype.visitInt=gS,pS.prototype.visitInt8=gS,pS.prototype.visitInt16=gS,pS.prototype.visitInt32=gS,pS.prototype.visitInt64=gS,pS.prototype.visitUint8=gS,pS.prototype.visitUint16=gS,pS.prototype.visitUint32=gS,pS.prototype.visitUint64=gS,pS.prototype.visitFloat=_S,pS.prototype.visitFloat16=_S,pS.prototype.visitFloat32=_S,pS.prototype.visitFloat64=_S,pS.prototype.visitUtf8=hS,pS.prototype.visitLargeUtf8=hS,pS.prototype.visitBinary=hS,pS.prototype.visitLargeBinary=hS,pS.prototype.visitFixedSizeBinary=vS,pS.prototype.visitDate=yS,pS.prototype.visitDateDay=yS,pS.prototype.visitDateMillisecond=yS,pS.prototype.visitTimestamp=bS,pS.prototype.visitTimestampSecond=bS,pS.prototype.visitTimestampMillisecond=bS,pS.prototype.visitTimestampMicrosecond=bS,pS.prototype.visitTimestampNanosecond=bS,pS.prototype.visitTime=xS,pS.prototype.visitTimeSecond=xS,pS.prototype.visitTimeMillisecond=xS,pS.prototype.visitTimeMicrosecond=xS,pS.prototype.visitTimeNanosecond=xS,pS.prototype.visitDecimal=hS,pS.prototype.visitList=SS,pS.prototype.visitStruct=CS,pS.prototype.visitUnion=wS,pS.prototype.visitDenseUnion=wS,pS.prototype.visitSparseUnion=wS,pS.prototype.visitDictionary=TS,pS.prototype.visitInterval=ES,pS.prototype.visitIntervalDayTime=ES,pS.prototype.visitIntervalYearMonth=ES,pS.prototype.visitDuration=DS,pS.prototype.visitDurationSecond=DS,pS.prototype.visitDurationMillisecond=DS,pS.prototype.visitDurationMicrosecond=DS,pS.prototype.visitDurationNanosecond=DS,pS.prototype.visitFixedSizeList=OS,pS.prototype.visitMap=kS;const AS=new pS;function jS(e,t){return AS.compareSchemas(e,t)}function MS(e,t){return NS(e,t.map(e=>e.data.concat()))}function NS(e,t){let n=[...e.fields],r=[],i={numBatches:t.reduce((e,t)=>Math.max(e,t.length),0)},a=0,o=0,s=-1,c=t.length,l,u=[];for(;i.numBatches-- >0;){for(o=1/0,s=-1;++s0&&(r[a++]=cx({type:new Tv(n),length:o,nullCount:0,children:u.slice()})))}return[e=e.assign(n),r.map(t=>new RS(e,t))]}function PS(e,t,n,r,i){var a;let o=(t+63&-64)>>3;for(let s=-1,c=r.length;++s=t)l===t?n[s]=c:(n[s]=c.slice(0,t),i.numBatches=Math.max(i.numBatches,r[s].unshift(c.slice(t,l-t))));else{let r=e[s];e[s]=r.clone({nullable:!0}),n[s]=(a=c?._changeLengthAndBackfillNullBitmap(t))??cx({type:r.type,length:t,nullCount:t,nullBitmap:new Uint8Array(o)})}}return n}var FS,IS=class e{constructor(...t){var n,r;if(t.length===0)return this.batches=[],this.schema=new Ix([]),this._offsets=[0],this;let i,a;t[0]instanceof Ix&&(i=t.shift()),t.at(-1)instanceof Uint32Array&&(a=t.pop());let o=t=>{if(t){if(t instanceof RS)return[t];if(t instanceof e)return t.batches;if(t instanceof ax){if(t.type instanceof Tv)return[new RS(new Ix(t.type.children),t)]}else if(Array.isArray(t))return t.flatMap(e=>o(e));else if(typeof t[Symbol.iterator]==`function`)return[...t].flatMap(e=>o(e));else if(typeof t==`object`){let e=Object.keys(t),n=e.map(e=>new Mx([t[e]])),r=i??new Ix(e.map((e,t)=>new Lx(String(e),n[t].type,n[t].nullable))),[,a]=MS(r,n);return a.length===0?[new RS(t)]:a}}return[]},s=t.flatMap(e=>o(e));if(i=(r=i??(n=s[0])?.schema)??new Ix([]),!(i instanceof Ix))throw TypeError(`Table constructor expects a [Schema, RecordBatch[]] pair.`);for(let e of s){if(!(e instanceof RS))throw TypeError(`Table constructor expects a [Schema, RecordBatch[]] pair.`);if(!jS(i,e.schema))throw TypeError(`Table and inner RecordBatch schemas must be equivalent.`)}this.schema=i,this.batches=s,this._offsets=a??fx(this.data)}get data(){return this.batches.map(({data:e})=>e)}get numCols(){return this.schema.fields.length}get numRows(){return this.data.reduce((e,t)=>e+t.length,0)}get nullCount(){return this._nullCount===-1&&(this._nullCount=dx(this.data)),this._nullCount}isValid(e){return!1}get(e){return null}at(e){return this.get(zb(e,this.numRows))}set(e,t){}indexOf(e,t){return-1}[Symbol.iterator](){return this.batches.length>0?Ox.visit(new Mx(this.data)):[][Symbol.iterator]()}toArray(){return[...this]}toString(){return`[\n ${this.toArray().join(`, - `)}\n]`}concat(...t){let n=this.schema,r=this.data.concat(t.flatMap(({data:e})=>e));return new e(n,r.map(e=>new RS(n,e)))}slice(t,n){let r=this.schema;[t,n]=Rb({length:this.numRows},t,n);let i=px(this.data,this._offsets,t,n);return new e(r,i.map(e=>new RS(r,e)))}getChild(e){return this.getChildAt(this.schema.fields.findIndex(t=>t.name===e))}getChildAt(e){if(e>-1&&et.children[e]);if(t.length===0){let{type:n}=this.schema.fields[e],r=cx({type:n,length:0,nullCount:0});t.push(r._changeLengthAndBackfillNullBitmap(this.numRows))}return new Mx(t)}return null}setChild(e,t){var n;return this.setChildAt((n=this.schema.fields)?.findIndex(t=>t.name===e),t)}setChildAt(t,n){let r=this.schema,i=[...this.batches];if(t>-1&&tthis.getChildAt(t));[e[t],o[t]]=[a,n],[r,i]=MS(r,o)}return new e(r,i)}select(e){let t=this.schema.fields.reduce((e,t,n)=>e.set(t.name,n),new Map);return this.selectAt(e.map(e=>t.get(e)).filter(e=>e>-1))}selectAt(t){let n=this.schema.selectAt(t),r=this.batches.map(e=>e.selectAt(t));return new e(n,r)}assign(t){let n=this.schema.fields,[r,i]=t.schema.fields.reduce((e,t,r)=>{let[i,a]=e,o=n.findIndex(e=>e.name===t.name);return~o?a[o]=r:i.push(r),e},[[],[]]),a=this.schema.assign(t.schema),o=[...n.map((e,t)=>[t,i[t]]).map(([e,n])=>n===void 0?this.getChildAt(e):t.getChildAt(n)),...r.map(e=>t.getChildAt(e))].filter(Boolean);return new e(...MS(a,o))}};FS=Symbol.toStringTag,IS[FS]=(e=>(e.schema=null,e.batches=[],e._offsets=new Uint32Array([0]),e._nullCount=-1,e[Symbol.isConcatSpreadable]=!0,e.isValid=gx(hx),e.get=gx(kb.getVisitFn(q.Struct)),e.set=_x(Ny.getVisitFn(q.Struct)),e.indexOf=vx(wx.getVisitFn(q.Struct)),`Table`))(IS.prototype);var LS,RS=class e{constructor(...e){switch(e.length){case 2:if([this.schema]=e,!(this.schema instanceof Ix)||([,this.data=cx({nullCount:0,type:new Tv(this.schema.fields),children:this.schema.fields.map(e=>cx({type:e.type,nullCount:0}))})]=e,!(this.data instanceof ax)))throw TypeError(`RecordBatch constructor expects a [Schema, Data] pair.`);[this.schema,this.data]=zS(this.schema,this.data.children);break;case 1:{let[t]=e,{fields:n,children:r,length:i}=Object.keys(t).reduce((e,n,r)=>(e.children[r]=t[n],e.length=Math.max(e.length,t[n].length),e.fields[r]=Lx.new({name:n,type:t[n].type,nullable:!0}),e),{length:0,fields:[],children:[]}),a=new Ix(n),o=cx({type:new Tv(n),length:i,children:r,nullCount:0});[this.schema,this.data]=zS(a,o.children,i);break}default:throw TypeError(`RecordBatch constructor expects an Object mapping names to child Data, or a [Schema, Data] pair.`)}}get dictionaries(){return this._dictionaries||=BS(this.schema.fields,this.data.children)}get numCols(){return this.schema.fields.length}get numRows(){return this.data.length}get nullCount(){return this.data.nullCount}isValid(e){return this.data.getValid(e)}get(e){return kb.visit(this.data,e)}at(e){return this.get(zb(e,this.numRows))}set(e,t){return Ny.visit(this.data,e,t)}indexOf(e,t){return wx.visit(this.data,e,t)}[Symbol.iterator](){return Ox.visit(new Mx([this.data]))}toArray(){return[...this]}concat(...e){return new IS(this.schema,[this,...e])}slice(t,n){let[r]=new Mx([this.data]).slice(t,n).data;return new e(this.schema,r)}getChild(e){var t;return this.getChildAt((t=this.schema.fields)?.findIndex(t=>t.name===e))}getChildAt(e){return e>-1&&et.name===e),t)}setChildAt(t,n){let r=this.schema,i=this.data;if(t>-1&&tt.name===e);~t&&(i[t]=this.data.children[t])}return new e(n,cx({type:r,length:this.numRows,children:i}))}selectAt(t){let n=this.schema.selectAt(t),r=t.map(e=>this.data.children[e]).filter(Boolean),i=cx({type:new Tv(n.fields),length:this.numRows,children:r});return new e(n,i)}};LS=Symbol.toStringTag,RS[LS]=(e=>(e._nullCount=-1,e[Symbol.isConcatSpreadable]=!0,`RecordBatch`))(RS.prototype);function zS(e,t,n=t.reduce((e,t)=>Math.max(e,t.length),0)){var r;let i=[...e.fields],a=[...t],o=(n+63&-64)>>3;for(let[s,c]of e.fields.entries()){let e=t[s];(!e||e.length!==n)&&(i[s]=c.clone({nullable:!0}),a[s]=(r=e?._changeLengthAndBackfillNullBitmap(n))??cx({type:c.type,length:n,nullCount:n,nullBitmap:new Uint8Array(o)}))}return[e.assign(i),cx({type:new Tv(i),length:n,children:a})]}function BS(e,t,n=new Map){var r,i;if(((r=e?.length)??0)>0&&e?.length===t?.length)for(let r=-1,a=e.length;++rcx({type:e.type})),n=cx({type:new Tv(e.fields),nullCount:0,children:t});super(e,n)}},HS=class e{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsMessage(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMessage(t,n){return t.setPosition(t.position()+wg),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}version(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):hg.V1}headerType(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint8(this.bb_pos+e):f_.NONE}header(e){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__union(e,this.bb_pos+t):null}bodyLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt64(this.bb_pos+e):BigInt(`0`)}customMetadata(e,t){let n=this.bb.__offset(this.bb_pos,12);return n?(t||new Ug).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}static startMessage(e){e.startObject(5)}static addVersion(e,t){e.addFieldInt16(0,t,hg.V1)}static addHeaderType(e,t){e.addFieldInt8(1,t,f_.NONE)}static addHeader(e,t){e.addFieldOffset(2,t,0)}static addBodyLength(e,t){e.addFieldInt64(3,t,BigInt(`0`))}static addCustomMetadata(e,t){e.addFieldOffset(4,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static endMessage(e){let t=e.endObject();return t}static finishMessageBuffer(e,t){e.finish(t)}static finishSizePrefixedMessageBuffer(e,t){e.finish(t,void 0,!0)}static createMessage(t,n,r,i,a,o){return e.startMessage(t),e.addVersion(t,n),e.addHeaderType(t,r),e.addHeader(t,i),e.addBodyLength(t,a),e.addCustomMetadata(t,o),e.endMessage(t)}},US=class extends Nv{visit(e,t){return e==null||t==null?void 0:super.visit(e,t)}visitNull(e,t){return r_.startNull(t),r_.endNull(t)}visitInt(e,t){return Vg.startInt(t),Vg.addBitWidth(t,e.bitWidth),Vg.addIsSigned(t,e.isSigned),Vg.endInt(t)}visitFloat(e,t){return Zg.startFloatingPoint(t),Zg.addPrecision(t,e.precision),Zg.endFloatingPoint(t)}visitBinary(e,t){return Wg.startBinary(t),Wg.endBinary(t)}visitLargeBinary(e,t){return $g.startLargeBinary(t),$g.endLargeBinary(t)}visitBool(e,t){return Gg.startBool(t),Gg.endBool(t)}visitUtf8(e,t){return c_.startUtf8(t),c_.endUtf8(t)}visitLargeUtf8(e,t){return e_.startLargeUtf8(t),e_.endLargeUtf8(t)}visitDecimal(e,t){return qg.startDecimal(t),qg.addScale(t,e.scale),qg.addPrecision(t,e.precision),qg.addBitWidth(t,e.bitWidth),qg.endDecimal(t)}visitDate(e,t){return Kg.startDate(t),Kg.addUnit(t,e.unit),Kg.endDate(t)}visitTime(e,t){return a_.startTime(t),a_.addUnit(t,e.unit),a_.addBitWidth(t,e.bitWidth),a_.endTime(t)}visitTimestamp(e,t){let n=e.timezone&&t.createString(e.timezone)||void 0;return o_.startTimestamp(t),o_.addUnit(t,e.unit),n!==void 0&&o_.addTimezone(t,n),o_.endTimestamp(t)}visitInterval(e,t){return Qg.startInterval(t),Qg.addUnit(t,e.unit),Qg.endInterval(t)}visitDuration(e,t){return Jg.startDuration(t),Jg.addUnit(t,e.unit),Jg.endDuration(t)}visitList(e,t){return t_.startList(t),t_.endList(t)}visitStruct(e,t){return i_.startStruct_(t),i_.endStruct_(t)}visitUnion(e,t){s_.startTypeIdsVector(t,e.typeIds.length);let n=s_.createTypeIdsVector(t,e.typeIds);return s_.startUnion(t),s_.addMode(t,e.mode),s_.addTypeIds(t,n),s_.endUnion(t)}visitDictionary(e,t){let n=this.visit(e.indices,t);return Hg.startDictionaryEncoding(t),Hg.addId(t,BigInt(e.id)),Hg.addIsOrdered(t,e.isOrdered),n!==void 0&&Hg.addIndexType(t,n),Hg.endDictionaryEncoding(t)}visitFixedSizeBinary(e,t){return Yg.startFixedSizeBinary(t),Yg.addByteWidth(t,e.byteWidth),Yg.endFixedSizeBinary(t)}visitFixedSizeList(e,t){return Xg.startFixedSizeList(t),Xg.addListSize(t,e.listSize),Xg.endFixedSizeList(t)}visitMap(e,t){return n_.startMap(t),n_.addKeysSorted(t,e.keysSorted),n_.endMap(t)}};const WS=new US;function GS(e,t=new Map){return new Ix(JS(e,t),eC(e.metadata),t)}function KS(e){return new oC(e.count,XS(e.columns),ZS(e.columns))}function qS(e){return new sC(KS(e.data),e.id,e.isDelta)}function JS(e,t){return(e.fields||[]).filter(Boolean).map(e=>Lx.fromJSON(e,t))}function YS(e,t){return(e.children||[]).filter(Boolean).map(e=>Lx.fromJSON(e,t))}function XS(e){return(e||[]).reduce((e,t)=>[...e,new lC(t.count,QS(t.VALIDITY)),...XS(t.children)],[])}function ZS(e,t=[]){for(let n=-1,r=(e||[]).length;++ne+ +(t===0),0)}function $S(e,t){let n,r,i,a,o,s;return!t||!(a=e.dictionary)?(o=nC(e,YS(e,t)),i=new Lx(e.name,o,e.nullable,eC(e.metadata))):t.has(n=a.id)?(r=(r=a.indexType)?tC(r):new rv,s=new jv(t.get(n),r,n,a.isOrdered),i=new Lx(e.name,s,e.nullable,eC(e.metadata))):(r=(r=a.indexType)?tC(r):new rv,t.set(n,o=nC(e,YS(e,t))),s=new jv(o,r,n,a.isOrdered),i=new Lx(e.name,s,e.nullable,eC(e.metadata))),i||null}function eC(e=[]){return new Map(e.map(({key:e,value:t})=>[e,t]))}function tC(e){return new ev(e.isSigned,e.bitWidth)}function nC(e,t){let n=e.type.name;switch(n){case`NONE`:return new $_;case`null`:return new $_;case`binary`:return new pv;case`largebinary`:return new mv;case`utf8`:return new hv;case`largeutf8`:return new gv;case`bool`:return new _v;case`list`:return new wv((t||[])[0]);case`struct`:return new Tv(t||[]);case`struct_`:return new Tv(t||[])}switch(n){case`int`:{let t=e.type;return new ev(t.isSigned,t.bitWidth)}case`floatingpoint`:{let t=e.type;return new lv(_g[t.precision])}case`decimal`:{let t=e.type;return new vv(t.scale,t.precision,t.bitWidth)}case`date`:{let t=e.type;return new yv(vg[t.unit])}case`time`:{let t=e.type;return new bv(yg[t.unit],t.bitWidth)}case`timestamp`:{let t=e.type;return new xv(yg[t.unit],t.timezone)}case`interval`:{let t=e.type;return new Sv(bg[t.unit])}case`duration`:{let t=e.type;return new Cv(yg[t.unit])}case`union`:{let n=e.type,[r,...i]=(n.mode+``).toLowerCase(),a=r.toUpperCase()+i.join(``);return new Ev(gg[a],n.typeIds||[],t||[])}case`fixedsizebinary`:{let t=e.type;return new Dv(t.byteWidth)}case`fixedsizelist`:{let n=e.type;return new Ov(n.listSize,(t||[])[0])}case`map`:{let n=e.type;return new kv((t||[])[0],n.keysSorted)}}throw Error(`Unrecognized type: "${n}"`)}var rC=jg,iC=Ag,aC=class e{static fromJSON(t,n){let r=new e(0,hg.V5,n);return r._createHeader=uC(t,n),r}static decode(t){t=new iC($h(t));let n=HS.getRootAsMessage(t),r=n.bodyLength(),i=n.version(),a=n.headerType(),o=new e(r,i,a);return o._createHeader=dC(n,a),o}static encode(e){let t=new rC,n=-1;return e.isSchema()?n=Ix.encode(t,e.header()):e.isRecordBatch()?n=oC.encode(t,e.header()):e.isDictionaryBatch()&&(n=sC.encode(t,e.header())),HS.startMessage(t),HS.addVersion(t,hg.V5),HS.addHeader(t,n),HS.addHeaderType(t,e.headerType),HS.addBodyLength(t,BigInt(e.bodyLength)),HS.finishMessageBuffer(t,HS.endMessage(t)),t.asUint8Array()}static from(t,n=0){if(t instanceof Ix)return new e(0,hg.V5,f_.Schema,t);if(t instanceof oC)return new e(n,hg.V5,f_.RecordBatch,t);if(t instanceof sC)return new e(n,hg.V5,f_.DictionaryBatch,t);throw Error(`Unrecognized Message header: ${t}`)}get type(){return this.headerType}get version(){return this._version}get headerType(){return this._headerType}get bodyLength(){return this._bodyLength}header(){return this._createHeader()}isSchema(){return this.headerType===f_.Schema}isRecordBatch(){return this.headerType===f_.RecordBatch}isDictionaryBatch(){return this.headerType===f_.DictionaryBatch}constructor(e,t,n,r){this._version=t,this._headerType=n,this.body=new Uint8Array,r&&(this._createHeader=()=>r),this._bodyLength=g_(e)}},oC=class{get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}constructor(e,t,n){this._nodes=t,this._buffers=n,this._length=g_(e)}},sC=class{get id(){return this._id}get data(){return this._data}get isDelta(){return this._isDelta}get length(){return this.data.length}get nodes(){return this.data.nodes}get buffers(){return this.data.buffers}constructor(e,t,n=!1){this._data=e,this._isDelta=n,this._id=g_(t)}},cC=class{constructor(e,t){this.offset=g_(e),this.length=g_(t)}},lC=class{constructor(e,t){this.length=g_(e),this.nullCount=g_(t)}};function uC(e,t){return()=>{switch(t){case f_.Schema:return Ix.fromJSON(e);case f_.RecordBatch:return oC.fromJSON(e);case f_.DictionaryBatch:return sC.fromJSON(e)}throw Error(`Unrecognized Message type: { name: ${f_[t]}, type: ${t} }`)}}function dC(e,t){return()=>{switch(t){case f_.Schema:return Ix.decode(e.header(new d_),new Map,e.version());case f_.RecordBatch:return oC.decode(e.header(new Lg),e.version());case f_.DictionaryBatch:return sC.decode(e.header(new Rg),e.version())}throw Error(`Unrecognized Message type: { name: ${f_[t]}, type: ${t} }`)}}Lx.encode=EC,Lx.decode=xC,Lx.fromJSON=$S,Ix.encode=TC,Ix.decode=fC,Ix.fromJSON=GS,oC.encode=DC,oC.decode=pC,oC.fromJSON=KS,sC.encode=OC,sC.decode=mC,sC.fromJSON=qS,lC.encode=kC,lC.decode=gC,cC.encode=AC,cC.decode=hC;function fC(e,t=new Map,n=hg.V5){let r=yC(e,t);return new Ix(r,SC(e),t,n)}function pC(e,t=hg.V5){if(e.compression()!==null)throw Error(`Record batch compression not implemented`);return new oC(e.length(),_C(e),vC(e,t))}function mC(e,t=hg.V5){return new sC(oC.decode(e.data(),t),e.id(),e.isDelta())}function hC(e){return new cC(e.offset(),e.length())}function gC(e){return new lC(e.length(),e.nullCount())}function _C(e){let t=[];for(let n,r=-1,i=-1,a=e.nodesLength();++rLx.encode(e,t));d_.startFieldsVector(e,n.length);let r=d_.createFieldsVector(e,n),i=t.metadata&&t.metadata.size>0?d_.createCustomMetadataVector(e,[...t.metadata].map(([t,n])=>{let r=e.createString(`${t}`),i=e.createString(`${n}`);return Ug.startKeyValue(e),Ug.addKey(e,r),Ug.addValue(e,i),Ug.endKeyValue(e)})):-1;return d_.startSchema(e),d_.addFields(e,r),d_.addEndianness(e,jC?zg.Little:zg.Big),i!==-1&&d_.addCustomMetadata(e,i),d_.endSchema(e)}function EC(e,t){let n=-1,r=-1,i=-1,a=t.type,o=t.typeId;Q_.isDictionary(a)?(o=a.dictionary.typeId,i=WS.visit(a,e),r=WS.visit(a.dictionary,e)):r=WS.visit(a,e);let s=(a.children||[]).map(t=>Lx.encode(e,t)),c=u_.createChildrenVector(e,s),l=t.metadata&&t.metadata.size>0?u_.createCustomMetadataVector(e,[...t.metadata].map(([t,n])=>{let r=e.createString(`${t}`),i=e.createString(`${n}`);return Ug.startKeyValue(e),Ug.addKey(e,r),Ug.addValue(e,i),Ug.endKeyValue(e)})):-1;return t.name&&(n=e.createString(t.name)),u_.startField(e),u_.addType(e,r),u_.addTypeType(e,o),u_.addChildren(e,c),u_.addNullable(e,!!t.nullable),n!==-1&&u_.addName(e,n),i!==-1&&u_.addDictionary(e,i),l!==-1&&u_.addCustomMetadata(e,l),u_.endField(e)}function DC(e,t){let n=t.nodes||[],r=t.buffers||[];Lg.startNodesVector(e,n.length);for(let t of n.slice().reverse())lC.encode(e,t);let i=e.endVector();Lg.startBuffersVector(e,r.length);for(let t of r.slice().reverse())cC.encode(e,t);let a=e.endVector();return Lg.startRecordBatch(e),Lg.addLength(e,BigInt(t.length)),Lg.addNodes(e,i),Lg.addBuffers(e,a),Lg.endRecordBatch(e)}function OC(e,t){let n=oC.encode(e,t.data);return Rg.startDictionaryBatch(e),Rg.addId(e,BigInt(t.id)),Rg.addIsDelta(e,t.isDelta),Rg.addData(e,n),Rg.endDictionaryBatch(e)}function kC(e,t){return Ig.createFieldNode(e,BigInt(t.length),BigInt(t.nullCount))}function AC(e,t){return Fg.createBuffer(e,BigInt(t.offset),BigInt(t.length))}const jC=(()=>{let e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),new Int16Array(e)[0]===256})(),MC=e=>`Expected ${f_[e]} Message in stream, but was null or length 0.`,NC=e=>`Header pointer of flatbuffer-encoded ${f_[e]} Message is null or length 0.`,PC=(e,t)=>`Expected to read ${e} metadata bytes, but only read ${t}.`,FC=(e,t)=>`Expected to read ${e} bytes for message body, but only read ${t}.`;var IC=class{constructor(e){this.source=e instanceof Xx?e:new Xx(e)}[Symbol.iterator](){return this}next(){let e;return(e=this.readMetadataLength()).done||e.value===-1&&(e=this.readMetadataLength()).done||(e=this.readMetadata(e.value)).done?Gx:e}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}readMessage(e){let t;if((t=this.next()).done)return null;if(e!=null&&t.value.headerType!==e)throw Error(MC(e));return t.value}readMessageBody(e){if(e<=0)return new Uint8Array;let t=$h(this.source.read(e));if(t.byteLength[...e,...n.VALIDITY&&[n.VALIDITY]||[],...n.TYPE_ID&&[n.TYPE_ID]||[],...n.OFFSET&&[n.OFFSET]||[],...n.DATA&&[n.DATA]||[],...t(n.children)],[])}}readMessage(e){let t;if((t=this.next()).done)return null;if(e!=null&&t.value.headerType!==e)throw Error(MC(e));return t.value}readSchema(){let e=f_.Schema,t=this.readMessage(e),n=t?.header();if(!t||!n)throw Error(NC(e));return n}};const zC=4,BC=`ARROW1`,VC=new Uint8Array(6);for(let e=0;e<6;e+=1)VC[e]=BC.codePointAt(e);function HC(e,t=0){for(let n=-1,r=VC.length;++nthis):this}readRecordBatch(e){return this._impl.isFile()?this._impl.readRecordBatch(e):null}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}toDOMStream(){return sg.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return sg.toNodeStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this},{objectMode:!0})}static throughNode(e){throw Error(`"throughNode" not available in this environment`)}static throughDOM(e,t){throw Error(`"throughDOM" not available in this environment`)}static from(t){return t instanceof e?t:Ih(t)?ow(t):Rh(t)?lw(t):Nh(t)?(()=>yh(this,void 0,void 0,function*(){return yield e.from(yield t)}))():zh(t)||Hh(t)||Wh(t)||Fh(t)?cw(new Zx(t)):sw(new Xx(t))}static readAll(t){return t instanceof e?t.isSync()?iw(t):aw(t):Ih(t)||ArrayBuffer.isView(t)||Ph(t)||Lh(t)?iw(t):aw(t)}},qC=class extends KC{constructor(e){super(e),this._impl=e}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return Sh(this,arguments,function*(){yield xh(yield*Ch(wh(this[Symbol.iterator]())))})}},JC=class extends KC{constructor(e){super(e),this._impl=e}readAll(){return yh(this,void 0,void 0,function*(){var e,t,n,r;let i=[];try{for(var a=!0,o=wh(this),s;s=yield o.next(),e=s.done,!e;a=!0){r=s.value,a=!1;let e=r;i.push(e)}}catch(e){t={error:e}}finally{try{!a&&!e&&(n=o.return)&&(yield n.call(o))}finally{if(t)throw t.error}}return i})}[Symbol.iterator](){throw Error(`AsyncRecordBatchStreamReader is not Iterable`)}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}},YC=class extends qC{constructor(e){super(e),this._impl=e}},XC=class extends JC{constructor(e){super(e),this._impl=e}},ZC=class{get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}constructor(e=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=e}isSync(){return!1}isAsync(){return!1}isFile(){return!1}isStream(){return!1}reset(e){return this._dictionaryIndex=0,this._recordBatchIndex=0,this.schema=e,this.dictionaries=new Map,this}_loadRecordBatch(e,t){let n=this._loadVectors(e,t,this.schema.fields),r=cx({type:new Tv(this.schema.fields),length:e.length,children:n});return new RS(this.schema,r)}_loadDictionaryBatch(e,t){let{id:n,isDelta:r}=e,{dictionaries:i,schema:a}=this,o=i.get(n),s=a.dictionaries.get(n),c=this._loadVectors(e.data,t,[s]);return(o&&r?o.concat(new Mx(c)):new Mx(c)).memoize()}_loadVectors(e,t,n){return new uS(t,e.nodes,e.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(n)}},QC=class extends ZC{constructor(e,t){super(t),this._reader=Ih(e)?new RC(this._handle=e):new IC(this._handle=e)}isSync(){return!0}isStream(){return!0}[Symbol.iterator](){return this}cancel(){!this.closed&&(this.closed=!0)&&(this.reset()._reader.return(),this._reader=null,this.dictionaries=null)}open(e){return this.closed||(this.autoDestroy=rw(this,e),(this.schema||=this._reader.readSchema())||this.cancel()),this}throw(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.throw(e):Gx}return(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(e):Gx}next(){if(this.closed)return Gx;let e,{_reader:t}=this;for(;e=this._readNextMessageAndValidate();)if(e.isSchema())this.reset(e.header());else if(e.isRecordBatch()){this._recordBatchIndex++;let n=e.header(),r=t.readMessageBody(e.bodyLength),i=this._loadRecordBatch(n,r);return{done:!1,value:i}}else if(e.isDictionaryBatch()){this._dictionaryIndex++;let n=e.header(),r=t.readMessageBody(e.bodyLength),i=this._loadDictionaryBatch(n,r);this.dictionaries.set(n.id,i)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new VS(this.schema)}):this.return()}_readNextMessageAndValidate(e){return this._reader.readMessage(e)}},$C=class extends ZC{constructor(e,t){super(t),this._reader=new LC(this._handle=e)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return yh(this,void 0,void 0,function*(){!this.closed&&(this.closed=!0)&&(yield this.reset()._reader.return(),this._reader=null,this.dictionaries=null)})}open(e){return yh(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=rw(this,e),(this.schema||=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(e){return yh(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(e):Gx})}return(e){return yh(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(e):Gx})}next(){return yh(this,void 0,void 0,function*(){if(this.closed)return Gx;let e,{_reader:t}=this;for(;e=yield this._readNextMessageAndValidate();)if(e.isSchema())yield this.reset(e.header());else if(e.isRecordBatch()){this._recordBatchIndex++;let n=e.header(),r=yield t.readMessageBody(e.bodyLength),i=this._loadRecordBatch(n,r);return{done:!1,value:i}}else if(e.isDictionaryBatch()){this._dictionaryIndex++;let n=e.header(),r=yield t.readMessageBody(e.bodyLength),i=this._loadDictionaryBatch(n,r);this.dictionaries.set(n.id,i)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new VS(this.schema)}):yield this.return()})}_readNextMessageAndValidate(e){return yh(this,void 0,void 0,function*(){return yield this._reader.readMessage(e)})}},ew=class extends QC{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(e,t){super(e instanceof eS?e:new eS(e),t)}isSync(){return!0}isFile(){return!0}open(e){if(!this.closed&&!this._footer){this.schema=(this._footer=this._readFooter()).schema;for(let e of this._footer.dictionaryBatches())e&&this._readDictionaryBatch(this._dictionaryIndex++)}return super.open(e)}readRecordBatch(e){var t;if(this.closed)return null;this._footer||this.open();let n=(t=this._footer)?.getRecordBatch(e);if(n&&this._handle.seek(n.offset)){let e=this._reader.readMessage(f_.RecordBatch);if(e?.isRecordBatch()){let t=e.header(),n=this._reader.readMessageBody(e.bodyLength),r=this._loadRecordBatch(t,n);return r}}return null}_readDictionaryBatch(e){var t;let n=(t=this._footer)?.getDictionaryBatch(e);if(n&&this._handle.seek(n.offset)){let e=this._reader.readMessage(f_.DictionaryBatch);if(e?.isDictionaryBatch()){let t=e.header(),n=this._reader.readMessageBody(e.bodyLength),r=this._loadDictionaryBatch(t,n);this.dictionaries.set(t.id,r)}}}_readFooter(){let{_handle:e}=this,t=e.size-WC,n=e.readInt32(t),r=e.readAt(t-n,n);return Hx.decode(r)}_readNextMessageAndValidate(e){var t;if(this._footer||this.open(),this._footer&&this._recordBatchIndexsuper.open}});return yh(this,void 0,void 0,function*(){if(!this.closed&&!this._footer){this.schema=(this._footer=yield this._readFooter()).schema;for(let e of this._footer.dictionaryBatches())e&&(yield this._readDictionaryBatch(this._dictionaryIndex++))}return yield t.open.call(this,e)})}readRecordBatch(e){return yh(this,void 0,void 0,function*(){var t;if(this.closed)return null;this._footer||(yield this.open());let n=(t=this._footer)?.getRecordBatch(e);if(n&&(yield this._handle.seek(n.offset))){let e=yield this._reader.readMessage(f_.RecordBatch);if(e?.isRecordBatch()){let t=e.header(),n=yield this._reader.readMessageBody(e.bodyLength),r=this._loadRecordBatch(t,n);return r}}return null})}_readDictionaryBatch(e){return yh(this,void 0,void 0,function*(){var t;let n=(t=this._footer)?.getDictionaryBatch(e);if(n&&(yield this._handle.seek(n.offset))){let e=yield this._reader.readMessage(f_.DictionaryBatch);if(e?.isDictionaryBatch()){let t=e.header(),n=yield this._reader.readMessageBody(e.bodyLength),r=this._loadDictionaryBatch(t,n);this.dictionaries.set(t.id,r)}}})}_readFooter(){return yh(this,void 0,void 0,function*(){let{_handle:e}=this;e._pending&&(yield e._pending);let t=e.size-WC,n=yield e.readInt32(t),r=yield e.readAt(t-n,n);return Hx.decode(r)})}_readNextMessageAndValidate(e){return yh(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex=4?HC(t)?new YC(new ew(e.read())):new qC(new QC(e)):new qC(new QC(function*(){}()))}function cw(e){return yh(this,void 0,void 0,function*(){let t=yield e.peek(UC+7&-8);return t&&t.byteLength>=4?HC(t)?new YC(new ew(yield e.read())):new JC(new $C(e)):new JC(new $C(function(){return Sh(this,arguments,function*(){})}()))})}function lw(e){return yh(this,void 0,void 0,function*(){let{size:t}=yield e.stat(),n=new tS(e,t);return t>=GC&&HC(yield n.readAt(0,UC+7&-8))?new XC(new tw(n)):new JC(new $C(n))})}var uw=class e extends Nv{static assemble(...t){let n=e=>e.flatMap(e=>Array.isArray(e)?n(e):e instanceof RS?e.data.children:e.data),r=new e;return r.visitMany(n(t)),r}constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[]}visit(e){if(e instanceof Mx)return this.visitMany(e.data),this;let{type:t}=e;if(!Q_.isDictionary(t)){let{length:n}=e;if(n>2147483647)throw RangeError(`Cannot write arrays larger than 2^31 - 1 in length`);if(Q_.isUnion(t))this.nodes.push(new lC(n,0));else{let{nullCount:r}=e;Q_.isNull(t)||dw.call(this,r<=0?new Uint8Array:Qb(e.offset,n,e.nullBitmap)),this.nodes.push(new lC(n,r))}}return super.visit(e)}visitNull(e){return this}visitDictionary(e){return this.visit(e.clone(e.type.indices))}get nodes(){return this._nodes}get buffers(){return this._buffers}get byteLength(){return this._byteLength}get bufferRegions(){return this._bufferRegions}};function dw(e){let t=e.byteLength+7&-8;return this.buffers.push(e),this.bufferRegions.push(new cC(this._byteLength,t)),this._byteLength+=t,this}function fw(e){var t;let{type:n,length:r,typeIds:i,valueOffsets:a}=e;if(dw.call(this,i),n.mode===gg.Sparse)return _w.call(this,e);if(n.mode===gg.Dense){if(e.offset<=0)return dw.call(this,a),_w.call(this,e);{let o=new Int32Array(r),s=Object.create(null),c=Object.create(null);for(let e,n,l=-1;++l{let i=n.typeIds[t],a=s[i],o=c[i];return e.slice(a,Math.min(r,o))}))}}return this}function pw(e){let t;return e.nullCount>=e.length?dw.call(this,new Uint8Array):(t=e.values)instanceof Uint8Array?dw.call(this,Qb(e.offset,e.length,t)):dw.call(this,$b(e.values))}function mw(e){return dw.call(this,e.values.subarray(0,e.length*e.stride))}function hw(e){let{length:t,values:n,valueOffsets:r}=e,i=g_(r[0]),a=g_(r[t]),o=Math.min(a-i,n.byteLength-i);return dw.call(this,ag(-i,t+1,r)),dw.call(this,n.subarray(i,i+o)),this}function gw(e){let{length:t,valueOffsets:n}=e;if(n){let{0:r,[t]:i}=n;return dw.call(this,ag(-r,t+1,n)),this.visit(e.children[0].slice(r,i-r))}return this.visit(e.children[0])}function _w(e){return this.visitMany(e.type.children.map((t,n)=>e.children[n]).filter(Boolean))[0]}uw.prototype.visitBool=pw,uw.prototype.visitInt=mw,uw.prototype.visitFloat=mw,uw.prototype.visitUtf8=hw,uw.prototype.visitLargeUtf8=hw,uw.prototype.visitBinary=hw,uw.prototype.visitLargeBinary=hw,uw.prototype.visitFixedSizeBinary=mw,uw.prototype.visitDate=mw,uw.prototype.visitTimestamp=mw,uw.prototype.visitTime=mw,uw.prototype.visitDecimal=mw,uw.prototype.visitList=gw,uw.prototype.visitStruct=_w,uw.prototype.visitUnion=fw,uw.prototype.visitInterval=mw,uw.prototype.visitDuration=mw,uw.prototype.visitFixedSizeList=gw,uw.prototype.visitMap=gw;var vw=class extends qx{static throughNode(e){throw Error(`"throughNode" not available in this environment`)}static throughDOM(e,t){throw Error(`"throughDOM" not available in this environment`)}constructor(e){super(),this._position=0,this._started=!1,this._sink=new Yx,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,Mh(e)||(e={autoDestroy:!0,writeLegacyIpcFormat:!1}),this._autoDestroy=typeof e.autoDestroy==`boolean`?e.autoDestroy:!0,this._writeLegacyIpcFormat=typeof e.writeLegacyIpcFormat==`boolean`?e.writeLegacyIpcFormat:!1}toString(e=!1){return this._sink.toString(e)}toUint8Array(e=!1){return this._sink.toUint8Array(e)}writeAll(e){return Nh(e)?e.then(e=>this.writeAll(e)):Fh(e)?Sw(this,e):xw(this,e)}get closed(){return this._sink.closed}[Symbol.asyncIterator](){return this._sink[Symbol.asyncIterator]()}toDOMStream(e){return this._sink.toDOMStream(e)}toNodeStream(e){return this._sink.toNodeStream(e)}close(){return this.reset()._sink.close()}abort(e){return this.reset()._sink.abort(e)}finish(){return this._autoDestroy?this.close():this.reset(this._sink,this._schema),this}reset(e=this._sink,t=null){return e===this._sink||e instanceof Yx?this._sink=e:(this._sink=new Yx,e&&Vh(e)?this.toDOMStream({type:`bytes`}).pipeTo(e):e&&Uh(e)&&this.toNodeStream({objectMode:!1}).pipe(e)),this._started&&this._schema&&this._writeFooter(this._schema),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,(!t||!jS(t,this._schema))&&(t==null?(this._position=0,this._schema=null):(this._started=!0,this._schema=t,this._writeSchema(t))),this}write(e){let t=null;if(this._sink){if(e==null||e instanceof IS&&!(t=e.schema)||e instanceof RS&&!(t=e.schema))return this.finish()&&void 0}else throw Error(`RecordBatchWriter is closed`);if(t&&!jS(t,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,t)}e instanceof RS?e instanceof VS||this._writeRecordBatch(e):e instanceof IS?this.writeAll(e.batches):Ph(e)&&this.writeAll(e)}_writeMessage(e,t=8){let n=t-1,r=aC.encode(e),i=r.byteLength,a=this._writeLegacyIpcFormat?4:8,o=i+a+n&~n,s=o-i-a;return e.headerType===f_.RecordBatch?this._recordBatchBlocks.push(new Wx(o,e.bodyLength,this._position)):e.headerType===f_.DictionaryBatch&&this._dictionaryBlocks.push(new Wx(o,e.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(o-a)),i>0&&this._write(r),this._writePadding(s)}_write(e){if(this._started){let t=$h(e);t&&t.byteLength>0&&(this._sink.write(t),this._position+=t.byteLength)}return this}_writeSchema(e){return this._writeMessage(aC.from(e))}_writeFooter(e){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(VC)}_writePadding(e){return e>0?this._write(new Uint8Array(e)):this}_writeRecordBatch(e){let{byteLength:t,nodes:n,bufferRegions:r,buffers:i}=uw.assemble(e),a=new oC(e.numRows,n,r),o=aC.from(a,t);return this._writeDictionaries(e)._writeMessage(o)._writeBodyBuffers(i)}_writeDictionaryBatch(e,t,n=!1){let{byteLength:r,nodes:i,bufferRegions:a,buffers:o}=uw.assemble(new Mx([e])),s=new oC(e.length,i,a),c=new sC(s,t,n),l=aC.from(c,r);return this._writeMessage(l)._writeBodyBuffers(o)}_writeBodyBuffers(e){let t,n,r;for(let i=-1,a=e.length;++i0&&(this._write(t),(r=(n+7&-8)-n)>0&&this._writePadding(r));return this}_writeDictionaries(e){var t,n;for(let[r,i]of e.dictionaries){let e=(t=i?.data)??[],a=this._seenDictionaries.get(r),o=(n=this._dictionaryDeltaOffsets.get(r))??0;if(!a||a.data[0]!==e[0])for(let[t,n]of e.entries())this._writeDictionaryBatch(n,r,t>0);else if(or.writeAll(e)):Fh(t)?Sw(r,t):xw(r,t)}},bw=class e extends vw{static writeAll(t){let n=new e;return Nh(t)?t.then(e=>n.writeAll(e)):Fh(t)?Sw(n,t):xw(n,t)}constructor(){super(),this._autoDestroy=!0}_writeSchema(e){return this._writeMagic()._writePadding(2)}_writeDictionaryBatch(e,t,n=!1){if(!n&&this._seenDictionaries.has(t))throw Error(`The Arrow File format does not support replacement dictionaries. `);return super._writeDictionaryBatch(e,t,n)}_writeFooter(e){let t=Hx.encode(new Hx(e,hg.V5,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(e)._write(t)._write(Int32Array.of(t.byteLength))._writeMagic()}};function xw(e,t){let n=t;t instanceof IS&&(n=t.batches,e.reset(void 0,t.schema));for(let t of n)e.write(t);return e.finish()}function Sw(e,t){return yh(this,void 0,void 0,function*(){var n,r,i,a,o,s,c;try{for(n=!0,r=wh(t);i=yield r.next(),a=i.done,!a;n=!0){c=i.value,n=!1;let t=c;e.write(t)}}catch(e){o={error:e}}finally{try{!n&&!a&&(s=r.return)&&(yield s.call(r))}finally{if(o)throw o.error}}return e.finish()})}function Cw(e,t=`stream`){return(t===`stream`?yw:bw).writeAll(e).toUint8Array(!0)}var ww=Object.create,Tw=Object.defineProperty,Ew=Object.getOwnPropertyDescriptor,Dw=Object.getOwnPropertyNames,Ow=Object.getPrototypeOf,kw=Object.prototype.hasOwnProperty,Aw=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),jw=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of Dw(t))!kw.call(e,i)&&i!==n&&Tw(e,i,{get:()=>t[i],enumerable:!(r=Ew(t,i))||r.enumerable});return e},Mw=(e,t,n)=>(n=e==null?{}:ww(Ow(e)),jw(t||!e||!e.__esModule?Tw(n,`default`,{value:e,enumerable:!0}):n,e)),Nw=Aw((e,t)=>{t.exports=Worker}),Pw=(e=>(e[e.UNDEFINED=0]=`UNDEFINED`,e[e.AUTOMATIC=1]=`AUTOMATIC`,e[e.READ_ONLY=2]=`READ_ONLY`,e[e.READ_WRITE=3]=`READ_WRITE`,e))(Pw||{}),Fw=(e=>(e[e.IDENTIFIER=0]=`IDENTIFIER`,e[e.NUMERIC_CONSTANT=1]=`NUMERIC_CONSTANT`,e[e.STRING_CONSTANT=2]=`STRING_CONSTANT`,e[e.OPERATOR=3]=`OPERATOR`,e[e.KEYWORD=4]=`KEYWORD`,e[e.COMMENT=5]=`COMMENT`,e))(Fw||{}),Iw=(e=>(e[e.NONE=0]=`NONE`,e[e.DEBUG=1]=`DEBUG`,e[e.INFO=2]=`INFO`,e[e.WARNING=3]=`WARNING`,e[e.ERROR=4]=`ERROR`,e))(Iw||{}),Lw=(e=>(e[e.NONE=0]=`NONE`,e[e.CONNECT=1]=`CONNECT`,e[e.DISCONNECT=2]=`DISCONNECT`,e[e.OPEN=3]=`OPEN`,e[e.QUERY=4]=`QUERY`,e[e.INSTANTIATE=5]=`INSTANTIATE`,e))(Lw||{}),Rw=(e=>(e[e.NONE=0]=`NONE`,e[e.OK=1]=`OK`,e[e.ERROR=2]=`ERROR`,e[e.START=3]=`START`,e[e.RUN=4]=`RUN`,e[e.CAPTURE=5]=`CAPTURE`,e))(Rw||{}),zw=(e=>(e[e.NONE=0]=`NONE`,e[e.WEB_WORKER=1]=`WEB_WORKER`,e[e.NODE_WORKER=2]=`NODE_WORKER`,e[e.BINDINGS=3]=`BINDINGS`,e[e.ASYNC_DUCKDB=4]=`ASYNC_DUCKDB`,e))(zw||{}),Bw=class{log(e){}},Vw=class{constructor(e=2){this.level=e}log(e){e.level>=this.level&&console.log(e)}},Hw=(e=>(e[e.SUCCESS=0]=`SUCCESS`,e))(Hw||{}),Uw=class{constructor(e,t){this._bindings=e,this._conn=t}get bindings(){return this._bindings}async close(){return this._bindings.disconnect(this._conn)}useUnsafe(e){return e(this._bindings,this._conn)}async query(e){this._bindings.logger.log({timestamp:new Date,level:2,origin:4,topic:4,event:4,value:e});let t=await this._bindings.runQuery(this._conn,e),n=KC.from(t);return console.assert(n.isSync(),`Reader is not sync`),console.assert(n.isFile(),`Reader is not file`),new IS(n)}async send(e,t=!1){this._bindings.logger.log({timestamp:new Date,level:2,origin:4,topic:4,event:4,value:e});let n=await this._bindings.startPendingQuery(this._conn,e,t);for(;n==null;)n=await this._bindings.pollPendingQuery(this._conn);let r=new Ww(this._bindings,this._conn,n),i=await KC.from(r);return console.assert(i.isAsync()),console.assert(i.isStream()),i}async cancelSent(){return await this._bindings.cancelPendingQuery(this._conn)}async getTableNames(e){return await this._bindings.getTableNames(this._conn,e)}async prepare(e){let t=await this._bindings.createPrepared(this._conn,e);return new Gw(this._bindings,this._conn,t)}async insertArrowTable(e,t){let n=Cw(e,`stream`);await this.insertArrowFromIPCStream(n,t)}async insertArrowFromIPCStream(e,t){await this._bindings.insertArrowFromIPCStream(this._conn,e,t)}async insertCSVFromPath(e,t){await this._bindings.insertCSVFromPath(this._conn,e,t)}async insertJSONFromPath(e,t){await this._bindings.insertJSONFromPath(this._conn,e,t)}},Ww=class{constructor(e,t,n){this.db=e,this.conn=t,this.header=n,this._first=!0,this._depleted=!1,this._inFlight=null}async next(){if(this._first)return this._first=!1,{done:!1,value:this.header};if(this._depleted)return{done:!0,value:null};let e;return this._inFlight==null?e=await this.db.fetchQueryResults(this.conn):(e=await this._inFlight,this._inFlight=null),this._depleted=e.length==0,this._depleted||(this._inFlight=this.db.fetchQueryResults(this.conn)),{done:this._depleted,value:e}}[Symbol.asyncIterator](){return this}},Gw=class{constructor(e,t,n){this.bindings=e,this.connectionId=t,this.statementId=n}async close(){await this.bindings.closePrepared(this.connectionId,this.statementId)}async query(...e){let t=await this.bindings.runPrepared(this.connectionId,this.statementId,e),n=KC.from(t);return console.assert(n.isSync()),console.assert(n.isFile()),new IS(n)}async send(...e){let t=await this.bindings.sendPrepared(this.connectionId,this.statementId,e),n=new Ww(this.bindings,this.connectionId,t),r=await KC.from(n);return console.assert(r.isAsync()),console.assert(r.isStream()),r}},Kw=(e=>(e.CANCEL_PENDING_QUERY=`CANCEL_PENDING_QUERY`,e.CLOSE_PREPARED=`CLOSE_PREPARED`,e.COLLECT_FILE_STATISTICS=`COLLECT_FILE_STATISTICS`,e.REGISTER_OPFS_FILE_NAME=`REGISTER_OPFS_FILE_NAME`,e.CONNECT=`CONNECT`,e.COPY_FILE_TO_BUFFER=`COPY_FILE_TO_BUFFER`,e.COPY_FILE_TO_PATH=`COPY_FILE_TO_PATH`,e.CREATE_PREPARED=`CREATE_PREPARED`,e.DISCONNECT=`DISCONNECT`,e.DROP_FILE=`DROP_FILE`,e.DROP_FILES=`DROP_FILES`,e.EXPORT_FILE_STATISTICS=`EXPORT_FILE_STATISTICS`,e.FETCH_QUERY_RESULTS=`FETCH_QUERY_RESULTS`,e.FLUSH_FILES=`FLUSH_FILES`,e.GET_FEATURE_FLAGS=`GET_FEATURE_FLAGS`,e.GET_TABLE_NAMES=`GET_TABLE_NAMES`,e.GET_VERSION=`GET_VERSION`,e.GLOB_FILE_INFOS=`GLOB_FILE_INFOS`,e.INSERT_ARROW_FROM_IPC_STREAM=`INSERT_ARROW_FROM_IPC_STREAM`,e.INSERT_CSV_FROM_PATH=`IMPORT_CSV_FROM_PATH`,e.INSERT_JSON_FROM_PATH=`IMPORT_JSON_FROM_PATH`,e.INSTANTIATE=`INSTANTIATE`,e.OPEN=`OPEN`,e.PING=`PING`,e.POLL_PENDING_QUERY=`POLL_PENDING_QUERY`,e.REGISTER_FILE_BUFFER=`REGISTER_FILE_BUFFER`,e.REGISTER_FILE_HANDLE=`REGISTER_FILE_HANDLE`,e.REGISTER_FILE_URL=`REGISTER_FILE_URL`,e.RESET=`RESET`,e.RUN_PREPARED=`RUN_PREPARED`,e.RUN_QUERY=`RUN_QUERY`,e.SEND_PREPARED=`SEND_PREPARED`,e.START_PENDING_QUERY=`START_PENDING_QUERY`,e.TOKENIZE=`TOKENIZE`,e))(Kw||{}),qw=(e=>(e.CONNECTION_INFO=`CONNECTION_INFO`,e.ERROR=`ERROR`,e.FEATURE_FLAGS=`FEATURE_FLAGS`,e.FILE_BUFFER=`FILE_BUFFER`,e.FILE_INFOS=`FILE_INFOS`,e.FILE_SIZE=`FILE_SIZE`,e.FILE_STATISTICS=`FILE_STATISTICS`,e.INSTANTIATE_PROGRESS=`INSTANTIATE_PROGRESS`,e.LOG=`LOG`,e.OK=`OK`,e.PREPARED_STATEMENT_ID=`PREPARED_STATEMENT_ID`,e.QUERY_PLAN=`QUERY_PLAN`,e.QUERY_RESULT=`QUERY_RESULT`,e.QUERY_RESULT_CHUNK=`QUERY_RESULT_CHUNK`,e.QUERY_RESULT_HEADER=`QUERY_RESULT_HEADER`,e.QUERY_RESULT_HEADER_OR_NULL=`QUERY_RESULT_HEADER_OR_NULL`,e.REGISTERED_FILE=`REGISTERED_FILE`,e.SCRIPT_TOKENS=`SCRIPT_TOKENS`,e.SUCCESS=`SUCCESS`,e.TABLE_NAMES=`TABLE_NAMES`,e.VERSION_STRING=`VERSION_STRING`,e))(qw||{}),Jw=class{constructor(e,t){this.promiseResolver=()=>{},this.promiseRejecter=()=>{},this.type=e,this.data=t,this.promise=new Promise((e,t)=>{this.promiseResolver=e,this.promiseRejecter=t})}};function Yw(e){switch(e.typeId){case q.Binary:return{sqlType:`binary`};case q.Bool:return{sqlType:`bool`};case q.Date:return{sqlType:`date`};case q.DateDay:return{sqlType:`date32[d]`};case q.DateMillisecond:return{sqlType:`date64[ms]`};case q.Decimal:{let t=e;return{sqlType:`decimal`,precision:t.precision,scale:t.scale}}case q.Float:return{sqlType:`float`};case q.Float16:return{sqlType:`float16`};case q.Float32:return{sqlType:`float32`};case q.Float64:return{sqlType:`float64`};case q.Int:return{sqlType:`int32`};case q.Int16:return{sqlType:`int16`};case q.Int32:return{sqlType:`int32`};case q.Int64:return{sqlType:`int64`};case q.Uint16:return{sqlType:`uint16`};case q.Uint32:return{sqlType:`uint32`};case q.Uint64:return{sqlType:`uint64`};case q.Uint8:return{sqlType:`uint8`};case q.IntervalDayTime:return{sqlType:`interval[dt]`};case q.IntervalYearMonth:return{sqlType:`interval[m]`};case q.List:return{sqlType:`list`,valueType:Yw(e.valueType)};case q.FixedSizeBinary:return{sqlType:`fixedsizebinary`,byteWidth:e.byteWidth};case q.Null:return{sqlType:`null`};case q.Utf8:return{sqlType:`utf8`};case q.Struct:return{sqlType:`struct`,fields:e.children.map(e=>Xw(e.name,e.type))};case q.Map:{let t=e;return{sqlType:`map`,keyType:Yw(t.keyType),valueType:Yw(t.valueType)}}case q.Time:return{sqlType:`time[s]`};case q.TimeMicrosecond:return{sqlType:`time[us]`};case q.TimeMillisecond:return{sqlType:`time[ms]`};case q.TimeNanosecond:return{sqlType:`time[ns]`};case q.TimeSecond:return{sqlType:`time[s]`};case q.Timestamp:return{sqlType:`timestamp`,timezone:e.timezone||void 0};case q.TimestampSecond:return{sqlType:`timestamp[s]`,timezone:e.timezone||void 0};case q.TimestampMicrosecond:return{sqlType:`timestamp[us]`,timezone:e.timezone||void 0};case q.TimestampNanosecond:return{sqlType:`timestamp[ns]`,timezone:e.timezone||void 0};case q.TimestampMillisecond:return{sqlType:`timestamp[ms]`,timezone:e.timezone||void 0}}throw Error(`unsupported arrow type: ${e.toString()}`)}function Xw(e,t){let n=Yw(t);return n.name=e,n}var Zw=new TextEncoder,Qw=class{constructor(e,t=null){this._onInstantiationProgress=[],this._worker=null,this._workerShutdownPromise=null,this._workerShutdownResolver=()=>{},this._nextMessageId=0,this._pendingRequests=new Map,this._logger=e,this._onMessageHandler=this.onMessage.bind(this),this._onErrorHandler=this.onError.bind(this),this._onCloseHandler=this.onClose.bind(this),t!=null&&this.attach(t)}get logger(){return this._logger}attach(e){this._worker=e,this._worker.addEventListener(`message`,this._onMessageHandler),this._worker.addEventListener(`error`,this._onErrorHandler),this._worker.addEventListener(`close`,this._onCloseHandler),this._workerShutdownPromise=new Promise((e,t)=>{this._workerShutdownResolver=e})}detach(){this._worker&&(this._worker.removeEventListener(`message`,this._onMessageHandler),this._worker.removeEventListener(`error`,this._onErrorHandler),this._worker.removeEventListener(`close`,this._onCloseHandler),this._worker=null,this._workerShutdownResolver(null),this._workerShutdownPromise=null,this._workerShutdownResolver=()=>{})}async terminate(){this._worker&&(this._worker.terminate(),this._worker=null,this._workerShutdownPromise=null,this._workerShutdownResolver=()=>{})}async postTask(e,t=[]){if(!this._worker){console.error(`cannot send a message since the worker is not set!`);return}let n=this._nextMessageId++;return this._pendingRequests.set(n,e),this._worker.postMessage({messageId:n,type:e.type,data:e.data},t),await e.promise}onMessage(e){var t;let n=e.data;switch(n.type){case`LOG`:this._logger.log(n.data);return;case`INSTANTIATE_PROGRESS`:for(let e of this._onInstantiationProgress)e(n.data);return}let r=this._pendingRequests.get(n.requestId);if(!r){console.warn(`unassociated response: [${n.requestId}, ${n.type.toString()}]`);return}if(this._pendingRequests.delete(n.requestId),n.type==`ERROR`){let e=Error(n.data.message);e.name=n.data.name,(t=Object.getOwnPropertyDescriptor(e,`stack`))!=null&&t.writable&&(e.stack=n.data.stack),r.promiseRejecter(e);return}switch(r.type){case`CLOSE_PREPARED`:case`COLLECT_FILE_STATISTICS`:case`REGISTER_OPFS_FILE_NAME`:case`COPY_FILE_TO_PATH`:case`DISCONNECT`:case`DROP_FILE`:case`DROP_FILES`:case`FLUSH_FILES`:case`INSERT_ARROW_FROM_IPC_STREAM`:case`IMPORT_CSV_FROM_PATH`:case`IMPORT_JSON_FROM_PATH`:case`OPEN`:case`PING`:case`REGISTER_FILE_BUFFER`:case`REGISTER_FILE_HANDLE`:case`REGISTER_FILE_URL`:case`RESET`:if(n.type==`OK`){r.promiseResolver(n.data);return}break;case`INSTANTIATE`:if(this._onInstantiationProgress=[],n.type==`OK`){r.promiseResolver(n.data);return}break;case`GLOB_FILE_INFOS`:if(n.type==`FILE_INFOS`){r.promiseResolver(n.data);return}break;case`GET_VERSION`:if(n.type==`VERSION_STRING`){r.promiseResolver(n.data);return}break;case`GET_FEATURE_FLAGS`:if(n.type==`FEATURE_FLAGS`){r.promiseResolver(n.data);return}break;case`GET_TABLE_NAMES`:if(n.type==`TABLE_NAMES`){r.promiseResolver(n.data);return}break;case`TOKENIZE`:if(n.type==`SCRIPT_TOKENS`){r.promiseResolver(n.data);return}break;case`COPY_FILE_TO_BUFFER`:if(n.type==`FILE_BUFFER`){r.promiseResolver(n.data);return}break;case`EXPORT_FILE_STATISTICS`:if(n.type==`FILE_STATISTICS`){r.promiseResolver(n.data);return}break;case`CONNECT`:if(n.type==`CONNECTION_INFO`){r.promiseResolver(n.data);return}break;case`RUN_PREPARED`:case`RUN_QUERY`:if(n.type==`QUERY_RESULT`){r.promiseResolver(n.data);return}break;case`SEND_PREPARED`:if(n.type==`QUERY_RESULT_HEADER`){r.promiseResolver(n.data);return}break;case`START_PENDING_QUERY`:if(n.type==`QUERY_RESULT_HEADER_OR_NULL`){r.promiseResolver(n.data);return}break;case`POLL_PENDING_QUERY`:if(n.type==`QUERY_RESULT_HEADER_OR_NULL`){r.promiseResolver(n.data);return}break;case`CANCEL_PENDING_QUERY`:if(this._onInstantiationProgress=[],n.type==`SUCCESS`){r.promiseResolver(n.data);return}break;case`FETCH_QUERY_RESULTS`:if(n.type==`QUERY_RESULT_CHUNK`){r.promiseResolver(n.data);return}break;case`CREATE_PREPARED`:if(n.type==`PREPARED_STATEMENT_ID`){r.promiseResolver(n.data);return}break}r.promiseRejecter(Error(`unexpected response type: ${n.type.toString()}`))}onError(e){console.error(e),console.error(`error in duckdb worker: ${e.message}`),this._pendingRequests.clear()}onClose(){if(this._workerShutdownResolver(null),this._pendingRequests.size!=0){console.warn(`worker terminated with ${this._pendingRequests.size} pending requests`);return}this._pendingRequests.clear()}async reset(){let e=new Jw(`RESET`,null);return await this.postTask(e)}async ping(){let e=new Jw(`PING`,null);await this.postTask(e)}async dropFile(e){let t=new Jw(`DROP_FILE`,e);return await this.postTask(t)}async dropFiles(){let e=new Jw(`DROP_FILES`,null);return await this.postTask(e)}async flushFiles(){let e=new Jw(`FLUSH_FILES`,null);return await this.postTask(e)}async instantiate(e,t=null,n=e=>{}){this._onInstantiationProgress.push(n);let r=new Jw(`INSTANTIATE`,[e,t]);return await this.postTask(r)}async getVersion(){let e=new Jw(`GET_VERSION`,null);return await this.postTask(e)}async getFeatureFlags(){let e=new Jw(`GET_FEATURE_FLAGS`,null);return await this.postTask(e)}async open(e){let t=new Jw(`OPEN`,e);await this.postTask(t)}async tokenize(e){let t=new Jw(`TOKENIZE`,e);return await this.postTask(t)}async connectInternal(){let e=new Jw(`CONNECT`,null);return await this.postTask(e)}async connect(){let e=await this.connectInternal();return new Uw(this,e)}async disconnect(e){let t=new Jw(`DISCONNECT`,e);await this.postTask(t)}async runQuery(e,t){let n=new Jw(`RUN_QUERY`,[e,t]);return await this.postTask(n)}async startPendingQuery(e,t,n=!1){let r=new Jw(`START_PENDING_QUERY`,[e,t,n]);return await this.postTask(r)}async pollPendingQuery(e){let t=new Jw(`POLL_PENDING_QUERY`,e);return await this.postTask(t)}async cancelPendingQuery(e){let t=new Jw(`CANCEL_PENDING_QUERY`,e);return await this.postTask(t)}async fetchQueryResults(e){let t=new Jw(`FETCH_QUERY_RESULTS`,e);return await this.postTask(t)}async getTableNames(e,t){let n=new Jw(`GET_TABLE_NAMES`,[e,t]);return await this.postTask(n)}async createPrepared(e,t){let n=new Jw(`CREATE_PREPARED`,[e,t]);return await this.postTask(n)}async closePrepared(e,t){let n=new Jw(`CLOSE_PREPARED`,[e,t]);await this.postTask(n)}async runPrepared(e,t,n){let r=new Jw(`RUN_PREPARED`,[e,t,n]);return await this.postTask(r)}async sendPrepared(e,t,n){let r=new Jw(`SEND_PREPARED`,[e,t,n]);return await this.postTask(r)}async globFiles(e){let t=new Jw(`GLOB_FILE_INFOS`,e);return await this.postTask(t)}async registerFileText(e,t){let n=Zw.encode(t);await this.registerFileBuffer(e,n)}async registerFileURL(e,t,n,r){t===void 0&&(t=e);let i=new Jw(`REGISTER_FILE_URL`,[e,t,n,r]);await this.postTask(i)}async registerEmptyFileBuffer(e){}async registerFileBuffer(e,t){let n=new Jw(`REGISTER_FILE_BUFFER`,[e,t]);await this.postTask(n,[t.buffer])}async registerFileHandle(e,t,n,r){let i=new Jw(`REGISTER_FILE_HANDLE`,[e,t,n,r]);await this.postTask(i,[])}async registerOPFSFileName(e){let t=new Jw(`REGISTER_OPFS_FILE_NAME`,[e]);await this.postTask(t,[])}async collectFileStatistics(e,t){let n=new Jw(`COLLECT_FILE_STATISTICS`,[e,t]);await this.postTask(n,[])}async exportFileStatistics(e){let t=new Jw(`EXPORT_FILE_STATISTICS`,e);return await this.postTask(t,[])}async copyFileToBuffer(e){let t=new Jw(`COPY_FILE_TO_BUFFER`,e);return await this.postTask(t)}async copyFileToPath(e,t){let n=new Jw(`COPY_FILE_TO_PATH`,[e,t]);await this.postTask(n)}async insertArrowFromIPCStream(e,t,n){if(t.length==0)return;let r=new Jw(`INSERT_ARROW_FROM_IPC_STREAM`,[e,t,n]);await this.postTask(r,[t.buffer])}async insertCSVFromPath(e,t,n){if(n.columns!==void 0){let e=[];for(let t in n.columns){let r=n.columns[t];e.push(Xw(t,r))}n.columnsFlat=e,delete n.columns}let r=new Jw(`IMPORT_CSV_FROM_PATH`,[e,t,n]);await this.postTask(r)}async insertJSONFromPath(e,t,n){if(n.columns!==void 0){let e=[];for(let t in n.columns){let r=n.columns[t];e.push(Xw(t,r))}n.columnsFlat=e,delete n.columns}let r=new Jw(`IMPORT_JSON_FROM_PATH`,[e,t,n]);await this.postTask(r)}};function $w(){let e=new TextDecoder;return t=>(typeof SharedArrayBuffer<`u`&&t.buffer instanceof SharedArrayBuffer&&(t=new Uint8Array(t)),e.decode(t))}var eT=$w(),tT=(e=>(e[e.BUFFER=0]=`BUFFER`,e[e.NODE_FS=1]=`NODE_FS`,e[e.BROWSER_FILEREADER=2]=`BROWSER_FILEREADER`,e[e.BROWSER_FSACCESS=3]=`BROWSER_FSACCESS`,e[e.HTTP=4]=`HTTP`,e[e.S3=5]=`S3`,e))(tT||{}),nT=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,3,1,0,1,10,14,1,12,0,65,0,65,0,65,0,252,10,0,0,11])),rT=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,8,1,6,0,6,64,25,11,11])),iT=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11])),aT=()=>(async e=>{try{return typeof MessageChannel<`u`&&new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(e)}catch{return!1}})(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11])),oT={name:`@duckdb/duckdb-wasm`,version:`1.29.1-dev68.0`,description:`DuckDB powered by WebAssembly`,license:`MIT`,repository:{type:`git`,url:`https://github.com/duckdb/duckdb-wasm.git`},keywords:[`sql`,`duckdb`,`relational`,`database`,`data`,`query`,`wasm`,`analytics`,`olap`,`arrow`,`parquet`,`json`,`csv`],dependencies:{"apache-arrow":`^17.0.0`},devDependencies:{"@types/emscripten":`^1.39.10`,"@types/jasmine":`^5.1.4`,"@typescript-eslint/eslint-plugin":`^6.21.0`,"@typescript-eslint/parser":`^6.21.0`,esbuild:`^0.20.2`,eslint:`^8.57.0`,"eslint-plugin-jasmine":`^4.1.3`,"eslint-plugin-react":`^7.34.0`,"fast-glob":`^3.3.2`,jasmine:`^5.1.0`,"jasmine-core":`^5.1.2`,"jasmine-spec-reporter":`^7.0.0`,"js-sha256":`^0.11.0`,karma:`^6.4.2`,"karma-chrome-launcher":`^3.2.0`,"karma-coverage":`^2.2.1`,"karma-firefox-launcher":`^2.1.3`,"karma-jasmine":`^5.1.0`,"karma-jasmine-html-reporter":`^2.1.0`,"karma-sourcemap-loader":`^0.4.0`,"karma-spec-reporter":`^0.0.36`,"make-dir":`^4.0.0`,nyc:`^15.1.0`,prettier:`^3.2.5`,puppeteer:`^22.8.0`,rimraf:`^5.0.5`,s3rver:`^3.7.1`,typedoc:`^0.25.13`,typescript:`^5.3.3`,"wasm-feature-detect":`^1.6.1`,"web-worker":`^1.2.0`},scripts:{"build:debug":`node bundle.mjs debug && tsc --emitDeclarationOnly`,"build:release":`node bundle.mjs release && tsc --emitDeclarationOnly`,docs:`typedoc`,report:`node ./coverage.mjs`,"test:node":`node --enable-source-maps ../../node_modules/jasmine/bin/jasmine ./dist/tests-node.cjs`,"test:node:debug":`node --inspect-brk --enable-source-maps ../../node_modules/jasmine/bin/jasmine ./dist/tests-node.cjs`,"test:node:coverage":`nyc -r json --report-dir ./coverage/node node ../../node_modules/jasmine/bin/jasmine ./dist/tests-node.cjs`,"test:firefox":`karma start ./karma/tests-firefox.cjs`,"test:chrome":`karma start ./karma/tests-chrome.cjs`,"test:chrome:eh":`karma start ./karma/tests-chrome-eh.cjs`,"test:chrome:coverage":`karma start ./karma/tests-chrome-coverage.cjs`,"test:browser":`karma start ./karma/tests-all.cjs`,"test:browser:debug":`karma start ./karma/tests-debug.cjs`,test:`npm run test:chrome && npm run test:node`,"test:coverage":`npm run test:chrome:coverage && npm run test:node:coverage && npm run report`,lint:`eslint src test`},files:[`dist`,`!dist/tests-*`,`!dist/duckdb-browser-mvp.worker.js.map`,`!dist/types/test`],main:`dist/duckdb-browser.cjs`,module:`dist/duckdb-browser.mjs`,types:`dist/duckdb-browser.d.ts`,jsdelivr:`dist/duckdb-browser.cjs`,unpkg:`dist/duckdb-browser.mjs`,sideEffects:!1,browser:{fs:!1,path:!1,perf_hooks:!1,os:!1,worker_threads:!1},exports:{"./dist/duckdb-mvp.wasm":`./dist/duckdb-mvp.wasm`,"./dist/duckdb-eh.wasm":`./dist/duckdb-eh.wasm`,"./dist/duckdb-coi.wasm":`./dist/duckdb-coi.wasm`,"./dist/duckdb-browser":`./dist/duckdb-browser.mjs`,"./dist/duckdb-browser.cjs":`./dist/duckdb-browser.cjs`,"./dist/duckdb-browser.mjs":`./dist/duckdb-browser.mjs`,"./dist/duckdb-browser-coi.pthread.worker.js":`./dist/duckdb-browser-coi.pthread.worker.js`,"./dist/duckdb-browser-coi.worker.js":`./dist/duckdb-browser-coi.worker.js`,"./dist/duckdb-browser-eh.worker.js":`./dist/duckdb-browser-eh.worker.js`,"./dist/duckdb-browser-mvp.worker.js":`./dist/duckdb-browser-mvp.worker.js`,"./dist/duckdb-node":`./dist/duckdb-node.cjs`,"./dist/duckdb-node.cjs":`./dist/duckdb-node.cjs`,"./dist/duckdb-node-blocking":`./dist/duckdb-node-blocking.cjs`,"./dist/duckdb-node-blocking.cjs":`./dist/duckdb-node-blocking.cjs`,"./dist/duckdb-node-eh.worker.cjs":`./dist/duckdb-node-eh.worker.cjs`,"./dist/duckdb-node-mvp.worker.cjs":`./dist/duckdb-node-mvp.worker.cjs`,"./blocking":{node:{types:`./dist/duckdb-node-blocking.d.ts`,require:`./dist/duckdb-node-blocking.cjs`,import:`./dist/duckdb-node-blocking.cjs`},types:`./dist/duckdb-node-blocking.d.ts`,import:`./dist/duckdb-node-blocking.mjs`,require:`./dist/duckdb-node-blocking.cjs`},".":{browser:{types:`./dist/duckdb-browser.d.ts`,import:`./dist/duckdb-browser.mjs`,require:`./dist/duckdb-browser.cjs`},node:{types:`./dist/duckdb-node.d.ts`,import:`./dist/duckdb-node.cjs`,require:`./dist/duckdb-node.cjs`},types:`./dist/duckdb-browser.d.ts`,import:`./dist/duckdb-browser.mjs`,require:`./dist/duckdb-browser.cjs`}}},sT=oT.name,cT=oT.version,lT=oT.version.split(`.`),uT=lT[0],dT=lT[1],fT=lT[2],pT=()=>typeof navigator>`u`,mT=()=>pT()?`node`:navigator.userAgent,hT=()=>mT().includes(`Firefox`),gT=()=>/^((?!chrome|android).)*safari/i.test(mT()),_T=null,vT=null,yT=null,bT=null,xT=null;async function ST(){return _T??=typeof BigInt64Array<`u`,vT??=await rT(),yT??=await aT(),bT??=await iT(),xT??=await nT(),{bigInt64Array:_T,crossOriginIsolated:pT()||globalThis.crossOriginIsolated||!1,wasmExceptions:vT,wasmSIMD:bT,wasmThreads:yT,wasmBulkMemory:xT}}async function CT(e){let t=await ST();if(t.wasmExceptions){if(t.wasmSIMD&&t.wasmThreads&&t.crossOriginIsolated&&e.coi)return{mainModule:e.coi.mainModule,mainWorker:e.coi.mainWorker,pthreadWorker:e.coi.pthreadWorker};if(e.eh)return{mainModule:e.eh.mainModule,mainWorker:e.eh.mainWorker,pthreadWorker:null}}return{mainModule:e.mvp.mainModule,mainWorker:e.mvp.mainWorker,pthreadWorker:null}}var wT=Mw(Nw());const TT=Symbol.for(`constructDateFrom`),ET={},DT={};function OT(e,t){try{let n=ET[e]||=new Intl.DateTimeFormat(`en-GB`,{timeZone:e,hour:`numeric`,timeZoneName:`longOffset`}).format,r=n(t).split(`GMT`)[1]||``;return r in DT?DT[r]:AT(r,r.split(`:`))}catch{if(e in DT)return DT[e];let t=e?.match(kT);return t?AT(e,t.slice(1)):NaN}}const kT=/([+-]\d\d):?(\d\d)?/;function AT(e,t){let n=+t[0],r=+(t[1]||0);return DT[e]=n>0?n*60+r:n*60-r}var jT=class e extends Date{constructor(...e){super(),e.length>1&&typeof e[e.length-1]==`string`&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(OT(this.timeZone,this))?this.setTime(NaN):e.length?typeof e[0]==`number`&&(e.length===1||e.length===2&&typeof e[1]!=`number`)?this.setTime(e[0]):typeof e[0]==`string`?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),FT(this,NaN),NT(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new e(...n,t):new e(Date.now(),t)}withTimeZone(t){return new e(+this,t)}getTimezoneOffset(){return-OT(this.timeZone,this)}setTime(e){return Date.prototype.setTime.apply(this,arguments),NT(this),+this}[Symbol.for(`constructDateFrom`)](t){return new e(+new Date(t),this.timeZone)}};const MT=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!MT.test(e))return;let t=e.replace(MT,`$1UTC`);jT.prototype[t]&&(e.startsWith(`get`)?jT.prototype[e]=function(){return this.internal[t]()}:(jT.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),PT(this),+this},jT.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),NT(this),+this}))});function NT(e){e.internal.setTime(+e),e.internal.setUTCMinutes(e.internal.getUTCMinutes()-e.getTimezoneOffset())}function PT(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),FT(e)}function FT(e){let t=OT(e.timeZone,e),n=new Date(+e);n.setUTCHours(n.getUTCHours()-1);let r=-new Date(+e).getTimezoneOffset(),i=-new Date(+n).getTimezoneOffset(),a=r-i,o=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();a&&o&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+a);let s=r-t;s&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+s);let c=OT(e.timeZone,e),l=-new Date(+e).getTimezoneOffset(),u=l-c,d=c!==t,f=u-s;if(d&&f){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+f);let t=OT(e.timeZone,e),n=c-t;n&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+n),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+n))}}var IT=class e extends jT{static tz(t,...n){return n.length?new e(...n,t):new e(Date.now(),t)}toISOString(){let[e,t,n]=this.tzComponents(),r=`${e}${t}:${n}`;return this.internal.toISOString().slice(0,-1)+r}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){let[e,t,n,r]=this.internal.toUTCString().split(` `);return`${e?.slice(0,-1)} ${n} ${t} ${r}`}toTimeString(){let e=this.internal.toUTCString().split(` `)[4],[t,n,r]=this.tzComponents();return`${e} GMT${t}${n}${r} (${LT(this.timeZone,this)})`}toLocaleString(e,t){return Date.prototype.toLocaleString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleDateString(e,t){return Date.prototype.toLocaleDateString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleTimeString(e,t){return Date.prototype.toLocaleTimeString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}tzComponents(){let e=this.getTimezoneOffset(),t=e>0?`-`:`+`,n=String(Math.floor(Math.abs(e)/60)).padStart(2,`0`),r=String(Math.abs(e)%60).padStart(2,`0`);return[t,n,r]}withTimeZone(t){return new e(+this,t)}[Symbol.for(`constructDateFrom`)](t){return new e(+new Date(t),this.timeZone)}};function LT(e,t){return new Intl.DateTimeFormat(`en-GB`,{timeZone:e,timeZoneName:`long`}).format(t).slice(12)}const RT=new TextDecoder(`utf-8`),zT=e=>RT.decode(e),BT=new TextEncoder,VT=e=>BT.encode(e),HT=e=>typeof e==`function`,UT=e=>e!=null&&Object(e)===e,WT=e=>UT(e)&&HT(e.then),GT=e=>UT(e)&&HT(e[Symbol.iterator]),KT=e=>UT(e)&&HT(e[Symbol.asyncIterator]),qT=e=>UT(e)&&`done`in e&&`value`in e,JT=e=>UT(e)&&HT(e.clear)&&HT(e.bytes)&&HT(e.position)&&HT(e.setPosition)&&HT(e.capacity)&&HT(e.getBufferIdentifier)&&HT(e.createLong);var YT={};pn(YT,{compareArrayLike:()=>PE,joinUint8Arrays:()=>$T,memcpy:()=>QT,rebaseValueOffsets:()=>NE,toArrayBufferView:()=>eE,toArrayBufferViewAsyncIterator:()=>CE,toArrayBufferViewIterator:()=>pE,toBigInt64Array:()=>iE,toBigUint64Array:()=>cE,toFloat32Array:()=>lE,toFloat32ArrayAsyncIterator:()=>AE,toFloat32ArrayIterator:()=>bE,toFloat64Array:()=>uE,toFloat64ArrayAsyncIterator:()=>jE,toFloat64ArrayIterator:()=>xE,toInt16Array:()=>nE,toInt16ArrayAsyncIterator:()=>TE,toInt16ArrayIterator:()=>hE,toInt32Array:()=>rE,toInt32ArrayAsyncIterator:()=>EE,toInt32ArrayIterator:()=>gE,toInt8Array:()=>tE,toInt8ArrayAsyncIterator:()=>wE,toInt8ArrayIterator:()=>mE,toUint16Array:()=>oE,toUint16ArrayAsyncIterator:()=>OE,toUint16ArrayIterator:()=>vE,toUint32Array:()=>sE,toUint32ArrayAsyncIterator:()=>kE,toUint32ArrayIterator:()=>yE,toUint8Array:()=>aE,toUint8ArrayAsyncIterator:()=>DE,toUint8ArrayIterator:()=>_E,toUint8ClampedArray:()=>dE,toUint8ClampedArrayAsyncIterator:()=>ME,toUint8ClampedArrayIterator:()=>SE});const XT=typeof SharedArrayBuffer<`u`?SharedArrayBuffer:ArrayBuffer;function ZT(e){let t=e[0]?[e[0]]:[],n,r,i,a;for(let o,s,c=0,l=0,u=e.length;++ce+t.byteLength,0),i,a,o,s=0,c=-1,l=Math.min(t||1/0,r);for(let e=n.length;++ceE(Int8Array,e),nE=e=>eE(Int16Array,e),rE=e=>eE(Int32Array,e),iE=e=>eE(BigInt64Array,e),aE=e=>eE(Uint8Array,e),oE=e=>eE(Uint16Array,e),sE=e=>eE(Uint32Array,e),cE=e=>eE(BigUint64Array,e),lE=e=>eE(Float32Array,e),uE=e=>eE(Float64Array,e),dE=e=>eE(Uint8ClampedArray,e),fE=e=>(e.next(),e);function*pE(e,t){let n=function*(e){yield e},r=typeof t==`string`||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof XT?n(t):GT(t)?t:n(t);return yield*fE(function*(t){let n=null;do n=t.next(yield eE(e,n));while(!n.done)}(r[Symbol.iterator]())),new e}const mE=e=>pE(Int8Array,e),hE=e=>pE(Int16Array,e),gE=e=>pE(Int32Array,e),_E=e=>pE(Uint8Array,e),vE=e=>pE(Uint16Array,e),yE=e=>pE(Uint32Array,e),bE=e=>pE(Float32Array,e),xE=e=>pE(Float64Array,e),SE=e=>pE(Uint8ClampedArray,e);function CE(e,t){return Sh(this,arguments,function*(){if(WT(t))return yield xh(yield xh(yield*Ch(wh(CE(e,yield xh(t))))));let n=function(e){return Sh(this,arguments,function*(){yield yield xh(yield xh(e))})},r=function(e){return Sh(this,arguments,function*(){yield xh(yield*Ch(wh(fE(function*(e){let t=null;do t=e.next(yield t?.value);while(!t.done)}(e[Symbol.iterator]())))))})},i=typeof t==`string`||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof XT?n(t):GT(t)?r(t):KT(t)?t:n(t);return yield xh(yield*Ch(wh(fE(function(t){return Sh(this,arguments,function*(){let n=null;do n=yield xh(t.next(yield yield xh(eE(e,n))));while(!n.done)})}(i[Symbol.asyncIterator]()))))),yield xh(new e)})}const wE=e=>CE(Int8Array,e),TE=e=>CE(Int16Array,e),EE=e=>CE(Int32Array,e),DE=e=>CE(Uint8Array,e),OE=e=>CE(Uint16Array,e),kE=e=>CE(Uint32Array,e),AE=e=>CE(Float32Array,e),jE=e=>CE(Float64Array,e),ME=e=>CE(Uint8ClampedArray,e);function NE(e,t,n){if(e!==0){n=n.slice(0,t);for(let t=-1,r=n.length;++t0)do if(e[n]!==t[n])return!1;while(++nUE});const HE=void 0;function UE(e){if(e===null)return`null`;if(e===HE)return`undefined`;switch(typeof e){case`number`:return`${e}`;case`bigint`:return`${e}`;case`string`:return`"${e}"`}return typeof e[Symbol.toPrimitive]==`function`?e[Symbol.toPrimitive](`string`):ArrayBuffer.isView(e)?e instanceof BigInt64Array||e instanceof BigUint64Array?`[${[...e].map(e=>UE(e))}]`:`[${e}]`:ArrayBuffer.isView(e)?`[${e}]`:JSON.stringify(e,(e,t)=>typeof t==`bigint`?`${t}`:t)}function WE(e){if(typeof e==`bigint`&&(e<-(2**53-1)||e>2**53-1))throw TypeError(`${e} is not safe to convert to a number.`);return Number(e)}function GE(e,t){return WE(e/t)+WE(e%t)/WE(t)}var KE={};pn(KE,{BN:()=>iD,bigNumToBigInt:()=>nD,bigNumToNumber:()=>eD,bigNumToString:()=>tD,isArrowBigNumSymbol:()=>qE});const qE=Symbol.for(`isArrowBigNum`);function JE(e,...t){return t.length===0?Object.setPrototypeOf(eE(this.TypedArray,e),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(e,...t),this.constructor.prototype)}JE.prototype[qE]=!0,JE.prototype.toJSON=function(){return`"${tD(this)}"`},JE.prototype.valueOf=function(e){return eD(this,e)},JE.prototype.toString=function(){return tD(this)},JE.prototype[Symbol.toPrimitive]=function(e=`default`){switch(e){case`number`:return eD(this);case`string`:return tD(this);case`default`:return nD(this)}return tD(this)};function YE(...e){return JE.apply(this,e)}function XE(...e){return JE.apply(this,e)}function ZE(...e){return JE.apply(this,e)}Object.setPrototypeOf(YE.prototype,Object.create(Int32Array.prototype)),Object.setPrototypeOf(XE.prototype,Object.create(Uint32Array.prototype)),Object.setPrototypeOf(ZE.prototype,Object.create(Uint32Array.prototype)),Object.assign(YE.prototype,JE.prototype,{constructor:YE,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array}),Object.assign(XE.prototype,JE.prototype,{constructor:XE,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array}),Object.assign(ZE.prototype,JE.prototype,{constructor:ZE,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});const QE=BigInt(4294967296)*BigInt(4294967296),$E=QE-BigInt(1);function eD(e,t){let{buffer:n,byteOffset:r,byteLength:i,signed:a}=e,o=new BigUint64Array(n,r,i/8),s=a&&o.at(-1)&BigInt(1)<0){let e=BigInt(`1`.padEnd(t+1,`0`)),n=c/e,r=s?-(c%e):c%e,i=WE(n),a=`${r}`.padStart(t,`0`),o=s&&i===0?`-`:``;return+`${o}${i}.${a}`}return WE(c)}function tD(e){if(e.byteLength===8){let t=new e.BigIntArray(e.buffer,e.byteOffset,1);return`${t[0]}`}if(!e.signed)return rD(e);let t=new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2),n=new Int16Array([t.at(-1)])[0];if(n>=0)return rD(e);t=t.slice();let r=1;for(let e=0;e(e.children=null,e.ArrayType=Array,e.OffsetArrayType=Int32Array,e[Symbol.toStringTag]=`DataType`))(DD.prototype);var OD=class extends DD{constructor(){super(J.Null)}toString(){return`Null`}};oD=Symbol.toStringTag,OD[oD]=(e=>e[Symbol.toStringTag]=`Null`)(OD.prototype);var kD=class extends DD{constructor(e,t){super(J.Int),this.isSigned=e,this.bitWidth=t}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:return this.isSigned?Int32Array:Uint32Array;case 64:return this.isSigned?BigInt64Array:BigUint64Array}throw Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?`I`:`Ui`}nt${this.bitWidth}`}};sD=Symbol.toStringTag,kD[sD]=(e=>(e.isSigned=null,e.bitWidth=null,e[Symbol.toStringTag]=`Int`))(kD.prototype);var AD=class extends kD{constructor(){super(!0,8)}get ArrayType(){return Int8Array}},jD=class extends kD{constructor(){super(!0,16)}get ArrayType(){return Int16Array}},MD=class extends kD{constructor(){super(!0,32)}get ArrayType(){return Int32Array}},ND=class extends kD{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}},PD=class extends kD{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}},FD=class extends kD{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}},ID=class extends kD{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}},LD=class extends kD{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}};Object.defineProperty(AD.prototype,`ArrayType`,{value:Int8Array}),Object.defineProperty(jD.prototype,`ArrayType`,{value:Int16Array}),Object.defineProperty(MD.prototype,`ArrayType`,{value:Int32Array}),Object.defineProperty(ND.prototype,`ArrayType`,{value:BigInt64Array}),Object.defineProperty(PD.prototype,`ArrayType`,{value:Uint8Array}),Object.defineProperty(FD.prototype,`ArrayType`,{value:Uint16Array}),Object.defineProperty(ID.prototype,`ArrayType`,{value:Uint32Array}),Object.defineProperty(LD.prototype,`ArrayType`,{value:BigUint64Array});var RD=class extends DD{constructor(e){super(J.Float),this.precision=e}get ArrayType(){switch(this.precision){case IE.HALF:return Uint16Array;case IE.SINGLE:return Float32Array;case IE.DOUBLE:return Float64Array}throw Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};cD=Symbol.toStringTag,RD[cD]=(e=>(e.precision=null,e[Symbol.toStringTag]=`Float`))(RD.prototype);var zD=class extends RD{constructor(){super(IE.HALF)}},BD=class extends RD{constructor(){super(IE.SINGLE)}},VD=class extends RD{constructor(){super(IE.DOUBLE)}};Object.defineProperty(zD.prototype,`ArrayType`,{value:Uint16Array}),Object.defineProperty(BD.prototype,`ArrayType`,{value:Float32Array}),Object.defineProperty(VD.prototype,`ArrayType`,{value:Float64Array});var HD=class extends DD{constructor(){super(J.Binary)}toString(){return`Binary`}};lD=Symbol.toStringTag,HD[lD]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`Binary`))(HD.prototype);var UD=class extends DD{constructor(){super(J.LargeBinary)}toString(){return`LargeBinary`}};uD=Symbol.toStringTag,UD[uD]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]=`LargeBinary`))(UD.prototype);var WD=class extends DD{constructor(){super(J.Utf8)}toString(){return`Utf8`}};dD=Symbol.toStringTag,WD[dD]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`Utf8`))(WD.prototype);var GD=class extends DD{constructor(){super(J.LargeUtf8)}toString(){return`LargeUtf8`}};fD=Symbol.toStringTag,GD[fD]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]=`LargeUtf8`))(GD.prototype);var KD=class extends DD{constructor(){super(J.Bool)}toString(){return`Bool`}};pD=Symbol.toStringTag,KD[pD]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`Bool`))(KD.prototype);var qD=class extends DD{constructor(e,t,n=128){super(J.Decimal),this.scale=e,this.precision=t,this.bitWidth=n}toString(){return`Decimal[${this.precision}e${this.scale>0?`+`:``}${this.scale}]`}};mD=Symbol.toStringTag,qD[mD]=(e=>(e.scale=null,e.precision=null,e.ArrayType=Uint32Array,e[Symbol.toStringTag]=`Decimal`))(qD.prototype);var JD=class extends DD{constructor(e){super(J.Date),this.unit=e}toString(){return`Date${(this.unit+1)*32}<${LE[this.unit]}>`}get ArrayType(){return this.unit===LE.DAY?Int32Array:BigInt64Array}};hD=Symbol.toStringTag,JD[hD]=(e=>(e.unit=null,e[Symbol.toStringTag]=`Date`))(JD.prototype);var YD=class extends DD{constructor(e,t){super(J.Time),this.unit=e,this.bitWidth=t}toString(){return`Time${this.bitWidth}<${RE[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}};gD=Symbol.toStringTag,YD[gD]=(e=>(e.unit=null,e.bitWidth=null,e[Symbol.toStringTag]=`Time`))(YD.prototype);var XD=class extends DD{constructor(e,t){super(J.Timestamp),this.unit=e,this.timezone=t}toString(){return`Timestamp<${RE[this.unit]}${this.timezone?`, ${this.timezone}`:``}>`}};_D=Symbol.toStringTag,XD[_D]=(e=>(e.unit=null,e.timezone=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]=`Timestamp`))(XD.prototype);var ZD=class extends DD{constructor(e){super(J.Interval),this.unit=e}toString(){return`Interval<${zE[this.unit]}>`}};vD=Symbol.toStringTag,ZD[vD]=(e=>(e.unit=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]=`Interval`))(ZD.prototype);var QD=class extends DD{constructor(e){super(J.Duration),this.unit=e}toString(){return`Duration<${RE[this.unit]}>`}};yD=Symbol.toStringTag,QD[yD]=(e=>(e.unit=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]=`Duration`))(QD.prototype);var $D=class extends DD{constructor(e){super(J.List),this.children=[e]}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};bD=Symbol.toStringTag,$D[bD]=(e=>(e.children=null,e[Symbol.toStringTag]=`List`))($D.prototype);var eO=class extends DD{constructor(e){super(J.Struct),this.children=e}toString(){return`Struct<{${this.children.map(e=>`${e.name}:${e.type}`).join(`, `)}}>`}};xD=Symbol.toStringTag,eO[xD]=(e=>(e.children=null,e[Symbol.toStringTag]=`Struct`))(eO.prototype);var tO=class extends DD{constructor(e,t,n){super(J.Union),this.mode=e,this.children=n,this.typeIds=t=Int32Array.from(t),this.typeIdToChildIndex=t.reduce((e,t,n)=>(e[t]=n)&&e||e,Object.create(null))}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(e=>`${e.type}`).join(` | `)}>`}};SD=Symbol.toStringTag,tO[SD]=(e=>(e.mode=null,e.typeIds=null,e.children=null,e.typeIdToChildIndex=null,e.ArrayType=Int8Array,e[Symbol.toStringTag]=`Union`))(tO.prototype);var nO=class extends DD{constructor(e){super(J.FixedSizeBinary),this.byteWidth=e}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};CD=Symbol.toStringTag,nO[CD]=(e=>(e.byteWidth=null,e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`FixedSizeBinary`))(nO.prototype);var rO=class extends DD{constructor(e,t){super(J.FixedSizeList),this.listSize=e,this.children=[t]}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}};wD=Symbol.toStringTag,rO[wD]=(e=>(e.children=null,e.listSize=null,e[Symbol.toStringTag]=`FixedSizeList`))(rO.prototype);var iO=class extends DD{constructor(e,t=!1){var n,r,i;if(super(J.Map),this.children=[e],this.keysSorted=t,e&&(e.name=`entries`,(n=e?.type)?.children)){let t=(r=e?.type)?.children[0];t&&(t.name=`key`);let n=(i=e?.type)?.children[1];n&&(n.name=`value`)}}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}get childType(){return this.children[0].type}toString(){return`Map<{${this.children[0].type.children.map(e=>`${e.name}:${e.type}`).join(`, `)}}>`}};TD=Symbol.toStringTag,iO[TD]=(e=>(e.children=null,e.keysSorted=null,e[Symbol.toStringTag]=`Map_`))(iO.prototype);const aO=(e=>()=>++e)(-1);var oO=class extends DD{constructor(e,t,n,r){super(J.Dictionary),this.indices=t,this.dictionary=e,this.isOrdered=r||!1,this.id=n==null?aO():WE(n)}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}};ED=Symbol.toStringTag,oO[ED]=(e=>(e.id=null,e.indices=null,e.isOrdered=null,e.dictionary=null,e[Symbol.toStringTag]=`Dictionary`))(oO.prototype);function sO(e){let t=e;switch(e.typeId){case J.Decimal:return e.bitWidth/32;case J.Interval:return t.unit===zE.MONTH_DAY_NANO?4:1+t.unit;case J.FixedSizeList:return t.listSize;case J.FixedSizeBinary:return t.byteWidth;default:return 1}}var cO=class{visitMany(e,...t){return e.map((e,n)=>this.visit(e,...t.map(e=>e[n])))}visit(...e){return this.getVisitFn(e[0],!1).apply(this,e)}getVisitFn(e,t=!0){return lO(this,e,t)}getVisitFnByTypeId(e,t=!0){return uO(this,e,t)}visitNull(e,...t){return null}visitBool(e,...t){return null}visitInt(e,...t){return null}visitFloat(e,...t){return null}visitUtf8(e,...t){return null}visitLargeUtf8(e,...t){return null}visitBinary(e,...t){return null}visitLargeBinary(e,...t){return null}visitFixedSizeBinary(e,...t){return null}visitDate(e,...t){return null}visitTimestamp(e,...t){return null}visitTime(e,...t){return null}visitDecimal(e,...t){return null}visitList(e,...t){return null}visitStruct(e,...t){return null}visitUnion(e,...t){return null}visitDictionary(e,...t){return null}visitInterval(e,...t){return null}visitDuration(e,...t){return null}visitFixedSizeList(e,...t){return null}visitMap(e,...t){return null}};function lO(e,t,n=!0){return typeof t==`number`?uO(e,t,n):typeof t==`string`&&t in J?uO(e,J[t],n):t&&t instanceof DD?uO(e,dO(t),n):t?.type&&t.type instanceof DD?uO(e,dO(t.type),n):uO(e,J.NONE,n)}function uO(e,t,n=!0){let r=null;switch(t){case J.Null:r=e.visitNull;break;case J.Bool:r=e.visitBool;break;case J.Int:r=e.visitInt;break;case J.Int8:r=e.visitInt8||e.visitInt;break;case J.Int16:r=e.visitInt16||e.visitInt;break;case J.Int32:r=e.visitInt32||e.visitInt;break;case J.Int64:r=e.visitInt64||e.visitInt;break;case J.Uint8:r=e.visitUint8||e.visitInt;break;case J.Uint16:r=e.visitUint16||e.visitInt;break;case J.Uint32:r=e.visitUint32||e.visitInt;break;case J.Uint64:r=e.visitUint64||e.visitInt;break;case J.Float:r=e.visitFloat;break;case J.Float16:r=e.visitFloat16||e.visitFloat;break;case J.Float32:r=e.visitFloat32||e.visitFloat;break;case J.Float64:r=e.visitFloat64||e.visitFloat;break;case J.Utf8:r=e.visitUtf8;break;case J.LargeUtf8:r=e.visitLargeUtf8;break;case J.Binary:r=e.visitBinary;break;case J.LargeBinary:r=e.visitLargeBinary;break;case J.FixedSizeBinary:r=e.visitFixedSizeBinary;break;case J.Date:r=e.visitDate;break;case J.DateDay:r=e.visitDateDay||e.visitDate;break;case J.DateMillisecond:r=e.visitDateMillisecond||e.visitDate;break;case J.Timestamp:r=e.visitTimestamp;break;case J.TimestampSecond:r=e.visitTimestampSecond||e.visitTimestamp;break;case J.TimestampMillisecond:r=e.visitTimestampMillisecond||e.visitTimestamp;break;case J.TimestampMicrosecond:r=e.visitTimestampMicrosecond||e.visitTimestamp;break;case J.TimestampNanosecond:r=e.visitTimestampNanosecond||e.visitTimestamp;break;case J.Time:r=e.visitTime;break;case J.TimeSecond:r=e.visitTimeSecond||e.visitTime;break;case J.TimeMillisecond:r=e.visitTimeMillisecond||e.visitTime;break;case J.TimeMicrosecond:r=e.visitTimeMicrosecond||e.visitTime;break;case J.TimeNanosecond:r=e.visitTimeNanosecond||e.visitTime;break;case J.Decimal:r=e.visitDecimal;break;case J.List:r=e.visitList;break;case J.Struct:r=e.visitStruct;break;case J.Union:r=e.visitUnion;break;case J.DenseUnion:r=e.visitDenseUnion||e.visitUnion;break;case J.SparseUnion:r=e.visitSparseUnion||e.visitUnion;break;case J.Dictionary:r=e.visitDictionary;break;case J.Interval:r=e.visitInterval;break;case J.IntervalDayTime:r=e.visitIntervalDayTime||e.visitInterval;break;case J.IntervalYearMonth:r=e.visitIntervalYearMonth||e.visitInterval;break;case J.IntervalMonthDayNano:r=e.visitIntervalMonthDayNano||e.visitInterval;break;case J.Duration:r=e.visitDuration;break;case J.DurationSecond:r=e.visitDurationSecond||e.visitDuration;break;case J.DurationMillisecond:r=e.visitDurationMillisecond||e.visitDuration;break;case J.DurationMicrosecond:r=e.visitDurationMicrosecond||e.visitDuration;break;case J.DurationNanosecond:r=e.visitDurationNanosecond||e.visitDuration;break;case J.FixedSizeList:r=e.visitFixedSizeList;break;case J.Map:r=e.visitMap;break}if(typeof r==`function`)return r;if(!n)return()=>null;throw Error(`Unrecognized type '${J[t]}'`)}function dO(e){switch(e.typeId){case J.Null:return J.Null;case J.Int:{let{bitWidth:t,isSigned:n}=e;switch(t){case 8:return n?J.Int8:J.Uint8;case 16:return n?J.Int16:J.Uint16;case 32:return n?J.Int32:J.Uint32;case 64:return n?J.Int64:J.Uint64}return J.Int}case J.Float:switch(e.precision){case IE.HALF:return J.Float16;case IE.SINGLE:return J.Float32;case IE.DOUBLE:return J.Float64}return J.Float;case J.Binary:return J.Binary;case J.LargeBinary:return J.LargeBinary;case J.Utf8:return J.Utf8;case J.LargeUtf8:return J.LargeUtf8;case J.Bool:return J.Bool;case J.Decimal:return J.Decimal;case J.Time:switch(e.unit){case RE.SECOND:return J.TimeSecond;case RE.MILLISECOND:return J.TimeMillisecond;case RE.MICROSECOND:return J.TimeMicrosecond;case RE.NANOSECOND:return J.TimeNanosecond}return J.Time;case J.Timestamp:switch(e.unit){case RE.SECOND:return J.TimestampSecond;case RE.MILLISECOND:return J.TimestampMillisecond;case RE.MICROSECOND:return J.TimestampMicrosecond;case RE.NANOSECOND:return J.TimestampNanosecond}return J.Timestamp;case J.Date:switch(e.unit){case LE.DAY:return J.DateDay;case LE.MILLISECOND:return J.DateMillisecond}return J.Date;case J.Interval:switch(e.unit){case zE.DAY_TIME:return J.IntervalDayTime;case zE.YEAR_MONTH:return J.IntervalYearMonth;case zE.MONTH_DAY_NANO:return J.IntervalMonthDayNano}return J.Interval;case J.Duration:switch(e.unit){case RE.SECOND:return J.DurationSecond;case RE.MILLISECOND:return J.DurationMillisecond;case RE.MICROSECOND:return J.DurationMicrosecond;case RE.NANOSECOND:return J.DurationNanosecond}return J.Duration;case J.Map:return J.Map;case J.List:return J.List;case J.Struct:return J.Struct;case J.Union:switch(e.mode){case FE.Dense:return J.DenseUnion;case FE.Sparse:return J.SparseUnion}return J.Union;case J.FixedSizeBinary:return J.FixedSizeBinary;case J.FixedSizeList:return J.FixedSizeList;case J.Dictionary:return J.Dictionary}throw Error(`Unrecognized type '${J[e.typeId]}'`)}cO.prototype.visitInt8=null,cO.prototype.visitInt16=null,cO.prototype.visitInt32=null,cO.prototype.visitInt64=null,cO.prototype.visitUint8=null,cO.prototype.visitUint16=null,cO.prototype.visitUint32=null,cO.prototype.visitUint64=null,cO.prototype.visitFloat16=null,cO.prototype.visitFloat32=null,cO.prototype.visitFloat64=null,cO.prototype.visitDateDay=null,cO.prototype.visitDateMillisecond=null,cO.prototype.visitTimestampSecond=null,cO.prototype.visitTimestampMillisecond=null,cO.prototype.visitTimestampMicrosecond=null,cO.prototype.visitTimestampNanosecond=null,cO.prototype.visitTimeSecond=null,cO.prototype.visitTimeMillisecond=null,cO.prototype.visitTimeMicrosecond=null,cO.prototype.visitTimeNanosecond=null,cO.prototype.visitDenseUnion=null,cO.prototype.visitSparseUnion=null,cO.prototype.visitIntervalDayTime=null,cO.prototype.visitIntervalYearMonth=null,cO.prototype.visitIntervalMonthDayNano=null,cO.prototype.visitDuration=null,cO.prototype.visitDurationSecond=null,cO.prototype.visitDurationMillisecond=null,cO.prototype.visitDurationMicrosecond=null,cO.prototype.visitDurationNanosecond=null;var fO={};pn(fO,{float64ToUint16:()=>gO,uint16ToFloat64:()=>hO});const pO=new Float64Array(1),mO=new Uint32Array(pO.buffer);function hO(e){let t=(e&31744)>>10,n=(e&1023)/1024,r=(-1)**((e&32768)>>15);switch(t){case 31:return r*(n?NaN:1/0);case 0:return r*(n?6103515625e-14*n:0)}return r*2**(t-15)*(1+n)}function gO(e){if(e!==e)return 32256;pO[0]=e;let t=(mO[1]&2147483648)>>16&65535,n=mO[1]&2146435072,r=0;return n>=1089470464?mO[0]>0?n=31744:(n=(n&2080374784)>>16,r=(mO[1]&1048575)>>10):n<=1056964608?(r=1048576+(mO[1]&1048575),r=1048576+(r<<(n>>20)-998)>>21,n=0):(n=n-1056964608>>10,r=(mO[1]&1048575)+512>>10),t|n|r&65535}var _O=class extends cO{};function vO(e){return(t,n,r)=>{if(t.setValid(n,r!=null))return e(t,n,r)}}const yO=(e,t,n)=>{e[t]=Math.floor(n/864e5)},bO=(e,t,n,r)=>{if(n+1{let i=e+n;r?t[i>>3]|=1<>3]&=~(1<{e[t]=n},CO=({values:e},t,n)=>{e[t]=n},wO=({values:e},t,n)=>{e[t]=gO(n)},TO=(e,t,n)=>{switch(e.type.precision){case IE.HALF:return wO(e,t,n);case IE.SINGLE:case IE.DOUBLE:return CO(e,t,n)}},EO=({values:e},t,n)=>{yO(e,t,n.valueOf())},DO=({values:e},t,n)=>{e[t]=BigInt(n)},OO=({stride:e,values:t},n,r)=>{t.set(r.subarray(0,e),e*n)},kO=({values:e,valueOffsets:t},n,r)=>bO(e,t,n,r),AO=({values:e,valueOffsets:t},n,r)=>bO(e,t,n,VT(r)),jO=(e,t,n)=>{e.type.unit===LE.DAY?EO(e,t,n):DO(e,t,n)},MO=({values:e},t,n)=>{e[t]=BigInt(n/1e3)},NO=({values:e},t,n)=>{e[t]=BigInt(n)},PO=({values:e},t,n)=>{e[t]=BigInt(n*1e3)},FO=({values:e},t,n)=>{e[t]=BigInt(n*1e6)},IO=(e,t,n)=>{switch(e.type.unit){case RE.SECOND:return MO(e,t,n);case RE.MILLISECOND:return NO(e,t,n);case RE.MICROSECOND:return PO(e,t,n);case RE.NANOSECOND:return FO(e,t,n)}},LO=({values:e},t,n)=>{e[t]=n},RO=({values:e},t,n)=>{e[t]=n},zO=({values:e},t,n)=>{e[t]=n},BO=({values:e},t,n)=>{e[t]=n},VO=(e,t,n)=>{switch(e.type.unit){case RE.SECOND:return LO(e,t,n);case RE.MILLISECOND:return RO(e,t,n);case RE.MICROSECOND:return zO(e,t,n);case RE.NANOSECOND:return BO(e,t,n)}},HO=({values:e,stride:t},n,r)=>{e.set(r.subarray(0,t),t*n)},UO=(e,t,n)=>{let r=e.children[0],i=e.valueOffsets,a=uk.getVisitFn(r);if(Array.isArray(n))for(let e=-1,o=i[t],s=i[t+1];o{let r=e.children[0],{valueOffsets:i}=e,a=uk.getVisitFn(r),{[t]:o,[t+1]:s}=i,c=n instanceof Map?n.entries():Object.entries(n);for(let e of c)if(a(r,o,e),++o>=s)break},GO=(e,t)=>(n,r,i,a)=>r&&n(r,e,t[a]),KO=(e,t)=>(n,r,i,a)=>r&&n(r,e,t.get(a)),qO=(e,t)=>(n,r,i,a)=>r&&n(r,e,t.get(i.name)),JO=(e,t)=>(n,r,i,a)=>r&&n(r,e,t[i.name]),YO=(e,t,n)=>{let r=e.type.children.map(e=>uk.getVisitFn(e.type)),i=n instanceof Map?qO(t,n):n instanceof pj?KO(t,n):Array.isArray(n)?GO(t,n):JO(t,n);e.type.children.forEach((t,n)=>i(r[n],e.children[n],t,n))},XO=(e,t,n)=>{e.type.mode===FE.Dense?ZO(e,t,n):QO(e,t,n)},ZO=(e,t,n)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[r];uk.visit(i,e.valueOffsets[t],n)},QO=(e,t,n)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[r];uk.visit(i,t,n)},$O=(e,t,n)=>{var r;(r=e.dictionary)==null||r.set(e.values[t],n)},ek=(e,t,n)=>{switch(e.type.unit){case zE.YEAR_MONTH:return nk(e,t,n);case zE.DAY_TIME:return tk(e,t,n);case zE.MONTH_DAY_NANO:return rk(e,t,n)}},tk=({values:e},t,n)=>{e.set(n.subarray(0,2),2*t)},nk=({values:e},t,n)=>{e[t]=n[0]*12+n[1]%12},rk=({values:e,stride:t},n,r)=>{e.set(r.subarray(0,t),t*n)},ik=({values:e},t,n)=>{e[t]=n},ak=({values:e},t,n)=>{e[t]=n},ok=({values:e},t,n)=>{e[t]=n},sk=({values:e},t,n)=>{e[t]=n},ck=(e,t,n)=>{switch(e.type.unit){case RE.SECOND:return ik(e,t,n);case RE.MILLISECOND:return ak(e,t,n);case RE.MICROSECOND:return ok(e,t,n);case RE.NANOSECOND:return sk(e,t,n)}},lk=(e,t,n)=>{let{stride:r}=e,i=e.children[0],a=uk.getVisitFn(i);if(Array.isArray(n))for(let e=-1,o=t*r;++e`${UE(e)}: ${UE(t)}`).join(`, `)}}`}[Symbol.for(`nodejs.util.inspect.custom`)](){return this.toString()}[Symbol.iterator](){return new mk(this[dk],this[fk])}},mk=class{constructor(e,t){this.childIndex=0,this.children=e.children,this.rowIndex=t,this.childFields=e.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){let e=this.childIndex;return ee.name)}has(e,t){return e[dk].type.children.some(e=>e.name===t)}getOwnPropertyDescriptor(e,t){if(e[dk].type.children.some(e=>e.name===t))return{writable:!0,enumerable:!0,configurable:!0}}get(e,t){if(Reflect.has(e,t))return e[t];let n=e[dk].type.children.findIndex(e=>e.name===t);if(n!==-1){let r=cA.visit(e[dk].children[n],e[fk]);return Reflect.set(e,t,r),r}}set(e,t,n){let r=e[dk].type.children.findIndex(e=>e.name===t);return r===-1?Reflect.has(e,t)||typeof t==`symbol`?Reflect.set(e,t,n):!1:(uk.visit(e[dk].children[r],e[fk],n),Reflect.set(e,t,n))}};const gk=new hk;var _k=class extends cO{};function vk(e){return(t,n)=>t.getValid(n)?e(t,n):null}const yk=(e,t)=>864e5*e[t],bk=(e,t)=>null,xk=(e,t,n)=>{if(n+1>=t.length)return null;let r=WE(t[n]),i=WE(t[n+1]);return e.subarray(r,i)},Sk=({offset:e,values:t},n)=>{let r=e+n,i=t[r>>3];return(i&1<yk(e,t),wk=({values:e},t)=>WE(e[t]),Tk=({stride:e,values:t},n)=>t[e*n],Ek=({stride:e,values:t},n)=>hO(t[e*n]),Dk=({values:e},t)=>e[t],Ok=({stride:e,values:t},n)=>t.subarray(e*n,e*(n+1)),kk=({values:e,valueOffsets:t},n)=>xk(e,t,n),Ak=({values:e,valueOffsets:t},n)=>{let r=xk(e,t,n);return r===null?null:zT(r)},jk=({values:e},t)=>e[t],Mk=({type:e,values:t},n)=>e.precision===IE.HALF?hO(t[n]):t[n],Nk=(e,t)=>e.type.unit===LE.DAY?Ck(e,t):wk(e,t),Pk=({values:e},t)=>1e3*WE(e[t]),Fk=({values:e},t)=>WE(e[t]),Ik=({values:e},t)=>GE(e[t],BigInt(1e3)),Lk=({values:e},t)=>GE(e[t],BigInt(1e6)),Rk=(e,t)=>{switch(e.type.unit){case RE.SECOND:return Pk(e,t);case RE.MILLISECOND:return Fk(e,t);case RE.MICROSECOND:return Ik(e,t);case RE.NANOSECOND:return Lk(e,t)}},zk=({values:e},t)=>e[t],Bk=({values:e},t)=>e[t],Vk=({values:e},t)=>e[t],Hk=({values:e},t)=>e[t],Uk=(e,t)=>{switch(e.type.unit){case RE.SECOND:return zk(e,t);case RE.MILLISECOND:return Bk(e,t);case RE.MICROSECOND:return Vk(e,t);case RE.NANOSECOND:return Hk(e,t)}},Wk=({values:e,stride:t},n)=>iD.decimal(e.subarray(t*n,t*(n+1))),Gk=(e,t)=>{let{valueOffsets:n,stride:r,children:i}=e,{[t*r]:a,[t*r+1]:o}=n,s=i[0],c=s.slice(a,o-a);return new pj([c])},Kk=(e,t)=>{let{valueOffsets:n,children:r}=e,{[t]:i,[t+1]:a}=n,o=r[0];return new pA(o.slice(i,a-i))},qk=(e,t)=>new pk(e,t),Jk=(e,t)=>e.type.mode===FE.Dense?Yk(e,t):Xk(e,t),Yk=(e,t)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],r=e.children[n];return cA.visit(r,e.valueOffsets[t])},Xk=(e,t)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],r=e.children[n];return cA.visit(r,t)},Zk=(e,t)=>{var n;return(n=e.dictionary)?.get(e.values[t])},Qk=(e,t)=>e.type.unit===zE.MONTH_DAY_NANO?tA(e,t):e.type.unit===zE.DAY_TIME?$k(e,t):eA(e,t),$k=({values:e},t)=>e.subarray(2*t,2*(t+1)),eA=({values:e},t)=>{let n=e[t],r=new Int32Array(2);return r[0]=Math.trunc(n/12),r[1]=Math.trunc(n%12),r},tA=({values:e},t)=>e.subarray(4*t,4*(t+1)),nA=({values:e},t)=>e[t],rA=({values:e},t)=>e[t],iA=({values:e},t)=>e[t],aA=({values:e},t)=>e[t],oA=(e,t)=>{switch(e.type.unit){case RE.SECOND:return nA(e,t);case RE.MILLISECOND:return rA(e,t);case RE.MICROSECOND:return iA(e,t);case RE.NANOSECOND:return aA(e,t)}},sA=(e,t)=>{let{stride:n,children:r}=e,i=r[0],a=i.slice(t*n,n);return new pj([a])};_k.prototype.visitNull=vk(bk),_k.prototype.visitBool=vk(Sk),_k.prototype.visitInt=vk(jk),_k.prototype.visitInt8=vk(Tk),_k.prototype.visitInt16=vk(Tk),_k.prototype.visitInt32=vk(Tk),_k.prototype.visitInt64=vk(Dk),_k.prototype.visitUint8=vk(Tk),_k.prototype.visitUint16=vk(Tk),_k.prototype.visitUint32=vk(Tk),_k.prototype.visitUint64=vk(Dk),_k.prototype.visitFloat=vk(Mk),_k.prototype.visitFloat16=vk(Ek),_k.prototype.visitFloat32=vk(Tk),_k.prototype.visitFloat64=vk(Tk),_k.prototype.visitUtf8=vk(Ak),_k.prototype.visitLargeUtf8=vk(Ak),_k.prototype.visitBinary=vk(kk),_k.prototype.visitLargeBinary=vk(kk),_k.prototype.visitFixedSizeBinary=vk(Ok),_k.prototype.visitDate=vk(Nk),_k.prototype.visitDateDay=vk(Ck),_k.prototype.visitDateMillisecond=vk(wk),_k.prototype.visitTimestamp=vk(Rk),_k.prototype.visitTimestampSecond=vk(Pk),_k.prototype.visitTimestampMillisecond=vk(Fk),_k.prototype.visitTimestampMicrosecond=vk(Ik),_k.prototype.visitTimestampNanosecond=vk(Lk),_k.prototype.visitTime=vk(Uk),_k.prototype.visitTimeSecond=vk(zk),_k.prototype.visitTimeMillisecond=vk(Bk),_k.prototype.visitTimeMicrosecond=vk(Vk),_k.prototype.visitTimeNanosecond=vk(Hk),_k.prototype.visitDecimal=vk(Wk),_k.prototype.visitList=vk(Gk),_k.prototype.visitStruct=vk(qk),_k.prototype.visitUnion=vk(Jk),_k.prototype.visitDenseUnion=vk(Yk),_k.prototype.visitSparseUnion=vk(Xk),_k.prototype.visitDictionary=vk(Zk),_k.prototype.visitInterval=vk(Qk),_k.prototype.visitIntervalDayTime=vk($k),_k.prototype.visitIntervalYearMonth=vk(eA),_k.prototype.visitIntervalMonthDayNano=vk(tA),_k.prototype.visitDuration=vk(oA),_k.prototype.visitDurationSecond=vk(nA),_k.prototype.visitDurationMillisecond=vk(rA),_k.prototype.visitDurationMicrosecond=vk(iA),_k.prototype.visitDurationNanosecond=vk(aA),_k.prototype.visitFixedSizeList=vk(sA),_k.prototype.visitMap=vk(Kk);const cA=new _k,lA=Symbol.for(`keys`),uA=Symbol.for(`vals`),dA=Symbol.for(`kKeysAsStrings`),fA=Symbol.for(`_kKeysAsStrings`);var pA=class{constructor(e){return this[lA]=new pj([e.children[0]]).memoize(),this[uA]=e.children[1],new Proxy(this,new hA)}get[dA](){return this[fA]||(this[fA]=Array.from(this[lA].toArray(),String))}[Symbol.iterator](){return new mA(this[lA],this[uA])}get size(){return this[lA].length}toArray(){return Object.values(this.toJSON())}toJSON(){let e=this[lA],t=this[uA],n={};for(let r=-1,i=e.length;++r`${UE(e)}: ${UE(t)}`).join(`, `)}}`}[Symbol.for(`nodejs.util.inspect.custom`)](){return this.toString()}},mA=class{constructor(e,t){this.keys=e,this.vals=t,this.keyIndex=0,this.numKeys=e.length}[Symbol.iterator](){return this}next(){let e=this.keyIndex;return e===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(e),cA.visit(this.vals,e)]})}},hA=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(e){return e[dA]}has(e,t){return e[dA].includes(t)}getOwnPropertyDescriptor(e,t){let n=e[dA].indexOf(t);if(n!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(e,t){if(Reflect.has(e,t))return e[t];let n=e[dA].indexOf(t);if(n!==-1){let r=cA.visit(Reflect.get(e,uA),n);return Reflect.set(e,t,r),r}}set(e,t,n){let r=e[dA].indexOf(t);return r===-1?Reflect.has(e,t)?Reflect.set(e,t,n):!1:(uk.visit(Reflect.get(e,uA),r,n),Reflect.set(e,t,n))}};Object.defineProperties(pA.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:`Row`},[lA]:{writable:!0,enumerable:!1,configurable:!1,value:null},[uA]:{writable:!0,enumerable:!1,configurable:!1,value:null},[fA]:{writable:!0,enumerable:!1,configurable:!1,value:null}});var gA={};pn(gA,{clampRange:()=>vA,createElementComparator:()=>xA,wrapIndex:()=>yA});let _A;function vA(e,t,n,r){let{length:i=0}=e,a=typeof t==`number`?t:0,o=typeof n==`number`?n:i;return a<0&&(a=(a%i+i)%i),o<0&&(o=(o%i+i)%i),oi&&(o=i),r?r(e,a,o):[a,o]}const yA=(e,t)=>e<0?t+e:e,bA=e=>e!==e;function xA(e){let t=typeof e;if(t!==`object`||e===null)return bA(e)?bA:t=>t===e;if(e instanceof Date){let t=e.valueOf();return e=>e instanceof Date?e.valueOf()===t:!1}return ArrayBuffer.isView(e)?t=>t?PE(e,t):!1:e instanceof Map?CA(e):Array.isArray(e)?SA(e):e instanceof pj?wA(e):TA(e,!0)}function SA(e){let t=[];for(let n=-1,r=e.length;++n!1;let r=[];for(let t=-1,i=n.length;++t{if(!n||typeof n!=`object`)return!1;switch(n.constructor){case Array:return DA(e,n);case Map:return kA(e,n,n.keys());case pA:case pk:case Object:case void 0:return kA(e,n,t||Object.keys(n))}return n instanceof pj?OA(e,n):!1}}function DA(e,t){let n=e.length;if(t.length!==n)return!1;for(let r=-1;++rIA,getBit:()=>MA,getBool:()=>jA,packBools:()=>FA,popcnt_array:()=>RA,popcnt_bit_range:()=>LA,popcnt_uint32:()=>zA,setBool:()=>NA,truncateBitmap:()=>PA});function jA(e,t,n,r){return(n&1<>r}function NA(e,t,n){return n?!!(e[t>>3]|=1<>3]&=~(1<0||n.byteLength>3):FA(new IA(n,e,t,null,jA)).subarray(0,r)),i}return n}function FA(e){let t=[],n=0,r=0,i=0;for(let a of e)a&&(i|=1<0)&&(t[n++]=i);let a=new Uint8Array(t.length+7&-8);return a.set(t),a}var IA=class{constructor(e,t,n,r,i){this.bytes=e,this.length=n,this.context=r,this.get=i,this.bit=t%8,this.byteIndex=t>>3,this.byte=e[this.byteIndex++],this.index=0}next(){return this.index>3<<3,i=t+(t%8==0?0:8-t%8);return LA(e,t,i)+LA(e,r,n)+RA(e,i>>3,r-i>>3)}function RA(e,t,n){let r=0,i=Math.trunc(t),a=new DataView(e.buffer,e.byteOffset,e.byteLength),o=n===void 0?e.byteLength:i+n;for(;o-i>=4;)r+=zA(a.getUint32(i)),i+=4;for(;o-i>=2;)r+=zA(a.getUint16(i)),i+=2;for(;o-i>=1;)r+=zA(a.getUint8(i)),i+=1;return r}function zA(e){let t=Math.trunc(e);return t-=t>>>1&1431655765,t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}const BA=-1;var VA=class e{get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get nullable(){if(this._nullCount!==0){let{type:e}=this;return DD.isSparseUnion(e)||DD.isDenseUnion(e)?this.children.some(e=>e.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let e=0,{valueOffsets:t,values:n,nullBitmap:r,typeIds:i}=this;return t&&(e+=t.byteLength),n&&(e+=n.byteLength),r&&(e+=r.byteLength),i&&(e+=i.byteLength),this.children.reduce((e,t)=>e+t.byteLength,e)}get nullCount(){if(DD.isUnion(this.type))return this.children.reduce((e,t)=>e+t.nullCount,0);let e=this._nullCount,t;return e<=BA&&(t=this.nullBitmap)&&(this._nullCount=e=t.length===0?0:this.length-LA(t,this.offset,this.offset+this.length)),e}constructor(t,n,r,i,a,o=[],s){this.type=t,this.children=o,this.dictionary=s,this.offset=Math.floor(Math.max(n||0,0)),this.length=Math.floor(Math.max(r||0,0)),this._nullCount=Math.floor(Math.max(i||0,-1));let c;a instanceof e?(this.stride=a.stride,this.values=a.values,this.typeIds=a.typeIds,this.nullBitmap=a.nullBitmap,this.valueOffsets=a.valueOffsets):(this.stride=sO(t),a&&((c=a[0])&&(this.valueOffsets=c),(c=a[1])&&(this.values=c),(c=a[2])&&(this.nullBitmap=c),(c=a[3])&&(this.typeIds=c)))}getValid(e){let{type:t}=this;if(DD.isUnion(t)){let n=t,r=this.children[n.typeIdToChildIndex[this.typeIds[e]]],i=n.mode===FE.Dense?this.valueOffsets[e]:e;return r.getValid(i)}if(this.nullable&&this.nullCount>0){let t=this.offset+e,n=this.nullBitmap[t>>3];return(n&1<>3;(!r||r.byteLength<=c)&&(r=new Uint8Array((i+a+63&-64)>>3).fill(255),this.nullCount>0?(r.set(PA(i,a,this.nullBitmap),0),Object.assign(this,{nullBitmap:r})):Object.assign(this,{nullBitmap:r,_nullCount:0}));let l=r[c];n=(l&s)!==0,r[c]=t?l|s:l&~s}return n!==!!t&&(this._nullCount=this.nullCount+(t?-1:1)),t}clone(t=this.type,n=this.offset,r=this.length,i=this._nullCount,a=this,o=this.children){return new e(t,n,r,i,a,o,this.dictionary)}slice(e,t){let{stride:n,typeId:r,children:i}=this,a=(this._nullCount===0)-1,o=r===16?n:1,s=this._sliceBuffers(e,t,n,r);return this.clone(this.type,this.offset+e,t,a,s,i.length===0||this.valueOffsets?i:this._sliceChildren(i,o*e,o*t))}_changeLengthAndBackfillNullBitmap(e){if(this.typeId===J.Null)return this.clone(this.type,0,e,0);let{length:t,nullCount:n}=this,r=new Uint8Array((e+63&-64)>>3).fill(255,0,t>>3);r[t>>3]=(1<0&&r.set(PA(this.offset,t,this.nullBitmap),0);let i=this.buffers;return i[BE.VALIDITY]=r,this.clone(this.type,0,e,n+(e-t),i)}_sliceBuffers(e,t,n,r){let i,{buffers:a}=this;return(i=a[BE.TYPE])&&(a[BE.TYPE]=i.subarray(e,e+t)),(i=a[BE.OFFSET])&&(a[BE.OFFSET]=i.subarray(e,e+t+1))||(i=a[BE.DATA])&&(a[BE.DATA]=r===6?i:i.subarray(n*e,n*(e+t))),a}_sliceChildren(e,t,n){return e.map(e=>e.slice(t,n))}};VA.prototype.children=Object.freeze([]);var HA=class e extends cO{visit(e){return this.getVisitFn(e.type).call(this,e)}visitNull(e){let{type:t,offset:n=0,length:r=0}=e;return new VA(t,n,r,r)}visitBool(e){let{type:t,offset:n=0}=e,r=aE(e.nullBitmap),i=eE(t.ArrayType,e.data),{length:a=i.length>>3,nullCount:o=e.nullBitmap?-1:0}=e;return new VA(t,n,a,o,[void 0,i,r])}visitInt(e){let{type:t,offset:n=0}=e,r=aE(e.nullBitmap),i=eE(t.ArrayType,e.data),{length:a=i.length,nullCount:o=e.nullBitmap?-1:0}=e;return new VA(t,n,a,o,[void 0,i,r])}visitFloat(e){let{type:t,offset:n=0}=e,r=aE(e.nullBitmap),i=eE(t.ArrayType,e.data),{length:a=i.length,nullCount:o=e.nullBitmap?-1:0}=e;return new VA(t,n,a,o,[void 0,i,r])}visitUtf8(e){let{type:t,offset:n=0}=e,r=aE(e.data),i=aE(e.nullBitmap),a=rE(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new VA(t,n,o,s,[a,r,i])}visitLargeUtf8(e){let{type:t,offset:n=0}=e,r=aE(e.data),i=aE(e.nullBitmap),a=iE(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new VA(t,n,o,s,[a,r,i])}visitBinary(e){let{type:t,offset:n=0}=e,r=aE(e.data),i=aE(e.nullBitmap),a=rE(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new VA(t,n,o,s,[a,r,i])}visitLargeBinary(e){let{type:t,offset:n=0}=e,r=aE(e.data),i=aE(e.nullBitmap),a=iE(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new VA(t,n,o,s,[a,r,i])}visitFixedSizeBinary(e){let{type:t,offset:n=0}=e,r=aE(e.nullBitmap),i=eE(t.ArrayType,e.data),{length:a=i.length/sO(t),nullCount:o=e.nullBitmap?-1:0}=e;return new VA(t,n,a,o,[void 0,i,r])}visitDate(e){let{type:t,offset:n=0}=e,r=aE(e.nullBitmap),i=eE(t.ArrayType,e.data),{length:a=i.length/sO(t),nullCount:o=e.nullBitmap?-1:0}=e;return new VA(t,n,a,o,[void 0,i,r])}visitTimestamp(e){let{type:t,offset:n=0}=e,r=aE(e.nullBitmap),i=eE(t.ArrayType,e.data),{length:a=i.length/sO(t),nullCount:o=e.nullBitmap?-1:0}=e;return new VA(t,n,a,o,[void 0,i,r])}visitTime(e){let{type:t,offset:n=0}=e,r=aE(e.nullBitmap),i=eE(t.ArrayType,e.data),{length:a=i.length/sO(t),nullCount:o=e.nullBitmap?-1:0}=e;return new VA(t,n,a,o,[void 0,i,r])}visitDecimal(e){let{type:t,offset:n=0}=e,r=aE(e.nullBitmap),i=eE(t.ArrayType,e.data),{length:a=i.length/sO(t),nullCount:o=e.nullBitmap?-1:0}=e;return new VA(t,n,a,o,[void 0,i,r])}visitList(e){let{type:t,offset:n=0,child:r}=e,i=aE(e.nullBitmap),a=rE(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new VA(t,n,o,s,[a,void 0,i],[r])}visitStruct(e){let{type:t,offset:n=0,children:r=[]}=e,i=aE(e.nullBitmap),{length:a=r.reduce((e,{length:t})=>Math.max(e,t),0),nullCount:o=e.nullBitmap?-1:0}=e;return new VA(t,n,a,o,[void 0,void 0,i],r)}visitUnion(e){let{type:t,offset:n=0,children:r=[]}=e,i=eE(t.ArrayType,e.typeIds),{length:a=i.length,nullCount:o=-1}=e;if(DD.isSparseUnion(t))return new VA(t,n,a,o,[void 0,void 0,void 0,i],r);let s=rE(e.valueOffsets);return new VA(t,n,a,o,[s,void 0,void 0,i],r)}visitDictionary(t){let{type:n,offset:r=0}=t,i=aE(t.nullBitmap),a=eE(n.indices.ArrayType,t.data),{dictionary:o=new pj([new e().visit({type:n.dictionary})])}=t,{length:s=a.length,nullCount:c=t.nullBitmap?-1:0}=t;return new VA(n,r,s,c,[void 0,a,i],[],o)}visitInterval(e){let{type:t,offset:n=0}=e,r=aE(e.nullBitmap),i=eE(t.ArrayType,e.data),{length:a=i.length/sO(t),nullCount:o=e.nullBitmap?-1:0}=e;return new VA(t,n,a,o,[void 0,i,r])}visitDuration(e){let{type:t,offset:n=0}=e,r=aE(e.nullBitmap),i=eE(t.ArrayType,e.data),{length:a=i.length,nullCount:o=e.nullBitmap?-1:0}=e;return new VA(t,n,a,o,[void 0,i,r])}visitFixedSizeList(t){let{type:n,offset:r=0,child:i=new e().visit({type:n.valueType})}=t,a=aE(t.nullBitmap),{length:o=i.length/sO(n),nullCount:s=t.nullBitmap?-1:0}=t;return new VA(n,r,o,s,[void 0,void 0,a],[i])}visitMap(t){let{type:n,offset:r=0,child:i=new e().visit({type:n.childType})}=t,a=aE(t.nullBitmap),o=rE(t.valueOffsets),{length:s=o.length-1,nullCount:c=t.nullBitmap?-1:0}=t;return new VA(n,r,s,c,[o,void 0,a],[i])}};const UA=new HA;var WA=class{constructor(e=0,t){this.numChunks=e,this.getChunkIterator=t,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndexe.nullable)}function KA(e){return e.reduce((e,t)=>e+t.nullCount,0)}function qA(e){return e.reduce((e,t,n)=>(e[n+1]=e[n]+t.length,e),new Uint32Array(e.length+1))}function JA(e,t,n,r){let i=[];for(let a=-1,o=e.length;++a=r)break;if(n>=s+c)continue;if(s>=n&&s+c<=r){i.push(o);continue}let l=Math.max(0,n-s),u=Math.min(r-s,c);i.push(o.slice(l,u-l))}return i.length===0&&i.push(e[0].slice(0,0)),i}function YA(e,t,n,r){let i=0,a=0,o=t.length-1;do{if(i>=o-1)return n0?0:-1}function nj(e,t){let{nullBitmap:n}=e;if(!n||e.nullCount<=0)return-1;let r=0;for(let i of new IA(n,e.offset+(t||0),e.length,n,jA)){if(!i)return r;++r}return-1}function rj(e,t,n){if(t===void 0)return-1;if(t===null)switch(e.typeId){case J.Union:break;case J.Dictionary:break;default:return nj(e,n)}let r=cA.getVisitFn(e),i=xA(t);for(let t=(n||0)-1,a=e.length;++t{let n=e.data[t];return n.values.subarray(0,n.length)[Symbol.iterator]()});let n=0;return new WA(e.data.length,t=>{let r=e.data[t],i=r.length,a=e.slice(n,n+i);return n+=i,new cj(a)})}var cj=class{constructor(e){this.vector=e,this.index=0}next(){return this.indexe.data):t;if(a.length===0||a.some(e=>!(e instanceof VA)))throw TypeError(`Vector constructor expects an Array of Data instances.`);let o=(n=a[0])?.type;switch(a.length){case 0:this._offsets=[0];break;case 1:{let{get:e,set:t,indexOf:n}=dj[o.typeId],r=a[0];this.isValid=e=>XA(r,e),this.get=t=>e(r,t),this.set=(e,n)=>t(r,e,n),this.indexOf=e=>n(r,e),this._offsets=[0,r.length];break}default:Object.setPrototypeOf(this,fj[o.typeId]),this._offsets=qA(a);break}this.data=a,this.type=o,this.stride=sO(o),this.numChildren=(i=(r=o.children)?.length)??0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((e,t)=>e+t.byteLength,0)}get nullable(){return GA(this.data)}get nullCount(){return KA(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${J[this.type.typeId]}Vector`}isValid(e){return!1}get(e){return null}at(e){return this.get(yA(e,this.length))}set(e,t){}indexOf(e,t){return-1}includes(e,t){return this.indexOf(e,t)>-1}[Symbol.iterator](){return lj.visit(this)}concat(...t){return new e(this.data.concat(t.flatMap(e=>e.data).flat(1/0)))}slice(t,n){return new e(vA(this,t,n,({data:e,_offsets:t},n,r)=>JA(e,t,n,r)))}toJSON(){return[...this]}toArray(){let{type:e,data:t,length:n,stride:r,ArrayType:i}=this;switch(e.typeId){case J.Int:case J.Float:case J.Decimal:case J.Time:case J.Timestamp:switch(t.length){case 0:return new i;case 1:return t[0].values.subarray(0,n*r);default:return t.reduce((e,{values:t,length:n})=>(e.array.set(t.subarray(0,n*r),e.offset),e.offset+=n*r,e),{array:new i(n*r),offset:0}).array}}return[...this]}toString(){return`[${[...this].join(`,`)}]`}getChild(e){var t;return this.getChildAt((t=this.type.children)?.findIndex(t=>t.name===e))}getChildAt(t){return t>-1&&te[t])):null}get isMemoized(){return DD.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(DD.isDictionary(this.type)){let t=new mj(this.data[0].dictionary),n=this.data.map(e=>{let n=e.clone();return n.dictionary=t,n});return new e(n)}return new mj(this)}unmemoize(){if(DD.isDictionary(this.type)&&this.isMemoized){let t=this.data[0].dictionary.unmemoize(),n=this.data.map(e=>{let n=e.clone();return n.dictionary=t,n});return new e(n)}return this}};uj=Symbol.toStringTag,pj[uj]=(e=>{e.type=DD.prototype,e.data=[],e.length=0,e.stride=1,e.numChildren=0,e._offsets=new Uint32Array([0]),e[Symbol.isConcatSpreadable]=!0;let t=Object.keys(J).map(e=>J[e]).filter(e=>typeof e==`number`&&e!==J.NONE);for(let n of t){let t=cA.getVisitFnByTypeId(n),r=uk.getVisitFnByTypeId(n),i=aj.getVisitFnByTypeId(n);dj[n]={get:t,set:r,indexOf:i},fj[n]=Object.create(e,{isValid:{value:ZA(XA)},get:{value:ZA(cA.getVisitFnByTypeId(n))},set:{value:QA(uk.getVisitFnByTypeId(n))},indexOf:{value:$A(aj.getVisitFnByTypeId(n))}})}return`Vector`})(pj.prototype);var mj=class e extends pj{constructor(t){super(t.data);let n=this.get,r=this.set,i=this.slice,a=Array(this.length);Object.defineProperty(this,`get`,{value(e){let t=a[e];if(t!==void 0)return t;let r=n.call(this,e);return a[e]=r,r}}),Object.defineProperty(this,`set`,{value(e,t){r.call(this,e,t),a[e]=t}}),Object.defineProperty(this,`slice`,{value:(t,n)=>new e(i.call(this,t,n))}),Object.defineProperty(this,`isMemoized`,{value:!0}),Object.defineProperty(this,`unmemoize`,{value:()=>new pj(this.data)}),Object.defineProperty(this,`memoize`,{value:()=>this})}},hj={};pn(hj,{BaseInt64:()=>bj,Int128:()=>Cj,Int64:()=>Sj,Uint64:()=>xj});const gj=65536;function _j(e){return e<0&&(e=4294967295+e+1),`0x${e.toString(16)}`}const vj=8,yj=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8];var bj=class{constructor(e){this.buffer=e}high(){return this.buffer[1]}low(){return this.buffer[0]}_times(e){let t=new Uint32Array([this.buffer[1]>>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),n=new Uint32Array([e.buffer[1]>>>16,e.buffer[1]&65535,e.buffer[0]>>>16,e.buffer[0]&65535]),r=t[3]*n[3];this.buffer[0]=r&65535;let i=r>>>16;return r=t[2]*n[3],i+=r,r=t[3]*n[2]>>>0,i+=r,this.buffer[0]+=i<<16,this.buffer[1]=i>>>0>>16,this.buffer[1]+=t[1]*n[3]+t[2]*n[2]+t[3]*n[1],this.buffer[1]+=t[0]*n[3]+t[1]*n[2]+t[2]*n[1]+t[3]*n[0]<<16,this}_plus(e){let t=this.buffer[0]+e.buffer[0]>>>0;this.buffer[1]+=e.buffer[1],t>>0&&++this.buffer[1],this.buffer[0]=t}lessThan(e){return this.buffer[1]>>0,t[2]=this.buffer[2]+e.buffer[2]>>>0,t[1]=this.buffer[1]+e.buffer[1]>>>0,t[0]=this.buffer[0]+e.buffer[0]>>>0,t[0]>>0&&++t[1],t[1]>>0&&++t[2],t[2]>>0&&++t[3],this.buffer[3]=t[3],this.buffer[2]=t[2],this.buffer[1]=t[1],this.buffer[0]=t[0],this}hex(){return`${_j(this.buffer[3])} ${_j(this.buffer[2])} ${_j(this.buffer[1])} ${_j(this.buffer[0])}`}static multiply(t,n){let r=new e(new Uint32Array(t.buffer));return r.times(n)}static add(t,n){let r=new e(new Uint32Array(t.buffer));return r.plus(n)}static from(t,n=new Uint32Array(4)){return e.fromString(typeof t==`string`?t:t.toString(),n)}static fromNumber(t,n=new Uint32Array(4)){return e.fromString(t.toString(),n)}static fromString(t,n=new Uint32Array(4)){let r=t.startsWith(`-`),i=t.length,a=new e(n);for(let n=r?1:0;nTj,toIntervalDayTimeObjects:()=>Dj,toIntervalMonthDayNanoInt32Array:()=>Ej,toIntervalMonthDayNanoObjects:()=>Oj});function Tj(e){var t,n;let r=e.length,i=new Int32Array(r*2);for(let a=0,o=0;a>BigInt(32))):o+=2}return i}function Dj(e){let t=e.length,n=Array(t/2);for(let r=0,i=0;r>>0);r[a++]={months:e[i],days:e[i+1],nanoseconds:t?`${n}`:n}}return r}var kj=class extends cO{compareSchemas(e,t){return e===t||t instanceof e.constructor&&this.compareManyFields(e.fields,t.fields)}compareManyFields(e,t){return e===t||Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every((e,n)=>this.compareFields(e,t[n]))}compareFields(e,t){return e===t||t instanceof e.constructor&&e.name===t.name&&e.nullable===t.nullable&&this.visit(e.type,t.type)}};function Aj(e,t){return t instanceof e.constructor}function jj(e,t){return e===t||Aj(e,t)}function Mj(e,t){return e===t||Aj(e,t)&&e.bitWidth===t.bitWidth&&e.isSigned===t.isSigned}function Nj(e,t){return e===t||Aj(e,t)&&e.precision===t.precision}function Pj(e,t){return e===t||Aj(e,t)&&e.byteWidth===t.byteWidth}function Fj(e,t){return e===t||Aj(e,t)&&e.unit===t.unit}function Ij(e,t){return e===t||Aj(e,t)&&e.unit===t.unit&&e.timezone===t.timezone}function Lj(e,t){return e===t||Aj(e,t)&&e.unit===t.unit&&e.bitWidth===t.bitWidth}function Rj(e,t){return e===t||Aj(e,t)&&e.children.length===t.children.length&&Kj.compareManyFields(e.children,t.children)}function zj(e,t){return e===t||Aj(e,t)&&e.children.length===t.children.length&&Kj.compareManyFields(e.children,t.children)}function Bj(e,t){return e===t||Aj(e,t)&&e.mode===t.mode&&e.typeIds.every((e,n)=>e===t.typeIds[n])&&Kj.compareManyFields(e.children,t.children)}function Vj(e,t){return e===t||Aj(e,t)&&e.id===t.id&&e.isOrdered===t.isOrdered&&Kj.visit(e.indices,t.indices)&&Kj.visit(e.dictionary,t.dictionary)}function Hj(e,t){return e===t||Aj(e,t)&&e.unit===t.unit}function Uj(e,t){return e===t||Aj(e,t)&&e.unit===t.unit}function Wj(e,t){return e===t||Aj(e,t)&&e.listSize===t.listSize&&e.children.length===t.children.length&&Kj.compareManyFields(e.children,t.children)}function Gj(e,t){return e===t||Aj(e,t)&&e.keysSorted===t.keysSorted&&e.children.length===t.children.length&&Kj.compareManyFields(e.children,t.children)}kj.prototype.visitNull=jj,kj.prototype.visitBool=jj,kj.prototype.visitInt=Mj,kj.prototype.visitInt8=Mj,kj.prototype.visitInt16=Mj,kj.prototype.visitInt32=Mj,kj.prototype.visitInt64=Mj,kj.prototype.visitUint8=Mj,kj.prototype.visitUint16=Mj,kj.prototype.visitUint32=Mj,kj.prototype.visitUint64=Mj,kj.prototype.visitFloat=Nj,kj.prototype.visitFloat16=Nj,kj.prototype.visitFloat32=Nj,kj.prototype.visitFloat64=Nj,kj.prototype.visitUtf8=jj,kj.prototype.visitLargeUtf8=jj,kj.prototype.visitBinary=jj,kj.prototype.visitLargeBinary=jj,kj.prototype.visitFixedSizeBinary=Pj,kj.prototype.visitDate=Fj,kj.prototype.visitDateDay=Fj,kj.prototype.visitDateMillisecond=Fj,kj.prototype.visitTimestamp=Ij,kj.prototype.visitTimestampSecond=Ij,kj.prototype.visitTimestampMillisecond=Ij,kj.prototype.visitTimestampMicrosecond=Ij,kj.prototype.visitTimestampNanosecond=Ij,kj.prototype.visitTime=Lj,kj.prototype.visitTimeSecond=Lj,kj.prototype.visitTimeMillisecond=Lj,kj.prototype.visitTimeMicrosecond=Lj,kj.prototype.visitTimeNanosecond=Lj,kj.prototype.visitDecimal=jj,kj.prototype.visitList=Rj,kj.prototype.visitStruct=zj,kj.prototype.visitUnion=Bj,kj.prototype.visitDenseUnion=Bj,kj.prototype.visitSparseUnion=Bj,kj.prototype.visitDictionary=Vj,kj.prototype.visitInterval=Hj,kj.prototype.visitIntervalDayTime=Hj,kj.prototype.visitIntervalYearMonth=Hj,kj.prototype.visitIntervalMonthDayNano=Hj,kj.prototype.visitDuration=Uj,kj.prototype.visitDurationSecond=Uj,kj.prototype.visitDurationMillisecond=Uj,kj.prototype.visitDurationMicrosecond=Uj,kj.prototype.visitDurationNanosecond=Uj,kj.prototype.visitFixedSizeList=Wj,kj.prototype.visitMap=Gj;const Kj=new kj;function qj(e,t){return Kj.compareSchemas(e,t)}function Jj(e,t){return Kj.compareFields(e,t)}function Yj(e,t){return Kj.visit(e,t)}const Xj=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},KE),hj),AA),fO),YT),gA),VE),wj),{compareSchemas:qj,compareFields:Jj,compareTypes:Yj}),Zj=365.2425,Qj=10**8*24*60*60*1e3,$j=6048e5,eM=864e5,tM=3600,nM=tM*24,rM=nM*7,iM=nM*Zj,aM=iM/12,oM=aM*3,sM=Symbol.for(`constructDateFrom`);function cM(e,t){return typeof e==`function`?e(t):e&&typeof e==`object`&&sM in e?e[sM](t):e instanceof Date?new e.constructor(t):new Date(t)}function lM(e,t){return cM(t||e,e)}let uM={};function dM(){return uM}function fM(e,t){let n=dM(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=lM(e,t?.in),a=i.getDay(),o=(a=a.getTime()?r+1:n.getTime()>=s.getTime()?r:r-1}function hM(e){let t=lM(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),e-+n}function gM(e,...t){let n=cM.bind(null,e||t.find(e=>typeof e==`object`));return t.map(n)}function _M(e,t){let n=lM(e,t?.in);return n.setHours(0,0,0,0),n}function vM(e,t,n){let[r,i]=gM(n?.in,e,t),a=_M(r),o=_M(i),s=+a-hM(a),c=+o-hM(o);return Math.round((s-c)/eM)}function yM(e,t){let n=mM(e,t),r=cM(t?.in||e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),pM(r)}function bM(e){return e instanceof Date||typeof e==`object`&&Object.prototype.toString.call(e)===`[object Date]`}function xM(e){return!(!bM(e)&&typeof e!=`number`||isNaN(+lM(e)))}function SM(e,t){let n=lM(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const CM={lessThanXSeconds:{one:`less than a second`,other:`less than {{count}} seconds`},xSeconds:{one:`1 second`,other:`{{count}} seconds`},halfAMinute:`half a minute`,lessThanXMinutes:{one:`less than a minute`,other:`less than {{count}} minutes`},xMinutes:{one:`1 minute`,other:`{{count}} minutes`},aboutXHours:{one:`about 1 hour`,other:`about {{count}} hours`},xHours:{one:`1 hour`,other:`{{count}} hours`},xDays:{one:`1 day`,other:`{{count}} days`},aboutXWeeks:{one:`about 1 week`,other:`about {{count}} weeks`},xWeeks:{one:`1 week`,other:`{{count}} weeks`},aboutXMonths:{one:`about 1 month`,other:`about {{count}} months`},xMonths:{one:`1 month`,other:`{{count}} months`},aboutXYears:{one:`about 1 year`,other:`about {{count}} years`},xYears:{one:`1 year`,other:`{{count}} years`},overXYears:{one:`over 1 year`,other:`over {{count}} years`},almostXYears:{one:`almost 1 year`,other:`almost {{count}} years`}},wM=(e,t,n)=>{let r,i=CM[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:r+` ago`:r};function TM(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth,r=e.formats[n]||e.formats[e.defaultWidth];return r}}const EM={full:`EEEE, MMMM do, y`,long:`MMMM do, y`,medium:`MMM d, y`,short:`MM/dd/yyyy`},DM={full:`h:mm:ss a zzzz`,long:`h:mm:ss a z`,medium:`h:mm:ss a`,short:`h:mm a`},OM={full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},kM={date:TM({formats:EM,defaultWidth:`full`}),time:TM({formats:DM,defaultWidth:`full`}),dateTime:TM({formats:OM,defaultWidth:`full`})},AM={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`},jM=(e,t,n,r)=>AM[e];function MM(e){return(t,n)=>{let r=n?.context?String(n.context):`standalone`,i;if(r===`formatting`&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{let t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}let a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}const NM={narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},PM={narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1st quarter`,`2nd quarter`,`3rd quarter`,`4th quarter`]},FM={narrow:[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],wide:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`]},IM={narrow:[`S`,`M`,`T`,`W`,`T`,`F`,`S`],short:[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],abbreviated:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],wide:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`]},LM={narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`}},RM={narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`}},zM=(e,t)=>{let n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+`st`;case 2:return n+`nd`;case 3:return n+`rd`}return n+`th`},BM={ordinalNumber:zM,era:MM({values:NM,defaultWidth:`wide`}),quarter:MM({values:PM,defaultWidth:`wide`,argumentCallback:e=>e-1}),month:MM({values:FM,defaultWidth:`wide`}),day:MM({values:IM,defaultWidth:`wide`}),dayPeriod:MM({values:LM,defaultWidth:`wide`,formattingValues:RM,defaultFormattingWidth:`wide`})};function VM(e){return(t,n={})=>{let r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;let o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?UM(s,e=>e.test(o)):HM(s,e=>e.test(o)),l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;let u=t.slice(o.length);return{value:l,rest:u}}}function HM(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function UM(e,t){for(let n=0;n{let r=t.match(e.matchPattern);if(!r)return null;let i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;let s=t.slice(i.length);return{value:o,rest:s}}}const GM=/^(\d+)(th|st|nd|rd)?/i,KM=/\d+/i,qM={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},JM={any:[/^b/i,/^(a|c)/i]},YM={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},XM={any:[/1/i,/2/i,/3/i,/4/i]},ZM={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},QM={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},$M={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},eN={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},tN={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},nN={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},rN={ordinalNumber:WM({matchPattern:GM,parsePattern:KM,valueCallback:e=>parseInt(e,10)}),era:VM({matchPatterns:qM,defaultMatchWidth:`wide`,parsePatterns:JM,defaultParseWidth:`any`}),quarter:VM({matchPatterns:YM,defaultMatchWidth:`wide`,parsePatterns:XM,defaultParseWidth:`any`,valueCallback:e=>e+1}),month:VM({matchPatterns:ZM,defaultMatchWidth:`wide`,parsePatterns:QM,defaultParseWidth:`any`}),day:VM({matchPatterns:$M,defaultMatchWidth:`wide`,parsePatterns:eN,defaultParseWidth:`any`}),dayPeriod:VM({matchPatterns:tN,defaultMatchWidth:`any`,parsePatterns:nN,defaultParseWidth:`any`})},iN={code:`en-US`,formatDistance:wM,formatLong:kM,formatRelative:jM,localize:BM,match:rN,options:{weekStartsOn:0,firstWeekContainsDate:1}};function aN(e,t){let n=lM(e,t?.in),r=vM(n,SM(n)),i=r+1;return i}function oN(e,t){let n=lM(e,t?.in),r=pM(n)-+yM(n);return Math.round(r/$j)+1}function sN(e,t){let n=lM(e,t?.in),r=n.getFullYear(),i=dM(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,o=cM(t?.in||e,0);o.setFullYear(r+1,0,a),o.setHours(0,0,0,0);let s=fM(o,t),c=cM(t?.in||e,0);c.setFullYear(r,0,a),c.setHours(0,0,0,0);let l=fM(c,t);return+n>=+s?r+1:+n>=+l?r:r-1}function cN(e,t){let n=dM(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=sN(e,t),a=cM(t?.in||e,0);a.setFullYear(i,0,r),a.setHours(0,0,0,0);let o=fM(a,t);return o}function lN(e,t){let n=lM(e,t?.in),r=fM(n,t)-+cN(n,t);return Math.round(r/$j)+1}function uN(e,t){let n=e<0?`-`:``,r=Math.abs(e).toString().padStart(t,`0`);return n+r}const dN={y(e,t){let n=e.getFullYear(),r=n>0?n:1-n;return uN(t===`yy`?r%100:r,t.length)},M(e,t){let n=e.getMonth();return t===`M`?String(n+1):uN(n+1,2)},d(e,t){return uN(e.getDate(),t.length)},a(e,t){let n=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.toUpperCase();case`aaa`:return n;case`aaaaa`:return n[0];case`aaaa`:default:return n===`am`?`a.m.`:`p.m.`}},h(e,t){return uN(e.getHours()%12||12,t.length)},H(e,t){return uN(e.getHours(),t.length)},m(e,t){return uN(e.getMinutes(),t.length)},s(e,t){return uN(e.getSeconds(),t.length)},S(e,t){let n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*10**(n-3));return uN(i,t.length)}},fN={am:`am`,pm:`pm`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},pN={G:function(e,t,n){let r=e.getFullYear()>0?1:0;switch(t){case`G`:case`GG`:case`GGG`:return n.era(r,{width:`abbreviated`});case`GGGGG`:return n.era(r,{width:`narrow`});case`GGGG`:default:return n.era(r,{width:`wide`})}},y:function(e,t,n){if(t===`yo`){let t=e.getFullYear(),r=t>0?t:1-t;return n.ordinalNumber(r,{unit:`year`})}return dN.y(e,t)},Y:function(e,t,n,r){let i=sN(e,r),a=i>0?i:1-i;if(t===`YY`){let e=a%100;return uN(e,2)}return t===`Yo`?n.ordinalNumber(a,{unit:`year`}):uN(a,t.length)},R:function(e,t){let n=mM(e);return uN(n,t.length)},u:function(e,t){let n=e.getFullYear();return uN(n,t.length)},Q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`Q`:return String(r);case`QQ`:return uN(r,2);case`Qo`:return n.ordinalNumber(r,{unit:`quarter`});case`QQQ`:return n.quarter(r,{width:`abbreviated`,context:`formatting`});case`QQQQQ`:return n.quarter(r,{width:`narrow`,context:`formatting`});case`QQQQ`:default:return n.quarter(r,{width:`wide`,context:`formatting`})}},q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`q`:return String(r);case`qq`:return uN(r,2);case`qo`:return n.ordinalNumber(r,{unit:`quarter`});case`qqq`:return n.quarter(r,{width:`abbreviated`,context:`standalone`});case`qqqqq`:return n.quarter(r,{width:`narrow`,context:`standalone`});case`qqqq`:default:return n.quarter(r,{width:`wide`,context:`standalone`})}},M:function(e,t,n){let r=e.getMonth();switch(t){case`M`:case`MM`:return dN.M(e,t);case`Mo`:return n.ordinalNumber(r+1,{unit:`month`});case`MMM`:return n.month(r,{width:`abbreviated`,context:`formatting`});case`MMMMM`:return n.month(r,{width:`narrow`,context:`formatting`});case`MMMM`:default:return n.month(r,{width:`wide`,context:`formatting`})}},L:function(e,t,n){let r=e.getMonth();switch(t){case`L`:return String(r+1);case`LL`:return uN(r+1,2);case`Lo`:return n.ordinalNumber(r+1,{unit:`month`});case`LLL`:return n.month(r,{width:`abbreviated`,context:`standalone`});case`LLLLL`:return n.month(r,{width:`narrow`,context:`standalone`});case`LLLL`:default:return n.month(r,{width:`wide`,context:`standalone`})}},w:function(e,t,n,r){let i=lN(e,r);return t===`wo`?n.ordinalNumber(i,{unit:`week`}):uN(i,t.length)},I:function(e,t,n){let r=oN(e);return t===`Io`?n.ordinalNumber(r,{unit:`week`}):uN(r,t.length)},d:function(e,t,n){return t===`do`?n.ordinalNumber(e.getDate(),{unit:`date`}):dN.d(e,t)},D:function(e,t,n){let r=aN(e);return t===`Do`?n.ordinalNumber(r,{unit:`dayOfYear`}):uN(r,t.length)},E:function(e,t,n){let r=e.getDay();switch(t){case`E`:case`EE`:case`EEE`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`EEEEE`:return n.day(r,{width:`narrow`,context:`formatting`});case`EEEEEE`:return n.day(r,{width:`short`,context:`formatting`});case`EEEE`:default:return n.day(r,{width:`wide`,context:`formatting`})}},e:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`e`:return String(a);case`ee`:return uN(a,2);case`eo`:return n.ordinalNumber(a,{unit:`day`});case`eee`:return n.day(i,{width:`abbreviated`,context:`formatting`});case`eeeee`:return n.day(i,{width:`narrow`,context:`formatting`});case`eeeeee`:return n.day(i,{width:`short`,context:`formatting`});case`eeee`:default:return n.day(i,{width:`wide`,context:`formatting`})}},c:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`c`:return String(a);case`cc`:return uN(a,t.length);case`co`:return n.ordinalNumber(a,{unit:`day`});case`ccc`:return n.day(i,{width:`abbreviated`,context:`standalone`});case`ccccc`:return n.day(i,{width:`narrow`,context:`standalone`});case`cccccc`:return n.day(i,{width:`short`,context:`standalone`});case`cccc`:default:return n.day(i,{width:`wide`,context:`standalone`})}},i:function(e,t,n){let r=e.getDay(),i=r===0?7:r;switch(t){case`i`:return String(i);case`ii`:return uN(i,t.length);case`io`:return n.ordinalNumber(i,{unit:`day`});case`iii`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`iiiii`:return n.day(r,{width:`narrow`,context:`formatting`});case`iiiiii`:return n.day(r,{width:`short`,context:`formatting`});case`iiii`:default:return n.day(r,{width:`wide`,context:`formatting`})}},a:function(e,t,n){let r=e.getHours(),i=r/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`aaa`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`aaaaa`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});case`aaaa`:default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},b:function(e,t,n){let r=e.getHours(),i;switch(i=r===12?fN.noon:r===0?fN.midnight:r/12>=1?`pm`:`am`,t){case`b`:case`bb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`bbb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`bbbbb`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});case`bbbb`:default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},B:function(e,t,n){let r=e.getHours(),i;switch(i=r>=17?fN.evening:r>=12?fN.afternoon:r>=4?fN.morning:fN.night,t){case`B`:case`BB`:case`BBB`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`BBBBB`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});case`BBBB`:default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},h:function(e,t,n){if(t===`ho`){let t=e.getHours()%12;return t===0&&(t=12),n.ordinalNumber(t,{unit:`hour`})}return dN.h(e,t)},H:function(e,t,n){return t===`Ho`?n.ordinalNumber(e.getHours(),{unit:`hour`}):dN.H(e,t)},K:function(e,t,n){let r=e.getHours()%12;return t===`Ko`?n.ordinalNumber(r,{unit:`hour`}):uN(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t===`ko`?n.ordinalNumber(r,{unit:`hour`}):uN(r,t.length)},m:function(e,t,n){return t===`mo`?n.ordinalNumber(e.getMinutes(),{unit:`minute`}):dN.m(e,t)},s:function(e,t,n){return t===`so`?n.ordinalNumber(e.getSeconds(),{unit:`second`}):dN.s(e,t)},S:function(e,t){return dN.S(e,t)},X:function(e,t,n){let r=e.getTimezoneOffset();if(r===0)return`Z`;switch(t){case`X`:return hN(r);case`XXXX`:case`XX`:return gN(r);case`XXXXX`:case`XXX`:default:return gN(r,`:`)}},x:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`x`:return hN(r);case`xxxx`:case`xx`:return gN(r);case`xxxxx`:case`xxx`:default:return gN(r,`:`)}},O:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`O`:case`OO`:case`OOO`:return`GMT`+mN(r,`:`);case`OOOO`:default:return`GMT`+gN(r,`:`)}},z:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`z`:case`zz`:case`zzz`:return`GMT`+mN(r,`:`);case`zzzz`:default:return`GMT`+gN(r,`:`)}},t:function(e,t,n){let r=Math.trunc(e/1e3);return uN(r,t.length)},T:function(e,t,n){return uN(+e,t.length)}};function mN(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=Math.trunc(r/60),a=r%60;return a===0?n+String(i):n+String(i)+t+uN(a,2)}function hN(e,t){if(e%60==0){let t=e>0?`-`:`+`;return t+uN(Math.abs(e)/60,2)}return gN(e,t)}function gN(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=uN(Math.trunc(r/60),2),a=uN(r%60,2);return n+i+t+a}const _N=(e,t)=>{switch(e){case`P`:return t.date({width:`short`});case`PP`:return t.date({width:`medium`});case`PPP`:return t.date({width:`long`});case`PPPP`:default:return t.date({width:`full`})}},vN=(e,t)=>{switch(e){case`p`:return t.time({width:`short`});case`pp`:return t.time({width:`medium`});case`ppp`:return t.time({width:`long`});case`pppp`:default:return t.time({width:`full`})}},yN=(e,t)=>{let n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return _N(e,t);let a;switch(r){case`P`:a=t.dateTime({width:`short`});break;case`PP`:a=t.dateTime({width:`medium`});break;case`PPP`:a=t.dateTime({width:`long`});break;case`PPPP`:default:a=t.dateTime({width:`full`});break}return a.replace(`{{date}}`,_N(r,t)).replace(`{{time}}`,vN(i,t))},bN={p:vN,P:yN},xN=/^D+$/,SN=/^Y+$/,CN=[`D`,`DD`,`YY`,`YYYY`];function wN(e){return xN.test(e)}function TN(e){return SN.test(e)}function EN(e,t,n){let r=DN(e,t,n);if(console.warn(r),CN.includes(e))throw RangeError(r)}function DN(e,t,n){let r=e[0]===`Y`?`years`:`days of the month`;return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const ON=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,kN=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,AN=/^'([^]*?)'?$/,jN=/''/g,MN=/[a-zA-Z]/;function NN(e,t,n){let r=dM(),i=n?.locale??r.locale??iN,a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,s=lM(e,n?.in);if(!xM(s))throw RangeError(`Invalid time value`);let c=t.match(kN).map(e=>{let t=e[0];if(t===`p`||t===`P`){let n=bN[t];return n(e,i.formatLong)}return e}).join(``).match(ON).map(e=>{if(e===`''`)return{isToken:!1,value:`'`};let t=e[0];if(t===`'`)return{isToken:!1,value:PN(e)};if(pN[t])return{isToken:!0,value:e};if(t.match(MN))throw RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});i.localize.preprocessor&&(c=i.localize.preprocessor(s,c));let l={firstWeekContainsDate:a,weekStartsOn:o,locale:i};return c.map(r=>{if(!r.isToken)return r.value;let a=r.value;(!n?.useAdditionalWeekYearTokens&&TN(a)||!n?.useAdditionalDayOfYearTokens&&wN(a))&&EN(a,t,String(e));let o=pN[a[0]];return o(s,a,i.localize,l)}).join(``)}function PN(e){let t=e.match(AN);return t?t[1].replace(jN,`'`):e}function FN(e,t){return lM(e*1e3,t?.in)}function IN(e,t){let n=LN(t)?new t(0):cM(t,0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n}function LN(e){return typeof e==`function`&&e.prototype?.constructor===e}function RN(e,t){if(t===void 0)return e.trimEnd();let n=e.length;switch(typeof t){case`string`:if(t.length!==1)throw Error(`The 'chars' parameter should be a single character string.`);for(;n>0&&e[n-1]===t;)n--;break;case`object`:for(;n>0&&t.includes(e[n-1]);)n--}return e.substring(0,n)}function zN(e){return e==null}function BN(e){return e!=null}async function VN(){if(typeof window<`u`&&window!==null)return`browser`;try{let e=await S(()=>import(`./__vite-browser-external-hz9OYH6e.js`).then(mn(1)),__vite__mapDeps([0,1,2]));return e!==void 0&&e.versions!=null&&e.versions.node!=null?`node`:`unknown`}catch{return`unknown`}}function HN(e){return zN(e)?!1:DD.isInt(e.type)&&!JN(e)||UN(e)}function UN(e){return zN(e)?!1:DD.isInt(e.type)&&e.type.isSigned===!1}function WN(e){return zN(e)?!1:DD.isFloat(e.type)??!1}function GN(e){return zN(e)?!1:DD.isDecimal(e.type)}function KN(e){return zN(e)?!1:DD.isBool(e.type)}function qN(e){return zN(e)?!1:DD.isDuration(e.type)}function JN(e){return zN(e)?!1:DD.isInt(e.type)&&e.metadata.get(`ARROW:extension:name`)===`period`}function YN(e){return zN(e)?!1:DD.isTimestamp(e.type)}function XN(e){return zN(e)?!1:DD.isDate(e.type)}function ZN(e){return zN(e)?!1:DD.isTime(e.type)}function QN(e){return zN(e)?!1:DD.isList(e.type)||DD.isFixedSizeList(e.type)}function $N(e){return zN(e)?!1:DD.isStruct(e.type)||DD.isMap(e.type)}function eP(e){return zN(e)?!1:DD.isStruct(e.type)&&e.metadata.get(`ARROW:extension:name`)===`interval`||DD.isInterval(e.type)}const tP=new Date(1970,0,1);function nP(e,t){let n;if(t===RE.MILLISECOND)n=1e3;else if(t===RE.MICROSECOND)n=1e3*1e3;else if(t===RE.NANOSECOND)n=1e3*1e3*1e3;else return Number(e);return typeof e==`bigint`&&!Number.isSafeInteger(Number(e))?Number(e/BigInt(n)):Number(e)/n}function rP(e,t){let n=nP(e,t?.type?.unit??RE.SECOND);return FN(n)}function iP(e,t){let n=rP(e,t);return NN(n,n.getMilliseconds()===0?`HH:mm:ss`:`HH:mm:ss.SSS`)}function aP(e){let t=`yyyy-MM-dd`;return e instanceof Date||typeof e==`number`&&Number.isFinite(e)?NN(e,t):(console.warn(`Unsupported date value: ${e}`),String(e))}function oP(e,t){if(!(e instanceof Date||typeof e==`number`&&Number.isFinite(e)))return console.warn(`Unsupported datetime value: ${e}`),null;let n,r=t?.type?.timezone;return n=r?new jT(e,r):new jT(e),IN(n,Date)}function sP(e,t){let n=t?.type?.scale||0,r=Xj.bigNumToString(new Xj.BN(e)).padStart(n,`0`);if(n===0)return r;let i=``;r.startsWith(`-`)&&(i=`-`,r=r.slice(1));let a=r.slice(0,-n)||`0`,o=RN(r.slice(-n),`0`)||``;return`${i}${a}${o?`.${o}`:``}`}const cP=new Intl.NumberFormat(`en-US`,{style:`decimal`,maximumFractionDigits:4,minimumFractionDigits:4,useGrouping:!0});function lP(e){let t=e[0],n=e[1],r=[];return t!==0&&r.push(`${t} year${t>1?`s`:``}`),n!==0&&r.push(`${n} month${n>1?`s`:``}`),r.length?r.join(` `):`0 months`}function uP(e,t){if(DD.isInterval(t?.type))return lP(e);let n=t&&t.metadata.get(`ARROW:extension:name`);if(n&&n===`pandas.interval`){let n=JSON.parse(t.metadata.get(`ARROW:extension:metadata`)),{closed:r}=n,i=e.toJSON(),a=r===`both`||r===`left`?`[`:`(`,o=r===`both`||r===`right`?`]`:`)`,s=fP(i.left,t.type?.children?.[0]),c=fP(i.right,t.type?.children?.[1]);return`${a+s}, ${c+o}`}return String(e)}function dP(e,t){return t?.type instanceof eO?JSON.parse(JSON.stringify(e,(e,t)=>{if(BN(t))return typeof t==`bigint`?Number(t):t})):JSON.parse(JSON.stringify(e,(e,t)=>typeof t==`bigint`?Number(t):t))}function fP(e,t){if(zN(e))return null;let n=e instanceof Date||Number.isFinite(e);if(n&&XN(t))return aP(e);if(typeof e==`bigint`&&ZN(t))return iP(Number(e),t);if(n&&YN(t))return oP(e,t);if(JN(t))throw Error(`Period type is not supported yet`);if(eP(t))return uP(e,t);if(qN(t))throw Error(`Duration type is not supported yet`);return GN(t)?sP(e,t):WN(t)&&Number.isFinite(e)||HN(t)?e:$N(t)||QN(t)?dP(e,t):KN(t)?!!e:String(e)}function pP(e){let t=(e.toArray()||[]).map(e=>e.toJSON())||[],n=t.map(t=>(e.schema.fields.forEach(e=>t[e.name]=fP(t[e.name],e)),t));return n}let mP=function(e){return e.ORIGIN_PRIVATE_FS=`origin-private-fs`,e.NODE_FS=`node-fs`,e}({});async function hP(e){let t=j(e,{logger:!1}),n,r,i=await VN();if(i===`browser`){if(t.bundles===void 0){let{getBundles:e}=await S(async()=>{let{getBundles:e}=await import(`./default-browser-BsyDD-mc.js`);return{getBundles:e}},[]);t.bundles=await e()}r=await CT(await t.bundles),n=new Worker(r.mainWorker)}else if(i===`node`){if(t.bundles===void 0){let{getBundles:e}=await S(async()=>{let{getBundles:e}=await import(`./default-node-BiFBkIjL.js`);return{getBundles:e}},__vite__mapDeps([3,1,2]));t.bundles=await e()}r=await CT(await t.bundles);let e=r.mainWorker;e.startsWith(`/@fs/`)&&(e=e.replace(`/@fs/`,`file://`));let i=await S(()=>import(`./browser-CoZYwbon.js`),[]);n=new i.default(e,{type:`module`})}else throw Error(`Unsupported environment: ${i}`);let a;a=t.logger===!0?new Vw:t.logger===!1?new Bw:t.logger;let o=new Qw(a,n);if(await o.instantiate(r.mainModule,r.pthreadWorker),t.storage)switch(t.storage.type){case mP.ORIGIN_PRIVATE_FS:try{let e=t.storage.path;e.startsWith(`/`)&&(e=e.slice(1)),await o.open({path:`opfs://${e}`,accessMode:t.storage.accessMode})}catch(e){throw await o.terminate(),await n.terminate(),e}break;case mP.NODE_FS:try{await o.open({path:t.storage.path,accessMode:t.storage.accessMode,useDirectIO:!0})}catch(e){throw await o.terminate(),await n.terminate(),e}break}let s=await o.connect();async function c(e,t=[]){if(!t||t.length===0){let t=await s.query(e);return{_results:t,_schema:t.schema,columns:t.schema.fields,rows:pP(t)}}let n=await s.prepare(e),r=await n.query(...t);return n.close(),{_results:r,_schema:r.schema,columns:r.schema.fields,rows:pP(r)}}return{worker:n,db:o,conn:s,query:async(e,t=[])=>c(e,t).then(e=>e.rows),queryWithColumns:async(e,t=[])=>c(e,t),close:async()=>{await s.close(),await o.terminate(),await n.terminate()}}}async function gP(e,t){await(await e).conn.send(`BEGIN TRANSACTION`);try{let n=await t(e);return await(await e).conn.send(`COMMIT`),n}catch(t){throw await(await e).conn.send(`ROLLBACK`),t}}async function _P(e,t,n){await(await e).conn.send(`SAVEPOINT ${t}`);try{let r=await n(e);return await(await e).conn.send(`RELEASE SAVEPOINT ${t}`),r}catch(n){throw await(await e).conn.send(`ROLLBACK TO SAVEPOINT ${t}`),n}}const Y=Symbol.for(`drizzle:entityKind`),vP=Symbol.for(`drizzle:hasOwnEntityKind`);function X(e,t){if(!e||typeof e!=`object`)return!1;if(e instanceof t)return!0;if(!Object.prototype.hasOwnProperty.call(t,Y))throw Error(`Class "${t.name??``}" doesn't look like a Drizzle entity. If this is incorrect and the class is provided by Drizzle, please report this as a bug.`);let n=Object.getPrototypeOf(e).constructor;if(n)for(;n;){if(Y in n&&n[Y]===t[Y])return!0;n=Object.getPrototypeOf(n)}return!1}var yP=class{constructor(e,t){this.table=e,this.config=t,this.name=t.name,this.keyAsName=t.keyAsName,this.notNull=t.notNull,this.default=t.default,this.defaultFn=t.defaultFn,this.onUpdateFn=t.onUpdateFn,this.hasDefault=t.hasDefault,this.primary=t.primaryKey,this.isUnique=t.isUnique,this.uniqueName=t.uniqueName,this.uniqueType=t.uniqueType,this.dataType=t.dataType,this.columnType=t.columnType,this.generated=t.generated,this.generatedIdentity=t.generatedIdentity}static[Y]=`Column`;name;keyAsName;primary;notNull;default;defaultFn;onUpdateFn;hasDefault;isUnique;uniqueName;uniqueType;dataType;columnType;enumValues=void 0;generated=void 0;generatedIdentity=void 0;config;mapFromDriverValue(e){return e}mapToDriverValue(e){return e}shouldDisableInsert(){return this.config.generated!==void 0&&this.config.generated.type!==`byDefault`}},bP=class{static[Y]=`ColumnBuilder`;config;constructor(e,t,n){this.config={name:e,keyAsName:e===``,notNull:!1,default:void 0,hasDefault:!1,primaryKey:!1,isUnique:!1,uniqueName:void 0,uniqueType:void 0,dataType:t,columnType:n,generated:void 0}}$type(){return this}notNull(){return this.config.notNull=!0,this}default(e){return this.config.default=e,this.config.hasDefault=!0,this}$defaultFn(e){return this.config.defaultFn=e,this.config.hasDefault=!0,this}$default=this.$defaultFn;$onUpdateFn(e){return this.config.onUpdateFn=e,this.config.hasDefault=!0,this}$onUpdate=this.$onUpdateFn;primaryKey(){return this.config.primaryKey=!0,this.config.notNull=!0,this}setName(e){this.config.name===``&&(this.config.name=e)}};const xP=Symbol.for(`drizzle:Name`);var SP=class{static[Y]=`PgForeignKeyBuilder`;reference;_onUpdate=`no action`;_onDelete=`no action`;constructor(e,t){this.reference=()=>{let{name:t,columns:n,foreignColumns:r}=e();return{name:t,columns:n,foreignTable:r[0].table,foreignColumns:r}},t&&(this._onUpdate=t.onUpdate,this._onDelete=t.onDelete)}onUpdate(e){return this._onUpdate=e===void 0?`no action`:e,this}onDelete(e){return this._onDelete=e===void 0?`no action`:e,this}build(e){return new CP(e,this)}},CP=class{constructor(e,t){this.table=e,this.reference=t.reference,this.onUpdate=t._onUpdate,this.onDelete=t._onDelete}static[Y]=`PgForeignKey`;reference;onUpdate;onDelete;getName(){let{name:e,columns:t,foreignColumns:n}=this.reference(),r=t.map(e=>e.name),i=n.map(e=>e.name),a=[this.table[xP],...r,n[0].table[xP],...i];return e??`${a.join(`_`)}_fk`}};function wP(e,...t){return e(...t)}function TP(e,t){return`${e[xP]}_${t.join(`_`)}_unique`}var EP=class{constructor(e,t){this.name=t,this.columns=e}static[Y]=`PgUniqueConstraintBuilder`;columns;nullsNotDistinctConfig=!1;nullsNotDistinct(){return this.nullsNotDistinctConfig=!0,this}build(e){return new OP(e,this.columns,this.nullsNotDistinctConfig,this.name)}},DP=class{static[Y]=`PgUniqueOnConstraintBuilder`;name;constructor(e){this.name=e}on(...e){return new EP(e,this.name)}},OP=class{constructor(e,t,n,r){this.table=e,this.columns=t,this.name=r??TP(this.table,this.columns.map(e=>e.name)),this.nullsNotDistinct=n}static[Y]=`PgUniqueConstraint`;columns;name;nullsNotDistinct=!1;getName(){return this.name}};function kP(e,t,n){for(let r=t;rArray.isArray(e)?MP(e):typeof e==`string`?`"${e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}"`:`${e}`).join(`,`)}}`}var NP=class extends bP{foreignKeyConfigs=[];static[Y]=`PgColumnBuilder`;array(e){return new LP(this.config.name,this,e)}references(e,t={}){return this.foreignKeyConfigs.push({ref:e,actions:t}),this}unique(e,t){return this.config.isUnique=!0,this.config.uniqueName=e,this.config.uniqueType=t?.nulls,this}generatedAlwaysAs(e){return this.config.generated={as:e,type:`always`,mode:`stored`},this}buildForeignKeys(e,t){return this.foreignKeyConfigs.map(({ref:n,actions:r})=>wP((n,r)=>{let i=new SP(()=>{let t=n();return{columns:[e],foreignColumns:[t]}});return r.onUpdate&&i.onUpdate(r.onUpdate),r.onDelete&&i.onDelete(r.onDelete),i.build(t)},n,r))}buildExtraConfigColumn(e){return new FP(e,this.config)}},PP=class extends yP{constructor(e,t){t.uniqueName||=TP(e,[t.name]),super(e,t),this.table=e}static[Y]=`PgColumn`},FP=class extends PP{static[Y]=`ExtraConfigColumn`;getSQLType(){return this.getSQLType()}indexConfig={order:this.config.order??`asc`,nulls:this.config.nulls??`last`,opClass:this.config.opClass};defaultConfig={order:`asc`,nulls:`last`,opClass:void 0};asc(){return this.indexConfig.order=`asc`,this}desc(){return this.indexConfig.order=`desc`,this}nullsFirst(){return this.indexConfig.nulls=`first`,this}nullsLast(){return this.indexConfig.nulls=`last`,this}op(e){return this.indexConfig.opClass=e,this}},IP=class{static[Y]=`IndexedColumn`;constructor(e,t,n,r){this.name=e,this.keyAsName=t,this.type=n,this.indexConfig=r}name;keyAsName;type;indexConfig},LP=class extends NP{static[Y]=`PgArrayBuilder`;constructor(e,t,n){super(e,`array`,`PgArray`),this.config.baseBuilder=t,this.config.size=n}build(e){let t=this.config.baseBuilder.build(e);return new RP(e,this.config,t)}},RP=class e extends PP{constructor(e,t,n,r){super(e,t),this.baseColumn=n,this.range=r,this.size=t.size}size;static[Y]=`PgArray`;getSQLType(){return`${this.baseColumn.getSQLType()}[${typeof this.size==`number`?this.size:``}]`}mapFromDriverValue(e){return typeof e==`string`&&(e=jP(e)),e.map(e=>this.baseColumn.mapFromDriverValue(e))}mapToDriverValue(t,n=!1){let r=t.map(t=>t===null?null:X(this.baseColumn,e)?this.baseColumn.mapToDriverValue(t,!0):this.baseColumn.mapToDriverValue(t));return n?r:MP(r)}},zP=class extends NP{static[Y]=`PgEnumObjectColumnBuilder`;constructor(e,t){super(e,`string`,`PgEnumObjectColumn`),this.config.enum=t}build(e){return new BP(e,this.config)}},BP=class extends PP{static[Y]=`PgEnumObjectColumn`;enum;enumValues=this.config.enum.enumValues;constructor(e,t){super(e,t),this.enum=t.enum}getSQLType(){return this.enum.enumName}};const VP=Symbol.for(`drizzle:isPgEnum`);function HP(e){return!!e&&typeof e==`function`&&VP in e&&e[VP]===!0}var UP=class extends NP{static[Y]=`PgEnumColumnBuilder`;constructor(e,t){super(e,`string`,`PgEnumColumn`),this.config.enum=t}build(e){return new WP(e,this.config)}},WP=class extends PP{static[Y]=`PgEnumColumn`;enum=this.config.enum;enumValues=this.config.enum.enumValues;constructor(e,t){super(e,t),this.enum=t.enum}getSQLType(){return this.enum.enumName}},GP=class{static[Y]=`Subquery`;constructor(e,t,n,r=!1,i=[]){this._={brand:`Subquery`,sql:e,selectedFields:t,alias:n,isWith:r,usedTables:i}}},KP=class extends GP{static[Y]=`WithSubquery`},qP=`0.44.2`;let JP,YP;const XP={startActiveSpan(e,t){return JP?(YP||=JP.trace.getTracer(`drizzle-orm`,qP),wP((n,r)=>r.startActiveSpan(e,e=>{try{return t(e)}catch(t){throw e.setStatus({code:n.SpanStatusCode.ERROR,message:t instanceof Error?t.message:`Unknown error`}),t}finally{e.end()}}),JP,YP)):t()}},ZP=Symbol.for(`drizzle:ViewBaseConfig`),QP=Symbol.for(`drizzle:Schema`),$P=Symbol.for(`drizzle:Columns`),eF=Symbol.for(`drizzle:ExtraConfigColumns`),tF=Symbol.for(`drizzle:OriginalName`),nF=Symbol.for(`drizzle:BaseName`),rF=Symbol.for(`drizzle:IsAlias`),iF=Symbol.for(`drizzle:ExtraConfigBuilder`),aF=Symbol.for(`drizzle:IsDrizzleTable`);var oF=class{static[Y]=`Table`;static Symbol={Name:xP,Schema:QP,OriginalName:tF,Columns:$P,ExtraConfigColumns:eF,BaseName:nF,IsAlias:rF,ExtraConfigBuilder:iF};[xP];[tF];[QP];[$P];[eF];[nF];[rF]=!1;[aF]=!0;[iF]=void 0;constructor(e,t,n){this[xP]=this[tF]=e,this[QP]=t,this[nF]=n}};function sF(e){return e[xP]}function cF(e){return`${e[QP]??`public`}.${e[xP]}`}var lF=class{static[Y]=`FakePrimitiveParam`};function uF(e){return e!=null&&typeof e.getSQL==`function`}function dF(e){let t={sql:``,params:[]};for(let n of e)t.sql+=n.sql,t.params.push(...n.params),n.typings?.length&&(t.typings||=[],t.typings.push(...n.typings));return t}var fF=class{static[Y]=`StringChunk`;value;constructor(e){this.value=Array.isArray(e)?e:[e]}getSQL(){return new pF([this])}},pF=class e{constructor(e){this.queryChunks=e;for(let t of e)if(X(t,oF)){let e=t[oF.Symbol.Schema];this.usedTables.push(e===void 0?t[oF.Symbol.Name]:e+`.`+t[oF.Symbol.Name])}}static[Y]=`SQL`;decoder=gF;shouldInlineParams=!1;usedTables=[];append(e){return this.queryChunks.push(...e.queryChunks),this}toQuery(e){return XP.startActiveSpan(`drizzle.buildSQL`,t=>{let n=this.buildQueryFromSourceParams(this.queryChunks,e);return t?.setAttributes({"drizzle.query.text":n.sql,"drizzle.query.params":JSON.stringify(n.params)}),n})}buildQueryFromSourceParams(t,n){let r=Object.assign({},n,{inlineParams:n.inlineParams||this.shouldInlineParams,paramStartIndex:n.paramStartIndex||{value:0}}),{casing:i,escapeName:a,escapeParam:o,prepareTyping:s,inlineParams:c,paramStartIndex:l}=r;return dF(t.map(t=>{if(X(t,fF))return{sql:t.value.join(``),params:[]};if(X(t,mF))return{sql:a(t.value),params:[]};if(t===void 0)return{sql:``,params:[]};if(Array.isArray(t)){let e=[new fF(`(`)];for(let[n,r]of t.entries())e.push(r),ne},_F={mapToDriverValue:e=>e},vF={...gF,..._F};var yF=class{constructor(e,t=_F){this.value=e,this.encoder=t}static[Y]=`Param`;brand;getSQL(){return new pF([this])}};function Z(e,...t){let n=[];(t.length>0||e.length>0&&e[0]!==``)&&n.push(new fF(e[0]));for(let[r,i]of t.entries())n.push(i,new fF(e[r+1]));return new pF(n)}(e=>{function t(){return new pF([])}e.empty=t;function n(e){return new pF(e)}e.fromList=n;function r(e){return new pF([new fF(e)])}e.raw=r;function i(e,t){let n=[];for(let[r,i]of e.entries())r>0&&t!==void 0&&n.push(t),n.push(i);return new pF(n)}e.join=i;function a(e){return new mF(e)}e.identifier=a;function o(e){return new bF(e)}e.placeholder=o;function s(e,t){return new yF(e,t)}e.param=s})(Z||={}),(e=>{class t{constructor(e,t){this.sql=e,this.fieldAlias=t}static[Y]=`SQL.Aliased`;isSelectionField=!1;getSQL(){return this.sql}clone(){return new t(this.sql,this.fieldAlias)}}e.Aliased=t})(pF||={});var bF=class{constructor(e){this.name=e}static[Y]=`Placeholder`;getSQL(){return new pF([this])}};function xF(e,t){return e.map(e=>{if(X(e,bF)){if(!(e.name in t))throw Error(`No value for placeholder "${e.name}" was provided`);return t[e.name]}if(X(e,yF)&&X(e.value,bF)){if(!(e.value.name in t))throw Error(`No value for placeholder "${e.value.name}" was provided`);return e.encoder.mapToDriverValue(t[e.value.name])}return e})}const SF=Symbol.for(`drizzle:IsDrizzleView`);var CF=class{static[Y]=`View`;[ZP];[SF]=!0;constructor({name:e,schema:t,selectedFields:n,query:r}){this[ZP]={name:e,originalName:e,schema:t,selectedFields:n,query:r,isExisting:!r,isAlias:!1}}getSQL(){return new pF([this])}};yP.prototype.getSQL=function(){return new pF([this])},oF.prototype.getSQL=function(){return new pF([this])},GP.prototype.getSQL=function(){return new pF([this])};var wF=class{constructor(e){this.table=e}static[Y]=`ColumnAliasProxyHandler`;get(e,t){return t===`table`?this.table:e[t]}},TF=class{constructor(e,t){this.alias=e,this.replaceOriginalName=t}static[Y]=`TableAliasProxyHandler`;get(e,t){if(t===oF.Symbol.IsAlias)return!0;if(t===oF.Symbol.Name||this.replaceOriginalName&&t===oF.Symbol.OriginalName)return this.alias;if(t===ZP)return{...e[ZP],name:this.alias,isAlias:!0};if(t===oF.Symbol.Columns){let t=e[oF.Symbol.Columns];if(!t)return t;let n={};return Object.keys(t).map(r=>{n[r]=new Proxy(t[r],new wF(new Proxy(e,this)))}),n}let n=e[t];return X(n,yP)?new Proxy(n,new wF(new Proxy(e,this))):n}},EF=class{constructor(e){this.alias=e}static[Y]=`RelationTableAliasProxyHandler`;get(e,t){return t===`sourceTable`?DF(e.sourceTable,this.alias):e[t]}};function DF(e,t){return new Proxy(e,new TF(t,!1))}function OF(e,t){return new Proxy(e,new wF(new Proxy(e.table,new TF(t,!1))))}function kF(e,t){return new pF.Aliased(AF(e.sql,t),e.fieldAlias)}function AF(e,t){return Z.join(e.queryChunks.map(e=>X(e,yP)?OF(e,t):X(e,pF)?AF(e,t):X(e,pF.Aliased)?kF(e,t):e))}var jF=class extends Error{static[Y]=`DrizzleError`;constructor({message:e,cause:t}){super(e),this.name=`DrizzleError`,this.cause=t}},MF=class extends jF{static[Y]=`TransactionRollbackError`;constructor(){super({message:`Rollback`})}},NF=class{static[Y]=`ConsoleLogWriter`;write(e){console.log(e)}},PF=class{static[Y]=`DefaultLogger`;writer;constructor(e){this.writer=e?.writer??new NF}logQuery(e,t){let n=t.map(e=>{try{return JSON.stringify(e)}catch{return String(e)}}),r=n.length?` -- params: [${n.join(`, `)}]`:``;this.writer.write(`Query: ${e}${r}`)}},FF=class{static[Y]=`NoopLogger`;logQuery(){}},IF=class{static[Y]=`QueryPromise`;[Symbol.toStringTag]=`QueryPromise`;catch(e){return this.then(void 0,e)}finally(e){return this.then(t=>(e?.(),t),t=>{throw e?.(),t})}then(e,t){return this.execute().then(e,t)}};function LF(e,t){return Object.entries(e).reduce((e,[n,r])=>{if(typeof n!=`string`)return e;let i=t?[...t,n]:[n];return X(r,yP)||X(r,pF)||X(r,pF.Aliased)?e.push({path:i,field:r}):X(r,oF)?e.push(...LF(r[oF.Symbol.Columns],i)):e.push(...LF(r,i)),e},[])}function RF(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let[e,t]of n.entries())if(t!==r[e])return!1;return!0}function zF(e,t){let n=Object.entries(t).filter(([,e])=>e!==void 0).map(([t,n])=>X(n,pF)||X(n,yP)?[t,n]:[t,new yF(n,e[oF.Symbol.Columns][t])]);if(n.length===0)throw Error(`No values to set`);return Object.fromEntries(n)}function BF(e,t){for(let n of t)for(let t of Object.getOwnPropertyNames(n.prototype)){if(t===`constructor`)continue;Object.defineProperty(e.prototype,t,Object.getOwnPropertyDescriptor(n.prototype,t)||Object.create(null))}}function VF(e){return e[oF.Symbol.Columns]}function HF(e){return X(e,GP)?e._.alias:X(e,CF)?e[ZP].name:X(e,pF)?void 0:e[oF.Symbol.IsAlias]?e[oF.Symbol.Name]:e[oF.Symbol.BaseName]}function UF(e){if(typeof e!=`object`||!e||e.constructor.name!==`Object`)return!1;if(`logger`in e){let t=typeof e.logger;return!(t!==`boolean`&&(t!==`object`||typeof e.logger.logQuery!=`function`)&&t!==`undefined`)}if(`schema`in e){let t=typeof e.schema;return!(t!==`object`&&t!==`undefined`)}if(`casing`in e){let t=typeof e.casing;return!(t!==`string`&&t!==`undefined`)}if(`mode`in e)return!(e.mode!==`default`||e.mode!==`planetscale`||e.mode!==void 0);if(`connection`in e){let t=typeof e.connection;return!(t!==`string`&&t!==`object`&&t!==`undefined`)}if(`client`in e){let t=typeof e.client;return!(t!==`object`&&t!==`function`&&t!==`undefined`)}return Object.keys(e).length===0}var WF=class extends NP{static[Y]=`PgDateColumnBaseBuilder`;defaultNow(){return this.default(Z`now()`)}},GF=class extends WF{static[Y]=`PgDateBuilder`;constructor(e){super(e,`date`,`PgDate`)}build(e){return new KF(e,this.config)}},KF=class extends PP{static[Y]=`PgDate`;getSQLType(){return`date`}mapFromDriverValue(e){return new Date(e)}mapToDriverValue(e){return e.toISOString()}},qF=class extends WF{static[Y]=`PgDateStringBuilder`;constructor(e){super(e,`string`,`PgDateString`)}build(e){return new JF(e,this.config)}},JF=class extends PP{static[Y]=`PgDateString`;getSQLType(){return`date`}},YF=class extends NP{static[Y]=`PgJsonBuilder`;constructor(e){super(e,`json`,`PgJson`)}build(e){return new XF(e,this.config)}},XF=class extends PP{static[Y]=`PgJson`;constructor(e,t){super(e,t)}getSQLType(){return`json`}mapToDriverValue(e){return JSON.stringify(e)}mapFromDriverValue(e){if(typeof e==`string`)try{return JSON.parse(e)}catch{return e}return e}},ZF=class extends NP{static[Y]=`PgJsonbBuilder`;constructor(e){super(e,`json`,`PgJsonb`)}build(e){return new QF(e,this.config)}},QF=class extends PP{static[Y]=`PgJsonb`;constructor(e,t){super(e,t)}getSQLType(){return`jsonb`}mapToDriverValue(e){return JSON.stringify(e)}mapFromDriverValue(e){if(typeof e==`string`)try{return JSON.parse(e)}catch{return e}return e}},$F=class extends NP{static[Y]=`PgNumericBuilder`;constructor(e,t,n){super(e,`string`,`PgNumeric`),this.config.precision=t,this.config.scale=n}build(e){return new eI(e,this.config)}},eI=class extends PP{static[Y]=`PgNumeric`;precision;scale;constructor(e,t){super(e,t),this.precision=t.precision,this.scale=t.scale}mapFromDriverValue(e){return typeof e==`string`?e:String(e)}getSQLType(){return this.precision!==void 0&&this.scale!==void 0?`numeric(${this.precision}, ${this.scale})`:this.precision===void 0?`numeric`:`numeric(${this.precision})`}},tI=class extends NP{static[Y]=`PgNumericNumberBuilder`;constructor(e,t,n){super(e,`number`,`PgNumericNumber`),this.config.precision=t,this.config.scale=n}build(e){return new nI(e,this.config)}},nI=class extends PP{static[Y]=`PgNumericNumber`;precision;scale;constructor(e,t){super(e,t),this.precision=t.precision,this.scale=t.scale}mapFromDriverValue(e){return typeof e==`number`?e:Number(e)}mapToDriverValue=String;getSQLType(){return this.precision!==void 0&&this.scale!==void 0?`numeric(${this.precision}, ${this.scale})`:this.precision===void 0?`numeric`:`numeric(${this.precision})`}},rI=class extends NP{static[Y]=`PgNumericBigIntBuilder`;constructor(e,t,n){super(e,`bigint`,`PgNumericBigInt`),this.config.precision=t,this.config.scale=n}build(e){return new iI(e,this.config)}},iI=class extends PP{static[Y]=`PgNumericBigInt`;precision;scale;constructor(e,t){super(e,t),this.precision=t.precision,this.scale=t.scale}mapFromDriverValue=BigInt;mapToDriverValue=String;getSQLType(){return this.precision!==void 0&&this.scale!==void 0?`numeric(${this.precision}, ${this.scale})`:this.precision===void 0?`numeric`:`numeric(${this.precision})`}},aI=class extends WF{constructor(e,t,n){super(e,`string`,`PgTime`),this.withTimezone=t,this.precision=n,this.config.withTimezone=t,this.config.precision=n}static[Y]=`PgTimeBuilder`;build(e){return new oI(e,this.config)}},oI=class extends PP{static[Y]=`PgTime`;withTimezone;precision;constructor(e,t){super(e,t),this.withTimezone=t.withTimezone,this.precision=t.precision}getSQLType(){let e=this.precision===void 0?``:`(${this.precision})`;return`time${e}${this.withTimezone?` with time zone`:``}`}},sI=class extends WF{static[Y]=`PgTimestampBuilder`;constructor(e,t,n){super(e,`date`,`PgTimestamp`),this.config.withTimezone=t,this.config.precision=n}build(e){return new cI(e,this.config)}},cI=class extends PP{static[Y]=`PgTimestamp`;withTimezone;precision;constructor(e,t){super(e,t),this.withTimezone=t.withTimezone,this.precision=t.precision}getSQLType(){let e=this.precision===void 0?``:` (${this.precision})`;return`timestamp${e}${this.withTimezone?` with time zone`:``}`}mapFromDriverValue=e=>new Date(this.withTimezone?e:e+`+0000`);mapToDriverValue=e=>e.toISOString()},lI=class extends WF{static[Y]=`PgTimestampStringBuilder`;constructor(e,t,n){super(e,`string`,`PgTimestampString`),this.config.withTimezone=t,this.config.precision=n}build(e){return new uI(e,this.config)}},uI=class extends PP{static[Y]=`PgTimestampString`;withTimezone;precision;constructor(e,t){super(e,t),this.withTimezone=t.withTimezone,this.precision=t.precision}getSQLType(){let e=this.precision===void 0?``:`(${this.precision})`;return`timestamp${e}${this.withTimezone?` with time zone`:``}`}},dI=class extends NP{static[Y]=`PgUUIDBuilder`;constructor(e){super(e,`string`,`PgUUID`)}defaultRandom(){return this.default(Z`gen_random_uuid()`)}build(e){return new fI(e,this.config)}},fI=class extends PP{static[Y]=`PgUUID`;getSQLType(){return`uuid`}};const pI=Symbol.for(`drizzle:PgInlineForeignKeys`),mI=Symbol.for(`drizzle:EnableRLS`);var hI=class extends oF{static[Y]=`PgTable`;static Symbol=Object.assign({},oF.Symbol,{InlineForeignKeys:pI,EnableRLS:mI});[pI]=[];[mI]=!1;[oF.Symbol.ExtraConfigBuilder]=void 0;[oF.Symbol.ExtraConfigColumns]={}},gI=class{static[Y]=`PgPrimaryKeyBuilder`;columns;name;constructor(e,t){this.columns=e,this.name=t}build(e){return new _I(e,this.columns,this.name)}},_I=class{constructor(e,t,n){this.table=e,this.columns=t,this.name=n}static[Y]=`PgPrimaryKey`;columns;name;getName(){return this.name??`${this.table[hI.Symbol.Name]}_${this.columns.map(e=>e.name).join(`_`)}_pk`}};function vI(e,t){return hF(t)&&!uF(e)&&!X(e,yF)&&!X(e,bF)&&!X(e,yP)&&!X(e,oF)&&!X(e,CF)?new yF(e,t):e}const yI=(e,t)=>Z`${e} = ${vI(t,e)}`,bI=(e,t)=>Z`${e} <> ${vI(t,e)}`;function xI(...e){let t=e.filter(e=>e!==void 0);if(t.length!==0)return t.length===1?new pF(t):new pF([new fF(`(`),Z.join(t,new fF(` and `)),new fF(`)`)])}function SI(...e){let t=e.filter(e=>e!==void 0);if(t.length!==0)return t.length===1?new pF(t):new pF([new fF(`(`),Z.join(t,new fF(` or `)),new fF(`)`)])}function CI(e){return Z`not ${e}`}const wI=(e,t)=>Z`${e} > ${vI(t,e)}`,TI=(e,t)=>Z`${e} >= ${vI(t,e)}`,EI=(e,t)=>Z`${e} < ${vI(t,e)}`,DI=(e,t)=>Z`${e} <= ${vI(t,e)}`;function OI(e,t){return Array.isArray(t)?t.length===0?Z`false`:Z`${e} in ${t.map(t=>vI(t,e))}`:Z`${e} in ${vI(t,e)}`}function kI(e,t){return Array.isArray(t)?t.length===0?Z`true`:Z`${e} not in ${t.map(t=>vI(t,e))}`:Z`${e} not in ${vI(t,e)}`}function AI(e){return Z`${e} is null`}function jI(e){return Z`${e} is not null`}function MI(e){return Z`exists ${e}`}function NI(e){return Z`not exists ${e}`}function PI(e,t,n){return Z`${e} between ${vI(t,e)} and ${vI(n,e)}`}function FI(e,t,n){return Z`${e} not between ${vI(t,e)} and ${vI(n,e)}`}function II(e,t){return Z`${e} like ${t}`}function LI(e,t){return Z`${e} not like ${t}`}function RI(e,t){return Z`${e} ilike ${t}`}function zI(e,t){return Z`${e} not ilike ${t}`}function BI(e){return Z`${e} asc`}function VI(e){return Z`${e} desc`}var HI=class{constructor(e,t,n){this.sourceTable=e,this.referencedTable=t,this.relationName=n,this.referencedTableName=t[oF.Symbol.Name]}static[Y]=`Relation`;referencedTableName;fieldName},UI=class{constructor(e,t){this.table=e,this.config=t}static[Y]=`Relations`},WI=class e extends HI{constructor(e,t,n,r){super(e,t,n?.relationName),this.config=n,this.isNullable=r}static[Y]=`One`;withFieldName(t){let n=new e(this.sourceTable,this.referencedTable,this.config,this.isNullable);return n.fieldName=t,n}},GI=class e extends HI{constructor(e,t,n){super(e,t,n?.relationName),this.config=n}static[Y]=`Many`;withFieldName(t){let n=new e(this.sourceTable,this.referencedTable,this.config);return n.fieldName=t,n}};function KI(){return{and:xI,between:PI,eq:yI,exists:MI,gt:wI,gte:TI,ilike:RI,inArray:OI,isNull:AI,isNotNull:jI,like:II,lt:EI,lte:DI,ne:bI,not:CI,notBetween:FI,notExists:NI,notLike:LI,notIlike:zI,notInArray:kI,or:SI,sql:Z}}function qI(){return{sql:Z,asc:BI,desc:VI}}function JI(e,t){Object.keys(e).length===1&&`default`in e&&!X(e.default,oF)&&(e=e.default);let n={},r={},i={};for(let[a,o]of Object.entries(e))if(X(o,oF)){let e=cF(o),t=r[e];n[e]=a,i[a]={tsName:a,dbName:o[oF.Symbol.Name],schema:o[oF.Symbol.Schema],columns:o[oF.Symbol.Columns],relations:t?.relations??{},primaryKey:t?.primaryKey??[]};for(let e of Object.values(o[oF.Symbol.Columns]))e.primary&&i[a].primaryKey.push(e);let s=o[oF.Symbol.ExtraConfigBuilder]?.(o[oF.Symbol.ExtraConfigColumns]);if(s)for(let e of Object.values(s))X(e,gI)&&i[a].primaryKey.push(...e.columns)}else if(X(o,UI)){let e=cF(o.table),a=n[e],s=o.config(t(o.table)),c;for(let[t,n]of Object.entries(s))if(a){let e=i[a];e.relations[t]=n,c&&e.primaryKey.push(...c)}else e in r||(r[e]={relations:{},primaryKey:c}),r[e].relations[t]=n}return{tables:i,tableNamesMap:n}}function YI(e){return function(t,n){return new WI(e,t,n,n?.fields.reduce((e,t)=>e&&t.notNull,!0)??!1)}}function XI(e){return function(t,n){return new GI(e,t,n)}}function ZI(e,t,n){if(X(n,WI)&&n.config)return{fields:n.config.fields,references:n.config.references};let r=t[cF(n.referencedTable)];if(!r)throw Error(`Table "${n.referencedTable[oF.Symbol.Name]}" not found in schema`);let i=e[r];if(!i)throw Error(`Table "${r}" not found in schema`);let a=n.sourceTable,o=t[cF(a)];if(!o)throw Error(`Table "${a[oF.Symbol.Name]}" not found in schema`);let s=[];for(let e of Object.values(i.relations))(n.relationName&&n!==e&&e.relationName===n.relationName||!n.relationName&&e.referencedTable===n.sourceTable)&&s.push(e);if(s.length>1)throw n.relationName?Error(`There are multiple relations with name "${n.relationName}" in table "${r}"`):Error(`There are multiple relations between "${r}" and "${n.sourceTable[oF.Symbol.Name]}". Please specify relation name`);if(s[0]&&X(s[0],WI)&&s[0].config)return{fields:s[0].config.references,references:s[0].config.fields};throw Error(`There is not enough information to infer relation "${o}.${n.fieldName}"`)}function QI(e){return{one:YI(e),many:XI(e)}}function $I(e,t,n,r,i=e=>e){let a={};for(let[o,s]of r.entries())if(s.isJson){let r=t.relations[s.tsKey],c=n[o],l=typeof c==`string`?JSON.parse(c):c;a[s.tsKey]=X(r,WI)?l&&$I(e,e[s.relationTableTsKey],l,s.selection,i):l.map(t=>$I(e,e[s.relationTableTsKey],t,s.selection,i))}else{let e=i(n[o]),t=s.field,r;r=X(t,yP)?t:X(t,pF)?t.decoder:t.sql.decoder,a[s.tsKey]=e===null?null:r.mapFromDriverValue(e)}return a}var eL=class e{static[Y]=`SelectionProxyHandler`;config;constructor(e){this.config={...e}}get(t,n){if(n===`_`)return{...t._,selectedFields:new Proxy(t._.selectedFields,this)};if(n===ZP)return{...t[ZP],selectedFields:new Proxy(t[ZP].selectedFields,this)};if(typeof n==`symbol`)return t[n];let r=X(t,GP)?t._.selectedFields:X(t,CF)?t[ZP].selectedFields:t,i=r[n];if(X(i,pF.Aliased)){if(this.config.sqlAliasedBehavior===`sql`&&!i.isSelectionField)return i.sql;let e=i.clone();return e.isSelectionField=!0,e}if(X(i,pF)){if(this.config.sqlBehavior===`sql`)return i;throw Error(`You tried to reference "${n}" field from a subquery, which is a raw SQL field, but it doesn't have an alias declared. Please add an alias to the field using ".as('alias')" method.`)}return X(i,yP)?this.config.alias?new Proxy(i,new wF(new Proxy(i.table,new TF(this.config.alias,this.config.replaceOriginalName??!1)))):i:typeof i!=`object`||!i?i:new Proxy(i,new e(this.config))}};function tL(e){let t=e.replace(/['\u2019]/g,``).match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[];return t.map(e=>e.toLowerCase()).join(`_`)}function nL(e){let t=e.replace(/['\u2019]/g,``).match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[];return t.reduce((e,t,n)=>{let r=n===0?t.toLowerCase():`${t[0].toUpperCase()}${t.slice(1)}`;return e+r},``)}function rL(e){return e}var iL=class{static[Y]=`CasingCache`;cache={};cachedTables={};convert;constructor(e){this.convert=e===`snake_case`?tL:e===`camelCase`?nL:rL}getColumnCasing(e){if(!e.keyAsName)return e.name;let t=e.table[oF.Symbol.Schema]??`public`,n=e.table[oF.Symbol.OriginalName],r=`${t}.${n}.${e.name}`;return this.cache[r]||this.cacheTable(e.table),this.cache[r]}cacheTable(e){let t=e[oF.Symbol.Schema]??`public`,n=e[oF.Symbol.OriginalName],r=`${t}.${n}`;if(!this.cachedTables[r]){for(let t of Object.values(e[oF.Symbol.Columns])){let e=`${r}.${t.name}`;this.cache[e]=this.convert(t.name)}this.cachedTables[r]=!0}}clearCache(){this.cache={},this.cachedTables={}}},aL=class extends CF{static[Y]=`PgViewBase`},oL=class{static[Y]=`PgDialect`;casing;constructor(e){this.casing=new iL(e?.casing)}async migrate(e,t,n){let r=typeof n==`string`?`__drizzle_migrations`:n.migrationsTable??`__drizzle_migrations`,i=typeof n==`string`?`drizzle`:n.migrationsSchema??`drizzle`,a=Z` +(function(n){typeof exports==`object`&&t!==void 0?t.exports=n():typeof define==`function`&&define.amd?define([],n):(typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:this).JSZip=n()})(function(){return function e(t,n,r){function i(o,s){if(!n[o]){if(!t[o]){var c=typeof _n==`function`&&_n;if(!s&&c)return c(o,!0);if(a)return a(o,!0);var l=Error(`Cannot find module '`+o+`'`);throw l.code=`MODULE_NOT_FOUND`,l}var u=n[o]={exports:{}};t[o][0].call(u.exports,function(e){var n=t[o][1][e];return i(n||e)},u,u.exports,e,t,n,r)}return n[o].exports}for(var a=typeof _n==`function`&&_n,o=0;o>2,s=(3&t)<<4|n>>4,c=1>6:64,l=2>4,n=(15&o)<<4|(s=a.indexOf(e.charAt(l++)))>>2,r=(3&s)<<6|(c=a.indexOf(e.charAt(l++))),f[u++]=t,s!==64&&(f[u++]=n),c!==64&&(f[u++]=r);return f}},{"./support":30,"./utils":32}],2:[function(e,t,n){"use strict";var r=e(`./external`),i=e(`./stream/DataWorker`),a=e(`./stream/Crc32Probe`),o=e(`./stream/DataLengthProbe`);function s(e,t,n,r,i){this.compressedSize=e,this.uncompressedSize=t,this.crc32=n,this.compression=r,this.compressedContent=i}s.prototype={getContentWorker:function(){var e=new i(r.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new o(`data_length`)),t=this;return e.on(`end`,function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw Error(`Bug : uncompressed data size mismatch`)}),e},getCompressedWorker:function(){return new i(r.Promise.resolve(this.compressedContent)).withStreamInfo(`compressedSize`,this.compressedSize).withStreamInfo(`uncompressedSize`,this.uncompressedSize).withStreamInfo(`crc32`,this.crc32).withStreamInfo(`compression`,this.compression)}},s.createWorkerFrom=function(e,t,n){return e.pipe(new a).pipe(new o(`uncompressedSize`)).pipe(t.compressWorker(n)).pipe(new o(`compressedSize`)).withStreamInfo(`compression`,t)},t.exports=s},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,t,n){"use strict";var r=e(`./stream/GenericWorker`);n.STORE={magic:`\0\0`,compressWorker:function(){return new r(`STORE compression`)},uncompressWorker:function(){return new r(`STORE decompression`)}},n.DEFLATE=e(`./flate`)},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,t,n){"use strict";var r=e(`./utils`),i=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t){return e!==void 0&&e.length?r.getTypeOf(e)===`string`?function(e,t,n,r){var a=i,o=r+n;e^=-1;for(var s=r;s>>8^a[255&(e^t.charCodeAt(s))];return-1^e}(0|t,e,e.length,0):function(e,t,n,r){var a=i,o=r+n;e^=-1;for(var s=r;s>>8^a[255&(e^t[s])];return-1^e}(0|t,e,e.length,0):0}},{"./utils":32}],5:[function(e,t,n){"use strict";n.base64=!1,n.binary=!1,n.dir=!1,n.createFolders=!0,n.date=null,n.compression=null,n.compressionOptions=null,n.comment=null,n.unixPermissions=null,n.dosPermissions=null},{}],6:[function(e,t,n){"use strict";var r=null;r=typeof Promise<`u`?Promise:e(`lie`),t.exports={Promise:r}},{lie:37}],7:[function(e,t,n){"use strict";var r=typeof Uint8Array<`u`&&typeof Uint16Array<`u`&&typeof Uint32Array<`u`,i=e(`pako`),a=e(`./utils`),o=e(`./stream/GenericWorker`),s=r?`uint8array`:`array`;function c(e,t){o.call(this,`FlateWorker/`+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}n.magic=`\b\0`,a.inherits(c,o),c.prototype.processChunk=function(e){this.meta=e.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(s,e.data),!1)},c.prototype.flush=function(){o.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},c.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this._pako=null},c.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}},n.compressWorker=function(e){return new c(`Deflate`,e)},n.uncompressWorker=function(){return new c(`Inflate`,{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,t,n){"use strict";function r(e,t){var n,r=``;for(n=0;n>>=8;return r}function i(e,t,n,i,o,u){var d,f,p=e.file,m=e.compression,h=u!==s.utf8encode,g=a.transformTo(`string`,u(p.name)),_=a.transformTo(`string`,s.utf8encode(p.name)),v=p.comment,y=a.transformTo(`string`,u(v)),b=a.transformTo(`string`,s.utf8encode(v)),x=_.length!==p.name.length,S=b.length!==v.length,C=``,w=``,T=``,E=p.dir,D=p.date,O={crc32:0,compressedSize:0,uncompressedSize:0};t&&!n||(O.crc32=e.crc32,O.compressedSize=e.compressedSize,O.uncompressedSize=e.uncompressedSize);var k=0;t&&(k|=8),h||!x&&!S||(k|=2048);var A=0,j=0;E&&(A|=16),o===`UNIX`?(j=798,A|=function(e,t){var n=e;return e||(n=t?16893:33204),(65535&n)<<16}(p.unixPermissions,E)):(j=20,A|=function(e){return 63&(e||0)}(p.dosPermissions)),d=D.getUTCHours(),d<<=6,d|=D.getUTCMinutes(),d<<=5,d|=D.getUTCSeconds()/2,f=D.getUTCFullYear()-1980,f<<=4,f|=D.getUTCMonth()+1,f<<=5,f|=D.getUTCDate(),x&&(w=r(1,1)+r(c(g),4)+_,C+=`up`+r(w.length,2)+w),S&&(T=r(1,1)+r(c(y),4)+b,C+=`uc`+r(T.length,2)+T);var M=``;return M+=` +\0`,M+=r(k,2),M+=m.magic,M+=r(d,2),M+=r(f,2),M+=r(O.crc32,4),M+=r(O.compressedSize,4),M+=r(O.uncompressedSize,4),M+=r(g.length,2),M+=r(C.length,2),{fileRecord:l.LOCAL_FILE_HEADER+M+g+C,dirRecord:l.CENTRAL_FILE_HEADER+r(j,2)+M+r(y.length,2)+`\0\0\0\0`+r(A,4)+r(i,4)+g+C+y}}var a=e(`../utils`),o=e(`../stream/GenericWorker`),s=e(`../utf8`),c=e(`../crc32`),l=e(`../signature`);function u(e,t,n,r){o.call(this,`ZipFileWorker`),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=n,this.encodeFileName=r,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(u,o),u.prototype.push=function(e){var t=e.meta.percent||0,n=this.entriesCount,r=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,o.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:n?(t+100*(n-r-1))/n:100}}))},u.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var n=i(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:n.fileRecord,meta:{percent:0}})}else this.accumulate=!0},u.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,n=i(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(n.dirRecord),t)this.push({data:function(e){return l.DATA_DESCRIPTOR+r(e.crc32,4)+r(e.compressedSize,4)+r(e.uncompressedSize,4)}(e),meta:{percent:100}});else for(this.push({data:n.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},u.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t=this.index;t--)n=(n<<8)+this.byteAt(t);return this.index+=e,n},readString:function(e){return r.transformTo(`string`,this.readData(e))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},t.exports=i},{"../utils":32}],19:[function(e,t,n){"use strict";var r=e(`./Uint8ArrayReader`);function i(e){r.call(this,e)}e(`../utils`).inherits(i,r),i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,t,n){"use strict";var r=e(`./DataReader`);function i(e){r.call(this,e)}e(`../utils`).inherits(i,r),i.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},i.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},i.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./DataReader":18}],21:[function(e,t,n){"use strict";var r=e(`./ArrayReader`);function i(e){r.call(this,e)}e(`../utils`).inherits(i,r),i.prototype.readData=function(e){if(this.checkOffset(e),e===0)return new Uint8Array;var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(e,t,n){"use strict";var r=e(`../utils`),i=e(`../support`),a=e(`./ArrayReader`),o=e(`./StringReader`),s=e(`./NodeBufferReader`),c=e(`./Uint8ArrayReader`);t.exports=function(e){var t=r.getTypeOf(e);return r.checkSupport(t),t!==`string`||i.uint8array?t===`nodebuffer`?new s(e):i.uint8array?new c(r.transformTo(`uint8array`,e)):new a(r.transformTo(`array`,e)):new o(e)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,t,n){"use strict";n.LOCAL_FILE_HEADER=`PK`,n.CENTRAL_FILE_HEADER=`PK`,n.CENTRAL_DIRECTORY_END=`PK`,n.ZIP64_CENTRAL_DIRECTORY_LOCATOR=`PK\x07`,n.ZIP64_CENTRAL_DIRECTORY_END=`PK`,n.DATA_DESCRIPTOR=`PK\x07\b`},{}],24:[function(e,t,n){"use strict";var r=e(`./GenericWorker`),i=e(`../utils`);function a(e){r.call(this,`ConvertWorker to `+e),this.destType=e}i.inherits(a,r),a.prototype.processChunk=function(e){this.push({data:i.transformTo(this.destType,e.data),meta:e.meta})},t.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(e,t,n){"use strict";var r=e(`./GenericWorker`),i=e(`../crc32`);function a(){r.call(this,`Crc32Probe`),this.withStreamInfo(`crc32`,0)}e(`../utils`).inherits(a,r),a.prototype.processChunk=function(e){this.streamInfo.crc32=i(e.data,this.streamInfo.crc32||0),this.push(e)},t.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,t,n){"use strict";var r=e(`../utils`),i=e(`./GenericWorker`);function a(e){i.call(this,`DataLengthProbe for `+e),this.propName=e,this.withStreamInfo(e,0)}r.inherits(a,i),a.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}i.prototype.processChunk.call(this,e)},t.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(e,t,n){"use strict";var r=e(`../utils`),i=e(`./GenericWorker`);function a(e){i.call(this,`DataWorker`);var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type=``,this._tickScheduled=!1,e.then(function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=r.getTypeOf(e),t.isPaused||t._tickAndRepeat()},function(e){t.error(e)})}r.inherits(a,i),a.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,r.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(r.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case`string`:e=this.data.substring(this.index,t);break;case`uint8array`:e=this.data.subarray(this.index,t);break;case`array`:case`nodebuffer`:e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(e,t,n){"use strict";function r(e){this.name=e||`default`,this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}r.prototype={push:function(e){this.emit(`data`,e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit(`end`),this.cleanUp(),this.isFinished=!0}catch(e){this.emit(`error`,e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit(`error`,e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var n=0;n `+e:e}},t.exports=r},{}],29:[function(e,t,n){"use strict";var r=e(`../utils`),i=e(`./ConvertWorker`),a=e(`./GenericWorker`),o=e(`../base64`),s=e(`../support`),c=e(`../external`),l=null;if(s.nodestream)try{l=e(`../nodejs/NodejsStreamOutputAdapter`)}catch{}function u(e,t){return new c.Promise(function(n,i){var a=[],s=e._internalType,c=e._outputType,l=e._mimeType;e.on(`data`,function(e,n){a.push(e),t&&t(n)}).on(`error`,function(e){a=[],i(e)}).on(`end`,function(){try{var e=function(e,t,n){switch(e){case`blob`:return r.newBlob(r.transformTo(`arraybuffer`,t),n);case`base64`:return o.encode(t);default:return r.transformTo(e,t)}}(c,function(e,t){var n,r=0,i=null,a=0;for(n=0;n`u`)n.blob=!1;else{var r=new ArrayBuffer(0);try{n.blob=new Blob([r],{type:`application/zip`}).size===0}catch{try{var i=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);i.append(r),n.blob=i.getBlob(`application/zip`).size===0}catch{n.blob=!1}}}try{n.nodestream=!!e(`readable-stream`).Readable}catch{n.nodestream=!1}},{"readable-stream":16}],31:[function(e,t,n){"use strict";for(var r=e(`./utils`),i=e(`./support`),a=e(`./nodejsUtils`),o=e(`./stream/GenericWorker`),s=Array(256),c=0;c<256;c++)s[c]=252<=c?6:248<=c?5:240<=c?4:224<=c?3:192<=c?2:1;s[254]=s[254]=1;function l(){o.call(this,`utf-8 decode`),this.leftOver=null}function u(){o.call(this,`utf-8 encode`)}n.utf8encode=function(e){return i.nodebuffer?a.newBufferFrom(e,`utf-8`):function(e){var t,n,r,a,o,s=e.length,c=0;for(a=0;a>>6:(n<65536?t[o++]=224|n>>>12:(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63),t[o++]=128|n>>>6&63),t[o++]=128|63&n);return t}(e)},n.utf8decode=function(e){return i.nodebuffer?r.transformTo(`nodebuffer`,e).toString(`utf-8`):function(e){var t,n,i,a,o=e.length,c=Array(2*o);for(t=n=0;t>10&1023,c[n++]=56320|1023&i)}return c.length!==n&&(c.subarray?c=c.subarray(0,n):c.length=n),r.applyFromCharCode(c)}(e=r.transformTo(i.uint8array?`uint8array`:`array`,e))},r.inherits(l,o),l.prototype.processChunk=function(e){var t=r.transformTo(i.uint8array?`uint8array`:`array`,e.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var a=t;(t=new Uint8Array(a.length+this.leftOver.length)).set(this.leftOver,0),t.set(a,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var o=function(e,t){var n;for((t||=e.length)>e.length&&(t=e.length),n=t-1;0<=n&&(192&e[n])==128;)n--;return n<0||n===0?t:n+s[e[n]]>t?n:t}(t),c=t;o!==t.length&&(i.uint8array?(c=t.subarray(0,o),this.leftOver=t.subarray(o,t.length)):(c=t.slice(0,o),this.leftOver=t.slice(o,t.length))),this.push({data:n.utf8decode(c),meta:e.meta})},l.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:n.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},n.Utf8DecodeWorker=l,r.inherits(u,o),u.prototype.processChunk=function(e){this.push({data:n.utf8encode(e.data),meta:e.meta})},n.Utf8EncodeWorker=u},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,t,n){"use strict";var r=e(`./support`),i=e(`./base64`),a=e(`./nodejsUtils`),o=e(`./external`);function s(e){return e}function c(e,t){for(var n=0;n>8;this.dir=!!(16&this.externalFileAttributes),e==0&&(this.dosPermissions=63&this.externalFileAttributes),e==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!==`/`||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var e=r(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(e){var t,n,r,i=e.index+this.extraFieldsLength;for(this.extraFields||={};e.index+4>>6:(n<65536?t[o++]=224|n>>>12:(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63),t[o++]=128|n>>>6&63),t[o++]=128|63&n);return t},n.buf2binstring=function(e){return c(e,e.length)},n.binstring2buf=function(e){for(var t=new r.Buf8(e.length),n=0,i=t.length;n>10&1023,l[r++]=56320|1023&i)}return c(l,r)},n.utf8border=function(e,t){var n;for((t||=e.length)>e.length&&(t=e.length),n=t-1;0<=n&&(192&e[n])==128;)n--;return n<0||n===0?t:n+o[e[n]]>t?n:t}},{"./common":41}],43:[function(e,t,n){"use strict";t.exports=function(e,t,n,r){for(var i=65535&e|0,a=e>>>16&65535|0,o=0;n!==0;){for(n-=o=2e3>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t,n,i){var a=r,o=i+n;e^=-1;for(var s=i;s>>8^a[255&(e^t[s])];return-1^e}},{}],46:[function(e,t,n){"use strict";var r,i=e(`../utils/common`),a=e(`./trees`),o=e(`./adler32`),s=e(`./crc32`),c=e(`./messages`),l=0,u=4,d=0,f=-2,p=-1,m=4,h=2,g=8,_=9,v=286,y=30,b=19,x=2*v+1,S=15,C=3,w=258,T=w+C+1,E=42,D=113,O=1,k=2,A=3,j=4;function M(e,t){return e.msg=c[t],t}function N(e){return(e<<1)-(4e.avail_out&&(n=e.avail_out),n!==0&&(i.arraySet(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))}function F(e,t){a._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,P(e.strm)}function I(e,t){e.pending_buf[e.pending++]=t}function L(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function te(e,t){var n,r,i=e.max_chain_length,a=e.strstart,o=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-T?e.strstart-(e.w_size-T):0,l=e.window,u=e.w_mask,d=e.prev,f=e.strstart+w,p=l[a+o-1],m=l[a+o];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do if(l[(n=t)+o]===m&&l[n+o-1]===p&&l[n]===l[a]&&l[++n]===l[a+1]){a+=2,n++;do;while(l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&ac&&--i!=0);return o<=e.lookahead?o:e.lookahead}function R(e){var t,n,r,a,c,l,u,d,f,p,m=e.w_size;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=m+(m-T)){for(i.arraySet(e.window,e.window,m,m,0),e.match_start-=m,e.strstart-=m,e.block_start-=m,t=n=e.hash_size;r=e.head[--t],e.head[t]=m<=r?r-m:0,--n;);for(t=n=m;r=e.prev[--t],e.prev[t]=m<=r?r-m:0,--n;);a+=m}if(e.strm.avail_in===0)break;if(l=e.strm,u=e.window,d=e.strstart+e.lookahead,f=a,p=void 0,p=l.avail_in,f=C)for(c=e.strstart-e.insert,e.ins_h=e.window[c],e.ins_h=(e.ins_h<=C&&(e.ins_h=(e.ins_h<=C)if(r=a._tr_tally(e,e.strstart-e.match_start,e.match_length-C),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=C){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<=C&&(e.ins_h=(e.ins_h<=C&&e.match_length<=e.prev_length){for(i=e.strstart+e.lookahead-C,r=a._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-C),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=i&&(e.ins_h=(e.ins_h<e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(R(e),e.lookahead===0&&t===l)return O;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+n;if((e.strstart===0||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,F(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-T&&(F(e,!1),e.strm.avail_out===0))return O}return e.insert=0,t===u?(F(e,!0),e.strm.avail_out===0?A:j):(e.strstart>e.block_start&&(F(e,!1),e.strm.avail_out),O)}),new re(4,4,8,4,ne),new re(4,5,16,8,ne),new re(4,6,32,32,ne),new re(4,4,16,16,z),new re(8,16,32,32,z),new re(8,16,128,128,z),new re(8,32,128,256,z),new re(32,128,258,1024,z),new re(32,258,258,4096,z)],n.deflateInit=function(e,t){return se(e,t,g,15,8,0)},n.deflateInit2=se,n.deflateReset=oe,n.deflateResetKeep=ae,n.deflateSetHeader=function(e,t){return e&&e.state&&e.state.wrap===2?(e.state.gzhead=t,d):f},n.deflate=function(e,t){var n,i,o,c;if(!e||!e.state||5>8&255),I(i,i.gzhead.time>>16&255),I(i,i.gzhead.time>>24&255),I(i,i.level===9?2:2<=i.strategy||i.level<2?4:0),I(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(I(i,255&i.gzhead.extra.length),I(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=s(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(I(i,0),I(i,0),I(i,0),I(i,0),I(i,0),I(i,i.level===9?2:2<=i.strategy||i.level<2?4:0),I(i,3),i.status=D);else{var p=g+(i.w_bits-8<<4)<<8;p|=(2<=i.strategy||i.level<2?0:i.level<6?1:i.level===6?2:3)<<6,i.strstart!==0&&(p|=32),p+=31-p%31,i.status=D,L(i,p),i.strstart!==0&&(L(i,e.adler>>>16),L(i,65535&e.adler)),e.adler=1}if(i.status===69)if(i.gzhead.extra){for(o=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),P(e),o=i.pending,i.pending!==i.pending_buf_size));)I(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(i.status===73)if(i.gzhead.name){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),P(e),o=i.pending,i.pending===i.pending_buf_size)){c=1;break}c=i.gzindexo&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),c===0&&(i.gzindex=0,i.status=91)}else i.status=91;if(i.status===91)if(i.gzhead.comment){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),P(e),o=i.pending,i.pending===i.pending_buf_size)){c=1;break}c=i.gzindexo&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),c===0&&(i.status=103)}else i.status=103;if(i.status===103&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&P(e),i.pending+2<=i.pending_buf_size&&(I(i,255&e.adler),I(i,e.adler>>8&255),e.adler=0,i.status=D)):i.status=D),i.pending!==0){if(P(e),e.avail_out===0)return i.last_flush=-1,d}else if(e.avail_in===0&&N(t)<=N(n)&&t!==u)return M(e,-5);if(i.status===666&&e.avail_in!==0)return M(e,-5);if(e.avail_in!==0||i.lookahead!==0||t!==l&&i.status!==666){var m=i.strategy===2?function(e,t){for(var n;;){if(e.lookahead===0&&(R(e),e.lookahead===0)){if(t===l)return O;break}if(e.match_length=0,n=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(F(e,!1),e.strm.avail_out===0))return O}return e.insert=0,t===u?(F(e,!0),e.strm.avail_out===0?A:j):e.last_lit&&(F(e,!1),e.strm.avail_out===0)?O:k}(i,t):i.strategy===3?function(e,t){for(var n,r,i,o,s=e.window;;){if(e.lookahead<=w){if(R(e),e.lookahead<=w&&t===l)return O;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=C&&0e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=C?(n=a._tr_tally(e,1,e.match_length-C),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(F(e,!1),e.strm.avail_out===0))return O}return e.insert=0,t===u?(F(e,!0),e.strm.avail_out===0?A:j):e.last_lit&&(F(e,!1),e.strm.avail_out===0)?O:k}(i,t):r[i.level].func(i,t);if(m!==A&&m!==j||(i.status=666),m===O||m===A)return e.avail_out===0&&(i.last_flush=-1),d;if(m===k&&(t===1?a._tr_align(i):t!==5&&(a._tr_stored_block(i,0,0,!1),t===3&&(ee(i.head),i.lookahead===0&&(i.strstart=0,i.block_start=0,i.insert=0))),P(e),e.avail_out===0))return i.last_flush=-1,d}return t===u?i.wrap<=0?1:(i.wrap===2?(I(i,255&e.adler),I(i,e.adler>>8&255),I(i,e.adler>>16&255),I(i,e.adler>>24&255),I(i,255&e.total_in),I(i,e.total_in>>8&255),I(i,e.total_in>>16&255),I(i,e.total_in>>24&255)):(L(i,e.adler>>>16),L(i,65535&e.adler)),P(e),0=n.w_size&&(s===0&&(ee(n.head),n.strstart=0,n.block_start=0,n.insert=0),p=new i.Buf8(n.w_size),i.arraySet(p,t,m-n.w_size,n.w_size,0),t=p,m=n.w_size),c=e.avail_in,l=e.next_in,u=e.input,e.avail_in=m,e.next_in=0,e.input=t,R(n);n.lookahead>=C;){for(r=n.strstart,a=n.lookahead-(C-1);n.ins_h=(n.ins_h<>>=b=y>>>24,m-=b,(b=y>>>16&255)==0)E[a++]=65535&y;else{if(!(16&b)){if(!(64&b)){y=h[(65535&y)+(p&(1<>>=b,m-=b),m<15&&(p+=T[r++]<>>=b=y>>>24,m-=b,!(16&(b=y>>>16&255))){if(!(64&b)){y=g[(65535&y)+(p&(1<>>=b,m-=b,(b=a-o)>3,p&=(1<<(m-=x<<3))-1,e.next_in=r,e.next_out=a,e.avail_in=r>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function g(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function _(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg=``,t.wrap&&(e.adler=1&t.wrap),t.mode=f,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new r.Buf32(p),t.distcode=t.distdyn=new r.Buf32(m),t.sane=1,t.back=-1,u):d}function v(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,_(e)):d}function y(e,t){var n,r;return e&&e.state?(r=e.state,t<0?(n=0,t=-t):(n=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15=o.wsize?(r.arraySet(o.window,t,n-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(i<(a=o.wsize-o.wnext)&&(a=i),r.arraySet(o.window,t,n-i,a,o.wnext),(i-=a)?(r.arraySet(o.window,t,n-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=a,o.wnext===o.wsize&&(o.wnext=0),o.whave>>8&255,n.check=a(n.check,R,2,0),x=b=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&b)<<8)+(b>>8))%31){e.msg=`incorrect header check`,n.mode=30;break}if((15&b)!=8){e.msg=`unknown compression method`,n.mode=30;break}if(x-=4,P=8+(15&(b>>>=4)),n.wbits===0)n.wbits=P;else if(P>n.wbits){e.msg=`invalid window size`,n.mode=30;break}n.dmax=1<>8&1),512&n.flags&&(R[0]=255&b,R[1]=b>>>8&255,n.check=a(n.check,R,2,0)),x=b=0,n.mode=3;case 3:for(;x<32;){if(v===0)break e;v--,b+=p[g++]<>>8&255,R[2]=b>>>16&255,R[3]=b>>>24&255,n.check=a(n.check,R,4,0)),x=b=0,n.mode=4;case 4:for(;x<16;){if(v===0)break e;v--,b+=p[g++]<>8),512&n.flags&&(R[0]=255&b,R[1]=b>>>8&255,n.check=a(n.check,R,2,0)),x=b=0,n.mode=5;case 5:if(1024&n.flags){for(;x<16;){if(v===0)break e;v--,b+=p[g++]<>>8&255,n.check=a(n.check,R,2,0)),x=b=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&(v<(E=n.length)&&(E=v),E&&(n.head&&(P=n.head.extra_len-n.length,n.head.extra||(n.head.extra=Array(n.head.extra_len)),r.arraySet(n.head.extra,p,g,E,P)),512&n.flags&&(n.check=a(n.check,p,E,g)),v-=E,g+=E,n.length-=E),n.length))break e;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(v===0)break e;for(E=0;P=p[g+ E++],n.head&&P&&n.length<65536&&(n.head.name+=String.fromCharCode(P)),P&&E>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=12;break;case 10:for(;x<32;){if(v===0)break e;v--,b+=p[g++]<>>=7&x,x-=7&x,n.mode=27;break}for(;x<3;){if(v===0)break e;v--,b+=p[g++]<>>=1)){case 0:n.mode=14;break;case 1:if(w(n),n.mode=20,t!==6)break;b>>>=2,x-=2;break e;case 2:n.mode=17;break;case 3:e.msg=`invalid block type`,n.mode=30}b>>>=2,x-=2;break;case 14:for(b>>>=7&x,x-=7&x;x<32;){if(v===0)break e;v--,b+=p[g++]<>>16^65535)){e.msg=`invalid stored block lengths`,n.mode=30;break}if(n.length=65535&b,x=b=0,n.mode=15,t===6)break e;case 15:n.mode=16;case 16:if(E=n.length){if(v>>=5,x-=5,n.ndist=1+(31&b),b>>>=5,x-=5,n.ncode=4+(15&b),b>>>=4,x-=4,286>>=3,x-=3}for(;n.have<19;)n.lens[ne[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,I={bits:n.lenbits},F=s(0,n.lens,0,19,n.lencode,0,n.work,I),n.lenbits=I.bits,F){e.msg=`invalid code lengths set`,n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have>>16&255,j=65535&te,!((k=te>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>>=k,x-=k,n.lens[n.have++]=j;else{if(j===16){for(L=k+2;x>>=k,x-=k,n.have===0){e.msg=`invalid bit length repeat`,n.mode=30;break}P=n.lens[n.have-1],E=3+(3&b),b>>>=2,x-=2}else if(j===17){for(L=k+3;x>>=k)),b>>>=3,x-=3}else{for(L=k+7;x>>=k)),b>>>=7,x-=7}if(n.have+E>n.nlen+n.ndist){e.msg=`invalid bit length repeat`,n.mode=30;break}for(;E--;)n.lens[n.have++]=P}}if(n.mode===30)break;if(n.lens[256]===0){e.msg=`invalid code -- missing end-of-block`,n.mode=30;break}if(n.lenbits=9,I={bits:n.lenbits},F=s(c,n.lens,0,n.nlen,n.lencode,0,n.work,I),n.lenbits=I.bits,F){e.msg=`invalid literal/lengths set`,n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,I={bits:n.distbits},F=s(l,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,I),n.distbits=I.bits,F){e.msg=`invalid distances set`,n.mode=30;break}if(n.mode=20,t===6)break e;case 20:n.mode=21;case 21:if(6<=v&&258<=y){e.next_out=_,e.avail_out=y,e.next_in=g,e.avail_in=v,n.hold=b,n.bits=x,o(e,C),_=e.next_out,m=e.output,y=e.avail_out,g=e.next_in,p=e.input,v=e.avail_in,b=n.hold,x=n.bits,n.mode===12&&(n.back=-1);break}for(n.back=0;A=(te=n.lencode[b&(1<>>16&255,j=65535&te,!((k=te>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>M)])>>>16&255,j=65535&te,!(M+(k=te>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>>=M,x-=M,n.back+=M}if(b>>>=k,x-=k,n.back+=k,n.length=j,A===0){n.mode=26;break}if(32&A){n.back=-1,n.mode=12;break}if(64&A){e.msg=`invalid literal/length code`,n.mode=30;break}n.extra=15&A,n.mode=22;case 22:if(n.extra){for(L=n.extra;x>>=n.extra,x-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;A=(te=n.distcode[b&(1<>>16&255,j=65535&te,!((k=te>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>M)])>>>16&255,j=65535&te,!(M+(k=te>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>>=M,x-=M,n.back+=M}if(b>>>=k,x-=k,n.back+=k,64&A){e.msg=`invalid distance code`,n.mode=30;break}n.offset=j,n.extra=15&A,n.mode=24;case 24:if(n.extra){for(L=n.extra;x>>=n.extra,x-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg=`invalid distance too far back`,n.mode=30;break}n.mode=25;case 25:if(y===0)break e;if(E=C-y,n.offset>E){if((E=n.offset-E)>n.whave&&n.sane){e.msg=`invalid distance too far back`,n.mode=30;break}D=E>n.wnext?(E-=n.wnext,n.wsize-E):n.wnext-E,E>n.length&&(E=n.length),O=n.window}else O=m,D=_-n.offset,E=n.length;for(yv?(b=I[L+d[w]],N[ee+d[w]]):(b=96,0),p=1<>k)+(m-=p)]=y<<24|b<<16|x|0,m!==0;);for(p=1<>=1;if(p===0?M=0:(M&=p-1,M+=p),w++,--P[C]==0){if(C===E)break;C=t[n+d[w]]}if(D>>7)]}function I(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function L(e,t,n){e.bi_valid>h-n?(e.bi_buf|=t<>h-e.bi_valid,e.bi_valid+=n-h):(e.bi_buf|=t<>>=1,n<<=1,0<--t;);return n>>>1}function ne(e,t,n){var r,i,a=Array(m+1),o=0;for(r=1;r<=m;r++)a[r]=o=o+n[r-1]<<1;for(i=0;i<=t;i++){var s=e[2*i+1];s!==0&&(e[2*i]=R(a[s]++,s))}}function z(e){var t;for(t=0;t>1;1<=n;n--)ae(e,a,n);for(i=c;n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],ae(e,a,1),r=e.heap[1],e.heap[--e.heap_max]=n,e.heap[--e.heap_max]=r,a[2*i]=a[2*n]+a[2*r],e.depth[i]=(e.depth[n]>=e.depth[r]?e.depth[n]:e.depth[r])+1,a[2*n+1]=a[2*r+1]=i,e.heap[1]=i++,ae(e,a,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var n,r,i,a,o,s,c=t.dyn_tree,l=t.max_code,u=t.stat_desc.static_tree,d=t.stat_desc.has_stree,f=t.stat_desc.extra_bits,h=t.stat_desc.extra_base,g=t.stat_desc.max_length,_=0;for(a=0;a<=m;a++)e.bl_count[a]=0;for(c[2*e.heap[e.heap_max]+1]=0,n=e.heap_max+1;n>=7;r>>=1)if(1&n&&e.dyn_ltree[2*t]!==0)return i;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return a;for(t=32;t>>3,(s=e.static_len+3+7>>>3)<=o&&(o=s)):o=s=n+5,n+4<=o&&t!==-1?de(e,t,n,r):e.strategy===4||s===o?(L(e,2+(r?1:0),3),oe(e,T,E)):(L(e,4+(r?1:0),3),function(e,t,n,r){var i;for(L(e,t-257,5),L(e,n-1,5),L(e,r-4,4),i=0;i>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&n,e.last_lit++,t===0?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(O[n]+l+1)]++,e.dyn_dtree[2*F(t)]++),e.last_lit===e.lit_bufsize-1},n._tr_align=function(e){L(e,2,3),te(e,_,T),function(e){e.bi_valid===16?(I(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},{"../utils/common":41}],53:[function(e,t,n){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=``,this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(e,t,n){(function(e){(function(e,t){"use strict";if(!e.setImmediate){var n,r,i,a,o=1,s={},c=!1,l=e.document,u=Object.getPrototypeOf&&Object.getPrototypeOf(e);u=u&&u.setTimeout?u:e,n={}.toString.call(e.process)===`[object process]`?function(e){process.nextTick(function(){f(e)})}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage(``,`*`),e.onmessage=n,t}}()?(a=`setImmediate$`+Math.random()+`$`,e.addEventListener?e.addEventListener(`message`,p,!1):e.attachEvent(`onmessage`,p),function(t){e.postMessage(a+t,`*`)}):e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){f(e.data)},function(e){i.port2.postMessage(e)}):l&&`onreadystatechange`in l.createElement(`script`)?(r=l.documentElement,function(e){var t=l.createElement(`script`);t.onreadystatechange=function(){f(e),t.onreadystatechange=null,r.removeChild(t),t=null},r.appendChild(t)}):function(e){setTimeout(f,0,e)},u.setImmediate=function(e){typeof e!=`function`&&(e=Function(``+e));for(var t=Array(arguments.length-1),r=0;r`u`?e===void 0?this:e:self)}).call(this,typeof global<`u`?global:typeof self<`u`?self:typeof window<`u`?window:{})},{}]},{},[10])(10)})}),dh=vn(uh());gd.zipReader=(e,t)=>dh.default.loadAsync(e);const fh=gd.createSettings;gd.createSettings=async e=>{let t=Object.keys(e.files);return t.find(e=>ph(e))?fh(e):gh(t)};function ph(e){return e.endsWith(`model3.json`)}function mh(e){return e.endsWith(`.moc3`)}function hh(e){return e.split(/[\\/]/).pop()}function gh(e){let t=e.filter(e=>mh(e));if(t.length!==1){let e=t.length?`(${t.map(e=>`"${e}"`).join(`,`)})`:``;throw Error(`Expected exactly one moc file, got ${t.length} ${e}`)}let n=t[0],r=hh(n).replace(/\.moc3?/,``),i=e.filter(e=>e.endsWith(`.png`));if(!i.length)throw Error(`Textures not found`);let a=e.filter(e=>e.endsWith(`.mtn`)||e.endsWith(`.motion3.json`)),o=e.find(e=>e.includes(`physics`)),s=e.find(e=>e.includes(`pose`)),c=new vd({url:`${r}.model3.json`,Version:3,FileReferences:{Moc:n,Textures:i,Physics:o,Pose:s,Motions:a.length?{"":a.map(e=>({File:e}))}:void 0}});return c.name=r,c._objectURL=`example://${c.url}`,c}gd.readText=(e,t)=>{let n=e.file(t);if(!n)throw Error(`Cannot find file: ${t}`);return n.async(`text`)},gd.getFilePaths=e=>{let t=[];return e.forEach(e=>t.push(e)),Promise.resolve(t)},gd.getFiles=(e,t)=>Promise.all(t.map(async t=>{let n=t.slice(t.lastIndexOf(`/`)+1),r=await e.file(t).async(`blob`);return new File([r],n)}));var _h=$t({__name:`Live2D`,props:{paused:{type:Boolean,default:!1},mouthOpenSize:{default:0},focusAt:{default:()=>({x:0,y:0})},xOffset:{},yOffset:{},scale:{default:1}},setup(e){return(e,t)=>(K(),wn(E,{relative:``},{default:tn(({width:t,height:n})=>[Mn(Od,{width:t,height:n,resolution:2,"max-h":`100dvh`},{default:tn(({app:r})=>[Mn(lh,{app:r,"mouth-open-size":e.mouthOpenSize,width:t,height:n,paused:e.paused,"focus-at":e.focusAt,"x-offset":e.xOffset,"y-offset":e.yOffset,scale:e.scale},null,8,[`app`,`mouth-open-size`,`width`,`height`,`paused`,`focus-at`,`x-offset`,`y-offset`,`scale`])]),_:2},1032,[`width`,`height`])]),_:1}))}}),vh=_h;function yh(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function bh(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)}function xh(e){return this instanceof xh?(this.v=e,this):new xh(e)}function Sh(e,t,n){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var r=n.apply(e,t||[]),i,a=[];return i=Object.create((typeof AsyncIterator==`function`?AsyncIterator:Object).prototype),s(`next`),s(`throw`),s(`return`,o),i[Symbol.asyncIterator]=function(){return this},i;function o(e){return function(t){return Promise.resolve(t).then(e,d)}}function s(e,t){r[e]&&(i[e]=function(t){return new Promise(function(n,r){a.push([e,t,n,r])>1||c(e,t)})},t&&(i[e]=t(i[e])))}function c(e,t){try{l(r[e](t))}catch(e){f(a[0][3],e)}}function l(e){e.value instanceof xh?Promise.resolve(e.value.v).then(u,d):f(a[0][2],e)}function u(e){c(`next`,e)}function d(e){c(`throw`,e)}function f(e,t){e(t),a.shift(),a.length&&c(a[0][0],a[0][1])}}function Ch(e){var t,n;return t={},r(`next`),r(`throw`,function(e){throw e}),r(`return`),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:xh(e[r](t)),done:!1}:i?i(t):t}:i}}function wh(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof bh==`function`?bh(e):e[Symbol.iterator](),n={},r(`next`),r(`throw`),r(`return`),n[Symbol.asyncIterator]=function(){return this},n);function r(t){n[t]=e[t]&&function(n){return new Promise(function(r,a){n=e[t](n),i(r,a,n.done,n.value)})}}function i(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}}const Th=new TextDecoder(`utf-8`),Eh=e=>Th.decode(e),Dh=new TextEncoder,Oh=e=>Dh.encode(e),kh=e=>typeof e==`number`,Ah=e=>typeof e==`boolean`,jh=e=>typeof e==`function`,Mh=e=>e!=null&&Object(e)===e,Nh=e=>Mh(e)&&jh(e.then),Ph=e=>Mh(e)&&jh(e[Symbol.iterator]),Fh=e=>Mh(e)&&jh(e[Symbol.asyncIterator]),Ih=e=>Mh(e)&&Mh(e.schema),Lh=e=>Mh(e)&&`done`in e&&`value`in e,Rh=e=>Mh(e)&&jh(e.stat)&&kh(e.fd),zh=e=>Mh(e)&&Hh(e.body),Bh=e=>`_getDOMStream`in e&&`_getNodeStream`in e,Vh=e=>Mh(e)&&jh(e.abort)&&jh(e.getWriter)&&!Bh(e),Hh=e=>Mh(e)&&jh(e.cancel)&&jh(e.getReader)&&!Bh(e),Uh=e=>Mh(e)&&jh(e.end)&&jh(e.write)&&Ah(e.writable)&&!Bh(e),Wh=e=>Mh(e)&&jh(e.read)&&jh(e.pipe)&&Ah(e.readable)&&!Bh(e),Gh=e=>Mh(e)&&jh(e.clear)&&jh(e.bytes)&&jh(e.position)&&jh(e.setPosition)&&jh(e.capacity)&&jh(e.getBufferIdentifier)&&jh(e.createLong),Kh=typeof SharedArrayBuffer<`u`?SharedArrayBuffer:ArrayBuffer;function qh(e){let t=e[0]?[e[0]]:[],n,r,i,a;for(let o,s,c=0,l=0,u=e.length;++ce+t.byteLength,0),i,a,o,s=0,c=-1,l=Math.min(t||1/0,r);for(let e=n.length;++cXh(Int32Array,e),Qh=e=>Xh(BigInt64Array,e),$h=e=>Xh(Uint8Array,e),eg=e=>(e.next(),e);function*tg(e,t){let n=function*(e){yield e},r=typeof t==`string`||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Kh?n(t):Ph(t)?t:n(t);return yield*eg(function*(t){let n=null;do n=t.next(yield Xh(e,n));while(!n.done)}(r[Symbol.iterator]())),new e}const ng=e=>tg(Uint8Array,e);function rg(e,t){return Sh(this,arguments,function*(){if(Nh(t))return yield xh(yield xh(yield*Ch(wh(rg(e,yield xh(t))))));let n=function(e){return Sh(this,arguments,function*(){yield yield xh(yield xh(e))})},r=function(e){return Sh(this,arguments,function*(){yield xh(yield*Ch(wh(eg(function*(e){let t=null;do t=e.next(yield t?.value);while(!t.done)}(e[Symbol.iterator]())))))})},i=typeof t==`string`||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Kh?n(t):Ph(t)?r(t):Fh(t)?t:n(t);return yield xh(yield*Ch(wh(eg(function(t){return Sh(this,arguments,function*(){let n=null;do n=yield xh(t.next(yield yield xh(Xh(e,n))));while(!n.done)})}(i[Symbol.asyncIterator]()))))),yield xh(new e)})}const ig=e=>rg(Uint8Array,e);function ag(e,t,n){if(e!==0){n=n.slice(0,t);for(let t=-1,r=n.length;++t0)do if(e[n]!==t[n])return!1;while(++n(e.next(),e);function*lg(e){let t,n=!1,r=[],i,a,o,s=0;function c(){return a===`peek`?Yh(r,o)[0]:([i,r,s]=Yh(r,o),i)}({cmd:a,size:o}=(yield(()=>null)())||{cmd:`read`,size:0});let l=ng(e)[Symbol.iterator]();try{do if({done:t,value:i}=Number.isNaN(o-s)?l.next():l.next(o-s),!t&&i.byteLength>0&&(r.push(i),s+=i.byteLength),t||o<=s)do({cmd:a,size:o}=yield c());while(onull)()))||{cmd:`read`,size:0});let l=ig(e)[Symbol.asyncIterator]();try{do if({done:t,value:i}=Number.isNaN(o-s)?yield xh(l.next()):yield xh(l.next(o-s)),!t&&i.byteLength>0&&(r.push(i),s+=i.byteLength),t||o<=s)do({cmd:a,size:o}=yield yield xh(c()));while(onull)()))||{cmd:`read`,size:0});let l=new fg(e);try{do if({done:t,value:i}=Number.isNaN(o-s)?yield xh(l.read()):yield xh(l.read(o-s)),!t&&i.byteLength>0&&(r.push($h(i)),s+=i.byteLength),t||o<=s)do({cmd:a,size:o}=yield yield xh(c()));while(o{})}get closed(){return this.reader?this.reader.closed.catch(()=>{}):Promise.resolve()}releaseLock(){this.reader&&this.reader.releaseLock(),this.reader=null}cancel(e){return yh(this,void 0,void 0,function*(){let{reader:t,source:n}=this;t&&(yield t.cancel(e).catch(()=>{})),n&&n.locked&&this.releaseLock()})}read(e){return yh(this,void 0,void 0,function*(){if(e===0)return{done:this.reader==null,value:new Uint8Array};let t=yield this.reader.read();return!t.done&&(t.value=$h(t)),t})}};const pg=(e,t)=>{let n=e=>r([t,e]),r;return[t,n,new Promise(i=>(r=i)&&e.once(t,n))]};function mg(e){return Sh(this,arguments,function*(){let t=[],n=`error`,r=!1,i=null,a,o,s=0,c=[],l;function u(){return a===`peek`?Yh(c,o)[0]:([l,c,s]=Yh(c,o),l)}if({cmd:a,size:o}=(yield yield xh((()=>null)()))||{cmd:`read`,size:0},e.isTTY)return yield yield xh(new Uint8Array),yield xh(null);try{t[0]=pg(e,`end`),t[1]=pg(e,`error`);do{if(t[2]=pg(e,`readable`),[n,i]=yield xh(Promise.race(t.map(e=>e[2]))),n===`error`)break;if((r=n===`end`)||(Number.isFinite(o-s)?(l=$h(e.read(o-s)),l.byteLength0&&(c.push(l),s+=l.byteLength)),r||o<=s)do({cmd:a,size:o}=yield yield xh(u()));while(o{for(let[n,r]of t)e.off(n,r);try{let t=e.destroy;t&&t.call(e,n),n=void 0}catch(e){n=e||n}finally{n==null?r():i(n)}})}})}var hg;(function(e){e[e.V1=0]=`V1`,e[e.V2=1]=`V2`,e[e.V3=2]=`V3`,e[e.V4=3]=`V4`,e[e.V5=4]=`V5`})(hg||={});var gg;(function(e){e[e.Sparse=0]=`Sparse`,e[e.Dense=1]=`Dense`})(gg||={});var _g;(function(e){e[e.HALF=0]=`HALF`,e[e.SINGLE=1]=`SINGLE`,e[e.DOUBLE=2]=`DOUBLE`})(_g||={});var vg;(function(e){e[e.DAY=0]=`DAY`,e[e.MILLISECOND=1]=`MILLISECOND`})(vg||={});var yg;(function(e){e[e.SECOND=0]=`SECOND`,e[e.MILLISECOND=1]=`MILLISECOND`,e[e.MICROSECOND=2]=`MICROSECOND`,e[e.NANOSECOND=3]=`NANOSECOND`})(yg||={});var bg;(function(e){e[e.YEAR_MONTH=0]=`YEAR_MONTH`,e[e.DAY_TIME=1]=`DAY_TIME`,e[e.MONTH_DAY_NANO=2]=`MONTH_DAY_NANO`})(bg||={});const xg=2,Sg=4,Cg=4,wg=4,Tg=new Int32Array(2),Eg=new Float32Array(Tg.buffer),Dg=new Float64Array(Tg.buffer),Og=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;var kg;(function(e){e[e.UTF8_BYTES=1]=`UTF8_BYTES`,e[e.UTF16_STRING=2]=`UTF16_STRING`})(kg||={});var Ag=class e{constructor(e){this.bytes_=e,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(t){return new e(new Uint8Array(t))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(e){this.position_=e}capacity(){return this.bytes_.length}readInt8(e){return this.readUint8(e)<<24>>24}readUint8(e){return this.bytes_[e]}readInt16(e){return this.readUint16(e)<<16>>16}readUint16(e){return this.bytes_[e]|this.bytes_[e+1]<<8}readInt32(e){return this.bytes_[e]|this.bytes_[e+1]<<8|this.bytes_[e+2]<<16|this.bytes_[e+3]<<24}readUint32(e){return this.readInt32(e)>>>0}readInt64(e){return BigInt.asIntN(64,BigInt(this.readUint32(e))+(BigInt(this.readUint32(e+4))<>8}writeUint16(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8}writeInt32(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24}writeUint32(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24}writeInt64(e,t){this.writeInt32(e,Number(BigInt.asIntN(32,t))),this.writeInt32(e+4,Number(BigInt.asIntN(32,t>>BigInt(32))))}writeUint64(e,t){this.writeUint32(e,Number(BigInt.asUintN(32,t))),this.writeUint32(e+4,Number(BigInt.asUintN(32,t>>BigInt(32))))}writeFloat32(e,t){Eg[0]=t,this.writeInt32(e,Tg[0])}writeFloat64(e,t){Dg[0]=t,this.writeInt32(e,Tg[Og?0:1]),this.writeInt32(e+4,Tg[Og?1:0])}getBufferIdentifier(){if(this.bytes_.lengththis.minalign&&(this.minalign=t);let r=~(this.bb.capacity()-this.space+n)+1&t-1;for(;this.space=0&&this.vtable[t]==0;t--);let n=t+1;for(;t>=0;t--)this.addInt16(this.vtable[t]==0?0:e-this.vtable[t]);let r=2;this.addInt16(e-this.object_start);let i=(n+r)*xg;this.addInt16(i);let a=0,o=this.space;outer_loop:for(t=0;t=0;t--)this.writeInt8(e.charCodeAt(t))}this.prep(this.minalign,Sg+r),this.addOffset(e),r&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(e,t){this.finish(e,t,!0)}requiredField(e,t){let n=this.bb.capacity()-e,r=n-this.bb.readInt32(n),i=t=0;n--)e.addInt32(t[n]);return e.endVector()}static startTypeIdsVector(e,t){e.startVector(4,t,4)}static endUnion(e){let t=e.endObject();return t}static createUnion(t,n,r){return e.startUnion(t),e.addMode(t,n),e.addTypeIds(t,r),e.endUnion(t)}},c_=class e{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsUtf8(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUtf8(t,n){return t.setPosition(t.position()+wg),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static startUtf8(e){e.startObject(0)}static endUtf8(e){let t=e.endObject();return t}static createUtf8(t){return e.startUtf8(t),e.endUtf8(t)}},l_;(function(e){e[e.NONE=0]=`NONE`,e[e.Null=1]=`Null`,e[e.Int=2]=`Int`,e[e.FloatingPoint=3]=`FloatingPoint`,e[e.Binary=4]=`Binary`,e[e.Utf8=5]=`Utf8`,e[e.Bool=6]=`Bool`,e[e.Decimal=7]=`Decimal`,e[e.Date=8]=`Date`,e[e.Time=9]=`Time`,e[e.Timestamp=10]=`Timestamp`,e[e.Interval=11]=`Interval`,e[e.List=12]=`List`,e[e.Struct_=13]=`Struct_`,e[e.Union=14]=`Union`,e[e.FixedSizeBinary=15]=`FixedSizeBinary`,e[e.FixedSizeList=16]=`FixedSizeList`,e[e.Map=17]=`Map`,e[e.Duration=18]=`Duration`,e[e.LargeBinary=19]=`LargeBinary`,e[e.LargeUtf8=20]=`LargeUtf8`,e[e.LargeList=21]=`LargeList`,e[e.RunEndEncoded=22]=`RunEndEncoded`})(l_||={});var u_=class e{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsField(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsField(t,n){return t.setPosition(t.position()+wg),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}name(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}nullable(){let e=this.bb.__offset(this.bb_pos,6);return e?!!this.bb.readInt8(this.bb_pos+e):!1}typeType(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readUint8(this.bb_pos+e):l_.NONE}type(e){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__union(e,this.bb_pos+t):null}dictionary(e){let t=this.bb.__offset(this.bb_pos,12);return t?(e||new Hg).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}children(t,n){let r=this.bb.__offset(this.bb_pos,14);return r?(n||new e).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+t*4),this.bb):null}childrenLength(){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,t){let n=this.bb.__offset(this.bb_pos,16);return n?(t||new Ug).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,16);return e?this.bb.__vector_len(this.bb_pos+e):0}static startField(e){e.startObject(7)}static addName(e,t){e.addFieldOffset(0,t,0)}static addNullable(e,t){e.addFieldInt8(1,+t,0)}static addTypeType(e,t){e.addFieldInt8(2,t,l_.NONE)}static addType(e,t){e.addFieldOffset(3,t,0)}static addDictionary(e,t){e.addFieldOffset(4,t,0)}static addChildren(e,t){e.addFieldOffset(5,t,0)}static createChildrenVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startChildrenVector(e,t){e.startVector(4,t,4)}static addCustomMetadata(e,t){e.addFieldOffset(6,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static endField(e){let t=e.endObject();return t}},d_=class e{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsSchema(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSchema(t,n){return t.setPosition(t.position()+wg),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}endianness(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):zg.Little}fields(e,t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new u_).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}fieldsLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,t){let n=this.bb.__offset(this.bb_pos,8);return n?(t||new Ug).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}features(e){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt64(this.bb.__vector(this.bb_pos+t)+e*8):BigInt(0)}featuresLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__vector_len(this.bb_pos+e):0}static startSchema(e){e.startObject(4)}static addEndianness(e,t){e.addFieldInt16(0,t,zg.Little)}static addFields(e,t){e.addFieldOffset(1,t,0)}static createFieldsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startFieldsVector(e,t){e.startVector(4,t,4)}static addCustomMetadata(e,t){e.addFieldOffset(2,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static addFeatures(e,t){e.addFieldOffset(3,t,0)}static createFeaturesVector(e,t){e.startVector(8,t.length,8);for(let n=t.length-1;n>=0;n--)e.addInt64(t[n]);return e.endVector()}static startFeaturesVector(e,t){e.startVector(8,t,8)}static endSchema(e){let t=e.endObject();return t}static finishSchemaBuffer(e,t){e.finish(t)}static finishSizePrefixedSchemaBuffer(e,t){e.finish(t,void 0,!0)}static createSchema(t,n,r,i,a){return e.startSchema(t),e.addEndianness(t,n),e.addFields(t,r),e.addCustomMetadata(t,i),e.addFeatures(t,a),e.endSchema(t)}},f_;(function(e){e[e.NONE=0]=`NONE`,e[e.Schema=1]=`Schema`,e[e.DictionaryBatch=2]=`DictionaryBatch`,e[e.RecordBatch=3]=`RecordBatch`,e[e.Tensor=4]=`Tensor`,e[e.SparseTensor=5]=`SparseTensor`})(f_||={});var q;(function(e){e[e.NONE=0]=`NONE`,e[e.Null=1]=`Null`,e[e.Int=2]=`Int`,e[e.Float=3]=`Float`,e[e.Binary=4]=`Binary`,e[e.Utf8=5]=`Utf8`,e[e.Bool=6]=`Bool`,e[e.Decimal=7]=`Decimal`,e[e.Date=8]=`Date`,e[e.Time=9]=`Time`,e[e.Timestamp=10]=`Timestamp`,e[e.Interval=11]=`Interval`,e[e.List=12]=`List`,e[e.Struct=13]=`Struct`,e[e.Union=14]=`Union`,e[e.FixedSizeBinary=15]=`FixedSizeBinary`,e[e.FixedSizeList=16]=`FixedSizeList`,e[e.Map=17]=`Map`,e[e.Duration=18]=`Duration`,e[e.LargeBinary=19]=`LargeBinary`,e[e.LargeUtf8=20]=`LargeUtf8`,e[e.Dictionary=-1]=`Dictionary`,e[e.Int8=-2]=`Int8`,e[e.Int16=-3]=`Int16`,e[e.Int32=-4]=`Int32`,e[e.Int64=-5]=`Int64`,e[e.Uint8=-6]=`Uint8`,e[e.Uint16=-7]=`Uint16`,e[e.Uint32=-8]=`Uint32`,e[e.Uint64=-9]=`Uint64`,e[e.Float16=-10]=`Float16`,e[e.Float32=-11]=`Float32`,e[e.Float64=-12]=`Float64`,e[e.DateDay=-13]=`DateDay`,e[e.DateMillisecond=-14]=`DateMillisecond`,e[e.TimestampSecond=-15]=`TimestampSecond`,e[e.TimestampMillisecond=-16]=`TimestampMillisecond`,e[e.TimestampMicrosecond=-17]=`TimestampMicrosecond`,e[e.TimestampNanosecond=-18]=`TimestampNanosecond`,e[e.TimeSecond=-19]=`TimeSecond`,e[e.TimeMillisecond=-20]=`TimeMillisecond`,e[e.TimeMicrosecond=-21]=`TimeMicrosecond`,e[e.TimeNanosecond=-22]=`TimeNanosecond`,e[e.DenseUnion=-23]=`DenseUnion`,e[e.SparseUnion=-24]=`SparseUnion`,e[e.IntervalDayTime=-25]=`IntervalDayTime`,e[e.IntervalYearMonth=-26]=`IntervalYearMonth`,e[e.DurationSecond=-27]=`DurationSecond`,e[e.DurationMillisecond=-28]=`DurationMillisecond`,e[e.DurationMicrosecond=-29]=`DurationMicrosecond`,e[e.DurationNanosecond=-30]=`DurationNanosecond`})(q||={});var p_;(function(e){e[e.OFFSET=0]=`OFFSET`,e[e.DATA=1]=`DATA`,e[e.VALIDITY=2]=`VALIDITY`,e[e.TYPE=3]=`TYPE`})(p_||={});const m_=void 0;function h_(e){if(e===null)return`null`;if(e===m_)return`undefined`;switch(typeof e){case`number`:return`${e}`;case`bigint`:return`${e}`;case`string`:return`"${e}"`}return typeof e[Symbol.toPrimitive]==`function`?e[Symbol.toPrimitive](`string`):ArrayBuffer.isView(e)?e instanceof BigInt64Array||e instanceof BigUint64Array?`[${[...e].map(e=>h_(e))}]`:`[${e}]`:ArrayBuffer.isView(e)?`[${e}]`:JSON.stringify(e,(e,t)=>typeof t==`bigint`?`${t}`:t)}function g_(e){if(typeof e==`bigint`&&(e<-(2**53-1)||e>2**53-1))throw TypeError(`${e} is not safe to convert to a number.`);return Number(e)}function __(e,t){return g_(e/t)+g_(e%t)/g_(t)}const v_=Symbol.for(`isArrowBigNum`);function y_(e,...t){return t.length===0?Object.setPrototypeOf(Xh(this.TypedArray,e),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(e,...t),this.constructor.prototype)}y_.prototype[v_]=!0,y_.prototype.toJSON=function(){return`"${E_(this)}"`},y_.prototype.valueOf=function(e){return T_(this,e)},y_.prototype.toString=function(){return E_(this)},y_.prototype[Symbol.toPrimitive]=function(e=`default`){switch(e){case`number`:return T_(this);case`string`:return E_(this);case`default`:return D_(this)}return E_(this)};function b_(...e){return y_.apply(this,e)}function x_(...e){return y_.apply(this,e)}function S_(...e){return y_.apply(this,e)}Object.setPrototypeOf(b_.prototype,Object.create(Int32Array.prototype)),Object.setPrototypeOf(x_.prototype,Object.create(Uint32Array.prototype)),Object.setPrototypeOf(S_.prototype,Object.create(Uint32Array.prototype)),Object.assign(b_.prototype,y_.prototype,{constructor:b_,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array}),Object.assign(x_.prototype,y_.prototype,{constructor:x_,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array}),Object.assign(S_.prototype,y_.prototype,{constructor:S_,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});const C_=BigInt(4294967296)*BigInt(4294967296),w_=C_-BigInt(1);function T_(e,t){let{buffer:n,byteOffset:r,byteLength:i,signed:a}=e,o=new BigUint64Array(n,r,i/8),s=a&&o.at(-1)&BigInt(1)<=0)return O_(e);t=t.slice();let r=1;for(let e=0;e(e.children=null,e.ArrayType=Array,e.OffsetArrayType=Int32Array,e[Symbol.toStringTag]=`DataType`))(Q_.prototype);var $_=class extends Q_{constructor(){super(q.Null)}toString(){return`Null`}};j_=Symbol.toStringTag,$_[j_]=(e=>e[Symbol.toStringTag]=`Null`)($_.prototype);var ev=class extends Q_{constructor(e,t){super(q.Int),this.isSigned=e,this.bitWidth=t}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:return this.isSigned?Int32Array:Uint32Array;case 64:return this.isSigned?BigInt64Array:BigUint64Array}throw Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?`I`:`Ui`}nt${this.bitWidth}`}};M_=Symbol.toStringTag,ev[M_]=(e=>(e.isSigned=null,e.bitWidth=null,e[Symbol.toStringTag]=`Int`))(ev.prototype);var tv=class extends ev{constructor(){super(!0,8)}get ArrayType(){return Int8Array}},nv=class extends ev{constructor(){super(!0,16)}get ArrayType(){return Int16Array}},rv=class extends ev{constructor(){super(!0,32)}get ArrayType(){return Int32Array}},iv=class extends ev{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}},av=class extends ev{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}},ov=class extends ev{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}},sv=class extends ev{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}},cv=class extends ev{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}};Object.defineProperty(tv.prototype,`ArrayType`,{value:Int8Array}),Object.defineProperty(nv.prototype,`ArrayType`,{value:Int16Array}),Object.defineProperty(rv.prototype,`ArrayType`,{value:Int32Array}),Object.defineProperty(iv.prototype,`ArrayType`,{value:BigInt64Array}),Object.defineProperty(av.prototype,`ArrayType`,{value:Uint8Array}),Object.defineProperty(ov.prototype,`ArrayType`,{value:Uint16Array}),Object.defineProperty(sv.prototype,`ArrayType`,{value:Uint32Array}),Object.defineProperty(cv.prototype,`ArrayType`,{value:BigUint64Array});var lv=class extends Q_{constructor(e){super(q.Float),this.precision=e}get ArrayType(){switch(this.precision){case _g.HALF:return Uint16Array;case _g.SINGLE:return Float32Array;case _g.DOUBLE:return Float64Array}throw Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};N_=Symbol.toStringTag,lv[N_]=(e=>(e.precision=null,e[Symbol.toStringTag]=`Float`))(lv.prototype);var uv=class extends lv{constructor(){super(_g.HALF)}},dv=class extends lv{constructor(){super(_g.SINGLE)}},fv=class extends lv{constructor(){super(_g.DOUBLE)}};Object.defineProperty(uv.prototype,`ArrayType`,{value:Uint16Array}),Object.defineProperty(dv.prototype,`ArrayType`,{value:Float32Array}),Object.defineProperty(fv.prototype,`ArrayType`,{value:Float64Array});var pv=class extends Q_{constructor(){super(q.Binary)}toString(){return`Binary`}};P_=Symbol.toStringTag,pv[P_]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`Binary`))(pv.prototype);var mv=class extends Q_{constructor(){super(q.LargeBinary)}toString(){return`LargeBinary`}};F_=Symbol.toStringTag,mv[F_]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]=`LargeBinary`))(mv.prototype);var hv=class extends Q_{constructor(){super(q.Utf8)}toString(){return`Utf8`}};I_=Symbol.toStringTag,hv[I_]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`Utf8`))(hv.prototype);var gv=class extends Q_{constructor(){super(q.LargeUtf8)}toString(){return`LargeUtf8`}};L_=Symbol.toStringTag,gv[L_]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]=`LargeUtf8`))(gv.prototype);var _v=class extends Q_{constructor(){super(q.Bool)}toString(){return`Bool`}};R_=Symbol.toStringTag,_v[R_]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`Bool`))(_v.prototype);var vv=class extends Q_{constructor(e,t,n=128){super(q.Decimal),this.scale=e,this.precision=t,this.bitWidth=n}toString(){return`Decimal[${this.precision}e${this.scale>0?`+`:``}${this.scale}]`}};z_=Symbol.toStringTag,vv[z_]=(e=>(e.scale=null,e.precision=null,e.ArrayType=Uint32Array,e[Symbol.toStringTag]=`Decimal`))(vv.prototype);var yv=class extends Q_{constructor(e){super(q.Date),this.unit=e}toString(){return`Date${(this.unit+1)*32}<${vg[this.unit]}>`}get ArrayType(){return this.unit===vg.DAY?Int32Array:BigInt64Array}};B_=Symbol.toStringTag,yv[B_]=(e=>(e.unit=null,e[Symbol.toStringTag]=`Date`))(yv.prototype);var bv=class extends Q_{constructor(e,t){super(q.Time),this.unit=e,this.bitWidth=t}toString(){return`Time${this.bitWidth}<${yg[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}};V_=Symbol.toStringTag,bv[V_]=(e=>(e.unit=null,e.bitWidth=null,e[Symbol.toStringTag]=`Time`))(bv.prototype);var xv=class extends Q_{constructor(e,t){super(q.Timestamp),this.unit=e,this.timezone=t}toString(){return`Timestamp<${yg[this.unit]}${this.timezone?`, ${this.timezone}`:``}>`}};H_=Symbol.toStringTag,xv[H_]=(e=>(e.unit=null,e.timezone=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]=`Timestamp`))(xv.prototype);var Sv=class extends Q_{constructor(e){super(q.Interval),this.unit=e}toString(){return`Interval<${bg[this.unit]}>`}};U_=Symbol.toStringTag,Sv[U_]=(e=>(e.unit=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]=`Interval`))(Sv.prototype);var Cv=class extends Q_{constructor(e){super(q.Duration),this.unit=e}toString(){return`Duration<${yg[this.unit]}>`}};W_=Symbol.toStringTag,Cv[W_]=(e=>(e.unit=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]=`Duration`))(Cv.prototype);var wv=class extends Q_{constructor(e){super(q.List),this.children=[e]}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};G_=Symbol.toStringTag,wv[G_]=(e=>(e.children=null,e[Symbol.toStringTag]=`List`))(wv.prototype);var Tv=class extends Q_{constructor(e){super(q.Struct),this.children=e}toString(){return`Struct<{${this.children.map(e=>`${e.name}:${e.type}`).join(`, `)}}>`}};K_=Symbol.toStringTag,Tv[K_]=(e=>(e.children=null,e[Symbol.toStringTag]=`Struct`))(Tv.prototype);var Ev=class extends Q_{constructor(e,t,n){super(q.Union),this.mode=e,this.children=n,this.typeIds=t=Int32Array.from(t),this.typeIdToChildIndex=t.reduce((e,t,n)=>(e[t]=n)&&e||e,Object.create(null))}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(e=>`${e.type}`).join(` | `)}>`}};q_=Symbol.toStringTag,Ev[q_]=(e=>(e.mode=null,e.typeIds=null,e.children=null,e.typeIdToChildIndex=null,e.ArrayType=Int8Array,e[Symbol.toStringTag]=`Union`))(Ev.prototype);var Dv=class extends Q_{constructor(e){super(q.FixedSizeBinary),this.byteWidth=e}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};J_=Symbol.toStringTag,Dv[J_]=(e=>(e.byteWidth=null,e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`FixedSizeBinary`))(Dv.prototype);var Ov=class extends Q_{constructor(e,t){super(q.FixedSizeList),this.listSize=e,this.children=[t]}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}};Y_=Symbol.toStringTag,Ov[Y_]=(e=>(e.children=null,e.listSize=null,e[Symbol.toStringTag]=`FixedSizeList`))(Ov.prototype);var kv=class extends Q_{constructor(e,t=!1){var n,r,i;if(super(q.Map),this.children=[e],this.keysSorted=t,e&&(e.name=`entries`,(n=e?.type)?.children)){let t=(r=e?.type)?.children[0];t&&(t.name=`key`);let n=(i=e?.type)?.children[1];n&&(n.name=`value`)}}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}get childType(){return this.children[0].type}toString(){return`Map<{${this.children[0].type.children.map(e=>`${e.name}:${e.type}`).join(`, `)}}>`}};X_=Symbol.toStringTag,kv[X_]=(e=>(e.children=null,e.keysSorted=null,e[Symbol.toStringTag]=`Map_`))(kv.prototype);const Av=(e=>()=>++e)(-1);var jv=class extends Q_{constructor(e,t,n,r){super(q.Dictionary),this.indices=t,this.dictionary=e,this.isOrdered=r||!1,this.id=n==null?Av():g_(n)}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}};Z_=Symbol.toStringTag,jv[Z_]=(e=>(e.id=null,e.indices=null,e.isOrdered=null,e.dictionary=null,e[Symbol.toStringTag]=`Dictionary`))(jv.prototype);function Mv(e){let t=e;switch(e.typeId){case q.Decimal:return e.bitWidth/32;case q.Interval:return 1+t.unit;case q.FixedSizeList:return t.listSize;case q.FixedSizeBinary:return t.byteWidth;default:return 1}}var Nv=class{visitMany(e,...t){return e.map((e,n)=>this.visit(e,...t.map(e=>e[n])))}visit(...e){return this.getVisitFn(e[0],!1).apply(this,e)}getVisitFn(e,t=!0){return Pv(this,e,t)}getVisitFnByTypeId(e,t=!0){return Fv(this,e,t)}visitNull(e,...t){return null}visitBool(e,...t){return null}visitInt(e,...t){return null}visitFloat(e,...t){return null}visitUtf8(e,...t){return null}visitLargeUtf8(e,...t){return null}visitBinary(e,...t){return null}visitLargeBinary(e,...t){return null}visitFixedSizeBinary(e,...t){return null}visitDate(e,...t){return null}visitTimestamp(e,...t){return null}visitTime(e,...t){return null}visitDecimal(e,...t){return null}visitList(e,...t){return null}visitStruct(e,...t){return null}visitUnion(e,...t){return null}visitDictionary(e,...t){return null}visitInterval(e,...t){return null}visitDuration(e,...t){return null}visitFixedSizeList(e,...t){return null}visitMap(e,...t){return null}};function Pv(e,t,n=!0){return typeof t==`number`?Fv(e,t,n):typeof t==`string`&&t in q?Fv(e,q[t],n):t&&t instanceof Q_?Fv(e,Iv(t),n):t?.type&&t.type instanceof Q_?Fv(e,Iv(t.type),n):Fv(e,q.NONE,n)}function Fv(e,t,n=!0){let r=null;switch(t){case q.Null:r=e.visitNull;break;case q.Bool:r=e.visitBool;break;case q.Int:r=e.visitInt;break;case q.Int8:r=e.visitInt8||e.visitInt;break;case q.Int16:r=e.visitInt16||e.visitInt;break;case q.Int32:r=e.visitInt32||e.visitInt;break;case q.Int64:r=e.visitInt64||e.visitInt;break;case q.Uint8:r=e.visitUint8||e.visitInt;break;case q.Uint16:r=e.visitUint16||e.visitInt;break;case q.Uint32:r=e.visitUint32||e.visitInt;break;case q.Uint64:r=e.visitUint64||e.visitInt;break;case q.Float:r=e.visitFloat;break;case q.Float16:r=e.visitFloat16||e.visitFloat;break;case q.Float32:r=e.visitFloat32||e.visitFloat;break;case q.Float64:r=e.visitFloat64||e.visitFloat;break;case q.Utf8:r=e.visitUtf8;break;case q.LargeUtf8:r=e.visitLargeUtf8;break;case q.Binary:r=e.visitBinary;break;case q.LargeBinary:r=e.visitLargeBinary;break;case q.FixedSizeBinary:r=e.visitFixedSizeBinary;break;case q.Date:r=e.visitDate;break;case q.DateDay:r=e.visitDateDay||e.visitDate;break;case q.DateMillisecond:r=e.visitDateMillisecond||e.visitDate;break;case q.Timestamp:r=e.visitTimestamp;break;case q.TimestampSecond:r=e.visitTimestampSecond||e.visitTimestamp;break;case q.TimestampMillisecond:r=e.visitTimestampMillisecond||e.visitTimestamp;break;case q.TimestampMicrosecond:r=e.visitTimestampMicrosecond||e.visitTimestamp;break;case q.TimestampNanosecond:r=e.visitTimestampNanosecond||e.visitTimestamp;break;case q.Time:r=e.visitTime;break;case q.TimeSecond:r=e.visitTimeSecond||e.visitTime;break;case q.TimeMillisecond:r=e.visitTimeMillisecond||e.visitTime;break;case q.TimeMicrosecond:r=e.visitTimeMicrosecond||e.visitTime;break;case q.TimeNanosecond:r=e.visitTimeNanosecond||e.visitTime;break;case q.Decimal:r=e.visitDecimal;break;case q.List:r=e.visitList;break;case q.Struct:r=e.visitStruct;break;case q.Union:r=e.visitUnion;break;case q.DenseUnion:r=e.visitDenseUnion||e.visitUnion;break;case q.SparseUnion:r=e.visitSparseUnion||e.visitUnion;break;case q.Dictionary:r=e.visitDictionary;break;case q.Interval:r=e.visitInterval;break;case q.IntervalDayTime:r=e.visitIntervalDayTime||e.visitInterval;break;case q.IntervalYearMonth:r=e.visitIntervalYearMonth||e.visitInterval;break;case q.Duration:r=e.visitDuration;break;case q.DurationSecond:r=e.visitDurationSecond||e.visitDuration;break;case q.DurationMillisecond:r=e.visitDurationMillisecond||e.visitDuration;break;case q.DurationMicrosecond:r=e.visitDurationMicrosecond||e.visitDuration;break;case q.DurationNanosecond:r=e.visitDurationNanosecond||e.visitDuration;break;case q.FixedSizeList:r=e.visitFixedSizeList;break;case q.Map:r=e.visitMap;break}if(typeof r==`function`)return r;if(!n)return()=>null;throw Error(`Unrecognized type '${q[t]}'`)}function Iv(e){switch(e.typeId){case q.Null:return q.Null;case q.Int:{let{bitWidth:t,isSigned:n}=e;switch(t){case 8:return n?q.Int8:q.Uint8;case 16:return n?q.Int16:q.Uint16;case 32:return n?q.Int32:q.Uint32;case 64:return n?q.Int64:q.Uint64}return q.Int}case q.Float:switch(e.precision){case _g.HALF:return q.Float16;case _g.SINGLE:return q.Float32;case _g.DOUBLE:return q.Float64}return q.Float;case q.Binary:return q.Binary;case q.LargeBinary:return q.LargeBinary;case q.Utf8:return q.Utf8;case q.LargeUtf8:return q.LargeUtf8;case q.Bool:return q.Bool;case q.Decimal:return q.Decimal;case q.Time:switch(e.unit){case yg.SECOND:return q.TimeSecond;case yg.MILLISECOND:return q.TimeMillisecond;case yg.MICROSECOND:return q.TimeMicrosecond;case yg.NANOSECOND:return q.TimeNanosecond}return q.Time;case q.Timestamp:switch(e.unit){case yg.SECOND:return q.TimestampSecond;case yg.MILLISECOND:return q.TimestampMillisecond;case yg.MICROSECOND:return q.TimestampMicrosecond;case yg.NANOSECOND:return q.TimestampNanosecond}return q.Timestamp;case q.Date:switch(e.unit){case vg.DAY:return q.DateDay;case vg.MILLISECOND:return q.DateMillisecond}return q.Date;case q.Interval:switch(e.unit){case bg.DAY_TIME:return q.IntervalDayTime;case bg.YEAR_MONTH:return q.IntervalYearMonth}return q.Interval;case q.Duration:switch(e.unit){case yg.SECOND:return q.DurationSecond;case yg.MILLISECOND:return q.DurationMillisecond;case yg.MICROSECOND:return q.DurationMicrosecond;case yg.NANOSECOND:return q.DurationNanosecond}return q.Duration;case q.Map:return q.Map;case q.List:return q.List;case q.Struct:return q.Struct;case q.Union:switch(e.mode){case gg.Dense:return q.DenseUnion;case gg.Sparse:return q.SparseUnion}return q.Union;case q.FixedSizeBinary:return q.FixedSizeBinary;case q.FixedSizeList:return q.FixedSizeList;case q.Dictionary:return q.Dictionary}throw Error(`Unrecognized type '${q[e.typeId]}'`)}Nv.prototype.visitInt8=null,Nv.prototype.visitInt16=null,Nv.prototype.visitInt32=null,Nv.prototype.visitInt64=null,Nv.prototype.visitUint8=null,Nv.prototype.visitUint16=null,Nv.prototype.visitUint32=null,Nv.prototype.visitUint64=null,Nv.prototype.visitFloat16=null,Nv.prototype.visitFloat32=null,Nv.prototype.visitFloat64=null,Nv.prototype.visitDateDay=null,Nv.prototype.visitDateMillisecond=null,Nv.prototype.visitTimestampSecond=null,Nv.prototype.visitTimestampMillisecond=null,Nv.prototype.visitTimestampMicrosecond=null,Nv.prototype.visitTimestampNanosecond=null,Nv.prototype.visitTimeSecond=null,Nv.prototype.visitTimeMillisecond=null,Nv.prototype.visitTimeMicrosecond=null,Nv.prototype.visitTimeNanosecond=null,Nv.prototype.visitDenseUnion=null,Nv.prototype.visitSparseUnion=null,Nv.prototype.visitIntervalDayTime=null,Nv.prototype.visitIntervalYearMonth=null,Nv.prototype.visitDuration=null,Nv.prototype.visitDurationSecond=null,Nv.prototype.visitDurationMillisecond=null,Nv.prototype.visitDurationMicrosecond=null,Nv.prototype.visitDurationNanosecond=null;const Lv=new Float64Array(1),Rv=new Uint32Array(Lv.buffer);function zv(e){let t=(e&31744)>>10,n=(e&1023)/1024,r=(-1)**((e&32768)>>15);switch(t){case 31:return r*(n?NaN:1/0);case 0:return r*(n?6103515625e-14*n:0)}return r*2**(t-15)*(1+n)}function Bv(e){if(e!==e)return 32256;Lv[0]=e;let t=(Rv[1]&2147483648)>>16&65535,n=Rv[1]&2146435072,r=0;return n>=1089470464?Rv[0]>0?n=31744:(n=(n&2080374784)>>16,r=(Rv[1]&1048575)>>10):n<=1056964608?(r=1048576+(Rv[1]&1048575),r=1048576+(r<<(n>>20)-998)>>21,n=0):(n=n-1056964608>>10,r=(Rv[1]&1048575)+512>>10),t|n|r&65535}var Vv=class extends Nv{};function Hv(e){return(t,n,r)=>{if(t.setValid(n,r!=null))return e(t,n,r)}}const Uv=(e,t,n)=>{e[t]=Math.floor(n/864e5)},Wv=(e,t,n,r)=>{if(n+1{let i=e+n;r?t[i>>3]|=1<>3]&=~(1<{e[t]=n},qv=({values:e},t,n)=>{e[t]=n},Jv=({values:e},t,n)=>{e[t]=Bv(n)},Yv=(e,t,n)=>{switch(e.type.precision){case _g.HALF:return Jv(e,t,n);case _g.SINGLE:case _g.DOUBLE:return qv(e,t,n)}},Xv=({values:e},t,n)=>{Uv(e,t,n.valueOf())},Zv=({values:e},t,n)=>{e[t]=BigInt(n)},Qv=({stride:e,values:t},n,r)=>{t.set(r.subarray(0,e),e*n)},$v=({values:e,valueOffsets:t},n,r)=>Wv(e,t,n,r),ey=({values:e,valueOffsets:t},n,r)=>Wv(e,t,n,Oh(r)),ty=(e,t,n)=>{e.type.unit===vg.DAY?Xv(e,t,n):Zv(e,t,n)},ny=({values:e},t,n)=>{e[t]=BigInt(n/1e3)},ry=({values:e},t,n)=>{e[t]=BigInt(n)},iy=({values:e},t,n)=>{e[t]=BigInt(n*1e3)},ay=({values:e},t,n)=>{e[t]=BigInt(n*1e6)},oy=(e,t,n)=>{switch(e.type.unit){case yg.SECOND:return ny(e,t,n);case yg.MILLISECOND:return ry(e,t,n);case yg.MICROSECOND:return iy(e,t,n);case yg.NANOSECOND:return ay(e,t,n)}},sy=({values:e},t,n)=>{e[t]=n},cy=({values:e},t,n)=>{e[t]=n},ly=({values:e},t,n)=>{e[t]=n},uy=({values:e},t,n)=>{e[t]=n},dy=(e,t,n)=>{switch(e.type.unit){case yg.SECOND:return sy(e,t,n);case yg.MILLISECOND:return cy(e,t,n);case yg.MICROSECOND:return ly(e,t,n);case yg.NANOSECOND:return uy(e,t,n)}},fy=({values:e,stride:t},n,r)=>{e.set(r.subarray(0,t),t*n)},py=(e,t,n)=>{let r=e.children[0],i=e.valueOffsets,a=Ny.getVisitFn(r);if(Array.isArray(n))for(let e=-1,o=i[t],s=i[t+1];o{let r=e.children[0],{valueOffsets:i}=e,a=Ny.getVisitFn(r),{[t]:o,[t+1]:s}=i,c=n instanceof Map?n.entries():Object.entries(n);for(let e of c)if(a(r,o,e),++o>=s)break},hy=(e,t)=>(n,r,i,a)=>r&&n(r,e,t[a]),gy=(e,t)=>(n,r,i,a)=>r&&n(r,e,t.get(a)),_y=(e,t)=>(n,r,i,a)=>r&&n(r,e,t.get(i.name)),vy=(e,t)=>(n,r,i,a)=>r&&n(r,e,t[i.name]),yy=(e,t,n)=>{let r=e.type.children.map(e=>Ny.getVisitFn(e.type)),i=n instanceof Map?_y(t,n):n instanceof Mx?gy(t,n):Array.isArray(n)?hy(t,n):vy(t,n);e.type.children.forEach((t,n)=>i(r[n],e.children[n],t,n))},by=(e,t,n)=>{e.type.mode===gg.Dense?xy(e,t,n):Sy(e,t,n)},xy=(e,t,n)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[r];Ny.visit(i,e.valueOffsets[t],n)},Sy=(e,t,n)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[r];Ny.visit(i,t,n)},Cy=(e,t,n)=>{var r;(r=e.dictionary)==null||r.set(e.values[t],n)},wy=(e,t,n)=>{e.type.unit===bg.DAY_TIME?Ty(e,t,n):Ey(e,t,n)},Ty=({values:e},t,n)=>{e.set(n.subarray(0,2),2*t)},Ey=({values:e},t,n)=>{e[t]=n[0]*12+n[1]%12},Dy=({values:e},t,n)=>{e[t]=n},Oy=({values:e},t,n)=>{e[t]=n},ky=({values:e},t,n)=>{e[t]=n},Ay=({values:e},t,n)=>{e[t]=n},jy=(e,t,n)=>{switch(e.type.unit){case yg.SECOND:return Dy(e,t,n);case yg.MILLISECOND:return Oy(e,t,n);case yg.MICROSECOND:return ky(e,t,n);case yg.NANOSECOND:return Ay(e,t,n)}},My=(e,t,n)=>{let{stride:r}=e,i=e.children[0],a=Ny.getVisitFn(i);if(Array.isArray(n))for(let e=-1,o=t*r;++e`${h_(e)}: ${h_(t)}`).join(`, `)}}`}[Symbol.for(`nodejs.util.inspect.custom`)](){return this.toString()}[Symbol.iterator](){return new Ly(this[Py],this[Fy])}},Ly=class{constructor(e,t){this.childIndex=0,this.children=e.children,this.rowIndex=t,this.childFields=e.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){let e=this.childIndex;return ee.name)}has(e,t){return e[Py].type.children.findIndex(e=>e.name===t)!==-1}getOwnPropertyDescriptor(e,t){if(e[Py].type.children.findIndex(e=>e.name===t)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(e,t){if(Reflect.has(e,t))return e[t];let n=e[Py].type.children.findIndex(e=>e.name===t);if(n!==-1){let r=kb.visit(e[Py].children[n],e[Fy]);return Reflect.set(e,t,r),r}}set(e,t,n){let r=e[Py].type.children.findIndex(e=>e.name===t);return r===-1?Reflect.has(e,t)||typeof t==`symbol`?Reflect.set(e,t,n):!1:(Ny.visit(e[Py].children[r],e[Fy],n),Reflect.set(e,t,n))}},zy=class extends Nv{};function By(e){return(t,n)=>t.getValid(n)?e(t,n):null}const Vy=(e,t)=>864e5*e[t],Hy=(e,t)=>null,Uy=(e,t,n)=>{if(n+1>=t.length)return null;let r=g_(t[n]),i=g_(t[n+1]);return e.subarray(r,i)},Wy=({offset:e,values:t},n)=>{let r=e+n,i=t[r>>3];return(i&1<Vy(e,t),Ky=({values:e},t)=>g_(e[t]),qy=({stride:e,values:t},n)=>t[e*n],Jy=({stride:e,values:t},n)=>zv(t[e*n]),Yy=({values:e},t)=>e[t],Xy=({stride:e,values:t},n)=>t.subarray(e*n,e*(n+1)),Zy=({values:e,valueOffsets:t},n)=>Uy(e,t,n),Qy=({values:e,valueOffsets:t},n)=>{let r=Uy(e,t,n);return r===null?null:Eh(r)},$y=({values:e},t)=>e[t],eb=({type:e,values:t},n)=>e.precision===_g.HALF?zv(t[n]):t[n],tb=(e,t)=>e.type.unit===vg.DAY?Gy(e,t):Ky(e,t),nb=({values:e},t)=>1e3*g_(e[t]),rb=({values:e},t)=>g_(e[t]),ib=({values:e},t)=>__(e[t],BigInt(1e3)),ab=({values:e},t)=>__(e[t],BigInt(1e6)),ob=(e,t)=>{switch(e.type.unit){case yg.SECOND:return nb(e,t);case yg.MILLISECOND:return rb(e,t);case yg.MICROSECOND:return ib(e,t);case yg.NANOSECOND:return ab(e,t)}},sb=({values:e},t)=>e[t],cb=({values:e},t)=>e[t],lb=({values:e},t)=>e[t],ub=({values:e},t)=>e[t],db=(e,t)=>{switch(e.type.unit){case yg.SECOND:return sb(e,t);case yg.MILLISECOND:return cb(e,t);case yg.MICROSECOND:return lb(e,t);case yg.NANOSECOND:return ub(e,t)}},fb=({values:e,stride:t},n)=>k_.decimal(e.subarray(t*n,t*(n+1))),pb=(e,t)=>{let{valueOffsets:n,stride:r,children:i}=e,{[t*r]:a,[t*r+1]:o}=n,s=i[0],c=s.slice(a,o-a);return new Mx([c])},mb=(e,t)=>{let{valueOffsets:n,children:r}=e,{[t]:i,[t+1]:a}=n,o=r[0];return new Pb(o.slice(i,a-i))},hb=(e,t)=>new Iy(e,t),gb=(e,t)=>e.type.mode===gg.Dense?_b(e,t):vb(e,t),_b=(e,t)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],r=e.children[n];return kb.visit(r,e.valueOffsets[t])},vb=(e,t)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],r=e.children[n];return kb.visit(r,t)},yb=(e,t)=>{var n;return(n=e.dictionary)?.get(e.values[t])},bb=(e,t)=>e.type.unit===bg.DAY_TIME?xb(e,t):Sb(e,t),xb=({values:e},t)=>e.subarray(2*t,2*(t+1)),Sb=({values:e},t)=>{let n=e[t],r=new Int32Array(2);return r[0]=Math.trunc(n/12),r[1]=Math.trunc(n%12),r},Cb=({values:e},t)=>e[t],wb=({values:e},t)=>e[t],Tb=({values:e},t)=>e[t],Eb=({values:e},t)=>e[t],Db=(e,t)=>{switch(e.type.unit){case yg.SECOND:return Cb(e,t);case yg.MILLISECOND:return wb(e,t);case yg.MICROSECOND:return Tb(e,t);case yg.NANOSECOND:return Eb(e,t)}},Ob=(e,t)=>{let{stride:n,children:r}=e,i=r[0],a=i.slice(t*n,n);return new Mx([a])};zy.prototype.visitNull=By(Hy),zy.prototype.visitBool=By(Wy),zy.prototype.visitInt=By($y),zy.prototype.visitInt8=By(qy),zy.prototype.visitInt16=By(qy),zy.prototype.visitInt32=By(qy),zy.prototype.visitInt64=By(Yy),zy.prototype.visitUint8=By(qy),zy.prototype.visitUint16=By(qy),zy.prototype.visitUint32=By(qy),zy.prototype.visitUint64=By(Yy),zy.prototype.visitFloat=By(eb),zy.prototype.visitFloat16=By(Jy),zy.prototype.visitFloat32=By(qy),zy.prototype.visitFloat64=By(qy),zy.prototype.visitUtf8=By(Qy),zy.prototype.visitLargeUtf8=By(Qy),zy.prototype.visitBinary=By(Zy),zy.prototype.visitLargeBinary=By(Zy),zy.prototype.visitFixedSizeBinary=By(Xy),zy.prototype.visitDate=By(tb),zy.prototype.visitDateDay=By(Gy),zy.prototype.visitDateMillisecond=By(Ky),zy.prototype.visitTimestamp=By(ob),zy.prototype.visitTimestampSecond=By(nb),zy.prototype.visitTimestampMillisecond=By(rb),zy.prototype.visitTimestampMicrosecond=By(ib),zy.prototype.visitTimestampNanosecond=By(ab),zy.prototype.visitTime=By(db),zy.prototype.visitTimeSecond=By(sb),zy.prototype.visitTimeMillisecond=By(cb),zy.prototype.visitTimeMicrosecond=By(lb),zy.prototype.visitTimeNanosecond=By(ub),zy.prototype.visitDecimal=By(fb),zy.prototype.visitList=By(pb),zy.prototype.visitStruct=By(hb),zy.prototype.visitUnion=By(gb),zy.prototype.visitDenseUnion=By(_b),zy.prototype.visitSparseUnion=By(vb),zy.prototype.visitDictionary=By(yb),zy.prototype.visitInterval=By(bb),zy.prototype.visitIntervalDayTime=By(xb),zy.prototype.visitIntervalYearMonth=By(Sb),zy.prototype.visitDuration=By(Db),zy.prototype.visitDurationSecond=By(Cb),zy.prototype.visitDurationMillisecond=By(wb),zy.prototype.visitDurationMicrosecond=By(Tb),zy.prototype.visitDurationNanosecond=By(Eb),zy.prototype.visitFixedSizeList=By(Ob),zy.prototype.visitMap=By(mb);const kb=new zy,Ab=Symbol.for(`keys`),jb=Symbol.for(`vals`),Mb=Symbol.for(`kKeysAsStrings`),Nb=Symbol.for(`_kKeysAsStrings`);var Pb=class{constructor(e){return this[Ab]=new Mx([e.children[0]]).memoize(),this[jb]=e.children[1],new Proxy(this,new Ib)}get[Mb](){return this[Nb]||(this[Nb]=Array.from(this[Ab].toArray(),String))}[Symbol.iterator](){return new Fb(this[Ab],this[jb])}get size(){return this[Ab].length}toArray(){return Object.values(this.toJSON())}toJSON(){let e=this[Ab],t=this[jb],n={};for(let r=-1,i=e.length;++r`${h_(e)}: ${h_(t)}`).join(`, `)}}`}[Symbol.for(`nodejs.util.inspect.custom`)](){return this.toString()}},Fb=class{constructor(e,t){this.keys=e,this.vals=t,this.keyIndex=0,this.numKeys=e.length}[Symbol.iterator](){return this}next(){let e=this.keyIndex;return e===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(e),kb.visit(this.vals,e)]})}},Ib=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(e){return e[Mb]}has(e,t){return e[Mb].includes(t)}getOwnPropertyDescriptor(e,t){let n=e[Mb].indexOf(t);if(n!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(e,t){if(Reflect.has(e,t))return e[t];let n=e[Mb].indexOf(t);if(n!==-1){let r=kb.visit(Reflect.get(e,jb),n);return Reflect.set(e,t,r),r}}set(e,t,n){let r=e[Mb].indexOf(t);return r===-1?Reflect.has(e,t)?Reflect.set(e,t,n):!1:(Ny.visit(Reflect.get(e,jb),r,n),Reflect.set(e,t,n))}};Object.defineProperties(Pb.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:`Row`},[Ab]:{writable:!0,enumerable:!1,configurable:!1,value:null},[jb]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Nb]:{writable:!0,enumerable:!1,configurable:!1,value:null}});let Lb;function Rb(e,t,n,r){let{length:i=0}=e,a=typeof t==`number`?t:0,o=typeof n==`number`?n:i;return a<0&&(a=(a%i+i)%i),o<0&&(o=(o%i+i)%i),oi&&(o=i),r?r(e,a,o):[a,o]}const zb=(e,t)=>e<0?t+e:e,Bb=e=>e!==e;function Vb(e){let t=typeof e;if(t!==`object`||e===null)return Bb(e)?Bb:t=>t===e;if(e instanceof Date){let t=e.valueOf();return e=>e instanceof Date?e.valueOf()===t:!1}return ArrayBuffer.isView(e)?t=>t?og(e,t):!1:e instanceof Map?Ub(e):Array.isArray(e)?Hb(e):e instanceof Mx?Wb(e):Gb(e,!0)}function Hb(e){let t=[];for(let n=-1,r=e.length;++n!1;let r=[];for(let t=-1,i=n.length;++t{if(!n||typeof n!=`object`)return!1;switch(n.constructor){case Array:return qb(e,n);case Map:return Yb(e,n,n.keys());case Pb:case Iy:case Object:case void 0:return Yb(e,n,t||Object.keys(n))}return n instanceof Mx?Jb(e,n):!1}}function qb(e,t){let n=e.length;if(t.length!==n)return!1;for(let r=-1;++r>r}function Qb(e,t,n){let r=n.byteLength+7&-8;if(e>0||n.byteLength>3):$b(new ex(n,e,t,null,Xb)).subarray(0,r)),i}return n}function $b(e){let t=[],n=0,r=0,i=0;for(let a of e)a&&(i|=1<0)&&(t[n++]=i);let a=new Uint8Array(t.length+7&-8);return a.set(t),a}var ex=class{constructor(e,t,n,r,i){this.bytes=e,this.length=n,this.context=r,this.get=i,this.bit=t%8,this.byteIndex=t>>3,this.byte=e[this.byteIndex++],this.index=0}next(){return this.index>3<<3,i=t+(t%8==0?0:8-t%8);return tx(e,t,i)+tx(e,r,n)+nx(e,i>>3,r-i>>3)}function nx(e,t,n){let r=0,i=Math.trunc(t),a=new DataView(e.buffer,e.byteOffset,e.byteLength),o=n===void 0?e.byteLength:i+n;for(;o-i>=4;)r+=rx(a.getUint32(i)),i+=4;for(;o-i>=2;)r+=rx(a.getUint16(i)),i+=2;for(;o-i>=1;)r+=rx(a.getUint8(i)),i+=1;return r}function rx(e){let t=Math.trunc(e);return t-=t>>>1&1431655765,t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}const ix=-1;var ax=class e{get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get nullable(){if(this._nullCount!==0){let{type:e}=this;return Q_.isSparseUnion(e)||Q_.isDenseUnion(e)?this.children.some(e=>e.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let e=0,{valueOffsets:t,values:n,nullBitmap:r,typeIds:i}=this;return t&&(e+=t.byteLength),n&&(e+=n.byteLength),r&&(e+=r.byteLength),i&&(e+=i.byteLength),this.children.reduce((e,t)=>e+t.byteLength,e)}get nullCount(){if(Q_.isUnion(this.type))return this.children.reduce((e,t)=>e+t.nullCount,0);let e=this._nullCount,t;return e<=ix&&(t=this.nullBitmap)&&(this._nullCount=e=t.length===0?0:this.length-tx(t,this.offset,this.offset+this.length)),e}constructor(t,n,r,i,a,o=[],s){this.type=t,this.children=o,this.dictionary=s,this.offset=Math.floor(Math.max(n||0,0)),this.length=Math.floor(Math.max(r||0,0)),this._nullCount=Math.floor(Math.max(i||0,-1));let c;a instanceof e?(this.stride=a.stride,this.values=a.values,this.typeIds=a.typeIds,this.nullBitmap=a.nullBitmap,this.valueOffsets=a.valueOffsets):(this.stride=Mv(t),a&&((c=a[0])&&(this.valueOffsets=c),(c=a[1])&&(this.values=c),(c=a[2])&&(this.nullBitmap=c),(c=a[3])&&(this.typeIds=c)))}getValid(e){let{type:t}=this;if(Q_.isUnion(t)){let n=t,r=this.children[n.typeIdToChildIndex[this.typeIds[e]]],i=n.mode===gg.Dense?this.valueOffsets[e]:e;return r.getValid(i)}if(this.nullable&&this.nullCount>0){let t=this.offset+e,n=this.nullBitmap[t>>3];return(n&1<>3;(!r||r.byteLength<=c)&&(r=new Uint8Array((i+a+63&-64)>>3).fill(255),this.nullCount>0?(r.set(Qb(i,a,this.nullBitmap),0),Object.assign(this,{nullBitmap:r})):Object.assign(this,{nullBitmap:r,_nullCount:0}));let l=r[c];n=(l&s)!==0,r[c]=t?l|s:l&~s}return n!==!!t&&(this._nullCount=this.nullCount+(t?-1:1)),t}clone(t=this.type,n=this.offset,r=this.length,i=this._nullCount,a=this,o=this.children){return new e(t,n,r,i,a,o,this.dictionary)}slice(e,t){let{stride:n,typeId:r,children:i}=this,a=(this._nullCount===0)-1,o=r===16?n:1,s=this._sliceBuffers(e,t,n,r);return this.clone(this.type,this.offset+e,t,a,s,i.length===0||this.valueOffsets?i:this._sliceChildren(i,o*e,o*t))}_changeLengthAndBackfillNullBitmap(e){if(this.typeId===q.Null)return this.clone(this.type,0,e,0);let{length:t,nullCount:n}=this,r=new Uint8Array((e+63&-64)>>3).fill(255,0,t>>3);r[t>>3]=(1<0&&r.set(Qb(this.offset,t,this.nullBitmap),0);let i=this.buffers;return i[p_.VALIDITY]=r,this.clone(this.type,0,e,n+(e-t),i)}_sliceBuffers(e,t,n,r){let i,{buffers:a}=this;return(i=a[p_.TYPE])&&(a[p_.TYPE]=i.subarray(e,e+t)),(i=a[p_.OFFSET])&&(a[p_.OFFSET]=i.subarray(e,e+t+1))||(i=a[p_.DATA])&&(a[p_.DATA]=r===6?i:i.subarray(n*e,n*(e+t))),a}_sliceChildren(e,t,n){return e.map(e=>e.slice(t,n))}};ax.prototype.children=Object.freeze([]);var ox=class e extends Nv{visit(e){return this.getVisitFn(e.type).call(this,e)}visitNull(e){let{type:t,offset:n=0,length:r=0}=e;return new ax(t,n,r,r)}visitBool(e){let{type:t,offset:n=0}=e,r=$h(e.nullBitmap),i=Xh(t.ArrayType,e.data),{length:a=i.length>>3,nullCount:o=e.nullBitmap?-1:0}=e;return new ax(t,n,a,o,[void 0,i,r])}visitInt(e){let{type:t,offset:n=0}=e,r=$h(e.nullBitmap),i=Xh(t.ArrayType,e.data),{length:a=i.length,nullCount:o=e.nullBitmap?-1:0}=e;return new ax(t,n,a,o,[void 0,i,r])}visitFloat(e){let{type:t,offset:n=0}=e,r=$h(e.nullBitmap),i=Xh(t.ArrayType,e.data),{length:a=i.length,nullCount:o=e.nullBitmap?-1:0}=e;return new ax(t,n,a,o,[void 0,i,r])}visitUtf8(e){let{type:t,offset:n=0}=e,r=$h(e.data),i=$h(e.nullBitmap),a=Zh(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new ax(t,n,o,s,[a,r,i])}visitLargeUtf8(e){let{type:t,offset:n=0}=e,r=$h(e.data),i=$h(e.nullBitmap),a=Qh(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new ax(t,n,o,s,[a,r,i])}visitBinary(e){let{type:t,offset:n=0}=e,r=$h(e.data),i=$h(e.nullBitmap),a=Zh(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new ax(t,n,o,s,[a,r,i])}visitLargeBinary(e){let{type:t,offset:n=0}=e,r=$h(e.data),i=$h(e.nullBitmap),a=Qh(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new ax(t,n,o,s,[a,r,i])}visitFixedSizeBinary(e){let{type:t,offset:n=0}=e,r=$h(e.nullBitmap),i=Xh(t.ArrayType,e.data),{length:a=i.length/Mv(t),nullCount:o=e.nullBitmap?-1:0}=e;return new ax(t,n,a,o,[void 0,i,r])}visitDate(e){let{type:t,offset:n=0}=e,r=$h(e.nullBitmap),i=Xh(t.ArrayType,e.data),{length:a=i.length/Mv(t),nullCount:o=e.nullBitmap?-1:0}=e;return new ax(t,n,a,o,[void 0,i,r])}visitTimestamp(e){let{type:t,offset:n=0}=e,r=$h(e.nullBitmap),i=Xh(t.ArrayType,e.data),{length:a=i.length/Mv(t),nullCount:o=e.nullBitmap?-1:0}=e;return new ax(t,n,a,o,[void 0,i,r])}visitTime(e){let{type:t,offset:n=0}=e,r=$h(e.nullBitmap),i=Xh(t.ArrayType,e.data),{length:a=i.length/Mv(t),nullCount:o=e.nullBitmap?-1:0}=e;return new ax(t,n,a,o,[void 0,i,r])}visitDecimal(e){let{type:t,offset:n=0}=e,r=$h(e.nullBitmap),i=Xh(t.ArrayType,e.data),{length:a=i.length/Mv(t),nullCount:o=e.nullBitmap?-1:0}=e;return new ax(t,n,a,o,[void 0,i,r])}visitList(e){let{type:t,offset:n=0,child:r}=e,i=$h(e.nullBitmap),a=Zh(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new ax(t,n,o,s,[a,void 0,i],[r])}visitStruct(e){let{type:t,offset:n=0,children:r=[]}=e,i=$h(e.nullBitmap),{length:a=r.reduce((e,{length:t})=>Math.max(e,t),0),nullCount:o=e.nullBitmap?-1:0}=e;return new ax(t,n,a,o,[void 0,void 0,i],r)}visitUnion(e){let{type:t,offset:n=0,children:r=[]}=e,i=Xh(t.ArrayType,e.typeIds),{length:a=i.length,nullCount:o=-1}=e;if(Q_.isSparseUnion(t))return new ax(t,n,a,o,[void 0,void 0,void 0,i],r);let s=Zh(e.valueOffsets);return new ax(t,n,a,o,[s,void 0,void 0,i],r)}visitDictionary(t){let{type:n,offset:r=0}=t,i=$h(t.nullBitmap),a=Xh(n.indices.ArrayType,t.data),{dictionary:o=new Mx([new e().visit({type:n.dictionary})])}=t,{length:s=a.length,nullCount:c=t.nullBitmap?-1:0}=t;return new ax(n,r,s,c,[void 0,a,i],[],o)}visitInterval(e){let{type:t,offset:n=0}=e,r=$h(e.nullBitmap),i=Xh(t.ArrayType,e.data),{length:a=i.length/Mv(t),nullCount:o=e.nullBitmap?-1:0}=e;return new ax(t,n,a,o,[void 0,i,r])}visitDuration(e){let{type:t,offset:n=0}=e,r=$h(e.nullBitmap),i=Xh(t.ArrayType,e.data),{length:a=i.length,nullCount:o=e.nullBitmap?-1:0}=e;return new ax(t,n,a,o,[void 0,i,r])}visitFixedSizeList(t){let{type:n,offset:r=0,child:i=new e().visit({type:n.valueType})}=t,a=$h(t.nullBitmap),{length:o=i.length/Mv(n),nullCount:s=t.nullBitmap?-1:0}=t;return new ax(n,r,o,s,[void 0,void 0,a],[i])}visitMap(t){let{type:n,offset:r=0,child:i=new e().visit({type:n.childType})}=t,a=$h(t.nullBitmap),o=Zh(t.valueOffsets),{length:s=o.length-1,nullCount:c=t.nullBitmap?-1:0}=t;return new ax(n,r,s,c,[o,void 0,a],[i])}};const sx=new ox;function cx(e){return sx.visit(e)}var lx=class{constructor(e=0,t){this.numChunks=e,this.getChunkIterator=t,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndexe.nullable)}function dx(e){return e.reduce((e,t)=>e+t.nullCount,0)}function fx(e){return e.reduce((e,t,n)=>(e[n+1]=e[n]+t.length,e),new Uint32Array(e.length+1))}function px(e,t,n,r){let i=[];for(let a=-1,o=e.length;++a=r)break;if(n>=s+c)continue;if(s>=n&&s+c<=r){i.push(o);continue}let l=Math.max(0,n-s),u=Math.min(r-s,c);i.push(o.slice(l,u-l))}return i.length===0&&i.push(e[0].slice(0,0)),i}function mx(e,t,n,r){let i=0,a=0,o=t.length-1;do{if(i>=o-1)return n0?0:-1}function xx(e,t){let{nullBitmap:n}=e;if(!n||e.nullCount<=0)return-1;let r=0;for(let i of new ex(n,e.offset+(t||0),e.length,n,Xb)){if(!i)return r;++r}return-1}function Sx(e,t,n){if(t===void 0)return-1;if(t===null)switch(e.typeId){case q.Union:break;case q.Dictionary:break;default:return xx(e,n)}let r=kb.getVisitFn(e),i=Vb(t);for(let t=(n||0)-1,a=e.length;++t{let n=e.data[t];return n.values.subarray(0,n.length)[Symbol.iterator]()});let n=0;return new lx(e.data.length,t=>{let r=e.data[t],i=r.length,a=e.slice(n,n+i);return n+=i,new Dx(a)})}var Dx=class{constructor(e){this.vector=e,this.index=0}next(){return this.indexe.data):t;if(a.length===0||a.some(e=>!(e instanceof ax)))throw TypeError(`Vector constructor expects an Array of Data instances.`);let o=(n=a[0])?.type;switch(a.length){case 0:this._offsets=[0];break;case 1:{let{get:e,set:t,indexOf:n}=Ax[o.typeId],r=a[0];this.isValid=e=>hx(r,e),this.get=t=>e(r,t),this.set=(e,n)=>t(r,e,n),this.indexOf=e=>n(r,e),this._offsets=[0,r.length];break}default:Object.setPrototypeOf(this,jx[o.typeId]),this._offsets=fx(a);break}this.data=a,this.type=o,this.stride=Mv(o),this.numChildren=(i=(r=o.children)?.length)??0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((e,t)=>e+t.byteLength,0)}get nullable(){return ux(this.data)}get nullCount(){return dx(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${q[this.type.typeId]}Vector`}isValid(e){return!1}get(e){return null}at(e){return this.get(zb(e,this.length))}set(e,t){}indexOf(e,t){return-1}includes(e,t){return this.indexOf(e,t)>-1}[Symbol.iterator](){return Ox.visit(this)}concat(...t){return new e(this.data.concat(t.flatMap(e=>e.data).flat(1/0)))}slice(t,n){return new e(Rb(this,t,n,({data:e,_offsets:t},n,r)=>px(e,t,n,r)))}toJSON(){return[...this]}toArray(){let{type:e,data:t,length:n,stride:r,ArrayType:i}=this;switch(e.typeId){case q.Int:case q.Float:case q.Decimal:case q.Time:case q.Timestamp:switch(t.length){case 0:return new i;case 1:return t[0].values.subarray(0,n*r);default:return t.reduce((e,{values:t,length:n})=>(e.array.set(t.subarray(0,n*r),e.offset),e.offset+=n*r,e),{array:new i(n*r),offset:0}).array}}return[...this]}toString(){return`[${[...this].join(`,`)}]`}getChild(e){var t;return this.getChildAt((t=this.type.children)?.findIndex(t=>t.name===e))}getChildAt(t){return t>-1&&te[t])):null}get isMemoized(){return Q_.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(Q_.isDictionary(this.type)){let t=new Nx(this.data[0].dictionary),n=this.data.map(e=>{let n=e.clone();return n.dictionary=t,n});return new e(n)}return new Nx(this)}unmemoize(){if(Q_.isDictionary(this.type)&&this.isMemoized){let t=this.data[0].dictionary.unmemoize(),n=this.data.map(e=>{let n=e.clone();return n.dictionary=t,n});return new e(n)}return this}};kx=Symbol.toStringTag,Mx[kx]=(e=>{e.type=Q_.prototype,e.data=[],e.length=0,e.stride=1,e.numChildren=0,e._offsets=new Uint32Array([0]),e[Symbol.isConcatSpreadable]=!0;let t=Object.keys(q).map(e=>q[e]).filter(e=>typeof e==`number`&&e!==q.NONE);for(let n of t){let t=kb.getVisitFnByTypeId(n),r=Ny.getVisitFnByTypeId(n),i=wx.getVisitFnByTypeId(n);Ax[n]={get:t,set:r,indexOf:i},jx[n]=Object.create(e,{isValid:{value:gx(hx)},get:{value:gx(kb.getVisitFnByTypeId(n))},set:{value:_x(Ny.getVisitFnByTypeId(n))},indexOf:{value:vx(wx.getVisitFnByTypeId(n))}})}return`Vector`})(Mx.prototype);var Nx=class e extends Mx{constructor(t){super(t.data);let n=this.get,r=this.set,i=this.slice,a=Array(this.length);Object.defineProperty(this,`get`,{value(e){let t=a[e];if(t!==void 0)return t;let r=n.call(this,e);return a[e]=r,r}}),Object.defineProperty(this,`set`,{value(e,t){r.call(this,e,t),a[e]=t}}),Object.defineProperty(this,`slice`,{value:(t,n)=>new e(i.call(this,t,n))}),Object.defineProperty(this,`isMemoized`,{value:!0}),Object.defineProperty(this,`unmemoize`,{value:()=>new Mx(this.data)}),Object.defineProperty(this,`memoize`,{value:()=>this})}},Px=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}offset(){return this.bb.readInt64(this.bb_pos)}metaDataLength(){return this.bb.readInt32(this.bb_pos+8)}bodyLength(){return this.bb.readInt64(this.bb_pos+16)}static sizeOf(){return 24}static createBlock(e,t,n,r){return e.prep(8,24),e.writeInt64(BigInt(r??0)),e.pad(4),e.writeInt32(n),e.writeInt64(BigInt(t??0)),e.offset()}},Fx=class e{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsFooter(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFooter(t,n){return t.setPosition(t.position()+wg),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}version(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):hg.V1}schema(e){let t=this.bb.__offset(this.bb_pos,6);return t?(e||new d_).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}dictionaries(e,t){let n=this.bb.__offset(this.bb_pos,8);return n?(t||new Px).__init(this.bb.__vector(this.bb_pos+n)+e*24,this.bb):null}dictionariesLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}recordBatches(e,t){let n=this.bb.__offset(this.bb_pos,10);return n?(t||new Px).__init(this.bb.__vector(this.bb_pos+n)+e*24,this.bb):null}recordBatchesLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,t){let n=this.bb.__offset(this.bb_pos,12);return n?(t||new Ug).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}static startFooter(e){e.startObject(5)}static addVersion(e,t){e.addFieldInt16(0,t,hg.V1)}static addSchema(e,t){e.addFieldOffset(1,t,0)}static addDictionaries(e,t){e.addFieldOffset(2,t,0)}static startDictionariesVector(e,t){e.startVector(24,t,8)}static addRecordBatches(e,t){e.addFieldOffset(3,t,0)}static startRecordBatchesVector(e,t){e.startVector(24,t,8)}static addCustomMetadata(e,t){e.addFieldOffset(4,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static endFooter(e){let t=e.endObject();return t}static finishFooterBuffer(e,t){e.finish(t)}static finishSizePrefixedFooterBuffer(e,t){e.finish(t,void 0,!0)}},Ix=class e{constructor(e=[],t,n,r=hg.V5){this.fields=e||[],this.metadata=t||new Map,n||=zx(this.fields),this.dictionaries=n,this.metadataVersion=r}get[Symbol.toStringTag](){return`Schema`}get names(){return this.fields.map(e=>e.name)}toString(){return`Schema<{ ${this.fields.map((e,t)=>`${t}: ${e}`).join(`, `)} }>`}select(t){let n=new Set(t),r=this.fields.filter(e=>n.has(e.name));return new e(r,this.metadata)}selectAt(t){let n=t.map(e=>this.fields[e]).filter(Boolean);return new e(n,this.metadata)}assign(...t){let n=t[0]instanceof e?t[0]:Array.isArray(t[0])?new e(t[0]):new e(t),r=[...this.fields],i=Rx(Rx(new Map,this.metadata),n.metadata),a=n.fields.filter(e=>{let t=r.findIndex(t=>t.name===e.name);return~t?(r[t]=e.clone({metadata:Rx(Rx(new Map,r[t].metadata),e.metadata)}))&&!1:!0}),o=zx(a,new Map);return new e([...r,...a],i,new Map([...this.dictionaries,...o]))}};Ix.prototype.fields=null,Ix.prototype.metadata=null,Ix.prototype.dictionaries=null;var Lx=class e{static new(...t){let[n,r,i,a]=t;return t[0]&&typeof t[0]==`object`&&({name:n}=t[0],r===void 0&&(r=t[0].type),i===void 0&&(i=t[0].nullable),a===void 0&&(a=t[0].metadata)),new e(`${n}`,r,i,a)}constructor(e,t,n=!1,r){this.name=e,this.type=t,this.nullable=n,this.metadata=r||new Map}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return`Field`}toString(){return`${this.name}: ${this.type}`}clone(...t){let[n,r,i,a]=t;return!t[0]||typeof t[0]!=`object`?[n=this.name,r=this.type,i=this.nullable,a=this.metadata]=t:{name:n=this.name,type:r=this.type,nullable:i=this.nullable,metadata:a=this.metadata}=t[0],e.new(n,r,i,a)}};Lx.prototype.type=null,Lx.prototype.name=null,Lx.prototype.nullable=null,Lx.prototype.metadata=null;function Rx(e,t){return new Map([...e||new Map,...t||new Map])}function zx(e,t=new Map){for(let n=-1,r=e.length;++n0&&zx(i.children,t)}return t}var Bx=jg,Vx=Ag,Hx=class{static decode(e){e=new Vx($h(e));let t=Fx.getRootAsFooter(e),n=Ix.decode(t.schema(),new Map,t.version());return new Ux(n,t)}static encode(e){let t=new Bx,n=Ix.encode(t,e.schema);Fx.startRecordBatchesVector(t,e.numRecordBatches);for(let n of[...e.recordBatches()].slice().reverse())Wx.encode(t,n);let r=t.endVector();Fx.startDictionariesVector(t,e.numDictionaries);for(let n of[...e.dictionaryBatches()].slice().reverse())Wx.encode(t,n);let i=t.endVector();return Fx.startFooter(t),Fx.addSchema(t,n),Fx.addVersion(t,hg.V5),Fx.addRecordBatches(t,r),Fx.addDictionaries(t,i),Fx.finishFooterBuffer(t,Fx.endFooter(t)),t.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}constructor(e,t=hg.V5,n,r){this.schema=e,this.version=t,n&&(this._recordBatches=n),r&&(this._dictionaryBatches=r)}*recordBatches(){for(let e,t=-1,n=this.numRecordBatches;++t=0&&e=0&&e=0&&e=0&&ethis._closedPromiseResolve=e)}get closed(){return this._closedPromise}cancel(e){return yh(this,void 0,void 0,function*(){yield this.return(e)})}write(e){this._ensureOpen()&&(this.resolvers.length<=0?this._values.push(e):this.resolvers.shift().resolve({done:!1,value:e}))}abort(e){this._closedPromiseResolve&&(this.resolvers.length<=0?this._error={error:e}:this.resolvers.shift().reject({done:!0,value:e}))}close(){if(this._closedPromiseResolve){let{resolvers:e}=this;for(;e.length>0;)e.shift().resolve(Gx);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(e){return sg.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,e)}toNodeStream(e){return sg.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,e)}throw(e){return yh(this,void 0,void 0,function*(){return yield this.abort(e),Gx})}return(e){return yh(this,void 0,void 0,function*(){return yield this.close(),Gx})}read(e){return yh(this,void 0,void 0,function*(){return(yield this.next(e,`read`)).value})}peek(e){return yh(this,void 0,void 0,function*(){return(yield this.next(e,`peek`)).value})}next(...e){return this._values.length>0?Promise.resolve({done:!1,value:this._values.shift()}):this._error?Promise.reject({done:!0,value:this._error.error}):this._closedPromiseResolve?new Promise((e,t)=>{this.resolvers.push({resolve:e,reject:t})}):Promise.resolve(Gx)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw Error(`AsyncQueue is closed`)}},Yx=class extends Jx{write(e){if((e=$h(e)).byteLength>0)return super.write(e)}toString(e=!1){return e?Eh(this.toUint8Array(!0)):this.toUint8Array(!1).then(Eh)}toUint8Array(e=!1){return e?Yh(this._values)[0]:(()=>yh(this,void 0,void 0,function*(){var e,t,n,r;let i=[],a=0;try{for(var o=!0,s=wh(this),c;c=yield s.next(),e=c.done,!e;o=!0){r=c.value,o=!1;let e=r;i.push(e),a+=e.byteLength}}catch(e){t={error:e}}finally{try{!o&&!e&&(n=s.return)&&(yield n.call(s))}finally{if(t)throw t.error}}return Yh(i,a)[0]}))()}},Xx=class{constructor(e){e&&(this.source=new Qx(sg.fromIterable(e)))}[Symbol.iterator](){return this}next(e){return this.source.next(e)}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}peek(e){return this.source.peek(e)}read(e){return this.source.read(e)}},Zx=class e{constructor(t){t instanceof e?this.source=t.source:t instanceof Yx?this.source=new $x(sg.fromAsyncIterable(t)):Wh(t)?this.source=new $x(sg.fromNodeStream(t)):Hh(t)?this.source=new $x(sg.fromDOMStream(t)):zh(t)?this.source=new $x(sg.fromDOMStream(t.body)):Ph(t)?this.source=new $x(sg.fromIterable(t)):(Nh(t)||Fh(t))&&(this.source=new $x(sg.fromAsyncIterable(t)))}[Symbol.asyncIterator](){return this}next(e){return this.source.next(e)}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}get closed(){return this.source.closed}cancel(e){return this.source.cancel(e)}peek(e){return this.source.peek(e)}read(e){return this.source.read(e)}},Qx=class{constructor(e){this.source=e}cancel(e){this.return(e)}peek(e){return this.next(e,`peek`).value}read(e){return this.next(e,`read`).value}next(e,t=`read`){return this.source.next({cmd:t,size:e})}throw(e){return Object.create(this.source.throw&&this.source.throw(e)||Gx)}return(e){return Object.create(this.source.return&&this.source.return(e)||Gx)}},$x=class{constructor(e){this.source=e,this._closedPromise=new Promise(e=>this._closedPromiseResolve=e)}cancel(e){return yh(this,void 0,void 0,function*(){yield this.return(e)})}get closed(){return this._closedPromise}read(e){return yh(this,void 0,void 0,function*(){return(yield this.next(e,`read`)).value})}peek(e){return yh(this,void 0,void 0,function*(){return(yield this.next(e,`peek`)).value})}next(e){return yh(this,arguments,void 0,function*(e,t=`read`){return yield this.source.next({cmd:t,size:e})})}throw(e){return yh(this,void 0,void 0,function*(){let t=this.source.throw&&(yield this.source.throw(e))||Gx;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(t)})}return(e){return yh(this,void 0,void 0,function*(){let t=this.source.return&&(yield this.source.return(e))||Gx;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(t)})}},eS=class extends Xx{constructor(e,t){super(),this.position=0,this.buffer=$h(e),this.size=t===void 0?this.buffer.byteLength:t}readInt32(e){let{buffer:t,byteOffset:n}=this.readAt(e,4);return new DataView(t,n).getInt32(0,!0)}seek(e){return this.position=Math.min(e,this.size),eyh(this,void 0,void 0,function*(){this.size=(yield e.stat()).size,delete this._pending}))()}readInt32(e){return yh(this,void 0,void 0,function*(){let{buffer:t,byteOffset:n}=yield this.readAt(e,4);return new DataView(t,n).getInt32(0,!0)})}seek(e){return yh(this,void 0,void 0,function*(){return this._pending&&(yield this._pending),this.position=Math.min(e,this.size),e>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),n=new Uint32Array([e.buffer[1]>>>16,e.buffer[1]&65535,e.buffer[0]>>>16,e.buffer[0]&65535]),r=t[3]*n[3];this.buffer[0]=r&65535;let i=r>>>16;return r=t[2]*n[3],i+=r,r=t[3]*n[2]>>>0,i+=r,this.buffer[0]+=i<<16,this.buffer[1]=i>>>0>>16,this.buffer[1]+=t[1]*n[3]+t[2]*n[2]+t[3]*n[1],this.buffer[1]+=t[0]*n[3]+t[1]*n[2]+t[2]*n[1]+t[3]*n[0]<<16,this}_plus(e){let t=this.buffer[0]+e.buffer[0]>>>0;this.buffer[1]+=e.buffer[1],t>>0&&++this.buffer[1],this.buffer[0]=t}lessThan(e){return this.buffer[1]>>0,t[2]=this.buffer[2]+e.buffer[2]>>>0,t[1]=this.buffer[1]+e.buffer[1]>>>0,t[0]=this.buffer[0]+e.buffer[0]>>>0,t[0]>>0&&++t[1],t[1]>>0&&++t[2],t[2]>>0&&++t[3],this.buffer[3]=t[3],this.buffer[2]=t[2],this.buffer[1]=t[1],this.buffer[0]=t[0],this}hex(){return`${rS(this.buffer[3])} ${rS(this.buffer[2])} ${rS(this.buffer[1])} ${rS(this.buffer[0])}`}static multiply(t,n){let r=new e(new Uint32Array(t.buffer));return r.times(n)}static add(t,n){let r=new e(new Uint32Array(t.buffer));return r.plus(n)}static from(t,n=new Uint32Array(4)){return e.fromString(typeof t==`string`?t:t.toString(),n)}static fromNumber(t,n=new Uint32Array(4)){return e.fromString(t.toString(),n)}static fromString(t,n=new Uint32Array(4)){let r=t.startsWith(`-`),i=t.length,a=new e(n);for(let n=r?1:0;n0&&this.readData(e,n)||new Uint8Array}readOffsets(e,t){return this.readData(e,t)}readTypeIds(e,t){return this.readData(e,t)}readData(e,{length:t,offset:n}=this.nextBufferRange()){return this.bytes.subarray(n,n+t)}readDictionary(e){return this.dictionaries.get(e.id)}},dS=class extends uS{constructor(e,t,n,r,i){super(new Uint8Array,t,n,r,i),this.sources=e}readNullBitmap(e,t,{offset:n}=this.nextBufferRange()){return t<=0?new Uint8Array:$b(this.sources[n])}readOffsets(e,{offset:t}=this.nextBufferRange()){return Xh(Uint8Array,Xh(e.OffsetArrayType,this.sources[t]))}readTypeIds(e,{offset:t}=this.nextBufferRange()){return Xh(Uint8Array,Xh(e.ArrayType,this.sources[t]))}readData(e,{offset:t}=this.nextBufferRange()){let{sources:n}=this;return Q_.isTimestamp(e)||(Q_.isInt(e)||Q_.isTime(e))&&e.bitWidth===64||Q_.isDuration(e)||Q_.isDate(e)&&e.unit===vg.MILLISECOND?Xh(Uint8Array,cS.convertArray(n[t])):Q_.isDecimal(e)?Xh(Uint8Array,lS.convertArray(n[t])):Q_.isBinary(e)||Q_.isLargeBinary(e)||Q_.isFixedSizeBinary(e)?fS(n[t]):Q_.isBool(e)?$b(n[t]):Q_.isUtf8(e)||Q_.isLargeUtf8(e)?Oh(n[t].join(``)):Xh(Uint8Array,Xh(e.ArrayType,n[t].map(e=>+e)))}};function fS(e){let t=e.join(``),n=new Uint8Array(t.length/2);for(let e=0;e>1]=Number.parseInt(t.slice(e,e+2),16);return n}var pS=class extends Nv{compareSchemas(e,t){return e===t||t instanceof e.constructor&&this.compareManyFields(e.fields,t.fields)}compareManyFields(e,t){return e===t||Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every((e,n)=>this.compareFields(e,t[n]))}compareFields(e,t){return e===t||t instanceof e.constructor&&e.name===t.name&&e.nullable===t.nullable&&this.visit(e.type,t.type)}};function mS(e,t){return t instanceof e.constructor}function hS(e,t){return e===t||mS(e,t)}function gS(e,t){return e===t||mS(e,t)&&e.bitWidth===t.bitWidth&&e.isSigned===t.isSigned}function _S(e,t){return e===t||mS(e,t)&&e.precision===t.precision}function vS(e,t){return e===t||mS(e,t)&&e.byteWidth===t.byteWidth}function yS(e,t){return e===t||mS(e,t)&&e.unit===t.unit}function bS(e,t){return e===t||mS(e,t)&&e.unit===t.unit&&e.timezone===t.timezone}function xS(e,t){return e===t||mS(e,t)&&e.unit===t.unit&&e.bitWidth===t.bitWidth}function SS(e,t){return e===t||mS(e,t)&&e.children.length===t.children.length&&AS.compareManyFields(e.children,t.children)}function CS(e,t){return e===t||mS(e,t)&&e.children.length===t.children.length&&AS.compareManyFields(e.children,t.children)}function wS(e,t){return e===t||mS(e,t)&&e.mode===t.mode&&e.typeIds.every((e,n)=>e===t.typeIds[n])&&AS.compareManyFields(e.children,t.children)}function TS(e,t){return e===t||mS(e,t)&&e.id===t.id&&e.isOrdered===t.isOrdered&&AS.visit(e.indices,t.indices)&&AS.visit(e.dictionary,t.dictionary)}function ES(e,t){return e===t||mS(e,t)&&e.unit===t.unit}function DS(e,t){return e===t||mS(e,t)&&e.unit===t.unit}function OS(e,t){return e===t||mS(e,t)&&e.listSize===t.listSize&&e.children.length===t.children.length&&AS.compareManyFields(e.children,t.children)}function kS(e,t){return e===t||mS(e,t)&&e.keysSorted===t.keysSorted&&e.children.length===t.children.length&&AS.compareManyFields(e.children,t.children)}pS.prototype.visitNull=hS,pS.prototype.visitBool=hS,pS.prototype.visitInt=gS,pS.prototype.visitInt8=gS,pS.prototype.visitInt16=gS,pS.prototype.visitInt32=gS,pS.prototype.visitInt64=gS,pS.prototype.visitUint8=gS,pS.prototype.visitUint16=gS,pS.prototype.visitUint32=gS,pS.prototype.visitUint64=gS,pS.prototype.visitFloat=_S,pS.prototype.visitFloat16=_S,pS.prototype.visitFloat32=_S,pS.prototype.visitFloat64=_S,pS.prototype.visitUtf8=hS,pS.prototype.visitLargeUtf8=hS,pS.prototype.visitBinary=hS,pS.prototype.visitLargeBinary=hS,pS.prototype.visitFixedSizeBinary=vS,pS.prototype.visitDate=yS,pS.prototype.visitDateDay=yS,pS.prototype.visitDateMillisecond=yS,pS.prototype.visitTimestamp=bS,pS.prototype.visitTimestampSecond=bS,pS.prototype.visitTimestampMillisecond=bS,pS.prototype.visitTimestampMicrosecond=bS,pS.prototype.visitTimestampNanosecond=bS,pS.prototype.visitTime=xS,pS.prototype.visitTimeSecond=xS,pS.prototype.visitTimeMillisecond=xS,pS.prototype.visitTimeMicrosecond=xS,pS.prototype.visitTimeNanosecond=xS,pS.prototype.visitDecimal=hS,pS.prototype.visitList=SS,pS.prototype.visitStruct=CS,pS.prototype.visitUnion=wS,pS.prototype.visitDenseUnion=wS,pS.prototype.visitSparseUnion=wS,pS.prototype.visitDictionary=TS,pS.prototype.visitInterval=ES,pS.prototype.visitIntervalDayTime=ES,pS.prototype.visitIntervalYearMonth=ES,pS.prototype.visitDuration=DS,pS.prototype.visitDurationSecond=DS,pS.prototype.visitDurationMillisecond=DS,pS.prototype.visitDurationMicrosecond=DS,pS.prototype.visitDurationNanosecond=DS,pS.prototype.visitFixedSizeList=OS,pS.prototype.visitMap=kS;const AS=new pS;function jS(e,t){return AS.compareSchemas(e,t)}function MS(e,t){return NS(e,t.map(e=>e.data.concat()))}function NS(e,t){let n=[...e.fields],r=[],i={numBatches:t.reduce((e,t)=>Math.max(e,t.length),0)},a=0,o=0,s=-1,c=t.length,l,u=[];for(;i.numBatches-- >0;){for(o=1/0,s=-1;++s0&&(r[a++]=cx({type:new Tv(n),length:o,nullCount:0,children:u.slice()})))}return[e=e.assign(n),r.map(t=>new RS(e,t))]}function PS(e,t,n,r,i){var a;let o=(t+63&-64)>>3;for(let s=-1,c=r.length;++s=t)l===t?n[s]=c:(n[s]=c.slice(0,t),i.numBatches=Math.max(i.numBatches,r[s].unshift(c.slice(t,l-t))));else{let r=e[s];e[s]=r.clone({nullable:!0}),n[s]=(a=c?._changeLengthAndBackfillNullBitmap(t))??cx({type:r.type,length:t,nullCount:t,nullBitmap:new Uint8Array(o)})}}return n}var FS,IS=class e{constructor(...t){var n,r;if(t.length===0)return this.batches=[],this.schema=new Ix([]),this._offsets=[0],this;let i,a;t[0]instanceof Ix&&(i=t.shift()),t.at(-1)instanceof Uint32Array&&(a=t.pop());let o=t=>{if(t){if(t instanceof RS)return[t];if(t instanceof e)return t.batches;if(t instanceof ax){if(t.type instanceof Tv)return[new RS(new Ix(t.type.children),t)]}else if(Array.isArray(t))return t.flatMap(e=>o(e));else if(typeof t[Symbol.iterator]==`function`)return[...t].flatMap(e=>o(e));else if(typeof t==`object`){let e=Object.keys(t),n=e.map(e=>new Mx([t[e]])),r=i??new Ix(e.map((e,t)=>new Lx(String(e),n[t].type,n[t].nullable))),[,a]=MS(r,n);return a.length===0?[new RS(t)]:a}}return[]},s=t.flatMap(e=>o(e));if(i=(r=i??(n=s[0])?.schema)??new Ix([]),!(i instanceof Ix))throw TypeError(`Table constructor expects a [Schema, RecordBatch[]] pair.`);for(let e of s){if(!(e instanceof RS))throw TypeError(`Table constructor expects a [Schema, RecordBatch[]] pair.`);if(!jS(i,e.schema))throw TypeError(`Table and inner RecordBatch schemas must be equivalent.`)}this.schema=i,this.batches=s,this._offsets=a??fx(this.data)}get data(){return this.batches.map(({data:e})=>e)}get numCols(){return this.schema.fields.length}get numRows(){return this.data.reduce((e,t)=>e+t.length,0)}get nullCount(){return this._nullCount===-1&&(this._nullCount=dx(this.data)),this._nullCount}isValid(e){return!1}get(e){return null}at(e){return this.get(zb(e,this.numRows))}set(e,t){}indexOf(e,t){return-1}[Symbol.iterator](){return this.batches.length>0?Ox.visit(new Mx(this.data)):[][Symbol.iterator]()}toArray(){return[...this]}toString(){return`[\n ${this.toArray().join(`, + `)}\n]`}concat(...t){let n=this.schema,r=this.data.concat(t.flatMap(({data:e})=>e));return new e(n,r.map(e=>new RS(n,e)))}slice(t,n){let r=this.schema;[t,n]=Rb({length:this.numRows},t,n);let i=px(this.data,this._offsets,t,n);return new e(r,i.map(e=>new RS(r,e)))}getChild(e){return this.getChildAt(this.schema.fields.findIndex(t=>t.name===e))}getChildAt(e){if(e>-1&&et.children[e]);if(t.length===0){let{type:n}=this.schema.fields[e],r=cx({type:n,length:0,nullCount:0});t.push(r._changeLengthAndBackfillNullBitmap(this.numRows))}return new Mx(t)}return null}setChild(e,t){var n;return this.setChildAt((n=this.schema.fields)?.findIndex(t=>t.name===e),t)}setChildAt(t,n){let r=this.schema,i=[...this.batches];if(t>-1&&tthis.getChildAt(t));[e[t],o[t]]=[a,n],[r,i]=MS(r,o)}return new e(r,i)}select(e){let t=this.schema.fields.reduce((e,t,n)=>e.set(t.name,n),new Map);return this.selectAt(e.map(e=>t.get(e)).filter(e=>e>-1))}selectAt(t){let n=this.schema.selectAt(t),r=this.batches.map(e=>e.selectAt(t));return new e(n,r)}assign(t){let n=this.schema.fields,[r,i]=t.schema.fields.reduce((e,t,r)=>{let[i,a]=e,o=n.findIndex(e=>e.name===t.name);return~o?a[o]=r:i.push(r),e},[[],[]]),a=this.schema.assign(t.schema),o=[...n.map((e,t)=>[t,i[t]]).map(([e,n])=>n===void 0?this.getChildAt(e):t.getChildAt(n)),...r.map(e=>t.getChildAt(e))].filter(Boolean);return new e(...MS(a,o))}};FS=Symbol.toStringTag,IS[FS]=(e=>(e.schema=null,e.batches=[],e._offsets=new Uint32Array([0]),e._nullCount=-1,e[Symbol.isConcatSpreadable]=!0,e.isValid=gx(hx),e.get=gx(kb.getVisitFn(q.Struct)),e.set=_x(Ny.getVisitFn(q.Struct)),e.indexOf=vx(wx.getVisitFn(q.Struct)),`Table`))(IS.prototype);var LS,RS=class e{constructor(...e){switch(e.length){case 2:if([this.schema]=e,!(this.schema instanceof Ix)||([,this.data=cx({nullCount:0,type:new Tv(this.schema.fields),children:this.schema.fields.map(e=>cx({type:e.type,nullCount:0}))})]=e,!(this.data instanceof ax)))throw TypeError(`RecordBatch constructor expects a [Schema, Data] pair.`);[this.schema,this.data]=zS(this.schema,this.data.children);break;case 1:{let[t]=e,{fields:n,children:r,length:i}=Object.keys(t).reduce((e,n,r)=>(e.children[r]=t[n],e.length=Math.max(e.length,t[n].length),e.fields[r]=Lx.new({name:n,type:t[n].type,nullable:!0}),e),{length:0,fields:[],children:[]}),a=new Ix(n),o=cx({type:new Tv(n),length:i,children:r,nullCount:0});[this.schema,this.data]=zS(a,o.children,i);break}default:throw TypeError(`RecordBatch constructor expects an Object mapping names to child Data, or a [Schema, Data] pair.`)}}get dictionaries(){return this._dictionaries||=BS(this.schema.fields,this.data.children)}get numCols(){return this.schema.fields.length}get numRows(){return this.data.length}get nullCount(){return this.data.nullCount}isValid(e){return this.data.getValid(e)}get(e){return kb.visit(this.data,e)}at(e){return this.get(zb(e,this.numRows))}set(e,t){return Ny.visit(this.data,e,t)}indexOf(e,t){return wx.visit(this.data,e,t)}[Symbol.iterator](){return Ox.visit(new Mx([this.data]))}toArray(){return[...this]}concat(...e){return new IS(this.schema,[this,...e])}slice(t,n){let[r]=new Mx([this.data]).slice(t,n).data;return new e(this.schema,r)}getChild(e){var t;return this.getChildAt((t=this.schema.fields)?.findIndex(t=>t.name===e))}getChildAt(e){return e>-1&&et.name===e),t)}setChildAt(t,n){let r=this.schema,i=this.data;if(t>-1&&tt.name===e);~t&&(i[t]=this.data.children[t])}return new e(n,cx({type:r,length:this.numRows,children:i}))}selectAt(t){let n=this.schema.selectAt(t),r=t.map(e=>this.data.children[e]).filter(Boolean),i=cx({type:new Tv(n.fields),length:this.numRows,children:r});return new e(n,i)}};LS=Symbol.toStringTag,RS[LS]=(e=>(e._nullCount=-1,e[Symbol.isConcatSpreadable]=!0,`RecordBatch`))(RS.prototype);function zS(e,t,n=t.reduce((e,t)=>Math.max(e,t.length),0)){var r;let i=[...e.fields],a=[...t],o=(n+63&-64)>>3;for(let[s,c]of e.fields.entries()){let e=t[s];(!e||e.length!==n)&&(i[s]=c.clone({nullable:!0}),a[s]=(r=e?._changeLengthAndBackfillNullBitmap(n))??cx({type:c.type,length:n,nullCount:n,nullBitmap:new Uint8Array(o)}))}return[e.assign(i),cx({type:new Tv(i),length:n,children:a})]}function BS(e,t,n=new Map){var r,i;if(((r=e?.length)??0)>0&&e?.length===t?.length)for(let r=-1,a=e.length;++rcx({type:e.type})),n=cx({type:new Tv(e.fields),nullCount:0,children:t});super(e,n)}},HS=class e{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsMessage(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMessage(t,n){return t.setPosition(t.position()+wg),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}version(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):hg.V1}headerType(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint8(this.bb_pos+e):f_.NONE}header(e){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__union(e,this.bb_pos+t):null}bodyLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt64(this.bb_pos+e):BigInt(`0`)}customMetadata(e,t){let n=this.bb.__offset(this.bb_pos,12);return n?(t||new Ug).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}static startMessage(e){e.startObject(5)}static addVersion(e,t){e.addFieldInt16(0,t,hg.V1)}static addHeaderType(e,t){e.addFieldInt8(1,t,f_.NONE)}static addHeader(e,t){e.addFieldOffset(2,t,0)}static addBodyLength(e,t){e.addFieldInt64(3,t,BigInt(`0`))}static addCustomMetadata(e,t){e.addFieldOffset(4,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static endMessage(e){let t=e.endObject();return t}static finishMessageBuffer(e,t){e.finish(t)}static finishSizePrefixedMessageBuffer(e,t){e.finish(t,void 0,!0)}static createMessage(t,n,r,i,a,o){return e.startMessage(t),e.addVersion(t,n),e.addHeaderType(t,r),e.addHeader(t,i),e.addBodyLength(t,a),e.addCustomMetadata(t,o),e.endMessage(t)}},US=class extends Nv{visit(e,t){return e==null||t==null?void 0:super.visit(e,t)}visitNull(e,t){return r_.startNull(t),r_.endNull(t)}visitInt(e,t){return Vg.startInt(t),Vg.addBitWidth(t,e.bitWidth),Vg.addIsSigned(t,e.isSigned),Vg.endInt(t)}visitFloat(e,t){return Zg.startFloatingPoint(t),Zg.addPrecision(t,e.precision),Zg.endFloatingPoint(t)}visitBinary(e,t){return Wg.startBinary(t),Wg.endBinary(t)}visitLargeBinary(e,t){return $g.startLargeBinary(t),$g.endLargeBinary(t)}visitBool(e,t){return Gg.startBool(t),Gg.endBool(t)}visitUtf8(e,t){return c_.startUtf8(t),c_.endUtf8(t)}visitLargeUtf8(e,t){return e_.startLargeUtf8(t),e_.endLargeUtf8(t)}visitDecimal(e,t){return qg.startDecimal(t),qg.addScale(t,e.scale),qg.addPrecision(t,e.precision),qg.addBitWidth(t,e.bitWidth),qg.endDecimal(t)}visitDate(e,t){return Kg.startDate(t),Kg.addUnit(t,e.unit),Kg.endDate(t)}visitTime(e,t){return a_.startTime(t),a_.addUnit(t,e.unit),a_.addBitWidth(t,e.bitWidth),a_.endTime(t)}visitTimestamp(e,t){let n=e.timezone&&t.createString(e.timezone)||void 0;return o_.startTimestamp(t),o_.addUnit(t,e.unit),n!==void 0&&o_.addTimezone(t,n),o_.endTimestamp(t)}visitInterval(e,t){return Qg.startInterval(t),Qg.addUnit(t,e.unit),Qg.endInterval(t)}visitDuration(e,t){return Jg.startDuration(t),Jg.addUnit(t,e.unit),Jg.endDuration(t)}visitList(e,t){return t_.startList(t),t_.endList(t)}visitStruct(e,t){return i_.startStruct_(t),i_.endStruct_(t)}visitUnion(e,t){s_.startTypeIdsVector(t,e.typeIds.length);let n=s_.createTypeIdsVector(t,e.typeIds);return s_.startUnion(t),s_.addMode(t,e.mode),s_.addTypeIds(t,n),s_.endUnion(t)}visitDictionary(e,t){let n=this.visit(e.indices,t);return Hg.startDictionaryEncoding(t),Hg.addId(t,BigInt(e.id)),Hg.addIsOrdered(t,e.isOrdered),n!==void 0&&Hg.addIndexType(t,n),Hg.endDictionaryEncoding(t)}visitFixedSizeBinary(e,t){return Yg.startFixedSizeBinary(t),Yg.addByteWidth(t,e.byteWidth),Yg.endFixedSizeBinary(t)}visitFixedSizeList(e,t){return Xg.startFixedSizeList(t),Xg.addListSize(t,e.listSize),Xg.endFixedSizeList(t)}visitMap(e,t){return n_.startMap(t),n_.addKeysSorted(t,e.keysSorted),n_.endMap(t)}};const WS=new US;function GS(e,t=new Map){return new Ix(JS(e,t),eC(e.metadata),t)}function KS(e){return new oC(e.count,XS(e.columns),ZS(e.columns))}function qS(e){return new sC(KS(e.data),e.id,e.isDelta)}function JS(e,t){return(e.fields||[]).filter(Boolean).map(e=>Lx.fromJSON(e,t))}function YS(e,t){return(e.children||[]).filter(Boolean).map(e=>Lx.fromJSON(e,t))}function XS(e){return(e||[]).reduce((e,t)=>[...e,new lC(t.count,QS(t.VALIDITY)),...XS(t.children)],[])}function ZS(e,t=[]){for(let n=-1,r=(e||[]).length;++ne+ +(t===0),0)}function $S(e,t){let n,r,i,a,o,s;return!t||!(a=e.dictionary)?(o=nC(e,YS(e,t)),i=new Lx(e.name,o,e.nullable,eC(e.metadata))):t.has(n=a.id)?(r=(r=a.indexType)?tC(r):new rv,s=new jv(t.get(n),r,n,a.isOrdered),i=new Lx(e.name,s,e.nullable,eC(e.metadata))):(r=(r=a.indexType)?tC(r):new rv,t.set(n,o=nC(e,YS(e,t))),s=new jv(o,r,n,a.isOrdered),i=new Lx(e.name,s,e.nullable,eC(e.metadata))),i||null}function eC(e=[]){return new Map(e.map(({key:e,value:t})=>[e,t]))}function tC(e){return new ev(e.isSigned,e.bitWidth)}function nC(e,t){let n=e.type.name;switch(n){case`NONE`:return new $_;case`null`:return new $_;case`binary`:return new pv;case`largebinary`:return new mv;case`utf8`:return new hv;case`largeutf8`:return new gv;case`bool`:return new _v;case`list`:return new wv((t||[])[0]);case`struct`:return new Tv(t||[]);case`struct_`:return new Tv(t||[])}switch(n){case`int`:{let t=e.type;return new ev(t.isSigned,t.bitWidth)}case`floatingpoint`:{let t=e.type;return new lv(_g[t.precision])}case`decimal`:{let t=e.type;return new vv(t.scale,t.precision,t.bitWidth)}case`date`:{let t=e.type;return new yv(vg[t.unit])}case`time`:{let t=e.type;return new bv(yg[t.unit],t.bitWidth)}case`timestamp`:{let t=e.type;return new xv(yg[t.unit],t.timezone)}case`interval`:{let t=e.type;return new Sv(bg[t.unit])}case`duration`:{let t=e.type;return new Cv(yg[t.unit])}case`union`:{let n=e.type,[r,...i]=(n.mode+``).toLowerCase(),a=r.toUpperCase()+i.join(``);return new Ev(gg[a],n.typeIds||[],t||[])}case`fixedsizebinary`:{let t=e.type;return new Dv(t.byteWidth)}case`fixedsizelist`:{let n=e.type;return new Ov(n.listSize,(t||[])[0])}case`map`:{let n=e.type;return new kv((t||[])[0],n.keysSorted)}}throw Error(`Unrecognized type: "${n}"`)}var rC=jg,iC=Ag,aC=class e{static fromJSON(t,n){let r=new e(0,hg.V5,n);return r._createHeader=uC(t,n),r}static decode(t){t=new iC($h(t));let n=HS.getRootAsMessage(t),r=n.bodyLength(),i=n.version(),a=n.headerType(),o=new e(r,i,a);return o._createHeader=dC(n,a),o}static encode(e){let t=new rC,n=-1;return e.isSchema()?n=Ix.encode(t,e.header()):e.isRecordBatch()?n=oC.encode(t,e.header()):e.isDictionaryBatch()&&(n=sC.encode(t,e.header())),HS.startMessage(t),HS.addVersion(t,hg.V5),HS.addHeader(t,n),HS.addHeaderType(t,e.headerType),HS.addBodyLength(t,BigInt(e.bodyLength)),HS.finishMessageBuffer(t,HS.endMessage(t)),t.asUint8Array()}static from(t,n=0){if(t instanceof Ix)return new e(0,hg.V5,f_.Schema,t);if(t instanceof oC)return new e(n,hg.V5,f_.RecordBatch,t);if(t instanceof sC)return new e(n,hg.V5,f_.DictionaryBatch,t);throw Error(`Unrecognized Message header: ${t}`)}get type(){return this.headerType}get version(){return this._version}get headerType(){return this._headerType}get bodyLength(){return this._bodyLength}header(){return this._createHeader()}isSchema(){return this.headerType===f_.Schema}isRecordBatch(){return this.headerType===f_.RecordBatch}isDictionaryBatch(){return this.headerType===f_.DictionaryBatch}constructor(e,t,n,r){this._version=t,this._headerType=n,this.body=new Uint8Array,r&&(this._createHeader=()=>r),this._bodyLength=g_(e)}},oC=class{get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}constructor(e,t,n){this._nodes=t,this._buffers=n,this._length=g_(e)}},sC=class{get id(){return this._id}get data(){return this._data}get isDelta(){return this._isDelta}get length(){return this.data.length}get nodes(){return this.data.nodes}get buffers(){return this.data.buffers}constructor(e,t,n=!1){this._data=e,this._isDelta=n,this._id=g_(t)}},cC=class{constructor(e,t){this.offset=g_(e),this.length=g_(t)}},lC=class{constructor(e,t){this.length=g_(e),this.nullCount=g_(t)}};function uC(e,t){return()=>{switch(t){case f_.Schema:return Ix.fromJSON(e);case f_.RecordBatch:return oC.fromJSON(e);case f_.DictionaryBatch:return sC.fromJSON(e)}throw Error(`Unrecognized Message type: { name: ${f_[t]}, type: ${t} }`)}}function dC(e,t){return()=>{switch(t){case f_.Schema:return Ix.decode(e.header(new d_),new Map,e.version());case f_.RecordBatch:return oC.decode(e.header(new Lg),e.version());case f_.DictionaryBatch:return sC.decode(e.header(new Rg),e.version())}throw Error(`Unrecognized Message type: { name: ${f_[t]}, type: ${t} }`)}}Lx.encode=EC,Lx.decode=xC,Lx.fromJSON=$S,Ix.encode=TC,Ix.decode=fC,Ix.fromJSON=GS,oC.encode=DC,oC.decode=pC,oC.fromJSON=KS,sC.encode=OC,sC.decode=mC,sC.fromJSON=qS,lC.encode=kC,lC.decode=gC,cC.encode=AC,cC.decode=hC;function fC(e,t=new Map,n=hg.V5){let r=yC(e,t);return new Ix(r,SC(e),t,n)}function pC(e,t=hg.V5){if(e.compression()!==null)throw Error(`Record batch compression not implemented`);return new oC(e.length(),_C(e),vC(e,t))}function mC(e,t=hg.V5){return new sC(oC.decode(e.data(),t),e.id(),e.isDelta())}function hC(e){return new cC(e.offset(),e.length())}function gC(e){return new lC(e.length(),e.nullCount())}function _C(e){let t=[];for(let n,r=-1,i=-1,a=e.nodesLength();++rLx.encode(e,t));d_.startFieldsVector(e,n.length);let r=d_.createFieldsVector(e,n),i=t.metadata&&t.metadata.size>0?d_.createCustomMetadataVector(e,[...t.metadata].map(([t,n])=>{let r=e.createString(`${t}`),i=e.createString(`${n}`);return Ug.startKeyValue(e),Ug.addKey(e,r),Ug.addValue(e,i),Ug.endKeyValue(e)})):-1;return d_.startSchema(e),d_.addFields(e,r),d_.addEndianness(e,jC?zg.Little:zg.Big),i!==-1&&d_.addCustomMetadata(e,i),d_.endSchema(e)}function EC(e,t){let n=-1,r=-1,i=-1,a=t.type,o=t.typeId;Q_.isDictionary(a)?(o=a.dictionary.typeId,i=WS.visit(a,e),r=WS.visit(a.dictionary,e)):r=WS.visit(a,e);let s=(a.children||[]).map(t=>Lx.encode(e,t)),c=u_.createChildrenVector(e,s),l=t.metadata&&t.metadata.size>0?u_.createCustomMetadataVector(e,[...t.metadata].map(([t,n])=>{let r=e.createString(`${t}`),i=e.createString(`${n}`);return Ug.startKeyValue(e),Ug.addKey(e,r),Ug.addValue(e,i),Ug.endKeyValue(e)})):-1;return t.name&&(n=e.createString(t.name)),u_.startField(e),u_.addType(e,r),u_.addTypeType(e,o),u_.addChildren(e,c),u_.addNullable(e,!!t.nullable),n!==-1&&u_.addName(e,n),i!==-1&&u_.addDictionary(e,i),l!==-1&&u_.addCustomMetadata(e,l),u_.endField(e)}function DC(e,t){let n=t.nodes||[],r=t.buffers||[];Lg.startNodesVector(e,n.length);for(let t of n.slice().reverse())lC.encode(e,t);let i=e.endVector();Lg.startBuffersVector(e,r.length);for(let t of r.slice().reverse())cC.encode(e,t);let a=e.endVector();return Lg.startRecordBatch(e),Lg.addLength(e,BigInt(t.length)),Lg.addNodes(e,i),Lg.addBuffers(e,a),Lg.endRecordBatch(e)}function OC(e,t){let n=oC.encode(e,t.data);return Rg.startDictionaryBatch(e),Rg.addId(e,BigInt(t.id)),Rg.addIsDelta(e,t.isDelta),Rg.addData(e,n),Rg.endDictionaryBatch(e)}function kC(e,t){return Ig.createFieldNode(e,BigInt(t.length),BigInt(t.nullCount))}function AC(e,t){return Fg.createBuffer(e,BigInt(t.offset),BigInt(t.length))}const jC=(()=>{let e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),new Int16Array(e)[0]===256})(),MC=e=>`Expected ${f_[e]} Message in stream, but was null or length 0.`,NC=e=>`Header pointer of flatbuffer-encoded ${f_[e]} Message is null or length 0.`,PC=(e,t)=>`Expected to read ${e} metadata bytes, but only read ${t}.`,FC=(e,t)=>`Expected to read ${e} bytes for message body, but only read ${t}.`;var IC=class{constructor(e){this.source=e instanceof Xx?e:new Xx(e)}[Symbol.iterator](){return this}next(){let e;return(e=this.readMetadataLength()).done||e.value===-1&&(e=this.readMetadataLength()).done||(e=this.readMetadata(e.value)).done?Gx:e}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}readMessage(e){let t;if((t=this.next()).done)return null;if(e!=null&&t.value.headerType!==e)throw Error(MC(e));return t.value}readMessageBody(e){if(e<=0)return new Uint8Array;let t=$h(this.source.read(e));if(t.byteLength[...e,...n.VALIDITY&&[n.VALIDITY]||[],...n.TYPE_ID&&[n.TYPE_ID]||[],...n.OFFSET&&[n.OFFSET]||[],...n.DATA&&[n.DATA]||[],...t(n.children)],[])}}readMessage(e){let t;if((t=this.next()).done)return null;if(e!=null&&t.value.headerType!==e)throw Error(MC(e));return t.value}readSchema(){let e=f_.Schema,t=this.readMessage(e),n=t?.header();if(!t||!n)throw Error(NC(e));return n}};const zC=4,BC=`ARROW1`,VC=new Uint8Array(6);for(let e=0;e<6;e+=1)VC[e]=BC.codePointAt(e);function HC(e,t=0){for(let n=-1,r=VC.length;++nthis):this}readRecordBatch(e){return this._impl.isFile()?this._impl.readRecordBatch(e):null}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}toDOMStream(){return sg.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return sg.toNodeStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this},{objectMode:!0})}static throughNode(e){throw Error(`"throughNode" not available in this environment`)}static throughDOM(e,t){throw Error(`"throughDOM" not available in this environment`)}static from(t){return t instanceof e?t:Ih(t)?ow(t):Rh(t)?lw(t):Nh(t)?(()=>yh(this,void 0,void 0,function*(){return yield e.from(yield t)}))():zh(t)||Hh(t)||Wh(t)||Fh(t)?cw(new Zx(t)):sw(new Xx(t))}static readAll(t){return t instanceof e?t.isSync()?iw(t):aw(t):Ih(t)||ArrayBuffer.isView(t)||Ph(t)||Lh(t)?iw(t):aw(t)}},qC=class extends KC{constructor(e){super(e),this._impl=e}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return Sh(this,arguments,function*(){yield xh(yield*Ch(wh(this[Symbol.iterator]())))})}},JC=class extends KC{constructor(e){super(e),this._impl=e}readAll(){return yh(this,void 0,void 0,function*(){var e,t,n,r;let i=[];try{for(var a=!0,o=wh(this),s;s=yield o.next(),e=s.done,!e;a=!0){r=s.value,a=!1;let e=r;i.push(e)}}catch(e){t={error:e}}finally{try{!a&&!e&&(n=o.return)&&(yield n.call(o))}finally{if(t)throw t.error}}return i})}[Symbol.iterator](){throw Error(`AsyncRecordBatchStreamReader is not Iterable`)}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}},YC=class extends qC{constructor(e){super(e),this._impl=e}},XC=class extends JC{constructor(e){super(e),this._impl=e}},ZC=class{get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}constructor(e=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=e}isSync(){return!1}isAsync(){return!1}isFile(){return!1}isStream(){return!1}reset(e){return this._dictionaryIndex=0,this._recordBatchIndex=0,this.schema=e,this.dictionaries=new Map,this}_loadRecordBatch(e,t){let n=this._loadVectors(e,t,this.schema.fields),r=cx({type:new Tv(this.schema.fields),length:e.length,children:n});return new RS(this.schema,r)}_loadDictionaryBatch(e,t){let{id:n,isDelta:r}=e,{dictionaries:i,schema:a}=this,o=i.get(n),s=a.dictionaries.get(n),c=this._loadVectors(e.data,t,[s]);return(o&&r?o.concat(new Mx(c)):new Mx(c)).memoize()}_loadVectors(e,t,n){return new uS(t,e.nodes,e.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(n)}},QC=class extends ZC{constructor(e,t){super(t),this._reader=Ih(e)?new RC(this._handle=e):new IC(this._handle=e)}isSync(){return!0}isStream(){return!0}[Symbol.iterator](){return this}cancel(){!this.closed&&(this.closed=!0)&&(this.reset()._reader.return(),this._reader=null,this.dictionaries=null)}open(e){return this.closed||(this.autoDestroy=rw(this,e),(this.schema||=this._reader.readSchema())||this.cancel()),this}throw(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.throw(e):Gx}return(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(e):Gx}next(){if(this.closed)return Gx;let e,{_reader:t}=this;for(;e=this._readNextMessageAndValidate();)if(e.isSchema())this.reset(e.header());else if(e.isRecordBatch()){this._recordBatchIndex++;let n=e.header(),r=t.readMessageBody(e.bodyLength),i=this._loadRecordBatch(n,r);return{done:!1,value:i}}else if(e.isDictionaryBatch()){this._dictionaryIndex++;let n=e.header(),r=t.readMessageBody(e.bodyLength),i=this._loadDictionaryBatch(n,r);this.dictionaries.set(n.id,i)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new VS(this.schema)}):this.return()}_readNextMessageAndValidate(e){return this._reader.readMessage(e)}},$C=class extends ZC{constructor(e,t){super(t),this._reader=new LC(this._handle=e)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return yh(this,void 0,void 0,function*(){!this.closed&&(this.closed=!0)&&(yield this.reset()._reader.return(),this._reader=null,this.dictionaries=null)})}open(e){return yh(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=rw(this,e),(this.schema||=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(e){return yh(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(e):Gx})}return(e){return yh(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(e):Gx})}next(){return yh(this,void 0,void 0,function*(){if(this.closed)return Gx;let e,{_reader:t}=this;for(;e=yield this._readNextMessageAndValidate();)if(e.isSchema())yield this.reset(e.header());else if(e.isRecordBatch()){this._recordBatchIndex++;let n=e.header(),r=yield t.readMessageBody(e.bodyLength),i=this._loadRecordBatch(n,r);return{done:!1,value:i}}else if(e.isDictionaryBatch()){this._dictionaryIndex++;let n=e.header(),r=yield t.readMessageBody(e.bodyLength),i=this._loadDictionaryBatch(n,r);this.dictionaries.set(n.id,i)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new VS(this.schema)}):yield this.return()})}_readNextMessageAndValidate(e){return yh(this,void 0,void 0,function*(){return yield this._reader.readMessage(e)})}},ew=class extends QC{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(e,t){super(e instanceof eS?e:new eS(e),t)}isSync(){return!0}isFile(){return!0}open(e){if(!this.closed&&!this._footer){this.schema=(this._footer=this._readFooter()).schema;for(let e of this._footer.dictionaryBatches())e&&this._readDictionaryBatch(this._dictionaryIndex++)}return super.open(e)}readRecordBatch(e){var t;if(this.closed)return null;this._footer||this.open();let n=(t=this._footer)?.getRecordBatch(e);if(n&&this._handle.seek(n.offset)){let e=this._reader.readMessage(f_.RecordBatch);if(e?.isRecordBatch()){let t=e.header(),n=this._reader.readMessageBody(e.bodyLength),r=this._loadRecordBatch(t,n);return r}}return null}_readDictionaryBatch(e){var t;let n=(t=this._footer)?.getDictionaryBatch(e);if(n&&this._handle.seek(n.offset)){let e=this._reader.readMessage(f_.DictionaryBatch);if(e?.isDictionaryBatch()){let t=e.header(),n=this._reader.readMessageBody(e.bodyLength),r=this._loadDictionaryBatch(t,n);this.dictionaries.set(t.id,r)}}}_readFooter(){let{_handle:e}=this,t=e.size-WC,n=e.readInt32(t),r=e.readAt(t-n,n);return Hx.decode(r)}_readNextMessageAndValidate(e){var t;if(this._footer||this.open(),this._footer&&this._recordBatchIndexsuper.open}});return yh(this,void 0,void 0,function*(){if(!this.closed&&!this._footer){this.schema=(this._footer=yield this._readFooter()).schema;for(let e of this._footer.dictionaryBatches())e&&(yield this._readDictionaryBatch(this._dictionaryIndex++))}return yield t.open.call(this,e)})}readRecordBatch(e){return yh(this,void 0,void 0,function*(){var t;if(this.closed)return null;this._footer||(yield this.open());let n=(t=this._footer)?.getRecordBatch(e);if(n&&(yield this._handle.seek(n.offset))){let e=yield this._reader.readMessage(f_.RecordBatch);if(e?.isRecordBatch()){let t=e.header(),n=yield this._reader.readMessageBody(e.bodyLength),r=this._loadRecordBatch(t,n);return r}}return null})}_readDictionaryBatch(e){return yh(this,void 0,void 0,function*(){var t;let n=(t=this._footer)?.getDictionaryBatch(e);if(n&&(yield this._handle.seek(n.offset))){let e=yield this._reader.readMessage(f_.DictionaryBatch);if(e?.isDictionaryBatch()){let t=e.header(),n=yield this._reader.readMessageBody(e.bodyLength),r=this._loadDictionaryBatch(t,n);this.dictionaries.set(t.id,r)}}})}_readFooter(){return yh(this,void 0,void 0,function*(){let{_handle:e}=this;e._pending&&(yield e._pending);let t=e.size-WC,n=yield e.readInt32(t),r=yield e.readAt(t-n,n);return Hx.decode(r)})}_readNextMessageAndValidate(e){return yh(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex=4?HC(t)?new YC(new ew(e.read())):new qC(new QC(e)):new qC(new QC(function*(){}()))}function cw(e){return yh(this,void 0,void 0,function*(){let t=yield e.peek(UC+7&-8);return t&&t.byteLength>=4?HC(t)?new YC(new ew(yield e.read())):new JC(new $C(e)):new JC(new $C(function(){return Sh(this,arguments,function*(){})}()))})}function lw(e){return yh(this,void 0,void 0,function*(){let{size:t}=yield e.stat(),n=new tS(e,t);return t>=GC&&HC(yield n.readAt(0,UC+7&-8))?new XC(new tw(n)):new JC(new $C(n))})}var uw=class e extends Nv{static assemble(...t){let n=e=>e.flatMap(e=>Array.isArray(e)?n(e):e instanceof RS?e.data.children:e.data),r=new e;return r.visitMany(n(t)),r}constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[]}visit(e){if(e instanceof Mx)return this.visitMany(e.data),this;let{type:t}=e;if(!Q_.isDictionary(t)){let{length:n}=e;if(n>2147483647)throw RangeError(`Cannot write arrays larger than 2^31 - 1 in length`);if(Q_.isUnion(t))this.nodes.push(new lC(n,0));else{let{nullCount:r}=e;Q_.isNull(t)||dw.call(this,r<=0?new Uint8Array:Qb(e.offset,n,e.nullBitmap)),this.nodes.push(new lC(n,r))}}return super.visit(e)}visitNull(e){return this}visitDictionary(e){return this.visit(e.clone(e.type.indices))}get nodes(){return this._nodes}get buffers(){return this._buffers}get byteLength(){return this._byteLength}get bufferRegions(){return this._bufferRegions}};function dw(e){let t=e.byteLength+7&-8;return this.buffers.push(e),this.bufferRegions.push(new cC(this._byteLength,t)),this._byteLength+=t,this}function fw(e){var t;let{type:n,length:r,typeIds:i,valueOffsets:a}=e;if(dw.call(this,i),n.mode===gg.Sparse)return _w.call(this,e);if(n.mode===gg.Dense){if(e.offset<=0)return dw.call(this,a),_w.call(this,e);{let o=new Int32Array(r),s=Object.create(null),c=Object.create(null);for(let e,n,l=-1;++l{let i=n.typeIds[t],a=s[i],o=c[i];return e.slice(a,Math.min(r,o))}))}}return this}function pw(e){let t;return e.nullCount>=e.length?dw.call(this,new Uint8Array):(t=e.values)instanceof Uint8Array?dw.call(this,Qb(e.offset,e.length,t)):dw.call(this,$b(e.values))}function mw(e){return dw.call(this,e.values.subarray(0,e.length*e.stride))}function hw(e){let{length:t,values:n,valueOffsets:r}=e,i=g_(r[0]),a=g_(r[t]),o=Math.min(a-i,n.byteLength-i);return dw.call(this,ag(-i,t+1,r)),dw.call(this,n.subarray(i,i+o)),this}function gw(e){let{length:t,valueOffsets:n}=e;if(n){let{0:r,[t]:i}=n;return dw.call(this,ag(-r,t+1,n)),this.visit(e.children[0].slice(r,i-r))}return this.visit(e.children[0])}function _w(e){return this.visitMany(e.type.children.map((t,n)=>e.children[n]).filter(Boolean))[0]}uw.prototype.visitBool=pw,uw.prototype.visitInt=mw,uw.prototype.visitFloat=mw,uw.prototype.visitUtf8=hw,uw.prototype.visitLargeUtf8=hw,uw.prototype.visitBinary=hw,uw.prototype.visitLargeBinary=hw,uw.prototype.visitFixedSizeBinary=mw,uw.prototype.visitDate=mw,uw.prototype.visitTimestamp=mw,uw.prototype.visitTime=mw,uw.prototype.visitDecimal=mw,uw.prototype.visitList=gw,uw.prototype.visitStruct=_w,uw.prototype.visitUnion=fw,uw.prototype.visitInterval=mw,uw.prototype.visitDuration=mw,uw.prototype.visitFixedSizeList=gw,uw.prototype.visitMap=gw;var vw=class extends qx{static throughNode(e){throw Error(`"throughNode" not available in this environment`)}static throughDOM(e,t){throw Error(`"throughDOM" not available in this environment`)}constructor(e){super(),this._position=0,this._started=!1,this._sink=new Yx,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,Mh(e)||(e={autoDestroy:!0,writeLegacyIpcFormat:!1}),this._autoDestroy=typeof e.autoDestroy==`boolean`?e.autoDestroy:!0,this._writeLegacyIpcFormat=typeof e.writeLegacyIpcFormat==`boolean`?e.writeLegacyIpcFormat:!1}toString(e=!1){return this._sink.toString(e)}toUint8Array(e=!1){return this._sink.toUint8Array(e)}writeAll(e){return Nh(e)?e.then(e=>this.writeAll(e)):Fh(e)?Sw(this,e):xw(this,e)}get closed(){return this._sink.closed}[Symbol.asyncIterator](){return this._sink[Symbol.asyncIterator]()}toDOMStream(e){return this._sink.toDOMStream(e)}toNodeStream(e){return this._sink.toNodeStream(e)}close(){return this.reset()._sink.close()}abort(e){return this.reset()._sink.abort(e)}finish(){return this._autoDestroy?this.close():this.reset(this._sink,this._schema),this}reset(e=this._sink,t=null){return e===this._sink||e instanceof Yx?this._sink=e:(this._sink=new Yx,e&&Vh(e)?this.toDOMStream({type:`bytes`}).pipeTo(e):e&&Uh(e)&&this.toNodeStream({objectMode:!1}).pipe(e)),this._started&&this._schema&&this._writeFooter(this._schema),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,(!t||!jS(t,this._schema))&&(t==null?(this._position=0,this._schema=null):(this._started=!0,this._schema=t,this._writeSchema(t))),this}write(e){let t=null;if(this._sink){if(e==null||e instanceof IS&&!(t=e.schema)||e instanceof RS&&!(t=e.schema))return this.finish()&&void 0}else throw Error(`RecordBatchWriter is closed`);if(t&&!jS(t,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,t)}e instanceof RS?e instanceof VS||this._writeRecordBatch(e):e instanceof IS?this.writeAll(e.batches):Ph(e)&&this.writeAll(e)}_writeMessage(e,t=8){let n=t-1,r=aC.encode(e),i=r.byteLength,a=this._writeLegacyIpcFormat?4:8,o=i+a+n&~n,s=o-i-a;return e.headerType===f_.RecordBatch?this._recordBatchBlocks.push(new Wx(o,e.bodyLength,this._position)):e.headerType===f_.DictionaryBatch&&this._dictionaryBlocks.push(new Wx(o,e.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(o-a)),i>0&&this._write(r),this._writePadding(s)}_write(e){if(this._started){let t=$h(e);t&&t.byteLength>0&&(this._sink.write(t),this._position+=t.byteLength)}return this}_writeSchema(e){return this._writeMessage(aC.from(e))}_writeFooter(e){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(VC)}_writePadding(e){return e>0?this._write(new Uint8Array(e)):this}_writeRecordBatch(e){let{byteLength:t,nodes:n,bufferRegions:r,buffers:i}=uw.assemble(e),a=new oC(e.numRows,n,r),o=aC.from(a,t);return this._writeDictionaries(e)._writeMessage(o)._writeBodyBuffers(i)}_writeDictionaryBatch(e,t,n=!1){let{byteLength:r,nodes:i,bufferRegions:a,buffers:o}=uw.assemble(new Mx([e])),s=new oC(e.length,i,a),c=new sC(s,t,n),l=aC.from(c,r);return this._writeMessage(l)._writeBodyBuffers(o)}_writeBodyBuffers(e){let t,n,r;for(let i=-1,a=e.length;++i0&&(this._write(t),(r=(n+7&-8)-n)>0&&this._writePadding(r));return this}_writeDictionaries(e){var t,n;for(let[r,i]of e.dictionaries){let e=(t=i?.data)??[],a=this._seenDictionaries.get(r),o=(n=this._dictionaryDeltaOffsets.get(r))??0;if(!a||a.data[0]!==e[0])for(let[t,n]of e.entries())this._writeDictionaryBatch(n,r,t>0);else if(or.writeAll(e)):Fh(t)?Sw(r,t):xw(r,t)}},bw=class e extends vw{static writeAll(t){let n=new e;return Nh(t)?t.then(e=>n.writeAll(e)):Fh(t)?Sw(n,t):xw(n,t)}constructor(){super(),this._autoDestroy=!0}_writeSchema(e){return this._writeMagic()._writePadding(2)}_writeDictionaryBatch(e,t,n=!1){if(!n&&this._seenDictionaries.has(t))throw Error(`The Arrow File format does not support replacement dictionaries. `);return super._writeDictionaryBatch(e,t,n)}_writeFooter(e){let t=Hx.encode(new Hx(e,hg.V5,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(e)._write(t)._write(Int32Array.of(t.byteLength))._writeMagic()}};function xw(e,t){let n=t;t instanceof IS&&(n=t.batches,e.reset(void 0,t.schema));for(let t of n)e.write(t);return e.finish()}function Sw(e,t){return yh(this,void 0,void 0,function*(){var n,r,i,a,o,s,c;try{for(n=!0,r=wh(t);i=yield r.next(),a=i.done,!a;n=!0){c=i.value,n=!1;let t=c;e.write(t)}}catch(e){o={error:e}}finally{try{!n&&!a&&(s=r.return)&&(yield s.call(r))}finally{if(o)throw o.error}}return e.finish()})}function Cw(e,t=`stream`){return(t===`stream`?yw:bw).writeAll(e).toUint8Array(!0)}var ww=Object.create,Tw=Object.defineProperty,Ew=Object.getOwnPropertyDescriptor,Dw=Object.getOwnPropertyNames,Ow=Object.getPrototypeOf,kw=Object.prototype.hasOwnProperty,Aw=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),jw=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of Dw(t))!kw.call(e,i)&&i!==n&&Tw(e,i,{get:()=>t[i],enumerable:!(r=Ew(t,i))||r.enumerable});return e},Mw=(e,t,n)=>(n=e==null?{}:ww(Ow(e)),jw(t||!e||!e.__esModule?Tw(n,`default`,{value:e,enumerable:!0}):n,e)),Nw=Aw((e,t)=>{t.exports=Worker}),Pw=(e=>(e[e.UNDEFINED=0]=`UNDEFINED`,e[e.AUTOMATIC=1]=`AUTOMATIC`,e[e.READ_ONLY=2]=`READ_ONLY`,e[e.READ_WRITE=3]=`READ_WRITE`,e))(Pw||{}),Fw=(e=>(e[e.IDENTIFIER=0]=`IDENTIFIER`,e[e.NUMERIC_CONSTANT=1]=`NUMERIC_CONSTANT`,e[e.STRING_CONSTANT=2]=`STRING_CONSTANT`,e[e.OPERATOR=3]=`OPERATOR`,e[e.KEYWORD=4]=`KEYWORD`,e[e.COMMENT=5]=`COMMENT`,e))(Fw||{}),Iw=(e=>(e[e.NONE=0]=`NONE`,e[e.DEBUG=1]=`DEBUG`,e[e.INFO=2]=`INFO`,e[e.WARNING=3]=`WARNING`,e[e.ERROR=4]=`ERROR`,e))(Iw||{}),Lw=(e=>(e[e.NONE=0]=`NONE`,e[e.CONNECT=1]=`CONNECT`,e[e.DISCONNECT=2]=`DISCONNECT`,e[e.OPEN=3]=`OPEN`,e[e.QUERY=4]=`QUERY`,e[e.INSTANTIATE=5]=`INSTANTIATE`,e))(Lw||{}),Rw=(e=>(e[e.NONE=0]=`NONE`,e[e.OK=1]=`OK`,e[e.ERROR=2]=`ERROR`,e[e.START=3]=`START`,e[e.RUN=4]=`RUN`,e[e.CAPTURE=5]=`CAPTURE`,e))(Rw||{}),zw=(e=>(e[e.NONE=0]=`NONE`,e[e.WEB_WORKER=1]=`WEB_WORKER`,e[e.NODE_WORKER=2]=`NODE_WORKER`,e[e.BINDINGS=3]=`BINDINGS`,e[e.ASYNC_DUCKDB=4]=`ASYNC_DUCKDB`,e))(zw||{}),Bw=class{log(e){}},Vw=class{constructor(e=2){this.level=e}log(e){e.level>=this.level&&console.log(e)}},Hw=(e=>(e[e.SUCCESS=0]=`SUCCESS`,e))(Hw||{}),Uw=class{constructor(e,t){this._bindings=e,this._conn=t}get bindings(){return this._bindings}async close(){return this._bindings.disconnect(this._conn)}useUnsafe(e){return e(this._bindings,this._conn)}async query(e){this._bindings.logger.log({timestamp:new Date,level:2,origin:4,topic:4,event:4,value:e});let t=await this._bindings.runQuery(this._conn,e),n=KC.from(t);return console.assert(n.isSync(),`Reader is not sync`),console.assert(n.isFile(),`Reader is not file`),new IS(n)}async send(e,t=!1){this._bindings.logger.log({timestamp:new Date,level:2,origin:4,topic:4,event:4,value:e});let n=await this._bindings.startPendingQuery(this._conn,e,t);for(;n==null;)n=await this._bindings.pollPendingQuery(this._conn);let r=new Ww(this._bindings,this._conn,n),i=await KC.from(r);return console.assert(i.isAsync()),console.assert(i.isStream()),i}async cancelSent(){return await this._bindings.cancelPendingQuery(this._conn)}async getTableNames(e){return await this._bindings.getTableNames(this._conn,e)}async prepare(e){let t=await this._bindings.createPrepared(this._conn,e);return new Gw(this._bindings,this._conn,t)}async insertArrowTable(e,t){let n=Cw(e,`stream`);await this.insertArrowFromIPCStream(n,t)}async insertArrowFromIPCStream(e,t){await this._bindings.insertArrowFromIPCStream(this._conn,e,t)}async insertCSVFromPath(e,t){await this._bindings.insertCSVFromPath(this._conn,e,t)}async insertJSONFromPath(e,t){await this._bindings.insertJSONFromPath(this._conn,e,t)}},Ww=class{constructor(e,t,n){this.db=e,this.conn=t,this.header=n,this._first=!0,this._depleted=!1,this._inFlight=null}async next(){if(this._first)return this._first=!1,{done:!1,value:this.header};if(this._depleted)return{done:!0,value:null};let e;return this._inFlight==null?e=await this.db.fetchQueryResults(this.conn):(e=await this._inFlight,this._inFlight=null),this._depleted=e.length==0,this._depleted||(this._inFlight=this.db.fetchQueryResults(this.conn)),{done:this._depleted,value:e}}[Symbol.asyncIterator](){return this}},Gw=class{constructor(e,t,n){this.bindings=e,this.connectionId=t,this.statementId=n}async close(){await this.bindings.closePrepared(this.connectionId,this.statementId)}async query(...e){let t=await this.bindings.runPrepared(this.connectionId,this.statementId,e),n=KC.from(t);return console.assert(n.isSync()),console.assert(n.isFile()),new IS(n)}async send(...e){let t=await this.bindings.sendPrepared(this.connectionId,this.statementId,e),n=new Ww(this.bindings,this.connectionId,t),r=await KC.from(n);return console.assert(r.isAsync()),console.assert(r.isStream()),r}},Kw=(e=>(e.CANCEL_PENDING_QUERY=`CANCEL_PENDING_QUERY`,e.CLOSE_PREPARED=`CLOSE_PREPARED`,e.COLLECT_FILE_STATISTICS=`COLLECT_FILE_STATISTICS`,e.REGISTER_OPFS_FILE_NAME=`REGISTER_OPFS_FILE_NAME`,e.CONNECT=`CONNECT`,e.COPY_FILE_TO_BUFFER=`COPY_FILE_TO_BUFFER`,e.COPY_FILE_TO_PATH=`COPY_FILE_TO_PATH`,e.CREATE_PREPARED=`CREATE_PREPARED`,e.DISCONNECT=`DISCONNECT`,e.DROP_FILE=`DROP_FILE`,e.DROP_FILES=`DROP_FILES`,e.EXPORT_FILE_STATISTICS=`EXPORT_FILE_STATISTICS`,e.FETCH_QUERY_RESULTS=`FETCH_QUERY_RESULTS`,e.FLUSH_FILES=`FLUSH_FILES`,e.GET_FEATURE_FLAGS=`GET_FEATURE_FLAGS`,e.GET_TABLE_NAMES=`GET_TABLE_NAMES`,e.GET_VERSION=`GET_VERSION`,e.GLOB_FILE_INFOS=`GLOB_FILE_INFOS`,e.INSERT_ARROW_FROM_IPC_STREAM=`INSERT_ARROW_FROM_IPC_STREAM`,e.INSERT_CSV_FROM_PATH=`IMPORT_CSV_FROM_PATH`,e.INSERT_JSON_FROM_PATH=`IMPORT_JSON_FROM_PATH`,e.INSTANTIATE=`INSTANTIATE`,e.OPEN=`OPEN`,e.PING=`PING`,e.POLL_PENDING_QUERY=`POLL_PENDING_QUERY`,e.REGISTER_FILE_BUFFER=`REGISTER_FILE_BUFFER`,e.REGISTER_FILE_HANDLE=`REGISTER_FILE_HANDLE`,e.REGISTER_FILE_URL=`REGISTER_FILE_URL`,e.RESET=`RESET`,e.RUN_PREPARED=`RUN_PREPARED`,e.RUN_QUERY=`RUN_QUERY`,e.SEND_PREPARED=`SEND_PREPARED`,e.START_PENDING_QUERY=`START_PENDING_QUERY`,e.TOKENIZE=`TOKENIZE`,e))(Kw||{}),qw=(e=>(e.CONNECTION_INFO=`CONNECTION_INFO`,e.ERROR=`ERROR`,e.FEATURE_FLAGS=`FEATURE_FLAGS`,e.FILE_BUFFER=`FILE_BUFFER`,e.FILE_INFOS=`FILE_INFOS`,e.FILE_SIZE=`FILE_SIZE`,e.FILE_STATISTICS=`FILE_STATISTICS`,e.INSTANTIATE_PROGRESS=`INSTANTIATE_PROGRESS`,e.LOG=`LOG`,e.OK=`OK`,e.PREPARED_STATEMENT_ID=`PREPARED_STATEMENT_ID`,e.QUERY_PLAN=`QUERY_PLAN`,e.QUERY_RESULT=`QUERY_RESULT`,e.QUERY_RESULT_CHUNK=`QUERY_RESULT_CHUNK`,e.QUERY_RESULT_HEADER=`QUERY_RESULT_HEADER`,e.QUERY_RESULT_HEADER_OR_NULL=`QUERY_RESULT_HEADER_OR_NULL`,e.REGISTERED_FILE=`REGISTERED_FILE`,e.SCRIPT_TOKENS=`SCRIPT_TOKENS`,e.SUCCESS=`SUCCESS`,e.TABLE_NAMES=`TABLE_NAMES`,e.VERSION_STRING=`VERSION_STRING`,e))(qw||{}),Jw=class{constructor(e,t){this.promiseResolver=()=>{},this.promiseRejecter=()=>{},this.type=e,this.data=t,this.promise=new Promise((e,t)=>{this.promiseResolver=e,this.promiseRejecter=t})}};function Yw(e){switch(e.typeId){case q.Binary:return{sqlType:`binary`};case q.Bool:return{sqlType:`bool`};case q.Date:return{sqlType:`date`};case q.DateDay:return{sqlType:`date32[d]`};case q.DateMillisecond:return{sqlType:`date64[ms]`};case q.Decimal:{let t=e;return{sqlType:`decimal`,precision:t.precision,scale:t.scale}}case q.Float:return{sqlType:`float`};case q.Float16:return{sqlType:`float16`};case q.Float32:return{sqlType:`float32`};case q.Float64:return{sqlType:`float64`};case q.Int:return{sqlType:`int32`};case q.Int16:return{sqlType:`int16`};case q.Int32:return{sqlType:`int32`};case q.Int64:return{sqlType:`int64`};case q.Uint16:return{sqlType:`uint16`};case q.Uint32:return{sqlType:`uint32`};case q.Uint64:return{sqlType:`uint64`};case q.Uint8:return{sqlType:`uint8`};case q.IntervalDayTime:return{sqlType:`interval[dt]`};case q.IntervalYearMonth:return{sqlType:`interval[m]`};case q.List:return{sqlType:`list`,valueType:Yw(e.valueType)};case q.FixedSizeBinary:return{sqlType:`fixedsizebinary`,byteWidth:e.byteWidth};case q.Null:return{sqlType:`null`};case q.Utf8:return{sqlType:`utf8`};case q.Struct:return{sqlType:`struct`,fields:e.children.map(e=>Xw(e.name,e.type))};case q.Map:{let t=e;return{sqlType:`map`,keyType:Yw(t.keyType),valueType:Yw(t.valueType)}}case q.Time:return{sqlType:`time[s]`};case q.TimeMicrosecond:return{sqlType:`time[us]`};case q.TimeMillisecond:return{sqlType:`time[ms]`};case q.TimeNanosecond:return{sqlType:`time[ns]`};case q.TimeSecond:return{sqlType:`time[s]`};case q.Timestamp:return{sqlType:`timestamp`,timezone:e.timezone||void 0};case q.TimestampSecond:return{sqlType:`timestamp[s]`,timezone:e.timezone||void 0};case q.TimestampMicrosecond:return{sqlType:`timestamp[us]`,timezone:e.timezone||void 0};case q.TimestampNanosecond:return{sqlType:`timestamp[ns]`,timezone:e.timezone||void 0};case q.TimestampMillisecond:return{sqlType:`timestamp[ms]`,timezone:e.timezone||void 0}}throw Error(`unsupported arrow type: ${e.toString()}`)}function Xw(e,t){let n=Yw(t);return n.name=e,n}var Zw=new TextEncoder,Qw=class{constructor(e,t=null){this._onInstantiationProgress=[],this._worker=null,this._workerShutdownPromise=null,this._workerShutdownResolver=()=>{},this._nextMessageId=0,this._pendingRequests=new Map,this._logger=e,this._onMessageHandler=this.onMessage.bind(this),this._onErrorHandler=this.onError.bind(this),this._onCloseHandler=this.onClose.bind(this),t!=null&&this.attach(t)}get logger(){return this._logger}attach(e){this._worker=e,this._worker.addEventListener(`message`,this._onMessageHandler),this._worker.addEventListener(`error`,this._onErrorHandler),this._worker.addEventListener(`close`,this._onCloseHandler),this._workerShutdownPromise=new Promise((e,t)=>{this._workerShutdownResolver=e})}detach(){this._worker&&(this._worker.removeEventListener(`message`,this._onMessageHandler),this._worker.removeEventListener(`error`,this._onErrorHandler),this._worker.removeEventListener(`close`,this._onCloseHandler),this._worker=null,this._workerShutdownResolver(null),this._workerShutdownPromise=null,this._workerShutdownResolver=()=>{})}async terminate(){this._worker&&(this._worker.terminate(),this._worker=null,this._workerShutdownPromise=null,this._workerShutdownResolver=()=>{})}async postTask(e,t=[]){if(!this._worker){console.error(`cannot send a message since the worker is not set!`);return}let n=this._nextMessageId++;return this._pendingRequests.set(n,e),this._worker.postMessage({messageId:n,type:e.type,data:e.data},t),await e.promise}onMessage(e){var t;let n=e.data;switch(n.type){case`LOG`:this._logger.log(n.data);return;case`INSTANTIATE_PROGRESS`:for(let e of this._onInstantiationProgress)e(n.data);return}let r=this._pendingRequests.get(n.requestId);if(!r){console.warn(`unassociated response: [${n.requestId}, ${n.type.toString()}]`);return}if(this._pendingRequests.delete(n.requestId),n.type==`ERROR`){let e=Error(n.data.message);e.name=n.data.name,(t=Object.getOwnPropertyDescriptor(e,`stack`))!=null&&t.writable&&(e.stack=n.data.stack),r.promiseRejecter(e);return}switch(r.type){case`CLOSE_PREPARED`:case`COLLECT_FILE_STATISTICS`:case`REGISTER_OPFS_FILE_NAME`:case`COPY_FILE_TO_PATH`:case`DISCONNECT`:case`DROP_FILE`:case`DROP_FILES`:case`FLUSH_FILES`:case`INSERT_ARROW_FROM_IPC_STREAM`:case`IMPORT_CSV_FROM_PATH`:case`IMPORT_JSON_FROM_PATH`:case`OPEN`:case`PING`:case`REGISTER_FILE_BUFFER`:case`REGISTER_FILE_HANDLE`:case`REGISTER_FILE_URL`:case`RESET`:if(n.type==`OK`){r.promiseResolver(n.data);return}break;case`INSTANTIATE`:if(this._onInstantiationProgress=[],n.type==`OK`){r.promiseResolver(n.data);return}break;case`GLOB_FILE_INFOS`:if(n.type==`FILE_INFOS`){r.promiseResolver(n.data);return}break;case`GET_VERSION`:if(n.type==`VERSION_STRING`){r.promiseResolver(n.data);return}break;case`GET_FEATURE_FLAGS`:if(n.type==`FEATURE_FLAGS`){r.promiseResolver(n.data);return}break;case`GET_TABLE_NAMES`:if(n.type==`TABLE_NAMES`){r.promiseResolver(n.data);return}break;case`TOKENIZE`:if(n.type==`SCRIPT_TOKENS`){r.promiseResolver(n.data);return}break;case`COPY_FILE_TO_BUFFER`:if(n.type==`FILE_BUFFER`){r.promiseResolver(n.data);return}break;case`EXPORT_FILE_STATISTICS`:if(n.type==`FILE_STATISTICS`){r.promiseResolver(n.data);return}break;case`CONNECT`:if(n.type==`CONNECTION_INFO`){r.promiseResolver(n.data);return}break;case`RUN_PREPARED`:case`RUN_QUERY`:if(n.type==`QUERY_RESULT`){r.promiseResolver(n.data);return}break;case`SEND_PREPARED`:if(n.type==`QUERY_RESULT_HEADER`){r.promiseResolver(n.data);return}break;case`START_PENDING_QUERY`:if(n.type==`QUERY_RESULT_HEADER_OR_NULL`){r.promiseResolver(n.data);return}break;case`POLL_PENDING_QUERY`:if(n.type==`QUERY_RESULT_HEADER_OR_NULL`){r.promiseResolver(n.data);return}break;case`CANCEL_PENDING_QUERY`:if(this._onInstantiationProgress=[],n.type==`SUCCESS`){r.promiseResolver(n.data);return}break;case`FETCH_QUERY_RESULTS`:if(n.type==`QUERY_RESULT_CHUNK`){r.promiseResolver(n.data);return}break;case`CREATE_PREPARED`:if(n.type==`PREPARED_STATEMENT_ID`){r.promiseResolver(n.data);return}break}r.promiseRejecter(Error(`unexpected response type: ${n.type.toString()}`))}onError(e){console.error(e),console.error(`error in duckdb worker: ${e.message}`),this._pendingRequests.clear()}onClose(){if(this._workerShutdownResolver(null),this._pendingRequests.size!=0){console.warn(`worker terminated with ${this._pendingRequests.size} pending requests`);return}this._pendingRequests.clear()}async reset(){let e=new Jw(`RESET`,null);return await this.postTask(e)}async ping(){let e=new Jw(`PING`,null);await this.postTask(e)}async dropFile(e){let t=new Jw(`DROP_FILE`,e);return await this.postTask(t)}async dropFiles(){let e=new Jw(`DROP_FILES`,null);return await this.postTask(e)}async flushFiles(){let e=new Jw(`FLUSH_FILES`,null);return await this.postTask(e)}async instantiate(e,t=null,n=e=>{}){this._onInstantiationProgress.push(n);let r=new Jw(`INSTANTIATE`,[e,t]);return await this.postTask(r)}async getVersion(){let e=new Jw(`GET_VERSION`,null);return await this.postTask(e)}async getFeatureFlags(){let e=new Jw(`GET_FEATURE_FLAGS`,null);return await this.postTask(e)}async open(e){let t=new Jw(`OPEN`,e);await this.postTask(t)}async tokenize(e){let t=new Jw(`TOKENIZE`,e);return await this.postTask(t)}async connectInternal(){let e=new Jw(`CONNECT`,null);return await this.postTask(e)}async connect(){let e=await this.connectInternal();return new Uw(this,e)}async disconnect(e){let t=new Jw(`DISCONNECT`,e);await this.postTask(t)}async runQuery(e,t){let n=new Jw(`RUN_QUERY`,[e,t]);return await this.postTask(n)}async startPendingQuery(e,t,n=!1){let r=new Jw(`START_PENDING_QUERY`,[e,t,n]);return await this.postTask(r)}async pollPendingQuery(e){let t=new Jw(`POLL_PENDING_QUERY`,e);return await this.postTask(t)}async cancelPendingQuery(e){let t=new Jw(`CANCEL_PENDING_QUERY`,e);return await this.postTask(t)}async fetchQueryResults(e){let t=new Jw(`FETCH_QUERY_RESULTS`,e);return await this.postTask(t)}async getTableNames(e,t){let n=new Jw(`GET_TABLE_NAMES`,[e,t]);return await this.postTask(n)}async createPrepared(e,t){let n=new Jw(`CREATE_PREPARED`,[e,t]);return await this.postTask(n)}async closePrepared(e,t){let n=new Jw(`CLOSE_PREPARED`,[e,t]);await this.postTask(n)}async runPrepared(e,t,n){let r=new Jw(`RUN_PREPARED`,[e,t,n]);return await this.postTask(r)}async sendPrepared(e,t,n){let r=new Jw(`SEND_PREPARED`,[e,t,n]);return await this.postTask(r)}async globFiles(e){let t=new Jw(`GLOB_FILE_INFOS`,e);return await this.postTask(t)}async registerFileText(e,t){let n=Zw.encode(t);await this.registerFileBuffer(e,n)}async registerFileURL(e,t,n,r){t===void 0&&(t=e);let i=new Jw(`REGISTER_FILE_URL`,[e,t,n,r]);await this.postTask(i)}async registerEmptyFileBuffer(e){}async registerFileBuffer(e,t){let n=new Jw(`REGISTER_FILE_BUFFER`,[e,t]);await this.postTask(n,[t.buffer])}async registerFileHandle(e,t,n,r){let i=new Jw(`REGISTER_FILE_HANDLE`,[e,t,n,r]);await this.postTask(i,[])}async registerOPFSFileName(e){let t=new Jw(`REGISTER_OPFS_FILE_NAME`,[e]);await this.postTask(t,[])}async collectFileStatistics(e,t){let n=new Jw(`COLLECT_FILE_STATISTICS`,[e,t]);await this.postTask(n,[])}async exportFileStatistics(e){let t=new Jw(`EXPORT_FILE_STATISTICS`,e);return await this.postTask(t,[])}async copyFileToBuffer(e){let t=new Jw(`COPY_FILE_TO_BUFFER`,e);return await this.postTask(t)}async copyFileToPath(e,t){let n=new Jw(`COPY_FILE_TO_PATH`,[e,t]);await this.postTask(n)}async insertArrowFromIPCStream(e,t,n){if(t.length==0)return;let r=new Jw(`INSERT_ARROW_FROM_IPC_STREAM`,[e,t,n]);await this.postTask(r,[t.buffer])}async insertCSVFromPath(e,t,n){if(n.columns!==void 0){let e=[];for(let t in n.columns){let r=n.columns[t];e.push(Xw(t,r))}n.columnsFlat=e,delete n.columns}let r=new Jw(`IMPORT_CSV_FROM_PATH`,[e,t,n]);await this.postTask(r)}async insertJSONFromPath(e,t,n){if(n.columns!==void 0){let e=[];for(let t in n.columns){let r=n.columns[t];e.push(Xw(t,r))}n.columnsFlat=e,delete n.columns}let r=new Jw(`IMPORT_JSON_FROM_PATH`,[e,t,n]);await this.postTask(r)}};function $w(){let e=new TextDecoder;return t=>(typeof SharedArrayBuffer<`u`&&t.buffer instanceof SharedArrayBuffer&&(t=new Uint8Array(t)),e.decode(t))}var eT=$w(),tT=(e=>(e[e.BUFFER=0]=`BUFFER`,e[e.NODE_FS=1]=`NODE_FS`,e[e.BROWSER_FILEREADER=2]=`BROWSER_FILEREADER`,e[e.BROWSER_FSACCESS=3]=`BROWSER_FSACCESS`,e[e.HTTP=4]=`HTTP`,e[e.S3=5]=`S3`,e))(tT||{}),nT=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,3,1,0,1,10,14,1,12,0,65,0,65,0,65,0,252,10,0,0,11])),rT=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,8,1,6,0,6,64,25,11,11])),iT=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11])),aT=()=>(async e=>{try{return typeof MessageChannel<`u`&&new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(e)}catch{return!1}})(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11])),oT={name:`@duckdb/duckdb-wasm`,version:`1.29.1-dev68.0`,description:`DuckDB powered by WebAssembly`,license:`MIT`,repository:{type:`git`,url:`https://github.com/duckdb/duckdb-wasm.git`},keywords:[`sql`,`duckdb`,`relational`,`database`,`data`,`query`,`wasm`,`analytics`,`olap`,`arrow`,`parquet`,`json`,`csv`],dependencies:{"apache-arrow":`^17.0.0`},devDependencies:{"@types/emscripten":`^1.39.10`,"@types/jasmine":`^5.1.4`,"@typescript-eslint/eslint-plugin":`^6.21.0`,"@typescript-eslint/parser":`^6.21.0`,esbuild:`^0.20.2`,eslint:`^8.57.0`,"eslint-plugin-jasmine":`^4.1.3`,"eslint-plugin-react":`^7.34.0`,"fast-glob":`^3.3.2`,jasmine:`^5.1.0`,"jasmine-core":`^5.1.2`,"jasmine-spec-reporter":`^7.0.0`,"js-sha256":`^0.11.0`,karma:`^6.4.2`,"karma-chrome-launcher":`^3.2.0`,"karma-coverage":`^2.2.1`,"karma-firefox-launcher":`^2.1.3`,"karma-jasmine":`^5.1.0`,"karma-jasmine-html-reporter":`^2.1.0`,"karma-sourcemap-loader":`^0.4.0`,"karma-spec-reporter":`^0.0.36`,"make-dir":`^4.0.0`,nyc:`^15.1.0`,prettier:`^3.2.5`,puppeteer:`^22.8.0`,rimraf:`^5.0.5`,s3rver:`^3.7.1`,typedoc:`^0.25.13`,typescript:`^5.3.3`,"wasm-feature-detect":`^1.6.1`,"web-worker":`^1.2.0`},scripts:{"build:debug":`node bundle.mjs debug && tsc --emitDeclarationOnly`,"build:release":`node bundle.mjs release && tsc --emitDeclarationOnly`,docs:`typedoc`,report:`node ./coverage.mjs`,"test:node":`node --enable-source-maps ../../node_modules/jasmine/bin/jasmine ./dist/tests-node.cjs`,"test:node:debug":`node --inspect-brk --enable-source-maps ../../node_modules/jasmine/bin/jasmine ./dist/tests-node.cjs`,"test:node:coverage":`nyc -r json --report-dir ./coverage/node node ../../node_modules/jasmine/bin/jasmine ./dist/tests-node.cjs`,"test:firefox":`karma start ./karma/tests-firefox.cjs`,"test:chrome":`karma start ./karma/tests-chrome.cjs`,"test:chrome:eh":`karma start ./karma/tests-chrome-eh.cjs`,"test:chrome:coverage":`karma start ./karma/tests-chrome-coverage.cjs`,"test:browser":`karma start ./karma/tests-all.cjs`,"test:browser:debug":`karma start ./karma/tests-debug.cjs`,test:`npm run test:chrome && npm run test:node`,"test:coverage":`npm run test:chrome:coverage && npm run test:node:coverage && npm run report`,lint:`eslint src test`},files:[`dist`,`!dist/tests-*`,`!dist/duckdb-browser-mvp.worker.js.map`,`!dist/types/test`],main:`dist/duckdb-browser.cjs`,module:`dist/duckdb-browser.mjs`,types:`dist/duckdb-browser.d.ts`,jsdelivr:`dist/duckdb-browser.cjs`,unpkg:`dist/duckdb-browser.mjs`,sideEffects:!1,browser:{fs:!1,path:!1,perf_hooks:!1,os:!1,worker_threads:!1},exports:{"./dist/duckdb-mvp.wasm":`./dist/duckdb-mvp.wasm`,"./dist/duckdb-eh.wasm":`./dist/duckdb-eh.wasm`,"./dist/duckdb-coi.wasm":`./dist/duckdb-coi.wasm`,"./dist/duckdb-browser":`./dist/duckdb-browser.mjs`,"./dist/duckdb-browser.cjs":`./dist/duckdb-browser.cjs`,"./dist/duckdb-browser.mjs":`./dist/duckdb-browser.mjs`,"./dist/duckdb-browser-coi.pthread.worker.js":`./dist/duckdb-browser-coi.pthread.worker.js`,"./dist/duckdb-browser-coi.worker.js":`./dist/duckdb-browser-coi.worker.js`,"./dist/duckdb-browser-eh.worker.js":`./dist/duckdb-browser-eh.worker.js`,"./dist/duckdb-browser-mvp.worker.js":`./dist/duckdb-browser-mvp.worker.js`,"./dist/duckdb-node":`./dist/duckdb-node.cjs`,"./dist/duckdb-node.cjs":`./dist/duckdb-node.cjs`,"./dist/duckdb-node-blocking":`./dist/duckdb-node-blocking.cjs`,"./dist/duckdb-node-blocking.cjs":`./dist/duckdb-node-blocking.cjs`,"./dist/duckdb-node-eh.worker.cjs":`./dist/duckdb-node-eh.worker.cjs`,"./dist/duckdb-node-mvp.worker.cjs":`./dist/duckdb-node-mvp.worker.cjs`,"./blocking":{node:{types:`./dist/duckdb-node-blocking.d.ts`,require:`./dist/duckdb-node-blocking.cjs`,import:`./dist/duckdb-node-blocking.cjs`},types:`./dist/duckdb-node-blocking.d.ts`,import:`./dist/duckdb-node-blocking.mjs`,require:`./dist/duckdb-node-blocking.cjs`},".":{browser:{types:`./dist/duckdb-browser.d.ts`,import:`./dist/duckdb-browser.mjs`,require:`./dist/duckdb-browser.cjs`},node:{types:`./dist/duckdb-node.d.ts`,import:`./dist/duckdb-node.cjs`,require:`./dist/duckdb-node.cjs`},types:`./dist/duckdb-browser.d.ts`,import:`./dist/duckdb-browser.mjs`,require:`./dist/duckdb-browser.cjs`}}},sT=oT.name,cT=oT.version,lT=oT.version.split(`.`),uT=lT[0],dT=lT[1],fT=lT[2],pT=()=>typeof navigator>`u`,mT=()=>pT()?`node`:navigator.userAgent,hT=()=>mT().includes(`Firefox`),gT=()=>/^((?!chrome|android).)*safari/i.test(mT()),_T=null,vT=null,yT=null,bT=null,xT=null;async function ST(){return _T??=typeof BigInt64Array<`u`,vT??=await rT(),yT??=await aT(),bT??=await iT(),xT??=await nT(),{bigInt64Array:_T,crossOriginIsolated:pT()||globalThis.crossOriginIsolated||!1,wasmExceptions:vT,wasmSIMD:bT,wasmThreads:yT,wasmBulkMemory:xT}}async function CT(e){let t=await ST();if(t.wasmExceptions){if(t.wasmSIMD&&t.wasmThreads&&t.crossOriginIsolated&&e.coi)return{mainModule:e.coi.mainModule,mainWorker:e.coi.mainWorker,pthreadWorker:e.coi.pthreadWorker};if(e.eh)return{mainModule:e.eh.mainModule,mainWorker:e.eh.mainWorker,pthreadWorker:null}}return{mainModule:e.mvp.mainModule,mainWorker:e.mvp.mainWorker,pthreadWorker:null}}var wT=Mw(Nw());const TT=Symbol.for(`constructDateFrom`),ET={},DT={};function OT(e,t){try{let n=ET[e]||=new Intl.DateTimeFormat(`en-GB`,{timeZone:e,hour:`numeric`,timeZoneName:`longOffset`}).format,r=n(t).split(`GMT`)[1]||``;return r in DT?DT[r]:AT(r,r.split(`:`))}catch{if(e in DT)return DT[e];let t=e?.match(kT);return t?AT(e,t.slice(1)):NaN}}const kT=/([+-]\d\d):?(\d\d)?/;function AT(e,t){let n=+t[0],r=+(t[1]||0);return DT[e]=n>0?n*60+r:n*60-r}var jT=class e extends Date{constructor(...e){super(),e.length>1&&typeof e[e.length-1]==`string`&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(OT(this.timeZone,this))?this.setTime(NaN):e.length?typeof e[0]==`number`&&(e.length===1||e.length===2&&typeof e[1]!=`number`)?this.setTime(e[0]):typeof e[0]==`string`?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),FT(this,NaN),NT(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new e(...n,t):new e(Date.now(),t)}withTimeZone(t){return new e(+this,t)}getTimezoneOffset(){return-OT(this.timeZone,this)}setTime(e){return Date.prototype.setTime.apply(this,arguments),NT(this),+this}[Symbol.for(`constructDateFrom`)](t){return new e(+new Date(t),this.timeZone)}};const MT=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!MT.test(e))return;let t=e.replace(MT,`$1UTC`);jT.prototype[t]&&(e.startsWith(`get`)?jT.prototype[e]=function(){return this.internal[t]()}:(jT.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),PT(this),+this},jT.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),NT(this),+this}))});function NT(e){e.internal.setTime(+e),e.internal.setUTCMinutes(e.internal.getUTCMinutes()-e.getTimezoneOffset())}function PT(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),FT(e)}function FT(e){let t=OT(e.timeZone,e),n=new Date(+e);n.setUTCHours(n.getUTCHours()-1);let r=-new Date(+e).getTimezoneOffset(),i=-new Date(+n).getTimezoneOffset(),a=r-i,o=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();a&&o&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+a);let s=r-t;s&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+s);let c=OT(e.timeZone,e),l=-new Date(+e).getTimezoneOffset(),u=l-c,d=c!==t,f=u-s;if(d&&f){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+f);let t=OT(e.timeZone,e),n=c-t;n&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+n),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+n))}}var IT=class e extends jT{static tz(t,...n){return n.length?new e(...n,t):new e(Date.now(),t)}toISOString(){let[e,t,n]=this.tzComponents(),r=`${e}${t}:${n}`;return this.internal.toISOString().slice(0,-1)+r}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){let[e,t,n,r]=this.internal.toUTCString().split(` `);return`${e?.slice(0,-1)} ${n} ${t} ${r}`}toTimeString(){let e=this.internal.toUTCString().split(` `)[4],[t,n,r]=this.tzComponents();return`${e} GMT${t}${n}${r} (${LT(this.timeZone,this)})`}toLocaleString(e,t){return Date.prototype.toLocaleString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleDateString(e,t){return Date.prototype.toLocaleDateString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleTimeString(e,t){return Date.prototype.toLocaleTimeString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}tzComponents(){let e=this.getTimezoneOffset(),t=e>0?`-`:`+`,n=String(Math.floor(Math.abs(e)/60)).padStart(2,`0`),r=String(Math.abs(e)%60).padStart(2,`0`);return[t,n,r]}withTimeZone(t){return new e(+this,t)}[Symbol.for(`constructDateFrom`)](t){return new e(+new Date(t),this.timeZone)}};function LT(e,t){return new Intl.DateTimeFormat(`en-GB`,{timeZone:e,timeZoneName:`long`}).format(t).slice(12)}const RT=new TextDecoder(`utf-8`),zT=e=>RT.decode(e),BT=new TextEncoder,VT=e=>BT.encode(e),HT=e=>typeof e==`function`,UT=e=>e!=null&&Object(e)===e,WT=e=>UT(e)&&HT(e.then),GT=e=>UT(e)&&HT(e[Symbol.iterator]),KT=e=>UT(e)&&HT(e[Symbol.asyncIterator]),qT=e=>UT(e)&&`done`in e&&`value`in e,JT=e=>UT(e)&&HT(e.clear)&&HT(e.bytes)&&HT(e.position)&&HT(e.setPosition)&&HT(e.capacity)&&HT(e.getBufferIdentifier)&&HT(e.createLong);var YT={};hn(YT,{compareArrayLike:()=>PE,joinUint8Arrays:()=>$T,memcpy:()=>QT,rebaseValueOffsets:()=>NE,toArrayBufferView:()=>eE,toArrayBufferViewAsyncIterator:()=>CE,toArrayBufferViewIterator:()=>pE,toBigInt64Array:()=>iE,toBigUint64Array:()=>cE,toFloat32Array:()=>lE,toFloat32ArrayAsyncIterator:()=>AE,toFloat32ArrayIterator:()=>bE,toFloat64Array:()=>uE,toFloat64ArrayAsyncIterator:()=>jE,toFloat64ArrayIterator:()=>xE,toInt16Array:()=>nE,toInt16ArrayAsyncIterator:()=>TE,toInt16ArrayIterator:()=>hE,toInt32Array:()=>rE,toInt32ArrayAsyncIterator:()=>EE,toInt32ArrayIterator:()=>gE,toInt8Array:()=>tE,toInt8ArrayAsyncIterator:()=>wE,toInt8ArrayIterator:()=>mE,toUint16Array:()=>oE,toUint16ArrayAsyncIterator:()=>OE,toUint16ArrayIterator:()=>vE,toUint32Array:()=>sE,toUint32ArrayAsyncIterator:()=>kE,toUint32ArrayIterator:()=>yE,toUint8Array:()=>aE,toUint8ArrayAsyncIterator:()=>DE,toUint8ArrayIterator:()=>_E,toUint8ClampedArray:()=>dE,toUint8ClampedArrayAsyncIterator:()=>ME,toUint8ClampedArrayIterator:()=>SE});const XT=typeof SharedArrayBuffer<`u`?SharedArrayBuffer:ArrayBuffer;function ZT(e){let t=e[0]?[e[0]]:[],n,r,i,a;for(let o,s,c=0,l=0,u=e.length;++ce+t.byteLength,0),i,a,o,s=0,c=-1,l=Math.min(t||1/0,r);for(let e=n.length;++ceE(Int8Array,e),nE=e=>eE(Int16Array,e),rE=e=>eE(Int32Array,e),iE=e=>eE(BigInt64Array,e),aE=e=>eE(Uint8Array,e),oE=e=>eE(Uint16Array,e),sE=e=>eE(Uint32Array,e),cE=e=>eE(BigUint64Array,e),lE=e=>eE(Float32Array,e),uE=e=>eE(Float64Array,e),dE=e=>eE(Uint8ClampedArray,e),fE=e=>(e.next(),e);function*pE(e,t){let n=function*(e){yield e},r=typeof t==`string`||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof XT?n(t):GT(t)?t:n(t);return yield*fE(function*(t){let n=null;do n=t.next(yield eE(e,n));while(!n.done)}(r[Symbol.iterator]())),new e}const mE=e=>pE(Int8Array,e),hE=e=>pE(Int16Array,e),gE=e=>pE(Int32Array,e),_E=e=>pE(Uint8Array,e),vE=e=>pE(Uint16Array,e),yE=e=>pE(Uint32Array,e),bE=e=>pE(Float32Array,e),xE=e=>pE(Float64Array,e),SE=e=>pE(Uint8ClampedArray,e);function CE(e,t){return Sh(this,arguments,function*(){if(WT(t))return yield xh(yield xh(yield*Ch(wh(CE(e,yield xh(t))))));let n=function(e){return Sh(this,arguments,function*(){yield yield xh(yield xh(e))})},r=function(e){return Sh(this,arguments,function*(){yield xh(yield*Ch(wh(fE(function*(e){let t=null;do t=e.next(yield t?.value);while(!t.done)}(e[Symbol.iterator]())))))})},i=typeof t==`string`||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof XT?n(t):GT(t)?r(t):KT(t)?t:n(t);return yield xh(yield*Ch(wh(fE(function(t){return Sh(this,arguments,function*(){let n=null;do n=yield xh(t.next(yield yield xh(eE(e,n))));while(!n.done)})}(i[Symbol.asyncIterator]()))))),yield xh(new e)})}const wE=e=>CE(Int8Array,e),TE=e=>CE(Int16Array,e),EE=e=>CE(Int32Array,e),DE=e=>CE(Uint8Array,e),OE=e=>CE(Uint16Array,e),kE=e=>CE(Uint32Array,e),AE=e=>CE(Float32Array,e),jE=e=>CE(Float64Array,e),ME=e=>CE(Uint8ClampedArray,e);function NE(e,t,n){if(e!==0){n=n.slice(0,t);for(let t=-1,r=n.length;++t0)do if(e[n]!==t[n])return!1;while(++nUE});const HE=void 0;function UE(e){if(e===null)return`null`;if(e===HE)return`undefined`;switch(typeof e){case`number`:return`${e}`;case`bigint`:return`${e}`;case`string`:return`"${e}"`}return typeof e[Symbol.toPrimitive]==`function`?e[Symbol.toPrimitive](`string`):ArrayBuffer.isView(e)?e instanceof BigInt64Array||e instanceof BigUint64Array?`[${[...e].map(e=>UE(e))}]`:`[${e}]`:ArrayBuffer.isView(e)?`[${e}]`:JSON.stringify(e,(e,t)=>typeof t==`bigint`?`${t}`:t)}function WE(e){if(typeof e==`bigint`&&(e<-(2**53-1)||e>2**53-1))throw TypeError(`${e} is not safe to convert to a number.`);return Number(e)}function GE(e,t){return WE(e/t)+WE(e%t)/WE(t)}var KE={};hn(KE,{BN:()=>iD,bigNumToBigInt:()=>nD,bigNumToNumber:()=>eD,bigNumToString:()=>tD,isArrowBigNumSymbol:()=>qE});const qE=Symbol.for(`isArrowBigNum`);function JE(e,...t){return t.length===0?Object.setPrototypeOf(eE(this.TypedArray,e),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(e,...t),this.constructor.prototype)}JE.prototype[qE]=!0,JE.prototype.toJSON=function(){return`"${tD(this)}"`},JE.prototype.valueOf=function(e){return eD(this,e)},JE.prototype.toString=function(){return tD(this)},JE.prototype[Symbol.toPrimitive]=function(e=`default`){switch(e){case`number`:return eD(this);case`string`:return tD(this);case`default`:return nD(this)}return tD(this)};function YE(...e){return JE.apply(this,e)}function XE(...e){return JE.apply(this,e)}function ZE(...e){return JE.apply(this,e)}Object.setPrototypeOf(YE.prototype,Object.create(Int32Array.prototype)),Object.setPrototypeOf(XE.prototype,Object.create(Uint32Array.prototype)),Object.setPrototypeOf(ZE.prototype,Object.create(Uint32Array.prototype)),Object.assign(YE.prototype,JE.prototype,{constructor:YE,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array}),Object.assign(XE.prototype,JE.prototype,{constructor:XE,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array}),Object.assign(ZE.prototype,JE.prototype,{constructor:ZE,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});const QE=BigInt(4294967296)*BigInt(4294967296),$E=QE-BigInt(1);function eD(e,t){let{buffer:n,byteOffset:r,byteLength:i,signed:a}=e,o=new BigUint64Array(n,r,i/8),s=a&&o.at(-1)&BigInt(1)<0){let e=BigInt(`1`.padEnd(t+1,`0`)),n=c/e,r=s?-(c%e):c%e,i=WE(n),a=`${r}`.padStart(t,`0`),o=s&&i===0?`-`:``;return+`${o}${i}.${a}`}return WE(c)}function tD(e){if(e.byteLength===8){let t=new e.BigIntArray(e.buffer,e.byteOffset,1);return`${t[0]}`}if(!e.signed)return rD(e);let t=new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2),n=new Int16Array([t.at(-1)])[0];if(n>=0)return rD(e);t=t.slice();let r=1;for(let e=0;e(e.children=null,e.ArrayType=Array,e.OffsetArrayType=Int32Array,e[Symbol.toStringTag]=`DataType`))(DD.prototype);var OD=class extends DD{constructor(){super(J.Null)}toString(){return`Null`}};oD=Symbol.toStringTag,OD[oD]=(e=>e[Symbol.toStringTag]=`Null`)(OD.prototype);var kD=class extends DD{constructor(e,t){super(J.Int),this.isSigned=e,this.bitWidth=t}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:return this.isSigned?Int32Array:Uint32Array;case 64:return this.isSigned?BigInt64Array:BigUint64Array}throw Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?`I`:`Ui`}nt${this.bitWidth}`}};sD=Symbol.toStringTag,kD[sD]=(e=>(e.isSigned=null,e.bitWidth=null,e[Symbol.toStringTag]=`Int`))(kD.prototype);var AD=class extends kD{constructor(){super(!0,8)}get ArrayType(){return Int8Array}},jD=class extends kD{constructor(){super(!0,16)}get ArrayType(){return Int16Array}},MD=class extends kD{constructor(){super(!0,32)}get ArrayType(){return Int32Array}},ND=class extends kD{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}},PD=class extends kD{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}},FD=class extends kD{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}},ID=class extends kD{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}},LD=class extends kD{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}};Object.defineProperty(AD.prototype,`ArrayType`,{value:Int8Array}),Object.defineProperty(jD.prototype,`ArrayType`,{value:Int16Array}),Object.defineProperty(MD.prototype,`ArrayType`,{value:Int32Array}),Object.defineProperty(ND.prototype,`ArrayType`,{value:BigInt64Array}),Object.defineProperty(PD.prototype,`ArrayType`,{value:Uint8Array}),Object.defineProperty(FD.prototype,`ArrayType`,{value:Uint16Array}),Object.defineProperty(ID.prototype,`ArrayType`,{value:Uint32Array}),Object.defineProperty(LD.prototype,`ArrayType`,{value:BigUint64Array});var RD=class extends DD{constructor(e){super(J.Float),this.precision=e}get ArrayType(){switch(this.precision){case IE.HALF:return Uint16Array;case IE.SINGLE:return Float32Array;case IE.DOUBLE:return Float64Array}throw Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};cD=Symbol.toStringTag,RD[cD]=(e=>(e.precision=null,e[Symbol.toStringTag]=`Float`))(RD.prototype);var zD=class extends RD{constructor(){super(IE.HALF)}},BD=class extends RD{constructor(){super(IE.SINGLE)}},VD=class extends RD{constructor(){super(IE.DOUBLE)}};Object.defineProperty(zD.prototype,`ArrayType`,{value:Uint16Array}),Object.defineProperty(BD.prototype,`ArrayType`,{value:Float32Array}),Object.defineProperty(VD.prototype,`ArrayType`,{value:Float64Array});var HD=class extends DD{constructor(){super(J.Binary)}toString(){return`Binary`}};lD=Symbol.toStringTag,HD[lD]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`Binary`))(HD.prototype);var UD=class extends DD{constructor(){super(J.LargeBinary)}toString(){return`LargeBinary`}};uD=Symbol.toStringTag,UD[uD]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]=`LargeBinary`))(UD.prototype);var WD=class extends DD{constructor(){super(J.Utf8)}toString(){return`Utf8`}};dD=Symbol.toStringTag,WD[dD]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`Utf8`))(WD.prototype);var GD=class extends DD{constructor(){super(J.LargeUtf8)}toString(){return`LargeUtf8`}};fD=Symbol.toStringTag,GD[fD]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]=`LargeUtf8`))(GD.prototype);var KD=class extends DD{constructor(){super(J.Bool)}toString(){return`Bool`}};pD=Symbol.toStringTag,KD[pD]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`Bool`))(KD.prototype);var qD=class extends DD{constructor(e,t,n=128){super(J.Decimal),this.scale=e,this.precision=t,this.bitWidth=n}toString(){return`Decimal[${this.precision}e${this.scale>0?`+`:``}${this.scale}]`}};mD=Symbol.toStringTag,qD[mD]=(e=>(e.scale=null,e.precision=null,e.ArrayType=Uint32Array,e[Symbol.toStringTag]=`Decimal`))(qD.prototype);var JD=class extends DD{constructor(e){super(J.Date),this.unit=e}toString(){return`Date${(this.unit+1)*32}<${LE[this.unit]}>`}get ArrayType(){return this.unit===LE.DAY?Int32Array:BigInt64Array}};hD=Symbol.toStringTag,JD[hD]=(e=>(e.unit=null,e[Symbol.toStringTag]=`Date`))(JD.prototype);var YD=class extends DD{constructor(e,t){super(J.Time),this.unit=e,this.bitWidth=t}toString(){return`Time${this.bitWidth}<${RE[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}};gD=Symbol.toStringTag,YD[gD]=(e=>(e.unit=null,e.bitWidth=null,e[Symbol.toStringTag]=`Time`))(YD.prototype);var XD=class extends DD{constructor(e,t){super(J.Timestamp),this.unit=e,this.timezone=t}toString(){return`Timestamp<${RE[this.unit]}${this.timezone?`, ${this.timezone}`:``}>`}};_D=Symbol.toStringTag,XD[_D]=(e=>(e.unit=null,e.timezone=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]=`Timestamp`))(XD.prototype);var ZD=class extends DD{constructor(e){super(J.Interval),this.unit=e}toString(){return`Interval<${zE[this.unit]}>`}};vD=Symbol.toStringTag,ZD[vD]=(e=>(e.unit=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]=`Interval`))(ZD.prototype);var QD=class extends DD{constructor(e){super(J.Duration),this.unit=e}toString(){return`Duration<${RE[this.unit]}>`}};yD=Symbol.toStringTag,QD[yD]=(e=>(e.unit=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]=`Duration`))(QD.prototype);var $D=class extends DD{constructor(e){super(J.List),this.children=[e]}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};bD=Symbol.toStringTag,$D[bD]=(e=>(e.children=null,e[Symbol.toStringTag]=`List`))($D.prototype);var eO=class extends DD{constructor(e){super(J.Struct),this.children=e}toString(){return`Struct<{${this.children.map(e=>`${e.name}:${e.type}`).join(`, `)}}>`}};xD=Symbol.toStringTag,eO[xD]=(e=>(e.children=null,e[Symbol.toStringTag]=`Struct`))(eO.prototype);var tO=class extends DD{constructor(e,t,n){super(J.Union),this.mode=e,this.children=n,this.typeIds=t=Int32Array.from(t),this.typeIdToChildIndex=t.reduce((e,t,n)=>(e[t]=n)&&e||e,Object.create(null))}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(e=>`${e.type}`).join(` | `)}>`}};SD=Symbol.toStringTag,tO[SD]=(e=>(e.mode=null,e.typeIds=null,e.children=null,e.typeIdToChildIndex=null,e.ArrayType=Int8Array,e[Symbol.toStringTag]=`Union`))(tO.prototype);var nO=class extends DD{constructor(e){super(J.FixedSizeBinary),this.byteWidth=e}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};CD=Symbol.toStringTag,nO[CD]=(e=>(e.byteWidth=null,e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`FixedSizeBinary`))(nO.prototype);var rO=class extends DD{constructor(e,t){super(J.FixedSizeList),this.listSize=e,this.children=[t]}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}};wD=Symbol.toStringTag,rO[wD]=(e=>(e.children=null,e.listSize=null,e[Symbol.toStringTag]=`FixedSizeList`))(rO.prototype);var iO=class extends DD{constructor(e,t=!1){var n,r,i;if(super(J.Map),this.children=[e],this.keysSorted=t,e&&(e.name=`entries`,(n=e?.type)?.children)){let t=(r=e?.type)?.children[0];t&&(t.name=`key`);let n=(i=e?.type)?.children[1];n&&(n.name=`value`)}}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}get childType(){return this.children[0].type}toString(){return`Map<{${this.children[0].type.children.map(e=>`${e.name}:${e.type}`).join(`, `)}}>`}};TD=Symbol.toStringTag,iO[TD]=(e=>(e.children=null,e.keysSorted=null,e[Symbol.toStringTag]=`Map_`))(iO.prototype);const aO=(e=>()=>++e)(-1);var oO=class extends DD{constructor(e,t,n,r){super(J.Dictionary),this.indices=t,this.dictionary=e,this.isOrdered=r||!1,this.id=n==null?aO():WE(n)}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}};ED=Symbol.toStringTag,oO[ED]=(e=>(e.id=null,e.indices=null,e.isOrdered=null,e.dictionary=null,e[Symbol.toStringTag]=`Dictionary`))(oO.prototype);function sO(e){let t=e;switch(e.typeId){case J.Decimal:return e.bitWidth/32;case J.Interval:return t.unit===zE.MONTH_DAY_NANO?4:1+t.unit;case J.FixedSizeList:return t.listSize;case J.FixedSizeBinary:return t.byteWidth;default:return 1}}var cO=class{visitMany(e,...t){return e.map((e,n)=>this.visit(e,...t.map(e=>e[n])))}visit(...e){return this.getVisitFn(e[0],!1).apply(this,e)}getVisitFn(e,t=!0){return lO(this,e,t)}getVisitFnByTypeId(e,t=!0){return uO(this,e,t)}visitNull(e,...t){return null}visitBool(e,...t){return null}visitInt(e,...t){return null}visitFloat(e,...t){return null}visitUtf8(e,...t){return null}visitLargeUtf8(e,...t){return null}visitBinary(e,...t){return null}visitLargeBinary(e,...t){return null}visitFixedSizeBinary(e,...t){return null}visitDate(e,...t){return null}visitTimestamp(e,...t){return null}visitTime(e,...t){return null}visitDecimal(e,...t){return null}visitList(e,...t){return null}visitStruct(e,...t){return null}visitUnion(e,...t){return null}visitDictionary(e,...t){return null}visitInterval(e,...t){return null}visitDuration(e,...t){return null}visitFixedSizeList(e,...t){return null}visitMap(e,...t){return null}};function lO(e,t,n=!0){return typeof t==`number`?uO(e,t,n):typeof t==`string`&&t in J?uO(e,J[t],n):t&&t instanceof DD?uO(e,dO(t),n):t?.type&&t.type instanceof DD?uO(e,dO(t.type),n):uO(e,J.NONE,n)}function uO(e,t,n=!0){let r=null;switch(t){case J.Null:r=e.visitNull;break;case J.Bool:r=e.visitBool;break;case J.Int:r=e.visitInt;break;case J.Int8:r=e.visitInt8||e.visitInt;break;case J.Int16:r=e.visitInt16||e.visitInt;break;case J.Int32:r=e.visitInt32||e.visitInt;break;case J.Int64:r=e.visitInt64||e.visitInt;break;case J.Uint8:r=e.visitUint8||e.visitInt;break;case J.Uint16:r=e.visitUint16||e.visitInt;break;case J.Uint32:r=e.visitUint32||e.visitInt;break;case J.Uint64:r=e.visitUint64||e.visitInt;break;case J.Float:r=e.visitFloat;break;case J.Float16:r=e.visitFloat16||e.visitFloat;break;case J.Float32:r=e.visitFloat32||e.visitFloat;break;case J.Float64:r=e.visitFloat64||e.visitFloat;break;case J.Utf8:r=e.visitUtf8;break;case J.LargeUtf8:r=e.visitLargeUtf8;break;case J.Binary:r=e.visitBinary;break;case J.LargeBinary:r=e.visitLargeBinary;break;case J.FixedSizeBinary:r=e.visitFixedSizeBinary;break;case J.Date:r=e.visitDate;break;case J.DateDay:r=e.visitDateDay||e.visitDate;break;case J.DateMillisecond:r=e.visitDateMillisecond||e.visitDate;break;case J.Timestamp:r=e.visitTimestamp;break;case J.TimestampSecond:r=e.visitTimestampSecond||e.visitTimestamp;break;case J.TimestampMillisecond:r=e.visitTimestampMillisecond||e.visitTimestamp;break;case J.TimestampMicrosecond:r=e.visitTimestampMicrosecond||e.visitTimestamp;break;case J.TimestampNanosecond:r=e.visitTimestampNanosecond||e.visitTimestamp;break;case J.Time:r=e.visitTime;break;case J.TimeSecond:r=e.visitTimeSecond||e.visitTime;break;case J.TimeMillisecond:r=e.visitTimeMillisecond||e.visitTime;break;case J.TimeMicrosecond:r=e.visitTimeMicrosecond||e.visitTime;break;case J.TimeNanosecond:r=e.visitTimeNanosecond||e.visitTime;break;case J.Decimal:r=e.visitDecimal;break;case J.List:r=e.visitList;break;case J.Struct:r=e.visitStruct;break;case J.Union:r=e.visitUnion;break;case J.DenseUnion:r=e.visitDenseUnion||e.visitUnion;break;case J.SparseUnion:r=e.visitSparseUnion||e.visitUnion;break;case J.Dictionary:r=e.visitDictionary;break;case J.Interval:r=e.visitInterval;break;case J.IntervalDayTime:r=e.visitIntervalDayTime||e.visitInterval;break;case J.IntervalYearMonth:r=e.visitIntervalYearMonth||e.visitInterval;break;case J.IntervalMonthDayNano:r=e.visitIntervalMonthDayNano||e.visitInterval;break;case J.Duration:r=e.visitDuration;break;case J.DurationSecond:r=e.visitDurationSecond||e.visitDuration;break;case J.DurationMillisecond:r=e.visitDurationMillisecond||e.visitDuration;break;case J.DurationMicrosecond:r=e.visitDurationMicrosecond||e.visitDuration;break;case J.DurationNanosecond:r=e.visitDurationNanosecond||e.visitDuration;break;case J.FixedSizeList:r=e.visitFixedSizeList;break;case J.Map:r=e.visitMap;break}if(typeof r==`function`)return r;if(!n)return()=>null;throw Error(`Unrecognized type '${J[t]}'`)}function dO(e){switch(e.typeId){case J.Null:return J.Null;case J.Int:{let{bitWidth:t,isSigned:n}=e;switch(t){case 8:return n?J.Int8:J.Uint8;case 16:return n?J.Int16:J.Uint16;case 32:return n?J.Int32:J.Uint32;case 64:return n?J.Int64:J.Uint64}return J.Int}case J.Float:switch(e.precision){case IE.HALF:return J.Float16;case IE.SINGLE:return J.Float32;case IE.DOUBLE:return J.Float64}return J.Float;case J.Binary:return J.Binary;case J.LargeBinary:return J.LargeBinary;case J.Utf8:return J.Utf8;case J.LargeUtf8:return J.LargeUtf8;case J.Bool:return J.Bool;case J.Decimal:return J.Decimal;case J.Time:switch(e.unit){case RE.SECOND:return J.TimeSecond;case RE.MILLISECOND:return J.TimeMillisecond;case RE.MICROSECOND:return J.TimeMicrosecond;case RE.NANOSECOND:return J.TimeNanosecond}return J.Time;case J.Timestamp:switch(e.unit){case RE.SECOND:return J.TimestampSecond;case RE.MILLISECOND:return J.TimestampMillisecond;case RE.MICROSECOND:return J.TimestampMicrosecond;case RE.NANOSECOND:return J.TimestampNanosecond}return J.Timestamp;case J.Date:switch(e.unit){case LE.DAY:return J.DateDay;case LE.MILLISECOND:return J.DateMillisecond}return J.Date;case J.Interval:switch(e.unit){case zE.DAY_TIME:return J.IntervalDayTime;case zE.YEAR_MONTH:return J.IntervalYearMonth;case zE.MONTH_DAY_NANO:return J.IntervalMonthDayNano}return J.Interval;case J.Duration:switch(e.unit){case RE.SECOND:return J.DurationSecond;case RE.MILLISECOND:return J.DurationMillisecond;case RE.MICROSECOND:return J.DurationMicrosecond;case RE.NANOSECOND:return J.DurationNanosecond}return J.Duration;case J.Map:return J.Map;case J.List:return J.List;case J.Struct:return J.Struct;case J.Union:switch(e.mode){case FE.Dense:return J.DenseUnion;case FE.Sparse:return J.SparseUnion}return J.Union;case J.FixedSizeBinary:return J.FixedSizeBinary;case J.FixedSizeList:return J.FixedSizeList;case J.Dictionary:return J.Dictionary}throw Error(`Unrecognized type '${J[e.typeId]}'`)}cO.prototype.visitInt8=null,cO.prototype.visitInt16=null,cO.prototype.visitInt32=null,cO.prototype.visitInt64=null,cO.prototype.visitUint8=null,cO.prototype.visitUint16=null,cO.prototype.visitUint32=null,cO.prototype.visitUint64=null,cO.prototype.visitFloat16=null,cO.prototype.visitFloat32=null,cO.prototype.visitFloat64=null,cO.prototype.visitDateDay=null,cO.prototype.visitDateMillisecond=null,cO.prototype.visitTimestampSecond=null,cO.prototype.visitTimestampMillisecond=null,cO.prototype.visitTimestampMicrosecond=null,cO.prototype.visitTimestampNanosecond=null,cO.prototype.visitTimeSecond=null,cO.prototype.visitTimeMillisecond=null,cO.prototype.visitTimeMicrosecond=null,cO.prototype.visitTimeNanosecond=null,cO.prototype.visitDenseUnion=null,cO.prototype.visitSparseUnion=null,cO.prototype.visitIntervalDayTime=null,cO.prototype.visitIntervalYearMonth=null,cO.prototype.visitIntervalMonthDayNano=null,cO.prototype.visitDuration=null,cO.prototype.visitDurationSecond=null,cO.prototype.visitDurationMillisecond=null,cO.prototype.visitDurationMicrosecond=null,cO.prototype.visitDurationNanosecond=null;var fO={};hn(fO,{float64ToUint16:()=>gO,uint16ToFloat64:()=>hO});const pO=new Float64Array(1),mO=new Uint32Array(pO.buffer);function hO(e){let t=(e&31744)>>10,n=(e&1023)/1024,r=(-1)**((e&32768)>>15);switch(t){case 31:return r*(n?NaN:1/0);case 0:return r*(n?6103515625e-14*n:0)}return r*2**(t-15)*(1+n)}function gO(e){if(e!==e)return 32256;pO[0]=e;let t=(mO[1]&2147483648)>>16&65535,n=mO[1]&2146435072,r=0;return n>=1089470464?mO[0]>0?n=31744:(n=(n&2080374784)>>16,r=(mO[1]&1048575)>>10):n<=1056964608?(r=1048576+(mO[1]&1048575),r=1048576+(r<<(n>>20)-998)>>21,n=0):(n=n-1056964608>>10,r=(mO[1]&1048575)+512>>10),t|n|r&65535}var _O=class extends cO{};function vO(e){return(t,n,r)=>{if(t.setValid(n,r!=null))return e(t,n,r)}}const yO=(e,t,n)=>{e[t]=Math.floor(n/864e5)},bO=(e,t,n,r)=>{if(n+1{let i=e+n;r?t[i>>3]|=1<>3]&=~(1<{e[t]=n},CO=({values:e},t,n)=>{e[t]=n},wO=({values:e},t,n)=>{e[t]=gO(n)},TO=(e,t,n)=>{switch(e.type.precision){case IE.HALF:return wO(e,t,n);case IE.SINGLE:case IE.DOUBLE:return CO(e,t,n)}},EO=({values:e},t,n)=>{yO(e,t,n.valueOf())},DO=({values:e},t,n)=>{e[t]=BigInt(n)},OO=({stride:e,values:t},n,r)=>{t.set(r.subarray(0,e),e*n)},kO=({values:e,valueOffsets:t},n,r)=>bO(e,t,n,r),AO=({values:e,valueOffsets:t},n,r)=>bO(e,t,n,VT(r)),jO=(e,t,n)=>{e.type.unit===LE.DAY?EO(e,t,n):DO(e,t,n)},MO=({values:e},t,n)=>{e[t]=BigInt(n/1e3)},NO=({values:e},t,n)=>{e[t]=BigInt(n)},PO=({values:e},t,n)=>{e[t]=BigInt(n*1e3)},FO=({values:e},t,n)=>{e[t]=BigInt(n*1e6)},IO=(e,t,n)=>{switch(e.type.unit){case RE.SECOND:return MO(e,t,n);case RE.MILLISECOND:return NO(e,t,n);case RE.MICROSECOND:return PO(e,t,n);case RE.NANOSECOND:return FO(e,t,n)}},LO=({values:e},t,n)=>{e[t]=n},RO=({values:e},t,n)=>{e[t]=n},zO=({values:e},t,n)=>{e[t]=n},BO=({values:e},t,n)=>{e[t]=n},VO=(e,t,n)=>{switch(e.type.unit){case RE.SECOND:return LO(e,t,n);case RE.MILLISECOND:return RO(e,t,n);case RE.MICROSECOND:return zO(e,t,n);case RE.NANOSECOND:return BO(e,t,n)}},HO=({values:e,stride:t},n,r)=>{e.set(r.subarray(0,t),t*n)},UO=(e,t,n)=>{let r=e.children[0],i=e.valueOffsets,a=uk.getVisitFn(r);if(Array.isArray(n))for(let e=-1,o=i[t],s=i[t+1];o{let r=e.children[0],{valueOffsets:i}=e,a=uk.getVisitFn(r),{[t]:o,[t+1]:s}=i,c=n instanceof Map?n.entries():Object.entries(n);for(let e of c)if(a(r,o,e),++o>=s)break},GO=(e,t)=>(n,r,i,a)=>r&&n(r,e,t[a]),KO=(e,t)=>(n,r,i,a)=>r&&n(r,e,t.get(a)),qO=(e,t)=>(n,r,i,a)=>r&&n(r,e,t.get(i.name)),JO=(e,t)=>(n,r,i,a)=>r&&n(r,e,t[i.name]),YO=(e,t,n)=>{let r=e.type.children.map(e=>uk.getVisitFn(e.type)),i=n instanceof Map?qO(t,n):n instanceof pj?KO(t,n):Array.isArray(n)?GO(t,n):JO(t,n);e.type.children.forEach((t,n)=>i(r[n],e.children[n],t,n))},XO=(e,t,n)=>{e.type.mode===FE.Dense?ZO(e,t,n):QO(e,t,n)},ZO=(e,t,n)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[r];uk.visit(i,e.valueOffsets[t],n)},QO=(e,t,n)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[r];uk.visit(i,t,n)},$O=(e,t,n)=>{var r;(r=e.dictionary)==null||r.set(e.values[t],n)},ek=(e,t,n)=>{switch(e.type.unit){case zE.YEAR_MONTH:return nk(e,t,n);case zE.DAY_TIME:return tk(e,t,n);case zE.MONTH_DAY_NANO:return rk(e,t,n)}},tk=({values:e},t,n)=>{e.set(n.subarray(0,2),2*t)},nk=({values:e},t,n)=>{e[t]=n[0]*12+n[1]%12},rk=({values:e,stride:t},n,r)=>{e.set(r.subarray(0,t),t*n)},ik=({values:e},t,n)=>{e[t]=n},ak=({values:e},t,n)=>{e[t]=n},ok=({values:e},t,n)=>{e[t]=n},sk=({values:e},t,n)=>{e[t]=n},ck=(e,t,n)=>{switch(e.type.unit){case RE.SECOND:return ik(e,t,n);case RE.MILLISECOND:return ak(e,t,n);case RE.MICROSECOND:return ok(e,t,n);case RE.NANOSECOND:return sk(e,t,n)}},lk=(e,t,n)=>{let{stride:r}=e,i=e.children[0],a=uk.getVisitFn(i);if(Array.isArray(n))for(let e=-1,o=t*r;++e`${UE(e)}: ${UE(t)}`).join(`, `)}}`}[Symbol.for(`nodejs.util.inspect.custom`)](){return this.toString()}[Symbol.iterator](){return new mk(this[dk],this[fk])}},mk=class{constructor(e,t){this.childIndex=0,this.children=e.children,this.rowIndex=t,this.childFields=e.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){let e=this.childIndex;return ee.name)}has(e,t){return e[dk].type.children.some(e=>e.name===t)}getOwnPropertyDescriptor(e,t){if(e[dk].type.children.some(e=>e.name===t))return{writable:!0,enumerable:!0,configurable:!0}}get(e,t){if(Reflect.has(e,t))return e[t];let n=e[dk].type.children.findIndex(e=>e.name===t);if(n!==-1){let r=cA.visit(e[dk].children[n],e[fk]);return Reflect.set(e,t,r),r}}set(e,t,n){let r=e[dk].type.children.findIndex(e=>e.name===t);return r===-1?Reflect.has(e,t)||typeof t==`symbol`?Reflect.set(e,t,n):!1:(uk.visit(e[dk].children[r],e[fk],n),Reflect.set(e,t,n))}};const gk=new hk;var _k=class extends cO{};function vk(e){return(t,n)=>t.getValid(n)?e(t,n):null}const yk=(e,t)=>864e5*e[t],bk=(e,t)=>null,xk=(e,t,n)=>{if(n+1>=t.length)return null;let r=WE(t[n]),i=WE(t[n+1]);return e.subarray(r,i)},Sk=({offset:e,values:t},n)=>{let r=e+n,i=t[r>>3];return(i&1<yk(e,t),wk=({values:e},t)=>WE(e[t]),Tk=({stride:e,values:t},n)=>t[e*n],Ek=({stride:e,values:t},n)=>hO(t[e*n]),Dk=({values:e},t)=>e[t],Ok=({stride:e,values:t},n)=>t.subarray(e*n,e*(n+1)),kk=({values:e,valueOffsets:t},n)=>xk(e,t,n),Ak=({values:e,valueOffsets:t},n)=>{let r=xk(e,t,n);return r===null?null:zT(r)},jk=({values:e},t)=>e[t],Mk=({type:e,values:t},n)=>e.precision===IE.HALF?hO(t[n]):t[n],Nk=(e,t)=>e.type.unit===LE.DAY?Ck(e,t):wk(e,t),Pk=({values:e},t)=>1e3*WE(e[t]),Fk=({values:e},t)=>WE(e[t]),Ik=({values:e},t)=>GE(e[t],BigInt(1e3)),Lk=({values:e},t)=>GE(e[t],BigInt(1e6)),Rk=(e,t)=>{switch(e.type.unit){case RE.SECOND:return Pk(e,t);case RE.MILLISECOND:return Fk(e,t);case RE.MICROSECOND:return Ik(e,t);case RE.NANOSECOND:return Lk(e,t)}},zk=({values:e},t)=>e[t],Bk=({values:e},t)=>e[t],Vk=({values:e},t)=>e[t],Hk=({values:e},t)=>e[t],Uk=(e,t)=>{switch(e.type.unit){case RE.SECOND:return zk(e,t);case RE.MILLISECOND:return Bk(e,t);case RE.MICROSECOND:return Vk(e,t);case RE.NANOSECOND:return Hk(e,t)}},Wk=({values:e,stride:t},n)=>iD.decimal(e.subarray(t*n,t*(n+1))),Gk=(e,t)=>{let{valueOffsets:n,stride:r,children:i}=e,{[t*r]:a,[t*r+1]:o}=n,s=i[0],c=s.slice(a,o-a);return new pj([c])},Kk=(e,t)=>{let{valueOffsets:n,children:r}=e,{[t]:i,[t+1]:a}=n,o=r[0];return new pA(o.slice(i,a-i))},qk=(e,t)=>new pk(e,t),Jk=(e,t)=>e.type.mode===FE.Dense?Yk(e,t):Xk(e,t),Yk=(e,t)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],r=e.children[n];return cA.visit(r,e.valueOffsets[t])},Xk=(e,t)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],r=e.children[n];return cA.visit(r,t)},Zk=(e,t)=>{var n;return(n=e.dictionary)?.get(e.values[t])},Qk=(e,t)=>e.type.unit===zE.MONTH_DAY_NANO?tA(e,t):e.type.unit===zE.DAY_TIME?$k(e,t):eA(e,t),$k=({values:e},t)=>e.subarray(2*t,2*(t+1)),eA=({values:e},t)=>{let n=e[t],r=new Int32Array(2);return r[0]=Math.trunc(n/12),r[1]=Math.trunc(n%12),r},tA=({values:e},t)=>e.subarray(4*t,4*(t+1)),nA=({values:e},t)=>e[t],rA=({values:e},t)=>e[t],iA=({values:e},t)=>e[t],aA=({values:e},t)=>e[t],oA=(e,t)=>{switch(e.type.unit){case RE.SECOND:return nA(e,t);case RE.MILLISECOND:return rA(e,t);case RE.MICROSECOND:return iA(e,t);case RE.NANOSECOND:return aA(e,t)}},sA=(e,t)=>{let{stride:n,children:r}=e,i=r[0],a=i.slice(t*n,n);return new pj([a])};_k.prototype.visitNull=vk(bk),_k.prototype.visitBool=vk(Sk),_k.prototype.visitInt=vk(jk),_k.prototype.visitInt8=vk(Tk),_k.prototype.visitInt16=vk(Tk),_k.prototype.visitInt32=vk(Tk),_k.prototype.visitInt64=vk(Dk),_k.prototype.visitUint8=vk(Tk),_k.prototype.visitUint16=vk(Tk),_k.prototype.visitUint32=vk(Tk),_k.prototype.visitUint64=vk(Dk),_k.prototype.visitFloat=vk(Mk),_k.prototype.visitFloat16=vk(Ek),_k.prototype.visitFloat32=vk(Tk),_k.prototype.visitFloat64=vk(Tk),_k.prototype.visitUtf8=vk(Ak),_k.prototype.visitLargeUtf8=vk(Ak),_k.prototype.visitBinary=vk(kk),_k.prototype.visitLargeBinary=vk(kk),_k.prototype.visitFixedSizeBinary=vk(Ok),_k.prototype.visitDate=vk(Nk),_k.prototype.visitDateDay=vk(Ck),_k.prototype.visitDateMillisecond=vk(wk),_k.prototype.visitTimestamp=vk(Rk),_k.prototype.visitTimestampSecond=vk(Pk),_k.prototype.visitTimestampMillisecond=vk(Fk),_k.prototype.visitTimestampMicrosecond=vk(Ik),_k.prototype.visitTimestampNanosecond=vk(Lk),_k.prototype.visitTime=vk(Uk),_k.prototype.visitTimeSecond=vk(zk),_k.prototype.visitTimeMillisecond=vk(Bk),_k.prototype.visitTimeMicrosecond=vk(Vk),_k.prototype.visitTimeNanosecond=vk(Hk),_k.prototype.visitDecimal=vk(Wk),_k.prototype.visitList=vk(Gk),_k.prototype.visitStruct=vk(qk),_k.prototype.visitUnion=vk(Jk),_k.prototype.visitDenseUnion=vk(Yk),_k.prototype.visitSparseUnion=vk(Xk),_k.prototype.visitDictionary=vk(Zk),_k.prototype.visitInterval=vk(Qk),_k.prototype.visitIntervalDayTime=vk($k),_k.prototype.visitIntervalYearMonth=vk(eA),_k.prototype.visitIntervalMonthDayNano=vk(tA),_k.prototype.visitDuration=vk(oA),_k.prototype.visitDurationSecond=vk(nA),_k.prototype.visitDurationMillisecond=vk(rA),_k.prototype.visitDurationMicrosecond=vk(iA),_k.prototype.visitDurationNanosecond=vk(aA),_k.prototype.visitFixedSizeList=vk(sA),_k.prototype.visitMap=vk(Kk);const cA=new _k,lA=Symbol.for(`keys`),uA=Symbol.for(`vals`),dA=Symbol.for(`kKeysAsStrings`),fA=Symbol.for(`_kKeysAsStrings`);var pA=class{constructor(e){return this[lA]=new pj([e.children[0]]).memoize(),this[uA]=e.children[1],new Proxy(this,new hA)}get[dA](){return this[fA]||(this[fA]=Array.from(this[lA].toArray(),String))}[Symbol.iterator](){return new mA(this[lA],this[uA])}get size(){return this[lA].length}toArray(){return Object.values(this.toJSON())}toJSON(){let e=this[lA],t=this[uA],n={};for(let r=-1,i=e.length;++r`${UE(e)}: ${UE(t)}`).join(`, `)}}`}[Symbol.for(`nodejs.util.inspect.custom`)](){return this.toString()}},mA=class{constructor(e,t){this.keys=e,this.vals=t,this.keyIndex=0,this.numKeys=e.length}[Symbol.iterator](){return this}next(){let e=this.keyIndex;return e===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(e),cA.visit(this.vals,e)]})}},hA=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(e){return e[dA]}has(e,t){return e[dA].includes(t)}getOwnPropertyDescriptor(e,t){let n=e[dA].indexOf(t);if(n!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(e,t){if(Reflect.has(e,t))return e[t];let n=e[dA].indexOf(t);if(n!==-1){let r=cA.visit(Reflect.get(e,uA),n);return Reflect.set(e,t,r),r}}set(e,t,n){let r=e[dA].indexOf(t);return r===-1?Reflect.has(e,t)?Reflect.set(e,t,n):!1:(uk.visit(Reflect.get(e,uA),r,n),Reflect.set(e,t,n))}};Object.defineProperties(pA.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:`Row`},[lA]:{writable:!0,enumerable:!1,configurable:!1,value:null},[uA]:{writable:!0,enumerable:!1,configurable:!1,value:null},[fA]:{writable:!0,enumerable:!1,configurable:!1,value:null}});var gA={};hn(gA,{clampRange:()=>vA,createElementComparator:()=>xA,wrapIndex:()=>yA});let _A;function vA(e,t,n,r){let{length:i=0}=e,a=typeof t==`number`?t:0,o=typeof n==`number`?n:i;return a<0&&(a=(a%i+i)%i),o<0&&(o=(o%i+i)%i),oi&&(o=i),r?r(e,a,o):[a,o]}const yA=(e,t)=>e<0?t+e:e,bA=e=>e!==e;function xA(e){let t=typeof e;if(t!==`object`||e===null)return bA(e)?bA:t=>t===e;if(e instanceof Date){let t=e.valueOf();return e=>e instanceof Date?e.valueOf()===t:!1}return ArrayBuffer.isView(e)?t=>t?PE(e,t):!1:e instanceof Map?CA(e):Array.isArray(e)?SA(e):e instanceof pj?wA(e):TA(e,!0)}function SA(e){let t=[];for(let n=-1,r=e.length;++n!1;let r=[];for(let t=-1,i=n.length;++t{if(!n||typeof n!=`object`)return!1;switch(n.constructor){case Array:return DA(e,n);case Map:return kA(e,n,n.keys());case pA:case pk:case Object:case void 0:return kA(e,n,t||Object.keys(n))}return n instanceof pj?OA(e,n):!1}}function DA(e,t){let n=e.length;if(t.length!==n)return!1;for(let r=-1;++rIA,getBit:()=>MA,getBool:()=>jA,packBools:()=>FA,popcnt_array:()=>RA,popcnt_bit_range:()=>LA,popcnt_uint32:()=>zA,setBool:()=>NA,truncateBitmap:()=>PA});function jA(e,t,n,r){return(n&1<>r}function NA(e,t,n){return n?!!(e[t>>3]|=1<>3]&=~(1<0||n.byteLength>3):FA(new IA(n,e,t,null,jA)).subarray(0,r)),i}return n}function FA(e){let t=[],n=0,r=0,i=0;for(let a of e)a&&(i|=1<0)&&(t[n++]=i);let a=new Uint8Array(t.length+7&-8);return a.set(t),a}var IA=class{constructor(e,t,n,r,i){this.bytes=e,this.length=n,this.context=r,this.get=i,this.bit=t%8,this.byteIndex=t>>3,this.byte=e[this.byteIndex++],this.index=0}next(){return this.index>3<<3,i=t+(t%8==0?0:8-t%8);return LA(e,t,i)+LA(e,r,n)+RA(e,i>>3,r-i>>3)}function RA(e,t,n){let r=0,i=Math.trunc(t),a=new DataView(e.buffer,e.byteOffset,e.byteLength),o=n===void 0?e.byteLength:i+n;for(;o-i>=4;)r+=zA(a.getUint32(i)),i+=4;for(;o-i>=2;)r+=zA(a.getUint16(i)),i+=2;for(;o-i>=1;)r+=zA(a.getUint8(i)),i+=1;return r}function zA(e){let t=Math.trunc(e);return t-=t>>>1&1431655765,t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}const BA=-1;var VA=class e{get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get nullable(){if(this._nullCount!==0){let{type:e}=this;return DD.isSparseUnion(e)||DD.isDenseUnion(e)?this.children.some(e=>e.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let e=0,{valueOffsets:t,values:n,nullBitmap:r,typeIds:i}=this;return t&&(e+=t.byteLength),n&&(e+=n.byteLength),r&&(e+=r.byteLength),i&&(e+=i.byteLength),this.children.reduce((e,t)=>e+t.byteLength,e)}get nullCount(){if(DD.isUnion(this.type))return this.children.reduce((e,t)=>e+t.nullCount,0);let e=this._nullCount,t;return e<=BA&&(t=this.nullBitmap)&&(this._nullCount=e=t.length===0?0:this.length-LA(t,this.offset,this.offset+this.length)),e}constructor(t,n,r,i,a,o=[],s){this.type=t,this.children=o,this.dictionary=s,this.offset=Math.floor(Math.max(n||0,0)),this.length=Math.floor(Math.max(r||0,0)),this._nullCount=Math.floor(Math.max(i||0,-1));let c;a instanceof e?(this.stride=a.stride,this.values=a.values,this.typeIds=a.typeIds,this.nullBitmap=a.nullBitmap,this.valueOffsets=a.valueOffsets):(this.stride=sO(t),a&&((c=a[0])&&(this.valueOffsets=c),(c=a[1])&&(this.values=c),(c=a[2])&&(this.nullBitmap=c),(c=a[3])&&(this.typeIds=c)))}getValid(e){let{type:t}=this;if(DD.isUnion(t)){let n=t,r=this.children[n.typeIdToChildIndex[this.typeIds[e]]],i=n.mode===FE.Dense?this.valueOffsets[e]:e;return r.getValid(i)}if(this.nullable&&this.nullCount>0){let t=this.offset+e,n=this.nullBitmap[t>>3];return(n&1<>3;(!r||r.byteLength<=c)&&(r=new Uint8Array((i+a+63&-64)>>3).fill(255),this.nullCount>0?(r.set(PA(i,a,this.nullBitmap),0),Object.assign(this,{nullBitmap:r})):Object.assign(this,{nullBitmap:r,_nullCount:0}));let l=r[c];n=(l&s)!==0,r[c]=t?l|s:l&~s}return n!==!!t&&(this._nullCount=this.nullCount+(t?-1:1)),t}clone(t=this.type,n=this.offset,r=this.length,i=this._nullCount,a=this,o=this.children){return new e(t,n,r,i,a,o,this.dictionary)}slice(e,t){let{stride:n,typeId:r,children:i}=this,a=(this._nullCount===0)-1,o=r===16?n:1,s=this._sliceBuffers(e,t,n,r);return this.clone(this.type,this.offset+e,t,a,s,i.length===0||this.valueOffsets?i:this._sliceChildren(i,o*e,o*t))}_changeLengthAndBackfillNullBitmap(e){if(this.typeId===J.Null)return this.clone(this.type,0,e,0);let{length:t,nullCount:n}=this,r=new Uint8Array((e+63&-64)>>3).fill(255,0,t>>3);r[t>>3]=(1<0&&r.set(PA(this.offset,t,this.nullBitmap),0);let i=this.buffers;return i[BE.VALIDITY]=r,this.clone(this.type,0,e,n+(e-t),i)}_sliceBuffers(e,t,n,r){let i,{buffers:a}=this;return(i=a[BE.TYPE])&&(a[BE.TYPE]=i.subarray(e,e+t)),(i=a[BE.OFFSET])&&(a[BE.OFFSET]=i.subarray(e,e+t+1))||(i=a[BE.DATA])&&(a[BE.DATA]=r===6?i:i.subarray(n*e,n*(e+t))),a}_sliceChildren(e,t,n){return e.map(e=>e.slice(t,n))}};VA.prototype.children=Object.freeze([]);var HA=class e extends cO{visit(e){return this.getVisitFn(e.type).call(this,e)}visitNull(e){let{type:t,offset:n=0,length:r=0}=e;return new VA(t,n,r,r)}visitBool(e){let{type:t,offset:n=0}=e,r=aE(e.nullBitmap),i=eE(t.ArrayType,e.data),{length:a=i.length>>3,nullCount:o=e.nullBitmap?-1:0}=e;return new VA(t,n,a,o,[void 0,i,r])}visitInt(e){let{type:t,offset:n=0}=e,r=aE(e.nullBitmap),i=eE(t.ArrayType,e.data),{length:a=i.length,nullCount:o=e.nullBitmap?-1:0}=e;return new VA(t,n,a,o,[void 0,i,r])}visitFloat(e){let{type:t,offset:n=0}=e,r=aE(e.nullBitmap),i=eE(t.ArrayType,e.data),{length:a=i.length,nullCount:o=e.nullBitmap?-1:0}=e;return new VA(t,n,a,o,[void 0,i,r])}visitUtf8(e){let{type:t,offset:n=0}=e,r=aE(e.data),i=aE(e.nullBitmap),a=rE(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new VA(t,n,o,s,[a,r,i])}visitLargeUtf8(e){let{type:t,offset:n=0}=e,r=aE(e.data),i=aE(e.nullBitmap),a=iE(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new VA(t,n,o,s,[a,r,i])}visitBinary(e){let{type:t,offset:n=0}=e,r=aE(e.data),i=aE(e.nullBitmap),a=rE(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new VA(t,n,o,s,[a,r,i])}visitLargeBinary(e){let{type:t,offset:n=0}=e,r=aE(e.data),i=aE(e.nullBitmap),a=iE(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new VA(t,n,o,s,[a,r,i])}visitFixedSizeBinary(e){let{type:t,offset:n=0}=e,r=aE(e.nullBitmap),i=eE(t.ArrayType,e.data),{length:a=i.length/sO(t),nullCount:o=e.nullBitmap?-1:0}=e;return new VA(t,n,a,o,[void 0,i,r])}visitDate(e){let{type:t,offset:n=0}=e,r=aE(e.nullBitmap),i=eE(t.ArrayType,e.data),{length:a=i.length/sO(t),nullCount:o=e.nullBitmap?-1:0}=e;return new VA(t,n,a,o,[void 0,i,r])}visitTimestamp(e){let{type:t,offset:n=0}=e,r=aE(e.nullBitmap),i=eE(t.ArrayType,e.data),{length:a=i.length/sO(t),nullCount:o=e.nullBitmap?-1:0}=e;return new VA(t,n,a,o,[void 0,i,r])}visitTime(e){let{type:t,offset:n=0}=e,r=aE(e.nullBitmap),i=eE(t.ArrayType,e.data),{length:a=i.length/sO(t),nullCount:o=e.nullBitmap?-1:0}=e;return new VA(t,n,a,o,[void 0,i,r])}visitDecimal(e){let{type:t,offset:n=0}=e,r=aE(e.nullBitmap),i=eE(t.ArrayType,e.data),{length:a=i.length/sO(t),nullCount:o=e.nullBitmap?-1:0}=e;return new VA(t,n,a,o,[void 0,i,r])}visitList(e){let{type:t,offset:n=0,child:r}=e,i=aE(e.nullBitmap),a=rE(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new VA(t,n,o,s,[a,void 0,i],[r])}visitStruct(e){let{type:t,offset:n=0,children:r=[]}=e,i=aE(e.nullBitmap),{length:a=r.reduce((e,{length:t})=>Math.max(e,t),0),nullCount:o=e.nullBitmap?-1:0}=e;return new VA(t,n,a,o,[void 0,void 0,i],r)}visitUnion(e){let{type:t,offset:n=0,children:r=[]}=e,i=eE(t.ArrayType,e.typeIds),{length:a=i.length,nullCount:o=-1}=e;if(DD.isSparseUnion(t))return new VA(t,n,a,o,[void 0,void 0,void 0,i],r);let s=rE(e.valueOffsets);return new VA(t,n,a,o,[s,void 0,void 0,i],r)}visitDictionary(t){let{type:n,offset:r=0}=t,i=aE(t.nullBitmap),a=eE(n.indices.ArrayType,t.data),{dictionary:o=new pj([new e().visit({type:n.dictionary})])}=t,{length:s=a.length,nullCount:c=t.nullBitmap?-1:0}=t;return new VA(n,r,s,c,[void 0,a,i],[],o)}visitInterval(e){let{type:t,offset:n=0}=e,r=aE(e.nullBitmap),i=eE(t.ArrayType,e.data),{length:a=i.length/sO(t),nullCount:o=e.nullBitmap?-1:0}=e;return new VA(t,n,a,o,[void 0,i,r])}visitDuration(e){let{type:t,offset:n=0}=e,r=aE(e.nullBitmap),i=eE(t.ArrayType,e.data),{length:a=i.length,nullCount:o=e.nullBitmap?-1:0}=e;return new VA(t,n,a,o,[void 0,i,r])}visitFixedSizeList(t){let{type:n,offset:r=0,child:i=new e().visit({type:n.valueType})}=t,a=aE(t.nullBitmap),{length:o=i.length/sO(n),nullCount:s=t.nullBitmap?-1:0}=t;return new VA(n,r,o,s,[void 0,void 0,a],[i])}visitMap(t){let{type:n,offset:r=0,child:i=new e().visit({type:n.childType})}=t,a=aE(t.nullBitmap),o=rE(t.valueOffsets),{length:s=o.length-1,nullCount:c=t.nullBitmap?-1:0}=t;return new VA(n,r,s,c,[o,void 0,a],[i])}};const UA=new HA;var WA=class{constructor(e=0,t){this.numChunks=e,this.getChunkIterator=t,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndexe.nullable)}function KA(e){return e.reduce((e,t)=>e+t.nullCount,0)}function qA(e){return e.reduce((e,t,n)=>(e[n+1]=e[n]+t.length,e),new Uint32Array(e.length+1))}function JA(e,t,n,r){let i=[];for(let a=-1,o=e.length;++a=r)break;if(n>=s+c)continue;if(s>=n&&s+c<=r){i.push(o);continue}let l=Math.max(0,n-s),u=Math.min(r-s,c);i.push(o.slice(l,u-l))}return i.length===0&&i.push(e[0].slice(0,0)),i}function YA(e,t,n,r){let i=0,a=0,o=t.length-1;do{if(i>=o-1)return n0?0:-1}function nj(e,t){let{nullBitmap:n}=e;if(!n||e.nullCount<=0)return-1;let r=0;for(let i of new IA(n,e.offset+(t||0),e.length,n,jA)){if(!i)return r;++r}return-1}function rj(e,t,n){if(t===void 0)return-1;if(t===null)switch(e.typeId){case J.Union:break;case J.Dictionary:break;default:return nj(e,n)}let r=cA.getVisitFn(e),i=xA(t);for(let t=(n||0)-1,a=e.length;++t{let n=e.data[t];return n.values.subarray(0,n.length)[Symbol.iterator]()});let n=0;return new WA(e.data.length,t=>{let r=e.data[t],i=r.length,a=e.slice(n,n+i);return n+=i,new cj(a)})}var cj=class{constructor(e){this.vector=e,this.index=0}next(){return this.indexe.data):t;if(a.length===0||a.some(e=>!(e instanceof VA)))throw TypeError(`Vector constructor expects an Array of Data instances.`);let o=(n=a[0])?.type;switch(a.length){case 0:this._offsets=[0];break;case 1:{let{get:e,set:t,indexOf:n}=dj[o.typeId],r=a[0];this.isValid=e=>XA(r,e),this.get=t=>e(r,t),this.set=(e,n)=>t(r,e,n),this.indexOf=e=>n(r,e),this._offsets=[0,r.length];break}default:Object.setPrototypeOf(this,fj[o.typeId]),this._offsets=qA(a);break}this.data=a,this.type=o,this.stride=sO(o),this.numChildren=(i=(r=o.children)?.length)??0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((e,t)=>e+t.byteLength,0)}get nullable(){return GA(this.data)}get nullCount(){return KA(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${J[this.type.typeId]}Vector`}isValid(e){return!1}get(e){return null}at(e){return this.get(yA(e,this.length))}set(e,t){}indexOf(e,t){return-1}includes(e,t){return this.indexOf(e,t)>-1}[Symbol.iterator](){return lj.visit(this)}concat(...t){return new e(this.data.concat(t.flatMap(e=>e.data).flat(1/0)))}slice(t,n){return new e(vA(this,t,n,({data:e,_offsets:t},n,r)=>JA(e,t,n,r)))}toJSON(){return[...this]}toArray(){let{type:e,data:t,length:n,stride:r,ArrayType:i}=this;switch(e.typeId){case J.Int:case J.Float:case J.Decimal:case J.Time:case J.Timestamp:switch(t.length){case 0:return new i;case 1:return t[0].values.subarray(0,n*r);default:return t.reduce((e,{values:t,length:n})=>(e.array.set(t.subarray(0,n*r),e.offset),e.offset+=n*r,e),{array:new i(n*r),offset:0}).array}}return[...this]}toString(){return`[${[...this].join(`,`)}]`}getChild(e){var t;return this.getChildAt((t=this.type.children)?.findIndex(t=>t.name===e))}getChildAt(t){return t>-1&&te[t])):null}get isMemoized(){return DD.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(DD.isDictionary(this.type)){let t=new mj(this.data[0].dictionary),n=this.data.map(e=>{let n=e.clone();return n.dictionary=t,n});return new e(n)}return new mj(this)}unmemoize(){if(DD.isDictionary(this.type)&&this.isMemoized){let t=this.data[0].dictionary.unmemoize(),n=this.data.map(e=>{let n=e.clone();return n.dictionary=t,n});return new e(n)}return this}};uj=Symbol.toStringTag,pj[uj]=(e=>{e.type=DD.prototype,e.data=[],e.length=0,e.stride=1,e.numChildren=0,e._offsets=new Uint32Array([0]),e[Symbol.isConcatSpreadable]=!0;let t=Object.keys(J).map(e=>J[e]).filter(e=>typeof e==`number`&&e!==J.NONE);for(let n of t){let t=cA.getVisitFnByTypeId(n),r=uk.getVisitFnByTypeId(n),i=aj.getVisitFnByTypeId(n);dj[n]={get:t,set:r,indexOf:i},fj[n]=Object.create(e,{isValid:{value:ZA(XA)},get:{value:ZA(cA.getVisitFnByTypeId(n))},set:{value:QA(uk.getVisitFnByTypeId(n))},indexOf:{value:$A(aj.getVisitFnByTypeId(n))}})}return`Vector`})(pj.prototype);var mj=class e extends pj{constructor(t){super(t.data);let n=this.get,r=this.set,i=this.slice,a=Array(this.length);Object.defineProperty(this,`get`,{value(e){let t=a[e];if(t!==void 0)return t;let r=n.call(this,e);return a[e]=r,r}}),Object.defineProperty(this,`set`,{value(e,t){r.call(this,e,t),a[e]=t}}),Object.defineProperty(this,`slice`,{value:(t,n)=>new e(i.call(this,t,n))}),Object.defineProperty(this,`isMemoized`,{value:!0}),Object.defineProperty(this,`unmemoize`,{value:()=>new pj(this.data)}),Object.defineProperty(this,`memoize`,{value:()=>this})}},hj={};hn(hj,{BaseInt64:()=>bj,Int128:()=>Cj,Int64:()=>Sj,Uint64:()=>xj});const gj=65536;function _j(e){return e<0&&(e=4294967295+e+1),`0x${e.toString(16)}`}const vj=8,yj=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8];var bj=class{constructor(e){this.buffer=e}high(){return this.buffer[1]}low(){return this.buffer[0]}_times(e){let t=new Uint32Array([this.buffer[1]>>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),n=new Uint32Array([e.buffer[1]>>>16,e.buffer[1]&65535,e.buffer[0]>>>16,e.buffer[0]&65535]),r=t[3]*n[3];this.buffer[0]=r&65535;let i=r>>>16;return r=t[2]*n[3],i+=r,r=t[3]*n[2]>>>0,i+=r,this.buffer[0]+=i<<16,this.buffer[1]=i>>>0>>16,this.buffer[1]+=t[1]*n[3]+t[2]*n[2]+t[3]*n[1],this.buffer[1]+=t[0]*n[3]+t[1]*n[2]+t[2]*n[1]+t[3]*n[0]<<16,this}_plus(e){let t=this.buffer[0]+e.buffer[0]>>>0;this.buffer[1]+=e.buffer[1],t>>0&&++this.buffer[1],this.buffer[0]=t}lessThan(e){return this.buffer[1]>>0,t[2]=this.buffer[2]+e.buffer[2]>>>0,t[1]=this.buffer[1]+e.buffer[1]>>>0,t[0]=this.buffer[0]+e.buffer[0]>>>0,t[0]>>0&&++t[1],t[1]>>0&&++t[2],t[2]>>0&&++t[3],this.buffer[3]=t[3],this.buffer[2]=t[2],this.buffer[1]=t[1],this.buffer[0]=t[0],this}hex(){return`${_j(this.buffer[3])} ${_j(this.buffer[2])} ${_j(this.buffer[1])} ${_j(this.buffer[0])}`}static multiply(t,n){let r=new e(new Uint32Array(t.buffer));return r.times(n)}static add(t,n){let r=new e(new Uint32Array(t.buffer));return r.plus(n)}static from(t,n=new Uint32Array(4)){return e.fromString(typeof t==`string`?t:t.toString(),n)}static fromNumber(t,n=new Uint32Array(4)){return e.fromString(t.toString(),n)}static fromString(t,n=new Uint32Array(4)){let r=t.startsWith(`-`),i=t.length,a=new e(n);for(let n=r?1:0;nTj,toIntervalDayTimeObjects:()=>Dj,toIntervalMonthDayNanoInt32Array:()=>Ej,toIntervalMonthDayNanoObjects:()=>Oj});function Tj(e){var t,n;let r=e.length,i=new Int32Array(r*2);for(let a=0,o=0;a>BigInt(32))):o+=2}return i}function Dj(e){let t=e.length,n=Array(t/2);for(let r=0,i=0;r>>0);r[a++]={months:e[i],days:e[i+1],nanoseconds:t?`${n}`:n}}return r}var kj=class extends cO{compareSchemas(e,t){return e===t||t instanceof e.constructor&&this.compareManyFields(e.fields,t.fields)}compareManyFields(e,t){return e===t||Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every((e,n)=>this.compareFields(e,t[n]))}compareFields(e,t){return e===t||t instanceof e.constructor&&e.name===t.name&&e.nullable===t.nullable&&this.visit(e.type,t.type)}};function Aj(e,t){return t instanceof e.constructor}function jj(e,t){return e===t||Aj(e,t)}function Mj(e,t){return e===t||Aj(e,t)&&e.bitWidth===t.bitWidth&&e.isSigned===t.isSigned}function Nj(e,t){return e===t||Aj(e,t)&&e.precision===t.precision}function Pj(e,t){return e===t||Aj(e,t)&&e.byteWidth===t.byteWidth}function Fj(e,t){return e===t||Aj(e,t)&&e.unit===t.unit}function Ij(e,t){return e===t||Aj(e,t)&&e.unit===t.unit&&e.timezone===t.timezone}function Lj(e,t){return e===t||Aj(e,t)&&e.unit===t.unit&&e.bitWidth===t.bitWidth}function Rj(e,t){return e===t||Aj(e,t)&&e.children.length===t.children.length&&Kj.compareManyFields(e.children,t.children)}function zj(e,t){return e===t||Aj(e,t)&&e.children.length===t.children.length&&Kj.compareManyFields(e.children,t.children)}function Bj(e,t){return e===t||Aj(e,t)&&e.mode===t.mode&&e.typeIds.every((e,n)=>e===t.typeIds[n])&&Kj.compareManyFields(e.children,t.children)}function Vj(e,t){return e===t||Aj(e,t)&&e.id===t.id&&e.isOrdered===t.isOrdered&&Kj.visit(e.indices,t.indices)&&Kj.visit(e.dictionary,t.dictionary)}function Hj(e,t){return e===t||Aj(e,t)&&e.unit===t.unit}function Uj(e,t){return e===t||Aj(e,t)&&e.unit===t.unit}function Wj(e,t){return e===t||Aj(e,t)&&e.listSize===t.listSize&&e.children.length===t.children.length&&Kj.compareManyFields(e.children,t.children)}function Gj(e,t){return e===t||Aj(e,t)&&e.keysSorted===t.keysSorted&&e.children.length===t.children.length&&Kj.compareManyFields(e.children,t.children)}kj.prototype.visitNull=jj,kj.prototype.visitBool=jj,kj.prototype.visitInt=Mj,kj.prototype.visitInt8=Mj,kj.prototype.visitInt16=Mj,kj.prototype.visitInt32=Mj,kj.prototype.visitInt64=Mj,kj.prototype.visitUint8=Mj,kj.prototype.visitUint16=Mj,kj.prototype.visitUint32=Mj,kj.prototype.visitUint64=Mj,kj.prototype.visitFloat=Nj,kj.prototype.visitFloat16=Nj,kj.prototype.visitFloat32=Nj,kj.prototype.visitFloat64=Nj,kj.prototype.visitUtf8=jj,kj.prototype.visitLargeUtf8=jj,kj.prototype.visitBinary=jj,kj.prototype.visitLargeBinary=jj,kj.prototype.visitFixedSizeBinary=Pj,kj.prototype.visitDate=Fj,kj.prototype.visitDateDay=Fj,kj.prototype.visitDateMillisecond=Fj,kj.prototype.visitTimestamp=Ij,kj.prototype.visitTimestampSecond=Ij,kj.prototype.visitTimestampMillisecond=Ij,kj.prototype.visitTimestampMicrosecond=Ij,kj.prototype.visitTimestampNanosecond=Ij,kj.prototype.visitTime=Lj,kj.prototype.visitTimeSecond=Lj,kj.prototype.visitTimeMillisecond=Lj,kj.prototype.visitTimeMicrosecond=Lj,kj.prototype.visitTimeNanosecond=Lj,kj.prototype.visitDecimal=jj,kj.prototype.visitList=Rj,kj.prototype.visitStruct=zj,kj.prototype.visitUnion=Bj,kj.prototype.visitDenseUnion=Bj,kj.prototype.visitSparseUnion=Bj,kj.prototype.visitDictionary=Vj,kj.prototype.visitInterval=Hj,kj.prototype.visitIntervalDayTime=Hj,kj.prototype.visitIntervalYearMonth=Hj,kj.prototype.visitIntervalMonthDayNano=Hj,kj.prototype.visitDuration=Uj,kj.prototype.visitDurationSecond=Uj,kj.prototype.visitDurationMillisecond=Uj,kj.prototype.visitDurationMicrosecond=Uj,kj.prototype.visitDurationNanosecond=Uj,kj.prototype.visitFixedSizeList=Wj,kj.prototype.visitMap=Gj;const Kj=new kj;function qj(e,t){return Kj.compareSchemas(e,t)}function Jj(e,t){return Kj.compareFields(e,t)}function Yj(e,t){return Kj.visit(e,t)}const Xj=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},KE),hj),AA),fO),YT),gA),VE),wj),{compareSchemas:qj,compareFields:Jj,compareTypes:Yj}),Zj=365.2425,Qj=10**8*24*60*60*1e3,$j=6048e5,eM=864e5,tM=3600,nM=tM*24,rM=nM*7,iM=nM*Zj,aM=iM/12,oM=aM*3,sM=Symbol.for(`constructDateFrom`);function cM(e,t){return typeof e==`function`?e(t):e&&typeof e==`object`&&sM in e?e[sM](t):e instanceof Date?new e.constructor(t):new Date(t)}function lM(e,t){return cM(t||e,e)}let uM={};function dM(){return uM}function fM(e,t){let n=dM(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=lM(e,t?.in),a=i.getDay(),o=(a=a.getTime()?r+1:n.getTime()>=s.getTime()?r:r-1}function hM(e){let t=lM(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),e-+n}function gM(e,...t){let n=cM.bind(null,e||t.find(e=>typeof e==`object`));return t.map(n)}function _M(e,t){let n=lM(e,t?.in);return n.setHours(0,0,0,0),n}function vM(e,t,n){let[r,i]=gM(n?.in,e,t),a=_M(r),o=_M(i),s=+a-hM(a),c=+o-hM(o);return Math.round((s-c)/eM)}function yM(e,t){let n=mM(e,t),r=cM(t?.in||e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),pM(r)}function bM(e){return e instanceof Date||typeof e==`object`&&Object.prototype.toString.call(e)===`[object Date]`}function xM(e){return!(!bM(e)&&typeof e!=`number`||isNaN(+lM(e)))}function SM(e,t){let n=lM(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const CM={lessThanXSeconds:{one:`less than a second`,other:`less than {{count}} seconds`},xSeconds:{one:`1 second`,other:`{{count}} seconds`},halfAMinute:`half a minute`,lessThanXMinutes:{one:`less than a minute`,other:`less than {{count}} minutes`},xMinutes:{one:`1 minute`,other:`{{count}} minutes`},aboutXHours:{one:`about 1 hour`,other:`about {{count}} hours`},xHours:{one:`1 hour`,other:`{{count}} hours`},xDays:{one:`1 day`,other:`{{count}} days`},aboutXWeeks:{one:`about 1 week`,other:`about {{count}} weeks`},xWeeks:{one:`1 week`,other:`{{count}} weeks`},aboutXMonths:{one:`about 1 month`,other:`about {{count}} months`},xMonths:{one:`1 month`,other:`{{count}} months`},aboutXYears:{one:`about 1 year`,other:`about {{count}} years`},xYears:{one:`1 year`,other:`{{count}} years`},overXYears:{one:`over 1 year`,other:`over {{count}} years`},almostXYears:{one:`almost 1 year`,other:`almost {{count}} years`}},wM=(e,t,n)=>{let r,i=CM[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:r+` ago`:r};function TM(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth,r=e.formats[n]||e.formats[e.defaultWidth];return r}}const EM={full:`EEEE, MMMM do, y`,long:`MMMM do, y`,medium:`MMM d, y`,short:`MM/dd/yyyy`},DM={full:`h:mm:ss a zzzz`,long:`h:mm:ss a z`,medium:`h:mm:ss a`,short:`h:mm a`},OM={full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},kM={date:TM({formats:EM,defaultWidth:`full`}),time:TM({formats:DM,defaultWidth:`full`}),dateTime:TM({formats:OM,defaultWidth:`full`})},AM={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`},jM=(e,t,n,r)=>AM[e];function MM(e){return(t,n)=>{let r=n?.context?String(n.context):`standalone`,i;if(r===`formatting`&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{let t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}let a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}const NM={narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},PM={narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1st quarter`,`2nd quarter`,`3rd quarter`,`4th quarter`]},FM={narrow:[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],wide:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`]},IM={narrow:[`S`,`M`,`T`,`W`,`T`,`F`,`S`],short:[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],abbreviated:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],wide:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`]},LM={narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`}},RM={narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`}},zM=(e,t)=>{let n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+`st`;case 2:return n+`nd`;case 3:return n+`rd`}return n+`th`},BM={ordinalNumber:zM,era:MM({values:NM,defaultWidth:`wide`}),quarter:MM({values:PM,defaultWidth:`wide`,argumentCallback:e=>e-1}),month:MM({values:FM,defaultWidth:`wide`}),day:MM({values:IM,defaultWidth:`wide`}),dayPeriod:MM({values:LM,defaultWidth:`wide`,formattingValues:RM,defaultFormattingWidth:`wide`})};function VM(e){return(t,n={})=>{let r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;let o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?UM(s,e=>e.test(o)):HM(s,e=>e.test(o)),l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;let u=t.slice(o.length);return{value:l,rest:u}}}function HM(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function UM(e,t){for(let n=0;n{let r=t.match(e.matchPattern);if(!r)return null;let i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;let s=t.slice(i.length);return{value:o,rest:s}}}const GM=/^(\d+)(th|st|nd|rd)?/i,KM=/\d+/i,qM={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},JM={any:[/^b/i,/^(a|c)/i]},YM={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},XM={any:[/1/i,/2/i,/3/i,/4/i]},ZM={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},QM={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},$M={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},eN={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},tN={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},nN={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},rN={ordinalNumber:WM({matchPattern:GM,parsePattern:KM,valueCallback:e=>parseInt(e,10)}),era:VM({matchPatterns:qM,defaultMatchWidth:`wide`,parsePatterns:JM,defaultParseWidth:`any`}),quarter:VM({matchPatterns:YM,defaultMatchWidth:`wide`,parsePatterns:XM,defaultParseWidth:`any`,valueCallback:e=>e+1}),month:VM({matchPatterns:ZM,defaultMatchWidth:`wide`,parsePatterns:QM,defaultParseWidth:`any`}),day:VM({matchPatterns:$M,defaultMatchWidth:`wide`,parsePatterns:eN,defaultParseWidth:`any`}),dayPeriod:VM({matchPatterns:tN,defaultMatchWidth:`any`,parsePatterns:nN,defaultParseWidth:`any`})},iN={code:`en-US`,formatDistance:wM,formatLong:kM,formatRelative:jM,localize:BM,match:rN,options:{weekStartsOn:0,firstWeekContainsDate:1}};function aN(e,t){let n=lM(e,t?.in),r=vM(n,SM(n)),i=r+1;return i}function oN(e,t){let n=lM(e,t?.in),r=pM(n)-+yM(n);return Math.round(r/$j)+1}function sN(e,t){let n=lM(e,t?.in),r=n.getFullYear(),i=dM(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,o=cM(t?.in||e,0);o.setFullYear(r+1,0,a),o.setHours(0,0,0,0);let s=fM(o,t),c=cM(t?.in||e,0);c.setFullYear(r,0,a),c.setHours(0,0,0,0);let l=fM(c,t);return+n>=+s?r+1:+n>=+l?r:r-1}function cN(e,t){let n=dM(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=sN(e,t),a=cM(t?.in||e,0);a.setFullYear(i,0,r),a.setHours(0,0,0,0);let o=fM(a,t);return o}function lN(e,t){let n=lM(e,t?.in),r=fM(n,t)-+cN(n,t);return Math.round(r/$j)+1}function uN(e,t){let n=e<0?`-`:``,r=Math.abs(e).toString().padStart(t,`0`);return n+r}const dN={y(e,t){let n=e.getFullYear(),r=n>0?n:1-n;return uN(t===`yy`?r%100:r,t.length)},M(e,t){let n=e.getMonth();return t===`M`?String(n+1):uN(n+1,2)},d(e,t){return uN(e.getDate(),t.length)},a(e,t){let n=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.toUpperCase();case`aaa`:return n;case`aaaaa`:return n[0];case`aaaa`:default:return n===`am`?`a.m.`:`p.m.`}},h(e,t){return uN(e.getHours()%12||12,t.length)},H(e,t){return uN(e.getHours(),t.length)},m(e,t){return uN(e.getMinutes(),t.length)},s(e,t){return uN(e.getSeconds(),t.length)},S(e,t){let n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*10**(n-3));return uN(i,t.length)}},fN={am:`am`,pm:`pm`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},pN={G:function(e,t,n){let r=e.getFullYear()>0?1:0;switch(t){case`G`:case`GG`:case`GGG`:return n.era(r,{width:`abbreviated`});case`GGGGG`:return n.era(r,{width:`narrow`});case`GGGG`:default:return n.era(r,{width:`wide`})}},y:function(e,t,n){if(t===`yo`){let t=e.getFullYear(),r=t>0?t:1-t;return n.ordinalNumber(r,{unit:`year`})}return dN.y(e,t)},Y:function(e,t,n,r){let i=sN(e,r),a=i>0?i:1-i;if(t===`YY`){let e=a%100;return uN(e,2)}return t===`Yo`?n.ordinalNumber(a,{unit:`year`}):uN(a,t.length)},R:function(e,t){let n=mM(e);return uN(n,t.length)},u:function(e,t){let n=e.getFullYear();return uN(n,t.length)},Q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`Q`:return String(r);case`QQ`:return uN(r,2);case`Qo`:return n.ordinalNumber(r,{unit:`quarter`});case`QQQ`:return n.quarter(r,{width:`abbreviated`,context:`formatting`});case`QQQQQ`:return n.quarter(r,{width:`narrow`,context:`formatting`});case`QQQQ`:default:return n.quarter(r,{width:`wide`,context:`formatting`})}},q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`q`:return String(r);case`qq`:return uN(r,2);case`qo`:return n.ordinalNumber(r,{unit:`quarter`});case`qqq`:return n.quarter(r,{width:`abbreviated`,context:`standalone`});case`qqqqq`:return n.quarter(r,{width:`narrow`,context:`standalone`});case`qqqq`:default:return n.quarter(r,{width:`wide`,context:`standalone`})}},M:function(e,t,n){let r=e.getMonth();switch(t){case`M`:case`MM`:return dN.M(e,t);case`Mo`:return n.ordinalNumber(r+1,{unit:`month`});case`MMM`:return n.month(r,{width:`abbreviated`,context:`formatting`});case`MMMMM`:return n.month(r,{width:`narrow`,context:`formatting`});case`MMMM`:default:return n.month(r,{width:`wide`,context:`formatting`})}},L:function(e,t,n){let r=e.getMonth();switch(t){case`L`:return String(r+1);case`LL`:return uN(r+1,2);case`Lo`:return n.ordinalNumber(r+1,{unit:`month`});case`LLL`:return n.month(r,{width:`abbreviated`,context:`standalone`});case`LLLLL`:return n.month(r,{width:`narrow`,context:`standalone`});case`LLLL`:default:return n.month(r,{width:`wide`,context:`standalone`})}},w:function(e,t,n,r){let i=lN(e,r);return t===`wo`?n.ordinalNumber(i,{unit:`week`}):uN(i,t.length)},I:function(e,t,n){let r=oN(e);return t===`Io`?n.ordinalNumber(r,{unit:`week`}):uN(r,t.length)},d:function(e,t,n){return t===`do`?n.ordinalNumber(e.getDate(),{unit:`date`}):dN.d(e,t)},D:function(e,t,n){let r=aN(e);return t===`Do`?n.ordinalNumber(r,{unit:`dayOfYear`}):uN(r,t.length)},E:function(e,t,n){let r=e.getDay();switch(t){case`E`:case`EE`:case`EEE`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`EEEEE`:return n.day(r,{width:`narrow`,context:`formatting`});case`EEEEEE`:return n.day(r,{width:`short`,context:`formatting`});case`EEEE`:default:return n.day(r,{width:`wide`,context:`formatting`})}},e:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`e`:return String(a);case`ee`:return uN(a,2);case`eo`:return n.ordinalNumber(a,{unit:`day`});case`eee`:return n.day(i,{width:`abbreviated`,context:`formatting`});case`eeeee`:return n.day(i,{width:`narrow`,context:`formatting`});case`eeeeee`:return n.day(i,{width:`short`,context:`formatting`});case`eeee`:default:return n.day(i,{width:`wide`,context:`formatting`})}},c:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`c`:return String(a);case`cc`:return uN(a,t.length);case`co`:return n.ordinalNumber(a,{unit:`day`});case`ccc`:return n.day(i,{width:`abbreviated`,context:`standalone`});case`ccccc`:return n.day(i,{width:`narrow`,context:`standalone`});case`cccccc`:return n.day(i,{width:`short`,context:`standalone`});case`cccc`:default:return n.day(i,{width:`wide`,context:`standalone`})}},i:function(e,t,n){let r=e.getDay(),i=r===0?7:r;switch(t){case`i`:return String(i);case`ii`:return uN(i,t.length);case`io`:return n.ordinalNumber(i,{unit:`day`});case`iii`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`iiiii`:return n.day(r,{width:`narrow`,context:`formatting`});case`iiiiii`:return n.day(r,{width:`short`,context:`formatting`});case`iiii`:default:return n.day(r,{width:`wide`,context:`formatting`})}},a:function(e,t,n){let r=e.getHours(),i=r/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`aaa`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`aaaaa`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});case`aaaa`:default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},b:function(e,t,n){let r=e.getHours(),i;switch(i=r===12?fN.noon:r===0?fN.midnight:r/12>=1?`pm`:`am`,t){case`b`:case`bb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`bbb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`bbbbb`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});case`bbbb`:default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},B:function(e,t,n){let r=e.getHours(),i;switch(i=r>=17?fN.evening:r>=12?fN.afternoon:r>=4?fN.morning:fN.night,t){case`B`:case`BB`:case`BBB`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`BBBBB`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});case`BBBB`:default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},h:function(e,t,n){if(t===`ho`){let t=e.getHours()%12;return t===0&&(t=12),n.ordinalNumber(t,{unit:`hour`})}return dN.h(e,t)},H:function(e,t,n){return t===`Ho`?n.ordinalNumber(e.getHours(),{unit:`hour`}):dN.H(e,t)},K:function(e,t,n){let r=e.getHours()%12;return t===`Ko`?n.ordinalNumber(r,{unit:`hour`}):uN(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t===`ko`?n.ordinalNumber(r,{unit:`hour`}):uN(r,t.length)},m:function(e,t,n){return t===`mo`?n.ordinalNumber(e.getMinutes(),{unit:`minute`}):dN.m(e,t)},s:function(e,t,n){return t===`so`?n.ordinalNumber(e.getSeconds(),{unit:`second`}):dN.s(e,t)},S:function(e,t){return dN.S(e,t)},X:function(e,t,n){let r=e.getTimezoneOffset();if(r===0)return`Z`;switch(t){case`X`:return hN(r);case`XXXX`:case`XX`:return gN(r);case`XXXXX`:case`XXX`:default:return gN(r,`:`)}},x:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`x`:return hN(r);case`xxxx`:case`xx`:return gN(r);case`xxxxx`:case`xxx`:default:return gN(r,`:`)}},O:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`O`:case`OO`:case`OOO`:return`GMT`+mN(r,`:`);case`OOOO`:default:return`GMT`+gN(r,`:`)}},z:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`z`:case`zz`:case`zzz`:return`GMT`+mN(r,`:`);case`zzzz`:default:return`GMT`+gN(r,`:`)}},t:function(e,t,n){let r=Math.trunc(e/1e3);return uN(r,t.length)},T:function(e,t,n){return uN(+e,t.length)}};function mN(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=Math.trunc(r/60),a=r%60;return a===0?n+String(i):n+String(i)+t+uN(a,2)}function hN(e,t){if(e%60==0){let t=e>0?`-`:`+`;return t+uN(Math.abs(e)/60,2)}return gN(e,t)}function gN(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=uN(Math.trunc(r/60),2),a=uN(r%60,2);return n+i+t+a}const _N=(e,t)=>{switch(e){case`P`:return t.date({width:`short`});case`PP`:return t.date({width:`medium`});case`PPP`:return t.date({width:`long`});case`PPPP`:default:return t.date({width:`full`})}},vN=(e,t)=>{switch(e){case`p`:return t.time({width:`short`});case`pp`:return t.time({width:`medium`});case`ppp`:return t.time({width:`long`});case`pppp`:default:return t.time({width:`full`})}},yN=(e,t)=>{let n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return _N(e,t);let a;switch(r){case`P`:a=t.dateTime({width:`short`});break;case`PP`:a=t.dateTime({width:`medium`});break;case`PPP`:a=t.dateTime({width:`long`});break;case`PPPP`:default:a=t.dateTime({width:`full`});break}return a.replace(`{{date}}`,_N(r,t)).replace(`{{time}}`,vN(i,t))},bN={p:vN,P:yN},xN=/^D+$/,SN=/^Y+$/,CN=[`D`,`DD`,`YY`,`YYYY`];function wN(e){return xN.test(e)}function TN(e){return SN.test(e)}function EN(e,t,n){let r=DN(e,t,n);if(console.warn(r),CN.includes(e))throw RangeError(r)}function DN(e,t,n){let r=e[0]===`Y`?`years`:`days of the month`;return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const ON=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,kN=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,AN=/^'([^]*?)'?$/,jN=/''/g,MN=/[a-zA-Z]/;function NN(e,t,n){let r=dM(),i=n?.locale??r.locale??iN,a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,s=lM(e,n?.in);if(!xM(s))throw RangeError(`Invalid time value`);let c=t.match(kN).map(e=>{let t=e[0];if(t===`p`||t===`P`){let n=bN[t];return n(e,i.formatLong)}return e}).join(``).match(ON).map(e=>{if(e===`''`)return{isToken:!1,value:`'`};let t=e[0];if(t===`'`)return{isToken:!1,value:PN(e)};if(pN[t])return{isToken:!0,value:e};if(t.match(MN))throw RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});i.localize.preprocessor&&(c=i.localize.preprocessor(s,c));let l={firstWeekContainsDate:a,weekStartsOn:o,locale:i};return c.map(r=>{if(!r.isToken)return r.value;let a=r.value;(!n?.useAdditionalWeekYearTokens&&TN(a)||!n?.useAdditionalDayOfYearTokens&&wN(a))&&EN(a,t,String(e));let o=pN[a[0]];return o(s,a,i.localize,l)}).join(``)}function PN(e){let t=e.match(AN);return t?t[1].replace(jN,`'`):e}function FN(e,t){return lM(e*1e3,t?.in)}function IN(e,t){let n=LN(t)?new t(0):cM(t,0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n}function LN(e){return typeof e==`function`&&e.prototype?.constructor===e}function RN(e,t){if(t===void 0)return e.trimEnd();let n=e.length;switch(typeof t){case`string`:if(t.length!==1)throw Error(`The 'chars' parameter should be a single character string.`);for(;n>0&&e[n-1]===t;)n--;break;case`object`:for(;n>0&&t.includes(e[n-1]);)n--}return e.substring(0,n)}function zN(e){return e==null}function BN(e){return e!=null}async function VN(){if(typeof window<`u`&&window!==null)return`browser`;try{let e=await S(()=>import(`./__vite-browser-external-C1t5aXtc.js`).then(gn(1)),__vite__mapDeps([0,1,2]));return e!==void 0&&e.versions!=null&&e.versions.node!=null?`node`:`unknown`}catch{return`unknown`}}function HN(e){return zN(e)?!1:DD.isInt(e.type)&&!JN(e)||UN(e)}function UN(e){return zN(e)?!1:DD.isInt(e.type)&&e.type.isSigned===!1}function WN(e){return zN(e)?!1:DD.isFloat(e.type)??!1}function GN(e){return zN(e)?!1:DD.isDecimal(e.type)}function KN(e){return zN(e)?!1:DD.isBool(e.type)}function qN(e){return zN(e)?!1:DD.isDuration(e.type)}function JN(e){return zN(e)?!1:DD.isInt(e.type)&&e.metadata.get(`ARROW:extension:name`)===`period`}function YN(e){return zN(e)?!1:DD.isTimestamp(e.type)}function XN(e){return zN(e)?!1:DD.isDate(e.type)}function ZN(e){return zN(e)?!1:DD.isTime(e.type)}function QN(e){return zN(e)?!1:DD.isList(e.type)||DD.isFixedSizeList(e.type)}function $N(e){return zN(e)?!1:DD.isStruct(e.type)||DD.isMap(e.type)}function eP(e){return zN(e)?!1:DD.isStruct(e.type)&&e.metadata.get(`ARROW:extension:name`)===`interval`||DD.isInterval(e.type)}const tP=new Date(1970,0,1);function nP(e,t){let n;if(t===RE.MILLISECOND)n=1e3;else if(t===RE.MICROSECOND)n=1e3*1e3;else if(t===RE.NANOSECOND)n=1e3*1e3*1e3;else return Number(e);return typeof e==`bigint`&&!Number.isSafeInteger(Number(e))?Number(e/BigInt(n)):Number(e)/n}function rP(e,t){let n=nP(e,t?.type?.unit??RE.SECOND);return FN(n)}function iP(e,t){let n=rP(e,t);return NN(n,n.getMilliseconds()===0?`HH:mm:ss`:`HH:mm:ss.SSS`)}function aP(e){let t=`yyyy-MM-dd`;return e instanceof Date||typeof e==`number`&&Number.isFinite(e)?NN(e,t):(console.warn(`Unsupported date value: ${e}`),String(e))}function oP(e,t){if(!(e instanceof Date||typeof e==`number`&&Number.isFinite(e)))return console.warn(`Unsupported datetime value: ${e}`),null;let n,r=t?.type?.timezone;return n=r?new jT(e,r):new jT(e),IN(n,Date)}function sP(e,t){let n=t?.type?.scale||0,r=Xj.bigNumToString(new Xj.BN(e)).padStart(n,`0`);if(n===0)return r;let i=``;r.startsWith(`-`)&&(i=`-`,r=r.slice(1));let a=r.slice(0,-n)||`0`,o=RN(r.slice(-n),`0`)||``;return`${i}${a}${o?`.${o}`:``}`}const cP=new Intl.NumberFormat(`en-US`,{style:`decimal`,maximumFractionDigits:4,minimumFractionDigits:4,useGrouping:!0});function lP(e){let t=e[0],n=e[1],r=[];return t!==0&&r.push(`${t} year${t>1?`s`:``}`),n!==0&&r.push(`${n} month${n>1?`s`:``}`),r.length?r.join(` `):`0 months`}function uP(e,t){if(DD.isInterval(t?.type))return lP(e);let n=t&&t.metadata.get(`ARROW:extension:name`);if(n&&n===`pandas.interval`){let n=JSON.parse(t.metadata.get(`ARROW:extension:metadata`)),{closed:r}=n,i=e.toJSON(),a=r===`both`||r===`left`?`[`:`(`,o=r===`both`||r===`right`?`]`:`)`,s=fP(i.left,t.type?.children?.[0]),c=fP(i.right,t.type?.children?.[1]);return`${a+s}, ${c+o}`}return String(e)}function dP(e,t){return t?.type instanceof eO?JSON.parse(JSON.stringify(e,(e,t)=>{if(BN(t))return typeof t==`bigint`?Number(t):t})):JSON.parse(JSON.stringify(e,(e,t)=>typeof t==`bigint`?Number(t):t))}function fP(e,t){if(zN(e))return null;let n=e instanceof Date||Number.isFinite(e);if(n&&XN(t))return aP(e);if(typeof e==`bigint`&&ZN(t))return iP(Number(e),t);if(n&&YN(t))return oP(e,t);if(JN(t))throw Error(`Period type is not supported yet`);if(eP(t))return uP(e,t);if(qN(t))throw Error(`Duration type is not supported yet`);return GN(t)?sP(e,t):WN(t)&&Number.isFinite(e)||HN(t)?e:$N(t)||QN(t)?dP(e,t):KN(t)?!!e:String(e)}function pP(e){let t=(e.toArray()||[]).map(e=>e.toJSON())||[],n=t.map(t=>(e.schema.fields.forEach(e=>t[e.name]=fP(t[e.name],e)),t));return n}let mP=function(e){return e.ORIGIN_PRIVATE_FS=`origin-private-fs`,e.NODE_FS=`node-fs`,e}({});async function hP(e){let t=j(e,{logger:!1}),n,r,i=await VN();if(i===`browser`){if(t.bundles===void 0){let{getBundles:e}=await S(async()=>{let{getBundles:e}=await import(`./default-browser-BsyDD-mc.js`);return{getBundles:e}},[]);t.bundles=await e()}r=await CT(await t.bundles),n=new Worker(r.mainWorker)}else if(i===`node`){if(t.bundles===void 0){let{getBundles:e}=await S(async()=>{let{getBundles:e}=await import(`./default-node-BI20WiOb.js`);return{getBundles:e}},__vite__mapDeps([3,1,2]));t.bundles=await e()}r=await CT(await t.bundles);let e=r.mainWorker;e.startsWith(`/@fs/`)&&(e=e.replace(`/@fs/`,`file://`));let i=await S(()=>import(`./browser-CoZYwbon.js`),[]);n=new i.default(e,{type:`module`})}else throw Error(`Unsupported environment: ${i}`);let a;a=t.logger===!0?new Vw:t.logger===!1?new Bw:t.logger;let o=new Qw(a,n);if(await o.instantiate(r.mainModule,r.pthreadWorker),t.storage)switch(t.storage.type){case mP.ORIGIN_PRIVATE_FS:try{let e=t.storage.path;e.startsWith(`/`)&&(e=e.slice(1)),await o.open({path:`opfs://${e}`,accessMode:t.storage.accessMode})}catch(e){throw await o.terminate(),await n.terminate(),e}break;case mP.NODE_FS:try{await o.open({path:t.storage.path,accessMode:t.storage.accessMode,useDirectIO:!0})}catch(e){throw await o.terminate(),await n.terminate(),e}break}let s=await o.connect();async function c(e,t=[]){if(!t||t.length===0){let t=await s.query(e);return{_results:t,_schema:t.schema,columns:t.schema.fields,rows:pP(t)}}let n=await s.prepare(e),r=await n.query(...t);return n.close(),{_results:r,_schema:r.schema,columns:r.schema.fields,rows:pP(r)}}return{worker:n,db:o,conn:s,query:async(e,t=[])=>c(e,t).then(e=>e.rows),queryWithColumns:async(e,t=[])=>c(e,t),close:async()=>{await s.close(),await o.terminate(),await n.terminate()}}}async function gP(e,t){await(await e).conn.send(`BEGIN TRANSACTION`);try{let n=await t(e);return await(await e).conn.send(`COMMIT`),n}catch(t){throw await(await e).conn.send(`ROLLBACK`),t}}async function _P(e,t,n){await(await e).conn.send(`SAVEPOINT ${t}`);try{let r=await n(e);return await(await e).conn.send(`RELEASE SAVEPOINT ${t}`),r}catch(n){throw await(await e).conn.send(`ROLLBACK TO SAVEPOINT ${t}`),n}}const Y=Symbol.for(`drizzle:entityKind`),vP=Symbol.for(`drizzle:hasOwnEntityKind`);function X(e,t){if(!e||typeof e!=`object`)return!1;if(e instanceof t)return!0;if(!Object.prototype.hasOwnProperty.call(t,Y))throw Error(`Class "${t.name??``}" doesn't look like a Drizzle entity. If this is incorrect and the class is provided by Drizzle, please report this as a bug.`);let n=Object.getPrototypeOf(e).constructor;if(n)for(;n;){if(Y in n&&n[Y]===t[Y])return!0;n=Object.getPrototypeOf(n)}return!1}var yP=class{constructor(e,t){this.table=e,this.config=t,this.name=t.name,this.keyAsName=t.keyAsName,this.notNull=t.notNull,this.default=t.default,this.defaultFn=t.defaultFn,this.onUpdateFn=t.onUpdateFn,this.hasDefault=t.hasDefault,this.primary=t.primaryKey,this.isUnique=t.isUnique,this.uniqueName=t.uniqueName,this.uniqueType=t.uniqueType,this.dataType=t.dataType,this.columnType=t.columnType,this.generated=t.generated,this.generatedIdentity=t.generatedIdentity}static[Y]=`Column`;name;keyAsName;primary;notNull;default;defaultFn;onUpdateFn;hasDefault;isUnique;uniqueName;uniqueType;dataType;columnType;enumValues=void 0;generated=void 0;generatedIdentity=void 0;config;mapFromDriverValue(e){return e}mapToDriverValue(e){return e}shouldDisableInsert(){return this.config.generated!==void 0&&this.config.generated.type!==`byDefault`}},bP=class{static[Y]=`ColumnBuilder`;config;constructor(e,t,n){this.config={name:e,keyAsName:e===``,notNull:!1,default:void 0,hasDefault:!1,primaryKey:!1,isUnique:!1,uniqueName:void 0,uniqueType:void 0,dataType:t,columnType:n,generated:void 0}}$type(){return this}notNull(){return this.config.notNull=!0,this}default(e){return this.config.default=e,this.config.hasDefault=!0,this}$defaultFn(e){return this.config.defaultFn=e,this.config.hasDefault=!0,this}$default=this.$defaultFn;$onUpdateFn(e){return this.config.onUpdateFn=e,this.config.hasDefault=!0,this}$onUpdate=this.$onUpdateFn;primaryKey(){return this.config.primaryKey=!0,this.config.notNull=!0,this}setName(e){this.config.name===``&&(this.config.name=e)}};const xP=Symbol.for(`drizzle:Name`);var SP=class{static[Y]=`PgForeignKeyBuilder`;reference;_onUpdate=`no action`;_onDelete=`no action`;constructor(e,t){this.reference=()=>{let{name:t,columns:n,foreignColumns:r}=e();return{name:t,columns:n,foreignTable:r[0].table,foreignColumns:r}},t&&(this._onUpdate=t.onUpdate,this._onDelete=t.onDelete)}onUpdate(e){return this._onUpdate=e===void 0?`no action`:e,this}onDelete(e){return this._onDelete=e===void 0?`no action`:e,this}build(e){return new CP(e,this)}},CP=class{constructor(e,t){this.table=e,this.reference=t.reference,this.onUpdate=t._onUpdate,this.onDelete=t._onDelete}static[Y]=`PgForeignKey`;reference;onUpdate;onDelete;getName(){let{name:e,columns:t,foreignColumns:n}=this.reference(),r=t.map(e=>e.name),i=n.map(e=>e.name),a=[this.table[xP],...r,n[0].table[xP],...i];return e??`${a.join(`_`)}_fk`}};function wP(e,...t){return e(...t)}function TP(e,t){return`${e[xP]}_${t.join(`_`)}_unique`}var EP=class{constructor(e,t){this.name=t,this.columns=e}static[Y]=`PgUniqueConstraintBuilder`;columns;nullsNotDistinctConfig=!1;nullsNotDistinct(){return this.nullsNotDistinctConfig=!0,this}build(e){return new OP(e,this.columns,this.nullsNotDistinctConfig,this.name)}},DP=class{static[Y]=`PgUniqueOnConstraintBuilder`;name;constructor(e){this.name=e}on(...e){return new EP(e,this.name)}},OP=class{constructor(e,t,n,r){this.table=e,this.columns=t,this.name=r??TP(this.table,this.columns.map(e=>e.name)),this.nullsNotDistinct=n}static[Y]=`PgUniqueConstraint`;columns;name;nullsNotDistinct=!1;getName(){return this.name}};function kP(e,t,n){for(let r=t;rArray.isArray(e)?MP(e):typeof e==`string`?`"${e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}"`:`${e}`).join(`,`)}}`}var NP=class extends bP{foreignKeyConfigs=[];static[Y]=`PgColumnBuilder`;array(e){return new LP(this.config.name,this,e)}references(e,t={}){return this.foreignKeyConfigs.push({ref:e,actions:t}),this}unique(e,t){return this.config.isUnique=!0,this.config.uniqueName=e,this.config.uniqueType=t?.nulls,this}generatedAlwaysAs(e){return this.config.generated={as:e,type:`always`,mode:`stored`},this}buildForeignKeys(e,t){return this.foreignKeyConfigs.map(({ref:n,actions:r})=>wP((n,r)=>{let i=new SP(()=>{let t=n();return{columns:[e],foreignColumns:[t]}});return r.onUpdate&&i.onUpdate(r.onUpdate),r.onDelete&&i.onDelete(r.onDelete),i.build(t)},n,r))}buildExtraConfigColumn(e){return new FP(e,this.config)}},PP=class extends yP{constructor(e,t){t.uniqueName||=TP(e,[t.name]),super(e,t),this.table=e}static[Y]=`PgColumn`},FP=class extends PP{static[Y]=`ExtraConfigColumn`;getSQLType(){return this.getSQLType()}indexConfig={order:this.config.order??`asc`,nulls:this.config.nulls??`last`,opClass:this.config.opClass};defaultConfig={order:`asc`,nulls:`last`,opClass:void 0};asc(){return this.indexConfig.order=`asc`,this}desc(){return this.indexConfig.order=`desc`,this}nullsFirst(){return this.indexConfig.nulls=`first`,this}nullsLast(){return this.indexConfig.nulls=`last`,this}op(e){return this.indexConfig.opClass=e,this}},IP=class{static[Y]=`IndexedColumn`;constructor(e,t,n,r){this.name=e,this.keyAsName=t,this.type=n,this.indexConfig=r}name;keyAsName;type;indexConfig},LP=class extends NP{static[Y]=`PgArrayBuilder`;constructor(e,t,n){super(e,`array`,`PgArray`),this.config.baseBuilder=t,this.config.size=n}build(e){let t=this.config.baseBuilder.build(e);return new RP(e,this.config,t)}},RP=class e extends PP{constructor(e,t,n,r){super(e,t),this.baseColumn=n,this.range=r,this.size=t.size}size;static[Y]=`PgArray`;getSQLType(){return`${this.baseColumn.getSQLType()}[${typeof this.size==`number`?this.size:``}]`}mapFromDriverValue(e){return typeof e==`string`&&(e=jP(e)),e.map(e=>this.baseColumn.mapFromDriverValue(e))}mapToDriverValue(t,n=!1){let r=t.map(t=>t===null?null:X(this.baseColumn,e)?this.baseColumn.mapToDriverValue(t,!0):this.baseColumn.mapToDriverValue(t));return n?r:MP(r)}},zP=class extends NP{static[Y]=`PgEnumObjectColumnBuilder`;constructor(e,t){super(e,`string`,`PgEnumObjectColumn`),this.config.enum=t}build(e){return new BP(e,this.config)}},BP=class extends PP{static[Y]=`PgEnumObjectColumn`;enum;enumValues=this.config.enum.enumValues;constructor(e,t){super(e,t),this.enum=t.enum}getSQLType(){return this.enum.enumName}};const VP=Symbol.for(`drizzle:isPgEnum`);function HP(e){return!!e&&typeof e==`function`&&VP in e&&e[VP]===!0}var UP=class extends NP{static[Y]=`PgEnumColumnBuilder`;constructor(e,t){super(e,`string`,`PgEnumColumn`),this.config.enum=t}build(e){return new WP(e,this.config)}},WP=class extends PP{static[Y]=`PgEnumColumn`;enum=this.config.enum;enumValues=this.config.enum.enumValues;constructor(e,t){super(e,t),this.enum=t.enum}getSQLType(){return this.enum.enumName}},GP=class{static[Y]=`Subquery`;constructor(e,t,n,r=!1,i=[]){this._={brand:`Subquery`,sql:e,selectedFields:t,alias:n,isWith:r,usedTables:i}}},KP=class extends GP{static[Y]=`WithSubquery`},qP=`0.44.2`;let JP,YP;const XP={startActiveSpan(e,t){return JP?(YP||=JP.trace.getTracer(`drizzle-orm`,qP),wP((n,r)=>r.startActiveSpan(e,e=>{try{return t(e)}catch(t){throw e.setStatus({code:n.SpanStatusCode.ERROR,message:t instanceof Error?t.message:`Unknown error`}),t}finally{e.end()}}),JP,YP)):t()}},ZP=Symbol.for(`drizzle:ViewBaseConfig`),QP=Symbol.for(`drizzle:Schema`),$P=Symbol.for(`drizzle:Columns`),eF=Symbol.for(`drizzle:ExtraConfigColumns`),tF=Symbol.for(`drizzle:OriginalName`),nF=Symbol.for(`drizzle:BaseName`),rF=Symbol.for(`drizzle:IsAlias`),iF=Symbol.for(`drizzle:ExtraConfigBuilder`),aF=Symbol.for(`drizzle:IsDrizzleTable`);var oF=class{static[Y]=`Table`;static Symbol={Name:xP,Schema:QP,OriginalName:tF,Columns:$P,ExtraConfigColumns:eF,BaseName:nF,IsAlias:rF,ExtraConfigBuilder:iF};[xP];[tF];[QP];[$P];[eF];[nF];[rF]=!1;[aF]=!0;[iF]=void 0;constructor(e,t,n){this[xP]=this[tF]=e,this[QP]=t,this[nF]=n}};function sF(e){return e[xP]}function cF(e){return`${e[QP]??`public`}.${e[xP]}`}var lF=class{static[Y]=`FakePrimitiveParam`};function uF(e){return e!=null&&typeof e.getSQL==`function`}function dF(e){let t={sql:``,params:[]};for(let n of e)t.sql+=n.sql,t.params.push(...n.params),n.typings?.length&&(t.typings||=[],t.typings.push(...n.typings));return t}var fF=class{static[Y]=`StringChunk`;value;constructor(e){this.value=Array.isArray(e)?e:[e]}getSQL(){return new pF([this])}},pF=class e{constructor(e){this.queryChunks=e;for(let t of e)if(X(t,oF)){let e=t[oF.Symbol.Schema];this.usedTables.push(e===void 0?t[oF.Symbol.Name]:e+`.`+t[oF.Symbol.Name])}}static[Y]=`SQL`;decoder=gF;shouldInlineParams=!1;usedTables=[];append(e){return this.queryChunks.push(...e.queryChunks),this}toQuery(e){return XP.startActiveSpan(`drizzle.buildSQL`,t=>{let n=this.buildQueryFromSourceParams(this.queryChunks,e);return t?.setAttributes({"drizzle.query.text":n.sql,"drizzle.query.params":JSON.stringify(n.params)}),n})}buildQueryFromSourceParams(t,n){let r=Object.assign({},n,{inlineParams:n.inlineParams||this.shouldInlineParams,paramStartIndex:n.paramStartIndex||{value:0}}),{casing:i,escapeName:a,escapeParam:o,prepareTyping:s,inlineParams:c,paramStartIndex:l}=r;return dF(t.map(t=>{if(X(t,fF))return{sql:t.value.join(``),params:[]};if(X(t,mF))return{sql:a(t.value),params:[]};if(t===void 0)return{sql:``,params:[]};if(Array.isArray(t)){let e=[new fF(`(`)];for(let[n,r]of t.entries())e.push(r),ne},_F={mapToDriverValue:e=>e},vF={...gF,..._F};var yF=class{constructor(e,t=_F){this.value=e,this.encoder=t}static[Y]=`Param`;brand;getSQL(){return new pF([this])}};function Z(e,...t){let n=[];(t.length>0||e.length>0&&e[0]!==``)&&n.push(new fF(e[0]));for(let[r,i]of t.entries())n.push(i,new fF(e[r+1]));return new pF(n)}(e=>{function t(){return new pF([])}e.empty=t;function n(e){return new pF(e)}e.fromList=n;function r(e){return new pF([new fF(e)])}e.raw=r;function i(e,t){let n=[];for(let[r,i]of e.entries())r>0&&t!==void 0&&n.push(t),n.push(i);return new pF(n)}e.join=i;function a(e){return new mF(e)}e.identifier=a;function o(e){return new bF(e)}e.placeholder=o;function s(e,t){return new yF(e,t)}e.param=s})(Z||={}),(e=>{class t{constructor(e,t){this.sql=e,this.fieldAlias=t}static[Y]=`SQL.Aliased`;isSelectionField=!1;getSQL(){return this.sql}clone(){return new t(this.sql,this.fieldAlias)}}e.Aliased=t})(pF||={});var bF=class{constructor(e){this.name=e}static[Y]=`Placeholder`;getSQL(){return new pF([this])}};function xF(e,t){return e.map(e=>{if(X(e,bF)){if(!(e.name in t))throw Error(`No value for placeholder "${e.name}" was provided`);return t[e.name]}if(X(e,yF)&&X(e.value,bF)){if(!(e.value.name in t))throw Error(`No value for placeholder "${e.value.name}" was provided`);return e.encoder.mapToDriverValue(t[e.value.name])}return e})}const SF=Symbol.for(`drizzle:IsDrizzleView`);var CF=class{static[Y]=`View`;[ZP];[SF]=!0;constructor({name:e,schema:t,selectedFields:n,query:r}){this[ZP]={name:e,originalName:e,schema:t,selectedFields:n,query:r,isExisting:!r,isAlias:!1}}getSQL(){return new pF([this])}};yP.prototype.getSQL=function(){return new pF([this])},oF.prototype.getSQL=function(){return new pF([this])},GP.prototype.getSQL=function(){return new pF([this])};var wF=class{constructor(e){this.table=e}static[Y]=`ColumnAliasProxyHandler`;get(e,t){return t===`table`?this.table:e[t]}},TF=class{constructor(e,t){this.alias=e,this.replaceOriginalName=t}static[Y]=`TableAliasProxyHandler`;get(e,t){if(t===oF.Symbol.IsAlias)return!0;if(t===oF.Symbol.Name||this.replaceOriginalName&&t===oF.Symbol.OriginalName)return this.alias;if(t===ZP)return{...e[ZP],name:this.alias,isAlias:!0};if(t===oF.Symbol.Columns){let t=e[oF.Symbol.Columns];if(!t)return t;let n={};return Object.keys(t).map(r=>{n[r]=new Proxy(t[r],new wF(new Proxy(e,this)))}),n}let n=e[t];return X(n,yP)?new Proxy(n,new wF(new Proxy(e,this))):n}},EF=class{constructor(e){this.alias=e}static[Y]=`RelationTableAliasProxyHandler`;get(e,t){return t===`sourceTable`?DF(e.sourceTable,this.alias):e[t]}};function DF(e,t){return new Proxy(e,new TF(t,!1))}function OF(e,t){return new Proxy(e,new wF(new Proxy(e.table,new TF(t,!1))))}function kF(e,t){return new pF.Aliased(AF(e.sql,t),e.fieldAlias)}function AF(e,t){return Z.join(e.queryChunks.map(e=>X(e,yP)?OF(e,t):X(e,pF)?AF(e,t):X(e,pF.Aliased)?kF(e,t):e))}var jF=class extends Error{static[Y]=`DrizzleError`;constructor({message:e,cause:t}){super(e),this.name=`DrizzleError`,this.cause=t}},MF=class extends jF{static[Y]=`TransactionRollbackError`;constructor(){super({message:`Rollback`})}},NF=class{static[Y]=`ConsoleLogWriter`;write(e){console.log(e)}},PF=class{static[Y]=`DefaultLogger`;writer;constructor(e){this.writer=e?.writer??new NF}logQuery(e,t){let n=t.map(e=>{try{return JSON.stringify(e)}catch{return String(e)}}),r=n.length?` -- params: [${n.join(`, `)}]`:``;this.writer.write(`Query: ${e}${r}`)}},FF=class{static[Y]=`NoopLogger`;logQuery(){}},IF=class{static[Y]=`QueryPromise`;[Symbol.toStringTag]=`QueryPromise`;catch(e){return this.then(void 0,e)}finally(e){return this.then(t=>(e?.(),t),t=>{throw e?.(),t})}then(e,t){return this.execute().then(e,t)}};function LF(e,t){return Object.entries(e).reduce((e,[n,r])=>{if(typeof n!=`string`)return e;let i=t?[...t,n]:[n];return X(r,yP)||X(r,pF)||X(r,pF.Aliased)?e.push({path:i,field:r}):X(r,oF)?e.push(...LF(r[oF.Symbol.Columns],i)):e.push(...LF(r,i)),e},[])}function RF(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let[e,t]of n.entries())if(t!==r[e])return!1;return!0}function zF(e,t){let n=Object.entries(t).filter(([,e])=>e!==void 0).map(([t,n])=>X(n,pF)||X(n,yP)?[t,n]:[t,new yF(n,e[oF.Symbol.Columns][t])]);if(n.length===0)throw Error(`No values to set`);return Object.fromEntries(n)}function BF(e,t){for(let n of t)for(let t of Object.getOwnPropertyNames(n.prototype)){if(t===`constructor`)continue;Object.defineProperty(e.prototype,t,Object.getOwnPropertyDescriptor(n.prototype,t)||Object.create(null))}}function VF(e){return e[oF.Symbol.Columns]}function HF(e){return X(e,GP)?e._.alias:X(e,CF)?e[ZP].name:X(e,pF)?void 0:e[oF.Symbol.IsAlias]?e[oF.Symbol.Name]:e[oF.Symbol.BaseName]}function UF(e){if(typeof e!=`object`||!e||e.constructor.name!==`Object`)return!1;if(`logger`in e){let t=typeof e.logger;return!(t!==`boolean`&&(t!==`object`||typeof e.logger.logQuery!=`function`)&&t!==`undefined`)}if(`schema`in e){let t=typeof e.schema;return!(t!==`object`&&t!==`undefined`)}if(`casing`in e){let t=typeof e.casing;return!(t!==`string`&&t!==`undefined`)}if(`mode`in e)return!(e.mode!==`default`||e.mode!==`planetscale`||e.mode!==void 0);if(`connection`in e){let t=typeof e.connection;return!(t!==`string`&&t!==`object`&&t!==`undefined`)}if(`client`in e){let t=typeof e.client;return!(t!==`object`&&t!==`function`&&t!==`undefined`)}return Object.keys(e).length===0}var WF=class extends NP{static[Y]=`PgDateColumnBaseBuilder`;defaultNow(){return this.default(Z`now()`)}},GF=class extends WF{static[Y]=`PgDateBuilder`;constructor(e){super(e,`date`,`PgDate`)}build(e){return new KF(e,this.config)}},KF=class extends PP{static[Y]=`PgDate`;getSQLType(){return`date`}mapFromDriverValue(e){return new Date(e)}mapToDriverValue(e){return e.toISOString()}},qF=class extends WF{static[Y]=`PgDateStringBuilder`;constructor(e){super(e,`string`,`PgDateString`)}build(e){return new JF(e,this.config)}},JF=class extends PP{static[Y]=`PgDateString`;getSQLType(){return`date`}},YF=class extends NP{static[Y]=`PgJsonBuilder`;constructor(e){super(e,`json`,`PgJson`)}build(e){return new XF(e,this.config)}},XF=class extends PP{static[Y]=`PgJson`;constructor(e,t){super(e,t)}getSQLType(){return`json`}mapToDriverValue(e){return JSON.stringify(e)}mapFromDriverValue(e){if(typeof e==`string`)try{return JSON.parse(e)}catch{return e}return e}},ZF=class extends NP{static[Y]=`PgJsonbBuilder`;constructor(e){super(e,`json`,`PgJsonb`)}build(e){return new QF(e,this.config)}},QF=class extends PP{static[Y]=`PgJsonb`;constructor(e,t){super(e,t)}getSQLType(){return`jsonb`}mapToDriverValue(e){return JSON.stringify(e)}mapFromDriverValue(e){if(typeof e==`string`)try{return JSON.parse(e)}catch{return e}return e}},$F=class extends NP{static[Y]=`PgNumericBuilder`;constructor(e,t,n){super(e,`string`,`PgNumeric`),this.config.precision=t,this.config.scale=n}build(e){return new eI(e,this.config)}},eI=class extends PP{static[Y]=`PgNumeric`;precision;scale;constructor(e,t){super(e,t),this.precision=t.precision,this.scale=t.scale}mapFromDriverValue(e){return typeof e==`string`?e:String(e)}getSQLType(){return this.precision!==void 0&&this.scale!==void 0?`numeric(${this.precision}, ${this.scale})`:this.precision===void 0?`numeric`:`numeric(${this.precision})`}},tI=class extends NP{static[Y]=`PgNumericNumberBuilder`;constructor(e,t,n){super(e,`number`,`PgNumericNumber`),this.config.precision=t,this.config.scale=n}build(e){return new nI(e,this.config)}},nI=class extends PP{static[Y]=`PgNumericNumber`;precision;scale;constructor(e,t){super(e,t),this.precision=t.precision,this.scale=t.scale}mapFromDriverValue(e){return typeof e==`number`?e:Number(e)}mapToDriverValue=String;getSQLType(){return this.precision!==void 0&&this.scale!==void 0?`numeric(${this.precision}, ${this.scale})`:this.precision===void 0?`numeric`:`numeric(${this.precision})`}},rI=class extends NP{static[Y]=`PgNumericBigIntBuilder`;constructor(e,t,n){super(e,`bigint`,`PgNumericBigInt`),this.config.precision=t,this.config.scale=n}build(e){return new iI(e,this.config)}},iI=class extends PP{static[Y]=`PgNumericBigInt`;precision;scale;constructor(e,t){super(e,t),this.precision=t.precision,this.scale=t.scale}mapFromDriverValue=BigInt;mapToDriverValue=String;getSQLType(){return this.precision!==void 0&&this.scale!==void 0?`numeric(${this.precision}, ${this.scale})`:this.precision===void 0?`numeric`:`numeric(${this.precision})`}},aI=class extends WF{constructor(e,t,n){super(e,`string`,`PgTime`),this.withTimezone=t,this.precision=n,this.config.withTimezone=t,this.config.precision=n}static[Y]=`PgTimeBuilder`;build(e){return new oI(e,this.config)}},oI=class extends PP{static[Y]=`PgTime`;withTimezone;precision;constructor(e,t){super(e,t),this.withTimezone=t.withTimezone,this.precision=t.precision}getSQLType(){let e=this.precision===void 0?``:`(${this.precision})`;return`time${e}${this.withTimezone?` with time zone`:``}`}},sI=class extends WF{static[Y]=`PgTimestampBuilder`;constructor(e,t,n){super(e,`date`,`PgTimestamp`),this.config.withTimezone=t,this.config.precision=n}build(e){return new cI(e,this.config)}},cI=class extends PP{static[Y]=`PgTimestamp`;withTimezone;precision;constructor(e,t){super(e,t),this.withTimezone=t.withTimezone,this.precision=t.precision}getSQLType(){let e=this.precision===void 0?``:` (${this.precision})`;return`timestamp${e}${this.withTimezone?` with time zone`:``}`}mapFromDriverValue=e=>new Date(this.withTimezone?e:e+`+0000`);mapToDriverValue=e=>e.toISOString()},lI=class extends WF{static[Y]=`PgTimestampStringBuilder`;constructor(e,t,n){super(e,`string`,`PgTimestampString`),this.config.withTimezone=t,this.config.precision=n}build(e){return new uI(e,this.config)}},uI=class extends PP{static[Y]=`PgTimestampString`;withTimezone;precision;constructor(e,t){super(e,t),this.withTimezone=t.withTimezone,this.precision=t.precision}getSQLType(){let e=this.precision===void 0?``:`(${this.precision})`;return`timestamp${e}${this.withTimezone?` with time zone`:``}`}},dI=class extends NP{static[Y]=`PgUUIDBuilder`;constructor(e){super(e,`string`,`PgUUID`)}defaultRandom(){return this.default(Z`gen_random_uuid()`)}build(e){return new fI(e,this.config)}},fI=class extends PP{static[Y]=`PgUUID`;getSQLType(){return`uuid`}};const pI=Symbol.for(`drizzle:PgInlineForeignKeys`),mI=Symbol.for(`drizzle:EnableRLS`);var hI=class extends oF{static[Y]=`PgTable`;static Symbol=Object.assign({},oF.Symbol,{InlineForeignKeys:pI,EnableRLS:mI});[pI]=[];[mI]=!1;[oF.Symbol.ExtraConfigBuilder]=void 0;[oF.Symbol.ExtraConfigColumns]={}},gI=class{static[Y]=`PgPrimaryKeyBuilder`;columns;name;constructor(e,t){this.columns=e,this.name=t}build(e){return new _I(e,this.columns,this.name)}},_I=class{constructor(e,t,n){this.table=e,this.columns=t,this.name=n}static[Y]=`PgPrimaryKey`;columns;name;getName(){return this.name??`${this.table[hI.Symbol.Name]}_${this.columns.map(e=>e.name).join(`_`)}_pk`}};function vI(e,t){return hF(t)&&!uF(e)&&!X(e,yF)&&!X(e,bF)&&!X(e,yP)&&!X(e,oF)&&!X(e,CF)?new yF(e,t):e}const yI=(e,t)=>Z`${e} = ${vI(t,e)}`,bI=(e,t)=>Z`${e} <> ${vI(t,e)}`;function xI(...e){let t=e.filter(e=>e!==void 0);if(t.length!==0)return t.length===1?new pF(t):new pF([new fF(`(`),Z.join(t,new fF(` and `)),new fF(`)`)])}function SI(...e){let t=e.filter(e=>e!==void 0);if(t.length!==0)return t.length===1?new pF(t):new pF([new fF(`(`),Z.join(t,new fF(` or `)),new fF(`)`)])}function CI(e){return Z`not ${e}`}const wI=(e,t)=>Z`${e} > ${vI(t,e)}`,TI=(e,t)=>Z`${e} >= ${vI(t,e)}`,EI=(e,t)=>Z`${e} < ${vI(t,e)}`,DI=(e,t)=>Z`${e} <= ${vI(t,e)}`;function OI(e,t){return Array.isArray(t)?t.length===0?Z`false`:Z`${e} in ${t.map(t=>vI(t,e))}`:Z`${e} in ${vI(t,e)}`}function kI(e,t){return Array.isArray(t)?t.length===0?Z`true`:Z`${e} not in ${t.map(t=>vI(t,e))}`:Z`${e} not in ${vI(t,e)}`}function AI(e){return Z`${e} is null`}function jI(e){return Z`${e} is not null`}function MI(e){return Z`exists ${e}`}function NI(e){return Z`not exists ${e}`}function PI(e,t,n){return Z`${e} between ${vI(t,e)} and ${vI(n,e)}`}function FI(e,t,n){return Z`${e} not between ${vI(t,e)} and ${vI(n,e)}`}function II(e,t){return Z`${e} like ${t}`}function LI(e,t){return Z`${e} not like ${t}`}function RI(e,t){return Z`${e} ilike ${t}`}function zI(e,t){return Z`${e} not ilike ${t}`}function BI(e){return Z`${e} asc`}function VI(e){return Z`${e} desc`}var HI=class{constructor(e,t,n){this.sourceTable=e,this.referencedTable=t,this.relationName=n,this.referencedTableName=t[oF.Symbol.Name]}static[Y]=`Relation`;referencedTableName;fieldName},UI=class{constructor(e,t){this.table=e,this.config=t}static[Y]=`Relations`},WI=class e extends HI{constructor(e,t,n,r){super(e,t,n?.relationName),this.config=n,this.isNullable=r}static[Y]=`One`;withFieldName(t){let n=new e(this.sourceTable,this.referencedTable,this.config,this.isNullable);return n.fieldName=t,n}},GI=class e extends HI{constructor(e,t,n){super(e,t,n?.relationName),this.config=n}static[Y]=`Many`;withFieldName(t){let n=new e(this.sourceTable,this.referencedTable,this.config);return n.fieldName=t,n}};function KI(){return{and:xI,between:PI,eq:yI,exists:MI,gt:wI,gte:TI,ilike:RI,inArray:OI,isNull:AI,isNotNull:jI,like:II,lt:EI,lte:DI,ne:bI,not:CI,notBetween:FI,notExists:NI,notLike:LI,notIlike:zI,notInArray:kI,or:SI,sql:Z}}function qI(){return{sql:Z,asc:BI,desc:VI}}function JI(e,t){Object.keys(e).length===1&&`default`in e&&!X(e.default,oF)&&(e=e.default);let n={},r={},i={};for(let[a,o]of Object.entries(e))if(X(o,oF)){let e=cF(o),t=r[e];n[e]=a,i[a]={tsName:a,dbName:o[oF.Symbol.Name],schema:o[oF.Symbol.Schema],columns:o[oF.Symbol.Columns],relations:t?.relations??{},primaryKey:t?.primaryKey??[]};for(let e of Object.values(o[oF.Symbol.Columns]))e.primary&&i[a].primaryKey.push(e);let s=o[oF.Symbol.ExtraConfigBuilder]?.(o[oF.Symbol.ExtraConfigColumns]);if(s)for(let e of Object.values(s))X(e,gI)&&i[a].primaryKey.push(...e.columns)}else if(X(o,UI)){let e=cF(o.table),a=n[e],s=o.config(t(o.table)),c;for(let[t,n]of Object.entries(s))if(a){let e=i[a];e.relations[t]=n,c&&e.primaryKey.push(...c)}else e in r||(r[e]={relations:{},primaryKey:c}),r[e].relations[t]=n}return{tables:i,tableNamesMap:n}}function YI(e){return function(t,n){return new WI(e,t,n,n?.fields.reduce((e,t)=>e&&t.notNull,!0)??!1)}}function XI(e){return function(t,n){return new GI(e,t,n)}}function ZI(e,t,n){if(X(n,WI)&&n.config)return{fields:n.config.fields,references:n.config.references};let r=t[cF(n.referencedTable)];if(!r)throw Error(`Table "${n.referencedTable[oF.Symbol.Name]}" not found in schema`);let i=e[r];if(!i)throw Error(`Table "${r}" not found in schema`);let a=n.sourceTable,o=t[cF(a)];if(!o)throw Error(`Table "${a[oF.Symbol.Name]}" not found in schema`);let s=[];for(let e of Object.values(i.relations))(n.relationName&&n!==e&&e.relationName===n.relationName||!n.relationName&&e.referencedTable===n.sourceTable)&&s.push(e);if(s.length>1)throw n.relationName?Error(`There are multiple relations with name "${n.relationName}" in table "${r}"`):Error(`There are multiple relations between "${r}" and "${n.sourceTable[oF.Symbol.Name]}". Please specify relation name`);if(s[0]&&X(s[0],WI)&&s[0].config)return{fields:s[0].config.references,references:s[0].config.fields};throw Error(`There is not enough information to infer relation "${o}.${n.fieldName}"`)}function QI(e){return{one:YI(e),many:XI(e)}}function $I(e,t,n,r,i=e=>e){let a={};for(let[o,s]of r.entries())if(s.isJson){let r=t.relations[s.tsKey],c=n[o],l=typeof c==`string`?JSON.parse(c):c;a[s.tsKey]=X(r,WI)?l&&$I(e,e[s.relationTableTsKey],l,s.selection,i):l.map(t=>$I(e,e[s.relationTableTsKey],t,s.selection,i))}else{let e=i(n[o]),t=s.field,r;r=X(t,yP)?t:X(t,pF)?t.decoder:t.sql.decoder,a[s.tsKey]=e===null?null:r.mapFromDriverValue(e)}return a}var eL=class e{static[Y]=`SelectionProxyHandler`;config;constructor(e){this.config={...e}}get(t,n){if(n===`_`)return{...t._,selectedFields:new Proxy(t._.selectedFields,this)};if(n===ZP)return{...t[ZP],selectedFields:new Proxy(t[ZP].selectedFields,this)};if(typeof n==`symbol`)return t[n];let r=X(t,GP)?t._.selectedFields:X(t,CF)?t[ZP].selectedFields:t,i=r[n];if(X(i,pF.Aliased)){if(this.config.sqlAliasedBehavior===`sql`&&!i.isSelectionField)return i.sql;let e=i.clone();return e.isSelectionField=!0,e}if(X(i,pF)){if(this.config.sqlBehavior===`sql`)return i;throw Error(`You tried to reference "${n}" field from a subquery, which is a raw SQL field, but it doesn't have an alias declared. Please add an alias to the field using ".as('alias')" method.`)}return X(i,yP)?this.config.alias?new Proxy(i,new wF(new Proxy(i.table,new TF(this.config.alias,this.config.replaceOriginalName??!1)))):i:typeof i!=`object`||!i?i:new Proxy(i,new e(this.config))}};function tL(e){let t=e.replace(/['\u2019]/g,``).match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[];return t.map(e=>e.toLowerCase()).join(`_`)}function nL(e){let t=e.replace(/['\u2019]/g,``).match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[];return t.reduce((e,t,n)=>{let r=n===0?t.toLowerCase():`${t[0].toUpperCase()}${t.slice(1)}`;return e+r},``)}function rL(e){return e}var iL=class{static[Y]=`CasingCache`;cache={};cachedTables={};convert;constructor(e){this.convert=e===`snake_case`?tL:e===`camelCase`?nL:rL}getColumnCasing(e){if(!e.keyAsName)return e.name;let t=e.table[oF.Symbol.Schema]??`public`,n=e.table[oF.Symbol.OriginalName],r=`${t}.${n}.${e.name}`;return this.cache[r]||this.cacheTable(e.table),this.cache[r]}cacheTable(e){let t=e[oF.Symbol.Schema]??`public`,n=e[oF.Symbol.OriginalName],r=`${t}.${n}`;if(!this.cachedTables[r]){for(let t of Object.values(e[oF.Symbol.Columns])){let e=`${r}.${t.name}`;this.cache[e]=this.convert(t.name)}this.cachedTables[r]=!0}}clearCache(){this.cache={},this.cachedTables={}}},aL=class extends CF{static[Y]=`PgViewBase`},oL=class{static[Y]=`PgDialect`;casing;constructor(e){this.casing=new iL(e?.casing)}async migrate(e,t,n){let r=typeof n==`string`?`__drizzle_migrations`:n.migrationsTable??`__drizzle_migrations`,i=typeof n==`string`?`drizzle`:n.migrationsSchema??`drizzle`,a=Z` CREATE TABLE IF NOT EXISTS ${Z.identifier(i)}.${Z.identifier(r)} ( id SERIAL PRIMARY KEY, hash text NOT NULL, created_at bigint ) `;await t.execute(Z`CREATE SCHEMA IF NOT EXISTS ${Z.identifier(i)}`),await t.execute(a);let o=await t.all(Z`select id, hash, created_at from ${Z.identifier(i)}.${Z.identifier(r)} order by created_at desc limit 1`),s=o[0];await t.transaction(async t=>{for await(let n of e)if(!s||Number(s.created_at)t[e]!==void 0||n[e]?.onUpdateFn!==void 0),i=r.length;return Z.join(r.flatMap((e,r)=>{let a=n[e],o=t[e]??Z.param(a.onUpdateFn(),a),s=Z`${Z.identifier(this.casing.getColumnCasing(a))} = ${o}`;return r{let i=[];if(X(e,pF.Aliased)&&e.isSelectionField)i.push(Z.identifier(e.fieldAlias));else if(X(e,pF.Aliased)||X(e,pF)){let n=X(e,pF.Aliased)?e.sql:e;t?i.push(new pF(n.queryChunks.map(e=>X(e,PP)?Z.identifier(this.casing.getColumnCasing(e)):e))):i.push(n),X(e,pF.Aliased)&&i.push(Z` as ${Z.identifier(e.fieldAlias)}`)}else X(e,yP)&&(t?i.push(Z.identifier(this.casing.getColumnCasing(e))):i.push(e));return ro?.some(({alias:t})=>t===(e[oF.Symbol.IsAlias]?sF(e):e[oF.Symbol.BaseName])))(e.field.table)){let t=sF(e.field.table);throw Error(`Your "${e.path.join(`->`)}" field references a column "${t}"."${e.field.name}", but the table "${t}" is not part of the query! Did you forget to join it?`)}let h=!o||o.length===0,g=this.buildWithCTE(e),_;f&&(_=f===!0?Z` distinct`:Z` distinct on (${Z.join(f.on,Z`, `)})`);let v=this.buildSelection(m,{isSingleTable:h}),y=this.buildFromTable(a),b=this.buildJoins(o),x=r?Z` where ${r}`:void 0,S=i?Z` having ${i}`:void 0,C;s&&s.length>0&&(C=Z` order by ${Z.join(s,Z`, `)}`);let w;c&&c.length>0&&(w=Z` group by ${Z.join(c,Z`, `)}`);let T=typeof l==`object`||typeof l==`number`&&l>=0?Z` limit ${l}`:void 0,E=u?Z` offset ${u}`:void 0,D=Z.empty();if(d){let e=Z` for ${Z.raw(d.strength)}`;d.config.of&&e.append(Z` of ${Z.join(Array.isArray(d.config.of)?d.config.of:[d.config.of],Z`, `)}`),d.config.noWait?e.append(Z` nowait`):d.config.skipLocked&&e.append(Z` skip locked`),D.append(e)}let O=Z`${g}select${_} ${v} from ${y}${b}${x}${w}${S}${C}${T}${E}${D}`;return p.length>0?this.buildSetOperations(O,p):O}buildSetOperations(e,t){let[n,...r]=t;if(!n)throw Error(`Cannot pass undefined values to any set operator`);return r.length===0?this.buildSetOperationQuery({leftSelect:e,setOperator:n}):this.buildSetOperations(this.buildSetOperationQuery({leftSelect:e,setOperator:n}),r)}buildSetOperationQuery({leftSelect:e,setOperator:{type:t,isAll:n,rightSelect:r,limit:i,orderBy:a,offset:o}}){let s=Z`(${e.getSQL()}) `,c=Z`(${r.getSQL()})`,l;if(a&&a.length>0){let e=[];for(let t of a)if(X(t,PP))e.push(Z.identifier(t.name));else if(X(t,pF)){for(let e=0;e=0?Z` limit ${i}`:void 0,d=Z.raw(`${t} ${n?`all `:``}`),f=o?Z` offset ${o}`:void 0;return Z`${s}${d}${c}${l}${u}${f}`}buildInsertQuery({table:e,values:t,onConflict:n,returning:r,withList:i,select:a,overridingSystemValue_:o}){let s=[],c=e[oF.Symbol.Columns],l=Object.entries(c).filter(([e,t])=>!t.shouldDisableInsert()),u=l.map(([,e])=>Z.identifier(this.casing.getColumnCasing(e)));if(a){let e=t;X(e,pF)?s.push(e):s.push(e.getSQL())}else{let e=t;s.push(Z.raw(`values `));for(let[t,n]of e.entries()){let r=[];for(let[e,t]of l){let i=n[e];if(i===void 0||X(i,yF)&&i.value===void 0)if(t.defaultFn!==void 0){let e=t.defaultFn(),n=X(e,pF)?e:Z.param(e,t);r.push(n)}else if(!t.default&&t.onUpdateFn!==void 0){let e=t.onUpdateFn(),n=X(e,pF)?e:Z.param(e,t);r.push(n)}else r.push(Z`default`);else r.push(i)}s.push(r),t({dbKey:t.name,tsKey:e,field:OF(t,o),relationTableTsKey:void 0,isJson:!1,selection:[]}))}else{let r=Object.fromEntries(Object.entries(i.columns).map(([e,t])=>[e,OF(t,o)]));if(a.where){let e=typeof a.where==`function`?a.where(r,KI()):a.where;p=e&&AF(e,o)}let s=[],c=[];if(a.columns){let e=!1;for(let[t,n]of Object.entries(a.columns)){if(n===void 0)continue;t in i.columns&&(!e&&n===!0&&(e=!0),c.push(t))}c.length>0&&(c=e?c.filter(e=>a.columns?.[e]===!0):Object.keys(i.columns).filter(e=>!c.includes(e)))}else c=Object.keys(i.columns);for(let e of c){let t=i.columns[e];s.push({tsKey:e,value:t})}let h=[];a.with&&(h=Object.entries(a.with).filter(e=>!!e[1]).map(([e,t])=>({tsKey:e,queryConfig:t,relation:i.relations[e]})));let g;if(a.extras){g=typeof a.extras==`function`?a.extras(r,{sql:Z}):a.extras;for(let[e,t]of Object.entries(g))s.push({tsKey:e,value:kF(t,o)})}for(let{tsKey:e,value:t}of s)l.push({dbKey:X(t,pF.Aliased)?t.fieldAlias:i.columns[e].name,tsKey:e,field:X(t,yP)?OF(t,o):t,relationTableTsKey:void 0,isJson:!1,selection:[]});let _=typeof a.orderBy==`function`?a.orderBy(r,qI()):a.orderBy??[];Array.isArray(_)||(_=[_]),f=_.map(e=>X(e,yP)?OF(e,o):AF(e,o)),u=a.limit,d=a.offset;for(let{tsKey:r,queryConfig:i,relation:a}of h){let s=ZI(t,n,a),c=cF(a.referencedTable),u=n[c],d=`${o}_${r}`,f=xI(...s.fields.map((e,t)=>yI(OF(s.references[t],d),OF(e,o)))),p=this.buildRelationalQueryWithoutPK({fullSchema:e,schema:t,tableNamesMap:n,table:e[u],tableConfig:t[u],queryConfig:X(a,WI)?i===!0?{limit:1}:{...i,limit:1}:i,tableAlias:d,joinOn:f,nestedQueryRelation:a}),h=Z`${Z.identifier(d)}.${Z.identifier(`data`)}`.as(r);m.push({on:Z`true`,table:new GP(p.sql,{},d),alias:d,joinType:`left`,lateral:!0}),l.push({dbKey:r,tsKey:r,field:h,relationTableTsKey:u,isJson:!0,selection:p.selection})}}if(l.length===0)throw new jF({message:`No fields selected for table "${i.tsName}" ("${o}")`});let h;if(p=xI(c,p),s){let e=Z`json_build_array(${Z.join(l.map(({field:e,tsKey:t,isJson:n})=>n?Z`${Z.identifier(`${o}_${t}`)}.${Z.identifier(`data`)}`:X(e,pF.Aliased)?e.sql:e),Z`, `)})`;X(s,GI)&&(e=Z`coalesce(json_agg(${e}${f.length>0?Z` order by ${Z.join(f,Z`, `)}`:void 0}), '[]'::json)`);let t=[{dbKey:`data`,tsKey:`data`,field:e.as(`data`),isJson:!0,relationTableTsKey:i.tsName,selection:l}],n=u!==void 0||d!==void 0||f.length>0;n?(h=this.buildSelectQuery({table:DF(r,o),fields:{},fieldsFlat:[{path:[],field:Z.raw(`*`)}],where:p,limit:u,offset:d,orderBy:f,setOperators:[]}),p=void 0,u=void 0,d=void 0,f=[]):h=DF(r,o),h=this.buildSelectQuery({table:X(h,hI)?h:new GP(h,{},o),fields:{},fieldsFlat:t.map(({field:e})=>({path:[],field:X(e,yP)?OF(e,o):e})),joins:m,where:p,limit:u,offset:d,orderBy:f,setOperators:[]})}else h=this.buildSelectQuery({table:DF(r,o),fields:{},fieldsFlat:l.map(({field:e})=>({path:[],field:X(e,yP)?OF(e,o):e})),joins:m,where:p,limit:u,offset:d,orderBy:f,setOperators:[]});return{tableTsKey:i.tsName,sql:h,selection:l}}},sL=class{static[Y]=`TypedQueryBuilder`;getSelectedFields(){return this._.selectedFields}},cL=class{static[Y]=`PgSelectBuilder`;fields;session;dialect;withList=[];distinct;constructor(e){this.fields=e.fields,this.session=e.session,this.dialect=e.dialect,e.withList&&(this.withList=e.withList),this.distinct=e.distinct}authToken;setToken(e){return this.authToken=e,this}from(e){let t=!!this.fields,n=e,r;return r=this.fields?this.fields:X(n,GP)?Object.fromEntries(Object.keys(n._.selectedFields).map(e=>[e,n[e]])):X(n,aL)?n[ZP].selectedFields:X(n,pF)?{}:VF(n),new uL({table:n,fields:r,isPartialSelect:t,session:this.session,dialect:this.dialect,withList:this.withList,distinct:this.distinct}).setToken(this.authToken)}},lL=class extends sL{static[Y]=`PgSelectQueryBuilder`;_;config;joinsNotNullableMap;tableName;isPartialSelect;session;dialect;cacheConfig=void 0;usedTables=new Set;constructor({table:e,fields:t,isPartialSelect:n,session:r,dialect:i,withList:a,distinct:o}){super(),this.config={withList:a,table:e,fields:{...t},distinct:o,setOperators:[]},this.isPartialSelect=n,this.session=r,this.dialect=i,this._={selectedFields:t,config:this.config},this.tableName=HF(e),this.joinsNotNullableMap=typeof this.tableName==`string`?{[this.tableName]:!0}:{};for(let t of bL(e))this.usedTables.add(t)}getUsedTables(){return[...this.usedTables]}createJoin(e,t){return(n,r)=>{let i=this.tableName,a=HF(n);for(let e of bL(n))this.usedTables.add(e);if(typeof a==`string`&&this.config.joins?.some(e=>e.alias===a))throw Error(`Alias "${a}" is already used in this query`);if(!this.isPartialSelect&&(Object.keys(this.joinsNotNullableMap).length===1&&typeof i==`string`&&(this.config.fields={[i]:this.config.fields}),typeof a==`string`&&!X(n,pF))){let e=X(n,GP)?n._.selectedFields:X(n,CF)?n[ZP].selectedFields:n[oF.Symbol.Columns];this.config.fields[a]=e}if(typeof r==`function`&&(r=r(new Proxy(this.config.fields,new eL({sqlAliasedBehavior:`sql`,sqlBehavior:`sql`})))),this.config.joins||(this.config.joins=[]),this.config.joins.push({on:r,table:n,joinType:e,alias:a,lateral:t}),typeof a==`string`)switch(e){case`left`:this.joinsNotNullableMap[a]=!1;break;case`right`:this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([e])=>[e,!1])),this.joinsNotNullableMap[a]=!0;break;case`cross`:case`inner`:this.joinsNotNullableMap[a]=!0;break;case`full`:this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([e])=>[e,!1])),this.joinsNotNullableMap[a]=!1;break}return this}}leftJoin=this.createJoin(`left`,!1);leftJoinLateral=this.createJoin(`left`,!0);rightJoin=this.createJoin(`right`,!1);innerJoin=this.createJoin(`inner`,!1);innerJoinLateral=this.createJoin(`inner`,!0);fullJoin=this.createJoin(`full`,!1);crossJoin=this.createJoin(`cross`,!1);crossJoinLateral=this.createJoin(`cross`,!0);createSetOperator(e,t){return n=>{let r=typeof n==`function`?n(fL()):n;if(!RF(this.getSelectedFields(),r.getSelectedFields()))throw Error(`Set operator error (union / intersect / except): selected fields are not the same or are in a different order`);return this.config.setOperators.push({type:e,isAll:t,rightSelect:r}),this}}union=this.createSetOperator(`union`,!1);unionAll=this.createSetOperator(`union`,!0);intersect=this.createSetOperator(`intersect`,!1);intersectAll=this.createSetOperator(`intersect`,!0);except=this.createSetOperator(`except`,!1);exceptAll=this.createSetOperator(`except`,!0);addSetOperators(e){return this.config.setOperators.push(...e),this}where(e){return typeof e==`function`&&(e=e(new Proxy(this.config.fields,new eL({sqlAliasedBehavior:`sql`,sqlBehavior:`sql`})))),this.config.where=e,this}having(e){return typeof e==`function`&&(e=e(new Proxy(this.config.fields,new eL({sqlAliasedBehavior:`sql`,sqlBehavior:`sql`})))),this.config.having=e,this}groupBy(...e){if(typeof e[0]==`function`){let t=e[0](new Proxy(this.config.fields,new eL({sqlAliasedBehavior:`alias`,sqlBehavior:`sql`})));this.config.groupBy=Array.isArray(t)?t:[t]}else this.config.groupBy=e;return this}orderBy(...e){if(typeof e[0]==`function`){let t=e[0](new Proxy(this.config.fields,new eL({sqlAliasedBehavior:`alias`,sqlBehavior:`sql`}))),n=Array.isArray(t)?t:[t];this.config.setOperators.length>0?this.config.setOperators.at(-1).orderBy=n:this.config.orderBy=n}else{let t=e;this.config.setOperators.length>0?this.config.setOperators.at(-1).orderBy=t:this.config.orderBy=t}return this}limit(e){return this.config.setOperators.length>0?this.config.setOperators.at(-1).limit=e:this.config.limit=e,this}offset(e){return this.config.setOperators.length>0?this.config.setOperators.at(-1).offset=e:this.config.offset=e,this}for(e,t={}){return this.config.lockingClause={strength:e,config:t},this}getSQL(){return this.dialect.buildSelectQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}as(e){let t=[];if(t.push(...bL(this.config.table)),this.config.joins)for(let e of this.config.joins)t.push(...bL(e.table));return new Proxy(new GP(this.getSQL(),this.config.fields,e,!1,[...new Set(t)]),new eL({alias:e,sqlAliasedBehavior:`alias`,sqlBehavior:`error`}))}getSelectedFields(){return new Proxy(this.config.fields,new eL({alias:this.tableName,sqlAliasedBehavior:`alias`,sqlBehavior:`error`}))}$dynamic(){return this}$withCache(e){return this.cacheConfig=e===void 0?{config:{},enable:!0,autoInvalidate:!0}:e===!1?{enable:!1}:{enable:!0,autoInvalidate:!0,...e},this}},uL=class extends lL{static[Y]=`PgSelect`;_prepare(e){let{session:t,config:n,dialect:r,joinsNotNullableMap:i,authToken:a,cacheConfig:o,usedTables:s}=this;if(!t)throw Error(`Cannot execute a query on a query builder. Please use a database instance instead.`);let{fields:c}=n;return XP.startActiveSpan(`drizzle.prepareQuery`,()=>{let n=LF(c),l=t.prepareQuery(r.sqlToQuery(this.getSQL()),n,e,!0,void 0,{type:`select`,tables:[...s]},o);return l.joinsNotNullableMap=i,l.setToken(a)})}prepare(e){return this._prepare(e)}authToken;setToken(e){return this.authToken=e,this}execute=e=>XP.startActiveSpan(`drizzle.operation`,()=>this._prepare().execute(e,this.authToken))};BF(uL,[IF]);function dL(e,t){return(n,r,...i)=>{let a=[r,...i].map(n=>({type:e,isAll:t,rightSelect:n}));for(let e of a)if(!RF(n.getSelectedFields(),e.rightSelect.getSelectedFields()))throw Error(`Set operator error (union / intersect / except): selected fields are not the same or are in a different order`);return n.addSetOperators(a)}}const fL=()=>({union:pL,unionAll:mL,intersect:hL,intersectAll:gL,except:_L,exceptAll:vL}),pL=dL(`union`,!1),mL=dL(`union`,!0),hL=dL(`intersect`,!1),gL=dL(`intersect`,!0),_L=dL(`except`,!1),vL=dL(`except`,!0);var yL=class{static[Y]=`PgQueryBuilder`;dialect;dialectConfig;constructor(e){this.dialect=X(e,oL)?e:void 0,this.dialectConfig=X(e,oL)?void 0:e}$with=(e,t)=>{let n=this,r=r=>(typeof r==`function`&&(r=r(n)),new Proxy(new KP(r.getSQL(),t??(`getSelectedFields`in r?r.getSelectedFields()??{}:{}),e,!0),new eL({alias:e,sqlAliasedBehavior:`alias`,sqlBehavior:`error`})));return{as:r}};with(...e){let t=this;function n(n){return new cL({fields:n??void 0,session:void 0,dialect:t.getDialect(),withList:e})}function r(e){return new cL({fields:e??void 0,session:void 0,dialect:t.getDialect(),distinct:!0})}function i(e,n){return new cL({fields:n??void 0,session:void 0,dialect:t.getDialect(),distinct:{on:e}})}return{select:n,selectDistinct:r,selectDistinctOn:i}}select(e){return new cL({fields:e??void 0,session:void 0,dialect:this.getDialect()})}selectDistinct(e){return new cL({fields:e??void 0,session:void 0,dialect:this.getDialect(),distinct:!0})}selectDistinctOn(e,t){return new cL({fields:t??void 0,session:void 0,dialect:this.getDialect(),distinct:{on:e}})}getDialect(){return this.dialect||=new oL(this.dialectConfig),this.dialect}};function bL(e){return X(e,hI)?[e[QP]?`${e[QP]}.${e[oF.Symbol.BaseName]}`:e[oF.Symbol.BaseName]]:X(e,GP)?e._.usedTables??[]:X(e,pF)?e.usedTables??[]:[]}var xL=class extends IF{constructor(e,t,n,r){super(),this.session=t,this.dialect=n,this.config={table:e,withList:r}}static[Y]=`PgDelete`;config;cacheConfig;where(e){return this.config.where=e,this}returning(e=this.config.table[oF.Symbol.Columns]){return this.config.returningFields=e,this.config.returning=LF(e),this}getSQL(){return this.dialect.buildDeleteQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}_prepare(e){return XP.startActiveSpan(`drizzle.prepareQuery`,()=>this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,e,!0,void 0,{type:`delete`,tables:bL(this.config.table)},this.cacheConfig))}prepare(e){return this._prepare(e)}authToken;setToken(e){return this.authToken=e,this}execute=e=>XP.startActiveSpan(`drizzle.operation`,()=>this._prepare().execute(e,this.authToken));getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new eL({alias:sF(this.config.table),sqlAliasedBehavior:`alias`,sqlBehavior:`error`})):void 0}$dynamic(){return this}},SL=class{constructor(e,t,n,r,i){this.table=e,this.session=t,this.dialect=n,this.withList=r,this.overridingSystemValue_=i}static[Y]=`PgInsertBuilder`;authToken;setToken(e){return this.authToken=e,this}overridingSystemValue(){return this.overridingSystemValue_=!0,this}values(e){if(e=Array.isArray(e)?e:[e],e.length===0)throw Error(`values() must be called with at least one value`);let t=e.map(e=>{let t={},n=this.table[oF.Symbol.Columns];for(let r of Object.keys(e)){let i=e[r];t[r]=X(i,pF)?i:new yF(i,n[r])}return t});return new CL(this.table,t,this.session,this.dialect,this.withList,!1,this.overridingSystemValue_).setToken(this.authToken)}select(e){let t=typeof e==`function`?e(new yL):e;if(!X(t,pF)&&!RF(this.table[$P],t._.selectedFields))throw Error(`Insert select error: selected fields are not the same or are in a different order compared to the table definition`);return new CL(this.table,t,this.session,this.dialect,this.withList,!0)}},CL=class extends IF{constructor(e,t,n,r,i,a,o){super(),this.session=n,this.dialect=r,this.config={table:e,values:t,withList:i,select:a,overridingSystemValue_:o}}static[Y]=`PgInsert`;config;cacheConfig;returning(e=this.config.table[oF.Symbol.Columns]){return this.config.returningFields=e,this.config.returning=LF(e),this}onConflictDoNothing(e={}){if(e.target===void 0)this.config.onConflict=Z`do nothing`;else{let t=``;t=Array.isArray(e.target)?e.target.map(e=>this.dialect.escapeName(this.dialect.casing.getColumnCasing(e))).join(`,`):this.dialect.escapeName(this.dialect.casing.getColumnCasing(e.target));let n=e.where?Z` where ${e.where}`:void 0;this.config.onConflict=Z`(${Z.raw(t)})${n} do nothing`}return this}onConflictDoUpdate(e){if(e.where&&(e.targetWhere||e.setWhere))throw Error(`You cannot use both "where" and "targetWhere"/"setWhere" at the same time - "where" is deprecated, use "targetWhere" or "setWhere" instead.`);let t=e.where?Z` where ${e.where}`:void 0,n=e.targetWhere?Z` where ${e.targetWhere}`:void 0,r=e.setWhere?Z` where ${e.setWhere}`:void 0,i=this.dialect.buildUpdateSet(this.config.table,zF(this.config.table,e.set)),a=``;return a=Array.isArray(e.target)?e.target.map(e=>this.dialect.escapeName(this.dialect.casing.getColumnCasing(e))).join(`,`):this.dialect.escapeName(this.dialect.casing.getColumnCasing(e.target)),this.config.onConflict=Z`(${Z.raw(a)})${n} do update set ${i}${t}${r}`,this}getSQL(){return this.dialect.buildInsertQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}_prepare(e){return XP.startActiveSpan(`drizzle.prepareQuery`,()=>this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,e,!0,void 0,{type:`insert`,tables:bL(this.config.table)},this.cacheConfig))}prepare(e){return this._prepare(e)}authToken;setToken(e){return this.authToken=e,this}execute=e=>XP.startActiveSpan(`drizzle.operation`,()=>this._prepare().execute(e,this.authToken));getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new eL({alias:sF(this.config.table),sqlAliasedBehavior:`alias`,sqlBehavior:`error`})):void 0}$dynamic(){return this}},wL=class extends IF{constructor(e,t,n){super(),this.session=t,this.dialect=n,this.config={view:e}}static[Y]=`PgRefreshMaterializedView`;config;concurrently(){if(this.config.withNoData!==void 0)throw Error(`Cannot use concurrently and withNoData together`);return this.config.concurrently=!0,this}withNoData(){if(this.config.concurrently!==void 0)throw Error(`Cannot use concurrently and withNoData together`);return this.config.withNoData=!0,this}getSQL(){return this.dialect.buildRefreshMaterializedViewQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}_prepare(e){return XP.startActiveSpan(`drizzle.prepareQuery`,()=>this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),void 0,e,!0))}prepare(e){return this._prepare(e)}authToken;setToken(e){return this.authToken=e,this}execute=e=>XP.startActiveSpan(`drizzle.operation`,()=>this._prepare().execute(e,this.authToken))},TL=class{constructor(e,t,n,r){this.table=e,this.session=t,this.dialect=n,this.withList=r}static[Y]=`PgUpdateBuilder`;authToken;setToken(e){return this.authToken=e,this}set(e){return new EL(this.table,zF(this.table,e),this.session,this.dialect,this.withList).setToken(this.authToken)}},EL=class extends IF{constructor(e,t,n,r,i){super(),this.session=n,this.dialect=r,this.config={set:t,table:e,withList:i,joins:[]},this.tableName=HF(e),this.joinsNotNullableMap=typeof this.tableName==`string`?{[this.tableName]:!0}:{}}static[Y]=`PgUpdate`;config;tableName;joinsNotNullableMap;cacheConfig;from(e){let t=e,n=HF(t);return typeof n==`string`&&(this.joinsNotNullableMap[n]=!0),this.config.from=t,this}getTableLikeFields(e){return X(e,hI)?e[oF.Symbol.Columns]:X(e,GP)?e._.selectedFields:e[ZP].selectedFields}createJoin(e){return(t,n)=>{let r=HF(t);if(typeof r==`string`&&this.config.joins.some(e=>e.alias===r))throw Error(`Alias "${r}" is already used in this query`);if(typeof n==`function`){let e=this.config.from&&!X(this.config.from,pF)?this.getTableLikeFields(this.config.from):void 0;n=n(new Proxy(this.config.table[oF.Symbol.Columns],new eL({sqlAliasedBehavior:`sql`,sqlBehavior:`sql`})),e&&new Proxy(e,new eL({sqlAliasedBehavior:`sql`,sqlBehavior:`sql`})))}if(this.config.joins.push({on:n,table:t,joinType:e,alias:r}),typeof r==`string`)switch(e){case`left`:this.joinsNotNullableMap[r]=!1;break;case`right`:this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([e])=>[e,!1])),this.joinsNotNullableMap[r]=!0;break;case`inner`:this.joinsNotNullableMap[r]=!0;break;case`full`:this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([e])=>[e,!1])),this.joinsNotNullableMap[r]=!1;break}return this}}leftJoin=this.createJoin(`left`);rightJoin=this.createJoin(`right`);innerJoin=this.createJoin(`inner`);fullJoin=this.createJoin(`full`);where(e){return this.config.where=e,this}returning(e){if(!e&&(e=Object.assign({},this.config.table[oF.Symbol.Columns]),this.config.from)){let t=HF(this.config.from);if(typeof t==`string`&&this.config.from&&!X(this.config.from,pF)){let n=this.getTableLikeFields(this.config.from);e[t]=n}for(let t of this.config.joins){let n=HF(t.table);if(typeof n==`string`&&!X(t.table,pF)){let r=this.getTableLikeFields(t.table);e[n]=r}}}return this.config.returningFields=e,this.config.returning=LF(e),this}getSQL(){return this.dialect.buildUpdateQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}_prepare(e){let t=this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,e,!0,void 0,{type:`insert`,tables:bL(this.config.table)},this.cacheConfig);return t.joinsNotNullableMap=this.joinsNotNullableMap,t}prepare(e){return this._prepare(e)}authToken;setToken(e){return this.authToken=e,this}execute=e=>this._prepare().execute(e,this.authToken);getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new eL({alias:sF(this.config.table),sqlAliasedBehavior:`alias`,sqlBehavior:`error`})):void 0}$dynamic(){return this}},DL=class e extends pF{constructor(t){super(e.buildEmbeddedCount(t.source,t.filters).queryChunks),this.params=t,this.mapWith(Number),this.session=t.session,this.sql=e.buildCount(t.source,t.filters)}sql;token;static[Y]=`PgCountBuilder`;[Symbol.toStringTag]=`PgCountBuilder`;session;static buildEmbeddedCount(e,t){return Z`(select count(*) from ${e}${Z.raw(` where `).if(t)}${t})`}static buildCount(e,t){return Z`select count(*) as count from ${e}${Z.raw(` where `).if(t)}${t};`}setToken(e){return this.token=e,this}then(e,t){return Promise.resolve(this.session.count(this.sql,this.token)).then(e,t)}catch(e){return this.then(void 0,e)}finally(e){return this.then(t=>(e?.(),t),t=>{throw e?.(),t})}},OL=class{constructor(e,t,n,r,i,a,o){this.fullSchema=e,this.schema=t,this.tableNamesMap=n,this.table=r,this.tableConfig=i,this.dialect=a,this.session=o}static[Y]=`PgRelationalQueryBuilder`;findMany(e){return new kL(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,e||{},`many`)}findFirst(e){return new kL(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,e?{...e,limit:1}:{limit:1},`first`)}},kL=class extends IF{constructor(e,t,n,r,i,a,o,s,c){super(),this.fullSchema=e,this.schema=t,this.tableNamesMap=n,this.table=r,this.tableConfig=i,this.dialect=a,this.session=o,this.config=s,this.mode=c}static[Y]=`PgRelationalQuery`;_prepare(e){return XP.startActiveSpan(`drizzle.prepareQuery`,()=>{let{query:t,builtQuery:n}=this._toSQL();return this.session.prepareQuery(n,void 0,e,!0,(e,n)=>{let r=e.map(e=>$I(this.schema,this.tableConfig,e,t.selection,n));return this.mode===`first`?r[0]:r})})}prepare(e){return this._prepare(e)}_getQuery(){return this.dialect.buildRelationalQueryWithoutPK({fullSchema:this.fullSchema,schema:this.schema,tableNamesMap:this.tableNamesMap,table:this.table,tableConfig:this.tableConfig,queryConfig:this.config,tableAlias:this.tableConfig.tsName})}getSQL(){return this._getQuery().sql}_toSQL(){let e=this._getQuery(),t=this.dialect.sqlToQuery(e.sql);return{query:e,builtQuery:t}}toSQL(){return this._toSQL().builtQuery}authToken;setToken(e){return this.authToken=e,this}execute(){return XP.startActiveSpan(`drizzle.operation`,()=>this._prepare().execute(void 0,this.authToken))}},AL=class extends IF{constructor(e,t,n,r){super(),this.execute=e,this.sql=t,this.query=n,this.mapBatchResult=r}static[Y]=`PgRaw`;getSQL(){return this.sql}getQuery(){return this.query}mapResult(e,t){return t?this.mapBatchResult(e):e}_prepare(){return this}isResponseInArrayMode(){return!1}},jL=class{constructor(e,t,n){if(this.dialect=e,this.session=t,this._=n?{schema:n.schema,fullSchema:n.fullSchema,tableNamesMap:n.tableNamesMap,session:t}:{schema:void 0,fullSchema:{},tableNamesMap:{},session:t},this.query={},this._.schema)for(let[r,i]of Object.entries(this._.schema))this.query[r]=new OL(n.fullSchema,this._.schema,this._.tableNamesMap,n.fullSchema[r],i,e,t);this.$cache={invalidate:async e=>{}}}static[Y]=`PgDatabase`;query;$with=(e,t)=>{let n=this,r=r=>(typeof r==`function`&&(r=r(new yL(n.dialect))),new Proxy(new KP(r.getSQL(),t??(`getSelectedFields`in r?r.getSelectedFields()??{}:{}),e,!0),new eL({alias:e,sqlAliasedBehavior:`alias`,sqlBehavior:`error`})));return{as:r}};$count(e,t){return new DL({source:e,filters:t,session:this.session})}$cache;with(...e){let t=this;function n(n){return new cL({fields:n??void 0,session:t.session,dialect:t.dialect,withList:e})}function r(n){return new cL({fields:n??void 0,session:t.session,dialect:t.dialect,withList:e,distinct:!0})}function i(n,r){return new cL({fields:r??void 0,session:t.session,dialect:t.dialect,withList:e,distinct:{on:n}})}function a(n){return new TL(n,t.session,t.dialect,e)}function o(n){return new SL(n,t.session,t.dialect,e)}function s(n){return new xL(n,t.session,t.dialect,e)}return{select:n,selectDistinct:r,selectDistinctOn:i,update:a,insert:o,delete:s}}select(e){return new cL({fields:e??void 0,session:this.session,dialect:this.dialect})}selectDistinct(e){return new cL({fields:e??void 0,session:this.session,dialect:this.dialect,distinct:!0})}selectDistinctOn(e,t){return new cL({fields:t??void 0,session:this.session,dialect:this.dialect,distinct:{on:e}})}update(e){return new TL(e,this.session,this.dialect)}insert(e){return new SL(e,this.session,this.dialect)}delete(e){return new xL(e,this.session,this.dialect)}refreshMaterializedView(e){return new wL(e,this.session,this.dialect)}authToken;execute(e){let t=typeof e==`string`?Z.raw(e):e.getSQL(),n=this.dialect.sqlToQuery(t),r=this.session.prepareQuery(n,void 0,void 0,!1);return new AL(()=>r.execute(void 0,this.authToken),t,n,e=>r.mapResult(e,!0))}transaction(e,t){return this.session.transaction(e,t)}},ML=class{static[Y]=`Cache`},NL=class extends ML{strategy(){return`all`}static[Y]=`NoopCache`;async get(e){}async put(e,t,n,r){}async onMutate(e){}};async function PL(e,t){let n=`${e}-${JSON.stringify(t)}`,r=new TextEncoder,i=r.encode(n),a=await crypto.subtle.digest(`SHA-256`,i),o=[...new Uint8Array(a)],s=o.map(e=>e.toString(16).padStart(2,`0`)).join(``);return s}var FL=class e extends Error{constructor(t,n,r){super(`Failed query: ${t} -params: ${n}`),this.query=t,this.params=n,this.cause=r,Error.captureStackTrace(this,e),r&&(this.cause=r)}},IL=class{constructor(e,t,n,r){this.query=e,this.cache=t,this.queryMetadata=n,this.cacheConfig=r,t&&t.strategy()===`all`&&r===void 0&&(this.cacheConfig={enable:!0,autoInvalidate:!0}),this.cacheConfig?.enable||(this.cacheConfig=void 0)}authToken;getQuery(){return this.query}mapResult(e,t){return e}setToken(e){return this.authToken=e,this}static[Y]=`PgPreparedQuery`;joinsNotNullableMap;async queryWithCache(e,t,n){if(this.cache===void 0||X(this.cache,NL)||this.queryMetadata===void 0)try{return await n()}catch(n){throw new FL(e,t,n)}if(this.cacheConfig&&!this.cacheConfig.enable)try{return await n()}catch(n){throw new FL(e,t,n)}if((this.queryMetadata.type===`insert`||this.queryMetadata.type===`update`||this.queryMetadata.type===`delete`)&&this.queryMetadata.tables.length>0)try{let[e]=await Promise.all([n(),this.cache.onMutate({tables:this.queryMetadata.tables})]);return e}catch(n){throw new FL(e,t,n)}if(!this.cacheConfig)try{return await n()}catch(n){throw new FL(e,t,n)}if(this.queryMetadata.type===`select`){let r=await this.cache.get(this.cacheConfig.tag??await PL(e,t),this.queryMetadata.tables,this.cacheConfig.tag!==void 0,this.cacheConfig.autoInvalidate);if(r===void 0){let r;try{r=await n()}catch(n){throw new FL(e,t,n)}return await this.cache.put(this.cacheConfig.tag??await PL(e,t),r,this.cacheConfig.autoInvalidate?this.queryMetadata.tables:[],this.cacheConfig.tag!==void 0,this.cacheConfig.config),r}return r}try{return await n()}catch(n){throw new FL(e,t,n)}}},LL=class{constructor(e){this.dialect=e}static[Y]=`PgSession`;execute(e,t){return XP.startActiveSpan(`drizzle.operation`,()=>{let n=XP.startActiveSpan(`drizzle.prepareQuery`,()=>this.prepareQuery(this.dialect.sqlToQuery(e),void 0,void 0,!1));return n.setToken(t).execute(void 0,t)})}all(e){return this.prepareQuery(this.dialect.sqlToQuery(e),void 0,void 0,!1).all()}async count(e,t){let n=await this.execute(e,t);return Number(n[0].count)}},RL=class extends jL{constructor(e,t,n,r=0){super(e,t,n),this.schema=n,this.nestedIndex=r}static[Y]=`PgTransaction`;rollback(){throw new MF}getTransactionConfigSQL(e){let t=[];return e.isolationLevel&&t.push(`isolation level ${e.isolationLevel}`),e.accessMode&&t.push(e.accessMode),typeof e.deferrable==`boolean`&&t.push(e.deferrable?`deferrable`:`not deferrable`),Z.raw(t.join(` `))}setTransaction(e){return this.session.execute(Z`set transaction ${this.getTransactionConfigSQL(e)}`)}};function zL(e){return typeof e==`string`&&/^true$/i.test(e)}function BL(e){let t={scheme:`duckdb-wasm:`},n=new URL(e);if(!n.protocol.startsWith(`duckdb-wasm:`))throw Error(`Expected scheme to be "duckdb-wasm:" but got "${n.protocol}"`);n.searchParams.get(`bundles`)===`import-url`&&(t.bundles=`import-url`);let r=n.searchParams.get(`logger`);r&&zL(r)&&(t.logger=!0);let i=n.searchParams.get(`storage`);switch(i){case mP.ORIGIN_PRIVATE_FS:{n.host.length>0&&console.warn(`Host "${n.host}" will be ignored while using Origin Private FS`);let e=n.searchParams.get(`write`);t.storage={type:mP.ORIGIN_PRIVATE_FS,path:n.pathname.startsWith(`/`)?n.pathname.slice(1):n.pathname,...e&&zL(e)&&{accessMode:Pw.READ_WRITE}};break}case null:break;default:console.warn(`Unknown storage type "${i}"`);break}return t}var VL=class extends IL{static[Y]=`DuckDBWasmPreparedQuery`;constructor(e,t,n,r,i,a){super({sql:t,params:n}),this.client=e,this.queryString=t,this.params=n,this.logger=r,this.fields=i,this.customResultMapper=a}async execute(e={}){let t=xF(this.params,e);this.logger.logQuery(this.queryString,t);let{fields:n,queryString:r,client:i,customResultMapper:a}=this,o=await i;return o.query(r,t)}async all(e={}){let t=xF(this.params,e);this.logger.logQuery(this.queryString,t);let n=await this.client;return n.query(this.queryString,t)}},HL=class e extends LL{static[Y]=`DuckDBWasmSession`;logger;constructor(e,t,n,r={}){super(t),this.client=e,this.schema=n,this.options=r,this.logger=r.logger??new FF}prepareQuery(e,t,n,r,i){return new VL(this.client,e.sql,e.params,this.logger,t,i)}async query(e,t){this.logger.logQuery(e,t);let n=await this.client;return n.query(e,t)}async queryObjects(e,t){this.logger.logQuery(e,t);let n=await this.client;return n.query(e,t)}transaction(t,n){return gP(this.client,async r=>{let i=new e(r,this.dialect,this.schema,this.options),a=new UL(this.dialect,i,this.schema);return n&&await a.setTransaction(n),t(a)})}},UL=class e extends RL{static[Y]=`DuckDBWasmTransaction`;dialect;session;constructor(e,t,n,r=0){super(e,t,n,r),this.dialect=e,this.session=t}async transaction(t){return _P(this.session.client,``,async n=>{let r=new HL(n,this.dialect,this.schema,this.session.options),i=new e(this.dialect,r,this.schema);return t(i)})}},WL=class extends jL{static[Y]=`DuckDBWasmDatabase`};function GL(e,t={}){let n=new oL({casing:t.casing}),r;t.logger===!0?r=new PF:t.logger!==!1&&(r=t.logger);let i;if(t.schema){let e=JI(t.schema,QI);i={fullSchema:t.schema,schema:e.tables,tableNamesMap:e.tableNamesMap}}let a=new HL(e,n,i,{logger:r}),o=new WL(n,a,i);return o.$client=e,o}function KL(e,t){let n=BL(e),r;if(n.bundles===`import-url`){let e=async()=>{let e=await VN();switch(e){case`browser`:return(await S(async()=>{let{getImportUrlBundles:e}=await import(`./import-url-browser-CkMcxt8_.js`);return{getImportUrlBundles:e}},__vite__mapDeps([4,5,6]))).getImportUrlBundles();case`node`:return await(await S(async()=>{let{getImportUrlBundles:e}=await import(`./import-url-node-DmUEwuAI.js`);return{getImportUrlBundles:e}},__vite__mapDeps([7,6]))).getImportUrlBundles();default:throw Error(`Unsupported environment: "${e}"`)}};r=e()}else{let e=async()=>{let e=await VN();switch(e){case`browser`:return(await S(async()=>{let{getBundles:e}=await import(`./default-browser-BsyDD-mc.js`);return{getBundles:e}},[])).getBundles();case`node`:return await(await S(async()=>{let{getBundles:e}=await import(`./default-node-BiFBkIjL.js`);return{getBundles:e}},__vite__mapDeps([3,1,2]))).getBundles();default:throw Error(`Unsupported environment: "${e}"`)}};r=e()}return GL(hP({bundles:r,logger:n.logger?new Vw:void 0,storage:n.storage}),t)}function qL(...e){if(typeof e[0]==`string`)return KL(e[0],e[1]);if(UF(e[0])){let{connection:t,client:n,...r}=e[0];if(n)return GL(n,r);if(typeof t==`string`)return KL(t,r);if(t===void 0)throw Error(`connection option is required`);return GL(hP({bundles:t.bundles,logger:t.logger,storage:t.storage}),r)}return GL(e[0],e[1])}(function(e){function t(e){return GL({options:{parsers:{},serializers:{}}},e)}e.mock=t})(qL||={});var JL=Object.defineProperty,YL=(e,t,n)=>t in e?JL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,XL=(e,t,n)=>YL(e,typeof t==`symbol`?t:t+``,n);function ZL(e){return dn()?(rn(e),!0):!1}function QL(e){return typeof e==`function`?e():H(e)}const $L=typeof window<`u`&&typeof document<`u`;typeof WorkerGlobalScope<`u`&&globalThis instanceof WorkerGlobalScope;const eR=Object.prototype.toString,tR=e=>eR.call(e)===`[object Object]`,nR=()=>{};function rR(e,t){function n(...n){return new Promise((r,i)=>{Promise.resolve(e(()=>t.apply(this,n),{fn:t,thisArg:this,args:n})).then(r).catch(i)})}return n}function iR(e,t={}){let n,r,i=nR,a=e=>{clearTimeout(e),i(),i=nR};return o=>{let s=QL(e),c=QL(t.maxWait);return n&&a(n),s<=0||c!==void 0&&c<=0?(r&&(a(r),r=null),Promise.resolve(o())):new Promise((e,l)=>{i=t.rejectOnCancel?l:e,c&&!r&&(r=setTimeout(()=>{n&&a(n),r=null,e(o())},c)),n=setTimeout(()=>{r&&a(r),r=null,e(o())},s)})}}function aR(...e){let t=0,n,r=!0,i=nR,a,o,s,c,l;!sn(e[0])&&typeof e[0]==`object`?{delay:o,trailing:s=!0,leading:c=!0,rejectOnCancel:l=!1}=e[0]:[o,s=!0,c=!0,l=!1]=e;let u=()=>{n&&(clearTimeout(n),n=void 0,i(),i=nR)};return e=>{let d=QL(o),f=Date.now()-t,p=()=>a=e();return u(),d<=0?(t=Date.now(),p()):(f>d&&(c||!r)?(t=Date.now(),p()):s&&(a=new Promise((e,a)=>{i=l?a:e,n=setTimeout(()=>{t=Date.now(),r=!0,e(p()),u()},Math.max(0,d-f))})),!c&&!n&&(n=setTimeout(()=>r=!0,d)),r=!1,a)}}function oR(e){return vn()}function sR(e,t=200,n={}){return rR(iR(t,n),e)}function cR(e,t=200,n=!1,r=!0,i=!1){return rR(aR(t,n,r,i),e)}function lR(e,t=!0,n){oR()?Cn(e,n):t?e():wn(e)}const uR=$L?window:void 0;function dR(e){var t;let n=QL(e);return(t=n?.$el)??n}function fR(...e){let t,n,r,i;if(typeof e[0]==`string`||Array.isArray(e[0])?([n,r,i]=e,t=uR):[t,n,r,i]=e,!t)return nR;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);let a=[],o=()=>{a.forEach(e=>e()),a.length=0},s=(e,t,n,r)=>(e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)),c=G(()=>[dR(t),QL(i)],([e,t])=>{if(o(),!e)return;let i=tR(t)?{...t}:t;a.push(...n.flatMap(t=>r.map(n=>s(e,t,n,i))))},{immediate:!0,flush:`post`}),l=()=>{c(),o()};return ZL(l),l}function pR(){let e=U(!1),t=vn();return t&&Cn(()=>{e.value=!0},t),e}function mR(e){let t=pR();return _n(()=>(t.value,!!e()))}function hR(e,t={}){let{window:n=uR}=t,r=mR(()=>n&&`matchMedia`in n&&typeof n.matchMedia==`function`),i,a=U(!1),o=e=>{a.value=e.matches},s=()=>{i&&(`removeEventListener`in i?i.removeEventListener(`change`,o):i.removeListener(o))},c=Nn(()=>{r.value&&(s(),i=n.matchMedia(QL(e)),`addEventListener`in i?i.addEventListener(`change`,o):i.addListener(o),a.value=i.matches)});return ZL(()=>{c(),s(),i=void 0}),a}function gR(e,t,n={}){let{window:r=uR,...i}=n,a,o=mR(()=>r&&`ResizeObserver`in r),s=()=>{a&&(a.disconnect(),a=void 0)},c=_n(()=>{let t=QL(e);return Array.isArray(t)?t.map(e=>dR(e)):[dR(t)]}),l=G(c,e=>{if(s(),o.value&&r){a=new ResizeObserver(t);for(let t of e)t&&a.observe(t,i)}},{immediate:!0,flush:`post`}),u=()=>{s(),l()};return ZL(u),{isSupported:o,stop:u}}function _R(e,t={width:0,height:0},n={}){let{window:r=uR,box:i=`content-box`}=n,a=_n(()=>{var t,n;return(n=(t=dR(e))?.namespaceURI)?.includes(`svg`)}),o=U(t.width),s=U(t.height),{stop:c}=gR(e,([t])=>{let n=i===`border-box`?t.borderBoxSize:i===`content-box`?t.contentBoxSize:t.devicePixelContentBoxSize;if(r&&a.value){let t=dR(e);if(t){let e=t.getBoundingClientRect();o.value=e.width,s.value=e.height}}else if(n){let e=Array.isArray(n)?n:[n];o.value=e.reduce((e,{inlineSize:t})=>e+t,0),s.value=e.reduce((e,{blockSize:t})=>e+t,0)}else o.value=t.contentRect.width,s.value=t.contentRect.height},n);lR(()=>{let n=dR(e);n&&(o.value=`offsetWidth`in n?n.offsetWidth:t.width,s.value=`offsetHeight`in n?n.offsetHeight:t.height)});let l=G(()=>dR(e),e=>{o.value=e?t.width:0,s.value=e?t.height:0});function u(){c(),l()}return{width:o,height:s,stop:u}}const vR=1;function yR(e,t={}){let{throttle:n=0,idle:r=200,onStop:i=nR,onScroll:a=nR,offset:o={left:0,right:0,top:0,bottom:0},eventListenerOptions:s={capture:!1,passive:!0},behavior:c=`auto`,window:l=uR,onError:u=e=>{console.error(e)}}=t,d=U(0),f=U(0),p=_n({get(){return d.value},set(e){h(e,void 0)}}),m=_n({get(){return f.value},set(e){h(void 0,e)}});function h(t,n){var r,i,a,o;if(!l)return;let s=QL(e);if(!s)return;(a=s instanceof Document?l.document.body:s)==null||a.scrollTo({top:(r=QL(n))??m.value,left:(i=QL(t))??p.value,behavior:QL(c)});let u=(o=s?.document)?.documentElement||s?.documentElement||s;p!=null&&(d.value=u.scrollLeft),m!=null&&(f.value=u.scrollTop)}let g=U(!1),_=nn({left:!0,right:!1,top:!0,bottom:!1}),v=nn({left:!1,right:!1,top:!1,bottom:!1}),y=e=>{g.value&&(g.value=!1,v.left=!1,v.right=!1,v.top=!1,v.bottom=!1,i(e))},b=sR(y,n+r),x=e=>{var t;if(!l)return;let n=(t=e?.document)?.documentElement||e?.documentElement||dR(e),{display:r,flexDirection:i}=getComputedStyle(n),a=n.scrollLeft;v.left=ad.value;let s=Math.abs(a)<=(o.left||0),c=Math.abs(a)+n.clientWidth>=n.scrollWidth-(o.right||0)-vR;r===`flex`&&i===`row-reverse`?(_.left=c,_.right=s):(_.left=s,_.right=c),d.value=a;let u=n.scrollTop;e===l.document&&!u&&(u=l.document.body.scrollTop),v.top=uf.value;let p=Math.abs(u)<=(o.top||0),m=Math.abs(u)+n.clientHeight>=n.scrollHeight-(o.bottom||0)-vR;r===`flex`&&i===`column-reverse`?(_.top=m,_.bottom=p):(_.top=p,_.bottom=m),f.value=u},S=e=>{var t;if(!l)return;let n=(t=e.target.documentElement)??e.target;x(n),g.value=!0,b(e),a(e)};return fR(e,`scroll`,n?cR(S,n,!0,!1):S,s),lR(()=>{try{let t=QL(e);if(!t)return;x(t)}catch(e){u(e)}}),fR(e,`scrollend`,y,s),{x:p,y:m,isScrolling:g,arrivedState:_,directions:v,measure(){let t=QL(e);l&&t&&x(t)}}}const bR={ctrl:`control`,command:`meta`,cmd:`meta`,option:`alt`,up:`arrowup`,down:`arrowdown`,left:`arrowleft`,right:`arrowright`};function xR(e={}){let{reactive:t=!1,target:n=uR,aliasMap:r=bR,passive:i=!0,onEventFired:a=nR}=e,o=nn(new Set),s={toJSON(){return{}},current:o},c=t?nn(s):s,l=new Set,u=new Set;function d(e,n){e in c&&(t?c[e]=n:c[e].value=n)}function f(){o.clear();for(let e of u)d(e,!1)}function p(e,t){var n,r;let i=(n=e.key)?.toLowerCase(),a=[(r=e.code)?.toLowerCase(),i].filter(Boolean);i&&(t?o.add(i):o.delete(i));for(let e of a)u.add(e),d(e,t);i===`meta`&&!t?(l.forEach(e=>{o.delete(e),d(e,!1)}),l.clear()):typeof e.getModifierState==`function`&&e.getModifierState(`Meta`)&&t&&[...o,...a].forEach(e=>l.add(e))}fR(n,`keydown`,e=>(p(e,!0),a(e)),{passive:i}),fR(n,`keyup`,e=>(p(e,!1),a(e)),{passive:i}),fR(`blur`,f,{passive:!0}),fR(`focus`,f,{passive:!0});let m=new Proxy(c,{get(e,n,i){if(typeof n!=`string`)return Reflect.get(e,n,i);if(n=n.toLowerCase(),n in r&&(n=r[n]),!(n in c))if(/[+_-]/.test(n)){let e=n.split(/[+_-]/g).map(e=>e.trim());c[n]=_n(()=>e.every(e=>QL(m[e])))}else c[n]=U(!1);let a=Reflect.get(e,n,i);return t?QL(a):a}});return m}const SR={page:e=>[e.pageX,e.pageY],client:e=>[e.clientX,e.clientY],screen:e=>[e.screenX,e.screenY],movement:e=>e instanceof Touch?null:[e.movementX,e.movementY]};function CR(e={}){let{type:t=`page`,touch:n=!0,resetOnTouchEnds:r=!1,initialValue:i={x:0,y:0},window:a=uR,target:o=a,scroll:s=!0,eventFilter:c}=e,l=null,u=0,d=0,f=U(i.x),p=U(i.y),m=U(null),h=typeof t==`function`?t:SR[t],g=e=>{let t=h(e);l=e,t&&([f.value,p.value]=t,m.value=`mouse`),a&&(u=a.scrollX,d=a.scrollY)},_=e=>{if(e.touches.length>0){let t=h(e.touches[0]);t&&([f.value,p.value]=t,m.value=`touch`)}},v=()=>{if(!l||!a)return;let e=h(l);l instanceof MouseEvent&&e&&(f.value=e[0]+a.scrollX-u,p.value=e[1]+a.scrollY-d)},y=()=>{f.value=i.x,p.value=i.y},b=c?e=>c(()=>g(e),{}):e=>g(e),x=c?e=>c(()=>_(e),{}):e=>_(e),S=c?()=>c(()=>v(),{}):()=>v();if(o){let e={passive:!0};fR(o,[`mousemove`,`dragover`],b,e),n&&t!==`movement`&&(fR(o,[`touchstart`,`touchmove`],x,e),r&&fR(o,`touchend`,y,e)),s&&t===`page`&&fR(a,`scroll`,S,{passive:!0})}return{x:f,y:p,sourceType:m}}function wR(e={}){let{window:t=uR,behavior:n=`auto`}=e;if(!t)return{x:U(0),y:U(0)};let r=U(t.scrollX),i=U(t.scrollY),a=_n({get(){return r.value},set(e){scrollTo({left:e,behavior:n})}}),o=_n({get(){return i.value},set(e){scrollTo({top:e,behavior:n})}});return fR(t,`scroll`,()=>{r.value=t.scrollX,i.value=t.scrollY},{capture:!1,passive:!0}),{x:a,y:o}}function TR(e={}){let{window:t=uR,initialWidth:n=1/0,initialHeight:r=1/0,listenOrientation:i=!0,includeScrollbar:a=!0,type:o=`inner`}=e,s=U(n),c=U(r),l=()=>{t&&(o===`outer`?(s.value=t.outerWidth,c.value=t.outerHeight):a?(s.value=t.innerWidth,c.value=t.innerHeight):(s.value=t.document.documentElement.clientWidth,c.value=t.document.documentElement.clientHeight))};if(l(),lR(l),fR(`resize`,l,{passive:!0}),i){let e=hR(`(orientation: portrait)`);G(e,()=>l())}return{width:s,height:c}}function ER(e){let{resolution:t,renderer:n,scene:r,envMap:i,fog:a,near:o,far:s}=e;n??=ye().renderer,r??=ye().scene,Nn(()=>{t=on(e.resolution)??255,o=on(e.near)??.1,s=on(e.far)??1e3,i=on(e.envMap)??void 0,a=on(e.fog)??void 0,n=on(e.renderer)??n,r=on(e.scene)??r});let c=_n(()=>new Vt(on(t)));c.value.texture.type=wt,ZL(()=>{c.value.dispose()});let l=_n(()=>new lt(on(o),on(s),on(c))),u=()=>{let e=on(r),t=e.fog,o=e.background;e.background=on(i)||o,e.fog=on(a)||t,l.value.update(on(n),e),e.fog=t,e.background=o};return Nn(u),{fbo:c,camera:l,update:u}}const DR=[`object`],OR=Tn({__name:`component`,props:{frames:{default:1/0},resolution:{},near:{},far:{},envMap:{},fog:{},renderer:{},scene:{}},setup(e,{expose:t}){let n=e,r=W(),{fbo:i,camera:a,update:o}=ER(n),s=0;return be().onBeforeRender(()=>{r.value&&(n.frames===1/0||s{`material`in e&&typeof e.material==`object`&&e.material&&`envMap`in e.material&&(e.material.envMap=i.value.texture)}),s++)}),t({instance:r,fbo:i,camera:a,update:o}),(e,t)=>(K(),On(`TresGroup`,{ref_key:`groupRef`,ref:r},[jn(`primitive`,{object:H(a)},null,8,DR),Qt(e.$slots,`default`)],512))}}),kR=Tn({__name:`Billboard`,props:{autoUpdate:{type:Boolean,default:!0},lockX:{type:Boolean,default:!1},lockY:{type:Boolean,default:!1},lockZ:{type:Boolean,default:!1}},setup(e,{expose:t}){let n=e,r=W(new ve),i=W(new ve),a=new Rt,o=new Le;function s(e){r.value&&(!e&&(e=ye().camera.value,!e)||(i.value.rotation.copy(o),r.value.updateMatrix(),r.value.updateWorldMatrix(!1,!1),r.value.getWorldQuaternion(a),e.getWorldQuaternion(i.value.quaternion).premultiply(a.invert()),n.lockX&&(i.value.rotation.x=o.x),n.lockY&&(i.value.rotation.y=o.y),n.lockZ&&(i.value.rotation.z=o.z)))}return be().onBeforeRender(({camera:e})=>{n.autoUpdate&&s(e)}),t({instance:r,update:s}),(e,t)=>(K(),On(`TresGroup`,{ref_key:`outerRef`,ref:r},[jn(`TresGroup`,{ref_key:`innerRef`,ref:i},[Qt(e.$slots,`default`)],512)],512))}}),AR=Tn({name:`GlobalAudio`,props:[`src`,`loop`,`volume`,`playbackRate`,`playTrigger`,`stopTrigger`],async setup(e,{expose:t,emit:n}){var r;let{camera:i,renderer:a}=De(),o=new le;(r=i.value)==null||r.add(o);let s=new Ot(o),c=new ct;t({instance:s}),An(()=>{s&&s.disconnect()}),G(()=>[e.playbackRate],()=>s.setPlaybackRate(e.playbackRate??1),{immediate:!0}),G(()=>[e.volume],()=>s.setVolume(e.volume??.5),{immediate:!0}),G(()=>[e.loop],()=>s.setLoop(e.loop??!1),{immediate:!0}),G(()=>[e.src],async()=>{let t=await c.loadAsync(e.src);s.setBuffer(t)},{immediate:!0});let l=document.getElementById(e.playTrigger??``)||a.value.domElement;fR(l,`click`,()=>{s.isPlaying?s.pause():s.play(),n(`isPlaying`,s.isPlaying)});let u=document.getElementById(e.stopTrigger??``);return u&&fR(u,`click`,()=>{s.stop(),n(`isPlaying`,s.isPlaying)}),null}}),jR=[`color-space`,`args`,`attach`],MR=Tn({__name:`GradientTexture`,props:{stops:{},colors:{},attach:{default:`map`},height:{default:1024},width:{default:16},type:{default:`linear`},innerCircleRadius:{default:0},outerCircleRadius:{default:`auto`}},setup(e,{expose:t}){let n=e,r=W(),i=document.createElement(`canvas`);function a(e){let t=e.getContext(`2d`);e.width=n.width,e.height=n.height;let i;if(n.type===`linear`)i=t.createLinearGradient(0,0,0,n.height);else{let r=e.width/2,a=e.height/2,o=n.outerCircleRadius===`auto`?Math.sqrt(r**2+a**2):Math.abs(Number(n.outerCircleRadius));i=t.createRadialGradient(r,a,Math.abs(n.innerCircleRadius),r,a,o)}let a=new ge,o=n.stops.length;for(;o--;)i.addColorStop(n.stops[o],a.set(n.colors[o]).getStyle());t.save(),t.fillStyle=i,t.fillRect(0,0,n.width,n.height),t.restore(),r.value&&(r.value.needsUpdate=!0)}let o=ye().renderer;return G(()=>[n.colors,n.stops,n.height,n.width,n.type,n.innerCircleRadius,n.outerCircleRadius],()=>{a(i)},{immediate:!0}),ln(n.colors)&&G(n.colors,()=>a(i)),ln(n.stops)&&G(n.stops,()=>a(i)),t({instance:r}),(e,t)=>(K(),On(`TresCanvasTexture`,{ref_key:`textureRef`,ref:r,"color-space":H(o).outputColorSpace,args:[H(i)],attach:n.attach},null,8,jR))}});function NR(e,t,n,r){let i=class extends Bt{constructor(r={}){let i=Object.entries(e);super({uniforms:i.reduce((e,[t,n])=>{let r=Dt.clone({[t]:{value:n}});return{...e,...r}},{}),vertexShader:t,fragmentShader:n}),XL(this,`key`,``),i.forEach(([e])=>Object.defineProperty(this,e,{get:()=>this.uniforms[e].value,set:t=>this.uniforms[e].value=t})),Object.assign(this,r)}};return i.key=it.generateUUID(),i}const PR=NR({color:new ge(`white`),scale:new ut(1,1),imageBounds:new ut(1,1),resolution:1024,map:null,zoom:1,radius:0,grayscale:0,opacity:1},` +params: ${n}`),this.query=t,this.params=n,this.cause=r,Error.captureStackTrace(this,e),r&&(this.cause=r)}},IL=class{constructor(e,t,n,r){this.query=e,this.cache=t,this.queryMetadata=n,this.cacheConfig=r,t&&t.strategy()===`all`&&r===void 0&&(this.cacheConfig={enable:!0,autoInvalidate:!0}),this.cacheConfig?.enable||(this.cacheConfig=void 0)}authToken;getQuery(){return this.query}mapResult(e,t){return e}setToken(e){return this.authToken=e,this}static[Y]=`PgPreparedQuery`;joinsNotNullableMap;async queryWithCache(e,t,n){if(this.cache===void 0||X(this.cache,NL)||this.queryMetadata===void 0)try{return await n()}catch(n){throw new FL(e,t,n)}if(this.cacheConfig&&!this.cacheConfig.enable)try{return await n()}catch(n){throw new FL(e,t,n)}if((this.queryMetadata.type===`insert`||this.queryMetadata.type===`update`||this.queryMetadata.type===`delete`)&&this.queryMetadata.tables.length>0)try{let[e]=await Promise.all([n(),this.cache.onMutate({tables:this.queryMetadata.tables})]);return e}catch(n){throw new FL(e,t,n)}if(!this.cacheConfig)try{return await n()}catch(n){throw new FL(e,t,n)}if(this.queryMetadata.type===`select`){let r=await this.cache.get(this.cacheConfig.tag??await PL(e,t),this.queryMetadata.tables,this.cacheConfig.tag!==void 0,this.cacheConfig.autoInvalidate);if(r===void 0){let r;try{r=await n()}catch(n){throw new FL(e,t,n)}return await this.cache.put(this.cacheConfig.tag??await PL(e,t),r,this.cacheConfig.autoInvalidate?this.queryMetadata.tables:[],this.cacheConfig.tag!==void 0,this.cacheConfig.config),r}return r}try{return await n()}catch(n){throw new FL(e,t,n)}}},LL=class{constructor(e){this.dialect=e}static[Y]=`PgSession`;execute(e,t){return XP.startActiveSpan(`drizzle.operation`,()=>{let n=XP.startActiveSpan(`drizzle.prepareQuery`,()=>this.prepareQuery(this.dialect.sqlToQuery(e),void 0,void 0,!1));return n.setToken(t).execute(void 0,t)})}all(e){return this.prepareQuery(this.dialect.sqlToQuery(e),void 0,void 0,!1).all()}async count(e,t){let n=await this.execute(e,t);return Number(n[0].count)}},RL=class extends jL{constructor(e,t,n,r=0){super(e,t,n),this.schema=n,this.nestedIndex=r}static[Y]=`PgTransaction`;rollback(){throw new MF}getTransactionConfigSQL(e){let t=[];return e.isolationLevel&&t.push(`isolation level ${e.isolationLevel}`),e.accessMode&&t.push(e.accessMode),typeof e.deferrable==`boolean`&&t.push(e.deferrable?`deferrable`:`not deferrable`),Z.raw(t.join(` `))}setTransaction(e){return this.session.execute(Z`set transaction ${this.getTransactionConfigSQL(e)}`)}};function zL(e){return typeof e==`string`&&/^true$/i.test(e)}function BL(e){let t={scheme:`duckdb-wasm:`},n=new URL(e);if(!n.protocol.startsWith(`duckdb-wasm:`))throw Error(`Expected scheme to be "duckdb-wasm:" but got "${n.protocol}"`);n.searchParams.get(`bundles`)===`import-url`&&(t.bundles=`import-url`);let r=n.searchParams.get(`logger`);r&&zL(r)&&(t.logger=!0);let i=n.searchParams.get(`storage`);switch(i){case mP.ORIGIN_PRIVATE_FS:{n.host.length>0&&console.warn(`Host "${n.host}" will be ignored while using Origin Private FS`);let e=n.searchParams.get(`write`);t.storage={type:mP.ORIGIN_PRIVATE_FS,path:n.pathname.startsWith(`/`)?n.pathname.slice(1):n.pathname,...e&&zL(e)&&{accessMode:Pw.READ_WRITE}};break}case null:break;default:console.warn(`Unknown storage type "${i}"`);break}return t}var VL=class extends IL{static[Y]=`DuckDBWasmPreparedQuery`;constructor(e,t,n,r,i,a){super({sql:t,params:n}),this.client=e,this.queryString=t,this.params=n,this.logger=r,this.fields=i,this.customResultMapper=a}async execute(e={}){let t=xF(this.params,e);this.logger.logQuery(this.queryString,t);let{fields:n,queryString:r,client:i,customResultMapper:a}=this,o=await i;return o.query(r,t)}async all(e={}){let t=xF(this.params,e);this.logger.logQuery(this.queryString,t);let n=await this.client;return n.query(this.queryString,t)}},HL=class e extends LL{static[Y]=`DuckDBWasmSession`;logger;constructor(e,t,n,r={}){super(t),this.client=e,this.schema=n,this.options=r,this.logger=r.logger??new FF}prepareQuery(e,t,n,r,i){return new VL(this.client,e.sql,e.params,this.logger,t,i)}async query(e,t){this.logger.logQuery(e,t);let n=await this.client;return n.query(e,t)}async queryObjects(e,t){this.logger.logQuery(e,t);let n=await this.client;return n.query(e,t)}transaction(t,n){return gP(this.client,async r=>{let i=new e(r,this.dialect,this.schema,this.options),a=new UL(this.dialect,i,this.schema);return n&&await a.setTransaction(n),t(a)})}},UL=class e extends RL{static[Y]=`DuckDBWasmTransaction`;dialect;session;constructor(e,t,n,r=0){super(e,t,n,r),this.dialect=e,this.session=t}async transaction(t){return _P(this.session.client,``,async n=>{let r=new HL(n,this.dialect,this.schema,this.session.options),i=new e(this.dialect,r,this.schema);return t(i)})}},WL=class extends jL{static[Y]=`DuckDBWasmDatabase`};function GL(e,t={}){let n=new oL({casing:t.casing}),r;t.logger===!0?r=new PF:t.logger!==!1&&(r=t.logger);let i;if(t.schema){let e=JI(t.schema,QI);i={fullSchema:t.schema,schema:e.tables,tableNamesMap:e.tableNamesMap}}let a=new HL(e,n,i,{logger:r}),o=new WL(n,a,i);return o.$client=e,o}function KL(e,t){let n=BL(e),r;if(n.bundles===`import-url`){let e=async()=>{let e=await VN();switch(e){case`browser`:return(await S(async()=>{let{getImportUrlBundles:e}=await import(`./import-url-browser-CkMcxt8_.js`);return{getImportUrlBundles:e}},__vite__mapDeps([4,5,6]))).getImportUrlBundles();case`node`:return await(await S(async()=>{let{getImportUrlBundles:e}=await import(`./import-url-node-DmUEwuAI.js`);return{getImportUrlBundles:e}},__vite__mapDeps([7,6]))).getImportUrlBundles();default:throw Error(`Unsupported environment: "${e}"`)}};r=e()}else{let e=async()=>{let e=await VN();switch(e){case`browser`:return(await S(async()=>{let{getBundles:e}=await import(`./default-browser-BsyDD-mc.js`);return{getBundles:e}},[])).getBundles();case`node`:return await(await S(async()=>{let{getBundles:e}=await import(`./default-node-BI20WiOb.js`);return{getBundles:e}},__vite__mapDeps([3,1,2]))).getBundles();default:throw Error(`Unsupported environment: "${e}"`)}};r=e()}return GL(hP({bundles:r,logger:n.logger?new Vw:void 0,storage:n.storage}),t)}function qL(...e){if(typeof e[0]==`string`)return KL(e[0],e[1]);if(UF(e[0])){let{connection:t,client:n,...r}=e[0];if(n)return GL(n,r);if(typeof t==`string`)return KL(t,r);if(t===void 0)throw Error(`connection option is required`);return GL(hP({bundles:t.bundles,logger:t.logger,storage:t.storage}),r)}return GL(e[0],e[1])}(function(e){function t(e){return GL({options:{parsers:{},serializers:{}}},e)}e.mock=t})(qL||={});var JL=Object.defineProperty,YL=(e,t,n)=>t in e?JL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,XL=(e,t,n)=>YL(e,typeof t==`symbol`?t:t+``,n);function ZL(e){return an()?(cn(e),!0):!1}function QL(e){return typeof e==`function`?e():H(e)}const $L=typeof window<`u`&&typeof document<`u`;typeof WorkerGlobalScope<`u`&&globalThis instanceof WorkerGlobalScope;const eR=Object.prototype.toString,tR=e=>eR.call(e)===`[object Object]`,nR=()=>{};function rR(e,t){function n(...n){return new Promise((r,i)=>{Promise.resolve(e(()=>t.apply(this,n),{fn:t,thisArg:this,args:n})).then(r).catch(i)})}return n}function iR(e,t={}){let n,r,i=nR,a=e=>{clearTimeout(e),i(),i=nR};return o=>{let s=QL(e),c=QL(t.maxWait);return n&&a(n),s<=0||c!==void 0&&c<=0?(r&&(a(r),r=null),Promise.resolve(o())):new Promise((e,l)=>{i=t.rejectOnCancel?l:e,c&&!r&&(r=setTimeout(()=>{n&&a(n),r=null,e(o())},c)),n=setTimeout(()=>{r&&a(r),r=null,e(o())},s)})}}function aR(...e){let t=0,n,r=!0,i=nR,a,o,s,c,l;!dn(e[0])&&typeof e[0]==`object`?{delay:o,trailing:s=!0,leading:c=!0,rejectOnCancel:l=!1}=e[0]:[o,s=!0,c=!0,l=!1]=e;let u=()=>{n&&(clearTimeout(n),n=void 0,i(),i=nR)};return e=>{let d=QL(o),f=Date.now()-t,p=()=>a=e();return u(),d<=0?(t=Date.now(),p()):(f>d&&(c||!r)?(t=Date.now(),p()):s&&(a=new Promise((e,a)=>{i=l?a:e,n=setTimeout(()=>{t=Date.now(),r=!0,e(p()),u()},Math.max(0,d-f))})),!c&&!n&&(n=setTimeout(()=>r=!0,d)),r=!1,a)}}function oR(e){return kn()}function sR(e,t=200,n={}){return rR(iR(t,n),e)}function cR(e,t=200,n=!1,r=!0,i=!1){return rR(aR(t,n,r,i),e)}function lR(e,t=!0,n){oR()?Pn(e,n):t?e():Qt(e)}const uR=$L?window:void 0;function dR(e){var t;let n=QL(e);return(t=n?.$el)??n}function fR(...e){let t,n,r,i;if(typeof e[0]==`string`||Array.isArray(e[0])?([n,r,i]=e,t=uR):[t,n,r,i]=e,!t)return nR;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);let a=[],o=()=>{a.forEach(e=>e()),a.length=0},s=(e,t,n,r)=>(e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)),c=G(()=>[dR(t),QL(i)],([e,t])=>{if(o(),!e)return;let i=tR(t)?{...t}:t;a.push(...n.flatMap(t=>r.map(n=>s(e,t,n,i))))},{immediate:!0,flush:`post`}),l=()=>{c(),o()};return ZL(l),l}function pR(){let e=U(!1),t=kn();return t&&Pn(()=>{e.value=!0},t),e}function mR(e){let t=pR();return On(()=>(t.value,!!e()))}function hR(e,t={}){let{window:n=uR}=t,r=mR(()=>n&&`matchMedia`in n&&typeof n.matchMedia==`function`),i,a=U(!1),o=e=>{a.value=e.matches},s=()=>{i&&(`removeEventListener`in i?i.removeEventListener(`change`,o):i.removeListener(o))},c=Cn(()=>{r.value&&(s(),i=n.matchMedia(QL(e)),`addEventListener`in i?i.addEventListener(`change`,o):i.addListener(o),a.value=i.matches)});return ZL(()=>{c(),s(),i=void 0}),a}function gR(e,t,n={}){let{window:r=uR,...i}=n,a,o=mR(()=>r&&`ResizeObserver`in r),s=()=>{a&&(a.disconnect(),a=void 0)},c=On(()=>{let t=QL(e);return Array.isArray(t)?t.map(e=>dR(e)):[dR(t)]}),l=G(c,e=>{if(s(),o.value&&r){a=new ResizeObserver(t);for(let t of e)t&&a.observe(t,i)}},{immediate:!0,flush:`post`}),u=()=>{s(),l()};return ZL(u),{isSupported:o,stop:u}}function _R(e,t={width:0,height:0},n={}){let{window:r=uR,box:i=`content-box`}=n,a=On(()=>{var t,n;return(n=(t=dR(e))?.namespaceURI)?.includes(`svg`)}),o=U(t.width),s=U(t.height),{stop:c}=gR(e,([t])=>{let n=i===`border-box`?t.borderBoxSize:i===`content-box`?t.contentBoxSize:t.devicePixelContentBoxSize;if(r&&a.value){let t=dR(e);if(t){let e=t.getBoundingClientRect();o.value=e.width,s.value=e.height}}else if(n){let e=Array.isArray(n)?n:[n];o.value=e.reduce((e,{inlineSize:t})=>e+t,0),s.value=e.reduce((e,{blockSize:t})=>e+t,0)}else o.value=t.contentRect.width,s.value=t.contentRect.height},n);lR(()=>{let n=dR(e);n&&(o.value=`offsetWidth`in n?n.offsetWidth:t.width,s.value=`offsetHeight`in n?n.offsetHeight:t.height)});let l=G(()=>dR(e),e=>{o.value=e?t.width:0,s.value=e?t.height:0});function u(){c(),l()}return{width:o,height:s,stop:u}}const vR=1;function yR(e,t={}){let{throttle:n=0,idle:r=200,onStop:i=nR,onScroll:a=nR,offset:o={left:0,right:0,top:0,bottom:0},eventListenerOptions:s={capture:!1,passive:!0},behavior:c=`auto`,window:l=uR,onError:u=e=>{console.error(e)}}=t,d=U(0),f=U(0),p=On({get(){return d.value},set(e){h(e,void 0)}}),m=On({get(){return f.value},set(e){h(void 0,e)}});function h(t,n){var r,i,a,o;if(!l)return;let s=QL(e);if(!s)return;(a=s instanceof Document?l.document.body:s)==null||a.scrollTo({top:(r=QL(n))??m.value,left:(i=QL(t))??p.value,behavior:QL(c)});let u=(o=s?.document)?.documentElement||s?.documentElement||s;p!=null&&(d.value=u.scrollLeft),m!=null&&(f.value=u.scrollTop)}let g=U(!1),_=sn({left:!0,right:!1,top:!0,bottom:!1}),v=sn({left:!1,right:!1,top:!1,bottom:!1}),y=e=>{g.value&&(g.value=!1,v.left=!1,v.right=!1,v.top=!1,v.bottom=!1,i(e))},b=sR(y,n+r),x=e=>{var t;if(!l)return;let n=(t=e?.document)?.documentElement||e?.documentElement||dR(e),{display:r,flexDirection:i}=getComputedStyle(n),a=n.scrollLeft;v.left=ad.value;let s=Math.abs(a)<=(o.left||0),c=Math.abs(a)+n.clientWidth>=n.scrollWidth-(o.right||0)-vR;r===`flex`&&i===`row-reverse`?(_.left=c,_.right=s):(_.left=s,_.right=c),d.value=a;let u=n.scrollTop;e===l.document&&!u&&(u=l.document.body.scrollTop),v.top=uf.value;let p=Math.abs(u)<=(o.top||0),m=Math.abs(u)+n.clientHeight>=n.scrollHeight-(o.bottom||0)-vR;r===`flex`&&i===`column-reverse`?(_.top=m,_.bottom=p):(_.top=p,_.bottom=m),f.value=u},S=e=>{var t;if(!l)return;let n=(t=e.target.documentElement)??e.target;x(n),g.value=!0,b(e),a(e)};return fR(e,`scroll`,n?cR(S,n,!0,!1):S,s),lR(()=>{try{let t=QL(e);if(!t)return;x(t)}catch(e){u(e)}}),fR(e,`scrollend`,y,s),{x:p,y:m,isScrolling:g,arrivedState:_,directions:v,measure(){let t=QL(e);l&&t&&x(t)}}}const bR={ctrl:`control`,command:`meta`,cmd:`meta`,option:`alt`,up:`arrowup`,down:`arrowdown`,left:`arrowleft`,right:`arrowright`};function xR(e={}){let{reactive:t=!1,target:n=uR,aliasMap:r=bR,passive:i=!0,onEventFired:a=nR}=e,o=sn(new Set),s={toJSON(){return{}},current:o},c=t?sn(s):s,l=new Set,u=new Set;function d(e,n){e in c&&(t?c[e]=n:c[e].value=n)}function f(){o.clear();for(let e of u)d(e,!1)}function p(e,t){var n,r;let i=(n=e.key)?.toLowerCase(),a=[(r=e.code)?.toLowerCase(),i].filter(Boolean);i&&(t?o.add(i):o.delete(i));for(let e of a)u.add(e),d(e,t);i===`meta`&&!t?(l.forEach(e=>{o.delete(e),d(e,!1)}),l.clear()):typeof e.getModifierState==`function`&&e.getModifierState(`Meta`)&&t&&[...o,...a].forEach(e=>l.add(e))}fR(n,`keydown`,e=>(p(e,!0),a(e)),{passive:i}),fR(n,`keyup`,e=>(p(e,!1),a(e)),{passive:i}),fR(`blur`,f,{passive:!0}),fR(`focus`,f,{passive:!0});let m=new Proxy(c,{get(e,n,i){if(typeof n!=`string`)return Reflect.get(e,n,i);if(n=n.toLowerCase(),n in r&&(n=r[n]),!(n in c))if(/[+_-]/.test(n)){let e=n.split(/[+_-]/g).map(e=>e.trim());c[n]=On(()=>e.every(e=>QL(m[e])))}else c[n]=U(!1);let a=Reflect.get(e,n,i);return t?QL(a):a}});return m}const SR={page:e=>[e.pageX,e.pageY],client:e=>[e.clientX,e.clientY],screen:e=>[e.screenX,e.screenY],movement:e=>e instanceof Touch?null:[e.movementX,e.movementY]};function CR(e={}){let{type:t=`page`,touch:n=!0,resetOnTouchEnds:r=!1,initialValue:i={x:0,y:0},window:a=uR,target:o=a,scroll:s=!0,eventFilter:c}=e,l=null,u=0,d=0,f=U(i.x),p=U(i.y),m=U(null),h=typeof t==`function`?t:SR[t],g=e=>{let t=h(e);l=e,t&&([f.value,p.value]=t,m.value=`mouse`),a&&(u=a.scrollX,d=a.scrollY)},_=e=>{if(e.touches.length>0){let t=h(e.touches[0]);t&&([f.value,p.value]=t,m.value=`touch`)}},v=()=>{if(!l||!a)return;let e=h(l);l instanceof MouseEvent&&e&&(f.value=e[0]+a.scrollX-u,p.value=e[1]+a.scrollY-d)},y=()=>{f.value=i.x,p.value=i.y},b=c?e=>c(()=>g(e),{}):e=>g(e),x=c?e=>c(()=>_(e),{}):e=>_(e),S=c?()=>c(()=>v(),{}):()=>v();if(o){let e={passive:!0};fR(o,[`mousemove`,`dragover`],b,e),n&&t!==`movement`&&(fR(o,[`touchstart`,`touchmove`],x,e),r&&fR(o,`touchend`,y,e)),s&&t===`page`&&fR(a,`scroll`,S,{passive:!0})}return{x:f,y:p,sourceType:m}}function wR(e={}){let{window:t=uR,behavior:n=`auto`}=e;if(!t)return{x:U(0),y:U(0)};let r=U(t.scrollX),i=U(t.scrollY),a=On({get(){return r.value},set(e){scrollTo({left:e,behavior:n})}}),o=On({get(){return i.value},set(e){scrollTo({top:e,behavior:n})}});return fR(t,`scroll`,()=>{r.value=t.scrollX,i.value=t.scrollY},{capture:!1,passive:!0}),{x:a,y:o}}function TR(e={}){let{window:t=uR,initialWidth:n=1/0,initialHeight:r=1/0,listenOrientation:i=!0,includeScrollbar:a=!0,type:o=`inner`}=e,s=U(n),c=U(r),l=()=>{t&&(o===`outer`?(s.value=t.outerWidth,c.value=t.outerHeight):a?(s.value=t.innerWidth,c.value=t.innerHeight):(s.value=t.document.documentElement.clientWidth,c.value=t.document.documentElement.clientHeight))};if(l(),lR(l),fR(`resize`,l,{passive:!0}),i){let e=hR(`(orientation: portrait)`);G(e,()=>l())}return{width:s,height:c}}function ER(e){let{resolution:t,renderer:n,scene:r,envMap:i,fog:a,near:o,far:s}=e;n??=ye().renderer,r??=ye().scene,Cn(()=>{t=un(e.resolution)??255,o=un(e.near)??.1,s=un(e.far)??1e3,i=un(e.envMap)??void 0,a=un(e.fog)??void 0,n=un(e.renderer)??n,r=un(e.scene)??r});let c=On(()=>new zt(un(t)));c.value.texture.type=St,ZL(()=>{c.value.dispose()});let l=On(()=>new st(un(o),un(s),un(c))),u=()=>{let e=un(r),t=e.fog,o=e.background;e.background=un(i)||o,e.fog=un(a)||t,l.value.update(un(n),e),e.fog=t,e.background=o};return Cn(u),{fbo:c,camera:l,update:u}}const DR=[`object`],OR=$t({__name:`component`,props:{frames:{default:1/0},resolution:{},near:{},far:{},envMap:{},fog:{},renderer:{},scene:{}},setup(e,{expose:t}){let n=e,r=W(),{fbo:i,camera:a,update:o}=ER(n),s=0;return be().onBeforeRender(()=>{r.value&&(n.frames===1/0||s{`material`in e&&typeof e.material==`object`&&e.material&&`envMap`in e.material&&(e.material.envMap=i.value.texture)}),s++)}),t({instance:r,fbo:i,camera:a,update:o}),(e,t)=>(K(),nn(`TresGroup`,{ref_key:`groupRef`,ref:r},[xn(`primitive`,{object:H(a)},null,8,DR),Tn(e.$slots,`default`)],512))}}),kR=$t({__name:`Billboard`,props:{autoUpdate:{type:Boolean,default:!0},lockX:{type:Boolean,default:!1},lockY:{type:Boolean,default:!1},lockZ:{type:Boolean,default:!1}},setup(e,{expose:t}){let n=e,r=W(new ge),i=W(new ge),a=new It,o=new Le;function s(e){r.value&&(!e&&(e=ye().camera.value,!e)||(i.value.rotation.copy(o),r.value.updateMatrix(),r.value.updateWorldMatrix(!1,!1),r.value.getWorldQuaternion(a),e.getWorldQuaternion(i.value.quaternion).premultiply(a.invert()),n.lockX&&(i.value.rotation.x=o.x),n.lockY&&(i.value.rotation.y=o.y),n.lockZ&&(i.value.rotation.z=o.z)))}return be().onBeforeRender(({camera:e})=>{n.autoUpdate&&s(e)}),t({instance:r,update:s}),(e,t)=>(K(),nn(`TresGroup`,{ref_key:`outerRef`,ref:r},[xn(`TresGroup`,{ref_key:`innerRef`,ref:i},[Tn(e.$slots,`default`)],512)],512))}}),AR=$t({name:`GlobalAudio`,props:[`src`,`loop`,`volume`,`playbackRate`,`playTrigger`,`stopTrigger`],async setup(e,{expose:t,emit:n}){var r;let{camera:i,renderer:a}=De(),o=new se;(r=i.value)==null||r.add(o);let s=new Tt(o),c=new ot;t({instance:s}),bn(()=>{s&&s.disconnect()}),G(()=>[e.playbackRate],()=>s.setPlaybackRate(e.playbackRate??1),{immediate:!0}),G(()=>[e.volume],()=>s.setVolume(e.volume??.5),{immediate:!0}),G(()=>[e.loop],()=>s.setLoop(e.loop??!1),{immediate:!0}),G(()=>[e.src],async()=>{let t=await c.loadAsync(e.src);s.setBuffer(t)},{immediate:!0});let l=document.getElementById(e.playTrigger??``)||a.value.domElement;fR(l,`click`,()=>{s.isPlaying?s.pause():s.play(),n(`isPlaying`,s.isPlaying)});let u=document.getElementById(e.stopTrigger??``);return u&&fR(u,`click`,()=>{s.stop(),n(`isPlaying`,s.isPlaying)}),null}}),jR=[`color-space`,`args`,`attach`],MR=$t({__name:`GradientTexture`,props:{stops:{},colors:{},attach:{default:`map`},height:{default:1024},width:{default:16},type:{default:`linear`},innerCircleRadius:{default:0},outerCircleRadius:{default:`auto`}},setup(e,{expose:t}){let n=e,r=W(),i=document.createElement(`canvas`);function a(e){let t=e.getContext(`2d`);e.width=n.width,e.height=n.height;let i;if(n.type===`linear`)i=t.createLinearGradient(0,0,0,n.height);else{let r=e.width/2,a=e.height/2,o=n.outerCircleRadius===`auto`?Math.sqrt(r**2+a**2):Math.abs(Number(n.outerCircleRadius));i=t.createRadialGradient(r,a,Math.abs(n.innerCircleRadius),r,a,o)}let a=new me,o=n.stops.length;for(;o--;)i.addColorStop(n.stops[o],a.set(n.colors[o]).getStyle());t.save(),t.fillStyle=i,t.fillRect(0,0,n.width,n.height),t.restore(),r.value&&(r.value.needsUpdate=!0)}let o=ye().renderer;return G(()=>[n.colors,n.stops,n.height,n.width,n.type,n.innerCircleRadius,n.outerCircleRadius],()=>{a(i)},{immediate:!0}),pn(n.colors)&&G(n.colors,()=>a(i)),pn(n.stops)&&G(n.stops,()=>a(i)),t({instance:r}),(e,t)=>(K(),nn(`TresCanvasTexture`,{ref_key:`textureRef`,ref:r,"color-space":H(o).outputColorSpace,args:[H(i)],attach:n.attach},null,8,jR))}});function NR(e,t,n,r){let i=class extends Rt{constructor(r={}){let i=Object.entries(e);super({uniforms:i.reduce((e,[t,n])=>{let r=Et.clone({[t]:{value:n}});return{...e,...r}},{}),vertexShader:t,fragmentShader:n}),XL(this,`key`,``),i.forEach(([e])=>Object.defineProperty(this,e,{get:()=>this.uniforms[e].value,set:t=>this.uniforms[e].value=t})),Object.assign(this,r)}};return i.key=nt.generateUUID(),i}const PR=NR({color:new me(`white`),scale:new ct(1,1),imageBounds:new ct(1,1),resolution:1024,map:null,zoom:1,radius:0,grayscale:0,opacity:1},` varying vec2 vUv; varying vec2 vPos; void main() { @@ -2466,7 +2466,7 @@ params: ${n}`),this.query=t,this.params=n,this.cause=r,Error.captureStackTrace(t #include #include } - `),FR=Tn({__name:`ImageMaterial`,setup(e,{expose:t}){Te({ImageMaterial:PR});let n=W();return t({instance:n}),(e,t)=>(K(),On(`TresImageMaterial`,{ref_key:`materialRef`,ref:n},null,512))}}),IR=[`scale`],LR=[`args`],RR=Tn({__name:`component`,props:{segments:{default:1},scale:{default:1},color:{default:()=>new ge(`white`)},zoom:{default:1},radius:{default:0},grayscale:{default:0},toneMapped:{type:Boolean,default:!0},transparent:{type:Boolean,default:!1},opacity:{default:1},side:{default:Ct},texture:{},url:{}},setup(e,{expose:t}){let n=e,r=W(),i=W(n.texture??null),a=ye().sizes,o=_n(()=>Array.isArray(n.scale)?[n.scale[0],n.scale[1]]:[n.scale,n.scale]),s=_n(()=>{var e,t;return[(e=i.value)?.image.width??0,(t=i.value)?.image.height??0]}),c=_n(()=>Math.max(a.width.value,a.height.value));Nn(()=>{n.texture?i.value=n.texture:xe([n.url]).then(e=>i.value=e)});let l=_n(()=>Array.isArray(n.scale)?[...n.scale,1]:n.scale);return t({instance:r}),(e,t)=>(K(),On(`TresMesh`,{ref_key:`imageRef`,ref:r,scale:l.value},[Qt(e.$slots,`default`,{},()=>[jn(`TresPlaneGeometry`,{args:[1,1,n.segments,n.segments]},null,8,LR)]),xn(FR,{color:n.color,map:i.value,zoom:n.zoom,grayscale:n.grayscale,opacity:n.opacity,scale:o.value,imageBounds:s.value,resolution:c.value,radius:e.radius,toneMapped:e.toneMapped,transparent:e.transparent,side:e.side},null,8,[`color`,`map`,`zoom`,`grayscale`,`opacity`,`scale`,`imageBounds`,`resolution`,`radius`,`toneMapped`,`transparent`,`side`])],8,IR))}}),zR=parseInt(Tt.replace(/\D+/g,``)),BR=zR>=125?`uv1`:`uv2`;function VR(e,t=Math.PI/3){let n=Math.cos(t),r=1.0000000001*100,i=[new B,new B,new B],a=new B,o=new B,s=new B,c=new B;function l(e){let t=~~(e.x*r),n=~~(e.y*r),i=~~(e.z*r);return`${t},${n},${i}`}let u=e.index?e.toNonIndexed():e,d=u.attributes.position,f={};for(let e=0,t=d.count/3;en&&c.add(t)}c.normalize(),m.setXYZ(t+e,c.x,c.y,c.z)}}return u.setAttribute(`normal`,m),u}var HR=Object.defineProperty,UR=(e,t,n)=>t in e?HR(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,WR=(e,t,n)=>(UR(e,t+``,n),n);async function GR(e){let t=await e.arrayBuffer(),n=btoa(String.fromCharCode(...new Uint8Array(t)));return`data:${e.type||``};base64,${n}`}let KR,qR,JR,YR;function XR(e,t=1/0,n=null){qR||=new Ye(2,2,1,1),JR||=new Bt({uniforms:{blitTexture:new ae(e)},vertexShader:` + `),FR=$t({__name:`ImageMaterial`,setup(e,{expose:t}){Te({ImageMaterial:PR});let n=W();return t({instance:n}),(e,t)=>(K(),nn(`TresImageMaterial`,{ref_key:`materialRef`,ref:n},null,512))}}),IR=[`scale`],LR=[`args`],RR=$t({__name:`component`,props:{segments:{default:1},scale:{default:1},color:{default:()=>new me(`white`)},zoom:{default:1},radius:{default:0},grayscale:{default:0},toneMapped:{type:Boolean,default:!0},transparent:{type:Boolean,default:!1},opacity:{default:1},side:{default:xt},texture:{},url:{}},setup(e,{expose:t}){let n=e,r=W(),i=W(n.texture??null),a=ye().sizes,o=On(()=>Array.isArray(n.scale)?[n.scale[0],n.scale[1]]:[n.scale,n.scale]),s=On(()=>{var e,t;return[(e=i.value)?.image.width??0,(t=i.value)?.image.height??0]}),c=On(()=>Math.max(a.width.value,a.height.value));Cn(()=>{n.texture?i.value=n.texture:xe([n.url]).then(e=>i.value=e)});let l=On(()=>Array.isArray(n.scale)?[...n.scale,1]:n.scale);return t({instance:r}),(e,t)=>(K(),nn(`TresMesh`,{ref_key:`imageRef`,ref:r,scale:l.value},[Tn(e.$slots,`default`,{},()=>[xn(`TresPlaneGeometry`,{args:[1,1,n.segments,n.segments]},null,8,LR)]),Mn(FR,{color:n.color,map:i.value,zoom:n.zoom,grayscale:n.grayscale,opacity:n.opacity,scale:o.value,imageBounds:s.value,resolution:c.value,radius:e.radius,toneMapped:e.toneMapped,transparent:e.transparent,side:e.side},null,8,[`color`,`map`,`zoom`,`grayscale`,`opacity`,`scale`,`imageBounds`,`resolution`,`radius`,`toneMapped`,`transparent`,`side`])],8,IR))}}),zR=parseInt(Qe.replace(/\D+/g,``)),BR=zR>=125?`uv1`:`uv2`;function VR(e,t=Math.PI/3){let n=Math.cos(t),r=1.0000000001*100,i=[new B,new B,new B],a=new B,o=new B,s=new B,c=new B;function l(e){let t=~~(e.x*r),n=~~(e.y*r),i=~~(e.z*r);return`${t},${n},${i}`}let u=e.index?e.toNonIndexed():e,d=u.attributes.position,f={};for(let e=0,t=d.count/3;en&&c.add(t)}c.normalize(),m.setXYZ(t+e,c.x,c.y,c.z)}}return u.setAttribute(`normal`,m),u}var HR=Object.defineProperty,UR=(e,t,n)=>t in e?HR(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,WR=(e,t,n)=>(UR(e,t+``,n),n);async function GR(e){let t=await e.arrayBuffer(),n=btoa(String.fromCharCode(...new Uint8Array(t)));return`data:${e.type||``};base64,${n}`}let KR,qR,JR,YR;function XR(e,t=1/0,n=null){qR||=new qe(2,2,1,1),JR||=new Rt({uniforms:{blitTexture:new re(e)},vertexShader:` varying vec2 vUv; void main(){ vUv = uv; @@ -2485,7 +2485,7 @@ params: ${n}`),this.query=t,this.params=n,this.cause=r,Error.captureStackTrace(t gl_FragColor = texture2D( blitTexture, vUv); #endif } - `}),JR.uniforms.blitTexture.value=e,JR.defines.IS_SRGB=`colorSpace`in e?e.colorSpace===`srgb`:e.encoding===3001,JR.needsUpdate=!0,YR||(YR=new V(qR,JR),YR.frustrumCulled=!1);let r=new qe,i=new dt;i.add(YR),n||=KR=new Ae({antialias:!1}),n.setSize(Math.min(e.image.width,t),Math.min(e.image.height,t)),n.clear(),n.render(i,r);let a=new Xt(n.domElement);return a.minFilter=e.minFilter,a.magFilter=e.magFilter,a.wrapS=e.wrapS,a.wrapT=e.wrapT,a.name=e.name,KR&&(KR.dispose(),KR=null),a}const ZR={POSITION:[`byte`,`byte normalized`,`unsigned byte`,`unsigned byte normalized`,`short`,`short normalized`,`unsigned short`,`unsigned short normalized`],NORMAL:[`byte normalized`,`short normalized`],TANGENT:[`byte normalized`,`short normalized`],TEXCOORD:[`byte`,`byte normalized`,`unsigned byte`,`short`,`short normalized`,`unsigned short`]};var QR=class{constructor(){this.pluginCallbacks=[],this.register(function(e){return new yz(e)}),this.register(function(e){return new bz(e)}),this.register(function(e){return new Cz(e)}),this.register(function(e){return new wz(e)}),this.register(function(e){return new Tz(e)}),this.register(function(e){return new Ez(e)}),this.register(function(e){return new xz(e)}),this.register(function(e){return new Sz(e)}),this.register(function(e){return new Dz(e)}),this.register(function(e){return new Oz(e)}),this.register(function(e){return new kz(e)})}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,r){let i=new vz,a=[];for(let e=0,t=this.pluginCallbacks.length;ee.times[e.times.length-1]){if(Math.abs(e.times[e.times.length-1]-t)<.001)return e.times.length-1;r[r.length-1]=t,r.set(e.times,0),i.set(e.values,0),i.set(a.evaluate(t),e.values.length),o=r.length-1}else for(let s=0;st){r.set(e.times.slice(0,s+1),0),r[s+1]=t,r.set(e.times.slice(s+1),s+2),i.set(e.values.slice(0,(s+1)*n),0),i.set(a.evaluate(t),(s+1)*n),i.set(e.values.slice((s+1)*n),(s+2)*n),o=s+1;break}}return e.times=r,e.values=i,o},mergeMorphTargetTracks:function(e,t){let n=[],r={},i=e.tracks;for(let e=0;e4?n=e.array[i*e.itemSize+t]:(t===0?n=e.getX(i):t===1?n=e.getY(i):t===2?n=e.getZ(i):t===3&&(n=e.getW(i)),e.normalized===!0&&(n=it.normalize(n,e.array))),r.min[t]=Math.min(r.min[t],n),r.max[t]=Math.max(r.max[t],n)}return r}function mz(e){return Math.ceil(e/4)*4}function hz(e,t=0){let n=mz(e.byteLength);if(n!==e.byteLength){let r=new Uint8Array(n);if(r.set(new Uint8Array(e)),t!==0)for(let i=e.byteLength;i`u`&&typeof OffscreenCanvas<`u`?new OffscreenCanvas(1,1):document.createElement(`canvas`)}function _z(e,t){if(e.toBlob!==void 0)return new Promise(n=>e.toBlob(n,t));let n;return t===`image/jpeg`?n=.92:t===`image/webp`&&(n=.8),e.convertToBlob({type:t,quality:n})}var vz=class{constructor(){this.plugins=[],this.options={},this.pending=[],this.buffers=[],this.byteOffset=0,this.buffers=[],this.nodeMap=new Map,this.skins=[],this.extensionsUsed={},this.extensionsRequired={},this.uids=new Map,this.uid=0,this.json={asset:{version:`2.0`,generator:`THREE.GLTFExporter`}},this.cache={meshes:new Map,attributes:new Map,attributesNormalized:new Map,materials:new Map,textures:new Map,images:new Map}}setPlugins(e){this.plugins=e}async write(e,t,n={}){this.options=Object.assign({binary:!1,trs:!1,onlyVisible:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},n),this.options.animations.length>0&&(this.options.trs=!0),this.processInput(e),await Promise.all(this.pending);let r=this,i=r.buffers,a=r.json;n=r.options;let o=r.extensionsUsed,s=r.extensionsRequired,c=new Blob(i,{type:`application/octet-stream`}),l=Object.keys(o),u=Object.keys(s);l.length>0&&(a.extensionsUsed=l),u.length>0&&(a.extensionsRequired=u),a.buffers&&a.buffers.length>0&&(a.buffers[0].byteLength=c.size),n.binary===!0?c.arrayBuffer().then(e=>{let n=hz(e),r=new DataView(new ArrayBuffer(sz));r.setUint32(0,n.byteLength,!0),r.setUint32(4,lz,!0);let i=hz(dz(JSON.stringify(a)),32),o=new DataView(new ArrayBuffer(sz));o.setUint32(0,i.byteLength,!0),o.setUint32(4,cz,!0);let s=new ArrayBuffer(iz),c=new DataView(s);c.setUint32(0,az,!0),c.setUint32(4,oz,!0);let l=iz+o.byteLength+i.byteLength+r.byteLength+n.byteLength;c.setUint32(8,l,!0),new Blob([s,o,i,r,n],{type:`application/octet-stream`}).arrayBuffer().then(t)}):a.buffers&&a.buffers.length>0?GR(c).then(e=>{a.buffers[0].uri=e,t(a)}):t(a)}serializeUserData(e,t){if(Object.keys(e.userData).length===0)return;let n=this.options,r=this.extensionsUsed;try{let i=JSON.parse(JSON.stringify(e.userData));if(n.includeCustomExtensions&&i.gltfExtensions){for(let e in t.extensions===void 0&&(t.extensions={}),i.gltfExtensions)t.extensions[e]=i.gltfExtensions[e],r[e]=!0;delete i.gltfExtensions}Object.keys(i).length>0&&(t.extras=i)}catch(t){console.warn(`THREE.GLTFExporter: userData of '`+e.name+`' won't be serialized because of JSON.stringify error - `+t.message)}}getUID(e,t=!1){if(this.uids.has(e)===!1){let t=new Map;t.set(!0,this.uid++),t.set(!1,this.uid++),this.uids.set(e,t)}return this.uids.get(e).get(t)}isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;let t=new B;for(let n=0,r=e.count;n5e-4)return!1;return!0}createNormalizedNormalAttribute(e){let t=this.cache;if(t.attributesNormalized.has(e))return t.attributesNormalized.get(e);let n=e.clone(),r=new B;for(let e=0,t=n.count;e4?r=e.array[i*e.itemSize+n]:(n===0?r=e.getX(i):n===1?r=e.getY(i):n===2?r=e.getZ(i):n===3&&(r=e.getW(i)),e.normalized===!0&&(r=it.normalize(r,e.array))),t===$R.FLOAT?c.setFloat32(l,r,!0):t===$R.INT?c.setInt32(l,r,!0):t===$R.UNSIGNED_INT?c.setUint32(l,r,!0):t===$R.SHORT?c.setInt16(l,r,!0):t===$R.UNSIGNED_SHORT?c.setUint16(l,r,!0):t===$R.BYTE?c.setInt8(l,r):t===$R.UNSIGNED_BYTE&&c.setUint8(l,r),l+=o}let u={buffer:this.processBuffer(c.buffer),byteOffset:this.byteOffset,byteLength:s};return i!==void 0&&(u.target=i),i===$R.ARRAY_BUFFER&&(u.byteStride=e.itemSize*o),this.byteOffset+=s,a.bufferViews.push(u),{id:a.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){let t=this,n=t.json;return n.bufferViews||=[],e.arrayBuffer().then(e=>{let r=hz(e),i={buffer:t.processBuffer(r),byteOffset:t.byteOffset,byteLength:r.byteLength};return t.byteOffset+=r.byteLength,n.bufferViews.push(i)-1})}processAccessor(e,t,n,r){let i=this.json,a={1:`SCALAR`,2:`VEC2`,3:`VEC3`,4:`VEC4`,9:`MAT3`,16:`MAT4`},o;if(e.array.constructor===Float32Array)o=$R.FLOAT;else if(e.array.constructor===Int32Array)o=$R.INT;else if(e.array.constructor===Uint32Array)o=$R.UNSIGNED_INT;else if(e.array.constructor===Int16Array)o=$R.SHORT;else if(e.array.constructor===Uint16Array)o=$R.UNSIGNED_SHORT;else if(e.array.constructor===Int8Array)o=$R.BYTE;else if(e.array.constructor===Uint8Array)o=$R.UNSIGNED_BYTE;else throw Error(`THREE.GLTFExporter: Unsupported bufferAttribute component type: `+e.array.constructor.name);if(n===void 0&&(n=0),r===void 0&&(r=e.count),r===0)return null;let s=pz(e,n,r),c;t!==void 0&&(c=e===t.index?$R.ELEMENT_ARRAY_BUFFER:$R.ARRAY_BUFFER);let l=this.processBufferView(e,o,n,r,c),u={bufferView:l.id,byteOffset:l.byteOffset,componentType:o,count:r,max:s.max,min:s.min,type:a[e.itemSize]};return e.normalized===!0&&(u.normalized=!0),i.accessors||=[],i.accessors.push(u)-1}processImage(e,t,n,r=`image/png`){if(e!==null){let i=this,a=i.cache,o=i.json,s=i.options,c=i.pending;a.images.has(e)||a.images.set(e,{});let l=a.images.get(e),u=r+`:flipY/`+n.toString();if(l[u]!==void 0)return l[u];o.images||=[];let d={mimeType:r},f=gz();f.width=Math.min(e.width,s.maxTextureSize),f.height=Math.min(e.height,s.maxTextureSize);let p=f.getContext(`2d`);if(n===!0&&(p.translate(0,f.height),p.scale(1,-1)),e.data!==void 0){t!==ie&&console.error(`GLTFExporter: Only RGBAFormat is supported.`,t),(e.width>s.maxTextureSize||e.height>s.maxTextureSize)&&console.warn(`GLTFExporter: Image size is bigger than maxTextureSize`,e);let n=new Uint8ClampedArray(e.height*e.width*4);for(let t=0;ti.processBufferViewImage(e)).then(e=>{d.bufferView=e})):f.toDataURL===void 0?c.push(_z(f,r).then(GR).then(e=>{d.uri=e})):d.uri=f.toDataURL(r);let m=o.images.push(d)-1;return l[u]=m,m}else throw Error(`THREE.GLTFExporter: No valid image data found. Unable to process texture.`)}processSampler(e){let t=this.json;t.samplers||=[];let n={magFilter:tz[e.magFilter],minFilter:tz[e.minFilter],wrapS:tz[e.wrapS],wrapT:tz[e.wrapT]};return t.samplers.push(n)-1}processTexture(e){let t=this.options,n=this.cache,r=this.json;if(n.textures.has(e))return n.textures.get(e);r.textures||=[],e instanceof ce&&(e=XR(e,t.maxTextureSize));let i=e.userData.mimeType;i===`image/webp`&&(i=`image/png`);let a={sampler:this.processSampler(e),source:this.processImage(e.image,e.format,e.flipY,i)};e.name&&(a.name=e.name),this._invokeAll(function(t){t.writeTexture&&t.writeTexture(e,a)});let o=r.textures.push(a)-1;return n.textures.set(e,o),o}processMaterial(e){let t=this.cache,n=this.json;if(t.materials.has(e))return t.materials.get(e);if(e.isShaderMaterial)return console.warn(`GLTFExporter: THREE.ShaderMaterial not supported.`),null;n.materials||=[];let r={pbrMetallicRoughness:{}};e.isMeshStandardMaterial!==!0&&e.isMeshBasicMaterial!==!0&&console.warn(`GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.`);let i=e.color.toArray().concat([e.opacity]);if(uz(i,[1,1,1,1])||(r.pbrMetallicRoughness.baseColorFactor=i),e.isMeshStandardMaterial?(r.pbrMetallicRoughness.metallicFactor=e.metalness,r.pbrMetallicRoughness.roughnessFactor=e.roughness):(r.pbrMetallicRoughness.metallicFactor=.5,r.pbrMetallicRoughness.roughnessFactor=.5),e.metalnessMap||e.roughnessMap){let t=this.buildMetalRoughTexture(e.metalnessMap,e.roughnessMap),n={index:this.processTexture(t),channel:t.channel};this.applyTextureTransform(n,t),r.pbrMetallicRoughness.metallicRoughnessTexture=n}if(e.map){let t={index:this.processTexture(e.map),texCoord:e.map.channel};this.applyTextureTransform(t,e.map),r.pbrMetallicRoughness.baseColorTexture=t}if(e.emissive){let t=e.emissive;if(Math.max(t.r,t.g,t.b)>0&&(r.emissiveFactor=e.emissive.toArray()),e.emissiveMap){let t={index:this.processTexture(e.emissiveMap),texCoord:e.emissiveMap.channel};this.applyTextureTransform(t,e.emissiveMap),r.emissiveTexture=t}}if(e.normalMap){let t={index:this.processTexture(e.normalMap),texCoord:e.normalMap.channel};e.normalScale&&e.normalScale.x!==1&&(t.scale=e.normalScale.x),this.applyTextureTransform(t,e.normalMap),r.normalTexture=t}if(e.aoMap){let t={index:this.processTexture(e.aoMap),texCoord:e.aoMap.channel};e.aoMapIntensity!==1&&(t.strength=e.aoMapIntensity),this.applyTextureTransform(t,e.aoMap),r.occlusionTexture=t}e.transparent?r.alphaMode=`BLEND`:e.alphaTest>0&&(r.alphaMode=`MASK`,r.alphaCutoff=e.alphaTest),e.side===Ve&&(r.doubleSided=!0),e.name!==``&&(r.name=e.name),this.serializeUserData(e,r),this._invokeAll(function(t){t.writeMaterial&&t.writeMaterial(e,r)});let a=n.materials.push(r)-1;return t.materials.set(e,a),a}processMesh(e){let t=this.cache,n=this.json,r=[e.geometry.uuid];if(Array.isArray(e.material))for(let t=0,n=e.material.length;t=152?{uv:`TEXCOORD_0`,uv1:`TEXCOORD_1`,uv2:`TEXCOORD_2`,uv3:`TEXCOORD_3`}:{uv:`TEXCOORD_0`,uv2:`TEXCOORD_1`},color:`COLOR_0`,skinWeight:`WEIGHTS_0`,skinIndex:`JOINTS_0`},f=a.getAttribute(`normal`);f!==void 0&&!this.isNormalizedNormalAttribute(f)&&(console.warn(`THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one.`),a.setAttribute(`normal`,this.createNormalizedNormalAttribute(f)));let p=null;for(let e in a.attributes){if(e.slice(0,5)===`morph`)continue;let n=a.attributes[e];if(e=d[e]||e.toUpperCase(),/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(e)||(e=`_`+e),t.attributes.has(this.getUID(n))){c[e]=t.attributes.get(this.getUID(n));continue}p=null;let r=n.array;e===`JOINTS_0`&&!(r instanceof Uint16Array)&&!(r instanceof Uint8Array)&&(console.warn(`GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.`),p=new se(new Uint16Array(r),n.itemSize,n.normalized));let i=this.processAccessor(p||n,a);i!==null&&(e.startsWith(`_`)||this.detectMeshQuantization(e,n),c[e]=i,t.attributes.set(this.getUID(n),i))}if(f!==void 0&&a.setAttribute(`normal`,f),Object.keys(c).length===0)return null;if(e.morphTargetInfluences!==void 0&&e.morphTargetInfluences.length>0){let n=[],r=[],i={};if(e.morphTargetDictionary!==void 0)for(let t in e.morphTargetDictionary)i[e.morphTargetDictionary[t]]=t;for(let o=0;o0&&(s.extras={},s.extras.targetNames=r)}let m=Array.isArray(e.material);if(m&&a.groups.length===0)return null;let h=m?e.material:[e.material],g=m?a.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let e=0,n=g.length;e0&&(n.targets=u),a.index!==null){let r=this.getUID(a.index);(g[e].start!==void 0||g[e].count!==void 0)&&(r+=`:`+g[e].start+`:`+g[e].count),t.attributes.has(r)?n.indices=t.attributes.get(r):(n.indices=this.processAccessor(a.index,a,g[e].start,g[e].count),t.attributes.set(r,n.indices)),n.indices===null&&delete n.indices}let r=this.processMaterial(h[g[e].materialIndex]);r!==null&&(n.material=r),l.push(n)}s.primitives=l,n.meshes||=[],this._invokeAll(function(t){t.writeMesh&&t.writeMesh(e,s)});let _=n.meshes.push(s)-1;return t.meshes.set(i,_),_}detectMeshQuantization(e,t){if(this.extensionsUsed[ez])return;let n;switch(t.array.constructor){case Int8Array:n=`byte`;break;case Uint8Array:n=`unsigned byte`;break;case Int16Array:n=`short`;break;case Uint16Array:n=`unsigned short`;break;default:return}t.normalized&&(n+=` normalized`);let r=e.split(`_`,1)[0];ZR[r]&&ZR[r].includes(n)&&(this.extensionsUsed[ez]=!0,this.extensionsRequired[ez]=!0)}processCamera(e){let t=this.json;t.cameras||=[];let n=e.isOrthographicCamera,r={type:n?`orthographic`:`perspective`};return n?r.orthographic={xmag:e.right*2,ymag:e.top*2,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:r.perspective={aspectRatio:e.aspect,yfov:it.degToRad(e.fov),zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},e.name!==``&&(r.name=e.type),t.cameras.push(r)-1}processAnimation(e,t){let n=this.json,r=this.nodeMap;n.animations||=[],e=QR.Utils.mergeMorphTargetTracks(e.clone(),t);let i=e.tracks,a=[],o=[];for(let e=0;e0){let t=[];for(let r=0,i=e.children.length;r0&&(i.children=t)}this._invokeAll(function(t){t.writeNode&&t.writeNode(e,i)});let a=t.nodes.push(i)-1;return r.set(e,a),a}processScene(e){let t=this.json,n=this.options;t.scenes||(t.scenes=[],t.scene=0);let r={};e.name!==``&&(r.name=e.name),t.scenes.push(r);let i=[];for(let t=0,r=e.children.length;t0&&(r.nodes=i),this.serializeUserData(e,r)}processObjects(e){let t=new dt;t.name=`AuxScene`;for(let n=0;n0&&this.processObjects(n);for(let e=0;e0&&(a.range=e.distance)):e.isSpotLight&&(a.type=`spot`,e.distance>0&&(a.range=e.distance),a.spot={},a.spot.innerConeAngle=(e.penumbra-1)*e.angle*-1,a.spot.outerConeAngle=e.angle),e.decay!==void 0&&e.decay!==2&&console.warn(`THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2.`),e.target&&(e.target.parent!==e||e.target.position.x!==0||e.target.position.y!==0||e.target.position.z!==-1)&&console.warn(`THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1.`),i[this.name]||(r.extensions=r.extensions||{},r.extensions[this.name]={lights:[]},i[this.name]=!0);let o=r.extensions[this.name].lights;o.push(a),t.extensions=t.extensions||{},t.extensions[this.name]={light:o.length-1}}};let bz=class{constructor(e){this.writer=e,this.name=`KHR_materials_unlit`}writeMaterial(e,t){if(!e.isMeshBasicMaterial)return;let n=this.writer.extensionsUsed;t.extensions=t.extensions||{},t.extensions[this.name]={},n[this.name]=!0,t.pbrMetallicRoughness.metallicFactor=0,t.pbrMetallicRoughness.roughnessFactor=.9}},xz=class{constructor(e){this.writer=e,this.name=`KHR_materials_clearcoat`}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.clearcoat===0)return;let n=this.writer,r=n.extensionsUsed,i={};if(i.clearcoatFactor=e.clearcoat,e.clearcoatMap){let t={index:n.processTexture(e.clearcoatMap),texCoord:e.clearcoatMap.channel};n.applyTextureTransform(t,e.clearcoatMap),i.clearcoatTexture=t}if(i.clearcoatRoughnessFactor=e.clearcoatRoughness,e.clearcoatRoughnessMap){let t={index:n.processTexture(e.clearcoatRoughnessMap),texCoord:e.clearcoatRoughnessMap.channel};n.applyTextureTransform(t,e.clearcoatRoughnessMap),i.clearcoatRoughnessTexture=t}if(e.clearcoatNormalMap){let t={index:n.processTexture(e.clearcoatNormalMap),texCoord:e.clearcoatNormalMap.channel};n.applyTextureTransform(t,e.clearcoatNormalMap),i.clearcoatNormalTexture=t}t.extensions=t.extensions||{},t.extensions[this.name]=i,r[this.name]=!0}},Sz=class{constructor(e){this.writer=e,this.name=`KHR_materials_iridescence`}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.iridescence===0)return;let n=this.writer,r=n.extensionsUsed,i={};if(i.iridescenceFactor=e.iridescence,e.iridescenceMap){let t={index:n.processTexture(e.iridescenceMap),texCoord:e.iridescenceMap.channel};n.applyTextureTransform(t,e.iridescenceMap),i.iridescenceTexture=t}if(i.iridescenceIor=e.iridescenceIOR,i.iridescenceThicknessMinimum=e.iridescenceThicknessRange[0],i.iridescenceThicknessMaximum=e.iridescenceThicknessRange[1],e.iridescenceThicknessMap){let t={index:n.processTexture(e.iridescenceThicknessMap),texCoord:e.iridescenceThicknessMap.channel};n.applyTextureTransform(t,e.iridescenceThicknessMap),i.iridescenceThicknessTexture=t}t.extensions=t.extensions||{},t.extensions[this.name]=i,r[this.name]=!0}},Cz=class{constructor(e){this.writer=e,this.name=`KHR_materials_transmission`}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;let n=this.writer,r=n.extensionsUsed,i={};if(i.transmissionFactor=e.transmission,e.transmissionMap){let t={index:n.processTexture(e.transmissionMap),texCoord:e.transmissionMap.channel};n.applyTextureTransform(t,e.transmissionMap),i.transmissionTexture=t}t.extensions=t.extensions||{},t.extensions[this.name]=i,r[this.name]=!0}},wz=class{constructor(e){this.writer=e,this.name=`KHR_materials_volume`}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;let n=this.writer,r=n.extensionsUsed,i={};if(i.thicknessFactor=e.thickness,e.thicknessMap){let t={index:n.processTexture(e.thicknessMap),texCoord:e.thicknessMap.channel};n.applyTextureTransform(t,e.thicknessMap),i.thicknessTexture=t}i.attenuationDistance=e.attenuationDistance,i.attenuationColor=e.attenuationColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=i,r[this.name]=!0}},Tz=class{constructor(e){this.writer=e,this.name=`KHR_materials_ior`}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.ior===1.5)return;let n=this.writer.extensionsUsed,r={};r.ior=e.ior,t.extensions=t.extensions||{},t.extensions[this.name]=r,n[this.name]=!0}},Ez=class{constructor(e){this.writer=e,this.name=`KHR_materials_specular`}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.specularIntensity===1&&e.specularColor.equals(rz)&&!e.specularIntensityMap&&!e.specularColorTexture)return;let n=this.writer,r=n.extensionsUsed,i={};if(e.specularIntensityMap){let t={index:n.processTexture(e.specularIntensityMap),texCoord:e.specularIntensityMap.channel};n.applyTextureTransform(t,e.specularIntensityMap),i.specularTexture=t}if(e.specularColorMap){let t={index:n.processTexture(e.specularColorMap),texCoord:e.specularColorMap.channel};n.applyTextureTransform(t,e.specularColorMap),i.specularColorTexture=t}i.specularFactor=e.specularIntensity,i.specularColorFactor=e.specularColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=i,r[this.name]=!0}},Dz=class{constructor(e){this.writer=e,this.name=`KHR_materials_sheen`}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.sheen==0)return;let n=this.writer,r=n.extensionsUsed,i={};if(e.sheenRoughnessMap){let t={index:n.processTexture(e.sheenRoughnessMap),texCoord:e.sheenRoughnessMap.channel};n.applyTextureTransform(t,e.sheenRoughnessMap),i.sheenRoughnessTexture=t}if(e.sheenColorMap){let t={index:n.processTexture(e.sheenColorMap),texCoord:e.sheenColorMap.channel};n.applyTextureTransform(t,e.sheenColorMap),i.sheenColorTexture=t}i.sheenRoughnessFactor=e.sheenRoughness,i.sheenColorFactor=e.sheenColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=i,r[this.name]=!0}},Oz=class{constructor(e){this.writer=e,this.name=`KHR_materials_anisotropy`}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.anisotropy==0)return;let n=this.writer,r=n.extensionsUsed,i={};if(e.anisotropyMap){let t={index:n.processTexture(e.anisotropyMap)};n.applyTextureTransform(t,e.anisotropyMap),i.anisotropyTexture=t}i.anisotropyStrength=e.anisotropy,i.anisotropyRotation=e.anisotropyRotation,t.extensions=t.extensions||{},t.extensions[this.name]=i,r[this.name]=!0}},kz=class{constructor(e){this.writer=e,this.name=`KHR_materials_emissive_strength`}writeMaterial(e,t){if(!e.isMeshStandardMaterial||e.emissiveIntensity===1)return;let n=this.writer.extensionsUsed,r={};r.emissiveStrength=e.emissiveIntensity,t.extensions=t.extensions||{},t.extensions[this.name]=r,n[this.name]=!0}};var Az=Uint8Array,jz=Uint16Array,Mz=Uint32Array,Nz=new Az([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Pz=new Az([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Fz=new Az([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Iz=function(e,t){for(var n=new jz(31),r=0;r<31;++r)n[r]=t+=1<>>1|(Uz&21845)<<1;Wz=(Wz&52428)>>>2|(Wz&13107)<<2,Wz=(Wz&61680)>>>4|(Wz&3855)<<4,Hz[Uz]=((Wz&65280)>>>8|(Wz&255)<<8)>>>1}for(var Gz=function(e,t,n){for(var r=e.length,i=0,a=new jz(t);i>>c]=l}else for(s=new jz(r),i=0;i>>15-e[i]);return s},Kz=new Az(288),Uz=0;Uz<144;++Uz)Kz[Uz]=8;for(var Uz=144;Uz<256;++Uz)Kz[Uz]=9;for(var Uz=256;Uz<280;++Uz)Kz[Uz]=7;for(var Uz=280;Uz<288;++Uz)Kz[Uz]=8;for(var qz=new Az(32),Uz=0;Uz<32;++Uz)qz[Uz]=5;var Jz=Gz(Kz,9,1),Yz=Gz(qz,5,1),Xz=function(e){for(var t=e[0],n=1;nt&&(t=e[n]);return t},Zz=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(t&7)&n},Qz=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(t&7)},$z=function(e){return(e/8|0)+(e&7&&1)},eB=function(e,t,n){(n==null||n>e.length)&&(n=e.length);var r=new(e instanceof jz?jz:e instanceof Mz?Mz:Az)(n-t);return r.set(e.subarray(t,n)),r},tB=function(e,t,n){var r=e.length;if(!r||n&&!n.l&&r<5)return t||new Az(0);var i=!t||n,a=!n||n.i;n||={},t||=new Az(r*3);var o=function(e){var n=t.length;if(e>n){var r=new Az(Math.max(n*2,e));r.set(t),t=r}},s=n.f||0,c=n.p||0,l=n.b||0,u=n.l,d=n.d,f=n.m,p=n.n,m=r*8;do{if(!u){n.f=s=Zz(e,c,1);var h=Zz(e,c+1,3);if(c+=3,h)if(h==1)u=Jz,d=Yz,f=9,p=5;else if(h==2){var g=Zz(e,c,31)+257,_=Zz(e,c+10,15)+4,v=g+Zz(e,c+5,31)+1;c+=14;for(var y=new Az(v),b=new Az(19),x=0;x<_;++x)b[Fz[x]]=Zz(e,c+x*3,7);c+=_*3;for(var S=Xz(b),C=(1<>>4;if(E<16)y[x++]=E;else{var D=0,O=0;for(E==16?(O=3+Zz(e,c,3),c+=2,D=y[x-1]):E==17?(O=3+Zz(e,c,7),c+=3):E==18&&(O=11+Zz(e,c,127),c+=7);O--;)y[x++]=D}}var k=y.subarray(0,g),A=y.subarray(g);f=Xz(k),p=Xz(A),u=Gz(k,f,1),d=Gz(A,p,1)}else throw`invalid block type`;else{var E=$z(c)+4,j=e[E-4]|e[E-3]<<8,M=E+j;if(M>r){if(a)throw`unexpected EOF`;break}i&&o(l+j),t.set(e.subarray(E,M),l),n.b=l+=j,n.p=c=M*8;continue}if(c>m){if(a)throw`unexpected EOF`;break}}i&&o(l+131072);for(var N=(1<>>4;if(c+=D&15,c>m){if(a)throw`unexpected EOF`;break}if(!D)throw`invalid length/literal`;if(F<256)t[l++]=F;else if(F==256){P=c,u=null;break}else{var I=F-254;if(F>264){var x=F-257,L=Nz[x];I=Zz(e,c,(1<>>4;if(!te)throw`invalid distance`;c+=te&15;var A=Vz[R];if(R>3){var L=Pz[R];A+=Qz(e,c)&(1<m){if(a)throw`unexpected EOF`;break}i&&o(l+131072);for(var ne=l+I;l>>4>7||(e[0]<<8|e[1])%31)throw`invalid zlib data`;if(e[1]&32)throw`invalid zlib data: preset dictionaries not supported`},iB=typeof TextDecoder<`u`&&new TextDecoder,aB=0;try{iB.decode(nB,{stream:!0}),aB=1}catch{}var oB=Object.defineProperty,sB=(e,t,n)=>t in e?oB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,cB=(e,t,n)=>(sB(e,t+``,n),n);const lB=class extends V{constructor(e,t={}){super(e),this.isReflector=!0,this.type=`Reflector`,this.camera=new qe;let n=this,r=t.color===void 0?new ge(8355711):new ge(t.color),i=t.textureWidth||512,a=t.textureHeight||512,o=t.clipBias||0,s=t.shader||lB.ReflectorShader,c=t.multisample===void 0?4:t.multisample,l=new Ft,u=new B,d=new B,f=new B,p=new je,m=new B(0,0,-1),h=new Yt,g=new B,_=new B,v=new Yt,y=new je,b=this.camera,x=new re(i,a,{samples:c,type:wt}),S=new Bt({uniforms:Dt.clone(s.uniforms),fragmentShader:s.fragmentShader,vertexShader:s.vertexShader});S.uniforms.tDiffuse.value=x.texture,S.uniforms.color.value=r,S.uniforms.textureMatrix.value=y,this.material=S,this.onBeforeRender=function(e,t,r){if(d.setFromMatrixPosition(n.matrixWorld),f.setFromMatrixPosition(r.matrixWorld),p.extractRotation(n.matrixWorld),u.set(0,0,1),u.applyMatrix4(p),g.subVectors(d,f),g.dot(u)>0)return;g.reflect(u).negate(),g.add(d),p.extractRotation(r.matrixWorld),m.set(0,0,-1),m.applyMatrix4(p),m.add(f),_.subVectors(d,m),_.reflect(u).negate(),_.add(d),b.position.copy(g),b.up.set(0,1,0),b.up.applyMatrix4(p),b.up.reflect(u),b.lookAt(_),b.far=r.far,b.updateMatrixWorld(),b.projectionMatrix.copy(r.projectionMatrix),y.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),y.multiply(b.projectionMatrix),y.multiply(b.matrixWorldInverse),y.multiply(n.matrixWorld),l.setFromNormalAndCoplanarPoint(u,d),l.applyMatrix4(b.matrixWorldInverse),h.set(l.normal.x,l.normal.y,l.normal.z,l.constant);let i=b.projectionMatrix;v.x=(Math.sign(h.x)+i.elements[8])/i.elements[0],v.y=(Math.sign(h.y)+i.elements[9])/i.elements[5],v.z=-1,v.w=(1+i.elements[10])/i.elements[14],h.multiplyScalar(2/h.dot(v)),i.elements[2]=h.x,i.elements[6]=h.y,i.elements[10]=h.z+1-o,i.elements[14]=h.w,n.visible=!1;let a=e.getRenderTarget(),s=e.xr.enabled,c=e.shadowMap.autoUpdate,S=e.toneMapping,C=!1;C=`outputColorSpace`in e?e.outputColorSpace===`srgb`:e.outputEncoding===3001,e.xr.enabled=!1,e.shadowMap.autoUpdate=!1,`outputColorSpace`in e?e.outputColorSpace=`srgb-linear`:e.outputEncoding=3e3,e.toneMapping=jt,e.setRenderTarget(x),e.state.buffers.depth.setMask(!0),e.autoClear===!1&&e.clear(),e.render(t,b),e.xr.enabled=s,e.shadowMap.autoUpdate=c,e.toneMapping=S,`outputColorSpace`in e?e.outputColorSpace=C?`srgb`:`srgb-linear`:e.outputEncoding=C?3001:3e3,e.setRenderTarget(a);let w=r.viewport;w!==void 0&&e.state.viewport(w),n.visible=!0},this.getRenderTarget=function(){return x},this.dispose=function(){x.dispose(),n.material.dispose()}}};let uB=lB;cB(uB,`ReflectorShader`,{uniforms:{color:{value:null},tDiffuse:{value:null},textureMatrix:{value:null}},vertexShader:` + `}),JR.uniforms.blitTexture.value=e,JR.defines.IS_SRGB=`colorSpace`in e?e.colorSpace===`srgb`:e.encoding===3001,JR.needsUpdate=!0,YR||(YR=new V(qR,JR),YR.frustrumCulled=!1);let r=new Ge,i=new lt;i.add(YR),n||=KR=new Ae({antialias:!1}),n.setSize(Math.min(e.image.width,t),Math.min(e.image.height,t)),n.clear(),n.render(i,r);let a=new Jt(n.domElement);return a.minFilter=e.minFilter,a.magFilter=e.magFilter,a.wrapS=e.wrapS,a.wrapT=e.wrapT,a.name=e.name,KR&&(KR.dispose(),KR=null),a}const ZR={POSITION:[`byte`,`byte normalized`,`unsigned byte`,`unsigned byte normalized`,`short`,`short normalized`,`unsigned short`,`unsigned short normalized`],NORMAL:[`byte normalized`,`short normalized`],TANGENT:[`byte normalized`,`short normalized`],TEXCOORD:[`byte`,`byte normalized`,`unsigned byte`,`short`,`short normalized`,`unsigned short`]};var QR=class{constructor(){this.pluginCallbacks=[],this.register(function(e){return new yz(e)}),this.register(function(e){return new bz(e)}),this.register(function(e){return new Cz(e)}),this.register(function(e){return new wz(e)}),this.register(function(e){return new Tz(e)}),this.register(function(e){return new Ez(e)}),this.register(function(e){return new xz(e)}),this.register(function(e){return new Sz(e)}),this.register(function(e){return new Dz(e)}),this.register(function(e){return new Oz(e)}),this.register(function(e){return new kz(e)})}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,r){let i=new vz,a=[];for(let e=0,t=this.pluginCallbacks.length;ee.times[e.times.length-1]){if(Math.abs(e.times[e.times.length-1]-t)<.001)return e.times.length-1;r[r.length-1]=t,r.set(e.times,0),i.set(e.values,0),i.set(a.evaluate(t),e.values.length),o=r.length-1}else for(let s=0;st){r.set(e.times.slice(0,s+1),0),r[s+1]=t,r.set(e.times.slice(s+1),s+2),i.set(e.values.slice(0,(s+1)*n),0),i.set(a.evaluate(t),(s+1)*n),i.set(e.values.slice((s+1)*n),(s+2)*n),o=s+1;break}}return e.times=r,e.values=i,o},mergeMorphTargetTracks:function(e,t){let n=[],r={},i=e.tracks;for(let e=0;e4?n=e.array[i*e.itemSize+t]:(t===0?n=e.getX(i):t===1?n=e.getY(i):t===2?n=e.getZ(i):t===3&&(n=e.getW(i)),e.normalized===!0&&(n=nt.normalize(n,e.array))),r.min[t]=Math.min(r.min[t],n),r.max[t]=Math.max(r.max[t],n)}return r}function mz(e){return Math.ceil(e/4)*4}function hz(e,t=0){let n=mz(e.byteLength);if(n!==e.byteLength){let r=new Uint8Array(n);if(r.set(new Uint8Array(e)),t!==0)for(let i=e.byteLength;i`u`&&typeof OffscreenCanvas<`u`?new OffscreenCanvas(1,1):document.createElement(`canvas`)}function _z(e,t){if(e.toBlob!==void 0)return new Promise(n=>e.toBlob(n,t));let n;return t===`image/jpeg`?n=.92:t===`image/webp`&&(n=.8),e.convertToBlob({type:t,quality:n})}var vz=class{constructor(){this.plugins=[],this.options={},this.pending=[],this.buffers=[],this.byteOffset=0,this.buffers=[],this.nodeMap=new Map,this.skins=[],this.extensionsUsed={},this.extensionsRequired={},this.uids=new Map,this.uid=0,this.json={asset:{version:`2.0`,generator:`THREE.GLTFExporter`}},this.cache={meshes:new Map,attributes:new Map,attributesNormalized:new Map,materials:new Map,textures:new Map,images:new Map}}setPlugins(e){this.plugins=e}async write(e,t,n={}){this.options=Object.assign({binary:!1,trs:!1,onlyVisible:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},n),this.options.animations.length>0&&(this.options.trs=!0),this.processInput(e),await Promise.all(this.pending);let r=this,i=r.buffers,a=r.json;n=r.options;let o=r.extensionsUsed,s=r.extensionsRequired,c=new Blob(i,{type:`application/octet-stream`}),l=Object.keys(o),u=Object.keys(s);l.length>0&&(a.extensionsUsed=l),u.length>0&&(a.extensionsRequired=u),a.buffers&&a.buffers.length>0&&(a.buffers[0].byteLength=c.size),n.binary===!0?c.arrayBuffer().then(e=>{let n=hz(e),r=new DataView(new ArrayBuffer(sz));r.setUint32(0,n.byteLength,!0),r.setUint32(4,lz,!0);let i=hz(dz(JSON.stringify(a)),32),o=new DataView(new ArrayBuffer(sz));o.setUint32(0,i.byteLength,!0),o.setUint32(4,cz,!0);let s=new ArrayBuffer(iz),c=new DataView(s);c.setUint32(0,az,!0),c.setUint32(4,oz,!0);let l=iz+o.byteLength+i.byteLength+r.byteLength+n.byteLength;c.setUint32(8,l,!0),new Blob([s,o,i,r,n],{type:`application/octet-stream`}).arrayBuffer().then(t)}):a.buffers&&a.buffers.length>0?GR(c).then(e=>{a.buffers[0].uri=e,t(a)}):t(a)}serializeUserData(e,t){if(Object.keys(e.userData).length===0)return;let n=this.options,r=this.extensionsUsed;try{let i=JSON.parse(JSON.stringify(e.userData));if(n.includeCustomExtensions&&i.gltfExtensions){for(let e in t.extensions===void 0&&(t.extensions={}),i.gltfExtensions)t.extensions[e]=i.gltfExtensions[e],r[e]=!0;delete i.gltfExtensions}Object.keys(i).length>0&&(t.extras=i)}catch(t){console.warn(`THREE.GLTFExporter: userData of '`+e.name+`' won't be serialized because of JSON.stringify error - `+t.message)}}getUID(e,t=!1){if(this.uids.has(e)===!1){let t=new Map;t.set(!0,this.uid++),t.set(!1,this.uid++),this.uids.set(e,t)}return this.uids.get(e).get(t)}isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;let t=new B;for(let n=0,r=e.count;n5e-4)return!1;return!0}createNormalizedNormalAttribute(e){let t=this.cache;if(t.attributesNormalized.has(e))return t.attributesNormalized.get(e);let n=e.clone(),r=new B;for(let e=0,t=n.count;e4?r=e.array[i*e.itemSize+n]:(n===0?r=e.getX(i):n===1?r=e.getY(i):n===2?r=e.getZ(i):n===3&&(r=e.getW(i)),e.normalized===!0&&(r=nt.normalize(r,e.array))),t===$R.FLOAT?c.setFloat32(l,r,!0):t===$R.INT?c.setInt32(l,r,!0):t===$R.UNSIGNED_INT?c.setUint32(l,r,!0):t===$R.SHORT?c.setInt16(l,r,!0):t===$R.UNSIGNED_SHORT?c.setUint16(l,r,!0):t===$R.BYTE?c.setInt8(l,r):t===$R.UNSIGNED_BYTE&&c.setUint8(l,r),l+=o}let u={buffer:this.processBuffer(c.buffer),byteOffset:this.byteOffset,byteLength:s};return i!==void 0&&(u.target=i),i===$R.ARRAY_BUFFER&&(u.byteStride=e.itemSize*o),this.byteOffset+=s,a.bufferViews.push(u),{id:a.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){let t=this,n=t.json;return n.bufferViews||=[],e.arrayBuffer().then(e=>{let r=hz(e),i={buffer:t.processBuffer(r),byteOffset:t.byteOffset,byteLength:r.byteLength};return t.byteOffset+=r.byteLength,n.bufferViews.push(i)-1})}processAccessor(e,t,n,r){let i=this.json,a={1:`SCALAR`,2:`VEC2`,3:`VEC3`,4:`VEC4`,9:`MAT3`,16:`MAT4`},o;if(e.array.constructor===Float32Array)o=$R.FLOAT;else if(e.array.constructor===Int32Array)o=$R.INT;else if(e.array.constructor===Uint32Array)o=$R.UNSIGNED_INT;else if(e.array.constructor===Int16Array)o=$R.SHORT;else if(e.array.constructor===Uint16Array)o=$R.UNSIGNED_SHORT;else if(e.array.constructor===Int8Array)o=$R.BYTE;else if(e.array.constructor===Uint8Array)o=$R.UNSIGNED_BYTE;else throw Error(`THREE.GLTFExporter: Unsupported bufferAttribute component type: `+e.array.constructor.name);if(n===void 0&&(n=0),r===void 0&&(r=e.count),r===0)return null;let s=pz(e,n,r),c;t!==void 0&&(c=e===t.index?$R.ELEMENT_ARRAY_BUFFER:$R.ARRAY_BUFFER);let l=this.processBufferView(e,o,n,r,c),u={bufferView:l.id,byteOffset:l.byteOffset,componentType:o,count:r,max:s.max,min:s.min,type:a[e.itemSize]};return e.normalized===!0&&(u.normalized=!0),i.accessors||=[],i.accessors.push(u)-1}processImage(e,t,n,r=`image/png`){if(e!==null){let i=this,a=i.cache,o=i.json,s=i.options,c=i.pending;a.images.has(e)||a.images.set(e,{});let l=a.images.get(e),u=r+`:flipY/`+n.toString();if(l[u]!==void 0)return l[u];o.images||=[];let d={mimeType:r},f=gz();f.width=Math.min(e.width,s.maxTextureSize),f.height=Math.min(e.height,s.maxTextureSize);let p=f.getContext(`2d`);if(n===!0&&(p.translate(0,f.height),p.scale(1,-1)),e.data!==void 0){t!==z&&console.error(`GLTFExporter: Only RGBAFormat is supported.`,t),(e.width>s.maxTextureSize||e.height>s.maxTextureSize)&&console.warn(`GLTFExporter: Image size is bigger than maxTextureSize`,e);let n=new Uint8ClampedArray(e.height*e.width*4);for(let t=0;ti.processBufferViewImage(e)).then(e=>{d.bufferView=e})):f.toDataURL===void 0?c.push(_z(f,r).then(GR).then(e=>{d.uri=e})):d.uri=f.toDataURL(r);let m=o.images.push(d)-1;return l[u]=m,m}else throw Error(`THREE.GLTFExporter: No valid image data found. Unable to process texture.`)}processSampler(e){let t=this.json;t.samplers||=[];let n={magFilter:tz[e.magFilter],minFilter:tz[e.minFilter],wrapS:tz[e.wrapS],wrapT:tz[e.wrapT]};return t.samplers.push(n)-1}processTexture(e){let t=this.options,n=this.cache,r=this.json;if(n.textures.has(e))return n.textures.get(e);r.textures||=[],e instanceof oe&&(e=XR(e,t.maxTextureSize));let i=e.userData.mimeType;i===`image/webp`&&(i=`image/png`);let a={sampler:this.processSampler(e),source:this.processImage(e.image,e.format,e.flipY,i)};e.name&&(a.name=e.name),this._invokeAll(function(t){t.writeTexture&&t.writeTexture(e,a)});let o=r.textures.push(a)-1;return n.textures.set(e,o),o}processMaterial(e){let t=this.cache,n=this.json;if(t.materials.has(e))return t.materials.get(e);if(e.isShaderMaterial)return console.warn(`GLTFExporter: THREE.ShaderMaterial not supported.`),null;n.materials||=[];let r={pbrMetallicRoughness:{}};e.isMeshStandardMaterial!==!0&&e.isMeshBasicMaterial!==!0&&console.warn(`GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.`);let i=e.color.toArray().concat([e.opacity]);if(uz(i,[1,1,1,1])||(r.pbrMetallicRoughness.baseColorFactor=i),e.isMeshStandardMaterial?(r.pbrMetallicRoughness.metallicFactor=e.metalness,r.pbrMetallicRoughness.roughnessFactor=e.roughness):(r.pbrMetallicRoughness.metallicFactor=.5,r.pbrMetallicRoughness.roughnessFactor=.5),e.metalnessMap||e.roughnessMap){let t=this.buildMetalRoughTexture(e.metalnessMap,e.roughnessMap),n={index:this.processTexture(t),channel:t.channel};this.applyTextureTransform(n,t),r.pbrMetallicRoughness.metallicRoughnessTexture=n}if(e.map){let t={index:this.processTexture(e.map),texCoord:e.map.channel};this.applyTextureTransform(t,e.map),r.pbrMetallicRoughness.baseColorTexture=t}if(e.emissive){let t=e.emissive;if(Math.max(t.r,t.g,t.b)>0&&(r.emissiveFactor=e.emissive.toArray()),e.emissiveMap){let t={index:this.processTexture(e.emissiveMap),texCoord:e.emissiveMap.channel};this.applyTextureTransform(t,e.emissiveMap),r.emissiveTexture=t}}if(e.normalMap){let t={index:this.processTexture(e.normalMap),texCoord:e.normalMap.channel};e.normalScale&&e.normalScale.x!==1&&(t.scale=e.normalScale.x),this.applyTextureTransform(t,e.normalMap),r.normalTexture=t}if(e.aoMap){let t={index:this.processTexture(e.aoMap),texCoord:e.aoMap.channel};e.aoMapIntensity!==1&&(t.strength=e.aoMapIntensity),this.applyTextureTransform(t,e.aoMap),r.occlusionTexture=t}e.transparent?r.alphaMode=`BLEND`:e.alphaTest>0&&(r.alphaMode=`MASK`,r.alphaCutoff=e.alphaTest),e.side===ze&&(r.doubleSided=!0),e.name!==``&&(r.name=e.name),this.serializeUserData(e,r),this._invokeAll(function(t){t.writeMaterial&&t.writeMaterial(e,r)});let a=n.materials.push(r)-1;return t.materials.set(e,a),a}processMesh(e){let t=this.cache,n=this.json,r=[e.geometry.uuid];if(Array.isArray(e.material))for(let t=0,n=e.material.length;t=152?{uv:`TEXCOORD_0`,uv1:`TEXCOORD_1`,uv2:`TEXCOORD_2`,uv3:`TEXCOORD_3`}:{uv:`TEXCOORD_0`,uv2:`TEXCOORD_1`},color:`COLOR_0`,skinWeight:`WEIGHTS_0`,skinIndex:`JOINTS_0`},f=a.getAttribute(`normal`);f!==void 0&&!this.isNormalizedNormalAttribute(f)&&(console.warn(`THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one.`),a.setAttribute(`normal`,this.createNormalizedNormalAttribute(f)));let p=null;for(let e in a.attributes){if(e.slice(0,5)===`morph`)continue;let n=a.attributes[e];if(e=d[e]||e.toUpperCase(),/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(e)||(e=`_`+e),t.attributes.has(this.getUID(n))){c[e]=t.attributes.get(this.getUID(n));continue}p=null;let r=n.array;e===`JOINTS_0`&&!(r instanceof Uint16Array)&&!(r instanceof Uint8Array)&&(console.warn(`GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.`),p=new ae(new Uint16Array(r),n.itemSize,n.normalized));let i=this.processAccessor(p||n,a);i!==null&&(e.startsWith(`_`)||this.detectMeshQuantization(e,n),c[e]=i,t.attributes.set(this.getUID(n),i))}if(f!==void 0&&a.setAttribute(`normal`,f),Object.keys(c).length===0)return null;if(e.morphTargetInfluences!==void 0&&e.morphTargetInfluences.length>0){let n=[],r=[],i={};if(e.morphTargetDictionary!==void 0)for(let t in e.morphTargetDictionary)i[e.morphTargetDictionary[t]]=t;for(let o=0;o0&&(s.extras={},s.extras.targetNames=r)}let m=Array.isArray(e.material);if(m&&a.groups.length===0)return null;let h=m?e.material:[e.material],g=m?a.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let e=0,n=g.length;e0&&(n.targets=u),a.index!==null){let r=this.getUID(a.index);(g[e].start!==void 0||g[e].count!==void 0)&&(r+=`:`+g[e].start+`:`+g[e].count),t.attributes.has(r)?n.indices=t.attributes.get(r):(n.indices=this.processAccessor(a.index,a,g[e].start,g[e].count),t.attributes.set(r,n.indices)),n.indices===null&&delete n.indices}let r=this.processMaterial(h[g[e].materialIndex]);r!==null&&(n.material=r),l.push(n)}s.primitives=l,n.meshes||=[],this._invokeAll(function(t){t.writeMesh&&t.writeMesh(e,s)});let _=n.meshes.push(s)-1;return t.meshes.set(i,_),_}detectMeshQuantization(e,t){if(this.extensionsUsed[ez])return;let n;switch(t.array.constructor){case Int8Array:n=`byte`;break;case Uint8Array:n=`unsigned byte`;break;case Int16Array:n=`short`;break;case Uint16Array:n=`unsigned short`;break;default:return}t.normalized&&(n+=` normalized`);let r=e.split(`_`,1)[0];ZR[r]&&ZR[r].includes(n)&&(this.extensionsUsed[ez]=!0,this.extensionsRequired[ez]=!0)}processCamera(e){let t=this.json;t.cameras||=[];let n=e.isOrthographicCamera,r={type:n?`orthographic`:`perspective`};return n?r.orthographic={xmag:e.right*2,ymag:e.top*2,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:r.perspective={aspectRatio:e.aspect,yfov:nt.degToRad(e.fov),zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},e.name!==``&&(r.name=e.type),t.cameras.push(r)-1}processAnimation(e,t){let n=this.json,r=this.nodeMap;n.animations||=[],e=QR.Utils.mergeMorphTargetTracks(e.clone(),t);let i=e.tracks,a=[],o=[];for(let e=0;e0){let t=[];for(let r=0,i=e.children.length;r0&&(i.children=t)}this._invokeAll(function(t){t.writeNode&&t.writeNode(e,i)});let a=t.nodes.push(i)-1;return r.set(e,a),a}processScene(e){let t=this.json,n=this.options;t.scenes||(t.scenes=[],t.scene=0);let r={};e.name!==``&&(r.name=e.name),t.scenes.push(r);let i=[];for(let t=0,r=e.children.length;t0&&(r.nodes=i),this.serializeUserData(e,r)}processObjects(e){let t=new lt;t.name=`AuxScene`;for(let n=0;n0&&this.processObjects(n);for(let e=0;e0&&(a.range=e.distance)):e.isSpotLight&&(a.type=`spot`,e.distance>0&&(a.range=e.distance),a.spot={},a.spot.innerConeAngle=(e.penumbra-1)*e.angle*-1,a.spot.outerConeAngle=e.angle),e.decay!==void 0&&e.decay!==2&&console.warn(`THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2.`),e.target&&(e.target.parent!==e||e.target.position.x!==0||e.target.position.y!==0||e.target.position.z!==-1)&&console.warn(`THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1.`),i[this.name]||(r.extensions=r.extensions||{},r.extensions[this.name]={lights:[]},i[this.name]=!0);let o=r.extensions[this.name].lights;o.push(a),t.extensions=t.extensions||{},t.extensions[this.name]={light:o.length-1}}};let bz=class{constructor(e){this.writer=e,this.name=`KHR_materials_unlit`}writeMaterial(e,t){if(!e.isMeshBasicMaterial)return;let n=this.writer.extensionsUsed;t.extensions=t.extensions||{},t.extensions[this.name]={},n[this.name]=!0,t.pbrMetallicRoughness.metallicFactor=0,t.pbrMetallicRoughness.roughnessFactor=.9}},xz=class{constructor(e){this.writer=e,this.name=`KHR_materials_clearcoat`}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.clearcoat===0)return;let n=this.writer,r=n.extensionsUsed,i={};if(i.clearcoatFactor=e.clearcoat,e.clearcoatMap){let t={index:n.processTexture(e.clearcoatMap),texCoord:e.clearcoatMap.channel};n.applyTextureTransform(t,e.clearcoatMap),i.clearcoatTexture=t}if(i.clearcoatRoughnessFactor=e.clearcoatRoughness,e.clearcoatRoughnessMap){let t={index:n.processTexture(e.clearcoatRoughnessMap),texCoord:e.clearcoatRoughnessMap.channel};n.applyTextureTransform(t,e.clearcoatRoughnessMap),i.clearcoatRoughnessTexture=t}if(e.clearcoatNormalMap){let t={index:n.processTexture(e.clearcoatNormalMap),texCoord:e.clearcoatNormalMap.channel};n.applyTextureTransform(t,e.clearcoatNormalMap),i.clearcoatNormalTexture=t}t.extensions=t.extensions||{},t.extensions[this.name]=i,r[this.name]=!0}},Sz=class{constructor(e){this.writer=e,this.name=`KHR_materials_iridescence`}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.iridescence===0)return;let n=this.writer,r=n.extensionsUsed,i={};if(i.iridescenceFactor=e.iridescence,e.iridescenceMap){let t={index:n.processTexture(e.iridescenceMap),texCoord:e.iridescenceMap.channel};n.applyTextureTransform(t,e.iridescenceMap),i.iridescenceTexture=t}if(i.iridescenceIor=e.iridescenceIOR,i.iridescenceThicknessMinimum=e.iridescenceThicknessRange[0],i.iridescenceThicknessMaximum=e.iridescenceThicknessRange[1],e.iridescenceThicknessMap){let t={index:n.processTexture(e.iridescenceThicknessMap),texCoord:e.iridescenceThicknessMap.channel};n.applyTextureTransform(t,e.iridescenceThicknessMap),i.iridescenceThicknessTexture=t}t.extensions=t.extensions||{},t.extensions[this.name]=i,r[this.name]=!0}},Cz=class{constructor(e){this.writer=e,this.name=`KHR_materials_transmission`}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;let n=this.writer,r=n.extensionsUsed,i={};if(i.transmissionFactor=e.transmission,e.transmissionMap){let t={index:n.processTexture(e.transmissionMap),texCoord:e.transmissionMap.channel};n.applyTextureTransform(t,e.transmissionMap),i.transmissionTexture=t}t.extensions=t.extensions||{},t.extensions[this.name]=i,r[this.name]=!0}},wz=class{constructor(e){this.writer=e,this.name=`KHR_materials_volume`}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;let n=this.writer,r=n.extensionsUsed,i={};if(i.thicknessFactor=e.thickness,e.thicknessMap){let t={index:n.processTexture(e.thicknessMap),texCoord:e.thicknessMap.channel};n.applyTextureTransform(t,e.thicknessMap),i.thicknessTexture=t}i.attenuationDistance=e.attenuationDistance,i.attenuationColor=e.attenuationColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=i,r[this.name]=!0}},Tz=class{constructor(e){this.writer=e,this.name=`KHR_materials_ior`}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.ior===1.5)return;let n=this.writer.extensionsUsed,r={};r.ior=e.ior,t.extensions=t.extensions||{},t.extensions[this.name]=r,n[this.name]=!0}},Ez=class{constructor(e){this.writer=e,this.name=`KHR_materials_specular`}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.specularIntensity===1&&e.specularColor.equals(rz)&&!e.specularIntensityMap&&!e.specularColorTexture)return;let n=this.writer,r=n.extensionsUsed,i={};if(e.specularIntensityMap){let t={index:n.processTexture(e.specularIntensityMap),texCoord:e.specularIntensityMap.channel};n.applyTextureTransform(t,e.specularIntensityMap),i.specularTexture=t}if(e.specularColorMap){let t={index:n.processTexture(e.specularColorMap),texCoord:e.specularColorMap.channel};n.applyTextureTransform(t,e.specularColorMap),i.specularColorTexture=t}i.specularFactor=e.specularIntensity,i.specularColorFactor=e.specularColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=i,r[this.name]=!0}},Dz=class{constructor(e){this.writer=e,this.name=`KHR_materials_sheen`}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.sheen==0)return;let n=this.writer,r=n.extensionsUsed,i={};if(e.sheenRoughnessMap){let t={index:n.processTexture(e.sheenRoughnessMap),texCoord:e.sheenRoughnessMap.channel};n.applyTextureTransform(t,e.sheenRoughnessMap),i.sheenRoughnessTexture=t}if(e.sheenColorMap){let t={index:n.processTexture(e.sheenColorMap),texCoord:e.sheenColorMap.channel};n.applyTextureTransform(t,e.sheenColorMap),i.sheenColorTexture=t}i.sheenRoughnessFactor=e.sheenRoughness,i.sheenColorFactor=e.sheenColor.toArray(),t.extensions=t.extensions||{},t.extensions[this.name]=i,r[this.name]=!0}},Oz=class{constructor(e){this.writer=e,this.name=`KHR_materials_anisotropy`}writeMaterial(e,t){if(!e.isMeshPhysicalMaterial||e.anisotropy==0)return;let n=this.writer,r=n.extensionsUsed,i={};if(e.anisotropyMap){let t={index:n.processTexture(e.anisotropyMap)};n.applyTextureTransform(t,e.anisotropyMap),i.anisotropyTexture=t}i.anisotropyStrength=e.anisotropy,i.anisotropyRotation=e.anisotropyRotation,t.extensions=t.extensions||{},t.extensions[this.name]=i,r[this.name]=!0}},kz=class{constructor(e){this.writer=e,this.name=`KHR_materials_emissive_strength`}writeMaterial(e,t){if(!e.isMeshStandardMaterial||e.emissiveIntensity===1)return;let n=this.writer.extensionsUsed,r={};r.emissiveStrength=e.emissiveIntensity,t.extensions=t.extensions||{},t.extensions[this.name]=r,n[this.name]=!0}};var Az=Uint8Array,jz=Uint16Array,Mz=Uint32Array,Nz=new Az([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Pz=new Az([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Fz=new Az([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Iz=function(e,t){for(var n=new jz(31),r=0;r<31;++r)n[r]=t+=1<>>1|(Uz&21845)<<1;Wz=(Wz&52428)>>>2|(Wz&13107)<<2,Wz=(Wz&61680)>>>4|(Wz&3855)<<4,Hz[Uz]=((Wz&65280)>>>8|(Wz&255)<<8)>>>1}for(var Gz=function(e,t,n){for(var r=e.length,i=0,a=new jz(t);i>>c]=l}else for(s=new jz(r),i=0;i>>15-e[i]);return s},Kz=new Az(288),Uz=0;Uz<144;++Uz)Kz[Uz]=8;for(var Uz=144;Uz<256;++Uz)Kz[Uz]=9;for(var Uz=256;Uz<280;++Uz)Kz[Uz]=7;for(var Uz=280;Uz<288;++Uz)Kz[Uz]=8;for(var qz=new Az(32),Uz=0;Uz<32;++Uz)qz[Uz]=5;var Jz=Gz(Kz,9,1),Yz=Gz(qz,5,1),Xz=function(e){for(var t=e[0],n=1;nt&&(t=e[n]);return t},Zz=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(t&7)&n},Qz=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(t&7)},$z=function(e){return(e/8|0)+(e&7&&1)},eB=function(e,t,n){(n==null||n>e.length)&&(n=e.length);var r=new(e instanceof jz?jz:e instanceof Mz?Mz:Az)(n-t);return r.set(e.subarray(t,n)),r},tB=function(e,t,n){var r=e.length;if(!r||n&&!n.l&&r<5)return t||new Az(0);var i=!t||n,a=!n||n.i;n||={},t||=new Az(r*3);var o=function(e){var n=t.length;if(e>n){var r=new Az(Math.max(n*2,e));r.set(t),t=r}},s=n.f||0,c=n.p||0,l=n.b||0,u=n.l,d=n.d,f=n.m,p=n.n,m=r*8;do{if(!u){n.f=s=Zz(e,c,1);var h=Zz(e,c+1,3);if(c+=3,h)if(h==1)u=Jz,d=Yz,f=9,p=5;else if(h==2){var g=Zz(e,c,31)+257,_=Zz(e,c+10,15)+4,v=g+Zz(e,c+5,31)+1;c+=14;for(var y=new Az(v),b=new Az(19),x=0;x<_;++x)b[Fz[x]]=Zz(e,c+x*3,7);c+=_*3;for(var S=Xz(b),C=(1<>>4;if(E<16)y[x++]=E;else{var D=0,O=0;for(E==16?(O=3+Zz(e,c,3),c+=2,D=y[x-1]):E==17?(O=3+Zz(e,c,7),c+=3):E==18&&(O=11+Zz(e,c,127),c+=7);O--;)y[x++]=D}}var k=y.subarray(0,g),A=y.subarray(g);f=Xz(k),p=Xz(A),u=Gz(k,f,1),d=Gz(A,p,1)}else throw`invalid block type`;else{var E=$z(c)+4,j=e[E-4]|e[E-3]<<8,M=E+j;if(M>r){if(a)throw`unexpected EOF`;break}i&&o(l+j),t.set(e.subarray(E,M),l),n.b=l+=j,n.p=c=M*8;continue}if(c>m){if(a)throw`unexpected EOF`;break}}i&&o(l+131072);for(var N=(1<>>4;if(c+=D&15,c>m){if(a)throw`unexpected EOF`;break}if(!D)throw`invalid length/literal`;if(F<256)t[l++]=F;else if(F==256){P=c,u=null;break}else{var I=F-254;if(F>264){var x=F-257,L=Nz[x];I=Zz(e,c,(1<>>4;if(!te)throw`invalid distance`;c+=te&15;var A=Vz[R];if(R>3){var L=Pz[R];A+=Qz(e,c)&(1<m){if(a)throw`unexpected EOF`;break}i&&o(l+131072);for(var ne=l+I;l>>4>7||(e[0]<<8|e[1])%31)throw`invalid zlib data`;if(e[1]&32)throw`invalid zlib data: preset dictionaries not supported`},iB=typeof TextDecoder<`u`&&new TextDecoder,aB=0;try{iB.decode(nB,{stream:!0}),aB=1}catch{}var oB=Object.defineProperty,sB=(e,t,n)=>t in e?oB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,cB=(e,t,n)=>(sB(e,t+``,n),n);const lB=class extends V{constructor(e,t={}){super(e),this.isReflector=!0,this.type=`Reflector`,this.camera=new Ge;let n=this,r=t.color===void 0?new me(8355711):new me(t.color),i=t.textureWidth||512,a=t.textureHeight||512,o=t.clipBias||0,s=t.shader||lB.ReflectorShader,c=t.multisample===void 0?4:t.multisample,l=new Nt,u=new B,d=new B,f=new B,p=new wt,m=new B(0,0,-1),h=new qt,g=new B,_=new B,v=new qt,y=new wt,b=this.camera,x=new ne(i,a,{samples:c,type:St}),S=new Rt({uniforms:Et.clone(s.uniforms),fragmentShader:s.fragmentShader,vertexShader:s.vertexShader});S.uniforms.tDiffuse.value=x.texture,S.uniforms.color.value=r,S.uniforms.textureMatrix.value=y,this.material=S,this.onBeforeRender=function(e,t,r){if(d.setFromMatrixPosition(n.matrixWorld),f.setFromMatrixPosition(r.matrixWorld),p.extractRotation(n.matrixWorld),u.set(0,0,1),u.applyMatrix4(p),g.subVectors(d,f),g.dot(u)>0)return;g.reflect(u).negate(),g.add(d),p.extractRotation(r.matrixWorld),m.set(0,0,-1),m.applyMatrix4(p),m.add(f),_.subVectors(d,m),_.reflect(u).negate(),_.add(d),b.position.copy(g),b.up.set(0,1,0),b.up.applyMatrix4(p),b.up.reflect(u),b.lookAt(_),b.far=r.far,b.updateMatrixWorld(),b.projectionMatrix.copy(r.projectionMatrix),y.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),y.multiply(b.projectionMatrix),y.multiply(b.matrixWorldInverse),y.multiply(n.matrixWorld),l.setFromNormalAndCoplanarPoint(u,d),l.applyMatrix4(b.matrixWorldInverse),h.set(l.normal.x,l.normal.y,l.normal.z,l.constant);let i=b.projectionMatrix;v.x=(Math.sign(h.x)+i.elements[8])/i.elements[0],v.y=(Math.sign(h.y)+i.elements[9])/i.elements[5],v.z=-1,v.w=(1+i.elements[10])/i.elements[14],h.multiplyScalar(2/h.dot(v)),i.elements[2]=h.x,i.elements[6]=h.y,i.elements[10]=h.z+1-o,i.elements[14]=h.w,n.visible=!1;let a=e.getRenderTarget(),s=e.xr.enabled,c=e.shadowMap.autoUpdate,S=e.toneMapping,C=!1;C=`outputColorSpace`in e?e.outputColorSpace===`srgb`:e.outputEncoding===3001,e.xr.enabled=!1,e.shadowMap.autoUpdate=!1,`outputColorSpace`in e?e.outputColorSpace=`srgb-linear`:e.outputEncoding=3e3,e.toneMapping=Ot,e.setRenderTarget(x),e.state.buffers.depth.setMask(!0),e.autoClear===!1&&e.clear(),e.render(t,b),e.xr.enabled=s,e.shadowMap.autoUpdate=c,e.toneMapping=S,`outputColorSpace`in e?e.outputColorSpace=C?`srgb`:`srgb-linear`:e.outputEncoding=C?3001:3e3,e.setRenderTarget(a);let w=r.viewport;w!==void 0&&e.state.viewport(w),n.visible=!0},this.getRenderTarget=function(){return x},this.dispose=function(){x.dispose(),n.material.dispose()}}};let uB=lB;cB(uB,`ReflectorShader`,{uniforms:{color:{value:null},tDiffuse:{value:null},textureMatrix:{value:null}},vertexShader:` uniform mat4 textureMatrix; varying vec4 vUv; @@ -2529,7 +2529,7 @@ params: ${n}`),this.query=t,this.params=n,this.cause=r,Error.captureStackTrace(t #include #include <${zR>=154?`colorspace_fragment`:`encodings_fragment`}> - }`});var dB=Object.defineProperty,fB=(e,t,n)=>t in e?dB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,pB=(e,t,n)=>(fB(e,typeof t==`symbol`?t:t+``,n),n);const mB=new rt,hB=new Float32Array([-1,-1,0,0,0,1,-1,0,1,0,1,1,0,1,1,-1,1,0,0,1]),gB=new Pe(hB,5);mB.setIndex([0,1,2,0,2,3]),mB.setAttribute(`position`,new pt(gB,3,0,!1)),mB.setAttribute(`uv`,new pt(gB,2,3,!1));const _B=class extends V{constructor(){super(_B.Geometry,new gt({opacity:0,transparent:!0})),this.isLensflare=!0,this.type=`Lensflare`,this.frustumCulled=!1,this.renderOrder=1/0;let e=new B,t=new B,n=new ft(new Uint8Array(16*16*3),16,16,ie);n.minFilter=fe,n.magFilter=fe,n.wrapS=te,n.wrapT=te;let r=new ft(new Uint8Array(16*16*3),16,16,ie);r.minFilter=fe,r.magFilter=fe,r.wrapS=te,r.wrapT=te;let i=_B.Geometry,a=new Ht({uniforms:{scale:{value:null},screenPosition:{value:null}},vertexShader:` + }`});var dB=Object.defineProperty,fB=(e,t,n)=>t in e?dB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,pB=(e,t,n)=>(fB(e,typeof t==`symbol`?t:t+``,n),n);const mB=new tt,hB=new Float32Array([-1,-1,0,0,0,1,-1,0,1,0,1,1,0,1,1,-1,1,0,0,1]),gB=new Me(hB,5);mB.setIndex([0,1,2,0,2,3]),mB.setAttribute(`position`,new dt(gB,3,0,!1)),mB.setAttribute(`uv`,new dt(gB,2,3,!1));const _B=class extends V{constructor(){super(_B.Geometry,new mt({opacity:0,transparent:!0})),this.isLensflare=!0,this.type=`Lensflare`,this.frustumCulled=!1,this.renderOrder=1/0;let e=new B,t=new B,n=new ut(new Uint8Array(16*16*3),16,16,z);n.minFilter=le,n.magFilter=le,n.wrapS=I,n.wrapT=I;let r=new ut(new Uint8Array(16*16*3),16,16,z);r.minFilter=le,r.magFilter=le,r.wrapS=I,r.wrapT=I;let i=_B.Geometry,a=new Vt({uniforms:{scale:{value:null},screenPosition:{value:null}},vertexShader:` precision highp float; @@ -2550,7 +2550,7 @@ params: ${n}`),this.query=t,this.params=n,this.cause=r,Error.captureStackTrace(t gl_FragColor = vec4( 1.0, 0.0, 1.0, 1.0 ); - }`,depthTest:!0,depthWrite:!1,transparent:!1}),o=new Ht({uniforms:{map:{value:n},scale:{value:null},screenPosition:{value:null}},vertexShader:` + }`,depthTest:!0,depthWrite:!1,transparent:!1}),o=new Vt({uniforms:{map:{value:n},scale:{value:null},screenPosition:{value:null}},vertexShader:` precision highp float; @@ -2580,7 +2580,7 @@ params: ${n}`),this.query=t,this.params=n,this.cause=r,Error.captureStackTrace(t gl_FragColor = texture2D( map, vUV ); - }`,depthTest:!1,depthWrite:!1,transparent:!1}),s=new V(i,a),c=[],l=yB.Shader,u=new Ht({uniforms:{map:{value:null},occlusionMap:{value:r},color:{value:new ge(16777215)},scale:{value:new ut},screenPosition:{value:new B}},vertexShader:l.vertexShader,fragmentShader:l.fragmentShader,blending:F,transparent:!0,depthWrite:!1}),d=new V(i,u);this.addElement=function(e){c.push(e)};let f=new ut,p=new ut,m=new Mt,h=new Yt;this.onBeforeRender=function(l,g,_){l.getCurrentViewport(h);let v=h.w/h.z,y=h.z/2,b=h.w/2,x=16/h.w;if(f.set(x*v,x),m.min.set(h.x,h.y),m.max.set(h.x+(h.z-16),h.y+(h.w-16)),t.setFromMatrixPosition(this.matrixWorld),t.applyMatrix4(_.matrixWorldInverse),!(t.z>0)&&(e.copy(t).applyMatrix4(_.projectionMatrix),p.x=h.x+e.x*y+y-8,p.y=h.y+e.y*b+b-8,m.containsPoint(p))){l.copyFramebufferToTexture(p,n);let t=a.uniforms;t.scale.value=f,t.screenPosition.value=e,l.renderBufferDirect(_,null,i,a,s,null),l.copyFramebufferToTexture(p,r),t=o.uniforms,t.scale.value=f,t.screenPosition.value=e,l.renderBufferDirect(_,null,i,o,s,null);let m=-e.x*2,g=-e.y*2;for(let t=0,n=c.length;t0)&&(e.copy(t).applyMatrix4(_.projectionMatrix),p.x=h.x+e.x*y+y-8,p.y=h.y+e.y*b+b-8,m.containsPoint(p))){l.copyFramebufferToTexture(p,n);let t=a.uniforms;t.scale.value=f,t.screenPosition.value=e,l.renderBufferDirect(_,null,i,a,s,null),l.copyFramebufferToTexture(p,r),t=o.uniforms,t.scale.value=f,t.screenPosition.value=e,l.renderBufferDirect(_,null,i,o,s,null);let m=-e.x*2,g=-e.y*2;for(let t=0,n=c.length;t - #include <${parseInt(Tt.replace(/\D+/g,``))>=154?`colorspace_fragment`:`encodings_fragment`}> + #include <${parseInt(Qe.replace(/\D+/g,``))>=154?`colorspace_fragment`:`encodings_fragment`}> #include - }`},A=new Bt({fragmentShader:k.fragmentShader,vertexShader:k.vertexShader,uniforms:Dt.clone(k.uniforms),lights:!0,side:m,fog:h});A.uniforms.mirrorSampler.value=O.texture,A.uniforms.textureMatrix.value=E,A.uniforms.alpha.value=o,A.uniforms.time.value=s,A.uniforms.normalSampler.value=c,A.uniforms.sunColor.value=u,A.uniforms.waterColor.value=d,A.uniforms.sunDirection.value=l,A.uniforms.distortionScale.value=p,A.uniforms.eye.value=f,n.material=A,n.onBeforeRender=function(e,t,r){if(v.setFromMatrixPosition(n.matrixWorld),y.setFromMatrixPosition(r.matrixWorld),b.extractRotation(n.matrixWorld),_.set(0,0,1),_.applyMatrix4(b),C.subVectors(v,y),C.dot(_)>0)return;C.reflect(_).negate(),C.add(v),b.extractRotation(r.matrixWorld),x.set(0,0,-1),x.applyMatrix4(b),x.add(y),w.subVectors(v,x),w.reflect(_).negate(),w.add(v),D.position.copy(C),D.up.set(0,1,0),D.up.applyMatrix4(b),D.up.reflect(_),D.lookAt(w),D.far=r.far,D.updateMatrixWorld(),D.projectionMatrix.copy(r.projectionMatrix),E.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),E.multiply(D.projectionMatrix),E.multiply(D.matrixWorldInverse),g.setFromNormalAndCoplanarPoint(_,v),g.applyMatrix4(D.matrixWorldInverse),S.set(g.normal.x,g.normal.y,g.normal.z,g.constant);let i=D.projectionMatrix;T.x=(Math.sign(S.x)+i.elements[8])/i.elements[0],T.y=(Math.sign(S.y)+i.elements[9])/i.elements[5],T.z=-1,T.w=(1+i.elements[10])/i.elements[14],S.multiplyScalar(2/S.dot(T)),i.elements[2]=S.x,i.elements[6]=S.y,i.elements[10]=S.z+1-a,i.elements[14]=S.w,f.setFromMatrixPosition(r.matrixWorld);let o=e.getRenderTarget(),s=e.xr.enabled,c=e.shadowMap.autoUpdate;n.visible=!1,e.xr.enabled=!1,e.shadowMap.autoUpdate=!1,e.setRenderTarget(O),e.state.buffers.depth.setMask(!0),e.autoClear===!1&&e.clear(),e.render(t,D),n.visible=!0,e.xr.enabled=s,e.shadowMap.autoUpdate=c,e.setRenderTarget(o);let l=r.viewport;l!==void 0&&e.state.viewport(l)}}},xB=Object.defineProperty,SB=(e,t,n)=>t in e?xB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,CB=(e,t,n)=>(SB(e,typeof t==`symbol`?t:t+``,n),n);const wB={uniforms:{turbidity:{value:2},rayleigh:{value:1},mieCoefficient:{value:.005},mieDirectionalG:{value:.8},sunPosition:{value:new B},up:{value:new B(0,1,0)}},vertexShader:` + }`},A=new Rt({fragmentShader:k.fragmentShader,vertexShader:k.vertexShader,uniforms:Et.clone(k.uniforms),lights:!0,side:m,fog:h});A.uniforms.mirrorSampler.value=O.texture,A.uniforms.textureMatrix.value=E,A.uniforms.alpha.value=o,A.uniforms.time.value=s,A.uniforms.normalSampler.value=c,A.uniforms.sunColor.value=u,A.uniforms.waterColor.value=d,A.uniforms.sunDirection.value=l,A.uniforms.distortionScale.value=p,A.uniforms.eye.value=f,n.material=A,n.onBeforeRender=function(e,t,r){if(v.setFromMatrixPosition(n.matrixWorld),y.setFromMatrixPosition(r.matrixWorld),b.extractRotation(n.matrixWorld),_.set(0,0,1),_.applyMatrix4(b),C.subVectors(v,y),C.dot(_)>0)return;C.reflect(_).negate(),C.add(v),b.extractRotation(r.matrixWorld),x.set(0,0,-1),x.applyMatrix4(b),x.add(y),w.subVectors(v,x),w.reflect(_).negate(),w.add(v),D.position.copy(C),D.up.set(0,1,0),D.up.applyMatrix4(b),D.up.reflect(_),D.lookAt(w),D.far=r.far,D.updateMatrixWorld(),D.projectionMatrix.copy(r.projectionMatrix),E.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),E.multiply(D.projectionMatrix),E.multiply(D.matrixWorldInverse),g.setFromNormalAndCoplanarPoint(_,v),g.applyMatrix4(D.matrixWorldInverse),S.set(g.normal.x,g.normal.y,g.normal.z,g.constant);let i=D.projectionMatrix;T.x=(Math.sign(S.x)+i.elements[8])/i.elements[0],T.y=(Math.sign(S.y)+i.elements[9])/i.elements[5],T.z=-1,T.w=(1+i.elements[10])/i.elements[14],S.multiplyScalar(2/S.dot(T)),i.elements[2]=S.x,i.elements[6]=S.y,i.elements[10]=S.z+1-a,i.elements[14]=S.w,f.setFromMatrixPosition(r.matrixWorld);let o=e.getRenderTarget(),s=e.xr.enabled,c=e.shadowMap.autoUpdate;n.visible=!1,e.xr.enabled=!1,e.shadowMap.autoUpdate=!1,e.setRenderTarget(O),e.state.buffers.depth.setMask(!0),e.autoClear===!1&&e.clear(),e.render(t,D),n.visible=!0,e.xr.enabled=s,e.shadowMap.autoUpdate=c,e.setRenderTarget(o);let l=r.viewport;l!==void 0&&e.state.viewport(l)}}},xB=Object.defineProperty,SB=(e,t,n)=>t in e?xB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,CB=(e,t,n)=>(SB(e,typeof t==`symbol`?t:t+``,n),n);const wB={uniforms:{turbidity:{value:2},rayleigh:{value:1},mieCoefficient:{value:.005},mieDirectionalG:{value:.8},sunPosition:{value:new B},up:{value:new B(0,1,0)}},vertexShader:` uniform vec3 sunPosition; uniform float rayleigh; uniform float turbidity; @@ -2887,7 +2887,7 @@ params: ${n}`),this.query=t,this.params=n,this.cause=r,Error.captureStackTrace(t #include <${zR>=154?`colorspace_fragment`:`encodings_fragment`}> } - `},TB=new Bt({name:`SkyShader`,fragmentShader:wB.fragmentShader,vertexShader:wB.vertexShader,uniforms:Dt.clone(wB.uniforms),side:Fe,depthWrite:!1});var EB=class extends V{constructor(){super(new ht(1,1,1),TB)}};CB(EB,`SkyShader`,wB),CB(EB,`material`,TB);const DB=new Lt,OB=new B;var kB=class{constructor(e){let t=e.geometry;t.index&&(console.warn(`THREE.MeshSurfaceSampler: Converting geometry to non-indexed BufferGeometry.`),t=t.toNonIndexed()),this.geometry=t,this.randomFunction=Math.random,this.positionAttribute=this.geometry.getAttribute(`position`),this.colorAttribute=this.geometry.getAttribute(`color`),this.weightAttribute=null,this.distribution=null}setWeightAttribute(e){return this.weightAttribute=e?this.geometry.getAttribute(e):null,this}build(){let e=this.positionAttribute,t=this.weightAttribute,n=new Float32Array(e.count/3);for(let r=0;re){i=a;break}else e1&&(i=1-i,a=1-a),DB.a.fromBufferAttribute(this.positionAttribute,e*3),DB.b.fromBufferAttribute(this.positionAttribute,e*3+1),DB.c.fromBufferAttribute(this.positionAttribute,e*3+2),t.set(0,0,0).addScaledVector(DB.a,i).addScaledVector(DB.b,a).addScaledVector(DB.c,1-(i+a)),n!==void 0&&DB.getNormal(n),r!==void 0&&this.colorAttribute!==void 0&&(DB.a.fromBufferAttribute(this.colorAttribute,e*3),DB.b.fromBufferAttribute(this.colorAttribute,e*3+1),DB.c.fromBufferAttribute(this.colorAttribute,e*3+2),OB.set(0,0,0).addScaledVector(DB.a,i).addScaledVector(DB.b,a).addScaledVector(DB.c,1-(i+a)),r.r=OB.x,r.g=OB.y,r.b=OB.z),this}},AB=Object.defineProperty,jB=(e,t,n)=>t in e?AB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Q=(e,t,n)=>(jB(e,typeof t==`symbol`?t:t+``,n),n),MB=class extends _e{constructor(e,t){super(),Q(this,`isTransformControls`,!0),Q(this,`visible`,!1),Q(this,`domElement`),Q(this,`raycaster`,new at),Q(this,`gizmo`),Q(this,`plane`),Q(this,`tempVector`,new B),Q(this,`tempVector2`,new B),Q(this,`tempQuaternion`,new Rt),Q(this,`unit`,{X:new B(1,0,0),Y:new B(0,1,0),Z:new B(0,0,1)}),Q(this,`pointStart`,new B),Q(this,`pointEnd`,new B),Q(this,`offset`,new B),Q(this,`rotationAxis`,new B),Q(this,`startNorm`,new B),Q(this,`endNorm`,new B),Q(this,`rotationAngle`,0),Q(this,`cameraPosition`,new B),Q(this,`cameraQuaternion`,new Rt),Q(this,`cameraScale`,new B),Q(this,`parentPosition`,new B),Q(this,`parentQuaternion`,new Rt),Q(this,`parentQuaternionInv`,new Rt),Q(this,`parentScale`,new B),Q(this,`worldPositionStart`,new B),Q(this,`worldQuaternionStart`,new Rt),Q(this,`worldScaleStart`,new B),Q(this,`worldPosition`,new B),Q(this,`worldQuaternion`,new Rt),Q(this,`worldQuaternionInv`,new Rt),Q(this,`worldScale`,new B),Q(this,`eye`,new B),Q(this,`positionStart`,new B),Q(this,`quaternionStart`,new Rt),Q(this,`scaleStart`,new B),Q(this,`camera`),Q(this,`object`),Q(this,`enabled`,!0),Q(this,`axis`,null),Q(this,`mode`,`translate`),Q(this,`translationSnap`,null),Q(this,`rotationSnap`,null),Q(this,`scaleSnap`,null),Q(this,`space`,`world`),Q(this,`size`,1),Q(this,`dragging`,!1),Q(this,`showX`,!0),Q(this,`showY`,!0),Q(this,`showZ`,!0),Q(this,`changeEvent`,{type:`change`}),Q(this,`mouseDownEvent`,{type:`mouseDown`,mode:this.mode}),Q(this,`mouseUpEvent`,{type:`mouseUp`,mode:this.mode}),Q(this,`objectChangeEvent`,{type:`objectChange`}),Q(this,`intersectObjectWithRay`,(e,t,n)=>{let r=t.intersectObject(e,!0);for(let e=0;e(this.object=e,this.visible=!0,this)),Q(this,`detach`,()=>(this.object=void 0,this.visible=!1,this.axis=null,this)),Q(this,`reset`,()=>(this.enabled&&this.dragging&&this.object!==void 0&&(this.object.position.copy(this.positionStart),this.object.quaternion.copy(this.quaternionStart),this.object.scale.copy(this.scaleStart),this.dispatchEvent(this.changeEvent),this.dispatchEvent(this.objectChangeEvent),this.pointStart.copy(this.pointEnd)),this)),Q(this,`updateMatrixWorld`,()=>{this.object!==void 0&&(this.object.updateMatrixWorld(),this.object.parent===null?console.error(`TransformControls: The attached 3D object must be a part of the scene graph.`):this.object.parent.matrixWorld.decompose(this.parentPosition,this.parentQuaternion,this.parentScale),this.object.matrixWorld.decompose(this.worldPosition,this.worldQuaternion,this.worldScale),this.parentQuaternionInv.copy(this.parentQuaternion).invert(),this.worldQuaternionInv.copy(this.worldQuaternion).invert()),this.camera.updateMatrixWorld(),this.camera.matrixWorld.decompose(this.cameraPosition,this.cameraQuaternion,this.cameraScale),this.eye.copy(this.cameraPosition).sub(this.worldPosition).normalize(),super.updateMatrixWorld()}),Q(this,`pointerHover`,e=>{if(this.object===void 0||this.dragging===!0)return;this.raycaster.setFromCamera(e,this.camera);let t=this.intersectObjectWithRay(this.gizmo.picker[this.mode],this.raycaster);t?this.axis=t.object.name:this.axis=null}),Q(this,`pointerDown`,e=>{if(!(this.object===void 0||this.dragging===!0||e.button!==0)&&this.axis!==null){this.raycaster.setFromCamera(e,this.camera);let t=this.intersectObjectWithRay(this.plane,this.raycaster,!0);if(t){let e=this.space;if(this.mode===`scale`?e=`local`:(this.axis===`E`||this.axis===`XYZE`||this.axis===`XYZ`)&&(e=`world`),e===`local`&&this.mode===`rotate`){let e=this.rotationSnap;this.axis===`X`&&e&&(this.object.rotation.x=Math.round(this.object.rotation.x/e)*e),this.axis===`Y`&&e&&(this.object.rotation.y=Math.round(this.object.rotation.y/e)*e),this.axis===`Z`&&e&&(this.object.rotation.z=Math.round(this.object.rotation.z/e)*e)}this.object.updateMatrixWorld(),this.object.parent&&this.object.parent.updateMatrixWorld(),this.positionStart.copy(this.object.position),this.quaternionStart.copy(this.object.quaternion),this.scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this.worldScaleStart),this.pointStart.copy(t.point).sub(this.worldPositionStart)}this.dragging=!0,this.mouseDownEvent.mode=this.mode,this.dispatchEvent(this.mouseDownEvent)}}),Q(this,`pointerMove`,e=>{let t=this.axis,n=this.mode,r=this.object,i=this.space;if(n===`scale`?i=`local`:(t===`E`||t===`XYZE`||t===`XYZ`)&&(i=`world`),r===void 0||t===null||this.dragging===!1||e.button!==-1)return;this.raycaster.setFromCamera(e,this.camera);let a=this.intersectObjectWithRay(this.plane,this.raycaster,!0);if(a){if(this.pointEnd.copy(a.point).sub(this.worldPositionStart),n===`translate`)this.offset.copy(this.pointEnd).sub(this.pointStart),i===`local`&&t!==`XYZ`&&this.offset.applyQuaternion(this.worldQuaternionInv),t.indexOf(`X`)===-1&&(this.offset.x=0),t.indexOf(`Y`)===-1&&(this.offset.y=0),t.indexOf(`Z`)===-1&&(this.offset.z=0),i===`local`&&t!==`XYZ`?this.offset.applyQuaternion(this.quaternionStart).divide(this.parentScale):this.offset.applyQuaternion(this.parentQuaternionInv).divide(this.parentScale),r.position.copy(this.offset).add(this.positionStart),this.translationSnap&&(i===`local`&&(r.position.applyQuaternion(this.tempQuaternion.copy(this.quaternionStart).invert()),t.search(`X`)!==-1&&(r.position.x=Math.round(r.position.x/this.translationSnap)*this.translationSnap),t.search(`Y`)!==-1&&(r.position.y=Math.round(r.position.y/this.translationSnap)*this.translationSnap),t.search(`Z`)!==-1&&(r.position.z=Math.round(r.position.z/this.translationSnap)*this.translationSnap),r.position.applyQuaternion(this.quaternionStart)),i===`world`&&(r.parent&&r.position.add(this.tempVector.setFromMatrixPosition(r.parent.matrixWorld)),t.search(`X`)!==-1&&(r.position.x=Math.round(r.position.x/this.translationSnap)*this.translationSnap),t.search(`Y`)!==-1&&(r.position.y=Math.round(r.position.y/this.translationSnap)*this.translationSnap),t.search(`Z`)!==-1&&(r.position.z=Math.round(r.position.z/this.translationSnap)*this.translationSnap),r.parent&&r.position.sub(this.tempVector.setFromMatrixPosition(r.parent.matrixWorld))));else if(n===`scale`){if(t.search(`XYZ`)!==-1){let e=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(e*=-1),this.tempVector2.set(e,e,e)}else this.tempVector.copy(this.pointStart),this.tempVector2.copy(this.pointEnd),this.tempVector.applyQuaternion(this.worldQuaternionInv),this.tempVector2.applyQuaternion(this.worldQuaternionInv),this.tempVector2.divide(this.tempVector),t.search(`X`)===-1&&(this.tempVector2.x=1),t.search(`Y`)===-1&&(this.tempVector2.y=1),t.search(`Z`)===-1&&(this.tempVector2.z=1);r.scale.copy(this.scaleStart).multiply(this.tempVector2),this.scaleSnap&&this.object&&(t.search(`X`)!==-1&&(this.object.scale.x=Math.round(r.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search(`Y`)!==-1&&(r.scale.y=Math.round(r.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search(`Z`)!==-1&&(r.scale.z=Math.round(r.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(n===`rotate`){this.offset.copy(this.pointEnd).sub(this.pointStart);let e=20/this.worldPosition.distanceTo(this.tempVector.setFromMatrixPosition(this.camera.matrixWorld));t===`E`?(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this.startNorm.copy(this.pointStart).normalize(),this.endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this.endNorm.cross(this.startNorm).dot(this.eye)<0?1:-1):t===`XYZE`?(this.rotationAxis.copy(this.offset).cross(this.eye).normalize(),this.rotationAngle=this.offset.dot(this.tempVector.copy(this.rotationAxis).cross(this.eye))*e):(t===`X`||t===`Y`||t===`Z`)&&(this.rotationAxis.copy(this.unit[t]),this.tempVector.copy(this.unit[t]),i===`local`&&this.tempVector.applyQuaternion(this.worldQuaternion),this.rotationAngle=this.offset.dot(this.tempVector.cross(this.eye).normalize())*e),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),i===`local`&&t!==`E`&&t!==`XYZE`?(r.quaternion.copy(this.quaternionStart),r.quaternion.multiply(this.tempQuaternion.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this.parentQuaternionInv),r.quaternion.copy(this.tempQuaternion.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),r.quaternion.multiply(this.quaternionStart).normalize())}this.dispatchEvent(this.changeEvent),this.dispatchEvent(this.objectChangeEvent)}}),Q(this,`pointerUp`,e=>{e.button===0&&(this.dragging&&this.axis!==null&&(this.mouseUpEvent.mode=this.mode,this.dispatchEvent(this.mouseUpEvent)),this.dragging=!1,this.axis=null)}),Q(this,`getPointer`,e=>{var t;if(this.domElement&&(t=this.domElement.ownerDocument)!=null&&t.pointerLockElement)return{x:0,y:0,button:e.button};{let t=e.changedTouches?e.changedTouches[0]:e,n=this.domElement.getBoundingClientRect();return{x:(t.clientX-n.left)/n.width*2-1,y:-(t.clientY-n.top)/n.height*2+1,button:e.button}}}),Q(this,`onPointerHover`,e=>{if(this.enabled)switch(e.pointerType){case`mouse`:case`pen`:this.pointerHover(this.getPointer(e));break}}),Q(this,`onPointerDown`,e=>{!this.enabled||!this.domElement||(this.domElement.style.touchAction=`none`,this.domElement.ownerDocument.addEventListener(`pointermove`,this.onPointerMove),this.pointerHover(this.getPointer(e)),this.pointerDown(this.getPointer(e)))}),Q(this,`onPointerMove`,e=>{this.enabled&&this.pointerMove(this.getPointer(e))}),Q(this,`onPointerUp`,e=>{!this.enabled||!this.domElement||(this.domElement.style.touchAction=``,this.domElement.ownerDocument.removeEventListener(`pointermove`,this.onPointerMove),this.pointerUp(this.getPointer(e)))}),Q(this,`getMode`,()=>this.mode),Q(this,`setMode`,e=>{this.mode=e}),Q(this,`setTranslationSnap`,e=>{this.translationSnap=e}),Q(this,`setRotationSnap`,e=>{this.rotationSnap=e}),Q(this,`setScaleSnap`,e=>{this.scaleSnap=e}),Q(this,`setSize`,e=>{this.size=e}),Q(this,`setSpace`,e=>{this.space=e}),Q(this,`update`,()=>{console.warn(`THREE.TransformControls: update function has no more functionality and therefore has been deprecated.`)}),Q(this,`connect`,e=>{e===document&&console.error(`THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.`),this.domElement=e,this.domElement.addEventListener(`pointerdown`,this.onPointerDown),this.domElement.addEventListener(`pointermove`,this.onPointerHover),this.domElement.ownerDocument.addEventListener(`pointerup`,this.onPointerUp)}),Q(this,`dispose`,()=>{var e,t,n,r,i,a;(e=this.domElement)==null||e.removeEventListener(`pointerdown`,this.onPointerDown),(t=this.domElement)==null||t.removeEventListener(`pointermove`,this.onPointerHover),(r=(n=this.domElement)?.ownerDocument)==null||r.removeEventListener(`pointermove`,this.onPointerMove),(a=(i=this.domElement)?.ownerDocument)==null||a.removeEventListener(`pointerup`,this.onPointerUp),this.traverse(e=>{let t=e;t.geometry&&t.geometry.dispose(),t.material&&t.material.dispose()})}),this.domElement=t,this.camera=e,this.gizmo=new NB,this.add(this.gizmo),this.plane=new PB,this.add(this.plane);let n=(e,t)=>{let n=t;Object.defineProperty(this,e,{get:function(){return n===void 0?t:n},set:function(t){n!==t&&(n=t,this.plane[e]=t,this.gizmo[e]=t,this.dispatchEvent({type:e+`-changed`,value:t}),this.dispatchEvent(this.changeEvent))}}),this[e]=t,this.plane[e]=t,this.gizmo[e]=t};n(`camera`,this.camera),n(`object`,this.object),n(`enabled`,this.enabled),n(`axis`,this.axis),n(`mode`,this.mode),n(`translationSnap`,this.translationSnap),n(`rotationSnap`,this.rotationSnap),n(`scaleSnap`,this.scaleSnap),n(`space`,this.space),n(`size`,this.size),n(`dragging`,this.dragging),n(`showX`,this.showX),n(`showY`,this.showY),n(`showZ`,this.showZ),n(`worldPosition`,this.worldPosition),n(`worldPositionStart`,this.worldPositionStart),n(`worldQuaternion`,this.worldQuaternion),n(`worldQuaternionStart`,this.worldQuaternionStart),n(`cameraPosition`,this.cameraPosition),n(`cameraQuaternion`,this.cameraQuaternion),n(`pointStart`,this.pointStart),n(`pointEnd`,this.pointEnd),n(`rotationAxis`,this.rotationAxis),n(`rotationAngle`,this.rotationAngle),n(`eye`,this.eye),t!==void 0&&this.connect(t)}},NB=class extends _e{constructor(){super(),Q(this,`isTransformControlsGizmo`,!0),Q(this,`type`,`TransformControlsGizmo`),Q(this,`tempVector`,new B(0,0,0)),Q(this,`tempEuler`,new Le),Q(this,`alignVector`,new B(0,1,0)),Q(this,`zeroVector`,new B(0,0,0)),Q(this,`lookAtMatrix`,new je),Q(this,`tempQuaternion`,new Rt),Q(this,`tempQuaternion2`,new Rt),Q(this,`identityQuaternion`,new Rt),Q(this,`unitX`,new B(1,0,0)),Q(this,`unitY`,new B(0,1,0)),Q(this,`unitZ`,new B(0,0,1)),Q(this,`gizmo`),Q(this,`picker`),Q(this,`helper`),Q(this,`rotationAxis`,new B),Q(this,`cameraPosition`,new B),Q(this,`worldPositionStart`,new B),Q(this,`worldQuaternionStart`,new Rt),Q(this,`worldPosition`,new B),Q(this,`worldQuaternion`,new Rt),Q(this,`eye`,new B),Q(this,`camera`,null),Q(this,`enabled`,!0),Q(this,`axis`,null),Q(this,`mode`,`translate`),Q(this,`space`,`world`),Q(this,`size`,1),Q(this,`dragging`,!1),Q(this,`showX`,!0),Q(this,`showY`,!0),Q(this,`showZ`,!0),Q(this,`updateMatrixWorld`,()=>{let e=this.space;this.mode===`scale`&&(e=`local`);let t=e===`local`?this.worldQuaternion:this.identityQuaternion;this.gizmo.translate.visible=this.mode===`translate`,this.gizmo.rotate.visible=this.mode===`rotate`,this.gizmo.scale.visible=this.mode===`scale`,this.helper.translate.visible=this.mode===`translate`,this.helper.rotate.visible=this.mode===`rotate`,this.helper.scale.visible=this.mode===`scale`;let n=[];n=n.concat(this.picker[this.mode].children),n=n.concat(this.gizmo[this.mode].children),n=n.concat(this.helper[this.mode].children);for(let e=0;e.9&&(r.visible=!1)),this.axis===`Y`&&(this.tempQuaternion.setFromEuler(this.tempEuler.set(0,0,Math.PI/2)),r.quaternion.copy(t).multiply(this.tempQuaternion),Math.abs(this.alignVector.copy(this.unitY).applyQuaternion(t).dot(this.eye))>.9&&(r.visible=!1)),this.axis===`Z`&&(this.tempQuaternion.setFromEuler(this.tempEuler.set(0,Math.PI/2,0)),r.quaternion.copy(t).multiply(this.tempQuaternion),Math.abs(this.alignVector.copy(this.unitZ).applyQuaternion(t).dot(this.eye))>.9&&(r.visible=!1)),this.axis===`XYZE`&&(this.tempQuaternion.setFromEuler(this.tempEuler.set(0,Math.PI/2,0)),this.alignVector.copy(this.rotationAxis),r.quaternion.setFromRotationMatrix(this.lookAtMatrix.lookAt(this.zeroVector,this.alignVector,this.unitY)),r.quaternion.multiply(this.tempQuaternion),r.visible=this.dragging),this.axis===`E`&&(r.visible=!1)):r.name===`START`?(r.position.copy(this.worldPositionStart),r.visible=this.dragging):r.name===`END`?(r.position.copy(this.worldPosition),r.visible=this.dragging):r.name===`DELTA`?(r.position.copy(this.worldPositionStart),r.quaternion.copy(this.worldQuaternionStart),this.tempVector.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),this.tempVector.applyQuaternion(this.worldQuaternionStart.clone().invert()),r.scale.copy(this.tempVector),r.visible=this.dragging):(r.quaternion.copy(t),this.dragging?r.position.copy(this.worldPositionStart):r.position.copy(this.worldPosition),this.axis&&(r.visible=this.axis.search(r.name)!==-1));continue}r.quaternion.copy(t),this.mode===`translate`||this.mode===`scale`?((r.name===`X`||r.name===`XYZX`)&&Math.abs(this.alignVector.copy(this.unitX).applyQuaternion(t).dot(this.eye))>.99&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),(r.name===`Y`||r.name===`XYZY`)&&Math.abs(this.alignVector.copy(this.unitY).applyQuaternion(t).dot(this.eye))>.99&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),(r.name===`Z`||r.name===`XYZZ`)&&Math.abs(this.alignVector.copy(this.unitZ).applyQuaternion(t).dot(this.eye))>.99&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name===`XY`&&Math.abs(this.alignVector.copy(this.unitZ).applyQuaternion(t).dot(this.eye))<.2&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name===`YZ`&&Math.abs(this.alignVector.copy(this.unitX).applyQuaternion(t).dot(this.eye))<.2&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name===`XZ`&&Math.abs(this.alignVector.copy(this.unitY).applyQuaternion(t).dot(this.eye))<.2&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name.search(`X`)!==-1&&(this.alignVector.copy(this.unitX).applyQuaternion(t).dot(this.eye)<0?r.tag===`fwd`?r.visible=!1:r.scale.x*=-1:r.tag===`bwd`&&(r.visible=!1)),r.name.search(`Y`)!==-1&&(this.alignVector.copy(this.unitY).applyQuaternion(t).dot(this.eye)<0?r.tag===`fwd`?r.visible=!1:r.scale.y*=-1:r.tag===`bwd`&&(r.visible=!1)),r.name.search(`Z`)!==-1&&(this.alignVector.copy(this.unitZ).applyQuaternion(t).dot(this.eye)<0?r.tag===`fwd`?r.visible=!1:r.scale.z*=-1:r.tag===`bwd`&&(r.visible=!1))):this.mode===`rotate`&&(this.tempQuaternion2.copy(t),this.alignVector.copy(this.eye).applyQuaternion(this.tempQuaternion.copy(t).invert()),r.name.search(`E`)!==-1&&r.quaternion.setFromRotationMatrix(this.lookAtMatrix.lookAt(this.eye,this.zeroVector,this.unitY)),r.name===`X`&&(this.tempQuaternion.setFromAxisAngle(this.unitX,Math.atan2(-this.alignVector.y,this.alignVector.z)),this.tempQuaternion.multiplyQuaternions(this.tempQuaternion2,this.tempQuaternion),r.quaternion.copy(this.tempQuaternion)),r.name===`Y`&&(this.tempQuaternion.setFromAxisAngle(this.unitY,Math.atan2(this.alignVector.x,this.alignVector.z)),this.tempQuaternion.multiplyQuaternions(this.tempQuaternion2,this.tempQuaternion),r.quaternion.copy(this.tempQuaternion)),r.name===`Z`&&(this.tempQuaternion.setFromAxisAngle(this.unitZ,Math.atan2(this.alignVector.y,this.alignVector.x)),this.tempQuaternion.multiplyQuaternions(this.tempQuaternion2,this.tempQuaternion),r.quaternion.copy(this.tempQuaternion))),r.visible=r.visible&&(r.name.indexOf(`X`)===-1||this.showX),r.visible=r.visible&&(r.name.indexOf(`Y`)===-1||this.showY),r.visible=r.visible&&(r.name.indexOf(`Z`)===-1||this.showZ),r.visible=r.visible&&(r.name.indexOf(`E`)===-1||this.showX&&this.showY&&this.showZ),r.material.tempOpacity=r.material.tempOpacity||r.material.opacity,r.material.tempColor=r.material.tempColor||r.material.color.clone(),r.material.color.copy(r.material.tempColor),r.material.opacity=r.material.tempOpacity,this.enabled?this.axis&&(r.name===this.axis||this.axis.split(``).some(function(e){return r.name===e})?(r.material.opacity=1,r.material.color.lerp(new ge(1,1,1),.5)):(r.material.opacity*=.25,r.material.color.lerp(new ge(1,1,1),.5))):(r.material.opacity*=.5,r.material.color.lerp(new ge(1,1,1),.5))}super.updateMatrixWorld()});let e=new gt({depthTest:!1,depthWrite:!1,transparent:!0,side:Ve,fog:!1,toneMapped:!1}),t=new P({depthTest:!1,depthWrite:!1,transparent:!0,linewidth:1,fog:!1,toneMapped:!1}),n=e.clone();n.opacity=.15;let r=e.clone();r.opacity=.33;let i=e.clone();i.color.set(16711680);let a=e.clone();a.color.set(65280);let o=e.clone();o.color.set(255);let s=e.clone();s.opacity=.25;let c=s.clone();c.color.set(16776960);let l=s.clone();l.color.set(65535);let u=s.clone();u.color.set(16711935),e.clone().color.set(16776960);let d=t.clone();d.color.set(16711680);let f=t.clone();f.color.set(65280);let p=t.clone();p.color.set(255);let m=t.clone();m.color.set(65535);let h=t.clone();h.color.set(16711935);let g=t.clone();g.color.set(16776960);let _=t.clone();_.color.set(7895160);let v=g.clone();v.opacity=.25;let y=new Kt(0,.05,.2,12,1,!1),b=new ht(.125,.125,.125),x=new rt;x.setAttribute(`position`,new pe([0,0,0,1,0,0],3));let S=(e,t)=>{let n=new rt,r=[];for(let n=0;n<=64*t;++n)r.push(0,Math.cos(n/32*Math.PI)*e,Math.sin(n/32*Math.PI)*e);return n.setAttribute(`position`,new pe(r,3)),n},C=()=>{let e=new rt;return e.setAttribute(`position`,new pe([0,0,0,1,1,1],3)),e},w={X:[[new V(y,i),[1,0,0],[0,0,-Math.PI/2],null,`fwd`],[new V(y,i),[1,0,0],[0,0,Math.PI/2],null,`bwd`],[new Qe(x,d)]],Y:[[new V(y,a),[0,1,0],null,null,`fwd`],[new V(y,a),[0,1,0],[Math.PI,0,0],null,`bwd`],[new Qe(x,f),null,[0,0,Math.PI/2]]],Z:[[new V(y,o),[0,0,1],[Math.PI/2,0,0],null,`fwd`],[new V(y,o),[0,0,1],[-Math.PI/2,0,0],null,`bwd`],[new Qe(x,p),null,[0,-Math.PI/2,0]]],XYZ:[[new V(new R(.1,0),s.clone()),[0,0,0],[0,0,0]]],XY:[[new V(new Ye(.295,.295),c.clone()),[.15,.15,0]],[new Qe(x,g),[.18,.3,0],null,[.125,1,1]],[new Qe(x,g),[.3,.18,0],[0,0,Math.PI/2],[.125,1,1]]],YZ:[[new V(new Ye(.295,.295),l.clone()),[0,.15,.15],[0,Math.PI/2,0]],[new Qe(x,m),[0,.18,.3],[0,0,Math.PI/2],[.125,1,1]],[new Qe(x,m),[0,.3,.18],[0,-Math.PI/2,0],[.125,1,1]]],XZ:[[new V(new Ye(.295,.295),u.clone()),[.15,0,.15],[-Math.PI/2,0,0]],[new Qe(x,h),[.18,0,.3],null,[.125,1,1]],[new Qe(x,h),[.3,0,.18],[0,-Math.PI/2,0],[.125,1,1]]]},T={X:[[new V(new Kt(.2,0,1,4,1,!1),n),[.6,0,0],[0,0,-Math.PI/2]]],Y:[[new V(new Kt(.2,0,1,4,1,!1),n),[0,.6,0]]],Z:[[new V(new Kt(.2,0,1,4,1,!1),n),[0,0,.6],[Math.PI/2,0,0]]],XYZ:[[new V(new R(.2,0),n)]],XY:[[new V(new Ye(.4,.4),n),[.2,.2,0]]],YZ:[[new V(new Ye(.4,.4),n),[0,.2,.2],[0,Math.PI/2,0]]],XZ:[[new V(new Ye(.4,.4),n),[.2,0,.2],[-Math.PI/2,0,0]]]},E={START:[[new V(new R(.01,2),r),null,null,null,`helper`]],END:[[new V(new R(.01,2),r),null,null,null,`helper`]],DELTA:[[new Qe(C(),r),null,null,null,`helper`]],X:[[new Qe(x,r.clone()),[-1e3,0,0],null,[1e6,1,1],`helper`]],Y:[[new Qe(x,r.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],`helper`]],Z:[[new Qe(x,r.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],`helper`]]},D={X:[[new Qe(S(1,.5),d)],[new V(new R(.04,0),i),[0,0,.99],null,[1,3,1]]],Y:[[new Qe(S(1,.5),f),null,[0,0,-Math.PI/2]],[new V(new R(.04,0),a),[0,0,.99],null,[3,1,1]]],Z:[[new Qe(S(1,.5),p),null,[0,Math.PI/2,0]],[new V(new R(.04,0),o),[.99,0,0],null,[1,3,1]]],E:[[new Qe(S(1.25,1),v),null,[0,Math.PI/2,0]],[new V(new Kt(.03,0,.15,4,1,!1),v),[1.17,0,0],[0,0,-Math.PI/2],[1,1,.001]],[new V(new Kt(.03,0,.15,4,1,!1),v),[-1.17,0,0],[0,0,Math.PI/2],[1,1,.001]],[new V(new Kt(.03,0,.15,4,1,!1),v),[0,-1.17,0],[Math.PI,0,0],[1,1,.001]],[new V(new Kt(.03,0,.15,4,1,!1),v),[0,1.17,0],[0,0,0],[1,1,.001]]],XYZE:[[new Qe(S(1,1),_),null,[0,Math.PI/2,0]]]},O={AXIS:[[new Qe(x,r.clone()),[-1e3,0,0],null,[1e6,1,1],`helper`]]},k={X:[[new V(new M(1,.1,4,24),n),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new V(new M(1,.1,4,24),n),[0,0,0],[Math.PI/2,0,0]]],Z:[[new V(new M(1,.1,4,24),n),[0,0,0],[0,0,-Math.PI/2]]],E:[[new V(new M(1.25,.1,2,24),n)]],XYZE:[[new V(new Pt(.7,10,8),n)]]},A={X:[[new V(b,i),[.8,0,0],[0,0,-Math.PI/2]],[new Qe(x,d),null,null,[.8,1,1]]],Y:[[new V(b,a),[0,.8,0]],[new Qe(x,f),null,[0,0,Math.PI/2],[.8,1,1]]],Z:[[new V(b,o),[0,0,.8],[Math.PI/2,0,0]],[new Qe(x,p),null,[0,-Math.PI/2,0],[.8,1,1]]],XY:[[new V(b,c),[.85,.85,0],null,[2,2,.2]],[new Qe(x,g),[.855,.98,0],null,[.125,1,1]],[new Qe(x,g),[.98,.855,0],[0,0,Math.PI/2],[.125,1,1]]],YZ:[[new V(b,l),[0,.85,.85],null,[.2,2,2]],[new Qe(x,m),[0,.855,.98],[0,0,Math.PI/2],[.125,1,1]],[new Qe(x,m),[0,.98,.855],[0,-Math.PI/2,0],[.125,1,1]]],XZ:[[new V(b,u),[.85,0,.85],null,[2,.2,2]],[new Qe(x,h),[.855,0,.98],null,[.125,1,1]],[new Qe(x,h),[.98,0,.855],[0,-Math.PI/2,0],[.125,1,1]]],XYZX:[[new V(new ht(.125,.125,.125),s.clone()),[1.1,0,0]]],XYZY:[[new V(new ht(.125,.125,.125),s.clone()),[0,1.1,0]]],XYZZ:[[new V(new ht(.125,.125,.125),s.clone()),[0,0,1.1]]]},j={X:[[new V(new Kt(.2,0,.8,4,1,!1),n),[.5,0,0],[0,0,-Math.PI/2]]],Y:[[new V(new Kt(.2,0,.8,4,1,!1),n),[0,.5,0]]],Z:[[new V(new Kt(.2,0,.8,4,1,!1),n),[0,0,.5],[Math.PI/2,0,0]]],XY:[[new V(b,n),[.85,.85,0],null,[3,3,.2]]],YZ:[[new V(b,n),[0,.85,.85],null,[.2,3,3]]],XZ:[[new V(b,n),[.85,0,.85],null,[3,.2,3]]],XYZX:[[new V(new ht(.2,.2,.2),n),[1.1,0,0]]],XYZY:[[new V(new ht(.2,.2,.2),n),[0,1.1,0]]],XYZZ:[[new V(new ht(.2,.2,.2),n),[0,0,1.1]]]},N={X:[[new Qe(x,r.clone()),[-1e3,0,0],null,[1e6,1,1],`helper`]],Y:[[new Qe(x,r.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],`helper`]],Z:[[new Qe(x,r.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],`helper`]]},ee=e=>{let t=new _e;for(let n in e)for(let r=e[n].length;r--;){let i=e[n][r][0].clone(),a=e[n][r][1],o=e[n][r][2],s=e[n][r][3],c=e[n][r][4];i.name=n,i.tag=c,a&&i.position.set(a[0],a[1],a[2]),o&&i.rotation.set(o[0],o[1],o[2]),s&&i.scale.set(s[0],s[1],s[2]),i.updateMatrix();let l=i.geometry.clone();l.applyMatrix4(i.matrix),i.geometry=l,i.renderOrder=1/0,i.position.set(0,0,0),i.rotation.set(0,0,0),i.scale.set(1,1,1),t.add(i)}return t};this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=ee(w)),this.add(this.gizmo.rotate=ee(D)),this.add(this.gizmo.scale=ee(A)),this.add(this.picker.translate=ee(T)),this.add(this.picker.rotate=ee(k)),this.add(this.picker.scale=ee(j)),this.add(this.helper.translate=ee(E)),this.add(this.helper.rotate=ee(O)),this.add(this.helper.scale=ee(N)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1}},PB=class extends V{constructor(){super(new Ye(1e5,1e5,2,2),new gt({visible:!1,wireframe:!0,side:Ve,transparent:!0,opacity:.1,toneMapped:!1})),Q(this,`isTransformControlsPlane`,!0),Q(this,`type`,`TransformControlsPlane`),Q(this,`unitX`,new B(1,0,0)),Q(this,`unitY`,new B(0,1,0)),Q(this,`unitZ`,new B(0,0,1)),Q(this,`tempVector`,new B),Q(this,`dirVector`,new B),Q(this,`alignVector`,new B),Q(this,`tempMatrix`,new je),Q(this,`identityQuaternion`,new Rt),Q(this,`cameraQuaternion`,new Rt),Q(this,`worldPosition`,new B),Q(this,`worldQuaternion`,new Rt),Q(this,`eye`,new B),Q(this,`axis`,null),Q(this,`mode`,`translate`),Q(this,`space`,`world`),Q(this,`updateMatrixWorld`,()=>{let e=this.space;switch(this.position.copy(this.worldPosition),this.mode===`scale`&&(e=`local`),this.unitX.set(1,0,0).applyQuaternion(e===`local`?this.worldQuaternion:this.identityQuaternion),this.unitY.set(0,1,0).applyQuaternion(e===`local`?this.worldQuaternion:this.identityQuaternion),this.unitZ.set(0,0,1).applyQuaternion(e===`local`?this.worldQuaternion:this.identityQuaternion),this.alignVector.copy(this.unitY),this.mode){case`translate`:case`scale`:switch(this.axis){case`X`:this.alignVector.copy(this.eye).cross(this.unitX),this.dirVector.copy(this.unitX).cross(this.alignVector);break;case`Y`:this.alignVector.copy(this.eye).cross(this.unitY),this.dirVector.copy(this.unitY).cross(this.alignVector);break;case`Z`:this.alignVector.copy(this.eye).cross(this.unitZ),this.dirVector.copy(this.unitZ).cross(this.alignVector);break;case`XY`:this.dirVector.copy(this.unitZ);break;case`YZ`:this.dirVector.copy(this.unitX);break;case`XZ`:this.alignVector.copy(this.unitZ),this.dirVector.copy(this.unitY);break;case`XYZ`:case`E`:this.dirVector.set(0,0,0);break}break;case`rotate`:default:this.dirVector.set(0,0,0)}this.dirVector.length()===0?this.quaternion.copy(this.cameraQuaternion):(this.tempMatrix.lookAt(this.tempVector.set(0,0,0),this.dirVector,this.alignVector),this.quaternion.setFromRotationMatrix(this.tempMatrix)),super.updateMatrixWorld()})}},FB=Object.defineProperty,IB=(e,t,n)=>t in e?FB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,LB=(e,t,n)=>(IB(e,typeof t==`symbol`?t:t+``,n),n);const RB=new Le(0,0,0,`YXZ`),zB=new B,BB={type:`change`},VB={type:`lock`},HB={type:`unlock`},UB=Math.PI/2;var WB=class extends Xe{constructor(e,t){super(),LB(this,`camera`),LB(this,`domElement`),LB(this,`isLocked`),LB(this,`minPolarAngle`),LB(this,`maxPolarAngle`),LB(this,`pointerSpeed`),LB(this,`onMouseMove`,e=>{if(!this.domElement||this.isLocked===!1)return;let t=e.movementX||e.mozMovementX||e.webkitMovementX||0,n=e.movementY||e.mozMovementY||e.webkitMovementY||0;RB.setFromQuaternion(this.camera.quaternion),RB.y-=t*.002*this.pointerSpeed,RB.x-=n*.002*this.pointerSpeed,RB.x=Math.max(UB-this.maxPolarAngle,Math.min(UB-this.minPolarAngle,RB.x)),this.camera.quaternion.setFromEuler(RB),this.dispatchEvent(BB)}),LB(this,`onPointerlockChange`,()=>{this.domElement&&(this.domElement.ownerDocument.pointerLockElement===this.domElement?(this.dispatchEvent(VB),this.isLocked=!0):(this.dispatchEvent(HB),this.isLocked=!1))}),LB(this,`onPointerlockError`,()=>{console.error(`THREE.PointerLockControls: Unable to use Pointer Lock API`)}),LB(this,`connect`,e=>{this.domElement=e||this.domElement,this.domElement&&(this.domElement.ownerDocument.addEventListener(`mousemove`,this.onMouseMove),this.domElement.ownerDocument.addEventListener(`pointerlockchange`,this.onPointerlockChange),this.domElement.ownerDocument.addEventListener(`pointerlockerror`,this.onPointerlockError))}),LB(this,`disconnect`,()=>{this.domElement&&(this.domElement.ownerDocument.removeEventListener(`mousemove`,this.onMouseMove),this.domElement.ownerDocument.removeEventListener(`pointerlockchange`,this.onPointerlockChange),this.domElement.ownerDocument.removeEventListener(`pointerlockerror`,this.onPointerlockError))}),LB(this,`dispose`,()=>{this.disconnect()}),LB(this,`getObject`,()=>this.camera),LB(this,`direction`,new B(0,0,-1)),LB(this,`getDirection`,e=>e.copy(this.direction).applyQuaternion(this.camera.quaternion)),LB(this,`moveForward`,e=>{zB.setFromMatrixColumn(this.camera.matrix,0),zB.crossVectors(this.camera.up,zB),this.camera.position.addScaledVector(zB,e)}),LB(this,`moveRight`,e=>{zB.setFromMatrixColumn(this.camera.matrix,0),this.camera.position.addScaledVector(zB,e)}),LB(this,`lock`,()=>{this.domElement&&this.domElement.requestPointerLock()}),LB(this,`unlock`,()=>{this.domElement&&this.domElement.ownerDocument.exitPointerLock()}),this.camera=e,this.domElement=t,this.isLocked=!1,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.pointerSpeed=1,t&&this.connect(t)}},GB=Object.defineProperty,KB=(e,t,n)=>t in e?GB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qB=(e,t,n)=>(KB(e,typeof t==`symbol`?t:t+``,n),n);const JB=new Ue,YB=new Ft,XB=Math.cos(70*(Math.PI/180)),ZB=(e,t)=>(e%t+t)%t;var QB=class extends Xe{constructor(e,t){super(),qB(this,`object`),qB(this,`domElement`),qB(this,`enabled`,!0),qB(this,`target`,new B),qB(this,`minDistance`,0),qB(this,`maxDistance`,1/0),qB(this,`minZoom`,0),qB(this,`maxZoom`,1/0),qB(this,`minPolarAngle`,0),qB(this,`maxPolarAngle`,Math.PI),qB(this,`minAzimuthAngle`,-1/0),qB(this,`maxAzimuthAngle`,1/0),qB(this,`enableDamping`,!1),qB(this,`dampingFactor`,.05),qB(this,`enableZoom`,!0),qB(this,`zoomSpeed`,1),qB(this,`enableRotate`,!0),qB(this,`rotateSpeed`,1),qB(this,`enablePan`,!0),qB(this,`panSpeed`,1),qB(this,`screenSpacePanning`,!0),qB(this,`keyPanSpeed`,7),qB(this,`zoomToCursor`,!1),qB(this,`autoRotate`,!1),qB(this,`autoRotateSpeed`,2),qB(this,`reverseOrbit`,!1),qB(this,`reverseHorizontalOrbit`,!1),qB(this,`reverseVerticalOrbit`,!1),qB(this,`keys`,{LEFT:`ArrowLeft`,UP:`ArrowUp`,RIGHT:`ArrowRight`,BOTTOM:`ArrowDown`}),qB(this,`mouseButtons`,{LEFT:Nt.ROTATE,MIDDLE:Nt.DOLLY,RIGHT:Nt.PAN}),qB(this,`touches`,{ONE:It.ROTATE,TWO:It.DOLLY_PAN}),qB(this,`target0`),qB(this,`position0`),qB(this,`zoom0`),qB(this,`_domElementKeyEvents`,null),qB(this,`getPolarAngle`),qB(this,`getAzimuthalAngle`),qB(this,`setPolarAngle`),qB(this,`setAzimuthalAngle`),qB(this,`getDistance`),qB(this,`getZoomScale`),qB(this,`listenToKeyEvents`),qB(this,`stopListenToKeyEvents`),qB(this,`saveState`),qB(this,`reset`),qB(this,`update`),qB(this,`connect`),qB(this,`dispose`),qB(this,`dollyIn`),qB(this,`dollyOut`),qB(this,`getScale`),qB(this,`setScale`),this.object=e,this.domElement=t,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=()=>l.phi,this.getAzimuthalAngle=()=>l.theta,this.setPolarAngle=e=>{let t=ZB(e,2*Math.PI),r=l.phi;r<0&&(r+=2*Math.PI),t<0&&(t+=2*Math.PI);let i=Math.abs(t-r);2*Math.PI-i{let t=ZB(e,2*Math.PI),r=l.theta;r<0&&(r+=2*Math.PI),t<0&&(t+=2*Math.PI);let i=Math.abs(t-r);2*Math.PI-in.object.position.distanceTo(n.target),this.listenToKeyEvents=e=>{e.addEventListener(`keydown`,we),this._domElementKeyEvents=e},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener(`keydown`,we),this._domElementKeyEvents=null},this.saveState=()=>{n.target0.copy(n.target),n.position0.copy(n.object.position),n.zoom0=n.object.zoom},this.reset=()=>{n.target.copy(n.target0),n.object.position.copy(n.position0),n.object.zoom=n.zoom0,n.object.updateProjectionMatrix(),n.dispatchEvent(r),n.update(),s=o.NONE},this.update=(()=>{let t=new B,i=new B(0,1,0),a=new Rt().setFromUnitVectors(e.up,i),p=a.clone().invert(),m=new B,h=new Rt,g=2*Math.PI;return function(){let _=n.object.position;a.setFromUnitVectors(e.up,i),p.copy(a).invert(),t.copy(_).sub(n.target),t.applyQuaternion(a),l.setFromVector3(t),n.autoRotate&&s===o.NONE&&k(D()),n.enableDamping?(l.theta+=u.theta*n.dampingFactor,l.phi+=u.phi*n.dampingFactor):(l.theta+=u.theta,l.phi+=u.phi);let v=n.minAzimuthAngle,y=n.maxAzimuthAngle;isFinite(v)&&isFinite(y)&&(v<-Math.PI?v+=g:v>Math.PI&&(v-=g),y<-Math.PI?y+=g:y>Math.PI&&(y-=g),v<=y?l.theta=Math.max(v,Math.min(y,l.theta)):l.theta=l.theta>(v+y)/2?Math.max(v,l.theta):Math.min(y,l.theta)),l.phi=Math.max(n.minPolarAngle,Math.min(n.maxPolarAngle,l.phi)),l.makeSafe(),n.enableDamping===!0?n.target.addScaledVector(f,n.dampingFactor):n.target.add(f),n.zoomToCursor&&w||n.object.isOrthographicCamera?l.radius=te(l.radius):l.radius=te(l.radius*d),t.setFromSpherical(l),t.applyQuaternion(p),_.copy(n.target).add(t),n.object.matrixAutoUpdate||n.object.updateMatrix(),n.object.lookAt(n.target),n.enableDamping===!0?(u.theta*=1-n.dampingFactor,u.phi*=1-n.dampingFactor,f.multiplyScalar(1-n.dampingFactor)):(u.set(0,0,0),f.set(0,0,0));let b=!1;if(n.zoomToCursor&&w){let r=null;if(n.object instanceof qe&&n.object.isPerspectiveCamera){let e=t.length();r=te(e*d);let i=e-r;n.object.position.addScaledVector(S,i),n.object.updateMatrixWorld()}else if(n.object.isOrthographicCamera){let e=new B(C.x,C.y,0);e.unproject(n.object),n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/d)),n.object.updateProjectionMatrix(),b=!0;let i=new B(C.x,C.y,0);i.unproject(n.object),n.object.position.sub(i).add(e),n.object.updateMatrixWorld(),r=t.length()}else console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled.`),n.zoomToCursor=!1;r!==null&&(n.screenSpacePanning?n.target.set(0,0,-1).transformDirection(n.object.matrix).multiplyScalar(r).add(n.object.position):(JB.origin.copy(n.object.position),JB.direction.set(0,0,-1).transformDirection(n.object.matrix),Math.abs(n.object.up.dot(JB.direction))c||8*(1-h.dot(n.object.quaternion))>c?(n.dispatchEvent(r),m.copy(n.object.position),h.copy(n.object.quaternion),b=!1,!0):!1}})(),this.connect=e=>{n.domElement=e,n.domElement.style.touchAction=`none`,n.domElement.addEventListener(`contextmenu`,De),n.domElement.addEventListener(`pointerdown`,ve),n.domElement.addEventListener(`pointercancel`,be),n.domElement.addEventListener(`wheel`,Ce)},this.dispose=()=>{var e,t,r,i,a,o;n.domElement&&(n.domElement.style.touchAction=`auto`),(e=n.domElement)==null||e.removeEventListener(`contextmenu`,De),(t=n.domElement)==null||t.removeEventListener(`pointerdown`,ve),(r=n.domElement)==null||r.removeEventListener(`pointercancel`,be),(i=n.domElement)==null||i.removeEventListener(`wheel`,Ce),(a=n.domElement)==null||a.ownerDocument.removeEventListener(`pointermove`,ye),(o=n.domElement)==null||o.ownerDocument.removeEventListener(`pointerup`,be),n._domElementKeyEvents!==null&&n._domElementKeyEvents.removeEventListener(`keydown`,we)};let n=this,r={type:`change`},i={type:`start`},a={type:`end`},o={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},s=o.NONE,c=1e-6,l=new Ie,u=new Ie,d=1,f=new B,p=new ut,m=new ut,h=new ut,g=new ut,_=new ut,v=new ut,y=new ut,b=new ut,x=new ut,S=new B,C=new ut,w=!1,T=[],E={};function D(){return 2*Math.PI/60/60*n.autoRotateSpeed}function O(){return .95**n.zoomSpeed}function k(e){n.reverseOrbit||n.reverseHorizontalOrbit?u.theta+=e:u.theta-=e}function A(e){n.reverseOrbit||n.reverseVerticalOrbit?u.phi+=e:u.phi-=e}let j=(()=>{let e=new B;return function(t,n){e.setFromMatrixColumn(n,0),e.multiplyScalar(-t),f.add(e)}})(),M=(()=>{let e=new B;return function(t,r){n.screenSpacePanning===!0?e.setFromMatrixColumn(r,1):(e.setFromMatrixColumn(r,0),e.crossVectors(n.object.up,e)),e.multiplyScalar(t),f.add(e)}})(),N=(()=>{let e=new B;return function(t,r){let i=n.domElement;if(i&&n.object instanceof qe&&n.object.isPerspectiveCamera){let a=n.object.position;e.copy(a).sub(n.target);let o=e.length();o*=Math.tan(n.object.fov/2*Math.PI/180),j(2*t*o/i.clientHeight,n.object.matrix),M(2*r*o/i.clientHeight,n.object.matrix)}else i&&n.object instanceof ee&&n.object.isOrthographicCamera?(j(t*(n.object.right-n.object.left)/n.object.zoom/i.clientWidth,n.object.matrix),M(r*(n.object.top-n.object.bottom)/n.object.zoom/i.clientHeight,n.object.matrix)):(console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.`),n.enablePan=!1)}})();function P(e){n.object instanceof qe&&n.object.isPerspectiveCamera||n.object instanceof ee&&n.object.isOrthographicCamera?d=e:(console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.`),n.enableZoom=!1)}function F(e){P(d/e)}function I(e){P(d*e)}function L(e){if(!n.zoomToCursor||!n.domElement)return;w=!0;let t=n.domElement.getBoundingClientRect(),r=e.clientX-t.left,i=e.clientY-t.top,a=t.width,o=t.height;C.x=r/a*2-1,C.y=-(i/o)*2+1,S.set(C.x,C.y,1).unproject(n.object).sub(n.object.position).normalize()}function te(e){return Math.max(n.minDistance,Math.min(n.maxDistance,e))}function R(e){p.set(e.clientX,e.clientY)}function ne(e){L(e),y.set(e.clientX,e.clientY)}function z(e){g.set(e.clientX,e.clientY)}function re(e){m.set(e.clientX,e.clientY),h.subVectors(m,p).multiplyScalar(n.rotateSpeed);let t=n.domElement;t&&(k(2*Math.PI*h.x/t.clientHeight),A(2*Math.PI*h.y/t.clientHeight)),p.copy(m),n.update()}function ie(e){b.set(e.clientX,e.clientY),x.subVectors(b,y),x.y>0?F(O()):x.y<0&&I(O()),y.copy(b),n.update()}function ae(e){_.set(e.clientX,e.clientY),v.subVectors(_,g).multiplyScalar(n.panSpeed),N(v.x,v.y),g.copy(_),n.update()}function oe(e){L(e),e.deltaY<0?I(O()):e.deltaY>0&&F(O()),n.update()}function se(e){let t=!1;switch(e.code){case n.keys.UP:N(0,n.keyPanSpeed),t=!0;break;case n.keys.BOTTOM:N(0,-n.keyPanSpeed),t=!0;break;case n.keys.LEFT:N(n.keyPanSpeed,0),t=!0;break;case n.keys.RIGHT:N(-n.keyPanSpeed,0),t=!0;break}t&&(e.preventDefault(),n.update())}function ce(){if(T.length==1)p.set(T[0].pageX,T[0].pageY);else{let e=.5*(T[0].pageX+T[1].pageX),t=.5*(T[0].pageY+T[1].pageY);p.set(e,t)}}function le(){if(T.length==1)g.set(T[0].pageX,T[0].pageY);else{let e=.5*(T[0].pageX+T[1].pageX),t=.5*(T[0].pageY+T[1].pageY);g.set(e,t)}}function ue(){let e=T[0].pageX-T[1].pageX,t=T[0].pageY-T[1].pageY,n=Math.sqrt(e*e+t*t);y.set(0,n)}function de(){n.enableZoom&&ue(),n.enablePan&&le()}function fe(){n.enableZoom&&ue(),n.enableRotate&&ce()}function pe(e){if(T.length==1)m.set(e.pageX,e.pageY);else{let t=je(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);m.set(n,r)}h.subVectors(m,p).multiplyScalar(n.rotateSpeed);let t=n.domElement;t&&(k(2*Math.PI*h.x/t.clientHeight),A(2*Math.PI*h.y/t.clientHeight)),p.copy(m)}function me(e){if(T.length==1)_.set(e.pageX,e.pageY);else{let t=je(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);_.set(n,r)}v.subVectors(_,g).multiplyScalar(n.panSpeed),N(v.x,v.y),g.copy(_)}function he(e){let t=je(e),r=e.pageX-t.x,i=e.pageY-t.y,a=Math.sqrt(r*r+i*i);b.set(0,a),x.set(0,(b.y/y.y)**+n.zoomSpeed),F(x.y),y.copy(b)}function ge(e){n.enableZoom&&he(e),n.enablePan&&me(e)}function _e(e){n.enableZoom&&he(e),n.enableRotate&&pe(e)}function ve(e){var t,r;n.enabled!==!1&&(T.length===0&&((t=n.domElement)==null||t.ownerDocument.addEventListener(`pointermove`,ye),(r=n.domElement)==null||r.ownerDocument.addEventListener(`pointerup`,be)),Oe(e),e.pointerType===`touch`?Te(e):xe(e))}function ye(e){n.enabled!==!1&&(e.pointerType===`touch`?Ee(e):Se(e))}function be(e){var t,r,i;ke(e),T.length===0&&((t=n.domElement)==null||t.releasePointerCapture(e.pointerId),(r=n.domElement)==null||r.ownerDocument.removeEventListener(`pointermove`,ye),(i=n.domElement)==null||i.ownerDocument.removeEventListener(`pointerup`,be)),n.dispatchEvent(a),s=o.NONE}function xe(e){let t;switch(e.button){case 0:t=n.mouseButtons.LEFT;break;case 1:t=n.mouseButtons.MIDDLE;break;case 2:t=n.mouseButtons.RIGHT;break;default:t=-1}switch(t){case Nt.DOLLY:if(n.enableZoom===!1)return;ne(e),s=o.DOLLY;break;case Nt.ROTATE:if(e.ctrlKey||e.metaKey||e.shiftKey){if(n.enablePan===!1)return;z(e),s=o.PAN}else{if(n.enableRotate===!1)return;R(e),s=o.ROTATE}break;case Nt.PAN:if(e.ctrlKey||e.metaKey||e.shiftKey){if(n.enableRotate===!1)return;R(e),s=o.ROTATE}else{if(n.enablePan===!1)return;z(e),s=o.PAN}break;default:s=o.NONE}s!==o.NONE&&n.dispatchEvent(i)}function Se(e){if(n.enabled!==!1)switch(s){case o.ROTATE:if(n.enableRotate===!1)return;re(e);break;case o.DOLLY:if(n.enableZoom===!1)return;ie(e);break;case o.PAN:if(n.enablePan===!1)return;ae(e);break}}function Ce(e){n.enabled===!1||n.enableZoom===!1||s!==o.NONE&&s!==o.ROTATE||(e.preventDefault(),n.dispatchEvent(i),oe(e),n.dispatchEvent(a))}function we(e){n.enabled===!1||n.enablePan===!1||se(e)}function Te(e){switch(Ae(e),T.length){case 1:switch(n.touches.ONE){case It.ROTATE:if(n.enableRotate===!1)return;ce(),s=o.TOUCH_ROTATE;break;case It.PAN:if(n.enablePan===!1)return;le(),s=o.TOUCH_PAN;break;default:s=o.NONE}break;case 2:switch(n.touches.TWO){case It.DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;de(),s=o.TOUCH_DOLLY_PAN;break;case It.DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;fe(),s=o.TOUCH_DOLLY_ROTATE;break;default:s=o.NONE}break;default:s=o.NONE}s!==o.NONE&&n.dispatchEvent(i)}function Ee(e){switch(Ae(e),s){case o.TOUCH_ROTATE:if(n.enableRotate===!1)return;pe(e),n.update();break;case o.TOUCH_PAN:if(n.enablePan===!1)return;me(e),n.update();break;case o.TOUCH_DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;ge(e),n.update();break;case o.TOUCH_DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;_e(e),n.update();break;default:s=o.NONE}}function De(e){n.enabled!==!1&&e.preventDefault()}function Oe(e){T.push(e)}function ke(e){delete E[e.pointerId];for(let t=0;t{I(e),n.update()},this.dollyOut=(e=O())=>{F(e),n.update()},this.getScale=()=>d,this.setScale=e=>{P(e),n.update()},this.getZoomScale=()=>O(),t!==void 0&&this.connect(t),this.update()}},$B=class extends QB{constructor(e,t){super(e,t),this.screenSpacePanning=!1,this.mouseButtons.LEFT=Nt.PAN,this.mouseButtons.RIGHT=Nt.ROTATE,this.touches.ONE=It.PAN,this.touches.TWO=It.DOLLY_ROTATE}};const eV=new Rt,tV={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},nV={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},rV={9728:fe,9729:$e,9984:me,9985:kt,9986:O,9987:zt},iV={33071:te,33648:oe,10497:I},aV={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},oV={POSITION:`position`,NORMAL:`normal`,TANGENT:`tangent`,...zR>=152?{TEXCOORD_0:`uv`,TEXCOORD_1:`uv1`,TEXCOORD_2:`uv2`,TEXCOORD_3:`uv3`}:{TEXCOORD_0:`uv`,TEXCOORD_1:`uv2`},COLOR_0:`color`,WEIGHTS_0:`skinWeight`,JOINTS_0:`skinIndex`},sV={scale:`scale`,translation:`position`,rotation:`quaternion`,weights:`morphTargetInfluences`},cV={CUBICSPLINE:void 0,LINEAR:He,STEP:Ne},lV={OPAQUE:`OPAQUE`,MASK:`MASK`,BLEND:`BLEND`},uV=new je,dV=new B;function fV(e,t,n,r,i,a){let o=2*Math.PI*i/4,s=Math.max(a-2*i,0),c=Math.PI/4;dV.copy(t),dV[r]=0,dV.normalize();let l=.5*o/(o+s),u=1-dV.angleTo(e)/c;return Math.sign(dV[n])===1?u*l:s/(o+s)+l+l*(1-u)}var pV=class extends ht{constructor(e=1,t=1,n=1,r=2,i=.1){if(r=r*2+1,i=Math.min(e/2,t/2,n/2,i),super(1,1,1,r,r,r),r===1)return;let a=this.toNonIndexed();this.index=null,this.attributes.position=a.attributes.position,this.attributes.normal=a.attributes.normal,this.attributes.uv=a.attributes.uv;let o=new B,s=new B,c=new B(e,t,n).divideScalar(2).subScalar(i),l=this.attributes.position.array,u=this.attributes.normal.array,d=this.attributes.uv.array,f=l.length/6,p=new B,m=.5/r;for(let r=0,a=0;re){i=a;break}else e1&&(i=1-i,a=1-a),DB.a.fromBufferAttribute(this.positionAttribute,e*3),DB.b.fromBufferAttribute(this.positionAttribute,e*3+1),DB.c.fromBufferAttribute(this.positionAttribute,e*3+2),t.set(0,0,0).addScaledVector(DB.a,i).addScaledVector(DB.b,a).addScaledVector(DB.c,1-(i+a)),n!==void 0&&DB.getNormal(n),r!==void 0&&this.colorAttribute!==void 0&&(DB.a.fromBufferAttribute(this.colorAttribute,e*3),DB.b.fromBufferAttribute(this.colorAttribute,e*3+1),DB.c.fromBufferAttribute(this.colorAttribute,e*3+2),OB.set(0,0,0).addScaledVector(DB.a,i).addScaledVector(DB.b,a).addScaledVector(DB.c,1-(i+a)),r.r=OB.x,r.g=OB.y,r.b=OB.z),this}},AB=Object.defineProperty,jB=(e,t,n)=>t in e?AB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Q=(e,t,n)=>(jB(e,typeof t==`symbol`?t:t+``,n),n),MB=class extends he{constructor(e,t){super(),Q(this,`isTransformControls`,!0),Q(this,`visible`,!1),Q(this,`domElement`),Q(this,`raycaster`,new rt),Q(this,`gizmo`),Q(this,`plane`),Q(this,`tempVector`,new B),Q(this,`tempVector2`,new B),Q(this,`tempQuaternion`,new It),Q(this,`unit`,{X:new B(1,0,0),Y:new B(0,1,0),Z:new B(0,0,1)}),Q(this,`pointStart`,new B),Q(this,`pointEnd`,new B),Q(this,`offset`,new B),Q(this,`rotationAxis`,new B),Q(this,`startNorm`,new B),Q(this,`endNorm`,new B),Q(this,`rotationAngle`,0),Q(this,`cameraPosition`,new B),Q(this,`cameraQuaternion`,new It),Q(this,`cameraScale`,new B),Q(this,`parentPosition`,new B),Q(this,`parentQuaternion`,new It),Q(this,`parentQuaternionInv`,new It),Q(this,`parentScale`,new B),Q(this,`worldPositionStart`,new B),Q(this,`worldQuaternionStart`,new It),Q(this,`worldScaleStart`,new B),Q(this,`worldPosition`,new B),Q(this,`worldQuaternion`,new It),Q(this,`worldQuaternionInv`,new It),Q(this,`worldScale`,new B),Q(this,`eye`,new B),Q(this,`positionStart`,new B),Q(this,`quaternionStart`,new It),Q(this,`scaleStart`,new B),Q(this,`camera`),Q(this,`object`),Q(this,`enabled`,!0),Q(this,`axis`,null),Q(this,`mode`,`translate`),Q(this,`translationSnap`,null),Q(this,`rotationSnap`,null),Q(this,`scaleSnap`,null),Q(this,`space`,`world`),Q(this,`size`,1),Q(this,`dragging`,!1),Q(this,`showX`,!0),Q(this,`showY`,!0),Q(this,`showZ`,!0),Q(this,`changeEvent`,{type:`change`}),Q(this,`mouseDownEvent`,{type:`mouseDown`,mode:this.mode}),Q(this,`mouseUpEvent`,{type:`mouseUp`,mode:this.mode}),Q(this,`objectChangeEvent`,{type:`objectChange`}),Q(this,`intersectObjectWithRay`,(e,t,n)=>{let r=t.intersectObject(e,!0);for(let e=0;e(this.object=e,this.visible=!0,this)),Q(this,`detach`,()=>(this.object=void 0,this.visible=!1,this.axis=null,this)),Q(this,`reset`,()=>(this.enabled&&this.dragging&&this.object!==void 0&&(this.object.position.copy(this.positionStart),this.object.quaternion.copy(this.quaternionStart),this.object.scale.copy(this.scaleStart),this.dispatchEvent(this.changeEvent),this.dispatchEvent(this.objectChangeEvent),this.pointStart.copy(this.pointEnd)),this)),Q(this,`updateMatrixWorld`,()=>{this.object!==void 0&&(this.object.updateMatrixWorld(),this.object.parent===null?console.error(`TransformControls: The attached 3D object must be a part of the scene graph.`):this.object.parent.matrixWorld.decompose(this.parentPosition,this.parentQuaternion,this.parentScale),this.object.matrixWorld.decompose(this.worldPosition,this.worldQuaternion,this.worldScale),this.parentQuaternionInv.copy(this.parentQuaternion).invert(),this.worldQuaternionInv.copy(this.worldQuaternion).invert()),this.camera.updateMatrixWorld(),this.camera.matrixWorld.decompose(this.cameraPosition,this.cameraQuaternion,this.cameraScale),this.eye.copy(this.cameraPosition).sub(this.worldPosition).normalize(),super.updateMatrixWorld()}),Q(this,`pointerHover`,e=>{if(this.object===void 0||this.dragging===!0)return;this.raycaster.setFromCamera(e,this.camera);let t=this.intersectObjectWithRay(this.gizmo.picker[this.mode],this.raycaster);t?this.axis=t.object.name:this.axis=null}),Q(this,`pointerDown`,e=>{if(!(this.object===void 0||this.dragging===!0||e.button!==0)&&this.axis!==null){this.raycaster.setFromCamera(e,this.camera);let t=this.intersectObjectWithRay(this.plane,this.raycaster,!0);if(t){let e=this.space;if(this.mode===`scale`?e=`local`:(this.axis===`E`||this.axis===`XYZE`||this.axis===`XYZ`)&&(e=`world`),e===`local`&&this.mode===`rotate`){let e=this.rotationSnap;this.axis===`X`&&e&&(this.object.rotation.x=Math.round(this.object.rotation.x/e)*e),this.axis===`Y`&&e&&(this.object.rotation.y=Math.round(this.object.rotation.y/e)*e),this.axis===`Z`&&e&&(this.object.rotation.z=Math.round(this.object.rotation.z/e)*e)}this.object.updateMatrixWorld(),this.object.parent&&this.object.parent.updateMatrixWorld(),this.positionStart.copy(this.object.position),this.quaternionStart.copy(this.object.quaternion),this.scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this.worldScaleStart),this.pointStart.copy(t.point).sub(this.worldPositionStart)}this.dragging=!0,this.mouseDownEvent.mode=this.mode,this.dispatchEvent(this.mouseDownEvent)}}),Q(this,`pointerMove`,e=>{let t=this.axis,n=this.mode,r=this.object,i=this.space;if(n===`scale`?i=`local`:(t===`E`||t===`XYZE`||t===`XYZ`)&&(i=`world`),r===void 0||t===null||this.dragging===!1||e.button!==-1)return;this.raycaster.setFromCamera(e,this.camera);let a=this.intersectObjectWithRay(this.plane,this.raycaster,!0);if(a){if(this.pointEnd.copy(a.point).sub(this.worldPositionStart),n===`translate`)this.offset.copy(this.pointEnd).sub(this.pointStart),i===`local`&&t!==`XYZ`&&this.offset.applyQuaternion(this.worldQuaternionInv),t.indexOf(`X`)===-1&&(this.offset.x=0),t.indexOf(`Y`)===-1&&(this.offset.y=0),t.indexOf(`Z`)===-1&&(this.offset.z=0),i===`local`&&t!==`XYZ`?this.offset.applyQuaternion(this.quaternionStart).divide(this.parentScale):this.offset.applyQuaternion(this.parentQuaternionInv).divide(this.parentScale),r.position.copy(this.offset).add(this.positionStart),this.translationSnap&&(i===`local`&&(r.position.applyQuaternion(this.tempQuaternion.copy(this.quaternionStart).invert()),t.search(`X`)!==-1&&(r.position.x=Math.round(r.position.x/this.translationSnap)*this.translationSnap),t.search(`Y`)!==-1&&(r.position.y=Math.round(r.position.y/this.translationSnap)*this.translationSnap),t.search(`Z`)!==-1&&(r.position.z=Math.round(r.position.z/this.translationSnap)*this.translationSnap),r.position.applyQuaternion(this.quaternionStart)),i===`world`&&(r.parent&&r.position.add(this.tempVector.setFromMatrixPosition(r.parent.matrixWorld)),t.search(`X`)!==-1&&(r.position.x=Math.round(r.position.x/this.translationSnap)*this.translationSnap),t.search(`Y`)!==-1&&(r.position.y=Math.round(r.position.y/this.translationSnap)*this.translationSnap),t.search(`Z`)!==-1&&(r.position.z=Math.round(r.position.z/this.translationSnap)*this.translationSnap),r.parent&&r.position.sub(this.tempVector.setFromMatrixPosition(r.parent.matrixWorld))));else if(n===`scale`){if(t.search(`XYZ`)!==-1){let e=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(e*=-1),this.tempVector2.set(e,e,e)}else this.tempVector.copy(this.pointStart),this.tempVector2.copy(this.pointEnd),this.tempVector.applyQuaternion(this.worldQuaternionInv),this.tempVector2.applyQuaternion(this.worldQuaternionInv),this.tempVector2.divide(this.tempVector),t.search(`X`)===-1&&(this.tempVector2.x=1),t.search(`Y`)===-1&&(this.tempVector2.y=1),t.search(`Z`)===-1&&(this.tempVector2.z=1);r.scale.copy(this.scaleStart).multiply(this.tempVector2),this.scaleSnap&&this.object&&(t.search(`X`)!==-1&&(this.object.scale.x=Math.round(r.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search(`Y`)!==-1&&(r.scale.y=Math.round(r.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search(`Z`)!==-1&&(r.scale.z=Math.round(r.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(n===`rotate`){this.offset.copy(this.pointEnd).sub(this.pointStart);let e=20/this.worldPosition.distanceTo(this.tempVector.setFromMatrixPosition(this.camera.matrixWorld));t===`E`?(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this.startNorm.copy(this.pointStart).normalize(),this.endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this.endNorm.cross(this.startNorm).dot(this.eye)<0?1:-1):t===`XYZE`?(this.rotationAxis.copy(this.offset).cross(this.eye).normalize(),this.rotationAngle=this.offset.dot(this.tempVector.copy(this.rotationAxis).cross(this.eye))*e):(t===`X`||t===`Y`||t===`Z`)&&(this.rotationAxis.copy(this.unit[t]),this.tempVector.copy(this.unit[t]),i===`local`&&this.tempVector.applyQuaternion(this.worldQuaternion),this.rotationAngle=this.offset.dot(this.tempVector.cross(this.eye).normalize())*e),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),i===`local`&&t!==`E`&&t!==`XYZE`?(r.quaternion.copy(this.quaternionStart),r.quaternion.multiply(this.tempQuaternion.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this.parentQuaternionInv),r.quaternion.copy(this.tempQuaternion.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),r.quaternion.multiply(this.quaternionStart).normalize())}this.dispatchEvent(this.changeEvent),this.dispatchEvent(this.objectChangeEvent)}}),Q(this,`pointerUp`,e=>{e.button===0&&(this.dragging&&this.axis!==null&&(this.mouseUpEvent.mode=this.mode,this.dispatchEvent(this.mouseUpEvent)),this.dragging=!1,this.axis=null)}),Q(this,`getPointer`,e=>{var t;if(this.domElement&&(t=this.domElement.ownerDocument)!=null&&t.pointerLockElement)return{x:0,y:0,button:e.button};{let t=e.changedTouches?e.changedTouches[0]:e,n=this.domElement.getBoundingClientRect();return{x:(t.clientX-n.left)/n.width*2-1,y:-(t.clientY-n.top)/n.height*2+1,button:e.button}}}),Q(this,`onPointerHover`,e=>{if(this.enabled)switch(e.pointerType){case`mouse`:case`pen`:this.pointerHover(this.getPointer(e));break}}),Q(this,`onPointerDown`,e=>{!this.enabled||!this.domElement||(this.domElement.style.touchAction=`none`,this.domElement.ownerDocument.addEventListener(`pointermove`,this.onPointerMove),this.pointerHover(this.getPointer(e)),this.pointerDown(this.getPointer(e)))}),Q(this,`onPointerMove`,e=>{this.enabled&&this.pointerMove(this.getPointer(e))}),Q(this,`onPointerUp`,e=>{!this.enabled||!this.domElement||(this.domElement.style.touchAction=``,this.domElement.ownerDocument.removeEventListener(`pointermove`,this.onPointerMove),this.pointerUp(this.getPointer(e)))}),Q(this,`getMode`,()=>this.mode),Q(this,`setMode`,e=>{this.mode=e}),Q(this,`setTranslationSnap`,e=>{this.translationSnap=e}),Q(this,`setRotationSnap`,e=>{this.rotationSnap=e}),Q(this,`setScaleSnap`,e=>{this.scaleSnap=e}),Q(this,`setSize`,e=>{this.size=e}),Q(this,`setSpace`,e=>{this.space=e}),Q(this,`update`,()=>{console.warn(`THREE.TransformControls: update function has no more functionality and therefore has been deprecated.`)}),Q(this,`connect`,e=>{e===document&&console.error(`THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.`),this.domElement=e,this.domElement.addEventListener(`pointerdown`,this.onPointerDown),this.domElement.addEventListener(`pointermove`,this.onPointerHover),this.domElement.ownerDocument.addEventListener(`pointerup`,this.onPointerUp)}),Q(this,`dispose`,()=>{var e,t,n,r,i,a;(e=this.domElement)==null||e.removeEventListener(`pointerdown`,this.onPointerDown),(t=this.domElement)==null||t.removeEventListener(`pointermove`,this.onPointerHover),(r=(n=this.domElement)?.ownerDocument)==null||r.removeEventListener(`pointermove`,this.onPointerMove),(a=(i=this.domElement)?.ownerDocument)==null||a.removeEventListener(`pointerup`,this.onPointerUp),this.traverse(e=>{let t=e;t.geometry&&t.geometry.dispose(),t.material&&t.material.dispose()})}),this.domElement=t,this.camera=e,this.gizmo=new NB,this.add(this.gizmo),this.plane=new PB,this.add(this.plane);let n=(e,t)=>{let n=t;Object.defineProperty(this,e,{get:function(){return n===void 0?t:n},set:function(t){n!==t&&(n=t,this.plane[e]=t,this.gizmo[e]=t,this.dispatchEvent({type:e+`-changed`,value:t}),this.dispatchEvent(this.changeEvent))}}),this[e]=t,this.plane[e]=t,this.gizmo[e]=t};n(`camera`,this.camera),n(`object`,this.object),n(`enabled`,this.enabled),n(`axis`,this.axis),n(`mode`,this.mode),n(`translationSnap`,this.translationSnap),n(`rotationSnap`,this.rotationSnap),n(`scaleSnap`,this.scaleSnap),n(`space`,this.space),n(`size`,this.size),n(`dragging`,this.dragging),n(`showX`,this.showX),n(`showY`,this.showY),n(`showZ`,this.showZ),n(`worldPosition`,this.worldPosition),n(`worldPositionStart`,this.worldPositionStart),n(`worldQuaternion`,this.worldQuaternion),n(`worldQuaternionStart`,this.worldQuaternionStart),n(`cameraPosition`,this.cameraPosition),n(`cameraQuaternion`,this.cameraQuaternion),n(`pointStart`,this.pointStart),n(`pointEnd`,this.pointEnd),n(`rotationAxis`,this.rotationAxis),n(`rotationAngle`,this.rotationAngle),n(`eye`,this.eye),t!==void 0&&this.connect(t)}},NB=class extends he{constructor(){super(),Q(this,`isTransformControlsGizmo`,!0),Q(this,`type`,`TransformControlsGizmo`),Q(this,`tempVector`,new B(0,0,0)),Q(this,`tempEuler`,new Le),Q(this,`alignVector`,new B(0,1,0)),Q(this,`zeroVector`,new B(0,0,0)),Q(this,`lookAtMatrix`,new wt),Q(this,`tempQuaternion`,new It),Q(this,`tempQuaternion2`,new It),Q(this,`identityQuaternion`,new It),Q(this,`unitX`,new B(1,0,0)),Q(this,`unitY`,new B(0,1,0)),Q(this,`unitZ`,new B(0,0,1)),Q(this,`gizmo`),Q(this,`picker`),Q(this,`helper`),Q(this,`rotationAxis`,new B),Q(this,`cameraPosition`,new B),Q(this,`worldPositionStart`,new B),Q(this,`worldQuaternionStart`,new It),Q(this,`worldPosition`,new B),Q(this,`worldQuaternion`,new It),Q(this,`eye`,new B),Q(this,`camera`,null),Q(this,`enabled`,!0),Q(this,`axis`,null),Q(this,`mode`,`translate`),Q(this,`space`,`world`),Q(this,`size`,1),Q(this,`dragging`,!1),Q(this,`showX`,!0),Q(this,`showY`,!0),Q(this,`showZ`,!0),Q(this,`updateMatrixWorld`,()=>{let e=this.space;this.mode===`scale`&&(e=`local`);let t=e===`local`?this.worldQuaternion:this.identityQuaternion;this.gizmo.translate.visible=this.mode===`translate`,this.gizmo.rotate.visible=this.mode===`rotate`,this.gizmo.scale.visible=this.mode===`scale`,this.helper.translate.visible=this.mode===`translate`,this.helper.rotate.visible=this.mode===`rotate`,this.helper.scale.visible=this.mode===`scale`;let n=[];n=n.concat(this.picker[this.mode].children),n=n.concat(this.gizmo[this.mode].children),n=n.concat(this.helper[this.mode].children);for(let e=0;e.9&&(r.visible=!1)),this.axis===`Y`&&(this.tempQuaternion.setFromEuler(this.tempEuler.set(0,0,Math.PI/2)),r.quaternion.copy(t).multiply(this.tempQuaternion),Math.abs(this.alignVector.copy(this.unitY).applyQuaternion(t).dot(this.eye))>.9&&(r.visible=!1)),this.axis===`Z`&&(this.tempQuaternion.setFromEuler(this.tempEuler.set(0,Math.PI/2,0)),r.quaternion.copy(t).multiply(this.tempQuaternion),Math.abs(this.alignVector.copy(this.unitZ).applyQuaternion(t).dot(this.eye))>.9&&(r.visible=!1)),this.axis===`XYZE`&&(this.tempQuaternion.setFromEuler(this.tempEuler.set(0,Math.PI/2,0)),this.alignVector.copy(this.rotationAxis),r.quaternion.setFromRotationMatrix(this.lookAtMatrix.lookAt(this.zeroVector,this.alignVector,this.unitY)),r.quaternion.multiply(this.tempQuaternion),r.visible=this.dragging),this.axis===`E`&&(r.visible=!1)):r.name===`START`?(r.position.copy(this.worldPositionStart),r.visible=this.dragging):r.name===`END`?(r.position.copy(this.worldPosition),r.visible=this.dragging):r.name===`DELTA`?(r.position.copy(this.worldPositionStart),r.quaternion.copy(this.worldQuaternionStart),this.tempVector.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),this.tempVector.applyQuaternion(this.worldQuaternionStart.clone().invert()),r.scale.copy(this.tempVector),r.visible=this.dragging):(r.quaternion.copy(t),this.dragging?r.position.copy(this.worldPositionStart):r.position.copy(this.worldPosition),this.axis&&(r.visible=this.axis.search(r.name)!==-1));continue}r.quaternion.copy(t),this.mode===`translate`||this.mode===`scale`?((r.name===`X`||r.name===`XYZX`)&&Math.abs(this.alignVector.copy(this.unitX).applyQuaternion(t).dot(this.eye))>.99&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),(r.name===`Y`||r.name===`XYZY`)&&Math.abs(this.alignVector.copy(this.unitY).applyQuaternion(t).dot(this.eye))>.99&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),(r.name===`Z`||r.name===`XYZZ`)&&Math.abs(this.alignVector.copy(this.unitZ).applyQuaternion(t).dot(this.eye))>.99&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name===`XY`&&Math.abs(this.alignVector.copy(this.unitZ).applyQuaternion(t).dot(this.eye))<.2&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name===`YZ`&&Math.abs(this.alignVector.copy(this.unitX).applyQuaternion(t).dot(this.eye))<.2&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name===`XZ`&&Math.abs(this.alignVector.copy(this.unitY).applyQuaternion(t).dot(this.eye))<.2&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name.search(`X`)!==-1&&(this.alignVector.copy(this.unitX).applyQuaternion(t).dot(this.eye)<0?r.tag===`fwd`?r.visible=!1:r.scale.x*=-1:r.tag===`bwd`&&(r.visible=!1)),r.name.search(`Y`)!==-1&&(this.alignVector.copy(this.unitY).applyQuaternion(t).dot(this.eye)<0?r.tag===`fwd`?r.visible=!1:r.scale.y*=-1:r.tag===`bwd`&&(r.visible=!1)),r.name.search(`Z`)!==-1&&(this.alignVector.copy(this.unitZ).applyQuaternion(t).dot(this.eye)<0?r.tag===`fwd`?r.visible=!1:r.scale.z*=-1:r.tag===`bwd`&&(r.visible=!1))):this.mode===`rotate`&&(this.tempQuaternion2.copy(t),this.alignVector.copy(this.eye).applyQuaternion(this.tempQuaternion.copy(t).invert()),r.name.search(`E`)!==-1&&r.quaternion.setFromRotationMatrix(this.lookAtMatrix.lookAt(this.eye,this.zeroVector,this.unitY)),r.name===`X`&&(this.tempQuaternion.setFromAxisAngle(this.unitX,Math.atan2(-this.alignVector.y,this.alignVector.z)),this.tempQuaternion.multiplyQuaternions(this.tempQuaternion2,this.tempQuaternion),r.quaternion.copy(this.tempQuaternion)),r.name===`Y`&&(this.tempQuaternion.setFromAxisAngle(this.unitY,Math.atan2(this.alignVector.x,this.alignVector.z)),this.tempQuaternion.multiplyQuaternions(this.tempQuaternion2,this.tempQuaternion),r.quaternion.copy(this.tempQuaternion)),r.name===`Z`&&(this.tempQuaternion.setFromAxisAngle(this.unitZ,Math.atan2(this.alignVector.y,this.alignVector.x)),this.tempQuaternion.multiplyQuaternions(this.tempQuaternion2,this.tempQuaternion),r.quaternion.copy(this.tempQuaternion))),r.visible=r.visible&&(r.name.indexOf(`X`)===-1||this.showX),r.visible=r.visible&&(r.name.indexOf(`Y`)===-1||this.showY),r.visible=r.visible&&(r.name.indexOf(`Z`)===-1||this.showZ),r.visible=r.visible&&(r.name.indexOf(`E`)===-1||this.showX&&this.showY&&this.showZ),r.material.tempOpacity=r.material.tempOpacity||r.material.opacity,r.material.tempColor=r.material.tempColor||r.material.color.clone(),r.material.color.copy(r.material.tempColor),r.material.opacity=r.material.tempOpacity,this.enabled?this.axis&&(r.name===this.axis||this.axis.split(``).some(function(e){return r.name===e})?(r.material.opacity=1,r.material.color.lerp(new me(1,1,1),.5)):(r.material.opacity*=.25,r.material.color.lerp(new me(1,1,1),.5))):(r.material.opacity*=.5,r.material.color.lerp(new me(1,1,1),.5))}super.updateMatrixWorld()});let e=new mt({depthTest:!1,depthWrite:!1,transparent:!0,side:ze,fog:!1,toneMapped:!1}),t=new M({depthTest:!1,depthWrite:!1,transparent:!0,linewidth:1,fog:!1,toneMapped:!1}),n=e.clone();n.opacity=.15;let r=e.clone();r.opacity=.33;let i=e.clone();i.color.set(16711680);let a=e.clone();a.color.set(65280);let o=e.clone();o.color.set(255);let s=e.clone();s.opacity=.25;let c=s.clone();c.color.set(16776960);let l=s.clone();l.color.set(65535);let u=s.clone();u.color.set(16711935),e.clone().color.set(16776960);let d=t.clone();d.color.set(16711680);let f=t.clone();f.color.set(65280);let p=t.clone();p.color.set(255);let m=t.clone();m.color.set(65535);let h=t.clone();h.color.set(16711935);let g=t.clone();g.color.set(16776960);let _=t.clone();_.color.set(7895160);let v=g.clone();v.opacity=.25;let y=new Kt(0,.05,.2,12,1,!1),b=new pt(.125,.125,.125),x=new tt;x.setAttribute(`position`,new de([0,0,0,1,0,0],3));let S=(e,t)=>{let n=new tt,r=[];for(let n=0;n<=64*t;++n)r.push(0,Math.cos(n/32*Math.PI)*e,Math.sin(n/32*Math.PI)*e);return n.setAttribute(`position`,new de(r,3)),n},C=()=>{let e=new tt;return e.setAttribute(`position`,new de([0,0,0,1,1,1],3)),e},w={X:[[new V(y,i),[1,0,0],[0,0,-Math.PI/2],null,`fwd`],[new V(y,i),[1,0,0],[0,0,Math.PI/2],null,`bwd`],[new Xe(x,d)]],Y:[[new V(y,a),[0,1,0],null,null,`fwd`],[new V(y,a),[0,1,0],[Math.PI,0,0],null,`bwd`],[new Xe(x,f),null,[0,0,Math.PI/2]]],Z:[[new V(y,o),[0,0,1],[Math.PI/2,0,0],null,`fwd`],[new V(y,o),[0,0,1],[-Math.PI/2,0,0],null,`bwd`],[new Xe(x,p),null,[0,-Math.PI/2,0]]],XYZ:[[new V(new L(.1,0),s.clone()),[0,0,0],[0,0,0]]],XY:[[new V(new qe(.295,.295),c.clone()),[.15,.15,0]],[new Xe(x,g),[.18,.3,0],null,[.125,1,1]],[new Xe(x,g),[.3,.18,0],[0,0,Math.PI/2],[.125,1,1]]],YZ:[[new V(new qe(.295,.295),l.clone()),[0,.15,.15],[0,Math.PI/2,0]],[new Xe(x,m),[0,.18,.3],[0,0,Math.PI/2],[.125,1,1]],[new Xe(x,m),[0,.3,.18],[0,-Math.PI/2,0],[.125,1,1]]],XZ:[[new V(new qe(.295,.295),u.clone()),[.15,0,.15],[-Math.PI/2,0,0]],[new Xe(x,h),[.18,0,.3],null,[.125,1,1]],[new Xe(x,h),[.3,0,.18],[0,-Math.PI/2,0],[.125,1,1]]]},T={X:[[new V(new Kt(.2,0,1,4,1,!1),n),[.6,0,0],[0,0,-Math.PI/2]]],Y:[[new V(new Kt(.2,0,1,4,1,!1),n),[0,.6,0]]],Z:[[new V(new Kt(.2,0,1,4,1,!1),n),[0,0,.6],[Math.PI/2,0,0]]],XYZ:[[new V(new L(.2,0),n)]],XY:[[new V(new qe(.4,.4),n),[.2,.2,0]]],YZ:[[new V(new qe(.4,.4),n),[0,.2,.2],[0,Math.PI/2,0]]],XZ:[[new V(new qe(.4,.4),n),[.2,0,.2],[-Math.PI/2,0,0]]]},E={START:[[new V(new L(.01,2),r),null,null,null,`helper`]],END:[[new V(new L(.01,2),r),null,null,null,`helper`]],DELTA:[[new Xe(C(),r),null,null,null,`helper`]],X:[[new Xe(x,r.clone()),[-1e3,0,0],null,[1e6,1,1],`helper`]],Y:[[new Xe(x,r.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],`helper`]],Z:[[new Xe(x,r.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],`helper`]]},D={X:[[new Xe(S(1,.5),d)],[new V(new L(.04,0),i),[0,0,.99],null,[1,3,1]]],Y:[[new Xe(S(1,.5),f),null,[0,0,-Math.PI/2]],[new V(new L(.04,0),a),[0,0,.99],null,[3,1,1]]],Z:[[new Xe(S(1,.5),p),null,[0,Math.PI/2,0]],[new V(new L(.04,0),o),[.99,0,0],null,[1,3,1]]],E:[[new Xe(S(1.25,1),v),null,[0,Math.PI/2,0]],[new V(new Kt(.03,0,.15,4,1,!1),v),[1.17,0,0],[0,0,-Math.PI/2],[1,1,.001]],[new V(new Kt(.03,0,.15,4,1,!1),v),[-1.17,0,0],[0,0,Math.PI/2],[1,1,.001]],[new V(new Kt(.03,0,.15,4,1,!1),v),[0,-1.17,0],[Math.PI,0,0],[1,1,.001]],[new V(new Kt(.03,0,.15,4,1,!1),v),[0,1.17,0],[0,0,0],[1,1,.001]]],XYZE:[[new Xe(S(1,1),_),null,[0,Math.PI/2,0]]]},O={AXIS:[[new Xe(x,r.clone()),[-1e3,0,0],null,[1e6,1,1],`helper`]]},k={X:[[new V(new He(1,.1,4,24),n),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new V(new He(1,.1,4,24),n),[0,0,0],[Math.PI/2,0,0]]],Z:[[new V(new He(1,.1,4,24),n),[0,0,0],[0,0,-Math.PI/2]]],E:[[new V(new He(1.25,.1,2,24),n)]],XYZE:[[new V(new Mt(.7,10,8),n)]]},A={X:[[new V(b,i),[.8,0,0],[0,0,-Math.PI/2]],[new Xe(x,d),null,null,[.8,1,1]]],Y:[[new V(b,a),[0,.8,0]],[new Xe(x,f),null,[0,0,Math.PI/2],[.8,1,1]]],Z:[[new V(b,o),[0,0,.8],[Math.PI/2,0,0]],[new Xe(x,p),null,[0,-Math.PI/2,0],[.8,1,1]]],XY:[[new V(b,c),[.85,.85,0],null,[2,2,.2]],[new Xe(x,g),[.855,.98,0],null,[.125,1,1]],[new Xe(x,g),[.98,.855,0],[0,0,Math.PI/2],[.125,1,1]]],YZ:[[new V(b,l),[0,.85,.85],null,[.2,2,2]],[new Xe(x,m),[0,.855,.98],[0,0,Math.PI/2],[.125,1,1]],[new Xe(x,m),[0,.98,.855],[0,-Math.PI/2,0],[.125,1,1]]],XZ:[[new V(b,u),[.85,0,.85],null,[2,.2,2]],[new Xe(x,h),[.855,0,.98],null,[.125,1,1]],[new Xe(x,h),[.98,0,.855],[0,-Math.PI/2,0],[.125,1,1]]],XYZX:[[new V(new pt(.125,.125,.125),s.clone()),[1.1,0,0]]],XYZY:[[new V(new pt(.125,.125,.125),s.clone()),[0,1.1,0]]],XYZZ:[[new V(new pt(.125,.125,.125),s.clone()),[0,0,1.1]]]},j={X:[[new V(new Kt(.2,0,.8,4,1,!1),n),[.5,0,0],[0,0,-Math.PI/2]]],Y:[[new V(new Kt(.2,0,.8,4,1,!1),n),[0,.5,0]]],Z:[[new V(new Kt(.2,0,.8,4,1,!1),n),[0,0,.5],[Math.PI/2,0,0]]],XY:[[new V(b,n),[.85,.85,0],null,[3,3,.2]]],YZ:[[new V(b,n),[0,.85,.85],null,[.2,3,3]]],XZ:[[new V(b,n),[.85,0,.85],null,[3,.2,3]]],XYZX:[[new V(new pt(.2,.2,.2),n),[1.1,0,0]]],XYZY:[[new V(new pt(.2,.2,.2),n),[0,1.1,0]]],XYZZ:[[new V(new pt(.2,.2,.2),n),[0,0,1.1]]]},N={X:[[new Xe(x,r.clone()),[-1e3,0,0],null,[1e6,1,1],`helper`]],Y:[[new Xe(x,r.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],`helper`]],Z:[[new Xe(x,r.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],`helper`]]},ee=e=>{let t=new he;for(let n in e)for(let r=e[n].length;r--;){let i=e[n][r][0].clone(),a=e[n][r][1],o=e[n][r][2],s=e[n][r][3],c=e[n][r][4];i.name=n,i.tag=c,a&&i.position.set(a[0],a[1],a[2]),o&&i.rotation.set(o[0],o[1],o[2]),s&&i.scale.set(s[0],s[1],s[2]),i.updateMatrix();let l=i.geometry.clone();l.applyMatrix4(i.matrix),i.geometry=l,i.renderOrder=1/0,i.position.set(0,0,0),i.rotation.set(0,0,0),i.scale.set(1,1,1),t.add(i)}return t};this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=ee(w)),this.add(this.gizmo.rotate=ee(D)),this.add(this.gizmo.scale=ee(A)),this.add(this.picker.translate=ee(T)),this.add(this.picker.rotate=ee(k)),this.add(this.picker.scale=ee(j)),this.add(this.helper.translate=ee(E)),this.add(this.helper.rotate=ee(O)),this.add(this.helper.scale=ee(N)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1}},PB=class extends V{constructor(){super(new qe(1e5,1e5,2,2),new mt({visible:!1,wireframe:!0,side:ze,transparent:!0,opacity:.1,toneMapped:!1})),Q(this,`isTransformControlsPlane`,!0),Q(this,`type`,`TransformControlsPlane`),Q(this,`unitX`,new B(1,0,0)),Q(this,`unitY`,new B(0,1,0)),Q(this,`unitZ`,new B(0,0,1)),Q(this,`tempVector`,new B),Q(this,`dirVector`,new B),Q(this,`alignVector`,new B),Q(this,`tempMatrix`,new wt),Q(this,`identityQuaternion`,new It),Q(this,`cameraQuaternion`,new It),Q(this,`worldPosition`,new B),Q(this,`worldQuaternion`,new It),Q(this,`eye`,new B),Q(this,`axis`,null),Q(this,`mode`,`translate`),Q(this,`space`,`world`),Q(this,`updateMatrixWorld`,()=>{let e=this.space;switch(this.position.copy(this.worldPosition),this.mode===`scale`&&(e=`local`),this.unitX.set(1,0,0).applyQuaternion(e===`local`?this.worldQuaternion:this.identityQuaternion),this.unitY.set(0,1,0).applyQuaternion(e===`local`?this.worldQuaternion:this.identityQuaternion),this.unitZ.set(0,0,1).applyQuaternion(e===`local`?this.worldQuaternion:this.identityQuaternion),this.alignVector.copy(this.unitY),this.mode){case`translate`:case`scale`:switch(this.axis){case`X`:this.alignVector.copy(this.eye).cross(this.unitX),this.dirVector.copy(this.unitX).cross(this.alignVector);break;case`Y`:this.alignVector.copy(this.eye).cross(this.unitY),this.dirVector.copy(this.unitY).cross(this.alignVector);break;case`Z`:this.alignVector.copy(this.eye).cross(this.unitZ),this.dirVector.copy(this.unitZ).cross(this.alignVector);break;case`XY`:this.dirVector.copy(this.unitZ);break;case`YZ`:this.dirVector.copy(this.unitX);break;case`XZ`:this.alignVector.copy(this.unitZ),this.dirVector.copy(this.unitY);break;case`XYZ`:case`E`:this.dirVector.set(0,0,0);break}break;case`rotate`:default:this.dirVector.set(0,0,0)}this.dirVector.length()===0?this.quaternion.copy(this.cameraQuaternion):(this.tempMatrix.lookAt(this.tempVector.set(0,0,0),this.dirVector,this.alignVector),this.quaternion.setFromRotationMatrix(this.tempMatrix)),super.updateMatrixWorld()})}},FB=Object.defineProperty,IB=(e,t,n)=>t in e?FB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,LB=(e,t,n)=>(IB(e,typeof t==`symbol`?t:t+``,n),n);const RB=new Le(0,0,0,`YXZ`),zB=new B,BB={type:`change`},VB={type:`lock`},HB={type:`unlock`},UB=Math.PI/2;var WB=class extends Je{constructor(e,t){super(),LB(this,`camera`),LB(this,`domElement`),LB(this,`isLocked`),LB(this,`minPolarAngle`),LB(this,`maxPolarAngle`),LB(this,`pointerSpeed`),LB(this,`onMouseMove`,e=>{if(!this.domElement||this.isLocked===!1)return;let t=e.movementX||e.mozMovementX||e.webkitMovementX||0,n=e.movementY||e.mozMovementY||e.webkitMovementY||0;RB.setFromQuaternion(this.camera.quaternion),RB.y-=t*.002*this.pointerSpeed,RB.x-=n*.002*this.pointerSpeed,RB.x=Math.max(UB-this.maxPolarAngle,Math.min(UB-this.minPolarAngle,RB.x)),this.camera.quaternion.setFromEuler(RB),this.dispatchEvent(BB)}),LB(this,`onPointerlockChange`,()=>{this.domElement&&(this.domElement.ownerDocument.pointerLockElement===this.domElement?(this.dispatchEvent(VB),this.isLocked=!0):(this.dispatchEvent(HB),this.isLocked=!1))}),LB(this,`onPointerlockError`,()=>{console.error(`THREE.PointerLockControls: Unable to use Pointer Lock API`)}),LB(this,`connect`,e=>{this.domElement=e||this.domElement,this.domElement&&(this.domElement.ownerDocument.addEventListener(`mousemove`,this.onMouseMove),this.domElement.ownerDocument.addEventListener(`pointerlockchange`,this.onPointerlockChange),this.domElement.ownerDocument.addEventListener(`pointerlockerror`,this.onPointerlockError))}),LB(this,`disconnect`,()=>{this.domElement&&(this.domElement.ownerDocument.removeEventListener(`mousemove`,this.onMouseMove),this.domElement.ownerDocument.removeEventListener(`pointerlockchange`,this.onPointerlockChange),this.domElement.ownerDocument.removeEventListener(`pointerlockerror`,this.onPointerlockError))}),LB(this,`dispose`,()=>{this.disconnect()}),LB(this,`getObject`,()=>this.camera),LB(this,`direction`,new B(0,0,-1)),LB(this,`getDirection`,e=>e.copy(this.direction).applyQuaternion(this.camera.quaternion)),LB(this,`moveForward`,e=>{zB.setFromMatrixColumn(this.camera.matrix,0),zB.crossVectors(this.camera.up,zB),this.camera.position.addScaledVector(zB,e)}),LB(this,`moveRight`,e=>{zB.setFromMatrixColumn(this.camera.matrix,0),this.camera.position.addScaledVector(zB,e)}),LB(this,`lock`,()=>{this.domElement&&this.domElement.requestPointerLock()}),LB(this,`unlock`,()=>{this.domElement&&this.domElement.ownerDocument.exitPointerLock()}),this.camera=e,this.domElement=t,this.isLocked=!1,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.pointerSpeed=1,t&&this.connect(t)}},GB=Object.defineProperty,KB=(e,t,n)=>t in e?GB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qB=(e,t,n)=>(KB(e,typeof t==`symbol`?t:t+``,n),n);const JB=new Ve,YB=new Nt,XB=Math.cos(70*(Math.PI/180)),ZB=(e,t)=>(e%t+t)%t;var QB=class extends Je{constructor(e,t){super(),qB(this,`object`),qB(this,`domElement`),qB(this,`enabled`,!0),qB(this,`target`,new B),qB(this,`minDistance`,0),qB(this,`maxDistance`,1/0),qB(this,`minZoom`,0),qB(this,`maxZoom`,1/0),qB(this,`minPolarAngle`,0),qB(this,`maxPolarAngle`,Math.PI),qB(this,`minAzimuthAngle`,-1/0),qB(this,`maxAzimuthAngle`,1/0),qB(this,`enableDamping`,!1),qB(this,`dampingFactor`,.05),qB(this,`enableZoom`,!0),qB(this,`zoomSpeed`,1),qB(this,`enableRotate`,!0),qB(this,`rotateSpeed`,1),qB(this,`enablePan`,!0),qB(this,`panSpeed`,1),qB(this,`screenSpacePanning`,!0),qB(this,`keyPanSpeed`,7),qB(this,`zoomToCursor`,!1),qB(this,`autoRotate`,!1),qB(this,`autoRotateSpeed`,2),qB(this,`reverseOrbit`,!1),qB(this,`reverseHorizontalOrbit`,!1),qB(this,`reverseVerticalOrbit`,!1),qB(this,`keys`,{LEFT:`ArrowLeft`,UP:`ArrowUp`,RIGHT:`ArrowRight`,BOTTOM:`ArrowDown`}),qB(this,`mouseButtons`,{LEFT:jt.ROTATE,MIDDLE:jt.DOLLY,RIGHT:jt.PAN}),qB(this,`touches`,{ONE:Pt.ROTATE,TWO:Pt.DOLLY_PAN}),qB(this,`target0`),qB(this,`position0`),qB(this,`zoom0`),qB(this,`_domElementKeyEvents`,null),qB(this,`getPolarAngle`),qB(this,`getAzimuthalAngle`),qB(this,`setPolarAngle`),qB(this,`setAzimuthalAngle`),qB(this,`getDistance`),qB(this,`getZoomScale`),qB(this,`listenToKeyEvents`),qB(this,`stopListenToKeyEvents`),qB(this,`saveState`),qB(this,`reset`),qB(this,`update`),qB(this,`connect`),qB(this,`dispose`),qB(this,`dollyIn`),qB(this,`dollyOut`),qB(this,`getScale`),qB(this,`setScale`),this.object=e,this.domElement=t,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=()=>l.phi,this.getAzimuthalAngle=()=>l.theta,this.setPolarAngle=e=>{let t=ZB(e,2*Math.PI),r=l.phi;r<0&&(r+=2*Math.PI),t<0&&(t+=2*Math.PI);let i=Math.abs(t-r);2*Math.PI-i{let t=ZB(e,2*Math.PI),r=l.theta;r<0&&(r+=2*Math.PI),t<0&&(t+=2*Math.PI);let i=Math.abs(t-r);2*Math.PI-in.object.position.distanceTo(n.target),this.listenToKeyEvents=e=>{e.addEventListener(`keydown`,we),this._domElementKeyEvents=e},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener(`keydown`,we),this._domElementKeyEvents=null},this.saveState=()=>{n.target0.copy(n.target),n.position0.copy(n.object.position),n.zoom0=n.object.zoom},this.reset=()=>{n.target.copy(n.target0),n.object.position.copy(n.position0),n.object.zoom=n.zoom0,n.object.updateProjectionMatrix(),n.dispatchEvent(r),n.update(),s=o.NONE},this.update=(()=>{let t=new B,i=new B(0,1,0),a=new It().setFromUnitVectors(e.up,i),p=a.clone().invert(),m=new B,h=new It,g=2*Math.PI;return function(){let _=n.object.position;a.setFromUnitVectors(e.up,i),p.copy(a).invert(),t.copy(_).sub(n.target),t.applyQuaternion(a),l.setFromVector3(t),n.autoRotate&&s===o.NONE&&k(D()),n.enableDamping?(l.theta+=u.theta*n.dampingFactor,l.phi+=u.phi*n.dampingFactor):(l.theta+=u.theta,l.phi+=u.phi);let v=n.minAzimuthAngle,y=n.maxAzimuthAngle;isFinite(v)&&isFinite(y)&&(v<-Math.PI?v+=g:v>Math.PI&&(v-=g),y<-Math.PI?y+=g:y>Math.PI&&(y-=g),v<=y?l.theta=Math.max(v,Math.min(y,l.theta)):l.theta=l.theta>(v+y)/2?Math.max(v,l.theta):Math.min(y,l.theta)),l.phi=Math.max(n.minPolarAngle,Math.min(n.maxPolarAngle,l.phi)),l.makeSafe(),n.enableDamping===!0?n.target.addScaledVector(f,n.dampingFactor):n.target.add(f),n.zoomToCursor&&w||n.object.isOrthographicCamera?l.radius=te(l.radius):l.radius=te(l.radius*d),t.setFromSpherical(l),t.applyQuaternion(p),_.copy(n.target).add(t),n.object.matrixAutoUpdate||n.object.updateMatrix(),n.object.lookAt(n.target),n.enableDamping===!0?(u.theta*=1-n.dampingFactor,u.phi*=1-n.dampingFactor,f.multiplyScalar(1-n.dampingFactor)):(u.set(0,0,0),f.set(0,0,0));let b=!1;if(n.zoomToCursor&&w){let r=null;if(n.object instanceof Ge&&n.object.isPerspectiveCamera){let e=t.length();r=te(e*d);let i=e-r;n.object.position.addScaledVector(S,i),n.object.updateMatrixWorld()}else if(n.object.isOrthographicCamera){let e=new B(C.x,C.y,0);e.unproject(n.object),n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/d)),n.object.updateProjectionMatrix(),b=!0;let i=new B(C.x,C.y,0);i.unproject(n.object),n.object.position.sub(i).add(e),n.object.updateMatrixWorld(),r=t.length()}else console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled.`),n.zoomToCursor=!1;r!==null&&(n.screenSpacePanning?n.target.set(0,0,-1).transformDirection(n.object.matrix).multiplyScalar(r).add(n.object.position):(JB.origin.copy(n.object.position),JB.direction.set(0,0,-1).transformDirection(n.object.matrix),Math.abs(n.object.up.dot(JB.direction))c||8*(1-h.dot(n.object.quaternion))>c?(n.dispatchEvent(r),m.copy(n.object.position),h.copy(n.object.quaternion),b=!1,!0):!1}})(),this.connect=e=>{n.domElement=e,n.domElement.style.touchAction=`none`,n.domElement.addEventListener(`contextmenu`,De),n.domElement.addEventListener(`pointerdown`,ve),n.domElement.addEventListener(`pointercancel`,be),n.domElement.addEventListener(`wheel`,Ce)},this.dispose=()=>{var e,t,r,i,a,o;n.domElement&&(n.domElement.style.touchAction=`auto`),(e=n.domElement)==null||e.removeEventListener(`contextmenu`,De),(t=n.domElement)==null||t.removeEventListener(`pointerdown`,ve),(r=n.domElement)==null||r.removeEventListener(`pointercancel`,be),(i=n.domElement)==null||i.removeEventListener(`wheel`,Ce),(a=n.domElement)==null||a.ownerDocument.removeEventListener(`pointermove`,ye),(o=n.domElement)==null||o.ownerDocument.removeEventListener(`pointerup`,be),n._domElementKeyEvents!==null&&n._domElementKeyEvents.removeEventListener(`keydown`,we)};let n=this,r={type:`change`},i={type:`start`},a={type:`end`},o={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},s=o.NONE,c=1e-6,l=new Pe,u=new Pe,d=1,f=new B,p=new ct,m=new ct,h=new ct,g=new ct,_=new ct,v=new ct,y=new ct,b=new ct,x=new ct,S=new B,C=new ct,w=!1,T=[],E={};function D(){return 2*Math.PI/60/60*n.autoRotateSpeed}function O(){return .95**n.zoomSpeed}function k(e){n.reverseOrbit||n.reverseHorizontalOrbit?u.theta+=e:u.theta-=e}function A(e){n.reverseOrbit||n.reverseVerticalOrbit?u.phi+=e:u.phi-=e}let j=(()=>{let e=new B;return function(t,n){e.setFromMatrixColumn(n,0),e.multiplyScalar(-t),f.add(e)}})(),M=(()=>{let e=new B;return function(t,r){n.screenSpacePanning===!0?e.setFromMatrixColumn(r,1):(e.setFromMatrixColumn(r,0),e.crossVectors(n.object.up,e)),e.multiplyScalar(t),f.add(e)}})(),ee=(()=>{let e=new B;return function(t,r){let i=n.domElement;if(i&&n.object instanceof Ge&&n.object.isPerspectiveCamera){let a=n.object.position;e.copy(a).sub(n.target);let o=e.length();o*=Math.tan(n.object.fov/2*Math.PI/180),j(2*t*o/i.clientHeight,n.object.matrix),M(2*r*o/i.clientHeight,n.object.matrix)}else i&&n.object instanceof N&&n.object.isOrthographicCamera?(j(t*(n.object.right-n.object.left)/n.object.zoom/i.clientWidth,n.object.matrix),M(r*(n.object.top-n.object.bottom)/n.object.zoom/i.clientHeight,n.object.matrix)):(console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.`),n.enablePan=!1)}})();function P(e){n.object instanceof Ge&&n.object.isPerspectiveCamera||n.object instanceof N&&n.object.isOrthographicCamera?d=e:(console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.`),n.enableZoom=!1)}function F(e){P(d/e)}function I(e){P(d*e)}function L(e){if(!n.zoomToCursor||!n.domElement)return;w=!0;let t=n.domElement.getBoundingClientRect(),r=e.clientX-t.left,i=e.clientY-t.top,a=t.width,o=t.height;C.x=r/a*2-1,C.y=-(i/o)*2+1,S.set(C.x,C.y,1).unproject(n.object).sub(n.object.position).normalize()}function te(e){return Math.max(n.minDistance,Math.min(n.maxDistance,e))}function R(e){p.set(e.clientX,e.clientY)}function ne(e){L(e),y.set(e.clientX,e.clientY)}function z(e){g.set(e.clientX,e.clientY)}function re(e){m.set(e.clientX,e.clientY),h.subVectors(m,p).multiplyScalar(n.rotateSpeed);let t=n.domElement;t&&(k(2*Math.PI*h.x/t.clientHeight),A(2*Math.PI*h.y/t.clientHeight)),p.copy(m),n.update()}function ie(e){b.set(e.clientX,e.clientY),x.subVectors(b,y),x.y>0?F(O()):x.y<0&&I(O()),y.copy(b),n.update()}function ae(e){_.set(e.clientX,e.clientY),v.subVectors(_,g).multiplyScalar(n.panSpeed),ee(v.x,v.y),g.copy(_),n.update()}function oe(e){L(e),e.deltaY<0?I(O()):e.deltaY>0&&F(O()),n.update()}function se(e){let t=!1;switch(e.code){case n.keys.UP:ee(0,n.keyPanSpeed),t=!0;break;case n.keys.BOTTOM:ee(0,-n.keyPanSpeed),t=!0;break;case n.keys.LEFT:ee(n.keyPanSpeed,0),t=!0;break;case n.keys.RIGHT:ee(-n.keyPanSpeed,0),t=!0;break}t&&(e.preventDefault(),n.update())}function ce(){if(T.length==1)p.set(T[0].pageX,T[0].pageY);else{let e=.5*(T[0].pageX+T[1].pageX),t=.5*(T[0].pageY+T[1].pageY);p.set(e,t)}}function le(){if(T.length==1)g.set(T[0].pageX,T[0].pageY);else{let e=.5*(T[0].pageX+T[1].pageX),t=.5*(T[0].pageY+T[1].pageY);g.set(e,t)}}function ue(){let e=T[0].pageX-T[1].pageX,t=T[0].pageY-T[1].pageY,n=Math.sqrt(e*e+t*t);y.set(0,n)}function de(){n.enableZoom&&ue(),n.enablePan&&le()}function fe(){n.enableZoom&&ue(),n.enableRotate&&ce()}function pe(e){if(T.length==1)m.set(e.pageX,e.pageY);else{let t=je(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);m.set(n,r)}h.subVectors(m,p).multiplyScalar(n.rotateSpeed);let t=n.domElement;t&&(k(2*Math.PI*h.x/t.clientHeight),A(2*Math.PI*h.y/t.clientHeight)),p.copy(m)}function me(e){if(T.length==1)_.set(e.pageX,e.pageY);else{let t=je(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);_.set(n,r)}v.subVectors(_,g).multiplyScalar(n.panSpeed),ee(v.x,v.y),g.copy(_)}function he(e){let t=je(e),r=e.pageX-t.x,i=e.pageY-t.y,a=Math.sqrt(r*r+i*i);b.set(0,a),x.set(0,(b.y/y.y)**+n.zoomSpeed),F(x.y),y.copy(b)}function ge(e){n.enableZoom&&he(e),n.enablePan&&me(e)}function _e(e){n.enableZoom&&he(e),n.enableRotate&&pe(e)}function ve(e){var t,r;n.enabled!==!1&&(T.length===0&&((t=n.domElement)==null||t.ownerDocument.addEventListener(`pointermove`,ye),(r=n.domElement)==null||r.ownerDocument.addEventListener(`pointerup`,be)),Oe(e),e.pointerType===`touch`?Te(e):xe(e))}function ye(e){n.enabled!==!1&&(e.pointerType===`touch`?Ee(e):Se(e))}function be(e){var t,r,i;ke(e),T.length===0&&((t=n.domElement)==null||t.releasePointerCapture(e.pointerId),(r=n.domElement)==null||r.ownerDocument.removeEventListener(`pointermove`,ye),(i=n.domElement)==null||i.ownerDocument.removeEventListener(`pointerup`,be)),n.dispatchEvent(a),s=o.NONE}function xe(e){let t;switch(e.button){case 0:t=n.mouseButtons.LEFT;break;case 1:t=n.mouseButtons.MIDDLE;break;case 2:t=n.mouseButtons.RIGHT;break;default:t=-1}switch(t){case jt.DOLLY:if(n.enableZoom===!1)return;ne(e),s=o.DOLLY;break;case jt.ROTATE:if(e.ctrlKey||e.metaKey||e.shiftKey){if(n.enablePan===!1)return;z(e),s=o.PAN}else{if(n.enableRotate===!1)return;R(e),s=o.ROTATE}break;case jt.PAN:if(e.ctrlKey||e.metaKey||e.shiftKey){if(n.enableRotate===!1)return;R(e),s=o.ROTATE}else{if(n.enablePan===!1)return;z(e),s=o.PAN}break;default:s=o.NONE}s!==o.NONE&&n.dispatchEvent(i)}function Se(e){if(n.enabled!==!1)switch(s){case o.ROTATE:if(n.enableRotate===!1)return;re(e);break;case o.DOLLY:if(n.enableZoom===!1)return;ie(e);break;case o.PAN:if(n.enablePan===!1)return;ae(e);break}}function Ce(e){n.enabled===!1||n.enableZoom===!1||s!==o.NONE&&s!==o.ROTATE||(e.preventDefault(),n.dispatchEvent(i),oe(e),n.dispatchEvent(a))}function we(e){n.enabled===!1||n.enablePan===!1||se(e)}function Te(e){switch(Ae(e),T.length){case 1:switch(n.touches.ONE){case Pt.ROTATE:if(n.enableRotate===!1)return;ce(),s=o.TOUCH_ROTATE;break;case Pt.PAN:if(n.enablePan===!1)return;le(),s=o.TOUCH_PAN;break;default:s=o.NONE}break;case 2:switch(n.touches.TWO){case Pt.DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;de(),s=o.TOUCH_DOLLY_PAN;break;case Pt.DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;fe(),s=o.TOUCH_DOLLY_ROTATE;break;default:s=o.NONE}break;default:s=o.NONE}s!==o.NONE&&n.dispatchEvent(i)}function Ee(e){switch(Ae(e),s){case o.TOUCH_ROTATE:if(n.enableRotate===!1)return;pe(e),n.update();break;case o.TOUCH_PAN:if(n.enablePan===!1)return;me(e),n.update();break;case o.TOUCH_DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;ge(e),n.update();break;case o.TOUCH_DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;_e(e),n.update();break;default:s=o.NONE}}function De(e){n.enabled!==!1&&e.preventDefault()}function Oe(e){T.push(e)}function ke(e){delete E[e.pointerId];for(let t=0;t{I(e),n.update()},this.dollyOut=(e=O())=>{F(e),n.update()},this.getScale=()=>d,this.setScale=e=>{P(e),n.update()},this.getZoomScale=()=>O(),t!==void 0&&this.connect(t),this.update()}},$B=class extends QB{constructor(e,t){super(e,t),this.screenSpacePanning=!1,this.mouseButtons.LEFT=jt.PAN,this.mouseButtons.RIGHT=jt.ROTATE,this.touches.ONE=Pt.PAN,this.touches.TWO=Pt.DOLLY_ROTATE}};const eV=new It,tV={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},nV={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},rV={9728:le,9729:Ze,9984:fe,9985:Dt,9986:_e,9987:Lt},iV={33071:I,33648:ie,10497:P},aV={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},oV={POSITION:`position`,NORMAL:`normal`,TANGENT:`tangent`,...zR>=152?{TEXCOORD_0:`uv`,TEXCOORD_1:`uv1`,TEXCOORD_2:`uv2`,TEXCOORD_3:`uv3`}:{TEXCOORD_0:`uv`,TEXCOORD_1:`uv2`},COLOR_0:`color`,WEIGHTS_0:`skinWeight`,JOINTS_0:`skinIndex`},sV={scale:`scale`,translation:`position`,rotation:`quaternion`,weights:`morphTargetInfluences`},cV={CUBICSPLINE:void 0,LINEAR:Be,STEP:je},lV={OPAQUE:`OPAQUE`,MASK:`MASK`,BLEND:`BLEND`},uV=new wt,dV=new B;function fV(e,t,n,r,i,a){let o=2*Math.PI*i/4,s=Math.max(a-2*i,0),c=Math.PI/4;dV.copy(t),dV[r]=0,dV.normalize();let l=.5*o/(o+s),u=1-dV.angleTo(e)/c;return Math.sign(dV[n])===1?u*l:s/(o+s)+l+l*(1-u)}var pV=class extends pt{constructor(e=1,t=1,n=1,r=2,i=.1){if(r=r*2+1,i=Math.min(e/2,t/2,n/2,i),super(1,1,1,r,r,r),r===1)return;let a=this.toNonIndexed();this.index=null,this.attributes.position=a.attributes.position,this.attributes.normal=a.attributes.normal,this.attributes.uv=a.attributes.uv;let o=new B,s=new B,c=new B(e,t,n).divideScalar(2).subScalar(i),l=this.attributes.position.array,u=this.attributes.normal.array,d=this.attributes.uv.array,f=l.length/6,p=new B,m=.5/r;for(let r=0,a=0;rt in e?yV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,xV=(e,t,n)=>(bV(e,typeof t==`symbol`?t:t+``,n),n),SV=class extends Ut{constructor(e){super(e)}load(e,t,n,r){let i=new de(this.manager);i.setPath(this.path),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials),i.load(e,e=>{if(typeof e!=`string`)throw Error(`unsupported data type`);let n=JSON.parse(e),r=this.parse(n);t&&t(r)},n,r)}loadAsync(e,t){return super.loadAsync(e,t)}parse(e){return new CV(e)}},CV=class{constructor(e){xV(this,`data`),this.data=e}generateShapes(e,t=100,n){let r=[],i={letterSpacing:0,lineHeight:1,...n},a=wV(e,t,this.data,i);for(let e=0,t=a.length;et in e?yV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,xV=(e,t,n)=>(bV(e,typeof t==`symbol`?t:t+``,n),n),SV=class extends Bt{constructor(e){super(e)}load(e,t,n,r){let i=new ue(this.manager);i.setPath(this.path),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials),i.load(e,e=>{if(typeof e!=`string`)throw Error(`unsupported data type`);let n=JSON.parse(e),r=this.parse(n);t&&t(r)},n,r)}loadAsync(e,t){return super.loadAsync(e,t)}parse(e){return new CV(e)}},CV=class{constructor(e){xV(this,`data`),this.data=e}generateShapes(e,t=100,n){let r=[],i={letterSpacing:0,lineHeight:1,...n},a=wV(e,t,this.data,i);for(let e=0,t=a.length;e(a=c.indexOf(n))&&o=e.byteLength||!(l=r(e)))&&t(1,`no header found`),(u=l.match(n))||t(3,`bad initial token`),c.valid|=1,c.programtype=u[1],c.string+=l+` `;l=r(e),l!==!1;){if(c.string+=l+` `,l.charAt(0)===`#`){c.comments+=l+` -`;continue}if((u=l.match(i))&&(c.gamma=parseFloat(u[1])),(u=l.match(a))&&(c.exposure=parseFloat(u[1])),(u=l.match(o))&&(c.valid|=2,c.format=u[1]),(u=l.match(s))&&(c.valid|=4,c.height=parseInt(u[1],10),c.width=parseInt(u[2],10)),c.valid&2&&c.valid&4)break}return c.valid&2||t(3,`missing format specifier`),c.valid&4||t(3,`missing image size specifier`),c},a=function(e,n,r){let i=n;if(i<8||i>32767||e[0]!==2||e[1]!==2||e[2]&128)return new Uint8Array(e);i!==(e[2]<<8|e[3])&&t(3,`wrong scanline width`);let a=new Uint8Array(4*n*r);a.length||t(4,`unable to allocate buffer space`);let o=0,s=0,c=4*i,l=new Uint8Array(4),u=new Uint8Array(c),d=r;for(;d>0&&se.byteLength&&t(1),l[0]=e[s++],l[1]=e[s++],l[2]=e[s++],l[3]=e[s++],(l[0]!=2||l[1]!=2||(l[2]<<8|l[3])!=i)&&t(3,`bad rgbe scanline format`);let n=0,r;for(;n128;if(i&&(r-=128),(r===0||n+r>c)&&t(3,`bad scanline data`),i){let t=e[s++];for(let e=0;e0?F.copy(k[k.length-1]):F.identity())}function r(e){let t=new Re,n=new ut,r=new ut,i=new ut,o=!0,s=!1,c=e.getAttribute(`d`);if(c===``||c===`none`)return null;let l=c.match(/[a-df-z][^a-df-z]*/gi);for(let e=0,c=l.length;e0&&(n.copy(i),t.currentPath.currentPoint.copy(n),o=!0);break;default:console.warn(c)}s=!1}return t}function i(e){if(!(!e.sheet||!e.sheet.cssRules||!e.sheet.cssRules.length))for(let t=0;te.trim());for(let e=0;ee!==``));O[r[e]]=Object.assign(O[r[e]]||{},t)}}}function a(e,t,n,r,i,a,s,c){if(t==0||n==0){e.lineTo(c.x,c.y);return}r=r*Math.PI/180,t=Math.abs(t),n=Math.abs(n);let l=(s.x-c.x)/2,u=(s.y-c.y)/2,d=Math.cos(r)*l+Math.sin(r)*u,f=-Math.sin(r)*l+Math.cos(r)*u,p=t*t,m=n*n,h=d*d,g=f*f,_=h/p+g/m;if(_>1){let e=Math.sqrt(_);t=e*t,n=e*n,p=t*t,m=n*n}let v=p*g+m*h,y=(p*m-v)/v,b=Math.sqrt(Math.max(0,y));i===a&&(b=-b);let x=b*t*f/n,S=-b*n*d/t,C=Math.cos(r)*x-Math.sin(r)*S+(s.x+c.x)/2,w=Math.sin(r)*x+Math.cos(r)*S+(s.y+c.y)/2,T=o(1,0,(d-x)/t,(f-S)/n),E=o((d-x)/t,(f-S)/n,(-d-x)/t,(-f-S)/n)%(Math.PI*2);e.currentPath.absellipse(C,w,t,n,T,T+E,a===0,r)}function o(e,t,n,r){let i=e*n+t*r,a=Math.sqrt(e*e+t*t)*Math.sqrt(n*n+r*r),o=Math.acos(Math.max(-1,Math.min(1,i/a)));return e*r-t*n<0&&(o=-o),o}function s(e){let t=v(e.getAttribute(`x`)||0),n=v(e.getAttribute(`y`)||0),r=v(e.getAttribute(`rx`)||e.getAttribute(`ry`)||0),i=v(e.getAttribute(`ry`)||e.getAttribute(`rx`)||0),a=v(e.getAttribute(`width`)),o=v(e.getAttribute(`height`)),s=.448084975506,c=new Re;return c.moveTo(t+r,n),c.lineTo(t+a-r,n),(r!==0||i!==0)&&c.bezierCurveTo(t+a-r*s,n,t+a,n+i*s,t+a,n+i),c.lineTo(t+a,n+o-i),(r!==0||i!==0)&&c.bezierCurveTo(t+a,n+o-i*s,t+a-r*s,n+o,t+a-r,n+o),c.lineTo(t+r,n+o),(r!==0||i!==0)&&c.bezierCurveTo(t+r*s,n+o,t,n+o-i*s,t,n+o-i),c.lineTo(t,n+i),(r!==0||i!==0)&&c.bezierCurveTo(t,n+i*s,t+r*s,n,t+r,n),c}function c(e){function t(e,t,n){let a=v(t),o=v(n);i===0?r.moveTo(a,o):r.lineTo(a,o),i++}let n=/([+-]?\d*\.?\d+(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g,r=new Re,i=0;return e.getAttribute(`points`).replace(n,t),r.currentPath.autoClose=!0,r}function l(e){function t(e,t,n){let a=v(t),o=v(n);i===0?r.moveTo(a,o):r.lineTo(a,o),i++}let n=/([+-]?\d*\.?\d+(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g,r=new Re,i=0;return e.getAttribute(`points`).replace(n,t),r.currentPath.autoClose=!1,r}function u(e){let t=v(e.getAttribute(`cx`)||0),n=v(e.getAttribute(`cy`)||0),r=v(e.getAttribute(`r`)||0),i=new L;i.absarc(t,n,r,0,Math.PI*2);let a=new Re;return a.subPaths.push(i),a}function d(e){let t=v(e.getAttribute(`cx`)||0),n=v(e.getAttribute(`cy`)||0),r=v(e.getAttribute(`rx`)||0),i=v(e.getAttribute(`ry`)||0),a=new L;a.absellipse(t,n,r,i,0,Math.PI*2);let o=new Re;return o.subPaths.push(a),o}function f(e){let t=v(e.getAttribute(`x1`)||0),n=v(e.getAttribute(`y1`)||0),r=v(e.getAttribute(`x2`)||0),i=v(e.getAttribute(`y2`)||0),a=new Re;return a.moveTo(t,n),a.lineTo(r,i),a.currentPath.autoClose=!1,a}function p(e,t){t=Object.assign({},t);let n={};if(e.hasAttribute(`class`)){let t=e.getAttribute(`class`).split(/\s/).filter(Boolean).map(e=>e.trim());for(let e=0;e0&&t.premultiply(k[k.length-1]),F.copy(t),k.push(t),t}function b(e){let t=new We,n=A;if(e.nodeName===`use`&&(e.hasAttribute(`x`)||e.hasAttribute(`y`))){let n=v(e.getAttribute(`x`)),r=v(e.getAttribute(`y`));t.translate(n,r)}if(e.hasAttribute(`transform`)){let r=e.getAttribute(`transform`).split(`)`);for(let e=r.length-1;e>=0;e--){let i=r[e].trim();if(i===``)continue;let a=i.indexOf(`(`),o=i.length;if(a>0&&a=1){let e=t[0],r=0;t.length>=2&&(r=t[1]),n.translate(e,r)}break;case`rotate`:if(t.length>=1){let e=0,r=0,i=0;e=t[0]*Math.PI/180,t.length>=3&&(r=t[1],i=t[2]),j.makeTranslation(-r,-i),M.makeRotation(e),N.multiplyMatrices(M,j),j.makeTranslation(r,i),n.multiplyMatrices(j,N)}break;case`scale`:if(t.length>=1){let e=t[0],r=e;t.length>=2&&(r=t[1]),n.scale(e,r)}break;case`skewX`:t.length===1&&n.set(1,Math.tan(t[0]*Math.PI/180),0,0,1,0,0,0,1);break;case`skewY`:t.length===1&&n.set(1,0,0,Math.tan(t[0]*Math.PI/180),1,0,0,0,1);break;case`matrix`:t.length===6&&n.set(t[0],t[2],t[4],t[1],t[3],t[5],0,0,1);break}}t.premultiply(n)}}return t}function x(e,t){function n(e){P.set(e.x,e.y,1).applyMatrix3(t),e.set(P.x,P.y)}function r(e){let n=e.xRadius,r=e.yRadius,i=Math.cos(e.aRotation),a=Math.sin(e.aRotation),o=new B(n*i,n*a,0),s=new B(-r*a,r*i,0),c=o.applyMatrix3(t),l=s.applyMatrix3(t),u=A.set(c.x,l.x,0,c.y,l.y,0,0,0,1),d=j.copy(u).invert(),f=M.copy(d).transpose().multiply(d).elements,p=E(f[0],f[1],f[4]),m=Math.sqrt(p.rt1),h=Math.sqrt(p.rt2);if(e.xRadius=1/m,e.yRadius=1/h,e.aRotation=Math.atan2(p.sn,p.cs),!((e.aEndAngle-e.aStartAngle)%(2*Math.PI)<2**-52)){let n=j.set(m,0,0,0,h,0,0,0,1),r=M.set(p.cs,p.sn,0,-p.sn,p.cs,0,0,0,1),i=n.multiply(r).multiply(u),a=e=>{let{x:t,y:n}=new B(Math.cos(e),Math.sin(e),0).applyMatrix3(i);return Math.atan2(n,t)};e.aStartAngle=a(e.aStartAngle),e.aEndAngle=a(e.aEndAngle),S(t)&&(e.aClockwise=!e.aClockwise)}}function i(e){let n=w(t),r=T(t);e.xRadius*=n,e.yRadius*=r;let i=n>2**-52?Math.atan2(t.elements[1],t.elements[0]):Math.atan2(-t.elements[3],t.elements[4]);e.aRotation+=i,S(t)&&(e.aStartAngle*=-1,e.aEndAngle*=-1,e.aClockwise=!e.aClockwise)}let a=e.subPaths;for(let e=0,o=a.length;e2**-52}function w(e){let t=e.elements;return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function T(e){let t=e.elements;return Math.sqrt(t[3]*t[3]+t[4]*t[4])}function E(e,t,n){let r,i,a,o,s,c=e+n,l=e-n,u=Math.sqrt(l*l+4*t*t);return c>0?(r=.5*(c+u),s=1/r,i=e*s*n-t*s*t):c<0?i=.5*(c-u):(r=.5*u,i=-.5*u),a=l>0?l+u:l-u,Math.abs(a)>2*Math.abs(t)?(s=-2*t/a,o=1/Math.sqrt(1+s*s),a=s*o):Math.abs(t)===0?(a=1,o=0):(s=-.5*a/t,a=1/Math.sqrt(1+s*s),o=s*a),l>0&&(s=a,a=-o,o=s),{rt1:r,rt2:i,cs:a,sn:o}}let D=[],O={},k=[],A=new We,j=new We,M=new We,N=new We,ee=new ut,P=new B,F=new We,I=new DOMParser().parseFromString(e,`image/svg+xml`);return n(I.documentElement,{fill:`#000`,fillOpacity:1,strokeOpacity:1,strokeWidth:1,strokeLineJoin:`miter`,strokeLineCap:`butt`,strokeMiterLimit:4}),{paths:D,xml:I.documentElement}}static createShapes(e){let t={ORIGIN:0,DESTINATION:1,BETWEEN:2,LEFT:3,RIGHT:4,BEHIND:5,BEYOND:6},n={loc:t.ORIGIN,t:0};function r(e,r,a,o){let s=e.x,c=r.x,l=a.x,u=o.x,d=e.y,f=r.y,p=a.y,m=o.y,h=(u-l)*(d-p)-(m-p)*(s-l),g=(c-s)*(d-p)-(f-d)*(s-l),_=(m-p)*(c-s)-(u-l)*(f-d),v=h/_,y=g/_;if(_===0&&h!==0||v<=0||v>=1||y<0||y>1)return null;if(h===0&&_===0){for(let l=0;l<2;l++)if(i(l===0?a:o,e,r),n.loc==t.ORIGIN){let e=l===0?a:o;return{x:e.x,y:e.y,t:n.t}}else if(n.loc==t.BETWEEN){let e=+(s+n.t*(c-s)).toPrecision(10),t=+(d+n.t*(f-d)).toPrecision(10);return{x:e,y:t,t:n.t}}return null}else{for(let s=0;s<2;s++)if(i(s===0?a:o,e,r),n.loc==t.ORIGIN){let e=s===0?a:o;return{x:e.x,y:e.y,t:n.t}}let l=+(s+v*(c-s)).toPrecision(10),u=+(d+v*(f-d)).toPrecision(10);return{x:l,y:u,t:v}}}function i(e,r,i){let a=i.x-r.x,o=i.y-r.y,s=e.x-r.x,c=e.y-r.y,l=a*c-s*o;if(e.x===r.x&&e.y===r.y){n.loc=t.ORIGIN,n.t=0;return}if(e.x===i.x&&e.y===i.y){n.loc=t.DESTINATION,n.t=1;return}if(l<-(2**-52)){n.loc=t.LEFT;return}if(l>2**-52){n.loc=t.RIGHT;return}if(a*s<0||o*c<0){n.loc=t.BEHIND;return}if(Math.sqrt(a*a+o*o)e.t<=l.t+2**-52&&e.t>=l.t-2**-52)===void 0&&(n.push(l),i.push(new ut(l.x,l.y)))}}return i}function o(e,t,n){let r=new ut;t.getCenter(r);let i=[];return n.forEach(t=>{t.boundingBox.containsPoint(r)&&a(e,t.points).forEach(e=>{i.push({identifier:t.identifier,isCW:t.isCW,point:e})})}),i.sort((e,t)=>e.point.x-t.point.x),i}function s(e,t,n,r,i){(i==null||i===``)&&(i=`nonzero`);let a=new ut;e.boundingBox.getCenter(a);let s=[new ut(n,a.y),new ut(r,a.y)],c=o(s,e.boundingBox,t);c.sort((e,t)=>e.point.x-t.point.x);let l=[],u=[];c.forEach(t=>{t.identifier===e.identifier?l.push(t):u.push(t)});let d=l[0].point.x,f=[],p=0;for(;p0&&f[f.length-1]===u[p].identifier?f.pop():f.push(u[p].identifier),p++;if(f.push(e.identifier),i===`evenodd`){let t=f.length%2==0,n=f[f.length-2];return{identifier:e.identifier,isHole:t,for:n}}else if(i===`nonzero`){let n=!0,r=null,i=null;for(let e=0;e{let t=e.getPoints(),n=-999999999,r=999999999,i=-999999999,a=999999999;for(let e=0;en&&(n=o.y),o.yi&&(i=o.x),o.x=a&&(c=a-1),{curves:e.curves,points:t,isCW:he.isClockWise(t),identifier:-1,boundingBox:new Mt(new ut(a,r),new ut(i,n))}});u=u.filter(e=>e.points.length>1);for(let e=0;es(t,u,c,l,e.userData?e.userData.style.fillRule:void 0)),f=[];return u.forEach(e=>{if(!d[e.identifier].isHole){let t=new qt;t.curves=e.curves,d.filter(t=>t.isHole&&t.for===e.identifier).forEach(e=>{let n=u[e.identifier],r=new L;r.curves=n.curves,t.holes.push(r)}),f.push(t)}}),f}static getStrokeStyle(e,t,n,r,i){return e=e===void 0?1:e,t=t===void 0?`#000`:t,n=n===void 0?`miter`:n,r=r===void 0?`butt`:r,i=i===void 0?4:i,{strokeColor:t,strokeWidth:e,strokeLineJoin:n,strokeLineCap:r,strokeMiterLimit:i}}static pointsToStroke(t,n,r,i){let a=[],o=[],s=[];if(e.pointsToStrokeWithBuffers(t,n,r,i,a,o,s)===0)return null;let c=new rt;return c.setAttribute(`position`,new pe(a,3)),c.setAttribute(`normal`,new pe(o,3)),c.setAttribute(`uv`,new pe(s,2)),c}static pointsToStrokeWithBuffers(e,t,n,r,i,a,o,s){let c=new ut,l=new ut,u=new ut,d=new ut,f=new ut,p=new ut,m=new ut,h=new ut,g=new ut,_=new ut,v=new ut,y=new ut,b=new ut,x=new ut,S=new ut,C=new ut,w=new ut;n=n===void 0?12:n,r=r===void 0?.001:r,s=s===void 0?0:s,e=ce(e);let T=e.length;if(T<2)return 0;let E=e[0].equals(e[T-1]),D,O=e[0],k,A=t.strokeWidth/2,j=1/(T-1),M=0,N,ee,P,F,I=!1,L=0,te=s*3,R=s*2;ne(e[0],e[1],c).multiplyScalar(A),h.copy(e[0]).sub(c),g.copy(e[0]).add(c),_.copy(h),v.copy(g);for(let n=1;n2**-52){let n=A/e;u.multiplyScalar(-n),d.subVectors(D,O),f.copy(d).setLength(n).add(u),C.copy(f).negate();let r=f.length(),i=d.length();d.divideScalar(i),p.subVectors(k,D);let a=p.length();switch(p.divideScalar(a),d.dot(C)=r&&n.push(e[t]);return n.push(e[e.length-1]),n}}};const kV=new z,AV=new B;var jV=class extends yt{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type=`LineSegmentsGeometry`;let e=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],t=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],n=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(n),this.setAttribute(`position`,new pe(e,3)),this.setAttribute(`uv`,new pe(t,2))}applyMatrix4(e){let t=this.attributes.instanceStart,n=this.attributes.instanceEnd;return t!==void 0&&(t.applyMatrix4(e),n.applyMatrix4(e),t.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));let n=new mt(t,6,1);return this.setAttribute(`instanceStart`,new pt(n,3,0)),this.setAttribute(`instanceEnd`,new pt(n,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e,t=3){let n;e instanceof Float32Array?n=e:Array.isArray(e)&&(n=new Float32Array(e));let r=new mt(n,t*2,1);return this.setAttribute(`instanceColorStart`,new pt(r,t,0)),this.setAttribute(`instanceColorEnd`,new pt(r,t,t)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new ne(e.geometry)),this}fromLineSegments(e){let t=e.geometry;return this.setPositions(t.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new z);let e=this.attributes.instanceStart,t=this.attributes.instanceEnd;e!==void 0&&t!==void 0&&(this.boundingBox.setFromBufferAttribute(e),kV.setFromBufferAttribute(t),this.boundingBox.union(kV))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new At),this.boundingBox===null&&this.computeBoundingBox();let e=this.attributes.instanceStart,t=this.attributes.instanceEnd;if(e!==void 0&&t!==void 0){let n=this.boundingSphere.center;this.boundingBox.getCenter(n);let r=0;for(let i=0,a=e.count;i32767||e[0]!==2||e[1]!==2||e[2]&128)return new Uint8Array(e);i!==(e[2]<<8|e[3])&&t(3,`wrong scanline width`);let a=new Uint8Array(4*n*r);a.length||t(4,`unable to allocate buffer space`);let o=0,s=0,c=4*i,l=new Uint8Array(4),u=new Uint8Array(c),d=r;for(;d>0&&se.byteLength&&t(1),l[0]=e[s++],l[1]=e[s++],l[2]=e[s++],l[3]=e[s++],(l[0]!=2||l[1]!=2||(l[2]<<8|l[3])!=i)&&t(3,`bad rgbe scanline format`);let n=0,r;for(;n128;if(i&&(r-=128),(r===0||n+r>c)&&t(3,`bad scanline data`),i){let t=e[s++];for(let e=0;e0?I.copy(k[k.length-1]):I.identity())}function r(e){let t=new Fe,n=new ct,r=new ct,i=new ct,o=!0,s=!1,c=e.getAttribute(`d`);if(c===``||c===`none`)return null;let l=c.match(/[a-df-z][^a-df-z]*/gi);for(let e=0,c=l.length;e0&&(n.copy(i),t.currentPath.currentPoint.copy(n),o=!0);break;default:console.warn(c)}s=!1}return t}function i(e){if(!(!e.sheet||!e.sheet.cssRules||!e.sheet.cssRules.length))for(let t=0;te.trim());for(let e=0;ee!==``));O[r[e]]=Object.assign(O[r[e]]||{},t)}}}function a(e,t,n,r,i,a,s,c){if(t==0||n==0){e.lineTo(c.x,c.y);return}r=r*Math.PI/180,t=Math.abs(t),n=Math.abs(n);let l=(s.x-c.x)/2,u=(s.y-c.y)/2,d=Math.cos(r)*l+Math.sin(r)*u,f=-Math.sin(r)*l+Math.cos(r)*u,p=t*t,m=n*n,h=d*d,g=f*f,_=h/p+g/m;if(_>1){let e=Math.sqrt(_);t=e*t,n=e*n,p=t*t,m=n*n}let v=p*g+m*h,y=(p*m-v)/v,b=Math.sqrt(Math.max(0,y));i===a&&(b=-b);let x=b*t*f/n,S=-b*n*d/t,C=Math.cos(r)*x-Math.sin(r)*S+(s.x+c.x)/2,w=Math.sin(r)*x+Math.cos(r)*S+(s.y+c.y)/2,T=o(1,0,(d-x)/t,(f-S)/n),E=o((d-x)/t,(f-S)/n,(-d-x)/t,(-f-S)/n)%(Math.PI*2);e.currentPath.absellipse(C,w,t,n,T,T+E,a===0,r)}function o(e,t,n,r){let i=e*n+t*r,a=Math.sqrt(e*e+t*t)*Math.sqrt(n*n+r*r),o=Math.acos(Math.max(-1,Math.min(1,i/a)));return e*r-t*n<0&&(o=-o),o}function s(e){let t=v(e.getAttribute(`x`)||0),n=v(e.getAttribute(`y`)||0),r=v(e.getAttribute(`rx`)||e.getAttribute(`ry`)||0),i=v(e.getAttribute(`ry`)||e.getAttribute(`rx`)||0),a=v(e.getAttribute(`width`)),o=v(e.getAttribute(`height`)),s=.448084975506,c=new Fe;return c.moveTo(t+r,n),c.lineTo(t+a-r,n),(r!==0||i!==0)&&c.bezierCurveTo(t+a-r*s,n,t+a,n+i*s,t+a,n+i),c.lineTo(t+a,n+o-i),(r!==0||i!==0)&&c.bezierCurveTo(t+a,n+o-i*s,t+a-r*s,n+o,t+a-r,n+o),c.lineTo(t+r,n+o),(r!==0||i!==0)&&c.bezierCurveTo(t+r*s,n+o,t,n+o-i*s,t,n+o-i),c.lineTo(t,n+i),(r!==0||i!==0)&&c.bezierCurveTo(t,n+i*s,t+r*s,n,t+r,n),c}function c(e){function t(e,t,n){let a=v(t),o=v(n);i===0?r.moveTo(a,o):r.lineTo(a,o),i++}let n=/([+-]?\d*\.?\d+(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g,r=new Fe,i=0;return e.getAttribute(`points`).replace(n,t),r.currentPath.autoClose=!0,r}function l(e){function t(e,t,n){let a=v(t),o=v(n);i===0?r.moveTo(a,o):r.lineTo(a,o),i++}let n=/([+-]?\d*\.?\d+(?:e[+-]?\d+)?)(?:,|\s)([+-]?\d*\.?\d+(?:e[+-]?\d+)?)/g,r=new Fe,i=0;return e.getAttribute(`points`).replace(n,t),r.currentPath.autoClose=!1,r}function u(e){let t=v(e.getAttribute(`cx`)||0),n=v(e.getAttribute(`cy`)||0),r=v(e.getAttribute(`r`)||0),i=new F;i.absarc(t,n,r,0,Math.PI*2);let a=new Fe;return a.subPaths.push(i),a}function d(e){let t=v(e.getAttribute(`cx`)||0),n=v(e.getAttribute(`cy`)||0),r=v(e.getAttribute(`rx`)||0),i=v(e.getAttribute(`ry`)||0),a=new F;a.absellipse(t,n,r,i,0,Math.PI*2);let o=new Fe;return o.subPaths.push(a),o}function f(e){let t=v(e.getAttribute(`x1`)||0),n=v(e.getAttribute(`y1`)||0),r=v(e.getAttribute(`x2`)||0),i=v(e.getAttribute(`y2`)||0),a=new Fe;return a.moveTo(t,n),a.lineTo(r,i),a.currentPath.autoClose=!1,a}function p(e,t){t=Object.assign({},t);let n={};if(e.hasAttribute(`class`)){let t=e.getAttribute(`class`).split(/\s/).filter(Boolean).map(e=>e.trim());for(let e=0;e0&&t.premultiply(k[k.length-1]),I.copy(t),k.push(t),t}function b(e){let t=new ve,n=A;if(e.nodeName===`use`&&(e.hasAttribute(`x`)||e.hasAttribute(`y`))){let n=v(e.getAttribute(`x`)),r=v(e.getAttribute(`y`));t.translate(n,r)}if(e.hasAttribute(`transform`)){let r=e.getAttribute(`transform`).split(`)`);for(let e=r.length-1;e>=0;e--){let i=r[e].trim();if(i===``)continue;let a=i.indexOf(`(`),o=i.length;if(a>0&&a=1){let e=t[0],r=0;t.length>=2&&(r=t[1]),n.translate(e,r)}break;case`rotate`:if(t.length>=1){let e=0,r=0,i=0;e=t[0]*Math.PI/180,t.length>=3&&(r=t[1],i=t[2]),j.makeTranslation(-r,-i),M.makeRotation(e),N.multiplyMatrices(M,j),j.makeTranslation(r,i),n.multiplyMatrices(j,N)}break;case`scale`:if(t.length>=1){let e=t[0],r=e;t.length>=2&&(r=t[1]),n.scale(e,r)}break;case`skewX`:t.length===1&&n.set(1,Math.tan(t[0]*Math.PI/180),0,0,1,0,0,0,1);break;case`skewY`:t.length===1&&n.set(1,0,0,Math.tan(t[0]*Math.PI/180),1,0,0,0,1);break;case`matrix`:t.length===6&&n.set(t[0],t[2],t[4],t[1],t[3],t[5],0,0,1);break}}t.premultiply(n)}}return t}function x(e,t){function n(e){P.set(e.x,e.y,1).applyMatrix3(t),e.set(P.x,P.y)}function r(e){let n=e.xRadius,r=e.yRadius,i=Math.cos(e.aRotation),a=Math.sin(e.aRotation),o=new B(n*i,n*a,0),s=new B(-r*a,r*i,0),c=o.applyMatrix3(t),l=s.applyMatrix3(t),u=A.set(c.x,l.x,0,c.y,l.y,0,0,0,1),d=j.copy(u).invert(),f=M.copy(d).transpose().multiply(d).elements,p=E(f[0],f[1],f[4]),m=Math.sqrt(p.rt1),h=Math.sqrt(p.rt2);if(e.xRadius=1/m,e.yRadius=1/h,e.aRotation=Math.atan2(p.sn,p.cs),!((e.aEndAngle-e.aStartAngle)%(2*Math.PI)<2**-52)){let n=j.set(m,0,0,0,h,0,0,0,1),r=M.set(p.cs,p.sn,0,-p.sn,p.cs,0,0,0,1),i=n.multiply(r).multiply(u),a=e=>{let{x:t,y:n}=new B(Math.cos(e),Math.sin(e),0).applyMatrix3(i);return Math.atan2(n,t)};e.aStartAngle=a(e.aStartAngle),e.aEndAngle=a(e.aEndAngle),S(t)&&(e.aClockwise=!e.aClockwise)}}function i(e){let n=w(t),r=T(t);e.xRadius*=n,e.yRadius*=r;let i=n>2**-52?Math.atan2(t.elements[1],t.elements[0]):Math.atan2(-t.elements[3],t.elements[4]);e.aRotation+=i,S(t)&&(e.aStartAngle*=-1,e.aEndAngle*=-1,e.aClockwise=!e.aClockwise)}let a=e.subPaths;for(let e=0,o=a.length;e2**-52}function w(e){let t=e.elements;return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function T(e){let t=e.elements;return Math.sqrt(t[3]*t[3]+t[4]*t[4])}function E(e,t,n){let r,i,a,o,s,c=e+n,l=e-n,u=Math.sqrt(l*l+4*t*t);return c>0?(r=.5*(c+u),s=1/r,i=e*s*n-t*s*t):c<0?i=.5*(c-u):(r=.5*u,i=-.5*u),a=l>0?l+u:l-u,Math.abs(a)>2*Math.abs(t)?(s=-2*t/a,o=1/Math.sqrt(1+s*s),a=s*o):Math.abs(t)===0?(a=1,o=0):(s=-.5*a/t,a=1/Math.sqrt(1+s*s),o=s*a),l>0&&(s=a,a=-o,o=s),{rt1:r,rt2:i,cs:a,sn:o}}let D=[],O={},k=[],A=new ve,j=new ve,M=new ve,N=new ve,ee=new ct,P=new B,I=new ve,L=new DOMParser().parseFromString(e,`image/svg+xml`);return n(L.documentElement,{fill:`#000`,fillOpacity:1,strokeOpacity:1,strokeWidth:1,strokeLineJoin:`miter`,strokeLineCap:`butt`,strokeMiterLimit:4}),{paths:D,xml:L.documentElement}}static createShapes(e){let t={ORIGIN:0,DESTINATION:1,BETWEEN:2,LEFT:3,RIGHT:4,BEHIND:5,BEYOND:6},n={loc:t.ORIGIN,t:0};function r(e,r,a,o){let s=e.x,c=r.x,l=a.x,u=o.x,d=e.y,f=r.y,p=a.y,m=o.y,h=(u-l)*(d-p)-(m-p)*(s-l),g=(c-s)*(d-p)-(f-d)*(s-l),_=(m-p)*(c-s)-(u-l)*(f-d),v=h/_,y=g/_;if(_===0&&h!==0||v<=0||v>=1||y<0||y>1)return null;if(h===0&&_===0){for(let l=0;l<2;l++)if(i(l===0?a:o,e,r),n.loc==t.ORIGIN){let e=l===0?a:o;return{x:e.x,y:e.y,t:n.t}}else if(n.loc==t.BETWEEN){let e=+(s+n.t*(c-s)).toPrecision(10),t=+(d+n.t*(f-d)).toPrecision(10);return{x:e,y:t,t:n.t}}return null}else{for(let s=0;s<2;s++)if(i(s===0?a:o,e,r),n.loc==t.ORIGIN){let e=s===0?a:o;return{x:e.x,y:e.y,t:n.t}}let l=+(s+v*(c-s)).toPrecision(10),u=+(d+v*(f-d)).toPrecision(10);return{x:l,y:u,t:v}}}function i(e,r,i){let a=i.x-r.x,o=i.y-r.y,s=e.x-r.x,c=e.y-r.y,l=a*c-s*o;if(e.x===r.x&&e.y===r.y){n.loc=t.ORIGIN,n.t=0;return}if(e.x===i.x&&e.y===i.y){n.loc=t.DESTINATION,n.t=1;return}if(l<-(2**-52)){n.loc=t.LEFT;return}if(l>2**-52){n.loc=t.RIGHT;return}if(a*s<0||o*c<0){n.loc=t.BEHIND;return}if(Math.sqrt(a*a+o*o)e.t<=l.t+2**-52&&e.t>=l.t-2**-52)===void 0&&(n.push(l),i.push(new ct(l.x,l.y)))}}return i}function o(e,t,n){let r=new ct;t.getCenter(r);let i=[];return n.forEach(t=>{t.boundingBox.containsPoint(r)&&a(e,t.points).forEach(e=>{i.push({identifier:t.identifier,isCW:t.isCW,point:e})})}),i.sort((e,t)=>e.point.x-t.point.x),i}function s(e,t,n,r,i){(i==null||i===``)&&(i=`nonzero`);let a=new ct;e.boundingBox.getCenter(a);let s=[new ct(n,a.y),new ct(r,a.y)],c=o(s,e.boundingBox,t);c.sort((e,t)=>e.point.x-t.point.x);let l=[],u=[];c.forEach(t=>{t.identifier===e.identifier?l.push(t):u.push(t)});let d=l[0].point.x,f=[],p=0;for(;p0&&f[f.length-1]===u[p].identifier?f.pop():f.push(u[p].identifier),p++;if(f.push(e.identifier),i===`evenodd`){let t=f.length%2==0,n=f[f.length-2];return{identifier:e.identifier,isHole:t,for:n}}else if(i===`nonzero`){let n=!0,r=null,i=null;for(let e=0;e{let t=e.getPoints(),n=-999999999,r=999999999,i=-999999999,a=999999999;for(let e=0;en&&(n=o.y),o.yi&&(i=o.x),o.x=a&&(c=a-1),{curves:e.curves,points:t,isCW:pe.isClockWise(t),identifier:-1,boundingBox:new kt(new ct(a,r),new ct(i,n))}});u=u.filter(e=>e.points.length>1);for(let e=0;es(t,u,c,l,e.userData?e.userData.style.fillRule:void 0)),f=[];return u.forEach(e=>{if(!d[e.identifier].isHole){let t=new Wt;t.curves=e.curves,d.filter(t=>t.isHole&&t.for===e.identifier).forEach(e=>{let n=u[e.identifier],r=new F;r.curves=n.curves,t.holes.push(r)}),f.push(t)}}),f}static getStrokeStyle(e,t,n,r,i){return e=e===void 0?1:e,t=t===void 0?`#000`:t,n=n===void 0?`miter`:n,r=r===void 0?`butt`:r,i=i===void 0?4:i,{strokeColor:t,strokeWidth:e,strokeLineJoin:n,strokeLineCap:r,strokeMiterLimit:i}}static pointsToStroke(t,n,r,i){let a=[],o=[],s=[];if(e.pointsToStrokeWithBuffers(t,n,r,i,a,o,s)===0)return null;let c=new tt;return c.setAttribute(`position`,new de(a,3)),c.setAttribute(`normal`,new de(o,3)),c.setAttribute(`uv`,new de(s,2)),c}static pointsToStrokeWithBuffers(e,t,n,r,i,a,o,s){let c=new ct,l=new ct,u=new ct,d=new ct,f=new ct,p=new ct,m=new ct,h=new ct,g=new ct,_=new ct,v=new ct,y=new ct,b=new ct,x=new ct,S=new ct,C=new ct,w=new ct;n=n===void 0?12:n,r=r===void 0?.001:r,s=s===void 0?0:s,e=ce(e);let T=e.length;if(T<2)return 0;let E=e[0].equals(e[T-1]),D,O=e[0],k,A=t.strokeWidth/2,j=1/(T-1),M=0,N,ee,P,F,I=!1,L=0,te=s*3,R=s*2;ne(e[0],e[1],c).multiplyScalar(A),h.copy(e[0]).sub(c),g.copy(e[0]).add(c),_.copy(h),v.copy(g);for(let n=1;n2**-52){let n=A/e;u.multiplyScalar(-n),d.subVectors(D,O),f.copy(d).setLength(n).add(u),C.copy(f).negate();let r=f.length(),i=d.length();d.divideScalar(i),p.subVectors(k,D);let a=p.length();switch(p.divideScalar(a),d.dot(C)=r&&n.push(e[t]);return n.push(e[e.length-1]),n}}};const kV=new R,AV=new B;var jV=class extends _t{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type=`LineSegmentsGeometry`;let e=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],t=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],n=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(n),this.setAttribute(`position`,new de(e,3)),this.setAttribute(`uv`,new de(t,2))}applyMatrix4(e){let t=this.attributes.instanceStart,n=this.attributes.instanceEnd;return t!==void 0&&(t.applyMatrix4(e),n.applyMatrix4(e),t.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));let n=new ft(t,6,1);return this.setAttribute(`instanceStart`,new dt(n,3,0)),this.setAttribute(`instanceEnd`,new dt(n,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e,t=3){let n;e instanceof Float32Array?n=e:Array.isArray(e)&&(n=new Float32Array(e));let r=new ft(n,t*2,1);return this.setAttribute(`instanceColorStart`,new dt(r,t,0)),this.setAttribute(`instanceColorEnd`,new dt(r,t,t)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new te(e.geometry)),this}fromLineSegments(e){let t=e.geometry;return this.setPositions(t.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new R);let e=this.attributes.instanceStart,t=this.attributes.instanceEnd;e!==void 0&&t!==void 0&&(this.boundingBox.setFromBufferAttribute(e),kV.setFromBufferAttribute(t),this.boundingBox.union(kV))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new At),this.boundingBox===null&&this.computeBoundingBox();let e=this.attributes.instanceStart,t=this.attributes.instanceEnd;if(e!==void 0&&t!==void 0){let n=this.boundingSphere.center;this.boundingBox.getCenter(n);let r=0;for(let i=0,a=e.count;i #include #include @@ -3360,12 +3360,12 @@ params: ${n}`),this.query=t,this.params=n,this.cause=r,Error.captureStackTrace(t gl_FragColor = diffuseColor; #include - #include <${parseInt(Tt.replace(/\D+/g,``))>=154?`colorspace_fragment`:`encodings_fragment`}> + #include <${parseInt(Qe.replace(/\D+/g,``))>=154?`colorspace_fragment`:`encodings_fragment`}> #include #include } - `,clipping:!0}),this.isLineMaterial=!0,this.onBeforeCompile=function(){this.transparent?this.defines.USE_LINE_COLOR_ALPHA=`1`:delete this.defines.USE_LINE_COLOR_ALPHA},Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(e){this.uniforms.diffuse.value=e}},worldUnits:{enumerable:!0,get:function(){return`WORLD_UNITS`in this.defines},set:function(e){e===!0?this.defines.WORLD_UNITS=``:delete this.defines.WORLD_UNITS}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(e){this.uniforms.linewidth.value=e}},dashed:{enumerable:!0,get:function(){return`USE_DASH`in this.defines},set(e){!!e!=`USE_DASH`in this.defines&&(this.needsUpdate=!0),e===!0?this.defines.USE_DASH=``:delete this.defines.USE_DASH}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(e){this.uniforms.dashScale.value=e}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(e){this.uniforms.dashSize.value=e}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(e){this.uniforms.dashOffset.value=e}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(e){this.uniforms.gapSize.value=e}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(e){this.uniforms.opacity.value=e}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(e){this.uniforms.resolution.value.copy(e)}},alphaToCoverage:{enumerable:!0,get:function(){return`USE_ALPHA_TO_COVERAGE`in this.defines},set:function(e){!!e!=`USE_ALPHA_TO_COVERAGE`in this.defines&&(this.needsUpdate=!0),e===!0?(this.defines.USE_ALPHA_TO_COVERAGE=``,this.extensions.derivatives=!0):(delete this.defines.USE_ALPHA_TO_COVERAGE,this.extensions.derivatives=!1)}}}),this.setValues(e)}};const PV=new Yt,FV=new B,IV=new B,LV=new Yt,RV=new Yt,zV=new Yt,BV=new B,VV=new je,HV=new ot,UV=new B,WV=new z,GV=new At,KV=new Yt;let qV,JV;function YV(e,t,n){return KV.set(0,0,-t,1).applyMatrix4(e.projectionMatrix),KV.multiplyScalar(1/KV.w),KV.x=JV/n.width,KV.y=JV/n.height,KV.applyMatrix4(e.projectionMatrixInverse),KV.multiplyScalar(1/KV.w),Math.abs(Math.max(KV.x,KV.y))}function XV(e,t){let n=e.matrixWorld,r=e.geometry,i=r.attributes.instanceStart,a=r.attributes.instanceEnd,o=Math.min(r.instanceCount,i.count);for(let r=0,s=o;ru&&RV.z>u)continue;if(LV.z>u){let e=LV.z-RV.z,t=(LV.z-u)/e;LV.lerp(RV,t)}else if(RV.z>u){let e=RV.z-LV.z,t=(RV.z-u)/e;RV.lerp(LV,t)}LV.applyMatrix4(r),RV.applyMatrix4(r),LV.multiplyScalar(1/LV.w),RV.multiplyScalar(1/RV.w),LV.x*=i.x/2,LV.y*=i.y/2,RV.x*=i.x/2,RV.y*=i.y/2,HV.start.copy(LV),HV.start.z=0,HV.end.copy(RV),HV.end.z=0;let o=HV.closestPointToPointParameter(BV,!0);HV.at(o,UV);let l=it.lerp(LV.z,RV.z,o),d=l>=-1&&l<=1,f=BV.distanceTo(UV)t)),o=Math.min(e.length,i);return a.slice(0,o).sort().map(t=>e[t])}shuffle(e){return e.map(e=>({value:e,sort:this._getNext()})).sort((e,t)=>e.sort-t.sort).map(({value:e})=>e)}getMulberry32(e=0){return e>0&&e<1&&(e=Math.floor(e*2**16)),()=>{e+=1831565813;let t=e;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}}};const OH=[tH,nH,rH,iH,aH],kH=it.lerp,AH=(e=0,t=wH)=>{let n=new DH(e).choice(OH);return t.map((t,r)=>{let i=new DH(e*(r*7907+1)+(typeof t.seed==`number`?t.seed:0)),a=i.int(t.length[0],t.length[1]);return Array.from({length:a}).fill(0).map(()=>{let e=n(i.rand());return{texture:i.defaultChoice(t.texture,TH.texture),size:kH(t.size[0],t.size[1],n(1-e)),distance:kH(t.distance[0],t.distance[1],e),color:i.defaultChoice(t.color,TH.color)}})}).flat()},jH=(e,t,n=void 0,r=void 0,i=TH)=>{if(e!==void 0&&e.length>0&&(typeof n==`number`||typeof r<`u`)){let a=AH(n??0,r??wH),o=a.length,s=e.length;return o>=s?a.map((n,r)=>Object.assign(n,t,rObject.assign({},i,n0){let n=Object.assign({},i,t);return e.map(e=>Object.assign({},n,e))}let a=r===void 0||r.length===0?wH:r;return AH(n??0,a).map(e=>Object.assign({},e,t))};function MH(e){return NH(e,(e,t)=>t in TH&&e!==void 0)}function NH(e,t){let n={};return Object.keys(e).forEach(r=>{t(e[r],r)&&(n[r]=e[r])}),n}const PH=Tn({__name:`component`,props:{scale:{default:1},elements:{default:void 0},seed:{default:void 0},seedProps:{default:void 0},color:{default:void 0},distance:{default:void 0},size:{default:void 0},texture:{default:void 0}},setup(e,{expose:t}){let n=e,r=W(),i=W([]),a=W(MH(n));t({instance:r});let o=new Ge,s=new vB,c=[],l=()=>{for(var e,t,n;c.length;)c.pop();(e=r.value)==null||e.children.forEach(e=>{`dispose`in e&&e.dispose()}),(t=r.value)==null||t.remove(...r.value.children),(n=r.value)==null||n.dispose()},u=e=>{if(typeof e.texture==`string`){let t=e.texture;e.texture=o.load(t),e.texture.name=t}return e.color=Se(e.color),e},d=()=>{for(let e=i.value.length-1;e{c[t].size=e.size*n.scale})},f=()=>{for(;i.value.length>c.length;){let e={...u(i.value[c.length])};c.push(e),s.addElement(e)}i.value.forEach((e,t)=>{let n=c[t],{texture:r,size:i,distance:a,color:s}=e;if(typeof r==`string`){if(n.texture.name!==r){n.texture.dispose();let e=r;n.texture=o.load(e),n.texture.name=e}}else n.texture!==r&&(n.texture.dispose(),n.texture=r);n.size=i,n.distance=a,n.color=Se(s)}),d()};return An(()=>{l()}),Cn(()=>{var e;(e=r.value)==null||e.add(s),i.value=jH(n.elements,a.value,n.seed,n.seedProps)}),G(()=>[n.color,n.distance,n.size,n.texture],()=>{a.value={color:n.color,distance:n.distance,size:n.size,texture:n.texture}}),G(()=>[a.value,n.elements,n.seed,n.seedProps],()=>{i.value=jH(n.elements,a.value,n.seed,n.seedProps)}),G(()=>n.scale,()=>{d()}),G(()=>i.value,()=>{f()}),(e,t)=>(K(),On(`TresGroup`,{ref_key:`lensflareRef`,ref:r},null,512))}}),FH=Tn({__name:`Levioso`,props:{speed:{default:1},rotationFactor:{default:1},floatFactor:{default:1},range:{default:()=>[-.1,.1]}},setup(e,{expose:t}){let n=e,r=W();t({instance:r});{let e=Math.random()*1e4,{onBeforeRender:t}=be(),i=e;t(({delta:e,invalidate:t})=>{if(!r.value)return;i+=e*n.speed;let a=i*.25,o=r.value;o.rotation.x=Math.cos(a)*.125*n.rotationFactor,o.rotation.y=Math.sin(a)*.125*n.rotationFactor,o.rotation.z=Math.sin(a)*.05*n.rotationFactor,o.position.y=it.mapLinear(Math.sin(a),-1,1,n.range[0],n.range[1])*n.floatFactor,t()})}return(e,t)=>(K(),On(`TresGroup`,bn(e.$attrs,{ref_key:`groupRef`,ref:r}),[Qt(e.$slots,`default`)],16))}}),IH=[`render-order`],LH=Tn({__name:`component`,props:{id:{default:1},colorWrite:{type:Boolean,default:!0},depthWrite:{type:Boolean,default:!1}},setup(e,{expose:t}){let n=e,r=W();function i(){var e,t;let i=Array.isArray((e=r.value)?.material)?r.value.material[0]:(t=r.value)?.material;i&&(i.colorWrite=n.colorWrite,i.depthWrite=n.depthWrite,i.stencilWrite=!0,i.stencilRef=n.id,i.stencilFunc=Ze,i.stencilFail=St,i.stencilZFail=St,i.stencilZPass=St)}return Nn(i),t({instance:r}),(e,t)=>(K(),On(`TresMesh`,{ref_key:`meshRef`,ref:r,"render-order":-n.id},[Qt(e.$slots,`default`)],8,IH))}}),RH=Tn({__name:`MouseParallax`,props:{disabled:{type:Boolean,default:!1},factor:{default:2.5},ease:{default:.1},local:{type:Boolean,default:!1}},setup(e){let t=e,{camera:n,renderer:r}=De(),{disabled:i,factor:a,ease:o,local:s}=un(t),c={};s.value&&(c.target=r.value.domElement,c.type=`client`);let{x:l,y:u}=CR(c),{width:d,height:f}=s.value?_R(r.value.domElement):TR(),p=W(),m=U(),h=U();G([a,o],()=>{m.value=Array.isArray(a.value)?a.value:[a.value,a.value],h.value=Array.isArray(o.value)?o.value:[o.value,o.value]},{immediate:!0});let g=_n(()=>(l.value/d.value-.5)*m.value[0]),_=_n(()=>-(u.value/f.value-.5)*m.value[1]),{onBeforeRender:v}=be();return v(({delta:e,invalidate:t})=>{i.value||!p.value||Number.isNaN(g.value)||Number.isNaN(_.value)||(p.value.position.x+=(g.value-p.value.position.x)*h.value[0]*e,p.value.position.y+=(_.value-p.value.position.y)*h.value[1]*e,t())}),G(()=>p.value,e=>e?.add(n.value)),(e,t)=>(K(),On(`TresGroup`,{ref_key:`cameraGroupRef`,ref:p},null,512))}}),zH=NR({screenspace:!1,color:new ge(`black`),opacity:1,thickness:.05,size:new ut(1,1)},`#include + `,clipping:!0}),this.isLineMaterial=!0,this.onBeforeCompile=function(){this.transparent?this.defines.USE_LINE_COLOR_ALPHA=`1`:delete this.defines.USE_LINE_COLOR_ALPHA},Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(e){this.uniforms.diffuse.value=e}},worldUnits:{enumerable:!0,get:function(){return`WORLD_UNITS`in this.defines},set:function(e){e===!0?this.defines.WORLD_UNITS=``:delete this.defines.WORLD_UNITS}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(e){this.uniforms.linewidth.value=e}},dashed:{enumerable:!0,get:function(){return`USE_DASH`in this.defines},set(e){!!e!=`USE_DASH`in this.defines&&(this.needsUpdate=!0),e===!0?this.defines.USE_DASH=``:delete this.defines.USE_DASH}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(e){this.uniforms.dashScale.value=e}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(e){this.uniforms.dashSize.value=e}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(e){this.uniforms.dashOffset.value=e}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(e){this.uniforms.gapSize.value=e}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(e){this.uniforms.opacity.value=e}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(e){this.uniforms.resolution.value.copy(e)}},alphaToCoverage:{enumerable:!0,get:function(){return`USE_ALPHA_TO_COVERAGE`in this.defines},set:function(e){!!e!=`USE_ALPHA_TO_COVERAGE`in this.defines&&(this.needsUpdate=!0),e===!0?(this.defines.USE_ALPHA_TO_COVERAGE=``,this.extensions.derivatives=!0):(delete this.defines.USE_ALPHA_TO_COVERAGE,this.extensions.derivatives=!1)}}}),this.setValues(e)}};const PV=new qt,FV=new B,IV=new B,LV=new qt,RV=new qt,zV=new qt,BV=new B,VV=new wt,HV=new it,UV=new B,WV=new R,GV=new At,KV=new qt;let qV,JV;function YV(e,t,n){return KV.set(0,0,-t,1).applyMatrix4(e.projectionMatrix),KV.multiplyScalar(1/KV.w),KV.x=JV/n.width,KV.y=JV/n.height,KV.applyMatrix4(e.projectionMatrixInverse),KV.multiplyScalar(1/KV.w),Math.abs(Math.max(KV.x,KV.y))}function XV(e,t){let n=e.matrixWorld,r=e.geometry,i=r.attributes.instanceStart,a=r.attributes.instanceEnd,o=Math.min(r.instanceCount,i.count);for(let r=0,s=o;ru&&RV.z>u)continue;if(LV.z>u){let e=LV.z-RV.z,t=(LV.z-u)/e;LV.lerp(RV,t)}else if(RV.z>u){let e=RV.z-LV.z,t=(RV.z-u)/e;RV.lerp(LV,t)}LV.applyMatrix4(r),RV.applyMatrix4(r),LV.multiplyScalar(1/LV.w),RV.multiplyScalar(1/RV.w),LV.x*=i.x/2,LV.y*=i.y/2,RV.x*=i.x/2,RV.y*=i.y/2,HV.start.copy(LV),HV.start.z=0,HV.end.copy(RV),HV.end.z=0;let o=HV.closestPointToPointParameter(BV,!0);HV.at(o,UV);let l=nt.lerp(LV.z,RV.z,o),d=l>=-1&&l<=1,f=BV.distanceTo(UV)t)),o=Math.min(e.length,i);return a.slice(0,o).sort().map(t=>e[t])}shuffle(e){return e.map(e=>({value:e,sort:this._getNext()})).sort((e,t)=>e.sort-t.sort).map(({value:e})=>e)}getMulberry32(e=0){return e>0&&e<1&&(e=Math.floor(e*2**16)),()=>{e+=1831565813;let t=e;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}}};const OH=[tH,nH,rH,iH,aH],kH=nt.lerp,AH=(e=0,t=wH)=>{let n=new DH(e).choice(OH);return t.map((t,r)=>{let i=new DH(e*(r*7907+1)+(typeof t.seed==`number`?t.seed:0)),a=i.int(t.length[0],t.length[1]);return Array.from({length:a}).fill(0).map(()=>{let e=n(i.rand());return{texture:i.defaultChoice(t.texture,TH.texture),size:kH(t.size[0],t.size[1],n(1-e)),distance:kH(t.distance[0],t.distance[1],e),color:i.defaultChoice(t.color,TH.color)}})}).flat()},jH=(e,t,n=void 0,r=void 0,i=TH)=>{if(e!==void 0&&e.length>0&&(typeof n==`number`||typeof r<`u`)){let a=AH(n??0,r??wH),o=a.length,s=e.length;return o>=s?a.map((n,r)=>Object.assign(n,t,rObject.assign({},i,n0){let n=Object.assign({},i,t);return e.map(e=>Object.assign({},n,e))}let a=r===void 0||r.length===0?wH:r;return AH(n??0,a).map(e=>Object.assign({},e,t))};function MH(e){return NH(e,(e,t)=>t in TH&&e!==void 0)}function NH(e,t){let n={};return Object.keys(e).forEach(r=>{t(e[r],r)&&(n[r]=e[r])}),n}const PH=$t({__name:`component`,props:{scale:{default:1},elements:{default:void 0},seed:{default:void 0},seedProps:{default:void 0},color:{default:void 0},distance:{default:void 0},size:{default:void 0},texture:{default:void 0}},setup(e,{expose:t}){let n=e,r=W(),i=W([]),a=W(MH(n));t({instance:r});let o=new D,s=new vB,c=[],l=()=>{for(var e,t,n;c.length;)c.pop();(e=r.value)==null||e.children.forEach(e=>{`dispose`in e&&e.dispose()}),(t=r.value)==null||t.remove(...r.value.children),(n=r.value)==null||n.dispose()},u=e=>{if(typeof e.texture==`string`){let t=e.texture;e.texture=o.load(t),e.texture.name=t}return e.color=Se(e.color),e},d=()=>{for(let e=i.value.length-1;e{c[t].size=e.size*n.scale})},f=()=>{for(;i.value.length>c.length;){let e={...u(i.value[c.length])};c.push(e),s.addElement(e)}i.value.forEach((e,t)=>{let n=c[t],{texture:r,size:i,distance:a,color:s}=e;if(typeof r==`string`){if(n.texture.name!==r){n.texture.dispose();let e=r;n.texture=o.load(e),n.texture.name=e}}else n.texture!==r&&(n.texture.dispose(),n.texture=r);n.size=i,n.distance=a,n.color=Se(s)}),d()};return bn(()=>{l()}),Pn(()=>{var e;(e=r.value)==null||e.add(s),i.value=jH(n.elements,a.value,n.seed,n.seedProps)}),G(()=>[n.color,n.distance,n.size,n.texture],()=>{a.value={color:n.color,distance:n.distance,size:n.size,texture:n.texture}}),G(()=>[a.value,n.elements,n.seed,n.seedProps],()=>{i.value=jH(n.elements,a.value,n.seed,n.seedProps)}),G(()=>n.scale,()=>{d()}),G(()=>i.value,()=>{f()}),(e,t)=>(K(),nn(`TresGroup`,{ref_key:`lensflareRef`,ref:r},null,512))}}),FH=$t({__name:`Levioso`,props:{speed:{default:1},rotationFactor:{default:1},floatFactor:{default:1},range:{default:()=>[-.1,.1]}},setup(e,{expose:t}){let n=e,r=W();t({instance:r});{let e=Math.random()*1e4,{onBeforeRender:t}=be(),i=e;t(({delta:e,invalidate:t})=>{if(!r.value)return;i+=e*n.speed;let a=i*.25,o=r.value;o.rotation.x=Math.cos(a)*.125*n.rotationFactor,o.rotation.y=Math.sin(a)*.125*n.rotationFactor,o.rotation.z=Math.sin(a)*.05*n.rotationFactor,o.position.y=nt.mapLinear(Math.sin(a),-1,1,n.range[0],n.range[1])*n.floatFactor,t()})}return(e,t)=>(K(),nn(`TresGroup`,jn(e.$attrs,{ref_key:`groupRef`,ref:r}),[Tn(e.$slots,`default`)],16))}}),IH=[`render-order`],LH=$t({__name:`component`,props:{id:{default:1},colorWrite:{type:Boolean,default:!0},depthWrite:{type:Boolean,default:!1}},setup(e,{expose:t}){let n=e,r=W();function i(){var e,t;let i=Array.isArray((e=r.value)?.material)?r.value.material[0]:(t=r.value)?.material;i&&(i.colorWrite=n.colorWrite,i.depthWrite=n.depthWrite,i.stencilWrite=!0,i.stencilRef=n.id,i.stencilFunc=Ye,i.stencilFail=bt,i.stencilZFail=bt,i.stencilZPass=bt)}return Cn(i),t({instance:r}),(e,t)=>(K(),nn(`TresMesh`,{ref_key:`meshRef`,ref:r,"render-order":-n.id},[Tn(e.$slots,`default`)],8,IH))}}),RH=$t({__name:`MouseParallax`,props:{disabled:{type:Boolean,default:!1},factor:{default:2.5},ease:{default:.1},local:{type:Boolean,default:!1}},setup(e){let t=e,{camera:n,renderer:r}=De(),{disabled:i,factor:a,ease:o,local:s}=rn(t),c={};s.value&&(c.target=r.value.domElement,c.type=`client`);let{x:l,y:u}=CR(c),{width:d,height:f}=s.value?_R(r.value.domElement):TR(),p=W(),m=U(),h=U();G([a,o],()=>{m.value=Array.isArray(a.value)?a.value:[a.value,a.value],h.value=Array.isArray(o.value)?o.value:[o.value,o.value]},{immediate:!0});let g=On(()=>(l.value/d.value-.5)*m.value[0]),_=On(()=>-(u.value/f.value-.5)*m.value[1]),{onBeforeRender:v}=be();return v(({delta:e,invalidate:t})=>{i.value||!p.value||Number.isNaN(g.value)||Number.isNaN(_.value)||(p.value.position.x+=(g.value-p.value.position.x)*h.value[0]*e,p.value.position.y+=(_.value-p.value.position.y)*h.value[1]*e,t())}),G(()=>p.value,e=>e?.add(n.value)),(e,t)=>(K(),nn(`TresGroup`,{ref_key:`cameraGroupRef`,ref:p},null,512))}}),zH=NR({screenspace:!1,color:new me(`black`),opacity:1,thickness:.05,size:new ct(1,1)},`#include #include #include uniform float thickness; @@ -3405,14 +3405,14 @@ params: ${n}`),this.query=t,this.params=n,this.cause=r,Error.captureStackTrace(t gl_FragColor = vec4(color, opacity); #include #include - }`),BH=Tn({__name:`component`,props:{color:{default:`black`},screenspace:{type:Boolean,default:!1},opacity:{default:1},transparent:{type:Boolean,default:!1},thickness:{default:.05},angle:{default:Math.PI},toneMapped:{type:Boolean,default:!0},polygonOffset:{type:Boolean,default:!1},polygonOffsetFactor:{default:0},renderOrder:{default:0}},setup(e,{expose:t}){let n=e,r=W();t({instance:r});let i=new zH({...n}),a=new ut(1,1),o=0,s=null;function c(e){var t;let r=e.parent;if(!(!r||!r.geometry)&&(o!==n.angle||s!==r.geometry)){o=n.angle,s=r.geometry;let a=(t=e.children)?.[0];a&&(n.angle&&a.geometry.dispose(),e.remove(a)),r.skeleton?(a=new Et,a.material=i,a.bind(r.skeleton,r.bindMatrix),e.add(a)):r.isInstancedMesh?(a=new Gt(r.geometry,i,r.count),a.instanceMatrix=r.instanceMatrix,e.add(a)):(a=new V,a.material=i,e.add(a)),a.geometry=n.angle?VR(r.geometry,n.angle):r.geometry}}function l(){i.side=Fe,i.transparent=n.transparent,i.thickness=n.thickness,i.color=Se(n.color),i.opacity=n.opacity,i.size=a,i.screenspace=n.screenspace,i.toneMapped=n.toneMapped,i.polygonOffset=n.polygonOffset,i.polygonOffsetFactor=n.polygonOffsetFactor}let u=ye().sizes;return G(()=>[u.width.value,u.height.value],([e,t])=>{a.set(e,t)}),G(()=>[n.angle],()=>{r.value&&c(r.value)}),G(()=>[n.transparent,n.thickness,n.color,n.opacity,a,n.screenspace,n.toneMapped,n.polygonOffset,n.polygonOffsetFactor],()=>l(),{immediate:!0}),Cn(()=>c(r.value)),An(()=>{var e;let t=(e=r.value)?.children[0];t&&(t.geometry.dispose(),i.dispose(),t.removeFromParent())}),(e,t)=>(K(),On(`TresGroup`,{ref_key:`groupRef`,ref:r},null,512))}}),VH=[`args`],HH=Tn({__name:`PositionalAudio`,props:{ready:{type:Boolean,default:!1},url:{},distance:{default:2},helper:{type:Boolean,default:!1},loop:{type:Boolean,default:!1},autoplay:{type:Boolean,default:!1},innerAngle:{default:360},outerAngle:{default:360},outerGain:{default:0}},emits:[`isPlaying`],async setup(e,{expose:t,emit:n}){let r,i,a=e,o=n,{ready:s,url:c,distance:l,helper:u,loop:d,autoplay:f,innerAngle:p,outerAngle:m,outerGain:h}=un(a),{camera:g}=De(),_=W(null),v=W(null),y=W(null),b=an(new le),x=()=>{var e,t,n;(e=_?.value)!=null&&e.isPlaying||((t=_?.value)==null||t.play(),o(`isPlaying`,(n=_?.value)?.isPlaying))},S=()=>{var e,t;(e=_?.value)!=null&&e.isPlaying&&(_.value.pause(),o(`isPlaying`,(t=_?.value)?.isPlaying))},C=()=>{var e;_.value&&(_.value.stop(),o(`isPlaying`,(e=_?.value)?.isPlaying))},w=()=>{if(!(_!=null&&_.value))return;C();let e=_.value;e.source&&e.disconnect()},T=()=>{var e,t;!(_!=null&&_.value)||!(v!=null&&v.value)||((e=v?.value)==null||e.dispose(),(t=_?.value)==null||t.remove(v?.value))},E=()=>{var e;if(_.value&&(_.value.setBuffer(y.value),_.value.setRefDistance(l.value),_.value.setLoop(d.value),_.value.setDirectionalCone(p.value,m.value,h.value),(e=v?.value)==null||e.update(),v!=null&&v.value)){let e=v.value.material[0];!e.visible&&m.value!==p.value&&(e.visible=!0)}},D=()=>{var e,t;E();let n=(e=_.value)?.parent,r=new z().setFromObject(n),i=(r.max.z-r.min.z)*2;v.value=new eH(_.value,i,32,16),(t=_?.value)==null||t.add(v.value),v.value.update()},O=()=>{var e;(e=g?.value)==null||e.remove(b),w(),T()};return t({instance:_,play:x,stop:C,pause:S,dispose:O}),y.value=([r,i]=$t(()=>Ee(ct,c.value)),r=await r,i(),r),G(_,()=>{_!=null&&_.value&&(u.value&&D(),s.value&&f&&x())}),G(u,()=>{u.value?D():T()}),G(s,()=>{s.value&&E(),f.value&&s.value&&x(),!f.value&&s.value&&C()}),G([l,d,y,p,m,h,f],()=>{E()}),Cn(()=>{var e;(e=g?.value)==null||e.add(b)}),kn(()=>{O()}),(e,t)=>(K(),On(`TresPositionalAudio`,bn({ref_key:`positionalAudioRef`,ref:_,args:[H(b)]},e.$attrs),null,16,VH))}}),UH=[`args`,`material-uniforms-color-value`],WH=Tn({__name:`Reflector`,props:{color:{default:`#333`},textureWidth:{default:512},textureHeight:{default:512},clipBias:{default:0},multisample:{default:4},shader:{default:uB.ReflectorShader}},setup(e,{expose:t}){let n=e,{extend:r,invalidate:i}=De(),a=W();r({Reflector:uB});let{color:o,textureWidth:s,textureHeight:c,clipBias:l,multisample:u,shader:d}=un(n);return G(n,()=>i()),t({instance:a}),(e,t)=>(K(),On(`TresReflector`,{ref_key:`reflectorRef`,ref:a,args:[void 0,{textureWidth:H(s),textureHeight:H(c),clipBias:H(l),multisample:H(u),shader:H(d)}],"material-uniforms-color-value":H(o)},[Qt(e.$slots,`default`,{},()=>[t[0]||=jn(`TresPlaneGeometry`,{args:[5,5]},null,-1)])],8,UH))}}),GH=[`position-z`],KH=Tn({__name:`ScreenSpace`,props:{depth:{default:-1}},setup(e,{expose:t}){let n=W();return be().onBeforeRender(({camera:e})=>{n.value&&(n.value.quaternion.copy(e.quaternion),n.value.position.copy(e.position))}),t({instance:n}),(e,t)=>(K(),On(`TresGroup`,{ref_key:`outerRef`,ref:n},[jn(`TresGroup`,{"position-z":-e.depth},[Qt(e.$slots,`default`)],8,GH)],512))}}),qH=[`args`,`center`],JH=Tn({__name:`Text3D`,props:{font:{},text:{},size:{default:.5},height:{default:.2},curveSegments:{default:5},bevelEnabled:{type:Boolean,default:!0},bevelThickness:{default:.05},bevelSize:{default:.02},bevelOffset:{default:0},bevelSegments:{default:4},center:{type:Boolean,default:!1},needUpdates:{type:Boolean,default:!1}},async setup(e,{expose:t}){let n,r,i=e,{center:a,font:o,text:s,needUpdates:c,size:l,height:u,curveSegments:d,bevelEnabled:f,bevelThickness:p,bevelSize:m,bevelOffset:h,bevelSegments:g}=un(i),{extend:_,invalidate:v}=De();G(i,()=>v()),_({TextGeometry:mV});let y=new SV,b=yn(),x=_n(()=>{var e;return s!=null&&s.value?s.value:b.default?(e=b.default()[0].children)?.trim():c.value?``:`TresJS`}),S=W();t({instance:S});let C=([n,r]=$t(()=>new Promise((e,t)=>{try{typeof o.value==`string`?y.load(o.value,t=>{e(t)}):e(o.value)}catch(e){t(console.error(`cientos`,e))}})),n=await n,r(),n),w=_n(()=>({font:C,size:on(l),height:on(u),curveSegments:on(d),bevelEnabled:on(f),bevelThickness:on(p),bevelSize:on(m),bevelOffset:on(h),bevelSegments:on(g)}));return Nn(()=>{S.value&&c.value&&(S.value.geometry.dispose(),S.value.geometry=new mV(x.value,w.value),a.value&&S.value.geometry.center())}),(e,t)=>H(o)?(K(),On(`TresMesh`,{key:0,ref_key:`text3DRef`,ref:S},[x.value?(K(),On(`TresTextGeometry`,{key:0,args:[x.value,w.value],center:H(a)},null,8,qH)):En(``,!0),Qt(e.$slots,`default`)],512)):En(``,!0)}});function YH(e){let t=U(null),{height:n,width:r,settings:i,depth:a,autoRender:o=U(!0)}=ln(e)?un(e):un(nn(e)),{onBeforeRender:s}=be(),{camera:c,renderer:l,scene:u,sizes:d,invalidate:f}=De();return G(()=>[r?.value,d.width.value,n?.value,d.height.value],()=>{var e;(e=t.value)==null||e.dispose(),t.value=new re(r?.value||d.width.value,n?.value||d.height.value,{minFilter:$e,magFilter:$e,type:wt,...i?.value}),a!=null&&a.value&&(t.value.depthTexture=new Wt(r?.value||d.width.value,n?.value||d.height.value,bt)),f()},{immediate:!0}),s(()=>{o.value&&(l.value.setRenderTarget(t.value),l.value.clear(),l.value.render(u.value,c.value),l.value.setRenderTarget(null))},1/0),kn(()=>{var e;(e=t.value)==null||e.dispose()}),t}const XH=Tn({__name:`component`,props:{width:{},height:{},depth:{type:Boolean,default:!1},settings:{default:void 0},autoRender:{type:Boolean,default:!0}},setup(e,{expose:t}){let n=YH(e);return t({instance:n}),()=>{}}}),ZH=(e,t=16,n,r,i)=>{let a=new Float32Array(t*16),o=U(new Pe(a,16));return(()=>{if(!e)return;let a=new kB(e);r&&a.setWeightAttribute(r),a.build();let s=new B,c=new B,l=new ge,u=new _e;e.updateMatrixWorld(!0);for(let r=0;ro()),Nn(()=>{var e,t;i.value=n.instanceMesh??(e=r.value)?.children.find(e=>Object.prototype.hasOwnProperty.call(e,`instanceMatrix`)),a.value=n.mesh??(t=r.value)?.children.find(e=>e.type===`Mesh`),ZH(a.value,n.count,i.value,n.weight,n.transform)}),t({samplerRef:r}),(e,t)=>(K(),On(`TresGroup`,{ref_key:`samplerRef`,ref:r},[Qt(e.$slots,`default`)],512))}}),$H=new B,eU=new B,tU=new B,nU=(e,t,n)=>{let r=n.width/2,i=n.height/2;t.updateMatrixWorld(!1);let a=e.project(t);return a.x=a.x*r+r,a.y=-(a.y*i)+i,a},rU=(e,t,n,r=1)=>{let i=$H.set(e.x/n.width*2-1,-(e.y/n.height)*2+1,r);return i.unproject(t),i},iU=(e,t,n,r)=>{let i=nU(tU.copy(e),n,r),a=0;for(let o=0;o<2;++o){let s=eU.copy(i).setComponent(o,i.getComponent(o)+t),c=rU(s,n,r,s.z);a=Math.max(a,e.distanceTo(c))}return a},aU=Tn({__name:`ScreenSizer`,setup(e,{expose:t}){let n=new B,r=W(),i=W(),a=ye().sizes,o=_n(()=>({width:a.width.value,height:a.height.value}));return be().onBeforeRender(({camera:e})=>{let t=i.value;if(!t)return;let r=iU(t.getWorldPosition(n),1,e,o.value);t.scale.setScalar(r)}),t({instance:r}),(e,t)=>(K(),On(`TresObject3D`,{ref_key:`outerRef`,ref:r},[jn(`TresObject3D`,{ref_key:`innerRef`,ref:i},[Qt(e.$slots,`default`)],512)],512))}}),oU=[`color`],sU=Tn({__name:`Edges`,props:{color:{default:`#ff0000`},threshold:{default:15}},setup(e,{expose:t}){let n=e,{color:r,threshold:i}=un(n),a=W(),o=U(null),s=U(1);return t({instance:a}),G(()=>[a.value,i.value],()=>{if(a.value){let e=a.value.parent;if(e&&`geometry`in e&&e.geometry instanceof rt){let t=e.geometry;(t!==o.value||i.value!==s.value)&&(o.value=t,s.value=i.value,a.value.geometry=new Jt(t,i.value))}}}),(e,t)=>(K(),On(`TresLineSegments`,bn({ref_key:`lineSegmentsRef`,ref:a},e.$attrs),[Qt(e.$slots,`default`,{},()=>[jn(`TresLineBasicMaterial`,{color:H(r)},null,8,oU)])],16))}}),cU={sunset:`venice/venice_sunset_1k.hdr`,studio:`studio/poly_haven_studio_1k.hdr`,city:`city/canary_wharf_1k.hdr`,umbrellas:`outdoor/outdoor_umbrellas_1k.hdr`,night:`outdoor/satara_night_1k.hdr`,forest:`outood/mossy_forest_1k.hdr`,snow:`outdoor/snowy_forest_path_01_1k.hdr`,dawn:`kiara/kiara_1_dawn_1k.hdr`,hangar:`indoor/small_hangar_01_1k.hdr`,urban:`indoor/abandoned_games_room_02_1k.hdr`,modern:`city/modern_buildings_2_1k.hdr`,shangai:`city/shanghai_bund_1k.hdr`},lU=`https://raw.githubusercontent.com/Tresjs/assets/main/textures/hdr/`;function uU(e){return e instanceof Le?e:Array.isArray(e)?new Le(e[0],e[1],e[2]):typeof e==`number`?new Le(e,e,e):e instanceof B||typeof e==`object`&&`x`in e&&`y`in e&&`z`in e?new Le(e.x,e.y,e.z):null}function dU(e){e.traverse(e=>{e instanceof V&&e.material&&(e.material.needsUpdate=!0)})}async function fU(e,t){let{scene:n,invalidate:r}=De(),{preset:i,blur:a,files:o=U([]),path:s=U(``),background:c,backgroundIntensity:l=U(1),environmentIntensity:u=U(1),backgroundRotation:d=U([0,0,0]),environmentRotation:f=U([0,0,0]),syncMaterials:p=U(!1)}=un(e);G(e,()=>{r()});let m=U(null),h=_n(()=>Array.isArray(o.value)),g=_n(()=>h.value?Ke:EV);return G([o,s],async([e,t])=>{if(e&&e.length>0&&!(i!=null&&i.value)){try{let n=await Ee(g.value,h.value?[...H(e)]:H(e),e=>{t&&e.setPath(H(t))});m.value=Array.isArray(n)?n[0]:n}catch(e){throw Error(`Failed to load environment map: ${e}`)}m.value&&(m.value.mapping=h.value?Me:N)}},{immediate:!0}),G(m,e=>{n.value&&e&&(n.value.environment=e)},{immediate:!0}),G([c,m],([e,r])=>{if(n.value){let i=t!=null&&t.value?t.value.texture:r;i&&(n.value.background=e?i:null)}},{immediate:!0}),G(()=>a?.value,e=>{n.value&&e&&(n.value.backgroundBlurriness=e)},{immediate:!0}),G(()=>l?.value,e=>{n.value&&(n.value.backgroundIntensity=e??1)},{immediate:!0}),G(()=>u?.value,e=>{n.value&&(n.value.environmentIntensity=e??1)},{immediate:!0}),G(()=>d?.value,e=>{if(n.value){let t=uU(e);t&&(n.value.backgroundRotation=t)}},{immediate:!0}),G(()=>f?.value,e=>{if(n.value&&!(p!=null&&p.value)){let t=uU(e);t&&(n.value.environmentRotation=t,dU(n.value))}},{immediate:!0}),G(()=>i?.value,async e=>{if(e&&e in cU){let t=lU,n=cU[e];try{let e=await Ee(EV,n,e=>{e.setPath(t)});m.value=Array.isArray(e)?e[0]:e}catch(e){throw Error(`Failed to load environment map: ${e}`)}m.value&&(m.value.mapping=N),r()}else if(e&&!(e in cU))throw Error(`Preset must be one of: ${Object.keys(cU).join(`, `)}`)},{immediate:!0}),G([p,d],([e,t])=>{if(e&&n.value){let e=uU(t);e&&(n.value.environmentRotation=e,dU(n.value))}},{immediate:!0}),m} + }`),BH=$t({__name:`component`,props:{color:{default:`black`},screenspace:{type:Boolean,default:!1},opacity:{default:1},transparent:{type:Boolean,default:!1},thickness:{default:.05},angle:{default:Math.PI},toneMapped:{type:Boolean,default:!0},polygonOffset:{type:Boolean,default:!1},polygonOffsetFactor:{default:0},renderOrder:{default:0}},setup(e,{expose:t}){let n=e,r=W();t({instance:r});let i=new zH({...n}),a=new ct(1,1),o=0,s=null;function c(e){var t;let r=e.parent;if(!(!r||!r.geometry)&&(o!==n.angle||s!==r.geometry)){o=n.angle,s=r.geometry;let a=(t=e.children)?.[0];a&&(n.angle&&a.geometry.dispose(),e.remove(a)),r.skeleton?(a=new $e,a.material=i,a.bind(r.skeleton,r.bindMatrix),e.add(a)):r.isInstancedMesh?(a=new Ut(r.geometry,i,r.count),a.instanceMatrix=r.instanceMatrix,e.add(a)):(a=new V,a.material=i,e.add(a)),a.geometry=n.angle?VR(r.geometry,n.angle):r.geometry}}function l(){i.side=Ne,i.transparent=n.transparent,i.thickness=n.thickness,i.color=Se(n.color),i.opacity=n.opacity,i.size=a,i.screenspace=n.screenspace,i.toneMapped=n.toneMapped,i.polygonOffset=n.polygonOffset,i.polygonOffsetFactor=n.polygonOffsetFactor}let u=ye().sizes;return G(()=>[u.width.value,u.height.value],([e,t])=>{a.set(e,t)}),G(()=>[n.angle],()=>{r.value&&c(r.value)}),G(()=>[n.transparent,n.thickness,n.color,n.opacity,a,n.screenspace,n.toneMapped,n.polygonOffset,n.polygonOffsetFactor],()=>l(),{immediate:!0}),Pn(()=>c(r.value)),bn(()=>{var e;let t=(e=r.value)?.children[0];t&&(t.geometry.dispose(),i.dispose(),t.removeFromParent())}),(e,t)=>(K(),nn(`TresGroup`,{ref_key:`groupRef`,ref:r},null,512))}}),VH=[`args`],HH=$t({__name:`PositionalAudio`,props:{ready:{type:Boolean,default:!1},url:{},distance:{default:2},helper:{type:Boolean,default:!1},loop:{type:Boolean,default:!1},autoplay:{type:Boolean,default:!1},innerAngle:{default:360},outerAngle:{default:360},outerGain:{default:0}},emits:[`isPlaying`],async setup(e,{expose:t,emit:n}){let r,i,a=e,o=n,{ready:s,url:c,distance:l,helper:u,loop:d,autoplay:f,innerAngle:p,outerAngle:m,outerGain:h}=rn(a),{camera:g}=De(),_=W(null),v=W(null),y=W(null),b=ln(new se),x=()=>{var e,t,n;(e=_?.value)!=null&&e.isPlaying||((t=_?.value)==null||t.play(),o(`isPlaying`,(n=_?.value)?.isPlaying))},S=()=>{var e,t;(e=_?.value)!=null&&e.isPlaying&&(_.value.pause(),o(`isPlaying`,(t=_?.value)?.isPlaying))},C=()=>{var e;_.value&&(_.value.stop(),o(`isPlaying`,(e=_?.value)?.isPlaying))},w=()=>{if(!(_!=null&&_.value))return;C();let e=_.value;e.source&&e.disconnect()},T=()=>{var e,t;!(_!=null&&_.value)||!(v!=null&&v.value)||((e=v?.value)==null||e.dispose(),(t=_?.value)==null||t.remove(v?.value))},E=()=>{var e;if(_.value&&(_.value.setBuffer(y.value),_.value.setRefDistance(l.value),_.value.setLoop(d.value),_.value.setDirectionalCone(p.value,m.value,h.value),(e=v?.value)==null||e.update(),v!=null&&v.value)){let e=v.value.material[0];!e.visible&&m.value!==p.value&&(e.visible=!0)}},D=()=>{var e,t;E();let n=(e=_.value)?.parent,r=new R().setFromObject(n),i=(r.max.z-r.min.z)*2;v.value=new eH(_.value,i,32,16),(t=_?.value)==null||t.add(v.value),v.value.update()},O=()=>{var e;(e=g?.value)==null||e.remove(b),w(),T()};return t({instance:_,play:x,stop:C,pause:S,dispose:O}),y.value=([r,i]=En(()=>Ee(ot,c.value)),r=await r,i(),r),G(_,()=>{_!=null&&_.value&&(u.value&&D(),s.value&&f&&x())}),G(u,()=>{u.value?D():T()}),G(s,()=>{s.value&&E(),f.value&&s.value&&x(),!f.value&&s.value&&C()}),G([l,d,y,p,m,h,f],()=>{E()}),Pn(()=>{var e;(e=g?.value)==null||e.add(b)}),yn(()=>{O()}),(e,t)=>(K(),nn(`TresPositionalAudio`,jn({ref_key:`positionalAudioRef`,ref:_,args:[H(b)]},e.$attrs),null,16,VH))}}),UH=[`args`,`material-uniforms-color-value`],WH=$t({__name:`Reflector`,props:{color:{default:`#333`},textureWidth:{default:512},textureHeight:{default:512},clipBias:{default:0},multisample:{default:4},shader:{default:uB.ReflectorShader}},setup(e,{expose:t}){let n=e,{extend:r,invalidate:i}=De(),a=W();r({Reflector:uB});let{color:o,textureWidth:s,textureHeight:c,clipBias:l,multisample:u,shader:d}=rn(n);return G(n,()=>i()),t({instance:a}),(e,t)=>(K(),nn(`TresReflector`,{ref_key:`reflectorRef`,ref:a,args:[void 0,{textureWidth:H(s),textureHeight:H(c),clipBias:H(l),multisample:H(u),shader:H(d)}],"material-uniforms-color-value":H(o)},[Tn(e.$slots,`default`,{},()=>[t[0]||=xn(`TresPlaneGeometry`,{args:[5,5]},null,-1)])],8,UH))}}),GH=[`position-z`],KH=$t({__name:`ScreenSpace`,props:{depth:{default:-1}},setup(e,{expose:t}){let n=W();return be().onBeforeRender(({camera:e})=>{n.value&&(n.value.quaternion.copy(e.quaternion),n.value.position.copy(e.position))}),t({instance:n}),(e,t)=>(K(),nn(`TresGroup`,{ref_key:`outerRef`,ref:n},[xn(`TresGroup`,{"position-z":-e.depth},[Tn(e.$slots,`default`)],8,GH)],512))}}),qH=[`args`,`center`],JH=$t({__name:`Text3D`,props:{font:{},text:{},size:{default:.5},height:{default:.2},curveSegments:{default:5},bevelEnabled:{type:Boolean,default:!0},bevelThickness:{default:.05},bevelSize:{default:.02},bevelOffset:{default:0},bevelSegments:{default:4},center:{type:Boolean,default:!1},needUpdates:{type:Boolean,default:!1}},async setup(e,{expose:t}){let n,r,i=e,{center:a,font:o,text:s,needUpdates:c,size:l,height:u,curveSegments:d,bevelEnabled:f,bevelThickness:p,bevelSize:m,bevelOffset:h,bevelSegments:g}=rn(i),{extend:_,invalidate:v}=De();G(i,()=>v()),_({TextGeometry:mV});let y=new SV,b=An(),x=On(()=>{var e;return s!=null&&s.value?s.value:b.default?(e=b.default()[0].children)?.trim():c.value?``:`TresJS`}),S=W();t({instance:S});let C=([n,r]=En(()=>new Promise((e,t)=>{try{typeof o.value==`string`?y.load(o.value,t=>{e(t)}):e(o.value)}catch(e){t(console.error(`cientos`,e))}})),n=await n,r(),n),w=On(()=>({font:C,size:un(l),height:un(u),curveSegments:un(d),bevelEnabled:un(f),bevelThickness:un(p),bevelSize:un(m),bevelOffset:un(h),bevelSegments:un(g)}));return Cn(()=>{S.value&&c.value&&(S.value.geometry.dispose(),S.value.geometry=new mV(x.value,w.value),a.value&&S.value.geometry.center())}),(e,t)=>H(o)?(K(),nn(`TresMesh`,{key:0,ref_key:`text3DRef`,ref:S},[x.value?(K(),nn(`TresTextGeometry`,{key:0,args:[x.value,w.value],center:H(a)},null,8,qH)):en(``,!0),Tn(e.$slots,`default`)],512)):en(``,!0)}});function YH(e){let t=U(null),{height:n,width:r,settings:i,depth:a,autoRender:o=U(!0)}=pn(e)?rn(e):rn(sn(e)),{onBeforeRender:s}=be(),{camera:c,renderer:l,scene:u,sizes:d,invalidate:f}=De();return G(()=>[r?.value,d.width.value,n?.value,d.height.value],()=>{var e;(e=t.value)==null||e.dispose(),t.value=new ne(r?.value||d.width.value,n?.value||d.height.value,{minFilter:Ze,magFilter:Ze,type:St,...i?.value}),a!=null&&a.value&&(t.value.depthTexture=new Ht(r?.value||d.width.value,n?.value||d.height.value,vt)),f()},{immediate:!0}),s(()=>{o.value&&(l.value.setRenderTarget(t.value),l.value.clear(),l.value.render(u.value,c.value),l.value.setRenderTarget(null))},1/0),yn(()=>{var e;(e=t.value)==null||e.dispose()}),t}const XH=$t({__name:`component`,props:{width:{},height:{},depth:{type:Boolean,default:!1},settings:{default:void 0},autoRender:{type:Boolean,default:!0}},setup(e,{expose:t}){let n=YH(e);return t({instance:n}),()=>{}}}),ZH=(e,t=16,n,r,i)=>{let a=new Float32Array(t*16),o=U(new Me(a,16));return(()=>{if(!e)return;let a=new kB(e);r&&a.setWeightAttribute(r),a.build();let s=new B,c=new B,l=new me,u=new he;e.updateMatrixWorld(!0);for(let r=0;ro()),Cn(()=>{var e,t;i.value=n.instanceMesh??(e=r.value)?.children.find(e=>Object.prototype.hasOwnProperty.call(e,`instanceMatrix`)),a.value=n.mesh??(t=r.value)?.children.find(e=>e.type===`Mesh`),ZH(a.value,n.count,i.value,n.weight,n.transform)}),t({samplerRef:r}),(e,t)=>(K(),nn(`TresGroup`,{ref_key:`samplerRef`,ref:r},[Tn(e.$slots,`default`)],512))}}),$H=new B,eU=new B,tU=new B,nU=(e,t,n)=>{let r=n.width/2,i=n.height/2;t.updateMatrixWorld(!1);let a=e.project(t);return a.x=a.x*r+r,a.y=-(a.y*i)+i,a},rU=(e,t,n,r=1)=>{let i=$H.set(e.x/n.width*2-1,-(e.y/n.height)*2+1,r);return i.unproject(t),i},iU=(e,t,n,r)=>{let i=nU(tU.copy(e),n,r),a=0;for(let o=0;o<2;++o){let s=eU.copy(i).setComponent(o,i.getComponent(o)+t),c=rU(s,n,r,s.z);a=Math.max(a,e.distanceTo(c))}return a},aU=$t({__name:`ScreenSizer`,setup(e,{expose:t}){let n=new B,r=W(),i=W(),a=ye().sizes,o=On(()=>({width:a.width.value,height:a.height.value}));return be().onBeforeRender(({camera:e})=>{let t=i.value;if(!t)return;let r=iU(t.getWorldPosition(n),1,e,o.value);t.scale.setScalar(r)}),t({instance:r}),(e,t)=>(K(),nn(`TresObject3D`,{ref_key:`outerRef`,ref:r},[xn(`TresObject3D`,{ref_key:`innerRef`,ref:i},[Tn(e.$slots,`default`)],512)],512))}}),oU=[`color`],sU=$t({__name:`Edges`,props:{color:{default:`#ff0000`},threshold:{default:15}},setup(e,{expose:t}){let n=e,{color:r,threshold:i}=rn(n),a=W(),o=U(null),s=U(1);return t({instance:a}),G(()=>[a.value,i.value],()=>{if(a.value){let e=a.value.parent;if(e&&`geometry`in e&&e.geometry instanceof tt){let t=e.geometry;(t!==o.value||i.value!==s.value)&&(o.value=t,s.value=i.value,a.value.geometry=new Gt(t,i.value))}}}),(e,t)=>(K(),nn(`TresLineSegments`,jn({ref_key:`lineSegmentsRef`,ref:a},e.$attrs),[Tn(e.$slots,`default`,{},()=>[xn(`TresLineBasicMaterial`,{color:H(r)},null,8,oU)])],16))}}),cU={sunset:`venice/venice_sunset_1k.hdr`,studio:`studio/poly_haven_studio_1k.hdr`,city:`city/canary_wharf_1k.hdr`,umbrellas:`outdoor/outdoor_umbrellas_1k.hdr`,night:`outdoor/satara_night_1k.hdr`,forest:`outood/mossy_forest_1k.hdr`,snow:`outdoor/snowy_forest_path_01_1k.hdr`,dawn:`kiara/kiara_1_dawn_1k.hdr`,hangar:`indoor/small_hangar_01_1k.hdr`,urban:`indoor/abandoned_games_room_02_1k.hdr`,modern:`city/modern_buildings_2_1k.hdr`,shangai:`city/shanghai_bund_1k.hdr`},lU=`https://raw.githubusercontent.com/Tresjs/assets/main/textures/hdr/`;function uU(e){return e instanceof Le?e:Array.isArray(e)?new Le(e[0],e[1],e[2]):typeof e==`number`?new Le(e,e,e):e instanceof B||typeof e==`object`&&`x`in e&&`y`in e&&`z`in e?new Le(e.x,e.y,e.z):null}function dU(e){e.traverse(e=>{e instanceof V&&e.material&&(e.material.needsUpdate=!0)})}async function fU(e,t){let{scene:n,invalidate:r}=De(),{preset:i,blur:a,files:o=U([]),path:s=U(``),background:c,backgroundIntensity:l=U(1),environmentIntensity:u=U(1),backgroundRotation:d=U([0,0,0]),environmentRotation:f=U([0,0,0]),syncMaterials:p=U(!1)}=rn(e);G(e,()=>{r()});let m=U(null),h=On(()=>Array.isArray(o.value)),g=On(()=>h.value?We:EV);return G([o,s],async([e,t])=>{if(e&&e.length>0&&!(i!=null&&i.value)){try{let n=await Ee(g.value,h.value?[...H(e)]:H(e),e=>{t&&e.setPath(H(t))});m.value=Array.isArray(n)?n[0]:n}catch(e){throw Error(`Failed to load environment map: ${e}`)}m.value&&(m.value.mapping=h.value?Ct:Ue)}},{immediate:!0}),G(m,e=>{n.value&&e&&(n.value.environment=e)},{immediate:!0}),G([c,m],([e,r])=>{if(n.value){let i=t!=null&&t.value?t.value.texture:r;i&&(n.value.background=e?i:null)}},{immediate:!0}),G(()=>a?.value,e=>{n.value&&e&&(n.value.backgroundBlurriness=e)},{immediate:!0}),G(()=>l?.value,e=>{n.value&&(n.value.backgroundIntensity=e??1)},{immediate:!0}),G(()=>u?.value,e=>{n.value&&(n.value.environmentIntensity=e??1)},{immediate:!0}),G(()=>d?.value,e=>{if(n.value){let t=uU(e);t&&(n.value.backgroundRotation=t)}},{immediate:!0}),G(()=>f?.value,e=>{if(n.value&&!(p!=null&&p.value)){let t=uU(e);t&&(n.value.environmentRotation=t,dU(n.value))}},{immediate:!0}),G(()=>i?.value,async e=>{if(e&&e in cU){let t=lU,n=cU[e];try{let e=await Ee(EV,n,e=>{e.setPath(t)});m.value=Array.isArray(e)?e[0]:e}catch(e){throw Error(`Failed to load environment map: ${e}`)}m.value&&(m.value.mapping=Ue),r()}else if(e&&!(e in cU))throw Error(`Preset must be one of: ${Object.keys(cU).join(`, `)}`)},{immediate:!0}),G([p,d],([e,t])=>{if(e&&n.value){let e=uU(t);e&&(n.value.environmentRotation=e,dU(n.value))}},{immediate:!0}),m} /*! * camera-controls * https://github.com/yomotsu/camera-controls * (c) 2017 @yomotsu * Released under the MIT License. */ -const pU={LEFT:1,RIGHT:2,MIDDLE:4},$=Object.freeze({NONE:0,ROTATE:1,TRUCK:2,OFFSET:4,DOLLY:8,ZOOM:16,TOUCH_ROTATE:32,TOUCH_TRUCK:64,TOUCH_OFFSET:128,TOUCH_DOLLY:256,TOUCH_ZOOM:512,TOUCH_DOLLY_TRUCK:1024,TOUCH_DOLLY_OFFSET:2048,TOUCH_DOLLY_ROTATE:4096,TOUCH_ZOOM_TRUCK:8192,TOUCH_ZOOM_OFFSET:16384,TOUCH_ZOOM_ROTATE:32768}),mU={NONE:0,IN:1,OUT:-1};function hU(e){return e.isPerspectiveCamera}function gU(e){return e.isOrthographicCamera}const _U=Math.PI*2,vU=Math.PI/2,yU=1e-5,bU=Math.PI/180;function xU(e,t,n){return Math.max(t,Math.min(n,e))}function SU(e,t=yU){return Math.abs(e)0==p>u&&(p=u,n.value=(p-u)/a),p}function OU(e,t,n,r,i=1/0,a,o){r=Math.max(1e-4,r);let s=2/r,c=s*a,l=1/(1+c+.48*c*c+.235*c*c*c),u=t.x,d=t.y,f=t.z,p=e.x-u,m=e.y-d,h=e.z-f,g=u,_=d,v=f,y=i*r,b=y*y,x=p*p+m*m+h*h;if(x>b){let e=Math.sqrt(x);p=p/e*y,m=m/e*y,h=h/e*y}u=e.x-p,d=e.y-m,f=e.z-h;let S=(n.x+s*p)*a,C=(n.y+s*m)*a,w=(n.z+s*h)*a;n.x=(n.x-s*S)*l,n.y=(n.y-s*C)*l,n.z=(n.z-s*w)*l,o.x=u+(p+S)*l,o.y=d+(m+C)*l,o.z=f+(h+w)*l;let T=g-e.x,E=_-e.y,D=v-e.z,O=o.x-g,k=o.y-_,A=o.z-v;return T*O+E*k+D*A>0&&(o.x=g,o.y=_,o.z=v,n.x=(o.x-g)/a,n.y=(o.y-_)/a,n.z=(o.z-v)/a),o}function kU(e,t){t.set(0,0),e.forEach(e=>{t.x+=e.clientX,t.y+=e.clientY}),t.x/=e.length,t.y/=e.length}function AU(e,t){return gU(e)?(console.warn(`${t} is not supported in OrthographicCamera`),!0):!1}var jU=class{constructor(){this._listeners={}}addEventListener(e,t){let n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){let n=this._listeners;return n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){let n=this._listeners[e];if(n!==void 0){let e=n.indexOf(t);e!==-1&&n.splice(e,1)}}removeAllEventListeners(e){if(!e){this._listeners={};return}Array.isArray(this._listeners[e])&&(this._listeners[e].length=0)}dispatchEvent(e){let t=this._listeners[e.type];if(t!==void 0){e.target=this;let n=t.slice(0);for(let t=0,r=n.length;t{},this._enabled=!0,this._state=$.NONE,this._viewport=null,this._changedDolly=0,this._changedZoom=0,this._hasRested=!0,this._boundaryEnclosesCamera=!1,this._needsUpdate=!0,this._updatedLastTime=!1,this._elementRect=new DOMRect,this._isDragging=!1,this._dragNeedsUpdate=!0,this._activePointers=[],this._lockedPointer=null,this._interactiveArea=new DOMRect(0,0,1,1),this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._isUserControllingOffset=!1,this._isUserControllingZoom=!1,this._lastDollyDirection=mU.NONE,this._thetaVelocity={value:0},this._phiVelocity={value:0},this._radiusVelocity={value:0},this._targetVelocity=new IU.Vector3,this._focalOffsetVelocity=new IU.Vector3,this._zoomVelocity={value:0},this._truckInternal=(e,t,n)=>{let r,i;if(hU(this._camera)){let n=VU.copy(this._camera.position).sub(this._target),a=this._camera.getEffectiveFOV()*bU,o=n.length()*Math.tan(a*.5);r=this.truckSpeed*e*o/this._elementRect.height,i=this.truckSpeed*t*o/this._elementRect.height}else if(gU(this._camera)){let n=this._camera;r=e*(n.right-n.left)/n.zoom/this._elementRect.width,i=t*(n.top-n.bottom)/n.zoom/this._elementRect.height}else return;this.verticalDragToForward?(n?this.setFocalOffset(this._focalOffsetEnd.x+r,this._focalOffsetEnd.y,this._focalOffsetEnd.z,!0):this.truck(r,0,!0),this.forward(-i,!0)):n?this.setFocalOffset(this._focalOffsetEnd.x+r,this._focalOffsetEnd.y+i,this._focalOffsetEnd.z,!0):this.truck(r,i,!0)},this._rotateInternal=(e,t)=>{let n=_U*this.azimuthRotateSpeed*e/this._elementRect.height,r=_U*this.polarRotateSpeed*t/this._elementRect.height;this.rotate(n,r,!0)},this._dollyInternal=(e,t,n)=>{let r=.95**(-e*this.dollySpeed),i=this._sphericalEnd.radius,a=this._sphericalEnd.radius*r,o=xU(a,this.minDistance,this.maxDistance),s=o-a;this.infinityDolly&&this.dollyToCursor?this._dollyToNoClamp(a,!0):(this.infinityDolly&&!this.dollyToCursor&&this.dollyInFixed(s,!0),this._dollyToNoClamp(o,!0)),this.dollyToCursor&&(this._changedDolly+=(this.infinityDolly?a:o)-i,this._dollyControlCoord.set(t,n)),this._lastDollyDirection=Math.sign(-e)},this._zoomInternal=(e,t,n)=>{let r=.95**(e*this.dollySpeed),i=this._zoom,a=this._zoom*r;this.zoomTo(a,!0),this.dollyToCursor&&(this._changedZoom+=a-i,this._dollyControlCoord.set(t,n))},typeof IU>`u`&&console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."),this._camera=t,this._yAxisUpSpace=new IU.Quaternion().setFromUnitVectors(this._camera.up,RU),this._yAxisUpSpaceInverse=this._yAxisUpSpace.clone().invert(),this._state=$.NONE,this._target=new IU.Vector3,this._targetEnd=this._target.clone(),this._focalOffset=new IU.Vector3,this._focalOffsetEnd=this._focalOffset.clone(),this._spherical=new IU.Spherical().setFromVector3(VU.copy(this._camera.position).applyQuaternion(this._yAxisUpSpace)),this._sphericalEnd=this._spherical.clone(),this._lastDistance=this._spherical.radius,this._zoom=this._camera.zoom,this._zoomEnd=this._zoom,this._lastZoom=this._zoom,this._nearPlaneCorners=[new IU.Vector3,new IU.Vector3,new IU.Vector3,new IU.Vector3],this._updateNearPlaneCorners(),this._boundary=new IU.Box3(new IU.Vector3(-1/0,-1/0,-1/0),new IU.Vector3(1/0,1/0,1/0)),this._cameraUp0=this._camera.up.clone(),this._target0=this._target.clone(),this._position0=this._camera.position.clone(),this._zoom0=this._zoom,this._focalOffset0=this._focalOffset.clone(),this._dollyControlCoord=new IU.Vector2,this.mouseButtons={left:$.ROTATE,middle:$.DOLLY,right:$.TRUCK,wheel:hU(this._camera)?$.DOLLY:gU(this._camera)?$.ZOOM:$.NONE},this.touches={one:$.TOUCH_ROTATE,two:hU(this._camera)?$.TOUCH_DOLLY_TRUCK:gU(this._camera)?$.TOUCH_ZOOM_TRUCK:$.NONE,three:$.TOUCH_TRUCK};let r=new IU.Vector2,i=new IU.Vector2,a=new IU.Vector2,o=e=>{if(!this._enabled||!this._domElement)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){let t=this._domElement.getBoundingClientRect(),n=e.clientX/t.width,r=e.clientY/t.height;if(nthis._interactiveArea.right||rthis._interactiveArea.bottom)return}let t=e.pointerType===`mouse`?(e.buttons&pU.LEFT)===pU.LEFT?pU.LEFT:(e.buttons&pU.MIDDLE)===pU.MIDDLE?pU.MIDDLE:(e.buttons&pU.RIGHT)===pU.RIGHT?pU.RIGHT:null:null;if(t!==null){let e=this._findPointerByMouseButton(t);e&&this._disposePointer(e)}if((e.buttons&pU.LEFT)===pU.LEFT&&this._lockedPointer)return;let n={pointerId:e.pointerId,clientX:e.clientX,clientY:e.clientY,deltaX:0,deltaY:0,mouseButton:t};this._activePointers.push(n),this._domElement.ownerDocument.removeEventListener(`pointermove`,s,{passive:!1}),this._domElement.ownerDocument.removeEventListener(`pointerup`,c),this._domElement.ownerDocument.addEventListener(`pointermove`,s,{passive:!1}),this._domElement.ownerDocument.addEventListener(`pointerup`,c),this._isDragging=!0,f(e)},s=e=>{e.cancelable&&e.preventDefault();let t=e.pointerId,n=this._lockedPointer||this._findPointerById(t);if(n){if(n.clientX=e.clientX,n.clientY=e.clientY,n.deltaX=e.movementX,n.deltaY=e.movementY,this._state=0,e.pointerType===`touch`)switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else (!this._isDragging&&this._lockedPointer||this._isDragging&&(e.buttons&pU.LEFT)===pU.LEFT)&&(this._state|=this.mouseButtons.left),this._isDragging&&(e.buttons&pU.MIDDLE)===pU.MIDDLE&&(this._state|=this.mouseButtons.middle),this._isDragging&&(e.buttons&pU.RIGHT)===pU.RIGHT&&(this._state|=this.mouseButtons.right);p()}},c=e=>{let t=this._findPointerById(e.pointerId);if(!(t&&t===this._lockedPointer)){if(t&&this._disposePointer(t),e.pointerType===`touch`)switch(this._activePointers.length){case 0:this._state=$.NONE;break;case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else this._state=$.NONE;m()}},l=-1,u=e=>{if(!this._domElement||!this._enabled||this.mouseButtons.wheel===$.NONE)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){let t=this._domElement.getBoundingClientRect(),n=e.clientX/t.width,r=e.clientY/t.height;if(nthis._interactiveArea.right||rthis._interactiveArea.bottom)return}if(e.preventDefault(),this.dollyToCursor||this.mouseButtons.wheel===$.ROTATE||this.mouseButtons.wheel===$.TRUCK){let e=performance.now();l-e<1e3&&this._getClientRect(this._elementRect),l=e}let t=FU?-1:-3,n=e.deltaMode===1?e.deltaY/t:e.deltaY/(t*10),r=this.dollyToCursor?(e.clientX-this._elementRect.x)/this._elementRect.width*2-1:0,i=this.dollyToCursor?(e.clientY-this._elementRect.y)/this._elementRect.height*-2+1:0;switch(this.mouseButtons.wheel){case $.ROTATE:this._rotateInternal(e.deltaX,e.deltaY),this._isUserControllingRotate=!0;break;case $.TRUCK:this._truckInternal(e.deltaX,e.deltaY,!1),this._isUserControllingTruck=!0;break;case $.OFFSET:this._truckInternal(e.deltaX,e.deltaY,!0),this._isUserControllingOffset=!0;break;case $.DOLLY:this._dollyInternal(-n,r,i),this._isUserControllingDolly=!0;break;case $.ZOOM:this._zoomInternal(-n,r,i),this._isUserControllingZoom=!0;break}this.dispatchEvent({type:`control`})},d=t=>{if(!(!this._domElement||!this._enabled)){if(this.mouseButtons.right===e.ACTION.NONE){let e=t instanceof PointerEvent?t.pointerId:0,n=this._findPointerById(e);n&&this._disposePointer(n),this._domElement.ownerDocument.removeEventListener(`pointermove`,s,{passive:!1}),this._domElement.ownerDocument.removeEventListener(`pointerup`,c);return}t.preventDefault()}},f=e=>{if(this._enabled){if(kU(this._activePointers,BU),this._getClientRect(this._elementRect),r.copy(BU),i.copy(BU),this._activePointers.length>=2){let e=BU.x-this._activePointers[1].clientX,t=BU.y-this._activePointers[1].clientY,n=Math.sqrt(e*e+t*t);a.set(0,n);let r=(this._activePointers[0].clientX+this._activePointers[1].clientX)*.5,o=(this._activePointers[0].clientY+this._activePointers[1].clientY)*.5;i.set(r,o)}if(this._state=0,!e)this._lockedPointer&&(this._state|=this.mouseButtons.left);else if(`pointerType`in e&&e.pointerType===`touch`)switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else !this._lockedPointer&&(e.buttons&pU.LEFT)===pU.LEFT&&(this._state|=this.mouseButtons.left),(e.buttons&pU.MIDDLE)===pU.MIDDLE&&(this._state|=this.mouseButtons.middle),(e.buttons&pU.RIGHT)===pU.RIGHT&&(this._state|=this.mouseButtons.right);((this._state&$.ROTATE)===$.ROTATE||(this._state&$.TOUCH_ROTATE)===$.TOUCH_ROTATE||(this._state&$.TOUCH_DOLLY_ROTATE)===$.TOUCH_DOLLY_ROTATE||(this._state&$.TOUCH_ZOOM_ROTATE)===$.TOUCH_ZOOM_ROTATE)&&(this._sphericalEnd.theta=this._spherical.theta,this._sphericalEnd.phi=this._spherical.phi,this._thetaVelocity.value=0,this._phiVelocity.value=0),((this._state&$.TRUCK)===$.TRUCK||(this._state&$.TOUCH_TRUCK)===$.TOUCH_TRUCK||(this._state&$.TOUCH_DOLLY_TRUCK)===$.TOUCH_DOLLY_TRUCK||(this._state&$.TOUCH_ZOOM_TRUCK)===$.TOUCH_ZOOM_TRUCK)&&(this._targetEnd.copy(this._target),this._targetVelocity.set(0,0,0)),((this._state&$.DOLLY)===$.DOLLY||(this._state&$.TOUCH_DOLLY)===$.TOUCH_DOLLY||(this._state&$.TOUCH_DOLLY_TRUCK)===$.TOUCH_DOLLY_TRUCK||(this._state&$.TOUCH_DOLLY_OFFSET)===$.TOUCH_DOLLY_OFFSET||(this._state&$.TOUCH_DOLLY_ROTATE)===$.TOUCH_DOLLY_ROTATE)&&(this._sphericalEnd.radius=this._spherical.radius,this._radiusVelocity.value=0),((this._state&$.ZOOM)===$.ZOOM||(this._state&$.TOUCH_ZOOM)===$.TOUCH_ZOOM||(this._state&$.TOUCH_ZOOM_TRUCK)===$.TOUCH_ZOOM_TRUCK||(this._state&$.TOUCH_ZOOM_OFFSET)===$.TOUCH_ZOOM_OFFSET||(this._state&$.TOUCH_ZOOM_ROTATE)===$.TOUCH_ZOOM_ROTATE)&&(this._zoomEnd=this._zoom,this._zoomVelocity.value=0),((this._state&$.OFFSET)===$.OFFSET||(this._state&$.TOUCH_OFFSET)===$.TOUCH_OFFSET||(this._state&$.TOUCH_DOLLY_OFFSET)===$.TOUCH_DOLLY_OFFSET||(this._state&$.TOUCH_ZOOM_OFFSET)===$.TOUCH_ZOOM_OFFSET)&&(this._focalOffsetEnd.copy(this._focalOffset),this._focalOffsetVelocity.set(0,0,0)),this.dispatchEvent({type:`controlstart`})}},p=()=>{if(!this._enabled||!this._dragNeedsUpdate)return;this._dragNeedsUpdate=!1,kU(this._activePointers,BU);let e=this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement?this._lockedPointer||this._activePointers[0]:null,t=e?-e.deltaX:i.x-BU.x,n=e?-e.deltaY:i.y-BU.y;if(i.copy(BU),((this._state&$.ROTATE)===$.ROTATE||(this._state&$.TOUCH_ROTATE)===$.TOUCH_ROTATE||(this._state&$.TOUCH_DOLLY_ROTATE)===$.TOUCH_DOLLY_ROTATE||(this._state&$.TOUCH_ZOOM_ROTATE)===$.TOUCH_ZOOM_ROTATE)&&(this._rotateInternal(t,n),this._isUserControllingRotate=!0),(this._state&$.DOLLY)===$.DOLLY||(this._state&$.ZOOM)===$.ZOOM){let e=this.dollyToCursor?(r.x-this._elementRect.x)/this._elementRect.width*2-1:0,t=this.dollyToCursor?(r.y-this._elementRect.y)/this._elementRect.height*-2+1:0,i=this.dollyDragInverted?-1:1;(this._state&$.DOLLY)===$.DOLLY?(this._dollyInternal(i*n*PU,e,t),this._isUserControllingDolly=!0):(this._zoomInternal(i*n*PU,e,t),this._isUserControllingZoom=!0)}if((this._state&$.TOUCH_DOLLY)===$.TOUCH_DOLLY||(this._state&$.TOUCH_ZOOM)===$.TOUCH_ZOOM||(this._state&$.TOUCH_DOLLY_TRUCK)===$.TOUCH_DOLLY_TRUCK||(this._state&$.TOUCH_ZOOM_TRUCK)===$.TOUCH_ZOOM_TRUCK||(this._state&$.TOUCH_DOLLY_OFFSET)===$.TOUCH_DOLLY_OFFSET||(this._state&$.TOUCH_ZOOM_OFFSET)===$.TOUCH_ZOOM_OFFSET||(this._state&$.TOUCH_DOLLY_ROTATE)===$.TOUCH_DOLLY_ROTATE||(this._state&$.TOUCH_ZOOM_ROTATE)===$.TOUCH_ZOOM_ROTATE){let e=BU.x-this._activePointers[1].clientX,t=BU.y-this._activePointers[1].clientY,n=Math.sqrt(e*e+t*t),r=a.y-n;a.set(0,n);let o=this.dollyToCursor?(i.x-this._elementRect.x)/this._elementRect.width*2-1:0,s=this.dollyToCursor?(i.y-this._elementRect.y)/this._elementRect.height*-2+1:0;(this._state&$.TOUCH_DOLLY)===$.TOUCH_DOLLY||(this._state&$.TOUCH_DOLLY_ROTATE)===$.TOUCH_DOLLY_ROTATE||(this._state&$.TOUCH_DOLLY_TRUCK)===$.TOUCH_DOLLY_TRUCK||(this._state&$.TOUCH_DOLLY_OFFSET)===$.TOUCH_DOLLY_OFFSET?(this._dollyInternal(r*PU,o,s),this._isUserControllingDolly=!0):(this._zoomInternal(r*PU,o,s),this._isUserControllingZoom=!0)}((this._state&$.TRUCK)===$.TRUCK||(this._state&$.TOUCH_TRUCK)===$.TOUCH_TRUCK||(this._state&$.TOUCH_DOLLY_TRUCK)===$.TOUCH_DOLLY_TRUCK||(this._state&$.TOUCH_ZOOM_TRUCK)===$.TOUCH_ZOOM_TRUCK)&&(this._truckInternal(t,n,!1),this._isUserControllingTruck=!0),((this._state&$.OFFSET)===$.OFFSET||(this._state&$.TOUCH_OFFSET)===$.TOUCH_OFFSET||(this._state&$.TOUCH_DOLLY_OFFSET)===$.TOUCH_DOLLY_OFFSET||(this._state&$.TOUCH_ZOOM_OFFSET)===$.TOUCH_ZOOM_OFFSET)&&(this._truckInternal(t,n,!0),this._isUserControllingOffset=!0),this.dispatchEvent({type:`control`})},m=()=>{kU(this._activePointers,BU),i.copy(BU),this._dragNeedsUpdate=!1,(this._activePointers.length===0||this._activePointers.length===1&&this._activePointers[0]===this._lockedPointer)&&(this._isDragging=!1),this._activePointers.length===0&&this._domElement&&(this._domElement.ownerDocument.removeEventListener(`pointermove`,s,{passive:!1}),this._domElement.ownerDocument.removeEventListener(`pointerup`,c),this.dispatchEvent({type:`controlend`}))};this.lockPointer=()=>{!this._enabled||!this._domElement||(this.cancel(),this._lockedPointer={pointerId:-1,clientX:0,clientY:0,deltaX:0,deltaY:0,mouseButton:null},this._activePointers.push(this._lockedPointer),this._domElement.ownerDocument.removeEventListener(`pointermove`,s,{passive:!1}),this._domElement.ownerDocument.removeEventListener(`pointerup`,c),this._domElement.requestPointerLock(),this._domElement.ownerDocument.addEventListener(`pointerlockchange`,h),this._domElement.ownerDocument.addEventListener(`pointerlockerror`,g),this._domElement.ownerDocument.addEventListener(`pointermove`,s,{passive:!1}),this._domElement.ownerDocument.addEventListener(`pointerup`,c),f())},this.unlockPointer=()=>{var e,t,n;this._lockedPointer!==null&&(this._disposePointer(this._lockedPointer),this._lockedPointer=null),(e=this._domElement)==null||e.ownerDocument.exitPointerLock(),(t=this._domElement)==null||t.ownerDocument.removeEventListener(`pointerlockchange`,h),(n=this._domElement)==null||n.ownerDocument.removeEventListener(`pointerlockerror`,g),this.cancel()};let h=()=>{this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement||this.unlockPointer()},g=()=>{this.unlockPointer()};this._addAllEventListeners=e=>{this._domElement=e,this._domElement.style.touchAction=`none`,this._domElement.style.userSelect=`none`,this._domElement.style.webkitUserSelect=`none`,this._domElement.addEventListener(`pointerdown`,o),this._domElement.addEventListener(`pointercancel`,c),this._domElement.addEventListener(`wheel`,u,{passive:!1}),this._domElement.addEventListener(`contextmenu`,d)},this._removeAllEventListeners=()=>{this._domElement&&(this._domElement.style.touchAction=``,this._domElement.style.userSelect=``,this._domElement.style.webkitUserSelect=``,this._domElement.removeEventListener(`pointerdown`,o),this._domElement.removeEventListener(`pointercancel`,c),this._domElement.removeEventListener(`wheel`,u,{passive:!1}),this._domElement.removeEventListener(`contextmenu`,d),this._domElement.ownerDocument.removeEventListener(`pointermove`,s,{passive:!1}),this._domElement.ownerDocument.removeEventListener(`pointerup`,c),this._domElement.ownerDocument.removeEventListener(`pointerlockchange`,h),this._domElement.ownerDocument.removeEventListener(`pointerlockerror`,g))},this.cancel=()=>{this._state!==$.NONE&&(this._state=$.NONE,this._activePointers.length=0,m())},n&&this.connect(n),this.update(0)}get camera(){return this._camera}set camera(e){this._camera=e,this.updateCameraUp(),this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this._domElement&&(e?(this._domElement.style.touchAction=`none`,this._domElement.style.userSelect=`none`,this._domElement.style.webkitUserSelect=`none`):(this.cancel(),this._domElement.style.touchAction=``,this._domElement.style.userSelect=``,this._domElement.style.webkitUserSelect=``))}get active(){return!this._hasRested}get currentAction(){return this._state}get distance(){return this._spherical.radius}set distance(e){this._spherical.radius===e&&this._sphericalEnd.radius===e||(this._spherical.radius=e,this._sphericalEnd.radius=e,this._needsUpdate=!0)}get azimuthAngle(){return this._spherical.theta}set azimuthAngle(e){this._spherical.theta===e&&this._sphericalEnd.theta===e||(this._spherical.theta=e,this._sphericalEnd.theta=e,this._needsUpdate=!0)}get polarAngle(){return this._spherical.phi}set polarAngle(e){this._spherical.phi===e&&this._sphericalEnd.phi===e||(this._spherical.phi=e,this._sphericalEnd.phi=e,this._needsUpdate=!0)}get boundaryEnclosesCamera(){return this._boundaryEnclosesCamera}set boundaryEnclosesCamera(e){this._boundaryEnclosesCamera=e,this._needsUpdate=!0}set interactiveArea(e){this._interactiveArea.width=xU(e.width,0,1),this._interactiveArea.height=xU(e.height,0,1),this._interactiveArea.x=xU(e.x,0,1-this._interactiveArea.width),this._interactiveArea.y=xU(e.y,0,1-this._interactiveArea.height)}addEventListener(e,t){super.addEventListener(e,t)}removeEventListener(e,t){super.removeEventListener(e,t)}rotate(e,t,n=!1){return this.rotateTo(this._sphericalEnd.theta+e,this._sphericalEnd.phi+t,n)}rotateAzimuthTo(e,t=!1){return this.rotateTo(e,this._sphericalEnd.phi,t)}rotatePolarTo(e,t=!1){return this.rotateTo(this._sphericalEnd.theta,e,t)}rotateTo(e,t,n=!1){this._isUserControllingRotate=!1;let r=xU(e,this.minAzimuthAngle,this.maxAzimuthAngle),i=xU(t,this.minPolarAngle,this.maxPolarAngle);this._sphericalEnd.theta=r,this._sphericalEnd.phi=i,this._sphericalEnd.makeSafe(),this._needsUpdate=!0,n||(this._spherical.theta=this._sphericalEnd.theta,this._spherical.phi=this._sphericalEnd.phi);let a=!n||CU(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&CU(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold);return this._createOnRestPromise(a)}dolly(e,t=!1){return this.dollyTo(this._sphericalEnd.radius-e,t)}dollyTo(e,t=!1){return this._isUserControllingDolly=!1,this._lastDollyDirection=mU.NONE,this._changedDolly=0,this._dollyToNoClamp(xU(e,this.minDistance,this.maxDistance),t)}_dollyToNoClamp(e,t=!1){let n=this._sphericalEnd.radius;if(this.colliderMeshes.length>=1){let t=this._collisionTest(),r=CU(t,this._spherical.radius);if(!(n>e)&&r)return Promise.resolve();this._sphericalEnd.radius=Math.min(e,t)}else this._sphericalEnd.radius=e;this._needsUpdate=!0,t||(this._spherical.radius=this._sphericalEnd.radius);let r=!t||CU(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(r)}dollyInFixed(e,t=!1){this._targetEnd.add(this._getCameraDirection(WU).multiplyScalar(e)),t||this._target.copy(this._targetEnd);let n=!t||CU(this._target.x,this._targetEnd.x,this.restThreshold)&&CU(this._target.y,this._targetEnd.y,this.restThreshold)&&CU(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(n)}zoom(e,t=!1){return this.zoomTo(this._zoomEnd+e,t)}zoomTo(e,t=!1){this._isUserControllingZoom=!1,this._zoomEnd=xU(e,this.minZoom,this.maxZoom),this._needsUpdate=!0,t||(this._zoom=this._zoomEnd);let n=!t||CU(this._zoom,this._zoomEnd,this.restThreshold);return this._changedZoom=0,this._createOnRestPromise(n)}pan(e,t,n=!1){return console.warn("`pan` has been renamed to `truck`"),this.truck(e,t,n)}truck(e,t,n=!1){this._camera.updateMatrix(),GU.setFromMatrixColumn(this._camera.matrix,0),KU.setFromMatrixColumn(this._camera.matrix,1),GU.multiplyScalar(e),KU.multiplyScalar(-t);let r=VU.copy(GU).add(KU),i=HU.copy(this._targetEnd).add(r);return this.moveTo(i.x,i.y,i.z,n)}forward(e,t=!1){VU.setFromMatrixColumn(this._camera.matrix,0),VU.crossVectors(this._camera.up,VU),VU.multiplyScalar(e);let n=HU.copy(this._targetEnd).add(VU);return this.moveTo(n.x,n.y,n.z,t)}elevate(e,t=!1){return VU.copy(this._camera.up).multiplyScalar(e),this.moveTo(this._targetEnd.x+VU.x,this._targetEnd.y+VU.y,this._targetEnd.z+VU.z,t)}moveTo(e,t,n,r=!1){this._isUserControllingTruck=!1;let i=VU.set(e,t,n).sub(this._targetEnd);this._encloseToBoundary(this._targetEnd,i,this.boundaryFriction),this._needsUpdate=!0,r||this._target.copy(this._targetEnd);let a=!r||CU(this._target.x,this._targetEnd.x,this.restThreshold)&&CU(this._target.y,this._targetEnd.y,this.restThreshold)&&CU(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(a)}lookInDirectionOf(e,t,n,r=!1){let i=VU.set(e,t,n).sub(this._targetEnd).normalize().multiplyScalar(-this._sphericalEnd.radius).add(this._targetEnd);return this.setPosition(i.x,i.y,i.z,r)}fitToBox(e,t,{cover:n=!1,paddingLeft:r=0,paddingRight:i=0,paddingBottom:a=0,paddingTop:o=0}={}){let s=[],c=e.isBox3?QU.copy(e):QU.setFromObject(e);c.isEmpty()&&(console.warn(`camera-controls: fitTo() cannot be used with an empty box. Aborting`),Promise.resolve());let l=wU(this._sphericalEnd.theta,vU),u=wU(this._sphericalEnd.phi,vU);s.push(this.rotateTo(l,u,t));let d=VU.setFromSpherical(this._sphericalEnd).normalize(),f=tW.setFromUnitVectors(d,zU),p=CU(Math.abs(d.y),1);p&&f.multiply(nW.setFromAxisAngle(RU,l)),f.multiply(this._yAxisUpSpaceInverse);let m=$U.makeEmpty();HU.copy(c.min).applyQuaternion(f),m.expandByPoint(HU),HU.copy(c.min).setX(c.max.x).applyQuaternion(f),m.expandByPoint(HU),HU.copy(c.min).setY(c.max.y).applyQuaternion(f),m.expandByPoint(HU),HU.copy(c.max).setZ(c.min.z).applyQuaternion(f),m.expandByPoint(HU),HU.copy(c.min).setZ(c.max.z).applyQuaternion(f),m.expandByPoint(HU),HU.copy(c.max).setY(c.min.y).applyQuaternion(f),m.expandByPoint(HU),HU.copy(c.max).setX(c.min.x).applyQuaternion(f),m.expandByPoint(HU),HU.copy(c.max).applyQuaternion(f),m.expandByPoint(HU),m.min.x-=r,m.min.y-=a,m.max.x+=i,m.max.y+=o,f.setFromUnitVectors(zU,d),p&&f.premultiply(nW.invert()),f.premultiply(this._yAxisUpSpace);let h=m.getSize(VU),g=m.getCenter(HU).applyQuaternion(f);if(hU(this._camera)){let e=this.getDistanceToFitBox(h.x,h.y,h.z,n);s.push(this.moveTo(g.x,g.y,g.z,t)),s.push(this.dollyTo(e,t)),s.push(this.setFocalOffset(0,0,0,t))}else if(gU(this._camera)){let e=this._camera,r=e.right-e.left,i=e.top-e.bottom,a=n?Math.max(r/h.x,i/h.y):Math.min(r/h.x,i/h.y);s.push(this.moveTo(g.x,g.y,g.z,t)),s.push(this.zoomTo(a,t)),s.push(this.setFocalOffset(0,0,0,t))}return Promise.all(s)}fitToSphere(t,n){let r=[],i=`isObject3D`in t?e.createBoundingSphere(t,eW):eW.copy(t);if(r.push(this.moveTo(i.center.x,i.center.y,i.center.z,n)),hU(this._camera)){let e=this.getDistanceToFitSphere(i.radius);r.push(this.dollyTo(e,n))}else if(gU(this._camera)){let e=this._camera.right-this._camera.left,t=this._camera.top-this._camera.bottom,a=2*i.radius,o=Math.min(e/a,t/a);r.push(this.zoomTo(o,n))}return r.push(this.setFocalOffset(0,0,0,n)),Promise.all(r)}setLookAt(e,t,n,r,i,a,o=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=mU.NONE,this._changedDolly=0;let s=HU.set(r,i,a),c=VU.set(e,t,n);this._targetEnd.copy(s),this._sphericalEnd.setFromVector3(c.sub(s).applyQuaternion(this._yAxisUpSpace)),this.normalizeRotations(),this._needsUpdate=!0,o||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));let l=!o||CU(this._target.x,this._targetEnd.x,this.restThreshold)&&CU(this._target.y,this._targetEnd.y,this.restThreshold)&&CU(this._target.z,this._targetEnd.z,this.restThreshold)&&CU(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&CU(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&CU(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(l)}lerpLookAt(e,t,n,r,i,a,o,s,c,l,u,d,f,p=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=mU.NONE,this._changedDolly=0;let m=VU.set(r,i,a),h=HU.set(e,t,n);XU.setFromVector3(h.sub(m).applyQuaternion(this._yAxisUpSpace));let g=UU.set(l,u,d),_=HU.set(o,s,c);ZU.setFromVector3(_.sub(g).applyQuaternion(this._yAxisUpSpace)),this._targetEnd.copy(m.lerp(g,f));let v=ZU.theta-XU.theta,y=ZU.phi-XU.phi,b=ZU.radius-XU.radius;this._sphericalEnd.set(XU.radius+b*f,XU.phi+y*f,XU.theta+v*f),this.normalizeRotations(),this._needsUpdate=!0,p||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));let x=!p||CU(this._target.x,this._targetEnd.x,this.restThreshold)&&CU(this._target.y,this._targetEnd.y,this.restThreshold)&&CU(this._target.z,this._targetEnd.z,this.restThreshold)&&CU(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&CU(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&CU(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(x)}setPosition(e,t,n,r=!1){return this.setLookAt(e,t,n,this._targetEnd.x,this._targetEnd.y,this._targetEnd.z,r)}setTarget(e,t,n,r=!1){let i=this.getPosition(VU),a=this.setLookAt(i.x,i.y,i.z,e,t,n,r);return this._sphericalEnd.phi=xU(this._sphericalEnd.phi,this.minPolarAngle,this.maxPolarAngle),a}setFocalOffset(e,t,n,r=!1){this._isUserControllingOffset=!1,this._focalOffsetEnd.set(e,t,n),this._needsUpdate=!0,r||this._focalOffset.copy(this._focalOffsetEnd);let i=!r||CU(this._focalOffset.x,this._focalOffsetEnd.x,this.restThreshold)&&CU(this._focalOffset.y,this._focalOffsetEnd.y,this.restThreshold)&&CU(this._focalOffset.z,this._focalOffsetEnd.z,this.restThreshold);return this._createOnRestPromise(i)}setOrbitPoint(e,t,n){this._camera.updateMatrixWorld(),GU.setFromMatrixColumn(this._camera.matrixWorldInverse,0),KU.setFromMatrixColumn(this._camera.matrixWorldInverse,1),qU.setFromMatrixColumn(this._camera.matrixWorldInverse,2);let r=VU.set(e,t,n),i=r.distanceTo(this._camera.position),a=r.sub(this._camera.position);GU.multiplyScalar(a.x),KU.multiplyScalar(a.y),qU.multiplyScalar(a.z),VU.copy(GU).add(KU).add(qU),VU.z+=i,this.dollyTo(i,!1),this.setFocalOffset(-VU.x,VU.y,-VU.z,!1),this.moveTo(e,t,n,!1)}setBoundary(e){if(!e){this._boundary.min.set(-1/0,-1/0,-1/0),this._boundary.max.set(1/0,1/0,1/0),this._needsUpdate=!0;return}this._boundary.copy(e),this._boundary.clampPoint(this._targetEnd,this._targetEnd),this._needsUpdate=!0}setViewport(e,t,n,r){if(e===null){this._viewport=null;return}this._viewport=this._viewport||new IU.Vector4,typeof e==`number`?this._viewport.set(e,t,n,r):this._viewport.copy(e)}getDistanceToFitBox(e,t,n,r=!1){if(AU(this._camera,`getDistanceToFitBox`))return this._spherical.radius;let i=e/t,a=this._camera.getEffectiveFOV()*bU,o=this._camera.aspect;return((r?i>o:it.pointerId===e)}_findPointerByMouseButton(e){return this._activePointers.find(t=>t.mouseButton===e)}_disposePointer(e){this._activePointers.splice(this._activePointers.indexOf(e),1)}_encloseToBoundary(e,t,n){let r=t.lengthSq();if(r===0)return e;let i=HU.copy(t).add(e),a=this._boundary.clampPoint(i,UU).sub(i),o=a.lengthSq();if(o===0)return e.add(t);if(o===r)return e;if(n===0)return e.add(t).add(a);{let r=1+n*o/t.dot(a);return e.add(HU.copy(t).multiplyScalar(r)).add(a.multiplyScalar(1-n))}}_updateNearPlaneCorners(){if(hU(this._camera)){let e=this._camera,t=e.near,n=e.getEffectiveFOV()*bU,r=Math.tan(n*.5)*t,i=r*e.aspect;this._nearPlaneCorners[0].set(-i,-r,0),this._nearPlaneCorners[1].set(i,-r,0),this._nearPlaneCorners[2].set(i,r,0),this._nearPlaneCorners[3].set(-i,r,0)}else if(gU(this._camera)){let e=this._camera,t=1/e.zoom,n=e.left*t,r=e.right*t,i=e.top*t,a=e.bottom*t;this._nearPlaneCorners[0].set(n,i,0),this._nearPlaneCorners[1].set(r,i,0),this._nearPlaneCorners[2].set(r,a,0),this._nearPlaneCorners[3].set(n,a,0)}}_collisionTest(){let e=1/0;if(!(this.colliderMeshes.length>=1)||AU(this._camera,`_collisionTest`))return e;let t=this._getTargetDirection(WU);rW.lookAt(LU,t,this._camera.up);for(let n=0;n<4;n++){let r=HU.copy(this._nearPlaneCorners[n]);r.applyMatrix4(rW);let i=UU.addVectors(this._target,r);iW.set(i,t),iW.far=this._spherical.radius+1;let a=iW.intersectObjects(this.colliderMeshes);a.length!==0&&a[0].distance{let t=()=>{this.removeEventListener(`rest`,t),e()};this.addEventListener(`rest`,t)}))}_addAllEventListeners(e){}_removeAllEventListeners(){}get dampingFactor(){return console.warn(`.dampingFactor has been deprecated. use smoothTime (in seconds) instead.`),0}set dampingFactor(e){console.warn(`.dampingFactor has been deprecated. use smoothTime (in seconds) instead.`)}get draggingDampingFactor(){return console.warn(`.draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead.`),0}set draggingDampingFactor(e){console.warn(`.draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead.`)}static createBoundingSphere(e,t=new IU.Sphere){let n=t,r=n.center;QU.makeEmpty(),e.traverseVisible(e=>{e.isMesh&&QU.expandByObject(e)}),QU.getCenter(r);let i=0;return e.traverseVisible(e=>{if(!e.isMesh)return;let t=e,n=t.geometry.clone();n.applyMatrix4(t.matrixWorld);let a=n.attributes.position;for(let e=0,t=a.count;e!!(e&&e.isPerspectiveCamera),sW=e=>!!(e&&e.isOrthographicCamera),cW=`min-polar-angle.max-polar-angle.min-azimuth-angle.max-azimuth-angle.distance.min-distance.max-distance.infinity-dolly.min-zoom.max-zoom.smooth-time.dragging-smooth-time.max-speed.azimuth-rotate-speed.polar-rotate-speed.dolly-speed.dolly-drag-inverted.truck-speed.dolly-to-cursor.drag-to-offset.vertical-drag-to-forward.boundary-friction.rest-threshold.collider-meshes.args.mouse-buttons.touches`.split(`.`),lW=(e,t)=>({left:aW.ACTION.ROTATE,middle:aW.ACTION.DOLLY,right:aW.ACTION.TRUCK,wheel:oW(e)?aW.ACTION.DOLLY:sW(e)?aW.ACTION.ZOOM:aW.ACTION.NONE,...t}),uW=(e,t)=>({one:aW.ACTION.TOUCH_ROTATE,two:oW(e)?aW.ACTION.TOUCH_DOLLY_TRUCK:sW(e)?aW.ACTION.TOUCH_ZOOM_TRUCK:aW.ACTION.NONE,three:aW.ACTION.TOUCH_TRUCK,...t}),dW=Tn({__name:`CameraControls`,props:{makeDefault:{type:Boolean,default:!1},camera:{},domElement:{},minPolarAngle:{default:0},maxPolarAngle:{default:Math.PI},minAzimuthAngle:{default:-1/0},maxAzimuthAngle:{default:1/0},distance:{default:()=>De().camera.value.position.z},minDistance:{default:2**-52},maxDistance:{default:1/0},infinityDolly:{type:Boolean,default:!1},minZoom:{default:.01},maxZoom:{default:1/0},smoothTime:{default:.25},draggingSmoothTime:{default:.125},maxSpeed:{default:1/0},azimuthRotateSpeed:{default:1},polarRotateSpeed:{default:1},dollySpeed:{default:1},dollyDragInverted:{type:Boolean,default:!1},truckSpeed:{default:2},dollyToCursor:{type:Boolean,default:!1},dragToOffset:{type:Boolean,default:!1},verticalDragToForward:{type:Boolean,default:!1},boundaryFriction:{default:0},restThreshold:{default:.01},colliderMeshes:{default:()=>[]},mouseButtons:{default:()=>lW(De().camera.value)},touches:{default:()=>uW(De().camera.value)}},emits:[`change`,`start`,`end`],setup(e,{expose:t,emit:n}){let r=e,i=n,{makeDefault:a,minPolarAngle:o,maxPolarAngle:s,minAzimuthAngle:c,maxAzimuthAngle:l,distance:u,minDistance:d,maxDistance:f,infinityDolly:p,minZoom:m,maxZoom:h,smoothTime:g,draggingSmoothTime:_,maxSpeed:v,azimuthRotateSpeed:y,polarRotateSpeed:b,dollySpeed:x,dollyDragInverted:S,truckSpeed:C,dollyToCursor:w,dragToOffset:T,verticalDragToForward:E,boundaryFriction:D,restThreshold:O,colliderMeshes:k}=un(r),A={Box3:z,MathUtils:{clamp:it.clamp},Matrix4:je,Quaternion:Rt,Raycaster:at,Sphere:At,Spherical:Ie,Vector2:ut,Vector3:B,Vector4:Yt};aW.install({THREE:A});let{camera:j,renderer:M,extend:N,controls:ee,invalidate:P}=De();G(r,()=>{P()});let F=_n(()=>lW(r.camera||j.value,r.mouseButtons)),I=_n(()=>uW(r.camera||j.value,r.touches)),L=W(null);N({CameraControls:aW}),Nn(()=>{te(),L.value&&a.value?ee.value=L.value:ee.value=null});function te(){fR(L.value,`update`,()=>{i(`change`,L.value),P()}),fR(L.value,`controlend`,()=>i(`end`,L.value)),fR(L.value,`controlstart`,()=>i(`start`,L.value))}let{onBeforeRender:R}=be();return R(({delta:e,invalidate:t})=>{var n,r;(n=L.value)!=null&&n.enabled&&((r=L.value)==null||r.update(e),t())}),An(()=>{L.value&&L.value.disconnect()}),t({instance:L}),(e,t)=>(e.camera||H(j))&&(e.domElement||H(M))?(K(),On(`TresCameraControls`,{key:0,ref_key:`controlsRef`,ref:L,"min-polar-angle":H(o),"max-polar-angle":H(s),"min-azimuth-angle":H(c),"max-azimuth-angle":H(l),distance:H(u),"min-distance":H(d),"max-distance":H(f),"infinity-dolly":H(p),"min-zoom":H(m),"max-zoom":H(h),"smooth-time":H(g),"dragging-smooth-time":H(_),"max-speed":H(v),"azimuth-rotate-speed":H(y),"polar-rotate-speed":H(b),"dolly-speed":H(x),"dolly-drag-inverted":H(S),"truck-speed":H(C),"dolly-to-cursor":H(w),"drag-to-offset":H(T),"vertical-drag-to-forward":H(E),"boundary-friction":H(D),"rest-threshold":H(O),"collider-meshes":H(k),args:[e.camera||H(j),e.domElement||H(M).domElement],"mouse-buttons":F.value,touches:I.value},null,8,cW)):En(``,!0)}}),fW=Tn({__name:`KeyboardControls`,props:{makeDefault:{type:Boolean,default:!0},camera:{},domElement:{},moveSpeed:{default:.2},selector:{}},emits:[`isLock`,`change`],setup(e,{expose:t,emit:n}){let r=e,i=n,{moveSpeed:a}=un(r),{camera:o,controls:s,renderer:c,invalidate:l}=De();G(r,()=>{l()});let u=U(0),d=U(0),{KeyW:f,KeyA:p,KeyS:m,KeyD:h,Up:g,Down:_,Left:v,Right:y}=xR();Nn(()=>{p.value||v.value?u.value=-a.value:h.value||y.value?u.value=a.value:u.value=0,f.value||g.value?d.value=a.value:m.value||_.value?d.value=-a.value:d.value=0}),t({instance:s});let b=e=>i(`isLock`,e),x=e=>i(`change`,e),S=new B,C=new B,w=new Rt,T=(e,t)=>{var n;if(!((n=o.value)!=null&&n.position)&&!S)return;let r=o.value,a=e*.001;r?.translateZ(-t),w.set(C.x*a,C.y*a,C.z*a,1).normalize(),r?.quaternion.multiply(w),(u.value||d.value)&&i(`change`,s.value)},{onBeforeRender:E}=be();return E(({delta:e,invalidate:t})=>{var n;s.value instanceof WB&&(n=s.value)!=null&&n.isLocked&&(T(e,d.value),s.value.moveRight(u.value),t())}),(e,t)=>(K(),Pn(H(vW),{selector:e.selector,"make-default":e.makeDefault,camera:e.camera||H(o),"dom-element":e.domElement||H(c).domElement,onIsLock:b,onChange:x},null,8,[`selector`,`make-default`,`camera`,`dom-element`]))}}),pW=[`args`,`auto-rotate`,`auto-rotate-speed`,`enable-damping`,`damping-factor`,`enable-pan`,`key-pan-speed`,`keys`,`max-azimuth-angle`,`min-azimuth-angle`,`max-polar-angle`,`min-polar-angle`,`min-distance`,`max-distance`,`min-zoom`,`max-zoom`,`enable-zoom`,`zoom-speed`,`enable-rotate`,`rotate-speed`],mW=Tn({__name:`MapControls`,props:{makeDefault:{type:Boolean,default:!1},camera:{},domElement:{},target:{},enableDamping:{type:Boolean,default:!0},dampingFactor:{default:.05},autoRotate:{type:Boolean,default:!1},autoRotateSpeed:{default:2},enablePan:{type:Boolean,default:!0},keyPanSpeed:{default:7},keys:{},maxAzimuthAngle:{default:1/0},minAzimuthAngle:{default:-1/0},maxPolarAngle:{default:Math.PI},minPolarAngle:{default:0},minDistance:{default:0},maxDistance:{default:1/0},minZoom:{default:0},maxZoom:{default:1/0},touches:{},enableZoom:{type:Boolean,default:!0},zoomSpeed:{default:1},enableRotate:{type:Boolean,default:!0},rotateSpeed:{default:1}},emits:[`change`,`start`,`end`],setup(e,{expose:t,emit:n}){let r=e,{autoRotate:i,autoRotateSpeed:a,enableDamping:o,dampingFactor:s,enablePan:c,keyPanSpeed:l,maxAzimuthAngle:u,minAzimuthAngle:d,maxPolarAngle:f,minPolarAngle:p,minDistance:m,maxDistance:h,minZoom:g,maxZoom:_,enableZoom:v,zoomSpeed:y,enableRotate:b,rotateSpeed:x}=un(r),{camera:S,renderer:C,extend:w,controls:T,invalidate:E}=De();G(r,()=>{E()});let D=W(null);w({MapControls:$B}),G(T,e=>{e&&r.makeDefault?T.value=e:T.value=null});let{onBeforeRender:O}=be();return O(({invalidate:e})=>{D.value&&(o.value||i.value)&&(D.value.update(),e())}),An(()=>{D.value&&D.value.dispose()}),t({instance:D}),(e,t)=>(e.camera||H(S))&&(e.domElement||H(C))?(K(),On(`TresMapControls`,{key:0,ref_key:`controlsRef`,ref:D,args:[e.camera||H(S),e.domElement||H(C).domElement],"auto-rotate":H(i),"auto-rotate-speed":H(a),"enable-damping":H(o),"damping-factor":H(s),"enable-pan":H(c),"key-pan-speed":H(l),keys:e.keys,"max-azimuth-angle":H(u),"min-azimuth-angle":H(d),"max-polar-angle":H(f),"min-polar-angle":H(p),"min-distance":H(m),"max-distance":H(h),"min-zoom":H(g),"max-zoom":H(_),"enable-zoom":H(v),"zoom-speed":H(y),"enable-rotate":H(b),"rotate-speed":H(x)},null,8,pW)):En(``,!0)}}),hW=[`target`,`auto-rotate`,`auto-rotate-speed`,`enable-damping`,`damping-factor`,`enable-pan`,`key-pan-speed`,`keys`,`max-azimuth-angle`,`min-azimuth-angle`,`max-polar-angle`,`min-polar-angle`,`min-distance`,`max-distance`,`min-zoom`,`max-zoom`,`touches`,`enable-zoom`,`zoom-speed`,`enable-rotate`,`rotate-speed`,`mouse-buttons`,`args`],gW=Tn({__name:`OrbitControls`,props:{makeDefault:{type:Boolean,default:!1},camera:{},domElement:{},target:{default:()=>[0,0,0]},enableDamping:{type:Boolean,default:!0},dampingFactor:{default:.05},autoRotate:{type:Boolean,default:!1},autoRotateSpeed:{default:2},enablePan:{type:Boolean,default:!0},keyPanSpeed:{default:7},keys:{},maxAzimuthAngle:{default:1/0},minAzimuthAngle:{default:-1/0},maxPolarAngle:{default:Math.PI},minPolarAngle:{default:0},minDistance:{default:0},maxDistance:{default:1/0},minZoom:{default:0},maxZoom:{default:1/0},touches:{default:()=>({ONE:It.ROTATE,TWO:It.DOLLY_PAN})},enableZoom:{type:Boolean,default:!0},zoomSpeed:{default:1},enableRotate:{type:Boolean,default:!0},rotateSpeed:{default:1},mouseButtons:{default:()=>({LEFT:Nt.ROTATE,MIDDLE:Nt.DOLLY,RIGHT:Nt.PAN})}},emits:[`change`,`start`,`end`],setup(e,{expose:t,emit:n}){let r=e,i=n,{makeDefault:a,autoRotate:o,autoRotateSpeed:s,enableDamping:c,dampingFactor:l,enablePan:u,keyPanSpeed:d,maxAzimuthAngle:f,minAzimuthAngle:p,maxPolarAngle:m,minPolarAngle:h,minDistance:g,maxDistance:_,minZoom:v,maxZoom:y,enableZoom:b,zoomSpeed:x,enableRotate:S,touches:C,rotateSpeed:w,target:T,mouseButtons:E}=un(r),{camera:D,renderer:O,extend:k,controls:A,invalidate:j}=De(),M=W(null);k({OrbitControls:QB}),G(M,e=>{N(),e&&a.value?A.value=e:A.value=null});function N(){fR(M.value,`change`,()=>{i(`change`,M.value),j()}),fR(M.value,`start`,()=>i(`start`,M.value)),fR(M.value,`end`,()=>i(`end`,M.value))}let{onBeforeRender:ee}=be();return ee(({invalidate:e})=>{M.value&&(c.value||o.value)&&(M.value.update(),o.value&&e())}),An(()=>{M.value&&M.value.dispose()}),t({instance:M}),(e,t)=>(e.camera||H(D))&&(e.domElement||H(O))?(K(),On(`TresOrbitControls`,{key:0,ref_key:`controlsRef`,ref:M,target:H(T),"auto-rotate":H(o),"auto-rotate-speed":H(s),"enable-damping":H(c),"damping-factor":H(l),"enable-pan":H(u),"key-pan-speed":H(d),keys:e.keys,"max-azimuth-angle":H(f),"min-azimuth-angle":H(p),"max-polar-angle":H(m),"min-polar-angle":H(h),"min-distance":H(g),"max-distance":H(_),"min-zoom":H(v),"max-zoom":H(y),touches:H(C),"enable-zoom":H(b),"zoom-speed":H(x),"enable-rotate":H(S),"rotate-speed":H(w),"mouse-buttons":H(E),args:[e.camera||H(D),e.domElement||H(O).domElement]},null,8,hW)):En(``,!0)}}),_W=[`args`],vW=Tn({__name:`PointerLockControls`,props:{makeDefault:{type:Boolean,default:!1},camera:{},domElement:{},selector:{}},emits:[`isLock`,`change`],setup(e,{expose:t,emit:n}){let r=e,i=n,{camera:a,renderer:o,extend:s,controls:c,invalidate:l}=De();G(r,()=>{l()});let u=W(null),d;s({PointerLockControls:WB});let f=e=>{i(`isLock`,e)};return G(u,e=>{e&&r.makeDefault?c.value=e:c.value=null,d=document.getElementById(r.selector||``)||o.value.domElement,fR(d,`click`,()=>{u.value&&(u.value.lock(),u.value.addEventListener(`lock`,()=>f(!0)),u.value.addEventListener(`unlock`,()=>f(!1)),l())})}),An(()=>{let e=u.value;e&&(e.removeEventListener(`lock`,()=>f(!0)),e.removeEventListener(`unlock`,()=>f(!1)),e.dispose())}),t({instance:c}),(e,t)=>(e.camera||H(a))&&(e.domElement||H(o))?(K(),On(`TresPointerLockControls`,{key:0,ref_key:`controlsRef`,ref:u,args:[e.camera||H(a),e.domElement||H(o).domElement]},null,8,_W)):En(``,!0)}}),yW=Tn({__name:`ScrollControls`,props:{pages:{default:4},distance:{default:4},smoothScroll:{default:.1},horizontal:{type:Boolean,default:!1},htmlScroll:{type:Boolean,default:!1}},emits:[`update:modelValue`],setup(e,{expose:t,emit:n}){let r=e,i=n,{logWarning:a}=Ce();r.smoothScroll<0&&a(`SmoothControl must be greater than zero`),r.pages<0&&a(`Pages must be greater than zero`);let{camera:o,controls:s,renderer:c,invalidate:l}=De();G(r,()=>{l()});let u=W(),d=document.createElement(`div`),{y:f}=wR(),{x:p,y:m,isScrolling:h}=yR(d),{height:g,width:_}=TR(),v=0,y=U(!1),b=U(0),x=U(0),S=U(0),C=r.horizontal?`x`:`y`,w=G(o,e=>{if(y.value){w();return}v=r.horizontal?e?.position.x||0:e?.position.y||0,y.value=!0},{immediate:!0});G(h,e=>{s.value&&(s.value.enabled=!e)},{immediate:!0}),G(f,e=>{!h.value&&!r.htmlScroll||(x.value=e/g.value/(S.value/g.value-1),b.value=-1*x.value,i(`update:modelValue`,x.value))}),G(m,e=>{x.value=e/g.value/(S.value/g.value),b.value=-1*x.value,i(`update:modelValue`,x.value)}),G(p,e=>{x.value=e/_.value/(S.value/_.value-1),b.value=+x.value,i(`update:modelValue`,x.value)}),G(c,e=>{var t,n;let i=e?.domElement;if(r.htmlScroll&&e!=null&&e.domElement)i!=null&&i.style.width&&i!=null&&i.style.position&&i!=null&&i.style.top&&i!=null&&i.style.left&&(i.style.width=`100%`,i.style.position=`fixed`,i.style.zIndex=` -99999`,i.style.top=`0`,i.style.left=`0`),S.value=document.body.scrollHeight;else{let a=document.createElement(`div`),o=document.createElement(`div`);d.style[r.horizontal?`overflowX`:`overflowY`]=`auto`,d.style[r.horizontal?`overflowY`:`overflowX`]=`hidden`,d.style.position=`absolute`,d.style.width=`100%`,d.style.height=` 100%`,d.style.top=`0`,d.style.left=`0`,d.classList.add(`scrollContainer`),a.style.position=`sticky`,a.style.top=`0px`,a.style.left=`0px`,a.style.width=`100%`,a.style.height=`100%`,a.style.overflow=`hidden`,d.appendChild(a),o.style.height=r.horizontal?`100%`:`${g.value*r.pages}px`,o.style.width=r.horizontal?`${_.value*r.pages}px`:`100vw`,o.style.pointerEvents=`none`,i.style.position=`fixed`,i.style.zIndex=`0`,i!=null&&i.style.width&&(i.style.width=`100%`),d.appendChild(o),e!=null&&e.domElement.parentNode&&(e.domElement.parentNode.style.position=`relative`),(n=(t=e?.domElement)?.parentNode)==null||n.appendChild(d),S.value=r.horizontal?_.value*r.pages:g.value*r.pages}},{immediate:!0});let{onBeforeRender:T}=be();return T(({invalidate:e})=>{var t;if((t=o.value)!=null&&t.position){let t=(b.value*r.distance-o.value.position[C]+v)*r.smoothScroll;o.value.position[C]+=t,u.value.children.length>0&&(u.value.position[C]+=t),e()}}),t({instance:u}),(e,t)=>(K(),On(`TresGroup`,{ref_key:`wrapperRef`,ref:u},[Qt(e.$slots,`default`)],512))}}),bW=[`object`,`args`,`mode`,`enabled`,`axis`,`translation-snap`,`rotation-snap`,`scale-snap`,`space`,`size`,`show-x`,`show-y`,`show-z`],xW=Tn({__name:`TransformControls`,props:{object:{},camera:{},mode:{default:`translate`},enabled:{type:Boolean,default:!0},axis:{default:`XYZ`},translationSnap:{},rotationSnap:{},scaleSnap:{},space:{default:`world`},size:{default:1},showX:{type:Boolean,default:!0},showY:{type:Boolean,default:!0},showZ:{type:Boolean,default:!0}},emits:[`dragging`,`change`,`mouseDown`,`mouseUp`,`objectChange`],setup(e,{expose:t,emit:n}){let r=e,i=n,{object:a,mode:o,enabled:s,axis:c,translationSnap:l,rotationSnap:u,scaleSnap:d,space:f,size:p,showX:m,showY:h,showZ:g}=un(r),_=W(null),{controls:v,camera:y,renderer:b,extend:x,invalidate:S}=De();G([a,o,s,c,l,u,d,f,p,m,h,g],()=>{S()}),x({TransformControls:MB});let C=()=>{S(),i(`change`)},w=e=>{v.value&&(v.value.enabled=!e.value),S(),i(`dragging`,e.value)},T=()=>{S(),i(`mouseDown`)},E=()=>{S(),i(`mouseDown`)},D=()=>{S(),i(`objectChange`)};function O(){fR(_.value,`change`,C),fR(_.value,`dragging-changed`,w),fR(_.value,`mouseDown`,T),fR(_.value,`mouseUp`,E),fR(_.value,`objectChange`,D)}return G(_,e=>{e&&O()}),An(()=>{_.value&&_.value.dispose()}),t({instance:_}),(e,t)=>{var n;return(e.camera||H(y))&&H(b)?(K(),On(`TresTransformControls`,{ref_key:`controlsRef`,ref:_,key:(n=e.camera||H(y))?.uuid,object:H(a),args:[e.camera||H(y),H(b).domElement],mode:H(o),enabled:H(s),axis:H(c),"translation-snap":H(l),"rotation-snap":H(u),"scale-snap":H(d),space:H(f),size:H(p),"show-x":H(m),"show-y":H(h),"show-z":H(g),visible:!0},null,8,bW)):En(``,!0)}}}),SW=[`geometry`,`render-order`],CW=Tn({__name:`component`,props:{src:{},skipStrokes:{type:Boolean,default:!1},skipFills:{type:Boolean,default:!1},fillMaterial:{},strokeMaterial:{},fillMeshProps:{},strokeMeshProps:{},depth:{default:`renderOrder`}},setup(e,{expose:t}){let n=e;class r extends OV{load(e,t,n,r){let i=Array.isArray(e)?e[0]:e;super.load(i,t,n,r)}}let{src:i,skipStrokes:a,skipFills:o,fillMaterial:s,strokeMaterial:c,fillMeshProps:l,strokeMeshProps:u,depth:d}=un(n),f=W(),p=W([]),m=W([]);t({instance:f}),Nn(async()=>h(i.value).then(e=>m.value=e.paths)),G([o,a,s,c,m],_);async function h(e){let t=e.startsWith(`e.geometry.dispose())}function _(){var e,t,r;g();let i=[],[s,c]=(()=>{let e={flat:!1,renderOrder:!1,offsetZ:!0},t={flat:0,renderOrder:0,offsetZ:.025},n=d.value;return typeof n==`number`?[!0,n]:[e[n],t[n]]})(),l=0;for(let u of m.value){let d=(e=u.userData)?.style??{},f=Object.assign({color:d.fill,opacity:d.fillOpacity,transparent:!0,side:Ve,depthWrite:s},n.fillMaterial);if(!o.value&&d.fill!==void 0&&d.fill!==`none`)for(let e of OV.createShapes(u)){let t=new et(e);t.scale(1,-1,1),c&&t.translate(0,0,l++*c),i.push({geometry:t,material:f,isStroke:!1})}if(!a.value&&d.stroke!==void 0&&d.stroke!==`none`){let e=Object.assign({color:(t=u.userData)?.style.stroke,opacity:(r=u.userData)?.style.strokeOpacity,transparent:!0,side:Ve,depthWrite:s},n.strokeMaterial);for(let t of u.subPaths){let n=t.getPoints().map(e=>new ut(e.x,-e.y)),r=OV.pointsToStroke(n,d||`none`);c&&r.translate(0,0,l++*c),i.push({geometry:r,material:e,isStroke:!0})}}}p.value=i}return(e,t)=>(K(),On(`TresGroup`,{ref_key:`svgRef`,ref:f},[(K(!0),On(en,null,Mn(p.value,({geometry:e,material:t,isStroke:n},r)=>(K(),On(`TresMesh`,bn({key:`${r}`,ref_for:!0},H(n?u:l),{geometry:e,"render-order":H(d)===`renderOrder`?r:0}),[jn(`TresMeshBasicMaterial`,bn({ref_for:!0},t),null,16)],16,SW))),128))],512))}});function wW(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}function TW(e){throw Error(`Could not dynamically require "`+e+`". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.`)}var EW={exports:{}},DW;function OW(){return DW||(DW=1,function(e,t){(function(t){e.exports=t()})(function(){return function e(t,n,r){function i(o,s){if(!n[o]){if(!t[o]){var c=typeof TW==`function`&&TW;if(!s&&c)return c(o,!0);if(a)return a(o,!0);throw Error(`Cannot find module '`+o+`'`)}s=n[o]={exports:{}},t[o][0].call(s.exports,function(e){var n=t[o][1][e];return i(n||e)},s,s.exports,e,t,n,r)}return n[o].exports}for(var a=typeof TW==`function`&&TW,o=0;o0==p>u&&(p=u,n.value=(p-u)/a),p}function OU(e,t,n,r,i=1/0,a,o){r=Math.max(1e-4,r);let s=2/r,c=s*a,l=1/(1+c+.48*c*c+.235*c*c*c),u=t.x,d=t.y,f=t.z,p=e.x-u,m=e.y-d,h=e.z-f,g=u,_=d,v=f,y=i*r,b=y*y,x=p*p+m*m+h*h;if(x>b){let e=Math.sqrt(x);p=p/e*y,m=m/e*y,h=h/e*y}u=e.x-p,d=e.y-m,f=e.z-h;let S=(n.x+s*p)*a,C=(n.y+s*m)*a,w=(n.z+s*h)*a;n.x=(n.x-s*S)*l,n.y=(n.y-s*C)*l,n.z=(n.z-s*w)*l,o.x=u+(p+S)*l,o.y=d+(m+C)*l,o.z=f+(h+w)*l;let T=g-e.x,E=_-e.y,D=v-e.z,O=o.x-g,k=o.y-_,A=o.z-v;return T*O+E*k+D*A>0&&(o.x=g,o.y=_,o.z=v,n.x=(o.x-g)/a,n.y=(o.y-_)/a,n.z=(o.z-v)/a),o}function kU(e,t){t.set(0,0),e.forEach(e=>{t.x+=e.clientX,t.y+=e.clientY}),t.x/=e.length,t.y/=e.length}function AU(e,t){return gU(e)?(console.warn(`${t} is not supported in OrthographicCamera`),!0):!1}var jU=class{constructor(){this._listeners={}}addEventListener(e,t){let n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){let n=this._listeners;return n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){let n=this._listeners[e];if(n!==void 0){let e=n.indexOf(t);e!==-1&&n.splice(e,1)}}removeAllEventListeners(e){if(!e){this._listeners={};return}Array.isArray(this._listeners[e])&&(this._listeners[e].length=0)}dispatchEvent(e){let t=this._listeners[e.type];if(t!==void 0){e.target=this;let n=t.slice(0);for(let t=0,r=n.length;t{},this._enabled=!0,this._state=$.NONE,this._viewport=null,this._changedDolly=0,this._changedZoom=0,this._hasRested=!0,this._boundaryEnclosesCamera=!1,this._needsUpdate=!0,this._updatedLastTime=!1,this._elementRect=new DOMRect,this._isDragging=!1,this._dragNeedsUpdate=!0,this._activePointers=[],this._lockedPointer=null,this._interactiveArea=new DOMRect(0,0,1,1),this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._isUserControllingOffset=!1,this._isUserControllingZoom=!1,this._lastDollyDirection=mU.NONE,this._thetaVelocity={value:0},this._phiVelocity={value:0},this._radiusVelocity={value:0},this._targetVelocity=new IU.Vector3,this._focalOffsetVelocity=new IU.Vector3,this._zoomVelocity={value:0},this._truckInternal=(e,t,n)=>{let r,i;if(hU(this._camera)){let n=VU.copy(this._camera.position).sub(this._target),a=this._camera.getEffectiveFOV()*bU,o=n.length()*Math.tan(a*.5);r=this.truckSpeed*e*o/this._elementRect.height,i=this.truckSpeed*t*o/this._elementRect.height}else if(gU(this._camera)){let n=this._camera;r=e*(n.right-n.left)/n.zoom/this._elementRect.width,i=t*(n.top-n.bottom)/n.zoom/this._elementRect.height}else return;this.verticalDragToForward?(n?this.setFocalOffset(this._focalOffsetEnd.x+r,this._focalOffsetEnd.y,this._focalOffsetEnd.z,!0):this.truck(r,0,!0),this.forward(-i,!0)):n?this.setFocalOffset(this._focalOffsetEnd.x+r,this._focalOffsetEnd.y+i,this._focalOffsetEnd.z,!0):this.truck(r,i,!0)},this._rotateInternal=(e,t)=>{let n=_U*this.azimuthRotateSpeed*e/this._elementRect.height,r=_U*this.polarRotateSpeed*t/this._elementRect.height;this.rotate(n,r,!0)},this._dollyInternal=(e,t,n)=>{let r=.95**(-e*this.dollySpeed),i=this._sphericalEnd.radius,a=this._sphericalEnd.radius*r,o=xU(a,this.minDistance,this.maxDistance),s=o-a;this.infinityDolly&&this.dollyToCursor?this._dollyToNoClamp(a,!0):(this.infinityDolly&&!this.dollyToCursor&&this.dollyInFixed(s,!0),this._dollyToNoClamp(o,!0)),this.dollyToCursor&&(this._changedDolly+=(this.infinityDolly?a:o)-i,this._dollyControlCoord.set(t,n)),this._lastDollyDirection=Math.sign(-e)},this._zoomInternal=(e,t,n)=>{let r=.95**(e*this.dollySpeed),i=this._zoom,a=this._zoom*r;this.zoomTo(a,!0),this.dollyToCursor&&(this._changedZoom+=a-i,this._dollyControlCoord.set(t,n))},typeof IU>`u`&&console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."),this._camera=t,this._yAxisUpSpace=new IU.Quaternion().setFromUnitVectors(this._camera.up,RU),this._yAxisUpSpaceInverse=this._yAxisUpSpace.clone().invert(),this._state=$.NONE,this._target=new IU.Vector3,this._targetEnd=this._target.clone(),this._focalOffset=new IU.Vector3,this._focalOffsetEnd=this._focalOffset.clone(),this._spherical=new IU.Spherical().setFromVector3(VU.copy(this._camera.position).applyQuaternion(this._yAxisUpSpace)),this._sphericalEnd=this._spherical.clone(),this._lastDistance=this._spherical.radius,this._zoom=this._camera.zoom,this._zoomEnd=this._zoom,this._lastZoom=this._zoom,this._nearPlaneCorners=[new IU.Vector3,new IU.Vector3,new IU.Vector3,new IU.Vector3],this._updateNearPlaneCorners(),this._boundary=new IU.Box3(new IU.Vector3(-1/0,-1/0,-1/0),new IU.Vector3(1/0,1/0,1/0)),this._cameraUp0=this._camera.up.clone(),this._target0=this._target.clone(),this._position0=this._camera.position.clone(),this._zoom0=this._zoom,this._focalOffset0=this._focalOffset.clone(),this._dollyControlCoord=new IU.Vector2,this.mouseButtons={left:$.ROTATE,middle:$.DOLLY,right:$.TRUCK,wheel:hU(this._camera)?$.DOLLY:gU(this._camera)?$.ZOOM:$.NONE},this.touches={one:$.TOUCH_ROTATE,two:hU(this._camera)?$.TOUCH_DOLLY_TRUCK:gU(this._camera)?$.TOUCH_ZOOM_TRUCK:$.NONE,three:$.TOUCH_TRUCK};let r=new IU.Vector2,i=new IU.Vector2,a=new IU.Vector2,o=e=>{if(!this._enabled||!this._domElement)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){let t=this._domElement.getBoundingClientRect(),n=e.clientX/t.width,r=e.clientY/t.height;if(nthis._interactiveArea.right||rthis._interactiveArea.bottom)return}let t=e.pointerType===`mouse`?(e.buttons&pU.LEFT)===pU.LEFT?pU.LEFT:(e.buttons&pU.MIDDLE)===pU.MIDDLE?pU.MIDDLE:(e.buttons&pU.RIGHT)===pU.RIGHT?pU.RIGHT:null:null;if(t!==null){let e=this._findPointerByMouseButton(t);e&&this._disposePointer(e)}if((e.buttons&pU.LEFT)===pU.LEFT&&this._lockedPointer)return;let n={pointerId:e.pointerId,clientX:e.clientX,clientY:e.clientY,deltaX:0,deltaY:0,mouseButton:t};this._activePointers.push(n),this._domElement.ownerDocument.removeEventListener(`pointermove`,s,{passive:!1}),this._domElement.ownerDocument.removeEventListener(`pointerup`,c),this._domElement.ownerDocument.addEventListener(`pointermove`,s,{passive:!1}),this._domElement.ownerDocument.addEventListener(`pointerup`,c),this._isDragging=!0,f(e)},s=e=>{e.cancelable&&e.preventDefault();let t=e.pointerId,n=this._lockedPointer||this._findPointerById(t);if(n){if(n.clientX=e.clientX,n.clientY=e.clientY,n.deltaX=e.movementX,n.deltaY=e.movementY,this._state=0,e.pointerType===`touch`)switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else (!this._isDragging&&this._lockedPointer||this._isDragging&&(e.buttons&pU.LEFT)===pU.LEFT)&&(this._state|=this.mouseButtons.left),this._isDragging&&(e.buttons&pU.MIDDLE)===pU.MIDDLE&&(this._state|=this.mouseButtons.middle),this._isDragging&&(e.buttons&pU.RIGHT)===pU.RIGHT&&(this._state|=this.mouseButtons.right);p()}},c=e=>{let t=this._findPointerById(e.pointerId);if(!(t&&t===this._lockedPointer)){if(t&&this._disposePointer(t),e.pointerType===`touch`)switch(this._activePointers.length){case 0:this._state=$.NONE;break;case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else this._state=$.NONE;m()}},l=-1,u=e=>{if(!this._domElement||!this._enabled||this.mouseButtons.wheel===$.NONE)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){let t=this._domElement.getBoundingClientRect(),n=e.clientX/t.width,r=e.clientY/t.height;if(nthis._interactiveArea.right||rthis._interactiveArea.bottom)return}if(e.preventDefault(),this.dollyToCursor||this.mouseButtons.wheel===$.ROTATE||this.mouseButtons.wheel===$.TRUCK){let e=performance.now();l-e<1e3&&this._getClientRect(this._elementRect),l=e}let t=FU?-1:-3,n=e.deltaMode===1?e.deltaY/t:e.deltaY/(t*10),r=this.dollyToCursor?(e.clientX-this._elementRect.x)/this._elementRect.width*2-1:0,i=this.dollyToCursor?(e.clientY-this._elementRect.y)/this._elementRect.height*-2+1:0;switch(this.mouseButtons.wheel){case $.ROTATE:this._rotateInternal(e.deltaX,e.deltaY),this._isUserControllingRotate=!0;break;case $.TRUCK:this._truckInternal(e.deltaX,e.deltaY,!1),this._isUserControllingTruck=!0;break;case $.OFFSET:this._truckInternal(e.deltaX,e.deltaY,!0),this._isUserControllingOffset=!0;break;case $.DOLLY:this._dollyInternal(-n,r,i),this._isUserControllingDolly=!0;break;case $.ZOOM:this._zoomInternal(-n,r,i),this._isUserControllingZoom=!0;break}this.dispatchEvent({type:`control`})},d=t=>{if(!(!this._domElement||!this._enabled)){if(this.mouseButtons.right===e.ACTION.NONE){let e=t instanceof PointerEvent?t.pointerId:0,n=this._findPointerById(e);n&&this._disposePointer(n),this._domElement.ownerDocument.removeEventListener(`pointermove`,s,{passive:!1}),this._domElement.ownerDocument.removeEventListener(`pointerup`,c);return}t.preventDefault()}},f=e=>{if(this._enabled){if(kU(this._activePointers,BU),this._getClientRect(this._elementRect),r.copy(BU),i.copy(BU),this._activePointers.length>=2){let e=BU.x-this._activePointers[1].clientX,t=BU.y-this._activePointers[1].clientY,n=Math.sqrt(e*e+t*t);a.set(0,n);let r=(this._activePointers[0].clientX+this._activePointers[1].clientX)*.5,o=(this._activePointers[0].clientY+this._activePointers[1].clientY)*.5;i.set(r,o)}if(this._state=0,!e)this._lockedPointer&&(this._state|=this.mouseButtons.left);else if(`pointerType`in e&&e.pointerType===`touch`)switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else !this._lockedPointer&&(e.buttons&pU.LEFT)===pU.LEFT&&(this._state|=this.mouseButtons.left),(e.buttons&pU.MIDDLE)===pU.MIDDLE&&(this._state|=this.mouseButtons.middle),(e.buttons&pU.RIGHT)===pU.RIGHT&&(this._state|=this.mouseButtons.right);((this._state&$.ROTATE)===$.ROTATE||(this._state&$.TOUCH_ROTATE)===$.TOUCH_ROTATE||(this._state&$.TOUCH_DOLLY_ROTATE)===$.TOUCH_DOLLY_ROTATE||(this._state&$.TOUCH_ZOOM_ROTATE)===$.TOUCH_ZOOM_ROTATE)&&(this._sphericalEnd.theta=this._spherical.theta,this._sphericalEnd.phi=this._spherical.phi,this._thetaVelocity.value=0,this._phiVelocity.value=0),((this._state&$.TRUCK)===$.TRUCK||(this._state&$.TOUCH_TRUCK)===$.TOUCH_TRUCK||(this._state&$.TOUCH_DOLLY_TRUCK)===$.TOUCH_DOLLY_TRUCK||(this._state&$.TOUCH_ZOOM_TRUCK)===$.TOUCH_ZOOM_TRUCK)&&(this._targetEnd.copy(this._target),this._targetVelocity.set(0,0,0)),((this._state&$.DOLLY)===$.DOLLY||(this._state&$.TOUCH_DOLLY)===$.TOUCH_DOLLY||(this._state&$.TOUCH_DOLLY_TRUCK)===$.TOUCH_DOLLY_TRUCK||(this._state&$.TOUCH_DOLLY_OFFSET)===$.TOUCH_DOLLY_OFFSET||(this._state&$.TOUCH_DOLLY_ROTATE)===$.TOUCH_DOLLY_ROTATE)&&(this._sphericalEnd.radius=this._spherical.radius,this._radiusVelocity.value=0),((this._state&$.ZOOM)===$.ZOOM||(this._state&$.TOUCH_ZOOM)===$.TOUCH_ZOOM||(this._state&$.TOUCH_ZOOM_TRUCK)===$.TOUCH_ZOOM_TRUCK||(this._state&$.TOUCH_ZOOM_OFFSET)===$.TOUCH_ZOOM_OFFSET||(this._state&$.TOUCH_ZOOM_ROTATE)===$.TOUCH_ZOOM_ROTATE)&&(this._zoomEnd=this._zoom,this._zoomVelocity.value=0),((this._state&$.OFFSET)===$.OFFSET||(this._state&$.TOUCH_OFFSET)===$.TOUCH_OFFSET||(this._state&$.TOUCH_DOLLY_OFFSET)===$.TOUCH_DOLLY_OFFSET||(this._state&$.TOUCH_ZOOM_OFFSET)===$.TOUCH_ZOOM_OFFSET)&&(this._focalOffsetEnd.copy(this._focalOffset),this._focalOffsetVelocity.set(0,0,0)),this.dispatchEvent({type:`controlstart`})}},p=()=>{if(!this._enabled||!this._dragNeedsUpdate)return;this._dragNeedsUpdate=!1,kU(this._activePointers,BU);let e=this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement?this._lockedPointer||this._activePointers[0]:null,t=e?-e.deltaX:i.x-BU.x,n=e?-e.deltaY:i.y-BU.y;if(i.copy(BU),((this._state&$.ROTATE)===$.ROTATE||(this._state&$.TOUCH_ROTATE)===$.TOUCH_ROTATE||(this._state&$.TOUCH_DOLLY_ROTATE)===$.TOUCH_DOLLY_ROTATE||(this._state&$.TOUCH_ZOOM_ROTATE)===$.TOUCH_ZOOM_ROTATE)&&(this._rotateInternal(t,n),this._isUserControllingRotate=!0),(this._state&$.DOLLY)===$.DOLLY||(this._state&$.ZOOM)===$.ZOOM){let e=this.dollyToCursor?(r.x-this._elementRect.x)/this._elementRect.width*2-1:0,t=this.dollyToCursor?(r.y-this._elementRect.y)/this._elementRect.height*-2+1:0,i=this.dollyDragInverted?-1:1;(this._state&$.DOLLY)===$.DOLLY?(this._dollyInternal(i*n*PU,e,t),this._isUserControllingDolly=!0):(this._zoomInternal(i*n*PU,e,t),this._isUserControllingZoom=!0)}if((this._state&$.TOUCH_DOLLY)===$.TOUCH_DOLLY||(this._state&$.TOUCH_ZOOM)===$.TOUCH_ZOOM||(this._state&$.TOUCH_DOLLY_TRUCK)===$.TOUCH_DOLLY_TRUCK||(this._state&$.TOUCH_ZOOM_TRUCK)===$.TOUCH_ZOOM_TRUCK||(this._state&$.TOUCH_DOLLY_OFFSET)===$.TOUCH_DOLLY_OFFSET||(this._state&$.TOUCH_ZOOM_OFFSET)===$.TOUCH_ZOOM_OFFSET||(this._state&$.TOUCH_DOLLY_ROTATE)===$.TOUCH_DOLLY_ROTATE||(this._state&$.TOUCH_ZOOM_ROTATE)===$.TOUCH_ZOOM_ROTATE){let e=BU.x-this._activePointers[1].clientX,t=BU.y-this._activePointers[1].clientY,n=Math.sqrt(e*e+t*t),r=a.y-n;a.set(0,n);let o=this.dollyToCursor?(i.x-this._elementRect.x)/this._elementRect.width*2-1:0,s=this.dollyToCursor?(i.y-this._elementRect.y)/this._elementRect.height*-2+1:0;(this._state&$.TOUCH_DOLLY)===$.TOUCH_DOLLY||(this._state&$.TOUCH_DOLLY_ROTATE)===$.TOUCH_DOLLY_ROTATE||(this._state&$.TOUCH_DOLLY_TRUCK)===$.TOUCH_DOLLY_TRUCK||(this._state&$.TOUCH_DOLLY_OFFSET)===$.TOUCH_DOLLY_OFFSET?(this._dollyInternal(r*PU,o,s),this._isUserControllingDolly=!0):(this._zoomInternal(r*PU,o,s),this._isUserControllingZoom=!0)}((this._state&$.TRUCK)===$.TRUCK||(this._state&$.TOUCH_TRUCK)===$.TOUCH_TRUCK||(this._state&$.TOUCH_DOLLY_TRUCK)===$.TOUCH_DOLLY_TRUCK||(this._state&$.TOUCH_ZOOM_TRUCK)===$.TOUCH_ZOOM_TRUCK)&&(this._truckInternal(t,n,!1),this._isUserControllingTruck=!0),((this._state&$.OFFSET)===$.OFFSET||(this._state&$.TOUCH_OFFSET)===$.TOUCH_OFFSET||(this._state&$.TOUCH_DOLLY_OFFSET)===$.TOUCH_DOLLY_OFFSET||(this._state&$.TOUCH_ZOOM_OFFSET)===$.TOUCH_ZOOM_OFFSET)&&(this._truckInternal(t,n,!0),this._isUserControllingOffset=!0),this.dispatchEvent({type:`control`})},m=()=>{kU(this._activePointers,BU),i.copy(BU),this._dragNeedsUpdate=!1,(this._activePointers.length===0||this._activePointers.length===1&&this._activePointers[0]===this._lockedPointer)&&(this._isDragging=!1),this._activePointers.length===0&&this._domElement&&(this._domElement.ownerDocument.removeEventListener(`pointermove`,s,{passive:!1}),this._domElement.ownerDocument.removeEventListener(`pointerup`,c),this.dispatchEvent({type:`controlend`}))};this.lockPointer=()=>{!this._enabled||!this._domElement||(this.cancel(),this._lockedPointer={pointerId:-1,clientX:0,clientY:0,deltaX:0,deltaY:0,mouseButton:null},this._activePointers.push(this._lockedPointer),this._domElement.ownerDocument.removeEventListener(`pointermove`,s,{passive:!1}),this._domElement.ownerDocument.removeEventListener(`pointerup`,c),this._domElement.requestPointerLock(),this._domElement.ownerDocument.addEventListener(`pointerlockchange`,h),this._domElement.ownerDocument.addEventListener(`pointerlockerror`,g),this._domElement.ownerDocument.addEventListener(`pointermove`,s,{passive:!1}),this._domElement.ownerDocument.addEventListener(`pointerup`,c),f())},this.unlockPointer=()=>{var e,t,n;this._lockedPointer!==null&&(this._disposePointer(this._lockedPointer),this._lockedPointer=null),(e=this._domElement)==null||e.ownerDocument.exitPointerLock(),(t=this._domElement)==null||t.ownerDocument.removeEventListener(`pointerlockchange`,h),(n=this._domElement)==null||n.ownerDocument.removeEventListener(`pointerlockerror`,g),this.cancel()};let h=()=>{this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement||this.unlockPointer()},g=()=>{this.unlockPointer()};this._addAllEventListeners=e=>{this._domElement=e,this._domElement.style.touchAction=`none`,this._domElement.style.userSelect=`none`,this._domElement.style.webkitUserSelect=`none`,this._domElement.addEventListener(`pointerdown`,o),this._domElement.addEventListener(`pointercancel`,c),this._domElement.addEventListener(`wheel`,u,{passive:!1}),this._domElement.addEventListener(`contextmenu`,d)},this._removeAllEventListeners=()=>{this._domElement&&(this._domElement.style.touchAction=``,this._domElement.style.userSelect=``,this._domElement.style.webkitUserSelect=``,this._domElement.removeEventListener(`pointerdown`,o),this._domElement.removeEventListener(`pointercancel`,c),this._domElement.removeEventListener(`wheel`,u,{passive:!1}),this._domElement.removeEventListener(`contextmenu`,d),this._domElement.ownerDocument.removeEventListener(`pointermove`,s,{passive:!1}),this._domElement.ownerDocument.removeEventListener(`pointerup`,c),this._domElement.ownerDocument.removeEventListener(`pointerlockchange`,h),this._domElement.ownerDocument.removeEventListener(`pointerlockerror`,g))},this.cancel=()=>{this._state!==$.NONE&&(this._state=$.NONE,this._activePointers.length=0,m())},n&&this.connect(n),this.update(0)}get camera(){return this._camera}set camera(e){this._camera=e,this.updateCameraUp(),this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this._domElement&&(e?(this._domElement.style.touchAction=`none`,this._domElement.style.userSelect=`none`,this._domElement.style.webkitUserSelect=`none`):(this.cancel(),this._domElement.style.touchAction=``,this._domElement.style.userSelect=``,this._domElement.style.webkitUserSelect=``))}get active(){return!this._hasRested}get currentAction(){return this._state}get distance(){return this._spherical.radius}set distance(e){this._spherical.radius===e&&this._sphericalEnd.radius===e||(this._spherical.radius=e,this._sphericalEnd.radius=e,this._needsUpdate=!0)}get azimuthAngle(){return this._spherical.theta}set azimuthAngle(e){this._spherical.theta===e&&this._sphericalEnd.theta===e||(this._spherical.theta=e,this._sphericalEnd.theta=e,this._needsUpdate=!0)}get polarAngle(){return this._spherical.phi}set polarAngle(e){this._spherical.phi===e&&this._sphericalEnd.phi===e||(this._spherical.phi=e,this._sphericalEnd.phi=e,this._needsUpdate=!0)}get boundaryEnclosesCamera(){return this._boundaryEnclosesCamera}set boundaryEnclosesCamera(e){this._boundaryEnclosesCamera=e,this._needsUpdate=!0}set interactiveArea(e){this._interactiveArea.width=xU(e.width,0,1),this._interactiveArea.height=xU(e.height,0,1),this._interactiveArea.x=xU(e.x,0,1-this._interactiveArea.width),this._interactiveArea.y=xU(e.y,0,1-this._interactiveArea.height)}addEventListener(e,t){super.addEventListener(e,t)}removeEventListener(e,t){super.removeEventListener(e,t)}rotate(e,t,n=!1){return this.rotateTo(this._sphericalEnd.theta+e,this._sphericalEnd.phi+t,n)}rotateAzimuthTo(e,t=!1){return this.rotateTo(e,this._sphericalEnd.phi,t)}rotatePolarTo(e,t=!1){return this.rotateTo(this._sphericalEnd.theta,e,t)}rotateTo(e,t,n=!1){this._isUserControllingRotate=!1;let r=xU(e,this.minAzimuthAngle,this.maxAzimuthAngle),i=xU(t,this.minPolarAngle,this.maxPolarAngle);this._sphericalEnd.theta=r,this._sphericalEnd.phi=i,this._sphericalEnd.makeSafe(),this._needsUpdate=!0,n||(this._spherical.theta=this._sphericalEnd.theta,this._spherical.phi=this._sphericalEnd.phi);let a=!n||CU(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&CU(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold);return this._createOnRestPromise(a)}dolly(e,t=!1){return this.dollyTo(this._sphericalEnd.radius-e,t)}dollyTo(e,t=!1){return this._isUserControllingDolly=!1,this._lastDollyDirection=mU.NONE,this._changedDolly=0,this._dollyToNoClamp(xU(e,this.minDistance,this.maxDistance),t)}_dollyToNoClamp(e,t=!1){let n=this._sphericalEnd.radius;if(this.colliderMeshes.length>=1){let t=this._collisionTest(),r=CU(t,this._spherical.radius);if(!(n>e)&&r)return Promise.resolve();this._sphericalEnd.radius=Math.min(e,t)}else this._sphericalEnd.radius=e;this._needsUpdate=!0,t||(this._spherical.radius=this._sphericalEnd.radius);let r=!t||CU(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(r)}dollyInFixed(e,t=!1){this._targetEnd.add(this._getCameraDirection(WU).multiplyScalar(e)),t||this._target.copy(this._targetEnd);let n=!t||CU(this._target.x,this._targetEnd.x,this.restThreshold)&&CU(this._target.y,this._targetEnd.y,this.restThreshold)&&CU(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(n)}zoom(e,t=!1){return this.zoomTo(this._zoomEnd+e,t)}zoomTo(e,t=!1){this._isUserControllingZoom=!1,this._zoomEnd=xU(e,this.minZoom,this.maxZoom),this._needsUpdate=!0,t||(this._zoom=this._zoomEnd);let n=!t||CU(this._zoom,this._zoomEnd,this.restThreshold);return this._changedZoom=0,this._createOnRestPromise(n)}pan(e,t,n=!1){return console.warn("`pan` has been renamed to `truck`"),this.truck(e,t,n)}truck(e,t,n=!1){this._camera.updateMatrix(),GU.setFromMatrixColumn(this._camera.matrix,0),KU.setFromMatrixColumn(this._camera.matrix,1),GU.multiplyScalar(e),KU.multiplyScalar(-t);let r=VU.copy(GU).add(KU),i=HU.copy(this._targetEnd).add(r);return this.moveTo(i.x,i.y,i.z,n)}forward(e,t=!1){VU.setFromMatrixColumn(this._camera.matrix,0),VU.crossVectors(this._camera.up,VU),VU.multiplyScalar(e);let n=HU.copy(this._targetEnd).add(VU);return this.moveTo(n.x,n.y,n.z,t)}elevate(e,t=!1){return VU.copy(this._camera.up).multiplyScalar(e),this.moveTo(this._targetEnd.x+VU.x,this._targetEnd.y+VU.y,this._targetEnd.z+VU.z,t)}moveTo(e,t,n,r=!1){this._isUserControllingTruck=!1;let i=VU.set(e,t,n).sub(this._targetEnd);this._encloseToBoundary(this._targetEnd,i,this.boundaryFriction),this._needsUpdate=!0,r||this._target.copy(this._targetEnd);let a=!r||CU(this._target.x,this._targetEnd.x,this.restThreshold)&&CU(this._target.y,this._targetEnd.y,this.restThreshold)&&CU(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(a)}lookInDirectionOf(e,t,n,r=!1){let i=VU.set(e,t,n).sub(this._targetEnd).normalize().multiplyScalar(-this._sphericalEnd.radius).add(this._targetEnd);return this.setPosition(i.x,i.y,i.z,r)}fitToBox(e,t,{cover:n=!1,paddingLeft:r=0,paddingRight:i=0,paddingBottom:a=0,paddingTop:o=0}={}){let s=[],c=e.isBox3?QU.copy(e):QU.setFromObject(e);c.isEmpty()&&(console.warn(`camera-controls: fitTo() cannot be used with an empty box. Aborting`),Promise.resolve());let l=wU(this._sphericalEnd.theta,vU),u=wU(this._sphericalEnd.phi,vU);s.push(this.rotateTo(l,u,t));let d=VU.setFromSpherical(this._sphericalEnd).normalize(),f=tW.setFromUnitVectors(d,zU),p=CU(Math.abs(d.y),1);p&&f.multiply(nW.setFromAxisAngle(RU,l)),f.multiply(this._yAxisUpSpaceInverse);let m=$U.makeEmpty();HU.copy(c.min).applyQuaternion(f),m.expandByPoint(HU),HU.copy(c.min).setX(c.max.x).applyQuaternion(f),m.expandByPoint(HU),HU.copy(c.min).setY(c.max.y).applyQuaternion(f),m.expandByPoint(HU),HU.copy(c.max).setZ(c.min.z).applyQuaternion(f),m.expandByPoint(HU),HU.copy(c.min).setZ(c.max.z).applyQuaternion(f),m.expandByPoint(HU),HU.copy(c.max).setY(c.min.y).applyQuaternion(f),m.expandByPoint(HU),HU.copy(c.max).setX(c.min.x).applyQuaternion(f),m.expandByPoint(HU),HU.copy(c.max).applyQuaternion(f),m.expandByPoint(HU),m.min.x-=r,m.min.y-=a,m.max.x+=i,m.max.y+=o,f.setFromUnitVectors(zU,d),p&&f.premultiply(nW.invert()),f.premultiply(this._yAxisUpSpace);let h=m.getSize(VU),g=m.getCenter(HU).applyQuaternion(f);if(hU(this._camera)){let e=this.getDistanceToFitBox(h.x,h.y,h.z,n);s.push(this.moveTo(g.x,g.y,g.z,t)),s.push(this.dollyTo(e,t)),s.push(this.setFocalOffset(0,0,0,t))}else if(gU(this._camera)){let e=this._camera,r=e.right-e.left,i=e.top-e.bottom,a=n?Math.max(r/h.x,i/h.y):Math.min(r/h.x,i/h.y);s.push(this.moveTo(g.x,g.y,g.z,t)),s.push(this.zoomTo(a,t)),s.push(this.setFocalOffset(0,0,0,t))}return Promise.all(s)}fitToSphere(t,n){let r=[],i=`isObject3D`in t?e.createBoundingSphere(t,eW):eW.copy(t);if(r.push(this.moveTo(i.center.x,i.center.y,i.center.z,n)),hU(this._camera)){let e=this.getDistanceToFitSphere(i.radius);r.push(this.dollyTo(e,n))}else if(gU(this._camera)){let e=this._camera.right-this._camera.left,t=this._camera.top-this._camera.bottom,a=2*i.radius,o=Math.min(e/a,t/a);r.push(this.zoomTo(o,n))}return r.push(this.setFocalOffset(0,0,0,n)),Promise.all(r)}setLookAt(e,t,n,r,i,a,o=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=mU.NONE,this._changedDolly=0;let s=HU.set(r,i,a),c=VU.set(e,t,n);this._targetEnd.copy(s),this._sphericalEnd.setFromVector3(c.sub(s).applyQuaternion(this._yAxisUpSpace)),this.normalizeRotations(),this._needsUpdate=!0,o||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));let l=!o||CU(this._target.x,this._targetEnd.x,this.restThreshold)&&CU(this._target.y,this._targetEnd.y,this.restThreshold)&&CU(this._target.z,this._targetEnd.z,this.restThreshold)&&CU(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&CU(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&CU(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(l)}lerpLookAt(e,t,n,r,i,a,o,s,c,l,u,d,f,p=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=mU.NONE,this._changedDolly=0;let m=VU.set(r,i,a),h=HU.set(e,t,n);XU.setFromVector3(h.sub(m).applyQuaternion(this._yAxisUpSpace));let g=UU.set(l,u,d),_=HU.set(o,s,c);ZU.setFromVector3(_.sub(g).applyQuaternion(this._yAxisUpSpace)),this._targetEnd.copy(m.lerp(g,f));let v=ZU.theta-XU.theta,y=ZU.phi-XU.phi,b=ZU.radius-XU.radius;this._sphericalEnd.set(XU.radius+b*f,XU.phi+y*f,XU.theta+v*f),this.normalizeRotations(),this._needsUpdate=!0,p||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));let x=!p||CU(this._target.x,this._targetEnd.x,this.restThreshold)&&CU(this._target.y,this._targetEnd.y,this.restThreshold)&&CU(this._target.z,this._targetEnd.z,this.restThreshold)&&CU(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&CU(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&CU(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(x)}setPosition(e,t,n,r=!1){return this.setLookAt(e,t,n,this._targetEnd.x,this._targetEnd.y,this._targetEnd.z,r)}setTarget(e,t,n,r=!1){let i=this.getPosition(VU),a=this.setLookAt(i.x,i.y,i.z,e,t,n,r);return this._sphericalEnd.phi=xU(this._sphericalEnd.phi,this.minPolarAngle,this.maxPolarAngle),a}setFocalOffset(e,t,n,r=!1){this._isUserControllingOffset=!1,this._focalOffsetEnd.set(e,t,n),this._needsUpdate=!0,r||this._focalOffset.copy(this._focalOffsetEnd);let i=!r||CU(this._focalOffset.x,this._focalOffsetEnd.x,this.restThreshold)&&CU(this._focalOffset.y,this._focalOffsetEnd.y,this.restThreshold)&&CU(this._focalOffset.z,this._focalOffsetEnd.z,this.restThreshold);return this._createOnRestPromise(i)}setOrbitPoint(e,t,n){this._camera.updateMatrixWorld(),GU.setFromMatrixColumn(this._camera.matrixWorldInverse,0),KU.setFromMatrixColumn(this._camera.matrixWorldInverse,1),qU.setFromMatrixColumn(this._camera.matrixWorldInverse,2);let r=VU.set(e,t,n),i=r.distanceTo(this._camera.position),a=r.sub(this._camera.position);GU.multiplyScalar(a.x),KU.multiplyScalar(a.y),qU.multiplyScalar(a.z),VU.copy(GU).add(KU).add(qU),VU.z+=i,this.dollyTo(i,!1),this.setFocalOffset(-VU.x,VU.y,-VU.z,!1),this.moveTo(e,t,n,!1)}setBoundary(e){if(!e){this._boundary.min.set(-1/0,-1/0,-1/0),this._boundary.max.set(1/0,1/0,1/0),this._needsUpdate=!0;return}this._boundary.copy(e),this._boundary.clampPoint(this._targetEnd,this._targetEnd),this._needsUpdate=!0}setViewport(e,t,n,r){if(e===null){this._viewport=null;return}this._viewport=this._viewport||new IU.Vector4,typeof e==`number`?this._viewport.set(e,t,n,r):this._viewport.copy(e)}getDistanceToFitBox(e,t,n,r=!1){if(AU(this._camera,`getDistanceToFitBox`))return this._spherical.radius;let i=e/t,a=this._camera.getEffectiveFOV()*bU,o=this._camera.aspect;return((r?i>o:it.pointerId===e)}_findPointerByMouseButton(e){return this._activePointers.find(t=>t.mouseButton===e)}_disposePointer(e){this._activePointers.splice(this._activePointers.indexOf(e),1)}_encloseToBoundary(e,t,n){let r=t.lengthSq();if(r===0)return e;let i=HU.copy(t).add(e),a=this._boundary.clampPoint(i,UU).sub(i),o=a.lengthSq();if(o===0)return e.add(t);if(o===r)return e;if(n===0)return e.add(t).add(a);{let r=1+n*o/t.dot(a);return e.add(HU.copy(t).multiplyScalar(r)).add(a.multiplyScalar(1-n))}}_updateNearPlaneCorners(){if(hU(this._camera)){let e=this._camera,t=e.near,n=e.getEffectiveFOV()*bU,r=Math.tan(n*.5)*t,i=r*e.aspect;this._nearPlaneCorners[0].set(-i,-r,0),this._nearPlaneCorners[1].set(i,-r,0),this._nearPlaneCorners[2].set(i,r,0),this._nearPlaneCorners[3].set(-i,r,0)}else if(gU(this._camera)){let e=this._camera,t=1/e.zoom,n=e.left*t,r=e.right*t,i=e.top*t,a=e.bottom*t;this._nearPlaneCorners[0].set(n,i,0),this._nearPlaneCorners[1].set(r,i,0),this._nearPlaneCorners[2].set(r,a,0),this._nearPlaneCorners[3].set(n,a,0)}}_collisionTest(){let e=1/0;if(!(this.colliderMeshes.length>=1)||AU(this._camera,`_collisionTest`))return e;let t=this._getTargetDirection(WU);rW.lookAt(LU,t,this._camera.up);for(let n=0;n<4;n++){let r=HU.copy(this._nearPlaneCorners[n]);r.applyMatrix4(rW);let i=UU.addVectors(this._target,r);iW.set(i,t),iW.far=this._spherical.radius+1;let a=iW.intersectObjects(this.colliderMeshes);a.length!==0&&a[0].distance{let t=()=>{this.removeEventListener(`rest`,t),e()};this.addEventListener(`rest`,t)}))}_addAllEventListeners(e){}_removeAllEventListeners(){}get dampingFactor(){return console.warn(`.dampingFactor has been deprecated. use smoothTime (in seconds) instead.`),0}set dampingFactor(e){console.warn(`.dampingFactor has been deprecated. use smoothTime (in seconds) instead.`)}get draggingDampingFactor(){return console.warn(`.draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead.`),0}set draggingDampingFactor(e){console.warn(`.draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead.`)}static createBoundingSphere(e,t=new IU.Sphere){let n=t,r=n.center;QU.makeEmpty(),e.traverseVisible(e=>{e.isMesh&&QU.expandByObject(e)}),QU.getCenter(r);let i=0;return e.traverseVisible(e=>{if(!e.isMesh)return;let t=e,n=t.geometry.clone();n.applyMatrix4(t.matrixWorld);let a=n.attributes.position;for(let e=0,t=a.count;e!!(e&&e.isPerspectiveCamera),sW=e=>!!(e&&e.isOrthographicCamera),cW=`min-polar-angle.max-polar-angle.min-azimuth-angle.max-azimuth-angle.distance.min-distance.max-distance.infinity-dolly.min-zoom.max-zoom.smooth-time.dragging-smooth-time.max-speed.azimuth-rotate-speed.polar-rotate-speed.dolly-speed.dolly-drag-inverted.truck-speed.dolly-to-cursor.drag-to-offset.vertical-drag-to-forward.boundary-friction.rest-threshold.collider-meshes.args.mouse-buttons.touches`.split(`.`),lW=(e,t)=>({left:aW.ACTION.ROTATE,middle:aW.ACTION.DOLLY,right:aW.ACTION.TRUCK,wheel:oW(e)?aW.ACTION.DOLLY:sW(e)?aW.ACTION.ZOOM:aW.ACTION.NONE,...t}),uW=(e,t)=>({one:aW.ACTION.TOUCH_ROTATE,two:oW(e)?aW.ACTION.TOUCH_DOLLY_TRUCK:sW(e)?aW.ACTION.TOUCH_ZOOM_TRUCK:aW.ACTION.NONE,three:aW.ACTION.TOUCH_TRUCK,...t}),dW=$t({__name:`CameraControls`,props:{makeDefault:{type:Boolean,default:!1},camera:{},domElement:{},minPolarAngle:{default:0},maxPolarAngle:{default:Math.PI},minAzimuthAngle:{default:-1/0},maxAzimuthAngle:{default:1/0},distance:{default:()=>De().camera.value.position.z},minDistance:{default:2**-52},maxDistance:{default:1/0},infinityDolly:{type:Boolean,default:!1},minZoom:{default:.01},maxZoom:{default:1/0},smoothTime:{default:.25},draggingSmoothTime:{default:.125},maxSpeed:{default:1/0},azimuthRotateSpeed:{default:1},polarRotateSpeed:{default:1},dollySpeed:{default:1},dollyDragInverted:{type:Boolean,default:!1},truckSpeed:{default:2},dollyToCursor:{type:Boolean,default:!1},dragToOffset:{type:Boolean,default:!1},verticalDragToForward:{type:Boolean,default:!1},boundaryFriction:{default:0},restThreshold:{default:.01},colliderMeshes:{default:()=>[]},mouseButtons:{default:()=>lW(De().camera.value)},touches:{default:()=>uW(De().camera.value)}},emits:[`change`,`start`,`end`],setup(e,{expose:t,emit:n}){let r=e,i=n,{makeDefault:a,minPolarAngle:o,maxPolarAngle:s,minAzimuthAngle:c,maxAzimuthAngle:l,distance:u,minDistance:d,maxDistance:f,infinityDolly:p,minZoom:m,maxZoom:h,smoothTime:g,draggingSmoothTime:_,maxSpeed:v,azimuthRotateSpeed:y,polarRotateSpeed:b,dollySpeed:x,dollyDragInverted:S,truckSpeed:C,dollyToCursor:w,dragToOffset:T,verticalDragToForward:E,boundaryFriction:D,restThreshold:O,colliderMeshes:k}=rn(r),A={Box3:R,MathUtils:{clamp:nt.clamp},Matrix4:wt,Quaternion:It,Raycaster:rt,Sphere:At,Spherical:Pe,Vector2:ct,Vector3:B,Vector4:qt};aW.install({THREE:A});let{camera:j,renderer:M,extend:N,controls:ee,invalidate:P}=De();G(r,()=>{P()});let F=On(()=>lW(r.camera||j.value,r.mouseButtons)),I=On(()=>uW(r.camera||j.value,r.touches)),L=W(null);N({CameraControls:aW}),Cn(()=>{te(),L.value&&a.value?ee.value=L.value:ee.value=null});function te(){fR(L.value,`update`,()=>{i(`change`,L.value),P()}),fR(L.value,`controlend`,()=>i(`end`,L.value)),fR(L.value,`controlstart`,()=>i(`start`,L.value))}let{onBeforeRender:ne}=be();return ne(({delta:e,invalidate:t})=>{var n,r;(n=L.value)!=null&&n.enabled&&((r=L.value)==null||r.update(e),t())}),bn(()=>{L.value&&L.value.disconnect()}),t({instance:L}),(e,t)=>(e.camera||H(j))&&(e.domElement||H(M))?(K(),nn(`TresCameraControls`,{key:0,ref_key:`controlsRef`,ref:L,"min-polar-angle":H(o),"max-polar-angle":H(s),"min-azimuth-angle":H(c),"max-azimuth-angle":H(l),distance:H(u),"min-distance":H(d),"max-distance":H(f),"infinity-dolly":H(p),"min-zoom":H(m),"max-zoom":H(h),"smooth-time":H(g),"dragging-smooth-time":H(_),"max-speed":H(v),"azimuth-rotate-speed":H(y),"polar-rotate-speed":H(b),"dolly-speed":H(x),"dolly-drag-inverted":H(S),"truck-speed":H(C),"dolly-to-cursor":H(w),"drag-to-offset":H(T),"vertical-drag-to-forward":H(E),"boundary-friction":H(D),"rest-threshold":H(O),"collider-meshes":H(k),args:[e.camera||H(j),e.domElement||H(M).domElement],"mouse-buttons":F.value,touches:I.value},null,8,cW)):en(``,!0)}}),fW=$t({__name:`KeyboardControls`,props:{makeDefault:{type:Boolean,default:!0},camera:{},domElement:{},moveSpeed:{default:.2},selector:{}},emits:[`isLock`,`change`],setup(e,{expose:t,emit:n}){let r=e,i=n,{moveSpeed:a}=rn(r),{camera:o,controls:s,renderer:c,invalidate:l}=De();G(r,()=>{l()});let u=U(0),d=U(0),{KeyW:f,KeyA:p,KeyS:m,KeyD:h,Up:g,Down:_,Left:v,Right:y}=xR();Cn(()=>{p.value||v.value?u.value=-a.value:h.value||y.value?u.value=a.value:u.value=0,f.value||g.value?d.value=a.value:m.value||_.value?d.value=-a.value:d.value=0}),t({instance:s});let b=e=>i(`isLock`,e),x=e=>i(`change`,e),S=new B,C=new B,w=new It,T=(e,t)=>{var n;if(!((n=o.value)!=null&&n.position)&&!S)return;let r=o.value,a=e*.001;r?.translateZ(-t),w.set(C.x*a,C.y*a,C.z*a,1).normalize(),r?.quaternion.multiply(w),(u.value||d.value)&&i(`change`,s.value)},{onBeforeRender:E}=be();return E(({delta:e,invalidate:t})=>{var n;s.value instanceof WB&&(n=s.value)!=null&&n.isLocked&&(T(e,d.value),s.value.moveRight(u.value),t())}),(e,t)=>(K(),wn(H(vW),{selector:e.selector,"make-default":e.makeDefault,camera:e.camera||H(o),"dom-element":e.domElement||H(c).domElement,onIsLock:b,onChange:x},null,8,[`selector`,`make-default`,`camera`,`dom-element`]))}}),pW=[`args`,`auto-rotate`,`auto-rotate-speed`,`enable-damping`,`damping-factor`,`enable-pan`,`key-pan-speed`,`keys`,`max-azimuth-angle`,`min-azimuth-angle`,`max-polar-angle`,`min-polar-angle`,`min-distance`,`max-distance`,`min-zoom`,`max-zoom`,`enable-zoom`,`zoom-speed`,`enable-rotate`,`rotate-speed`],mW=$t({__name:`MapControls`,props:{makeDefault:{type:Boolean,default:!1},camera:{},domElement:{},target:{},enableDamping:{type:Boolean,default:!0},dampingFactor:{default:.05},autoRotate:{type:Boolean,default:!1},autoRotateSpeed:{default:2},enablePan:{type:Boolean,default:!0},keyPanSpeed:{default:7},keys:{},maxAzimuthAngle:{default:1/0},minAzimuthAngle:{default:-1/0},maxPolarAngle:{default:Math.PI},minPolarAngle:{default:0},minDistance:{default:0},maxDistance:{default:1/0},minZoom:{default:0},maxZoom:{default:1/0},touches:{},enableZoom:{type:Boolean,default:!0},zoomSpeed:{default:1},enableRotate:{type:Boolean,default:!0},rotateSpeed:{default:1}},emits:[`change`,`start`,`end`],setup(e,{expose:t,emit:n}){let r=e,{autoRotate:i,autoRotateSpeed:a,enableDamping:o,dampingFactor:s,enablePan:c,keyPanSpeed:l,maxAzimuthAngle:u,minAzimuthAngle:d,maxPolarAngle:f,minPolarAngle:p,minDistance:m,maxDistance:h,minZoom:g,maxZoom:_,enableZoom:v,zoomSpeed:y,enableRotate:b,rotateSpeed:x}=rn(r),{camera:S,renderer:C,extend:w,controls:T,invalidate:E}=De();G(r,()=>{E()});let D=W(null);w({MapControls:$B}),G(T,e=>{e&&r.makeDefault?T.value=e:T.value=null});let{onBeforeRender:O}=be();return O(({invalidate:e})=>{D.value&&(o.value||i.value)&&(D.value.update(),e())}),bn(()=>{D.value&&D.value.dispose()}),t({instance:D}),(e,t)=>(e.camera||H(S))&&(e.domElement||H(C))?(K(),nn(`TresMapControls`,{key:0,ref_key:`controlsRef`,ref:D,args:[e.camera||H(S),e.domElement||H(C).domElement],"auto-rotate":H(i),"auto-rotate-speed":H(a),"enable-damping":H(o),"damping-factor":H(s),"enable-pan":H(c),"key-pan-speed":H(l),keys:e.keys,"max-azimuth-angle":H(u),"min-azimuth-angle":H(d),"max-polar-angle":H(f),"min-polar-angle":H(p),"min-distance":H(m),"max-distance":H(h),"min-zoom":H(g),"max-zoom":H(_),"enable-zoom":H(v),"zoom-speed":H(y),"enable-rotate":H(b),"rotate-speed":H(x)},null,8,pW)):en(``,!0)}}),hW=[`target`,`auto-rotate`,`auto-rotate-speed`,`enable-damping`,`damping-factor`,`enable-pan`,`key-pan-speed`,`keys`,`max-azimuth-angle`,`min-azimuth-angle`,`max-polar-angle`,`min-polar-angle`,`min-distance`,`max-distance`,`min-zoom`,`max-zoom`,`touches`,`enable-zoom`,`zoom-speed`,`enable-rotate`,`rotate-speed`,`mouse-buttons`,`args`],gW=$t({__name:`OrbitControls`,props:{makeDefault:{type:Boolean,default:!1},camera:{},domElement:{},target:{default:()=>[0,0,0]},enableDamping:{type:Boolean,default:!0},dampingFactor:{default:.05},autoRotate:{type:Boolean,default:!1},autoRotateSpeed:{default:2},enablePan:{type:Boolean,default:!0},keyPanSpeed:{default:7},keys:{},maxAzimuthAngle:{default:1/0},minAzimuthAngle:{default:-1/0},maxPolarAngle:{default:Math.PI},minPolarAngle:{default:0},minDistance:{default:0},maxDistance:{default:1/0},minZoom:{default:0},maxZoom:{default:1/0},touches:{default:()=>({ONE:Pt.ROTATE,TWO:Pt.DOLLY_PAN})},enableZoom:{type:Boolean,default:!0},zoomSpeed:{default:1},enableRotate:{type:Boolean,default:!0},rotateSpeed:{default:1},mouseButtons:{default:()=>({LEFT:jt.ROTATE,MIDDLE:jt.DOLLY,RIGHT:jt.PAN})}},emits:[`change`,`start`,`end`],setup(e,{expose:t,emit:n}){let r=e,i=n,{makeDefault:a,autoRotate:o,autoRotateSpeed:s,enableDamping:c,dampingFactor:l,enablePan:u,keyPanSpeed:d,maxAzimuthAngle:f,minAzimuthAngle:p,maxPolarAngle:m,minPolarAngle:h,minDistance:g,maxDistance:_,minZoom:v,maxZoom:y,enableZoom:b,zoomSpeed:x,enableRotate:S,touches:C,rotateSpeed:w,target:T,mouseButtons:E}=rn(r),{camera:D,renderer:O,extend:k,controls:A,invalidate:j}=De(),M=W(null);k({OrbitControls:QB}),G(M,e=>{N(),e&&a.value?A.value=e:A.value=null});function N(){fR(M.value,`change`,()=>{i(`change`,M.value),j()}),fR(M.value,`start`,()=>i(`start`,M.value)),fR(M.value,`end`,()=>i(`end`,M.value))}let{onBeforeRender:ee}=be();return ee(({invalidate:e})=>{M.value&&(c.value||o.value)&&(M.value.update(),o.value&&e())}),bn(()=>{M.value&&M.value.dispose()}),t({instance:M}),(e,t)=>(e.camera||H(D))&&(e.domElement||H(O))?(K(),nn(`TresOrbitControls`,{key:0,ref_key:`controlsRef`,ref:M,target:H(T),"auto-rotate":H(o),"auto-rotate-speed":H(s),"enable-damping":H(c),"damping-factor":H(l),"enable-pan":H(u),"key-pan-speed":H(d),keys:e.keys,"max-azimuth-angle":H(f),"min-azimuth-angle":H(p),"max-polar-angle":H(m),"min-polar-angle":H(h),"min-distance":H(g),"max-distance":H(_),"min-zoom":H(v),"max-zoom":H(y),touches:H(C),"enable-zoom":H(b),"zoom-speed":H(x),"enable-rotate":H(S),"rotate-speed":H(w),"mouse-buttons":H(E),args:[e.camera||H(D),e.domElement||H(O).domElement]},null,8,hW)):en(``,!0)}}),_W=[`args`],vW=$t({__name:`PointerLockControls`,props:{makeDefault:{type:Boolean,default:!1},camera:{},domElement:{},selector:{}},emits:[`isLock`,`change`],setup(e,{expose:t,emit:n}){let r=e,i=n,{camera:a,renderer:o,extend:s,controls:c,invalidate:l}=De();G(r,()=>{l()});let u=W(null),d;s({PointerLockControls:WB});let f=e=>{i(`isLock`,e)};return G(u,e=>{e&&r.makeDefault?c.value=e:c.value=null,d=document.getElementById(r.selector||``)||o.value.domElement,fR(d,`click`,()=>{u.value&&(u.value.lock(),u.value.addEventListener(`lock`,()=>f(!0)),u.value.addEventListener(`unlock`,()=>f(!1)),l())})}),bn(()=>{let e=u.value;e&&(e.removeEventListener(`lock`,()=>f(!0)),e.removeEventListener(`unlock`,()=>f(!1)),e.dispose())}),t({instance:c}),(e,t)=>(e.camera||H(a))&&(e.domElement||H(o))?(K(),nn(`TresPointerLockControls`,{key:0,ref_key:`controlsRef`,ref:u,args:[e.camera||H(a),e.domElement||H(o).domElement]},null,8,_W)):en(``,!0)}}),yW=$t({__name:`ScrollControls`,props:{pages:{default:4},distance:{default:4},smoothScroll:{default:.1},horizontal:{type:Boolean,default:!1},htmlScroll:{type:Boolean,default:!1}},emits:[`update:modelValue`],setup(e,{expose:t,emit:n}){let r=e,i=n,{logWarning:a}=Ce();r.smoothScroll<0&&a(`SmoothControl must be greater than zero`),r.pages<0&&a(`Pages must be greater than zero`);let{camera:o,controls:s,renderer:c,invalidate:l}=De();G(r,()=>{l()});let u=W(),d=document.createElement(`div`),{y:f}=wR(),{x:p,y:m,isScrolling:h}=yR(d),{height:g,width:_}=TR(),v=0,y=U(!1),b=U(0),x=U(0),S=U(0),C=r.horizontal?`x`:`y`,w=G(o,e=>{if(y.value){w();return}v=r.horizontal?e?.position.x||0:e?.position.y||0,y.value=!0},{immediate:!0});G(h,e=>{s.value&&(s.value.enabled=!e)},{immediate:!0}),G(f,e=>{!h.value&&!r.htmlScroll||(x.value=e/g.value/(S.value/g.value-1),b.value=-1*x.value,i(`update:modelValue`,x.value))}),G(m,e=>{x.value=e/g.value/(S.value/g.value),b.value=-1*x.value,i(`update:modelValue`,x.value)}),G(p,e=>{x.value=e/_.value/(S.value/_.value-1),b.value=+x.value,i(`update:modelValue`,x.value)}),G(c,e=>{var t,n;let i=e?.domElement;if(r.htmlScroll&&e!=null&&e.domElement)i!=null&&i.style.width&&i!=null&&i.style.position&&i!=null&&i.style.top&&i!=null&&i.style.left&&(i.style.width=`100%`,i.style.position=`fixed`,i.style.zIndex=` -99999`,i.style.top=`0`,i.style.left=`0`),S.value=document.body.scrollHeight;else{let a=document.createElement(`div`),o=document.createElement(`div`);d.style[r.horizontal?`overflowX`:`overflowY`]=`auto`,d.style[r.horizontal?`overflowY`:`overflowX`]=`hidden`,d.style.position=`absolute`,d.style.width=`100%`,d.style.height=` 100%`,d.style.top=`0`,d.style.left=`0`,d.classList.add(`scrollContainer`),a.style.position=`sticky`,a.style.top=`0px`,a.style.left=`0px`,a.style.width=`100%`,a.style.height=`100%`,a.style.overflow=`hidden`,d.appendChild(a),o.style.height=r.horizontal?`100%`:`${g.value*r.pages}px`,o.style.width=r.horizontal?`${_.value*r.pages}px`:`100vw`,o.style.pointerEvents=`none`,i.style.position=`fixed`,i.style.zIndex=`0`,i!=null&&i.style.width&&(i.style.width=`100%`),d.appendChild(o),e!=null&&e.domElement.parentNode&&(e.domElement.parentNode.style.position=`relative`),(n=(t=e?.domElement)?.parentNode)==null||n.appendChild(d),S.value=r.horizontal?_.value*r.pages:g.value*r.pages}},{immediate:!0});let{onBeforeRender:T}=be();return T(({invalidate:e})=>{var t;if((t=o.value)!=null&&t.position){let t=(b.value*r.distance-o.value.position[C]+v)*r.smoothScroll;o.value.position[C]+=t,u.value.children.length>0&&(u.value.position[C]+=t),e()}}),t({instance:u}),(e,t)=>(K(),nn(`TresGroup`,{ref_key:`wrapperRef`,ref:u},[Tn(e.$slots,`default`)],512))}}),bW=[`object`,`args`,`mode`,`enabled`,`axis`,`translation-snap`,`rotation-snap`,`scale-snap`,`space`,`size`,`show-x`,`show-y`,`show-z`],xW=$t({__name:`TransformControls`,props:{object:{},camera:{},mode:{default:`translate`},enabled:{type:Boolean,default:!0},axis:{default:`XYZ`},translationSnap:{},rotationSnap:{},scaleSnap:{},space:{default:`world`},size:{default:1},showX:{type:Boolean,default:!0},showY:{type:Boolean,default:!0},showZ:{type:Boolean,default:!0}},emits:[`dragging`,`change`,`mouseDown`,`mouseUp`,`objectChange`],setup(e,{expose:t,emit:n}){let r=e,i=n,{object:a,mode:o,enabled:s,axis:c,translationSnap:l,rotationSnap:u,scaleSnap:d,space:f,size:p,showX:m,showY:h,showZ:g}=rn(r),_=W(null),{controls:v,camera:y,renderer:b,extend:x,invalidate:S}=De();G([a,o,s,c,l,u,d,f,p,m,h,g],()=>{S()}),x({TransformControls:MB});let C=()=>{S(),i(`change`)},w=e=>{v.value&&(v.value.enabled=!e.value),S(),i(`dragging`,e.value)},T=()=>{S(),i(`mouseDown`)},E=()=>{S(),i(`mouseDown`)},D=()=>{S(),i(`objectChange`)};function O(){fR(_.value,`change`,C),fR(_.value,`dragging-changed`,w),fR(_.value,`mouseDown`,T),fR(_.value,`mouseUp`,E),fR(_.value,`objectChange`,D)}return G(_,e=>{e&&O()}),bn(()=>{_.value&&_.value.dispose()}),t({instance:_}),(e,t)=>{var n;return(e.camera||H(y))&&H(b)?(K(),nn(`TresTransformControls`,{ref_key:`controlsRef`,ref:_,key:(n=e.camera||H(y))?.uuid,object:H(a),args:[e.camera||H(y),H(b).domElement],mode:H(o),enabled:H(s),axis:H(c),"translation-snap":H(l),"rotation-snap":H(u),"scale-snap":H(d),space:H(f),size:H(p),"show-x":H(m),"show-y":H(h),"show-z":H(g),visible:!0},null,8,bW)):en(``,!0)}}}),SW=[`geometry`,`render-order`],CW=$t({__name:`component`,props:{src:{},skipStrokes:{type:Boolean,default:!1},skipFills:{type:Boolean,default:!1},fillMaterial:{},strokeMaterial:{},fillMeshProps:{},strokeMeshProps:{},depth:{default:`renderOrder`}},setup(e,{expose:t}){let n=e;class r extends OV{load(e,t,n,r){let i=Array.isArray(e)?e[0]:e;super.load(i,t,n,r)}}let{src:i,skipStrokes:a,skipFills:o,fillMaterial:s,strokeMaterial:c,fillMeshProps:l,strokeMeshProps:u,depth:d}=rn(n),f=W(),p=W([]),m=W([]);t({instance:f}),Cn(async()=>h(i.value).then(e=>m.value=e.paths)),G([o,a,s,c,m],_);async function h(e){let t=e.startsWith(`e.geometry.dispose())}function _(){var e,t,r;g();let i=[],[s,c]=(()=>{let e={flat:!1,renderOrder:!1,offsetZ:!0},t={flat:0,renderOrder:0,offsetZ:.025},n=d.value;return typeof n==`number`?[!0,n]:[e[n],t[n]]})(),l=0;for(let u of m.value){let d=(e=u.userData)?.style??{},f=Object.assign({color:d.fill,opacity:d.fillOpacity,transparent:!0,side:ze,depthWrite:s},n.fillMaterial);if(!o.value&&d.fill!==void 0&&d.fill!==`none`)for(let e of OV.createShapes(u)){let t=new Yt(e);t.scale(1,-1,1),c&&t.translate(0,0,l++*c),i.push({geometry:t,material:f,isStroke:!1})}if(!a.value&&d.stroke!==void 0&&d.stroke!==`none`){let e=Object.assign({color:(t=u.userData)?.style.stroke,opacity:(r=u.userData)?.style.strokeOpacity,transparent:!0,side:ze,depthWrite:s},n.strokeMaterial);for(let t of u.subPaths){let n=t.getPoints().map(e=>new ct(e.x,-e.y)),r=OV.pointsToStroke(n,d||`none`);c&&r.translate(0,0,l++*c),i.push({geometry:r,material:e,isStroke:!0})}}}p.value=i}return(e,t)=>(K(),nn(`TresGroup`,{ref_key:`svgRef`,ref:f},[(K(!0),nn(Dn,null,Sn(p.value,({geometry:e,material:t,isStroke:n},r)=>(K(),nn(`TresMesh`,jn({key:`${r}`,ref_for:!0},H(n?u:l),{geometry:e,"render-order":H(d)===`renderOrder`?r:0}),[xn(`TresMeshBasicMaterial`,jn({ref_for:!0},t),null,16)],16,SW))),128))],512))}});function wW(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}function TW(e){throw Error(`Could not dynamically require "`+e+`". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.`)}var EW={exports:{}},DW;function OW(){return DW||(DW=1,function(e,t){(function(t){e.exports=t()})(function(){return function e(t,n,r){function i(o,s){if(!n[o]){if(!t[o]){var c=typeof TW==`function`&&TW;if(!s&&c)return c(o,!0);if(a)return a(o,!0);throw Error(`Cannot find module '`+o+`'`)}s=n[o]={exports:{}},t[o][0].call(s.exports,function(e){var n=t[o][1][e];return i(n||e)},s,s.exports,e,t,n,r)}return n[o].exports}for(var a=typeof TW==`function`&&TW,o=0;o>16),c((65280&r)>>8),c(255&r);return i==2?c(255&(r=l(e.charAt(n))<<2|l(e.charAt(n+1))>>4)):i==1&&(c((r=l(e.charAt(n))<<10|l(e.charAt(n+1))<<4|l(e.charAt(n+2))>>2)>>8&255),c(255&r)),a},e.fromByteArray=function(e){var t,n,r,i,a=e.length%3,o=``;function s(e){return`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`.charAt(e)}for(t=0,r=e.length-a;t>18&63)+s(i>>12&63)+s(i>>6&63)+s(63&i);switch(a){case 1:o=(o+=s((n=e[e.length-1])>>2))+s(n<<4&63)+`==`;break;case 2:o=(o=(o+=s((n=(e[e.length-2]<<8)+e[e.length-1])>>10))+s(n>>4&63))+s(n<<2&63)+`=`}return o}})(n===void 0?this.base64js={}:n)}).call(this,e(`lYpoI2`),typeof self<`u`?self:typeof window<`u`?window:{},e(`buffer`).Buffer,arguments[3],arguments[4],arguments[5],arguments[6],`/node_modules/gulp-browserify/node_modules/base64-js/lib/b64.js`,`/node_modules/gulp-browserify/node_modules/base64-js/lib`)},{buffer:3,lYpoI2:11}],3:[function(e,t,n){(function(t,r,i,a,o,s,c,l,u){var d=e(`base64-js`),f=e(`ieee754`);function i(e,t,n){if(!(this instanceof i))return new i(e,t,n);var r,a,o,s,c=typeof e;if(t===`base64`&&c==`string`)for(e=(s=e).trim?s.trim():s.replace(/^\s+|\s+$/g,``);e.length%4!=0;)e+=`=`;if(c==`number`)r=A(e);else if(c==`string`)r=i.byteLength(e,t);else{if(c!=`object`)throw Error(`First argument needs to be a number, array or string.`);r=A(e.length)}if(i._useTypedArrays?a=i._augment(new Uint8Array(r)):((a=this).length=r,a._isBuffer=!0),i._useTypedArrays&&typeof e.byteLength==`number`)a._set(e);else if(j(s=e)||i.isBuffer(s)||s&&typeof s==`object`&&typeof s.length==`number`)for(o=0;o>8,n%=256,r.push(n),r.push(t);return r}(t),e,n,r)}function h(e,t,n){var r=``;n=Math.min(e.length,n);for(var i=t;i>>0)):(t+1>>0),i}function v(e,t,n,r){if(r||(R(typeof n==`boolean`,`missing or invalid endian`),R(t!=null,`missing offset`),R(t+1>>8*(r?a:1-a)}function C(e,t,n,r,i){if(i||(R(t!=null,`missing value`),R(typeof r==`boolean`,`missing or invalid endian`),R(n!=null,`missing offset`),R(n+3>>8*(r?a:3-a)&255}function w(e,t,n,r,i){i||(R(t!=null,`missing value`),R(typeof r==`boolean`,`missing or invalid endian`),R(n!=null,`missing offset`),R(n+1=0)return!1}return!0}function WG(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;Object.assign(e,t);var r=Object.getPrototypeOf(t);Object.entries(Object.getOwnPropertyDescriptors(r)).filter(function(e){var t=typeof e[1].get==`function`,n=typeof e[1].set==`function`,r=typeof e[1].value==`function`,i=e[0]===`constructor`;return(t||n||r)&&!i}).forEach(function(t){if(typeof e[t[0]]==`function`){n||console.warn(`Function ${t[0]} already exists on CSM, renaming to base_${t[0]}`);var r=`base_${t[0]}`;e[r]=t[1].value.bind(e);return}Object.defineProperty(e,t[0],t[1])})}function GG(e){var t=e.toString().trim(),n=t.substring(t.indexOf(`{`)+1,t.lastIndexOf(`}`));return n.trim().length===0}function KG(e){return e.replace(/\s/g,``)}function qG(e,t,n){var r=e.lastIndexOf(t);return r===-1?e:e.substring(0,r)+n+e.substring(r+t.length)}var JG=function(e){SG(n,e);var t=EG(n);function n(e){var r,i=e.baseMaterial,a=e.fragmentShader,o=e.vertexShader,s=e.uniforms,c=e.patchMap,l=e.cacheKey,u=e.silent,d=gG(e,zG);_G(this,n);var f;if(UG(i)?f=new i(d):(f=i,Object.assign(f,d)),f.type===`RawShaderMaterial`)throw Error(`CustomShaderMaterial does not support RawShaderMaterial`);r=t.call(this),WG(bG(r),f,u),r.__csm={patchMap:c||{},fragmentShader:a||``,vertexShader:o||``,cacheKey:l,baseMaterial:i,instanceID:it.generateUUID(),type:f.type,isAlreadyExtended:!GG(f.onBeforeCompile),cacheHash:``,silent:u},r.uniforms=mG(mG({},r.uniforms||{}),s||{});var p=r.__csm,m=p.fragmentShader,h=p.vertexShader,g=r.uniforms;return r.__csm.cacheHash=r.getCacheHash(),r.generateMaterial(m,h,g),r}return yG(n,[{key:`update`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.uniforms=e.uniforms||this.uniforms,Object.assign(this.__csm,e);var t=this.__csm,n=t.fragmentShader,r=t.vertexShader,i=this.uniforms,a=this.getCacheHash();this.__csm.cacheHash=a,this.generateMaterial(n,r,i)}},{key:`clone`,value:function(){var e={baseMaterial:this.__csm.baseMaterial,fragmentShader:this.__csm.fragmentShader,vertexShader:this.__csm.vertexShader,uniforms:this.uniforms,silent:this.__csm.silent,patchMap:this.__csm.patchMap,cacheKey:this.__csm.cacheKey},t=new this.constructor(e);return Object.assign(this,t),t}},{key:`getCacheHash`,value:function(){var e=this.__csm,t=e.fragmentShader,n=e.vertexShader,r=this.uniforms,i=Object.values(r).reduce(function(e,t){var n=t.value;return e+JSON.stringify(n)},``),a=KG(t)+KG(n)+i;return a.trim().length>0?AW(a):this.customProgramCacheKey()}},{key:`generateMaterial`,value:function(e,t,n){var r=this,i=this.parseShader(e),a=this.parseShader(t);this.uniforms=n||{},this.customProgramCacheKey=function(){return r.__csm.cacheHash};var o=function(e){try{if(i){var t=r.patchShader(i,e.fragmentShader,!0);e.fragmentShader=r.getMaterialDefine()+t}if(a){var n=r.patchShader(a,e.vertexShader);e.vertexShader=`#define IS_VERTEX; +`,LG,RG=(LG={},fG(LG,`${DG.position}`,`*`),fG(LG,`${DG.positionRaw}`,`*`),fG(LG,`${DG.normal}`,`*`),fG(LG,`${DG.pointSize}`,[`PointsMaterial`]),fG(LG,`${DG.diffuseColor}`,`*`),fG(LG,`${DG.fragColor}`,`*`),fG(LG,`${DG.emissive}`,[`MeshStandardMaterial`,`MeshPhysicalMaterial`]),fG(LG,`${DG.roughness}`,[`MeshStandardMaterial`,`MeshPhysicalMaterial`]),fG(LG,`${DG.metalness}`,[`MeshStandardMaterial`,`MeshPhysicalMaterial`]),fG(LG,`${DG.ao}`,[`MeshStandardMaterial`,`MeshPhysicalMaterial`,`MeshBasicMaterial`,`MeshLambertMaterial`,`MeshPhongMaterial`,`MeshToonMaterial`]),fG(LG,`${DG.bump}`,[`MeshLambertMaterial`,`MeshMatcapMaterial`,`MeshNormalMaterial`,`MeshPhongMaterial`,`MeshPhysicalMaterial`,`MeshStandardMaterial`,`MeshToonMaterial`,`ShadowMaterial`]),fG(LG,`${DG.depthAlpha}`,`*`),LG),zG=[`baseMaterial`,`fragmentShader`,`vertexShader`,`uniforms`,`patchMap`,`cacheKey`,`silent`],BG=function(e,t,n){return e.split(t).join(n)},VG=function(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,`\\$&`)},HG=function(e,t){return RegExp(`\\b${VG(t)}\\b`).test(e)};function UG(e){try{new e}catch(e){if(e.message.indexOf(`is not a constructor`)>=0)return!1}return!0}function WG(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;Object.assign(e,t);var r=Object.getPrototypeOf(t);Object.entries(Object.getOwnPropertyDescriptors(r)).filter(function(e){var t=typeof e[1].get==`function`,n=typeof e[1].set==`function`,r=typeof e[1].value==`function`,i=e[0]===`constructor`;return(t||n||r)&&!i}).forEach(function(t){if(typeof e[t[0]]==`function`){n||console.warn(`Function ${t[0]} already exists on CSM, renaming to base_${t[0]}`);var r=`base_${t[0]}`;e[r]=t[1].value.bind(e);return}Object.defineProperty(e,t[0],t[1])})}function GG(e){var t=e.toString().trim(),n=t.substring(t.indexOf(`{`)+1,t.lastIndexOf(`}`));return n.trim().length===0}function KG(e){return e.replace(/\s/g,``)}function qG(e,t,n){var r=e.lastIndexOf(t);return r===-1?e:e.substring(0,r)+n+e.substring(r+t.length)}var JG=function(e){SG(n,e);var t=EG(n);function n(e){var r,i=e.baseMaterial,a=e.fragmentShader,o=e.vertexShader,s=e.uniforms,c=e.patchMap,l=e.cacheKey,u=e.silent,d=gG(e,zG);_G(this,n);var f;if(UG(i)?f=new i(d):(f=i,Object.assign(f,d)),f.type===`RawShaderMaterial`)throw Error(`CustomShaderMaterial does not support RawShaderMaterial`);r=t.call(this),WG(bG(r),f,u),r.__csm={patchMap:c||{},fragmentShader:a||``,vertexShader:o||``,cacheKey:l,baseMaterial:i,instanceID:nt.generateUUID(),type:f.type,isAlreadyExtended:!GG(f.onBeforeCompile),cacheHash:``,silent:u},r.uniforms=mG(mG({},r.uniforms||{}),s||{});var p=r.__csm,m=p.fragmentShader,h=p.vertexShader,g=r.uniforms;return r.__csm.cacheHash=r.getCacheHash(),r.generateMaterial(m,h,g),r}return yG(n,[{key:`update`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.uniforms=e.uniforms||this.uniforms,Object.assign(this.__csm,e);var t=this.__csm,n=t.fragmentShader,r=t.vertexShader,i=this.uniforms,a=this.getCacheHash();this.__csm.cacheHash=a,this.generateMaterial(n,r,i)}},{key:`clone`,value:function(){var e={baseMaterial:this.__csm.baseMaterial,fragmentShader:this.__csm.fragmentShader,vertexShader:this.__csm.vertexShader,uniforms:this.uniforms,silent:this.__csm.silent,patchMap:this.__csm.patchMap,cacheKey:this.__csm.cacheKey},t=new this.constructor(e);return Object.assign(this,t),t}},{key:`getCacheHash`,value:function(){var e=this.__csm,t=e.fragmentShader,n=e.vertexShader,r=this.uniforms,i=Object.values(r).reduce(function(e,t){var n=t.value;return e+JSON.stringify(n)},``),a=KG(t)+KG(n)+i;return a.trim().length>0?AW(a):this.customProgramCacheKey()}},{key:`generateMaterial`,value:function(e,t,n){var r=this,i=this.parseShader(e),a=this.parseShader(t);this.uniforms=n||{},this.customProgramCacheKey=function(){return r.__csm.cacheHash};var o=function(e){try{if(i){var t=r.patchShader(i,e.fragmentShader,!0);e.fragmentShader=r.getMaterialDefine()+t}if(a){var n=r.patchShader(a,e.vertexShader);e.vertexShader=`#define IS_VERTEX; `+n,e.vertexShader=r.getMaterialDefine()+e.vertexShader}e.uniforms=mG(mG({},e.uniforms),r.uniforms),r.uniforms=e.uniforms}catch(e){console.error(e)}};if(this.__csm.isAlreadyExtended){var s=this.onBeforeCompile;this.onBeforeCompile=function(e,t){s(e,t),o(e)}}else this.onBeforeCompile=o;this.needsUpdate=!0}},{key:`patchShader`,value:function(e,t,n){var r=this,i=t,a=mG(mG({},this.getPatchMapForMaterial()),this.__csm.patchMap);Object.keys(a).forEach(function(t){Object.keys(a[t]).forEach(function(n){var o=RG[t],s=r.__csm.type;if(t===`*`||HG(e.main,t))if(!o||Array.isArray(o)&&o.includes(s)||o===`*`)i=BG(i,n,a[t][n]);else throw Error(`CSM: ${t} is not available in ${s}. Shader cannot compile.`)})}),i=i.replace(`void main() {`,` #ifndef CSM_IS_HEAD_DEFAULTS_DEFINED ${n?FG:NG} @@ -3571,7 +3571,7 @@ list should be an Array.`),e.length===0)return new i(0);if(e.length===1)return e // CSM_END `),i=e.defines+i,i}},{key:`parseShader`,value:function(e){if(e){var t=e.replace(/\/\*\*(.*?)\*\/|\/\/(.*?)\n/gm,``),n=$W(t),r=lG(n),i=r.map(function(e){return e.name}).indexOf(`main`),a=iG(n.slice(0,i>=0?r[i].outer[0]:void 0)),o=i>=0?this.getShaderFromIndex(n,r[i].body):``;return{defines:``,header:a,main:o}}}},{key:`getMaterialDefine`,value:function(){var e=this.__csm.type;return e?`#define IS_${e.toUpperCase()}; `:`#define IS_UNKNOWN; -`}},{key:`getPatchMapForMaterial`,value:function(){switch(this.__csm.type){case`ShaderMaterial`:return jG;default:return AG}}},{key:`getShaderFromIndex`,value:function(e,t){return iG(e.slice(t[0],t[1]))}}]),n}(Be),YG=class extends nt{constructor(e={}){super(e),XL(this,`_time`),XL(this,`_factor`),this.setValues(e),this._time={value:0},this._factor={value:1}}onBeforeCompile(e){e.uniforms||={},e.uniforms.time=this._time,e.uniforms.factor=this._factor,e.vertexShader=` +`}},{key:`getPatchMapForMaterial`,value:function(){switch(this.__csm.type){case`ShaderMaterial`:return jG;default:return AG}}},{key:`getShaderFromIndex`,value:function(e,t){return iG(e.slice(t[0],t[1]))}}]),n}(Ie),YG=class extends et{constructor(e={}){super(e),XL(this,`_time`),XL(this,`_factor`),this.setValues(e),this._time={value:0},this._factor={value:1}}onBeforeCompile(e){e.uniforms||={},e.uniforms.time=this._time,e.uniforms.factor=this._factor,e.vertexShader=` uniform float time; uniform float factor; ${e.vertexShader} @@ -3580,7 +3580,7 @@ list should be an Array.`),e.length===0)return new i(0);if(e.length===1)return e float s = sin( theta ); mat3 m = mat3( c, 0, s, 0, 1, 0, -s, 0, c ); vec3 transformed = vec3( position ) * m; - vNormal = vNormal * m;`)}get time(){return this._time.value}set time(e){this._time.value=e}get factor(){return this._factor.value}set factor(e){this._factor.value=e}};const XG=[`factor`],ZG=Tn({__name:`index`,props:{speed:{default:1},factor:{default:1}},setup(e,{expose:t}){let n=e,r=W(),{extend:i,invalidate:a}=De();i({MeshWobbleMaterial:YG}),G(n,()=>a());let{onBeforeRender:o}=be();return o(({elapsed:e,invalidate:t})=>{r.value&&(r.value.time=e*n?.speed,t())}),t({instance:r}),(e,t)=>(K(),On(`TresMeshWobbleMaterial`,bn({ref_key:`materialRef`,ref:r,factor:e.factor},e.$attrs),null,16,XG))}}),QG=Tn({name:`BakeShadows`,setup(){let{renderer:e}=De();Nn(()=>{e.value.shadowMap.autoUpdate=!1,e.value.shadowMap.needsUpdate=!0})}});var $G=`void main() { + vNormal = vNormal * m;`)}get time(){return this._time.value}set time(e){this._time.value=e}get factor(){return this._factor.value}set factor(e){this._factor.value=e}};const XG=[`factor`],ZG=$t({__name:`index`,props:{speed:{default:1},factor:{default:1}},setup(e,{expose:t}){let n=e,r=W(),{extend:i,invalidate:a}=De();i({MeshWobbleMaterial:YG}),G(n,()=>a());let{onBeforeRender:o}=be();return o(({elapsed:e,invalidate:t})=>{r.value&&(r.value.time=e*n?.speed,t())}),t({instance:r}),(e,t)=>(K(),nn(`TresMeshWobbleMaterial`,jn({ref_key:`materialRef`,ref:r,factor:e.factor},e.$attrs),null,16,XG))}}),QG=$t({name:`BakeShadows`,setup(){let{renderer:e}=De();Cn(()=>{e.value.shadowMap.autoUpdate=!1,e.value.shadowMap.needsUpdate=!0})}});var $G=`void main() { gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); }`,eK=`#include @@ -3607,14 +3607,14 @@ void main() { mvPosition.xy += rotatedPosition; gl_Position = projectionMatrix * mvPosition; -}`;const tK=new B(0,0,0),nK=new B(0,0,0),rK=new B(0,0,0);function iK(e,t,n){let r=tK.setFromMatrixPosition(e.matrixWorld);r.project(t);let i=n.width/2,a=n.height/2;return[(Number.isNaN(r.x)?0:r.x)*i+i,-(r.y*a)+a,r.z]}function aK(e,t){let n=tK.setFromMatrixPosition(e.matrixWorld),r=nK.setFromMatrixPosition(t.matrixWorld),i=n.sub(r),a=t.getWorldDirection(rK);return i.angleTo(a)>Math.PI/2}function oK(e,t,n,r){let i=tK.setFromMatrixPosition(e.matrixWorld),a=i.clone();a.project(t),n.setFromCamera(new ut(a.x,a.y),t);let o=n.intersectObjects(r,!0);if(o.length>0){let e=o[0].distance;return i.distanceTo(n.ray.origin)Math.abs(e)<1e-10?0:e;function uK(e,t,n=``){let r=`matrix3d(`;for(let n=0;n!==16;n++)r+=lK(t[n]*e.elements[n])+(n===15?`)`:`,`);return n+r}const dK=(e=>t=>uK(t,e))([1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1]),fK=(e=>(t,n)=>uK(t,e(n),`translate(-50%,-50%)`))(e=>[1/e,1/e,1/e,1,-1/e,-1/e,-1/e,-1,1/e,1/e,1/e,1,1,1,1,1]),pK=[`geometry`,`material`],mK=Tn({__name:`HTML`,props:{geometry:{default:new Ye},material:{},as:{default:`div`},transform:{type:Boolean,default:!1},portal:{},wrapperClass:{},eps:{default:1e-4},distanceFactor:{},fullscreen:{type:Boolean},center:{type:Boolean},pointerEvents:{default:`auto`},sprite:{type:Boolean,default:!1},zIndexRange:{default:()=>[16777271,0]},occlude:{type:[Object,null,Array,Boolean,String]}},emits:[`onOcclude`],setup(e,{expose:t,emit:n}){let r=e,i=n,a=yn(),o=Sn(),s=U(),c=U(),{geometry:l,material:u,as:d,transform:f,portal:p,wrapperClass:m,eps:h,distanceFactor:g,fullscreen:_,center:v,pointerEvents:y,sprite:b,occlude:x,zIndexRange:S}=un(r),{renderer:C,scene:w,camera:T,raycaster:E,sizes:D}=De(),O=_n(()=>document.createElement(d.value)),k=U([0,0,0]),A=U(0),j=U(),M=_n(()=>f.value?{position:`absolute`,top:0,left:0,width:`${D.width.value}px`,height:`${D.height.value}px`,transformStyle:`preserve-3d`,pointerEvents:`none`,zIndex:2}:{position:`absolute`,transform:v.value?`translate3d(-50%,-50%,0)`:`none`,..._.value&&{top:-D.height.value/2,left:-D.width.value/2,width:`${D.width.value}px`,height:`${D.height.value}px`},zIndex:2,...Object.assign({},o.style)}),N=_n(()=>({position:`absolute`,pointerEvents:y.value})),ee=U(null),P=U(!1),F=_n(()=>x?.value&&x?.value!==`blending`||Array.isArray(x?.value)&&x?.value.length&&sn(x.value[0]));G(()=>x,({value:e})=>{e===`blending`?(O.value.style.zIndex=`${Math.floor(S.value[0]/2)}`,O.value.style.position=`absolute`,O.value.style.pointerEvents=`none`):(O.value.style.zIndex=null,O.value.style.position=null,O.value.style.pointerEvents=null)}),G(()=>{var e;return[s.value,C.value,D.width.value,D.height.value,(e=a.default)?.call(a)]},([e,t])=>{var n,r,i,s,l,u;if(e&&t){let d=p?.value||t.domElement;if((n=w.value)==null||n.updateMatrixWorld(),f.value)O.value.style.cssText=`position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;`;else{let t=iK(e,T.value,{width:D.width.value,height:D.height.value});O.value.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${t[0]}px,${t[1]}px,0);transform-origin:0 0;`}d&&!O.value.parentNode&&((r=d.parentNode)==null||r.appendChild(O.value)),f.value?j.value=xn(`div`,{id:`outer`,style:M.value},[xn(`div`,{id:`inner`,style:N.value},[xn(`div`,{key:(i=c.value)?.uuid,id:w?.value.uuid,class:o.class,style:o.style},(s=a.default)?.call(a))])]):j.value=xn(`div`,{key:(l=c.value)?.uuid,id:w?.value.uuid,style:M.value},(u=a.default)?.call(a)),Zt(j.value,O.value)}}),Nn(()=>{m!=null&&m.value&&(O.value.className=m.value)});let I=U(!0),{onBeforeRender:L}=be();L(({invalidate:e})=>{var t,n,r,a,u,d,p;if(e(),s.value&&T.value&&C.value){(t=T.value)==null||t.updateMatrixWorld(),s.value.updateWorldMatrix(!0,!1);let e=f.value?k.value:iK(s.value,T.value,{width:D.width.value||0,height:D.height.value||0});if(f.value||Math.abs(A.value-T.value.zoom)>h.value||Math.abs(k.value[0]-e[0])>h.value||Math.abs(k.value[1]-e[1])>h.value||Math.abs(k.value[2]-e[2])>h.value){let t=aK(s.value,T.value),a=!1;F.value&&(Array.isArray(x?.value)?a=x?.value:x?.value!==`blending`&&(a=[w.value]));let o=I.value;if(a){let e=oK(s.value,T.value,E.value,a);I.value=e&&!t}else I.value=!t;o!==I.value&&(i(`onOcclude`,!I.value),O.value.style.display=I.value?`block`:`none`);let c=Math.floor(S.value[0]/2),l=x!=null&&x.value?F.value?[S.value[0],c]:[c-1,0]:S.value;if(O.value.style.zIndex=`${cK(s.value,T.value,l)}`,f.value){let[e,t]=[D.width.value/2,D.height.value/2],i=T.value.projectionMatrix.elements[5]*t,{isOrthographicCamera:a,top:o,left:c,bottom:l,right:u}=T.value,d=dK(T.value.matrixWorldInverse),f=a?`scale(${i})translate(${lK(-(u+c)/2)}px,${lK((o+l)/2)}px)`:`translateZ(${i}px)`,p=s.value.matrixWorld;if(b.value&&(p=T.value.matrixWorldInverse.clone().transpose().copyPosition(p).scale(s.value.scale),p.elements[3]=p.elements[7]=p.elements[11]=0,p.elements[15]=1),O.value.style.width=`${D.width.value}px`,O.value.style.height=`${D.height.value}px`,O.value.style.perspective=a?``:`${i}px`,(n=j.value)!=null&&n.el&&(r=j.value)!=null&&r.children&&Array.isArray(j.value.children)){j.value.el.style.transform=`${f}${d}translate(${e}px,${t}px)`;let n=j.value.children[0];n&&n.el&&(n.el.style.transform=fK(p,1/((g?.value||10)/400)))}}else{let t=g?.value===void 0?1:sK(s.value,T.value)*g?.value;O.value.style.transform=`translate3d(${e[0]}px,${e[1]}px,0) scale(${t})`}}k.value=e,A.value=T.value.zoom}if(!F.value&&c.value&&!P.value)if(f.value){if((a=j.value)!=null&&a.el&&(u=j.value)!=null&&u.children){let e=((d=j.value)?.children)[0];if(e!=null&&e.clientWidth&&e!=null&&e.clientHeight){let{isOrthographicCamera:t}=T.value;if(t||l)o.scale&&(Array.isArray(o.scale)?o.scale instanceof B?c.value.scale.copy(o.scale.clone().divideScalar(1)):c.value.scale.set(1/o.scale[0],1/o.scale[1],1/o.scale[2]):c.value.scale.setScalar(1/o.scale));else{let t=(g?.value||10)/400,n=e.clientWidth*t,r=e.clientHeight*t;c.value.scale.set(n,r,1)}P.value=!0}}}else{let e=O.value.children[0];if(e!=null&&e.clientWidth&&e!=null&&e.clientHeight){let t=e.clientWidth*1,n=e.clientHeight*1;c.value.scale.set(t,n,1),P.value=!0}ee.value.lookAt((p=T.value)?.position)}});let te=_n(()=>({vertexShader:f.value?void 0:eK,fragmentShader:$G})),R=_n(()=>{let e=te.value;return u.value||new Bt({vertexShader:e.vertexShader,fragmentShader:e.fragmentShader,side:Ve})});return An(()=>{R.value&&R.value.dispose(),O.value.remove()}),t({instance:s}),(e,t)=>(K(),On(`TresGroup`,{ref_key:`groupRef`,ref:s},[H(x)&&!F.value?(K(),On(`TresMesh`,{key:0,ref_key:`meshRef`,ref:c,geometry:H(l),material:R.value},null,8,pK)):En(``,!0)],512))}});var hK={exports:{}},gK=hK.exports,_K;function vK(){return _K||(_K=1,function(e,t){(function(t,n){e.exports=n()})(gK,function(){var e=function(){function t(e){return i.appendChild(e.dom),e}function n(e){for(var t=0;to+1e3&&(c.update(1e3*s/(e-o),100),o=e,s=0,u)){var t=performance.memory;u.update(t.usedJSHeapSize/1048576,t.jsHeapSizeLimit/1048576)}return e},update:function(){a=this.end()},domElement:i,setMode:n}};return e.Panel=function(e,t,n){var r=1/0,i=0,a=Math.round,o=a(window.devicePixelRatio||1),s=80*o,c=48*o,l=3*o,u=2*o,d=3*o,f=15*o,p=74*o,m=30*o,h=document.createElement(`canvas`);h.width=s,h.height=c,h.style.cssText=`width:80px;height:48px`;var g=h.getContext(`2d`);return g.font=`bold `+9*o+`px Helvetica,Arial,sans-serif`,g.textBaseline=`top`,g.fillStyle=n,g.fillRect(0,0,s,c),g.fillStyle=t,g.fillText(e,l,u),g.fillRect(d,f,p,m),g.fillStyle=n,g.globalAlpha=.9,g.fillRect(d,f,p,m),{dom:h,update:function(c,_){r=Math.min(r,c),i=Math.max(i,c),g.fillStyle=n,g.globalAlpha=1,g.fillRect(0,0,s,f),g.fillStyle=t,g.fillText(a(c)+` `+e+` (`+a(r)+`-`+a(i)+`)`,l,u),g.drawImage(h,d+o,f,p-o,m,d,f,p-o,m),g.fillRect(d+p-o,f,o,m),g.fillStyle=n,g.globalAlpha=.9,g.fillRect(d+p-o,f,o,a((1-c/_)*m))}}},e})}(hK)),hK.exports}var yK=vK();const bK=wW(yK),xK=Tn({name:`Stats`,props:{showPanel:{type:Number,default:0}},setup(e,{expose:t}){let n=new bK;t({instance:n});let r=document.body;n.showPanel(e.showPanel||0),r?.appendChild(n.dom);let{onBeforeRender:i,onAfterRender:a}=be();i(()=>n.begin(),-1/0),a(()=>n.end(),1/0),An(()=>{r?.removeChild(n.dom)})}});var SK=class{constructor(e,t,n){this.name=e,this.fg=t,this.bg=n,this.gradient=null,this.PR=Math.round(window.devicePixelRatio||1),this.WIDTH=90*this.PR,this.HEIGHT=48*this.PR,this.TEXT_X=3*this.PR,this.TEXT_Y=2*this.PR,this.GRAPH_X=3*this.PR,this.GRAPH_Y=15*this.PR,this.GRAPH_WIDTH=84*this.PR,this.GRAPH_HEIGHT=30*this.PR,this.canvas=document.createElement(`canvas`),this.canvas.width=this.WIDTH,this.canvas.height=this.HEIGHT,this.canvas.style.width=`90px`,this.canvas.style.height=`48px`,this.canvas.style.position=`absolute`,this.canvas.style.cssText=`width:90px;height:48px`,this.context=this.canvas.getContext(`2d`),this.initializeCanvas()}createGradient(){if(!this.context)throw Error(`No context`);let e=this.context.createLinearGradient(0,this.GRAPH_Y,0,this.GRAPH_Y+this.GRAPH_HEIGHT),t,n=this.fg;switch(this.fg.toLowerCase()){case`#0ff`:t=`#006666`;break;case`#0f0`:t=`#006600`;break;case`#ff0`:t=`#666600`;break;case`#e1e1e1`:t=`#666666`;break;default:t=this.bg;break}return e.addColorStop(0,t),e.addColorStop(1,n),e}initializeCanvas(){this.context&&(this.context.font=`bold `+9*this.PR+`px Helvetica,Arial,sans-serif`,this.context.textBaseline=`top`,this.gradient=this.createGradient(),this.context.fillStyle=this.bg,this.context.fillRect(0,0,this.WIDTH,this.HEIGHT),this.context.fillStyle=this.fg,this.context.fillText(this.name,this.TEXT_X,this.TEXT_Y),this.context.fillStyle=this.fg,this.context.fillRect(this.GRAPH_X,this.GRAPH_Y,this.GRAPH_WIDTH,this.GRAPH_HEIGHT),this.context.fillStyle=this.bg,this.context.globalAlpha=.9,this.context.fillRect(this.GRAPH_X,this.GRAPH_Y,this.GRAPH_WIDTH,this.GRAPH_HEIGHT))}update(e,t,n,r,i=0){if(!this.context||!this.gradient)return;let a=Math.min(1/0,e),o=Math.max(n,e);r=Math.max(r,t),this.context.globalAlpha=1,this.context.fillStyle=this.bg,this.context.fillRect(0,0,this.WIDTH,this.GRAPH_Y),this.context.fillStyle=this.fg,this.context.fillText(`${e.toFixed(i)} ${this.name} (${a.toFixed(i)}-${parseFloat(o.toFixed(i))})`,this.TEXT_X,this.TEXT_Y),this.context.drawImage(this.canvas,this.GRAPH_X+this.PR,this.GRAPH_Y,this.GRAPH_WIDTH-this.PR,this.GRAPH_HEIGHT,this.GRAPH_X,this.GRAPH_Y,this.GRAPH_WIDTH-this.PR,this.GRAPH_HEIGHT);let s=this.GRAPH_HEIGHT-(1-t/r)*this.GRAPH_HEIGHT;s>0&&(this.context.globalAlpha=1,this.context.fillStyle=this.gradient,this.context.fillRect(this.GRAPH_X+this.GRAPH_WIDTH-this.PR,this.GRAPH_Y+this.GRAPH_HEIGHT-s,this.PR,s))}};const CK=class e{constructor({trackGPU:t=!1,logsPerSecond:n=30,samplesLog:r=60,samplesGraph:i=10,precision:a=2,minimal:o=!1,horizontal:s=!0,mode:c=0}={}){this.gl=null,this.ext=null,this.activeQuery=null,this.gpuQueries=[],this.threeRendererPatched=!1,this.frames=0,this.renderCount=0,this.isRunningCPUProfiling=!1,this.totalCpuDuration=0,this.totalGpuDuration=0,this.totalGpuDurationCompute=0,this.totalFps=0,this.gpuPanel=null,this.gpuPanelCompute=null,this.averageFps={logs:[],graph:[]},this.averageCpu={logs:[],graph:[]},this.averageGpu={logs:[],graph:[]},this.averageGpuCompute={logs:[],graph:[]},this.handleClick=e=>{e.preventDefault(),this.showPanel(++this.mode%this.dom.children.length)},this.handleResize=()=>{this.resizePanel(this.fpsPanel,0),this.resizePanel(this.msPanel,1),this.gpuPanel&&this.resizePanel(this.gpuPanel,2),this.gpuPanelCompute&&this.resizePanel(this.gpuPanelCompute,3)},this.mode=c,this.horizontal=s,this.minimal=o,this.trackGPU=t,this.samplesLog=r,this.samplesGraph=i,this.precision=a,this.logsPerSecond=n,this.dom=document.createElement(`div`),this.initializeDOM(),this.beginTime=performance.now(),this.prevTime=this.beginTime,this.prevCpuTime=this.beginTime,this.fpsPanel=this.addPanel(new e.Panel(`FPS`,`#0ff`,`#002`),0),this.msPanel=this.addPanel(new e.Panel(`CPU`,`#0f0`,`#020`),1),this.setupEventListeners()}initializeDOM(){this.dom.style.cssText=` +}`;const tK=new B(0,0,0),nK=new B(0,0,0),rK=new B(0,0,0);function iK(e,t,n){let r=tK.setFromMatrixPosition(e.matrixWorld);r.project(t);let i=n.width/2,a=n.height/2;return[(Number.isNaN(r.x)?0:r.x)*i+i,-(r.y*a)+a,r.z]}function aK(e,t){let n=tK.setFromMatrixPosition(e.matrixWorld),r=nK.setFromMatrixPosition(t.matrixWorld),i=n.sub(r),a=t.getWorldDirection(rK);return i.angleTo(a)>Math.PI/2}function oK(e,t,n,r){let i=tK.setFromMatrixPosition(e.matrixWorld),a=i.clone();a.project(t),n.setFromCamera(new ct(a.x,a.y),t);let o=n.intersectObjects(r,!0);if(o.length>0){let e=o[0].distance;return i.distanceTo(n.ray.origin)Math.abs(e)<1e-10?0:e;function uK(e,t,n=``){let r=`matrix3d(`;for(let n=0;n!==16;n++)r+=lK(t[n]*e.elements[n])+(n===15?`)`:`,`);return n+r}const dK=(e=>t=>uK(t,e))([1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1]),fK=(e=>(t,n)=>uK(t,e(n),`translate(-50%,-50%)`))(e=>[1/e,1/e,1/e,1,-1/e,-1/e,-1/e,-1,1/e,1/e,1/e,1,1,1,1,1]),pK=[`geometry`,`material`],mK=$t({__name:`HTML`,props:{geometry:{default:new qe},material:{},as:{default:`div`},transform:{type:Boolean,default:!1},portal:{},wrapperClass:{},eps:{default:1e-4},distanceFactor:{},fullscreen:{type:Boolean},center:{type:Boolean},pointerEvents:{default:`auto`},sprite:{type:Boolean,default:!1},zIndexRange:{default:()=>[16777271,0]},occlude:{type:[Object,null,Array,Boolean,String]}},emits:[`onOcclude`],setup(e,{expose:t,emit:n}){let r=e,i=n,a=An(),o=Nn(),s=U(),c=U(),{geometry:l,material:u,as:d,transform:f,portal:p,wrapperClass:m,eps:h,distanceFactor:g,fullscreen:_,center:v,pointerEvents:y,sprite:b,occlude:x,zIndexRange:S}=rn(r),{renderer:C,scene:w,camera:T,raycaster:E,sizes:D}=De(),O=On(()=>document.createElement(d.value)),k=U([0,0,0]),A=U(0),j=U(),M=On(()=>f.value?{position:`absolute`,top:0,left:0,width:`${D.width.value}px`,height:`${D.height.value}px`,transformStyle:`preserve-3d`,pointerEvents:`none`,zIndex:2}:{position:`absolute`,transform:v.value?`translate3d(-50%,-50%,0)`:`none`,..._.value&&{top:-D.height.value/2,left:-D.width.value/2,width:`${D.width.value}px`,height:`${D.height.value}px`},zIndex:2,...Object.assign({},o.style)}),N=On(()=>({position:`absolute`,pointerEvents:y.value})),ee=U(null),P=U(!1),F=On(()=>x?.value&&x?.value!==`blending`||Array.isArray(x?.value)&&x?.value.length&&dn(x.value[0]));G(()=>x,({value:e})=>{e===`blending`?(O.value.style.zIndex=`${Math.floor(S.value[0]/2)}`,O.value.style.position=`absolute`,O.value.style.pointerEvents=`none`):(O.value.style.zIndex=null,O.value.style.position=null,O.value.style.pointerEvents=null)}),G(()=>{var e;return[s.value,C.value,D.width.value,D.height.value,(e=a.default)?.call(a)]},([e,t])=>{var n,r,i,s,l,u;if(e&&t){let d=p?.value||t.domElement;if((n=w.value)==null||n.updateMatrixWorld(),f.value)O.value.style.cssText=`position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;`;else{let t=iK(e,T.value,{width:D.width.value,height:D.height.value});O.value.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${t[0]}px,${t[1]}px,0);transform-origin:0 0;`}d&&!O.value.parentNode&&((r=d.parentNode)==null||r.appendChild(O.value)),f.value?j.value=Mn(`div`,{id:`outer`,style:M.value},[Mn(`div`,{id:`inner`,style:N.value},[Mn(`div`,{key:(i=c.value)?.uuid,id:w?.value.uuid,class:o.class,style:o.style},(s=a.default)?.call(a))])]):j.value=Mn(`div`,{key:(l=c.value)?.uuid,id:w?.value.uuid,style:M.value},(u=a.default)?.call(a)),Zt(j.value,O.value)}}),Cn(()=>{m!=null&&m.value&&(O.value.className=m.value)});let I=U(!0),{onBeforeRender:L}=be();L(({invalidate:e})=>{var t,n,r,a,u,d,p;if(e(),s.value&&T.value&&C.value){(t=T.value)==null||t.updateMatrixWorld(),s.value.updateWorldMatrix(!0,!1);let e=f.value?k.value:iK(s.value,T.value,{width:D.width.value||0,height:D.height.value||0});if(f.value||Math.abs(A.value-T.value.zoom)>h.value||Math.abs(k.value[0]-e[0])>h.value||Math.abs(k.value[1]-e[1])>h.value||Math.abs(k.value[2]-e[2])>h.value){let t=aK(s.value,T.value),a=!1;F.value&&(Array.isArray(x?.value)?a=x?.value:x?.value!==`blending`&&(a=[w.value]));let o=I.value;if(a){let e=oK(s.value,T.value,E.value,a);I.value=e&&!t}else I.value=!t;o!==I.value&&(i(`onOcclude`,!I.value),O.value.style.display=I.value?`block`:`none`);let c=Math.floor(S.value[0]/2),l=x!=null&&x.value?F.value?[S.value[0],c]:[c-1,0]:S.value;if(O.value.style.zIndex=`${cK(s.value,T.value,l)}`,f.value){let[e,t]=[D.width.value/2,D.height.value/2],i=T.value.projectionMatrix.elements[5]*t,{isOrthographicCamera:a,top:o,left:c,bottom:l,right:u}=T.value,d=dK(T.value.matrixWorldInverse),f=a?`scale(${i})translate(${lK(-(u+c)/2)}px,${lK((o+l)/2)}px)`:`translateZ(${i}px)`,p=s.value.matrixWorld;if(b.value&&(p=T.value.matrixWorldInverse.clone().transpose().copyPosition(p).scale(s.value.scale),p.elements[3]=p.elements[7]=p.elements[11]=0,p.elements[15]=1),O.value.style.width=`${D.width.value}px`,O.value.style.height=`${D.height.value}px`,O.value.style.perspective=a?``:`${i}px`,(n=j.value)!=null&&n.el&&(r=j.value)!=null&&r.children&&Array.isArray(j.value.children)){j.value.el.style.transform=`${f}${d}translate(${e}px,${t}px)`;let n=j.value.children[0];n&&n.el&&(n.el.style.transform=fK(p,1/((g?.value||10)/400)))}}else{let t=g?.value===void 0?1:sK(s.value,T.value)*g?.value;O.value.style.transform=`translate3d(${e[0]}px,${e[1]}px,0) scale(${t})`}}k.value=e,A.value=T.value.zoom}if(!F.value&&c.value&&!P.value)if(f.value){if((a=j.value)!=null&&a.el&&(u=j.value)!=null&&u.children){let e=((d=j.value)?.children)[0];if(e!=null&&e.clientWidth&&e!=null&&e.clientHeight){let{isOrthographicCamera:t}=T.value;if(t||l)o.scale&&(Array.isArray(o.scale)?o.scale instanceof B?c.value.scale.copy(o.scale.clone().divideScalar(1)):c.value.scale.set(1/o.scale[0],1/o.scale[1],1/o.scale[2]):c.value.scale.setScalar(1/o.scale));else{let t=(g?.value||10)/400,n=e.clientWidth*t,r=e.clientHeight*t;c.value.scale.set(n,r,1)}P.value=!0}}}else{let e=O.value.children[0];if(e!=null&&e.clientWidth&&e!=null&&e.clientHeight){let t=e.clientWidth*1,n=e.clientHeight*1;c.value.scale.set(t,n,1),P.value=!0}ee.value.lookAt((p=T.value)?.position)}});let te=On(()=>({vertexShader:f.value?void 0:eK,fragmentShader:$G})),R=On(()=>{let e=te.value;return u.value||new Rt({vertexShader:e.vertexShader,fragmentShader:e.fragmentShader,side:ze})});return bn(()=>{R.value&&R.value.dispose(),O.value.remove()}),t({instance:s}),(e,t)=>(K(),nn(`TresGroup`,{ref_key:`groupRef`,ref:s},[H(x)&&!F.value?(K(),nn(`TresMesh`,{key:0,ref_key:`meshRef`,ref:c,geometry:H(l),material:R.value},null,8,pK)):en(``,!0)],512))}});var hK={exports:{}},gK=hK.exports,_K;function vK(){return _K||(_K=1,function(e,t){(function(t,n){e.exports=n()})(gK,function(){var e=function(){function t(e){return i.appendChild(e.dom),e}function n(e){for(var t=0;to+1e3&&(c.update(1e3*s/(e-o),100),o=e,s=0,u)){var t=performance.memory;u.update(t.usedJSHeapSize/1048576,t.jsHeapSizeLimit/1048576)}return e},update:function(){a=this.end()},domElement:i,setMode:n}};return e.Panel=function(e,t,n){var r=1/0,i=0,a=Math.round,o=a(window.devicePixelRatio||1),s=80*o,c=48*o,l=3*o,u=2*o,d=3*o,f=15*o,p=74*o,m=30*o,h=document.createElement(`canvas`);h.width=s,h.height=c,h.style.cssText=`width:80px;height:48px`;var g=h.getContext(`2d`);return g.font=`bold `+9*o+`px Helvetica,Arial,sans-serif`,g.textBaseline=`top`,g.fillStyle=n,g.fillRect(0,0,s,c),g.fillStyle=t,g.fillText(e,l,u),g.fillRect(d,f,p,m),g.fillStyle=n,g.globalAlpha=.9,g.fillRect(d,f,p,m),{dom:h,update:function(c,_){r=Math.min(r,c),i=Math.max(i,c),g.fillStyle=n,g.globalAlpha=1,g.fillRect(0,0,s,f),g.fillStyle=t,g.fillText(a(c)+` `+e+` (`+a(r)+`-`+a(i)+`)`,l,u),g.drawImage(h,d+o,f,p-o,m,d,f,p-o,m),g.fillRect(d+p-o,f,o,m),g.fillStyle=n,g.globalAlpha=.9,g.fillRect(d+p-o,f,o,a((1-c/_)*m))}}},e})}(hK)),hK.exports}var yK=vK();const bK=wW(yK),xK=$t({name:`Stats`,props:{showPanel:{type:Number,default:0}},setup(e,{expose:t}){let n=new bK;t({instance:n});let r=document.body;n.showPanel(e.showPanel||0),r?.appendChild(n.dom);let{onBeforeRender:i,onAfterRender:a}=be();i(()=>n.begin(),-1/0),a(()=>n.end(),1/0),bn(()=>{r?.removeChild(n.dom)})}});var SK=class{constructor(e,t,n){this.name=e,this.fg=t,this.bg=n,this.gradient=null,this.PR=Math.round(window.devicePixelRatio||1),this.WIDTH=90*this.PR,this.HEIGHT=48*this.PR,this.TEXT_X=3*this.PR,this.TEXT_Y=2*this.PR,this.GRAPH_X=3*this.PR,this.GRAPH_Y=15*this.PR,this.GRAPH_WIDTH=84*this.PR,this.GRAPH_HEIGHT=30*this.PR,this.canvas=document.createElement(`canvas`),this.canvas.width=this.WIDTH,this.canvas.height=this.HEIGHT,this.canvas.style.width=`90px`,this.canvas.style.height=`48px`,this.canvas.style.position=`absolute`,this.canvas.style.cssText=`width:90px;height:48px`,this.context=this.canvas.getContext(`2d`),this.initializeCanvas()}createGradient(){if(!this.context)throw Error(`No context`);let e=this.context.createLinearGradient(0,this.GRAPH_Y,0,this.GRAPH_Y+this.GRAPH_HEIGHT),t,n=this.fg;switch(this.fg.toLowerCase()){case`#0ff`:t=`#006666`;break;case`#0f0`:t=`#006600`;break;case`#ff0`:t=`#666600`;break;case`#e1e1e1`:t=`#666666`;break;default:t=this.bg;break}return e.addColorStop(0,t),e.addColorStop(1,n),e}initializeCanvas(){this.context&&(this.context.font=`bold `+9*this.PR+`px Helvetica,Arial,sans-serif`,this.context.textBaseline=`top`,this.gradient=this.createGradient(),this.context.fillStyle=this.bg,this.context.fillRect(0,0,this.WIDTH,this.HEIGHT),this.context.fillStyle=this.fg,this.context.fillText(this.name,this.TEXT_X,this.TEXT_Y),this.context.fillStyle=this.fg,this.context.fillRect(this.GRAPH_X,this.GRAPH_Y,this.GRAPH_WIDTH,this.GRAPH_HEIGHT),this.context.fillStyle=this.bg,this.context.globalAlpha=.9,this.context.fillRect(this.GRAPH_X,this.GRAPH_Y,this.GRAPH_WIDTH,this.GRAPH_HEIGHT))}update(e,t,n,r,i=0){if(!this.context||!this.gradient)return;let a=Math.min(1/0,e),o=Math.max(n,e);r=Math.max(r,t),this.context.globalAlpha=1,this.context.fillStyle=this.bg,this.context.fillRect(0,0,this.WIDTH,this.GRAPH_Y),this.context.fillStyle=this.fg,this.context.fillText(`${e.toFixed(i)} ${this.name} (${a.toFixed(i)}-${parseFloat(o.toFixed(i))})`,this.TEXT_X,this.TEXT_Y),this.context.drawImage(this.canvas,this.GRAPH_X+this.PR,this.GRAPH_Y,this.GRAPH_WIDTH-this.PR,this.GRAPH_HEIGHT,this.GRAPH_X,this.GRAPH_Y,this.GRAPH_WIDTH-this.PR,this.GRAPH_HEIGHT);let s=this.GRAPH_HEIGHT-(1-t/r)*this.GRAPH_HEIGHT;s>0&&(this.context.globalAlpha=1,this.context.fillStyle=this.gradient,this.context.fillRect(this.GRAPH_X+this.GRAPH_WIDTH-this.PR,this.GRAPH_Y+this.GRAPH_HEIGHT-s,this.PR,s))}};const CK=class e{constructor({trackGPU:t=!1,logsPerSecond:n=30,samplesLog:r=60,samplesGraph:i=10,precision:a=2,minimal:o=!1,horizontal:s=!0,mode:c=0}={}){this.gl=null,this.ext=null,this.activeQuery=null,this.gpuQueries=[],this.threeRendererPatched=!1,this.frames=0,this.renderCount=0,this.isRunningCPUProfiling=!1,this.totalCpuDuration=0,this.totalGpuDuration=0,this.totalGpuDurationCompute=0,this.totalFps=0,this.gpuPanel=null,this.gpuPanelCompute=null,this.averageFps={logs:[],graph:[]},this.averageCpu={logs:[],graph:[]},this.averageGpu={logs:[],graph:[]},this.averageGpuCompute={logs:[],graph:[]},this.handleClick=e=>{e.preventDefault(),this.showPanel(++this.mode%this.dom.children.length)},this.handleResize=()=>{this.resizePanel(this.fpsPanel,0),this.resizePanel(this.msPanel,1),this.gpuPanel&&this.resizePanel(this.gpuPanel,2),this.gpuPanelCompute&&this.resizePanel(this.gpuPanelCompute,3)},this.mode=c,this.horizontal=s,this.minimal=o,this.trackGPU=t,this.samplesLog=r,this.samplesGraph=i,this.precision=a,this.logsPerSecond=n,this.dom=document.createElement(`div`),this.initializeDOM(),this.beginTime=performance.now(),this.prevTime=this.beginTime,this.prevCpuTime=this.beginTime,this.fpsPanel=this.addPanel(new e.Panel(`FPS`,`#0ff`,`#002`),0),this.msPanel=this.addPanel(new e.Panel(`CPU`,`#0f0`,`#020`),1),this.setupEventListeners()}initializeDOM(){this.dom.style.cssText=` position: fixed; top: 0; left: 0; opacity: 0.9; z-index: 10000; ${this.minimal?`cursor: pointer;`:``} - `}setupEventListeners(){this.minimal?(this.dom.addEventListener(`click`,this.handleClick),this.showPanel(this.mode)):window.addEventListener(`resize`,this.handleResize)}async init(e){if(!e){console.error(`Stats: The "canvas" parameter is undefined.`);return}this.handleThreeRenderer(e)||await this.handleWebGPURenderer(e)||this.initializeWebGL(e)}handleThreeRenderer(e){return e.isWebGLRenderer&&!this.threeRendererPatched?(this.patchThreeRenderer(e),this.gl=e.getContext(),this.trackGPU&&this.initializeGPUTracking(),!0):!1}async handleWebGPURenderer(e){return e.isWebGPURenderer?(this.trackGPU&&(e.backend.trackTimestamp=!0,await e.hasFeatureAsync(`timestamp-query`)&&this.initializeWebGPUPanels()),this.info=e.info,!0):!1}initializeWebGPUPanels(){this.gpuPanel=this.addPanel(new e.Panel(`GPU`,`#ff0`,`#220`),2),this.gpuPanelCompute=this.addPanel(new e.Panel(`CPT`,`#e1e1e1`,`#212121`),3)}initializeWebGL(e){if(e instanceof WebGL2RenderingContext)this.gl=e;else if(e instanceof HTMLCanvasElement||e instanceof OffscreenCanvas){if(this.gl=e.getContext(`webgl2`),!this.gl)return console.error(`Stats: Unable to obtain WebGL2 context.`),!1}else return console.error(`Stats: Invalid input type. Expected WebGL2RenderingContext, HTMLCanvasElement, or OffscreenCanvas.`),!1;return!0}initializeGPUTracking(){this.gl&&(this.ext=this.gl.getExtension(`EXT_disjoint_timer_query_webgl2`),this.ext&&(this.gpuPanel=this.addPanel(new e.Panel(`GPU`,`#ff0`,`#220`),2)))}begin(){this.isRunningCPUProfiling||this.beginProfiling(`cpu-started`),!(!this.gl||!this.ext)&&(this.activeQuery&&this.gl.endQuery(this.ext.TIME_ELAPSED_EXT),this.activeQuery=this.gl.createQuery(),this.activeQuery&&this.gl.beginQuery(this.ext.TIME_ELAPSED_EXT,this.activeQuery))}end(){this.renderCount++,this.gl&&this.ext&&this.activeQuery&&(this.gl.endQuery(this.ext.TIME_ELAPSED_EXT),this.gpuQueries.push({query:this.activeQuery}),this.activeQuery=null)}update(){this.info?this.processWebGPUTimestamps():this.processGpuQueries(),this.endProfiling(`cpu-started`,`cpu-finished`,`cpu-duration`),this.updateAverages(),this.resetCounters()}processWebGPUTimestamps(){this.totalGpuDuration=this.info.render.timestamp,this.totalGpuDurationCompute=this.info.compute.timestamp,this.addToAverage(this.totalGpuDurationCompute,this.averageGpuCompute)}updateAverages(){this.addToAverage(this.totalCpuDuration,this.averageCpu),this.addToAverage(this.totalGpuDuration,this.averageGpu)}resetCounters(){this.renderCount=0,this.totalCpuDuration===0&&this.beginProfiling(`cpu-started`),this.totalCpuDuration=0,this.totalFps=0,this.beginTime=this.endInternal()}resizePanel(e,t){e.canvas.style.position=`absolute`,this.minimal?e.canvas.style.display=`none`:(e.canvas.style.display=`block`,this.horizontal?(e.canvas.style.top=`0px`,e.canvas.style.left=t*e.WIDTH/e.PR+`px`):(e.canvas.style.left=`0px`,e.canvas.style.top=t*e.HEIGHT/e.PR+`px`))}addPanel(e,t){return e.canvas&&(this.dom.appendChild(e.canvas),this.resizePanel(e,t)),e}showPanel(e){for(let t=0;t{if(this.gl){let n=this.gl.getQueryParameter(e.query,this.gl.QUERY_RESULT_AVAILABLE),r=this.gl.getParameter(this.ext.GPU_DISJOINT_EXT);if(n&&!r){let n=this.gl.getQueryParameter(e.query,this.gl.QUERY_RESULT)*1e-6;this.totalGpuDuration+=n,this.gl.deleteQuery(e.query),this.gpuQueries.splice(t,1)}}}))}endInternal(){this.frames++;let e=(performance||Date).now(),t=e-this.prevTime;if(e>=this.prevCpuTime+1e3/this.logsPerSecond){let n=Math.round(this.frames*1e3/t);this.addToAverage(n,this.averageFps),this.updatePanel(this.fpsPanel,this.averageFps,0),this.updatePanel(this.msPanel,this.averageCpu,this.precision),this.updatePanel(this.gpuPanel,this.averageGpu,this.precision),this.gpuPanelCompute&&this.updatePanel(this.gpuPanelCompute,this.averageGpuCompute),this.frames=0,this.prevCpuTime=e,this.prevTime=e}return e}addToAverage(e,t){t.logs.push(e),t.logs.length>this.samplesLog&&t.logs.shift(),t.graph.push(e),t.graph.length>this.samplesGraph&&t.graph.shift()}beginProfiling(e){window.performance&&(window.performance.mark(e),this.isRunningCPUProfiling=!0)}endProfiling(e,t,n){if(window.performance&&t&&this.isRunningCPUProfiling){window.performance.mark(t);let r=performance.measure(n,e,t);this.totalCpuDuration+=r.duration,this.isRunningCPUProfiling=!1}}updatePanel(e,t,n=2){if(t.logs.length>0){let r=0,i=.01;for(let e=0;ei&&(i=t.logs[e]);let a=0,o=.01;for(let e=0;eo&&(o=t.graph[e]);e&&e.update(r/Math.min(t.logs.length,this.samplesLog),a/Math.min(t.graph.length,this.samplesGraph),i,o,n)}}get domElement(){return this.dom}patchThreeRenderer(e){let t=e.render,n=this;e.render=function(e,r){n.begin(),t.call(this,e,r),n.end()},this.threeRendererPatched=!0}};CK.Panel=SK;let wK=CK;const TK=Tn({name:`StatsGl`,props:[`logsPerSecond`,`samplesLog`,`samplesGraph`,`precision`,`horizontal`,`minimal`,`mode`],setup(e,{expose:t}){let n=new wK({logsPerSecond:e.logsPerSecond,samplesLog:e.samplesLog,samplesGraph:e.samplesGraph,precision:e.precision,horizontal:e.horizontal,minimal:e.minimal,mode:e.mode});t({instance:n});let r=document.body,i=n.dom||n.container;r?.appendChild(i);let{renderer:a}=De(),{onAfterRender:o}=be();n.init(a.value),o(()=>n.update(),1/0),An(()=>{r?.removeChild(i)})}}),{logError:EK}=Ce(),DK=[`args`],OK=[`color`],kK=Tn({__name:`Box`,props:{args:{default:()=>[1,1,1]},color:{default:`#ffffff`}},setup(e,{expose:t}){let n=e,{invalidate:r}=De(),{args:i,color:a}=un(n);G(i,()=>r());let o=W();return t({instance:o}),(e,t)=>(K(),On(`TresMesh`,bn({ref_key:`boxRef`,ref:o},e.$attrs),[jn(`TresBoxGeometry`,{args:H(i)},null,8,DK),Qt(e.$slots,`default`,{},()=>[jn(`TresMeshBasicMaterial`,{color:H(a)},null,8,OK)])],16))}}),AK=[`object`],jK=Tn({__name:`Line2`,props:{points:{},vertexColors:{default:null},color:{default:`white`},lineWidth:{default:1},worldUnits:{type:Boolean,default:!1},alphaToCoverage:{type:Boolean,default:!1},dashed:{type:Boolean,default:!1},dashSize:{default:1},gapSize:{default:1},dashScale:{default:1},dashOffset:{default:0}},setup(e,{expose:t}){let n=e;function r(e,t){if(!e||e.length===0)return Array.from({length:t}).fill(Se(n.color));if(e.length===1)return Array.from({length:t}).fill(Se(e[0]));if(e.length===t)return e.map(Se);let r=t-1,i=e.map(Se);closed&&i.push(i[0].clone());let a=[i[0]],o=r/(i.length-1);for(let e=1;eArray.isArray(n.vertexColors));function u(e,t){e.color=Se(t.color),e.linewidth=t.lineWidth,e.alphaToCoverage=t.alphaToCoverage,e.worldUnits=t.worldUnits,e.vertexColors=Array.isArray(t.vertexColors),e.dashed=t.dashed,e.dashScale=t.dashScale,e.dashSize=t.dashSize,e.dashOffset=t.dashOffset,e.gapSize=t.gapSize,e.needsUpdate=!0}function d(e,t,n){let i=t.map(e=>e instanceof B?[e.x,e.y,e.z]:e instanceof ut?[e.x,e.y,0]:Array.isArray(e)&&e.length===2?[e[0],e[1],0]:e).flat();e.setPositions(i.flat());let a=r(n,t.length).map(e=>e.toArray()).flat();e.setColors(a),o.computeLineDistances()}u(i,n),d(a,n.points,n.vertexColors),o.computeLineDistances(),G(()=>[n.color,n.lineWidth,n.alphaToCoverage,n.worldUnits,l,n.dashed,n.dashScale,n.dashSize,n.dashOffset],()=>{u(i,n),c()}),G(()=>[n.points,n.vertexColors],()=>{d(a,n.points,n.vertexColors),c()}),G(()=>[s.height,s.width],()=>{i.resolution=new ut(s.width.value,s.height.value),c()}),An(()=>{a.dispose(),i.dispose()});let f=W();return t({instance:f}),(e,t)=>(K(),On(`primitive`,{ref:f.value,object:H(o)},null,8,AK))}}),MK=Tn({__name:`CatmullRomCurve3`,props:{segments:{default:20},closed:{type:Boolean,default:!1},curveType:{default:`centripetal`},tension:{default:.5},points:{},vertexColors:{},color:{},lineWidth:{},alphaToCoverage:{type:Boolean},dashed:{type:Boolean},dashSize:{},dashScale:{},dashOffset:{},gapSize:{},worldUnits:{type:Boolean}},setup(e,{expose:t}){let n=e;function r(e,t,n,r){let i=e.map(e=>e instanceof B?e:new B(...e));return new vt(i,t,n,r)}function i(e,t){return e.getPoints(t)}let a=_n(()=>r(n.points,n.closed,n.curveType,n.tension)),o=_n(()=>i(a.value,n.segments)),s=W();return t({instance:s}),(e,t)=>(K(),Pn(jK,{ref:s.value,points:o.value,"vertex-colors":n.vertexColors,color:n.color,"line-width":n.lineWidth,"alpha-to-coverage":n.alphaToCoverage,dashed:n.dashed,"dash-size":n.dashSize,"dash-scale":n.dashScale,"dash-offset":n.dashOffset,"gap-size":n.gapSize,"world-units":n.worldUnits},null,8,[`points`,`vertex-colors`,`color`,`line-width`,`alpha-to-coverage`,`dashed`,`dash-size`,`dash-scale`,`dash-offset`,`gap-size`,`world-units`]))}}),NK=[`args`],PK=[`color`],FK=Tn({__name:`Circle`,props:{args:{default:()=>[1,32,0,Math.PI*2]},color:{default:`#ffffff`}},setup(e,{expose:t}){let n=e,{args:r,color:i}=un(n),{invalidate:a}=De();G(r,()=>a());let o=W();return t({instance:o}),(e,t)=>(K(),On(`TresMesh`,bn({ref_key:`circleRef`,ref:o},e.$attrs),[jn(`TresCircleGeometry`,{args:H(r)},null,8,NK),Qt(e.$slots,`default`,{},()=>[jn(`TresMeshBasicMaterial`,{color:H(i)},null,8,PK)])],16))}}),IK=[`args`],LK=[`color`],RK=Tn({__name:`Cone`,props:{args:{default:()=>[1,1,12,12,!1,0,Math.PI*2]},color:{default:`#ffffff`}},setup(e,{expose:t}){let n=e,{args:r,color:i}=un(n),{invalidate:a}=De();G(r,()=>a());let o=W();return t({instance:o}),(e,t)=>(K(),On(`TresMesh`,bn({ref_key:`coneRef`,ref:o},e.$attrs),[jn(`TresConeGeometry`,{args:H(r)},null,8,IK),Qt(e.$slots,`default`,{},()=>[jn(`TresMeshBasicMaterial`,{color:H(i)},null,8,LK)])],16))}}),zK=[`args`],BK=[`color`],VK=Tn({__name:`Cylinder`,props:{args:{default:()=>[1,1,1,32,1,!1,0,Math.PI*2]},color:{default:`#ffffff`}},setup(e,{expose:t}){let n=e,{args:r,color:i}=un(n),{invalidate:a}=De();G(r,()=>a());let o=W();return t({instance:o}),(e,t)=>(K(),On(`TresMesh`,bn({ref_key:`cylinderRef`,ref:o},e.$attrs),[jn(`TresCylinderGeometry`,{args:H(r)},null,8,zK),Qt(e.$slots,`default`,{},()=>[jn(`TresMeshBasicMaterial`,{color:H(i)},null,8,BK)])],16))}}),HK=[`args`],UK=[`color`],WK=Tn({__name:`Dodecahedron`,props:{args:{default:()=>[1,0]},color:{default:`#ffffff`}},setup(e,{expose:t}){let n=e,{args:r,color:i}=un(n),a=W(),{invalidate:o}=De();return G(r,()=>o()),t({instance:a}),(e,t)=>(K(),On(`TresMesh`,bn({ref_key:`dodecahedronRef`,ref:a},e.$attrs),[jn(`TresDodecahedronGeometry`,{args:H(r)},null,8,HK),Qt(e.$slots,`default`,{},()=>[jn(`TresMeshBasicMaterial`,{color:H(i)},null,8,UK)])],16))}}),GK=[`args`],KK=[`color`],qK=Tn({__name:`Icosahedron`,props:{args:{default:()=>[1,0]},color:{default:`#ffffff`}},setup(e,{expose:t}){let n=e,{args:r,color:i}=un(n),{invalidate:a}=De();G(r,()=>a());let o=W();return t({instance:o}),(e,t)=>(K(),On(`TresMesh`,bn({ref_key:`icosahedronRef`,ref:o},e.$attrs),[jn(`TresIcosahedronGeometry`,{args:H(r)},null,8,GK),Qt(e.$slots,`default`,{},()=>[jn(`TresMeshBasicMaterial`,{color:H(i)},null,8,KK)])],16))}}),JK=[`args`],YK=[`color`],XK=Tn({__name:`Octahedron`,props:{args:{default:()=>[1,0]},color:{default:`#ffffff`}},setup(e,{expose:t}){let n=e,{args:r,color:i}=un(n),{invalidate:a}=De();G(r,()=>a());let o=W();return t({instance:o}),(e,t)=>(K(),On(`TresMesh`,bn({ref_key:`octahedronRef`,ref:o},e.$attrs),[jn(`TresOctahedronGeometry`,{args:H(r)},null,8,JK),Qt(e.$slots,`default`,{},()=>[jn(`TresMeshBasicMaterial`,{color:H(i)},null,8,YK)])],16))}}),ZK=[`rotation`],QK=[`args`],$K=[`color`],eq=Tn({__name:`Plane`,props:{args:{default:()=>[1,1]},color:{default:`#ffffff`}},setup(e,{expose:t}){let n=e,{args:r,color:i}=un(n),{invalidate:a}=De();G(r,()=>a());let o=W();return t({instance:o}),(e,t)=>(K(),On(`TresMesh`,bn({ref_key:`planeRef`,ref:o,rotation:[-Math.PI/2,0,0]},e.$attrs),[jn(`TresPlaneGeometry`,{args:H(r)},null,8,QK),Qt(e.$slots,`default`,{},()=>[jn(`TresMeshBasicMaterial`,{color:H(i)},null,8,$K)])],16,ZK))}}),tq=[`args`],nq=[`color`],rq=Tn({__name:`Ring`,props:{args:{default:()=>[.5,1,32]},color:{default:`#ffffff`}},setup(e,{expose:t}){let n=e,{args:r,color:i}=un(n),{invalidate:a}=De();G(r,()=>a());let o=W();return t({instance:o}),(e,t)=>(K(),On(`TresMesh`,bn({ref_key:`ringRef`,ref:o},e.$attrs),[jn(`TresRingGeometry`,{args:H(r)},null,8,tq),Qt(e.$slots,`default`,{},()=>[jn(`TresMeshBasicMaterial`,{color:H(i)},null,8,nq)])],16))}}),iq=[`args`],aq=[`color`],oq=Tn({__name:`RoundedBox`,props:{args:{default:()=>[1,1,1,2,.1]},color:{default:`#ffffff`}},setup(e,{expose:t}){let n=e,{args:r,color:i}=un(n),{invalidate:a,extend:o}=De();o({RoundedBoxGeometry:pV}),G(r,()=>a());let s=W();return t({instance:s}),(e,t)=>(K(),On(`TresMesh`,{ref_key:`roundedBoxRef`,ref:s},[jn(`TresRoundedBoxGeometry`,{args:H(r)},null,8,iq),Qt(e.$slots,`default`,{},()=>[jn(`TresMeshBasicMaterial`,{color:H(i)},null,8,aq)])],512))}}),sq=[`args`],cq=[`color`],lq=Tn({__name:`Sphere`,props:{args:{default:()=>[2,32,16]},color:{default:`#ffffff`}},setup(e,{expose:t}){let n=e,{args:r,color:i}=un(n),{invalidate:a}=De();G(r,()=>a());let o=W();return t({instance:o}),(e,t)=>(K(),On(`TresMesh`,bn({ref_key:`sphereRef`,ref:o},e.$attrs),[jn(`TresSphereGeometry`,{args:H(r)},null,8,sq),Qt(e.$slots,`default`,{},()=>[jn(`TresMeshBasicMaterial`,{color:H(i)},null,8,cq)])],16))}}),uq=[`geometry`],dq=[`color`],fq=Tn({__name:`Superformula`,props:{widthSegments:{default:32},heightSegments:{default:32},numArmsA:{default:4},expA:{default:()=>[40,1.3,.9]},numArmsB:{default:4},expB:{default:()=>[40,1.3,.9]},color:{default:`white`}},setup(e,{expose:t}){let n=e,{invalidate:r}=De(),{cos:i,sin:a,abs:o}=Math,s=W(),c=W(n.color);function l(e,t){let n=new rt,r=e*t,i=new Float32Array(Array.from({length:3*r}).fill(0)),a=new Float32Array(Array.from({length:3*r}).fill(0)),o=[];for(let n=0;nn.color,()=>c.value=n.color),G(()=>[n.widthSegments,n.heightSegments],()=>{s.value&&s.value.dispose(),s.value=l(n.widthSegments,n.heightSegments),r()},{immediate:!0}),G(()=>[n.numArmsA,n.expA[0],n.expA[1],n.expA[2],n.numArmsB,n.expB[0],n.expB[1],n.expB[2]],()=>{d(s.value,n.numArmsA,n.expA[0],n.expA[1],n.expA[2],n.numArmsB,n.expB[0],n.expB[1],n.expB[2],n.widthSegments,n.heightSegments),r()},{immediate:!0}),An(()=>{s.value&&s.value.dispose()});let f=W();return t({instance:f}),(e,t)=>(K(),On(`TresMesh`,bn({ref_key:`superformulaRef`,ref:f},e.$attrs,{geometry:s.value}),[Qt(e.$slots,`default`,{},()=>[jn(`TresMeshBasicMaterial`,{color:c.value},null,8,dq)])],16,uq))}}),pq=[`rotation`],mq=[`args`],hq=[`color`],gq=Tn({__name:`Tetrahedron`,props:{args:{default:()=>[1,0]},color:{default:`#ffffff`}},setup(e,{expose:t}){let n=e,{args:r,color:i}=un(n),a=W();return t({instance:a}),(e,t)=>(K(),On(`TresMesh`,bn({ref_key:`tetrahedronRef`,ref:a,rotation:[-Math.PI/2,0,0]},e.$attrs),[jn(`TresTetrahedronGeometry`,{args:H(r)},null,8,mq),Qt(e.$slots,`default`,{},()=>[jn(`TresMeshBasicMaterial`,{color:H(i)},null,8,hq)])],16,pq))}}),_q=[`args`],vq=[`color`],yq=Tn({__name:`Torus`,props:{args:{default:()=>[1,1,16,80]},color:{default:`#ffffff`}},setup(e,{expose:t}){let n=e,{args:r,color:i}=un(n),{invalidate:a}=De();G(r,()=>a());let o=W();return t({instance:o}),(e,t)=>(K(),On(`TresMesh`,bn({ref_key:`torusRef`,ref:o},e.$attrs),[jn(`TresTorusGeometry`,{args:H(r)},null,8,_q),Qt(e.$slots,`default`,{},()=>[jn(`TresMeshBasicMaterial`,{color:H(i)},null,8,vq)])],16))}}),bq=[`args`],xq=[`color`],Sq=Tn({__name:`TorusKnot`,props:{args:{default:()=>[1,.4,64,8]},color:{default:`#ffffff`}},setup(e,{expose:t}){let n=e,{args:r,color:i}=un(n),{invalidate:a}=De();G(r,()=>a());let o=W();return t({instance:o}),(e,t)=>(K(),On(`TresMesh`,bn({ref_key:`torusKnotRef`,ref:o},e.$attrs),[jn(`TresTorusKnotGeometry`,{args:H(r)},null,8,bq),Qt(e.$slots,`default`,{},()=>[jn(`TresMeshBasicMaterial`,{color:H(i)},null,8,xq)])],16))}}),Cq=[`args`],wq=[`color`],Tq=Tn({__name:`Tube`,props:{args:{default:()=>[new _t(new B(-1,0,0),new B(0,1,0),new B(1,0,0)),20,.2,8,!1]},color:{default:`#ffffff`}},setup(e,{expose:t}){let n=e,{args:r,color:i}=un(n),{invalidate:a}=De();G(r,()=>a());let o=W();return t({instance:o}),(e,t)=>(K(),On(`TresMesh`,bn({ref_key:`tubeRef`,ref:o},e.$attrs),[jn(`TresTubeGeometry`,{args:H(r)},null,8,Cq),Qt(e.$slots,`default`,{},()=>[jn(`TresMeshBasicMaterial`,{color:H(i)},null,8,wq)])],16))}}),Eq=Tn({__name:`Align`,props:{top:{type:Boolean},right:{type:Boolean},bottom:{type:Boolean},left:{type:Boolean},front:{type:Boolean},back:{type:Boolean},disable:{type:Boolean},disableX:{type:Boolean},disableY:{type:Boolean},disableZ:{type:Boolean},precise:{type:Boolean,default:!0},onAlign:{},cacheKey:{default:void 0}},setup(e,{expose:t}){let n=e,r=W(),i=W(),a=W(),o=new z,s=new B,c=new At;function l(){if(!i.value||!a.value||!r.value)return;i.value.matrixWorld.identity(),o.setFromObject(a.value,n.precise);let e=o.max.x-o.min.x,t=o.max.y-o.min.y,l=o.max.z-o.min.z;o.getCenter(s),o.getBoundingSphere(c);let u=n.top?t/2:n.bottom?-t/2:0,d=n.left?-e/2:n.right?e/2:0,f=n.front?l/2:n.back?-l/2:0;i.value.position.set(n.disable||n.disableX?0:-s.x+d,n.disable||n.disableY?0:-s.y+u,n.disable||n.disableZ?0:-s.z+f),typeof n.onAlign<`u`&&n.onAlign({parent:r.value.parent,container:r.value,width:e,height:t,depth:l,boundingBox:o,boundingSphere:c,center:s,verticalAlignment:u,horizontalAlignment:d,depthAlignment:f})}let u=null,d=null,f=be();return Nn(()=>{u?.(),u=null;let e=on(n.cacheKey);e===d&&d!=null||(d=e,n.cacheKey===null||n.cacheKey===void 0?u=f.onBeforeRender(()=>{l()}).off:l())}),t({instance:r,update:l}),(e,t)=>(K(),On(`TresGroup`,{ref_key:`ref`,ref:r},[jn(`TresGroup`,{ref_key:`outer`,ref:i},[jn(`TresGroup`,{ref_key:`inner`,ref:a},[Qt(e.$slots,`default`)],512)],512)],512))}}),Dq=[`receive-shadow`,`rotation`],Oq=[`args`],kq=Tn({__name:`Backdrop`,props:{floor:{default:.25},segments:{default:20},receiveShadow:{type:Boolean,default:!1}},setup(e,{expose:t}){let n=e,r=e=>e===0?0:2**(10*e-10),{floor:i,segments:a,receiveShadow:o}=un(n),s=U(null);G([a,i,s],([e,t,n])=>{if(!n||e===null)return;let i=0,a=e/e/2,o=n.attributes.position;for(let n=0;n(K(),On(`TresGroup`,bn({ref_key:`backdropRef`,ref:c},e.$attrs),[jn(`TresMesh`,{"receive-shadow":H(o),rotation:[-Math.PI/2,0,Math.PI/2]},[jn(`TresPlaneGeometry`,{ref_key:`planeRef`,ref:s,args:[1,1,H(a),H(a)]},null,8,Oq),Qt(e.$slots,`default`,{},()=>[t[0]||=jn(`TresMeshStandardMaterial`,{color:8421504,side:2},null,-1)])],8,Dq)],16))}}),Aq=[`object`],jq=Tn({__name:`ContactShadows`,props:{opacity:{default:1},blur:{default:1},color:{default:`#000000`},tint:{default:void 0},scale:{default:10},width:{default:1},height:{default:1},far:{default:10},smooth:{type:Boolean,default:!0},resolution:{default:512},frames:{default:1/0},depthWrite:{type:Boolean,default:!1}},setup(e,{expose:t}){let n=e;function r(e,t,n){n.blurPlane.visible=!0,n.blurPlane.material=n.horizontalBlurMaterial,n.horizontalBlurMaterial.uniforms.tDiffuse.value=n.renderTarget.texture,n.horizontalBlurMaterial.uniforms.h.value=e/256,t.setRenderTarget(n.renderTargetBlur),t.render(n.blurPlane,n.shadowCamera),n.blurPlane.material=n.verticalBlurMaterial,n.verticalBlurMaterial.uniforms.tDiffuse.value=n.renderTargetBlur.texture,n.verticalBlurMaterial.uniforms.v.value=e/256,t.setRenderTarget(n.renderTarget),t.render(n.blurPlane,n.shadowCamera),n.blurPlane.visible=!1}function i(e,t,n,i){let{renderTarget:a,shadowCamera:o,depthMaterial:s}=i,c=t.background;t.background=null,t.overrideMaterial=s;let l=n.getClearAlpha();n.setClearAlpha(0),n.setRenderTarget(a),n.render(t,o),t.overrideMaterial=null,r(e.blur,n,i),e.smooth&&r(e.blur*.4,n,i),n.setRenderTarget(null),n.setClearAlpha(l),t.background=c}function a(e){let t=new ve,n=new re(e.resolution,e.resolution);n.texture.generateMipmaps=!1;let r=new re(e.resolution,e.resolution);r.texture.generateMipmaps=!1;let i=new Ye(e.width,e.height).rotateX(Math.PI/2),a=new gt({map:n.texture,opacity:e.opacity,transparent:!0,depthWrite:e.depthWrite,color:new ge(e.color??`black`)}),o=new V(i,a);t.add(o),o.scale.y=-1;let s=new V(i);s.visible=!1,t.add(s);let c=new ee(-e.width/2,e.width/2,e.height/2,-e.height/2,0,.3);c.rotation.x=Math.PI/2,t.add(c);let l=new tt,u=new Bt(hV);u.depthTest=!1;let d=new Bt(gV);return d.depthTest=!1,{renderTarget:n,renderTargetBlur:r,shadowCamera:c,depthMaterial:l,horizontalBlurMaterial:u,verticalBlurMaterial:d,shadowGroup:t,plane:o,blurPlane:s}}function o(e,t){let n=t.shadowCamera;n.left=-e.width/2,n.right=e.width/2,n.top=e.height/2,n.bottom=-e.height/2,n.far=e.far;let r=e.width*(Array.isArray(e.scale)?e.scale[0]:e.scale||1),i=e.height*(Array.isArray(e.scale)?e.scale[1]:e.scale||1);t.shadowGroup.scale.set(r,e.far,i)}function s(e,t){t.renderTarget.dispose(),t.renderTargetBlur.dispose(),t.renderTarget=new re(e,e),t.renderTarget.texture.generateMipmaps=!1,t.renderTargetBlur=new re(e,e),t.renderTargetBlur.texture.generateMipmaps=!1,t.plane.material.map=t.renderTarget.texture}function c(e,t){t.plane.material.color=new ge(e.color??`black`),t.depthMaterial.dispose(),t.depthMaterial=new tt,t.depthMaterial.onBeforeCompile=function(t){let n=e.tint?new ge(e.tint):new ge(`white`),{r,g:i,b:a}=n,o=t.fragmentShader.replace(`gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );`,`gl_FragColor = vec4( ${r}, ${i}, ${a}, ( 1.0 - fragCoordZ ) * opacity);`);t.fragmentShader=o}}let{onBeforeRender:l}=be(),u=a(n),d=0,f=()=>d=d>=n.frames?n.frames-1:d;return l(({renderer:e,scene:t,invalidate:r})=>{d[n.opacity,n.depthWrite,n.blur,n.smooth],()=>{u.plane.material.opacity=n.opacity??1,u.plane.material.depthWrite=n.depthWrite??!1,f()},{immediate:!0}),G(()=>[n.color,n.tint],()=>{c(n,u),f()},{immediate:!0}),G(()=>[n.resolution],()=>{s(n.resolution,u),f()}),G(()=>[n.width,n.height,n.scale,n.far],()=>{o(n,u),f()},{immediate:!0}),An(()=>{for(let e of Object.values(u))e&&`dispose`in e&&typeof e.dispose==`function`&&e.dispose()}),t({instance:u.shadowGroup}),(e,t)=>(K(),On(`primitive`,{object:H(u).shadowGroup},null,8,Aq))}}),Mq=Tn({__name:`Fit`,props:{into:{default:()=>new z(new B(-.5,-.5,-.5),new B(.5,.5,.5))},precise:{type:Boolean,default:!1}},setup(e,{expose:t}){let n=e,{invalidate:r}=De(),i=W(new ve),a=W(new ve);function o(e,t){if(i.value.position.set(0,0,0),i.value.updateMatrixWorld(),a.value.scale.set(1,1,1),a.value.updateMatrixWorld(),!a.value.children.length||e===null)return;let{box3:n,use:o}=s(e,t),c=new z;a.value.children.forEach(e=>c.expandByObject(e,t));let l=c.getSize(new B),u=n.getSize(new B),d=Math.min(u.x/l.x,u.y/l.y,u.z/l.z);a.value.scale.setScalar(d===1/0?1:d),a.value.updateMatrixWorld();let f=i.value.worldToLocal(c.getCenter(new B));if(o.position){let e=i.value.worldToLocal(n.getCenter(new B));i.value.position.copy(e.sub(f.multiplyScalar(d)))}else i.value.position.copy(f.sub(f.multiplyScalar(d)));r()}function s(e,t){return typeof e==`number`?e=new B(e,e,e):Array.isArray(e)&&(e=new B(...e)),e&&`isVector3`in e&&e.isVector3?{box3:new z(new B(0,0,0),e),use:{position:!1}}:e&&`isBox3`in e&&e.isBox3?{box3:e,use:{position:!0}}:e&&`isObject3D`in e&&e.isObject3D?{box3:new z().setFromObject(e,t??!1),use:{position:!0}}:{box3:new z(new B(-.5,-.5,-.5),new B(.5,.5,.5)),use:{position:!0}}}G(()=>[n.into,n.precise],()=>o(n.into,n.precise)),Cn(()=>{o(n.into,n.precise),wn().then(()=>{o(n.into,n.precise)})});let c=W();return t({instance:c,fit:(e=new z(new B(-.5,-.5,-.5),new B(.5,.5,.5)),t=!1)=>{o(e,t)},update:()=>o(n.into,n.precise)}),(e,t)=>(K(),On(`TresGroup`,{ref_key:`outer`,ref:c},[jn(`TresGroup`,{ref_key:`middle`,ref:i},[jn(`TresGroup`,{ref_key:`inner`,ref:a},[Qt(e.$slots,`default`)],512)],512)],512))}}),Nq=[`side`,`cell-size`,`section-size`,`cell-color`,`section-color`,`cell-thickness`,`section-thickness`,`fade-distance`,`fade-strength`,`fade-from`,`infinite-grid`,`follow-camera`],Pq=[`args`],Fq=Tn({__name:`Grid`,props:{cellSize:{default:.5},cellThickness:{default:.5},cellColor:{default:`#000000`},sectionSize:{default:1},sectionThickness:{default:1},sectionColor:{default:`#0000ff`},followCamera:{type:Boolean,default:!1},infiniteGrid:{type:Boolean,default:!1},fadeDistance:{default:100},fadeStrength:{default:1},fadeFrom:{default:1},side:{default:Fe},args:{}},setup(e){let t=e,n=NR({cellSize:.5,sectionSize:1,fadeDistance:100,fadeStrength:1,fadeFrom:1,cellThickness:.5,sectionThickness:1,cellColor:new ge,sectionColor:new ge,infiniteGrid:!1,followCamera:!1,worldCamProjPosition:new B,worldPlanePosition:new B},` + `}setupEventListeners(){this.minimal?(this.dom.addEventListener(`click`,this.handleClick),this.showPanel(this.mode)):window.addEventListener(`resize`,this.handleResize)}async init(e){if(!e){console.error(`Stats: The "canvas" parameter is undefined.`);return}this.handleThreeRenderer(e)||await this.handleWebGPURenderer(e)||this.initializeWebGL(e)}handleThreeRenderer(e){return e.isWebGLRenderer&&!this.threeRendererPatched?(this.patchThreeRenderer(e),this.gl=e.getContext(),this.trackGPU&&this.initializeGPUTracking(),!0):!1}async handleWebGPURenderer(e){return e.isWebGPURenderer?(this.trackGPU&&(e.backend.trackTimestamp=!0,await e.hasFeatureAsync(`timestamp-query`)&&this.initializeWebGPUPanels()),this.info=e.info,!0):!1}initializeWebGPUPanels(){this.gpuPanel=this.addPanel(new e.Panel(`GPU`,`#ff0`,`#220`),2),this.gpuPanelCompute=this.addPanel(new e.Panel(`CPT`,`#e1e1e1`,`#212121`),3)}initializeWebGL(e){if(e instanceof WebGL2RenderingContext)this.gl=e;else if(e instanceof HTMLCanvasElement||e instanceof OffscreenCanvas){if(this.gl=e.getContext(`webgl2`),!this.gl)return console.error(`Stats: Unable to obtain WebGL2 context.`),!1}else return console.error(`Stats: Invalid input type. Expected WebGL2RenderingContext, HTMLCanvasElement, or OffscreenCanvas.`),!1;return!0}initializeGPUTracking(){this.gl&&(this.ext=this.gl.getExtension(`EXT_disjoint_timer_query_webgl2`),this.ext&&(this.gpuPanel=this.addPanel(new e.Panel(`GPU`,`#ff0`,`#220`),2)))}begin(){this.isRunningCPUProfiling||this.beginProfiling(`cpu-started`),!(!this.gl||!this.ext)&&(this.activeQuery&&this.gl.endQuery(this.ext.TIME_ELAPSED_EXT),this.activeQuery=this.gl.createQuery(),this.activeQuery&&this.gl.beginQuery(this.ext.TIME_ELAPSED_EXT,this.activeQuery))}end(){this.renderCount++,this.gl&&this.ext&&this.activeQuery&&(this.gl.endQuery(this.ext.TIME_ELAPSED_EXT),this.gpuQueries.push({query:this.activeQuery}),this.activeQuery=null)}update(){this.info?this.processWebGPUTimestamps():this.processGpuQueries(),this.endProfiling(`cpu-started`,`cpu-finished`,`cpu-duration`),this.updateAverages(),this.resetCounters()}processWebGPUTimestamps(){this.totalGpuDuration=this.info.render.timestamp,this.totalGpuDurationCompute=this.info.compute.timestamp,this.addToAverage(this.totalGpuDurationCompute,this.averageGpuCompute)}updateAverages(){this.addToAverage(this.totalCpuDuration,this.averageCpu),this.addToAverage(this.totalGpuDuration,this.averageGpu)}resetCounters(){this.renderCount=0,this.totalCpuDuration===0&&this.beginProfiling(`cpu-started`),this.totalCpuDuration=0,this.totalFps=0,this.beginTime=this.endInternal()}resizePanel(e,t){e.canvas.style.position=`absolute`,this.minimal?e.canvas.style.display=`none`:(e.canvas.style.display=`block`,this.horizontal?(e.canvas.style.top=`0px`,e.canvas.style.left=t*e.WIDTH/e.PR+`px`):(e.canvas.style.left=`0px`,e.canvas.style.top=t*e.HEIGHT/e.PR+`px`))}addPanel(e,t){return e.canvas&&(this.dom.appendChild(e.canvas),this.resizePanel(e,t)),e}showPanel(e){for(let t=0;t{if(this.gl){let n=this.gl.getQueryParameter(e.query,this.gl.QUERY_RESULT_AVAILABLE),r=this.gl.getParameter(this.ext.GPU_DISJOINT_EXT);if(n&&!r){let n=this.gl.getQueryParameter(e.query,this.gl.QUERY_RESULT)*1e-6;this.totalGpuDuration+=n,this.gl.deleteQuery(e.query),this.gpuQueries.splice(t,1)}}}))}endInternal(){this.frames++;let e=(performance||Date).now(),t=e-this.prevTime;if(e>=this.prevCpuTime+1e3/this.logsPerSecond){let n=Math.round(this.frames*1e3/t);this.addToAverage(n,this.averageFps),this.updatePanel(this.fpsPanel,this.averageFps,0),this.updatePanel(this.msPanel,this.averageCpu,this.precision),this.updatePanel(this.gpuPanel,this.averageGpu,this.precision),this.gpuPanelCompute&&this.updatePanel(this.gpuPanelCompute,this.averageGpuCompute),this.frames=0,this.prevCpuTime=e,this.prevTime=e}return e}addToAverage(e,t){t.logs.push(e),t.logs.length>this.samplesLog&&t.logs.shift(),t.graph.push(e),t.graph.length>this.samplesGraph&&t.graph.shift()}beginProfiling(e){window.performance&&(window.performance.mark(e),this.isRunningCPUProfiling=!0)}endProfiling(e,t,n){if(window.performance&&t&&this.isRunningCPUProfiling){window.performance.mark(t);let r=performance.measure(n,e,t);this.totalCpuDuration+=r.duration,this.isRunningCPUProfiling=!1}}updatePanel(e,t,n=2){if(t.logs.length>0){let r=0,i=.01;for(let e=0;ei&&(i=t.logs[e]);let a=0,o=.01;for(let e=0;eo&&(o=t.graph[e]);e&&e.update(r/Math.min(t.logs.length,this.samplesLog),a/Math.min(t.graph.length,this.samplesGraph),i,o,n)}}get domElement(){return this.dom}patchThreeRenderer(e){let t=e.render,n=this;e.render=function(e,r){n.begin(),t.call(this,e,r),n.end()},this.threeRendererPatched=!0}};CK.Panel=SK;let wK=CK;const TK=$t({name:`StatsGl`,props:[`logsPerSecond`,`samplesLog`,`samplesGraph`,`precision`,`horizontal`,`minimal`,`mode`],setup(e,{expose:t}){let n=new wK({logsPerSecond:e.logsPerSecond,samplesLog:e.samplesLog,samplesGraph:e.samplesGraph,precision:e.precision,horizontal:e.horizontal,minimal:e.minimal,mode:e.mode});t({instance:n});let r=document.body,i=n.dom||n.container;r?.appendChild(i);let{renderer:a}=De(),{onAfterRender:o}=be();n.init(a.value),o(()=>n.update(),1/0),bn(()=>{r?.removeChild(i)})}}),{logError:EK}=Ce(),DK=[`args`],OK=[`color`],kK=$t({__name:`Box`,props:{args:{default:()=>[1,1,1]},color:{default:`#ffffff`}},setup(e,{expose:t}){let n=e,{invalidate:r}=De(),{args:i,color:a}=rn(n);G(i,()=>r());let o=W();return t({instance:o}),(e,t)=>(K(),nn(`TresMesh`,jn({ref_key:`boxRef`,ref:o},e.$attrs),[xn(`TresBoxGeometry`,{args:H(i)},null,8,DK),Tn(e.$slots,`default`,{},()=>[xn(`TresMeshBasicMaterial`,{color:H(a)},null,8,OK)])],16))}}),AK=[`object`],jK=$t({__name:`Line2`,props:{points:{},vertexColors:{default:null},color:{default:`white`},lineWidth:{default:1},worldUnits:{type:Boolean,default:!1},alphaToCoverage:{type:Boolean,default:!1},dashed:{type:Boolean,default:!1},dashSize:{default:1},gapSize:{default:1},dashScale:{default:1},dashOffset:{default:0}},setup(e,{expose:t}){let n=e;function r(e,t){if(!e||e.length===0)return Array.from({length:t}).fill(Se(n.color));if(e.length===1)return Array.from({length:t}).fill(Se(e[0]));if(e.length===t)return e.map(Se);let r=t-1,i=e.map(Se);closed&&i.push(i[0].clone());let a=[i[0]],o=r/(i.length-1);for(let e=1;eArray.isArray(n.vertexColors));function u(e,t){e.color=Se(t.color),e.linewidth=t.lineWidth,e.alphaToCoverage=t.alphaToCoverage,e.worldUnits=t.worldUnits,e.vertexColors=Array.isArray(t.vertexColors),e.dashed=t.dashed,e.dashScale=t.dashScale,e.dashSize=t.dashSize,e.dashOffset=t.dashOffset,e.gapSize=t.gapSize,e.needsUpdate=!0}function d(e,t,n){let i=t.map(e=>e instanceof B?[e.x,e.y,e.z]:e instanceof ct?[e.x,e.y,0]:Array.isArray(e)&&e.length===2?[e[0],e[1],0]:e).flat();e.setPositions(i.flat());let a=r(n,t.length).map(e=>e.toArray()).flat();e.setColors(a),o.computeLineDistances()}u(i,n),d(a,n.points,n.vertexColors),o.computeLineDistances(),G(()=>[n.color,n.lineWidth,n.alphaToCoverage,n.worldUnits,l,n.dashed,n.dashScale,n.dashSize,n.dashOffset],()=>{u(i,n),c()}),G(()=>[n.points,n.vertexColors],()=>{d(a,n.points,n.vertexColors),c()}),G(()=>[s.height,s.width],()=>{i.resolution=new ct(s.width.value,s.height.value),c()}),bn(()=>{a.dispose(),i.dispose()});let f=W();return t({instance:f}),(e,t)=>(K(),nn(`primitive`,{ref:f.value,object:H(o)},null,8,AK))}}),MK=$t({__name:`CatmullRomCurve3`,props:{segments:{default:20},closed:{type:Boolean,default:!1},curveType:{default:`centripetal`},tension:{default:.5},points:{},vertexColors:{},color:{},lineWidth:{},alphaToCoverage:{type:Boolean},dashed:{type:Boolean},dashSize:{},dashScale:{},dashOffset:{},gapSize:{},worldUnits:{type:Boolean}},setup(e,{expose:t}){let n=e;function r(e,t,n,r){let i=e.map(e=>e instanceof B?e:new B(...e));return new ht(i,t,n,r)}function i(e,t){return e.getPoints(t)}let a=On(()=>r(n.points,n.closed,n.curveType,n.tension)),o=On(()=>i(a.value,n.segments)),s=W();return t({instance:s}),(e,t)=>(K(),wn(jK,{ref:s.value,points:o.value,"vertex-colors":n.vertexColors,color:n.color,"line-width":n.lineWidth,"alpha-to-coverage":n.alphaToCoverage,dashed:n.dashed,"dash-size":n.dashSize,"dash-scale":n.dashScale,"dash-offset":n.dashOffset,"gap-size":n.gapSize,"world-units":n.worldUnits},null,8,[`points`,`vertex-colors`,`color`,`line-width`,`alpha-to-coverage`,`dashed`,`dash-size`,`dash-scale`,`dash-offset`,`gap-size`,`world-units`]))}}),NK=[`args`],PK=[`color`],FK=$t({__name:`Circle`,props:{args:{default:()=>[1,32,0,Math.PI*2]},color:{default:`#ffffff`}},setup(e,{expose:t}){let n=e,{args:r,color:i}=rn(n),{invalidate:a}=De();G(r,()=>a());let o=W();return t({instance:o}),(e,t)=>(K(),nn(`TresMesh`,jn({ref_key:`circleRef`,ref:o},e.$attrs),[xn(`TresCircleGeometry`,{args:H(r)},null,8,NK),Tn(e.$slots,`default`,{},()=>[xn(`TresMeshBasicMaterial`,{color:H(i)},null,8,PK)])],16))}}),IK=[`args`],LK=[`color`],RK=$t({__name:`Cone`,props:{args:{default:()=>[1,1,12,12,!1,0,Math.PI*2]},color:{default:`#ffffff`}},setup(e,{expose:t}){let n=e,{args:r,color:i}=rn(n),{invalidate:a}=De();G(r,()=>a());let o=W();return t({instance:o}),(e,t)=>(K(),nn(`TresMesh`,jn({ref_key:`coneRef`,ref:o},e.$attrs),[xn(`TresConeGeometry`,{args:H(r)},null,8,IK),Tn(e.$slots,`default`,{},()=>[xn(`TresMeshBasicMaterial`,{color:H(i)},null,8,LK)])],16))}}),zK=[`args`],BK=[`color`],VK=$t({__name:`Cylinder`,props:{args:{default:()=>[1,1,1,32,1,!1,0,Math.PI*2]},color:{default:`#ffffff`}},setup(e,{expose:t}){let n=e,{args:r,color:i}=rn(n),{invalidate:a}=De();G(r,()=>a());let o=W();return t({instance:o}),(e,t)=>(K(),nn(`TresMesh`,jn({ref_key:`cylinderRef`,ref:o},e.$attrs),[xn(`TresCylinderGeometry`,{args:H(r)},null,8,zK),Tn(e.$slots,`default`,{},()=>[xn(`TresMeshBasicMaterial`,{color:H(i)},null,8,BK)])],16))}}),HK=[`args`],UK=[`color`],WK=$t({__name:`Dodecahedron`,props:{args:{default:()=>[1,0]},color:{default:`#ffffff`}},setup(e,{expose:t}){let n=e,{args:r,color:i}=rn(n),a=W(),{invalidate:o}=De();return G(r,()=>o()),t({instance:a}),(e,t)=>(K(),nn(`TresMesh`,jn({ref_key:`dodecahedronRef`,ref:a},e.$attrs),[xn(`TresDodecahedronGeometry`,{args:H(r)},null,8,HK),Tn(e.$slots,`default`,{},()=>[xn(`TresMeshBasicMaterial`,{color:H(i)},null,8,UK)])],16))}}),GK=[`args`],KK=[`color`],qK=$t({__name:`Icosahedron`,props:{args:{default:()=>[1,0]},color:{default:`#ffffff`}},setup(e,{expose:t}){let n=e,{args:r,color:i}=rn(n),{invalidate:a}=De();G(r,()=>a());let o=W();return t({instance:o}),(e,t)=>(K(),nn(`TresMesh`,jn({ref_key:`icosahedronRef`,ref:o},e.$attrs),[xn(`TresIcosahedronGeometry`,{args:H(r)},null,8,GK),Tn(e.$slots,`default`,{},()=>[xn(`TresMeshBasicMaterial`,{color:H(i)},null,8,KK)])],16))}}),JK=[`args`],YK=[`color`],XK=$t({__name:`Octahedron`,props:{args:{default:()=>[1,0]},color:{default:`#ffffff`}},setup(e,{expose:t}){let n=e,{args:r,color:i}=rn(n),{invalidate:a}=De();G(r,()=>a());let o=W();return t({instance:o}),(e,t)=>(K(),nn(`TresMesh`,jn({ref_key:`octahedronRef`,ref:o},e.$attrs),[xn(`TresOctahedronGeometry`,{args:H(r)},null,8,JK),Tn(e.$slots,`default`,{},()=>[xn(`TresMeshBasicMaterial`,{color:H(i)},null,8,YK)])],16))}}),ZK=[`rotation`],QK=[`args`],$K=[`color`],eq=$t({__name:`Plane`,props:{args:{default:()=>[1,1]},color:{default:`#ffffff`}},setup(e,{expose:t}){let n=e,{args:r,color:i}=rn(n),{invalidate:a}=De();G(r,()=>a());let o=W();return t({instance:o}),(e,t)=>(K(),nn(`TresMesh`,jn({ref_key:`planeRef`,ref:o,rotation:[-Math.PI/2,0,0]},e.$attrs),[xn(`TresPlaneGeometry`,{args:H(r)},null,8,QK),Tn(e.$slots,`default`,{},()=>[xn(`TresMeshBasicMaterial`,{color:H(i)},null,8,$K)])],16,ZK))}}),tq=[`args`],nq=[`color`],rq=$t({__name:`Ring`,props:{args:{default:()=>[.5,1,32]},color:{default:`#ffffff`}},setup(e,{expose:t}){let n=e,{args:r,color:i}=rn(n),{invalidate:a}=De();G(r,()=>a());let o=W();return t({instance:o}),(e,t)=>(K(),nn(`TresMesh`,jn({ref_key:`ringRef`,ref:o},e.$attrs),[xn(`TresRingGeometry`,{args:H(r)},null,8,tq),Tn(e.$slots,`default`,{},()=>[xn(`TresMeshBasicMaterial`,{color:H(i)},null,8,nq)])],16))}}),iq=[`args`],aq=[`color`],oq=$t({__name:`RoundedBox`,props:{args:{default:()=>[1,1,1,2,.1]},color:{default:`#ffffff`}},setup(e,{expose:t}){let n=e,{args:r,color:i}=rn(n),{invalidate:a,extend:o}=De();o({RoundedBoxGeometry:pV}),G(r,()=>a());let s=W();return t({instance:s}),(e,t)=>(K(),nn(`TresMesh`,{ref_key:`roundedBoxRef`,ref:s},[xn(`TresRoundedBoxGeometry`,{args:H(r)},null,8,iq),Tn(e.$slots,`default`,{},()=>[xn(`TresMeshBasicMaterial`,{color:H(i)},null,8,aq)])],512))}}),sq=[`args`],cq=[`color`],lq=$t({__name:`Sphere`,props:{args:{default:()=>[2,32,16]},color:{default:`#ffffff`}},setup(e,{expose:t}){let n=e,{args:r,color:i}=rn(n),{invalidate:a}=De();G(r,()=>a());let o=W();return t({instance:o}),(e,t)=>(K(),nn(`TresMesh`,jn({ref_key:`sphereRef`,ref:o},e.$attrs),[xn(`TresSphereGeometry`,{args:H(r)},null,8,sq),Tn(e.$slots,`default`,{},()=>[xn(`TresMeshBasicMaterial`,{color:H(i)},null,8,cq)])],16))}}),uq=[`geometry`],dq=[`color`],fq=$t({__name:`Superformula`,props:{widthSegments:{default:32},heightSegments:{default:32},numArmsA:{default:4},expA:{default:()=>[40,1.3,.9]},numArmsB:{default:4},expB:{default:()=>[40,1.3,.9]},color:{default:`white`}},setup(e,{expose:t}){let n=e,{invalidate:r}=De(),{cos:i,sin:a,abs:o}=Math,s=W(),c=W(n.color);function l(e,t){let n=new tt,r=e*t,i=new Float32Array(Array.from({length:3*r}).fill(0)),a=new Float32Array(Array.from({length:3*r}).fill(0)),o=[];for(let n=0;nn.color,()=>c.value=n.color),G(()=>[n.widthSegments,n.heightSegments],()=>{s.value&&s.value.dispose(),s.value=l(n.widthSegments,n.heightSegments),r()},{immediate:!0}),G(()=>[n.numArmsA,n.expA[0],n.expA[1],n.expA[2],n.numArmsB,n.expB[0],n.expB[1],n.expB[2]],()=>{d(s.value,n.numArmsA,n.expA[0],n.expA[1],n.expA[2],n.numArmsB,n.expB[0],n.expB[1],n.expB[2],n.widthSegments,n.heightSegments),r()},{immediate:!0}),bn(()=>{s.value&&s.value.dispose()});let f=W();return t({instance:f}),(e,t)=>(K(),nn(`TresMesh`,jn({ref_key:`superformulaRef`,ref:f},e.$attrs,{geometry:s.value}),[Tn(e.$slots,`default`,{},()=>[xn(`TresMeshBasicMaterial`,{color:c.value},null,8,dq)])],16,uq))}}),pq=[`rotation`],mq=[`args`],hq=[`color`],gq=$t({__name:`Tetrahedron`,props:{args:{default:()=>[1,0]},color:{default:`#ffffff`}},setup(e,{expose:t}){let n=e,{args:r,color:i}=rn(n),a=W();return t({instance:a}),(e,t)=>(K(),nn(`TresMesh`,jn({ref_key:`tetrahedronRef`,ref:a,rotation:[-Math.PI/2,0,0]},e.$attrs),[xn(`TresTetrahedronGeometry`,{args:H(r)},null,8,mq),Tn(e.$slots,`default`,{},()=>[xn(`TresMeshBasicMaterial`,{color:H(i)},null,8,hq)])],16,pq))}}),_q=[`args`],vq=[`color`],yq=$t({__name:`Torus`,props:{args:{default:()=>[1,1,16,80]},color:{default:`#ffffff`}},setup(e,{expose:t}){let n=e,{args:r,color:i}=rn(n),{invalidate:a}=De();G(r,()=>a());let o=W();return t({instance:o}),(e,t)=>(K(),nn(`TresMesh`,jn({ref_key:`torusRef`,ref:o},e.$attrs),[xn(`TresTorusGeometry`,{args:H(r)},null,8,_q),Tn(e.$slots,`default`,{},()=>[xn(`TresMeshBasicMaterial`,{color:H(i)},null,8,vq)])],16))}}),bq=[`args`],xq=[`color`],Sq=$t({__name:`TorusKnot`,props:{args:{default:()=>[1,.4,64,8]},color:{default:`#ffffff`}},setup(e,{expose:t}){let n=e,{args:r,color:i}=rn(n),{invalidate:a}=De();G(r,()=>a());let o=W();return t({instance:o}),(e,t)=>(K(),nn(`TresMesh`,jn({ref_key:`torusKnotRef`,ref:o},e.$attrs),[xn(`TresTorusKnotGeometry`,{args:H(r)},null,8,bq),Tn(e.$slots,`default`,{},()=>[xn(`TresMeshBasicMaterial`,{color:H(i)},null,8,xq)])],16))}}),Cq=[`args`],wq=[`color`],Tq=$t({__name:`Tube`,props:{args:{default:()=>[new gt(new B(-1,0,0),new B(0,1,0),new B(1,0,0)),20,.2,8,!1]},color:{default:`#ffffff`}},setup(e,{expose:t}){let n=e,{args:r,color:i}=rn(n),{invalidate:a}=De();G(r,()=>a());let o=W();return t({instance:o}),(e,t)=>(K(),nn(`TresMesh`,jn({ref_key:`tubeRef`,ref:o},e.$attrs),[xn(`TresTubeGeometry`,{args:H(r)},null,8,Cq),Tn(e.$slots,`default`,{},()=>[xn(`TresMeshBasicMaterial`,{color:H(i)},null,8,wq)])],16))}}),Eq=$t({__name:`Align`,props:{top:{type:Boolean},right:{type:Boolean},bottom:{type:Boolean},left:{type:Boolean},front:{type:Boolean},back:{type:Boolean},disable:{type:Boolean},disableX:{type:Boolean},disableY:{type:Boolean},disableZ:{type:Boolean},precise:{type:Boolean,default:!0},onAlign:{},cacheKey:{default:void 0}},setup(e,{expose:t}){let n=e,r=W(),i=W(),a=W(),o=new R,s=new B,c=new At;function l(){if(!i.value||!a.value||!r.value)return;i.value.matrixWorld.identity(),o.setFromObject(a.value,n.precise);let e=o.max.x-o.min.x,t=o.max.y-o.min.y,l=o.max.z-o.min.z;o.getCenter(s),o.getBoundingSphere(c);let u=n.top?t/2:n.bottom?-t/2:0,d=n.left?-e/2:n.right?e/2:0,f=n.front?l/2:n.back?-l/2:0;i.value.position.set(n.disable||n.disableX?0:-s.x+d,n.disable||n.disableY?0:-s.y+u,n.disable||n.disableZ?0:-s.z+f),typeof n.onAlign<`u`&&n.onAlign({parent:r.value.parent,container:r.value,width:e,height:t,depth:l,boundingBox:o,boundingSphere:c,center:s,verticalAlignment:u,horizontalAlignment:d,depthAlignment:f})}let u=null,d=null,f=be();return Cn(()=>{u?.(),u=null;let e=un(n.cacheKey);e===d&&d!=null||(d=e,n.cacheKey===null||n.cacheKey===void 0?u=f.onBeforeRender(()=>{l()}).off:l())}),t({instance:r,update:l}),(e,t)=>(K(),nn(`TresGroup`,{ref_key:`ref`,ref:r},[xn(`TresGroup`,{ref_key:`outer`,ref:i},[xn(`TresGroup`,{ref_key:`inner`,ref:a},[Tn(e.$slots,`default`)],512)],512)],512))}}),Dq=[`receive-shadow`,`rotation`],Oq=[`args`],kq=$t({__name:`Backdrop`,props:{floor:{default:.25},segments:{default:20},receiveShadow:{type:Boolean,default:!1}},setup(e,{expose:t}){let n=e,r=e=>e===0?0:2**(10*e-10),{floor:i,segments:a,receiveShadow:o}=rn(n),s=U(null);G([a,i,s],([e,t,n])=>{if(!n||e===null)return;let i=0,a=e/e/2,o=n.attributes.position;for(let n=0;n(K(),nn(`TresGroup`,jn({ref_key:`backdropRef`,ref:c},e.$attrs),[xn(`TresMesh`,{"receive-shadow":H(o),rotation:[-Math.PI/2,0,Math.PI/2]},[xn(`TresPlaneGeometry`,{ref_key:`planeRef`,ref:s,args:[1,1,H(a),H(a)]},null,8,Oq),Tn(e.$slots,`default`,{},()=>[t[0]||=xn(`TresMeshStandardMaterial`,{color:8421504,side:2},null,-1)])],8,Dq)],16))}}),Aq=[`object`],jq=$t({__name:`ContactShadows`,props:{opacity:{default:1},blur:{default:1},color:{default:`#000000`},tint:{default:void 0},scale:{default:10},width:{default:1},height:{default:1},far:{default:10},smooth:{type:Boolean,default:!0},resolution:{default:512},frames:{default:1/0},depthWrite:{type:Boolean,default:!1}},setup(e,{expose:t}){let n=e;function r(e,t,n){n.blurPlane.visible=!0,n.blurPlane.material=n.horizontalBlurMaterial,n.horizontalBlurMaterial.uniforms.tDiffuse.value=n.renderTarget.texture,n.horizontalBlurMaterial.uniforms.h.value=e/256,t.setRenderTarget(n.renderTargetBlur),t.render(n.blurPlane,n.shadowCamera),n.blurPlane.material=n.verticalBlurMaterial,n.verticalBlurMaterial.uniforms.tDiffuse.value=n.renderTargetBlur.texture,n.verticalBlurMaterial.uniforms.v.value=e/256,t.setRenderTarget(n.renderTarget),t.render(n.blurPlane,n.shadowCamera),n.blurPlane.visible=!1}function i(e,t,n,i){let{renderTarget:a,shadowCamera:o,depthMaterial:s}=i,c=t.background;t.background=null,t.overrideMaterial=s;let l=n.getClearAlpha();n.setClearAlpha(0),n.setRenderTarget(a),n.render(t,o),t.overrideMaterial=null,r(e.blur,n,i),e.smooth&&r(e.blur*.4,n,i),n.setRenderTarget(null),n.setClearAlpha(l),t.background=c}function a(e){let t=new ge,n=new ne(e.resolution,e.resolution);n.texture.generateMipmaps=!1;let r=new ne(e.resolution,e.resolution);r.texture.generateMipmaps=!1;let i=new qe(e.width,e.height).rotateX(Math.PI/2),a=new mt({map:n.texture,opacity:e.opacity,transparent:!0,depthWrite:e.depthWrite,color:new me(e.color??`black`)}),o=new V(i,a);t.add(o),o.scale.y=-1;let s=new V(i);s.visible=!1,t.add(s);let c=new N(-e.width/2,e.width/2,e.height/2,-e.height/2,0,.3);c.rotation.x=Math.PI/2,t.add(c);let l=new Xt,u=new Rt(hV);u.depthTest=!1;let d=new Rt(gV);return d.depthTest=!1,{renderTarget:n,renderTargetBlur:r,shadowCamera:c,depthMaterial:l,horizontalBlurMaterial:u,verticalBlurMaterial:d,shadowGroup:t,plane:o,blurPlane:s}}function o(e,t){let n=t.shadowCamera;n.left=-e.width/2,n.right=e.width/2,n.top=e.height/2,n.bottom=-e.height/2,n.far=e.far;let r=e.width*(Array.isArray(e.scale)?e.scale[0]:e.scale||1),i=e.height*(Array.isArray(e.scale)?e.scale[1]:e.scale||1);t.shadowGroup.scale.set(r,e.far,i)}function s(e,t){t.renderTarget.dispose(),t.renderTargetBlur.dispose(),t.renderTarget=new ne(e,e),t.renderTarget.texture.generateMipmaps=!1,t.renderTargetBlur=new ne(e,e),t.renderTargetBlur.texture.generateMipmaps=!1,t.plane.material.map=t.renderTarget.texture}function c(e,t){t.plane.material.color=new me(e.color??`black`),t.depthMaterial.dispose(),t.depthMaterial=new Xt,t.depthMaterial.onBeforeCompile=function(t){let n=e.tint?new me(e.tint):new me(`white`),{r,g:i,b:a}=n,o=t.fragmentShader.replace(`gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );`,`gl_FragColor = vec4( ${r}, ${i}, ${a}, ( 1.0 - fragCoordZ ) * opacity);`);t.fragmentShader=o}}let{onBeforeRender:l}=be(),u=a(n),d=0,f=()=>d=d>=n.frames?n.frames-1:d;return l(({renderer:e,scene:t,invalidate:r})=>{d[n.opacity,n.depthWrite,n.blur,n.smooth],()=>{u.plane.material.opacity=n.opacity??1,u.plane.material.depthWrite=n.depthWrite??!1,f()},{immediate:!0}),G(()=>[n.color,n.tint],()=>{c(n,u),f()},{immediate:!0}),G(()=>[n.resolution],()=>{s(n.resolution,u),f()}),G(()=>[n.width,n.height,n.scale,n.far],()=>{o(n,u),f()},{immediate:!0}),bn(()=>{for(let e of Object.values(u))e&&`dispose`in e&&typeof e.dispose==`function`&&e.dispose()}),t({instance:u.shadowGroup}),(e,t)=>(K(),nn(`primitive`,{object:H(u).shadowGroup},null,8,Aq))}}),Mq=$t({__name:`Fit`,props:{into:{default:()=>new R(new B(-.5,-.5,-.5),new B(.5,.5,.5))},precise:{type:Boolean,default:!1}},setup(e,{expose:t}){let n=e,{invalidate:r}=De(),i=W(new ge),a=W(new ge);function o(e,t){if(i.value.position.set(0,0,0),i.value.updateMatrixWorld(),a.value.scale.set(1,1,1),a.value.updateMatrixWorld(),!a.value.children.length||e===null)return;let{box3:n,use:o}=s(e,t),c=new R;a.value.children.forEach(e=>c.expandByObject(e,t));let l=c.getSize(new B),u=n.getSize(new B),d=Math.min(u.x/l.x,u.y/l.y,u.z/l.z);a.value.scale.setScalar(d===1/0?1:d),a.value.updateMatrixWorld();let f=i.value.worldToLocal(c.getCenter(new B));if(o.position){let e=i.value.worldToLocal(n.getCenter(new B));i.value.position.copy(e.sub(f.multiplyScalar(d)))}else i.value.position.copy(f.sub(f.multiplyScalar(d)));r()}function s(e,t){return typeof e==`number`?e=new B(e,e,e):Array.isArray(e)&&(e=new B(...e)),e&&`isVector3`in e&&e.isVector3?{box3:new R(new B(0,0,0),e),use:{position:!1}}:e&&`isBox3`in e&&e.isBox3?{box3:e,use:{position:!0}}:e&&`isObject3D`in e&&e.isObject3D?{box3:new R().setFromObject(e,t??!1),use:{position:!0}}:{box3:new R(new B(-.5,-.5,-.5),new B(.5,.5,.5)),use:{position:!0}}}G(()=>[n.into,n.precise],()=>o(n.into,n.precise)),Pn(()=>{o(n.into,n.precise),Qt().then(()=>{o(n.into,n.precise)})});let c=W();return t({instance:c,fit:(e=new R(new B(-.5,-.5,-.5),new B(.5,.5,.5)),t=!1)=>{o(e,t)},update:()=>o(n.into,n.precise)}),(e,t)=>(K(),nn(`TresGroup`,{ref_key:`outer`,ref:c},[xn(`TresGroup`,{ref_key:`middle`,ref:i},[xn(`TresGroup`,{ref_key:`inner`,ref:a},[Tn(e.$slots,`default`)],512)],512)],512))}}),Nq=[`side`,`cell-size`,`section-size`,`cell-color`,`section-color`,`cell-thickness`,`section-thickness`,`fade-distance`,`fade-strength`,`fade-from`,`infinite-grid`,`follow-camera`],Pq=[`args`],Fq=$t({__name:`Grid`,props:{cellSize:{default:.5},cellThickness:{default:.5},cellColor:{default:`#000000`},sectionSize:{default:1},sectionThickness:{default:1},sectionColor:{default:`#0000ff`},followCamera:{type:Boolean,default:!1},infiniteGrid:{type:Boolean,default:!1},fadeDistance:{default:100},fadeStrength:{default:1},fadeFrom:{default:1},side:{default:Ne},args:{}},setup(e){let t=e,n=NR({cellSize:.5,sectionSize:1,fadeDistance:100,fadeStrength:1,fadeFrom:1,cellThickness:.5,sectionThickness:1,cellColor:new me,sectionColor:new me,infiniteGrid:!1,followCamera:!1,worldCamProjPosition:new B,worldPlanePosition:new B},` varying vec3 localPosition; varying vec4 worldPosition; @@ -3674,9 +3674,9 @@ void main() { #include #include } - `);Te({GridMaterial:n});let r=W(new V),i=new Ft,a=new B(0,1,0),o=new B(0,0,0);return be().onBeforeRender(e=>{i.setFromNormalAndCoplanarPoint(a,o).applyMatrix4(r.value.matrixWorld);let t=r.value.material,n=t.uniforms.worldCamProjPosition,s=t.uniforms.worldPlanePosition;i.projectPoint(e.camera.position,n.value),s.value.set(0,0,0).applyMatrix4(r.value.matrixWorld)}),(e,n)=>(K(),On(`TresMesh`,{ref_key:`ref`,ref:r,"frustum-culled":!1},[jn(`TresGridMaterial`,{transparent:!0,"extensions-derivatives":!0,side:t.side,"cell-size":t.cellSize,"section-size":t.sectionSize,"cell-color":t.cellColor,"section-color":t.sectionColor,"cell-thickness":t.cellThickness,"section-thickness":t.sectionThickness,"fade-distance":t.fadeDistance,"fade-strength":t.fadeStrength,"fade-from":t.fadeFrom,"infinite-grid":t.infiniteGrid,"follow-camera":t.followCamera},null,8,Nq),jn(`TresPlaneGeometry`,{args:t.args},null,8,Pq)],512))}}),Iq=[`rotation-x`,`args`],Lq=Tn({__name:`Ocean`,props:{textureWidth:{default:512},textureHeight:{default:512},waterNormals:{default:`https://raw.githubusercontent.com/Tresjs/assets/main/textures/water-normals/Water_1_M_Normal.jpg`},sunDirection:{default:()=>new B},sunColor:{default:16777215},waterColor:{default:7695},distortionScale:{default:3.7},size:{default:1},clipBias:{default:0},alpha:{default:1},side:{default:Ct}},async setup(e,{expose:t}){let n,r,i=e,{textureWidth:a,textureHeight:o,waterNormals:s,sunDirection:c,sunColor:l,waterColor:u,distortionScale:d,size:f,clipBias:p,alpha:m,side:h}=un(i),{extend:g,scene:_}=De();g({Water:bB});let v=W(),y=W(),b=_.value.fog!==void 0;t({instance:v}),_.value.traverse(e=>{Object.prototype.hasOwnProperty.call(e,`isSky`)&&(y.value=e)}),Cn(async()=>{if(await wn(),y.value){let e=y.value.material.uniforms.sunPosition.value;v.value.material.uniforms.sunDirection.value.copy(e)}});let{normalMap:x}=([n,r]=$t(()=>xe({normalMap:s.value})),n=await n,r(),n);x.wrapS=x.wrapT=I;let{onBeforeRender:S}=be();return S(({delta:e,invalidate:t})=>{v.value.material.uniforms.time.value+=e,t()}),(e,t)=>(K(),On(`TresWater`,{ref_key:`waterRef`,ref:v,"rotation-x":-Math.PI/2,args:[void 0,{textureWidth:H(a),textureHeight:H(o),waterNormals:H(x),sunDirection:H(c),sunColor:H(l),waterColor:H(u),distortionScale:H(d),fog:b,size:H(f),clipBias:H(p),alpha:H(m),side:H(h)}]},[Qt(e.$slots,`default`,{},()=>[t[0]||=jn(`TresPlaneGeometry`,{args:[1e4,1e4]},null,-1)])],8,Iq))}}),Rq=[`size`,`color`,`alpha-map`,`map`,`opacity`,`alpha-test`,`depth-write`,`transparent`,`size-attenuation`],zq=[`position`,`velocity`],Bq=Tn({__name:`Precipitation`,props:{size:{default:.1},area:{default:()=>[10,10,20]},color:{default:16777215},map:{},alphaMap:{},alphaTest:{default:.01},opacity:{default:.8},count:{default:5e3},speed:{default:.1},randomness:{default:.5},depthWrite:{type:Boolean,default:!1},transparent:{type:Boolean,default:!0},sizeAttenuation:{type:Boolean,default:!0}},setup(e,{expose:t}){let n=e,{size:r,area:i,color:a,alphaMap:o,map:s,opacity:c,alphaTest:l,depthWrite:u,transparent:d,sizeAttenuation:f,count:p,speed:m,randomness:h}=un(n),g=W(),_=[],v=[],y=()=>{_=new Float32Array(p.value*3);for(let e=0;e{v=new Float32Array(p.value*2);for(let e=0;e{b(),y()});let x=W(null),S=W(null);Nn(async()=>{Nn(async()=>{if(typeof o.value==`string`){let e=await xe({alphaMap:o.value});x.value=e.alphaMap}else x.value=o.value??null;if(typeof s.value==`string`){let e=await xe({map:s.value});S.value=e.map}else S.value=s.value??null})});let{onBeforeRender:C}=be();C(({invalidate:e})=>{var t,n;if((t=g.value)!=null&&t.attributes.position.array&&(n=g.value)!=null&&n.attributes.position.count){let t=g.value.attributes.position.array;for(let e=0;e=i.value[0]/2)&&(t[e*3]=t[e*3]*-1),(t[e*3+1]<=-i.value[1]/2||t[e*3+1]>=i.value[1]/2)&&(t[e*3+1]=t[e*3+1]*-1)}g.value.attributes.position.needsUpdate=!0,e()}});let w=W();return t({instance:w}),(e,t)=>(K(),On(`TresPoints`,{ref_key:`pointsRef`,ref:w},[jn(`TresPointsMaterial`,{size:H(r),color:H(a),"alpha-map":x.value,map:S.value,opacity:H(c),"alpha-test":H(l),"depth-write":H(u),transparent:H(d),"size-attenuation":H(f)},null,8,Rq),jn(`TresBufferGeometry`,{ref_key:`geometryRef`,ref:g,position:[H(_),3],velocity:[H(v)]},null,8,zq)],512))}}),Vq=[`object`,`material-uniforms-turbidity-value`,`material-uniforms-rayleigh-value`,`material-uniforms-mieCoefficient-value`,`material-uniforms-mieDirectionalG-value`,`material-uniforms-sunPosition-value`,`scale`],Hq=Tn({__name:`Sky`,props:{turbidity:{default:3.4},rayleigh:{default:3},mieCoefficient:{default:.005},mieDirectionalG:{default:.7},elevation:{default:.6},azimuth:{default:180},distance:{default:45e4}},setup(e,{expose:t}){let n=e,{invalidate:r}=De();G(n,()=>r());let i=W(),a=new EB,o=_n(()=>s(n.azimuth,n.elevation));function s(e,t){let n=it.degToRad(90-t),r=it.degToRad(e);return new B().setFromSphericalCoords(1,n,r)}return t({instance:i,sunPosition:o.value}),(e,t)=>(K(),On(`primitive`,{ref_key:`skyRef`,ref:i,object:H(a),"material-uniforms-turbidity-value":n.turbidity,"material-uniforms-rayleigh-value":n.rayleigh,"material-uniforms-mieCoefficient-value":n.mieCoefficient,"material-uniforms-mieDirectionalG-value":n.mieDirectionalG,"material-uniforms-sunPosition-value":o.value,scale:n.distance},null,8,Vq))}}),Uq=[`position`],Wq=[`position`],Gq=[`scale`],Kq=[`map`,`depth-test`,`color-space`,`color`,`opacity`],qq=Tn({__name:`Smoke`,props:{color:{default:`#ffffff`},opacity:{default:.5},speed:{default:.4},width:{default:10},depth:{default:1.5},segments:{default:20},texture:{default:`https://raw.githubusercontent.com/Tresjs/assets/main/textures/clouds/defaultCloud.png`},depthTest:{type:Boolean,default:!0}},async setup(e,{expose:t}){let n,r,i=e,{width:a,depth:o,segments:s,texture:c,color:l,depthTest:u,opacity:d,speed:f}=un(i),p=W(),m=W();t({instance:p});let h=[s].map((e,t)=>({x:a.value/2-Math.random()*a.value,y:a.value/2-Math.random()*a.value,scale:.4+Math.sin((t+1)/s.value*Math.PI)*((.2+Math.random())*10),density:Math.max(.2,Math.random()),rotation:Math.max(.002,.005*Math.random())*f.value})),g=(e,t)=>e/6*t*d.value,{map:_}=([n,r]=$t(()=>xe({map:c.value})),n=await n,r(),n),{renderer:v,camera:y}=De(),b=_n(()=>{var e;return(e=v.value)?.outputColorSpace}),{onBeforeRender:x}=be();return x(({invalidate:e})=>{var t,n;p.value&&y.value&&m.value&&((t=m.value)==null||t.children.forEach((e,t)=>{e.rotation.z+=h[t].rotation}),p.value.lookAt((n=y.value)?.position),e())}),(e,t)=>(K(),On(`TresGroup`,bn({ref_key:`smokeRef`,ref:p},e.$attrs),[jn(`TresGroup`,{ref_key:`groupRef`,ref:m,position:[0,0,H(s)/2*H(o)]},[(K(!0),On(en,null,Mn(H(h),({scale:e,x:t,y:n,density:r},i)=>(K(),On(`TresMesh`,{key:`${i}`,position:[t,n,-i*H(o)]},[jn(`TresPlaneGeometry`,{scale:[e,e,e],rotation:[0,0,0]},null,8,Gq),jn(`TresMeshStandardMaterial`,{map:H(_),"depth-test":H(u),"color-space":b.value,color:H(l),"depth-write":!1,transparent:``,opacity:g(e,r)},null,8,Kq)],8,Wq))),128))],8,Uq)],16))}}),Jq=` + `);Te({GridMaterial:n});let r=W(new V),i=new Nt,a=new B(0,1,0),o=new B(0,0,0);return be().onBeforeRender(e=>{i.setFromNormalAndCoplanarPoint(a,o).applyMatrix4(r.value.matrixWorld);let t=r.value.material,n=t.uniforms.worldCamProjPosition,s=t.uniforms.worldPlanePosition;i.projectPoint(e.camera.position,n.value),s.value.set(0,0,0).applyMatrix4(r.value.matrixWorld)}),(e,n)=>(K(),nn(`TresMesh`,{ref_key:`ref`,ref:r,"frustum-culled":!1},[xn(`TresGridMaterial`,{transparent:!0,"extensions-derivatives":!0,side:t.side,"cell-size":t.cellSize,"section-size":t.sectionSize,"cell-color":t.cellColor,"section-color":t.sectionColor,"cell-thickness":t.cellThickness,"section-thickness":t.sectionThickness,"fade-distance":t.fadeDistance,"fade-strength":t.fadeStrength,"fade-from":t.fadeFrom,"infinite-grid":t.infiniteGrid,"follow-camera":t.followCamera},null,8,Nq),xn(`TresPlaneGeometry`,{args:t.args},null,8,Pq)],512))}}),Iq=[`rotation-x`,`args`],Lq=$t({__name:`Ocean`,props:{textureWidth:{default:512},textureHeight:{default:512},waterNormals:{default:`https://raw.githubusercontent.com/Tresjs/assets/main/textures/water-normals/Water_1_M_Normal.jpg`},sunDirection:{default:()=>new B},sunColor:{default:16777215},waterColor:{default:7695},distortionScale:{default:3.7},size:{default:1},clipBias:{default:0},alpha:{default:1},side:{default:xt}},async setup(e,{expose:t}){let n,r,i=e,{textureWidth:a,textureHeight:o,waterNormals:s,sunDirection:c,sunColor:l,waterColor:u,distortionScale:d,size:f,clipBias:p,alpha:m,side:h}=rn(i),{extend:g,scene:_}=De();g({Water:bB});let v=W(),y=W(),b=_.value.fog!==void 0;t({instance:v}),_.value.traverse(e=>{Object.prototype.hasOwnProperty.call(e,`isSky`)&&(y.value=e)}),Pn(async()=>{if(await Qt(),y.value){let e=y.value.material.uniforms.sunPosition.value;v.value.material.uniforms.sunDirection.value.copy(e)}});let{normalMap:x}=([n,r]=En(()=>xe({normalMap:s.value})),n=await n,r(),n);x.wrapS=x.wrapT=P;let{onBeforeRender:S}=be();return S(({delta:e,invalidate:t})=>{v.value.material.uniforms.time.value+=e,t()}),(e,t)=>(K(),nn(`TresWater`,{ref_key:`waterRef`,ref:v,"rotation-x":-Math.PI/2,args:[void 0,{textureWidth:H(a),textureHeight:H(o),waterNormals:H(x),sunDirection:H(c),sunColor:H(l),waterColor:H(u),distortionScale:H(d),fog:b,size:H(f),clipBias:H(p),alpha:H(m),side:H(h)}]},[Tn(e.$slots,`default`,{},()=>[t[0]||=xn(`TresPlaneGeometry`,{args:[1e4,1e4]},null,-1)])],8,Iq))}}),Rq=[`size`,`color`,`alpha-map`,`map`,`opacity`,`alpha-test`,`depth-write`,`transparent`,`size-attenuation`],zq=[`position`,`velocity`],Bq=$t({__name:`Precipitation`,props:{size:{default:.1},area:{default:()=>[10,10,20]},color:{default:16777215},map:{},alphaMap:{},alphaTest:{default:.01},opacity:{default:.8},count:{default:5e3},speed:{default:.1},randomness:{default:.5},depthWrite:{type:Boolean,default:!1},transparent:{type:Boolean,default:!0},sizeAttenuation:{type:Boolean,default:!0}},setup(e,{expose:t}){let n=e,{size:r,area:i,color:a,alphaMap:o,map:s,opacity:c,alphaTest:l,depthWrite:u,transparent:d,sizeAttenuation:f,count:p,speed:m,randomness:h}=rn(n),g=W(),_=[],v=[],y=()=>{_=new Float32Array(p.value*3);for(let e=0;e{v=new Float32Array(p.value*2);for(let e=0;e{b(),y()});let x=W(null),S=W(null);Cn(async()=>{Cn(async()=>{if(typeof o.value==`string`){let e=await xe({alphaMap:o.value});x.value=e.alphaMap}else x.value=o.value??null;if(typeof s.value==`string`){let e=await xe({map:s.value});S.value=e.map}else S.value=s.value??null})});let{onBeforeRender:C}=be();C(({invalidate:e})=>{var t,n;if((t=g.value)!=null&&t.attributes.position.array&&(n=g.value)!=null&&n.attributes.position.count){let t=g.value.attributes.position.array;for(let e=0;e=i.value[0]/2)&&(t[e*3]=t[e*3]*-1),(t[e*3+1]<=-i.value[1]/2||t[e*3+1]>=i.value[1]/2)&&(t[e*3+1]=t[e*3+1]*-1)}g.value.attributes.position.needsUpdate=!0,e()}});let w=W();return t({instance:w}),(e,t)=>(K(),nn(`TresPoints`,{ref_key:`pointsRef`,ref:w},[xn(`TresPointsMaterial`,{size:H(r),color:H(a),"alpha-map":x.value,map:S.value,opacity:H(c),"alpha-test":H(l),"depth-write":H(u),transparent:H(d),"size-attenuation":H(f)},null,8,Rq),xn(`TresBufferGeometry`,{ref_key:`geometryRef`,ref:g,position:[H(_),3],velocity:[H(v)]},null,8,zq)],512))}}),Vq=[`object`,`material-uniforms-turbidity-value`,`material-uniforms-rayleigh-value`,`material-uniforms-mieCoefficient-value`,`material-uniforms-mieDirectionalG-value`,`material-uniforms-sunPosition-value`,`scale`],Hq=$t({__name:`Sky`,props:{turbidity:{default:3.4},rayleigh:{default:3},mieCoefficient:{default:.005},mieDirectionalG:{default:.7},elevation:{default:.6},azimuth:{default:180},distance:{default:45e4}},setup(e,{expose:t}){let n=e,{invalidate:r}=De();G(n,()=>r());let i=W(),a=new EB,o=On(()=>s(n.azimuth,n.elevation));function s(e,t){let n=nt.degToRad(90-t),r=nt.degToRad(e);return new B().setFromSphericalCoords(1,n,r)}return t({instance:i,sunPosition:o.value}),(e,t)=>(K(),nn(`primitive`,{ref_key:`skyRef`,ref:i,object:H(a),"material-uniforms-turbidity-value":n.turbidity,"material-uniforms-rayleigh-value":n.rayleigh,"material-uniforms-mieCoefficient-value":n.mieCoefficient,"material-uniforms-mieDirectionalG-value":n.mieDirectionalG,"material-uniforms-sunPosition-value":o.value,scale:n.distance},null,8,Vq))}}),Uq=[`position`],Wq=[`position`],Gq=[`scale`],Kq=[`map`,`depth-test`,`color-space`,`color`,`opacity`],qq=$t({__name:`Smoke`,props:{color:{default:`#ffffff`},opacity:{default:.5},speed:{default:.4},width:{default:10},depth:{default:1.5},segments:{default:20},texture:{default:`https://raw.githubusercontent.com/Tresjs/assets/main/textures/clouds/defaultCloud.png`},depthTest:{type:Boolean,default:!0}},async setup(e,{expose:t}){let n,r,i=e,{width:a,depth:o,segments:s,texture:c,color:l,depthTest:u,opacity:d,speed:f}=rn(i),p=W(),m=W();t({instance:p});let h=[s].map((e,t)=>({x:a.value/2-Math.random()*a.value,y:a.value/2-Math.random()*a.value,scale:.4+Math.sin((t+1)/s.value*Math.PI)*((.2+Math.random())*10),density:Math.max(.2,Math.random()),rotation:Math.max(.002,.005*Math.random())*f.value})),g=(e,t)=>e/6*t*d.value,{map:_}=([n,r]=En(()=>xe({map:c.value})),n=await n,r(),n),{renderer:v,camera:y}=De(),b=On(()=>{var e;return(e=v.value)?.outputColorSpace}),{onBeforeRender:x}=be();return x(({invalidate:e})=>{var t,n;p.value&&y.value&&m.value&&((t=m.value)==null||t.children.forEach((e,t)=>{e.rotation.z+=h[t].rotation}),p.value.lookAt((n=y.value)?.position),e())}),(e,t)=>(K(),nn(`TresGroup`,jn({ref_key:`smokeRef`,ref:p},e.$attrs),[xn(`TresGroup`,{ref_key:`groupRef`,ref:m,position:[0,0,H(s)/2*H(o)]},[(K(!0),nn(Dn,null,Sn(H(h),({scale:e,x:t,y:n,density:r},i)=>(K(),nn(`TresMesh`,{key:`${i}`,position:[t,n,-i*H(o)]},[xn(`TresPlaneGeometry`,{scale:[e,e,e],rotation:[0,0,0]},null,8,Gq),xn(`TresMeshStandardMaterial`,{map:H(_),"depth-test":H(u),"color-space":b.value,color:H(l),"depth-write":!1,transparent:``,opacity:g(e,r)},null,8,Kq)],8,Wq))),128))],8,Uq)],16))}}),Jq=` return PCSS( shadowMap, shadowCoord ); -`,Yq=Tn({__name:`SoftShadows`,props:{size:{default:25},samples:{default:10},focus:{default:0}},setup(e){let t=e,n=({focus:e=0,size:t=25,samples:n=10}={})=>` +`,Yq=$t({__name:`SoftShadows`,props:{size:{default:25},samples:{default:10},focus:{default:0}},setup(e){let t=e,n=({focus:e=0,size:t=25,samples:n=10}={})=>` #define PENUMBRA_FILTER_SIZE float(${t}) #define RGB_NOISE_FUNCTION(uv) (randRGB(uv)) vec3 randRGB(vec2 uv) { @@ -3778,4 +3778,4 @@ float PCSS (sampler2D shadowMap, vec4 coords) { return vogelFilter(shadowMap, uv, zReceiver, 1.25 * penumbraRatio, angle); }`,r=Oe.shadowmap_pars_fragment,{renderer:i,scene:a,camera:o}=ye();function s(e,t){let i=r;i=i.replace(`#ifdef USE_SHADOWMAP`,`#ifdef USE_SHADOWMAP ${n(t)}`),i=i.replace(`#if defined( SHADOWMAP_TYPE_PCF )`,`${Jq} - #if defined( SHADOWMAP_TYPE_PCF )`),Oe.shadowmap_pars_fragment=i,e.shadowMap.enabled=!0}function c(e,t,n){t.traverse(t=>{var n,r;`material`in t&&t.material&&(e.properties.remove(t.material),typeof t.material==`object`&&`dispose`in t.material&&typeof t.material.dispose==`function`&&((r=(n=t.material).dispose)==null||r.call(n)))}),e.info.programs&&(e.info.programs.length=0),e.compile(t,n)}return An(()=>{o.value&&(Oe.shadowmap_pars_fragment=r,c(i.value,a.value,o.value))}),G(t,()=>{o.value&&(s(i.value,t),c(i.value,a.value,o.value))},{immediate:!0}),(e,t)=>(K(),On(`TresGroup`))}});var Xq=class extends _e{constructor(){super(),XL(this,`virtualScene`,null),this.virtualScene=new dt}add(...e){return this.virtualScene.add(...e),this}dispose(){this.virtualScene.traverse(e=>{e instanceof V&&(e.geometry.dispose(),e.material.dispose(),e.material.map&&e.material.map.dispose(),this.virtualScene.remove(e))}),this.virtualScene=null}};const Zq=Tn({__name:`component`,props:{background:{type:[Boolean,String],default:!1},blur:{default:0},files:{default:()=>[]},path:{default:``},preset:{default:void 0},resolution:{default:256},near:{default:1},far:{default:1e3},frames:{default:1/0},backgroundIntensity:{default:1},backgroundRotation:{},environmentIntensity:{default:1},environmentRotation:{},syncMaterials:{type:Boolean}},async setup(e,{expose:t}){let n,r,i=e,a=U(null);t({texture:a});let{extend:o,renderer:s,scene:c}=De();o({EnvironmentScene:Xq});let l=null,u=U(null),d=null,f=U(null),p=([n,r]=$t(()=>fU(i,u)),n=await n,r(),n),{onBeforeRender:m}=be(),h=1;m(()=>{if(d&&f.value&&u.value&&(i.frames===1/0||h{if(e&&t!=null&&t.virtualScene){let n=tn(t).virtualScene,r=n.children.find(e=>e instanceof V&&e.userData.isEnvironment);r||(r=new V(new ht(1,1,1),new gt({side:Fe})),r.userData.isEnvironment=!0,n.add(r)),n.background=e,n.backgroundBlurriness=i.blur}},{immediate:!0});let g=e=>{e&&l!=null&&l.length?(c.value.environment=e.texture,i.background&&(c.value.background=e.texture)):p.value&&(c.value.environment=p.value,i.background&&(c.value.background=p.value))};return G(p,()=>{u.value&&g(u.value)},{immediate:!0,deep:!0}),G(()=>yn().default,e=>{var t;if(e&&(l=e(),Array.isArray(l)&&l.length>0)){o({EnvironmentScene:Xq}),u.value=new Vt(i.resolution),u.value.texture.type=wt,d=new lt(i.near,i.far,u.value),g(u.value);return}(t=u.value)==null||t.dispose(),u.value=null,g()},{immediate:!0,deep:!0}),a.value=p.value,An(()=>{var e,t;(e=f.value)==null||e.dispose(),(t=u.value)==null||t.dispose()}),(e,t)=>u.value?(K(),On(`TresEnvironmentScene`,{key:0,ref_key:`environmentScene`,ref:f},[Qt(e.$slots,`default`)],512)):En(``,!0)}}),Qq={key:0,args:[0,1,64]},$q={key:1,args:[.5,1,64]},eJ={key:2},tJ=[`tone-mapped`,`map`,`side`,`color`],nJ=Tn({__name:`index`,props:{args:{default:null},form:{default:`rect`},toneMapped:{type:Boolean,default:!1},map:{default:null},intensity:{default:1},color:{default:new ge(16777215)}},setup(e,{expose:t}){let n=e,r=U(),i=U();return Nn(()=>{r.value&&(r.value.color.copy(new ge(n.color)),r.value.color.multiplyScalar(n.intensity),r.value.needsUpdate=!0)}),t({mesh:i}),(e,t)=>(K(),On(`TresMesh`,{ref_key:`mesh`,ref:i},[e.form===`circle`?(K(),On(`TresRingGeometry`,Qq)):e.form===`ring`?(K(),On(`TresRingGeometry`,$q)):e.form===`rect`?(K(),On(`TresPlaneGeometry`,eJ)):(K(),Pn(n.form,{key:3,args:e.args},null,8,[`args`])),jn(`TresMeshBasicMaterial`,{ref_key:`material`,ref:r,"tone-mapped":e.toneMapped,map:e.map,side:H(Ve),color:e.color},null,8,tJ)],512))}}),rJ={key:0,size:1},iJ=[`position`,`zoom`];var aJ=Tn({__name:`VRM`,props:{paused:{type:Boolean,default:!1},showAxes:{type:Boolean,default:!1}},emits:[`loadModelProgress`,`error`],setup(e,{expose:t,emit:n}){let r=e,i=n,{selectedModel:a,scale:o}=C(Fn()),s=U(.17),c=U(.5),l=U(-1),u=U();return t({setExpression:e=>{u.value?.setExpression(e)}}),(e,t)=>(K(),Pn(H(D),{relative:``},{default:Dn(({width:e,height:n})=>[xn(H(we),{alpha:!0,antialias:!0,width:e,height:n},{default:Dn(()=>[xn(H(gW),{"enable-zoom":!1}),r.showAxes?(K(),On(`TresAxesHelper`,rJ)):En(``,!0),jn(`TresPerspectiveCamera`,{position:[s.value,c.value,l.value],zoom:H(o)},null,8,iJ),t[2]||=jn(`TresDirectionalLight`,{color:16777215,intensity:1.2,position:[1,1,1]},null,-1),t[3]||=jn(`TresAmbientLight`,{color:16777215,intensity:1.5},null,-1),(K(),Pn(H(fJ),{ref_key:`modelRef`,ref:u,key:H(a),model:H(a),"idle-animation":`/assets/vrm/animations/idle_loop.vrma`,paused:r.paused,onLoadModelProgress:t[0]||=e=>i(`loadModelProgress`,e),onError:t[1]||=e=>i(`error`,e)},null,8,[`model`,`paused`]))]),_:2,__:[2,3]},1032,[`width`,`height`])]),_:1}))}}),oJ=aJ;const sJ={relative:``},cJ={"h-full":``,"w-full":``};var lJ=Tn({__name:`Stage`,props:{paused:{type:Boolean,default:!1},focusAt:{},xOffset:{},yOffset:{},scale:{default:1}},setup(t){let n=U(),r=U(),{stageView:i,stageViewControlsEnabled:a}=C(In()),{mouthOpenSize:o}=C(f()),{audioContext:s,calculateVolume:c}=d(),{onBeforeMessageComposed:l,onBeforeSend:u,onTokenLiteral:x,onTokenSpecial:S,onStreamEnd:w,onAssistantResponseEnd:T}=Rn(),E=e(),D=U(),O=U(!1),k=U(!1),A=g({handlers:[e=>new Promise(t=>{let n=s.createBufferSource();n.buffer=e.data.audioBuffer,n.connect(s.destination),n.connect(D.value),O.value=!0,n.start(0),n.onended=()=>{O.value=!1,t()}})]}),j=zn(),{ssmlEnabled:M,activeSpeechProvider:N,activeSpeechModel:ee,activeSpeechVoice:P,pitch:F}=C(j);async function I(e){try{if(!N.value){console.warn(`No active speech provider configured`);return}if(!P.value){console.warn(`No active speech voice configured`);return}let t=await E.getProviderInstance(N.value);if(!t){console.error(`Failed to initialize speech provider`);return}let n=E.getProviderConfig(N.value),r=M.value?j.generateSSML(e.data,P.value,{...n,pitch:F.value}):e.data,i=await Bn({...t.speech(ee.value,n),input:r,voice:P.value.id}),a=await s.decodeAudioData(i);await A.add({audioBuffer:a,text:e.data})}catch(e){console.error(`Speech generation failed:`,e)}}let L=g({handlers:[I]});L.on(`add`,e=>{console.debug(`ttsQueue added`,e)});let te=m(L),{currentMotion:R}=C(Ln()),ne=g({handlers:[async e=>{if(i.value===`3d`){let t=y[e.data];if(!t)return;await r.value.setExpression(t)}else i.value===`2d`&&(R.value={group:v[e.data]})}]}),z=h(ne);z.onHandlerEvent(`emotion`,e=>{console.debug(`emotion detected`,e)});let re=p();re.onHandlerEvent(`delay`,e=>{console.debug(`delay detected`,e)});function ie(){requestAnimationFrame(ie),O.value&&(o.value=c(D.value,`linear`))}function ae(){k.value||(ie(),s.resume(),k.value=!0)}function oe(){D.value||=s.createAnalyser()}return l(async()=>{oe(),ae()}),u(async()=>{R.value={group:b}}),x(async e=>{await te.add(e)}),S(async e=>{await re.add(e),await z.add(e)}),w(async()=>{await re.add(_)}),T(async e=>{}),An(()=>{k.value=!1}),Cn(async()=>{n.value=qL({connection:{bundles:Vn()}}),await n.value.execute(`CREATE TABLE memory_test (vec FLOAT[768]);`)}),(e,t)=>(K(),On(`div`,sJ,[jn(`div`,cJ,[H(i)===`2d`?(K(),Pn(vh,{key:0,"focus-at":e.focusAt,"mouth-open-size":H(o),"min-w":`50% {p.value&&p.value.scene.position.set(T.value.x,T.value.y,T.value.z)},{deep:!0}),Cn(async()=>{if(h.value)try{let e=await n(u.model,{scene:h.value,lookAt:!0,positionOffset:[x.value.x,x.value.y,x.value.z],onProgress:e=>d(`loadModelProgress`,Number((100*e.loaded/e.total).toFixed(2)))});if(!e){console.warn(`No VRM model loaded`);return}let{_vrm:r,modelCenter:o,modelSize:s}=e;S.value={x:o.x,y:o.y,z:o.z},w.value={x:s.x,y:s.y,z:s.z};function c(e){e.tracks=e.tracks.filter(e=>!e.name.endsWith(`.position`))}let l=await i(u.idleAnimation),b=await a(r,l);if(!b){console.warn(`No VRM animation loaded`);return}c(b),m.value=new st(r.scene),m.value.clipAction(b).play(),y.value=t(r),p.value=r,p.value.scene.scale.set(E.value,E.value,E.value),f=g(({delta:e})=>{m.value?.update(e),p.value?.update(e),_.update(p.value,e),v.update(p.value,e),y.value?.update(e)}).off}catch(e){d(`error`,e)}}),An(()=>{f?.(),p.value&&(p.value.scene.removeFromParent(),s.deepDispose(p.value.scene))}),c({setExpression(e){y.value?.setEmotionWithResetAfter(e,1e3)}});let{pause:D,resume:O}=be();return G(()=>u.paused,e=>{e?D():O()}),G(E,()=>{p.value&&p.value.scene.scale.set(E.value,E.value,E.value)},{immediate:!0}),(e,t)=>Qt(e.$slots,`default`)}}),fJ=dJ;export{uJ as b,oJ as c,vh as d,uh as e,lh as f,kd as g,Od as h}; \ No newline at end of file + #if defined( SHADOWMAP_TYPE_PCF )`),Oe.shadowmap_pars_fragment=i,e.shadowMap.enabled=!0}function c(e,t,n){t.traverse(t=>{var n,r;`material`in t&&t.material&&(e.properties.remove(t.material),typeof t.material==`object`&&`dispose`in t.material&&typeof t.material.dispose==`function`&&((r=(n=t.material).dispose)==null||r.call(n)))}),e.info.programs&&(e.info.programs.length=0),e.compile(t,n)}return bn(()=>{o.value&&(Oe.shadowmap_pars_fragment=r,c(i.value,a.value,o.value))}),G(t,()=>{o.value&&(s(i.value,t),c(i.value,a.value,o.value))},{immediate:!0}),(e,t)=>(K(),nn(`TresGroup`))}});var Xq=class extends he{constructor(){super(),XL(this,`virtualScene`,null),this.virtualScene=new lt}add(...e){return this.virtualScene.add(...e),this}dispose(){this.virtualScene.traverse(e=>{e instanceof V&&(e.geometry.dispose(),e.material.dispose(),e.material.map&&e.material.map.dispose(),this.virtualScene.remove(e))}),this.virtualScene=null}};const Zq=$t({__name:`component`,props:{background:{type:[Boolean,String],default:!1},blur:{default:0},files:{default:()=>[]},path:{default:``},preset:{default:void 0},resolution:{default:256},near:{default:1},far:{default:1e3},frames:{default:1/0},backgroundIntensity:{default:1},backgroundRotation:{},environmentIntensity:{default:1},environmentRotation:{},syncMaterials:{type:Boolean}},async setup(e,{expose:t}){let n,r,i=e,a=U(null);t({texture:a});let{extend:o,renderer:s,scene:c}=De();o({EnvironmentScene:Xq});let l=null,u=U(null),d=null,f=U(null),p=([n,r]=En(()=>fU(i,u)),n=await n,r(),n),{onBeforeRender:m}=be(),h=1;m(()=>{if(d&&f.value&&u.value&&(i.frames===1/0||h{if(e&&t!=null&&t.virtualScene){let n=on(t).virtualScene,r=n.children.find(e=>e instanceof V&&e.userData.isEnvironment);r||(r=new V(new pt(1,1,1),new mt({side:Ne})),r.userData.isEnvironment=!0,n.add(r)),n.background=e,n.backgroundBlurriness=i.blur}},{immediate:!0});let g=e=>{e&&l!=null&&l.length?(c.value.environment=e.texture,i.background&&(c.value.background=e.texture)):p.value&&(c.value.environment=p.value,i.background&&(c.value.background=p.value))};return G(p,()=>{u.value&&g(u.value)},{immediate:!0,deep:!0}),G(()=>An().default,e=>{var t;if(e&&(l=e(),Array.isArray(l)&&l.length>0)){o({EnvironmentScene:Xq}),u.value=new zt(i.resolution),u.value.texture.type=St,d=new st(i.near,i.far,u.value),g(u.value);return}(t=u.value)==null||t.dispose(),u.value=null,g()},{immediate:!0,deep:!0}),a.value=p.value,bn(()=>{var e,t;(e=f.value)==null||e.dispose(),(t=u.value)==null||t.dispose()}),(e,t)=>u.value?(K(),nn(`TresEnvironmentScene`,{key:0,ref_key:`environmentScene`,ref:f},[Tn(e.$slots,`default`)],512)):en(``,!0)}}),Qq={key:0,args:[0,1,64]},$q={key:1,args:[.5,1,64]},eJ={key:2},tJ=[`tone-mapped`,`map`,`side`,`color`],nJ=$t({__name:`index`,props:{args:{default:null},form:{default:`rect`},toneMapped:{type:Boolean,default:!1},map:{default:null},intensity:{default:1},color:{default:new me(16777215)}},setup(e,{expose:t}){let n=e,r=U(),i=U();return Cn(()=>{r.value&&(r.value.color.copy(new me(n.color)),r.value.color.multiplyScalar(n.intensity),r.value.needsUpdate=!0)}),t({mesh:i}),(e,t)=>(K(),nn(`TresMesh`,{ref_key:`mesh`,ref:i},[e.form===`circle`?(K(),nn(`TresRingGeometry`,Qq)):e.form===`ring`?(K(),nn(`TresRingGeometry`,$q)):e.form===`rect`?(K(),nn(`TresPlaneGeometry`,eJ)):(K(),wn(n.form,{key:3,args:e.args},null,8,[`args`])),xn(`TresMeshBasicMaterial`,{ref_key:`material`,ref:r,"tone-mapped":e.toneMapped,map:e.map,side:H(ze),color:e.color},null,8,tJ)],512))}}),rJ={key:0,size:1},iJ=[`position`,`zoom`];var aJ=$t({__name:`VRM`,props:{paused:{type:Boolean,default:!1},showAxes:{type:Boolean,default:!1}},emits:[`loadModelProgress`,`error`],setup(e,{expose:t,emit:n}){let r=e,i=n,{selectedModel:a,scale:o}=C(Fn()),s=U(.17),c=U(.5),l=U(-1),u=U();return t({setExpression:e=>{u.value?.setExpression(e)}}),(e,t)=>(K(),wn(H(E),{relative:``},{default:tn(({width:e,height:n})=>[Mn(H(we),{alpha:!0,antialias:!0,width:e,height:n},{default:tn(()=>[Mn(H(gW),{"enable-zoom":!1}),r.showAxes?(K(),nn(`TresAxesHelper`,rJ)):en(``,!0),xn(`TresPerspectiveCamera`,{position:[s.value,c.value,l.value],zoom:H(o)},null,8,iJ),t[2]||=xn(`TresDirectionalLight`,{color:16777215,intensity:1.2,position:[1,1,1]},null,-1),t[3]||=xn(`TresAmbientLight`,{color:16777215,intensity:1.5},null,-1),(K(),wn(H(fJ),{ref_key:`modelRef`,ref:u,key:H(a),model:H(a),"idle-animation":`/assets/vrm/animations/idle_loop.vrma`,paused:r.paused,onLoadModelProgress:t[0]||=e=>i(`loadModelProgress`,e),onError:t[1]||=e=>i(`error`,e)},null,8,[`model`,`paused`]))]),_:2,__:[2,3]},1032,[`width`,`height`])]),_:1}))}}),oJ=aJ;const sJ={relative:``},cJ={"h-full":``,"w-full":``};var lJ=$t({__name:`Stage`,props:{paused:{type:Boolean,default:!1},focusAt:{},xOffset:{},yOffset:{},scale:{default:1}},setup(t){let n=U(),r=U(),{stageView:i,stageViewControlsEnabled:a}=C(In()),{mouthOpenSize:o}=C(f()),{audioContext:s,calculateVolume:c}=d(),{onBeforeMessageComposed:l,onBeforeSend:u,onTokenLiteral:x,onTokenSpecial:S,onStreamEnd:w,onAssistantResponseEnd:T}=Rn(),E=e(),D=U(),O=U(!1),k=U(!1),A=g({handlers:[e=>new Promise(t=>{let n=s.createBufferSource();n.buffer=e.data.audioBuffer,n.connect(s.destination),n.connect(D.value),O.value=!0,n.start(0),n.onended=()=>{O.value=!1,t()}})]}),j=zn(),{ssmlEnabled:M,activeSpeechProvider:N,activeSpeechModel:ee,activeSpeechVoice:P,pitch:F}=C(j);async function I(e){try{if(!N.value){console.warn(`No active speech provider configured`);return}if(!P.value){console.warn(`No active speech voice configured`);return}let t=await E.getProviderInstance(N.value);if(!t){console.error(`Failed to initialize speech provider`);return}let n=E.getProviderConfig(N.value),r=M.value?j.generateSSML(e.data,P.value,{...n,pitch:F.value}):e.data,i=await Bn({...t.speech(ee.value,n),input:r,voice:P.value.id}),a=await s.decodeAudioData(i);await A.add({audioBuffer:a,text:e.data})}catch(e){console.error(`Speech generation failed:`,e)}}let L=g({handlers:[I]});L.on(`add`,e=>{console.debug(`ttsQueue added`,e)});let te=p(L),{currentMotion:R}=C(Ln()),ne=g({handlers:[async e=>{if(i.value===`3d`){let t=b[e.data];if(!t)return;await r.value.setExpression(t)}else i.value===`2d`&&(R.value={group:y[e.data]})}]}),z=m(ne);z.onHandlerEvent(`emotion`,e=>{console.debug(`emotion detected`,e)});let re=h();re.onHandlerEvent(`delay`,e=>{console.debug(`delay detected`,e)});function ie(){requestAnimationFrame(ie),O.value&&(o.value=c(D.value,`linear`))}function ae(){k.value||(ie(),s.resume(),k.value=!0)}function oe(){D.value||=s.createAnalyser()}return l(async()=>{oe(),ae()}),u(async()=>{R.value={group:v}}),x(async e=>{await te.add(e)}),S(async e=>{await re.add(e),await z.add(e)}),w(async()=>{await re.add(_)}),T(async e=>{}),bn(()=>{k.value=!1}),Pn(async()=>{n.value=qL({connection:{bundles:Vn()}}),await n.value.execute(`CREATE TABLE memory_test (vec FLOAT[768]);`)}),(e,t)=>(K(),nn(`div`,sJ,[xn(`div`,cJ,[H(i)===`2d`?(K(),wn(vh,{key:0,"focus-at":e.focusAt,"mouth-open-size":H(o),"min-w":`50% {p.value&&p.value.scene.position.set(T.value.x,T.value.y,T.value.z)},{deep:!0}),Pn(async()=>{if(h.value)try{let e=await n(u.model,{scene:h.value,lookAt:!0,positionOffset:[x.value.x,x.value.y,x.value.z],onProgress:e=>d(`loadModelProgress`,Number((100*e.loaded/e.total).toFixed(2)))});if(!e){console.warn(`No VRM model loaded`);return}let{_vrm:r,modelCenter:i,modelSize:s}=e;S.value={x:i.x,y:i.y,z:i.z},w.value={x:s.x,y:s.y,z:s.z};function c(e){e.tracks=e.tracks.filter(e=>!e.name.endsWith(`.position`))}let l=await a(u.idleAnimation),b=await o(r,l);if(!b){console.warn(`No VRM animation loaded`);return}c(b),m.value=new at(r.scene),m.value.clipAction(b).play(),y.value=t(r),p.value=r,p.value.scene.scale.set(E.value,E.value,E.value),f=g(({delta:e})=>{m.value?.update(e),p.value?.update(e),_.update(p.value,e),v.update(p.value,e),y.value?.update(e)}).off}catch(e){d(`error`,e)}}),bn(()=>{f?.(),p.value&&(p.value.scene.removeFromParent(),s.deepDispose(p.value.scene))}),c({setExpression(e){y.value?.setEmotionWithResetAfter(e,1e3)}});let{pause:D,resume:O}=be();return G(()=>u.paused,e=>{e?D():O()}),G(E,()=>{p.value&&p.value.scene.scale.set(E.value,E.value,E.value)},{immediate:!0}),(e,t)=>Tn(e.$slots,`default`)}}),fJ=dJ;export{uJ as b,oJ as c,vh as d,uh as e,lh as f,kd as g,Od as h}; \ No newline at end of file diff --git a/assets/Textarea-BFPvaePN.js b/assets/Textarea-BsLlwm-1.js similarity index 66% rename from assets/Textarea-BFPvaePN.js rename to assets/Textarea-BsLlwm-1.js index 9c0704149492ad76003ac41f3bc4f7639168ffa0..1bb97ae1b862f96fdc40324948af5ea746cc9bff 100644 --- a/assets/Textarea-BFPvaePN.js +++ b/assets/Textarea-BsLlwm-1.js @@ -1 +1 @@ -import{b as e}from"./Basic-BIq-Of0k.js";import{di as t,dm as n,dy as r,dz as i}from"./index-Bcb2irKh.js";var a=n({__name:`Textarea`,props:{modelValue:{default:``},modelModifiers:{}},emits:[`update:modelValue`],setup(n){let a=i(n,`modelValue`);return(n,i)=>(t(),r(e,{modelValue:a.value,"onUpdate:modelValue":i[0]||=e=>a.value=e,border:`focus:primary-300 dark:focus:primary-400/50 2 solid neutral-100 dark:neutral-900`,transition:`all duration-200 ease-in-out`,text:`disabled:neutral-400 dark:disabled:neutral-600`,cursor:`disabled:not-allowed`,"w-full":``,"rounded-lg":``,"px-2":``,"py-1":``,"text-sm":``,"outline-none":``,shadow:`sm`,bg:`neutral-50 dark:neutral-950 focus:neutral-50 dark:focus:neutral-900`},null,8,[`modelValue`]))}}),o=a;export{o as b}; \ No newline at end of file +import{b as e}from"./Basic-8xhCMoI8.js";import{d6 as t,di as n,dj as r,dx as i}from"./index-TXtvn0DM.js";var a=t({__name:`Textarea`,props:{modelValue:{default:``},modelModifiers:{}},emits:[`update:modelValue`],setup(t){let a=r(t,`modelValue`);return(t,r)=>(i(),n(e,{modelValue:a.value,"onUpdate:modelValue":r[0]||=e=>a.value=e,border:`focus:primary-300 dark:focus:primary-400/50 2 solid neutral-100 dark:neutral-900`,transition:`all duration-200 ease-in-out`,text:`disabled:neutral-400 dark:disabled:neutral-600`,cursor:`disabled:not-allowed`,"w-full":``,"rounded-lg":``,"px-2":``,"py-1":``,"text-sm":``,"outline-none":``,shadow:`sm`,bg:`neutral-50 dark:neutral-950 focus:neutral-50 dark:focus:neutral-900`},null,8,[`modelValue`]))}}),o=a;export{o as b}; \ No newline at end of file diff --git a/assets/_...all_-FwJQpnSo.js b/assets/_...all_-FwJQpnSo.js new file mode 100644 index 0000000000000000000000000000000000000000..a5f5209f581446e6f5df52e3b638657d4363f878 --- /dev/null +++ b/assets/_...all_-FwJQpnSo.js @@ -0,0 +1 @@ +import{aK as e,d9 as t,dx as n}from"./index-TXtvn0DM.js";const r={};function i(e,r){return n(),t(`div`,null,` 404 - Page not found `)}var a=e(r,[[`render`,i]]);export{a as default}; \ No newline at end of file diff --git a/assets/_...all_-gC8Dl7gs.js b/assets/_...all_-gC8Dl7gs.js deleted file mode 100644 index 14a8e78d9332bc4605a538f4b0197e8c19c2dfcf..0000000000000000000000000000000000000000 --- a/assets/_...all_-gC8Dl7gs.js +++ /dev/null @@ -1 +0,0 @@ -import{aK as e,di as t,dp as n}from"./index-Bcb2irKh.js";const r={};function i(e,r){return t(),n(`div`,null,` 404 - Page not found `)}var a=e(r,[[`render`,i]]);export{a as default}; \ No newline at end of file diff --git a/assets/__vite-browser-external-C1t5aXtc.js b/assets/__vite-browser-external-C1t5aXtc.js new file mode 100644 index 0000000000000000000000000000000000000000..47e3a0c7c3ea93634ee976fd25a7efa58e682d27 --- /dev/null +++ b/assets/__vite-browser-external-C1t5aXtc.js @@ -0,0 +1 @@ +import{dQ as e}from"./index-TXtvn0DM.js";var t=e((exports,t)=>{t.exports={}});export default t(); \ No newline at end of file diff --git a/assets/__vite-browser-external-hz9OYH6e.js b/assets/__vite-browser-external-hz9OYH6e.js deleted file mode 100644 index cc47839cd5d34783f34ede842368502206e278f0..0000000000000000000000000000000000000000 --- a/assets/__vite-browser-external-hz9OYH6e.js +++ /dev/null @@ -1 +0,0 @@ -import{dQ as e}from"./index-Bcb2irKh.js";var t=e((exports,t)=>{t.exports={}});export default t(); \ No newline at end of file diff --git a/assets/airi-card-B7ZfdDe0.js b/assets/airi-card-B7ZfdDe0.js deleted file mode 100644 index b668186d0e286fa4a30414b9295f4f24966bd094..0000000000000000000000000000000000000000 --- a/assets/airi-card-B7ZfdDe0.js +++ /dev/null @@ -1 +0,0 @@ -import{b as e}from"./InputFile-DaDBm_4w.js";import{a8 as t,aR as n,aj as r,an as i,d0 as a,d6 as o,d9 as s,dD as c,dI as l,dN as u,dO as ee,da as d,de as f,dg as p,dh as te,di as m,dj as h,dm as g,dn as _,do as v,dp as y,du as b,dv as ne,dy as x,x as re}from"./index-Bcb2irKh.js";import{b as S}from"./route-block-DVyt-3Cw.js";import{b as C}from"./CardCreate-DUt9F6Lp.js";import{b as w}from"./CardCreationDialog-vXdEoAe9.js";import{b as T}from"./DeleteCardDialog-CfSwu3w5.js";import{b as E}from"./CardDetailDialog-PAuW-O48.js";import{b as D}from"./CardListItem-Zshbg3UA.js";const ie={"rounded-xl":``,"p-4":``,flex:`~ col gap-4`},ae={flex:`~ row`,"flex-wrap":``,"items-center":``,"justify-between":``,"gap-4":``},oe={class:`relative min-w-[200px] flex-1`,"inline-flex":`~`,"w-full":``,"items-center":``},se=[`placeholder`],O={class:`relative flex flex-row justify-start gap-2 lg:flex-col`},k={class:`top-[-32px] whitespace-nowrap text-sm text-neutral-500 leading-10 lg:absolute dark:text-neutral-400`},A={key:0,flex:``,"flex-col":``,"items-center":``},j={"font-medium":``,text:`neutral-600 dark:neutral-300`},M={text:`neutral-500 dark:neutral-400`,"mt-2":``,"text-sm":``},N={key:1,flex:``,"flex-col":``,"items-center":``},P={"font-medium":``,text:`primary-600 dark:primary-300`},F={key:1,class:`col-span-full rounded-xl p-8 text-center`,border:`~ neutral-200/50 dark:neutral-700/30`,bg:`neutral-50/50 dark:neutral-900/50`},I={text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-15rem)]`,"bottom-0":``,"right--5":``,"z--1":``,initial:{scale:.9,opacity:0,x:20},enter:{scale:1,opacity:1,x:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``};var L=g({__name:`index`,setup(g){let{t:S}=t(),L=re(),{addCard:R,removeCard:z}=L,{cards:B,activeCardId:V}=n(L),H=l(``),U=l(!1),W=l(!1),G=l(``),K=l(`nameAsc`),q=l([]);p(q,async e=>{let t=e[0];if(t)try{let e=await t.text(),n=JSON.parse(e);H.value=R(n),U.value=!0}catch(e){console.error(`Error processing card file:`,e)}});let J=d(()=>Array.from(B.value.entries()).map(([e,t])=>({id:e,name:t.name,description:t.description}))),ce=d(()=>{if(!G.value)return J.value;let e=G.value.toLowerCase();return J.value.filter(t=>t.name.toLowerCase().includes(e)||t.description&&t.description.toLowerCase().includes(e))}),Y=d(()=>{let e=[...ce.value];return K.value===`nameAsc`?e.sort((e,t)=>e.name.localeCompare(t.name)):K.value===`nameDesc`?e.sort((e,t)=>t.name.localeCompare(e.name)):K.value===`recent`?e.sort((e,t)=>t.id.localeCompare(e.id)):e}),X=l(!1),Z=l(null);function Q(){Z.value&&(z(Z.value),Z.value=null,X.value=!1)}function le(e){Z.value=e,X.value=!0}function ue(e){H.value=e,U.value=!0}function de(){W.value=!0}function fe(e){V.value=e}function pe(e){let t=B.value.get(e);return t?.version||`1.0.0`}function $(e,t){let n=B.value.get(e);if(!n||!n.extensions?.airi?.modules)return`default`;let r=n.extensions.airi.modules;return t===`consciousness`?r.consciousness?.model&&r.consciousness.model.split(`-`).pop()||`default`:t===`voice`&&r.speech?.voice_id||`default`}return(t,n)=>{let l=te(`motion`);return m(),y(s,null,[b(`div`,ie,[b(`div`,ae,[b(`div`,oe,[n[7]||=b(`div`,{class:`pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3`},[b(`div`,{"i-solar:magnifer-line-duotone":``,class:`text-neutral-500 dark:text-neutral-400`})],-1),o(b(`input`,{"onUpdate:modelValue":n[0]||=e=>G.value=e,type:`search`,class:`w-full rounded-xl p-2.5 pl-10 text-sm outline-none`,border:`focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800`,transition:`all duration-200 ease-in-out`,bg:`white dark:neutral-900`,placeholder:c(S)(`settings.pages.card.search`)},null,8,se),[[a,G.value]])]),b(`div`,O,[b(`div`,k,u(c(S)(`settings.pages.card.sort_by`))+`: `,1),f(c(i),{modelValue:K.value,"onUpdate:modelValue":n[1]||=e=>K.value=e,options:[{value:`nameAsc`,label:c(S)(`settings.pages.card.name_asc`)},{value:`nameDesc`,label:c(S)(`settings.pages.card.name_desc`)},{value:`recent`,label:c(S)(`settings.pages.card.recent`)}],placeholder:`Select sort option`,class:`min-w-[150px]`},null,8,[`modelValue`,`options`])])]),b(`div`,{class:ee([`mt-4`,{"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4 grid-auto-rows-[minmax(min-content,max-content)] grid-auto-flow-dense sm:grid-cols-[repeat(auto-fill,minmax(240px,1fr))] sm:gap-5 md:grid-cols-[repeat(auto-fill,minmax(220px,1fr))] lg:grid-cols-[repeat(auto-fill,minmax(250px,1fr))]":c(B).size>0}])},[f(c(e),{modelValue:q.value,"onUpdate:modelValue":n[2]||=e=>q.value=e,accept:`*.json`},{default:v(({isDragging:e})=>[e?(m(),y(`div`,N,[n[9]||=b(`div`,{"i-solar:upload-minimalistic-bold":``,class:`mb-2 text-5xl text-primary-500 dark:text-primary-400`},null,-1),b(`p`,P,u(c(S)(`settings.pages.card.drop_here`)),1)])):(m(),y(`div`,A,[n[8]||=b(`div`,{"i-solar:upload-square-line-duotone":``,"mb-4":``,"text-5xl":``,text:`neutral-400 dark:neutral-500`},null,-1),b(`p`,j,u(c(S)(`settings.pages.card.upload`)),1),b(`p`,M,u(c(S)(`settings.pages.card.upload_desc`)),1)]))]),_:1},8,[`modelValue`]),f(C,{onClick:de}),c(B).size>0?(m(!0),y(s,{key:0},ne(Y.value,e=>(m(),x(D,{id:e.id,key:e.id,name:e.name,description:e.description,"is-active":e.id===c(V),"is-selected":e.id===H.value&&U.value,version:pe(e.id),"consciousness-model":$(e.id,`consciousness`),"voice-model":$(e.id,`voice`),onSelect:t=>ue(e.id),onActivate:t=>fe(e.id),onDelete:t=>le(e.id)},null,8,[`id`,`name`,`description`,`is-active`,`is-selected`,`version`,`consciousness-model`,`voice-model`,`onSelect`,`onActivate`,`onDelete`]))),128)):_(``,!0),c(B).size===0?(m(),y(`div`,F,[n[10]||=b(`div`,{"i-solar:card-search-broken":``,"mx-auto":``,"mb-3":``,"text-6xl":``,"text-neutral-400":``},null,-1),b(`p`,null,u(c(S)(`settings.pages.card.no_cards`)),1)])):_(``,!0),G.value&&Y.value.length===0?(m(),x(c(r),{key:2,type:`warning`},{title:v(()=>[h(u(c(S)(`settings.pages.card.no_results`)),1)]),content:v(()=>[h(u(c(S)(`settings.pages.card.try_different_search`)),1)]),_:1})):_(``,!0)],2)]),f(T,{modelValue:X.value,"onUpdate:modelValue":n[3]||=e=>X.value=e,"card-name":Z.value?c(L).getCard(Z.value)?.name:``,onConfirm:Q,onCancel:n[4]||=e=>Z.value=null},null,8,[`modelValue`,`card-name`]),f(E,{modelValue:U.value,"onUpdate:modelValue":n[5]||=e=>U.value=e,"card-id":H.value},null,8,[`modelValue`,`card-id`]),f(w,{modelValue:W.value,"onUpdate:modelValue":n[6]||=e=>W.value=e},null,8,[`modelValue`]),o((m(),y(`div`,I,n[11]||=[b(`div`,{text:`60`,"i-solar:emoji-funny-square-bold-duotone":``},null,-1)])),[[l]])],64)}}});typeof S==`function`&&S(L);var R=L;export{R as default}; \ No newline at end of file diff --git a/assets/airi-card-BDbpb8YI.js b/assets/airi-card-BDbpb8YI.js new file mode 100644 index 0000000000000000000000000000000000000000..29ef0331598011a2475a913152ef1590e45d3385 --- /dev/null +++ b/assets/airi-card-BDbpb8YI.js @@ -0,0 +1 @@ +import{b as e}from"./InputFile-BduVApi9.js";import{a8 as t,aR as n,aj as r,an as ee,d1 as i,d6 as a,d7 as o,d8 as s,d9 as c,dF as l,dK as u,dN as d,dO as te,de as f,df as p,di as m,dl as h,do as g,dp as _,dt as v,dv as ne,dw as re,dx as y,dy as b,x as ie}from"./index-TXtvn0DM.js";import{b as x}from"./route-block-DVyt-3Cw.js";import{b as S}from"./CardCreate-Cwl18tMa.js";import{b as C}from"./CardCreationDialog-DBoOEet-.js";import{b as w}from"./DeleteCardDialog-DeUARo5-.js";import{b as T}from"./CardDetailDialog-CTqSCcym.js";import{b as E}from"./CardListItem-B9_yTni-.js";const D={"rounded-xl":``,"p-4":``,flex:`~ col gap-4`},O={flex:`~ row`,"flex-wrap":``,"items-center":``,"justify-between":``,"gap-4":``},ae={class:`relative min-w-[200px] flex-1`,"inline-flex":`~`,"w-full":``,"items-center":``},oe=[`placeholder`],se={class:`relative flex flex-row justify-start gap-2 lg:flex-col`},k={class:`top-[-32px] whitespace-nowrap text-sm text-neutral-500 leading-10 lg:absolute dark:text-neutral-400`},A={key:0,flex:``,"flex-col":``,"items-center":``},j={"font-medium":``,text:`neutral-600 dark:neutral-300`},M={text:`neutral-500 dark:neutral-400`,"mt-2":``,"text-sm":``},N={key:1,flex:``,"flex-col":``,"items-center":``},P={"font-medium":``,text:`primary-600 dark:primary-300`},F={key:1,class:`col-span-full rounded-xl p-8 text-center`,border:`~ neutral-200/50 dark:neutral-700/30`,bg:`neutral-50/50 dark:neutral-900/50`},I={text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-15rem)]`,"bottom-0":``,"right--5":``,"z--1":``,initial:{scale:.9,opacity:0,x:20},enter:{scale:1,opacity:1,x:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``};var L=a({__name:`index`,setup(a){let{t:x}=t(),L=ie(),{addCard:R,removeCard:z}=L,{cards:B,activeCardId:V}=n(L),H=u(``),U=u(!1),W=u(!1),G=u(``),K=u(`nameAsc`),q=u([]);ne(q,async e=>{let t=e[0];if(t)try{let e=await t.text(),n=JSON.parse(e);H.value=R(n),U.value=!0}catch(e){console.error(`Error processing card file:`,e)}});let J=_(()=>Array.from(B.value.entries()).map(([e,t])=>({id:e,name:t.name,description:t.description}))),ce=_(()=>{if(!G.value)return J.value;let e=G.value.toLowerCase();return J.value.filter(t=>t.name.toLowerCase().includes(e)||t.description&&t.description.toLowerCase().includes(e))}),Y=_(()=>{let e=[...ce.value];return K.value===`nameAsc`?e.sort((e,t)=>e.name.localeCompare(t.name)):K.value===`nameDesc`?e.sort((e,t)=>t.name.localeCompare(e.name)):K.value===`recent`?e.sort((e,t)=>t.id.localeCompare(e.id)):e}),X=u(!1),Z=u(null);function Q(){Z.value&&(z(Z.value),Z.value=null,X.value=!1)}function le(e){Z.value=e,X.value=!0}function ue(e){H.value=e,U.value=!0}function de(){W.value=!0}function fe(e){V.value=e}function pe(e){let t=B.value.get(e);return t?.version||`1.0.0`}function $(e,t){let n=B.value.get(e);if(!n||!n.extensions?.airi?.modules)return`default`;let r=n.extensions.airi.modules;return t===`consciousness`?r.consciousness?.model&&r.consciousness.model.split(`-`).pop()||`default`:t===`voice`&&r.speech?.voice_id||`default`}return(t,n)=>{let a=re(`motion`);return y(),c(g,null,[f(`div`,D,[f(`div`,O,[f(`div`,ae,[n[7]||=f(`div`,{class:`pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3`},[f(`div`,{"i-solar:magnifer-line-duotone":``,class:`text-neutral-500 dark:text-neutral-400`})],-1),h(f(`input`,{"onUpdate:modelValue":n[0]||=e=>G.value=e,type:`search`,class:`w-full rounded-xl p-2.5 pl-10 text-sm outline-none`,border:`focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800`,transition:`all duration-200 ease-in-out`,bg:`white dark:neutral-900`,placeholder:l(x)(`settings.pages.card.search`)},null,8,oe),[[i,G.value]])]),f(`div`,se,[f(`div`,k,d(l(x)(`settings.pages.card.sort_by`))+`: `,1),v(l(ee),{modelValue:K.value,"onUpdate:modelValue":n[1]||=e=>K.value=e,options:[{value:`nameAsc`,label:l(x)(`settings.pages.card.name_asc`)},{value:`nameDesc`,label:l(x)(`settings.pages.card.name_desc`)},{value:`recent`,label:l(x)(`settings.pages.card.recent`)}],placeholder:`Select sort option`,class:`min-w-[150px]`},null,8,[`modelValue`,`options`])])]),f(`div`,{class:te([`mt-4`,{"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4 grid-auto-rows-[minmax(min-content,max-content)] grid-auto-flow-dense sm:grid-cols-[repeat(auto-fill,minmax(240px,1fr))] sm:gap-5 md:grid-cols-[repeat(auto-fill,minmax(220px,1fr))] lg:grid-cols-[repeat(auto-fill,minmax(250px,1fr))]":l(B).size>0}])},[v(l(e),{modelValue:q.value,"onUpdate:modelValue":n[2]||=e=>q.value=e,accept:`*.json`},{default:s(({isDragging:e})=>[e?(y(),c(`div`,N,[n[9]||=f(`div`,{"i-solar:upload-minimalistic-bold":``,class:`mb-2 text-5xl text-primary-500 dark:text-primary-400`},null,-1),f(`p`,P,d(l(x)(`settings.pages.card.drop_here`)),1)])):(y(),c(`div`,A,[n[8]||=f(`div`,{"i-solar:upload-square-line-duotone":``,"mb-4":``,"text-5xl":``,text:`neutral-400 dark:neutral-500`},null,-1),f(`p`,j,d(l(x)(`settings.pages.card.upload`)),1),f(`p`,M,d(l(x)(`settings.pages.card.upload_desc`)),1)]))]),_:1},8,[`modelValue`]),v(S,{onClick:de}),l(B).size>0?(y(!0),c(g,{key:0},p(Y.value,e=>(y(),m(E,{id:e.id,key:e.id,name:e.name,description:e.description,"is-active":e.id===l(V),"is-selected":e.id===H.value&&U.value,version:pe(e.id),"consciousness-model":$(e.id,`consciousness`),"voice-model":$(e.id,`voice`),onSelect:t=>ue(e.id),onActivate:t=>fe(e.id),onDelete:t=>le(e.id)},null,8,[`id`,`name`,`description`,`is-active`,`is-selected`,`version`,`consciousness-model`,`voice-model`,`onSelect`,`onActivate`,`onDelete`]))),128)):o(``,!0),l(B).size===0?(y(),c(`div`,F,[n[10]||=f(`div`,{"i-solar:card-search-broken":``,"mx-auto":``,"mb-3":``,"text-6xl":``,"text-neutral-400":``},null,-1),f(`p`,null,d(l(x)(`settings.pages.card.no_cards`)),1)])):o(``,!0),G.value&&Y.value.length===0?(y(),m(l(r),{key:2,type:`warning`},{title:s(()=>[b(d(l(x)(`settings.pages.card.no_results`)),1)]),content:s(()=>[b(d(l(x)(`settings.pages.card.try_different_search`)),1)]),_:1})):o(``,!0)],2)]),v(w,{modelValue:X.value,"onUpdate:modelValue":n[3]||=e=>X.value=e,"card-name":Z.value?l(L).getCard(Z.value)?.name:``,onConfirm:Q,onCancel:n[4]||=e=>Z.value=null},null,8,[`modelValue`,`card-name`]),v(T,{modelValue:U.value,"onUpdate:modelValue":n[5]||=e=>U.value=e,"card-id":H.value},null,8,[`modelValue`,`card-id`]),v(C,{modelValue:W.value,"onUpdate:modelValue":n[6]||=e=>W.value=e},null,8,[`modelValue`]),h((y(),c(`div`,I,n[11]||=[f(`div`,{text:`60`,"i-solar:emoji-funny-square-bold-duotone":``},null,-1)])),[[a]])],64)}}});typeof x==`function`&&x(L);var R=L;export{R as default}; \ No newline at end of file diff --git a/assets/alibaba-cloud-model-studio-CKp1Z1Ta.js b/assets/alibaba-cloud-model-studio-CKp1Z1Ta.js new file mode 100644 index 0000000000000000000000000000000000000000..7e597b7e97035c842e80a84fcb73220c84c77760 --- /dev/null +++ b/assets/alibaba-cloud-model-studio-CKp1Z1Ta.js @@ -0,0 +1 @@ +import{B as e,V as t,a8 as n,aR as r,at as i,d6 as a,d8 as o,dF as s,dK as c,de as l,di as u,dp as d,dt as f,dv as p,dx as m,dz as h,r as g,y as _}from"./index-TXtvn0DM.js";import{b as v}from"./route-block-DVyt-3Cw.js";const y={flex:`~ col gap-4`},b=`alibaba-cloud-model-studio`,x=`cosyvoice-v1`;var S=a({__name:`alibaba-cloud-model-studio`,setup(a){let v={speed:1},S=c(0),C=c(1),w=c(0),T=_(),E=e(),{providers:D}=r(E),{t:O}=n(),k=d(()=>!!D.value[b]?.apiKey),A=d(()=>T.availableVoices[b]||[]);async function j(e,t,n){let r=await E.getProviderInstance(b);if(!r)throw Error(`Failed to initialize speech provider`);let i=E.getProviderConfig(b),a=i.model||x;return await T.speech(r,a,e,t,{...i,...v})}return h(async()=>{let e=E.getProviderConfig(b),t=E.getProviderMetadata(b);await t.validators.validateProviderConfig(e)?await T.loadVoicesForProvider(b):console.error(`Failed to validate provider config`,e)}),p(S,async()=>{let e=E.getProviderConfig(b);e.pitch=S.value}),p(C,async()=>{let e=E.getProviderConfig(b);e.speed=C.value}),p(w,async()=>{let e=E.getProviderConfig(b);e.volume=w.value}),p(D,async()=>{let e=E.getProviderConfig(b),t=E.getProviderMetadata(b);await t.validators.validateProviderConfig(e)?await T.loadVoicesForProvider(b):console.error(`Failed to validate provider config`,e)},{immediate:!0}),(e,n)=>(m(),u(s(g),{"provider-id":b,"default-model":x,"additional-settings":v},{"voice-settings":o(()=>[l(`div`,y,[f(s(i),{modelValue:S.value,"onUpdate:modelValue":n[0]||=e=>S.value=e,label:s(O)(`settings.pages.providers.provider.common.fields.field.pitch.label`),description:s(O)(`settings.pages.providers.provider.common.fields.field.pitch.description`),min:-100,max:100,step:1,"format-value":e=>`${e}%`},null,8,[`modelValue`,`label`,`description`,`format-value`]),f(s(i),{modelValue:C.value,"onUpdate:modelValue":n[1]||=e=>C.value=e,label:s(O)(`settings.pages.providers.provider.common.fields.field.speed.label`),description:s(O)(`settings.pages.providers.provider.common.fields.field.speed.description`),min:.5,max:2,step:.01},null,8,[`modelValue`,`label`,`description`]),f(s(i),{modelValue:w.value,"onUpdate:modelValue":n[2]||=e=>w.value=e,label:s(O)(`settings.pages.providers.provider.common.fields.field.volume.label`),description:s(O)(`settings.pages.providers.provider.common.fields.field.volume.description`),min:-100,max:100,step:1,"format-value":e=>`${e}%`},null,8,[`modelValue`,`label`,`description`,`format-value`])])]),playground:o(()=>[f(s(t),{"available-voices":A.value,"generate-speech":j,"api-key-configured":k.value,"default-text":`Hello! This is a test of the ElevenLabs voice synthesis.`},null,8,[`available-voices`,`api-key-configured`])]),_:1}))}});typeof v==`function`&&v(S);var C=S;export{C as default}; \ No newline at end of file diff --git a/assets/alibaba-cloud-model-studio-DlNMnmqi.js b/assets/alibaba-cloud-model-studio-DlNMnmqi.js deleted file mode 100644 index 2e4b4d9e4dbd8997e949f7be65ed44150bc2cb63..0000000000000000000000000000000000000000 --- a/assets/alibaba-cloud-model-studio-DlNMnmqi.js +++ /dev/null @@ -1 +0,0 @@ -import{B as e,V as t,a8 as n,aR as r,at as i,dD as a,dI as o,da as s,de as c,dg as l,di as u,dk as d,dm as f,do as p,du as m,dy as h,r as g,y as _}from"./index-Bcb2irKh.js";import{b as v}from"./route-block-DVyt-3Cw.js";const y={flex:`~ col gap-4`},b=`alibaba-cloud-model-studio`,x=`cosyvoice-v1`;var S=f({__name:`alibaba-cloud-model-studio`,setup(f){let v={speed:1},S=o(0),C=o(1),w=o(0),T=_(),E=e(),{providers:D}=r(E),{t:O}=n(),k=s(()=>!!D.value[b]?.apiKey),A=s(()=>T.availableVoices[b]||[]);async function j(e,t,n){let r=await E.getProviderInstance(b);if(!r)throw Error(`Failed to initialize speech provider`);let i=E.getProviderConfig(b),a=i.model||x;return await T.speech(r,a,e,t,{...i,...v})}return d(async()=>{let e=E.getProviderConfig(b),t=E.getProviderMetadata(b);await t.validators.validateProviderConfig(e)?await T.loadVoicesForProvider(b):console.error(`Failed to validate provider config`,e)}),l(S,async()=>{let e=E.getProviderConfig(b);e.pitch=S.value}),l(C,async()=>{let e=E.getProviderConfig(b);e.speed=C.value}),l(w,async()=>{let e=E.getProviderConfig(b);e.volume=w.value}),l(D,async()=>{let e=E.getProviderConfig(b),t=E.getProviderMetadata(b);await t.validators.validateProviderConfig(e)?await T.loadVoicesForProvider(b):console.error(`Failed to validate provider config`,e)},{immediate:!0}),(e,n)=>(u(),h(a(g),{"provider-id":b,"default-model":x,"additional-settings":v},{"voice-settings":p(()=>[m(`div`,y,[c(a(i),{modelValue:S.value,"onUpdate:modelValue":n[0]||=e=>S.value=e,label:a(O)(`settings.pages.providers.provider.common.fields.field.pitch.label`),description:a(O)(`settings.pages.providers.provider.common.fields.field.pitch.description`),min:-100,max:100,step:1,"format-value":e=>`${e}%`},null,8,[`modelValue`,`label`,`description`,`format-value`]),c(a(i),{modelValue:C.value,"onUpdate:modelValue":n[1]||=e=>C.value=e,label:a(O)(`settings.pages.providers.provider.common.fields.field.speed.label`),description:a(O)(`settings.pages.providers.provider.common.fields.field.speed.description`),min:.5,max:2,step:.01},null,8,[`modelValue`,`label`,`description`]),c(a(i),{modelValue:w.value,"onUpdate:modelValue":n[2]||=e=>w.value=e,label:a(O)(`settings.pages.providers.provider.common.fields.field.volume.label`),description:a(O)(`settings.pages.providers.provider.common.fields.field.volume.description`),min:-100,max:100,step:1,"format-value":e=>`${e}%`},null,8,[`modelValue`,`label`,`description`,`format-value`])])]),playground:p(()=>[c(a(t),{"available-voices":A.value,"generate-speech":j,"api-key-configured":k.value,"default-text":`Hello! This is a test of the ElevenLabs voice synthesis.`},null,8,[`available-voices`,`api-key-configured`])]),_:1}))}});typeof v==`function`&&v(S);var C=S;export{C as default}; \ No newline at end of file diff --git a/assets/anthropic-B7BAJgzg.js b/assets/anthropic-B7BAJgzg.js deleted file mode 100644 index e907100266d1af04964a20d888996be0913bb270..0000000000000000000000000000000000000000 --- a/assets/anthropic-B7BAJgzg.js +++ /dev/null @@ -1 +0,0 @@ -import{B as e,a3 as t,a4 as n,a5 as r,a6 as i,a7 as a,a8 as o,a9 as s,aM as c,aR as l,dD as u,dN as d,da as f,de as p,dg as m,di as h,dj as g,dk as _,dm as v,do as y,du as b,dy as x}from"./index-Bcb2irKh.js";import{b as S}from"./route-block-DVyt-3Cw.js";const C={bg:`orange-50 dark:orange-900/20`,"rounded-xl":``,"p-4":``,flex:`~ col gap-3`},w={"text-xl":``,"font-semibold":``,text:`orange-700 dark:orange-500`},T={underline:``,href:`https://docs.anthropic.com/en/api/openai-sdk`},E=`anthropic`;var D=v({__name:`anthropic`,setup(v){let{t:S}=o(),D=c(),O=e(),{providers:k}=l(O),A=f(()=>O.getProviderMetadata(E)),j=f({get:()=>k.value[E]?.apiKey||``,set:e=>{k.value[E]||(k.value[E]={}),k.value[E].apiKey=e}}),M=f({get:()=>k.value[E]?.baseUrl||`https://api.anthropic.com/v1/`,set:e=>{k.value[E]||(k.value[E]={}),k.value[E].baseUrl=e}});_(()=>{k.value[E]||(k.value[E]={baseUrl:`https://api.anthropic.com/v1/`}),j.value=k.value[E]?.apiKey||``,M.value=k.value[E]?.baseUrl||`https://api.anthropic.com/v1/`}),m([j,M],()=>{k.value[E]={...k.value[E],apiKey:j.value,baseUrl:M.value||`https://api.anthropic.com/v1/`}});function N(){k.value[E]={baseUrl:`https://api.anthropic.com/v1/`}}return(e,o)=>(h(),x(u(t),{"provider-name":A.value?.localizedName||`Anthropic | Claude`,"provider-icon":A.value?.icon,"on-back":()=>u(D).back()},{default:y(()=>[b(`div`,C,[b(`h2`,w,d(u(S)(`settings.pages.providers.provider.anthropic.helpinfo.title`)),1),b(`p`,null,[g(d(u(S)(`settings.pages.providers.provider.anthropic.helpinfo.description.part1`))+` `,1),b(`a`,T,d(u(S)(`settings.pages.providers.provider.anthropic.helpinfo.description.part2`)),1),g(`, `+d(u(S)(`settings.pages.providers.provider.anthropic.helpinfo.description.part3`))+` `,1),o[2]||=b(`a`,{underline:``,href:`https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CORS`},`CORS`,-1),g(` `+d(u(S)(`settings.pages.providers.provider.anthropic.helpinfo.description.part4`)),1)]),b(`p`,null,[g(d(u(S)(`settings.pages.providers.provider.anthropic.helpinfo.description.part5`))+` `,1),o[3]||=b(`a`,{underline:``,href:`https://workers.cloudflare.com/`},`Cloudflare Workers`,-1),g(` `+d(u(S)(`settings.pages.providers.provider.anthropic.helpinfo.description.part6`)),1)])]),p(u(n),null,{default:y(()=>[p(u(r),{title:u(S)(`settings.pages.providers.common.section.basic.title`),description:u(S)(`settings.pages.providers.common.section.basic.description`),"on-reset":N},{default:y(()=>[p(u(a),{modelValue:j.value,"onUpdate:modelValue":o[0]||=e=>j.value=e,"provider-name":A.value?.localizedName||`Anthropic`,placeholder:`sk-...`},null,8,[`modelValue`,`provider-name`])]),_:1},8,[`title`,`description`]),p(u(s),{title:u(S)(`settings.pages.providers.common.section.advanced.title`)},{default:y(()=>[p(u(i),{modelValue:M.value,"onUpdate:modelValue":o[1]||=e=>M.value=e,placeholder:`https://api.anthropic.com/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`]))}});typeof S==`function`&&S(D);var O=D;export{O as default}; \ No newline at end of file diff --git a/assets/anthropic-CEBNe0YC.js b/assets/anthropic-CEBNe0YC.js new file mode 100644 index 0000000000000000000000000000000000000000..c009dd519833de4e90fded59affd853cb0a717b4 --- /dev/null +++ b/assets/anthropic-CEBNe0YC.js @@ -0,0 +1 @@ +import{B as e,a3 as t,a4 as n,a5 as r,a6 as i,a7 as a,a8 as o,a9 as s,aM as c,aR as l,d6 as u,d8 as d,dF as f,dN as p,de as m,di as h,dp as g,dt as _,dv as v,dx as y,dy as b,dz as x}from"./index-TXtvn0DM.js";import{b as S}from"./route-block-DVyt-3Cw.js";const C={bg:`orange-50 dark:orange-900/20`,"rounded-xl":``,"p-4":``,flex:`~ col gap-3`},w={"text-xl":``,"font-semibold":``,text:`orange-700 dark:orange-500`},T={underline:``,href:`https://docs.anthropic.com/en/api/openai-sdk`},E=`anthropic`;var D=u({__name:`anthropic`,setup(u){let{t:S}=o(),D=c(),O=e(),{providers:k}=l(O),A=g(()=>O.getProviderMetadata(E)),j=g({get:()=>k.value[E]?.apiKey||``,set:e=>{k.value[E]||(k.value[E]={}),k.value[E].apiKey=e}}),M=g({get:()=>k.value[E]?.baseUrl||`https://api.anthropic.com/v1/`,set:e=>{k.value[E]||(k.value[E]={}),k.value[E].baseUrl=e}});x(()=>{k.value[E]||(k.value[E]={baseUrl:`https://api.anthropic.com/v1/`}),j.value=k.value[E]?.apiKey||``,M.value=k.value[E]?.baseUrl||`https://api.anthropic.com/v1/`}),v([j,M],()=>{k.value[E]={...k.value[E],apiKey:j.value,baseUrl:M.value||`https://api.anthropic.com/v1/`}});function N(){k.value[E]={baseUrl:`https://api.anthropic.com/v1/`}}return(e,o)=>(y(),h(f(t),{"provider-name":A.value?.localizedName||`Anthropic | Claude`,"provider-icon":A.value?.icon,"on-back":()=>f(D).back()},{default:d(()=>[m(`div`,C,[m(`h2`,w,p(f(S)(`settings.pages.providers.provider.anthropic.helpinfo.title`)),1),m(`p`,null,[b(p(f(S)(`settings.pages.providers.provider.anthropic.helpinfo.description.part1`))+` `,1),m(`a`,T,p(f(S)(`settings.pages.providers.provider.anthropic.helpinfo.description.part2`)),1),b(`, `+p(f(S)(`settings.pages.providers.provider.anthropic.helpinfo.description.part3`))+` `,1),o[2]||=m(`a`,{underline:``,href:`https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CORS`},`CORS`,-1),b(` `+p(f(S)(`settings.pages.providers.provider.anthropic.helpinfo.description.part4`)),1)]),m(`p`,null,[b(p(f(S)(`settings.pages.providers.provider.anthropic.helpinfo.description.part5`))+` `,1),o[3]||=m(`a`,{underline:``,href:`https://workers.cloudflare.com/`},`Cloudflare Workers`,-1),b(` `+p(f(S)(`settings.pages.providers.provider.anthropic.helpinfo.description.part6`)),1)])]),_(f(n),null,{default:d(()=>[_(f(r),{title:f(S)(`settings.pages.providers.common.section.basic.title`),description:f(S)(`settings.pages.providers.common.section.basic.description`),"on-reset":N},{default:d(()=>[_(f(a),{modelValue:j.value,"onUpdate:modelValue":o[0]||=e=>j.value=e,"provider-name":A.value?.localizedName||`Anthropic`,placeholder:`sk-...`},null,8,[`modelValue`,`provider-name`])]),_:1},8,[`title`,`description`]),_(f(s),{title:f(S)(`settings.pages.providers.common.section.advanced.title`)},{default:d(()=>[_(f(i),{modelValue:M.value,"onUpdate:modelValue":o[1]||=e=>M.value=e,placeholder:`https://api.anthropic.com/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`]))}});typeof S==`function`&&S(D);var O=D;export{O as default}; \ No newline at end of file diff --git a/assets/appearance-DYPH8hMh.js b/assets/appearance-CF2ZynHB.js similarity index 59% rename from assets/appearance-DYPH8hMh.js rename to assets/appearance-CF2ZynHB.js index 8160c4fba739f7ecda4d3f0f82e65bc7b1bd99c7..55c049a13d7ebf1266e0a7681495c2c1441c6ba8 100644 --- a/assets/appearance-DYPH8hMh.js +++ b/assets/appearance-CF2ZynHB.js @@ -1 +1 @@ -import{a8 as e,al as t,d6 as n,d9 as r,dD as i,dP as a,da as o,dh as s,di as c,dm as l,dp as u,du as d,dv as f,dy as p}from"./index-Bcb2irKh.js";import{b as m}from"./route-block-DVyt-3Cw.js";const h={flex:`~ col gap-4`,"font-normal":``},g={flex:`~ col gap-4`},_={text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-12rem)]`,"bottom-0":``,"right--10":``,"z--1":``,initial:{scale:.9,opacity:0,rotate:180},enter:{scale:1,opacity:1,rotate:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``},v={text:`60`,"i-solar:settings-bold-duotone":``};var y=l({__name:`index`,setup(l){let{t:m}=e(),y=o(()=>[{title:m(`settings.pages.themes.general.title`),description:m(`settings.pages.themes.general.description`),icon:`i-solar:emoji-funny-square-bold-duotone`,to:`/settings/appearance/general`},{title:m(`settings.pages.themes.color-scheme.title`),description:m(`settings.pages.themes.color-scheme.description`),icon:`i-solar:pallete-2-bold-duotone`,to:`/settings/appearance/color-scheme`},{title:m(`settings.pages.themes.developer.title`),description:m(`settings.pages.themes.developer.description`),icon:`i-solar:code-bold-duotone`,to:`/settings/appearance/developer`}]);return(e,o)=>{let l=s(`motion`);return c(),u(`div`,h,[o[0]||=d(`div`,null,null,-1),d(`div`,g,[(c(!0),u(r,null,f(y.value,(e,r)=>n((c(),p(i(t),{key:e.to,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250,style:a({transitionDelay:`${r*50}ms`}),title:e.title,description:e.description,icon:e.icon,to:e.to},null,8,[`style`,`title`,`description`,`icon`,`to`])),[[l]])),128))]),n((c(),u(`div`,_,[n(d(`div`,v,null,512),[[l]])])),[[l]])])}}});typeof m==`function`&&m(y);var b=y;export{b as default}; \ No newline at end of file +import{a8 as e,al as t,d6 as n,d9 as r,dF as i,dP as a,de as o,df as s,di as c,dl as l,do as u,dp as d,dw as f,dx as p}from"./index-TXtvn0DM.js";import{b as m}from"./route-block-DVyt-3Cw.js";const h={flex:`~ col gap-4`,"font-normal":``},g={flex:`~ col gap-4`},_={text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-12rem)]`,"bottom-0":``,"right--10":``,"z--1":``,initial:{scale:.9,opacity:0,rotate:180},enter:{scale:1,opacity:1,rotate:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``},v={text:`60`,"i-solar:settings-bold-duotone":``};var y=n({__name:`index`,setup(n){let{t:m}=e(),y=d(()=>[{title:m(`settings.pages.themes.general.title`),description:m(`settings.pages.themes.general.description`),icon:`i-solar:emoji-funny-square-bold-duotone`,to:`/settings/appearance/general`},{title:m(`settings.pages.themes.color-scheme.title`),description:m(`settings.pages.themes.color-scheme.description`),icon:`i-solar:pallete-2-bold-duotone`,to:`/settings/appearance/color-scheme`},{title:m(`settings.pages.themes.developer.title`),description:m(`settings.pages.themes.developer.description`),icon:`i-solar:code-bold-duotone`,to:`/settings/appearance/developer`}]);return(e,n)=>{let d=f(`motion`);return p(),r(`div`,h,[n[0]||=o(`div`,null,null,-1),o(`div`,g,[(p(!0),r(u,null,s(y.value,(e,n)=>l((p(),c(i(t),{key:e.to,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250,style:a({transitionDelay:`${n*50}ms`}),title:e.title,description:e.description,icon:e.icon,to:e.to},null,8,[`style`,`title`,`description`,`icon`,`to`])),[[d]])),128))]),l((p(),r(`div`,_,[l(o(`div`,v,null,512),[[d]])])),[[d]])])}}});typeof m==`function`&&m(y);var b=y;export{b as default}; \ No newline at end of file diff --git a/assets/audio-XSIo9MwQ.js b/assets/audio-BBLd3epQ.js similarity index 50% rename from assets/audio-XSIo9MwQ.js rename to assets/audio-BBLd3epQ.js index ffd6e5776c9d69af3a4208a8425d9bc3de779aa5..e02eca1e3fe73b9e6a368a76640364e6b712d590 100644 --- a/assets/audio-XSIo9MwQ.js +++ b/assets/audio-BBLd3epQ.js @@ -1 +1 @@ -import{dI as e,di as t,dm as n,dp as r,du as i}from"./index-Bcb2irKh.js";var a=n({__name:`audio`,setup(n){let a=e(),o=e();function s(e){if(!e)return;let t=o.value?.files?.[0];if(!t)return;let n=document.createElement(`audio`);a.value?.appendChild(n),n.src=URL.createObjectURL(t),n.controls=!0,n.load(),n.play()}return(e,n)=>(t(),r(`div`,null,[i(`div`,null,[i(`div`,{ref_key:`containerRef`,ref:a},null,512),i(`input`,{ref_key:`fileInputRef`,ref:o,type:`file`,onChange:s},null,544)])]))}}),o=a;export{o as default}; \ No newline at end of file +import{d6 as e,d9 as t,dK as n,de as r,dx as i}from"./index-TXtvn0DM.js";var a=e({__name:`audio`,setup(e){let a=n(),o=n();function s(e){if(!e)return;let t=o.value?.files?.[0];if(!t)return;let n=document.createElement(`audio`);a.value?.appendChild(n),n.src=URL.createObjectURL(t),n.controls=!0,n.load(),n.play()}return(e,n)=>(i(),t(`div`,null,[r(`div`,null,[r(`div`,{ref_key:`containerRef`,ref:a},null,512),r(`input`,{ref_key:`fileInputRef`,ref:o,type:`file`,onChange:s},null,544)])]))}}),o=a;export{o as default}; \ No newline at end of file diff --git a/assets/audio-record-CqOfJMhf.js b/assets/audio-record-CqOfJMhf.js deleted file mode 100644 index a6d61d630ceac23ca52472b93193ed7fdd1382a9..0000000000000000000000000000000000000000 --- a/assets/audio-record-CqOfJMhf.js +++ /dev/null @@ -1 +0,0 @@ -import{aV as e,af as t,an as n,ao as r,b3 as i,b4 as a,d9 as o,dD as s,dG as c,dH as l,dI as u,dN as d,da as f,de as p,dg as m,di as h,dj as g,dk as _,dm as v,do as y,dp as b,dr as x,du as S,dv as C,dy as w}from"./index-Bcb2irKh.js";function T(){let t=e({constraints:{audio:!0},requestPermissions:!1}),n=u(t.audioInputs.value[0]?.deviceId||``),r=u(),a=f(()=>t.audioInputs.value),o=u({audio:!0}),s=i({constraints:o,autoSwitch:!0,enabled:!1});async function c(){t.permissionGranted.value||t.isSupported.value&&await t.ensurePermissions()}m(n,()=>{n.value&&(o.value={audio:{deviceId:{exact:n.value}}})},{immediate:!0}),m(t.audioInputs,()=>{r.value=a.value.find(e=>e.deviceId===n.value)},{immediate:!0}),m([t.permissionGranted,a,n],async()=>{await c(),t.permissionGranted.value&&a.value.length!==0&&(r.value||=a.value[0])},{immediate:!0});async function l(){await c(),t.permissionGranted.value&&r.value&&(s.enabled.value&&s.restart(),s.start())}function d(){s.stop()}return{selectedAudioInputId:n,selectedAudioInput:r,audioInputs:a,start:l,stop:d,request:c,media:s}}function E(e,t=()=>Promise.resolve()){let n=u(),r=l(e);async function i(){if(await t(),await a(r).toBeTruthy(),!r.value){console.error(`No media media available`);return}n.value=new MediaRecorder(r.value),n.value.start()}function o(){n.value&&(n.value.stop(),n.value.ondataavailable=e=>{let t=e.data,n=URL.createObjectURL(t),r=new Audio(n);r.play()})}return{startRecord:i,stopRecord:o}}const D={class:`mt-4 w-full flex justify-center gap-2`};var O=v({__name:`audio-record`,setup(e){let{audioInputs:i,selectedAudioInputId:a,start:l,stop:u,media:f,request:m}=T(),{startRecord:v,stopRecord:O}=E(f.stream,l);return _(()=>m()),x(()=>u()),(e,u)=>(h(),b(`div`,null,[p(s(n),{modelValue:s(a),"onUpdate:modelValue":u[0]||=e=>c(a)?a.value=e:null,onChange:u[1]||=()=>s(l)()},{default:y(({value:e})=>[S(`div`,null,d(e?s(i).find(t=>t.deviceId===e)?.label:`Select Audio Input`),1)]),options:y(({hide:e})=>[(h(!0),b(o,null,C(s(i),t=>(h(),w(s(r),{key:t.deviceId,value:t.deviceId,active:t.deviceId===s(a),onClick:t=>e()},{default:y(()=>[g(d(t.label),1)]),_:2},1032,[`value`,`active`,`onClick`]))),128))]),_:1},8,[`modelValue`]),S(`div`,D,[p(s(t),{onClick:s(v)},{default:y(()=>u[2]||=[g(` Start Recording `)]),_:1,__:[2]},8,[`onClick`]),p(s(t),{onClick:s(O)},{default:y(()=>u[3]||=[g(` Stop Recording `)]),_:1,__:[3]},8,[`onClick`])])]))}}),k=O;export{k as default}; \ No newline at end of file diff --git a/assets/audio-record-DIcCrdh3.js b/assets/audio-record-DIcCrdh3.js new file mode 100644 index 0000000000000000000000000000000000000000..fef0ff77f607a44beff167b78859dfc9c826774f --- /dev/null +++ b/assets/audio-record-DIcCrdh3.js @@ -0,0 +1 @@ +import{aY as e,af as t,an as n,ao as r,b0 as i,b8 as a,d6 as o,d8 as s,d9 as c,dF as l,dI as u,dJ as d,dK as f,dN as p,db as m,de as h,df as g,di as _,do as v,dp as y,dt as b,dv as x,dx as S,dy as C,dz as w}from"./index-TXtvn0DM.js";function T(){let t=i({constraints:{audio:!0},requestPermissions:!1}),n=f(t.audioInputs.value[0]?.deviceId||``),r=f(),a=y(()=>t.audioInputs.value),o=f({audio:!0}),s=e({constraints:o,autoSwitch:!0,enabled:!1});async function c(){t.permissionGranted.value||t.isSupported.value&&await t.ensurePermissions()}x(n,()=>{n.value&&(o.value={audio:{deviceId:{exact:n.value}}})},{immediate:!0}),x(t.audioInputs,()=>{r.value=a.value.find(e=>e.deviceId===n.value)},{immediate:!0}),x([t.permissionGranted,a,n],async()=>{await c(),t.permissionGranted.value&&a.value.length!==0&&(r.value||=a.value[0])},{immediate:!0});async function l(){await c(),t.permissionGranted.value&&r.value&&(s.enabled.value&&s.restart(),s.start())}function u(){s.stop()}return{selectedAudioInputId:n,selectedAudioInput:r,audioInputs:a,start:l,stop:u,request:c,media:s}}function E(e,t=()=>Promise.resolve()){let n=f(),r=d(e);async function i(){if(await t(),await a(r).toBeTruthy(),!r.value){console.error(`No media media available`);return}n.value=new MediaRecorder(r.value),n.value.start()}function o(){n.value&&(n.value.stop(),n.value.ondataavailable=e=>{let t=e.data,n=URL.createObjectURL(t),r=new Audio(n);r.play()})}return{startRecord:i,stopRecord:o}}const D={class:`mt-4 w-full flex justify-center gap-2`};var O=o({__name:`audio-record`,setup(e){let{audioInputs:i,selectedAudioInputId:a,start:o,stop:d,media:f,request:y}=T(),{startRecord:x,stopRecord:O}=E(f.stream,o);return w(()=>y()),m(()=>d()),(e,d)=>(S(),c(`div`,null,[b(l(n),{modelValue:l(a),"onUpdate:modelValue":d[0]||=e=>u(a)?a.value=e:null,onChange:d[1]||=()=>l(o)()},{default:s(({value:e})=>[h(`div`,null,p(e?l(i).find(t=>t.deviceId===e)?.label:`Select Audio Input`),1)]),options:s(({hide:e})=>[(S(!0),c(v,null,g(l(i),t=>(S(),_(l(r),{key:t.deviceId,value:t.deviceId,active:t.deviceId===l(a),onClick:t=>e()},{default:s(()=>[C(p(t.label),1)]),_:2},1032,[`value`,`active`,`onClick`]))),128))]),_:1},8,[`modelValue`]),h(`div`,D,[b(l(t),{onClick:l(x)},{default:s(()=>d[2]||=[C(` Start Recording `)]),_:1,__:[2]},8,[`onClick`]),b(l(t),{onClick:l(O)},{default:s(()=>d[3]||=[C(` Stop Recording `)]),_:1,__:[3]},8,[`onClick`])])]))}}),k=O;export{k as default}; \ No newline at end of file diff --git a/assets/azure-ai-foundry-DlZ-mKi2.js b/assets/azure-ai-foundry-Bkkz_TjR.js similarity index 51% rename from assets/azure-ai-foundry-DlZ-mKi2.js rename to assets/azure-ai-foundry-Bkkz_TjR.js index f9c7bdbd416a32cc943d0e5f9850f9d56767c78c..82cf11509dc5a0e439b94326cc335295881b5c38 100644 --- a/assets/azure-ai-foundry-DlZ-mKi2.js +++ b/assets/azure-ai-foundry-Bkkz_TjR.js @@ -1 +1 @@ -import{B as e,a3 as t,a4 as n,a5 as r,a7 as i,a8 as a,a9 as o,aM as s,aR as c,aa as l,dD as u,da as d,de as f,dg as p,di as m,dk as h,dm as g,do as _,dy as v}from"./index-Bcb2irKh.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b=`azure-ai-foundry`;var x=g({__name:`azure-ai-foundry`,setup(g){let{t:y}=a(),x=s(),S=e(),{providers:C}=c(S),w=d(()=>S.getProviderMetadata(b)),T=d({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=d({get:()=>C.value[b]?.resourceName||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].resourceName=e}}),D=d({get:()=>C.value[b]?.apiVersion||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiVersion=e}}),O=d({get:()=>C.value[b]?.modelId||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].modelId=e}});h(()=>{C.value[b]||(C.value[b]={}),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.resourceName||``,D.value=C.value[b]?.apiVersion||``,O.value=C.value[b]?.modelId||``}),p([T,E,D,O],()=>{C.value[b]={...C.value[b],apiKey:T.value,resourceName:E.value,apiVersion:D.value,modelId:O.value}});function k(){C.value[b]={}}return(e,a)=>(m(),v(u(t),{"provider-name":w.value?.localizedName||`Azure OpenAI`,"provider-icon":w.value?.icon,"on-back":()=>u(x).back()},{default:_(()=>[f(u(n),null,{default:_(()=>[f(u(r),{title:u(y)(`settings.pages.providers.common.section.basic.title`),description:u(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":k},{default:_(()=>[f(u(i),{modelValue:T.value,"onUpdate:modelValue":a[0]||=e=>T.value=e,"provider-name":w.value?.localizedName||`Azure OpenAI`,placeholder:`...`,required:``},null,8,[`modelValue`,`provider-name`]),f(u(l),{modelValue:E.value,"onUpdate:modelValue":a[1]||=e=>E.value=e,label:`Resouce name`,placeholder:`...`,description:`Prefix used in https://.services.ai.azure.com`,required:``},null,8,[`modelValue`]),f(u(l),{modelValue:O.value,"onUpdate:modelValue":a[2]||=e=>O.value=e,label:`Model id`,placeholder:`...`,description:`Model ID on Azure AI Foundry`,required:``},null,8,[`modelValue`])]),_:1},8,[`title`,`description`]),f(u(o),{title:u(y)(`settings.pages.providers.common.section.advanced.title`)},{default:_(()=>[f(u(l),{modelValue:D.value,"onUpdate:modelValue":a[3]||=e=>D.value=e,label:`API version`,placeholder:`e.g. 2025-04-01-preview`,description:`API version for snapshot of the models`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`]))}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file +import{B as e,a3 as t,a4 as n,a5 as r,a7 as i,a8 as a,a9 as o,aM as s,aR as c,aa as l,d6 as u,d8 as d,dF as f,di as p,dp as m,dt as h,dv as g,dx as _,dz as v}from"./index-TXtvn0DM.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b=`azure-ai-foundry`;var x=u({__name:`azure-ai-foundry`,setup(u){let{t:y}=a(),x=s(),S=e(),{providers:C}=c(S),w=m(()=>S.getProviderMetadata(b)),T=m({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=m({get:()=>C.value[b]?.resourceName||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].resourceName=e}}),D=m({get:()=>C.value[b]?.apiVersion||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiVersion=e}}),O=m({get:()=>C.value[b]?.modelId||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].modelId=e}});v(()=>{C.value[b]||(C.value[b]={}),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.resourceName||``,D.value=C.value[b]?.apiVersion||``,O.value=C.value[b]?.modelId||``}),g([T,E,D,O],()=>{C.value[b]={...C.value[b],apiKey:T.value,resourceName:E.value,apiVersion:D.value,modelId:O.value}});function k(){C.value[b]={}}return(e,a)=>(_(),p(f(t),{"provider-name":w.value?.localizedName||`Azure OpenAI`,"provider-icon":w.value?.icon,"on-back":()=>f(x).back()},{default:d(()=>[h(f(n),null,{default:d(()=>[h(f(r),{title:f(y)(`settings.pages.providers.common.section.basic.title`),description:f(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":k},{default:d(()=>[h(f(i),{modelValue:T.value,"onUpdate:modelValue":a[0]||=e=>T.value=e,"provider-name":w.value?.localizedName||`Azure OpenAI`,placeholder:`...`,required:``},null,8,[`modelValue`,`provider-name`]),h(f(l),{modelValue:E.value,"onUpdate:modelValue":a[1]||=e=>E.value=e,label:`Resouce name`,placeholder:`...`,description:`Prefix used in https://.services.ai.azure.com`,required:``},null,8,[`modelValue`]),h(f(l),{modelValue:O.value,"onUpdate:modelValue":a[2]||=e=>O.value=e,label:`Model id`,placeholder:`...`,description:`Model ID on Azure AI Foundry`,required:``},null,8,[`modelValue`])]),_:1},8,[`title`,`description`]),h(f(o),{title:f(y)(`settings.pages.providers.common.section.advanced.title`)},{default:d(()=>[h(f(l),{modelValue:D.value,"onUpdate:modelValue":a[3]||=e=>D.value=e,label:`API version`,placeholder:`e.g. 2025-04-01-preview`,description:`API version for snapshot of the models`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`]))}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file diff --git a/assets/background-remove-BIlLHheK.js b/assets/background-remove-CaMBEs_t.js similarity index 55% rename from assets/background-remove-BIlLHheK.js rename to assets/background-remove-CaMBEs_t.js index ab46e57e9a36a02f23a7fa5b68b3aa263b374d49..667fd17caac4504dbe5574daa5c5d8e4f0ccdfd4 100644 --- a/assets/background-remove-BIlLHheK.js +++ b/assets/background-remove-CaMBEs_t.js @@ -1 +1 @@ -import{b as e}from"./InputFile-DaDBm_4w.js";import{C as t,d9 as n,dD as r,dI as i,dN as a,dP as o,da as s,de as c,di as l,dk as u,dm as d,dn as f,dp as p,du as m,dv as h}from"./index-Bcb2irKh.js";import{b as g,d as _,e as v,f as y}from"./transformers.web-CQlzVquP.js";const b={flex:``,"flex-col":``,"items-center":``,"gap-4":``},x=[`disabled`],S={"h-full":``,"w-full":``,flex:``,"gap-2":``},C={w:`[50%]`,border:`2 solid neutral-200 dark:neutral-800`,bg:`neutral-50 dark:neutral-900`,"min-h":`120`,h:`auto`,"overflow-hidden":``,"rounded-lg":``},w=[`src`],T={w:`[50%]`,border:`2 solid neutral-200 dark:neutral-800`,bg:`neutral-50 dark:neutral-900`,"min-h":`120`,h:`auto`,relative:``,"overflow-hidden":``,"rounded-lg":``},E={key:0,bg:`black/50`,absolute:``,"inset-0":``,"z-10":``,flex:``,"flex-col":``,"items-center":``,"justify-center":``},D={"mb-4":``,"text-white":``,"font-medium":``},O={bg:`gray-200/30`,w:`70%`,"h-2":``,"overflow-hidden":``,"rounded-full":``},k=[`src`],A={bg:`black/0 group-hover:black/20`,absolute:``,"inset-0":``,flex:``,"items-center":``,"justify-center":``,"transition-all":``,"duration-200":``},j=[`onClick`],M={key:1,absolute:``,"bottom-2":``,"right-2":``};var N=d({__name:`background-remove`,setup(d){let N=i(),P=i(),F=i(),I=i(),L=i(!1),R=i(0),z=i(),B=i(),V=i([]),H=s(()=>V.value.map(e=>URL.createObjectURL(e)));u(async()=>{try{if(!(await t()).supported)throw Error(`WebGPU is not supported in this browser.`);let e=`Xenova/modnet`;_.backends.onnx.wasm.proxy=!1,N.value??=await y.from_pretrained(e,{device:`webgpu`}),P.value??=await v.from_pretrained(e,{})}catch(e){F.value=e}I.value=!1});async function U(){if(!N.value||!P.value)return;L.value=!0,R.value=0,z.value=[];let e=H.value.length;for(let t=0;t=z.value.length||!V.value[e])return;let t=V.value[e].name,n=t.substring(0,t.lastIndexOf(`.`))||t,r=t.substring(t.lastIndexOf(`.`))||`.png`,i=`${n}-background-removed${r}`,a=document.createElement(`a`);a.href=z.value[e],a.download=i,document.body.appendChild(a),a.click(),document.body.removeChild(a)}function G(){!z.value||z.value.length===0||z.value.forEach((e,t)=>{setTimeout(()=>W(t),t*100)})}return(t,i)=>(l(),p(`div`,b,[m(`button`,{bg:`neutral-100 dark:neutral-800`,"w-full":``,"cursor-pointer":``,"rounded-lg":``,"px-3":``,"py-2":``,disabled:L.value,onClick:U},a(L.value?`Processing...`:`Process`),9,x),m(`div`,S,[m(`div`,C,[(l(!0),p(n,null,h(H.value,(e,t)=>(l(),p(`img`,{key:t,src:e,"h-full":``,"w-full":``,"object-cover":``},null,8,w))),128))]),m(`div`,T,[L.value?(l(),p(`div`,E,[m(`div`,D,a(R.value)+`% `,1),m(`div`,O,[m(`div`,{bg:`emerald-500`,"h-full":``,style:o({width:`${R.value}%`}),"transition-all":``,"duration-200":``},null,4)])])):f(``,!0),(l(!0),p(n,null,h(z.value,(e,t)=>(l(),p(`div`,{key:t,relative:``,class:`group`,"h-full":``,"w-full":``},[m(`img`,{src:e,"h-full":``,"w-full":``,"object-cover":``},null,8,k),m(`div`,A,[m(`button`,{bg:`emerald-500 hover:emerald-600`,"rounded-full":``,"p-2":``,"text-white":``,"opacity-0":``,"transition-all":``,"duration-200":``,"group-hover:opacity-100":``,onClick:e=>W(t)},i[1]||=[m(`svg`,{xmlns:`http://www.w3.org/2000/svg`,class:`h-5 w-5`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`},[m(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4`})],-1)],8,j)])]))),128)),z.value&&z.value.length>1?(l(),p(`div`,M,[m(`button`,{bg:`emerald-500 hover:emerald-600`,"rounded-full":``,"p-2":``,"text-white":``,onClick:G},i[2]||=[m(`svg`,{xmlns:`http://www.w3.org/2000/svg`,class:`h-5 w-5`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`},[m(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12`})],-1)])])):f(``,!0)])]),c(r(e),{modelValue:V.value,"onUpdate:modelValue":i[0]||=e=>V.value=e,"w-full":``},null,8,[`modelValue`])]))}}),P=N;export{P as default}; \ No newline at end of file +import{b as e}from"./InputFile-BduVApi9.js";import{C as t,d6 as n,d7 as r,d9 as i,dF as a,dK as o,dN as s,dP as c,de as l,df as u,do as d,dp as f,dt as p,dx as m,dz as h}from"./index-TXtvn0DM.js";import{b as g,c as _,d as v,f as y}from"./transformers.web-7B3It45j.js";const b={flex:``,"flex-col":``,"items-center":``,"gap-4":``},x=[`disabled`],S={"h-full":``,"w-full":``,flex:``,"gap-2":``},C={w:`[50%]`,border:`2 solid neutral-200 dark:neutral-800`,bg:`neutral-50 dark:neutral-900`,"min-h":`120`,h:`auto`,"overflow-hidden":``,"rounded-lg":``},w=[`src`],T={w:`[50%]`,border:`2 solid neutral-200 dark:neutral-800`,bg:`neutral-50 dark:neutral-900`,"min-h":`120`,h:`auto`,relative:``,"overflow-hidden":``,"rounded-lg":``},E={key:0,bg:`black/50`,absolute:``,"inset-0":``,"z-10":``,flex:``,"flex-col":``,"items-center":``,"justify-center":``},D={"mb-4":``,"text-white":``,"font-medium":``},O={bg:`gray-200/30`,w:`70%`,"h-2":``,"overflow-hidden":``,"rounded-full":``},k=[`src`],A={bg:`black/0 group-hover:black/20`,absolute:``,"inset-0":``,flex:``,"items-center":``,"justify-center":``,"transition-all":``,"duration-200":``},j=[`onClick`],M={key:1,absolute:``,"bottom-2":``,"right-2":``};var N=n({__name:`background-remove`,setup(n){let N=o(),P=o(),F=o(),I=o(),L=o(!1),R=o(0),z=o(),B=o(),V=o([]),H=f(()=>V.value.map(e=>URL.createObjectURL(e)));h(async()=>{try{if(!(await t()).supported)throw Error(`WebGPU is not supported in this browser.`);let e=`Xenova/modnet`;y.backends.onnx.wasm.proxy=!1,N.value??=await _.from_pretrained(e,{device:`webgpu`}),P.value??=await g.from_pretrained(e,{})}catch(e){F.value=e}I.value=!1});async function U(){if(!N.value||!P.value)return;L.value=!0,R.value=0,z.value=[];let e=H.value.length;for(let t=0;t=z.value.length||!V.value[e])return;let t=V.value[e].name,n=t.substring(0,t.lastIndexOf(`.`))||t,r=t.substring(t.lastIndexOf(`.`))||`.png`,i=`${n}-background-removed${r}`,a=document.createElement(`a`);a.href=z.value[e],a.download=i,document.body.appendChild(a),a.click(),document.body.removeChild(a)}function G(){!z.value||z.value.length===0||z.value.forEach((e,t)=>{setTimeout(()=>W(t),t*100)})}return(t,n)=>(m(),i(`div`,b,[l(`button`,{bg:`neutral-100 dark:neutral-800`,"w-full":``,"cursor-pointer":``,"rounded-lg":``,"px-3":``,"py-2":``,disabled:L.value,onClick:U},s(L.value?`Processing...`:`Process`),9,x),l(`div`,S,[l(`div`,C,[(m(!0),i(d,null,u(H.value,(e,t)=>(m(),i(`img`,{key:t,src:e,"h-full":``,"w-full":``,"object-cover":``},null,8,w))),128))]),l(`div`,T,[L.value?(m(),i(`div`,E,[l(`div`,D,s(R.value)+`% `,1),l(`div`,O,[l(`div`,{bg:`emerald-500`,"h-full":``,style:c({width:`${R.value}%`}),"transition-all":``,"duration-200":``},null,4)])])):r(``,!0),(m(!0),i(d,null,u(z.value,(e,t)=>(m(),i(`div`,{key:t,relative:``,class:`group`,"h-full":``,"w-full":``},[l(`img`,{src:e,"h-full":``,"w-full":``,"object-cover":``},null,8,k),l(`div`,A,[l(`button`,{bg:`emerald-500 hover:emerald-600`,"rounded-full":``,"p-2":``,"text-white":``,"opacity-0":``,"transition-all":``,"duration-200":``,"group-hover:opacity-100":``,onClick:e=>W(t)},n[1]||=[l(`svg`,{xmlns:`http://www.w3.org/2000/svg`,class:`h-5 w-5`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`},[l(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4`})],-1)],8,j)])]))),128)),z.value&&z.value.length>1?(m(),i(`div`,M,[l(`button`,{bg:`emerald-500 hover:emerald-600`,"rounded-full":``,"p-2":``,"text-white":``,onClick:G},n[2]||=[l(`svg`,{xmlns:`http://www.w3.org/2000/svg`,class:`h-5 w-5`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`},[l(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12`})],-1)])])):r(``,!0)])]),p(a(e),{modelValue:V.value,"onUpdate:modelValue":n[0]||=e=>V.value=e,"w-full":``},null,8,[`modelValue`])]))}}),P=N;export{P as default}; \ No newline at end of file diff --git a/assets/chat-mNT9qYfI.js b/assets/chat-DXU-idBw.js similarity index 84% rename from assets/chat-mNT9qYfI.js rename to assets/chat-DXU-idBw.js index 15ebdcdaf0b43798a9b73936a2cb71d736806e4c..0c368d74334fe30cf351c884330f1c18dbba4cd3 100644 --- a/assets/chat-mNT9qYfI.js +++ b/assets/chat-DXU-idBw.js @@ -1,3 +1,3 @@ -import{G as e,b0 as t,d0 as n,d6 as r,d9 as i,dA as a,dD as o,dG as s,dI as c,dN as l,di as u,dm as d,dn as f,dp as p,du as m,dv as h}from"./index-Bcb2irKh.js";const g=()=>{let e=null;return{getStore:()=>(e===null&&console.warn("Woops! Looks like you are calling `getContext` after `await fn()`. Please move `getContext` to top level of handler."),e),run(t,n){e=t;try{return n()}finally{e=null}}}},_=new WeakMap,v=new WeakMap;let y=0,b=0;const x=e=>{let t=`${y++}`,n={debugLabel:e?.debugLabel??t,include:e=>r.has(e),with:i=>{let a=`${b++}`,o={[Symbol.toStringTag]:e?.debugLabel??`WorkflowEvent(${t}.${a})`,toString:()=>e?.debugLabel?e.debugLabel:`WorkflowEvent(${t}.${a})`,toJSON:()=>({type:e?.debugLabel?e.debugLabel:t,data:i}),get data(){return i}};return r.add(o),v.set(o,n),o}},r=new WeakSet;_.set(n,r),Object.defineProperty(n,Symbol.toStringTag,{get:()=>n?.debugLabel??`WorkflowEvent<${t}>`}),Object.defineProperty(n,`displayName`,{value:n?.debugLabel??`WorkflowEvent<${t}>`});let i=e?.uniqueId;return Object.defineProperty(n,`uniqueId`,{get:()=>(i||=t,i),set:()=>{throw Error(`uniqueId is readonly`)}}),n.toString=()=>e?.debugLabel??`WorkflowEvent<${t}>`,n},S=e=>typeof e==`object`&&e?_.has(e):!1,C=e=>typeof e==`object`&&e?v.get(e):void 0,w=e=>typeof e==`object`&&!!e&&`data`in e,T=e=>e!=null&&typeof e.then==`function`;function E(e,t){let n=Array(e.length);for(let r of t)for(let t=0;t(e.add(t),()=>{e.delete(t)}),publish:(...t)=>{let n=[];for(let r of e)n.push(r(...t));return n}};return D.set(t,e),t}var A=class extends TransformStream{constructor(){super({transform:(e,t)=>{C(e)&&t.enqueue(JSON.stringify({data:e.data,uniqueId:C(e).uniqueId})+` +import{G as e,aV as t,d1 as n,d6 as r,d7 as i,d9 as a,dC as o,dF as s,dI as c,dK as l,dN as u,de as d,df as f,dl as p,do as m,dx as h}from"./index-TXtvn0DM.js";const g=()=>{let e=null;return{getStore:()=>(e===null&&console.warn("Woops! Looks like you are calling `getContext` after `await fn()`. Please move `getContext` to top level of handler."),e),run(t,n){e=t;try{return n()}finally{e=null}}}},_=new WeakMap,v=new WeakMap;let y=0,b=0;const x=e=>{let t=`${y++}`,n={debugLabel:e?.debugLabel??t,include:e=>r.has(e),with:i=>{let a=`${b++}`,o={[Symbol.toStringTag]:e?.debugLabel??`WorkflowEvent(${t}.${a})`,toString:()=>e?.debugLabel?e.debugLabel:`WorkflowEvent(${t}.${a})`,toJSON:()=>({type:e?.debugLabel?e.debugLabel:t,data:i}),get data(){return i}};return r.add(o),v.set(o,n),o}},r=new WeakSet;_.set(n,r),Object.defineProperty(n,Symbol.toStringTag,{get:()=>n?.debugLabel??`WorkflowEvent<${t}>`}),Object.defineProperty(n,`displayName`,{value:n?.debugLabel??`WorkflowEvent<${t}>`});let i=e?.uniqueId;return Object.defineProperty(n,`uniqueId`,{get:()=>(i||=t,i),set:()=>{throw Error(`uniqueId is readonly`)}}),n.toString=()=>e?.debugLabel??`WorkflowEvent<${t}>`,n},S=e=>typeof e==`object`&&e?_.has(e):!1,C=e=>typeof e==`object`&&e?v.get(e):void 0,w=e=>typeof e==`object`&&!!e&&`data`in e,T=e=>e!=null&&typeof e.then==`function`;function E(e,t){let n=Array(e.length);for(let r of t)for(let t=0;t(e.add(t),()=>{e.delete(t)}),publish:(...t)=>{let n=[];for(let r of e)n.push(r(...t));return n}};return D.set(t,e),t}var A=class extends TransformStream{constructor(){super({transform:(e,t)=>{C(e)&&t.enqueue(JSON.stringify({data:e.data,uniqueId:C(e).uniqueId})+` `)}})}},j=class extends TransformStream{#eventMap;constructor(e){super({transform:(e,t)=>{let n=e.split(` -`).map(e=>e.trim()).filter(e=>e.length>0);n.forEach(e=>{let n=JSON.parse(e),r=Object.values(this.#eventMap).find(e=>e.uniqueId===n.uniqueId);if(r){let e=r.with(n.data);t.enqueue(e)}else console.warn(`Unknown event: ${n.uniqueId}`)})}}),this.#eventMap=e}},M=class e extends ReadableStream{#stream;#subscribable;on(e,t){return this.#subscribable.subscribe(n=>{e.include(n)&&t(n)})}constructor(e,t){if(!e&&!t)throw TypeError(`Either subscribable or root stream must be provided`);if(super(),e){this.#subscribable=e;let n;this.#stream=t??new ReadableStream({start:t=>{n=e.subscribe(e=>{t.enqueue(e)})},cancel:()=>{n()}})}else{this.#subscribable=k(),this.#stream=t.pipeThrough(new TransformStream({transform:(e,t)=>{this.#subscribable.publish(e),t.enqueue(e)}}));return}}static fromReadableStream(t){return new e(null,t.pipeThrough(new TransformStream({transform:(e,t)=>{t.enqueue(e)}})))}static fromResponse(t,n){let r=t.body;if(!r)throw Error(`Response body is not readable`);return new e(null,r.pipeThrough(new TextDecoderStream).pipeThrough(new j(n)))}toResponse(e,t=new A){return new Response(this.#stream.pipeThrough(t).pipeThrough(new TextEncoderStream),e)}get locked(){return this.#stream.locked}[Symbol.asyncIterator](){return this.#stream[Symbol.asyncIterator]()}cancel(e){return this.#stream.cancel(e)}getReader(){return this.#stream.getReader()}pipeThrough(t,n){let r=this.#stream.pipeThrough(t,n);return new e(null,r)}pipeTo(e,t){return this.#stream.pipeTo(e,t)}tee(){let[t,n]=this.#stream.tee();return[new e(this.#subscribable,t),new e(this.#subscribable,n)]}forEach(e){return this.#stream.pipeTo(new WritableStream({write:t=>{e(t)}}))}map(e){return this.pipeThrough(new TransformStream({transform:(t,n)=>{n.enqueue(e(t))}}))}values(e){return this.#stream.values(e)}take(e){let t=0;return this.pipeThrough(new TransformStream({transform:(n,r)=>{t=e&&r.terminate()}}))}filter(e){return this.pipeThrough(new TransformStream({transform:(t,n)=>{(typeof e==`function`?e(t):S(e)?e.include(t):e===t)&&n.enqueue(t)}}))}until(e){return this.pipeThrough(new TransformStream({transform:(t,n)=>{n.enqueue(t),(typeof e==`function`?e(t):S(e)?e.include(t):e===t)&&n.terminate()}}))}async toArray(){let e=[];return await this.pipeTo(new WritableStream({write:t=>{e.push(t)}})),e}};const N=g();function P(){let e=N.getStore();if(!e)throw Error(`No current context found`);return e}const F=g(),I=new WeakMap,L=({listeners:e})=>{let t=[],n=(e,t,n,r)=>{let c,l={get abortController(){return c||=new AbortController,c},async:`constructor`in e?e.constructor.name===`AsyncFunction`:!1,pending:null,handler:e,inputEvents:t,inputs:n,outputs:[],prev:r,next:new Set,get root(){return o}};l.prev.next.add(l);let u=i(l);F.run(l,()=>{let e=[...new Set([...O(s.__internal__call_context),...O(u.__internal__call_context)])];N.run(u,()=>{let t=0,n=r=>{if(t===e.length){let e;try{e=r.handler(...r.inputs)}catch(e){if(c??a)(c??a).abort(e);else throw console.error(`unhandled error in handler`,e),e}T(e)?(l.async=!0,l.pending=e.then(e=>(w(e)&&u.sendEvent(e),e))):w(e)&&u.sendEvent(e)}let i=e[t];i&&(t++,i(r,n))};n(l)})})},r=r=>{let i=[...t];[...e].filter(([e])=>{let t=E(e,i);return t.length===e.length}).map(([e,a])=>{let o=E(e,i);o.forEach(e=>{t.splice(t.indexOf(e),1)});for(let t of a)n(t,e,o,r)})},i=e=>{let n=null;return{get stream(){if(!n){let t=k();s.__internal__call_send_event.subscribe(n=>{let r=I.get(n);for(;r;){if(r===e){t.publish(n);break}r=r.prev}}),n=new M(t,null)}return n},get signal(){return e.abortController.signal},sendEvent:(...n)=>{n.forEach(n=>{I.set(n,e),e.outputs.push(n),t.push(n),s.__internal__call_send_event.publish(n,e),r(e)})},__internal__call_context:k(),__internal__call_send_event:k()}},a=new AbortController,o={get abortController(){return a||=new AbortController,a},async:!1,pending:null,inputEvents:[],inputs:[],outputs:[],handler:null,prev:null,next:new Set,get root(){return o}},s=i(o);return s},R=()=>{let e={steps:new Map};return{handle:(t,n)=>{if(e.steps.has(t)){let r=e.steps.get(t);r.add(n)}else{let r=new Set;r.add(n),e.steps.set(t,r)}},createContext(){return L({listeners:e.steps})}}};function z(e,t){let n=(...e)=>{let n=t.filter(([t])=>t.every((t,n)=>t.include(e[n]))).map(([e,t])=>t),r=P(),i=r.sendEvent;return(...e)=>{for(let t=0;tt.include(e[n])))return i(...e)}return console.warn(`Invalid input detected [%s]`,e.map(e=>e.data).join(`, `)),i(...e)}};return{...e,strictHandle:(t,n)=>{let r=(...e)=>{let t=P();return n(t.safeSendEvent,...e)};return e.handle(t,r)},createContext(){let t=e.createContext();return t.__internal__call_context.subscribe((e,t)=>{P().safeSendEvent=n(...e.inputs),t(e)}),t}}}async function B(e,t,n){let{stream:r,sendEvent:i}=e.createContext();i(t);let a=(await r.until(n).toArray()).at(-1);if(!a)throw Error(`No output event received`);return a}const V={flex:``,"flex-col":``,"gap-2":``},H={flex:`~ col`,"gap-2":``},U={flex:``,"flex-col":``,"gap-2":``},W={grid:``,"grid-cols-2":``,"gap-2":``},G={flex:``,"items-center":``,"gap-2":``},K={flex:``,"items-center":``,"gap-2":``},q={flex:``,"items-center":``,"gap-2":``},J={key:0},Y={key:1};var X=d({__name:`chat`,setup(d){let g=t(`settings/llm/baseUrl`,`https://openrouter.ai/api/v1/`),_=t(`settings/llm/apiKey`,``),v=t(`settings/llm/model`,`openai/gpt-4o-mini`),y=c(``),b=c([]),S=c({role:`assistant`,content:``}),C=c(!1),w=x(),T=x(),E=x(),D=x(),O=x();async function k(){C.value=!0;try{let t=z(R(),[[[w],[T,O]],[[T],[E]],[[E],[D]]]);t.handle([w],async()=>{let{sendEvent:n}=t.createContext();S.value={role:`assistant`,content:``},b.value.push({role:`user`,content:y.value}),b.value.push(S.value);let r=await e({baseURL:g.value,apiKey:_.value,model:v.value,messages:b.value.slice(0,b.value.length-1).map(e=>a(e))});for await(let e of r.chunkStream)n(T.with(e.choices[0].delta.content||``));return O.with()}),t.handle([T],async e=>{S.value.content?S.value.content+=e.data:S.value.content=e.data}),await B(t,w.with(),O)}catch(e){console.error(e)}finally{C.value=!1}}return(e,t)=>(u(),p(`div`,V,[m(`div`,H,[m(`div`,U,[t[7]||=m(`div`,null,[m(`span`,{"text-neutral-500":``,"dark:text-neutral-400":``},`LLM`)],-1),m(`div`,W,[m(`label`,G,[t[4]||=m(`span`,{"text-nowrap":``},` Base URL `,-1),r(m(`input`,{"onUpdate:modelValue":t[0]||=e=>s(g)?g.value=e:null,border:`focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800`,transition:`all duration-200 ease-in-out`,text:`disabled:neutral-400 dark:disabled:neutral-600`,cursor:`disabled:not-allowed`,"w-full":``,"rounded-lg":``,"px-2":``,"py-1":``,"text-nowrap":``,"text-sm":``,"outline-none":``,shadow:`sm`,bg:`neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900`},null,512),[[n,o(g)]])]),m(`label`,K,[t[5]||=m(`span`,{"text-nowrap":``},` API Key `,-1),r(m(`input`,{"onUpdate:modelValue":t[1]||=e=>s(_)?_.value=e:null,type:`password`,border:`focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800`,transition:`all duration-200 ease-in-out`,text:`disabled:neutral-400 dark:disabled:neutral-600`,cursor:`disabled:not-allowed`,"w-full":``,"rounded-lg":``,"px-2":``,"py-1":``,"text-nowrap":``,"text-sm":``,"outline-none":``,shadow:`sm`,bg:`neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900`},null,512),[[n,o(_)]])]),m(`label`,q,[t[6]||=m(`span`,{"text-nowrap":``},` Model `,-1),r(m(`input`,{"onUpdate:modelValue":t[2]||=e=>s(v)?v.value=e:null,border:`focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800`,transition:`all duration-200 ease-in-out`,text:`disabled:neutral-400 dark:disabled:neutral-600`,cursor:`disabled:not-allowed`,"w-full":``,"rounded-lg":``,"px-2":``,"py-1":``,"text-nowrap":``,"text-sm":``,"outline-none":``,shadow:`sm`,bg:`neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900`},null,512),[[n,o(v)]])])])]),m(`div`,null,[r(m(`textarea`,{"onUpdate:modelValue":t[3]||=e=>y.value=e,border:`focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800`,transition:`all duration-200 ease-in-out`,text:`disabled:neutral-400 dark:disabled:neutral-600`,cursor:`disabled:not-allowed`,"w-full":``,"rounded-lg":``,"px-2":``,"py-1":``,"text-nowrap":``,"text-sm":``,"outline-none":``,shadow:`sm`,bg:`neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900`},null,512),[[n,y.value]])]),m(`button`,{"rounded-lg":``,bg:`blue-100 dark:blue-900`,"px-4":``,"py-2":``,onClick:k},` Send `),m(`div`,null,[(u(!0),p(i,null,h(b.value,(e,t)=>(u(),p(`div`,{key:t},[e.role===`user`?(u(),p(`div`,J,[m(`span`,null,l(e.content),1)])):f(``,!0),e.role===`assistant`?(u(),p(`div`,Y,[m(`span`,null,l(e.content),1)])):f(``,!0)]))),128))])])]))}}),Z=X;export{Z as default}; \ No newline at end of file +`).map(e=>e.trim()).filter(e=>e.length>0);n.forEach(e=>{let n=JSON.parse(e),r=Object.values(this.#eventMap).find(e=>e.uniqueId===n.uniqueId);if(r){let e=r.with(n.data);t.enqueue(e)}else console.warn(`Unknown event: ${n.uniqueId}`)})}}),this.#eventMap=e}},M=class e extends ReadableStream{#stream;#subscribable;on(e,t){return this.#subscribable.subscribe(n=>{e.include(n)&&t(n)})}constructor(e,t){if(!e&&!t)throw TypeError(`Either subscribable or root stream must be provided`);if(super(),e){this.#subscribable=e;let n;this.#stream=t??new ReadableStream({start:t=>{n=e.subscribe(e=>{t.enqueue(e)})},cancel:()=>{n()}})}else{this.#subscribable=k(),this.#stream=t.pipeThrough(new TransformStream({transform:(e,t)=>{this.#subscribable.publish(e),t.enqueue(e)}}));return}}static fromReadableStream(t){return new e(null,t.pipeThrough(new TransformStream({transform:(e,t)=>{t.enqueue(e)}})))}static fromResponse(t,n){let r=t.body;if(!r)throw Error(`Response body is not readable`);return new e(null,r.pipeThrough(new TextDecoderStream).pipeThrough(new j(n)))}toResponse(e,t=new A){return new Response(this.#stream.pipeThrough(t).pipeThrough(new TextEncoderStream),e)}get locked(){return this.#stream.locked}[Symbol.asyncIterator](){return this.#stream[Symbol.asyncIterator]()}cancel(e){return this.#stream.cancel(e)}getReader(){return this.#stream.getReader()}pipeThrough(t,n){let r=this.#stream.pipeThrough(t,n);return new e(null,r)}pipeTo(e,t){return this.#stream.pipeTo(e,t)}tee(){let[t,n]=this.#stream.tee();return[new e(this.#subscribable,t),new e(this.#subscribable,n)]}forEach(e){return this.#stream.pipeTo(new WritableStream({write:t=>{e(t)}}))}map(e){return this.pipeThrough(new TransformStream({transform:(t,n)=>{n.enqueue(e(t))}}))}values(e){return this.#stream.values(e)}take(e){let t=0;return this.pipeThrough(new TransformStream({transform:(n,r)=>{t=e&&r.terminate()}}))}filter(e){return this.pipeThrough(new TransformStream({transform:(t,n)=>{(typeof e==`function`?e(t):S(e)?e.include(t):e===t)&&n.enqueue(t)}}))}until(e){return this.pipeThrough(new TransformStream({transform:(t,n)=>{n.enqueue(t),(typeof e==`function`?e(t):S(e)?e.include(t):e===t)&&n.terminate()}}))}async toArray(){let e=[];return await this.pipeTo(new WritableStream({write:t=>{e.push(t)}})),e}};const N=g();function P(){let e=N.getStore();if(!e)throw Error(`No current context found`);return e}const F=g(),I=new WeakMap,L=({listeners:e})=>{let t=[],n=(e,t,n,r)=>{let c,l={get abortController(){return c||=new AbortController,c},async:`constructor`in e?e.constructor.name===`AsyncFunction`:!1,pending:null,handler:e,inputEvents:t,inputs:n,outputs:[],prev:r,next:new Set,get root(){return o}};l.prev.next.add(l);let u=i(l);F.run(l,()=>{let e=[...new Set([...O(s.__internal__call_context),...O(u.__internal__call_context)])];N.run(u,()=>{let t=0,n=r=>{if(t===e.length){let e;try{e=r.handler(...r.inputs)}catch(e){if(c??a)(c??a).abort(e);else throw console.error(`unhandled error in handler`,e),e}T(e)?(l.async=!0,l.pending=e.then(e=>(w(e)&&u.sendEvent(e),e))):w(e)&&u.sendEvent(e)}let i=e[t];i&&(t++,i(r,n))};n(l)})})},r=r=>{let i=[...t];[...e].filter(([e])=>{let t=E(e,i);return t.length===e.length}).map(([e,a])=>{let o=E(e,i);o.forEach(e=>{t.splice(t.indexOf(e),1)});for(let t of a)n(t,e,o,r)})},i=e=>{let n=null;return{get stream(){if(!n){let t=k();s.__internal__call_send_event.subscribe(n=>{let r=I.get(n);for(;r;){if(r===e){t.publish(n);break}r=r.prev}}),n=new M(t,null)}return n},get signal(){return e.abortController.signal},sendEvent:(...n)=>{n.forEach(n=>{I.set(n,e),e.outputs.push(n),t.push(n),s.__internal__call_send_event.publish(n,e),r(e)})},__internal__call_context:k(),__internal__call_send_event:k()}},a=new AbortController,o={get abortController(){return a||=new AbortController,a},async:!1,pending:null,inputEvents:[],inputs:[],outputs:[],handler:null,prev:null,next:new Set,get root(){return o}},s=i(o);return s},R=()=>{let e={steps:new Map};return{handle:(t,n)=>{if(e.steps.has(t)){let r=e.steps.get(t);r.add(n)}else{let r=new Set;r.add(n),e.steps.set(t,r)}},createContext(){return L({listeners:e.steps})}}};function z(e,t){let n=(...e)=>{let n=t.filter(([t])=>t.every((t,n)=>t.include(e[n]))).map(([e,t])=>t),r=P(),i=r.sendEvent;return(...e)=>{for(let t=0;tt.include(e[n])))return i(...e)}return console.warn(`Invalid input detected [%s]`,e.map(e=>e.data).join(`, `)),i(...e)}};return{...e,strictHandle:(t,n)=>{let r=(...e)=>{let t=P();return n(t.safeSendEvent,...e)};return e.handle(t,r)},createContext(){let t=e.createContext();return t.__internal__call_context.subscribe((e,t)=>{P().safeSendEvent=n(...e.inputs),t(e)}),t}}}async function B(e,t,n){let{stream:r,sendEvent:i}=e.createContext();i(t);let a=(await r.until(n).toArray()).at(-1);if(!a)throw Error(`No output event received`);return a}const V={flex:``,"flex-col":``,"gap-2":``},H={flex:`~ col`,"gap-2":``},U={flex:``,"flex-col":``,"gap-2":``},W={grid:``,"grid-cols-2":``,"gap-2":``},G={flex:``,"items-center":``,"gap-2":``},K={flex:``,"items-center":``,"gap-2":``},q={flex:``,"items-center":``,"gap-2":``},J={key:0},Y={key:1};var X=r({__name:`chat`,setup(r){let g=t(`settings/llm/baseUrl`,`https://openrouter.ai/api/v1/`),_=t(`settings/llm/apiKey`,``),v=t(`settings/llm/model`,`openai/gpt-4o-mini`),y=l(``),b=l([]),S=l({role:`assistant`,content:``}),C=l(!1),w=x(),T=x(),E=x(),D=x(),O=x();async function k(){C.value=!0;try{let t=z(R(),[[[w],[T,O]],[[T],[E]],[[E],[D]]]);t.handle([w],async()=>{let{sendEvent:n}=t.createContext();S.value={role:`assistant`,content:``},b.value.push({role:`user`,content:y.value}),b.value.push(S.value);let r=await e({baseURL:g.value,apiKey:_.value,model:v.value,messages:b.value.slice(0,b.value.length-1).map(e=>o(e))});for await(let e of r.chunkStream)n(T.with(e.choices[0].delta.content||``));return O.with()}),t.handle([T],async e=>{S.value.content?S.value.content+=e.data:S.value.content=e.data}),await B(t,w.with(),O)}catch(e){console.error(e)}finally{C.value=!1}}return(e,t)=>(h(),a(`div`,V,[d(`div`,H,[d(`div`,U,[t[7]||=d(`div`,null,[d(`span`,{"text-neutral-500":``,"dark:text-neutral-400":``},`LLM`)],-1),d(`div`,W,[d(`label`,G,[t[4]||=d(`span`,{"text-nowrap":``},` Base URL `,-1),p(d(`input`,{"onUpdate:modelValue":t[0]||=e=>c(g)?g.value=e:null,border:`focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800`,transition:`all duration-200 ease-in-out`,text:`disabled:neutral-400 dark:disabled:neutral-600`,cursor:`disabled:not-allowed`,"w-full":``,"rounded-lg":``,"px-2":``,"py-1":``,"text-nowrap":``,"text-sm":``,"outline-none":``,shadow:`sm`,bg:`neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900`},null,512),[[n,s(g)]])]),d(`label`,K,[t[5]||=d(`span`,{"text-nowrap":``},` API Key `,-1),p(d(`input`,{"onUpdate:modelValue":t[1]||=e=>c(_)?_.value=e:null,type:`password`,border:`focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800`,transition:`all duration-200 ease-in-out`,text:`disabled:neutral-400 dark:disabled:neutral-600`,cursor:`disabled:not-allowed`,"w-full":``,"rounded-lg":``,"px-2":``,"py-1":``,"text-nowrap":``,"text-sm":``,"outline-none":``,shadow:`sm`,bg:`neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900`},null,512),[[n,s(_)]])]),d(`label`,q,[t[6]||=d(`span`,{"text-nowrap":``},` Model `,-1),p(d(`input`,{"onUpdate:modelValue":t[2]||=e=>c(v)?v.value=e:null,border:`focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800`,transition:`all duration-200 ease-in-out`,text:`disabled:neutral-400 dark:disabled:neutral-600`,cursor:`disabled:not-allowed`,"w-full":``,"rounded-lg":``,"px-2":``,"py-1":``,"text-nowrap":``,"text-sm":``,"outline-none":``,shadow:`sm`,bg:`neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900`},null,512),[[n,s(v)]])])])]),d(`div`,null,[p(d(`textarea`,{"onUpdate:modelValue":t[3]||=e=>y.value=e,border:`focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800`,transition:`all duration-200 ease-in-out`,text:`disabled:neutral-400 dark:disabled:neutral-600`,cursor:`disabled:not-allowed`,"w-full":``,"rounded-lg":``,"px-2":``,"py-1":``,"text-nowrap":``,"text-sm":``,"outline-none":``,shadow:`sm`,bg:`neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900`},null,512),[[n,y.value]])]),d(`button`,{"rounded-lg":``,bg:`blue-100 dark:blue-900`,"px-4":``,"py-2":``,onClick:k},` Send `),d(`div`,null,[(h(!0),a(m,null,f(b.value,(e,t)=>(h(),a(`div`,{key:t},[e.role===`user`?(h(),a(`div`,J,[d(`span`,null,u(e.content),1)])):i(``,!0),e.role===`assistant`?(h(),a(`div`,Y,[d(`span`,null,u(e.content),1)])):i(``,!0)]))),128))])])]))}}),Z=X;export{Z as default}; \ No newline at end of file diff --git a/assets/cloudflare-workers-ai-CoptsH2G.js b/assets/cloudflare-workers-ai-CoptsH2G.js deleted file mode 100644 index 5884086d18adfdeefb3ce4b109fceb92fb2664ce..0000000000000000000000000000000000000000 --- a/assets/cloudflare-workers-ai-CoptsH2G.js +++ /dev/null @@ -1 +0,0 @@ -import{B as e,a3 as t,a4 as n,a5 as r,a7 as i,a8 as a,aM as o,aR as s,aa as c,dD as l,da as u,de as d,dg as f,di as p,dk as m,dm as h,do as g,dy as _}from"./index-Bcb2irKh.js";import{b as v}from"./route-block-DVyt-3Cw.js";const y=`cloudflare-workers-ai`;var b=h({__name:`cloudflare-workers-ai`,setup(h){let{t:v}=a(),b=o(),x=e(),{providers:S}=s(x),C=u(()=>x.getProviderMetadata(y)),w=u({get:()=>S.value[y]?.apiKey||``,set:e=>{S.value[y]||(S.value[y]={}),S.value[y].apiKey=e}}),T=u({get:()=>S.value[y]?.accountId||``,set:e=>{S.value[y]||(S.value[y]={}),S.value[y].accountId=e}});m(()=>{x.initializeProvider(y),w.value=S.value[y]?.apiKey||``,T.value=S.value[y]?.accountId||``}),f([w,T],()=>{S.value[y]={...S.value[y],apiKey:w.value,accountId:T.value}});function E(){S.value[y]={...C.value?.defaultOptions}}return(e,a)=>(p(),_(l(t),{"provider-name":C.value?.localizedName,"provider-icon-color":C.value?.iconColor,"on-back":()=>l(b).back()},{default:g(()=>[d(l(n),null,{default:g(()=>[d(l(r),{title:l(v)(`settings.pages.providers.common.section.basic.title`),description:l(v)(`settings.pages.providers.common.section.basic.description`),"on-reset":E},{default:g(()=>[d(l(i),{modelValue:w.value,"onUpdate:modelValue":a[0]||=e=>w.value=e,"provider-name":C.value?.localizedName,placeholder:l(v)(`settings.pages.providers.provider.cloudflare-workers-ai.fields.field.api-key.placeholder`)},null,8,[`modelValue`,`provider-name`,`placeholder`]),d(l(c),{modelValue:T.value,"onUpdate:modelValue":a[1]||=e=>T.value=e,label:l(v)(`settings.pages.providers.provider.cloudflare-workers-ai.fields.field.account-id.label`),description:l(v)(`settings.pages.providers.provider.cloudflare-workers-ai.fields.field.account-id.description`),placeholder:l(v)(`settings.pages.providers.provider.cloudflare-workers-ai.fields.field.account-id.placeholder`)},null,8,[`modelValue`,`label`,`description`,`placeholder`])]),_:1},8,[`title`,`description`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon-color`,`on-back`]))}});typeof v==`function`&&v(b);var x=b;export{x as default}; \ No newline at end of file diff --git a/assets/cloudflare-workers-ai-Di_IJhvu.js b/assets/cloudflare-workers-ai-Di_IJhvu.js new file mode 100644 index 0000000000000000000000000000000000000000..32931bb5cb45ce1d0a7463dd2bf535e459d011f6 --- /dev/null +++ b/assets/cloudflare-workers-ai-Di_IJhvu.js @@ -0,0 +1 @@ +import{B as e,a3 as t,a4 as n,a5 as r,a7 as i,a8 as a,aM as o,aR as s,aa as c,d6 as l,d8 as u,dF as d,di as f,dp as p,dt as m,dv as h,dx as g,dz as _}from"./index-TXtvn0DM.js";import{b as v}from"./route-block-DVyt-3Cw.js";const y=`cloudflare-workers-ai`;var b=l({__name:`cloudflare-workers-ai`,setup(l){let{t:v}=a(),b=o(),x=e(),{providers:S}=s(x),C=p(()=>x.getProviderMetadata(y)),w=p({get:()=>S.value[y]?.apiKey||``,set:e=>{S.value[y]||(S.value[y]={}),S.value[y].apiKey=e}}),T=p({get:()=>S.value[y]?.accountId||``,set:e=>{S.value[y]||(S.value[y]={}),S.value[y].accountId=e}});_(()=>{x.initializeProvider(y),w.value=S.value[y]?.apiKey||``,T.value=S.value[y]?.accountId||``}),h([w,T],()=>{S.value[y]={...S.value[y],apiKey:w.value,accountId:T.value}});function E(){S.value[y]={...C.value?.defaultOptions}}return(e,a)=>(g(),f(d(t),{"provider-name":C.value?.localizedName,"provider-icon-color":C.value?.iconColor,"on-back":()=>d(b).back()},{default:u(()=>[m(d(n),null,{default:u(()=>[m(d(r),{title:d(v)(`settings.pages.providers.common.section.basic.title`),description:d(v)(`settings.pages.providers.common.section.basic.description`),"on-reset":E},{default:u(()=>[m(d(i),{modelValue:w.value,"onUpdate:modelValue":a[0]||=e=>w.value=e,"provider-name":C.value?.localizedName,placeholder:d(v)(`settings.pages.providers.provider.cloudflare-workers-ai.fields.field.api-key.placeholder`)},null,8,[`modelValue`,`provider-name`,`placeholder`]),m(d(c),{modelValue:T.value,"onUpdate:modelValue":a[1]||=e=>T.value=e,label:d(v)(`settings.pages.providers.provider.cloudflare-workers-ai.fields.field.account-id.label`),description:d(v)(`settings.pages.providers.provider.cloudflare-workers-ai.fields.field.account-id.description`),placeholder:d(v)(`settings.pages.providers.provider.cloudflare-workers-ai.fields.field.account-id.placeholder`)},null,8,[`modelValue`,`label`,`description`,`placeholder`])]),_:1},8,[`title`,`description`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon-color`,`on-back`]))}});typeof v==`function`&&v(b);var x=b;export{x as default}; \ No newline at end of file diff --git a/assets/color-scheme-B8QUMGKo.js b/assets/color-scheme-B8QUMGKo.js deleted file mode 100644 index 5bfb5685f731b5bac868cfa989e9390b498bbcbb..0000000000000000000000000000000000000000 --- a/assets/color-scheme-B8QUMGKo.js +++ /dev/null @@ -1 +0,0 @@ -import{a8 as e,aK as t,am as n,aq as r,b as i,d4 as a,d6 as o,d9 as s,dD as c,dN as l,de as u,dh as d,di as f,dj as p,dm as m,do as h,dp as g,du as _,dv as v,dy as y,t as b}from"./index-Bcb2irKh.js";import{b as x}from"./route-block-DVyt-3Cw.js";var S=[[],[`#A5978B`,`#D8CAAF`,`#B8B4A7`,`#C4BCB1`,`#E5DED8`,`#9A8F7D`,`#BEB5A7`,`#C9C0B6`],[`#7A9EAF`,`#B8C7CC`,`#D4B79C`,`#8B9D77`,`#C7D5CB`,`#E6D0B1`,`#94A7B1`,`#B4C8C3`],[`#D9B48F`,`#B5917A`,`#8C7A6B`,`#A17F5F`,`#B98C46`,`#C7A252`,`#DAB300`,`#D19826`],[`#9BA7B0`,`#C1CBD4`,`#A5ADB6`,`#8B959E`,`#D4DCE4`,`#7F8A94`,`#B3BCC6`,`#98A4AE`],[`#E4C6D0`,`#A61B29`,`#5D513C`,`#789262`,`#1C0D1A`,`#F7C242`,`#62A9DD`,`#8C4B3C`]];const C={flex:``,"items-center":``,"justify-between":``,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:300,delay:5*50,transition:`all ease-in-out duration-250`},w={"text-lg":``,"font-normal":``},T={relative:``,flex:``,"cursor-pointer":``,"items-center":``,"gap-2":``},E={class:`color-bar`,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:320,delay:7*50,transition:`all ease-in-out duration-250`},D={"text-white":``,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:330,delay:8*50,transition:`all ease-in-out duration-250`},O={class:`color-bar transparency-grid`,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:340,delay:9*50,transition:`all ease-in-out duration-250`},k=[`duration`,`delay`],A={"font-medium":``},j={text:`sm neutral-500`},M={text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[65dvh]`,"right--15":``,"z--1":``,initial:{scale:.9,opacity:0,rotate:30},enter:{scale:1,opacity:1,rotate:0},duration:250,flex:``,"items-center":``,"justify-center":``};var N=m({__name:`color-scheme`,setup(t){let m=b(),{t:x}=e();return(e,t)=>{let b=d(`motion`);return f(),g(s,null,[o((f(),y(c(n),{"mb-2":``,title:c(x)(`settings.pages.themes.sections.section.custom-color.title`),icon:`i-solar:pallete-2-bold-duotone`,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:290,delay:4*50,transition:`all ease-in-out duration-250`},{default:h(()=>[o((f(),g(`div`,C,[_(`span`,w,l(e.$t(`settings.pages.themes.sections.section.custom-color.fields.field.primary-color.label`)),1),_(`label`,T,[o(_(`input`,{"onUpdate:modelValue":t[0]||=e=>c(m).themeColorsHueDynamic=e,type:`checkbox`,class:`peer sr-only`},null,512),[[a,c(m).themeColorsHueDynamic]]),t[2]||=_(`div`,{class:`h-6 w-11 rounded-full bg-neutral-200 after:absolute after:left-[2px] after:top-[2px] after:h-5 after:w-5 after:rounded-full after:bg-white dark:bg-neutral-600 peer-checked:bg-primary-500 after:transition-all after:content-[''] peer-checked:after:translate-x-full peer-checked:after:border-white`},null,-1),p(` `+l(e.$t(`settings.pages.themes.sections.section.custom-color.fields.field.primary-color.rgb-on.title`)),1)])])),[[b]]),o(u(c(r),{modelValue:c(m).themeColorsHue,"onUpdate:modelValue":t[1]||=e=>c(m).themeColorsHue=e,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:310,delay:6*50,disabled:c(m).themeColorsHueDynamic},null,8,[`modelValue`,`disabled`]),[[b]]),o((f(),g(`div`,E,[t[4]||=_(`span`,{"bg-primary-50":``},`50`,-1),t[5]||=_(`span`,{"bg-primary-100":``},`100`,-1),t[6]||=_(`span`,{"bg-primary-200":``},`200`,-1),t[7]||=_(`span`,{"bg-primary-300":``},`300`,-1),t[8]||=_(`span`,{"bg-primary-400":``},`400`,-1),t[9]||=_(`span`,{"bg-primary-500":``},`500`,-1),o((f(),g(`div`,D,t[3]||=[_(`span`,{"bg-primary-600":``},`600`,-1),_(`span`,{"bg-primary-700":``},`700`,-1),_(`span`,{"bg-primary-800":``},`800`,-1),_(`span`,{"bg-primary-900":``},`900`,-1),_(`span`,{"bg-primary-950":``},`950`,-1)])),[[b]])])),[[b]]),o((f(),g(`div`,O,t[10]||=[_(`span`,{bg:`primary-500/5`},`500/5`,-1),_(`span`,{bg:`primary-500/10`},`500/10`,-1),_(`span`,{bg:`primary-500/20`},`500/20`,-1),_(`span`,{bg:`primary-500/30`},`500/30`,-1),_(`span`,{bg:`primary-500/40`},`500/40`,-1),_(`span`,{bg:`primary-500/50`},`500/50`,-1),_(`span`,{bg:`primary-500/60`},`500/60`,-1),_(`span`,{bg:`primary-500/70`},`500/70`,-1),_(`span`,{bg:`primary-500/80`},`500/80`,-1),_(`span`,{bg:`primary-500/90`},`500/90`,-1),_(`span`,{bg:`primary-500`},`500`,-1)])),[[b]])]),_:1},8,[`title`])),[[b]]),o((f(),y(c(n),{"mb-2":``,title:c(x)(`settings.pages.themes.sections.section.theme-presets.title`),icon:`i-solar:magic-stick-2-bold-duotone`,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:350,delay:10*50,transition:`all ease-in-out duration-250`},{default:h(()=>[(f(!0),g(s,null,v(e.$tm(`settings.pages.themes.sections.section.theme-presets.presets`),({title:t,description:n,colors:r},a)=>o((f(),g(`div`,{key:a,class:`w-full flex items-center justify-between rounded-lg px-4 py-3 outline-none transition-all duration-250 ease-in-out`,bg:`neutral-100 dark:neutral-800`,hover:`bg-neutral-200 dark:bg-neutral-700`,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:360+a*10,delay:11*50+a*50,transition:`all ease-in-out duration-250`},[_(`div`,null,[_(`span`,A,l(e.$rt(t)),1),_(`div`,j,l(e.$rt(n)),1)]),u(c(i),{colors:r.map((t,n)=>({hex:c(S)[a][n],name:e.$rt(t)}))},null,8,[`colors`])],8,k)),[[b]])),128))]),_:1},8,[`title`])),[[b]]),o((f(),g(`div`,M,t[11]||=[_(`div`,{text:`60`,"i-solar:pallete-2-bold-duotone":``},null,-1)])),[[b]])],64)}}});typeof x==`function`&&x(N);var P=t(N,[[`__scopeId`,`data-v-190d7273`]]);export{P as default}; \ No newline at end of file diff --git a/assets/color-scheme-DVge0MdZ.js b/assets/color-scheme-DVge0MdZ.js new file mode 100644 index 0000000000000000000000000000000000000000..a5fa16b0754412aaf27886583d79c4e5bab0f23d --- /dev/null +++ b/assets/color-scheme-DVge0MdZ.js @@ -0,0 +1 @@ +import{a8 as e,aK as t,am as n,aq as r,b as i,c_ as a,d6 as o,d8 as s,d9 as c,dF as l,dN as u,de as d,df as f,di as p,dl as m,do as h,dt as g,dw as _,dx as v,dy as y,t as b}from"./index-TXtvn0DM.js";import{b as x}from"./route-block-DVyt-3Cw.js";var S=[[],[`#A5978B`,`#D8CAAF`,`#B8B4A7`,`#C4BCB1`,`#E5DED8`,`#9A8F7D`,`#BEB5A7`,`#C9C0B6`],[`#7A9EAF`,`#B8C7CC`,`#D4B79C`,`#8B9D77`,`#C7D5CB`,`#E6D0B1`,`#94A7B1`,`#B4C8C3`],[`#D9B48F`,`#B5917A`,`#8C7A6B`,`#A17F5F`,`#B98C46`,`#C7A252`,`#DAB300`,`#D19826`],[`#9BA7B0`,`#C1CBD4`,`#A5ADB6`,`#8B959E`,`#D4DCE4`,`#7F8A94`,`#B3BCC6`,`#98A4AE`],[`#E4C6D0`,`#A61B29`,`#5D513C`,`#789262`,`#1C0D1A`,`#F7C242`,`#62A9DD`,`#8C4B3C`]];const C={flex:``,"items-center":``,"justify-between":``,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:300,delay:5*50,transition:`all ease-in-out duration-250`},w={"text-lg":``,"font-normal":``},T={relative:``,flex:``,"cursor-pointer":``,"items-center":``,"gap-2":``},E={class:`color-bar`,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:320,delay:7*50,transition:`all ease-in-out duration-250`},D={"text-white":``,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:330,delay:8*50,transition:`all ease-in-out duration-250`},O={class:`color-bar transparency-grid`,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:340,delay:9*50,transition:`all ease-in-out duration-250`},k=[`duration`,`delay`],A={"font-medium":``},j={text:`sm neutral-500`},M={text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[65dvh]`,"right--15":``,"z--1":``,initial:{scale:.9,opacity:0,rotate:30},enter:{scale:1,opacity:1,rotate:0},duration:250,flex:``,"items-center":``,"justify-center":``};var N=o({__name:`color-scheme`,setup(t){let o=b(),{t:x}=e();return(e,t)=>{let b=_(`motion`);return v(),c(h,null,[m((v(),p(l(n),{"mb-2":``,title:l(x)(`settings.pages.themes.sections.section.custom-color.title`),icon:`i-solar:pallete-2-bold-duotone`,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:290,delay:4*50,transition:`all ease-in-out duration-250`},{default:s(()=>[m((v(),c(`div`,C,[d(`span`,w,u(e.$t(`settings.pages.themes.sections.section.custom-color.fields.field.primary-color.label`)),1),d(`label`,T,[m(d(`input`,{"onUpdate:modelValue":t[0]||=e=>l(o).themeColorsHueDynamic=e,type:`checkbox`,class:`peer sr-only`},null,512),[[a,l(o).themeColorsHueDynamic]]),t[2]||=d(`div`,{class:`h-6 w-11 rounded-full bg-neutral-200 after:absolute after:left-[2px] after:top-[2px] after:h-5 after:w-5 after:rounded-full after:bg-white dark:bg-neutral-600 peer-checked:bg-primary-500 after:transition-all after:content-[''] peer-checked:after:translate-x-full peer-checked:after:border-white`},null,-1),y(` `+u(e.$t(`settings.pages.themes.sections.section.custom-color.fields.field.primary-color.rgb-on.title`)),1)])])),[[b]]),m(g(l(r),{modelValue:l(o).themeColorsHue,"onUpdate:modelValue":t[1]||=e=>l(o).themeColorsHue=e,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:310,delay:6*50,disabled:l(o).themeColorsHueDynamic},null,8,[`modelValue`,`disabled`]),[[b]]),m((v(),c(`div`,E,[t[4]||=d(`span`,{"bg-primary-50":``},`50`,-1),t[5]||=d(`span`,{"bg-primary-100":``},`100`,-1),t[6]||=d(`span`,{"bg-primary-200":``},`200`,-1),t[7]||=d(`span`,{"bg-primary-300":``},`300`,-1),t[8]||=d(`span`,{"bg-primary-400":``},`400`,-1),t[9]||=d(`span`,{"bg-primary-500":``},`500`,-1),m((v(),c(`div`,D,t[3]||=[d(`span`,{"bg-primary-600":``},`600`,-1),d(`span`,{"bg-primary-700":``},`700`,-1),d(`span`,{"bg-primary-800":``},`800`,-1),d(`span`,{"bg-primary-900":``},`900`,-1),d(`span`,{"bg-primary-950":``},`950`,-1)])),[[b]])])),[[b]]),m((v(),c(`div`,O,t[10]||=[d(`span`,{bg:`primary-500/5`},`500/5`,-1),d(`span`,{bg:`primary-500/10`},`500/10`,-1),d(`span`,{bg:`primary-500/20`},`500/20`,-1),d(`span`,{bg:`primary-500/30`},`500/30`,-1),d(`span`,{bg:`primary-500/40`},`500/40`,-1),d(`span`,{bg:`primary-500/50`},`500/50`,-1),d(`span`,{bg:`primary-500/60`},`500/60`,-1),d(`span`,{bg:`primary-500/70`},`500/70`,-1),d(`span`,{bg:`primary-500/80`},`500/80`,-1),d(`span`,{bg:`primary-500/90`},`500/90`,-1),d(`span`,{bg:`primary-500`},`500`,-1)])),[[b]])]),_:1},8,[`title`])),[[b]]),m((v(),p(l(n),{"mb-2":``,title:l(x)(`settings.pages.themes.sections.section.theme-presets.title`),icon:`i-solar:magic-stick-2-bold-duotone`,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:350,delay:10*50,transition:`all ease-in-out duration-250`},{default:s(()=>[(v(!0),c(h,null,f(e.$tm(`settings.pages.themes.sections.section.theme-presets.presets`),({title:t,description:n,colors:r},a)=>m((v(),c(`div`,{key:a,class:`w-full flex items-center justify-between rounded-lg px-4 py-3 outline-none transition-all duration-250 ease-in-out`,bg:`neutral-100 dark:neutral-800`,hover:`bg-neutral-200 dark:bg-neutral-700`,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:360+a*10,delay:11*50+a*50,transition:`all ease-in-out duration-250`},[d(`div`,null,[d(`span`,A,u(e.$rt(t)),1),d(`div`,j,u(e.$rt(n)),1)]),g(l(i),{colors:r.map((t,n)=>({hex:l(S)[a][n],name:e.$rt(t)}))},null,8,[`colors`])],8,k)),[[b]])),128))]),_:1},8,[`title`])),[[b]]),m((v(),c(`div`,M,t[11]||=[d(`div`,{text:`60`,"i-solar:pallete-2-bold-duotone":``},null,-1)])),[[b]])],64)}}});typeof x==`function`&&x(N);var P=t(N,[[`__scopeId`,`data-v-190d7273`]]);export{P as default}; \ No newline at end of file diff --git a/assets/consciousness-BZ0UAvpf.js b/assets/consciousness-BZ0UAvpf.js new file mode 100644 index 0000000000000000000000000000000000000000..4e9c15180273caac45945e25cee2d21e7d540ee0 --- /dev/null +++ b/assets/consciousness-BZ0UAvpf.js @@ -0,0 +1 @@ +import{A as e,B as t,a8 as n,aO as r,aR as i,ae as ee,ah as te,ai as ne,aj as re,d1 as ie,d6 as a,d7 as o,d8 as s,d9 as c,dF as l,dI as u,dN as d,de as f,df as p,di as m,dl as h,do as g,dt as ae,dw as oe,dx as _,dy as v,dz as se}from"./index-TXtvn0DM.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b={bg:`neutral-50 dark:[rgba(0,0,0,0.3)]`,"rounded-xl":``,"p-4":``,flex:`~ col gap-4`},x={flex:`~ col gap-4`},S={class:`text-lg text-neutral-500 md:text-2xl dark:text-neutral-500`},C={text:`neutral-400 dark:neutral-400`},w={"max-w-full":``},T={key:0,flex:`~ row gap-4`,style:{"scrollbar-width":`none`},"min-w-0":``,"of-x-scroll":``,"scroll-smooth":``,role:`radiogroup`},E={key:1},D={key:0},O={flex:`~ col gap-4`},k={class:`text-lg md:text-2xl`},A={text:`neutral-400 dark:neutral-400`},j={key:0,class:`flex items-center justify-center py-4`},M={key:1},N={flex:`~ col gap-4`},P={class:`text-lg text-neutral-500 md:text-2xl dark:text-neutral-400`},F={text:`neutral-400 dark:neutral-500`},ce={class:`flex items-center gap-3 border border-primary-200 rounded-lg bg-primary-50 p-4 dark:border-primary-800 dark:bg-primary-900/20`},I={class:`flex flex-col`},L={class:`font-medium`},R={class:`text-sm text-primary-600 dark:text-primary-400`},z={class:`mt-2`},B={class:`mb-1 block text-sm font-medium`},V=[`placeholder`],H={text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-15rem)]`,"bottom-0":``,"right--5":``,"z--1":``,initial:{scale:.9,opacity:0,x:20},enter:{scale:1,opacity:1,x:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``};var U=a({__name:`consciousness`,setup(a){let y=t(),U=e(),{configuredChatProvidersMetadata:W}=i(y),{activeProvider:G,activeModel:K,customModelName:le,modelSearchQuery:q,supportsModelListing:J,providerModels:Y,isLoadingActiveProviderModels:X,activeProviderModelError:Z}=i(U),{t:Q}=n();se(async()=>{await U.loadModelsForProvider(G.value)});function $(e){le.value=e}return(e,t)=>{let n=oe(`motion`);return _(),c(g,null,[f(`div`,b,[f(`div`,null,[f(`div`,x,[f(`div`,null,[f(`h2`,S,d(l(Q)(`settings.pages.providers.title`)),1),f(`div`,C,[f(`span`,null,d(l(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.description`)),1)])]),f(`div`,w,[l(W).length>0?(_(),c(`fieldset`,T,[(_(!0),c(g,null,p(l(W),e=>(_(),m(l(te),{id:e.id,key:e.id,modelValue:l(G),"onUpdate:modelValue":t[0]||=e=>u(G)?G.value=e:null,name:`provider`,value:e.id,title:e.localizedName||`Unknown`,description:e.localizedDescription},null,8,[`id`,`modelValue`,`value`,`title`,`description`]))),128))])):(_(),c(`div`,E,[ae(l(r),{class:`flex items-center gap-3 rounded-lg p-4`,border:`2 dashed neutral-200 dark:neutral-800`,bg:`neutral-50 dark:neutral-800`,transition:`colors duration-200 ease-in-out`,to:`/settings/providers`},{default:s(()=>t[4]||=[f(`div`,{"i-solar:warning-circle-line-duotone":``,class:`text-2xl text-amber-500 dark:text-amber-400`},null,-1),f(`div`,{class:`flex flex-col`},[f(`span`,{class:`font-medium`},`No Providers Configured`),f(`span`,{class:`text-sm text-neutral-400 dark:text-neutral-500`},`Click here to set up your LLM providers`)],-1),f(`div`,{"i-solar:arrow-right-line-duotone":``,class:`ml-auto text-xl text-neutral-400 dark:text-neutral-500`},null,-1)]),_:1,__:[4]})]))])])]),l(G)&&l(J)?(_(),c(`div`,D,[f(`div`,O,[f(`div`,null,[f(`h2`,k,d(l(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.title`)),1),f(`div`,A,[f(`span`,null,d(l(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle`)),1)])]),l(X)?(_(),c(`div`,j,[t[5]||=f(`div`,{class:`mr-2 animate-spin`},[f(`div`,{"i-solar:spinner-line-duotone":``,"text-xl":``})],-1),f(`span`,null,d(l(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.loading`)),1)])):l(Z)?(_(),m(l(ee),{key:1,title:l(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.error`),error:l(Z)},null,8,[`title`,`error`])):l(Y).length===0&&!l(X)?(_(),m(l(re),{key:2,type:`warning`},{title:s(()=>[v(d(l(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models`)),1)]),content:s(()=>[v(d(l(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models_description`)),1)]),_:1})):l(Y).length>0?(_(),m(l(ne),{key:3,modelValue:l(K),"onUpdate:modelValue":t[1]||=e=>u(K)?K.value=e:null,"search-query":l(q),"onUpdate:searchQuery":t[2]||=e=>u(q)?q.value=e:null,items:l(Y).sort((e,t)=>e.id===l(K)?-1:t.id===l(K)?1:0),searchable:!0,"search-placeholder":l(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.search_placeholder`),"search-no-results-title":l(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results`),"search-no-results-description":l(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results_description`,{query:l(q)}),"search-results-text":l(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.search_results`,{count:`{count}`,total:`{total}`}),"custom-input-placeholder":l(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.custom_model_placeholder`),"expand-button-text":l(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.expand`),"collapse-button-text":l(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.collapse`),"onUpdate:customValue":$},null,8,[`modelValue`,`search-query`,`items`,`search-placeholder`,`search-no-results-title`,`search-no-results-description`,`search-results-text`,`custom-input-placeholder`,`expand-button-text`,`collapse-button-text`])):o(``,!0)])])):l(G)&&!l(J)?(_(),c(`div`,M,[f(`div`,N,[f(`div`,null,[f(`h2`,P,d(l(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.title`)),1),f(`div`,F,[f(`span`,null,d(l(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle`)),1)])]),f(`div`,ce,[t[6]||=f(`div`,{"i-solar:info-circle-line-duotone":``,class:`text-2xl text-primary-500 dark:text-primary-400`},null,-1),f(`div`,I,[f(`span`,L,d(l(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.not_supported`)),1),f(`span`,R,d(l(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.not_supported_description`)),1)])]),f(`div`,z,[f(`label`,B,d(l(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.manual_model_name`)),1),h(f(`input`,{"onUpdate:modelValue":t[3]||=e=>u(K)?K.value=e:null,type:`text`,class:`w-full border border-neutral-300 rounded bg-white px-3 py-2 dark:border-neutral-700 dark:bg-neutral-900`,placeholder:l(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.manual_model_placeholder`)},null,8,V),[[ie,l(K)]])])])])):o(``,!0)]),h((_(),c(`div`,H,t[7]||=[f(`div`,{text:`60`,"i-solar:ghost-bold-duotone":``},null,-1)])),[[n]])],64)}}});typeof y==`function`&&y(U);var W=U;export{W as default}; \ No newline at end of file diff --git a/assets/consciousness-Bsx6qnki.js b/assets/consciousness-Bsx6qnki.js deleted file mode 100644 index 4a4a718372c855913059f17701941e4a694c5a34..0000000000000000000000000000000000000000 --- a/assets/consciousness-Bsx6qnki.js +++ /dev/null @@ -1 +0,0 @@ -import{A as e,B as t,a8 as n,aO as r,aR as i,ae as ee,ah as te,ai as ne,aj as re,d0 as a,d6 as o,d9 as s,dD as c,dG as l,dN as u,de as ie,dh as ae,di as d,dj as f,dk as p,dm as oe,dn as m,do as h,dp as g,du as _,dv as se,dy as v}from"./index-Bcb2irKh.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b={bg:`neutral-50 dark:[rgba(0,0,0,0.3)]`,"rounded-xl":``,"p-4":``,flex:`~ col gap-4`},x={flex:`~ col gap-4`},S={class:`text-lg text-neutral-500 md:text-2xl dark:text-neutral-500`},C={text:`neutral-400 dark:neutral-400`},w={"max-w-full":``},T={key:0,flex:`~ row gap-4`,style:{"scrollbar-width":`none`},"min-w-0":``,"of-x-scroll":``,"scroll-smooth":``,role:`radiogroup`},E={key:1},D={key:0},O={flex:`~ col gap-4`},k={class:`text-lg md:text-2xl`},A={text:`neutral-400 dark:neutral-400`},j={key:0,class:`flex items-center justify-center py-4`},M={key:1},N={flex:`~ col gap-4`},P={class:`text-lg text-neutral-500 md:text-2xl dark:text-neutral-400`},F={text:`neutral-400 dark:neutral-500`},ce={class:`flex items-center gap-3 border border-primary-200 rounded-lg bg-primary-50 p-4 dark:border-primary-800 dark:bg-primary-900/20`},I={class:`flex flex-col`},L={class:`font-medium`},R={class:`text-sm text-primary-600 dark:text-primary-400`},z={class:`mt-2`},B={class:`mb-1 block text-sm font-medium`},V=[`placeholder`],H={text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-15rem)]`,"bottom-0":``,"right--5":``,"z--1":``,initial:{scale:.9,opacity:0,x:20},enter:{scale:1,opacity:1,x:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``};var U=oe({__name:`consciousness`,setup(oe){let y=t(),U=e(),{configuredChatProvidersMetadata:W}=i(y),{activeProvider:G,activeModel:K,customModelName:le,modelSearchQuery:q,supportsModelListing:J,providerModels:Y,isLoadingActiveProviderModels:X,activeProviderModelError:Z}=i(U),{t:Q}=n();p(async()=>{await U.loadModelsForProvider(G.value)});function $(e){le.value=e}return(e,t)=>{let n=ae(`motion`);return d(),g(s,null,[_(`div`,b,[_(`div`,null,[_(`div`,x,[_(`div`,null,[_(`h2`,S,u(c(Q)(`settings.pages.providers.title`)),1),_(`div`,C,[_(`span`,null,u(c(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.description`)),1)])]),_(`div`,w,[c(W).length>0?(d(),g(`fieldset`,T,[(d(!0),g(s,null,se(c(W),e=>(d(),v(c(te),{id:e.id,key:e.id,modelValue:c(G),"onUpdate:modelValue":t[0]||=e=>l(G)?G.value=e:null,name:`provider`,value:e.id,title:e.localizedName||`Unknown`,description:e.localizedDescription},null,8,[`id`,`modelValue`,`value`,`title`,`description`]))),128))])):(d(),g(`div`,E,[ie(c(r),{class:`flex items-center gap-3 rounded-lg p-4`,border:`2 dashed neutral-200 dark:neutral-800`,bg:`neutral-50 dark:neutral-800`,transition:`colors duration-200 ease-in-out`,to:`/settings/providers`},{default:h(()=>t[4]||=[_(`div`,{"i-solar:warning-circle-line-duotone":``,class:`text-2xl text-amber-500 dark:text-amber-400`},null,-1),_(`div`,{class:`flex flex-col`},[_(`span`,{class:`font-medium`},`No Providers Configured`),_(`span`,{class:`text-sm text-neutral-400 dark:text-neutral-500`},`Click here to set up your LLM providers`)],-1),_(`div`,{"i-solar:arrow-right-line-duotone":``,class:`ml-auto text-xl text-neutral-400 dark:text-neutral-500`},null,-1)]),_:1,__:[4]})]))])])]),c(G)&&c(J)?(d(),g(`div`,D,[_(`div`,O,[_(`div`,null,[_(`h2`,k,u(c(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.title`)),1),_(`div`,A,[_(`span`,null,u(c(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle`)),1)])]),c(X)?(d(),g(`div`,j,[t[5]||=_(`div`,{class:`mr-2 animate-spin`},[_(`div`,{"i-solar:spinner-line-duotone":``,"text-xl":``})],-1),_(`span`,null,u(c(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.loading`)),1)])):c(Z)?(d(),v(c(ee),{key:1,title:c(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.error`),error:c(Z)},null,8,[`title`,`error`])):c(Y).length===0&&!c(X)?(d(),v(c(re),{key:2,type:`warning`},{title:h(()=>[f(u(c(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models`)),1)]),content:h(()=>[f(u(c(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models_description`)),1)]),_:1})):c(Y).length>0?(d(),v(c(ne),{key:3,modelValue:c(K),"onUpdate:modelValue":t[1]||=e=>l(K)?K.value=e:null,"search-query":c(q),"onUpdate:searchQuery":t[2]||=e=>l(q)?q.value=e:null,items:c(Y).sort((e,t)=>e.id===c(K)?-1:t.id===c(K)?1:0),searchable:!0,"search-placeholder":c(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.search_placeholder`),"search-no-results-title":c(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results`),"search-no-results-description":c(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results_description`,{query:c(q)}),"search-results-text":c(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.search_results`,{count:`{count}`,total:`{total}`}),"custom-input-placeholder":c(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.custom_model_placeholder`),"expand-button-text":c(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.expand`),"collapse-button-text":c(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.collapse`),"onUpdate:customValue":$},null,8,[`modelValue`,`search-query`,`items`,`search-placeholder`,`search-no-results-title`,`search-no-results-description`,`search-results-text`,`custom-input-placeholder`,`expand-button-text`,`collapse-button-text`])):m(``,!0)])])):c(G)&&!c(J)?(d(),g(`div`,M,[_(`div`,N,[_(`div`,null,[_(`h2`,P,u(c(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.title`)),1),_(`div`,F,[_(`span`,null,u(c(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle`)),1)])]),_(`div`,ce,[t[6]||=_(`div`,{"i-solar:info-circle-line-duotone":``,class:`text-2xl text-primary-500 dark:text-primary-400`},null,-1),_(`div`,I,[_(`span`,L,u(c(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.not_supported`)),1),_(`span`,R,u(c(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.not_supported_description`)),1)])]),_(`div`,z,[_(`label`,B,u(c(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.manual_model_name`)),1),o(_(`input`,{"onUpdate:modelValue":t[3]||=e=>l(K)?K.value=e:null,type:`text`,class:`w-full border border-neutral-300 rounded bg-white px-3 py-2 dark:border-neutral-700 dark:bg-neutral-900`,placeholder:c(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.manual_model_placeholder`)},null,8,V),[[a,c(K)]])])])])):m(``,!0)]),o((d(),g(`div`,H,t[7]||=[_(`div`,{text:`60`,"i-solar:ghost-bold-duotone":``},null,-1)])),[[n]])],64)}}});typeof y==`function`&&y(U);var W=U;export{W as default}; \ No newline at end of file diff --git a/assets/deepseek-Bq3V0xqj.js b/assets/deepseek-Bq3V0xqj.js deleted file mode 100644 index 0d0b951b2c64141353604faee529c94f098aa080..0000000000000000000000000000000000000000 --- a/assets/deepseek-Bq3V0xqj.js +++ /dev/null @@ -1 +0,0 @@ -import{B as e,a3 as t,a4 as n,a5 as r,a6 as i,a7 as a,a8 as o,a9 as s,aM as c,aR as l,dD as u,da as d,de as f,dg as p,di as m,dk as h,dm as g,do as _,dy as v}from"./index-Bcb2irKh.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b=`deepseek`;var x=g({__name:`deepseek`,setup(g){let{t:y}=o(),x=c(),S=e(),{providers:C}=l(S),w=d(()=>S.getProviderMetadata(b)),T=d({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=d({get:()=>C.value[b]?.baseUrl||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});h(()=>{S.initializeProvider(b),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||``}),p([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||``}});function D(){C.value[b]={...w.value?.defaultOptions}}return(e,o)=>(m(),v(u(t),{"provider-name":w.value?.localizedName,"provider-icon-color":w.value?.iconColor,"on-back":()=>u(x).back()},{default:_(()=>[f(u(n),null,{default:_(()=>[f(u(r),{title:u(y)(`settings.pages.providers.common.section.basic.title`),description:u(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:_(()=>[f(u(a),{modelValue:T.value,"onUpdate:modelValue":o[0]||=e=>T.value=e,"provider-name":w.value?.localizedName,placeholder:`sk-...`},null,8,[`modelValue`,`provider-name`])]),_:1},8,[`title`,`description`]),f(u(s),{title:u(y)(`settings.pages.providers.common.section.advanced.title`)},{default:_(()=>[f(u(i),{modelValue:E.value,"onUpdate:modelValue":o[1]||=e=>E.value=e,placeholder:`https://api.deepseek.com/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon-color`,`on-back`]))}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file diff --git a/assets/deepseek-CROq3FT6.js b/assets/deepseek-CROq3FT6.js new file mode 100644 index 0000000000000000000000000000000000000000..7506b0f076450311c9c4e67490c615be9aea3fd9 --- /dev/null +++ b/assets/deepseek-CROq3FT6.js @@ -0,0 +1 @@ +import{B as e,a3 as t,a4 as n,a5 as r,a6 as i,a7 as a,a8 as o,a9 as s,aM as c,aR as l,d6 as u,d8 as d,dF as f,di as p,dp as m,dt as h,dv as g,dx as _,dz as v}from"./index-TXtvn0DM.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b=`deepseek`;var x=u({__name:`deepseek`,setup(u){let{t:y}=o(),x=c(),S=e(),{providers:C}=l(S),w=m(()=>S.getProviderMetadata(b)),T=m({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=m({get:()=>C.value[b]?.baseUrl||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});v(()=>{S.initializeProvider(b),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||``}),g([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||``}});function D(){C.value[b]={...w.value?.defaultOptions}}return(e,o)=>(_(),p(f(t),{"provider-name":w.value?.localizedName,"provider-icon-color":w.value?.iconColor,"on-back":()=>f(x).back()},{default:d(()=>[h(f(n),null,{default:d(()=>[h(f(r),{title:f(y)(`settings.pages.providers.common.section.basic.title`),description:f(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:d(()=>[h(f(a),{modelValue:T.value,"onUpdate:modelValue":o[0]||=e=>T.value=e,"provider-name":w.value?.localizedName,placeholder:`sk-...`},null,8,[`modelValue`,`provider-name`])]),_:1},8,[`title`,`description`]),h(f(s),{title:f(y)(`settings.pages.providers.common.section.advanced.title`)},{default:d(()=>[h(f(i),{modelValue:E.value,"onUpdate:modelValue":o[1]||=e=>E.value=e,placeholder:`https://api.deepseek.com/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon-color`,`on-back`]))}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file diff --git a/assets/default-DP_2zDq7.js b/assets/default-dHnBRBVa.js similarity index 51% rename from assets/default-DP_2zDq7.js rename to assets/default-dHnBRBVa.js index 6b2f943efb1344cb8c8d5a8e9a7cf23c7d7b41da..0b857b76ab6e0dd6fe1f74966f7320d3c484ccea 100644 --- a/assets/default-DP_2zDq7.js +++ b/assets/default-dHnBRBVa.js @@ -1 +1 @@ -import{aP as e,dD as t,de as n,di as r,dm as i,dp as a,du as o}from"./index-Bcb2irKh.js";import{b as s}from"./HeaderLink-BvOcNkh0.js";const c={style:{paddingBottom:`env(safe-area-inset-bottom, 0px)`,paddingTop:`env(safe-area-inset-top, 0px)`,paddingRight:`env(safe-area-inset-right, 0px)`,paddingLeft:`env(safe-area-inset-left, 0px)`},"h-full":``},l={class:`px-0 py-1 md:px-3 md:py-3`,"w-full":``,"gap-2":``,bg:`$bg-color`},u={class:`px-3 py-2 md:px-5 md:py-5`,flex:`~ col`,"mx-auto":``,"h-full":``,"max-w-screen-xl":``};var d=i({__name:`default`,setup(i){return(i,d)=>(r(),a(`div`,c,[o(`div`,l,[n(s)]),o(`div`,u,[n(t(e))])]))}}),f=d;export{f as default}; \ No newline at end of file +import{aP as e,d6 as t,d9 as n,dF as r,de as i,dt as a,dx as o}from"./index-TXtvn0DM.js";import{b as s}from"./HeaderLink-BMtWjY7k.js";const c={style:{paddingBottom:`env(safe-area-inset-bottom, 0px)`,paddingTop:`env(safe-area-inset-top, 0px)`,paddingRight:`env(safe-area-inset-right, 0px)`,paddingLeft:`env(safe-area-inset-left, 0px)`},"h-full":``},l={class:`px-0 py-1 md:px-3 md:py-3`,"w-full":``,"gap-2":``,bg:`$bg-color`},u={class:`px-3 py-2 md:px-5 md:py-5`,flex:`~ col`,"mx-auto":``,"h-full":``,"max-w-screen-xl":``};var d=t({__name:`default`,setup(t){return(t,d)=>(o(),n(`div`,c,[i(`div`,l,[a(s)]),i(`div`,u,[a(r(e))])]))}}),f=d;export{f as default}; \ No newline at end of file diff --git a/assets/default-node-BiFBkIjL.js b/assets/default-node-BI20WiOb.js similarity index 70% rename from assets/default-node-BiFBkIjL.js rename to assets/default-node-BI20WiOb.js index 66d96f8f3b0b1c6fe6cd6633edcda2f7f8117b72..b493949e06ace31ea4126801e305b2ac1df61800 100644 --- a/assets/default-node-BiFBkIjL.js +++ b/assets/default-node-BI20WiOb.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/__vite-browser-external-hz9OYH6e.js","assets/index-Bcb2irKh.js","assets/index-DdvhN8Iu.css"])))=>i.map(i=>d[i]); -import{aQ as e,dS as t}from"./index-Bcb2irKh.js";async function n(){let{createRequire:n}=await e(async()=>{let{createRequire:e}=await import(`./__vite-browser-external-hz9OYH6e.js`).then(t(1));return{createRequire:e}},__vite__mapDeps([0,1,2])),{dirname:r,resolve:i}=await e(async()=>{let{dirname:e,resolve:n}=await import(`./__vite-browser-external-hz9OYH6e.js`).then(t(1));return{dirname:e,resolve:n}},__vite__mapDeps([0,1,2])),a=n(import.meta.url),o=r(a.resolve(`@duckdb/duckdb-wasm`));return{mvp:{mainModule:i(o,`./duckdb-mvp.wasm`),mainWorker:i(o,`./duckdb-node-mvp.worker.cjs`)},eh:{mainModule:i(o,`./duckdb-eh.wasm`),mainWorker:i(o,`./duckdb-node-eh.worker.cjs`)}}}export{n as getBundles}; \ No newline at end of file +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/__vite-browser-external-C1t5aXtc.js","assets/index-TXtvn0DM.js","assets/index-DdvhN8Iu.css"])))=>i.map(i=>d[i]); +import{aQ as e,dS as t}from"./index-TXtvn0DM.js";async function n(){let{createRequire:n}=await e(async()=>{let{createRequire:e}=await import(`./__vite-browser-external-C1t5aXtc.js`).then(t(1));return{createRequire:e}},__vite__mapDeps([0,1,2])),{dirname:r,resolve:i}=await e(async()=>{let{dirname:e,resolve:n}=await import(`./__vite-browser-external-C1t5aXtc.js`).then(t(1));return{dirname:e,resolve:n}},__vite__mapDeps([0,1,2])),a=n(import.meta.url),o=r(a.resolve(`@duckdb/duckdb-wasm`));return{mvp:{mainModule:i(o,`./duckdb-mvp.wasm`),mainWorker:i(o,`./duckdb-node-mvp.worker.cjs`)},eh:{mainModule:i(o,`./duckdb-eh.wasm`),mainWorker:i(o,`./duckdb-node-eh.worker.cjs`)}}}export{n as getBundles}; \ No newline at end of file diff --git a/assets/delays-DOX4ZLru.js b/assets/delays-DOX4ZLru.js deleted file mode 100644 index 299bbf8fb1f5c769a43a91836d527ca93a5573e7..0000000000000000000000000000000000000000 --- a/assets/delays-DOX4ZLru.js +++ /dev/null @@ -1 +0,0 @@ -import"./Basic-BIq-Of0k.js";import{b as e}from"./Textarea-BFPvaePN.js";import{Y as t,aB as n,d9 as r,dD as i,dI as a,dN as o,de as s,di as c,dm as l,dp as u,du as d,dv as f}from"./index-Bcb2irKh.js";const p={flex:``,"flex-col":``,"gap-2":``,"p-2":``},m={flex:``,"flex-row":``,"gap-2":``},h={"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-4":``},g={"w-full":``,flex:``,"flex-row":``,"gap-4":``},_={"w-full":``,"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-2":``},v={"w-full":``,"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-2":``};var y=l({__name:`delays`,setup(l){let y=a(``),b=a([]),x=a([]),S=a(!1),C=t();C.onHandlerEvent(`delay`,e=>{x.value.push(e)});function w(){S.value=!0;let e=y.value.split(``);for(let t of e)C.add(t);C.add(n),y.value=``,S.value=!1}return(t,n)=>(c(),u(`div`,p,[d(`div`,m,[s(i(e),{modelValue:y.value,"onUpdate:modelValue":n[0]||=e=>y.value=e,placeholder:`Message`,p:`2`,bg:`neutral-100 dark:neutral-700`,"w-full":``,"rounded-lg":``,"outline-none":``,onSubmit:w},null,8,[`modelValue`]),d(`button`,h,o(S.value?`Processing...`:`Send`),1)]),d(`div`,g,[d(`div`,_,[n[1]||=d(`h3`,{"font-normal":``},` Emotion Message `,-1),(c(!0),u(r,null,f(b.value,e=>(c(),u(`div`,{key:e},[d(`div`,null,o(e),1)]))),128))]),d(`div`,v,[n[2]||=d(`h3`,{"font-normal":``},` Delays `,-1),(c(!0),u(r,null,f(x.value,e=>(c(),u(`div`,{key:e},[d(`div`,null,o(e)+`s`,1)]))),128))])])]))}}),b=y;export{b as default}; \ No newline at end of file diff --git a/assets/delays-tYDkCeIB.js b/assets/delays-tYDkCeIB.js new file mode 100644 index 0000000000000000000000000000000000000000..254517c18a87ea4dde57bcdcf6e2046d83c6d382 --- /dev/null +++ b/assets/delays-tYDkCeIB.js @@ -0,0 +1 @@ +import"./Basic-8xhCMoI8.js";import{b as e}from"./Textarea-BsLlwm-1.js";import{_ as t,aB as n,d6 as r,d9 as i,dF as a,dK as o,dN as s,de as c,df as l,do as u,dt as d,dx as f}from"./index-TXtvn0DM.js";const p={flex:``,"flex-col":``,"gap-2":``,"p-2":``},m={flex:``,"flex-row":``,"gap-2":``},h={"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-4":``},g={"w-full":``,flex:``,"flex-row":``,"gap-4":``},_={"w-full":``,"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-2":``},v={"w-full":``,"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-2":``};var y=r({__name:`delays`,setup(r){let y=o(``),b=o([]),x=o([]),S=o(!1),C=t();C.onHandlerEvent(`delay`,e=>{x.value.push(e)});function w(){S.value=!0;let e=y.value.split(``);for(let t of e)C.add(t);C.add(n),y.value=``,S.value=!1}return(t,n)=>(f(),i(`div`,p,[c(`div`,m,[d(a(e),{modelValue:y.value,"onUpdate:modelValue":n[0]||=e=>y.value=e,placeholder:`Message`,p:`2`,bg:`neutral-100 dark:neutral-700`,"w-full":``,"rounded-lg":``,"outline-none":``,onSubmit:w},null,8,[`modelValue`]),c(`button`,h,s(S.value?`Processing...`:`Send`),1)]),c(`div`,g,[c(`div`,_,[n[1]||=c(`h3`,{"font-normal":``},` Emotion Message `,-1),(f(!0),i(u,null,l(b.value,e=>(f(),i(`div`,{key:e},[c(`div`,null,s(e),1)]))),128))]),c(`div`,v,[n[2]||=c(`h3`,{"font-normal":``},` Delays `,-1),(f(!0),i(u,null,l(x.value,e=>(f(),i(`div`,{key:e},[c(`div`,null,s(e)+`s`,1)]))),128))])])]))}}),b=y;export{b as default}; \ No newline at end of file diff --git a/assets/developer-C3KwNa46.js b/assets/developer-DlN6BLxq.js similarity index 52% rename from assets/developer-C3KwNa46.js rename to assets/developer-DlN6BLxq.js index 27f044c6d35265621b1d9e65c70c46732523fae3..37846b8be4a4df6cf14db7dff8ca9382ca9576aa 100644 --- a/assets/developer-C3KwNa46.js +++ b/assets/developer-DlN6BLxq.js @@ -1 +1 @@ -import{c$ as e,d4 as t,d6 as n,d9 as r,dD as i,dN as a,dO as o,de as s,dh as c,di as l,dj as u,dm as d,dn as f,do as p,dp as m,ds as h,du as g,dz as _,t as v}from"./index-Bcb2irKh.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b={class:`w-full flex cursor-pointer items-center justify-between rounded-lg px-4 py-3 text-sm outline-none transition-all duration-250 ease-in-out`,bg:`neutral-50 dark:neutral-800`,hover:`bg-neutral-200 dark:bg-neutral-700`},x=[`aria-checked`],S={key:0,text:`sm neutral-500`};var C=d({__name:`CheckBar`,props:h({text:{},iconOn:{},iconOff:{},description:{}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:[`update:modelValue`],setup(r){let i=_(r,`modelValue`);return(r,c)=>(l(),m(`label`,b,[n(g(`input`,{"onUpdate:modelValue":c[0]||=e=>i.value=e,"aria-checked":i.value,type:`checkbox`,hidden:``},null,8,x),[[t,i.value]]),g(`div`,null,[u(a(r.$t(r.text))+` `,1),r.description?(l(),m(`div`,S,a(r.$t(r.description)),1)):f(``,!0)]),s(e,{name:`slide-away`,mode:`out-in`},{default:p(()=>[i.value?(l(),m(`div`,{key:0,class:o(r.iconOn),transition:`all ease-in-out duration-250`},null,2)):(l(),m(`div`,{key:1,class:o(r.iconOff),transition:`all ease-in-out duration-250`},null,2))]),_:1})]))}}),w=C;const T={text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[65dvh]`,"right--15":``,"z--1":``,initial:{scale:.9,opacity:0,rotate:30},enter:{scale:1,opacity:1,rotate:0},duration:250,flex:``,"items-center":``,"justify-center":``};var E=d({__name:`developer`,setup(e){let t=v();return(e,a)=>{let o=c(`motion`);return l(),m(r,null,[n(s(w,{modelValue:i(t).disableTransitions,"onUpdate:modelValue":a[0]||=e=>i(t).disableTransitions=e,"mb-2":``,"icon-on":`i-solar:people-nearby-bold-duotone`,"icon-off":`i-solar:running-2-line-duotone`,text:`settings.animations.stage-transitions.title`,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:440,delay:19*50,transition:`all ease-in-out duration-250`},null,8,[`modelValue`]),[[o]]),n(s(w,{modelValue:i(t).usePageSpecificTransitions,"onUpdate:modelValue":a[1]||=e=>i(t).usePageSpecificTransitions=e,disabled:i(t).disableTransitions,"icon-on":`i-solar:running-2-line-duotone`,"icon-off":`i-solar:people-nearby-bold-duotone`,text:`settings.animations.use-page-specific-transitions.title`,description:`settings.animations.use-page-specific-transitions.description`,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:450,delay:20*50,transition:`all ease-in-out duration-250`},null,8,[`modelValue`,`disabled`]),[[o]]),n((l(),m(`div`,T,a[2]||=[g(`div`,{text:`60`,"i-solar:code-bold-duotone":``},null,-1)])),[[o]])],64)}}});typeof y==`function`&&y(E);var D=E;export{D as default}; \ No newline at end of file +import{c_ as e,d0 as t,d6 as n,d7 as r,d8 as i,d9 as a,dF as o,dN as s,dO as c,dc as l,de as u,dj as d,dl as f,do as p,dt as m,dw as h,dx as g,dy as _,t as v}from"./index-TXtvn0DM.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b={class:`w-full flex cursor-pointer items-center justify-between rounded-lg px-4 py-3 text-sm outline-none transition-all duration-250 ease-in-out`,bg:`neutral-50 dark:neutral-800`,hover:`bg-neutral-200 dark:bg-neutral-700`},x=[`aria-checked`],S={key:0,text:`sm neutral-500`};var C=n({__name:`CheckBar`,props:l({text:{},iconOn:{},iconOff:{},description:{}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:[`update:modelValue`],setup(n){let o=d(n,`modelValue`);return(n,l)=>(g(),a(`label`,b,[f(u(`input`,{"onUpdate:modelValue":l[0]||=e=>o.value=e,"aria-checked":o.value,type:`checkbox`,hidden:``},null,8,x),[[e,o.value]]),u(`div`,null,[_(s(n.$t(n.text))+` `,1),n.description?(g(),a(`div`,S,s(n.$t(n.description)),1)):r(``,!0)]),m(t,{name:`slide-away`,mode:`out-in`},{default:i(()=>[o.value?(g(),a(`div`,{key:0,class:c(n.iconOn),transition:`all ease-in-out duration-250`},null,2)):(g(),a(`div`,{key:1,class:c(n.iconOff),transition:`all ease-in-out duration-250`},null,2))]),_:1})]))}}),w=C;const T={text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[65dvh]`,"right--15":``,"z--1":``,initial:{scale:.9,opacity:0,rotate:30},enter:{scale:1,opacity:1,rotate:0},duration:250,flex:``,"items-center":``,"justify-center":``};var E=n({__name:`developer`,setup(e){let t=v();return(e,n)=>{let r=h(`motion`);return g(),a(p,null,[f(m(w,{modelValue:o(t).disableTransitions,"onUpdate:modelValue":n[0]||=e=>o(t).disableTransitions=e,"mb-2":``,"icon-on":`i-solar:people-nearby-bold-duotone`,"icon-off":`i-solar:running-2-line-duotone`,text:`settings.animations.stage-transitions.title`,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:440,delay:19*50,transition:`all ease-in-out duration-250`},null,8,[`modelValue`]),[[r]]),f(m(w,{modelValue:o(t).usePageSpecificTransitions,"onUpdate:modelValue":n[1]||=e=>o(t).usePageSpecificTransitions=e,disabled:o(t).disableTransitions,"icon-on":`i-solar:running-2-line-duotone`,"icon-off":`i-solar:people-nearby-bold-duotone`,text:`settings.animations.use-page-specific-transitions.title`,description:`settings.animations.use-page-specific-transitions.description`,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:450,delay:20*50,transition:`all ease-in-out duration-250`},null,8,[`modelValue`,`disabled`]),[[r]]),f((g(),a(`div`,T,n[2]||=[u(`div`,{text:`60`,"i-solar:code-bold-duotone":``},null,-1)])),[[r]])],64)}}});typeof y==`function`&&y(E);var D=E;export{D as default}; \ No newline at end of file diff --git a/assets/effect-DBSVVF8G-CQ9lBH7Y.js b/assets/effect-DBSVVF8G-DSdeZPIg.js similarity index 72% rename from assets/effect-DBSVVF8G-CQ9lBH7Y.js rename to assets/effect-DBSVVF8G-DSdeZPIg.js index 59cee045012d908c51391076d5d80897ecaf3c92..49db81ba52480a3bfe8a8fa9bb4360a9935bb74d 100644 --- a/assets/effect-DBSVVF8G-CQ9lBH7Y.js +++ b/assets/effect-DBSVVF8G-DSdeZPIg.js @@ -1 +1 @@ -import{F as e,aQ as t}from"./index-Bcb2irKh.js";const n=async()=>{let{JSONSchema:n}=await e(t(()=>import(`./__vite-optional-peer-dep_effect_xsschema-CXIfmAu1.js`),[]),`effect`);return e=>n.make(e)};export{n as getToJsonSchemaFn}; \ No newline at end of file +import{F as e,aQ as t}from"./index-TXtvn0DM.js";const n=async()=>{let{JSONSchema:n}=await e(t(()=>import(`./__vite-optional-peer-dep_effect_xsschema-CXIfmAu1.js`),[]),`effect`);return e=>n.make(e)};export{n as getToJsonSchemaFn}; \ No newline at end of file diff --git a/assets/elevenlabs-BGkmS224.js b/assets/elevenlabs-BGkmS224.js deleted file mode 100644 index 15a73d31f8194b5e301bdcab045b88f93de67eec..0000000000000000000000000000000000000000 --- a/assets/elevenlabs-BGkmS224.js +++ /dev/null @@ -1 +0,0 @@ -import{B as e,V as t,a8 as n,aR as r,at as i,ax as a,dD as o,dI as s,da as c,de as l,dg as u,di as d,dk as f,dm as p,do as m,du as h,dy as g,r as _,y as v}from"./index-Bcb2irKh.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b={flex:`~ col gap-4`},x=`elevenlabs`,S=`eleven_multilingual_v2`;var C=p({__name:`elevenlabs`,setup(p){let y={similarityBoost:.75,stability:.5,speed:1,style:0,useSpeakerBoost:!0},C=s(0),w=s(1),T=s(0),E=s(0),D=s(.5),O=s(.75),k=s(!1),A=v(),j=e(),{providers:M}=r(j),{t:N}=n(),P=c(()=>!!M.value[x]?.apiKey),F=c(()=>A.availableVoices[x]||[]);async function I(e,t,n){let r=await j.getProviderInstance(x);if(!r)throw Error(`Failed to initialize speech provider`);let i=j.getProviderConfig(x),a=i.model||S;return await A.speech(r,a,e,t,{...i,...y})}return f(async()=>{let e=j.getProviderConfig(x),t=j.getProviderMetadata(x);await t.validators.validateProviderConfig(e)?await A.loadVoicesForProvider(x):console.error(`Failed to validate provider config`,e)}),u(C,async()=>{let e=j.getProviderConfig(x);e.pitch=C.value}),u(w,async()=>{let e=j.getProviderConfig(x);e.speed=w.value}),u(T,async()=>{let e=j.getProviderConfig(x);e.volume=T.value}),u(E,async()=>{let e=j.getProviderConfig(x);e.style=E.value}),u(D,async()=>{let e=j.getProviderConfig(x);e.stability=D.value}),u(O,async()=>{let e=j.getProviderConfig(x);e.similarityBoost=O.value}),u(k,async()=>{let e=j.getProviderConfig(x);e.useSpeakerBoost=k.value}),u(M,async()=>{let e=j.getProviderConfig(x),t=j.getProviderMetadata(x);await t.validators.validateProviderConfig(e)?await A.loadVoicesForProvider(x):console.error(`Failed to validate provider config`,e)},{immediate:!0}),(e,n)=>(d(),g(o(_),{"provider-id":x,"default-model":S,"additional-settings":y},{"voice-settings":m(()=>[h(`div`,b,[l(o(i),{modelValue:C.value,"onUpdate:modelValue":n[0]||=e=>C.value=e,label:o(N)(`settings.pages.providers.provider.common.fields.field.pitch.label`),description:o(N)(`settings.pages.providers.provider.common.fields.field.pitch.description`),min:-100,max:100,step:1,"format-value":e=>`${e}%`},null,8,[`modelValue`,`label`,`description`,`format-value`]),l(o(i),{modelValue:w.value,"onUpdate:modelValue":n[1]||=e=>w.value=e,label:o(N)(`settings.pages.providers.provider.common.fields.field.speed.label`),description:o(N)(`settings.pages.providers.provider.common.fields.field.speed.description`),min:.5,max:2,step:.01},null,8,[`modelValue`,`label`,`description`]),l(o(i),{modelValue:T.value,"onUpdate:modelValue":n[2]||=e=>T.value=e,label:o(N)(`settings.pages.providers.provider.common.fields.field.volume.label`),description:o(N)(`settings.pages.providers.provider.common.fields.field.volume.description`),min:-100,max:100,step:1,"format-value":e=>`${e}%`},null,8,[`modelValue`,`label`,`description`,`format-value`]),l(o(i),{modelValue:E.value,"onUpdate:modelValue":n[3]||=e=>E.value=e,label:o(N)(`settings.pages.providers.provider.elevenlabs.fields.field.style.label`),description:o(N)(`settings.pages.providers.provider.elevenlabs.fields.field.style.description`),min:0,max:1,step:.01},null,8,[`modelValue`,`label`,`description`]),l(o(i),{modelValue:D.value,"onUpdate:modelValue":n[4]||=e=>D.value=e,label:o(N)(`settings.pages.providers.provider.elevenlabs.fields.field.stability.label`),description:o(N)(`settings.pages.providers.provider.elevenlabs.fields.field.stability.description`),min:0,max:1,step:.01},null,8,[`modelValue`,`label`,`description`]),l(o(i),{modelValue:O.value,"onUpdate:modelValue":n[5]||=e=>O.value=e,label:o(N)(`settings.pages.providers.provider.elevenlabs.fields.field.simularity-boost.label`),description:o(N)(`settings.pages.providers.provider.elevenlabs.fields.field.simularity-boost.description`),min:0,max:1,step:.01},null,8,[`modelValue`,`label`,`description`]),l(o(a),{modelValue:k.value,"onUpdate:modelValue":n[6]||=e=>k.value=e,label:o(N)(`settings.pages.providers.provider.elevenlabs.fields.field.speaker-boost.label`),description:o(N)(`settings.pages.providers.provider.elevenlabs.fields.field.speaker-boost.description`)},null,8,[`modelValue`,`label`,`description`])])]),playground:m(()=>[l(o(t),{"available-voices":F.value,"generate-speech":I,"api-key-configured":P.value,"default-text":`Hello! This is a test of the ElevenLabs voice synthesis.`},null,8,[`available-voices`,`api-key-configured`])]),_:1}))}});typeof y==`function`&&y(C);var w=C;export{w as default}; \ No newline at end of file diff --git a/assets/elevenlabs-DBr8vpGg.js b/assets/elevenlabs-DBr8vpGg.js new file mode 100644 index 0000000000000000000000000000000000000000..b60d02e3b1def7d8e12374f799886bd67bec0981 --- /dev/null +++ b/assets/elevenlabs-DBr8vpGg.js @@ -0,0 +1 @@ +import{B as e,V as t,a8 as n,aR as r,at as i,ax as a,d6 as o,d8 as s,dF as c,dK as l,de as u,di as d,dp as f,dt as p,dv as m,dx as h,dz as g,r as _,y as v}from"./index-TXtvn0DM.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b={flex:`~ col gap-4`},x=`elevenlabs`,S=`eleven_multilingual_v2`;var C=o({__name:`elevenlabs`,setup(o){let y={similarityBoost:.75,stability:.5,speed:1,style:0,useSpeakerBoost:!0},C=l(0),w=l(1),T=l(0),E=l(0),D=l(.5),O=l(.75),k=l(!1),A=v(),j=e(),{providers:M}=r(j),{t:N}=n(),P=f(()=>!!M.value[x]?.apiKey),F=f(()=>A.availableVoices[x]||[]);async function I(e,t,n){let r=await j.getProviderInstance(x);if(!r)throw Error(`Failed to initialize speech provider`);let i=j.getProviderConfig(x),a=i.model||S;return await A.speech(r,a,e,t,{...i,...y})}return g(async()=>{let e=j.getProviderConfig(x),t=j.getProviderMetadata(x);await t.validators.validateProviderConfig(e)?await A.loadVoicesForProvider(x):console.error(`Failed to validate provider config`,e)}),m(C,async()=>{let e=j.getProviderConfig(x);e.pitch=C.value}),m(w,async()=>{let e=j.getProviderConfig(x);e.speed=w.value}),m(T,async()=>{let e=j.getProviderConfig(x);e.volume=T.value}),m(E,async()=>{let e=j.getProviderConfig(x);e.style=E.value}),m(D,async()=>{let e=j.getProviderConfig(x);e.stability=D.value}),m(O,async()=>{let e=j.getProviderConfig(x);e.similarityBoost=O.value}),m(k,async()=>{let e=j.getProviderConfig(x);e.useSpeakerBoost=k.value}),m(M,async()=>{let e=j.getProviderConfig(x),t=j.getProviderMetadata(x);await t.validators.validateProviderConfig(e)?await A.loadVoicesForProvider(x):console.error(`Failed to validate provider config`,e)},{immediate:!0}),(e,n)=>(h(),d(c(_),{"provider-id":x,"default-model":S,"additional-settings":y},{"voice-settings":s(()=>[u(`div`,b,[p(c(i),{modelValue:C.value,"onUpdate:modelValue":n[0]||=e=>C.value=e,label:c(N)(`settings.pages.providers.provider.common.fields.field.pitch.label`),description:c(N)(`settings.pages.providers.provider.common.fields.field.pitch.description`),min:-100,max:100,step:1,"format-value":e=>`${e}%`},null,8,[`modelValue`,`label`,`description`,`format-value`]),p(c(i),{modelValue:w.value,"onUpdate:modelValue":n[1]||=e=>w.value=e,label:c(N)(`settings.pages.providers.provider.common.fields.field.speed.label`),description:c(N)(`settings.pages.providers.provider.common.fields.field.speed.description`),min:.5,max:2,step:.01},null,8,[`modelValue`,`label`,`description`]),p(c(i),{modelValue:T.value,"onUpdate:modelValue":n[2]||=e=>T.value=e,label:c(N)(`settings.pages.providers.provider.common.fields.field.volume.label`),description:c(N)(`settings.pages.providers.provider.common.fields.field.volume.description`),min:-100,max:100,step:1,"format-value":e=>`${e}%`},null,8,[`modelValue`,`label`,`description`,`format-value`]),p(c(i),{modelValue:E.value,"onUpdate:modelValue":n[3]||=e=>E.value=e,label:c(N)(`settings.pages.providers.provider.elevenlabs.fields.field.style.label`),description:c(N)(`settings.pages.providers.provider.elevenlabs.fields.field.style.description`),min:0,max:1,step:.01},null,8,[`modelValue`,`label`,`description`]),p(c(i),{modelValue:D.value,"onUpdate:modelValue":n[4]||=e=>D.value=e,label:c(N)(`settings.pages.providers.provider.elevenlabs.fields.field.stability.label`),description:c(N)(`settings.pages.providers.provider.elevenlabs.fields.field.stability.description`),min:0,max:1,step:.01},null,8,[`modelValue`,`label`,`description`]),p(c(i),{modelValue:O.value,"onUpdate:modelValue":n[5]||=e=>O.value=e,label:c(N)(`settings.pages.providers.provider.elevenlabs.fields.field.simularity-boost.label`),description:c(N)(`settings.pages.providers.provider.elevenlabs.fields.field.simularity-boost.description`),min:0,max:1,step:.01},null,8,[`modelValue`,`label`,`description`]),p(c(a),{modelValue:k.value,"onUpdate:modelValue":n[6]||=e=>k.value=e,label:c(N)(`settings.pages.providers.provider.elevenlabs.fields.field.speaker-boost.label`),description:c(N)(`settings.pages.providers.provider.elevenlabs.fields.field.speaker-boost.description`)},null,8,[`modelValue`,`label`,`description`])])]),playground:s(()=>[p(c(t),{"available-voices":F.value,"generate-speech":I,"api-key-configured":P.value,"default-text":`Hello! This is a test of the ElevenLabs voice synthesis.`},null,8,[`available-voices`,`api-key-configured`])]),_:1}))}});typeof y==`function`&&y(C);var w=C;export{w as default}; \ No newline at end of file diff --git a/assets/emotions-BijqzfJR.js b/assets/emotions-BijqzfJR.js deleted file mode 100644 index 5f4c0c1bc2620459d0206d93274633dd68d6c305..0000000000000000000000000000000000000000 --- a/assets/emotions-BijqzfJR.js +++ /dev/null @@ -1 +0,0 @@ -import"./Basic-BIq-Of0k.js";import{b as e}from"./Textarea-BFPvaePN.js";import{_ as t,a2 as n,aB as r,d9 as i,dD as a,dI as o,dN as s,de as c,di as l,dm as u,dp as d,du as f,dv as p}from"./index-Bcb2irKh.js";const m={flex:``,"flex-col":``,"gap-2":``,"p-2":``},h={flex:``,"flex-row":``,"gap-2":``},g={"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-4":``},_={"w-full":``,flex:``,"flex-row":``,"gap-4":``},v={"w-full":``,"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-2":``},y={"w-full":``,"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-2":``};var b=u({__name:`emotions`,setup(u){let b=o(``),x=o([]),S=o([]),C=o(!1),w=n({handlers:[async e=>{S.value.push(e.data)}]}),T=t(w);function E(){C.value=!0;let e=b.value.split(``);for(let t of e)T.add(t);T.add(r),b.value=``,C.value=!1}return(t,n)=>(l(),d(`div`,m,[f(`div`,h,[c(a(e),{modelValue:b.value,"onUpdate:modelValue":n[0]||=e=>b.value=e,placeholder:`Message`,p:`2`,bg:`neutral-100 dark:neutral-700`,"w-full":``,"rounded-lg":``,"outline-none":``,onSubmit:E},null,8,[`modelValue`]),f(`button`,g,s(C.value?`Processing...`:`Send`),1)]),f(`div`,_,[f(`div`,v,[n[1]||=f(`h3`,{"font-normal":``},` Messages `,-1),(l(!0),d(i,null,p(x.value,e=>(l(),d(`div`,{key:e},[f(`div`,null,s(e),1)]))),128))]),f(`div`,y,[n[2]||=f(`h3`,{"font-normal":``},` Emotions `,-1),(l(!0),d(i,null,p(S.value,e=>(l(),d(`div`,{key:e},[f(`div`,null,s(e),1)]))),128))])])]))}}),x=b;export{x as default}; \ No newline at end of file diff --git a/assets/emotions-DpXE-YF0.js b/assets/emotions-DpXE-YF0.js new file mode 100644 index 0000000000000000000000000000000000000000..5959764d011a24e36d2ee3c46fa057350735dfd5 --- /dev/null +++ b/assets/emotions-DpXE-YF0.js @@ -0,0 +1 @@ +import"./Basic-8xhCMoI8.js";import{b as e}from"./Textarea-BsLlwm-1.js";import{Z as t,a2 as n,aB as r,d6 as i,d9 as a,dF as o,dK as s,dN as c,de as l,df as u,do as d,dt as f,dx as p}from"./index-TXtvn0DM.js";const m={flex:``,"flex-col":``,"gap-2":``,"p-2":``},h={flex:``,"flex-row":``,"gap-2":``},g={"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-4":``},_={"w-full":``,flex:``,"flex-row":``,"gap-4":``},v={"w-full":``,"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-2":``},y={"w-full":``,"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-2":``};var b=i({__name:`emotions`,setup(i){let b=s(``),x=s([]),S=s([]),C=s(!1),w=n({handlers:[async e=>{S.value.push(e.data)}]}),T=t(w);function E(){C.value=!0;let e=b.value.split(``);for(let t of e)T.add(t);T.add(r),b.value=``,C.value=!1}return(t,n)=>(p(),a(`div`,m,[l(`div`,h,[f(o(e),{modelValue:b.value,"onUpdate:modelValue":n[0]||=e=>b.value=e,placeholder:`Message`,p:`2`,bg:`neutral-100 dark:neutral-700`,"w-full":``,"rounded-lg":``,"outline-none":``,onSubmit:E},null,8,[`modelValue`]),l(`button`,g,c(C.value?`Processing...`:`Send`),1)]),l(`div`,_,[l(`div`,v,[n[1]||=l(`h3`,{"font-normal":``},` Messages `,-1),(p(!0),a(d,null,u(x.value,e=>(p(),a(`div`,{key:e},[l(`div`,null,c(e),1)]))),128))]),l(`div`,y,[n[2]||=l(`h3`,{"font-normal":``},` Emotions `,-1),(p(!0),a(d,null,u(S.value,e=>(p(),a(`div`,{key:e},[l(`div`,null,c(e),1)]))),128))])])]))}}),x=b;export{x as default}; \ No newline at end of file diff --git a/assets/esm-lKof8WUt.js b/assets/esm-4AUyG2HJ.js similarity index 99% rename from assets/esm-lKof8WUt.js rename to assets/esm-4AUyG2HJ.js index 093fc59ea1ece3312db8efaa21419bbe8a5b6935..16c2d8e3bec621158b5c9b33672d6e0ce1fae9f7 100644 --- a/assets/esm-lKof8WUt.js +++ b/assets/esm-4AUyG2HJ.js @@ -1,3 +1,3 @@ -import{D as e}from"./index-Bcb2irKh.js";const t=Symbol(`Let zodToJsonSchema decide on which parser to use`),n={name:void 0,$refStrategy:`root`,basePath:[`#`],effectStrategy:`input`,pipeStrategy:`all`,dateStrategy:`format:date-time`,mapStrategy:`entries`,removeAdditionalStrategy:`passthrough`,allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:`definitions`,target:`jsonSchema7`,strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:`escape`,applyRegexFlags:!1,emailStrategy:`format:email`,base64Strategy:`contentEncoding:base64`,nameStrategy:`ref`,openAiAnyTypeName:`OpenAiAnyType`},r=e=>typeof e==`string`?{...n,name:e}:{...n,...e},i=e=>{let t=r(e),n=t.name===void 0?t.basePath:[...t.basePath,t.definitionPath,t.name];return{...t,flags:{hasReferencedOpenAiAnyType:!1},currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([e,n])=>[n._def,{def:n._def,path:[...t.basePath,t.definitionPath,e],jsonSchema:void 0}]))}};function a(e,t,n,r){r?.errorMessages&&n&&(e.errorMessage={...e.errorMessage,[t]:n})}function o(e,t,n,r,i){e[t]=n,a(e,t,r,i)}const s=(e,t)=>{let n=0;for(;n$(e.innerType._def,t);function m(e,t,n){let r=n??t.dateStrategy;if(Array.isArray(r))return{anyOf:r.map((n,r)=>m(e,t,n))};switch(r){case`string`:case`format:date-time`:return{type:`string`,format:`date-time`};case`format:date`:return{type:`string`,format:`date`};case`integer`:return h(e,t)}}const h=(e,t)=>{let n={type:`integer`,format:`unix-time`};if(t.target===`openApi3`)return n;for(let r of e.checks)switch(r.kind){case`min`:o(n,`minimum`,r.value,r.message,t);break;case`max`:o(n,`maximum`,r.value,r.message,t);break}return n};function g(e,t){return{...$(e.innerType._def,t),default:e.defaultValue()}}function _(e,t){return t.effectStrategy===`input`?$(e.schema._def,t):c(t)}function v(e){return{type:`string`,enum:Array.from(e.values)}}const y=e=>`type`in e&&e.type===`string`?!1:`allOf`in e;function b(e,t){let n=[$(e.left._def,{...t,currentPath:[...t.currentPath,`allOf`,`0`]}),$(e.right._def,{...t,currentPath:[...t.currentPath,`allOf`,`1`]})].filter(e=>!!e),r=t.target===`jsonSchema2019-09`?{unevaluatedProperties:!1}:void 0,i=[];return n.forEach(e=>{if(y(e))i.push(...e.allOf),e.unevaluatedProperties===void 0&&(r=void 0);else{let t=e;if(`additionalProperties`in e&&e.additionalProperties===!1){let{additionalProperties:n,...r}=e;t=r}else r=void 0;i.push(t)}}),i.length?{allOf:i,...r}:void 0}function x(e,t){let n=typeof e.value;return n!==`bigint`&&n!==`number`&&n!==`boolean`&&n!==`string`?{type:Array.isArray(e.value)?`array`:`object`}:t.target===`openApi3`?{type:n===`bigint`?`integer`:n,enum:[e.value]}:{type:n===`bigint`?`integer`:n,const:e.value}}let S;const C={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(S===void 0&&(S=RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`)),S),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function w(e,t){let n={type:`string`};if(e.checks)for(let r of e.checks)switch(r.kind){case`min`:o(n,`minLength`,typeof n.minLength==`number`?Math.max(n.minLength,r.value):r.value,r.message,t);break;case`max`:o(n,`maxLength`,typeof n.maxLength==`number`?Math.min(n.maxLength,r.value):r.value,r.message,t);break;case`email`:switch(t.emailStrategy){case`format:email`:O(n,`email`,r.message,t);break;case`format:idn-email`:O(n,`idn-email`,r.message,t);break;case`pattern:zod`:k(n,C.email,r.message,t);break}break;case`url`:O(n,`uri`,r.message,t);break;case`uuid`:O(n,`uuid`,r.message,t);break;case`regex`:k(n,r.regex,r.message,t);break;case`cuid`:k(n,C.cuid,r.message,t);break;case`cuid2`:k(n,C.cuid2,r.message,t);break;case`startsWith`:k(n,RegExp(`^${T(r.value,t)}`),r.message,t);break;case`endsWith`:k(n,RegExp(`${T(r.value,t)}$`),r.message,t);break;case`datetime`:O(n,`date-time`,r.message,t);break;case`date`:O(n,`date`,r.message,t);break;case`time`:O(n,`time`,r.message,t);break;case`duration`:O(n,`duration`,r.message,t);break;case`length`:o(n,`minLength`,typeof n.minLength==`number`?Math.max(n.minLength,r.value):r.value,r.message,t),o(n,`maxLength`,typeof n.maxLength==`number`?Math.min(n.maxLength,r.value):r.value,r.message,t);break;case`includes`:k(n,RegExp(T(r.value,t)),r.message,t);break;case`ip`:r.version!==`v6`&&O(n,`ipv4`,r.message,t),r.version!==`v4`&&O(n,`ipv6`,r.message,t);break;case`base64url`:k(n,C.base64url,r.message,t);break;case`jwt`:k(n,C.jwt,r.message,t);break;case`cidr`:r.version!==`v6`&&k(n,C.ipv4Cidr,r.message,t),r.version!==`v4`&&k(n,C.ipv6Cidr,r.message,t);break;case`emoji`:k(n,C.emoji(),r.message,t);break;case`ulid`:k(n,C.ulid,r.message,t);break;case`base64`:switch(t.base64Strategy){case`format:binary`:O(n,`binary`,r.message,t);break;case`contentEncoding:base64`:o(n,`contentEncoding`,`base64`,r.message,t);break;case`pattern:zod`:k(n,C.base64,r.message,t);break}break;case`nanoid`:k(n,C.nanoid,r.message,t);case`toLowerCase`:case`toUpperCase`:case`trim`:break;default:(e=>{})(r)}return n}function T(e,t){return t.patternStrategy===`escape`?D(e):e}const E=new Set(`ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789`);function D(e){let t=``;for(let n=0;ne.format)?(e.anyOf||=[],e.format&&(e.anyOf.push({format:e.format,...e.errorMessage&&r.errorMessages&&{errorMessage:{format:e.errorMessage.format}}}),delete e.format,e.errorMessage&&(delete e.errorMessage.format,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.anyOf.push({format:t,...n&&r.errorMessages&&{errorMessage:{format:n}}})):o(e,`format`,t,n,r)}function k(e,t,n,r){e.pattern||e.allOf?.some(e=>e.pattern)?(e.allOf||=[],e.pattern&&(e.allOf.push({pattern:e.pattern,...e.errorMessage&&r.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}}}),delete e.pattern,e.errorMessage&&(delete e.errorMessage.pattern,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.allOf.push({pattern:A(t,r),...n&&r.errorMessages&&{errorMessage:{pattern:n}}})):o(e,`pattern`,A(t,r),n,r)}function A(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;let n={i:e.flags.includes(`i`),m:e.flags.includes(`m`),s:e.flags.includes(`s`)},r=n.i?e.source.toLowerCase():e.source,i=``,a=!1,o=!1,s=!1;for(let e=0;etypeof e==`string`?{...n,name:e}:{...n,...e},i=e=>{let t=r(e),n=t.name===void 0?t.basePath:[...t.basePath,t.definitionPath,t.name];return{...t,flags:{hasReferencedOpenAiAnyType:!1},currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([e,n])=>[n._def,{def:n._def,path:[...t.basePath,t.definitionPath,e],jsonSchema:void 0}]))}};function a(e,t,n,r){r?.errorMessages&&n&&(e.errorMessage={...e.errorMessage,[t]:n})}function o(e,t,n,r,i){e[t]=n,a(e,t,r,i)}const s=(e,t)=>{let n=0;for(;n$(e.innerType._def,t);function m(e,t,n){let r=n??t.dateStrategy;if(Array.isArray(r))return{anyOf:r.map((n,r)=>m(e,t,n))};switch(r){case`string`:case`format:date-time`:return{type:`string`,format:`date-time`};case`format:date`:return{type:`string`,format:`date`};case`integer`:return h(e,t)}}const h=(e,t)=>{let n={type:`integer`,format:`unix-time`};if(t.target===`openApi3`)return n;for(let r of e.checks)switch(r.kind){case`min`:o(n,`minimum`,r.value,r.message,t);break;case`max`:o(n,`maximum`,r.value,r.message,t);break}return n};function g(e,t){return{...$(e.innerType._def,t),default:e.defaultValue()}}function _(e,t){return t.effectStrategy===`input`?$(e.schema._def,t):c(t)}function v(e){return{type:`string`,enum:Array.from(e.values)}}const y=e=>`type`in e&&e.type===`string`?!1:`allOf`in e;function b(e,t){let n=[$(e.left._def,{...t,currentPath:[...t.currentPath,`allOf`,`0`]}),$(e.right._def,{...t,currentPath:[...t.currentPath,`allOf`,`1`]})].filter(e=>!!e),r=t.target===`jsonSchema2019-09`?{unevaluatedProperties:!1}:void 0,i=[];return n.forEach(e=>{if(y(e))i.push(...e.allOf),e.unevaluatedProperties===void 0&&(r=void 0);else{let t=e;if(`additionalProperties`in e&&e.additionalProperties===!1){let{additionalProperties:n,...r}=e;t=r}else r=void 0;i.push(t)}}),i.length?{allOf:i,...r}:void 0}function x(e,t){let n=typeof e.value;return n!==`bigint`&&n!==`number`&&n!==`boolean`&&n!==`string`?{type:Array.isArray(e.value)?`array`:`object`}:t.target===`openApi3`?{type:n===`bigint`?`integer`:n,enum:[e.value]}:{type:n===`bigint`?`integer`:n,const:e.value}}let S;const C={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(S===void 0&&(S=RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`)),S),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function w(e,t){let n={type:`string`};if(e.checks)for(let r of e.checks)switch(r.kind){case`min`:o(n,`minLength`,typeof n.minLength==`number`?Math.max(n.minLength,r.value):r.value,r.message,t);break;case`max`:o(n,`maxLength`,typeof n.maxLength==`number`?Math.min(n.maxLength,r.value):r.value,r.message,t);break;case`email`:switch(t.emailStrategy){case`format:email`:O(n,`email`,r.message,t);break;case`format:idn-email`:O(n,`idn-email`,r.message,t);break;case`pattern:zod`:k(n,C.email,r.message,t);break}break;case`url`:O(n,`uri`,r.message,t);break;case`uuid`:O(n,`uuid`,r.message,t);break;case`regex`:k(n,r.regex,r.message,t);break;case`cuid`:k(n,C.cuid,r.message,t);break;case`cuid2`:k(n,C.cuid2,r.message,t);break;case`startsWith`:k(n,RegExp(`^${T(r.value,t)}`),r.message,t);break;case`endsWith`:k(n,RegExp(`${T(r.value,t)}$`),r.message,t);break;case`datetime`:O(n,`date-time`,r.message,t);break;case`date`:O(n,`date`,r.message,t);break;case`time`:O(n,`time`,r.message,t);break;case`duration`:O(n,`duration`,r.message,t);break;case`length`:o(n,`minLength`,typeof n.minLength==`number`?Math.max(n.minLength,r.value):r.value,r.message,t),o(n,`maxLength`,typeof n.maxLength==`number`?Math.min(n.maxLength,r.value):r.value,r.message,t);break;case`includes`:k(n,RegExp(T(r.value,t)),r.message,t);break;case`ip`:r.version!==`v6`&&O(n,`ipv4`,r.message,t),r.version!==`v4`&&O(n,`ipv6`,r.message,t);break;case`base64url`:k(n,C.base64url,r.message,t);break;case`jwt`:k(n,C.jwt,r.message,t);break;case`cidr`:r.version!==`v6`&&k(n,C.ipv4Cidr,r.message,t),r.version!==`v4`&&k(n,C.ipv6Cidr,r.message,t);break;case`emoji`:k(n,C.emoji(),r.message,t);break;case`ulid`:k(n,C.ulid,r.message,t);break;case`base64`:switch(t.base64Strategy){case`format:binary`:O(n,`binary`,r.message,t);break;case`contentEncoding:base64`:o(n,`contentEncoding`,`base64`,r.message,t);break;case`pattern:zod`:k(n,C.base64,r.message,t);break}break;case`nanoid`:k(n,C.nanoid,r.message,t);case`toLowerCase`:case`toUpperCase`:case`trim`:break;default:(e=>{})(r)}return n}function T(e,t){return t.patternStrategy===`escape`?D(e):e}const E=new Set(`ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789`);function D(e){let t=``;for(let n=0;ne.format)?(e.anyOf||=[],e.format&&(e.anyOf.push({format:e.format,...e.errorMessage&&r.errorMessages&&{errorMessage:{format:e.errorMessage.format}}}),delete e.format,e.errorMessage&&(delete e.errorMessage.format,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.anyOf.push({format:t,...n&&r.errorMessages&&{errorMessage:{format:n}}})):o(e,`format`,t,n,r)}function k(e,t,n,r){e.pattern||e.allOf?.some(e=>e.pattern)?(e.allOf||=[],e.pattern&&(e.allOf.push({pattern:e.pattern,...e.errorMessage&&r.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}}}),delete e.pattern,e.errorMessage&&(delete e.errorMessage.pattern,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.allOf.push({pattern:A(t,r),...n&&r.errorMessages&&{errorMessage:{pattern:n}}})):o(e,`pattern`,A(t,r),n,r)}function A(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;let n={i:e.flags.includes(`i`),m:e.flags.includes(`m`),s:e.flags.includes(`s`)},r=n.i?e.source.toLowerCase():e.source,i=``,a=!1,o=!1,s=!1;for(let e=0;e({...e,[r]:$(t.valueType._def,{...n,currentPath:[...n.currentPath,`properties`,r]})??c(n)}),{}),additionalProperties:n.rejectedAdditionalProperties};let r={type:`object`,additionalProperties:$(t.valueType._def,{...n,currentPath:[...n.currentPath,`additionalProperties`]})??n.allowedAdditionalProperties};if(n.target===`openApi3`)return r;if(t.keyType?._def.typeName===e.ZodString&&t.keyType._def.checks?.length){let{type:e,...i}=w(t.keyType._def,n);return{...r,propertyNames:i}}else if(t.keyType?._def.typeName===e.ZodEnum)return{...r,propertyNames:{enum:t.keyType._def.values}};else if(t.keyType?._def.typeName===e.ZodBranded&&t.keyType._def.type._def.typeName===e.ZodString&&t.keyType._def.type._def.checks?.length){let{type:e,...i}=f(t.keyType._def,n);return{...r,propertyNames:i}}return r}function M(e,t){if(t.mapStrategy===`record`)return j(e,t);let n=$(e.keyType._def,{...t,currentPath:[...t.currentPath,`items`,`items`,`0`]})||c(t),r=$(e.valueType._def,{...t,currentPath:[...t.currentPath,`items`,`items`,`1`]})||c(t);return{type:`array`,maxItems:125,items:{type:`array`,items:[n,r],minItems:2,maxItems:2}}}function N(e){let t=e.values,n=Object.keys(e.values).filter(e=>typeof t[t[e]]!=`number`),r=n.map(e=>t[e]),i=Array.from(new Set(r.map(e=>typeof e)));return{type:i.length===1?i[0]===`string`?`string`:`number`:[`string`,`number`],enum:r}}function P(e){return e.target===`openAi`?void 0:{not:c({...e,currentPath:[...e.currentPath,`not`]})}}function F(e){return e.target===`openApi3`?{enum:[`null`],nullable:!0}:{type:`null`}}const I={ZodString:`string`,ZodNumber:`number`,ZodBigInt:`integer`,ZodBoolean:`boolean`,ZodNull:`null`};function L(e,t){if(t.target===`openApi3`)return R(e,t);let n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every(e=>e._def.typeName in I&&(!e._def.checks||!e._def.checks.length))){let e=n.reduce((e,t)=>{let n=I[t._def.typeName];return n&&!e.includes(n)?[...e,n]:e},[]);return{type:e.length>1?e:e[0]}}else if(n.every(e=>e._def.typeName===`ZodLiteral`&&!e.description)){let e=n.reduce((e,t)=>{let n=typeof t._def.value;switch(n){case`string`:case`number`:case`boolean`:return[...e,n];case`bigint`:return[...e,`integer`];case`object`:if(t._def.value===null)return[...e,`null`];case`symbol`:case`undefined`:case`function`:default:return e}},[]);if(e.length===n.length){let t=e.filter((e,t,n)=>n.indexOf(e)===t);return{type:t.length>1?t:t[0],enum:n.reduce((e,t)=>e.includes(t._def.value)?e:[...e,t._def.value],[])}}}else if(n.every(e=>e._def.typeName===`ZodEnum`))return{type:`string`,enum:n.reduce((e,t)=>[...e,...t._def.values.filter(t=>!e.includes(t))],[])};return R(e,t)}const R=(e,t)=>{let n=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((e,n)=>$(e._def,{...t,currentPath:[...t.currentPath,`anyOf`,`${n}`]})).filter(e=>!!e&&(!t.strictUnions||typeof e==`object`&&Object.keys(e).length>0));return n.length?{anyOf:n}:void 0};function z(e,t){if([`ZodString`,`ZodNumber`,`ZodBigInt`,`ZodBoolean`,`ZodNull`].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return t.target===`openApi3`?{type:I[e.innerType._def.typeName],nullable:!0}:{type:[I[e.innerType._def.typeName],`null`]};if(t.target===`openApi3`){let n=$(e.innerType._def,{...t,currentPath:[...t.currentPath]});return n&&`$ref`in n?{allOf:[n],nullable:!0}:n&&{...n,nullable:!0}}let n=$(e.innerType._def,{...t,currentPath:[...t.currentPath,`anyOf`,`0`]});return n&&{anyOf:[n,{type:`null`}]}}function B(e,t){let n={type:`number`};if(!e.checks)return n;for(let r of e.checks)switch(r.kind){case`int`:n.type=`integer`,a(n,`type`,r.message,t);break;case`min`:t.target===`jsonSchema7`?r.inclusive?o(n,`minimum`,r.value,r.message,t):o(n,`exclusiveMinimum`,r.value,r.message,t):(r.inclusive||(n.exclusiveMinimum=!0),o(n,`minimum`,r.value,r.message,t));break;case`max`:t.target===`jsonSchema7`?r.inclusive?o(n,`maximum`,r.value,r.message,t):o(n,`exclusiveMaximum`,r.value,r.message,t):(r.inclusive||(n.exclusiveMaximum=!0),o(n,`maximum`,r.value,r.message,t));break;case`multipleOf`:o(n,`multipleOf`,r.value,r.message,t);break}return n}function V(e,t){let n=t.target===`openAi`,r={type:`object`,properties:{}},i=[],a=e.shape();for(let e in a){let o=a[e];if(o===void 0||o._def===void 0)continue;let s=U(o);s&&n&&(o._def.typeName===`ZodOptional`&&(o=o._def.innerType),o.isNullable()||(o=o.nullable()),s=!1);let c=$(o._def,{...t,currentPath:[...t.currentPath,`properties`,e],propertyPath:[...t.currentPath,`properties`,e]});if(c===void 0)continue;r.properties[e]=c,s||i.push(e)}i.length&&(r.required=i);let o=H(e,t);return o!==void 0&&(r.additionalProperties=o),r}function H(e,t){if(e.catchall._def.typeName!==`ZodNever`)return $(e.catchall._def,{...t,currentPath:[...t.currentPath,`additionalProperties`]});switch(e.unknownKeys){case`passthrough`:return t.allowedAdditionalProperties;case`strict`:return t.rejectedAdditionalProperties;case`strip`:return t.removeAdditionalStrategy===`strict`?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function U(e){try{return e.isOptional()}catch{return!0}}const W=(e,t)=>{if(t.currentPath.toString()===t.propertyPath?.toString())return $(e.innerType._def,t);let n=$(e.innerType._def,{...t,currentPath:[...t.currentPath,`anyOf`,`1`]});return n?{anyOf:[{not:c(t)},n]}:c(t)},G=(e,t)=>{if(t.pipeStrategy===`input`)return $(e.in._def,t);if(t.pipeStrategy===`output`)return $(e.out._def,t);let n=$(e.in._def,{...t,currentPath:[...t.currentPath,`allOf`,`0`]}),r=$(e.out._def,{...t,currentPath:[...t.currentPath,`allOf`,n?`1`:`0`]});return{allOf:[n,r].filter(e=>e!==void 0)}};function K(e,t){return $(e.type._def,t)}function q(e,t){let n=$(e.valueType._def,{...t,currentPath:[...t.currentPath,`items`]}),r={type:`array`,uniqueItems:!0,items:n};return e.minSize&&o(r,`minItems`,e.minSize.value,e.minSize.message,t),e.maxSize&&o(r,`maxItems`,e.maxSize.value,e.maxSize.message,t),r}function J(e,t){return e.rest?{type:`array`,minItems:e.items.length,items:e.items.map((e,n)=>$(e._def,{...t,currentPath:[...t.currentPath,`items`,`${n}`]})).reduce((e,t)=>t===void 0?e:[...e,t],[]),additionalItems:$(e.rest._def,{...t,currentPath:[...t.currentPath,`additionalItems`]})}:{type:`array`,minItems:e.items.length,maxItems:e.items.length,items:e.items.map((e,n)=>$(e._def,{...t,currentPath:[...t.currentPath,`items`,`${n}`]})).reduce((e,t)=>t===void 0?e:[...e,t],[])}}function Y(e){return{not:c(e)}}function X(e){return c(e)}const Z=(e,t)=>$(e.innerType._def,t),Q=(t,n,r)=>{switch(n){case e.ZodString:return w(t,r);case e.ZodNumber:return B(t,r);case e.ZodObject:return V(t,r);case e.ZodBigInt:return u(t,r);case e.ZodBoolean:return d();case e.ZodDate:return m(t,r);case e.ZodUndefined:return Y(r);case e.ZodNull:return F(r);case e.ZodArray:return l(t,r);case e.ZodUnion:case e.ZodDiscriminatedUnion:return L(t,r);case e.ZodIntersection:return b(t,r);case e.ZodTuple:return J(t,r);case e.ZodRecord:return j(t,r);case e.ZodLiteral:return x(t,r);case e.ZodEnum:return v(t);case e.ZodNativeEnum:return N(t);case e.ZodNullable:return z(t,r);case e.ZodOptional:return W(t,r);case e.ZodMap:return M(t,r);case e.ZodSet:return q(t,r);case e.ZodLazy:return()=>t.getter()._def;case e.ZodPromise:return K(t,r);case e.ZodNaN:case e.ZodNever:return P(r);case e.ZodEffects:return _(t,r);case e.ZodAny:return c(r);case e.ZodUnknown:return X(r);case e.ZodDefault:return g(t,r);case e.ZodBranded:return f(t,r);case e.ZodReadonly:return Z(t,r);case e.ZodCatch:return p(t,r);case e.ZodPipeline:return G(t,r);case e.ZodFunction:case e.ZodVoid:case e.ZodSymbol:return;default:return(e=>void 0)(n)}};function $(e,n,r=!1){let i=n.seen.get(e);if(n.override){let a=n.override?.(e,n,i,r);if(a!==t)return a}if(i&&!r){let e=ee(i,n);if(e!==void 0)return e}let a={def:e,path:n.currentPath,jsonSchema:void 0};n.seen.set(e,a);let o=Q(e,e.typeName,n),s=typeof o==`function`?$(o(),n):o;if(s&&te(e,n,s),n.postProcess){let t=n.postProcess(s,e,n);return a.jsonSchema=s,t}return a.jsonSchema=s,s}const ee=(e,t)=>{switch(t.$refStrategy){case`root`:return{$ref:e.path.join(`/`)};case`relative`:return{$ref:s(t.currentPath,e.path)};case`none`:case`seen`:return e.path.lengtht.currentPath[n]===e)?(console.warn(`Recursive reference detected at ${t.currentPath.join(`/`)}! Defaulting to any`),c(t)):t.$refStrategy===`seen`?c(t):void 0}},te=(e,t,n)=>(e.description&&(n.description=e.description,t.markdownDescription&&(n.markdownDescription=e.description)),n),ne=(e,t)=>{let n=i(t),r=typeof t==`object`&&t.definitions?Object.entries(t.definitions).reduce((e,[t,r])=>({...e,[t]:$(r._def,{...n,currentPath:[...n.basePath,n.definitionPath,t]},!0)??c(n)}),{}):void 0,a=typeof t==`string`?t:t?.nameStrategy===`title`?void 0:t?.name,o=$(e._def,a===void 0?n:{...n,currentPath:[...n.basePath,n.definitionPath,a]},!1)??c(n),s=typeof t==`object`&&t.name!==void 0&&t.nameStrategy===`title`?t.name:void 0;s!==void 0&&(o.title=s),n.flags.hasReferencedOpenAiAnyType&&(r||={},r[n.openAiAnyTypeName]||(r[n.openAiAnyTypeName]={type:[`string`,`number`,`integer`,`boolean`,`array`,`null`],items:{$ref:n.$refStrategy===`relative`?`1`:[...n.basePath,n.definitionPath,n.openAiAnyTypeName].join(`/`)}}));let l=a===void 0?r?{...o,[n.definitionPath]:r}:o:{$ref:[...n.$refStrategy===`relative`?[]:n.basePath,n.definitionPath,a].join(`/`),[n.definitionPath]:{...r,[a]:o}};return n.target===`jsonSchema7`?l.$schema=`http://json-schema.org/draft-07/schema#`:(n.target===`jsonSchema2019-09`||n.target===`openAi`)&&(l.$schema=`https://json-schema.org/draft/2019-09/schema#`),n.target===`openAi`&&(`anyOf`in l||`oneOf`in l||`allOf`in l||`type`in l&&Array.isArray(l.type))&&console.warn(`Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property.`),l};export{a as addErrorMessage,n as defaultOptions,r as getDefaultOptions,i as getRefs,s as getRelativePath,t as ignoreOverride,c as parseAnyDef,l as parseArrayDef,u as parseBigintDef,d as parseBooleanDef,f as parseBrandedDef,p as parseCatchDef,m as parseDateDef,$ as parseDef,g as parseDefaultDef,_ as parseEffectsDef,v as parseEnumDef,b as parseIntersectionDef,x as parseLiteralDef,M as parseMapDef,N as parseNativeEnumDef,P as parseNeverDef,F as parseNullDef,z as parseNullableDef,B as parseNumberDef,V as parseObjectDef,W as parseOptionalDef,G as parsePipelineDef,K as parsePromiseDef,Z as parseReadonlyDef,j as parseRecordDef,q as parseSetDef,w as parseStringDef,J as parseTupleDef,Y as parseUndefinedDef,L as parseUnionDef,X as parseUnknownDef,I as primitiveMappings,Q as selectParser,o as setResponseValueAndErrors,C as zodPatterns,ne as zodToJsonSchema}; \ No newline at end of file diff --git a/assets/featherless-ai-CQeyDKta.js b/assets/featherless-ai-CQeyDKta.js deleted file mode 100644 index e1cd08b628e11a815959f777c985aeb33b180370..0000000000000000000000000000000000000000 --- a/assets/featherless-ai-CQeyDKta.js +++ /dev/null @@ -1 +0,0 @@ -import{B as e,a3 as t,a4 as n,a5 as r,a6 as i,a7 as a,a8 as o,a9 as s,aM as c,aR as l,dD as u,da as d,de as f,dg as p,di as m,dk as h,dm as g,do as _,dy as v}from"./index-Bcb2irKh.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b=`featherless-ai`;var x=g({__name:`featherless-ai`,setup(g){let{t:y}=o(),x=c(),S=e(),{providers:C}=l(S),w=d(()=>S.getProviderMetadata(b)),T=d({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=d({get:()=>C.value[b]?.baseUrl||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});h(()=>{S.initializeProvider(b),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||``}),p([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||``}});function D(){C.value[b]={...w.value?.defaultOptions}}return(e,o)=>(m(),v(u(t),{"provider-name":w.value?.localizedName,"provider-icon":w.value?.icon,"on-back":()=>u(x).back()},{default:_(()=>[f(u(n),null,{default:_(()=>[f(u(r),{title:u(y)(`settings.pages.providers.common.section.basic.title`),description:u(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:_(()=>[f(u(a),{modelValue:T.value,"onUpdate:modelValue":o[0]||=e=>T.value=e,"provider-name":w.value?.localizedName,placeholder:`fw-...`},null,8,[`modelValue`,`provider-name`])]),_:1},8,[`title`,`description`]),f(u(s),{title:u(y)(`settings.pages.providers.common.section.advanced.title`)},{default:_(()=>[f(u(i),{modelValue:E.value,"onUpdate:modelValue":o[1]||=e=>E.value=e,placeholder:`https://api.featherless.ai/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`]))}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file diff --git a/assets/featherless-ai-D0EyBsme.js b/assets/featherless-ai-D0EyBsme.js new file mode 100644 index 0000000000000000000000000000000000000000..1de702667fae04130a1663a2e904d2a6f2f573e1 --- /dev/null +++ b/assets/featherless-ai-D0EyBsme.js @@ -0,0 +1 @@ +import{B as e,a3 as t,a4 as n,a5 as r,a6 as i,a7 as a,a8 as o,a9 as s,aM as c,aR as l,d6 as u,d8 as d,dF as f,di as p,dp as m,dt as h,dv as g,dx as _,dz as v}from"./index-TXtvn0DM.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b=`featherless-ai`;var x=u({__name:`featherless-ai`,setup(u){let{t:y}=o(),x=c(),S=e(),{providers:C}=l(S),w=m(()=>S.getProviderMetadata(b)),T=m({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=m({get:()=>C.value[b]?.baseUrl||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});v(()=>{S.initializeProvider(b),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||``}),g([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||``}});function D(){C.value[b]={...w.value?.defaultOptions}}return(e,o)=>(_(),p(f(t),{"provider-name":w.value?.localizedName,"provider-icon":w.value?.icon,"on-back":()=>f(x).back()},{default:d(()=>[h(f(n),null,{default:d(()=>[h(f(r),{title:f(y)(`settings.pages.providers.common.section.basic.title`),description:f(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:d(()=>[h(f(a),{modelValue:T.value,"onUpdate:modelValue":o[0]||=e=>T.value=e,"provider-name":w.value?.localizedName,placeholder:`fw-...`},null,8,[`modelValue`,`provider-name`])]),_:1},8,[`title`,`description`]),h(f(s),{title:f(y)(`settings.pages.providers.common.section.advanced.title`)},{default:d(()=>[h(f(i),{modelValue:E.value,"onUpdate:modelValue":o[1]||=e=>E.value=e,placeholder:`https://api.featherless.ai/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`]))}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file diff --git a/assets/filter-message-BWzou1ED.js b/assets/filter-message-BWzou1ED.js new file mode 100644 index 0000000000000000000000000000000000000000..d2e04c34e5843e1b41d19b465010d7499400f002 --- /dev/null +++ b/assets/filter-message-BWzou1ED.js @@ -0,0 +1 @@ +import"./Basic-8xhCMoI8.js";import{b as e}from"./Textarea-BsLlwm-1.js";import{$ as t,d6 as n,d9 as r,dF as i,dK as a,dN as o,de as s,dt as c,dx as l}from"./index-TXtvn0DM.js";const u={flex:``,"flex-col":``,"gap-2":``,"p-2":``},d={flex:``,"flex-row":``,"gap-2":``},f={"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-4":``},p={"w-full":``,"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-2":``};var m=n({__name:`filter-message`,setup(n){let m=a(``),h=a(!1),g=a({content:``});async function _(){h.value=!0;let e=m.value.split(``),n=function(e){return e.Literal=`literal`,e.Special=`special`,e}({}),r=n.Literal,i=``;for(let a of e){await t(50);let e=r;a===`<`?e=n.Special:a===`>`&&(e=n.Literal),r===n.Literal&&e===n.Special&&(g.value.content+=i,i=``),r===n.Special&&e===n.Literal&&(i=``),r===n.Literal&&e===n.Literal&&(g.value.content+=a,i=``),r=e}i&&(g.value.content+=i),m.value=``,h.value=!1}return(t,n)=>(l(),r(`div`,u,[s(`div`,d,[c(i(e),{modelValue:m.value,"onUpdate:modelValue":n[0]||=e=>m.value=e,placeholder:`Message`,p:`2`,bg:`neutral-100 dark:neutral-700`,"w-full":``,"rounded-lg":``,"outline-none":``,onSubmit:_},null,8,[`modelValue`]),s(`button`,f,o(h.value?`Processing...`:`Send`),1)]),s(`div`,p,[n[1]||=s(`h3`,{"font-normal":``},` Streaming Message `,-1),s(`div`,null,o(g.value.content),1)])]))}}),h=m;export{h as default}; \ No newline at end of file diff --git a/assets/filter-message-lb-XLsxJ.js b/assets/filter-message-lb-XLsxJ.js deleted file mode 100644 index 91abc68528217a9a5c7498660d0af85056e35f47..0000000000000000000000000000000000000000 --- a/assets/filter-message-lb-XLsxJ.js +++ /dev/null @@ -1 +0,0 @@ -import"./Basic-BIq-Of0k.js";import{b as e}from"./Textarea-BFPvaePN.js";import{$ as t,dD as n,dI as r,dN as i,de as a,di as o,dm as s,dp as c,du as l}from"./index-Bcb2irKh.js";const u={flex:``,"flex-col":``,"gap-2":``,"p-2":``},d={flex:``,"flex-row":``,"gap-2":``},f={"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-4":``},p={"w-full":``,"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-2":``};var m=s({__name:`filter-message`,setup(s){let m=r(``),h=r(!1),g=r({content:``});async function _(){h.value=!0;let e=m.value.split(``),n=function(e){return e.Literal=`literal`,e.Special=`special`,e}({}),r=n.Literal,i=``;for(let a of e){await t(50);let e=r;a===`<`?e=n.Special:a===`>`&&(e=n.Literal),r===n.Literal&&e===n.Special&&(g.value.content+=i,i=``),r===n.Special&&e===n.Literal&&(i=``),r===n.Literal&&e===n.Literal&&(g.value.content+=a,i=``),r=e}i&&(g.value.content+=i),m.value=``,h.value=!1}return(t,r)=>(o(),c(`div`,u,[l(`div`,d,[a(n(e),{modelValue:m.value,"onUpdate:modelValue":r[0]||=e=>m.value=e,placeholder:`Message`,p:`2`,bg:`neutral-100 dark:neutral-700`,"w-full":``,"rounded-lg":``,"outline-none":``,onSubmit:_},null,8,[`modelValue`]),l(`button`,f,i(h.value?`Processing...`:`Send`),1)]),l(`div`,p,[r[1]||=l(`h3`,{"font-normal":``},` Streaming Message `,-1),l(`div`,null,i(g.value.content),1)])]))}}),h=m;export{h as default}; \ No newline at end of file diff --git a/assets/fireworks-ai-UvXpnZ_T.js b/assets/fireworks-ai-UvXpnZ_T.js new file mode 100644 index 0000000000000000000000000000000000000000..933bbb62ccb1d2f83305dacd4cb6fc26e44d3daa --- /dev/null +++ b/assets/fireworks-ai-UvXpnZ_T.js @@ -0,0 +1 @@ +import{B as e,a3 as t,a4 as n,a5 as r,a6 as i,a7 as a,a8 as o,a9 as s,aM as c,aR as l,d6 as u,d8 as d,dF as f,di as p,dp as m,dt as h,dv as g,dx as _,dz as v}from"./index-TXtvn0DM.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b=`fireworks-ai`;var x=u({__name:`fireworks-ai`,setup(u){let{t:y}=o(),x=c(),S=e(),{providers:C}=l(S),w=m(()=>S.getProviderMetadata(b)),T=m({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=m({get:()=>C.value[b]?.baseUrl||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});v(()=>{S.initializeProvider(b),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||``}),g([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||``}});function D(){C.value[b]={...w.value?.defaultOptions}}return(e,o)=>(_(),p(f(t),{"provider-name":w.value?.localizedName,"provider-icon":w.value?.icon,"on-back":()=>f(x).back()},{default:d(()=>[h(f(n),null,{default:d(()=>[h(f(r),{title:f(y)(`settings.pages.providers.common.section.basic.title`),description:f(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:d(()=>[h(f(a),{modelValue:T.value,"onUpdate:modelValue":o[0]||=e=>T.value=e,"provider-name":w.value?.localizedName,placeholder:`fw-...`},null,8,[`modelValue`,`provider-name`])]),_:1},8,[`title`,`description`]),h(f(s),{title:f(y)(`settings.pages.providers.common.section.advanced.title`)},{default:d(()=>[h(f(i),{modelValue:E.value,"onUpdate:modelValue":o[1]||=e=>E.value=e,placeholder:`https://api.fireworks.ai/inference/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`]))}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file diff --git a/assets/fireworks-ai-nFwpsnmc.js b/assets/fireworks-ai-nFwpsnmc.js deleted file mode 100644 index d47ddfc4027a9b7a5f0755f0e38c0cb0c2c5412d..0000000000000000000000000000000000000000 --- a/assets/fireworks-ai-nFwpsnmc.js +++ /dev/null @@ -1 +0,0 @@ -import{B as e,a3 as t,a4 as n,a5 as r,a6 as i,a7 as a,a8 as o,a9 as s,aM as c,aR as l,dD as u,da as d,de as f,dg as p,di as m,dk as h,dm as g,do as _,dy as v}from"./index-Bcb2irKh.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b=`fireworks-ai`;var x=g({__name:`fireworks-ai`,setup(g){let{t:y}=o(),x=c(),S=e(),{providers:C}=l(S),w=d(()=>S.getProviderMetadata(b)),T=d({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=d({get:()=>C.value[b]?.baseUrl||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});h(()=>{S.initializeProvider(b),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||``}),p([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||``}});function D(){C.value[b]={...w.value?.defaultOptions}}return(e,o)=>(m(),v(u(t),{"provider-name":w.value?.localizedName,"provider-icon":w.value?.icon,"on-back":()=>u(x).back()},{default:_(()=>[f(u(n),null,{default:_(()=>[f(u(r),{title:u(y)(`settings.pages.providers.common.section.basic.title`),description:u(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:_(()=>[f(u(a),{modelValue:T.value,"onUpdate:modelValue":o[0]||=e=>T.value=e,"provider-name":w.value?.localizedName,placeholder:`fw-...`},null,8,[`modelValue`,`provider-name`])]),_:1},8,[`title`,`description`]),f(u(s),{title:u(y)(`settings.pages.providers.common.section.advanced.title`)},{default:_(()=>[f(u(i),{modelValue:E.value,"onUpdate:modelValue":o[1]||=e=>E.value=e,placeholder:`https://api.fireworks.ai/inference/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`]))}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file diff --git a/assets/general-B5ZCNzAX.js b/assets/general-B5ZCNzAX.js new file mode 100644 index 0000000000000000000000000000000000000000..043f981ddd02c325cf612f989613a8b934947005 --- /dev/null +++ b/assets/general-B5ZCNzAX.js @@ -0,0 +1 @@ +import{a8 as e,aS as t,an as n,ao as r,as as i,ax as a,d6 as o,d8 as s,d9 as c,dF as l,dI as u,dN as d,de as f,di as p,dl as m,dt as h,dw as g,dx as _,dy as v,t as y}from"./index-TXtvn0DM.js";import{b}from"./route-block-DVyt-3Cw.js";const x={"rounded-lg":``,"bg-neutral-50":``,"p-4":``,"dark:bg-neutral-800":``,flex:`~ col gap-4`},S={text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[65dvh]`,"right--15":``,"z--1":``,initial:{scale:.9,opacity:0,rotate:30},enter:{scale:1,opacity:1,rotate:0},duration:250,flex:``,"items-center":``,"justify-center":``};var C=o({__name:`general`,setup(o){let b=y(),{t:C,locale:w}=e(),T=t();return(e,t)=>{let o=g(`motion`);return _(),c(`div`,x,[m(h(l(a),{modelValue:l(T),"onUpdate:modelValue":t[0]||=e=>u(T)?T.value=e:null,"mb-2":``,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:270,delay:2*50,label:l(C)(`settings.theme.title`),description:l(C)(`settings.theme.description`)},null,8,[`modelValue`,`label`,`description`]),[[o]]),m((_(),p(l(i),{initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:280,delay:3*50,transition:`all ease-in-out duration-250`,label:l(C)(`settings.language.title`),description:l(C)(`settings.language.description`)},{default:s(()=>[h(l(n),{modelValue:l(b).language,"onUpdate:modelValue":t[1]||=e=>l(b).language=e,transition:`all ease-in-out duration-250`,"cursor-pointer":``,"bg-transparent":``,"outline-none":``},{default:s(({value:t})=>[f(`div`,null,d(t?e.$t(`settings.language.${t}`):l(C)(`settings.language.english`)),1)]),options:s(({hide:t})=>[h(l(r),{value:`en`,active:l(w)===`en`,onClick:e=>t()},{default:s(()=>[v(d(e.$t(`settings.language.english`)),1)]),_:2},1032,[`active`,`onClick`]),h(l(r),{value:`zh-Hans`,active:l(w)===`zh-Hans`,onClick:e=>t()},{default:s(()=>[v(d(e.$t(`settings.language.chinese`)),1)]),_:2},1032,[`active`,`onClick`])]),_:1},8,[`modelValue`])]),_:1},8,[`label`,`description`])),[[o]]),m((_(),c(`div`,S,t[2]||=[f(`div`,{text:`60`,"i-solar:emoji-funny-square-bold-duotone":``},null,-1)])),[[o]])])}}});typeof b==`function`&&b(C);var w=C;export{w as default}; \ No newline at end of file diff --git a/assets/general-Ct2fynUz.js b/assets/general-Ct2fynUz.js deleted file mode 100644 index 93d0bbb9f5de968ce5944ca5b7054618a24b0b1b..0000000000000000000000000000000000000000 --- a/assets/general-Ct2fynUz.js +++ /dev/null @@ -1 +0,0 @@ -import{a8 as e,aZ as t,an as n,ao as r,as as i,ax as a,d6 as o,dD as s,dG as c,dN as l,de as u,dh as d,di as f,dj as p,dm as m,do as h,dp as g,du as _,dy as v,t as y}from"./index-Bcb2irKh.js";import{b}from"./route-block-DVyt-3Cw.js";const x={"rounded-lg":``,"bg-neutral-50":``,"p-4":``,"dark:bg-neutral-800":``,flex:`~ col gap-4`},S={text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[65dvh]`,"right--15":``,"z--1":``,initial:{scale:.9,opacity:0,rotate:30},enter:{scale:1,opacity:1,rotate:0},duration:250,flex:``,"items-center":``,"justify-center":``};var C=m({__name:`general`,setup(m){let b=y(),{t:C,locale:w}=e(),T=t();return(e,t)=>{let m=d(`motion`);return f(),g(`div`,x,[o(u(s(a),{modelValue:s(T),"onUpdate:modelValue":t[0]||=e=>c(T)?T.value=e:null,"mb-2":``,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:270,delay:2*50,label:s(C)(`settings.theme.title`),description:s(C)(`settings.theme.description`)},null,8,[`modelValue`,`label`,`description`]),[[m]]),o((f(),v(s(i),{initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:280,delay:3*50,transition:`all ease-in-out duration-250`,label:s(C)(`settings.language.title`),description:s(C)(`settings.language.description`)},{default:h(()=>[u(s(n),{modelValue:s(b).language,"onUpdate:modelValue":t[1]||=e=>s(b).language=e,transition:`all ease-in-out duration-250`,"cursor-pointer":``,"bg-transparent":``,"outline-none":``},{default:h(({value:t})=>[_(`div`,null,l(t?e.$t(`settings.language.${t}`):s(C)(`settings.language.english`)),1)]),options:h(({hide:t})=>[u(s(r),{value:`en`,active:s(w)===`en`,onClick:e=>t()},{default:h(()=>[p(l(e.$t(`settings.language.english`)),1)]),_:2},1032,[`active`,`onClick`]),u(s(r),{value:`zh-Hans`,active:s(w)===`zh-Hans`,onClick:e=>t()},{default:h(()=>[p(l(e.$t(`settings.language.chinese`)),1)]),_:2},1032,[`active`,`onClick`])]),_:1},8,[`modelValue`])]),_:1},8,[`label`,`description`])),[[m]]),o((f(),g(`div`,S,t[2]||=[_(`div`,{text:`60`,"i-solar:emoji-funny-square-bold-duotone":``},null,-1)])),[[m]])])}}});typeof b==`function`&&b(C);var w=C;export{w as default}; \ No newline at end of file diff --git a/assets/gesture-circle-BcNJ-k8_.js b/assets/gesture-circle-BcNJ-k8_.js new file mode 100644 index 0000000000000000000000000000000000000000..fbe17d900852f542cebbaedfbe2d2a13eaa79758 --- /dev/null +++ b/assets/gesture-circle-BcNJ-k8_.js @@ -0,0 +1 @@ +import{a$ as e,aX as t,b2 as n,b4 as r,b7 as i,d6 as a,d9 as o,dF as s,dK as c,dN as l,de as u,dp as d,dv as f,dx as p}from"./index-TXtvn0DM.js";import{b as m}from"./route-block-DVyt-3Cw.js";const h={relative:``,"h-full":``},g={bg:`neutral-100/50 dark:neutral-900/50`,absolute:``,"inset-0":``,"h-fit":``,"rounded-xl":``,"px-3":``,"py-2":``,"font-mono":``,"shadow-md":``,"backdrop-blur-md":``,grid:`~ cols-[150px_1fr]`},_=6;var v=a({__name:`gesture-circle`,setup(a){let m=c(),v=c(),y=c(),b=c(),{x,y:S}=e({target:y}),C=n(v,{immediate:!0,windowResize:!0}),w=d(()=>({x:x.value,y:S.value}));t(v,e=>{let t=e[0],{width:n,height:r}=t.contentRect;y.value&&(y.value.width=n,y.value.height=r)}),f(v,e=>{if(!e)return;let t=document.createElement(`canvas`);t.width=C.width.value,t.height=C.height.value,t.style.objectFit=`contain`;let n=t.getContext(`2d`);b.value=n,y.value=t,v.value?.appendChild(t)});let T=r(w,50),E=i(w,50),D=c(E.value),O=c(0),k=c(0),A=c(!1),j=c([]),M=c(!1);return f([x,S],()=>{b.value&&(b.value.beginPath(),b.value.fillStyle=`red`,b.value.arc(x.value,S.value,4,0,2*Math.PI),b.value.closePath(),b.value.fill())}),f(E,()=>{if(M.value=!1,b.value&&b.value.reset(),j.value.length>=_){let e=j.value.reduce((e,t)=>e+t.x,0)/j.value.length,t=j.value.reduce((e,t)=>e+t.y,0)/j.value.length,n=j.value.map(n=>Math.sqrt((n.x-e)**2+(n.y-t)**2)),r=n.reduce((e,t)=>e+t,0)/n.length,i=n.reduce((e,t)=>e+(t-r)**2,0)/n.length,a=Math.sqrt(i);a<20&&(k.value++,M.value=!0)}j.value=[]}),f(T,e=>{j.value.push(e)}),(e,t)=>(p(),o(`div`,{ref_key:`containerRef`,ref:m,"h-full":``},[u(`div`,h,[u(`div`,g,[t[0]||=u(`div`,{text:`neutral-400 dark:neutral-600`},` pointThrottled: `,-1),u(`div`,null,l(s(T)),1),t[1]||=u(`div`,{text:`neutral-400 dark:neutral-600`},` pointDebounced: `,-1),u(`div`,null,l(s(E)),1),t[2]||=u(`div`,{text:`neutral-400 dark:neutral-600`},` lastPoint: `,-1),u(`div`,null,l(D.value),1),t[3]||=u(`div`,{text:`neutral-400 dark:neutral-600`},` distance: `,-1),u(`div`,null,l(O.value),1),t[4]||=u(`div`,{text:`neutral-400 dark:neutral-600`},` count: `,-1),u(`div`,null,l(k.value),1),t[5]||=u(`div`,{text:`neutral-400 dark:neutral-600`},` show: `,-1),u(`div`,null,l(A.value),1),t[6]||=u(`div`,{text:`neutral-400 dark:neutral-600`},` lastPoints: `,-1),u(`div`,null,l(j.value),1),t[7]||=u(`div`,{text:`neutral-400 dark:neutral-600`},` isCircle: `,-1),u(`div`,null,l(M.value),1)]),u(`div`,{ref_key:`canvasContainerRef`,ref:v,"h-full":``,"w-full":``},null,512)])],512))}});typeof m==`function`&&m(v);var y=v;export{y as default}; \ No newline at end of file diff --git a/assets/gesture-circle-_WCnPwKn.js b/assets/gesture-circle-_WCnPwKn.js deleted file mode 100644 index 2349ef79356000871189116c0d63abe2da2e3b15..0000000000000000000000000000000000000000 --- a/assets/gesture-circle-_WCnPwKn.js +++ /dev/null @@ -1 +0,0 @@ -import{aU as e,aX as t,b2 as n,b5 as r,b8 as i,dD as a,dI as o,dN as s,da as c,dg as l,di as u,dm as d,dp as f,du as p}from"./index-Bcb2irKh.js";import{b as m}from"./route-block-DVyt-3Cw.js";const h={relative:``,"h-full":``},g={bg:`neutral-100/50 dark:neutral-900/50`,absolute:``,"inset-0":``,"h-fit":``,"rounded-xl":``,"px-3":``,"py-2":``,"font-mono":``,"shadow-md":``,"backdrop-blur-md":``,grid:`~ cols-[150px_1fr]`},_=6;var v=d({__name:`gesture-circle`,setup(d){let m=o(),v=o(),y=o(),b=o(),{x,y:S}=e({target:y}),C=t(v,{immediate:!0,windowResize:!0}),w=c(()=>({x:x.value,y:S.value}));n(v,e=>{let t=e[0],{width:n,height:r}=t.contentRect;y.value&&(y.value.width=n,y.value.height=r)}),l(v,e=>{if(!e)return;let t=document.createElement(`canvas`);t.width=C.width.value,t.height=C.height.value,t.style.objectFit=`contain`;let n=t.getContext(`2d`);b.value=n,y.value=t,v.value?.appendChild(t)});let T=r(w,50),E=i(w,50),D=o(E.value),O=o(0),k=o(0),A=o(!1),j=o([]),M=o(!1);return l([x,S],()=>{b.value&&(b.value.beginPath(),b.value.fillStyle=`red`,b.value.arc(x.value,S.value,4,0,2*Math.PI),b.value.closePath(),b.value.fill())}),l(E,()=>{if(M.value=!1,b.value&&b.value.reset(),j.value.length>=_){let e=j.value.reduce((e,t)=>e+t.x,0)/j.value.length,t=j.value.reduce((e,t)=>e+t.y,0)/j.value.length,n=j.value.map(n=>Math.sqrt((n.x-e)**2+(n.y-t)**2)),r=n.reduce((e,t)=>e+t,0)/n.length,i=n.reduce((e,t)=>e+(t-r)**2,0)/n.length,a=Math.sqrt(i);a<20&&(k.value++,M.value=!0)}j.value=[]}),l(T,e=>{j.value.push(e)}),(e,t)=>(u(),f(`div`,{ref_key:`containerRef`,ref:m,"h-full":``},[p(`div`,h,[p(`div`,g,[t[0]||=p(`div`,{text:`neutral-400 dark:neutral-600`},` pointThrottled: `,-1),p(`div`,null,s(a(T)),1),t[1]||=p(`div`,{text:`neutral-400 dark:neutral-600`},` pointDebounced: `,-1),p(`div`,null,s(a(E)),1),t[2]||=p(`div`,{text:`neutral-400 dark:neutral-600`},` lastPoint: `,-1),p(`div`,null,s(D.value),1),t[3]||=p(`div`,{text:`neutral-400 dark:neutral-600`},` distance: `,-1),p(`div`,null,s(O.value),1),t[4]||=p(`div`,{text:`neutral-400 dark:neutral-600`},` count: `,-1),p(`div`,null,s(k.value),1),t[5]||=p(`div`,{text:`neutral-400 dark:neutral-600`},` show: `,-1),p(`div`,null,s(A.value),1),t[6]||=p(`div`,{text:`neutral-400 dark:neutral-600`},` lastPoints: `,-1),p(`div`,null,s(j.value),1),t[7]||=p(`div`,{text:`neutral-400 dark:neutral-600`},` isCircle: `,-1),p(`div`,null,s(M.value),1)]),p(`div`,{ref_key:`canvasContainerRef`,ref:v,"h-full":``,"w-full":``},null,512)])],512))}});typeof m==`function`&&m(v);var y=v;export{y as default}; \ No newline at end of file diff --git a/assets/google-generative-ai-DozYAQuF.js b/assets/google-generative-ai-up4rXKy8.js similarity index 53% rename from assets/google-generative-ai-DozYAQuF.js rename to assets/google-generative-ai-up4rXKy8.js index b02990a30e4e700bda364459189441bd689d326f..4285edf0abdcf485b2c18481a6ab0318fa7f1a7f 100644 --- a/assets/google-generative-ai-DozYAQuF.js +++ b/assets/google-generative-ai-up4rXKy8.js @@ -1 +1 @@ -import{B as e,a3 as t,a4 as n,a5 as r,a6 as i,a7 as a,a8 as o,a9 as s,aM as c,aR as l,dD as u,da as d,de as f,dg as p,di as m,dk as h,dm as g,do as _,dy as v}from"./index-Bcb2irKh.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b=`google-generative-ai`;var x=g({__name:`google-generative-ai`,setup(g){let{t:y}=o(),x=c(),S=e(),{providers:C}=l(S),w=d(()=>S.getProviderMetadata(b)),T=d({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=d({get:()=>C.value[b]?.baseUrl||`https://generativelanguage.googleapis.com/v1beta/openai/`,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});h(()=>{C.value[b]||(C.value[b]={baseUrl:`https://api.anthropic.com/v1/`}),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||`https://generativelanguage.googleapis.com/v1beta/openai/`}),p([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||`https://generativelanguage.googleapis.com/v1beta/openai/`}});function D(){C.value[b]={baseUrl:`https://generativelanguage.googleapis.com/v1beta/openai/`}}return(e,o)=>(m(),v(u(t),{"provider-name":w.value?.localizedName||`Google | Gemini`,"provider-icon":w.value?.icon,"on-back":()=>u(x).back()},{default:_(()=>[f(u(n),null,{default:_(()=>[f(u(r),{title:u(y)(`settings.pages.providers.common.section.basic.title`),description:u(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:_(()=>[f(u(a),{modelValue:T.value,"onUpdate:modelValue":o[0]||=e=>T.value=e,"provider-name":w.value?.localizedName||`Google`,placeholder:`GEMINI_API_KEY`},null,8,[`modelValue`,`provider-name`])]),_:1},8,[`title`,`description`]),f(u(s),{title:u(y)(`settings.pages.providers.common.section.advanced.title`)},{default:_(()=>[f(u(i),{modelValue:E.value,"onUpdate:modelValue":o[1]||=e=>E.value=e,placeholder:`https://generativelanguage.googleapis.com/v1beta/openai/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`]))}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file +import{B as e,a3 as t,a4 as n,a5 as r,a6 as i,a7 as a,a8 as o,a9 as s,aM as c,aR as l,d6 as u,d8 as d,dF as f,di as p,dp as m,dt as h,dv as g,dx as _,dz as v}from"./index-TXtvn0DM.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b=`google-generative-ai`;var x=u({__name:`google-generative-ai`,setup(u){let{t:y}=o(),x=c(),S=e(),{providers:C}=l(S),w=m(()=>S.getProviderMetadata(b)),T=m({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=m({get:()=>C.value[b]?.baseUrl||`https://generativelanguage.googleapis.com/v1beta/openai/`,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});v(()=>{C.value[b]||(C.value[b]={baseUrl:`https://api.anthropic.com/v1/`}),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||`https://generativelanguage.googleapis.com/v1beta/openai/`}),g([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||`https://generativelanguage.googleapis.com/v1beta/openai/`}});function D(){C.value[b]={baseUrl:`https://generativelanguage.googleapis.com/v1beta/openai/`}}return(e,o)=>(_(),p(f(t),{"provider-name":w.value?.localizedName||`Google | Gemini`,"provider-icon":w.value?.icon,"on-back":()=>f(x).back()},{default:d(()=>[h(f(n),null,{default:d(()=>[h(f(r),{title:f(y)(`settings.pages.providers.common.section.basic.title`),description:f(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:d(()=>[h(f(a),{modelValue:T.value,"onUpdate:modelValue":o[0]||=e=>T.value=e,"provider-name":w.value?.localizedName||`Google`,placeholder:`GEMINI_API_KEY`},null,8,[`modelValue`,`provider-name`])]),_:1},8,[`title`,`description`]),h(f(s),{title:f(y)(`settings.pages.providers.common.section.advanced.title`)},{default:d(()=>[h(f(i),{modelValue:E.value,"onUpdate:modelValue":o[1]||=e=>E.value=e,placeholder:`https://generativelanguage.googleapis.com/v1beta/openai/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`]))}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file diff --git a/assets/hearing-B6PhAbYO.js b/assets/hearing-Xas1IMB8.js similarity index 71% rename from assets/hearing-B6PhAbYO.js rename to assets/hearing-Xas1IMB8.js index a9699ef4be2b6818a3f7734d1208e0ed54407415..e18c97a5ca486dff11636111f641f821da52d5c1 100644 --- a/assets/hearing-B6PhAbYO.js +++ b/assets/hearing-Xas1IMB8.js @@ -1 +1 @@ -import{B as e,U as t,W as n,a8 as r,aA as i,aI as a,aJ as o,aL as s,aR as c,aV as ee,ae as te,af as ne,ah as re,as as ie,at as l,ax as u,b3 as ae,d8 as oe,d9 as d,dD as f,dG as se,dI as p,dN as m,dO as ce,da as h,de as g,dg as _,di as v,dj as le,dk as ue,dl as de,dm as fe,dn as y,do as b,dp as x,dr as pe,du as S,dv as C,dy as w,w as me}from"./index-Bcb2irKh.js";import{c as T,f as E}from"./transformers.web-CQlzVquP.js";import{b as D}from"./route-block-DVyt-3Cw.js";function he(){let e=p(),t=p(),n=p(),r=p([]),i=p(0),a=p();function o(e){r.value.push(e)}function s(){let a=()=>{if(!e.value||!t.value)return;e.value.getByteFrequencyData(t.value);let o=0;for(let e=0;e{let{buffer:t}=e.data;t&&t.length>0&&await this.vad.processAudio(new Float32Array(t))}}catch(e){throw console.error(`Failed to initialize audio worklet:`,e),e}}async start(e){if(!this.audioContext||!this.audioWorkletNode)throw Error(`Audio system not initialized. Call initialize() first.`);try{this.audioContext.state===`suspended`&&await this.audioContext.resume(),this.mediaStream=e,this.sourceNode=this.audioContext.createMediaStreamSource(this.mediaStream),this.sourceNode.connect(this.audioWorkletNode);let t=this.audioContext.createGain();t.gain.value=0,this.audioWorkletNode.connect(t),t.connect(this.audioContext.destination)}catch(e){throw console.error(`Failed to start microphone:`,e),e}}stop(){this.sourceNode&&this.audioWorkletNode&&(this.sourceNode.disconnect(),this.audioWorkletNode.disconnect()),this.mediaStream&&(this.mediaStream.getTracks().forEach(e=>e.stop()),this.mediaStream=null),this.audioContext&&this.audioContext.state!==`closed`&&this.audioContext.suspend(),this.sourceNode=null,this.audioWorkletNode?.disconnect(),this.audioWorkletNode=null}dispose(){this.stop(),this.audioContext&&this.audioContext.state!==`closed`&&(this.audioContext.close(),this.audioContext=null),this.workletInitialized=!1}},ve=class{config;model;state;sampleRateTensor;buffer;bufferPointer=0;isRecording=!1;postSpeechSamples=0;prevBuffers=[];inferenceChain=Promise.resolve();eventListeners={};isReady=!1;constructor(e={}){let t={sampleRate:16e3,speechThreshold:.3,exitThreshold:.1,minSilenceDurationMs:400,speechPadMs:80,minSpeechDurationMs:250,maxBufferDuration:30,newBufferSize:512};this.config={...t,...e},this.buffer=new Float32Array(this.config.maxBufferDuration*this.config.sampleRate),this.sampleRateTensor=new T(`int64`,[this.config.sampleRate],[]),this.state=new T(`float32`,new Float32Array(2*1*128),[2,1,128])}async initialize(){try{this.emit(`status`,{type:`info`,message:`Loading VAD model...`}),this.model=await E.from_pretrained(`onnx-community/silero-vad`,{config:{model_type:`custom`},dtype:`fp32`}),this.isReady=!0,this.emit(`status`,{type:`info`,message:`VAD model loaded successfully`})}catch(e){throw this.emit(`status`,{type:`error`,message:`Failed to load VAD model: ${e}`}),e}}on(e,t){this.eventListeners[e]||(this.eventListeners[e]=[]),this.eventListeners[e].push(t)}off(e,t){this.eventListeners[e]&&(this.eventListeners[e]=this.eventListeners[e].filter(e=>e!==t))}emit(e,t){if(this.eventListeners[e])for(let n of this.eventListeners[e])n(t)}async processAudio(e){if(!this.isReady)throw Error(`VAD model is not initialized. Call initialize() first.`);let t=this.isRecording,n=await this.detectSpeech(e),r=this.config.sampleRate/1e3,i=this.config.minSilenceDurationMs*r,a=this.config.speechPadMs*r,o=this.config.minSpeechDurationMs*r,s=Math.ceil(a/this.config.newBufferSize);if(!t&&!n){this.prevBuffers.length>=s&&this.prevBuffers.shift(),this.prevBuffers.push(e.slice(0));return}let c=this.buffer.length-this.bufferPointer;if(e.length>=c){this.buffer.set(e.subarray(0,c),this.bufferPointer),this.bufferPointer+=c;let t=e.subarray(c);this.processSpeechSegment(t);return}else this.buffer.set(e,this.bufferPointer),this.bufferPointer+=e.length;if(n){this.isRecording||(this.emit(`speech-start`,void 0),this.emit(`status`,{type:`info`,message:`Speech detected`})),this.isRecording=!0,this.postSpeechSamples=0;return}if(this.postSpeechSamples+=e.length,this.postSpeechSamples>=i){if(this.bufferPointerthis.model?.({input:t,sr:this.sampleRateTensor,state:this.state})));this.state=n;let i=r.data[0];return this.emit(`debug`,{message:`VAD score`,data:{probability:i}}),i>this.config.speechThreshold||this.isRecording&&i>=this.config.exitThreshold}processSpeechSegment(e){let t=this.config.sampleRate/1e3,n=this.config.speechPadMs*t,r=this.bufferPointer/this.config.sampleRate*1e3,i=e?.length??0,a=this.prevBuffers.reduce((e,t)=>e+t.length,0),o=new Float32Array(a+this.bufferPointer+n),s=0;for(let e of this.prevBuffers)o.set(e,s),s+=e.length;o.set(this.buffer.slice(0,this.bufferPointer+n),s),this.emit(`speech-end`,void 0),this.emit(`speech-ready`,{buffer:o,duration:r}),e&&this.buffer.set(e,0),this.reset(i)}reset(e=0){this.buffer.fill(0,e),this.bufferPointer=e,this.isRecording=!1,this.postSpeechSamples=0,this.prevBuffers=[]}updateConfig(e){this.config={...this.config,...e},(e.maxBufferDuration||e.sampleRate)&&(this.buffer=new Float32Array(this.config.maxBufferDuration*this.config.sampleRate),this.bufferPointer=0),e.sampleRate&&(this.sampleRateTensor=new T(`int64`,[this.config.sampleRate],[]))}getLastProbability(){return 0}isCurrentlyRecording(){return this.isRecording}};async function ye(e){let t=new ve(e);return await t.initialize(),t}const be={flex:`~ col md:row gap-6`},xe={bg:`neutral-100 dark:[rgba(0,0,0,0.3)]`,"rounded-xl":``,"p-4":``,flex:`~ col gap-4`,class:`h-fit w-full md:w-[40%]`},Se={flex:`~ col gap-4`},Ce={flex:`~ col gap-4`},we={class:`text-lg text-neutral-500 md:text-2xl dark:text-neutral-500`},Te={text:`neutral-400 dark:neutral-400`},Ee={"max-w-full":``},De={key:0,flex:`~ row gap-4`,style:{"scrollbar-width":`none`},"min-w-0":``,"of-x-scroll":``,"scroll-smooth":``,role:`radiogroup`},Oe={key:1},ke={flex:`~ col gap-6`,class:`w-full md:w-[60%]`},Ae={"w-full":``,"rounded-xl":``},je={class:`mb-4 text-lg text-neutral-500 md:text-2xl dark:text-neutral-400`,"w-full":``},Me={class:`inline-flex items-center gap-4`},Ne=[`src`],Pe={key:0,class:`mt-2 text-sm text-neutral-500 dark:text-neutral-400`},Fe={flex:`~ col gap-4`},Ie={class:`space-y-4`},Le={class:`space-y-3`},Re={key:1,class:`space-y-3`},ze={key:2,class:`space-y-3`},Be={class:`flex items-center gap-3`},Ve={class:`text-sm font-medium`},He={class:`ml-auto text-xs text-neutral-500`},Ue={class:`border-t border-neutral-200 pt-3 dark:border-neutral-700`},We={key:0,class:`mt-3 space-y-2`},Ge={key:0,class:`flex items-center gap-2 text-primary-600 dark:text-primary-400`},Ke={key:2,class:`flex items-center gap-2 text-green-600 dark:text-green-400`},qe={class:`ml-auto text-xs text-neutral-500`},Je={key:0,class:`border-t border-neutral-200 pt-4 dark:border-neutral-700`},Ye={key:0,class:`mt-3`},Xe={key:1,class:`border border-amber-200 rounded-lg bg-amber-50 p-3 dark:border-amber-800 dark:bg-amber-900/20`},Ze=50;var O=fe({__name:`hearing`,setup(fe){let{t:T}=r(),E=me(),{activeTranscriptionProvider:D,activeTranscriptionModel:ve}=c(E),O=e(),{configuredTranscriptionProvidersMetadata:k}=c(O),A=ee({constraints:{audio:!0}}),j=h(()=>A.audioInputs.value),M=p(A.audioInputs.value[0]?.deviceId||``),Qe=h(()=>({audio:{deviceId:{exact:M.value},autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0}})),{stream:N,stop:$e,start:et}=ae({constraints:Qe,enabled:!1,autoSwitch:!1}),{startRecord:tt,stopRecord:nt,onStopRecord:rt}=t(N),{startAnalyzer:it,stopAnalyzer:at,onAnalyzerUpdate:ot,volumeLevel:st}=he(),{audioContext:P}=c(n()),F=p(``),I=p(``),L=p(!1),R=p(!1),z=p(),B=p(),V=p(!1),H=p(25),U=p(50),W=p(),G=p(!1),K=p(!1),q=p(!0),J=p(0),Y=p(.5),X=p([]),ct=p([]),lt=p([]),ut=h(()=>ct.value.map(e=>{let t=URL.createObjectURL(e);return lt.value.push(()=>URL.revokeObjectURL(t)),t})),Z=p([]);async function dt(){if(!(G.value||K.value)){K.value=!0,I.value=``;try{let e=await ye({sampleRate:16e3,speechThreshold:Y.value,exitThreshold:Y.value*.3,minSilenceDurationMs:400});e.on(`speech-start`,()=>{V.value=!0,tt()}),e.on(`speech-end`,()=>{V.value=!1,nt()}),e.on(`debug`,({data:e})=>{e?.probability!==void 0&&(J.value=e.probability,X.value.push(e.probability),X.value.length>Ze&&X.value.shift())}),e.on(`status`,({type:e,message:t})=>{e===`error`&&(I.value=t)});let t=new _e(e,{minChunkSize:512,audioContextOptions:{sampleRate:16e3,latencyHint:`interactive`}});await t.initialize(ge),W.value=t,G.value=!0}catch(e){I.value=e instanceof Error?e.message:String(e),console.error(`Failed to load VAD model:`,e)}finally{K.value=!1}}}async function Q(){try{if(!M.value){console.warn(`No audio input device selected`);return}if(await $(),await et(),!N.value){console.warn(`No audio stream available`);return}rt(async e=>{if(e)try{if(e){ct.value.push(e);let t=await O.getProviderInstance(D.value);if(!t)throw Error(`Failed to initialize speech provider`);let n=ve.value,r=await E.transcription(t,n,new File([e],`recording.wav`),`json`);Z.value.push(r.text)}}catch(e){F.value=e instanceof Error?e.message:String(e),console.error(`Error generating transcription:`,F.value)}});let e=P.value.createMediaStreamSource(N.value),t=it(P.value);ot(e=>{(!q.value||!G.value)&&(V.value=e>H.value)}),z.value=P.value.createGain(),z.value.gain.value=R.value?U.value/100:0,t&&e.connect(t),R.value&&(e.connect(z.value),z.value.connect(P.value.destination)),q.value&&(await dt(),W.value&&await W.value.start(N.value))}catch(e){console.error(`Error setting up audio monitoring:`,e),I.value=e instanceof Error?e.message:String(e)}}async function $(){B.value&&(cancelAnimationFrame(B.value),B.value=void 0),W.value&&await W.value.stop(),N.value&&$e(),at(),z.value=void 0,V.value=!1,J.value=0,X.value=[]}async function ft(){!P.value||!z.value||(R.value?(z.value.gain.value=U.value/100,z.value.connect(P.value.destination)):(z.value.gain.value=0,z.value.disconnect()))}_(M,async()=>{L.value&&await Q()}),_(R,ft),_(U,()=>{z.value&&R.value&&(z.value.gain.value=U.value/100)}),_(j,()=>{!M.value&&j.value.length>0&&(M.value=j.value[0]?.deviceId)}),_(Y,()=>{W.value&&G.value});async function pt(){L.value?(await $(),L.value=!1):(await Q(),L.value=!0)}let mt=h(()=>{if(!q.value||!G.value)return V.value?`bg-green-500 shadow-lg shadow-green-500/50`:`bg-white dark:bg-neutral-900 border-2 border-neutral-300 dark:border-neutral-600`;let e=J.value,t=Y.value;return e>t?`bg-green-500 shadow-lg shadow-green-500/50`:e>t*.5?`bg-yellow-500 shadow-lg shadow-yellow-500/30`:`bg-white dark:bg-neutral-900 border-2 border-neutral-300 dark:border-neutral-600`});return ue(()=>{A.ensurePermissions().then(()=>de()).then(()=>{j.value.length>0&&!M.value&&(M.value=j.value[0]?.deviceId)})}),pe(()=>{$(),W.value&&W.value.dispose(),lt.value.forEach(e=>e())}),(e,t)=>{let n=oe(`RouterLink`);return v(),x(`div`,be,[S(`div`,xe,[S(`div`,Se,[S(`div`,null,[g(f(ie),{modelValue:M.value,"onUpdate:modelValue":t[0]||=e=>M.value=e,label:`Audio Input Device`,description:`Select the audio input device for your hearing module.`,options:j.value.map(e=>({label:e.label||e.deviceId,value:e.deviceId})),placeholder:`Select an audio input device`},null,8,[`modelValue`,`options`])]),S(`div`,Ce,[S(`div`,null,[S(`h2`,we,m(f(T)(`settings.pages.providers.title`)),1),S(`div`,Te,[S(`span`,null,m(f(T)(`settings.pages.modules.hearing.sections.section.provider-model-selection.description`)),1)])]),S(`div`,Ee,[f(k).length>0?(v(),x(`fieldset`,De,[(v(!0),x(d,null,C(f(k),e=>(v(),w(f(re),{id:e.id,key:e.id,modelValue:f(D),"onUpdate:modelValue":t[1]||=e=>se(D)?D.value=e:null,name:`provider`,value:e.id,title:e.localizedName||`Unknown`,description:e.localizedDescription},null,8,[`id`,`modelValue`,`value`,`title`,`description`]))),128))])):(v(),x(`div`,Oe,[g(n,{class:`flex items-center gap-3 rounded-lg p-4`,border:`2 dashed neutral-200 dark:neutral-800`,bg:`neutral-50 dark:neutral-800`,transition:`colors duration-200 ease-in-out`,to:`/settings/providers`},{default:b(()=>t[7]||=[S(`div`,{"i-solar:warning-circle-line-duotone":``,class:`text-2xl text-amber-500 dark:text-amber-400`},null,-1),S(`div`,{class:`flex flex-col`},[S(`span`,{class:`font-medium`},`No Providers Configured`),S(`span`,{class:`text-sm text-neutral-400 dark:text-neutral-500`},`Click here to set up your Transcription providers`)],-1),S(`div`,{"i-solar:arrow-right-line-duotone":``,class:`ml-auto text-xl text-neutral-400 dark:text-neutral-500`},null,-1)]),_:1,__:[7]})]))])])])]),S(`div`,ke,[S(`div`,Ae,[S(`h2`,je,[S(`div`,Me,[g(f(o)),S(`div`,null,m(f(T)(`settings.pages.providers.provider.elevenlabs.playground.title`)),1)])]),g(f(ne),{class:`mb-4`,"w-full":``,onClick:pt},{default:b(()=>[le(m(L.value?`Stop Monitoring`:`Start Monitoring`),1)]),_:1}),S(`div`,null,[(v(!0),x(d,null,C(ut.value,(e,t)=>(v(),x(`div`,{key:t,class:`mb-2`},[S(`audio`,{src:e,controls:``,class:`w-full`},null,8,Ne),Z.value[t]?(v(),x(`div`,Pe,m(Z.value[t]),1)):y(``,!0)]))),128))]),S(`div`,Fe,[S(`div`,Ie,[S(`div`,Le,[g(f(s),{level:f(st),label:`Input Level`},null,8,[`level`]),q.value&&G.value?(v(),w(f(a),{key:0,value:J.value,threshold:Y.value,label:`Probability of Speech`,"below-label":`Silence`,"above-label":`Speech`,"threshold-label":`Detection threshold`},null,8,[`value`,`threshold`])):y(``,!0),q.value&&G.value?(v(),x(`div`,Re,[g(f(l),{modelValue:Y.value,"onUpdate:modelValue":t[2]||=e=>Y.value=e,label:`Sensitivity`,description:`Adjust the threshold for speech detection`,min:.1,max:.9,step:.05,"format-value":e=>`${(e*100).toFixed(0)}%`},null,8,[`modelValue`,`format-value`])])):(v(),x(`div`,ze,[g(f(l),{modelValue:H.value,"onUpdate:modelValue":t[3]||=e=>H.value=e,label:`Sensitivity`,description:`Adjust the threshold for speech detection`,min:1,max:80,step:1,"format-value":e=>`${e}%`},null,8,[`modelValue`,`format-value`])])),S(`div`,Be,[S(`div`,{class:ce([`h-4 w-4 rounded-full transition-all duration-200`,mt.value])},null,2),S(`span`,Ve,m(V.value?`Speaking Detected`:`Silence`),1),S(`span`,He,m(q.value&&G.value?`Model Based`:`Volume Based`),1)]),S(`div`,Ue,[g(f(u),{modelValue:q.value,"onUpdate:modelValue":t[4]||=e=>q.value=e,label:`Model Based`,description:`Use AI models for more accurate speech detection`},null,8,[`modelValue`]),q.value?(v(),x(`div`,We,[K.value?(v(),x(`div`,Ge,t[8]||=[S(`div`,{class:`animate-spin text-sm`,"i-solar:spinner-line-duotone":``},null,-1),S(`span`,{class:`text-sm`},`Loading...`,-1)])):I.value?(v(),w(f(te),{key:1,title:`Inference error`,error:I.value},null,8,[`error`])):G.value?(v(),x(`div`,Ke,[t[9]||=S(`div`,{class:`text-sm`,"i-solar:check-circle-bold-duotone":``},null,-1),t[10]||=S(`span`,{class:`text-sm`},`Activated`,-1),S(`span`,qe,` Probability: `+m((J.value*100).toFixed(1))+`% `,1)])):y(``,!0)])):y(``,!0)]),q.value&&G.value?(v(),w(f(i),{key:3,history:X.value,"current-value":J.value,threshold:Y.value,"is-active":V.value,title:`Voice Activity`,subtitle:`Last 2 seconds`,"active-label":`Speaking`,"active-legend-label":`Voice detected`,"inactive-legend-label":`Silence`,"threshold-label":`Speech threshold`},null,8,[`history`,`current-value`,`threshold`,`is-active`])):y(``,!0)]),L.value?(v(),x(`div`,Je,[g(f(u),{modelValue:R.value,"onUpdate:modelValue":t[5]||=e=>R.value=e,label:`Monitor Audio (Listen)`,description:`Enable audio playback monitoring (like OBS). Be careful of feedback!`},null,8,[`modelValue`]),R.value?(v(),x(`div`,Ye,[g(f(l),{modelValue:U.value,"onUpdate:modelValue":t[6]||=e=>U.value=e,label:`Monitor Volume`,description:`Control the volume of audio monitoring playback`,min:0,max:100,step:5,"format-value":e=>`${e}%`},null,8,[`modelValue`,`format-value`])])):y(``,!0)])):y(``,!0),R.value?(v(),x(`div`,Xe,t[11]||=[S(`div`,{class:`flex items-center gap-2 text-amber-700 dark:text-amber-300`},[S(`div`,{class:`text-sm`,"i-solar:warning-circle-bold-duotone":``}),S(`span`,{class:`text-sm font-medium`},`Audio feedback warning`)],-1),S(`div`,{class:`mt-1 text-xs text-amber-600 dark:text-amber-400`},` Use headphones to prevent audio feedback. Lower the monitor volume if you hear echoing. `,-1)])):y(``,!0)])])])])])}}});typeof D==`function`&&D(O);var k=O;export{k as default}; \ No newline at end of file +import{B as e,U as t,W as n,a8 as r,aA as i,aI as a,aJ as o,aL as s,aR as c,aY as ee,ae as te,af as ne,ah as re,as as ie,at as l,ax as u,b0 as ae,d5 as oe,d6 as se,d7 as d,d8 as f,d9 as p,dF as m,dI as ce,dK as h,dN as g,dO as le,db as ue,de as _,df as v,di as y,dn as de,do as b,dp as x,dt as S,dv as C,dx as w,dy as fe,dz as pe,w as me}from"./index-TXtvn0DM.js";import{c as T,e as E}from"./transformers.web-7B3It45j.js";import{b as D}from"./route-block-DVyt-3Cw.js";function he(){let e=h(),t=h(),n=h(),r=h([]),i=h(0),a=h();function o(e){r.value.push(e)}function s(){let a=()=>{if(!e.value||!t.value)return;e.value.getByteFrequencyData(t.value);let o=0;for(let e=0;e{let{buffer:t}=e.data;t&&t.length>0&&await this.vad.processAudio(new Float32Array(t))}}catch(e){throw console.error(`Failed to initialize audio worklet:`,e),e}}async start(e){if(!this.audioContext||!this.audioWorkletNode)throw Error(`Audio system not initialized. Call initialize() first.`);try{this.audioContext.state===`suspended`&&await this.audioContext.resume(),this.mediaStream=e,this.sourceNode=this.audioContext.createMediaStreamSource(this.mediaStream),this.sourceNode.connect(this.audioWorkletNode);let t=this.audioContext.createGain();t.gain.value=0,this.audioWorkletNode.connect(t),t.connect(this.audioContext.destination)}catch(e){throw console.error(`Failed to start microphone:`,e),e}}stop(){this.sourceNode&&this.audioWorkletNode&&(this.sourceNode.disconnect(),this.audioWorkletNode.disconnect()),this.mediaStream&&(this.mediaStream.getTracks().forEach(e=>e.stop()),this.mediaStream=null),this.audioContext&&this.audioContext.state!==`closed`&&this.audioContext.suspend(),this.sourceNode=null,this.audioWorkletNode?.disconnect(),this.audioWorkletNode=null}dispose(){this.stop(),this.audioContext&&this.audioContext.state!==`closed`&&(this.audioContext.close(),this.audioContext=null),this.workletInitialized=!1}},ve=class{config;model;state;sampleRateTensor;buffer;bufferPointer=0;isRecording=!1;postSpeechSamples=0;prevBuffers=[];inferenceChain=Promise.resolve();eventListeners={};isReady=!1;constructor(e={}){let t={sampleRate:16e3,speechThreshold:.3,exitThreshold:.1,minSilenceDurationMs:400,speechPadMs:80,minSpeechDurationMs:250,maxBufferDuration:30,newBufferSize:512};this.config={...t,...e},this.buffer=new Float32Array(this.config.maxBufferDuration*this.config.sampleRate),this.sampleRateTensor=new E(`int64`,[this.config.sampleRate],[]),this.state=new E(`float32`,new Float32Array(2*1*128),[2,1,128])}async initialize(){try{this.emit(`status`,{type:`info`,message:`Loading VAD model...`}),this.model=await T.from_pretrained(`onnx-community/silero-vad`,{config:{model_type:`custom`},dtype:`fp32`}),this.isReady=!0,this.emit(`status`,{type:`info`,message:`VAD model loaded successfully`})}catch(e){throw this.emit(`status`,{type:`error`,message:`Failed to load VAD model: ${e}`}),e}}on(e,t){this.eventListeners[e]||(this.eventListeners[e]=[]),this.eventListeners[e].push(t)}off(e,t){this.eventListeners[e]&&(this.eventListeners[e]=this.eventListeners[e].filter(e=>e!==t))}emit(e,t){if(this.eventListeners[e])for(let n of this.eventListeners[e])n(t)}async processAudio(e){if(!this.isReady)throw Error(`VAD model is not initialized. Call initialize() first.`);let t=this.isRecording,n=await this.detectSpeech(e),r=this.config.sampleRate/1e3,i=this.config.minSilenceDurationMs*r,a=this.config.speechPadMs*r,o=this.config.minSpeechDurationMs*r,s=Math.ceil(a/this.config.newBufferSize);if(!t&&!n){this.prevBuffers.length>=s&&this.prevBuffers.shift(),this.prevBuffers.push(e.slice(0));return}let c=this.buffer.length-this.bufferPointer;if(e.length>=c){this.buffer.set(e.subarray(0,c),this.bufferPointer),this.bufferPointer+=c;let t=e.subarray(c);this.processSpeechSegment(t);return}else this.buffer.set(e,this.bufferPointer),this.bufferPointer+=e.length;if(n){this.isRecording||(this.emit(`speech-start`,void 0),this.emit(`status`,{type:`info`,message:`Speech detected`})),this.isRecording=!0,this.postSpeechSamples=0;return}if(this.postSpeechSamples+=e.length,this.postSpeechSamples>=i){if(this.bufferPointerthis.model?.({input:t,sr:this.sampleRateTensor,state:this.state})));this.state=n;let i=r.data[0];return this.emit(`debug`,{message:`VAD score`,data:{probability:i}}),i>this.config.speechThreshold||this.isRecording&&i>=this.config.exitThreshold}processSpeechSegment(e){let t=this.config.sampleRate/1e3,n=this.config.speechPadMs*t,r=this.bufferPointer/this.config.sampleRate*1e3,i=e?.length??0,a=this.prevBuffers.reduce((e,t)=>e+t.length,0),o=new Float32Array(a+this.bufferPointer+n),s=0;for(let e of this.prevBuffers)o.set(e,s),s+=e.length;o.set(this.buffer.slice(0,this.bufferPointer+n),s),this.emit(`speech-end`,void 0),this.emit(`speech-ready`,{buffer:o,duration:r}),e&&this.buffer.set(e,0),this.reset(i)}reset(e=0){this.buffer.fill(0,e),this.bufferPointer=e,this.isRecording=!1,this.postSpeechSamples=0,this.prevBuffers=[]}updateConfig(e){this.config={...this.config,...e},(e.maxBufferDuration||e.sampleRate)&&(this.buffer=new Float32Array(this.config.maxBufferDuration*this.config.sampleRate),this.bufferPointer=0),e.sampleRate&&(this.sampleRateTensor=new E(`int64`,[this.config.sampleRate],[]))}getLastProbability(){return 0}isCurrentlyRecording(){return this.isRecording}};async function ye(e){let t=new ve(e);return await t.initialize(),t}const be={flex:`~ col md:row gap-6`},xe={bg:`neutral-100 dark:[rgba(0,0,0,0.3)]`,"rounded-xl":``,"p-4":``,flex:`~ col gap-4`,class:`h-fit w-full md:w-[40%]`},Se={flex:`~ col gap-4`},Ce={flex:`~ col gap-4`},we={class:`text-lg text-neutral-500 md:text-2xl dark:text-neutral-500`},Te={text:`neutral-400 dark:neutral-400`},Ee={"max-w-full":``},De={key:0,flex:`~ row gap-4`,style:{"scrollbar-width":`none`},"min-w-0":``,"of-x-scroll":``,"scroll-smooth":``,role:`radiogroup`},Oe={key:1},ke={flex:`~ col gap-6`,class:`w-full md:w-[60%]`},Ae={"w-full":``,"rounded-xl":``},je={class:`mb-4 text-lg text-neutral-500 md:text-2xl dark:text-neutral-400`,"w-full":``},Me={class:`inline-flex items-center gap-4`},Ne=[`src`],Pe={key:0,class:`mt-2 text-sm text-neutral-500 dark:text-neutral-400`},Fe={flex:`~ col gap-4`},Ie={class:`space-y-4`},Le={class:`space-y-3`},Re={key:1,class:`space-y-3`},ze={key:2,class:`space-y-3`},Be={class:`flex items-center gap-3`},Ve={class:`text-sm font-medium`},He={class:`ml-auto text-xs text-neutral-500`},Ue={class:`border-t border-neutral-200 pt-3 dark:border-neutral-700`},We={key:0,class:`mt-3 space-y-2`},Ge={key:0,class:`flex items-center gap-2 text-primary-600 dark:text-primary-400`},Ke={key:2,class:`flex items-center gap-2 text-green-600 dark:text-green-400`},qe={class:`ml-auto text-xs text-neutral-500`},Je={key:0,class:`border-t border-neutral-200 pt-4 dark:border-neutral-700`},Ye={key:0,class:`mt-3`},Xe={key:1,class:`border border-amber-200 rounded-lg bg-amber-50 p-3 dark:border-amber-800 dark:bg-amber-900/20`},Ze=50;var O=se({__name:`hearing`,setup(se){let{t:T}=r(),E=me(),{activeTranscriptionProvider:D,activeTranscriptionModel:ve}=c(E),O=e(),{configuredTranscriptionProvidersMetadata:k}=c(O),A=ae({constraints:{audio:!0}}),j=x(()=>A.audioInputs.value),M=h(A.audioInputs.value[0]?.deviceId||``),Qe=x(()=>({audio:{deviceId:{exact:M.value},autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0}})),{stream:N,stop:$e,start:et}=ee({constraints:Qe,enabled:!1,autoSwitch:!1}),{startRecord:tt,stopRecord:nt,onStopRecord:rt}=t(N),{startAnalyzer:it,stopAnalyzer:at,onAnalyzerUpdate:ot,volumeLevel:st}=he(),{audioContext:P}=c(n()),F=h(``),I=h(``),L=h(!1),R=h(!1),z=h(),B=h(),V=h(!1),H=h(25),U=h(50),W=h(),G=h(!1),K=h(!1),q=h(!0),J=h(0),Y=h(.5),X=h([]),ct=h([]),lt=h([]),ut=x(()=>ct.value.map(e=>{let t=URL.createObjectURL(e);return lt.value.push(()=>URL.revokeObjectURL(t)),t})),Z=h([]);async function dt(){if(!(G.value||K.value)){K.value=!0,I.value=``;try{let e=await ye({sampleRate:16e3,speechThreshold:Y.value,exitThreshold:Y.value*.3,minSilenceDurationMs:400});e.on(`speech-start`,()=>{V.value=!0,tt()}),e.on(`speech-end`,()=>{V.value=!1,nt()}),e.on(`debug`,({data:e})=>{e?.probability!==void 0&&(J.value=e.probability,X.value.push(e.probability),X.value.length>Ze&&X.value.shift())}),e.on(`status`,({type:e,message:t})=>{e===`error`&&(I.value=t)});let t=new _e(e,{minChunkSize:512,audioContextOptions:{sampleRate:16e3,latencyHint:`interactive`}});await t.initialize(ge),W.value=t,G.value=!0}catch(e){I.value=e instanceof Error?e.message:String(e),console.error(`Failed to load VAD model:`,e)}finally{K.value=!1}}}async function Q(){try{if(!M.value){console.warn(`No audio input device selected`);return}if(await $(),await et(),!N.value){console.warn(`No audio stream available`);return}rt(async e=>{if(e)try{if(e){ct.value.push(e);let t=await O.getProviderInstance(D.value);if(!t)throw Error(`Failed to initialize speech provider`);let n=ve.value,r=await E.transcription(t,n,new File([e],`recording.wav`),`json`);Z.value.push(r.text)}}catch(e){F.value=e instanceof Error?e.message:String(e),console.error(`Error generating transcription:`,F.value)}});let e=P.value.createMediaStreamSource(N.value),t=it(P.value);ot(e=>{(!q.value||!G.value)&&(V.value=e>H.value)}),z.value=P.value.createGain(),z.value.gain.value=R.value?U.value/100:0,t&&e.connect(t),R.value&&(e.connect(z.value),z.value.connect(P.value.destination)),q.value&&(await dt(),W.value&&await W.value.start(N.value))}catch(e){console.error(`Error setting up audio monitoring:`,e),I.value=e instanceof Error?e.message:String(e)}}async function $(){B.value&&(cancelAnimationFrame(B.value),B.value=void 0),W.value&&await W.value.stop(),N.value&&$e(),at(),z.value=void 0,V.value=!1,J.value=0,X.value=[]}async function ft(){!P.value||!z.value||(R.value?(z.value.gain.value=U.value/100,z.value.connect(P.value.destination)):(z.value.gain.value=0,z.value.disconnect()))}C(M,async()=>{L.value&&await Q()}),C(R,ft),C(U,()=>{z.value&&R.value&&(z.value.gain.value=U.value/100)}),C(j,()=>{!M.value&&j.value.length>0&&(M.value=j.value[0]?.deviceId)}),C(Y,()=>{W.value&&G.value});async function pt(){L.value?(await $(),L.value=!1):(await Q(),L.value=!0)}let mt=x(()=>{if(!q.value||!G.value)return V.value?`bg-green-500 shadow-lg shadow-green-500/50`:`bg-white dark:bg-neutral-900 border-2 border-neutral-300 dark:border-neutral-600`;let e=J.value,t=Y.value;return e>t?`bg-green-500 shadow-lg shadow-green-500/50`:e>t*.5?`bg-yellow-500 shadow-lg shadow-yellow-500/30`:`bg-white dark:bg-neutral-900 border-2 border-neutral-300 dark:border-neutral-600`});return pe(()=>{A.ensurePermissions().then(()=>oe()).then(()=>{j.value.length>0&&!M.value&&(M.value=j.value[0]?.deviceId)})}),ue(()=>{$(),W.value&&W.value.dispose(),lt.value.forEach(e=>e())}),(e,t)=>{let n=de(`RouterLink`);return w(),p(`div`,be,[_(`div`,xe,[_(`div`,Se,[_(`div`,null,[S(m(ie),{modelValue:M.value,"onUpdate:modelValue":t[0]||=e=>M.value=e,label:`Audio Input Device`,description:`Select the audio input device for your hearing module.`,options:j.value.map(e=>({label:e.label||e.deviceId,value:e.deviceId})),placeholder:`Select an audio input device`},null,8,[`modelValue`,`options`])]),_(`div`,Ce,[_(`div`,null,[_(`h2`,we,g(m(T)(`settings.pages.providers.title`)),1),_(`div`,Te,[_(`span`,null,g(m(T)(`settings.pages.modules.hearing.sections.section.provider-model-selection.description`)),1)])]),_(`div`,Ee,[m(k).length>0?(w(),p(`fieldset`,De,[(w(!0),p(b,null,v(m(k),e=>(w(),y(m(re),{id:e.id,key:e.id,modelValue:m(D),"onUpdate:modelValue":t[1]||=e=>ce(D)?D.value=e:null,name:`provider`,value:e.id,title:e.localizedName||`Unknown`,description:e.localizedDescription},null,8,[`id`,`modelValue`,`value`,`title`,`description`]))),128))])):(w(),p(`div`,Oe,[S(n,{class:`flex items-center gap-3 rounded-lg p-4`,border:`2 dashed neutral-200 dark:neutral-800`,bg:`neutral-50 dark:neutral-800`,transition:`colors duration-200 ease-in-out`,to:`/settings/providers`},{default:f(()=>t[7]||=[_(`div`,{"i-solar:warning-circle-line-duotone":``,class:`text-2xl text-amber-500 dark:text-amber-400`},null,-1),_(`div`,{class:`flex flex-col`},[_(`span`,{class:`font-medium`},`No Providers Configured`),_(`span`,{class:`text-sm text-neutral-400 dark:text-neutral-500`},`Click here to set up your Transcription providers`)],-1),_(`div`,{"i-solar:arrow-right-line-duotone":``,class:`ml-auto text-xl text-neutral-400 dark:text-neutral-500`},null,-1)]),_:1,__:[7]})]))])])])]),_(`div`,ke,[_(`div`,Ae,[_(`h2`,je,[_(`div`,Me,[S(m(o)),_(`div`,null,g(m(T)(`settings.pages.providers.provider.elevenlabs.playground.title`)),1)])]),S(m(ne),{class:`mb-4`,"w-full":``,onClick:pt},{default:f(()=>[fe(g(L.value?`Stop Monitoring`:`Start Monitoring`),1)]),_:1}),_(`div`,null,[(w(!0),p(b,null,v(ut.value,(e,t)=>(w(),p(`div`,{key:t,class:`mb-2`},[_(`audio`,{src:e,controls:``,class:`w-full`},null,8,Ne),Z.value[t]?(w(),p(`div`,Pe,g(Z.value[t]),1)):d(``,!0)]))),128))]),_(`div`,Fe,[_(`div`,Ie,[_(`div`,Le,[S(m(s),{level:m(st),label:`Input Level`},null,8,[`level`]),q.value&&G.value?(w(),y(m(a),{key:0,value:J.value,threshold:Y.value,label:`Probability of Speech`,"below-label":`Silence`,"above-label":`Speech`,"threshold-label":`Detection threshold`},null,8,[`value`,`threshold`])):d(``,!0),q.value&&G.value?(w(),p(`div`,Re,[S(m(l),{modelValue:Y.value,"onUpdate:modelValue":t[2]||=e=>Y.value=e,label:`Sensitivity`,description:`Adjust the threshold for speech detection`,min:.1,max:.9,step:.05,"format-value":e=>`${(e*100).toFixed(0)}%`},null,8,[`modelValue`,`format-value`])])):(w(),p(`div`,ze,[S(m(l),{modelValue:H.value,"onUpdate:modelValue":t[3]||=e=>H.value=e,label:`Sensitivity`,description:`Adjust the threshold for speech detection`,min:1,max:80,step:1,"format-value":e=>`${e}%`},null,8,[`modelValue`,`format-value`])])),_(`div`,Be,[_(`div`,{class:le([`h-4 w-4 rounded-full transition-all duration-200`,mt.value])},null,2),_(`span`,Ve,g(V.value?`Speaking Detected`:`Silence`),1),_(`span`,He,g(q.value&&G.value?`Model Based`:`Volume Based`),1)]),_(`div`,Ue,[S(m(u),{modelValue:q.value,"onUpdate:modelValue":t[4]||=e=>q.value=e,label:`Model Based`,description:`Use AI models for more accurate speech detection`},null,8,[`modelValue`]),q.value?(w(),p(`div`,We,[K.value?(w(),p(`div`,Ge,t[8]||=[_(`div`,{class:`animate-spin text-sm`,"i-solar:spinner-line-duotone":``},null,-1),_(`span`,{class:`text-sm`},`Loading...`,-1)])):I.value?(w(),y(m(te),{key:1,title:`Inference error`,error:I.value},null,8,[`error`])):G.value?(w(),p(`div`,Ke,[t[9]||=_(`div`,{class:`text-sm`,"i-solar:check-circle-bold-duotone":``},null,-1),t[10]||=_(`span`,{class:`text-sm`},`Activated`,-1),_(`span`,qe,` Probability: `+g((J.value*100).toFixed(1))+`% `,1)])):d(``,!0)])):d(``,!0)]),q.value&&G.value?(w(),y(m(i),{key:3,history:X.value,"current-value":J.value,threshold:Y.value,"is-active":V.value,title:`Voice Activity`,subtitle:`Last 2 seconds`,"active-label":`Speaking`,"active-legend-label":`Voice detected`,"inactive-legend-label":`Silence`,"threshold-label":`Speech threshold`},null,8,[`history`,`current-value`,`threshold`,`is-active`])):d(``,!0)]),L.value?(w(),p(`div`,Je,[S(m(u),{modelValue:R.value,"onUpdate:modelValue":t[5]||=e=>R.value=e,label:`Monitor Audio (Listen)`,description:`Enable audio playback monitoring (like OBS). Be careful of feedback!`},null,8,[`modelValue`]),R.value?(w(),p(`div`,Ye,[S(m(l),{modelValue:U.value,"onUpdate:modelValue":t[6]||=e=>U.value=e,label:`Monitor Volume`,description:`Control the volume of audio monitoring playback`,min:0,max:100,step:5,"format-value":e=>`${e}%`},null,8,[`modelValue`,`format-value`])])):d(``,!0)])):d(``,!0),R.value?(w(),p(`div`,Xe,t[11]||=[_(`div`,{class:`flex items-center gap-2 text-amber-700 dark:text-amber-300`},[_(`div`,{class:`text-sm`,"i-solar:warning-circle-bold-duotone":``}),_(`span`,{class:`text-sm font-medium`},`Audio feedback warning`)],-1),_(`div`,{class:`mt-1 text-xs text-amber-600 dark:text-amber-400`},` Use headphones to prevent audio feedback. Lower the monitor volume if you hear echoing. `,-1)])):d(``,!0)])])])])])}}});typeof D==`function`&&D(O);var k=O;export{k as default}; \ No newline at end of file diff --git a/assets/home-CtQR04tF.js b/assets/home-CtQR04tF.js new file mode 100644 index 0000000000000000000000000000000000000000..7d064186ce0461d0227e1b092627b5371fee5735 --- /dev/null +++ b/assets/home-CtQR04tF.js @@ -0,0 +1 @@ +import{aP as e,d6 as t,d9 as n,dF as r,de as i,dt as a,dx as o}from"./index-TXtvn0DM.js";const s={style:{paddingBottom:`env(safe-area-inset-bottom, 0px)`,paddingTop:`env(safe-area-inset-top, 0px)`,paddingRight:`env(safe-area-inset-right, 0px)`,paddingLeft:`env(safe-area-inset-left, 0px)`},"h-full":``},c={class:`px-3 py-2 md:px-5 md:py-5`,flex:`~ col`,"h-full":``};var l=t({__name:`home`,setup(t){return(t,l)=>(o(),n(`div`,s,[i(`div`,c,[a(r(e))])]))}}),u=l;export{u as default}; \ No newline at end of file diff --git a/assets/home-D7dZM1bj.js b/assets/home-D7dZM1bj.js deleted file mode 100644 index 20d170d9817fdc831840c26e62721db497169f30..0000000000000000000000000000000000000000 --- a/assets/home-D7dZM1bj.js +++ /dev/null @@ -1 +0,0 @@ -import{aP as e,dD as t,de as n,di as r,dm as i,dp as a,du as o}from"./index-Bcb2irKh.js";const s={style:{paddingBottom:`env(safe-area-inset-bottom, 0px)`,paddingTop:`env(safe-area-inset-top, 0px)`,paddingRight:`env(safe-area-inset-right, 0px)`,paddingLeft:`env(safe-area-inset-left, 0px)`},"h-full":``},c={class:`px-3 py-2 md:px-5 md:py-5`,flex:`~ col`,"h-full":``};var l=i({__name:`home`,setup(i){return(i,l)=>(r(),a(`div`,s,[o(`div`,c,[n(t(e))])]))}}),u=l;export{u as default}; \ No newline at end of file diff --git a/assets/icon-animation-Tj7r0tub.js b/assets/icon-animation-Tj7r0tub.js new file mode 100644 index 0000000000000000000000000000000000000000..af7ac90cf1d8c7ec1dfdf8e890bdc2d52955e57e --- /dev/null +++ b/assets/icon-animation-Tj7r0tub.js @@ -0,0 +1 @@ +import{dK as e,db as t,dp as n,dz as r,t as i}from"./index-TXtvn0DM.js";function a(a){let o=e(!1),s=e(!1),c=e(a),l=i(),u=n(()=>s.value&&!l.disableTransitions&&l.usePageSpecificTransitions);return r(()=>{s.value=!0,requestAnimationFrame(()=>{o.value=!0})}),t(()=>{o.value=!1,s.value=!1}),{iconAnimationStarted:o,showIconAnimation:u,animationIcon:c}}export{a as b}; \ No newline at end of file diff --git a/assets/icon-animation-aqma-gkh.js b/assets/icon-animation-aqma-gkh.js deleted file mode 100644 index 77133fb36b7dc101c5f81763e852bfcfdd857614..0000000000000000000000000000000000000000 --- a/assets/icon-animation-aqma-gkh.js +++ /dev/null @@ -1 +0,0 @@ -import{dI as e,da as t,dk as n,dr as r,t as i}from"./index-Bcb2irKh.js";function a(a){let o=e(!1),s=e(!1),c=e(a),l=i(),u=t(()=>s.value&&!l.disableTransitions&&l.usePageSpecificTransitions);return n(()=>{s.value=!0,requestAnimationFrame(()=>{o.value=!0})}),r(()=>{o.value=!1,s.value=!1}),{iconAnimationStarted:o,showIconAnimation:u,animationIcon:c}}export{a as b}; \ No newline at end of file diff --git a/assets/image-BLItfOAt.js b/assets/image-BLItfOAt.js deleted file mode 100644 index 3fcbcaae5f52f7103e9b4281f62403a2ba73c7f7..0000000000000000000000000000000000000000 --- a/assets/image-BLItfOAt.js +++ /dev/null @@ -1,2 +0,0 @@ -import{aK as e,aW as t,dD as n,dI as r,dN as i,di as a,dm as o,dn as s,dp as c,du as l}from"./index-Bcb2irKh.js";const u={bg:`neutral-100`,flex:`~ col`,"items-center":``,"justify-center":``,"rounded-lg":``,"px-4":``,"py-3":``},d={key:0},f=[`src`],p={bg:`neutral-100`,class:`text-wrap-any`,"max-h":`100`,"overflow-scroll":``,"rounded-lg":``,"text-wrap":``,"text-black":``,"font-mono":``};var m=o({__name:`image`,setup(e){let o=r(),m=r(``),{copy:h}=t({source:m});async function g(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=e=>{t(e.target?.result?.toString()||``)},r.onerror=e=>{n(e)},r.readAsDataURL(e)})}async function _(e){let t=e.target,n=t.files?.[0];if(n){o.value=n;let e=await g(n);m.value=e}}return(e,t)=>(a(),c(`div`,null,[l(`label`,u,[l(`input`,{type:`file`,accept:`image/*`,hidden:``,onChange:_},null,32),t[1]||=l(`span`,null,`Upload Image`,-1)]),m.value?(a(),c(`div`,d,[l(`img`,{src:m.value,alt:`Uploaded Image`,"w-100":``},null,8,f),l(`pre`,p,` `+i(m.value)+` - `,1),l(`button`,{bg:`primary-500`,text:`white`,"mt-4":``,"rounded-lg":``,"px-4":``,"py-2":``,onClick:t[0]||=()=>n(h)()},` Copy Data URL `)])):s(``,!0)]))}}),h=e(m,[[`__scopeId`,`data-v-7edd53e6`]]);export{h as default}; \ No newline at end of file diff --git a/assets/image-Y0D9IcSN.js b/assets/image-Y0D9IcSN.js new file mode 100644 index 0000000000000000000000000000000000000000..169da3a3eb911fa50438389485771c5344a23a4b --- /dev/null +++ b/assets/image-Y0D9IcSN.js @@ -0,0 +1,2 @@ +import{aK as e,b1 as t,d6 as n,d7 as r,d9 as i,dF as a,dK as o,dN as s,de as c,dx as l}from"./index-TXtvn0DM.js";const u={bg:`neutral-100`,flex:`~ col`,"items-center":``,"justify-center":``,"rounded-lg":``,"px-4":``,"py-3":``},d={key:0},f=[`src`],p={bg:`neutral-100`,class:`text-wrap-any`,"max-h":`100`,"overflow-scroll":``,"rounded-lg":``,"text-wrap":``,"text-black":``,"font-mono":``};var m=n({__name:`image`,setup(e){let n=o(),m=o(``),{copy:h}=t({source:m});async function g(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=e=>{t(e.target?.result?.toString()||``)},r.onerror=e=>{n(e)},r.readAsDataURL(e)})}async function _(e){let t=e.target,r=t.files?.[0];if(r){n.value=r;let e=await g(r);m.value=e}}return(e,t)=>(l(),i(`div`,null,[c(`label`,u,[c(`input`,{type:`file`,accept:`image/*`,hidden:``,onChange:_},null,32),t[1]||=c(`span`,null,`Upload Image`,-1)]),m.value?(l(),i(`div`,d,[c(`img`,{src:m.value,alt:`Uploaded Image`,"w-100":``},null,8,f),c(`pre`,p,` `+s(m.value)+` + `,1),c(`button`,{bg:`primary-500`,text:`white`,"mt-4":``,"rounded-lg":``,"px-4":``,"py-2":``,onClick:t[0]||=()=>a(h)()},` Copy Data URL `)])):r(``,!0)]))}}),h=e(m,[[`__scopeId`,`data-v-7edd53e6`]]);export{h as default}; \ No newline at end of file diff --git a/assets/index-Bcb2irKh.js b/assets/index-TXtvn0DM.js similarity index 99% rename from assets/index-Bcb2irKh.js rename to assets/index-TXtvn0DM.js index 740dae8572beccd024040e5c3ed1dd3c412248ee..7f024c76d163dd763e9956cd49f4749c41ac5507 100644 --- a/assets/index-Bcb2irKh.js +++ b/assets/index-TXtvn0DM.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/default-DP_2zDq7.js","assets/HeaderLink-BvOcNkh0.js","assets/HeaderLink-Bxs3yYEi.css","assets/settings-CdksUo4j.js","assets/theme-color-C-tbz8cx.js","assets/pages-CqvY_QyT.js","assets/route-block-DVyt-3Cw.js","assets/AnimatedWave-Co1wJ2Kd.js","assets/Basic-BIq-Of0k.js","assets/AnimatedWave-D0GIVVa8.css","assets/Scenes-ELpQ5xkP.js","assets/import-url-browser-CzbE4_30.js","assets/duckdb-mvp-1eM9E9sB.js","assets/background-remove-BIlLHheK.js","assets/transformers.web-CQlzVquP.js","assets/InputFile-DaDBm_4w.js","assets/gesture-circle-_WCnPwKn.js","assets/image-BLItfOAt.js","assets/image-BhuwcwI9.css","assets/polaroid-CgtEjW36.js","assets/vibrant-Cd0ESToT.js","assets/browser-CJhr0Svl.js","assets/settings-DIR2jMir.js","assets/IconAnimation-BSHXCi3V.js","assets/airi-card-B7ZfdDe0.js","assets/CardCreate-DUt9F6Lp.js","assets/CardCreationDialog-vXdEoAe9.js","assets/CardCreationDialog-CG2KLbdk.css","assets/CardDetailDialog-PAuW-O48.js","assets/DeleteCardDialog-CfSwu3w5.js","assets/CardListItem-Zshbg3UA.js","assets/CardCreate-B9UkMPmr.js","assets/CardCreationDialog-C2t6nzce.js","assets/CardDetailDialog-C5NS6yu5.js","assets/CardListItem-B_X4U4tj.js","assets/DeleteCardDialog-Cmxl4b8s.js","assets/appearance-DYPH8hMh.js","assets/color-scheme-B8QUMGKo.js","assets/color-scheme-ZSHYHslH.css","assets/developer-C3KwNa46.js","assets/general-Ct2fynUz.js","assets/memory-DF7fLUfS.js","assets/models-CxyqeYFq.js","assets/icon-animation-aqma-gkh.js","assets/modules-C3lme1kU.js","assets/consciousness-Bsx6qnki.js","assets/hearing-B6PhAbYO.js","assets/memory-long-term-D5MNuhrd.js","assets/memory-short-term-BfW329Pe.js","assets/speech-CHsV5f2H.js","assets/Textarea-BFPvaePN.js","assets/providers-DsrU6JIK.js","assets/alibaba-cloud-model-studio-DlNMnmqi.js","assets/anthropic-B7BAJgzg.js","assets/azure-ai-foundry-DlZ-mKi2.js","assets/cloudflare-workers-ai-CoptsH2G.js","assets/deepseek-Bq3V0xqj.js","assets/elevenlabs-BGkmS224.js","assets/featherless-ai-CQeyDKta.js","assets/fireworks-ai-nFwpsnmc.js","assets/google-generative-ai-DozYAQuF.js","assets/microsoft-speech-DXgisB08.js","assets/mistral-ai-C6OsPDG6.js","assets/moonshot-ai-Cq0Bgk3R.js","assets/novita-ai-BOoelGDv.js","assets/ollama-YEZZT8Xd.js","assets/openai-qf_j7gBp.js","assets/openai-audio-speech-gALEgqPK.js","assets/openai-audio-transcription-CdjYX-O2.js","assets/openrouter-ai-BFMtPxJ7.js","assets/player2-BEEn9lAM.js","assets/player2-speech-bBMC5JEe.js","assets/together-ai-CyEYaNHN.js","assets/volcengine-BCpR8HvM.js","assets/xai-Bt7XTBFn.js","assets/scene-Cp8LoaVN.js","assets/stage-Skn6SMJV.js","assets/filter-message-lb-XLsxJ.js","assets/delays-DOX4ZLru.js","assets/emotions-BijqzfJR.js","assets/messages-COyeBtk8.js"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/default-dHnBRBVa.js","assets/HeaderLink-BMtWjY7k.js","assets/HeaderLink-Bxs3yYEi.css","assets/settings-Dx_-xTvm.js","assets/theme-color-CrZYT1IJ.js","assets/pages-DqJj8AHh.js","assets/route-block-DVyt-3Cw.js","assets/AnimatedWave-1XImhiJl.js","assets/Basic-8xhCMoI8.js","assets/AnimatedWave-D0GIVVa8.css","assets/Scenes-D6JBpdgW.js","assets/import-url-browser-CzbE4_30.js","assets/duckdb-mvp-1eM9E9sB.js","assets/background-remove-CaMBEs_t.js","assets/transformers.web-7B3It45j.js","assets/InputFile-BduVApi9.js","assets/gesture-circle-BcNJ-k8_.js","assets/image-Y0D9IcSN.js","assets/image-BhuwcwI9.css","assets/polaroid-CpEbVTFH.js","assets/vibrant-CGg8wx9d.js","assets/browser-CJhr0Svl.js","assets/settings-BKVfWP0V.js","assets/IconAnimation-Cx_ji59L.js","assets/airi-card-BDbpb8YI.js","assets/CardCreate-Cwl18tMa.js","assets/CardCreationDialog-DBoOEet-.js","assets/CardCreationDialog-CG2KLbdk.css","assets/CardDetailDialog-CTqSCcym.js","assets/DeleteCardDialog-DeUARo5-.js","assets/CardListItem-B9_yTni-.js","assets/CardCreate-BnBq88i7.js","assets/CardCreationDialog-DNJ23ym3.js","assets/CardDetailDialog-DrRzlnwS.js","assets/CardListItem-DeblkTcG.js","assets/DeleteCardDialog-Db_k2voK.js","assets/appearance-CF2ZynHB.js","assets/color-scheme-DVge0MdZ.js","assets/color-scheme-ZSHYHslH.css","assets/developer-DlN6BLxq.js","assets/general-B5ZCNzAX.js","assets/memory-CxpzfPsV.js","assets/models-CGf69gF5.js","assets/icon-animation-Tj7r0tub.js","assets/modules-DOiXOO9v.js","assets/consciousness-BZ0UAvpf.js","assets/hearing-Xas1IMB8.js","assets/memory-long-term-g3FFPLwk.js","assets/memory-short-term-BGQrHIiR.js","assets/speech-KhxwETXc.js","assets/Textarea-BsLlwm-1.js","assets/providers-B5wbeFJM.js","assets/alibaba-cloud-model-studio-CKp1Z1Ta.js","assets/anthropic-CEBNe0YC.js","assets/azure-ai-foundry-Bkkz_TjR.js","assets/cloudflare-workers-ai-Di_IJhvu.js","assets/deepseek-CROq3FT6.js","assets/elevenlabs-DBr8vpGg.js","assets/featherless-ai-D0EyBsme.js","assets/fireworks-ai-UvXpnZ_T.js","assets/google-generative-ai-up4rXKy8.js","assets/microsoft-speech-BY2LoVCU.js","assets/mistral-ai-D39sepT1.js","assets/moonshot-ai-CTozCMSf.js","assets/novita-ai-dw27Ts63.js","assets/ollama-tQHRYGgL.js","assets/openai-Dpz_1L0T.js","assets/openai-audio-speech-BkZ6fMPR.js","assets/openai-audio-transcription-DB_zNBWO.js","assets/openrouter-ai-nUDctjfq.js","assets/player2-BMI1LzL_.js","assets/player2-speech-Dr2qPb6l.js","assets/together-ai-06SXbXqA.js","assets/volcengine-XpwUu7NL.js","assets/xai-CxK8L2y1.js","assets/scene-CkCOD6hR.js","assets/stage-Bsg2THie.js","assets/filter-message-BWzou1ED.js","assets/delays-tYDkCeIB.js","assets/emotions-DpXE-YF0.js","assets/messages-BQuV_Wj8.js"])))=>i.map(i=>d[i]); var __create=Object.create,__defProp$1=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp$1=Object.prototype.hasOwnProperty,__esmMin=(fn$6,res)=>()=>(fn$6&&(res=fn$6(fn$6=0)),res),__commonJSMin=(cb$1,mod)=>()=>(mod||cb$1((mod={exports:{}}).exports,mod),mod.exports),__export=(target$1,all$3)=>{for(var name$2 in all$3)__defProp$1(target$1,name$2,{get:all$3[name$2],enumerable:!0})},__copyProps=(to$2,from,except,desc)=>{if(from&&typeof from==`object`||typeof from==`function`)for(var keys$3=__getOwnPropNames(from),i$1=0,n$2=keys$3.length,key$2;i$1from[k$4]).bind(null,key$2),enumerable:!(desc=__getOwnPropDesc(from,key$2))||desc.enumerable});return to$2},__toESM=(mod,isNodeMode,target$1)=>(target$1=mod==null?{}:__create(__getProtoOf(mod)),__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp$1(target$1,`default`,{value:mod,enumerable:!0}):target$1,mod)),__toCommonJS=mod=>__copyProps(__defProp$1({},`__esModule`,{value:!0}),mod),__toDynamicImportESM=isNodeMode=>mod=>__toESM(mod.default,isNodeMode),__require=(x$3=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(x$3,{get:(a$2,b$4)=>(typeof require<`u`?require:a$2)[b$4]}):x$3)(function(x$3){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for "'+x$3+"\" in an environment that doesn't expose the `require` function.")});(function(){let relList=document.createElement(`link`).relList;if(relList&&relList.supports&&relList.supports(`modulepreload`))return;for(let link$1 of document.querySelectorAll(`link[rel="modulepreload"]`))processPreload(link$1);new MutationObserver(mutations$1=>{for(let mutation of mutations$1){if(mutation.type!==`childList`)continue;for(let node$1 of mutation.addedNodes)node$1.tagName===`LINK`&&node$1.rel===`modulepreload`&&processPreload(node$1)}}).observe(document,{childList:!0,subtree:!0});function getFetchOpts(link$1){let fetchOpts={};return link$1.integrity&&(fetchOpts.integrity=link$1.integrity),link$1.referrerPolicy&&(fetchOpts.referrerPolicy=link$1.referrerPolicy),link$1.crossOrigin===`use-credentials`?fetchOpts.credentials=`include`:link$1.crossOrigin===`anonymous`?fetchOpts.credentials=`omit`:fetchOpts.credentials=`same-origin`,fetchOpts}function processPreload(link$1){if(link$1.ep)return;link$1.ep=!0;let fetchOpts=getFetchOpts(link$1);fetch(link$1.href,fetchOpts)}})(); /** * @vue/shared v3.5.17 @@ -3835,7 +3835,7 @@ void main() { }`;var WebXRDepthSensing=class{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(renderer$1,depthData,renderState){if(this.texture===null){let texture=new Texture,texProps=renderer$1.properties.get(texture);texProps.__webglTexture=depthData.texture,(depthData.depthNear!==renderState.depthNear||depthData.depthFar!==renderState.depthFar)&&(this.depthNear=depthData.depthNear,this.depthFar=depthData.depthFar),this.texture=texture}}getMesh(cameraXR){if(this.texture!==null&&this.mesh===null){let viewport=cameraXR.cameras[0].viewport,material=new ShaderMaterial({vertexShader:_occlusion_vertex,fragmentShader:_occlusion_fragment,uniforms:{depthColor:{value:this.texture},depthWidth:{value:viewport.z},depthHeight:{value:viewport.w}}});this.mesh=new Mesh(new PlaneGeometry(20,20),material)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}},WebXRManager=class extends EventDispatcher{constructor(renderer$1,gl){super();let scope=this,session=null,framebufferScaleFactor=1,referenceSpace=null,referenceSpaceType=`local-floor`,foveation=1,customReferenceSpace=null,pose=null,glBinding=null,glProjLayer=null,glBaseLayer=null,xrFrame=null,depthSensing=new WebXRDepthSensing,attributes=gl.getContextAttributes(),initialRenderTarget=null,newRenderTarget=null,controllers=[],controllerInputSources=[],currentSize=new Vector2,currentPixelRatio=null,cameraL=new PerspectiveCamera;cameraL.viewport=new Vector4;let cameraR=new PerspectiveCamera;cameraR.viewport=new Vector4;let cameras=[cameraL,cameraR],cameraXR=new ArrayCamera,_currentDepthNear=null,_currentDepthFar=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(index$1){let controller=controllers[index$1];return controller===void 0&&(controller=new WebXRController,controllers[index$1]=controller),controller.getTargetRaySpace()},this.getControllerGrip=function(index$1){let controller=controllers[index$1];return controller===void 0&&(controller=new WebXRController,controllers[index$1]=controller),controller.getGripSpace()},this.getHand=function(index$1){let controller=controllers[index$1];return controller===void 0&&(controller=new WebXRController,controllers[index$1]=controller),controller.getHandSpace()};function onSessionEvent(event){let controllerIndex=controllerInputSources.indexOf(event.inputSource);if(controllerIndex===-1)return;let controller=controllers[controllerIndex];controller!==void 0&&(controller.update(event.inputSource,event.frame,customReferenceSpace||referenceSpace),controller.dispatchEvent({type:event.type,data:event.inputSource}))}function onSessionEnd(){session.removeEventListener(`select`,onSessionEvent),session.removeEventListener(`selectstart`,onSessionEvent),session.removeEventListener(`selectend`,onSessionEvent),session.removeEventListener(`squeeze`,onSessionEvent),session.removeEventListener(`squeezestart`,onSessionEvent),session.removeEventListener(`squeezeend`,onSessionEvent),session.removeEventListener(`end`,onSessionEnd),session.removeEventListener(`inputsourceschange`,onInputSourcesChange);for(let i$1=0;i$1=0&&(controllerInputSources[index$1]=null,controllers[index$1].disconnect(inputSource))}for(let i$1=0;i$1=controllerInputSources.length){controllerInputSources.push(inputSource),controllerIndex=i$2;break}else if(controllerInputSources[i$2]===null){controllerInputSources[i$2]=inputSource,controllerIndex=i$2;break}if(controllerIndex===-1)break}let controller=controllers[controllerIndex];controller&&controller.connect(inputSource)}}let cameraLPos=new Vector3,cameraRPos=new Vector3;function setProjectionFromUnion(camera,cameraL$1,cameraR$1){cameraLPos.setFromMatrixPosition(cameraL$1.matrixWorld),cameraRPos.setFromMatrixPosition(cameraR$1.matrixWorld);let ipd=cameraLPos.distanceTo(cameraRPos),projL=cameraL$1.projectionMatrix.elements,projR=cameraR$1.projectionMatrix.elements,near=projL[14]/(projL[10]-1),far=projL[14]/(projL[10]+1),topFov=(projL[9]+1)/projL[5],bottomFov=(projL[9]-1)/projL[5],leftFov=(projL[8]-1)/projL[0],rightFov=(projR[8]+1)/projR[0],left=near*leftFov,right=near*rightFov,zOffset=ipd/(-leftFov+rightFov),xOffset=zOffset*-leftFov;if(cameraL$1.matrixWorld.decompose(camera.position,camera.quaternion,camera.scale),camera.translateX(xOffset),camera.translateZ(zOffset),camera.matrixWorld.compose(camera.position,camera.quaternion,camera.scale),camera.matrixWorldInverse.copy(camera.matrixWorld).invert(),projL[10]===-1)camera.projectionMatrix.copy(cameraL$1.projectionMatrix),camera.projectionMatrixInverse.copy(cameraL$1.projectionMatrixInverse);else{let near2=near+zOffset,far2=far+zOffset,left2=left-xOffset,right2=right+(ipd-xOffset),top2=topFov*far/far2*near2,bottom2=bottomFov*far/far2*near2;camera.projectionMatrix.makePerspective(left2,right2,top2,bottom2,near2,far2),camera.projectionMatrixInverse.copy(camera.projectionMatrix).invert()}}function updateCamera(camera,parent){parent===null?camera.matrixWorld.copy(camera.matrix):camera.matrixWorld.multiplyMatrices(parent.matrixWorld,camera.matrix),camera.matrixWorldInverse.copy(camera.matrixWorld).invert()}this.updateCamera=function(camera){if(session===null)return;let depthNear=camera.near,depthFar=camera.far;depthSensing.texture!==null&&(depthSensing.depthNear>0&&(depthNear=depthSensing.depthNear),depthSensing.depthFar>0&&(depthFar=depthSensing.depthFar)),cameraXR.near=cameraR.near=cameraL.near=depthNear,cameraXR.far=cameraR.far=cameraL.far=depthFar,(_currentDepthNear!==cameraXR.near||_currentDepthFar!==cameraXR.far)&&(session.updateRenderState({depthNear:cameraXR.near,depthFar:cameraXR.far}),_currentDepthNear=cameraXR.near,_currentDepthFar=cameraXR.far),cameraL.layers.mask=camera.layers.mask|2,cameraR.layers.mask=camera.layers.mask|4,cameraXR.layers.mask=cameraL.layers.mask|cameraR.layers.mask;let parent=camera.parent,cameras$1=cameraXR.cameras;updateCamera(cameraXR,parent);for(let i$1=0;i$10&&(uniforms.alphaTest.value=material.alphaTest);let materialProperties=properties.get(material),envMap=materialProperties.envMap,envMapRotation=materialProperties.envMapRotation;envMap&&(uniforms.envMap.value=envMap,_e1.copy(envMapRotation),_e1.x*=-1,_e1.y*=-1,_e1.z*=-1,envMap.isCubeTexture&&envMap.isRenderTargetTexture===!1&&(_e1.y*=-1,_e1.z*=-1),uniforms.envMapRotation.value.setFromMatrix4(_m1.makeRotationFromEuler(_e1)),uniforms.flipEnvMap.value=envMap.isCubeTexture&&envMap.isRenderTargetTexture===!1?-1:1,uniforms.reflectivity.value=material.reflectivity,uniforms.ior.value=material.ior,uniforms.refractionRatio.value=material.refractionRatio),material.lightMap&&(uniforms.lightMap.value=material.lightMap,uniforms.lightMapIntensity.value=material.lightMapIntensity,refreshTransformUniform(material.lightMap,uniforms.lightMapTransform)),material.aoMap&&(uniforms.aoMap.value=material.aoMap,uniforms.aoMapIntensity.value=material.aoMapIntensity,refreshTransformUniform(material.aoMap,uniforms.aoMapTransform))}function refreshUniformsLine(uniforms,material){uniforms.diffuse.value.copy(material.color),uniforms.opacity.value=material.opacity,material.map&&(uniforms.map.value=material.map,refreshTransformUniform(material.map,uniforms.mapTransform))}function refreshUniformsDash(uniforms,material){uniforms.dashSize.value=material.dashSize,uniforms.totalSize.value=material.dashSize+material.gapSize,uniforms.scale.value=material.scale}function refreshUniformsPoints(uniforms,material,pixelRatio,height){uniforms.diffuse.value.copy(material.color),uniforms.opacity.value=material.opacity,uniforms.size.value=material.size*pixelRatio,uniforms.scale.value=height*.5,material.map&&(uniforms.map.value=material.map,refreshTransformUniform(material.map,uniforms.uvTransform)),material.alphaMap&&(uniforms.alphaMap.value=material.alphaMap,refreshTransformUniform(material.alphaMap,uniforms.alphaMapTransform)),material.alphaTest>0&&(uniforms.alphaTest.value=material.alphaTest)}function refreshUniformsSprites(uniforms,material){uniforms.diffuse.value.copy(material.color),uniforms.opacity.value=material.opacity,uniforms.rotation.value=material.rotation,material.map&&(uniforms.map.value=material.map,refreshTransformUniform(material.map,uniforms.mapTransform)),material.alphaMap&&(uniforms.alphaMap.value=material.alphaMap,refreshTransformUniform(material.alphaMap,uniforms.alphaMapTransform)),material.alphaTest>0&&(uniforms.alphaTest.value=material.alphaTest)}function refreshUniformsPhong(uniforms,material){uniforms.specular.value.copy(material.specular),uniforms.shininess.value=Math.max(material.shininess,1e-4)}function refreshUniformsToon(uniforms,material){material.gradientMap&&(uniforms.gradientMap.value=material.gradientMap)}function refreshUniformsStandard(uniforms,material){uniforms.metalness.value=material.metalness,material.metalnessMap&&(uniforms.metalnessMap.value=material.metalnessMap,refreshTransformUniform(material.metalnessMap,uniforms.metalnessMapTransform)),uniforms.roughness.value=material.roughness,material.roughnessMap&&(uniforms.roughnessMap.value=material.roughnessMap,refreshTransformUniform(material.roughnessMap,uniforms.roughnessMapTransform)),material.envMap&&(uniforms.envMapIntensity.value=material.envMapIntensity)}function refreshUniformsPhysical(uniforms,material,transmissionRenderTarget){uniforms.ior.value=material.ior,material.sheen>0&&(uniforms.sheenColor.value.copy(material.sheenColor).multiplyScalar(material.sheen),uniforms.sheenRoughness.value=material.sheenRoughness,material.sheenColorMap&&(uniforms.sheenColorMap.value=material.sheenColorMap,refreshTransformUniform(material.sheenColorMap,uniforms.sheenColorMapTransform)),material.sheenRoughnessMap&&(uniforms.sheenRoughnessMap.value=material.sheenRoughnessMap,refreshTransformUniform(material.sheenRoughnessMap,uniforms.sheenRoughnessMapTransform))),material.clearcoat>0&&(uniforms.clearcoat.value=material.clearcoat,uniforms.clearcoatRoughness.value=material.clearcoatRoughness,material.clearcoatMap&&(uniforms.clearcoatMap.value=material.clearcoatMap,refreshTransformUniform(material.clearcoatMap,uniforms.clearcoatMapTransform)),material.clearcoatRoughnessMap&&(uniforms.clearcoatRoughnessMap.value=material.clearcoatRoughnessMap,refreshTransformUniform(material.clearcoatRoughnessMap,uniforms.clearcoatRoughnessMapTransform)),material.clearcoatNormalMap&&(uniforms.clearcoatNormalMap.value=material.clearcoatNormalMap,refreshTransformUniform(material.clearcoatNormalMap,uniforms.clearcoatNormalMapTransform),uniforms.clearcoatNormalScale.value.copy(material.clearcoatNormalScale),material.side===BackSide&&uniforms.clearcoatNormalScale.value.negate())),material.dispersion>0&&(uniforms.dispersion.value=material.dispersion),material.iridescence>0&&(uniforms.iridescence.value=material.iridescence,uniforms.iridescenceIOR.value=material.iridescenceIOR,uniforms.iridescenceThicknessMinimum.value=material.iridescenceThicknessRange[0],uniforms.iridescenceThicknessMaximum.value=material.iridescenceThicknessRange[1],material.iridescenceMap&&(uniforms.iridescenceMap.value=material.iridescenceMap,refreshTransformUniform(material.iridescenceMap,uniforms.iridescenceMapTransform)),material.iridescenceThicknessMap&&(uniforms.iridescenceThicknessMap.value=material.iridescenceThicknessMap,refreshTransformUniform(material.iridescenceThicknessMap,uniforms.iridescenceThicknessMapTransform))),material.transmission>0&&(uniforms.transmission.value=material.transmission,uniforms.transmissionSamplerMap.value=transmissionRenderTarget.texture,uniforms.transmissionSamplerSize.value.set(transmissionRenderTarget.width,transmissionRenderTarget.height),material.transmissionMap&&(uniforms.transmissionMap.value=material.transmissionMap,refreshTransformUniform(material.transmissionMap,uniforms.transmissionMapTransform)),uniforms.thickness.value=material.thickness,material.thicknessMap&&(uniforms.thicknessMap.value=material.thicknessMap,refreshTransformUniform(material.thicknessMap,uniforms.thicknessMapTransform)),uniforms.attenuationDistance.value=material.attenuationDistance,uniforms.attenuationColor.value.copy(material.attenuationColor)),material.anisotropy>0&&(uniforms.anisotropyVector.value.set(material.anisotropy*Math.cos(material.anisotropyRotation),material.anisotropy*Math.sin(material.anisotropyRotation)),material.anisotropyMap&&(uniforms.anisotropyMap.value=material.anisotropyMap,refreshTransformUniform(material.anisotropyMap,uniforms.anisotropyMapTransform))),uniforms.specularIntensity.value=material.specularIntensity,uniforms.specularColor.value.copy(material.specularColor),material.specularColorMap&&(uniforms.specularColorMap.value=material.specularColorMap,refreshTransformUniform(material.specularColorMap,uniforms.specularColorMapTransform)),material.specularIntensityMap&&(uniforms.specularIntensityMap.value=material.specularIntensityMap,refreshTransformUniform(material.specularIntensityMap,uniforms.specularIntensityMapTransform))}function refreshUniformsMatcap(uniforms,material){material.matcap&&(uniforms.matcap.value=material.matcap)}function refreshUniformsDistance(uniforms,material){let light=properties.get(material).light;uniforms.referencePosition.value.setFromMatrixPosition(light.matrixWorld),uniforms.nearDistance.value=light.shadow.camera.near,uniforms.farDistance.value=light.shadow.camera.far}return{refreshFogUniforms,refreshMaterialUniforms}}function WebGLUniformsGroups(gl,info,capabilities,state){let buffers={},updateList={},allocatedBindingPoints=[],maxBindingPoints=gl.getParameter(gl.MAX_UNIFORM_BUFFER_BINDINGS);function bind(uniformsGroup,program){let webglProgram=program.program;state.uniformBlockBinding(uniformsGroup,webglProgram)}function update(uniformsGroup,program){let buffer$1=buffers[uniformsGroup.id];buffer$1===void 0&&(prepareUniformsGroup(uniformsGroup),buffer$1=createBuffer(uniformsGroup),buffers[uniformsGroup.id]=buffer$1,uniformsGroup.addEventListener(`dispose`,onUniformsGroupsDispose));let webglProgram=program.program;state.updateUBOMapping(uniformsGroup,webglProgram);let frame$1=info.render.frame;updateList[uniformsGroup.id]!==frame$1&&(updateBufferData(uniformsGroup),updateList[uniformsGroup.id]=frame$1)}function createBuffer(uniformsGroup){let bindingPointIndex=allocateBindingPointIndex();uniformsGroup.__bindingPointIndex=bindingPointIndex;let buffer$1=gl.createBuffer(),size$2=uniformsGroup.__size,usage=uniformsGroup.usage;return gl.bindBuffer(gl.UNIFORM_BUFFER,buffer$1),gl.bufferData(gl.UNIFORM_BUFFER,size$2,usage),gl.bindBuffer(gl.UNIFORM_BUFFER,null),gl.bindBufferBase(gl.UNIFORM_BUFFER,bindingPointIndex,buffer$1),buffer$1}function allocateBindingPointIndex(){for(let i$1=0;i$10&&(offset$2+=chunkSize-chunkOffset),uniformsGroup.__size=offset$2,uniformsGroup.__cache={},this}function getUniformSize(value$1){let info$1={boundary:0,storage:0};return typeof value$1==`number`||typeof value$1==`boolean`?(info$1.boundary=4,info$1.storage=4):value$1.isVector2?(info$1.boundary=8,info$1.storage=8):value$1.isVector3||value$1.isColor?(info$1.boundary=16,info$1.storage=12):value$1.isVector4?(info$1.boundary=16,info$1.storage=16):value$1.isMatrix3?(info$1.boundary=48,info$1.storage=48):value$1.isMatrix4?(info$1.boundary=64,info$1.storage=64):value$1.isTexture?console.warn(`THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group.`):console.warn(`THREE.WebGLRenderer: Unsupported uniform value type.`,value$1),info$1}function onUniformsGroupsDispose(event){let uniformsGroup=event.target;uniformsGroup.removeEventListener(`dispose`,onUniformsGroupsDispose);let index$1=allocatedBindingPoints.indexOf(uniformsGroup.__bindingPointIndex);allocatedBindingPoints.splice(index$1,1),gl.deleteBuffer(buffers[uniformsGroup.id]),delete buffers[uniformsGroup.id],delete updateList[uniformsGroup.id]}function dispose$1(){for(let id$1 in buffers)gl.deleteBuffer(buffers[id$1]);allocatedBindingPoints=[],buffers={},updateList={}}return{bind,update,dispose:dispose$1}}var WebGLRenderer=class{constructor(parameters={}){let{canvas=createCanvasElement(),context:context$1=null,depth=!0,stencil=!1,alpha:alpha$1=!1,antialias=!1,premultipliedAlpha=!0,preserveDrawingBuffer=!1,powerPreference=`default`,failIfMajorPerformanceCaveat=!1,reverseDepthBuffer=!1}=parameters;this.isWebGLRenderer=!0;let _alpha;if(context$1!==null){if(typeof WebGLRenderingContext<`u`&&context$1 instanceof WebGLRenderingContext)throw Error(`THREE.WebGLRenderer: WebGL 1 is not supported since r163.`);_alpha=context$1.getContextAttributes().alpha}else _alpha=alpha$1;let uintClearColor=new Uint32Array(4),intClearColor=new Int32Array(4),currentRenderList=null,currentRenderState=null,renderListStack=[],renderStateStack=[];this.domElement=canvas,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=NoToneMapping,this.toneMappingExposure=1,this.transmissionResolutionScale=1;let _this=this,_isContextLost=!1;this._outputColorSpace=SRGBColorSpace;let _currentActiveCubeFace=0,_currentActiveMipmapLevel=0,_currentRenderTarget=null,_currentMaterialId=-1,_currentCamera=null,_currentViewport=new Vector4,_currentScissor=new Vector4,_currentScissorTest=null,_currentClearColor=new Color(0),_currentClearAlpha=0,_width=canvas.width,_height=canvas.height,_pixelRatio=1,_opaqueSort=null,_transparentSort=null,_viewport=new Vector4(0,0,_width,_height),_scissor=new Vector4(0,0,_width,_height),_scissorTest=!1,_frustum$2=new Frustum,_clippingEnabled=!1,_localClippingEnabled=!1,_currentProjectionMatrix=new Matrix4,_projScreenMatrix$3=new Matrix4,_vector3$1=new Vector3,_vector4=new Vector4,_emptyScene={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0},_renderBackground=!1;function getTargetPixelRatio(){return _currentRenderTarget===null?_pixelRatio:1}let _gl=context$1;function getContext$1(contextName,contextAttributes){return canvas.getContext(contextName,contextAttributes)}try{let contextAttributes={alpha:!0,depth,stencil,antialias,premultipliedAlpha,preserveDrawingBuffer,powerPreference,failIfMajorPerformanceCaveat};if(`setAttribute`in canvas&&canvas.setAttribute(`data-engine`,`three.js r${REVISION}`),canvas.addEventListener(`webglcontextlost`,onContextLost,!1),canvas.addEventListener(`webglcontextrestored`,onContextRestore,!1),canvas.addEventListener(`webglcontextcreationerror`,onContextCreationError,!1),_gl===null){let contextName=`webgl2`;if(_gl=getContext$1(contextName,contextAttributes),_gl===null)throw getContext$1(contextName)?Error(`Error creating WebGL context with your selected attributes.`):Error(`Error creating WebGL context.`)}}catch(error){throw console.error(`THREE.WebGLRenderer: `+error.message),error}let extensions,capabilities,state,info,properties,textures,cubemaps,cubeuvmaps,attributes,geometries,objects,programCache,materials,renderLists,renderStates,clipping,shadowMap,background,morphtargets,bufferRenderer,indexedBufferRenderer,utils$1,bindingStates,uniformsGroups;function initGLContext(){extensions=new WebGLExtensions(_gl),extensions.init(),utils$1=new WebGLUtils(_gl,extensions),capabilities=new WebGLCapabilities(_gl,extensions,parameters,utils$1),state=new WebGLState(_gl,extensions),capabilities.reverseDepthBuffer&&reverseDepthBuffer&&state.buffers.depth.setReversed(!0),info=new WebGLInfo(_gl),properties=new WebGLProperties,textures=new WebGLTextures(_gl,extensions,state,properties,capabilities,utils$1,info),cubemaps=new WebGLCubeMaps(_this),cubeuvmaps=new WebGLCubeUVMaps(_this),attributes=new WebGLAttributes(_gl),bindingStates=new WebGLBindingStates(_gl,attributes),geometries=new WebGLGeometries(_gl,attributes,info,bindingStates),objects=new WebGLObjects(_gl,geometries,attributes,info),morphtargets=new WebGLMorphtargets(_gl,capabilities,textures),clipping=new WebGLClipping(properties),programCache=new WebGLPrograms(_this,cubemaps,cubeuvmaps,extensions,capabilities,bindingStates,clipping),materials=new WebGLMaterials(_this,properties),renderLists=new WebGLRenderLists,renderStates=new WebGLRenderStates(extensions),background=new WebGLBackground(_this,cubemaps,cubeuvmaps,state,objects,_alpha,premultipliedAlpha),shadowMap=new WebGLShadowMap(_this,objects,capabilities),uniformsGroups=new WebGLUniformsGroups(_gl,info,capabilities,state),bufferRenderer=new WebGLBufferRenderer(_gl,extensions,info),indexedBufferRenderer=new WebGLIndexedBufferRenderer(_gl,extensions,info),info.programs=programCache.programs,_this.capabilities=capabilities,_this.extensions=extensions,_this.properties=properties,_this.renderLists=renderLists,_this.shadowMap=shadowMap,_this.state=state,_this.info=info}initGLContext();let xr$1=new WebXRManager(_this,_gl);this.xr=xr$1,this.getContext=function(){return _gl},this.getContextAttributes=function(){return _gl.getContextAttributes()},this.forceContextLoss=function(){let extension$1=extensions.get(`WEBGL_lose_context`);extension$1&&extension$1.loseContext()},this.forceContextRestore=function(){let extension$1=extensions.get(`WEBGL_lose_context`);extension$1&&extension$1.restoreContext()},this.getPixelRatio=function(){return _pixelRatio},this.setPixelRatio=function(value$1){value$1!==void 0&&(_pixelRatio=value$1,this.setSize(_width,_height,!1))},this.getSize=function(target$1){return target$1.set(_width,_height)},this.setSize=function(width,height,updateStyle=!0){if(xr$1.isPresenting){console.warn(`THREE.WebGLRenderer: Can't change size while VR device is presenting.`);return}_width=width,_height=height,canvas.width=Math.floor(width*_pixelRatio),canvas.height=Math.floor(height*_pixelRatio),updateStyle===!0&&(canvas.style.width=width+`px`,canvas.style.height=height+`px`),this.setViewport(0,0,width,height)},this.getDrawingBufferSize=function(target$1){return target$1.set(_width*_pixelRatio,_height*_pixelRatio).floor()},this.setDrawingBufferSize=function(width,height,pixelRatio){_width=width,_height=height,_pixelRatio=pixelRatio,canvas.width=Math.floor(width*pixelRatio),canvas.height=Math.floor(height*pixelRatio),this.setViewport(0,0,width,height)},this.getCurrentViewport=function(target$1){return target$1.copy(_currentViewport)},this.getViewport=function(target$1){return target$1.copy(_viewport)},this.setViewport=function(x$3,y$3,width,height){x$3.isVector4?_viewport.set(x$3.x,x$3.y,x$3.z,x$3.w):_viewport.set(x$3,y$3,width,height),state.viewport(_currentViewport.copy(_viewport).multiplyScalar(_pixelRatio).round())},this.getScissor=function(target$1){return target$1.copy(_scissor)},this.setScissor=function(x$3,y$3,width,height){x$3.isVector4?_scissor.set(x$3.x,x$3.y,x$3.z,x$3.w):_scissor.set(x$3,y$3,width,height),state.scissor(_currentScissor.copy(_scissor).multiplyScalar(_pixelRatio).round())},this.getScissorTest=function(){return _scissorTest},this.setScissorTest=function(boolean$1){state.setScissorTest(_scissorTest=boolean$1)},this.setOpaqueSort=function(method){_opaqueSort=method},this.setTransparentSort=function(method){_transparentSort=method},this.getClearColor=function(target$1){return target$1.copy(background.getClearColor())},this.setClearColor=function(){background.setClearColor(...arguments)},this.getClearAlpha=function(){return background.getClearAlpha()},this.setClearAlpha=function(){background.setClearAlpha(...arguments)},this.clear=function(color$2=!0,depth$1=!0,stencil$1=!0){let bits=0;if(color$2){let isIntegerFormat=!1;if(_currentRenderTarget!==null){let targetFormat=_currentRenderTarget.texture.format;isIntegerFormat=targetFormat===RGBAIntegerFormat||targetFormat===RGIntegerFormat||targetFormat===RedIntegerFormat}if(isIntegerFormat){let targetType=_currentRenderTarget.texture.type,isUnsignedType=targetType===UnsignedByteType||targetType===UnsignedIntType||targetType===UnsignedShortType||targetType===UnsignedInt248Type||targetType===UnsignedShort4444Type||targetType===UnsignedShort5551Type,clearColor=background.getClearColor(),a$2=background.getClearAlpha(),r$2=clearColor.r,g$2=clearColor.g,b$4=clearColor.b;isUnsignedType?(uintClearColor[0]=r$2,uintClearColor[1]=g$2,uintClearColor[2]=b$4,uintClearColor[3]=a$2,_gl.clearBufferuiv(_gl.COLOR,0,uintClearColor)):(intClearColor[0]=r$2,intClearColor[1]=g$2,intClearColor[2]=b$4,intClearColor[3]=a$2,_gl.clearBufferiv(_gl.COLOR,0,intClearColor))}else bits|=_gl.COLOR_BUFFER_BIT}depth$1&&(bits|=_gl.DEPTH_BUFFER_BIT),stencil$1&&(bits|=_gl.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),_gl.clear(bits)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){canvas.removeEventListener(`webglcontextlost`,onContextLost,!1),canvas.removeEventListener(`webglcontextrestored`,onContextRestore,!1),canvas.removeEventListener(`webglcontextcreationerror`,onContextCreationError,!1),background.dispose(),renderLists.dispose(),renderStates.dispose(),properties.dispose(),cubemaps.dispose(),cubeuvmaps.dispose(),objects.dispose(),bindingStates.dispose(),uniformsGroups.dispose(),programCache.dispose(),xr$1.dispose(),xr$1.removeEventListener(`sessionstart`,onXRSessionStart),xr$1.removeEventListener(`sessionend`,onXRSessionEnd),animation.stop()};function onContextLost(event){event.preventDefault(),console.log(`THREE.WebGLRenderer: Context Lost.`),_isContextLost=!0}function onContextRestore(){console.log(`THREE.WebGLRenderer: Context Restored.`),_isContextLost=!1;let infoAutoReset=info.autoReset,shadowMapEnabled=shadowMap.enabled,shadowMapAutoUpdate=shadowMap.autoUpdate,shadowMapNeedsUpdate=shadowMap.needsUpdate,shadowMapType=shadowMap.type;initGLContext(),info.autoReset=infoAutoReset,shadowMap.enabled=shadowMapEnabled,shadowMap.autoUpdate=shadowMapAutoUpdate,shadowMap.needsUpdate=shadowMapNeedsUpdate,shadowMap.type=shadowMapType}function onContextCreationError(event){console.error(`THREE.WebGLRenderer: A WebGL context could not be created. Reason: `,event.statusMessage)}function onMaterialDispose(event){let material=event.target;material.removeEventListener(`dispose`,onMaterialDispose),deallocateMaterial(material)}function deallocateMaterial(material){releaseMaterialProgramReferences(material),properties.remove(material)}function releaseMaterialProgramReferences(material){let programs=properties.get(material).programs;programs!==void 0&&(programs.forEach(function(program){programCache.releaseProgram(program)}),material.isShaderMaterial&&programCache.releaseShaderCache(material))}this.renderBufferDirect=function(camera,scene,geometry,material,object,group){scene===null&&(scene=_emptyScene);let frontFaceCW=object.isMesh&&object.matrixWorld.determinant()<0,program=setProgram(camera,scene,geometry,material,object);state.setMaterial(material,frontFaceCW);let index$1=geometry.index,rangeFactor=1;if(material.wireframe===!0){if(index$1=geometries.getWireframeAttribute(geometry),index$1===void 0)return;rangeFactor=2}let drawRange=geometry.drawRange,position$2=geometry.attributes.position,drawStart=drawRange.start*rangeFactor,drawEnd=(drawRange.start+drawRange.count)*rangeFactor;group!==null&&(drawStart=Math.max(drawStart,group.start*rangeFactor),drawEnd=Math.min(drawEnd,(group.start+group.count)*rangeFactor)),index$1===null?position$2!=null&&(drawStart=Math.max(drawStart,0),drawEnd=Math.min(drawEnd,position$2.count)):(drawStart=Math.max(drawStart,0),drawEnd=Math.min(drawEnd,index$1.count));let drawCount=drawEnd-drawStart;if(drawCount<0||drawCount===1/0)return;bindingStates.setup(object,material,program,geometry,index$1);let attribute,renderer$1=bufferRenderer;if(index$1!==null&&(attribute=attributes.get(index$1),renderer$1=indexedBufferRenderer,renderer$1.setIndex(attribute)),object.isMesh)material.wireframe===!0?(state.setLineWidth(material.wireframeLinewidth*getTargetPixelRatio()),renderer$1.setMode(_gl.LINES)):renderer$1.setMode(_gl.TRIANGLES);else if(object.isLine){let lineWidth=material.linewidth;lineWidth===void 0&&(lineWidth=1),state.setLineWidth(lineWidth*getTargetPixelRatio()),object.isLineSegments?renderer$1.setMode(_gl.LINES):object.isLineLoop?renderer$1.setMode(_gl.LINE_LOOP):renderer$1.setMode(_gl.LINE_STRIP)}else object.isPoints?renderer$1.setMode(_gl.POINTS):object.isSprite&&renderer$1.setMode(_gl.TRIANGLES);if(object.isBatchedMesh)if(object._multiDrawInstances!==null)warnOnce$1(`THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection.`),renderer$1.renderMultiDrawInstances(object._multiDrawStarts,object._multiDrawCounts,object._multiDrawCount,object._multiDrawInstances);else if(extensions.get(`WEBGL_multi_draw`))renderer$1.renderMultiDraw(object._multiDrawStarts,object._multiDrawCounts,object._multiDrawCount);else{let starts=object._multiDrawStarts,counts=object._multiDrawCounts,drawCount$1=object._multiDrawCount,bytesPerElement=index$1?attributes.get(index$1).bytesPerElement:1,uniforms=properties.get(material).currentProgram.getUniforms();for(let i$1=0;i$1{function checkMaterialsReady(){if(materials$1.forEach(function(material){let materialProperties=properties.get(material),program=materialProperties.currentProgram;program.isReady()&&materials$1.delete(material)}),materials$1.size===0){resolve$1(scene);return}setTimeout(checkMaterialsReady,10)}extensions.get(`KHR_parallel_shader_compile`)===null?setTimeout(checkMaterialsReady,10):checkMaterialsReady()})};let onAnimationFrameCallback=null;function onAnimationFrame(time){onAnimationFrameCallback&&onAnimationFrameCallback(time)}function onXRSessionStart(){animation.stop()}function onXRSessionEnd(){animation.start()}let animation=new WebGLAnimation;animation.setAnimationLoop(onAnimationFrame),typeof self<`u`&&animation.setContext(self),this.setAnimationLoop=function(callback){onAnimationFrameCallback=callback,xr$1.setAnimationLoop(callback),callback===null?animation.stop():animation.start()},xr$1.addEventListener(`sessionstart`,onXRSessionStart),xr$1.addEventListener(`sessionend`,onXRSessionEnd),this.render=function(scene,camera){if(camera!==void 0&&camera.isCamera!==!0){console.error(`THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.`);return}if(_isContextLost===!0)return;if(scene.matrixWorldAutoUpdate===!0&&scene.updateMatrixWorld(),camera.parent===null&&camera.matrixWorldAutoUpdate===!0&&camera.updateMatrixWorld(),xr$1.enabled===!0&&xr$1.isPresenting===!0&&(xr$1.cameraAutoUpdate===!0&&xr$1.updateCamera(camera),camera=xr$1.getCamera()),scene.isScene===!0&&scene.onBeforeRender(_this,scene,camera,_currentRenderTarget),currentRenderState=renderStates.get(scene,renderStateStack.length),currentRenderState.init(camera),renderStateStack.push(currentRenderState),_projScreenMatrix$3.multiplyMatrices(camera.projectionMatrix,camera.matrixWorldInverse),_frustum$2.setFromProjectionMatrix(_projScreenMatrix$3),_localClippingEnabled=this.localClippingEnabled,_clippingEnabled=clipping.init(this.clippingPlanes,_localClippingEnabled),currentRenderList=renderLists.get(scene,renderListStack.length),currentRenderList.init(),renderListStack.push(currentRenderList),xr$1.enabled===!0&&xr$1.isPresenting===!0){let depthSensingMesh=_this.xr.getDepthSensingMesh();depthSensingMesh!==null&&projectObject(depthSensingMesh,camera,-1/0,_this.sortObjects)}projectObject(scene,camera,0,_this.sortObjects),currentRenderList.finish(),_this.sortObjects===!0&¤tRenderList.sort(_opaqueSort,_transparentSort),_renderBackground=xr$1.enabled===!1||xr$1.isPresenting===!1||xr$1.hasDepthSensing()===!1,_renderBackground&&background.addToRenderList(currentRenderList,scene),this.info.render.frame++,_clippingEnabled===!0&&clipping.beginShadows();let shadowsArray=currentRenderState.state.shadowsArray;shadowMap.render(shadowsArray,scene,camera),_clippingEnabled===!0&&clipping.endShadows(),this.info.autoReset===!0&&this.info.reset();let opaqueObjects=currentRenderList.opaque,transmissiveObjects=currentRenderList.transmissive;if(currentRenderState.setupLights(),camera.isArrayCamera){let cameras=camera.cameras;if(transmissiveObjects.length>0)for(let i$1=0,l$1=cameras.length;i$10&&renderTransmissionPass(opaqueObjects,transmissiveObjects,scene,camera),_renderBackground&&background.render(scene),renderScene(currentRenderList,scene,camera);_currentRenderTarget!==null&&_currentActiveMipmapLevel===0&&(textures.updateMultisampleRenderTarget(_currentRenderTarget),textures.updateRenderTargetMipmap(_currentRenderTarget)),scene.isScene===!0&&scene.onAfterRender(_this,scene,camera),bindingStates.resetDefaultState(),_currentMaterialId=-1,_currentCamera=null,renderStateStack.pop(),renderStateStack.length>0?(currentRenderState=renderStateStack[renderStateStack.length-1],_clippingEnabled===!0&&clipping.setGlobalState(_this.clippingPlanes,currentRenderState.state.camera)):currentRenderState=null,renderListStack.pop(),currentRenderList=renderListStack.length>0?renderListStack[renderListStack.length-1]:null};function projectObject(object,camera,groupOrder,sortObjects){if(object.visible===!1)return;let visible=object.layers.test(camera.layers);if(visible){if(object.isGroup)groupOrder=object.renderOrder;else if(object.isLOD)object.autoUpdate===!0&&object.update(camera);else if(object.isLight)currentRenderState.pushLight(object),object.castShadow&¤tRenderState.pushShadow(object);else if(object.isSprite){if(!object.frustumCulled||_frustum$2.intersectsSprite(object)){sortObjects&&_vector4.setFromMatrixPosition(object.matrixWorld).applyMatrix4(_projScreenMatrix$3);let geometry=objects.update(object),material=object.material;material.visible&¤tRenderList.push(object,geometry,material,groupOrder,_vector4.z,null)}}else if((object.isMesh||object.isLine||object.isPoints)&&(!object.frustumCulled||_frustum$2.intersectsObject(object))){let geometry=objects.update(object),material=object.material;if(sortObjects&&(object.boundingSphere===void 0?(geometry.boundingSphere===null&&geometry.computeBoundingSphere(),_vector4.copy(geometry.boundingSphere.center)):(object.boundingSphere===null&&object.computeBoundingSphere(),_vector4.copy(object.boundingSphere.center)),_vector4.applyMatrix4(object.matrixWorld).applyMatrix4(_projScreenMatrix$3)),Array.isArray(material)){let groups=geometry.groups;for(let i$1=0,l$1=groups.length;i$10&&renderObjects(opaqueObjects,scene,camera),transmissiveObjects.length>0&&renderObjects(transmissiveObjects,scene,camera),transparentObjects.length>0&&renderObjects(transparentObjects,scene,camera),state.buffers.depth.setTest(!0),state.buffers.depth.setMask(!0),state.buffers.color.setMask(!0),state.setPolygonOffset(!1)}function renderTransmissionPass(opaqueObjects,transmissiveObjects,scene,camera){let overrideMaterial=scene.isScene===!0?scene.overrideMaterial:null;if(overrideMaterial!==null)return;currentRenderState.state.transmissionRenderTarget[camera.id]===void 0&&(currentRenderState.state.transmissionRenderTarget[camera.id]=new WebGLRenderTarget(1,1,{generateMipmaps:!0,type:extensions.has(`EXT_color_buffer_half_float`)||extensions.has(`EXT_color_buffer_float`)?HalfFloatType:UnsignedByteType,minFilter:LinearMipmapLinearFilter,samples:4,stencilBuffer:stencil,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:ColorManagement.workingColorSpace}));let transmissionRenderTarget=currentRenderState.state.transmissionRenderTarget[camera.id],activeViewport=camera.viewport||_currentViewport;transmissionRenderTarget.setSize(activeViewport.z*_this.transmissionResolutionScale,activeViewport.w*_this.transmissionResolutionScale);let currentRenderTarget=_this.getRenderTarget(),currentActiveCubeFace=_this.getActiveCubeFace(),currentActiveMipmapLevel=_this.getActiveMipmapLevel();_this.setRenderTarget(transmissionRenderTarget),_this.getClearColor(_currentClearColor),_currentClearAlpha=_this.getClearAlpha(),_currentClearAlpha<1&&_this.setClearColor(16777215,.5),_this.clear(),_renderBackground&&background.render(scene);let currentToneMapping=_this.toneMapping;_this.toneMapping=NoToneMapping;let currentCameraViewport=camera.viewport;if(camera.viewport!==void 0&&(camera.viewport=void 0),currentRenderState.setupLightsView(camera),_clippingEnabled===!0&&clipping.setGlobalState(_this.clippingPlanes,camera),renderObjects(opaqueObjects,scene,camera),textures.updateMultisampleRenderTarget(transmissionRenderTarget),textures.updateRenderTargetMipmap(transmissionRenderTarget),extensions.has(`WEBGL_multisampled_render_to_texture`)===!1){let renderTargetNeedsUpdate=!1;for(let i$1=0,l$1=transmissiveObjects.length;i$10),morphTargets=!!geometry.morphAttributes.position,morphNormals=!!geometry.morphAttributes.normal,morphColors=!!geometry.morphAttributes.color,toneMapping=NoToneMapping;material.toneMapped&&(_currentRenderTarget===null||_currentRenderTarget.isXRRenderTarget===!0)&&(toneMapping=_this.toneMapping);let morphAttribute=geometry.morphAttributes.position||geometry.morphAttributes.normal||geometry.morphAttributes.color,morphTargetsCount=morphAttribute===void 0?0:morphAttribute.length,materialProperties=properties.get(material),lights=currentRenderState.state.lights;if(_clippingEnabled===!0&&(_localClippingEnabled===!0||camera!==_currentCamera)){let useCache=camera===_currentCamera&&material.id===_currentMaterialId;clipping.setState(material,camera,useCache)}let needsProgramChange=!1;material.version===materialProperties.__version?materialProperties.needsLights&&materialProperties.lightsStateVersion!==lights.state.version?needsProgramChange=!0:materialProperties.outputColorSpace===colorSpace?object.isBatchedMesh&&materialProperties.batching===!1||!object.isBatchedMesh&&materialProperties.batching===!0||object.isBatchedMesh&&materialProperties.batchingColor===!0&&object.colorTexture===null||object.isBatchedMesh&&materialProperties.batchingColor===!1&&object.colorTexture!==null||object.isInstancedMesh&&materialProperties.instancing===!1||!object.isInstancedMesh&&materialProperties.instancing===!0||object.isSkinnedMesh&&materialProperties.skinning===!1||!object.isSkinnedMesh&&materialProperties.skinning===!0||object.isInstancedMesh&&materialProperties.instancingColor===!0&&object.instanceColor===null||object.isInstancedMesh&&materialProperties.instancingColor===!1&&object.instanceColor!==null||object.isInstancedMesh&&materialProperties.instancingMorph===!0&&object.morphTexture===null||object.isInstancedMesh&&materialProperties.instancingMorph===!1&&object.morphTexture!==null?needsProgramChange=!0:materialProperties.envMap===envMap?material.fog===!0&&materialProperties.fog!==fog||materialProperties.numClippingPlanes!==void 0&&(materialProperties.numClippingPlanes!==clipping.numPlanes||materialProperties.numIntersection!==clipping.numIntersection)?needsProgramChange=!0:materialProperties.vertexAlphas===vertexAlphas&&materialProperties.vertexTangents===vertexTangents&&materialProperties.morphTargets===morphTargets&&materialProperties.morphNormals===morphNormals&&materialProperties.morphColors===morphColors&&materialProperties.toneMapping===toneMapping?materialProperties.morphTargetsCount!==morphTargetsCount&&(needsProgramChange=!0):needsProgramChange=!0:needsProgramChange=!0:needsProgramChange=!0:(needsProgramChange=!0,materialProperties.__version=material.version);let program=materialProperties.currentProgram;needsProgramChange===!0&&(program=getProgram(material,scene,object));let refreshProgram=!1,refreshMaterial=!1,refreshLights=!1,p_uniforms=program.getUniforms(),m_uniforms=materialProperties.uniforms;if(state.useProgram(program.program)&&(refreshProgram=!0,refreshMaterial=!0,refreshLights=!0),material.id!==_currentMaterialId&&(_currentMaterialId=material.id,refreshMaterial=!0),refreshProgram||_currentCamera!==camera){let reverseDepthBuffer$1=state.buffers.depth.getReversed();reverseDepthBuffer$1?(_currentProjectionMatrix.copy(camera.projectionMatrix),toNormalizedProjectionMatrix(_currentProjectionMatrix),toReversedProjectionMatrix(_currentProjectionMatrix),p_uniforms.setValue(_gl,`projectionMatrix`,_currentProjectionMatrix)):p_uniforms.setValue(_gl,`projectionMatrix`,camera.projectionMatrix),p_uniforms.setValue(_gl,`viewMatrix`,camera.matrixWorldInverse);let uCamPos=p_uniforms.map.cameraPosition;uCamPos!==void 0&&uCamPos.setValue(_gl,_vector3$1.setFromMatrixPosition(camera.matrixWorld)),capabilities.logarithmicDepthBuffer&&p_uniforms.setValue(_gl,`logDepthBufFC`,2/(Math.log(camera.far+1)/Math.LN2)),(material.isMeshPhongMaterial||material.isMeshToonMaterial||material.isMeshLambertMaterial||material.isMeshBasicMaterial||material.isMeshStandardMaterial||material.isShaderMaterial)&&p_uniforms.setValue(_gl,`isOrthographic`,camera.isOrthographicCamera===!0),_currentCamera!==camera&&(_currentCamera=camera,refreshMaterial=!0,refreshLights=!0)}if(object.isSkinnedMesh){p_uniforms.setOptional(_gl,object,`bindMatrix`),p_uniforms.setOptional(_gl,object,`bindMatrixInverse`);let skeleton=object.skeleton;skeleton&&(skeleton.boneTexture===null&&skeleton.computeBoneTexture(),p_uniforms.setValue(_gl,`boneTexture`,skeleton.boneTexture,textures))}object.isBatchedMesh&&(p_uniforms.setOptional(_gl,object,`batchingTexture`),p_uniforms.setValue(_gl,`batchingTexture`,object._matricesTexture,textures),p_uniforms.setOptional(_gl,object,`batchingIdTexture`),p_uniforms.setValue(_gl,`batchingIdTexture`,object._indirectTexture,textures),p_uniforms.setOptional(_gl,object,`batchingColorTexture`),object._colorsTexture!==null&&p_uniforms.setValue(_gl,`batchingColorTexture`,object._colorsTexture,textures));let morphAttributes=geometry.morphAttributes;if((morphAttributes.position!==void 0||morphAttributes.normal!==void 0||morphAttributes.color!==void 0)&&morphtargets.update(object,geometry,program),(refreshMaterial||materialProperties.receiveShadow!==object.receiveShadow)&&(materialProperties.receiveShadow=object.receiveShadow,p_uniforms.setValue(_gl,`receiveShadow`,object.receiveShadow)),material.isMeshGouraudMaterial&&material.envMap!==null&&(m_uniforms.envMap.value=envMap,m_uniforms.flipEnvMap.value=envMap.isCubeTexture&&envMap.isRenderTargetTexture===!1?-1:1),material.isMeshStandardMaterial&&material.envMap===null&&scene.environment!==null&&(m_uniforms.envMapIntensity.value=scene.environmentIntensity),refreshMaterial&&(p_uniforms.setValue(_gl,`toneMappingExposure`,_this.toneMappingExposure),materialProperties.needsLights&&markUniformsLightsNeedsUpdate(m_uniforms,refreshLights),fog&&material.fog===!0&&materials.refreshFogUniforms(m_uniforms,fog),materials.refreshMaterialUniforms(m_uniforms,material,_pixelRatio,_height,currentRenderState.state.transmissionRenderTarget[camera.id]),WebGLUniforms.upload(_gl,getUniformList(materialProperties),m_uniforms,textures)),material.isShaderMaterial&&material.uniformsNeedUpdate===!0&&(WebGLUniforms.upload(_gl,getUniformList(materialProperties),m_uniforms,textures),material.uniformsNeedUpdate=!1),material.isSpriteMaterial&&p_uniforms.setValue(_gl,`center`,object.center),p_uniforms.setValue(_gl,`modelViewMatrix`,object.modelViewMatrix),p_uniforms.setValue(_gl,`normalMatrix`,object.normalMatrix),p_uniforms.setValue(_gl,`modelMatrix`,object.matrixWorld),material.isShaderMaterial||material.isRawShaderMaterial){let groups=material.uniformsGroups;for(let i$1=0,l$1=groups.length;i$10&&textures.useMultisampledRTT(renderTarget)===!1?properties.get(renderTarget).__webglMultisampledFramebuffer:Array.isArray(__webglFramebuffer)?__webglFramebuffer[activeMipmapLevel]:__webglFramebuffer,_currentViewport.copy(renderTarget.viewport),_currentScissor.copy(renderTarget.scissor),_currentScissorTest=renderTarget.scissorTest}else _currentViewport.copy(_viewport).multiplyScalar(_pixelRatio).floor(),_currentScissor.copy(_scissor).multiplyScalar(_pixelRatio).floor(),_currentScissorTest=_scissorTest;activeMipmapLevel!==0&&(framebuffer=_scratchFrameBuffer);let framebufferBound=state.bindFramebuffer(_gl.FRAMEBUFFER,framebuffer);if(framebufferBound&&useDefaultFramebuffer&&state.drawBuffers(renderTarget,framebuffer),state.viewport(_currentViewport),state.scissor(_currentScissor),state.setScissorTest(_currentScissorTest),isCube){let textureProperties=properties.get(renderTarget.texture);_gl.framebufferTexture2D(_gl.FRAMEBUFFER,_gl.COLOR_ATTACHMENT0,_gl.TEXTURE_CUBE_MAP_POSITIVE_X+activeCubeFace,textureProperties.__webglTexture,activeMipmapLevel)}else if(isRenderTarget3D){let textureProperties=properties.get(renderTarget.texture),layer=activeCubeFace;_gl.framebufferTextureLayer(_gl.FRAMEBUFFER,_gl.COLOR_ATTACHMENT0,textureProperties.__webglTexture,activeMipmapLevel,layer)}else if(renderTarget!==null&&activeMipmapLevel!==0){let textureProperties=properties.get(renderTarget.texture);_gl.framebufferTexture2D(_gl.FRAMEBUFFER,_gl.COLOR_ATTACHMENT0,_gl.TEXTURE_2D,textureProperties.__webglTexture,activeMipmapLevel)}_currentMaterialId=-1},this.readRenderTargetPixels=function(renderTarget,x$3,y$3,width,height,buffer$1,activeCubeFaceIndex,textureIndex=0){if(!(renderTarget&&renderTarget.isWebGLRenderTarget)){console.error(`THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.`);return}let framebuffer=properties.get(renderTarget).__webglFramebuffer;if(renderTarget.isWebGLCubeRenderTarget&&activeCubeFaceIndex!==void 0&&(framebuffer=framebuffer[activeCubeFaceIndex]),framebuffer){state.bindFramebuffer(_gl.FRAMEBUFFER,framebuffer);try{let texture=renderTarget.textures[textureIndex],textureFormat=texture.format,textureType=texture.type;if(!capabilities.textureFormatReadable(textureFormat)){console.error(`THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.`);return}if(!capabilities.textureTypeReadable(textureType)){console.error(`THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.`);return}x$3>=0&&x$3<=renderTarget.width-width&&y$3>=0&&y$3<=renderTarget.height-height&&(renderTarget.textures.length>1&&_gl.readBuffer(_gl.COLOR_ATTACHMENT0+textureIndex),_gl.readPixels(x$3,y$3,width,height,utils$1.convert(textureFormat),utils$1.convert(textureType),buffer$1))}finally{let framebuffer$1=_currentRenderTarget===null?null:properties.get(_currentRenderTarget).__webglFramebuffer;state.bindFramebuffer(_gl.FRAMEBUFFER,framebuffer$1)}}},this.readRenderTargetPixelsAsync=async function(renderTarget,x$3,y$3,width,height,buffer$1,activeCubeFaceIndex,textureIndex=0){if(!(renderTarget&&renderTarget.isWebGLRenderTarget))throw Error(`THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.`);let framebuffer=properties.get(renderTarget).__webglFramebuffer;if(renderTarget.isWebGLCubeRenderTarget&&activeCubeFaceIndex!==void 0&&(framebuffer=framebuffer[activeCubeFaceIndex]),framebuffer)if(x$3>=0&&x$3<=renderTarget.width-width&&y$3>=0&&y$3<=renderTarget.height-height){state.bindFramebuffer(_gl.FRAMEBUFFER,framebuffer);let texture=renderTarget.textures[textureIndex],textureFormat=texture.format,textureType=texture.type;if(!capabilities.textureFormatReadable(textureFormat))throw Error(`THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.`);if(!capabilities.textureTypeReadable(textureType))throw Error(`THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.`);let glBuffer=_gl.createBuffer();_gl.bindBuffer(_gl.PIXEL_PACK_BUFFER,glBuffer),_gl.bufferData(_gl.PIXEL_PACK_BUFFER,buffer$1.byteLength,_gl.STREAM_READ),renderTarget.textures.length>1&&_gl.readBuffer(_gl.COLOR_ATTACHMENT0+textureIndex),_gl.readPixels(x$3,y$3,width,height,utils$1.convert(textureFormat),utils$1.convert(textureType),0);let currFramebuffer=_currentRenderTarget===null?null:properties.get(_currentRenderTarget).__webglFramebuffer;state.bindFramebuffer(_gl.FRAMEBUFFER,currFramebuffer);let sync$2=_gl.fenceSync(_gl.SYNC_GPU_COMMANDS_COMPLETE,0);return _gl.flush(),await probeAsync(_gl,sync$2,4),_gl.bindBuffer(_gl.PIXEL_PACK_BUFFER,glBuffer),_gl.getBufferSubData(_gl.PIXEL_PACK_BUFFER,0,buffer$1),_gl.deleteBuffer(glBuffer),_gl.deleteSync(sync$2),buffer$1}else throw Error(`THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.`)},this.copyFramebufferToTexture=function(texture,position$2=null,level=0){let levelScale=2**-level,width=Math.floor(texture.image.width*levelScale),height=Math.floor(texture.image.height*levelScale),x$3=position$2===null?0:position$2.x,y$3=position$2===null?0:position$2.y;textures.setTexture2D(texture,0),_gl.copyTexSubImage2D(_gl.TEXTURE_2D,level,0,0,x$3,y$3,width,height),state.unbindTexture()};let _srcFramebuffer=_gl.createFramebuffer(),_dstFramebuffer=_gl.createFramebuffer();this.copyTextureToTexture=function(srcTexture,dstTexture,srcRegion=null,dstPosition=null,srcLevel=0,dstLevel=null){dstLevel===null&&(srcLevel===0?dstLevel=0:(warnOnce$1(`WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels.`),dstLevel=srcLevel,srcLevel=0));let width,height,depth$1,minX,minY,minZ,dstX,dstY,dstZ,image$1=srcTexture.isCompressedTexture?srcTexture.mipmaps[dstLevel]:srcTexture.image;if(srcRegion!==null)width=srcRegion.max.x-srcRegion.min.x,height=srcRegion.max.y-srcRegion.min.y,depth$1=srcRegion.isBox3?srcRegion.max.z-srcRegion.min.z:1,minX=srcRegion.min.x,minY=srcRegion.min.y,minZ=srcRegion.isBox3?srcRegion.min.z:0;else{let levelScale=2**-srcLevel;width=Math.floor(image$1.width*levelScale),height=Math.floor(image$1.height*levelScale),depth$1=srcTexture.isDataArrayTexture?image$1.depth:srcTexture.isData3DTexture?Math.floor(image$1.depth*levelScale):1,minX=0,minY=0,minZ=0}dstPosition===null?(dstX=0,dstY=0,dstZ=0):(dstX=dstPosition.x,dstY=dstPosition.y,dstZ=dstPosition.z);let glFormat=utils$1.convert(dstTexture.format),glType=utils$1.convert(dstTexture.type),glTarget;dstTexture.isData3DTexture?(textures.setTexture3D(dstTexture,0),glTarget=_gl.TEXTURE_3D):dstTexture.isDataArrayTexture||dstTexture.isCompressedArrayTexture?(textures.setTexture2DArray(dstTexture,0),glTarget=_gl.TEXTURE_2D_ARRAY):(textures.setTexture2D(dstTexture,0),glTarget=_gl.TEXTURE_2D),_gl.pixelStorei(_gl.UNPACK_FLIP_Y_WEBGL,dstTexture.flipY),_gl.pixelStorei(_gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,dstTexture.premultiplyAlpha),_gl.pixelStorei(_gl.UNPACK_ALIGNMENT,dstTexture.unpackAlignment);let currentUnpackRowLen=_gl.getParameter(_gl.UNPACK_ROW_LENGTH),currentUnpackImageHeight=_gl.getParameter(_gl.UNPACK_IMAGE_HEIGHT),currentUnpackSkipPixels=_gl.getParameter(_gl.UNPACK_SKIP_PIXELS),currentUnpackSkipRows=_gl.getParameter(_gl.UNPACK_SKIP_ROWS),currentUnpackSkipImages=_gl.getParameter(_gl.UNPACK_SKIP_IMAGES);_gl.pixelStorei(_gl.UNPACK_ROW_LENGTH,image$1.width),_gl.pixelStorei(_gl.UNPACK_IMAGE_HEIGHT,image$1.height),_gl.pixelStorei(_gl.UNPACK_SKIP_PIXELS,minX),_gl.pixelStorei(_gl.UNPACK_SKIP_ROWS,minY),_gl.pixelStorei(_gl.UNPACK_SKIP_IMAGES,minZ);let isSrc3D=srcTexture.isDataArrayTexture||srcTexture.isData3DTexture,isDst3D=dstTexture.isDataArrayTexture||dstTexture.isData3DTexture;if(srcTexture.isDepthTexture){let srcTextureProperties=properties.get(srcTexture),dstTextureProperties=properties.get(dstTexture),srcRenderTargetProperties=properties.get(srcTextureProperties.__renderTarget),dstRenderTargetProperties=properties.get(dstTextureProperties.__renderTarget);state.bindFramebuffer(_gl.READ_FRAMEBUFFER,srcRenderTargetProperties.__webglFramebuffer),state.bindFramebuffer(_gl.DRAW_FRAMEBUFFER,dstRenderTargetProperties.__webglFramebuffer);for(let i$1=0;i$1{fns.delete(fn$6)},clear=()=>{fns.clear()},on$2=fn$6=>{fns.add(fn$6);let offFn=()=>off(fn$6);return tryOnScopeDispose$1(offFn),{off:offFn}},trigger$1=(...args)=>Promise.all(Array.from(fns).map(fn$6=>fn$6(...args)));return{on:on$2,off,trigger:trigger$1,clear}}function createGlobalState(stateFactory){let initialized=!1,state,scope=effectScope(!0);return(...args)=>(initialized||(state=scope.run(()=>stateFactory(...args)),initialized=!0),state)}const localProvidedStateMap$1=new WeakMap,injectLocal$1=(...args)=>{var _a$3;let key$2=args[0],instance=(_a$3=getCurrentInstance())?.proxy;if(instance==null&&!hasInjectionContext())throw Error(`injectLocal must be called in setup`);return instance&&localProvidedStateMap$1.has(instance)&&key$2 in localProvidedStateMap$1.get(instance)?localProvidedStateMap$1.get(instance)[key$2]:inject(...args)};function createSharedComposable(composable){let subscribers=0,state,scope,dispose$1=()=>{--subscribers,scope&&subscribers<=0&&(scope.stop(),state=void 0,scope=void 0)};return(...args)=>(subscribers+=1,scope||(scope=effectScope(!0),state=scope.run(()=>composable(...args))),tryOnScopeDispose$1(dispose$1),state)}const isClient$1=typeof window<`u`&&typeof document<`u`,isWorker$1=typeof WorkerGlobalScope<`u`&&globalThis instanceof WorkerGlobalScope,isDef$1=val=>val!==void 0,notNullish$1=val=>val!=null,toString$3=Object.prototype.toString,isObject$4=val=>toString$3.call(val)===`[object Object]`,noop$4=()=>{},isIOS=getIsIOS();function getIsIOS(){var _a$3,_b;return isClient$1&&(_a$3=window==null?void 0:window.navigator)?.userAgent&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||(_b=window==null?void 0:window.navigator)?.maxTouchPoints>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function createFilterWrapper$1(filter$1,fn$6){function wrapper(...args){return new Promise((resolve$1,reject)=>{Promise.resolve(filter$1(()=>fn$6.apply(this,args),{fn:fn$6,thisArg:this,args})).then(resolve$1).catch(reject)})}return wrapper}function debounceFilter$1(ms$1,options$1={}){let timer,maxTimer,lastRejector=noop$4,_clearTimeout=timer2=>{clearTimeout(timer2),lastRejector(),lastRejector=noop$4},lastInvoker,filter$1=invoke$1=>{let duration=toValue$1(ms$1),maxDuration$1=toValue$1(options$1.maxWait);return timer&&_clearTimeout(timer),duration<=0||maxDuration$1!==void 0&&maxDuration$1<=0?(maxTimer&&(_clearTimeout(maxTimer),maxTimer=null),Promise.resolve(invoke$1())):new Promise((resolve$1,reject)=>{lastRejector=options$1.rejectOnCancel?reject:resolve$1,lastInvoker=invoke$1,maxDuration$1&&!maxTimer&&(maxTimer=setTimeout(()=>{timer&&_clearTimeout(timer),maxTimer=null,resolve$1(lastInvoker())},maxDuration$1)),timer=setTimeout(()=>{maxTimer&&_clearTimeout(maxTimer),maxTimer=null,resolve$1(invoke$1())},duration)})};return filter$1}function cacheStringFunction$1(fn$6){let cache$1=Object.create(null);return str=>{let hit=cache$1[str];return hit||(cache$1[str]=fn$6(str))}}const hyphenateRE$1=/\B([A-Z])/g,hyphenate$1=cacheStringFunction$1(str=>str.replace(hyphenateRE$1,`-$1`).toLowerCase()),camelizeRE$1=/-(\w)/g,camelize$2=cacheStringFunction$1(str=>str.replace(camelizeRE$1,(_$2,c$4)=>c$4?c$4.toUpperCase():``));function pxValue$1(px$2){return px$2.endsWith(`rem`)?Number.parseFloat(px$2)*16:Number.parseFloat(px$2)}function objectPick$1(obj,keys$3,omitUndefined=!1){return keys$3.reduce((n$2,k$4)=>(k$4 in obj&&(!omitUndefined||obj[k$4]!==void 0)&&(n$2[k$4]=obj[k$4]),n$2),{})}function getLifeCycleTarget$1(target$1){return target$1||getCurrentInstance()}function toArray$1(value$1){return Array.isArray(value$1)?value$1:[value$1]}function useDebounceFn$1(fn$6,ms$1=200,options$1={}){return createFilterWrapper$1(debounceFilter$1(ms$1,options$1),fn$6)}function refDebounced$1(value$1,ms$1=200,options$1={}){let debounced=ref(value$1.value),updater=useDebounceFn$1(()=>{debounced.value=value$1.value},ms$1,options$1);return watch(value$1,()=>updater()),debounced}function toRefs$2(objectRef,options$1={}){if(!isRef(objectRef))return toRefs(objectRef);let result=Array.isArray(objectRef.value)?Array.from({length:objectRef.value.length}):{};for(let key$2 in objectRef.value)result[key$2]=customRef(()=>({get(){return objectRef.value[key$2]},set(v$2){var _a$3;let replaceRef=(_a$3=toValue$1(options$1.replaceRef))??!0;if(replaceRef)if(Array.isArray(objectRef.value)){let copy=[...objectRef.value];copy[key$2]=v$2,objectRef.value=copy}else{let newObject={...objectRef.value,[key$2]:v$2};Object.setPrototypeOf(newObject,Object.getPrototypeOf(objectRef.value)),objectRef.value=newObject}else objectRef.value[key$2]=v$2}}));return result}const toValue=toValue$1;function tryOnBeforeUnmount(fn$6,target$1){let instance=getLifeCycleTarget$1(target$1);instance&&onBeforeUnmount(fn$6,target$1)}function tryOnMounted$1(fn$6,sync$2=!0,target$1){let instance=getLifeCycleTarget$1();instance?onMounted(fn$6,target$1):sync$2?fn$6():nextTick(fn$6)}function useIntervalFn$1(cb$1,interval=1e3,options$1={}){let{immediate=!0,immediateCallback=!1}=options$1,timer=null,isActive=shallowRef(!1);function clean$3(){timer&&(clearInterval(timer),timer=null)}function pause(){isActive.value=!1,clean$3()}function resume(){let intervalValue=toValue$1(interval);intervalValue<=0||(isActive.value=!0,immediateCallback&&cb$1(),clean$3(),isActive.value&&(timer=setInterval(cb$1,intervalValue)))}if(immediate&&isClient$1&&resume(),isRef(interval)||typeof interval==`function`){let stopWatch=watch(interval,()=>{isActive.value&&isClient$1&&resume()});tryOnScopeDispose$1(stopWatch)}return tryOnScopeDispose$1(pause),{isActive,pause,resume}}function watchImmediate$1(source,cb$1,options$1){return watch(source,cb$1,{...options$1,immediate:!0})}const defaultWindow=isClient$1?window:void 0,defaultDocument$1=isClient$1?window.document:void 0,defaultNavigator$1=isClient$1?window.navigator:void 0,defaultLocation$1=isClient$1?window.location:void 0;function unrefElement(elRef){var _a$3;let plain=toValue$1(elRef);return(_a$3=plain?.$el)??plain}function useEventListener(...args){let cleanups=[],cleanup=()=>{cleanups.forEach(fn$6=>fn$6()),cleanups.length=0},register=(el$1,event,listener,options$1)=>(el$1.addEventListener(event,listener,options$1),()=>el$1.removeEventListener(event,listener,options$1)),firstParamTargets=computed(()=>{let test$1=toArray$1(toValue$1(args[0])).filter(e$3=>e$3!=null);return test$1.every(e$3=>typeof e$3!=`string`)?test$1:void 0}),stopWatch=watchImmediate$1(()=>{var _a$3,_b;return[(_b=(_a$3=firstParamTargets.value)?.map(e$3=>unrefElement(e$3)))??[defaultWindow].filter(e$3=>e$3!=null),toArray$1(toValue$1(firstParamTargets.value?args[1]:args[0])),toArray$1(unref(firstParamTargets.value?args[2]:args[1])),toValue$1(firstParamTargets.value?args[3]:args[2])]},([raw_targets,raw_events,raw_listeners,raw_options])=>{if(cleanup(),!raw_targets?.length||!raw_events?.length||!raw_listeners?.length)return;let optionsClone=isObject$4(raw_options)?{...raw_options}:raw_options;cleanups.push(...raw_targets.flatMap(el$1=>raw_events.flatMap(event=>raw_listeners.map(listener=>register(el$1,event,listener,optionsClone)))))},{flush:`post`}),stop$1=()=>{stopWatch(),cleanup()};return tryOnScopeDispose$1(cleanup),stop$1}function useMounted(){let isMounted=shallowRef(!1),instance=getCurrentInstance();return instance&&onMounted(()=>{isMounted.value=!0},instance),isMounted}function useSupported$1(callback){let isMounted=useMounted();return computed(()=>(isMounted.value,!!callback()))}function useMutationObserver$1(target$1,callback,options$1={}){let{window:window$1=defaultWindow,...mutationOptions}=options$1,observer,isSupported=useSupported$1(()=>window$1&&`MutationObserver`in window$1),cleanup=()=>{observer&&(observer.disconnect(),observer=void 0)},targets=computed(()=>{let value$1=toValue$1(target$1),items=toArray$1(value$1).map(unrefElement).filter(notNullish$1);return new Set(items)}),stopWatch=watch(()=>targets.value,targets2=>{cleanup(),isSupported.value&&targets2.size&&(observer=new MutationObserver(callback),targets2.forEach(el$1=>observer.observe(el$1,mutationOptions)))},{immediate:!0,flush:`post`}),takeRecords=()=>observer?.takeRecords(),stop$1=()=>{stopWatch(),cleanup()};return tryOnScopeDispose$1(stop$1),{isSupported,stop:stop$1,takeRecords}}function createKeyPredicate(keyFilter){return typeof keyFilter==`function`?keyFilter:typeof keyFilter==`string`?event=>event.key===keyFilter:Array.isArray(keyFilter)?event=>keyFilter.includes(event.key):()=>!0}function onKeyStroke(...args){let key$2,handler,options$1={};args.length===3?(key$2=args[0],handler=args[1],options$1=args[2]):args.length===2?typeof args[1]==`object`?(key$2=!0,handler=args[0],options$1=args[1]):(key$2=args[0],handler=args[1]):(key$2=!0,handler=args[0]);let{target:target$1=defaultWindow,eventName=`keydown`,passive=!1,dedupe=!1}=options$1,predicate=createKeyPredicate(key$2),listener=e$3=>{e$3.repeat&&toValue$1(dedupe)||predicate(e$3)&&handler(e$3)};return useEventListener(target$1,eventName,listener,passive)}function useRafFn(fn$6,options$1={}){let{immediate=!0,fpsLimit=void 0,window:window$1=defaultWindow,once=!1}=options$1,isActive=shallowRef(!1),intervalLimit=computed(()=>fpsLimit?1e3/toValue$1(fpsLimit):null),previousFrameTimestamp=0,rafId=null;function loop(timestamp$2){if(!isActive.value||!window$1)return;previousFrameTimestamp||=timestamp$2;let delta=timestamp$2-previousFrameTimestamp;if(intervalLimit.value&&deltawindow$1&&`matchMedia`in window$1&&typeof window$1.matchMedia==`function`),ssrSupport=shallowRef(typeof ssrWidth==`number`),mediaQuery=shallowRef(),matches$1=shallowRef(!1),handler=event=>{matches$1.value=event.matches};return watchEffect(()=>{if(ssrSupport.value){ssrSupport.value=!isSupported.value;let queryStrings=toValue$1(query).split(`,`);matches$1.value=queryStrings.some(queryString=>{let not=queryString.includes(`not all`),minWidth=queryString.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),maxWidth=queryString.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),res=!!(minWidth||maxWidth);return minWidth&&res&&(res=ssrWidth>=pxValue$1(minWidth[1])),maxWidth&&res&&(res=ssrWidth<=pxValue$1(maxWidth[1])),not?!res:res});return}isSupported.value&&(mediaQuery.value=window$1.matchMedia(toValue$1(query)),matches$1.value=mediaQuery.value.matches)}),useEventListener(mediaQuery,`change`,handler,{passive:!0}),computed(()=>matches$1.value)}function cloneFnJSON(source){return JSON.parse(JSON.stringify(source))}function useDevicePixelRatio(options$1={}){let{window:window$1=defaultWindow}=options$1,pixelRatio=shallowRef(1),query=useMediaQuery$1(()=>`(resolution: ${pixelRatio.value}dppx)`,options$1),stop$1=noop$4;return window$1&&(stop$1=watchImmediate$1(query,()=>pixelRatio.value=window$1.devicePixelRatio)),{pixelRatio:readonly(pixelRatio),stop:stop$1}}function useResizeObserver$1(target$1,callback,options$1={}){let{window:window$1=defaultWindow,...observerOptions}=options$1,observer,isSupported=useSupported$1(()=>window$1&&`ResizeObserver`in window$1),cleanup=()=>{observer&&(observer.disconnect(),observer=void 0)},targets=computed(()=>{let _targets=toValue$1(target$1);return Array.isArray(_targets)?_targets.map(el$1=>unrefElement(el$1)):[unrefElement(_targets)]}),stopWatch=watch(targets,els=>{if(cleanup(),isSupported.value&&window$1){observer=new ResizeObserver(callback);for(let _el of els)_el&&observer.observe(_el,observerOptions)}},{immediate:!0,flush:`post`}),stop$1=()=>{cleanup(),stopWatch()};return tryOnScopeDispose$1(stop$1),{isSupported,stop:stop$1}}function useElementBounding$1(target$1,options$1={}){let{reset=!0,windowResize=!0,windowScroll=!0,immediate=!0,updateTiming=`sync`}=options$1,height=shallowRef(0),bottom=shallowRef(0),left=shallowRef(0),right=shallowRef(0),top=shallowRef(0),width=shallowRef(0),x$3=shallowRef(0),y$3=shallowRef(0);function recalculate(){let el$1=unrefElement(target$1);if(!el$1){reset&&(height.value=0,bottom.value=0,left.value=0,right.value=0,top.value=0,width.value=0,x$3.value=0,y$3.value=0);return}let rect=el$1.getBoundingClientRect();height.value=rect.height,bottom.value=rect.bottom,left.value=rect.left,right.value=rect.right,top.value=rect.top,width.value=rect.width,x$3.value=rect.x,y$3.value=rect.y}function update(){updateTiming===`sync`?recalculate():updateTiming===`next-frame`&&requestAnimationFrame(()=>recalculate())}return useResizeObserver$1(target$1,update),watch(()=>unrefElement(target$1),ele=>!ele&&update()),useMutationObserver$1(target$1,update,{attributeFilter:[`style`,`class`]}),windowScroll&&useEventListener(`scroll`,update,{capture:!0,passive:!0}),windowResize&&useEventListener(`resize`,update,{passive:!0}),tryOnMounted$1(()=>{immediate&&update()}),{height,bottom,left,right,top,width,x:x$3,y:y$3,update}}function useElementSize(target$1,initialSize={width:0,height:0},options$1={}){let{window:window$1=defaultWindow,box=`content-box`}=options$1,isSVG=computed(()=>{var _a$3,_b;return(_b=(_a$3=unrefElement(target$1))?.namespaceURI)?.includes(`svg`)}),width=shallowRef(initialSize.width),height=shallowRef(initialSize.height),{stop:stop1}=useResizeObserver$1(target$1,([entry])=>{let boxSize=box===`border-box`?entry.borderBoxSize:box===`content-box`?entry.contentBoxSize:entry.devicePixelContentBoxSize;if(window$1&&isSVG.value){let $elem=unrefElement(target$1);if($elem){let rect=$elem.getBoundingClientRect();width.value=rect.width,height.value=rect.height}}else if(boxSize){let formatBoxSize=toArray$1(boxSize);width.value=formatBoxSize.reduce((acc,{inlineSize})=>acc+inlineSize,0),height.value=formatBoxSize.reduce((acc,{blockSize})=>acc+blockSize,0)}else width.value=entry.contentRect.width,height.value=entry.contentRect.height},options$1);tryOnMounted$1(()=>{let ele=unrefElement(target$1);ele&&(width.value=`offsetWidth`in ele?ele.offsetWidth:initialSize.width,height.value=`offsetHeight`in ele?ele.offsetHeight:initialSize.height)});let stop2=watch(()=>unrefElement(target$1),ele=>{width.value=ele?initialSize.width:0,height.value=ele?initialSize.height:0});function stop$1(){stop1(),stop2()}return{width,height,stop:stop$1}}function useFps(options$1){var _a$3;let fps=shallowRef(0);if(typeof performance>`u`)return fps;let every=(_a$3=options$1?.every)??10,last=performance.now(),ticks=0;return useRafFn(()=>{if(ticks+=1,ticks>=every){let now$1=performance.now(),diff=now$1-last;fps.value=Math.round(1e3/(diff/ticks)),last=now$1,ticks=0}}),fps}function useMemory(options$1={}){let memory=ref(),isSupported=useSupported$1(()=>typeof performance<`u`&&`memory`in performance);if(isSupported.value){let{interval=1e3}=options$1;useIntervalFn$1(()=>{memory.value=performance.memory},interval,{immediate:options$1.immediate,immediateCallback:options$1.immediateCallback})}return{isSupported,memory}}const defaultState$1={x:0,y:0,pointerId:0,pressure:0,tiltX:0,tiltY:0,width:0,height:0,twist:0,pointerType:null},keys$2=Object.keys(defaultState$1);function usePointer$1(options$1={}){let{target:target$1=defaultWindow}=options$1,isInside=shallowRef(!1),state=ref(options$1.initialValue||{});Object.assign(state.value,defaultState$1,state.value);let handler=event=>{isInside.value=!0,!(options$1.pointerTypes&&!options$1.pointerTypes.includes(event.pointerType))&&(state.value=objectPick$1(event,keys$2,!1))};if(target$1){let listenerOptions={passive:!0};useEventListener(target$1,[`pointerdown`,`pointermove`,`pointerup`],handler,listenerOptions),useEventListener(target$1,`pointerleave`,()=>isInside.value=!1,listenerOptions)}return{...toRefs$2(state),isInside}}const DEFAULT_UNITS$1=[{max:6e4,value:1e3,name:`second`},{max:276e4,value:6e4,name:`minute`},{max:72e6,value:36e5,name:`hour`},{max:5184e5,value:864e5,name:`day`},{max:24192e5,value:6048e5,name:`week`},{max:28512e6,value:2592e6,name:`month`},{max:1/0,value:31536e6,name:`year`}];function useVModel(props,key$2,emit$1,options$1={}){var _a$3,_b,_c$1;let{clone:clone$2=!1,passive=!1,eventName,deep=!1,defaultValue,shouldEmit}=options$1,vm$1=getCurrentInstance(),_emit=emit$1||vm$1?.emit||(_a$3=vm$1?.$emit)?.bind(vm$1)||(_c$1=(_b=vm$1?.proxy)?.$emit)?.bind(vm$1?.proxy),event=eventName;key$2||=`modelValue`,event||=`update:${key$2.toString()}`;let cloneFn=val=>clone$2?typeof clone$2==`function`?clone$2(val):cloneFnJSON(val):val,getValue$2=()=>isDef$1(props[key$2])?cloneFn(props[key$2]):defaultValue,triggerEmit=value$1=>{shouldEmit?shouldEmit(value$1)&&_emit(event,value$1):_emit(event,value$1)};if(passive){let initialValue=getValue$2(),proxy=ref(initialValue),isUpdating=!1;return watch(()=>props[key$2],v$2=>{isUpdating||(isUpdating=!0,proxy.value=cloneFn(v$2),nextTick(()=>isUpdating=!1))}),watch(proxy,v$2=>{!isUpdating&&(v$2!==props[key$2]||deep)&&triggerEmit(v$2)},{deep}),proxy}else return computed({get(){return getValue$2()},set(value$1){triggerEmit(value$1)}})}function useWindowSize$1(options$1={}){let{window:window$1=defaultWindow,initialWidth=1/0,initialHeight=1/0,listenOrientation=!0,includeScrollbar=!0,type=`inner`}=options$1,width=shallowRef(initialWidth),height=shallowRef(initialHeight),update=()=>{if(window$1)if(type===`outer`)width.value=window$1.outerWidth,height.value=window$1.outerHeight;else if(type===`visual`&&window$1.visualViewport){let{width:visualViewportWidth,height:visualViewportHeight,scale:scale$1}=window$1.visualViewport;width.value=Math.round(visualViewportWidth*scale$1),height.value=Math.round(visualViewportHeight*scale$1)}else includeScrollbar?(width.value=window$1.innerWidth,height.value=window$1.innerHeight):(width.value=window$1.document.documentElement.clientWidth,height.value=window$1.document.documentElement.clientHeight)};update(),tryOnMounted$1(update);let listenerOptions={passive:!0};if(useEventListener(`resize`,update,listenerOptions),window$1&&type===`visual`&&window$1.visualViewport&&useEventListener(window$1.visualViewport,`resize`,update,listenerOptions),listenOrientation){let matches$1=useMediaQuery$1(`(orientation: portrait)`);watch(matches$1,()=>update())}return{width,height}}var At$1=Object.defineProperty,xt$1=(e$3,t,r$2)=>t in e$3?At$1(e$3,t,{enumerable:!0,configurable:!0,writable:!0,value:r$2}):e$3[t]=r$2,de$2=(e$3,t,r$2)=>xt$1(e$3,typeof t==`symbol`?t:t+``,r$2);const gr=`@tresjs/core`,hr$1=`module`,vr$1=`4.3.6`,yr=`pnpm@10.6.3`,_r=`Declarative ThreeJS using Vue Components`,wr=`Alvaro Saburido (https://github.com/alvarosabu/)`,br=`MIT`,Mr={type:`git`,url:`git+https://github.com/Tresjs/tres.git`},Pr=[`vue`,`3d`,`threejs`,`three`,`threejs-vue`],Cr=!1,Er={".":{types:`./dist/index.d.ts`,import:`./dist/tres.js`,require:`./dist/tres.umd.cjs`},"./components":{types:`./dist/src/components/index.d.ts`},"./composables":{types:`./dist/src/composables/index.d.ts`},"./types":{types:`./dist/src/types/index.d.ts`},"./utils":{types:`./dist/src/utils/index.d.ts`},"./*":`./*`},Tr=`./dist/tres.js`,Sr=`./dist/tres.js`,Ar=`./dist/index.d.ts`,xr=[`*.d.ts`,`dist`],kr={access:`public`},Lr={dev:`pnpm --filter='./playground/vue' dev`,"dev:nuxt":`pnpm --filter='./playground/nuxt' dev`,build:`vite build`,test:`vitest`,"test:ci":`vitest run`,"test:ui":`vitest --ui --coverage.enabled=true`,release:`release-it`,coverage:`vitest run --coverage`,lint:`eslint .`,"lint:fix":`eslint . --fix`,"docs:dev":`vitepress dev docs`,"docs:build":`vitepress build docs`,"docs:serve":`vitepress serve docs`,"docs:preview":`vitepress preview docs`,"docs:contributors":`esno scripts/update-contributors.ts`},Rr={three:`>=0.133`,vue:`>=3.4`},Or={"@alvarosabu/utils":`^3.2.0`,"@vue/devtools-api":`^6.6.3`,"@vueuse/core":`^12.5.0`},Dr={"@release-it/conventional-changelog":`^10.0.0`,"@stackblitz/sdk":`^1.11.0`,"@tresjs/cientos":`4.1.0`,"@tresjs/eslint-config":`^1.4.0`,"@types/three":`^0.173.0`,"@typescript-eslint/eslint-plugin":`^8.23.0`,"@typescript-eslint/parser":`^8.23.0`,"@vitejs/plugin-vue":`^5.2.1`,"@vitest/coverage-c8":`^0.33.0`,"@vitest/coverage-v8":`^3.0.5`,"@vitest/ui":`^3.0.5`,"@vue/test-utils":`^2.4.6`,eslint:`^9.19.0`,"eslint-plugin-vue":`^9.32.0`,esno:`^4.8.0`,gsap:`^3.12.7`,jsdom:`^26.0.0`,kolorist:`^1.8.0`,ohmyfetch:`^0.4.21`,pathe:`^2.0.2`,"release-it":`^18.1.2`,"rollup-plugin-analyzer":`^4.0.0`,"rollup-plugin-copy":`^3.5.0`,"rollup-plugin-visualizer":`^5.14.0`,sponsorkit:`^16.3.0`,three:`^0.173.0`,unocss:`^65.4.3`,unplugin:`^2.1.2`,"unplugin-vue-components":`^28.0.0`,vite:`^6.1.0`,"vite-plugin-banner":`^0.8.0`,"vite-plugin-dts":`4.5.0`,"vite-plugin-inspect":`^10.1.0`,"vite-plugin-require-transform":`^1.0.21`,"vite-svg-loader":`^5.1.0`,vitepress:`1.6.3`,vitest:`3.0.5`,vue:`3.5.13`,"vue-demi":`^0.14.10`},jr$1={name:gr,type:hr$1,version:vr$1,packageManager:yr,description:_r,author:wr,license:br,repository:Mr,keywords:Pr,sideEffects:Cr,exports:Er,main:Tr,module:Sr,types:Ar,files:xr,publishConfig:kr,scripts:Lr,peerDependencies:Rr,dependencies:Or,devDependencies:Dr};function Br(e$3){let t={nodes:{},materials:{}};return e$3&&e$3.traverse(r$2=>{r$2.name&&(t.nodes[r$2.name]=r$2),r$2.material&&!t.materials[r$2.material.name]&&(t.materials[r$2.material.name]=r$2.material)}),t}async function Ir(e$3,t,r$2,n$2,o$1){let{logError:l$1}=Q$2(),s$1=new e$3;return o$1&&o$1(s$1),r$2&&r$2(s$1),await new Promise((a$2,c$4)=>{s$1.load(t,i$1=>{let f$3=i$1;f$3.scene&&Object.assign(f$3,Br(f$3.scene)),a$2(f$3)},n$2,i$1=>{l$1(`[useLoader] - Failed to load resource`,i$1),c$4(i$1)})})}var $r=class extends Mesh{constructor(...r$2){super(...r$2),de$2(this,`type`,`HightlightMesh`),de$2(this,`createTime`),this.createTime=Date.now()}onBeforeRender(){let n$2=(Date.now()-this.createTime)/1e3,s$1=1+.07*Math.sin(2.5*n$2);this.scale.set(s$1,s$1,s$1)}};function be$1(e$3){return typeof e$3>`u`}function ke(e$3){return Array.isArray(e$3)}function Hr(e$3){return typeof e$3==`number`}function dt$4(e$3){return typeof e$3==`string`}function Y$1(e$3){return typeof e$3==`function`}function j(e$3){return e$3===Object(e$3)&&!ke(e$3)&&!Y$1(e$3)}function N$1(e$3){return j(e$3)&&!!e$3.isObject3D}function mt$2(e$3){return j(e$3)&&!!e$3.isColor}function Ur$1(e$3){return e$3!=null&&(typeof e$3==`string`||typeof e$3==`number`||mt$2(e$3))}function Me$1(e$3){return typeof e$3==`object`&&!!e$3&&`set`in e$3&&typeof e$3.set==`function`}function Fr(e$3){return Me$1(e$3)&&`copy`in e$3&&typeof e$3.copy==`function`}function Wr$1(e$3){return!!(e$3!=null&&e$3.constructor)}function Ge$1(e$3){return e$3 instanceof Layers}function Ve(e$3){return j(e$3)&&!!e$3.isCamera}function Nr(e$3){return j(e$3)&&!!e$3.isBufferGeometry}function zr(e$3){return j(e$3)&&!!e$3.isMaterial}function Gr$1(e$3){return j(e$3)&&!!e$3.isLight}function Vr(e$3){return j(e$3)&&!!e$3.isFog}function Yr$1(e$3){return j(e$3)&&!!e$3.isScene}function ne$1(e$3){return N$1(e$3)||Nr(e$3)||zr(e$3)||Vr(e$3)}function qr$1(e$3){return j(e$3)&&!!e$3.isPrimitive}const gt$2=(e$3,t)=>{for(let r$2 of Object.keys(t))t[r$2]instanceof Object&&Object.assign(t[r$2],gt$2(e$3[r$2],t[r$2]));return Object.assign(e$3||{},t),e$3},Kr=`html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot`,Jr$1=Zr$1(Kr);function Ye(e$3){return e$3&&e$3.nodeType===1}function he$1(e$3){return e$3.replace(/-([a-z])/g,(t,r$2)=>r$2.toUpperCase())}const Qr$1=/\B([A-Z])/g;function Xr$1(e$3){return e$3.replace(Qr$1,`-$1`).toLowerCase()}function Zr$1(e$3,t){let r$2=Object.create(null),n$2=e$3.split(`,`);for(let o$1=0;o$1!!r$2[o$1.toLowerCase()]:o$1=>!!r$2[o$1]}const qe$1=(e$3,t)=>{if(!t)return;let r$2=Array.isArray(t)?t:t.match(/([^[.\]])+/g);return r$2?.reduce((n$2,o$1)=>n$2&&n$2[o$1],e$3)},en$1=(e$3,t,r$2)=>{let n$2=Array.isArray(t)?t:t.match(/([^[.\]])+/g);n$2&&n$2.reduce((o$1,l$1,s$1)=>(o$1[l$1]===void 0&&(o$1[l$1]={}),s$1===n$2.length-1&&(o$1[l$1]=r$2),o$1[l$1]),e$3)};function ht$3(e$3,t){if(Ye(e$3)&&Ye(t)){let o$1=e$3.attributes,l$1=t.attributes;return o$1.length===l$1.length?Array.from(o$1).every(({name:s$1,value:a$2})=>t.getAttribute(s$1)===a$2):!1}if(e$3===t)return!0;if(typeof e$3!=`object`||!e$3||typeof t!=`object`||!t)return!1;let r$2=Object.keys(e$3),n$2=Object.keys(t);if(r$2.length!==n$2.length)return!1;for(let o$1 of r$2)if(!n$2.includes(o$1)||!ht$3(e$3[o$1],t[o$1]))return!1;return!0}function tn$1(e$3,t){if(!Array.isArray(e$3)||!Array.isArray(t)||e$3.length!==t.length)return!1;for(let r$2=0;r$2{if(c$4.uuid===t)return c$4;for(let i$1 of c$4.children){let f$3=o$1(i$1);if(f$3)return f$3}},l$1=o$1(e$3);if(!l$1){console.warn(`Object with UUID not found in the scene.`);return}let s$1=l$1;for(let c$4=0;c$4vt$3(o$1)),!(e$3 instanceof Scene)){let o$1=e$3;e$3&&((n$2=e$3.dispose)==null||n$2.call(e$3)),o$1.geometry&&o$1.geometry.dispose(),Array.isArray(o$1.material)?o$1.material.forEach(l$1=>Ke(l$1)):o$1.material&&Ke(o$1.material)}}function ln$1(e$3,t){let r$2=0;for(let n$2=0;n$2r$2===0?t:t.charAt(0).toUpperCase()+t.slice(1)).join(``)}const Qe$1=/-\d+$/;function cn$2(e$3,t,r$2){if(dt$4(r$2)){if(Qe$1.test(r$2)){let l$1=r$2.replace(Qe$1,``),{target:s$1,key:a$2}=Pe$2(e$3,l$1);if(!Array.isArray(s$1[a$2])){let c$4=s$1[a$2],i$1=[];i$1.__tresDetach=()=>{i$1.every(f$3=>be$1(f$3))&&(s$1[a$2]=c$4)},s$1[a$2]=i$1}}let{target:n$2,key:o$1}=Pe$2(e$3,r$2);t.__tres.previousAttach=n$2[o$1],n$2[o$1]=J$1(t)}else t.__tres.previousAttach=r$2(e$3,t)}function un$3(e$3,t,r$2){var n$2,o$1,l$1;if(dt$4(r$2)){let{target:s$1,key:a$2}=Pe$2(e$3,r$2),c$4=t.__tres.previousAttach;c$4===void 0?delete s$1[a$2]:s$1[a$2]=c$4,`__tresDetach`in s$1&&s$1.__tresDetach()}else (o$1=(n$2=t.__tres)?.previousAttach)==null||o$1.call(n$2,e$3,t);(l$1=t.__tres)==null||delete l$1.previousAttach}function z$2(e$3,t,r$2){let n$2=e$3;return n$2.__tres={type:`unknown`,eventCount:0,root:r$2,handlers:{},memoizedProps:{},objects:[],parent:null,previousAttach:null,...t},n$2.__tres.attach||(n$2.isMaterial?n$2.__tres.attach=`material`:n$2.isBufferGeometry?n$2.__tres.attach=`geometry`:n$2.isFog&&(n$2.__tres.attach=`fog`)),n$2}function yt$3(e$3){var r$2;let t=(r$2=e$3?.__tres)?.root;t&&t.render&&t.render.canBeInvalidated.value&&t.invalidate()}function fn$5(e$3,t,r$2){var o$1;if(!Y$1(e$3.setPixelRatio))return;let n$2=0;if(r$2&&ke(r$2)&&r$2.length>=2){let[l$1,s$1]=r$2;n$2=MathUtils.clamp(t,l$1,s$1)}else n$2=Hr(r$2)?r$2:t;n$2!==(o$1=e$3.getPixelRatio)?.call(e$3)&&e$3.setPixelRatio(n$2)}function pn$1(e$3,t,r$2,n$2,o$1){let l$1=[...t.__tres.objects],s$1=J$1(t);if(e$3=J$1(e$3),s$1===e$3)return!0;let a$2=z$2(e$3,t.__tres??{},o$1),c$4=t.parent??t.__tres.parent??null,i$1={...t.__tres.memoizedProps};delete i$1.object;for(let f$3 of l$1)_t$3(f$3,o$1),wt$3(f$3,o$1);s$1.__tres.objects=[],n$2.remove(t);for(let[f$3,v$2]of Object.entries(i$1))n$2.patchProp(a$2,f$3,a$2[f$3],v$2);r$2(e$3),n$2.insert(t,c$4);for(let f$3 of l$1)n$2.insert(f$3,t);return!0}function J$1(e$3){return qr$1(e$3)?(e$3.object.__tres=e$3.__tres,e$3.object):e$3}function _t$3(e$3,t){var n$2,o$1,l$1,s$1;let r$2=(n$2=e$3.__tres)?.parent||t.scene.value;e$3.__tres&&(e$3.__tres.parent=null),r$2&&r$2.__tres&&`objects`in r$2.__tres&&ln$1(r$2.__tres.objects,a$2=>a$2!==e$3),(o$1=e$3.__tres)!=null&&o$1.attach?un$3(r$2,e$3,e$3.__tres.attach):((s$1=(l$1=e$3.parent)?.remove)==null||s$1.call(l$1,J$1(e$3)),e$3.parent=null)}function wt$3(e$3,t){var r$2;(r$2=e$3.traverse)==null||r$2.call(e$3,n$2=>{var o$1;t.deregisterCamera(n$2),(o$1=t.eventManager)==null||o$1.deregisterPointerMissedObject(n$2)}),t.deregisterCamera(e$3),yt$3(e$3)}async function dn$1(e$3,t){let r$2=new TextureLoader(t),n$2=o$1=>new Promise((l$1,s$1)=>{r$2.load(o$1,a$2=>l$1(a$2),()=>null,()=>{s$1(Error(`[useTextures] - Failed to load texture`))})});if(rn$1(e$3)){let o$1=await Promise.all(e$3.map(l$1=>n$2(l$1)));return e$3.length>1?o$1:o$1[0]}else{let{map:o$1,displacementMap:l$1,normalMap:s$1,roughnessMap:a$2,metalnessMap:c$4,aoMap:i$1,alphaMap:f$3,matcap:v$2}=e$3;return{map:o$1?await n$2(o$1):null,displacementMap:l$1?await n$2(l$1):null,normalMap:s$1?await n$2(s$1):null,roughnessMap:a$2?await n$2(a$2):null,metalnessMap:c$4?await n$2(c$4):null,aoMap:i$1?await n$2(i$1):null,alphaMap:f$3?await n$2(f$3):null,matcap:v$2?await n$2(v$2):null}}}const to$1=defineComponent({__name:`component`,props:{map:{},displacementMap:{},normalMap:{},roughnessMap:{},metalnessMap:{},aoMap:{},alphaMap:{},matcap:{}},async setup(e$3){let t,r$2,n$2=e$3,o$1=([t,r$2]=withAsyncContext(()=>reactive(dn$1(n$2))),t=await t,r$2(),t);return(l$1,s$1)=>renderSlot(l$1.$slots,`default`,{textures:unref(o$1)})}}),mn$1=({sizes:e$3})=>{let t=ref([]),r$2=computed(()=>t.value[0]),n$2=s$1=>{let a$2=s$1 instanceof Camera?s$1:t.value.find(i$1=>i$1.uuid===s$1);if(!a$2)return;let c$4=t.value.filter(({uuid:i$1})=>i$1!==a$2.uuid);t.value=[a$2,...c$4]},o$1=(s$1,a$2=!1)=>{if(Ve(s$1)){let c$4=s$1;if(t.value.some(({uuid:i$1})=>i$1===c$4.uuid))return;a$2?n$2(c$4):t.value.push(c$4)}},l$1=s$1=>{if(Ve(s$1)){let a$2=s$1;t.value=t.value.filter(({uuid:c$4})=>c$4!==a$2.uuid)}};return watchEffect(()=>{e$3.aspectRatio.value&&t.value.forEach(s$1=>{!s$1.manual&&(s$1 instanceof PerspectiveCamera||gn$1(s$1))&&(s$1 instanceof PerspectiveCamera?s$1.aspect=e$3.aspectRatio.value:(s$1.left=e$3.width.value*-.5,s$1.right=e$3.width.value*.5,s$1.top=e$3.height.value*.5,s$1.bottom=e$3.height.value*-.5),s$1.updateProjectionMatrix())})}),onUnmounted(()=>{t.value=[]}),{camera:r$2,cameras:t,registerCamera:o$1,deregisterCamera:l$1,setCameraActive:n$2}};function gn$1(e$3){return e$3.hasOwnProperty(`isOrthographicCamera`)&&e$3.isOrthographicCamera}const ro$1=!0,fe$1=`[TresJS ▲ ■ ●] `;function hn$1(...e$3){typeof e$3[0]==`string`?e$3[0]=fe$1+e$3[0]:e$3.unshift(fe$1),console.error(...e$3)}function vn$3(...e$3){typeof e$3[0]==`string`?e$3[0]=fe$1+e$3[0]:e$3.unshift(fe$1),console.warn(...e$3)}function yn$1(e$3,t){}function Q$2(){return{logError:hn$1,logWarning:vn$3,logMessage:yn$1}}const Ce$2=ref({}),Ee$1=e$3=>Object.assign(Ce$2.value,e$3);function ve(){let e$3=new Map,t=new Set,r$2=0,n$2=!1,o$1=()=>{let i$1=Array.from(e$3.entries()).sort((f$3,v$2)=>{let u$1=f$3[1].priority-v$2[1].priority;return u$1===0?f$3[1].addI-v$2[1].addI:u$1});t.clear(),i$1.forEach(f$3=>t.add(f$3[0]))},l$1=i$1=>{e$3.delete(i$1),t.delete(i$1)};return{on:(i$1,f$3=0)=>{e$3.set(i$1,{priority:f$3,addI:r$2++});let v$2=()=>l$1(i$1);return tryOnScopeDispose$1(v$2),n$2=!0,{off:v$2}},off:l$1,trigger:(...i$1)=>{n$2&&(o$1(),n$2=!1),t.forEach(f$3=>f$3(...i$1))},dispose:()=>{e$3.clear(),t.clear()},get count(){return e$3.size}}}function _n$1(){let e$3=!0,t=!0,r$2=!1,n$2=new Clock$1(!1),o$1=ref(n$2.running),l$1=ref(!1),s$1,a$2=MathUtils.generateUUID(),c$4=null,i$1=ve(),f$3=ve(),v$2=ve();S$2();let u$1={};function _$2(M$1){u$1=M$1}function d$2(M$1,x$3,m$3=0){switch(x$3){case`before`:return i$1.on(M$1,m$3);case`render`:return c$4||=M$1,f$3.dispose(),f$3.on(M$1);case`after`:return v$2.on(M$1,m$3)}}function y$3(){t&&(t=!1,S$2(),E$2())}function p$5(){t=!0,S$2(),cancelAnimationFrame(s$1)}function h$3(){r$2=!1,S$2()}function P$2(){r$2=!0,S$2()}function C$3(){l$1.value=!0}function b$4(){l$1.value=!1}function E$2(){if(!e$3){s$1=requestAnimationFrame(E$2);return}let M$1=n$2.getDelta(),x$3=n$2.getElapsedTime(),m$3={camera:unref(u$1.camera),scene:unref(u$1.scene),renderer:unref(u$1.renderer),raycaster:unref(u$1.raycaster),controls:unref(u$1.controls),invalidate:u$1.invalidate,advance:u$1.advance},w$2={delta:M$1,elapsed:x$3,clock:n$2,...m$3};o$1.value&&i$1.trigger(w$2),l$1.value||(f$3.count?f$3.trigger(w$2):c$4&&c$4(w$2)),o$1.value&&v$2.trigger(w$2),s$1=requestAnimationFrame(E$2)}function S$2(){let M$1=!t&&!r$2;n$2.running!==M$1&&(n$2.running?n$2.stop():n$2.start()),o$1.value=n$2.running}return{loopId:a$2,register:(M$1,x$3,m$3)=>d$2(M$1,x$3,m$3),start:y$3,stop:p$5,pause:P$2,resume:h$3,pauseRender:C$3,resumeRender:b$4,isRenderPaused:l$1,isActive:o$1,setContext:_$2,setReady:M$1=>e$3=M$1}}function Le$1(e$3){let t=0;return e$3.traverse(r$2=>{if(r$2.isMesh&&r$2.geometry&&r$2.type!==`HightlightMesh`){let n$2=r$2.geometry,o$1=n$2.attributes.position.count*3*Float32Array.BYTES_PER_ELEMENT,l$1=n$2.index?n$2.index.count*Uint32Array.BYTES_PER_ELEMENT:0,s$1=n$2.attributes.normal?n$2.attributes.normal.count*3*Float32Array.BYTES_PER_ELEMENT:0,a$2=n$2.attributes.uv?n$2.attributes.uv.count*2*Float32Array.BYTES_PER_ELEMENT:0,c$4=o$1+l$1+s$1+a$2;t+=c$4}}),t}function wn$1(e$3){return(e$3/1024).toFixed(2)}const bn$1=Number.parseInt(REVISION.replace(`dev`,``));function Mn$1(e$3){return e$3 instanceof Color?e$3:Array.isArray(e$3)?new Color(...e$3):new Color(e$3)}const oe$1={realistic:{shadows:!0,physicallyCorrectLights:!0,outputColorSpace:SRGBColorSpace,toneMapping:ACESFilmicToneMapping,toneMappingExposure:3,shadowMap:{enabled:!0,type:PCFSoftShadowMap}},flat:{toneMapping:NoToneMapping,toneMappingExposure:1}};function Pn$1({canvas:e$3,options:t,contextParts:{sizes:r$2,render:n$2,invalidate:o$1,advance:l$1}}){let s$1=computed(()=>({alpha:toValue(t.alpha)??!0,depth:toValue(t.depth),canvas:unrefElement(e$3),context:toValue(t.context),stencil:toValue(t.stencil),antialias:toValue(t.antialias)??!0,precision:toValue(t.precision),powerPreference:toValue(t.powerPreference),premultipliedAlpha:toValue(t.premultipliedAlpha),preserveDrawingBuffer:toValue(t.preserveDrawingBuffer),logarithmicDepthBuffer:toValue(t.logarithmicDepthBuffer),failIfMajorPerformanceCaveat:toValue(t.failIfMajorPerformanceCaveat)})),a$2=shallowRef(new WebGLRenderer(s$1.value));function c$4(){t.renderMode===`on-demand`&&o$1()}watch(s$1,()=>{a$2.value.dispose(),a$2.value=new WebGLRenderer(s$1.value),c$4()}),watch([r$2.width,r$2.height],()=>{a$2.value.setSize(r$2.width.value,r$2.height.value),c$4()},{immediate:!0}),watch(()=>t.clearColor,c$4);let{pixelRatio:i$1}=useDevicePixelRatio(),{logError:f$3}=Q$2(),u$1=(()=>{let d$2=new WebGLRenderer,y$3={shadowMap:{enabled:d$2.shadowMap.enabled,type:d$2.shadowMap.type},toneMapping:d$2.toneMapping,toneMappingExposure:d$2.toneMappingExposure,outputColorSpace:d$2.outputColorSpace};return d$2.dispose(),y$3})(),_$2=toValue(t.renderMode);return _$2===`on-demand`&&o$1(),_$2===`manual`&&setTimeout(()=>{l$1()},100),watchEffect(()=>{let d$2=toValue(t.preset);d$2&&(d$2 in oe$1||f$3(`Renderer Preset must be one of these: ${Object.keys(oe$1).join(`, `)}`),gt$2(a$2.value,oe$1[d$2])),fn$5(a$2.value,i$1.value,toValue(t.dpr)),_$2===`always`&&(n$2.frames.value=Math.max(1,n$2.frames.value));let y$3=(P$2,C$3)=>{let b$4=toValue(P$2),E$2=()=>{if(d$2)return qe$1(oe$1[d$2],C$3)};if(b$4!==void 0)return b$4;let S$2=E$2();return S$2===void 0?qe$1(u$1,C$3):S$2},p$5=(P$2,C$3)=>en$1(a$2.value,C$3,y$3(P$2,C$3));p$5(t.shadows,`shadowMap.enabled`),p$5(t.toneMapping??ACESFilmicToneMapping,`toneMapping`),p$5(t.shadowMapType,`shadowMap.type`),bn$1<150&&p$5(!t.useLegacyLights,`physicallyCorrectLights`),p$5(t.outputColorSpace,`outputColorSpace`),p$5(t.toneMappingExposure,`toneMappingExposure`);let h$3=y$3(t.clearColor,`clearColor`);h$3&&a$2.value.setClearColor(h$3?Mn$1(h$3):new Color(0))}),onUnmounted(()=>{a$2.value.dispose(),a$2.value.forceContextLoss()}),{renderer:a$2}}function Cn$1(e$3,t,r$2=10){let n$2=toValue(e$3)?useWindowSize$1():useElementSize(computed(()=>toValue(t).parentElement)),o$1=readonly(refDebounced$1(n$2.width,r$2)),l$1=readonly(refDebounced$1(n$2.height,r$2)),s$1=computed(()=>o$1.value/l$1.value);return{height:l$1,width:o$1,aspectRatio:s$1}}const En$1=(e$3,t)=>{let r$2=computed(()=>t.renderer.value.domElement),n$2=shallowRef([]),{x:o$1,y:l$1}=usePointer$1({target:r$2}),s$1=0,{width:a$2,height:c$4,top:i$1,left:f$3}=useElementBounding$1(r$2),v$2=({x:g$2,y:T$1})=>{if(r$2.value)return{x:(g$2-f$3.value)/a$2.value*2-1,y:-((T$1-i$1.value)/c$4.value)*2+1}},u$1=({x:g$2,y:T$1})=>{if(t.camera.value)return t.raycaster.value.setFromCamera(new Vector2(g$2,T$1),t.camera.value),n$2.value=t.raycaster.value.intersectObjects(e$3.value,!0),n$2.value},_$2=g$2=>{let T$1=v$2({x:g$2?.clientX??o$1.value,y:g$2?.clientY??l$1.value});return T$1&&u$1(T$1)||[]},d$2=createEventHook$1(),y$3=createEventHook$1(),p$5=createEventHook$1(),h$3=createEventHook$1(),P$2=createEventHook$1(),C$3=createEventHook$1(),b$4=createEventHook$1(),E$2=createEventHook$1();function S$2(g$2){let T$1={};for(let U in g$2)typeof U!=`function`&&(T$1[U]=g$2[U]);return T$1}let M$1=(g$2,T$1)=>{var Ie,$e$2,He$2;let U=S$2(T$1),re$3=new Vector3(T$1?.clientX,T$1?.clientY,0).unproject((Ie=t.camera)?.value);g$2.trigger({...U,intersections:n$2.value,unprojectedPoint:re$3,ray:($e$2=t.raycaster)?.value.ray,camera:(He$2=t.camera)?.value,sourceEvent:T$1,delta:s$1,stopPropagating:!1})},x$3,m$3=g$2=>{_$2(g$2),M$1(p$5,g$2),x$3=g$2},w$2=()=>{x$3&&m$3(x$3)},k$4,L$1,R$3,B$2=g$2=>{var T$1;k$4=(T$1=n$2.value[0])?.object,s$1=0,L$1=new Vector2(g$2?.clientX??o$1.value,g$2?.clientY??l$1.value),M$1(P$2,g$2)},O$3,G$2=!1,Oe$2=g$2=>{var T$1,U,re$3;g$2 instanceof PointerEvent&&(n$2.value.length===0&&M$1(C$3,g$2),k$4===(T$1=n$2.value[0])?.object&&(R$3=new Vector2(g$2?.clientX??o$1.value,g$2?.clientY??l$1.value),s$1=L$1?.distanceTo(R$3),g$2.button===0?(M$1(d$2,g$2),O$3===(U=n$2.value[0])?.object?G$2=!0:(O$3=(re$3=n$2.value[0])?.object,G$2=!1)):g$2.button===2&&M$1(b$4,g$2)),M$1(h$3,g$2))},De=g$2=>{G$2&&(M$1(y$3,g$2),O$3=void 0,G$2=!1)},je$1=g$2=>M$1(p$5,g$2),Be$2=g$2=>M$1(E$2,g$2);return r$2.value.addEventListener(`pointerup`,Oe$2),r$2.value.addEventListener(`pointerdown`,B$2),r$2.value.addEventListener(`pointermove`,m$3),r$2.value.addEventListener(`pointerleave`,je$1),r$2.value.addEventListener(`dblclick`,De),r$2.value.addEventListener(`wheel`,Be$2),onUnmounted(()=>{r$2!=null&&r$2.value&&(r$2.value.removeEventListener(`pointerup`,Oe$2),r$2.value.removeEventListener(`pointerdown`,B$2),r$2.value.removeEventListener(`pointermove`,m$3),r$2.value.removeEventListener(`pointerleave`,je$1),r$2.value.removeEventListener(`dblclick`,De),r$2.value.removeEventListener(`wheel`,Be$2))}),{intersects:n$2,onClick:g$2=>d$2.on(g$2).off,onDblClick:g$2=>y$3.on(g$2).off,onContextMenu:g$2=>b$4.on(g$2).off,onPointerMove:g$2=>p$5.on(g$2).off,onPointerUp:g$2=>h$3.on(g$2).off,onPointerDown:g$2=>P$2.on(g$2).off,onPointerMissed:g$2=>C$3.on(g$2).off,onWheel:g$2=>E$2.on(g$2).off,forceUpdate:w$2}};function ye(e$3,t){if(Array.isArray(e$3))for(let r$2 of e$3)r$2(t);typeof e$3==`function`&&e$3(t)}function Tn$1(e$3,t,r$2){var x$3;let n$2=shallowRef(),o$1=shallowRef();e$3&&(n$2.value=e$3),t&&(o$1.value=t);let l$1=m$3=>{var w$2;return(w$2=m$3.__tres)?.eventCount>0},s$1=m$3=>{var w$2;return(w$2=m$3.children)?.some(k$4=>s$1(k$4))||l$1(m$3)},a$2=shallowRef(((x$3=n$2.value)?.children).filter(s$1)||[]);function c$4(m$3,w$2){let k$4=[],L$1=()=>w$2.stopPropagating=!0;w$2.stopPropagation=L$1;for(let R$3 of w$2?.intersections){if(w$2.stopPropagating)return;w$2={...w$2,...R$3};let{object:B$2}=R$3;w$2.eventObject=B$2,ye(B$2[m$3],w$2),k$4.push(B$2);let O$3=B$2.parent;for(;O$3!==null&&!w$2.stopPropagating&&!k$4.includes(O$3);)w$2.eventObject=O$3,ye(O$3[m$3],w$2),k$4.push(O$3),O$3=O$3.parent;let G$2=Xr$1(m$3.slice(2));r$2(G$2,{intersection:R$3,event:w$2})}}let{onClick:i$1,onDblClick:f$3,onContextMenu:v$2,onPointerMove:u$1,onPointerDown:_$2,onPointerUp:d$2,onPointerMissed:y$3,onWheel:p$5,forceUpdate:h$3}=En$1(a$2,t);d$2(m$3=>c$4(`onPointerUp`,m$3)),_$2(m$3=>c$4(`onPointerDown`,m$3)),i$1(m$3=>c$4(`onClick`,m$3)),f$3(m$3=>c$4(`onDoubleClick`,m$3)),v$2(m$3=>c$4(`onContextMenu`,m$3)),p$5(m$3=>c$4(`onWheel`,m$3));let P$2=[];u$1(m$3=>{let w$2=m$3.intersections.map(({object:L$1})=>L$1),k$4=m$3.intersections;P$2.forEach(({object:L$1})=>{w$2.includes(L$1)||(m$3.intersections=P$2,c$4(`onPointerLeave`,m$3),c$4(`onPointerOut`,m$3))}),m$3.intersections=k$4,m$3.intersections.forEach(({object:L$1})=>{P$2.includes(L$1)||(c$4(`onPointerEnter`,m$3),c$4(`onPointerOver`,m$3))}),c$4(`onPointerMove`,m$3),P$2=m$3.intersections});let C$3=[];y$3(m$3=>{let w$2=()=>m$3.stopPropagating=!0;m$3.stopPropagation=w$2,C$3.forEach(k$4=>{m$3.stopPropagating||(m$3.eventObject=k$4,ye(k$4.onPointerMissed,m$3))}),r$2(`pointer-missed`,{event:m$3})});function b$4(m$3){ne$1(m$3)&&N$1(m$3)&&a$2.value.push(m$3)}function E$2(m$3){if(ne$1(m$3)&&N$1(m$3)){let w$2=a$2.value.indexOf(m$3);w$2>-1&&a$2.value.splice(w$2,1)}}function S$2(m$3){ne$1(m$3)&&N$1(m$3)&&m$3.onPointerMissed&&C$3.push(m$3)}function M$1(m$3){if(ne$1(m$3)&&N$1(m$3)){let w$2=C$3.indexOf(m$3);w$2>-1&&C$3.splice(w$2,1)}}return t.eventManager={forceUpdate:h$3,registerObject:b$4,deregisterObject:E$2,registerPointerMissedObject:S$2,deregisterPointerMissedObject:M$1},{forceUpdate:h$3,registerObject:b$4,deregisterObject:E$2,registerPointerMissedObject:S$2,deregisterPointerMissedObject:M$1}}function Sn$1(e$3,t,r$2=100){r$2=r$2<=0?100:r$2;let n$2=createEventHook$1(),o$1=new Set,l$1=!1,s$1=!1,a$2=null;function c$4(){a$2&&clearTimeout(a$2),!s$1&&!l$1&&e$3()?(n$2.trigger(t),o$1.forEach(u$1=>u$1()),o$1.clear(),l$1=!0):!s$1&&!l$1&&(a$2=setTimeout(c$4,r$2))}function i$1(){s$1=!0,a$2&&clearTimeout(a$2)}c$4();let f$3=(u$1,..._$2)=>{u$1(..._$2)};return{on:u$1=>{if(l$1)return f$3(u$1,t),{off:()=>{}};{let _$2=n$2.on(u$1);return o$1.add(_$2.off),n$2.on(u$1)}},off:n$2.off,trigger:n$2.trigger,clear:n$2.clear,cancel:i$1}}const ee$2=new WeakMap;function bt$3(e$3){if(e$3||=pe$2(),ee$2.has(e$3))return ee$2.get(e$3);let t=100,r$2=Date.now(),l$1=Sn$1(()=>{if(Date.now()-r$2>=t)return!0;{let s$1=e$3.renderer.value,a$2=s$1?.domElement||{width:0,height:0};return!!(s$1&&a$2.width>0&&a$2.height>0)}},e$3);return ee$2.set(e$3,l$1),l$1}function An({scene:e$3,canvas:t,windowSize:r$2,rendererOptions:n$2,emit:o$1}){let l$1=shallowRef(e$3),s$1=Cn$1(r$2,t),{camera:a$2,cameras:c$4,registerCamera:i$1,deregisterCamera:f$3,setCameraActive:v$2}=mn$1({sizes:s$1}),u$1={mode:ref(n$2.renderMode||`always`),priority:ref(0),frames:ref(0),maxFrames:60,canBeInvalidated:computed(()=>u$1.mode.value===`on-demand`&&u$1.frames.value===0)};function _$2(R$3=1){n$2.renderMode===`on-demand`&&(u$1.frames.value=Math.min(u$1.maxFrames,u$1.frames.value+R$3))}function d$2(){n$2.renderMode===`manual`&&(u$1.frames.value=1)}let{renderer:y$3}=Pn$1({canvas:t,options:n$2,contextParts:{sizes:s$1,render:u$1,invalidate:_$2,advance:d$2}}),p$5={sizes:s$1,scene:l$1,camera:a$2,cameras:readonly(c$4),renderer:y$3,raycaster:shallowRef(new Raycaster),controls:ref(null),perf:{maxFrames:160,fps:{value:0,accumulator:[]},memory:{currentMem:0,allocatedMem:0,accumulator:[]}},render:u$1,advance:d$2,extend:Ee$1,invalidate:_$2,registerCamera:i$1,setCameraActive:v$2,deregisterCamera:f$3,loop:_n$1()};provide(`useTres`,p$5),p$5.scene.value.__tres={root:p$5},p$5.loop.register(()=>{a$2.value&&u$1.frames.value>0&&(y$3.value.render(e$3,a$2.value),o$1(`render`,p$5.renderer.value)),u$1.priority.value=0,u$1.mode.value===`always`?u$1.frames.value=1:u$1.frames.value=Math.max(0,u$1.frames.value-1)},`render`);let{on:h$3,cancel:P$2}=bt$3(p$5);p$5.loop.setReady(!1),p$5.loop.start(),h$3(()=>{o$1(`ready`,p$5),p$5.loop.setReady(!0),Tn$1(e$3,p$5,o$1)}),onUnmounted(()=>{P$2(),p$5.loop.stop()});let C$3=100,b$4=useFps({every:C$3}),{isSupported:E$2,memory:S$2}=useMemory({interval:C$3}),M$1=160,x$3=performance.now(),m$3=({timestamp:R$3})=>{p$5.scene.value&&(p$5.perf.memory.allocatedMem=Le$1(p$5.scene.value)),R$3-x$3>=C$3&&(x$3=R$3,p$5.perf.fps.accumulator.push(b$4.value),p$5.perf.fps.accumulator.length>M$1&&p$5.perf.fps.accumulator.shift(),p$5.perf.fps.value=b$4.value,E$2.value&&S$2.value&&(p$5.perf.memory.accumulator.push(S$2.value.usedJSHeapSize/1024/1024),p$5.perf.memory.accumulator.length>M$1&&p$5.perf.memory.accumulator.shift(),p$5.perf.memory.currentMem=p$5.perf.memory.accumulator.reduce((B$2,O$3)=>B$2+O$3,0)/p$5.perf.memory.accumulator.length))},w$2=0,k$4=1,{pause:L$1}=useRafFn(({delta:R$3})=>{window.__TRES__DEVTOOLS__&&(m$3({timestamp:performance.now()}),w$2+=R$3,w$2>=k$4&&(window.__TRES__DEVTOOLS__.cb(p$5),w$2=0))},{immediate:!0});return onUnmounted(()=>{L$1()}),p$5}function pe$2(){let e$3=inject(`useTres`);if(!e$3)throw Error(`useTresContext must be used together with useTresContextProvider`);return e$3}const so$1=pe$2;function io$1(){let{camera:e$3,scene:t,renderer:r$2,loop:n$2,raycaster:o$1,controls:l$1,invalidate:s$1,advance:a$2}=pe$2();n$2.setContext({camera:e$3,scene:t,renderer:r$2,raycaster:o$1,controls:l$1,invalidate:s$1,advance:a$2});function c$4(v$2,u$1=0){return n$2.register(v$2,`before`,u$1)}function i$1(v$2){return n$2.register(v$2,`render`)}function f$3(v$2,u$1=0){return n$2.register(v$2,`after`,u$1)}return{pause:n$2.pause,resume:n$2.resume,pauseRender:n$2.pauseRender,resumeRender:n$2.resumeRender,isActive:n$2.isActive,onBeforeRender:c$4,render:i$1,onAfterRender:f$3}}const Mt$2=createEventHook$1(),Pt$2=createEventHook$1(),Re$1=createEventHook$1(),te$2=new Clock$1;let le$1=0,ce$1=0;const{pause:xn$1,resume:Xe,isActive:kn$1}=useRafFn(()=>{Mt$2.trigger({delta:le$1,elapsed:ce$1,clock:te$2}),Pt$2.trigger({delta:le$1,elapsed:ce$1,clock:te$2}),Re$1.trigger({delta:le$1,elapsed:ce$1,clock:te$2})},{immediate:!1});Re$1.on(()=>{le$1=te$2.getDelta(),ce$1=te$2.getElapsedTime()});function Ln(e$3,t={},r$2={}){let n$2=e$3,o$1=a$2=>{n$2=a$2},l$1=new Proxy({},{}),s$1={has(a$2,c$4){return c$4 in t||c$4 in n$2},get(a$2,c$4,i$1){return c$4 in t?t[c$4](n$2):n$2[c$4]},set(a$2,c$4,i$1){return r$2[c$4]?r$2[c$4](i$1,n$2,l$1,o$1):n$2[c$4]=i$1,!0}};return l$1=new Proxy({},s$1),l$1}const{logError:et$1}=Q$2(),tt$2=[`onClick`,`onContextMenu`,`onPointerMove`,`onPointerEnter`,`onPointerLeave`,`onPointerOver`,`onPointerOut`,`onDoubleClick`,`onPointerDown`,`onPointerUp`,`onPointerCancel`,`onPointerMissed`,`onLostPointerCapture`,`onWheel`],Rn$1=e$3=>{let t=e$3.scene.value;function r$2(i$1,f$3,v$2,u$1){if(u$1||={},u$1.args||=[],i$1===`template`||Jr$1(i$1))return null;let _$2=i$1.replace(`Tres`,``),d$2;if(i$1===`primitive`){(!j(u$1.object)||isRef(u$1.object))&&et$1(`Tres primitives need an 'object' prop, whose value is an object or shallowRef`),_$2=u$1.object.type;let y$3={};d$2=Ln(u$1.object,{object:h$3=>h$3,isPrimitive:()=>!0,__tres:()=>y$3},{object:(h$3,P$2,C$3,b$4)=>{pn$1(h$3,C$3,b$4,{patchProp:l$1,remove:o$1,insert:n$2},e$3)},__tres:h$3=>{Object.assign(y$3,h$3)}})}else{let y$3=Ce$2.value[_$2];y$3||et$1(`${_$2} is not defined on the THREE namespace. Use extend to add it to the catalog.`),d$2=new y$3(...u$1.args)}return d$2?(d$2.isCamera&&(u$1!=null&&u$1.position||d$2.position.set(3,3,3),u$1!=null&&u$1.lookAt||d$2.lookAt(0,0,0)),d$2=z$2(d$2,{...d$2.__tres,type:_$2,memoizedProps:u$1,eventCount:0,primitive:i$1===`primitive`,attach:u$1.attach},e$3),d$2):null}function n$2(i$1,f$3){var _$2,d$2,y$3;if(!i$1)return;f$3||=t;let v$2=i$1.__tres?i$1:z$2(i$1,{},e$3),u$1=f$3.__tres?f$3:z$2(f$3,{},e$3);i$1=J$1(v$2),f$3=J$1(u$1),i$1.__tres&&(_$2=i$1.__tres)?.eventCount>0&&((d$2=e$3.eventManager)==null||d$2.registerObject(i$1)),e$3.registerCamera(i$1),(y$3=e$3.eventManager)==null||y$3.registerPointerMissedObject(i$1),v$2.__tres.attach?cn$2(u$1,v$2,v$2.__tres.attach):N$1(i$1)&&N$1(u$1)&&(u$1.add(i$1),i$1.dispatchEvent({type:`added`})),v$2.__tres.parent=u$1,u$1.__tres.objects&&!u$1.__tres.objects.includes(v$2)&&u$1.__tres.objects.push(v$2)}function o$1(i$1,f$3){var d$2,y$3,p$5,h$3;if(!i$1)return;i$1!=null&&i$1.__tres&&(d$2=i$1.__tres)?.eventCount>0&&((y$3=e$3.eventManager)==null||y$3.deregisterObject(i$1)),f$3=be$1(f$3)?`default`:f$3;let v$2=(p$5=i$1.__tres)?.dispose;be$1(v$2)||(f$3=v$2===null?!1:v$2);let u$1=(h$3=i$1.__tres)?.primitive,_$2=f$3===`default`?!u$1:!!f$3;if(i$1.__tres&&`objects`in i$1.__tres&&[...i$1.__tres.objects].forEach(P$2=>o$1(P$2,f$3)),_$2&&i$1.children&&[...i$1.children].forEach(P$2=>o$1(P$2,f$3)),_t$3(i$1,e$3),wt$3(i$1,e$3),_$2&&!Yr$1(i$1)){if(Y$1(f$3))f$3(i$1);else if(Y$1(i$1.dispose))try{i$1.dispose()}catch{}}`__tres`in i$1&&delete i$1.__tres}function l$1(i$1,f$3,v$2,u$1){var P$2,C$3;if(!i$1)return;let _$2=i$1,d$2=f$3;if(i$1.__tres&&(i$1.__tres.memoizedProps[f$3]=u$1),f$3===`attach`){let b$4=(P$2=i$1.__tres)?.parent||i$1.parent;o$1(i$1),z$2(i$1,{attach:u$1},e$3),b$4&&n$2(i$1,b$4);return}if(f$3===`dispose`){i$1.__tres||(i$1=z$2(i$1,{},e$3)),i$1.__tres.dispose=u$1;return}if(N$1(i$1)&&d$2===`blocks-pointer-events`){u$1||u$1===``?i$1[d$2]=u$1:delete i$1[d$2];return}tt$2.includes(f$3)&&i$1.__tres&&(i$1.__tres.eventCount+=1);let y$3=he$1(d$2),p$5=_$2?.[y$3];if(d$2===`args`){let b$4=i$1,E$2=v$2??[],S$2=u$1??[],M$1=(C$3=i$1.__tres)?.type||i$1.type;M$1&&E$2.length&&!tn$1(E$2,S$2)&&(_$2=Object.assign(b$4,new Ce$2.value[M$1](...u$1)));return}if(_$2.type===`BufferGeometry`){if(d$2===`args`)return;_$2.setAttribute(he$1(d$2),new BufferAttribute(...u$1));return}if(d$2.includes(`-`)&&p$5===void 0){p$5=_$2;for(let b$4 of d$2.split(`-`))y$3=d$2=he$1(b$4),_$2=p$5,p$5=p$5?.[d$2]}let h$3=u$1;if(h$3===``&&(h$3=!0),Y$1(p$5)){tt$2.includes(f$3)||(ke(h$3)?i$1[y$3](...h$3):i$1[y$3](h$3)),y$3.startsWith(`on`)&&Y$1(h$3)&&(_$2[y$3]=h$3);return}Ge$1(p$5)&&Ge$1(h$3)?p$5.mask=h$3.mask:mt$2(p$5)&&Ur$1(h$3)?p$5.set(h$3):Fr(p$5)&&Wr$1(h$3)&&p$5.constructor===h$3.constructor?p$5.copy(h$3):Me$1(p$5)&&Array.isArray(h$3)?`fromArray`in p$5&&typeof p$5.fromArray==`function`?p$5.fromArray(h$3):p$5.set(...h$3):Me$1(p$5)&&typeof h$3==`number`?`setScalar`in p$5&&typeof p$5.setScalar==`function`?p$5.setScalar(h$3):p$5.set(h$3):_$2[y$3]=h$3,yt$3(i$1)}function s$1(i$1){var f$3;return(f$3=i$1?.__tres)?.parent||null}function a$2(i$1){let f$3=z$2(new Object3D,{type:`Comment`},e$3);return f$3.name=i$1,f$3}function c$4(i$1){var _$2;let f$3=s$1(i$1),v$2=(_$2=f$3?.__tres)?.objects||[],u$1=v$2.indexOf(i$1);return u$1<0||u$1>=v$2.length-1?null:v$2[u$1+1]}return{insert:n$2,remove:o$1,createElement:r$2,patchProp:l$1,parentNode:s$1,createText:()=>void 0,createComment:a$2,setText:()=>void 0,setElementText:()=>void 0,nextSibling:c$4,querySelector:()=>void 0,setScopeId:()=>void 0,cloneNode:()=>void 0,insertStaticContent:()=>void 0}};function On$1(){return Ct$2().__VUE_DEVTOOLS_GLOBAL_HOOK__}function Ct$2(){return typeof navigator<`u`&&typeof window<`u`?window:typeof globalThis<`u`?globalThis:{}}const Dn$1=typeof Proxy==`function`,jn$1=`devtools-plugin:setup`,Bn$1=`plugin:settings:set`;let V$1,Te$3;function In$1(){var e$3;return V$1!==void 0||(typeof window<`u`&&window.performance?(V$1=!0,Te$3=window.performance):typeof globalThis<`u`&&(e$3=globalThis.perf_hooks)!=null&&e$3.performance?(V$1=!0,Te$3=globalThis.perf_hooks.performance):V$1=!1),V$1}function $n$1(){return In$1()?Te$3.now():Date.now()}var Hn=class{constructor(t,r$2){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=t,this.hook=r$2;let n$2={};if(t.settings)for(let s$1 in t.settings){let a$2=t.settings[s$1];n$2[s$1]=a$2.defaultValue}let o$1=`__vue-devtools-plugin-settings__${t.id}`,l$1=Object.assign({},n$2);try{let s$1=localStorage.getItem(o$1),a$2=JSON.parse(s$1);Object.assign(l$1,a$2)}catch{}this.fallbacks={getSettings(){return l$1},setSettings(s$1){try{localStorage.setItem(o$1,JSON.stringify(s$1))}catch{}l$1=s$1},now(){return $n$1()}},r$2&&r$2.on(Bn$1,(s$1,a$2)=>{s$1===this.plugin.id&&this.fallbacks.setSettings(a$2)}),this.proxiedOn=new Proxy({},{get:(s$1,a$2)=>this.target?this.target.on[a$2]:(...c$4)=>{this.onQueue.push({method:a$2,args:c$4})}}),this.proxiedTarget=new Proxy({},{get:(s$1,a$2)=>this.target?this.target[a$2]:a$2===`on`?this.proxiedOn:Object.keys(this.fallbacks).includes(a$2)?(...c$4)=>(this.targetQueue.push({method:a$2,args:c$4,resolve:()=>{}}),this.fallbacks[a$2](...c$4)):(...c$4)=>new Promise(i$1=>{this.targetQueue.push({method:a$2,args:c$4,resolve:i$1})})})}async setRealTarget(t){this.target=t;for(let r$2 of this.onQueue)this.target.on[r$2.method](...r$2.args);for(let r$2 of this.targetQueue)r$2.resolve(await this.target[r$2.method](...r$2.args))}};function Un$1(e$3,t){let r$2=e$3,n$2=Ct$2(),o$1=On$1(),l$1=Dn$1&&r$2.enableEarlyProxy;if(o$1&&(n$2.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!l$1))o$1.emit(jn$1,e$3,t);else{let s$1=l$1?new Hn(r$2,o$1):null;(n$2.__VUE_DEVTOOLS_PLUGINS__=n$2.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:r$2,setupFn:t,proxy:s$1}),s$1&&t(s$1.proxiedTarget)}}function Fn(e$3,t){let r$2=`▲ ■ ●${e$3}`;typeof rt$4==`function`?rt$4(r$2,t):console.log(r$2)}function rt$4(e$3,t){throw Error(e$3+t)}const Et$1=e$3=>{let t={id:e$3.uuid,label:e$3.type,children:[],tags:[]};e$3.name!==``&&t.tags.push({label:e$3.name,textColor:5750629,backgroundColor:15793395});let r$2=Le$1(e$3);return r$2>0&&t.tags.push({label:`${wn$1(r$2)} KB`,textColor:15707189,backgroundColor:16775644,tooltip:`Memory usage`}),e$3.type.includes(`Light`)&&(Gr$1(e$3)&&t.tags.push({label:`${e$3.intensity}`,textColor:9738662,backgroundColor:16316922,tooltip:`Intensity`}),t.tags.push({label:`#${new Color(e$3.color).getHexString()}`,textColor:9738662,backgroundColor:16316922,tooltip:`Color`})),e$3.type.includes(`Camera`)&&(t.tags.push({label:`${e$3.fov}°`,textColor:9738662,backgroundColor:16316922,tooltip:`Field of view`}),t.tags.push({label:`x: ${Math.round(e$3.position.x)} y: ${Math.round(e$3.position.y)} z: ${Math.round(e$3.position.z)}`,textColor:9738662,backgroundColor:16316922,tooltip:`Position`})),t};function Tt$3(e$3,t,r$2=``){e$3.children.forEach(n$2=>{if(n$2.type===`HightlightMesh`||r$2&&!n$2.type.includes(r$2)&&!n$2.name.includes(r$2))return;let o$1=Et$1(n$2);t.children.push(o$1),Tt$3(n$2,o$1,r$2)})}const Wn$1=[],X$1=`tres:inspector`,Nn=reactive({sceneGraph:null});function zn(e$3,t){Un$1({id:`dev.esm.tres`,label:`TresJS 🪐`,logo:`https://raw.githubusercontent.com/Tresjs/tres/main/public/favicon.svg`,packageName:`tresjs`,homepage:`https://tresjs.org`,componentStateTypes:Wn$1,app:e$3},r$2=>{typeof r$2.now!=`function`&&Fn(`You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html.`),r$2.addInspector({id:X$1,label:`TresJS 🪐`,icon:`account_tree`,treeFilterPlaceholder:`Search instances`}),setInterval(()=>{r$2.sendInspectorTree(X$1)},1e3),setInterval(()=>{r$2.notifyComponentUpdate()},5e3),r$2.on.getInspectorTree(l$1=>{if(l$1.inspectorId===X$1){let s$1=Et$1(t.scene.value);Tt$3(t.scene.value,s$1,l$1.filter),Nn.sceneGraph=s$1,l$1.rootNodes=[s$1]}});let n$2=null,o$1=null;r$2.on.getInspectorState(l$1=>{var s$1;if(l$1.inspectorId===X$1){let[a$2]=t.scene.value.getObjectsByProperty(`uuid`,l$1.nodeId);if(!a$2)return;if(o$1&&n$2&&n$2.parent&&o$1.remove(n$2),a$2.isMesh){let c$4=on$1(a$2);a$2.add(c$4),n$2=c$4,o$1=a$2}l$1.state={object:Object.entries(a$2).map(([c$4,i$1])=>c$4===`children`?{key:c$4,value:i$1.filter(f$3=>f$3.type!==`HightlightMesh`)}:{key:c$4,value:i$1,editable:!0}).filter(({key:c$4})=>c$4!==`parent`)},a$2.isScene&&(l$1.state={...l$1.state,state:[{key:`Scene Info`,value:{objects:a$2.children.length,memory:Le$1(a$2),calls:t.renderer.value.info.render.calls,triangles:t.renderer.value.info.render.triangles,points:t.renderer.value.info.render.points,lines:t.renderer.value.info.render.lines}},{key:`Programs`,value:(s$1=t.renderer.value.info.programs)?.map(c$4=>({...c$4,programName:c$4.name}))||[]}]})}}),r$2.on.editInspectorState(l$1=>{l$1.inspectorId===X$1&&nn$1(t.scene.value,l$1.nodeId,l$1.path,l$1.state.value)})})}const Gn$1=[`data-scene`,`data-tres`],Vn$1=defineComponent({__name:`TresCanvas`,props:{shadows:{type:Boolean,default:void 0},clearColor:{},toneMapping:{},shadowMapType:{},useLegacyLights:{type:Boolean,default:void 0},outputColorSpace:{},toneMappingExposure:{},renderMode:{default:`always`},dpr:{},camera:{},preset:{},windowSize:{type:Boolean,default:void 0},enableProvideBridge:{type:Boolean,default:!0},context:{},alpha:{type:Boolean,default:void 0},premultipliedAlpha:{type:Boolean},antialias:{type:Boolean,default:void 0},stencil:{type:Boolean,default:void 0},preserveDrawingBuffer:{type:Boolean,default:void 0},powerPreference:{},depth:{type:Boolean,default:void 0},failIfMajorPerformanceCaveat:{type:Boolean,default:void 0},precision:{},logarithmicDepthBuffer:{type:Boolean,default:void 0},reverseDepthBuffer:{type:Boolean}},emits:[`render`,`click`,`double-click`,`context-menu`,`pointer-move`,`pointer-up`,`pointer-down`,`pointer-enter`,`pointer-leave`,`pointer-over`,`pointer-out`,`pointer-missed`,`wheel`,`ready`],setup(e$3,{expose:t,emit:r$2}){let n$2=e$3,o$1=r$2,l$1=useSlots(),s$1=ref(),a$2=shallowRef(new Scene),c$4=getCurrentInstance();Ee$1(three_module_exports);let i$1=(d$2,y$3=!1)=>defineComponent({setup(){var C$3;let p$5=(C$3=getCurrentInstance())?.appContext;p$5&&(p$5.app=c$4?.appContext.app);let h$3={};function P$2(b$4){b$4&&(b$4.parent&&P$2(b$4.parent),b$4.provides&&Object.assign(h$3,b$4.provides))}return c$4!=null&&c$4.parent&&n$2.enableProvideBridge&&(P$2(c$4.parent),Reflect.ownKeys(h$3).forEach(b$4=>{provide(b$4,h$3[b$4])})),provide(`useTres`,d$2),provide(`extend`,Ee$1),typeof window<`u`&&zn(p$5?.app,d$2),()=>h(Fragment,null,y$3?[]:l$1.default())}}),f$3=(d$2,y$3=!1)=>{let p$5=i$1(d$2,y$3),{render:h$3}=createRenderer(Rn$1(d$2));h$3(h(p$5),a$2.value)},v$2=(d$2,y$3=!1)=>{vt$3(d$2.scene.value),y$3&&(d$2.renderer.value.dispose(),d$2.renderer.value.renderLists.dispose(),d$2.renderer.value.forceContextLoss()),a$2.value.__tres={root:d$2}},u$1=shallowRef(null);t({context:u$1,dispose:()=>v$2(u$1.value,!0)});let _$2=()=>{v$2(u$1.value),f$3(u$1.value,!0)};return onMounted(()=>{let d$2=s$1;u$1.value=An({scene:a$2.value,canvas:d$2,windowSize:n$2.windowSize??!1,rendererOptions:n$2,emit:o$1});let{registerCamera:y$3,camera:p$5,cameras:h$3,deregisterCamera:P$2}=u$1.value;f$3(u$1.value);let C$3=()=>{let b$4=new PerspectiveCamera(45,window.innerWidth/window.innerHeight,.1,1e3);b$4.position.set(3,3,3),b$4.lookAt(0,0,0),y$3(b$4);let E$2=watchEffect(()=>{h$3.value.length>=2&&(b$4.removeFromParent(),P$2(b$4),E$2?.())})};watch(()=>n$2.camera,(b$4,E$2)=>{b$4&&y$3(b$4),E$2&&(E$2.removeFromParent(),P$2(E$2))},{immediate:!0}),p$5.value||C$3()}),onUnmounted(_$2),(d$2,y$3)=>(openBlock(),createElementBlock(`canvas`,{ref_key:`canvas`,ref:s$1,"data-scene":a$2.value.uuid,class:normalizeClass(d$2.$attrs.class),"data-tres":`tresjs ${unref(jr$1).version}`,style:normalizeStyle({display:`block`,width:`100%`,height:`100%`,position:d$2.windowSize?`fixed`:`relative`,top:0,left:0,pointerEvents:`auto`,touchAction:`none`,...d$2.$attrs.style})},null,14,Gn$1))}}),Yn$1=[`TresCanvas`,`TresLeches`,`TresScene`],co$1={template:{compilerOptions:{isCustomElement:e$3=>e$3.startsWith(`Tres`)&&!Yn$1.includes(e$3)||e$3===`primitive`}}},{logWarning:qn$1}=Q$2();var St$3=class extends Line{constructor(t,r$2){let n$2=[1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],o$1=new BufferGeometry;o$1.setAttribute(`position`,new Float32BufferAttribute(n$2,3)),o$1.computeBoundingSphere();let l$1=new LineBasicMaterial({fog:!1});super(o$1,l$1),this.light=t,this.color=r$2,this.type=`RectAreaLightHelper`;let s$1=[1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],a$2=new BufferGeometry;a$2.setAttribute(`position`,new Float32BufferAttribute(s$1,3)),a$2.computeBoundingSphere(),this.add(new Mesh(a$2,new MeshBasicMaterial({side:BackSide,fog:!1})))}updateMatrixWorld(){if(this.scale.set(.5*this.light.width,.5*this.light.height,1),this.color!==void 0)this.material.color.set(this.color),this.children[0].material.color.set(this.color);else{this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);let t=this.material.color,r$2=Math.max(t.r,t.g,t.b);r$2>1&&t.multiplyScalar(1/r$2),this.children[0].material.color.copy(this.material.color)}this.matrixWorld.extractRotation(this.light.matrixWorld).scale(this.scale).copyPosition(this.light.matrixWorld),this.children[0].matrixWorld.copy(this.matrixWorld)}dispose(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()}};const{logWarning:nt$2}=Q$2();let se,F$1;const Kn={DirectionalLight:DirectionalLightHelper,PointLight:PointLightHelper,SpotLight:SpotLightHelper,HemisphereLight:HemisphereLightHelper,RectAreaLight:St$3},fo$1={mounted:e$3=>{if(!e$3.isLight){nt$2(`${e$3.type} is not a light`);return}se=Kn[e$3.type],e$3.parent.add(new se(e$3,1,e$3.color.getHex()))},updated:e$3=>{F$1=e$3.parent.children.find(t=>t instanceof se),!(F$1 instanceof St$3)&&F$1.update()},unmounted:e$3=>{if(!e$3.isLight){nt$2(`${e$3.type} is not a light`);return}F$1=e$3.parent.children.find(t=>t instanceof se),F$1&&F$1.dispose&&F$1.dispose(),e$3.parent&&e$3.parent.remove(F$1)}},po$1={mounted:(e$3,t)=>{if(t.arg){console.log(`v-log:${t.arg}`,e$3[t.arg]);return}console.log(`v-log`,e$3)}},mo={install(e$3){e$3.component(`TresCanvas`,Vn$1)}};var require_nprogress=__commonJSMin((exports,module)=>{(function(root$3,factory){typeof define==`function`&&define.amd?define(factory):typeof exports==`object`?module.exports=factory():root$3.NProgress=factory()})(exports,function(){var NProgress$1={};NProgress$1.version=`0.2.0`;var Settings=NProgress$1.settings={minimum:.08,easing:`ease`,positionUsing:``,speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:`[role="bar"]`,spinnerSelector:`[role="spinner"]`,parent:`body`,template:`
`};NProgress$1.configure=function(options$1){var key$2,value$1;for(key$2 in options$1)value$1=options$1[key$2],value$1!==void 0&&options$1.hasOwnProperty(key$2)&&(Settings[key$2]=value$1);return this},NProgress$1.status=null,NProgress$1.set=function(n$2){var started=NProgress$1.isStarted();n$2=clamp$8(n$2,Settings.minimum,1),NProgress$1.status=n$2===1?null:n$2;var progress$1=NProgress$1.render(!started),bar=progress$1.querySelector(Settings.barSelector),speed=Settings.speed,ease=Settings.easing;return progress$1.offsetWidth,queue$1(function(next){Settings.positionUsing===``&&(Settings.positionUsing=NProgress$1.getPositioningCSS()),css(bar,barPositionCSS(n$2,speed,ease)),n$2===1?(css(progress$1,{transition:`none`,opacity:1}),progress$1.offsetWidth,setTimeout(function(){css(progress$1,{transition:`all `+speed+`ms linear`,opacity:0}),setTimeout(function(){NProgress$1.remove(),next()},speed)},speed)):setTimeout(next,speed)}),this},NProgress$1.isStarted=function(){return typeof NProgress$1.status==`number`},NProgress$1.start=function(){NProgress$1.status||NProgress$1.set(0);var work=function(){setTimeout(function(){NProgress$1.status&&(NProgress$1.trickle(),work())},Settings.trickleSpeed)};return Settings.trickle&&work(),this},NProgress$1.done=function(force){return!force&&!NProgress$1.status?this:NProgress$1.inc(.3+.5*Math.random()).set(1)},NProgress$1.inc=function(amount){var n$2=NProgress$1.status;return n$2?(typeof amount!=`number`&&(amount=(1-n$2)*clamp$8(Math.random()*n$2,.1,.95)),n$2=clamp$8(n$2+amount,0,.994),NProgress$1.set(n$2)):NProgress$1.start()},NProgress$1.trickle=function(){return NProgress$1.inc(Math.random()*Settings.trickleRate)},function(){var initial=0,current=0;NProgress$1.promise=function($promise){return!$promise||$promise.state()===`resolved`?this:(current===0&&NProgress$1.start(),initial++,current++,$promise.always(function(){current--,current===0?(initial=0,NProgress$1.done()):NProgress$1.set((initial-current)/initial)}),this)}}(),NProgress$1.render=function(fromStart){if(NProgress$1.isRendered())return document.getElementById(`nprogress`);addClass(document.documentElement,`nprogress-busy`);var progress$1=document.createElement(`div`);progress$1.id=`nprogress`,progress$1.innerHTML=Settings.template;var bar=progress$1.querySelector(Settings.barSelector),perc=fromStart?`-100`:toBarPerc(NProgress$1.status||0),parent=document.querySelector(Settings.parent),spinner;return css(bar,{transition:`all 0 linear`,transform:`translate3d(`+perc+`%,0,0)`}),Settings.showSpinner||(spinner=progress$1.querySelector(Settings.spinnerSelector),spinner&&removeElement(spinner)),parent!=document.body&&addClass(parent,`nprogress-custom-parent`),parent.appendChild(progress$1),progress$1},NProgress$1.remove=function(){removeClass(document.documentElement,`nprogress-busy`),removeClass(document.querySelector(Settings.parent),`nprogress-custom-parent`);var progress$1=document.getElementById(`nprogress`);progress$1&&removeElement(progress$1)},NProgress$1.isRendered=function(){return!!document.getElementById(`nprogress`)},NProgress$1.getPositioningCSS=function(){var bodyStyle=document.body.style,vendorPrefix=`WebkitTransform`in bodyStyle?`Webkit`:`MozTransform`in bodyStyle?`Moz`:`msTransform`in bodyStyle?`ms`:`OTransform`in bodyStyle?`O`:``;return vendorPrefix+`Perspective`in bodyStyle?`translate3d`:vendorPrefix+`Transform`in bodyStyle?`translate`:`margin`};function clamp$8(n$2,min$1,max$1){return n$2max$1?max$1:n$2}function toBarPerc(n$2){return(-1+n$2)*100}function barPositionCSS(n$2,speed,ease){var barCSS;return barCSS=Settings.positionUsing===`translate3d`?{transform:`translate3d(`+toBarPerc(n$2)+`%,0,0)`}:Settings.positionUsing===`translate`?{transform:`translate(`+toBarPerc(n$2)+`%,0)`}:{"margin-left":toBarPerc(n$2)+`%`},barCSS.transition=`all `+speed+`ms `+ease,barCSS}var queue$1=function(){var pending=[];function next(){var fn$6=pending.shift();fn$6&&fn$6(next)}return function(fn$6){pending.push(fn$6),pending.length==1&&next()}}(),css=function(){var cssPrefixes=[`Webkit`,`O`,`Moz`,`ms`],cssProps={};function camelCase(string$2){return string$2.replace(/^-ms-/,`ms-`).replace(/-([\da-z])/gi,function(match,letter){return letter.toUpperCase()})}function getVendorProp(name$2){var style=document.body.style;if(name$2 in style)return name$2;for(var i$1=cssPrefixes.length,capName=name$2.charAt(0).toUpperCase()+name$2.slice(1),vendorName;i$1--;)if(vendorName=cssPrefixes[i$1]+capName,vendorName in style)return vendorName;return name$2}function getStyleProp(name$2){return name$2=camelCase(name$2),cssProps[name$2]||(cssProps[name$2]=getVendorProp(name$2))}function applyCss(element$3,prop,value$1){prop=getStyleProp(prop),element$3.style[prop]=value$1}return function(element$3,properties){var args=arguments,prop,value$1;if(args.length==2)for(prop in properties)value$1=properties[prop],value$1!==void 0&&properties.hasOwnProperty(prop)&&applyCss(element$3,prop,value$1);else applyCss(element$3,args[1],args[2])}}();function hasClass(element$3,name$2){var list$2=typeof element$3==`string`?element$3:classList(element$3);return list$2.indexOf(` `+name$2+` `)>=0}function addClass(element$3,name$2){var oldList=classList(element$3),newList=oldList+name$2;hasClass(oldList,name$2)||(element$3.className=newList.substring(1))}function removeClass(element$3,name$2){var oldList=classList(element$3),newList;hasClass(element$3,name$2)&&(newList=oldList.replace(` `+name$2+` `,` `),element$3.className=newList.substring(1,newList.length-1))}function classList(element$3){return(` `+(element$3.className||``)+` `).replace(/\s+/gi,` `)}function removeElement(element$3){element$3&&element$3.parentNode&&element$3.parentNode.removeChild(element$3)}return NProgress$1})});const parents=new Set,coords=new WeakMap,siblings$1=new WeakMap,animations=new WeakMap,intersections=new WeakMap,intervals=new WeakMap,options=new WeakMap,debounces=new WeakMap,enabled=new WeakSet;let root$2,scrollX=0,scrollY=0;const TGT=`__aa_tgt`,DEL=`__aa_del`,NEW=`__aa_new`,handleMutations=mutations$1=>{let elements=getElements(mutations$1);elements&&elements.forEach(el$1=>animate$2(el$1))},handleResizes=entries=>{entries.forEach(entry=>{entry.target===root$2&&updateAllPos(),coords.has(entry.target)&&updatePos(entry.target)})};function observePosition(el$1){let oldObserver=intersections.get(el$1);oldObserver?.disconnect();let rect=coords.get(el$1),invocations=0,buffer$1=5;rect||(rect=getCoords(el$1),coords.set(el$1,rect));let{offsetWidth,offsetHeight}=root$2,rootMargins=[rect.top-buffer$1,offsetWidth-(rect.left+buffer$1+rect.width),offsetHeight-(rect.top+buffer$1+rect.height),rect.left-buffer$1],rootMargin=rootMargins.map(px$2=>`${-1*Math.floor(px$2)}px`).join(` `),observer=new IntersectionObserver(()=>{++invocations>1&&updatePos(el$1)},{root:root$2,threshold:1,rootMargin});observer.observe(el$1),intersections.set(el$1,observer)}function updatePos(el$1){clearTimeout(debounces.get(el$1));let optionsOrPlugin=getOptions(el$1),delay=isPlugin(optionsOrPlugin)?500:optionsOrPlugin.duration;debounces.set(el$1,setTimeout(async()=>{let currentAnimation=animations.get(el$1);try{await currentAnimation?.finished,coords.set(el$1,getCoords(el$1)),observePosition(el$1)}catch{}},delay))}function updateAllPos(){clearTimeout(debounces.get(root$2)),debounces.set(root$2,setTimeout(()=>{parents.forEach(parent=>forEach(parent,el$1=>lowPriority(()=>updatePos(el$1))))},100))}function poll(el$1){setTimeout(()=>{intervals.set(el$1,setInterval(()=>lowPriority(updatePos.bind(null,el$1)),2e3))},Math.round(2e3*Math.random()))}function lowPriority(callback){typeof requestIdleCallback==`function`?requestIdleCallback(()=>callback()):requestAnimationFrame(()=>callback())}let mutations,resize;const supportedBrowser=typeof window<`u`&&`ResizeObserver`in window;supportedBrowser&&(root$2=document.documentElement,mutations=new MutationObserver(handleMutations),resize=new ResizeObserver(handleResizes),window.addEventListener(`scroll`,()=>{scrollY=window.scrollY,scrollX=window.scrollX}),resize.observe(root$2));function getElements(mutations$1){let observedNodes=mutations$1.reduce((nodes,mutation)=>[...nodes,...Array.from(mutation.addedNodes),...Array.from(mutation.removedNodes)],[]),onlyCommentNodesObserved=observedNodes.every(node$1=>node$1.nodeName===`#comment`);return onlyCommentNodesObserved?!1:mutations$1.reduce((elements,mutation)=>{if(elements===!1)return!1;if(mutation.target instanceof Element){if(target(mutation.target),!elements.has(mutation.target)){elements.add(mutation.target);for(let i$1=0;i$1callback(parent,options.has(parent)));for(let i$1=0;i$1callback(child,options.has(child)))}}function getPluginTuple(pluginReturn){return Array.isArray(pluginReturn)?pluginReturn:[pluginReturn]}function isPlugin(config){return typeof config==`function`}function remain(el$1){let oldCoords=coords.get(el$1),newCoords=getCoords(el$1);if(!isEnabled(el$1))return coords.set(el$1,newCoords);let animation;if(!oldCoords)return;let pluginOrOptions=getOptions(el$1);if(typeof pluginOrOptions!=`function`){let deltaX=oldCoords.left-newCoords.left,deltaY=oldCoords.top-newCoords.top,[widthFrom,widthTo,heightFrom,heightTo]=getTransitionSizes(el$1,oldCoords,newCoords),start={transform:`translate(${deltaX}px, ${deltaY}px)`},end={transform:`translate(0, 0)`};widthFrom!==widthTo&&(start.width=`${widthFrom}px`,end.width=`${widthTo}px`),heightFrom!==heightTo&&(start.height=`${heightFrom}px`,end.height=`${heightTo}px`),animation=el$1.animate([start,end],{duration:pluginOrOptions.duration,easing:pluginOrOptions.easing})}else{let[keyframes$4]=getPluginTuple(pluginOrOptions(el$1,`remain`,oldCoords,newCoords));animation=new Animation(keyframes$4),animation.play()}animations.set(el$1,animation),coords.set(el$1,newCoords),animation.addEventListener(`finish`,updatePos.bind(null,el$1))}function add(el$1){NEW in el$1&&delete el$1[NEW];let newCoords=getCoords(el$1);coords.set(el$1,newCoords);let pluginOrOptions=getOptions(el$1);if(!isEnabled(el$1))return;let animation;if(typeof pluginOrOptions!=`function`)animation=el$1.animate([{transform:`scale(.98)`,opacity:0},{transform:`scale(0.98)`,opacity:0,offset:.5},{transform:`scale(1)`,opacity:1}],{duration:pluginOrOptions.duration*1.5,easing:`ease-in`});else{let[keyframes$4]=getPluginTuple(pluginOrOptions(el$1,`add`,newCoords));animation=new Animation(keyframes$4),animation.play()}animations.set(el$1,animation),animation.addEventListener(`finish`,updatePos.bind(null,el$1))}function cleanUp(el$1,styles){var _a$3;el$1.remove(),coords.delete(el$1),siblings$1.delete(el$1),animations.delete(el$1),(_a$3=intersections.get(el$1))==null||_a$3.disconnect(),setTimeout(()=>{if(DEL in el$1&&delete el$1[DEL],Object.defineProperty(el$1,NEW,{value:!0,configurable:!0}),styles&&el$1 instanceof HTMLElement)for(let style in styles)el$1.style[style]=``},0)}function remove$1(el$1){var _a$3;if(!siblings$1.has(el$1)||!coords.has(el$1))return;let[prev,next]=siblings$1.get(el$1);Object.defineProperty(el$1,DEL,{value:!0,configurable:!0});let finalX=window.scrollX,finalY=window.scrollY;if(next&&next.parentNode&&next.parentNode instanceof Element?next.parentNode.insertBefore(el$1,next):prev&&prev.parentNode?prev.parentNode.appendChild(el$1):(_a$3=getTarget(el$1))==null||_a$3.appendChild(el$1),!isEnabled(el$1))return cleanUp(el$1);let[top,left,width,height]=deletePosition(el$1),optionsOrPlugin=getOptions(el$1),oldCoords=coords.get(el$1);(finalX!==scrollX||finalY!==scrollY)&&adjustScroll(el$1,finalX,finalY,optionsOrPlugin);let animation,styleReset={position:`absolute`,top:`${top}px`,left:`${left}px`,width:`${width}px`,height:`${height}px`,margin:`0`,pointerEvents:`none`,transformOrigin:`center`,zIndex:`100`};if(!isPlugin(optionsOrPlugin))Object.assign(el$1.style,styleReset),animation=el$1.animate([{transform:`scale(1)`,opacity:1},{transform:`scale(.98)`,opacity:0}],{duration:optionsOrPlugin.duration,easing:`ease-out`});else{let[keyframes$4,options$1]=getPluginTuple(optionsOrPlugin(el$1,`remove`,oldCoords));options$1?.styleReset!==!1&&(styleReset=options$1?.styleReset||styleReset,Object.assign(el$1.style,styleReset)),animation=new Animation(keyframes$4),animation.play()}animations.set(el$1,animation),animation.addEventListener(`finish`,cleanUp.bind(null,el$1,styleReset))}function adjustScroll(el$1,finalX,finalY,optionsOrPlugin){let scrollDeltaX=scrollX-finalX,scrollDeltaY=scrollY-finalY,scrollBefore=document.documentElement.style.scrollBehavior,scrollBehavior=getComputedStyle(root$2).scrollBehavior;if(scrollBehavior===`smooth`&&(document.documentElement.style.scrollBehavior=`auto`),window.scrollTo(window.scrollX+scrollDeltaX,window.scrollY+scrollDeltaY),!el$1.parentElement)return;let parent=el$1.parentElement,lastHeight=parent.clientHeight,lastWidth=parent.clientWidth,startScroll=performance.now();function smoothScroll(){requestAnimationFrame(()=>{if(!isPlugin(optionsOrPlugin)){let deltaY=lastHeight-parent.clientHeight,deltaX=lastWidth-parent.clientWidth;startScroll+optionsOrPlugin.duration>performance.now()?(window.scrollTo({left:window.scrollX-deltaX,top:window.scrollY-deltaY}),lastHeight=parent.clientHeight,lastWidth=parent.clientWidth,smoothScroll()):document.documentElement.style.scrollBehavior=scrollBefore}})}smoothScroll()}function deletePosition(el$1){let oldCoords=coords.get(el$1),[width,,height]=getTransitionSizes(el$1,oldCoords,getCoords(el$1)),offsetParent=el$1.parentElement;for(;offsetParent&&(getComputedStyle(offsetParent).position===`static`||offsetParent instanceof HTMLBodyElement);)offsetParent=offsetParent.parentElement;offsetParent||=document.body;let parentStyles=getComputedStyle(offsetParent),parentCoords=coords.get(offsetParent)||getCoords(offsetParent),top=Math.round(oldCoords.top-parentCoords.top)-raw$2(parentStyles.borderTopWidth),left=Math.round(oldCoords.left-parentCoords.left)-raw$2(parentStyles.borderLeftWidth);return[top,left,width,height]}function autoAnimate(el$1,config={}){if(mutations&&resize){let mediaQuery=window.matchMedia(`(prefers-reduced-motion: reduce)`),isDisabledDueToReduceMotion=mediaQuery.matches&&!isPlugin(config)&&!config.disrespectUserMotionPreference;isDisabledDueToReduceMotion||(enabled.add(el$1),getComputedStyle(el$1).position===`static`&&Object.assign(el$1.style,{position:`relative`}),forEach(el$1,updatePos,poll,element$3=>resize?.observe(element$3)),isPlugin(config)?options.set(el$1,config):options.set(el$1,{duration:250,easing:`ease-in-out`,...config}),mutations.observe(el$1,{childList:!0}),parents.add(el$1))}return Object.freeze({parent:el$1,enable:()=>{enabled.add(el$1)},disable:()=>{enabled.delete(el$1)},isEnabled:()=>enabled.has(el$1)})}const vAutoAnimate={mounted:(el$1,binding)=>{autoAnimate(el$1,binding.value||{})},getSSRProps:()=>({})},vAutoAnimate$1=vAutoAnimate,autoAnimatePlugin={install(app){app.directive(`auto-animate`,vAutoAnimate$1)}};function isPlainObject$5(value$1){if(typeof value$1!=`object`||!value$1)return!1;let prototype=Object.getPrototypeOf(value$1);return prototype!==null&&prototype!==Object.prototype&&Object.getPrototypeOf(prototype)!==null||Symbol.iterator in value$1?!1:Symbol.toStringTag in value$1?Object.prototype.toString.call(value$1)===`[object Module]`:!0}function _defu(baseObject,defaults$1,namespace=`.`,merger){if(!isPlainObject$5(defaults$1))return _defu(baseObject,{},namespace,merger);let object=Object.assign({},defaults$1);for(let key$2 in baseObject){if(key$2===`__proto__`||key$2===`constructor`)continue;let value$1=baseObject[key$2];if(value$1==null||merger&&merger(object,key$2,value$1,namespace))continue;Array.isArray(value$1)&&Array.isArray(object[key$2])?object[key$2]=[...value$1,...object[key$2]]:isPlainObject$5(value$1)&&isPlainObject$5(object[key$2])?object[key$2]=_defu(value$1,object[key$2],(namespace?`${namespace}.`:``)+key$2.toString(),merger):object[key$2]=value$1}return object}function createDefu(merger){return(...arguments_)=>arguments_.reduce((p$5,c$4)=>_defu(p$5,c$4,``,merger),{})}const defu=createDefu(),defuFn=createDefu((object,key$2,currentValue)=>{if(object[key$2]!==void 0&&typeof currentValue==`function`)return object[key$2]=currentValue(object[key$2]),!0}),defuArrayFn=createDefu((object,key$2,currentValue)=>{if(Array.isArray(object[key$2])&&typeof currentValue==`function`)return object[key$2]=currentValue(object[key$2]),!0});function tryOnScopeDispose(fn$6){return getCurrentScope()?(onScopeDispose(fn$6),!0):!1}function createEventHook(){let fns=new Set,off=fn$6=>{fns.delete(fn$6)},clear=()=>{fns.clear()},on$2=fn$6=>{fns.add(fn$6);let offFn=()=>off(fn$6);return tryOnScopeDispose(offFn),{off:offFn}},trigger$1=(...args)=>Promise.all(Array.from(fns).map(fn$6=>fn$6(...args)));return{on:on$2,off,trigger:trigger$1,clear}}const localProvidedStateMap=new WeakMap,injectLocal=(...args)=>{var _a$3;let key$2=args[0],instance=(_a$3=getCurrentInstance())?.proxy;if(instance==null&&!hasInjectionContext())throw Error(`injectLocal must be called in setup`);return instance&&localProvidedStateMap.has(instance)&&key$2 in localProvidedStateMap.get(instance)?localProvidedStateMap.get(instance)[key$2]:inject(...args)},isClient$2=typeof window<`u`&&typeof document<`u`,isWorker=typeof WorkerGlobalScope<`u`&&globalThis instanceof WorkerGlobalScope,notNullish=val=>val!=null,toString$2=Object.prototype.toString,isObject$1=val=>toString$2.call(val)===`[object Object]`,noop$3=()=>{},hasOwn$2=(val,key$2)=>Object.prototype.hasOwnProperty.call(val,key$2);function toRef$1(...args){if(args.length!==1)return toRef(...args);let r$2=args[0];return typeof r$2==`function`?readonly(customRef(()=>({get:r$2,set:noop$3}))):ref(r$2)}function createFilterWrapper(filter$1,fn$6){function wrapper(...args){return new Promise((resolve$1,reject)=>{Promise.resolve(filter$1(()=>fn$6.apply(this,args),{fn:fn$6,thisArg:this,args})).then(resolve$1).catch(reject)})}return wrapper}const bypassFilter=invoke$1=>invoke$1();function debounceFilter(ms$1,options$1={}){let timer,maxTimer,lastRejector=noop$3,_clearTimeout=timer2=>{clearTimeout(timer2),lastRejector(),lastRejector=noop$3},lastInvoker,filter$1=invoke$1=>{let duration=toValue$1(ms$1),maxDuration$1=toValue$1(options$1.maxWait);return timer&&_clearTimeout(timer),duration<=0||maxDuration$1!==void 0&&maxDuration$1<=0?(maxTimer&&(_clearTimeout(maxTimer),maxTimer=void 0),Promise.resolve(invoke$1())):new Promise((resolve$1,reject)=>{lastRejector=options$1.rejectOnCancel?reject:resolve$1,lastInvoker=invoke$1,maxDuration$1&&!maxTimer&&(maxTimer=setTimeout(()=>{timer&&_clearTimeout(timer),maxTimer=void 0,resolve$1(lastInvoker())},maxDuration$1)),timer=setTimeout(()=>{maxTimer&&_clearTimeout(maxTimer),maxTimer=void 0,resolve$1(invoke$1())},duration)})};return filter$1}function throttleFilter(...args){let lastExec=0,timer,isLeading=!0,lastRejector=noop$3,lastValue,ms$1,trailing,leading,rejectOnCancel;!isRef(args[0])&&typeof args[0]==`object`?{delay:ms$1,trailing=!0,leading=!0,rejectOnCancel=!1}=args[0]:[ms$1,trailing=!0,leading=!0,rejectOnCancel=!1]=args;let clear=()=>{timer&&(clearTimeout(timer),timer=void 0,lastRejector(),lastRejector=noop$3)},filter$1=_invoke=>{let duration=toValue$1(ms$1),elapsed=Date.now()-lastExec,invoke$1=()=>lastValue=_invoke();return clear(),duration<=0?(lastExec=Date.now(),invoke$1()):(elapsed>duration&&(leading||!isLeading)?(lastExec=Date.now(),invoke$1()):trailing&&(lastValue=new Promise((resolve$1,reject)=>{lastRejector=rejectOnCancel?reject:resolve$1,timer=setTimeout(()=>{lastExec=Date.now(),isLeading=!0,resolve$1(invoke$1()),clear()},Math.max(0,duration-elapsed))})),!leading&&!timer&&(timer=setTimeout(()=>isLeading=!0,duration)),isLeading=!1,lastValue)};return filter$1}function pausableFilter(extendFilter=bypassFilter,options$1={}){let{initialState=`active`}=options$1,isActive=toRef$1(initialState===`active`);function pause(){isActive.value=!1}function resume(){isActive.value=!0}let eventFilter=(...args)=>{isActive.value&&extendFilter(...args)};return{isActive:readonly(isActive),pause,resume,eventFilter}}function promiseTimeout(ms$1,throwOnTimeout=!1,reason=`Timeout`){return new Promise((resolve$1,reject)=>{throwOnTimeout?setTimeout(()=>reject(reason),ms$1):setTimeout(resolve$1,ms$1)})}function createSingletonPromise(fn$6){let _promise;function wrapper(){return _promise||=fn$6(),_promise}return wrapper.reset=async()=>{let _prev=_promise;_promise=void 0,_prev&&await _prev},wrapper}function increaseWithUnit(target$1,delta){var _a$3;if(typeof target$1==`number`)return target$1+delta;let value$1=(_a$3=target$1.match(/^-?\d+\.?\d*/))?.[0]||``,unit=target$1.slice(value$1.length),result=Number.parseFloat(value$1)+delta;return Number.isNaN(result)?target$1:result+unit}function pxValue(px$2){return px$2.endsWith(`rem`)?Number.parseFloat(px$2)*16:Number.parseFloat(px$2)}function objectPick(obj,keys$3,omitUndefined=!1){return keys$3.reduce((n$2,k$4)=>(k$4 in obj&&(!omitUndefined||obj[k$4]!==void 0)&&(n$2[k$4]=obj[k$4]),n$2),{})}function toArray(value$1){return Array.isArray(value$1)?value$1:[value$1]}function cacheStringFunction(fn$6){let cache$1=Object.create(null);return str=>{let hit=cache$1[str];return hit||(cache$1[str]=fn$6(str))}}const hyphenateRE=/\B([A-Z])/g,hyphenate=cacheStringFunction(str=>str.replace(hyphenateRE,`-$1`).toLowerCase()),camelizeRE=/-(\w)/g,camelize$1=cacheStringFunction(str=>str.replace(camelizeRE,(_$2,c$4)=>c$4?c$4.toUpperCase():``));function getLifeCycleTarget(target$1){return target$1||getCurrentInstance()}function useDebounceFn(fn$6,ms$1=200,options$1={}){return createFilterWrapper(debounceFilter(ms$1,options$1),fn$6)}function refDebounced(value$1,ms$1=200,options$1={}){let debounced=ref(toValue$1(value$1)),updater=useDebounceFn(()=>{debounced.value=value$1.value},ms$1,options$1);return watch(value$1,()=>updater()),shallowReadonly(debounced)}function useThrottleFn(fn$6,ms$1=200,trailing=!1,leading=!0,rejectOnCancel=!1){return createFilterWrapper(throttleFilter(ms$1,trailing,leading,rejectOnCancel),fn$6)}function refThrottled(value$1,delay=200,trailing=!0,leading=!0){if(delay<=0)return value$1;let throttled=ref(toValue$1(value$1)),updater=useThrottleFn(()=>{throttled.value=value$1.value},delay,trailing,leading);return watch(value$1,()=>updater()),throttled}function watchWithFilter(source,cb$1,options$1={}){let{eventFilter=bypassFilter,...watchOptions}=options$1;return watch(source,createFilterWrapper(eventFilter,cb$1),watchOptions)}function watchPausable(source,cb$1,options$1={}){let{eventFilter:filter$1,initialState=`active`,...watchOptions}=options$1,{eventFilter,pause,resume,isActive}=pausableFilter(filter$1,{initialState}),stop$1=watchWithFilter(source,cb$1,{...watchOptions,eventFilter});return{stop:stop$1,pause,resume,isActive}}function toRefs$1(objectRef,options$1={}){if(!isRef(objectRef))return toRefs(objectRef);let result=Array.isArray(objectRef.value)?Array.from({length:objectRef.value.length}):{};for(let key$2 in objectRef.value)result[key$2]=customRef(()=>({get(){return objectRef.value[key$2]},set(v$2){var _a$3;let replaceRef=(_a$3=toValue$1(options$1.replaceRef))??!0;if(replaceRef)if(Array.isArray(objectRef.value)){let copy=[...objectRef.value];copy[key$2]=v$2,objectRef.value=copy}else{let newObject={...objectRef.value,[key$2]:v$2};Object.setPrototypeOf(newObject,Object.getPrototypeOf(objectRef.value)),objectRef.value=newObject}else objectRef.value[key$2]=v$2}}));return result}function tryOnMounted(fn$6,sync$2=!0,target$1){let instance=getLifeCycleTarget(target$1);instance?onMounted(fn$6,target$1):sync$2?fn$6():nextTick(fn$6)}function tryOnUnmounted(fn$6,target$1){let instance=getLifeCycleTarget(target$1);instance&&onUnmounted(fn$6,target$1)}function createUntil(r$2,isNot=!1){function toMatch(condition,{flush=`sync`,deep=!1,timeout,throwOnTimeout}={}){let stop$1=null,watcher=new Promise(resolve$1=>{stop$1=watch(r$2,v$2=>{condition(v$2)!==isNot&&(stop$1?stop$1():nextTick(()=>stop$1?.()),resolve$1(v$2))},{flush,deep,immediate:!0})}),promises=[watcher];return timeout!=null&&promises.push(promiseTimeout(timeout,throwOnTimeout).then(()=>toValue$1(r$2)).finally(()=>stop$1?.())),Promise.race(promises)}function toBe(value$1,options$1){if(!isRef(value$1))return toMatch(v$2=>v$2===value$1,options$1);let{flush=`sync`,deep=!1,timeout,throwOnTimeout}=options$1??{},stop$1=null,watcher=new Promise(resolve$1=>{stop$1=watch([r$2,value$1],([v1,v2])=>{isNot!==(v1===v2)&&(stop$1?stop$1():nextTick(()=>stop$1?.()),resolve$1(v1))},{flush,deep,immediate:!0})}),promises=[watcher];return timeout!=null&&promises.push(promiseTimeout(timeout,throwOnTimeout).then(()=>toValue$1(r$2)).finally(()=>(stop$1?.(),toValue$1(r$2)))),Promise.race(promises)}function toBeTruthy(options$1){return toMatch(v$2=>!!v$2,options$1)}function toBeNull(options$1){return toBe(null,options$1)}function toBeUndefined(options$1){return toBe(void 0,options$1)}function toBeNaN(options$1){return toMatch(Number.isNaN,options$1)}function toContains(value$1,options$1){return toMatch(v$2=>{let array=Array.from(v$2);return array.includes(value$1)||array.includes(toValue$1(value$1))},options$1)}function changed(options$1){return changedTimes(1,options$1)}function changedTimes(n$2=1,options$1){let count$1=-1;return toMatch(()=>(count$1+=1,count$1>=n$2),options$1)}if(Array.isArray(toValue$1(r$2))){let instance={toMatch,toContains,changed,changedTimes,get not(){return createUntil(r$2,!isNot)}};return instance}else{let instance={toMatch,toBe,toBeTruthy,toBeNull,toBeNaN,toBeUndefined,changed,changedTimes,get not(){return createUntil(r$2,!isNot)}};return instance}}function until(r$2){return createUntil(r$2)}function useTimeoutFn(cb$1,interval,options$1={}){let{immediate=!0,immediateCallback=!1}=options$1,isPending=shallowRef(!1),timer;function clear(){timer&&(clearTimeout(timer),timer=void 0)}function stop$1(){isPending.value=!1,clear()}function start(...args){immediateCallback&&cb$1(),clear(),isPending.value=!0,timer=setTimeout(()=>{isPending.value=!1,timer=void 0,cb$1(...args)},toValue$1(interval))}return immediate&&(isPending.value=!0,isClient$2&&start()),tryOnScopeDispose(stop$1),{isPending:shallowReadonly(isPending),start,stop:stop$1}}function watchDebounced(source,cb$1,options$1={}){let{debounce=0,maxWait=void 0,...watchOptions}=options$1;return watchWithFilter(source,cb$1,{...watchOptions,eventFilter:debounceFilter(debounce,{maxWait})})}function watchImmediate(source,cb$1,options$1){return watch(source,cb$1,{...options$1,immediate:!0})}function computedAsync(evaluationCallback,initialState,optionsOrRef){let options$1;options$1=isRef(optionsOrRef)?{evaluating:optionsOrRef}:optionsOrRef||{};let{lazy=!1,flush=`pre`,evaluating=void 0,shallow=!0,onError=noop$3}=options$1,started=shallowRef(!lazy),current=shallow?shallowRef(initialState):ref(initialState),counter=0;return watchEffect(async onInvalidate=>{if(!started.value)return;counter++;let counterAtBeginning=counter,hasFinished=!1;evaluating&&Promise.resolve().then(()=>{evaluating.value=!0});try{let result=await evaluationCallback(cancelCallback=>{onInvalidate(()=>{evaluating&&(evaluating.value=!1),hasFinished||cancelCallback()})});counterAtBeginning===counter&&(current.value=result)}catch(e$3){onError(e$3)}finally{evaluating&&counterAtBeginning===counter&&(evaluating.value=!1),hasFinished=!0}},{flush}),lazy?computed(()=>(started.value=!0,current.value)):current}const defaultWindow$1=isClient$2?window:void 0,defaultDocument=isClient$2?window.document:void 0,defaultNavigator=isClient$2?window.navigator:void 0,defaultLocation=isClient$2?window.location:void 0;function unrefElement$1(elRef){var _a$3;let plain=toValue$1(elRef);return(_a$3=plain?.$el)??plain}function useEventListener$1(...args){let cleanups=[],cleanup=()=>{cleanups.forEach(fn$6=>fn$6()),cleanups.length=0},register=(el$1,event,listener,options$1)=>(el$1.addEventListener(event,listener,options$1),()=>el$1.removeEventListener(event,listener,options$1)),firstParamTargets=computed(()=>{let test$1=toArray(toValue$1(args[0])).filter(e$3=>e$3!=null);return test$1.every(e$3=>typeof e$3!=`string`)?test$1:void 0}),stopWatch=watchImmediate(()=>{var _a$3,_b;return[(_b=(_a$3=firstParamTargets.value)?.map(e$3=>unrefElement$1(e$3)))??[defaultWindow$1].filter(e$3=>e$3!=null),toArray(toValue$1(firstParamTargets.value?args[1]:args[0])),toArray(unref(firstParamTargets.value?args[2]:args[1])),toValue$1(firstParamTargets.value?args[3]:args[2])]},([raw_targets,raw_events,raw_listeners,raw_options])=>{if(cleanup(),!raw_targets?.length||!raw_events?.length||!raw_listeners?.length)return;let optionsClone=isObject$1(raw_options)?{...raw_options}:raw_options;cleanups.push(...raw_targets.flatMap(el$1=>raw_events.flatMap(event=>raw_listeners.map(listener=>register(el$1,event,listener,optionsClone)))))},{flush:`post`}),stop$1=()=>{stopWatch(),cleanup()};return tryOnScopeDispose(cleanup),stop$1}function useMounted$1(){let isMounted=shallowRef(!1),instance=getCurrentInstance();return instance&&onMounted(()=>{isMounted.value=!0},instance),isMounted}function useSupported(callback){let isMounted=useMounted$1();return computed(()=>(isMounted.value,!!callback()))}function useMutationObserver(target$1,callback,options$1={}){let{window:window$1=defaultWindow$1,...mutationOptions}=options$1,observer,isSupported=useSupported(()=>window$1&&`MutationObserver`in window$1),cleanup=()=>{observer&&(observer.disconnect(),observer=void 0)},targets=computed(()=>{let value$1=toValue$1(target$1),items=toArray(value$1).map(unrefElement$1).filter(notNullish);return new Set(items)}),stopWatch=watch(()=>targets.value,targets2=>{cleanup(),isSupported.value&&targets2.size&&(observer=new MutationObserver(callback),targets2.forEach(el$1=>observer.observe(el$1,mutationOptions)))},{immediate:!0,flush:`post`}),takeRecords=()=>observer?.takeRecords(),stop$1=()=>{stopWatch(),cleanup()};return tryOnScopeDispose(stop$1),{isSupported,stop:stop$1,takeRecords}}const ssrWidthSymbol=Symbol(`vueuse-ssr-width`);function useSSRWidth(){let ssrWidth=hasInjectionContext()?injectLocal(ssrWidthSymbol,null):null;return typeof ssrWidth==`number`?ssrWidth:void 0}function useMediaQuery(query,options$1={}){let{window:window$1=defaultWindow$1,ssrWidth=useSSRWidth()}=options$1,isSupported=useSupported(()=>window$1&&`matchMedia`in window$1&&typeof window$1.matchMedia==`function`),ssrSupport=shallowRef(typeof ssrWidth==`number`),mediaQuery=shallowRef(),matches$1=shallowRef(!1),handler=event=>{matches$1.value=event.matches};return watchEffect(()=>{if(ssrSupport.value){ssrSupport.value=!isSupported.value;let queryStrings=toValue$1(query).split(`,`);matches$1.value=queryStrings.some(queryString=>{let not=queryString.includes(`not all`),minWidth=queryString.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),maxWidth=queryString.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),res=!!(minWidth||maxWidth);return minWidth&&res&&(res=ssrWidth>=pxValue(minWidth[1])),maxWidth&&res&&(res=ssrWidth<=pxValue(maxWidth[1])),not?!res:res});return}isSupported.value&&(mediaQuery.value=window$1.matchMedia(toValue$1(query)),matches$1.value=mediaQuery.value.matches)}),useEventListener$1(mediaQuery,`change`,handler,{passive:!0}),computed(()=>matches$1.value)}const breakpointsTailwind={sm:640,md:768,lg:1024,xl:1280,"2xl":1536};function useBreakpoints(breakpoints,options$1={}){function getValue$2(k$4,delta){let v$2=toValue$1(breakpoints[toValue$1(k$4)]);return delta!=null&&(v$2=increaseWithUnit(v$2,delta)),typeof v$2==`number`&&(v$2=`${v$2}px`),v$2}let{window:window$1=defaultWindow$1,strategy=`min-width`,ssrWidth=useSSRWidth()}=options$1,ssrSupport=typeof ssrWidth==`number`,mounted=ssrSupport?shallowRef(!1):{value:!0};ssrSupport&&tryOnMounted(()=>mounted.value=!!window$1);function match(query,size$2){return!mounted.value&&ssrSupport?query===`min`?ssrWidth>=pxValue(size$2):ssrWidth<=pxValue(size$2):window$1?window$1.matchMedia(`(${query}-width: ${size$2})`).matches:!1}let greaterOrEqual=k$4=>useMediaQuery(()=>`(min-width: ${getValue$2(k$4)})`,options$1),smallerOrEqual=k$4=>useMediaQuery(()=>`(max-width: ${getValue$2(k$4)})`,options$1),shortcutMethods=Object.keys(breakpoints).reduce((shortcuts,k$4)=>(Object.defineProperty(shortcuts,k$4,{get:()=>strategy===`min-width`?greaterOrEqual(k$4):smallerOrEqual(k$4),enumerable:!0,configurable:!0}),shortcuts),{});function current(){let points=Object.keys(breakpoints).map(k$4=>[k$4,shortcutMethods[k$4],pxValue(getValue$2(k$4))]).sort((a$2,b$4)=>a$2[2]-b$4[2]);return computed(()=>points.filter(([,v$2])=>v$2.value).map(([k$4])=>k$4))}return Object.assign(shortcutMethods,{greaterOrEqual,smallerOrEqual,greater(k$4){return useMediaQuery(()=>`(min-width: ${getValue$2(k$4,.1)})`,options$1)},smaller(k$4){return useMediaQuery(()=>`(max-width: ${getValue$2(k$4,-.1)})`,options$1)},between(a$2,b$4){return useMediaQuery(()=>`(min-width: ${getValue$2(a$2)}) and (max-width: ${getValue$2(b$4,-.1)})`,options$1)},isGreater(k$4){return match(`min`,getValue$2(k$4,.1))},isGreaterOrEqual(k$4){return match(`min`,getValue$2(k$4))},isSmaller(k$4){return match(`max`,getValue$2(k$4,-.1))},isSmallerOrEqual(k$4){return match(`max`,getValue$2(k$4))},isInBetween(a$2,b$4){return match(`min`,getValue$2(a$2))&&match(`max`,getValue$2(b$4,-.1))},current,active(){let bps=current();return computed(()=>bps.value.length===0?``:bps.value.at(strategy===`min-width`?-1:0))}})}function usePermission(permissionDesc,options$1={}){let{controls=!1,navigator:navigator$1=defaultNavigator}=options$1,isSupported=useSupported(()=>navigator$1&&`permissions`in navigator$1),permissionStatus=shallowRef(),desc=typeof permissionDesc==`string`?{name:permissionDesc}:permissionDesc,state=shallowRef(),update=()=>{var _a$3,_b;state.value=(_b=(_a$3=permissionStatus.value)?.state)??`prompt`};useEventListener$1(permissionStatus,`change`,update,{passive:!0});let query=createSingletonPromise(async()=>{if(isSupported.value){if(!permissionStatus.value)try{permissionStatus.value=await navigator$1.permissions.query(desc)}catch{permissionStatus.value=void 0}finally{update()}if(controls)return toRaw(permissionStatus.value)}});return query(),controls?{state,isSupported,query}:state}function useClipboard(options$1={}){let{navigator:navigator$1=defaultNavigator,read=!1,source,copiedDuring=1500,legacy=!1}=options$1,isClipboardApiSupported=useSupported(()=>navigator$1&&`clipboard`in navigator$1),permissionRead=usePermission(`clipboard-read`),permissionWrite=usePermission(`clipboard-write`),isSupported=computed(()=>isClipboardApiSupported.value||legacy),text$5=shallowRef(``),copied=shallowRef(!1),timeout=useTimeoutFn(()=>copied.value=!1,copiedDuring,{immediate:!1});async function updateText(){let useLegacy=!(isClipboardApiSupported.value&&isAllowed(permissionRead.value));if(!useLegacy)try{text$5.value=await navigator$1.clipboard.readText()}catch{useLegacy=!0}useLegacy&&(text$5.value=legacyRead())}isSupported.value&&read&&useEventListener$1([`copy`,`cut`],updateText,{passive:!0});async function copy(value$1=toValue$1(source)){if(isSupported.value&&value$1!=null){let useLegacy=!(isClipboardApiSupported.value&&isAllowed(permissionWrite.value));if(!useLegacy)try{await navigator$1.clipboard.writeText(value$1)}catch{useLegacy=!0}useLegacy&&legacyCopy(value$1),text$5.value=value$1,copied.value=!0,timeout.start()}}function legacyCopy(value$1){let ta$1=document.createElement(`textarea`);ta$1.value=value$1??``,ta$1.style.position=`absolute`,ta$1.style.opacity=`0`,document.body.appendChild(ta$1),ta$1.select(),document.execCommand(`copy`),ta$1.remove()}function legacyRead(){var _a$3,_b,_c$1;return(_c$1=(_b=(_a$3=document==null?void 0:document.getSelection)?.call(document))?.toString())??``}function isAllowed(status){return status===`granted`||status===`prompt`}return{isSupported,text:text$5,copied,copy}}const _global$1=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{},globalKey=`__vueuse_ssr_handlers__`,handlers$2=getHandlers();function getHandlers(){return globalKey in _global$1||(_global$1[globalKey]=_global$1[globalKey]||{}),_global$1[globalKey]}function getSSRHandler(key$2,fallback){return handlers$2[key$2]||fallback}function usePreferredDark(options$1){return useMediaQuery(`(prefers-color-scheme: dark)`,options$1)}function guessSerializerType(rawInit){return rawInit==null?`any`:rawInit instanceof Set?`set`:rawInit instanceof Map?`map`:rawInit instanceof Date?`date`:typeof rawInit==`boolean`?`boolean`:typeof rawInit==`string`?`string`:typeof rawInit==`object`?`object`:Number.isNaN(rawInit)?`any`:`number`}const StorageSerializers={boolean:{read:v$2=>v$2===`true`,write:v$2=>String(v$2)},object:{read:v$2=>JSON.parse(v$2),write:v$2=>JSON.stringify(v$2)},number:{read:v$2=>Number.parseFloat(v$2),write:v$2=>String(v$2)},any:{read:v$2=>v$2,write:v$2=>String(v$2)},string:{read:v$2=>v$2,write:v$2=>String(v$2)},map:{read:v$2=>new Map(JSON.parse(v$2)),write:v$2=>JSON.stringify(Array.from(v$2.entries()))},set:{read:v$2=>new Set(JSON.parse(v$2)),write:v$2=>JSON.stringify(Array.from(v$2))},date:{read:v$2=>new Date(v$2),write:v$2=>v$2.toISOString()}},customStorageEventName=`vueuse-storage`;function useStorage(key$2,defaults$1,storage,options$1={}){var _a$3;let{flush=`pre`,deep=!0,listenToStorageChanges=!0,writeDefaults=!0,mergeDefaults:mergeDefaults$1=!1,shallow,window:window$1=defaultWindow$1,eventFilter,onError=e$3=>{console.error(e$3)},initOnMounted}=options$1,data$12=(shallow?shallowRef:ref)(typeof defaults$1==`function`?defaults$1():defaults$1),keyComputed=computed(()=>toValue$1(key$2));if(!storage)try{storage=getSSRHandler(`getDefaultStorage`,()=>{var _a2;return(_a2=defaultWindow$1)?.localStorage})()}catch(e$3){onError(e$3)}if(!storage)return data$12;let rawInit=toValue$1(defaults$1),type=guessSerializerType(rawInit),serializer$1=(_a$3=options$1.serializer)??StorageSerializers[type],{pause:pauseWatch,resume:resumeWatch}=watchPausable(data$12,()=>write(data$12.value),{flush,deep,eventFilter});watch(keyComputed,()=>update(),{flush});let firstMounted=!1,onStorageEvent=ev$1=>{initOnMounted&&!firstMounted||update(ev$1)},onStorageCustomEvent=ev$1=>{initOnMounted&&!firstMounted||updateFromCustomEvent(ev$1)};window$1&&listenToStorageChanges&&(storage instanceof Storage?useEventListener$1(window$1,`storage`,onStorageEvent,{passive:!0}):useEventListener$1(window$1,customStorageEventName,onStorageCustomEvent)),initOnMounted?tryOnMounted(()=>{firstMounted=!0,update()}):update();function dispatchWriteEvent(oldValue,newValue){if(window$1){let payload={key:keyComputed.value,oldValue,newValue,storageArea:storage};window$1.dispatchEvent(storage instanceof Storage?new StorageEvent(`storage`,payload):new CustomEvent(customStorageEventName,{detail:payload}))}}function write(v$2){try{let oldValue=storage.getItem(keyComputed.value);if(v$2==null)dispatchWriteEvent(oldValue,null),storage.removeItem(keyComputed.value);else{let serialized=serializer$1.write(v$2);oldValue!==serialized&&(storage.setItem(keyComputed.value,serialized),dispatchWriteEvent(oldValue,serialized))}}catch(e$3){onError(e$3)}}function read(event){let rawValue=event?event.newValue:storage.getItem(keyComputed.value);if(rawValue==null)return writeDefaults&&rawInit!=null&&storage.setItem(keyComputed.value,serializer$1.write(rawInit)),rawInit;if(!event&&mergeDefaults$1){let value$1=serializer$1.read(rawValue);return typeof mergeDefaults$1==`function`?mergeDefaults$1(value$1,rawInit):type===`object`&&!Array.isArray(value$1)?{...rawInit,...value$1}:value$1}else if(typeof rawValue!=`string`)return rawValue;else return serializer$1.read(rawValue)}function update(event){if(!(event&&event.storageArea!==storage)){if(event&&event.key==null){data$12.value=rawInit;return}if(!(event&&event.key!==keyComputed.value)){pauseWatch();try{event?.newValue!==serializer$1.write(data$12.value)&&(data$12.value=read(event))}catch(e$3){onError(e$3)}finally{event?nextTick(resumeWatch):resumeWatch()}}}}function updateFromCustomEvent(event){update(event.detail)}return data$12}const CSS_DISABLE_TRANS=`*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}`;function useColorMode(options$1={}){let{selector=`html`,attribute=`class`,initialValue=`auto`,window:window$1=defaultWindow$1,storage,storageKey=`vueuse-color-scheme`,listenToStorageChanges=!0,storageRef,emitAuto,disableTransition=!0}=options$1,modes$1={auto:``,light:`light`,dark:`dark`,...options$1.modes||{}},preferredDark=usePreferredDark({window:window$1}),system=computed(()=>preferredDark.value?`dark`:`light`),store=storageRef||(storageKey==null?toRef$1(initialValue):useStorage(storageKey,initialValue,storage,{window:window$1,listenToStorageChanges})),state=computed(()=>store.value===`auto`?system.value:store.value),updateHTMLAttrs=getSSRHandler(`updateHTMLAttrs`,(selector2,attribute2,value$1)=>{let el$1=typeof selector2==`string`?window$1?.document.querySelector(selector2):unrefElement$1(selector2);if(!el$1)return;let classesToAdd=new Set,classesToRemove=new Set,attributeToChange=null;if(attribute2===`class`){let current=value$1.split(/\s/g);Object.values(modes$1).flatMap(i$1=>(i$1||``).split(/\s/g)).filter(Boolean).forEach(v$2=>{current.includes(v$2)?classesToAdd.add(v$2):classesToRemove.add(v$2)})}else attributeToChange={key:attribute2,value:value$1};if(classesToAdd.size===0&&classesToRemove.size===0&&attributeToChange===null)return;let style;disableTransition&&(style=window$1.document.createElement(`style`),style.appendChild(document.createTextNode(CSS_DISABLE_TRANS)),window$1.document.head.appendChild(style));for(let c$4 of classesToAdd)el$1.classList.add(c$4);for(let c$4 of classesToRemove)el$1.classList.remove(c$4);attributeToChange&&el$1.setAttribute(attributeToChange.key,attributeToChange.value),disableTransition&&(window$1.getComputedStyle(style).opacity,document.head.removeChild(style))});function defaultOnChanged(mode){var _a$3;updateHTMLAttrs(selector,attribute,(_a$3=modes$1[mode])??mode)}function onChanged(mode){options$1.onChanged?options$1.onChanged(mode,defaultOnChanged):defaultOnChanged(mode)}watch(state,onChanged,{flush:`post`,immediate:!0}),tryOnMounted(()=>onChanged(state.value));let auto=computed({get(){return emitAuto?store.value:state.value},set(v$2){store.value=v$2}});return Object.assign(auto,{store,system,state})}function useCssVar(prop,target$1,options$1={}){let{window:window$1=defaultWindow$1,initialValue,observe=!1}=options$1,variable=shallowRef(initialValue),elRef=computed(()=>{var _a$3;return unrefElement$1(target$1)||(_a$3=window$1?.document)?.documentElement});function updateCssVar(){var _a$3;let key$2=toValue$1(prop),el$1=toValue$1(elRef);if(el$1&&window$1&&key$2){let value$1=(_a$3=window$1.getComputedStyle(el$1).getPropertyValue(key$2))?.trim();variable.value=value$1||variable.value||initialValue}}return observe&&useMutationObserver(elRef,updateCssVar,{attributeFilter:[`style`,`class`],window:window$1}),watch([elRef,()=>toValue$1(prop)],(_$2,old)=>{old[0]&&old[1]&&old[0].style.removeProperty(old[1]),updateCssVar()},{immediate:!0}),watch([variable,elRef],([val,el$1])=>{let raw_prop=toValue$1(prop);el$1?.style&&raw_prop&&(val==null?el$1.style.removeProperty(raw_prop):el$1.style.setProperty(raw_prop,val))},{immediate:!0}),variable}function useDark(options$1={}){let{valueDark=`dark`,valueLight=``}=options$1,mode=useColorMode({...options$1,onChanged:(mode2,defaultHandler)=>{var _a$3;options$1.onChanged?(_a$3=options$1.onChanged)==null||_a$3.call(options$1,mode2===`dark`,defaultHandler,mode2):defaultHandler(mode2)},modes:{dark:valueDark,light:valueLight}}),system=computed(()=>mode.system.value),isDark=computed({get(){return mode.value===`dark`},set(v$2){let modeVal=v$2?`dark`:`light`;system.value===modeVal?mode.value=`auto`:mode.value=modeVal}});return isDark}function useDevicesList(options$1={}){let{navigator:navigator$1=defaultNavigator,requestPermissions=!1,constraints={audio:!0,video:!0},onUpdated:onUpdated$1}=options$1,devices=ref([]),videoInputs=computed(()=>devices.value.filter(i$1=>i$1.kind===`videoinput`)),audioInputs=computed(()=>devices.value.filter(i$1=>i$1.kind===`audioinput`)),audioOutputs=computed(()=>devices.value.filter(i$1=>i$1.kind===`audiooutput`)),isSupported=useSupported(()=>navigator$1&&navigator$1.mediaDevices&&navigator$1.mediaDevices.enumerateDevices),permissionGranted=shallowRef(!1),stream;async function update(){isSupported.value&&(devices.value=await navigator$1.mediaDevices.enumerateDevices(),onUpdated$1?.(devices.value),stream&&(stream.getTracks().forEach(t=>t.stop()),stream=null))}async function ensurePermissions(){let deviceName=constraints.video?`camera`:`microphone`;if(!isSupported.value)return!1;if(permissionGranted.value)return!0;let{state,query}=usePermission(deviceName,{controls:!0});if(await query(),state.value!==`granted`){let granted=!0;try{let allDevices=await navigator$1.mediaDevices.enumerateDevices(),hasCamera=allDevices.some(device=>device.kind===`videoinput`),hasMicrophone=allDevices.some(device=>device.kind===`audioinput`||device.kind===`audiooutput`);constraints.video=hasCamera?constraints.video:!1,constraints.audio=hasMicrophone?constraints.audio:!1,stream=await navigator$1.mediaDevices.getUserMedia(constraints)}catch{stream=null,granted=!1}update(),permissionGranted.value=granted}else permissionGranted.value=!0;return permissionGranted.value}return isSupported.value&&(requestPermissions&&ensurePermissions(),useEventListener$1(navigator$1.mediaDevices,`devicechange`,update,{passive:!0}),update()),{devices,ensurePermissions,permissionGranted,videoInputs,audioInputs,audioOutputs,isSupported}}function useResizeObserver(target$1,callback,options$1={}){let{window:window$1=defaultWindow$1,...observerOptions}=options$1,observer,isSupported=useSupported(()=>window$1&&`ResizeObserver`in window$1),cleanup=()=>{observer&&(observer.disconnect(),observer=void 0)},targets=computed(()=>{let _targets=toValue$1(target$1);return Array.isArray(_targets)?_targets.map(el$1=>unrefElement$1(el$1)):[unrefElement$1(_targets)]}),stopWatch=watch(targets,els=>{if(cleanup(),isSupported.value&&window$1){observer=new ResizeObserver(callback);for(let _el of els)_el&&observer.observe(_el,observerOptions)}},{immediate:!0,flush:`post`}),stop$1=()=>{cleanup(),stopWatch()};return tryOnScopeDispose(stop$1),{isSupported,stop:stop$1}}function useElementBounding(target$1,options$1={}){let{reset=!0,windowResize=!0,windowScroll=!0,immediate=!0,updateTiming=`sync`}=options$1,height=shallowRef(0),bottom=shallowRef(0),left=shallowRef(0),right=shallowRef(0),top=shallowRef(0),width=shallowRef(0),x$3=shallowRef(0),y$3=shallowRef(0);function recalculate(){let el$1=unrefElement$1(target$1);if(!el$1){reset&&(height.value=0,bottom.value=0,left.value=0,right.value=0,top.value=0,width.value=0,x$3.value=0,y$3.value=0);return}let rect=el$1.getBoundingClientRect();height.value=rect.height,bottom.value=rect.bottom,left.value=rect.left,right.value=rect.right,top.value=rect.top,width.value=rect.width,x$3.value=rect.x,y$3.value=rect.y}function update(){updateTiming===`sync`?recalculate():updateTiming===`next-frame`&&requestAnimationFrame(()=>recalculate())}return useResizeObserver(target$1,update),watch(()=>unrefElement$1(target$1),ele=>!ele&&update()),useMutationObserver(target$1,update,{attributeFilter:[`style`,`class`]}),windowScroll&&useEventListener$1(`scroll`,update,{capture:!0,passive:!0}),windowResize&&useEventListener$1(`resize`,update,{passive:!0}),tryOnMounted(()=>{immediate&&update()}),{height,bottom,left,right,top,width,x:x$3,y:y$3,update}}function useIntersectionObserver(target$1,callback,options$1={}){let{root:root$3,rootMargin=`0px`,threshold=0,window:window$1=defaultWindow$1,immediate=!0}=options$1,isSupported=useSupported(()=>window$1&&`IntersectionObserver`in window$1),targets=computed(()=>{let _target$1=toValue$1(target$1);return toArray(_target$1).map(unrefElement$1).filter(notNullish)}),cleanup=noop$3,isActive=shallowRef(immediate),stopWatch=isSupported.value?watch(()=>[targets.value,unrefElement$1(root$3),isActive.value],([targets2,root2])=>{if(cleanup(),!isActive.value||!targets2.length)return;let observer=new IntersectionObserver(callback,{root:unrefElement$1(root2),rootMargin,threshold});targets2.forEach(el$1=>el$1&&observer.observe(el$1)),cleanup=()=>{observer.disconnect(),cleanup=noop$3}},{immediate,flush:`post`}):noop$3,stop$1=()=>{cleanup(),stopWatch(),isActive.value=!1};return tryOnScopeDispose(stop$1),{isSupported,isActive,pause(){cleanup(),isActive.value=!1},resume(){isActive.value=!0},stop:stop$1}}const DEFAULT_OPTIONS={multiple:!0,accept:`*`,reset:!1,directory:!1};function prepareInitialFiles(files){if(!files)return null;if(files instanceof FileList)return files;let dt$5=new DataTransfer;for(let file of files)dt$5.items.add(file);return dt$5.files}function useFileDialog(options$1={}){let{document:document$3=defaultDocument}=options$1,files=ref(prepareInitialFiles(options$1.initialFiles)),{on:onChange,trigger:changeTrigger}=createEventHook(),{on:onCancel,trigger:cancelTrigger}=createEventHook(),input;document$3&&(input=unrefElement$1(options$1.input)||document$3.createElement(`input`),input.type=`file`,input.onchange=event=>{let result=event.target;files.value=result.files,changeTrigger(files.value)},input.oncancel=()=>{cancelTrigger()});let reset=()=>{files.value=null,input&&input.value&&(input.value=``,changeTrigger(null))},open$1=localOptions=>{if(!input)return;let _options={...DEFAULT_OPTIONS,...options$1,...localOptions};input.multiple=_options.multiple,input.accept=_options.accept,input.webkitdirectory=_options.directory,hasOwn$2(_options,`capture`)&&(input.capture=_options.capture),_options.reset&&reset(),input.click()};return{files:readonly(files),open:open$1,reset,onCancel,onChange}}function useLocalStorage(key$2,initialValue,options$1={}){let{window:window$1=defaultWindow$1}=options$1;return useStorage(key$2,initialValue,window$1?.localStorage,options$1)}const UseMouseBuiltinExtractors={page:event=>[event.pageX,event.pageY],client:event=>[event.clientX,event.clientY],screen:event=>[event.screenX,event.screenY],movement:event=>event instanceof MouseEvent?[event.movementX,event.movementY]:null};function useMouse(options$1={}){let{type=`page`,touch=!0,resetOnTouchEnds=!1,initialValue={x:0,y:0},window:window$1=defaultWindow$1,target:target$1=window$1,scroll=!0,eventFilter}=options$1,_prevMouseEvent=null,_prevScrollX=0,_prevScrollY=0,x$3=shallowRef(initialValue.x),y$3=shallowRef(initialValue.y),sourceType=shallowRef(null),extractor=typeof type==`function`?type:UseMouseBuiltinExtractors[type],mouseHandler=event=>{let result=extractor(event);_prevMouseEvent=event,result&&([x$3.value,y$3.value]=result,sourceType.value=`mouse`),window$1&&(_prevScrollX=window$1.scrollX,_prevScrollY=window$1.scrollY)},touchHandler=event=>{if(event.touches.length>0){let result=extractor(event.touches[0]);result&&([x$3.value,y$3.value]=result,sourceType.value=`touch`)}},scrollHandler=()=>{if(!_prevMouseEvent||!window$1)return;let pos=extractor(_prevMouseEvent);_prevMouseEvent instanceof MouseEvent&&pos&&(x$3.value=pos[0]+window$1.scrollX-_prevScrollX,y$3.value=pos[1]+window$1.scrollY-_prevScrollY)},reset=()=>{x$3.value=initialValue.x,y$3.value=initialValue.y},mouseHandlerWrapper=eventFilter?event=>eventFilter(()=>mouseHandler(event),{}):event=>mouseHandler(event),touchHandlerWrapper=eventFilter?event=>eventFilter(()=>touchHandler(event),{}):event=>touchHandler(event),scrollHandlerWrapper=eventFilter?()=>eventFilter(()=>scrollHandler(),{}):()=>scrollHandler();if(target$1){let listenerOptions={passive:!0};useEventListener$1(target$1,[`mousemove`,`dragover`],mouseHandlerWrapper,listenerOptions),touch&&type!==`movement`&&(useEventListener$1(target$1,[`touchstart`,`touchmove`],touchHandlerWrapper,listenerOptions),resetOnTouchEnds&&useEventListener$1(target$1,`touchend`,reset,listenerOptions)),scroll&&type===`page`&&useEventListener$1(window$1,`scroll`,scrollHandlerWrapper,listenerOptions)}return{x:x$3,y:y$3,sourceType}}function useObjectUrl(object){let url=shallowRef(),release=()=>{url.value&&URL.revokeObjectURL(url.value),url.value=void 0};return watch(()=>toValue$1(object),newObject=>{release(),newObject&&(url.value=URL.createObjectURL(newObject))},{immediate:!0}),tryOnScopeDispose(release),readonly(url)}const defaultState={x:0,y:0,pointerId:0,pressure:0,tiltX:0,tiltY:0,width:0,height:0,twist:0,pointerType:null},keys$1=Object.keys(defaultState);function usePointer(options$1={}){let{target:target$1=defaultWindow$1}=options$1,isInside=shallowRef(!1),state=ref(options$1.initialValue||{});Object.assign(state.value,defaultState,state.value);let handler=event=>{isInside.value=!0,!(options$1.pointerTypes&&!options$1.pointerTypes.includes(event.pointerType))&&(state.value=objectPick(event,keys$1,!1))};if(target$1){let listenerOptions={passive:!0};useEventListener$1(target$1,[`pointerdown`,`pointermove`,`pointerup`],handler,listenerOptions),useEventListener$1(target$1,`pointerleave`,()=>isInside.value=!1,listenerOptions)}return{...toRefs$1(state),isInside}}const topVarName=`--vueuse-safe-area-top`,rightVarName=`--vueuse-safe-area-right`,bottomVarName=`--vueuse-safe-area-bottom`,leftVarName=`--vueuse-safe-area-left`;function useScreenSafeArea(){let top=shallowRef(``),right=shallowRef(``),bottom=shallowRef(``),left=shallowRef(``);if(isClient$2){let topCssVar=useCssVar(topVarName),rightCssVar=useCssVar(rightVarName),bottomCssVar=useCssVar(bottomVarName),leftCssVar=useCssVar(leftVarName);topCssVar.value=`env(safe-area-inset-top, 0px)`,rightCssVar.value=`env(safe-area-inset-right, 0px)`,bottomCssVar.value=`env(safe-area-inset-bottom, 0px)`,leftCssVar.value=`env(safe-area-inset-left, 0px)`,tryOnMounted(update),useEventListener$1(`resize`,useDebounceFn(update),{passive:!0})}function update(){top.value=getValue(topVarName),right.value=getValue(rightVarName),bottom.value=getValue(bottomVarName),left.value=getValue(leftVarName)}return{top,right,bottom,left,update}}function getValue(position$2){return getComputedStyle(document.documentElement).getPropertyValue(position$2)}const DEFAULT_UNITS=[{max:6e4,value:1e3,name:`second`},{max:276e4,value:6e4,name:`minute`},{max:72e6,value:36e5,name:`hour`},{max:5184e5,value:864e5,name:`day`},{max:24192e5,value:6048e5,name:`week`},{max:28512e6,value:2592e6,name:`month`},{max:1/0,value:31536e6,name:`year`}];function useUserMedia(options$1={}){var _a$3,_b;let enabled$1=shallowRef((_a$3=options$1.enabled)??!1),autoSwitch=shallowRef((_b=options$1.autoSwitch)??!0),constraints=ref(options$1.constraints),{navigator:navigator$1=defaultNavigator}=options$1,isSupported=useSupported(()=>{var _a2;return(_a2=navigator$1?.mediaDevices)?.getUserMedia}),stream=shallowRef();function getDeviceOptions(type){switch(type){case`video`:if(constraints.value)return constraints.value.video||!1;break;case`audio`:if(constraints.value)return constraints.value.audio||!1;break}}async function _start$1(){if(!(!isSupported.value||stream.value))return stream.value=await navigator$1.mediaDevices.getUserMedia({video:getDeviceOptions(`video`),audio:getDeviceOptions(`audio`)}),stream.value}function _stop(){var _a2;(_a2=stream.value)==null||_a2.getTracks().forEach(t=>t.stop()),stream.value=void 0}function stop$1(){_stop(),enabled$1.value=!1}async function start(){return await _start$1(),stream.value&&(enabled$1.value=!0),stream.value}async function restart(){return _stop(),await start()}return watch(enabled$1,v$2=>{v$2?_start$1():_stop()},{immediate:!0}),watch(constraints,()=>{autoSwitch.value&&stream.value&&restart()},{immediate:!0}),tryOnScopeDispose(()=>{stop$1()}),{isSupported,stream,start,stop:stop$1,restart,constraints,enabled:enabled$1,autoSwitch}}function useWebWorker(arg0,workerOptions,options$1){let{window:window$1=defaultWindow$1}=options$1??{},data$12=ref(null),worker=shallowRef(),post=(...args)=>{worker.value&&worker.value.postMessage(...args)},terminate=function(){worker.value&&worker.value.terminate()};return window$1&&(typeof arg0==`string`?worker.value=new Worker(arg0,workerOptions):typeof arg0==`function`?worker.value=arg0():worker.value=arg0,worker.value.onmessage=e$3=>{data$12.value=e$3.data},tryOnScopeDispose(()=>{worker.value&&worker.value.terminate()})),{data:data$12,post,terminate,worker}}function useWindowSize(options$1={}){let{window:window$1=defaultWindow$1,initialWidth=1/0,initialHeight=1/0,listenOrientation=!0,includeScrollbar=!0,type=`inner`}=options$1,width=shallowRef(initialWidth),height=shallowRef(initialHeight),update=()=>{if(window$1)if(type===`outer`)width.value=window$1.outerWidth,height.value=window$1.outerHeight;else if(type===`visual`&&window$1.visualViewport){let{width:visualViewportWidth,height:visualViewportHeight,scale:scale$1}=window$1.visualViewport;width.value=Math.round(visualViewportWidth*scale$1),height.value=Math.round(visualViewportHeight*scale$1)}else includeScrollbar?(width.value=window$1.innerWidth,height.value=window$1.innerHeight):(width.value=window$1.document.documentElement.clientWidth,height.value=window$1.document.documentElement.clientHeight)};update(),tryOnMounted(update);let listenerOptions={passive:!0};if(useEventListener$1(`resize`,update,listenerOptions),window$1&&type===`visual`&&window$1.visualViewport&&useEventListener$1(window$1.visualViewport,`resize`,update,listenerOptions),listenOrientation){let matches$1=useMediaQuery(`(orientation: portrait)`);watch(matches$1,()=>update())}return{width,height}}const defaultTimestep=1/60*1e3,getCurrentTime=typeof performance<`u`?()=>performance.now():()=>Date.now(),onNextFrame=typeof window<`u`?callback=>window.requestAnimationFrame(callback):callback=>setTimeout(()=>callback(getCurrentTime()),defaultTimestep);function createRenderStep(runNextFrame$1){let toRun=[],toRunNextFrame=[],numToRun=0,isProcessing$1=!1,flushNextFrame=!1,toKeepAlive=new WeakSet,step={schedule:(callback,keepAlive=!1,immediate=!1)=>{let addToCurrentFrame=immediate&&isProcessing$1,buffer$1=addToCurrentFrame?toRun:toRunNextFrame;return keepAlive&&toKeepAlive.add(callback),buffer$1.indexOf(callback)===-1&&(buffer$1.push(callback),addToCurrentFrame&&isProcessing$1&&(numToRun=toRun.length)),callback},cancel:callback=>{let index$1=toRunNextFrame.indexOf(callback);index$1!==-1&&toRunNextFrame.splice(index$1,1),toKeepAlive.delete(callback)},process:frameData=>{if(isProcessing$1){flushNextFrame=!0;return}if(isProcessing$1=!0,[toRun,toRunNextFrame]=[toRunNextFrame,toRun],toRunNextFrame.length=0,numToRun=toRun.length,numToRun)for(let i$1=0;i$1(acc[key$2]=createRenderStep(()=>runNextFrame=!0),acc),{}),sync$1=stepsOrder.reduce((acc,key$2)=>{let step=steps$1[key$2];return acc[key$2]=(process$1,keepAlive=!1,immediate=!1)=>(runNextFrame||startLoop(),step.schedule(process$1,keepAlive,immediate)),acc},{}),cancelSync=stepsOrder.reduce((acc,key$2)=>(acc[key$2]=steps$1[key$2].cancel,acc),{}),flushSync=stepsOrder.reduce((acc,key$2)=>(acc[key$2]=()=>steps$1[key$2].process(frame),acc),{}),processStep=stepId=>steps$1[stepId].process(frame),processFrame=timestamp$2=>{runNextFrame=!1,frame.delta=useDefaultElapsed?defaultTimestep:Math.max(Math.min(timestamp$2-frame.timestamp,maxElapsed),1),frame.timestamp=timestamp$2,isProcessing=!0,stepsOrder.forEach(processStep),isProcessing=!1,runNextFrame&&(useDefaultElapsed=!1,onNextFrame(processFrame))},startLoop=()=>{runNextFrame=!0,useDefaultElapsed=!0,isProcessing||onNextFrame(processFrame)},getFrameData=()=>frame;var es_default=sync$1;function __rest(s$1,e$3){var t={};for(var p$5 in s$1)Object.prototype.hasOwnProperty.call(s$1,p$5)&&e$3.indexOf(p$5)<0&&(t[p$5]=s$1[p$5]);if(s$1!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i$1=0,p$5=Object.getOwnPropertySymbols(s$1);i$1Math.min(Math.max(v$2,min$1),max$1),safeMin=.001,minDuration=.01,maxDuration=10,minDamping=.05,maxDamping=1;function findSpring({duration=800,bounce=.25,velocity=0,mass=1}){let envelope,derivative;warning(duration<=maxDuration*1e3,`Spring duration must be 10 seconds or less`);let dampingRatio=1-bounce;dampingRatio=clamp$3(minDamping,maxDamping,dampingRatio),duration=clamp$3(minDuration,maxDuration,duration/1e3),dampingRatio<1?(envelope=undampedFreq$1=>{let exponentialDecay=undampedFreq$1*dampingRatio,delta=exponentialDecay*duration,a$2=exponentialDecay-velocity,b$4=calcAngularFreq(undampedFreq$1,dampingRatio),c$4=Math.exp(-delta);return safeMin-a$2/b$4*c$4},derivative=undampedFreq$1=>{let exponentialDecay=undampedFreq$1*dampingRatio,delta=exponentialDecay*duration,d$2=delta*velocity+velocity,e$3=dampingRatio**2*undampedFreq$1**2*duration,f$3=Math.exp(-delta),g$2=calcAngularFreq(undampedFreq$1**2,dampingRatio),factor$1=-envelope(undampedFreq$1)+safeMin>0?-1:1;return factor$1*((d$2-e$3)*f$3)/g$2}):(envelope=undampedFreq$1=>{let a$2=Math.exp(-undampedFreq$1*duration),b$4=(undampedFreq$1-velocity)*duration+1;return-safeMin+a$2*b$4},derivative=undampedFreq$1=>{let a$2=Math.exp(-undampedFreq$1*duration),b$4=(velocity-undampedFreq$1)*(duration*duration);return a$2*b$4});let initialGuess=5/duration,undampedFreq=approximateRoot(envelope,derivative,initialGuess);if(duration*=1e3,isNaN(undampedFreq))return{stiffness:100,damping:10,duration};{let stiffness=undampedFreq**2*mass;return{stiffness,damping:dampingRatio*2*Math.sqrt(mass*stiffness),duration}}}const rootIterations=12;function approximateRoot(envelope,derivative,initialGuess){let result=initialGuess;for(let i$1=1;i$1options$1[key$2]!==void 0)}function getSpringOptions(options$1){let springOptions=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},options$1);if(!isSpringType(options$1,physicsKeys)&&isSpringType(options$1,durationKeys)){let derived=findSpring(options$1);springOptions=Object.assign(Object.assign(Object.assign({},springOptions),derived),{velocity:0,mass:1}),springOptions.isResolvedFromDuration=!0}return springOptions}function spring(_a$3){var{from=0,to:to$2=1,restSpeed=2,restDelta}=_a$3,options$1=__rest(_a$3,[`from`,`to`,`restSpeed`,`restDelta`]);let state={done:!1,value:from},{stiffness,damping,mass,velocity,duration,isResolvedFromDuration}=getSpringOptions(options$1),resolveSpring=zero,resolveVelocity=zero;function createSpring(){let initialVelocity=velocity?-(velocity/1e3):0,initialDelta=to$2-from,dampingRatio=damping/(2*Math.sqrt(stiffness*mass)),undampedAngularFreq=Math.sqrt(stiffness/mass)/1e3;if(restDelta===void 0&&(restDelta=Math.min(Math.abs(to$2-from)/100,.4)),dampingRatio<1){let angularFreq=calcAngularFreq(undampedAngularFreq,dampingRatio);resolveSpring=t=>{let envelope=Math.exp(-dampingRatio*undampedAngularFreq*t);return to$2-envelope*((initialVelocity+dampingRatio*undampedAngularFreq*initialDelta)/angularFreq*Math.sin(angularFreq*t)+initialDelta*Math.cos(angularFreq*t))},resolveVelocity=t=>{let envelope=Math.exp(-dampingRatio*undampedAngularFreq*t);return dampingRatio*undampedAngularFreq*envelope*(Math.sin(angularFreq*t)*(initialVelocity+dampingRatio*undampedAngularFreq*initialDelta)/angularFreq+initialDelta*Math.cos(angularFreq*t))-envelope*(Math.cos(angularFreq*t)*(initialVelocity+dampingRatio*undampedAngularFreq*initialDelta)-angularFreq*initialDelta*Math.sin(angularFreq*t))}}else if(dampingRatio===1)resolveSpring=t=>to$2-Math.exp(-undampedAngularFreq*t)*(initialDelta+(initialVelocity+undampedAngularFreq*initialDelta)*t);else{let dampedAngularFreq=undampedAngularFreq*Math.sqrt(dampingRatio*dampingRatio-1);resolveSpring=t=>{let envelope=Math.exp(-dampingRatio*undampedAngularFreq*t),freqForT=Math.min(dampedAngularFreq*t,300);return to$2-envelope*((initialVelocity+dampingRatio*undampedAngularFreq*initialDelta)*Math.sinh(freqForT)+dampedAngularFreq*initialDelta*Math.cosh(freqForT))/dampedAngularFreq}}}return createSpring(),{next:t=>{let current=resolveSpring(t);if(isResolvedFromDuration)state.done=t>=duration;else{let currentVelocity=resolveVelocity(t)*1e3,isBelowVelocityThreshold=Math.abs(currentVelocity)<=restSpeed,isBelowDisplacementThreshold=Math.abs(to$2-current)<=restDelta;state.done=isBelowVelocityThreshold&&isBelowDisplacementThreshold}return state.value=state.done?to$2:current,state},flipTarget:()=>{velocity=-velocity,[from,to$2]=[to$2,from],createSpring()}}}spring.needsInterpolation=(a$2,b$4)=>typeof a$2==`string`||typeof b$4==`string`;const zero=_t$4=>0,progress=(from,to$2,value$1)=>{let toFromDifference=to$2-from;return toFromDifference===0?1:(value$1-from)/toFromDifference},mix=(from,to$2,progress$1)=>-progress$1*from+progress$1*to$2+from,clamp$4=(min$1,max$1)=>v$2=>Math.max(Math.min(v$2,max$1),min$1),sanitize=v$2=>v$2%1?Number(v$2.toFixed(5)):v$2,floatRegex=/(-)?([\d]*\.?[\d])+/g,colorRegex=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,singleColorRegex=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function isString$1(v$2){return typeof v$2==`string`}const number$2={test:v$2=>typeof v$2==`number`,parse:parseFloat,transform:v$2=>v$2},alpha=Object.assign(Object.assign({},number$2),{transform:clamp$4(0,1)}),scale=Object.assign(Object.assign({},number$2),{default:1}),createUnitType=unit=>({test:v$2=>isString$1(v$2)&&v$2.endsWith(unit)&&v$2.split(` `).length===1,parse:parseFloat,transform:v$2=>`${v$2}${unit}`}),degrees=createUnitType(`deg`),percent=createUnitType(`%`),px=createUnitType(`px`),vh$1=createUnitType(`vh`),vw=createUnitType(`vw`),progressPercentage=Object.assign(Object.assign({},percent),{parse:v$2=>percent.parse(v$2)/100,transform:v$2=>percent.transform(v$2*100)}),isColorString=(type,testProp)=>v$2=>!!(isString$1(v$2)&&singleColorRegex.test(v$2)&&v$2.startsWith(type)||testProp&&Object.prototype.hasOwnProperty.call(v$2,testProp)),splitColor=(aName,bName,cName)=>v$2=>{if(!isString$1(v$2))return v$2;let[a$2,b$4,c$4,alpha$1]=v$2.match(floatRegex);return{[aName]:parseFloat(a$2),[bName]:parseFloat(b$4),[cName]:parseFloat(c$4),alpha:alpha$1===void 0?1:parseFloat(alpha$1)}},hsla={test:isColorString(`hsl`,`hue`),parse:splitColor(`hue`,`saturation`,`lightness`),transform:({hue:hue$2,saturation,lightness,alpha:alpha$1=1})=>`hsla(`+Math.round(hue$2)+`, `+percent.transform(sanitize(saturation))+`, `+percent.transform(sanitize(lightness))+`, `+sanitize(alpha.transform(alpha$1))+`)`},clampRgbUnit=clamp$4(0,255),rgbUnit=Object.assign(Object.assign({},number$2),{transform:v$2=>Math.round(clampRgbUnit(v$2))}),rgba={test:isColorString(`rgb`,`red`),parse:splitColor(`red`,`green`,`blue`),transform:({red,green,blue,alpha:alpha$1=1})=>`rgba(`+rgbUnit.transform(red)+`, `+rgbUnit.transform(green)+`, `+rgbUnit.transform(blue)+`, `+sanitize(alpha.transform(alpha$1))+`)`};function parseHex$1(v$2){let r$2=``,g$2=``,b$4=``,a$2=``;return v$2.length>5?(r$2=v$2.substr(1,2),g$2=v$2.substr(3,2),b$4=v$2.substr(5,2),a$2=v$2.substr(7,2)):(r$2=v$2.substr(1,1),g$2=v$2.substr(2,1),b$4=v$2.substr(3,1),a$2=v$2.substr(4,1),r$2+=r$2,g$2+=g$2,b$4+=b$4,a$2+=a$2),{red:parseInt(r$2,16),green:parseInt(g$2,16),blue:parseInt(b$4,16),alpha:a$2?parseInt(a$2,16)/255:1}}const hex$1={test:isColorString(`#`),parse:parseHex$1,transform:rgba.transform},color$1={test:v$2=>rgba.test(v$2)||hex$1.test(v$2)||hsla.test(v$2),parse:v$2=>rgba.test(v$2)?rgba.parse(v$2):hsla.test(v$2)?hsla.parse(v$2):hex$1.parse(v$2),transform:v$2=>isString$1(v$2)?v$2:v$2.hasOwnProperty(`red`)?rgba.transform(v$2):hsla.transform(v$2)},colorToken="${c}",numberToken="${n}";function test(v$2){var _a$3,_b,_c$1,_d$1;return isNaN(v$2)&&isString$1(v$2)&&((_b=(_a$3=v$2.match(floatRegex))?.length)??0)+((_d$1=(_c$1=v$2.match(colorRegex))?.length)??0)>0}function analyse$1(v$2){typeof v$2==`number`&&(v$2=`${v$2}`);let values=[],numColors=0,colors=v$2.match(colorRegex);colors&&(numColors=colors.length,v$2=v$2.replace(colorRegex,colorToken),values.push(...colors.map(color$1.parse)));let numbers=v$2.match(floatRegex);return numbers&&(v$2=v$2.replace(floatRegex,numberToken),values.push(...numbers.map(number$2.parse))),{values,numColors,tokenised:v$2}}function parse$3(v$2){return analyse$1(v$2).values}function createTransformer$1(v$2){let{values,numColors,tokenised}=analyse$1(v$2),numValues=values.length;return v$3=>{let output=tokenised;for(let i$1=0;i$1typeof v$2==`number`?0:v$2;function getAnimatableNone$2(v$2){let parsed=parse$3(v$2),transformer=createTransformer$1(v$2);return transformer(parsed.map(convertNumbersToZero))}const complex={test,parse:parse$3,createTransformer:createTransformer$1,getAnimatableNone:getAnimatableNone$2},maxDefaults=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function applyDefaultFilter(v$2){let[name$2,value$1]=v$2.slice(0,-1).split(`(`);if(name$2===`drop-shadow`)return v$2;let[number$3]=value$1.match(floatRegex)||[];if(!number$3)return v$2;let unit=value$1.replace(number$3,``),defaultValue=maxDefaults.has(name$2)?1:0;return number$3!==value$1&&(defaultValue*=100),name$2+`(`+defaultValue+unit+`)`}const functionRegex=/([a-z-]*)\(.*?\)/g,filter=Object.assign(Object.assign({},complex),{getAnimatableNone:v$2=>{let functions=v$2.match(functionRegex);return functions?functions.map(applyDefaultFilter).join(` `):v$2}});function hueToRgb(p$5,q$2,t){return t<0&&(t+=1),t>1&&--t,t<1/6?p$5+(q$2-p$5)*6*t:t<1/2?q$2:t<2/3?p$5+(q$2-p$5)*(2/3-t)*6:p$5}function hslaToRgba({hue:hue$2,saturation,lightness,alpha:alpha$1}){hue$2/=360,saturation/=100,lightness/=100;let red=0,green=0,blue=0;if(!saturation)red=green=blue=lightness;else{let q$2=lightness<.5?lightness*(1+saturation):lightness+saturation-lightness*saturation,p$5=2*lightness-q$2;red=hueToRgb(p$5,q$2,hue$2+1/3),green=hueToRgb(p$5,q$2,hue$2),blue=hueToRgb(p$5,q$2,hue$2-1/3)}return{red:Math.round(red*255),green:Math.round(green*255),blue:Math.round(blue*255),alpha:alpha$1}}const mixLinearColor=(from,to$2,v$2)=>{let fromExpo=from*from,toExpo=to$2*to$2;return Math.sqrt(Math.max(0,v$2*(toExpo-fromExpo)+fromExpo))},colorTypes=[hex$1,rgba,hsla],getColorType=v$2=>colorTypes.find(type=>type.test(v$2)),notAnimatable=color$2=>`'${color$2}' is not an animatable color. Use the equivalent color code instead.`,mixColor=(from,to$2)=>{let fromColorType=getColorType(from),toColorType=getColorType(to$2);invariant(!!fromColorType,notAnimatable(from)),invariant(!!toColorType,notAnimatable(to$2));let fromColor=fromColorType.parse(from),toColor=toColorType.parse(to$2);fromColorType===hsla&&(fromColor=hslaToRgba(fromColor),fromColorType=rgba),toColorType===hsla&&(toColor=hslaToRgba(toColor),toColorType=rgba);let blended=Object.assign({},fromColor);return v$2=>{for(let key$2 in blended)key$2!==`alpha`&&(blended[key$2]=mixLinearColor(fromColor[key$2],toColor[key$2],v$2));return blended.alpha=mix(fromColor.alpha,toColor.alpha,v$2),fromColorType.transform(blended)}},isNum$1=v$2=>typeof v$2==`number`,combineFunctions=(a$2,b$4)=>v$2=>b$4(a$2(v$2)),pipe=(...transformers)=>transformers.reduce(combineFunctions);function getMixer(origin,target$1){return isNum$1(origin)?v$2=>mix(origin,target$1,v$2):color$1.test(origin)?mixColor(origin,target$1):mixComplex(origin,target$1)}const mixArray=(from,to$2)=>{let output=[...from],numValues=output.length,blendValue=from.map((fromThis,i$1)=>getMixer(fromThis,to$2[i$1]));return v$2=>{for(let i$1=0;i$1{let output=Object.assign(Object.assign({},origin),target$1),blendValue={};for(let key$2 in output)origin[key$2]!==void 0&&target$1[key$2]!==void 0&&(blendValue[key$2]=getMixer(origin[key$2],target$1[key$2]));return v$2=>{for(let key$2 in blendValue)output[key$2]=blendValue[key$2](v$2);return output}};function analyse(value$1){let parsed=complex.parse(value$1),numValues=parsed.length,numNumbers=0,numRGB=0,numHSL=0;for(let i$1=0;i$1{let template=complex.createTransformer(target$1),originStats=analyse(origin),targetStats=analyse(target$1),canInterpolate=originStats.numHSL===targetStats.numHSL&&originStats.numRGB===targetStats.numRGB&&originStats.numNumbers>=targetStats.numNumbers;return canInterpolate?pipe(mixArray(originStats.parsed,targetStats.parsed),template):(warning(!0,`Complex values '${origin}' and '${target$1}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),p$5=>`${p$5>0?target$1:origin}`)},mixNumber=(from,to$2)=>p$5=>mix(from,to$2,p$5);function detectMixerFactory(v$2){if(typeof v$2==`number`)return mixNumber;if(typeof v$2==`string`)return color$1.test(v$2)?mixColor:mixComplex;if(Array.isArray(v$2))return mixArray;if(typeof v$2==`object`)return mixObject}function createMixers(output,ease,customMixer){let mixers=[],mixerFactory=customMixer||detectMixerFactory(output[0]),numMixers=output.length-1;for(let i$1=0;i$1mixer(progress(from,to$2,v$2))}function slowInterpolate(input,mixers){let inputLength=input.length,lastInputIndex=inputLength-1;return v$2=>{let mixerIndex=0,foundMixerIndex=!1;if(v$2<=input[0]?foundMixerIndex=!0:v$2>=input[lastInputIndex]&&(mixerIndex=lastInputIndex-1,foundMixerIndex=!0),!foundMixerIndex){let i$1=1;for(;i$1v$2||i$1===lastInputIndex);i$1++);mixerIndex=i$1-1}let progressInRange=progress(input[mixerIndex],input[mixerIndex+1],v$2);return mixers[mixerIndex](progressInRange)}}function interpolate$1(input,output,{clamp:isClamp=!0,ease,mixer}={}){let inputLength=input.length;invariant(inputLength===output.length,`Both input and output ranges must be the same length`),invariant(!ease||!Array.isArray(ease)||ease.length===inputLength-1,"Array of easing functions must be of length `input.length - 1`, as it applies to the transitions **between** the defined values."),input[0]>input[inputLength-1]&&(input=[].concat(input),output=[].concat(output),input.reverse(),output.reverse());let mixers=createMixers(output,ease,mixer),interpolator=inputLength===2?fastInterpolate(input,mixers):slowInterpolate(input,mixers);return isClamp?v$2=>interpolator(clamp$3(input[0],input[inputLength-1],v$2)):interpolator}const reverseEasing=easing=>p$5=>1-easing(1-p$5),mirrorEasing=easing=>p$5=>p$5<=.5?easing(2*p$5)/2:(2-easing(2*(1-p$5)))/2,createExpoIn=power=>p$5=>p$5**+power,createBackIn=power=>p$5=>p$5*p$5*((power+1)*p$5-power),createAnticipate=power=>{let backEasing=createBackIn(power);return p$5=>(p$5*=2)<1?.5*backEasing(p$5):.5*(2-2**(-10*(p$5-1)))},DEFAULT_OVERSHOOT_STRENGTH=1.525,BOUNCE_FIRST_THRESHOLD=4/11,BOUNCE_SECOND_THRESHOLD=8/11,BOUNCE_THIRD_THRESHOLD=9/10,linear$1=p$5=>p$5,easeIn=createExpoIn(2),easeOut=reverseEasing(easeIn),easeInOut=mirrorEasing(easeIn),circIn=p$5=>1-Math.sin(Math.acos(p$5)),circOut=reverseEasing(circIn),circInOut=mirrorEasing(circOut),backIn=createBackIn(DEFAULT_OVERSHOOT_STRENGTH),backOut=reverseEasing(backIn),backInOut=mirrorEasing(backIn),anticipate=createAnticipate(DEFAULT_OVERSHOOT_STRENGTH),ca$1=4356/361,cb=35442/1805,cc$1=16061/1805,bounceOut=p$5=>{if(p$5===1||p$5===0)return p$5;let p2=p$5*p$5;return p$5p$5<.5?.5*(1-bounceOut(1-p$5*2)):.5*bounceOut(p$5*2-1)+.5;function defaultEasing(values,easing){return values.map(()=>easing||easeInOut).splice(0,values.length-1)}function defaultOffset(values){let numValues=values.length;return values.map((_value,i$1)=>i$1===0?0:i$1/(numValues-1))}function convertOffsetToTimes(offset$2,duration){return offset$2.map(o$1=>o$1*duration)}function keyframes$3({from=0,to:to$2=1,ease,offset:offset$2,duration=300}){let state={done:!1,value:from},values=Array.isArray(to$2)?to$2:[from,to$2],times=convertOffsetToTimes(offset$2&&offset$2.length===values.length?offset$2:defaultOffset(values),duration);function createInterpolator(){return interpolate$1(times,values,{ease:Array.isArray(ease)?ease:defaultEasing(values,ease)})}let interpolator=createInterpolator();return{next:t=>(state.value=interpolator(t),state.done=t>=duration,state),flipTarget:()=>{values.reverse(),interpolator=createInterpolator()}}}function decay({velocity=0,from=0,power=.8,timeConstant=350,restDelta=.5,modifyTarget}){let state={done:!1,value:from},amplitude=power*velocity,ideal=from+amplitude,target$1=modifyTarget===void 0?ideal:modifyTarget(ideal);return target$1!==ideal&&(amplitude=target$1-from),{next:t=>{let delta=-amplitude*Math.exp(-t/timeConstant);return state.done=!(delta>restDelta||delta<-restDelta),state.value=state.done?target$1:target$1+delta,state},flipTarget:()=>{}}}const types={keyframes:keyframes$3,spring,decay};function detectAnimationFromOptions(config){if(Array.isArray(config.to))return keyframes$3;if(types[config.type])return types[config.type];let keys$3=new Set(Object.keys(config));return keys$3.has(`ease`)||keys$3.has(`duration`)&&!keys$3.has(`dampingRatio`)?keyframes$3:keys$3.has(`dampingRatio`)||keys$3.has(`stiffness`)||keys$3.has(`mass`)||keys$3.has(`damping`)||keys$3.has(`restSpeed`)||keys$3.has(`restDelta`)?spring:keyframes$3}function loopElapsed(elapsed,duration,delay=0){return elapsed-duration-delay}function reverseElapsed(elapsed,duration,delay=0,isForwardPlayback=!0){return isForwardPlayback?loopElapsed(duration+-elapsed,duration,delay):duration-(elapsed-duration)+delay}function hasRepeatDelayElapsed(elapsed,duration,delay,isForwardPlayback){return isForwardPlayback?elapsed>=duration+delay:elapsed<=-delay}const framesync=update=>{let passTimestamp=({delta})=>update(delta);return{start:()=>es_default.update(passTimestamp,!0),stop:()=>cancelSync.update(passTimestamp)}};function animate$1(_a$3){var _b,_c$1,{from,autoplay=!0,driver=framesync,elapsed=0,repeat:repeatMax=0,repeatType=`loop`,repeatDelay=0,onPlay,onStop,onComplete,onRepeat,onUpdate}=_a$3,options$1=__rest(_a$3,[`from`,`autoplay`,`driver`,`elapsed`,`repeat`,`repeatType`,`repeatDelay`,`onPlay`,`onStop`,`onComplete`,`onRepeat`,`onUpdate`]);let{to:to$2}=options$1,driverControls,repeatCount=0,computedDuration=options$1.duration,latest,isComplete=!1,isForwardPlayback=!0,interpolateFromNumber,animator=detectAnimationFromOptions(options$1);(_c$1=(_b=animator).needsInterpolation)?.call(_b,from,to$2)&&(interpolateFromNumber=interpolate$1([0,100],[from,to$2],{clamp:!1}),from=0,to$2=100);let animation=animator(Object.assign(Object.assign({},options$1),{from,to:to$2}));function repeat(){repeatCount++,repeatType===`reverse`?(isForwardPlayback=repeatCount%2==0,elapsed=reverseElapsed(elapsed,computedDuration,repeatDelay,isForwardPlayback)):(elapsed=loopElapsed(elapsed,computedDuration,repeatDelay),repeatType===`mirror`&&animation.flipTarget()),isComplete=!1,onRepeat&&onRepeat()}function complete(){driverControls.stop(),onComplete&&onComplete()}function update(delta){if(isForwardPlayback||(delta=-delta),elapsed+=delta,!isComplete){let state=animation.next(Math.max(0,elapsed));latest=state.value,interpolateFromNumber&&(latest=interpolateFromNumber(latest)),isComplete=isForwardPlayback?state.done:elapsed<=0}onUpdate?.(latest),isComplete&&(repeatCount===0&&(computedDuration??=elapsed),repeatCount{onStop?.(),driverControls.stop()}}}function velocityPerSecond(velocity,frameDuration){return frameDuration?velocity*(1e3/frameDuration):0}function inertia({from=0,velocity=0,min:min$1,max:max$1,power=.8,timeConstant=750,bounceStiffness=500,bounceDamping=10,restDelta=1,modifyTarget,driver,onUpdate,onComplete,onStop}){let currentAnimation;function isOutOfBounds(v$2){return min$1!==void 0&&v$2max$1}function boundaryNearest(v$2){return min$1===void 0?max$1:max$1===void 0||Math.abs(min$1-v$2){var _a$3;onUpdate?.(v$2),(_a$3=options$1.onUpdate)==null||_a$3.call(options$1,v$2)},onComplete,onStop}))}function startSpring(options$1){startAnimation(Object.assign({type:`spring`,stiffness:bounceStiffness,damping:bounceDamping,restDelta},options$1))}if(isOutOfBounds(from))startSpring({from,velocity,to:boundaryNearest(from)});else{let target$1=power*velocity+from;modifyTarget!==void 0&&(target$1=modifyTarget(target$1));let boundary=boundaryNearest(target$1),heading$1=boundary===min$1?-1:1,prev,current,checkBoundary=v$2=>{prev=current,current=v$2,velocity=velocityPerSecond(v$2-prev,getFrameData().delta),(heading$1===1&&v$2>boundary||heading$1===-1&&v$2currentAnimation?.stop()}}const a$1=(a1,a2)=>1-3*a2+3*a1,b$3=(a1,a2)=>3*a2-6*a1,c$3=a1=>3*a1,calcBezier$1=(t,a1,a2)=>((a$1(a1,a2)*t+b$3(a1,a2))*t+c$3(a1))*t,getSlope=(t,a1,a2)=>3*a$1(a1,a2)*t*t+2*b$3(a1,a2)*t+c$3(a1),subdivisionPrecision=1e-7,subdivisionMaxIterations=10;function binarySubdivide$1(aX,aA,aB,mX1,mX2){let currentX,currentT,i$1=0;do currentT=aA+(aB-aA)/2,currentX=calcBezier$1(currentT,mX1,mX2)-aX,currentX>0?aB=currentT:aA=currentT;while(Math.abs(currentX)>subdivisionPrecision&&++i$1=newtonMinSlope?newtonRaphsonIterate(aX,guessForT,mX1,mX2):initialSlope===0?guessForT:binarySubdivide$1(aX,intervalStart,intervalStart+kSampleStepSize,mX1,mX2)}return t=>t===0||t===1?t:calcBezier$1(getTForX(t),mY1,mY2)}const __vite_import_meta_env__$1={BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_APP_TARGET_HUGGINGFACE_SPACE:`true`},motionState={};var SubscriptionManager$1=class{subscriptions=new Set;add(handler){return this.subscriptions.add(handler),()=>this.subscriptions.delete(handler)}notify(a$2,b$4,c$4){if(this.subscriptions.size)for(let handler of this.subscriptions)handler(a$2,b$4,c$4)}clear(){this.subscriptions.clear()}};function isFloat$1(value$1){return!Number.isNaN(Number.parseFloat(value$1))}var MotionValue$1=class{current;prev;timeDelta=0;lastUpdated=0;updateSubscribers=new SubscriptionManager$1;stopAnimation;canTrackVelocity=!1;constructor(init){this.prev=this.current=init,this.canTrackVelocity=isFloat$1(this.current)}onChange(subscription){return this.updateSubscribers.add(subscription)}clearListeners(){this.updateSubscribers.clear()}set(v$2){this.updateAndNotify(v$2)}updateAndNotify=v$2=>{this.prev=this.current,this.current=v$2;let{delta,timestamp:timestamp$2}=getFrameData();this.lastUpdated!==timestamp$2&&(this.timeDelta=delta,this.lastUpdated=timestamp$2),es_default.postRender(this.scheduleVelocityCheck),this.updateSubscribers.notify(this.current)};get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?velocityPerSecond(Number.parseFloat(this.current)-Number.parseFloat(this.prev),this.timeDelta):0}scheduleVelocityCheck=()=>es_default.postRender(this.velocityCheck);velocityCheck=({timestamp:timestamp$2})=>{this.canTrackVelocity||=isFloat$1(this.current),timestamp$2!==this.lastUpdated&&(this.prev=this.current)};start(animation){return this.stop(),new Promise(resolve$1=>{let{stop:stop$1}=animation(resolve$1);this.stopAnimation=stop$1}).then(()=>this.clearAnimation())}stop(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.updateSubscribers.clear(),this.stop()}};function getMotionValue$1(init){return new MotionValue$1(init)}const{isArray:isArray$4}=Array;function useMotionValues$1(){let motionValues=ref({}),stop$1=keys$3=>{let destroyKey=key$2=>{motionValues.value[key$2]&&(motionValues.value[key$2].stop(),motionValues.value[key$2].destroy(),delete motionValues.value[key$2])};keys$3?isArray$4(keys$3)?keys$3.forEach(destroyKey):destroyKey(keys$3):Object.keys(motionValues.value).forEach(destroyKey)},get=(key$2,from,target$1)=>{if(motionValues.value[key$2])return motionValues.value[key$2];let motionValue=getMotionValue$1(from);return motionValue.onChange(v$2=>target$1[key$2]=v$2),motionValues.value[key$2]=motionValue,motionValue};return tryOnUnmounted(stop$1),{motionValues,get,stop:stop$1}}function isKeyframesTarget$1(v$2){return Array.isArray(v$2)}function underDampedSpring$1(){return{type:`spring`,stiffness:500,damping:25,restDelta:.5,restSpeed:10}}function criticallyDampedSpring$1(to$2){return{type:`spring`,stiffness:550,damping:to$2===0?2*Math.sqrt(550):30,restDelta:.01,restSpeed:10}}function overDampedSpring$1(to$2){return{type:`spring`,stiffness:550,damping:to$2===0?100:30,restDelta:.01,restSpeed:10}}function linearTween$1(){return{type:`keyframes`,ease:`linear`,duration:300}}function keyframes$2(values){return{type:`keyframes`,duration:800,values}}const defaultTransitions$1={default:overDampedSpring$1,x:underDampedSpring$1,y:underDampedSpring$1,z:underDampedSpring$1,rotate:underDampedSpring$1,rotateX:underDampedSpring$1,rotateY:underDampedSpring$1,rotateZ:underDampedSpring$1,scaleX:criticallyDampedSpring$1,scaleY:criticallyDampedSpring$1,scale:criticallyDampedSpring$1,backgroundColor:linearTween$1,color:linearTween$1,opacity:linearTween$1};function getDefaultTransition$1(valueKey,to$2){let transitionFactory;return transitionFactory=isKeyframesTarget$1(to$2)?keyframes$2:defaultTransitions$1[valueKey]||defaultTransitions$1.default,{to:to$2,...transitionFactory(to$2)}}const int$1={...number$2,transform:Math.round},valueTypes$2={color:color$1,backgroundColor:color$1,outlineColor:color$1,fill:color$1,stroke:color$1,borderColor:color$1,borderTopColor:color$1,borderRightColor:color$1,borderBottomColor:color$1,borderLeftColor:color$1,borderWidth:px,borderTopWidth:px,borderRightWidth:px,borderBottomWidth:px,borderLeftWidth:px,borderRadius:px,radius:px,borderTopLeftRadius:px,borderTopRightRadius:px,borderBottomRightRadius:px,borderBottomLeftRadius:px,width:px,maxWidth:px,height:px,maxHeight:px,size:px,top:px,right:px,bottom:px,left:px,padding:px,paddingTop:px,paddingRight:px,paddingBottom:px,paddingLeft:px,margin:px,marginTop:px,marginRight:px,marginBottom:px,marginLeft:px,rotate:degrees,rotateX:degrees,rotateY:degrees,rotateZ:degrees,scale,scaleX:scale,scaleY:scale,scaleZ:scale,skew:degrees,skewX:degrees,skewY:degrees,distance:px,translateX:px,translateY:px,translateZ:px,x:px,y:px,z:px,perspective:px,transformPerspective:px,opacity:alpha,originX:progressPercentage,originY:progressPercentage,originZ:px,zIndex:int$1,filter,WebkitFilter:filter,fillOpacity:alpha,strokeOpacity:alpha,numOctaves:int$1},getValueType$1=key$2=>valueTypes$2[key$2];function getValueAsType$1(value$1,type){return type&&typeof value$1==`number`&&type.transform?type.transform(value$1):value$1}function getAnimatableNone$1(key$2,value$1){let defaultValueType=getValueType$1(key$2);return defaultValueType!==filter&&(defaultValueType=complex),defaultValueType.getAnimatableNone?defaultValueType.getAnimatableNone(value$1):void 0}const easingLookup$1={linear:linear$1,easeIn,easeInOut,easeOut,circIn,circInOut,circOut,backIn,backInOut,backOut,anticipate,bounceIn,bounceInOut,bounceOut};function easingDefinitionToFunction$1(definition$29){if(Array.isArray(definition$29)){let[x1,y1,x2,y2]=definition$29;return cubicBezier$1(x1,y1,x2,y2)}else if(typeof definition$29==`string`)return easingLookup$1[definition$29];return definition$29}function isEasingArray$1(ease){return Array.isArray(ease)&&typeof ease[0]!=`number`}function isAnimatable$1(key$2,value$1){return key$2===`zIndex`?!1:!!(typeof value$1==`number`||Array.isArray(value$1)||typeof value$1==`string`&&complex.test(value$1)&&!value$1.startsWith(`url(`))}function hydrateKeyframes$1(options$1){return Array.isArray(options$1.to)&&options$1.to[0]===null&&(options$1.to=[...options$1.to],options$1.to[0]=options$1.from),options$1}function convertTransitionToAnimationOptions$1({ease,times,delay,...transition}){let options$1={...transition};return times&&(options$1.offset=times),ease&&(options$1.ease=isEasingArray$1(ease)?ease.map(easingDefinitionToFunction$1):easingDefinitionToFunction$1(ease)),delay&&(options$1.elapsed=-delay),options$1}function getPopmotionAnimationOptions$1(transition,options$1,key$2){return Array.isArray(options$1.to)&&(transition.duration||=800),hydrateKeyframes$1(options$1),isTransitionDefined$1(transition)||(transition={...transition,...getDefaultTransition$1(key$2,options$1.to)}),{...options$1,...convertTransitionToAnimationOptions$1(transition)}}function isTransitionDefined$1({delay,repeat,repeatType,repeatDelay,from,...transition}){return!!Object.keys(transition).length}function getValueTransition$1(transition,key$2){return transition[key$2]||transition.default||transition}function getAnimation$1(key$2,value$1,target$1,transition,onComplete){let valueTransition=getValueTransition$1(transition,key$2),origin=valueTransition.from===null||valueTransition.from===void 0?value$1.get():valueTransition.from,isTargetAnimatable=isAnimatable$1(key$2,target$1);origin===`none`&&isTargetAnimatable&&typeof target$1==`string`&&(origin=getAnimatableNone$1(key$2,target$1));let isOriginAnimatable=isAnimatable$1(key$2,origin);function start(complete){let options$1={from:origin,to:target$1,velocity:transition.velocity?transition.velocity:value$1.getVelocity(),onUpdate:v$2=>value$1.set(v$2)};return valueTransition.type===`inertia`||valueTransition.type===`decay`?inertia({...options$1,...valueTransition}):animate$1({...getPopmotionAnimationOptions$1(valueTransition,options$1,key$2),onUpdate:v$2=>{options$1.onUpdate(v$2),valueTransition.onUpdate&&valueTransition.onUpdate(v$2)},onComplete:()=>{onComplete&&onComplete(),complete&&complete()}})}function set(complete){return value$1.set(target$1),onComplete&&onComplete(),complete&&complete(),{stop:()=>{}}}return!isOriginAnimatable||!isTargetAnimatable||valueTransition.type===!1?set:start}function useMotionTransitions$1(){let{motionValues,stop:stop$1,get}=useMotionValues$1(),push$1=(key$2,value$1,target$1,transition={},onComplete)=>{let from=target$1[key$2],motionValue=get(key$2,from,target$1);if(transition&&transition.immediate){motionValue.set(value$1);return}let animation=getAnimation$1(key$2,motionValue,value$1,transition,onComplete);motionValue.start(animation)};return{motionValues,stop:stop$1,push:push$1}}function useMotionControls$1(motionProperties,variants={},{motionValues,push:push$1,stop:stop$1}=useMotionTransitions$1()){let _variants=unref(variants),isAnimating=ref(!1);watch(motionValues,newVal=>{isAnimating.value=Object.values(newVal).filter(value$1=>value$1.isAnimating()).length>0},{immediate:!0,deep:!0});let getVariantFromKey=variant=>{if(!_variants||!_variants[variant])throw Error(`The variant ${variant} does not exist.`);return _variants[variant]},apply$2=variant=>{typeof variant==`string`&&(variant=getVariantFromKey(variant));let animations$1=Object.entries(variant).map(([key$2,value$1])=>{if(key$2!==`transition`)return new Promise(resolve$1=>push$1(key$2,value$1,motionProperties,variant.transition||getDefaultTransition$1(key$2,variant[key$2]),resolve$1))}).filter(Boolean);async function waitForComplete(){await Promise.all(animations$1),variant.transition?.onComplete?.()}return Promise.all([waitForComplete()])},set=variant=>{let variantData=isObject$1(variant)?variant:getVariantFromKey(variant);Object.entries(variantData).forEach(([key$2,value$1])=>{key$2!==`transition`&&push$1(key$2,value$1,motionProperties,{immediate:!0})})},leave=async done=>{let leaveVariant;if(_variants&&(_variants.leave&&(leaveVariant=_variants.leave),!_variants.leave&&_variants.initial&&(leaveVariant=_variants.initial)),!leaveVariant){done();return}await apply$2(leaveVariant),done()};return{isAnimating,apply:apply$2,set,leave,stop:stop$1}}const isBrowser$3=typeof window<`u`,supportsPointerEvents$1=()=>isBrowser$3&&(window.onpointerdown===null||__vite_import_meta_env__$1?.TEST),supportsTouchEvents$1=()=>isBrowser$3&&(window.ontouchstart===null||__vite_import_meta_env__$1?.TEST),supportsMouseEvents$1=()=>isBrowser$3&&(window.onmousedown===null||__vite_import_meta_env__$1?.TEST);function registerEventListeners$1({target:target$1,state,variants,apply:apply$2}){let _variants=unref(variants),hovered=ref(!1),tapped=ref(!1),focused=ref(!1),mutableKeys=computed(()=>{let result=[...Object.keys(state.value||{})];return _variants?(_variants.hovered&&(result=[...result,...Object.keys(_variants.hovered)]),_variants.tapped&&(result=[...result,...Object.keys(_variants.tapped)]),_variants.focused&&(result=[...result,...Object.keys(_variants.focused)]),result):result}),computedProperties=computed(()=>{let result={};for(let key$2 in Object.assign(result,state.value),hovered.value&&_variants.hovered&&Object.assign(result,_variants.hovered),tapped.value&&_variants.tapped&&Object.assign(result,_variants.tapped),focused.value&&_variants.focused&&Object.assign(result,_variants.focused),result)mutableKeys.value.includes(key$2)||delete result[key$2];return result});_variants.hovered&&(useEventListener$1(target$1,`mouseenter`,()=>hovered.value=!0),useEventListener$1(target$1,`mouseleave`,()=>{hovered.value=!1,tapped.value=!1})),_variants.tapped&&(supportsMouseEvents$1()&&(useEventListener$1(target$1,`mousedown`,()=>tapped.value=!0),useEventListener$1(target$1,`mouseup`,()=>tapped.value=!1)),supportsPointerEvents$1()&&(useEventListener$1(target$1,`pointerdown`,()=>tapped.value=!0),useEventListener$1(target$1,`pointerup`,()=>tapped.value=!1)),supportsTouchEvents$1()&&(useEventListener$1(target$1,`touchstart`,()=>tapped.value=!0),useEventListener$1(target$1,`touchend`,()=>tapped.value=!1))),_variants.focused&&(useEventListener$1(target$1,`focus`,()=>focused.value=!0),useEventListener$1(target$1,`blur`,()=>focused.value=!1)),watch([hovered,tapped,focused],()=>{apply$2(computedProperties.value)})}function registerLifeCycleHooks$1({set,target:target$1,variants,variant}){let _variants=unref(variants);watch(()=>target$1,()=>{_variants&&(_variants.initial&&(set(`initial`),variant.value=`initial`),_variants.enter&&(variant.value=`enter`))},{immediate:!0,flush:`pre`})}function registerVariantsSync$1({state,apply:apply$2}){watch(state,newVal=>{newVal&&apply$2(newVal)},{immediate:!0})}function registerVisibilityHooks$1({target:target$1,variants,variant}){let _variants=unref(variants);_variants&&(_variants.visible||_variants.visibleOnce)&&useIntersectionObserver(target$1,([{isIntersecting}])=>{_variants.visible?isIntersecting?variant.value=`visible`:variant.value=`initial`:_variants.visibleOnce&&(isIntersecting&&variant.value!==`visibleOnce`?variant.value=`visibleOnce`:variant.value||=`initial`)})}function useMotionFeatures$1(instance,options$1={syncVariants:!0,lifeCycleHooks:!0,visibilityHooks:!0,eventListeners:!0}){options$1.lifeCycleHooks&®isterLifeCycleHooks$1(instance),options$1.syncVariants&®isterVariantsSync$1(instance),options$1.visibilityHooks&®isterVisibilityHooks$1(instance),options$1.eventListeners&®isterEventListeners$1(instance)}function reactiveStyle$1(props={}){let state=reactive({...props}),style=ref({});return watch(state,()=>{let result={};for(let[key$2,value$1]of Object.entries(state)){let valueType=getValueType$1(key$2),valueAsType=getValueAsType$1(value$1,valueType);result[key$2]=valueAsType}style.value=result},{immediate:!0,deep:!0}),{state,style}}function usePermissiveTarget$1(target$1,onTarget){watch(()=>unrefElement$1(target$1),el$1=>{el$1&&onTarget(el$1)},{immediate:!0})}const translateAlias$1={x:`translateX`,y:`translateY`,z:`translateZ`};function reactiveTransform$1(props={},enableHardwareAcceleration=!0){let state=reactive({...props}),transform$1=ref(``);return watch(state,newVal=>{let result=``,hasHardwareAcceleration=!1;if(enableHardwareAcceleration&&(newVal.x||newVal.y||newVal.z)){let str=[newVal.x||0,newVal.y||0,newVal.z||0].map(val=>getValueAsType$1(val,px)).join(`,`);result+=`translate3d(${str}) `,hasHardwareAcceleration=!0}for(let[key$2,value$1]of Object.entries(newVal)){if(enableHardwareAcceleration&&(key$2===`x`||key$2===`y`||key$2===`z`))continue;let valueType=getValueType$1(key$2),valueAsType=getValueAsType$1(value$1,valueType);result+=`${translateAlias$1[key$2]||key$2}(${valueAsType}) `}enableHardwareAcceleration&&!hasHardwareAcceleration&&(result+=`translateZ(0px) `),transform$1.value=result.trim()},{immediate:!0,deep:!0}),{state,transform:transform$1}}const transformAxes$1=[``,`X`,`Y`,`Z`],order$2=[`perspective`,`translate`,`scale`,`rotate`,`skew`],transformProps$1=[`transformPerspective`,`x`,`y`,`z`];order$2.forEach(operationKey=>{transformAxes$1.forEach(axesKey=>{let key$2=operationKey+axesKey;transformProps$1.push(key$2)})});const transformPropSet$1=new Set(transformProps$1);function isTransformProp$1(key$2){return transformPropSet$1.has(key$2)}const transformOriginProps$1=new Set([`originX`,`originY`,`originZ`]);function isTransformOriginProp$1(key$2){return transformOriginProps$1.has(key$2)}function splitValues$1(variant){let transform$1={},style={};return Object.entries(variant).forEach(([key$2,value$1])=>{isTransformProp$1(key$2)||isTransformOriginProp$1(key$2)?transform$1[key$2]=value$1:style[key$2]=value$1}),{transform:transform$1,style}}function variantToStyle$1(variant){let{transform:_transform,style:_style}=splitValues$1(variant),{transform:transform$1}=reactiveTransform$1(_transform),{style}=reactiveStyle$1(_style);return transform$1.value&&(style.value.transform=transform$1.value),style.value}function useElementStyle$1(target$1,onInit){let _cache$1,_target$1,{state,style}=reactiveStyle$1();return usePermissiveTarget$1(target$1,el$1=>{_target$1=el$1;for(let key$2 of Object.keys(valueTypes$2)){if(el$1.style[key$2]===null||el$1.style[key$2]===``||isTransformProp$1(key$2)||isTransformOriginProp$1(key$2))continue;state[key$2]=el$1.style[key$2]}_cache$1&&Object.entries(_cache$1).forEach(([key$2,value$1])=>el$1.style[key$2]=value$1),onInit&&onInit(state)}),watch(style,newVal=>{if(!_target$1){_cache$1=newVal;return}for(let key$2 in newVal)_target$1.style[key$2]=newVal[key$2]},{immediate:!0}),{style:state}}function parseTransform$1(transform$1){let transforms=transform$1.trim().split(/\) |\)/);if(transforms.length===1)return{};let parseValues=value$1=>value$1.endsWith(`px`)||value$1.endsWith(`deg`)?Number.parseFloat(value$1):Number.isNaN(Number(value$1))?Number(value$1):value$1;return transforms.reduce((acc,transform2)=>{if(!transform2)return acc;let[name$2,transformValue]=transform2.split(`(`),valueArray=transformValue.split(`,`),values=valueArray.map(val=>parseValues(val.endsWith(`)`)?val.replace(`)`,``):val.trim())),value$1=values.length===1?values[0]:values;return{...acc,[name$2]:value$1}},{})}function stateFromTransform$1(state,transform$1){Object.entries(parseTransform$1(transform$1)).forEach(([key$2,value$1])=>{let axes=[`x`,`y`,`z`];if(key$2===`translate3d`){if(value$1===0){axes.forEach(axis=>state[axis]=0);return}value$1.forEach((axisValue,index$1)=>state[axes[index$1]]=axisValue);return}if(value$1=Number.parseFloat(`${value$1}`),key$2===`translateX`){state.x=value$1;return}if(key$2===`translateY`){state.y=value$1;return}if(key$2===`translateZ`){state.z=value$1;return}state[key$2]=value$1})}function useElementTransform$1(target$1,onInit){let _cache$1,_target$1,{state,transform:transform$1}=reactiveTransform$1();return usePermissiveTarget$1(target$1,el$1=>{_target$1=el$1,el$1.style.transform&&stateFromTransform$1(state,el$1.style.transform),_cache$1&&(el$1.style.transform=_cache$1),onInit&&onInit(state)}),watch(transform$1,newValue=>{if(!_target$1){_cache$1=newValue;return}_target$1.style.transform=newValue},{immediate:!0}),{transform:state}}function objectEntries$1(obj){return Object.entries(obj)}function useMotionProperties$1(target$1,defaultValues){let motionProperties=reactive({}),apply$2=values=>Object.entries(values).forEach(([key$2,value$1])=>motionProperties[key$2]=value$1),{style}=useElementStyle$1(target$1,apply$2),{transform:transform$1}=useElementTransform$1(target$1,apply$2);return watch(motionProperties,newVal=>{objectEntries$1(newVal).forEach(([key$2,value$1])=>{let target2=isTransformProp$1(key$2)?transform$1:style;target2[key$2]&&target2[key$2]===value$1||(target2[key$2]=value$1)})},{immediate:!0,deep:!0}),usePermissiveTarget$1(target$1,()=>defaultValues&&apply$2(defaultValues)),{motionProperties,style,transform:transform$1}}function useMotionVariants$1(variants={}){let _variants=unref(variants),variant=ref(),state=computed(()=>{if(variant.value)return _variants[variant.value]});return{state,variant}}function useMotion$1(target$1,variants={},options$1){let{motionProperties}=useMotionProperties$1(target$1),{variant,state}=useMotionVariants$1(variants),controls=useMotionControls$1(motionProperties,variants),instance={target:target$1,variant,variants,state,motionProperties,...controls};return useMotionFeatures$1(instance,options$1),instance}const transitionKeys$1=[`delay`,`duration`],directivePropsKeys$1=[`initial`,`enter`,`leave`,`visible`,`visible-once`,`visibleOnce`,`hovered`,`tapped`,`focused`,...transitionKeys$1];function isTransitionKey(val){return transitionKeys$1.includes(val)}function resolveVariants(node$1,variantsRef){let target$1=node$1.props?node$1.props:node$1.data&&node$1.data.attrs?node$1.data.attrs:{};if(target$1){target$1.variants&&isObject$1(target$1.variants)&&(variantsRef.value={...variantsRef.value,...target$1.variants});for(let key$2 of directivePropsKeys$1){if(!target$1||!target$1[key$2])continue;if(isTransitionKey(key$2)&&typeof target$1[key$2]==`number`){for(let variantKey of[`enter`,`visible`,`visibleOnce`]){let variantConfig=variantsRef.value[variantKey];if(variantConfig==null)continue;variantConfig.transition??={},variantConfig.transition[key$2]=target$1[key$2]}continue}if(isObject$1(target$1[key$2])){let prop=target$1[key$2];key$2===`visible-once`&&(key$2=`visibleOnce`),variantsRef.value[key$2]=prop}}}}function directive(variants,isPreset=!1){let register=(el$1,binding,node$1)=>{let key$2=binding.value&&typeof binding.value==`string`?binding.value:node$1.key;key$2&&motionState[key$2]&&motionState[key$2].stop();let variantsObject=isPreset?structuredClone(toRaw(variants)||{}):variants||{},variantsRef=ref(variantsObject);typeof binding.value==`object`&&(variantsRef.value=binding.value),resolveVariants(node$1,variantsRef);let motionOptions={eventListeners:!0,lifeCycleHooks:!0,syncVariants:!0,visibilityHooks:!1},motionInstance=useMotion$1(el$1,variantsRef,motionOptions);el$1.motionInstance=motionInstance,key$2&&(motionState[key$2]=motionInstance)},mounted=(el$1,_binding,_node)=>{el$1.motionInstance&®isterVisibilityHooks$1(el$1.motionInstance)};return{created:register,mounted,getSSRProps(binding,node$1){let{initial:bindingInitial}=binding.value||node$1&&node$1?.props||{};bindingInitial=unref(bindingInitial);let initial=defu({},variants?.initial||{},bindingInitial||{});if(!initial||Object.keys(initial).length===0)return;let style=variantToStyle$1(initial);return{style}}}}const fade$1={initial:{opacity:0},enter:{opacity:1}},fadeVisible$1={initial:{opacity:0},visible:{opacity:1}},fadeVisibleOnce$1={initial:{opacity:0},visibleOnce:{opacity:1}},pop$1={initial:{scale:0,opacity:0},enter:{scale:1,opacity:1}},popVisible$1={initial:{scale:0,opacity:0},visible:{scale:1,opacity:1}},popVisibleOnce$1={initial:{scale:0,opacity:0},visibleOnce:{scale:1,opacity:1}},rollLeft$1={initial:{x:-100,rotate:90,opacity:0},enter:{x:0,rotate:0,opacity:1}},rollVisibleLeft$1={initial:{x:-100,rotate:90,opacity:0},visible:{x:0,rotate:0,opacity:1}},rollVisibleOnceLeft$1={initial:{x:-100,rotate:90,opacity:0},visibleOnce:{x:0,rotate:0,opacity:1}},rollRight$1={initial:{x:100,rotate:-90,opacity:0},enter:{x:0,rotate:0,opacity:1}},rollVisibleRight$1={initial:{x:100,rotate:-90,opacity:0},visible:{x:0,rotate:0,opacity:1}},rollVisibleOnceRight$1={initial:{x:100,rotate:-90,opacity:0},visibleOnce:{x:0,rotate:0,opacity:1}},rollTop$1={initial:{y:-100,rotate:-90,opacity:0},enter:{y:0,rotate:0,opacity:1}},rollVisibleTop$1={initial:{y:-100,rotate:-90,opacity:0},visible:{y:0,rotate:0,opacity:1}},rollVisibleOnceTop$1={initial:{y:-100,rotate:-90,opacity:0},visibleOnce:{y:0,rotate:0,opacity:1}},rollBottom$1={initial:{y:100,rotate:90,opacity:0},enter:{y:0,rotate:0,opacity:1}},rollVisibleBottom$1={initial:{y:100,rotate:90,opacity:0},visible:{y:0,rotate:0,opacity:1}},rollVisibleOnceBottom$1={initial:{y:100,rotate:90,opacity:0},visibleOnce:{y:0,rotate:0,opacity:1}},slideLeft$1={initial:{x:-100,opacity:0},enter:{x:0,opacity:1}},slideVisibleLeft$1={initial:{x:-100,opacity:0},visible:{x:0,opacity:1}},slideVisibleOnceLeft$1={initial:{x:-100,opacity:0},visibleOnce:{x:0,opacity:1}},slideRight$1={initial:{x:100,opacity:0},enter:{x:0,opacity:1}},slideVisibleRight$1={initial:{x:100,opacity:0},visible:{x:0,opacity:1}},slideVisibleOnceRight$1={initial:{x:100,opacity:0},visibleOnce:{x:0,opacity:1}},slideTop$1={initial:{y:-100,opacity:0},enter:{y:0,opacity:1}},slideVisibleTop$1={initial:{y:-100,opacity:0},visible:{y:0,opacity:1}},slideVisibleOnceTop$1={initial:{y:-100,opacity:0},visibleOnce:{y:0,opacity:1}},slideBottom$1={initial:{y:100,opacity:0},enter:{y:0,opacity:1}},slideVisibleBottom$1={initial:{y:100,opacity:0},visible:{y:0,opacity:1}},slideVisibleOnceBottom$1={initial:{y:100,opacity:0},visibleOnce:{y:0,opacity:1}},presets$1={__proto__:null,fade:fade$1,fadeVisible:fadeVisible$1,fadeVisibleOnce:fadeVisibleOnce$1,pop:pop$1,popVisible:popVisible$1,popVisibleOnce:popVisibleOnce$1,rollBottom:rollBottom$1,rollLeft:rollLeft$1,rollRight:rollRight$1,rollTop:rollTop$1,rollVisibleBottom:rollVisibleBottom$1,rollVisibleLeft:rollVisibleLeft$1,rollVisibleOnceBottom:rollVisibleOnceBottom$1,rollVisibleOnceLeft:rollVisibleOnceLeft$1,rollVisibleOnceRight:rollVisibleOnceRight$1,rollVisibleOnceTop:rollVisibleOnceTop$1,rollVisibleRight:rollVisibleRight$1,rollVisibleTop:rollVisibleTop$1,slideBottom:slideBottom$1,slideLeft:slideLeft$1,slideRight:slideRight$1,slideTop:slideTop$1,slideVisibleBottom:slideVisibleBottom$1,slideVisibleLeft:slideVisibleLeft$1,slideVisibleOnceBottom:slideVisibleOnceBottom$1,slideVisibleOnceLeft:slideVisibleOnceLeft$1,slideVisibleOnceRight:slideVisibleOnceRight$1,slideVisibleOnceTop:slideVisibleOnceTop$1,slideVisibleRight:slideVisibleRight$1,slideVisibleTop:slideVisibleTop$1};function slugify(str){let a$2=`àáâäæãåāăąçćčđďèéêëēėęěğǵḧîïíīįìłḿñńǹňôöòóœøōõőṕŕřßśšşșťțûüùúūǘůűųẃẍÿýžźż·/_,:;`,b$4=`aaaaaaaaaacccddeeeeeeeegghiiiiiilmnnnnoooooooooprrsssssttuuuuuuuuuwxyyzzz------`,p$5=new RegExp(a$2.split(``).join(`|`),`g`);return str.toString().replace(/[A-Z]/g,s$1=>`-${s$1}`).toLowerCase().replace(/\s+/g,`-`).replace(p$5,c$4=>b$4.charAt(a$2.indexOf(c$4))).replace(/&/g,`-and-`).replace(/[^\w\-]+/g,``).replace(/-{2,}/g,`-`).replace(/^-+/,``).replace(/-+$/,``)}const CUSTOM_PRESETS$1=Symbol(``),MotionComponentProps$1={preset:{type:String,required:!1},instance:{type:Object,required:!1},variants:{type:Object,required:!1},initial:{type:Object,required:!1},enter:{type:Object,required:!1},leave:{type:Object,required:!1},visible:{type:Object,required:!1},visibleOnce:{type:Object,required:!1},hovered:{type:Object,required:!1},tapped:{type:Object,required:!1},focused:{type:Object,required:!1},delay:{type:[Number,String],required:!1},duration:{type:[Number,String],required:!1}};function isObject$3(val){return Object.prototype.toString.call(val)===`[object Object]`}function clone$1(v$2){if(Array.isArray(v$2))return v$2.map(clone$1);if(isObject$3(v$2)){let res={};for(let key$2 in v$2)res[key$2]=clone$1(v$2[key$2]);return res}return v$2}function setupMotionComponent$1(props){let instances=reactive({}),customPresets=inject(CUSTOM_PRESETS$1,{}),preset=computed(()=>props.preset==null?{}:customPresets!=null&&props.preset in customPresets?structuredClone(toRaw(customPresets)[props.preset]):props.preset in presets$1?structuredClone(presets$1[props.preset]):{}),propsConfig=computed(()=>({initial:props.initial,enter:props.enter,leave:props.leave,visible:props.visible,visibleOnce:props.visibleOnce,hovered:props.hovered,tapped:props.tapped,focused:props.focused}));function applyTransitionHelpers(config,values){for(let transitionKey of[`delay`,`duration`]){if(values[transitionKey]==null)continue;let transitionValueParsed=Number.parseInt(values[transitionKey]);for(let variantKey of[`enter`,`visible`,`visibleOnce`]){let variantConfig=config[variantKey];if(variantConfig==null)continue;variantConfig.transition??={},variantConfig.transition[transitionKey]=transitionValueParsed}}return config}let motionConfig=computed(()=>{let config=defu({},propsConfig.value,preset.value,props.variants||{});return applyTransitionHelpers({...config},props)});function setNodeInstance(node$1,index$1,style){node$1.props??={},node$1.props.style??={},node$1.props.style={...node$1.props.style,...style};let elementMotionConfig=applyTransitionHelpers(clone$1(motionConfig.value),node$1.props);return node$1.props.onVnodeMounted=({el:el$1})=>{instances[index$1]=useMotion$1(el$1,elementMotionConfig)},node$1.props.onVnodeUpdated=({el:el$1})=>{let styles=variantToStyle$1(instances[index$1].state);for(let[key$2,val]of Object.entries(styles))el$1.style[key$2]=val},node$1}return{motionConfig,setNodeInstance}}const MotionComponent$1=defineComponent({name:`Motion`,props:{...MotionComponentProps$1,is:{type:[String,Object],default:`div`}},setup(props){let slots=useSlots(),{motionConfig,setNodeInstance}=setupMotionComponent$1(props);return()=>{let style=variantToStyle$1(motionConfig.value.initial||{}),node$1=h(props.is,void 0,slots);return setNodeInstance(node$1,0,style),node$1}}}),MotionGroupComponent$1=defineComponent({name:`MotionGroup`,props:{...MotionComponentProps$1,is:{type:[String,Object],required:!1}},setup(props){let slots=useSlots(),{motionConfig,setNodeInstance}=setupMotionComponent$1(props);return()=>{let style=variantToStyle$1(motionConfig.value.initial||{}),nodes=slots.default?.()||[];for(let i$1=0;i$1activePinia=pinia$1,piniaSymbol=Symbol();function isPlainObject$4(o$1){return o$1&&typeof o$1==`object`&&Object.prototype.toString.call(o$1)===`[object Object]`&&typeof o$1.toJSON!=`function`}var MutationType;(function(MutationType$1){MutationType$1.direct=`direct`,MutationType$1.patchObject=`patch object`,MutationType$1.patchFunction=`patch function`})(MutationType||={});const IS_CLIENT=typeof window<`u`,_global=(()=>typeof window==`object`&&window.window===window?window:typeof self==`object`&&self.self===self?self:typeof global==`object`&&global.global===global?global:typeof globalThis==`object`?globalThis:{HTMLElement:null})();function bom(blob,{autoBom=!1}={}){return autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(blob.type)?new Blob([``,blob],{type:blob.type}):blob}function download(url,name$2,opts){let xhr=new XMLHttpRequest;xhr.open(`GET`,url),xhr.responseType=`blob`,xhr.onload=function(){saveAs(xhr.response,name$2,opts)},xhr.onerror=function(){console.error(`could not download file`)},xhr.send()}function corsEnabled(url){let xhr=new XMLHttpRequest;xhr.open(`HEAD`,url,!1);try{xhr.send()}catch{}return xhr.status>=200&&xhr.status<=299}function click(node$1){try{node$1.dispatchEvent(new MouseEvent(`click`))}catch{let evt=new MouseEvent(`click`,{bubbles:!0,cancelable:!0,view:window,detail:0,screenX:80,screenY:20,clientX:80,clientY:20,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null});node$1.dispatchEvent(evt)}}const _navigator=typeof navigator==`object`?navigator:{userAgent:``},isMacOSWebView=(()=>/Macintosh/.test(_navigator.userAgent)&&/AppleWebKit/.test(_navigator.userAgent)&&!/Safari/.test(_navigator.userAgent))(),saveAs=IS_CLIENT?typeof HTMLAnchorElement<`u`&&`download`in HTMLAnchorElement.prototype&&!isMacOSWebView?downloadSaveAs:`msSaveOrOpenBlob`in _navigator?msSaveAs:fileSaverSaveAs:()=>{};function downloadSaveAs(blob,name$2=`download`,opts){let a$2=document.createElement(`a`);a$2.download=name$2,a$2.rel=`noopener`,typeof blob==`string`?(a$2.href=blob,a$2.origin===location.origin?click(a$2):corsEnabled(a$2.href)?download(blob,name$2,opts):(a$2.target=`_blank`,click(a$2))):(a$2.href=URL.createObjectURL(blob),setTimeout(function(){URL.revokeObjectURL(a$2.href)},4e4),setTimeout(function(){click(a$2)},0))}function msSaveAs(blob,name$2=`download`,opts){if(typeof blob==`string`)if(corsEnabled(blob))download(blob,name$2,opts);else{let a$2=document.createElement(`a`);a$2.href=blob,a$2.target=`_blank`,setTimeout(function(){click(a$2)})}else navigator.msSaveOrOpenBlob(bom(blob,opts),name$2)}function fileSaverSaveAs(blob,name$2,opts,popup){if(popup||=open(``,`_blank`),popup&&(popup.document.title=popup.document.body.innerText=`downloading...`),typeof blob==`string`)return download(blob,name$2,opts);let force=blob.type===`application/octet-stream`,isSafari=/constructor/i.test(String(_global.HTMLElement))||`safari`in _global,isChromeIOS=/CriOS\/[\d]+/.test(navigator.userAgent);if((isChromeIOS||force&&isSafari||isMacOSWebView)&&typeof FileReader<`u`){let reader=new FileReader;reader.onloadend=function(){let url=reader.result;if(typeof url!=`string`)throw popup=null,Error(`Wrong reader.result type`);url=isChromeIOS?url:url.replace(/^data:[^;]*;/,`data:attachment/file;`),popup?popup.location.href=url:location.assign(url),popup=null},reader.readAsDataURL(blob)}else{let url=URL.createObjectURL(blob);popup?popup.location.assign(url):location.href=url,popup=null,setTimeout(function(){URL.revokeObjectURL(url)},4e4)}}const{assign:assign$1$1}=Object;function createPinia(){let scope=effectScope(!0),state=scope.run(()=>ref({})),_p$1=[],toBeInstalled=[],pinia$1=markRaw({install(app){setActivePinia(pinia$1),pinia$1._a=app,app.provide(piniaSymbol,pinia$1),app.config.globalProperties.$pinia=pinia$1,toBeInstalled.forEach(plugin=>_p$1.push(plugin)),toBeInstalled=[]},use(plugin){return this._a?_p$1.push(plugin):toBeInstalled.push(plugin),this},_p:_p$1,_a:null,_e:scope,_s:new Map,state});return pinia$1}const noop$2=()=>{};function addSubscription(subscriptions,callback,detached,onCleanup=noop$2){subscriptions.push(callback);let removeSubscription=()=>{let idx=subscriptions.indexOf(callback);idx>-1&&(subscriptions.splice(idx,1),onCleanup())};return!detached&&getCurrentScope()&&onScopeDispose(removeSubscription),removeSubscription}function triggerSubscriptions(subscriptions,...args){subscriptions.slice().forEach(callback=>{callback(...args)})}const fallbackRunWithContext=fn$6=>fn$6(),ACTION_MARKER=Symbol(),ACTION_NAME=Symbol();function mergeReactiveObjects(target$1,patchToApply){for(let key$2 in target$1 instanceof Map&&patchToApply instanceof Map?patchToApply.forEach((value$1,key$2)=>target$1.set(key$2,value$1)):target$1 instanceof Set&&patchToApply instanceof Set&&patchToApply.forEach(target$1.add,target$1),patchToApply){if(!patchToApply.hasOwnProperty(key$2))continue;let subPatch=patchToApply[key$2],targetValue=target$1[key$2];isPlainObject$4(targetValue)&&isPlainObject$4(subPatch)&&target$1.hasOwnProperty(key$2)&&!isRef(subPatch)&&!isReactive(subPatch)?target$1[key$2]=mergeReactiveObjects(targetValue,subPatch):target$1[key$2]=subPatch}return target$1}const skipHydrateSymbol=Symbol();function shouldHydrate(obj){return!isPlainObject$4(obj)||!Object.prototype.hasOwnProperty.call(obj,skipHydrateSymbol)}const{assign:assign$2}=Object;function isComputed(o$1){return!!(isRef(o$1)&&o$1.effect)}function createOptionsStore(id$1,options$1,pinia$1,hot){let{state,actions,getters}=options$1,initialState=pinia$1.state.value[id$1],store;function setup(){initialState||(pinia$1.state.value[id$1]=state?state():{});let localState=toRefs(pinia$1.state.value[id$1]);return assign$2(localState,actions,Object.keys(getters||{}).reduce((computedGetters,name$2)=>(computedGetters[name$2]=markRaw(computed(()=>{setActivePinia(pinia$1);let store$1=pinia$1._s.get(id$1);return getters[name$2].call(store$1,store$1)})),computedGetters),{}))}return store=createSetupStore(id$1,setup,options$1,pinia$1,hot,!0),store}function createSetupStore($id,setup,options$1={},pinia$1,hot,isOptionsStore){let scope,optionsForPlugin=assign$2({actions:{}},options$1),$subscribeOptions={deep:!0},isListening,isSyncListening,subscriptions=[],actionSubscriptions=[],debuggerEvents,initialState=pinia$1.state.value[$id];!isOptionsStore&&!initialState&&(pinia$1.state.value[$id]={});let hotState=ref({}),activeListener;function $patch(partialStateOrMutator){let subscriptionMutation;isListening=isSyncListening=!1,typeof partialStateOrMutator==`function`?(partialStateOrMutator(pinia$1.state.value[$id]),subscriptionMutation={type:MutationType.patchFunction,storeId:$id,events:debuggerEvents}):(mergeReactiveObjects(pinia$1.state.value[$id],partialStateOrMutator),subscriptionMutation={type:MutationType.patchObject,payload:partialStateOrMutator,storeId:$id,events:debuggerEvents});let myListenerId=activeListener=Symbol();nextTick().then(()=>{activeListener===myListenerId&&(isListening=!0)}),isSyncListening=!0,triggerSubscriptions(subscriptions,subscriptionMutation,pinia$1.state.value[$id])}let $reset=isOptionsStore?function(){let{state}=options$1,newState=state?state():{};this.$patch($state=>{assign$2($state,newState)})}:noop$2;function $dispose(){scope.stop(),subscriptions=[],actionSubscriptions=[],pinia$1._s.delete($id)}let action=(fn$6,name$2=``)=>{if(ACTION_MARKER in fn$6)return fn$6[ACTION_NAME]=name$2,fn$6;let wrappedAction=function(){setActivePinia(pinia$1);let args=Array.from(arguments),afterCallbackList=[],onErrorCallbackList=[];function after(callback){afterCallbackList.push(callback)}function onError(callback){onErrorCallbackList.push(callback)}triggerSubscriptions(actionSubscriptions,{args,name:wrappedAction[ACTION_NAME],store,after,onError});let ret;try{ret=fn$6.apply(this&&this.$id===$id?this:store,args)}catch(error){throw triggerSubscriptions(onErrorCallbackList,error),error}return ret instanceof Promise?ret.then(value$1=>(triggerSubscriptions(afterCallbackList,value$1),value$1)).catch(error=>(triggerSubscriptions(onErrorCallbackList,error),Promise.reject(error))):(triggerSubscriptions(afterCallbackList,ret),ret)};return wrappedAction[ACTION_MARKER]=!0,wrappedAction[ACTION_NAME]=name$2,wrappedAction},_hmrPayload=markRaw({actions:{},getters:{},state:[],hotState}),partialStore={_p:pinia$1,$id,$onAction:addSubscription.bind(null,actionSubscriptions),$patch,$reset,$subscribe(callback,options$2={}){let removeSubscription=addSubscription(subscriptions,callback,options$2.detached,()=>stopWatcher()),stopWatcher=scope.run(()=>watch(()=>pinia$1.state.value[$id],state=>{(options$2.flush===`sync`?isSyncListening:isListening)&&callback({storeId:$id,type:MutationType.direct,events:debuggerEvents},state)},assign$2({},$subscribeOptions,options$2)));return removeSubscription},$dispose},store=reactive(partialStore);pinia$1._s.set($id,store);let runWithContext=pinia$1._a&&pinia$1._a.runWithContext||fallbackRunWithContext,setupStore=runWithContext(()=>pinia$1._e.run(()=>(scope=effectScope()).run(()=>setup({action}))));for(let key$2 in setupStore){let prop=setupStore[key$2];if(isRef(prop)&&!isComputed(prop)||isReactive(prop))isOptionsStore||(initialState&&shouldHydrate(prop)&&(isRef(prop)?prop.value=initialState[key$2]:mergeReactiveObjects(prop,initialState[key$2])),pinia$1.state.value[$id][key$2]=prop);else if(typeof prop==`function`){let actionValue=action(prop,key$2);setupStore[key$2]=actionValue,optionsForPlugin.actions[key$2]=prop}}return assign$2(store,setupStore),assign$2(toRaw(store),setupStore),Object.defineProperty(store,`$state`,{get:()=>pinia$1.state.value[$id],set:state=>{$patch($state=>{assign$2($state,state)})}}),pinia$1._p.forEach(extender=>{assign$2(store,scope.run(()=>extender({store,app:pinia$1._a,pinia:pinia$1,options:optionsForPlugin})))}),initialState&&isOptionsStore&&options$1.hydrate&&options$1.hydrate(store.$state,initialState),isListening=!0,isSyncListening=!0,store} /*! #__NO_SIDE_EFFECTS__ */ -function defineStore(id$1,setup,setupOptions){let options$1,isSetupStore=typeof setup==`function`;options$1=isSetupStore?setupOptions:setup;function useStore(pinia$1,hot){let hasContext=hasInjectionContext();pinia$1||=hasContext?inject(piniaSymbol,null):null,pinia$1&&setActivePinia(pinia$1),pinia$1=activePinia,pinia$1._s.has(id$1)||(isSetupStore?createSetupStore(id$1,setup,options$1,pinia$1):createOptionsStore(id$1,options$1,pinia$1));let store=pinia$1._s.get(id$1);return store}return useStore.$id=id$1,useStore}function storeToRefs(store){let rawStore=toRaw(store),refs={};for(let key$2 in rawStore){let value$1=rawStore[key$2];value$1.effect?refs[key$2]=computed({get:()=>store[key$2],set(value$2){store[key$2]=value$2}}):(isRef(value$1)||isReactive(value$1))&&(refs[key$2]=toRef(store,key$2))}return refs}const scriptRel=`modulepreload`,assetsURL=function(dep){return`/`+dep},seen={},__vitePreload=function(baseModule,deps,importerUrl){let promise=Promise.resolve();if(deps&&deps.length>0){let links=document.getElementsByTagName(`link`),cspNonceMeta=document.querySelector(`meta[property=csp-nonce]`),cspNonce=cspNonceMeta?.nonce||cspNonceMeta?.getAttribute(`nonce`);function allSettled(promises$2){return Promise.all(promises$2.map(p$1$1=>Promise.resolve(p$1$1).then(value$1=>({status:`fulfilled`,value:value$1}),reason=>({status:`rejected`,reason}))))}promise=allSettled(deps.map(dep=>{if(dep=assetsURL(dep,importerUrl),dep in seen)return;seen[dep]=!0;let isCss=dep.endsWith(`.css`),cssSelector=isCss?`[rel="stylesheet"]`:``,isBaseRelative=!!importerUrl;if(isBaseRelative)for(let i$1=links.length-1;i$1>=0;i$1--){let link$1$1=links[i$1];if(link$1$1.href===dep&&(!isCss||link$1$1.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${dep}"]${cssSelector}`))return;let link$1=document.createElement(`link`);if(link$1.rel=isCss?`stylesheet`:scriptRel,isCss||(link$1.as=`script`),link$1.crossOrigin=``,link$1.href=dep,cspNonce&&link$1.setAttribute(`nonce`,cspNonce),document.head.appendChild(link$1),isCss)return new Promise((res,rej)=>{link$1.addEventListener(`load`,res),link$1.addEventListener(`error`,()=>rej(Error(`Unable to preload CSS for ${dep}`)))})}))}function handlePreloadError(err$2){let e$1$1=new Event(`vite:preloadError`,{cancelable:!0});if(e$1$1.payload=err$2,window.dispatchEvent(e$1$1),!e$1$1.defaultPrevented)throw err$2}return promise.then(res=>{for(let item of res||[]){if(item.status!==`rejected`)continue;handlePreloadError(item.reason)}return baseModule().catch(handlePreloadError)})},setupLayouts=routes$1=>{let layouts={},modules=Object.assign({"/src/layouts/default.vue":()=>__vitePreload(()=>import(`./default-DP_2zDq7.js`),__vite__mapDeps([0,1,2])),"/src/layouts/home.vue":()=>__vitePreload(()=>import(`./home-D7dZM1bj.js`),[]),"/src/layouts/plain.vue":()=>__vitePreload(()=>import(`./plain-rPj2okum.js`),[]),"/src/layouts/settings.vue":()=>__vitePreload(()=>import(`./settings-CdksUo4j.js`),__vite__mapDeps([3,1,2,4])),"/src/layouts/stage.vue":()=>__vitePreload(()=>import(`./stage-DR-1n1Ev.js`),[])});Object.entries(modules).forEach(([name$2,module$1])=>{let key$2=name$2.replace(`/src/layouts/`,``).replace(`.vue`,``);layouts[key$2]=module$1});function deepSetupLayout(routes$2,top=!0){return routes$2.map(route=>{if(route.children?.length>0&&(route.children=deepSetupLayout(route.children,!1)),top){let skipLayout=!route.component&&route.children?.find(r$2=>(r$2.path===``||r$2.path===`/`)&&r$2.meta?.isLayout);if(skipLayout)return route;if(route.meta?.layout!==!1)return{path:route.path,component:layouts[route.meta?.layout||`default`],children:route.path===`/`?[route]:[{...route,path:``}],meta:{isLayout:!0}}}return route.meta?.layout?{path:route.path,component:layouts[route.meta?.layout],children:[{...route,path:``}],meta:{isLayout:!0}}:route})}return deepSetupLayout(routes$1)},isBrowser$2=typeof document<`u`;function isRouteComponent(component){return typeof component==`object`||`displayName`in component||`props`in component||`__vccOpts`in component}function isESModule(obj){return obj.__esModule||obj[Symbol.toStringTag]===`Module`||obj.default&&isRouteComponent(obj.default)}const assign$1=Object.assign;function applyToParams(fn$6,params){let newParams={};for(let key$2 in params){let value$1=params[key$2];newParams[key$2]=isArray$3(value$1)?value$1.map(fn$6):fn$6(value$1)}return newParams}const noop$1=()=>{},isArray$3=Array.isArray,HASH_RE=/#/g,AMPERSAND_RE=/&/g,SLASH_RE=/\//g,EQUAL_RE=/=/g,IM_RE=/\?/g,PLUS_RE=/\+/g,ENC_BRACKET_OPEN_RE=/%5B/g,ENC_BRACKET_CLOSE_RE=/%5D/g,ENC_CARET_RE=/%5E/g,ENC_BACKTICK_RE=/%60/g,ENC_CURLY_OPEN_RE=/%7B/g,ENC_PIPE_RE=/%7C/g,ENC_CURLY_CLOSE_RE=/%7D/g,ENC_SPACE_RE=/%20/g;function commonEncode(text$5){return encodeURI(``+text$5).replace(ENC_PIPE_RE,`|`).replace(ENC_BRACKET_OPEN_RE,`[`).replace(ENC_BRACKET_CLOSE_RE,`]`)}function encodeHash(text$5){return commonEncode(text$5).replace(ENC_CURLY_OPEN_RE,`{`).replace(ENC_CURLY_CLOSE_RE,`}`).replace(ENC_CARET_RE,`^`)}function encodeQueryValue(text$5){return commonEncode(text$5).replace(PLUS_RE,`%2B`).replace(ENC_SPACE_RE,`+`).replace(HASH_RE,`%23`).replace(AMPERSAND_RE,`%26`).replace(ENC_BACKTICK_RE,"`").replace(ENC_CURLY_OPEN_RE,`{`).replace(ENC_CURLY_CLOSE_RE,`}`).replace(ENC_CARET_RE,`^`)}function encodeQueryKey(text$5){return encodeQueryValue(text$5).replace(EQUAL_RE,`%3D`)}function encodePath(text$5){return commonEncode(text$5).replace(HASH_RE,`%23`).replace(IM_RE,`%3F`)}function encodeParam(text$5){return text$5==null?``:encodePath(text$5).replace(SLASH_RE,`%2F`)}function decode$1(text$5){try{return decodeURIComponent(``+text$5)}catch{}return``+text$5}const TRAILING_SLASH_RE=/\/$/,removeTrailingSlash=path=>path.replace(TRAILING_SLASH_RE,``);function parseURL(parseQuery$1,location$1,currentLocation=`/`){let path,query={},searchString=``,hash=``,hashPos=location$1.indexOf(`#`),searchPos=location$1.indexOf(`?`);return hashPos=0&&(searchPos=-1),searchPos>-1&&(path=location$1.slice(0,searchPos),searchString=location$1.slice(searchPos+1,hashPos>-1?hashPos:location$1.length),query=parseQuery$1(searchString)),hashPos>-1&&(path||=location$1.slice(0,hashPos),hash=location$1.slice(hashPos,location$1.length)),path=resolveRelativePath(path??location$1,currentLocation),{fullPath:path+(searchString&&`?`)+searchString+hash,path,query,hash:decode$1(hash)}}function stringifyURL(stringifyQuery$1,location$1){let query=location$1.query?stringifyQuery$1(location$1.query):``;return location$1.path+(query&&`?`)+query+(location$1.hash||``)}function stripBase(pathname,base){return!base||!pathname.toLowerCase().startsWith(base.toLowerCase())?pathname:pathname.slice(base.length)||`/`}function isSameRouteLocation(stringifyQuery$1,a$2,b$4){let aLastIndex=a$2.matched.length-1,bLastIndex=b$4.matched.length-1;return aLastIndex>-1&&aLastIndex===bLastIndex&&isSameRouteRecord(a$2.matched[aLastIndex],b$4.matched[bLastIndex])&&isSameRouteLocationParams(a$2.params,b$4.params)&&stringifyQuery$1(a$2.query)===stringifyQuery$1(b$4.query)&&a$2.hash===b$4.hash}function isSameRouteRecord(a$2,b$4){return(a$2.aliasOf||a$2)===(b$4.aliasOf||b$4)}function isSameRouteLocationParams(a$2,b$4){if(Object.keys(a$2).length!==Object.keys(b$4).length)return!1;for(let key$2 in a$2)if(!isSameRouteLocationParamsValue(a$2[key$2],b$4[key$2]))return!1;return!0}function isSameRouteLocationParamsValue(a$2,b$4){return isArray$3(a$2)?isEquivalentArray(a$2,b$4):isArray$3(b$4)?isEquivalentArray(b$4,a$2):a$2===b$4}function isEquivalentArray(a$2,b$4){return isArray$3(b$4)?a$2.length===b$4.length&&a$2.every((value$1,i$1)=>value$1===b$4[i$1]):a$2.length===1&&a$2[0]===b$4}function resolveRelativePath(to$2,from){if(to$2.startsWith(`/`))return to$2;if(!to$2)return from;let fromSegments=from.split(`/`),toSegments=to$2.split(`/`),lastToSegment=toSegments[toSegments.length-1];(lastToSegment===`..`||lastToSegment===`.`)&&toSegments.push(``);let position$2=fromSegments.length-1,toPosition,segment;for(toPosition=0;toPosition1&&position$2--;else break;return fromSegments.slice(0,position$2).join(`/`)+`/`+toSegments.slice(toPosition).join(`/`)}const START_LOCATION_NORMALIZED={path:`/`,name:void 0,params:{},query:{},hash:``,fullPath:`/`,matched:[],meta:{},redirectedFrom:void 0};var NavigationType;(function(NavigationType$1){NavigationType$1.pop=`pop`,NavigationType$1.push=`push`})(NavigationType||={});var NavigationDirection;(function(NavigationDirection$1){NavigationDirection$1.back=`back`,NavigationDirection$1.forward=`forward`,NavigationDirection$1.unknown=``})(NavigationDirection||={});function normalizeBase(base){if(!base)if(isBrowser$2){let baseEl=document.querySelector(`base`);base=baseEl&&baseEl.getAttribute(`href`)||`/`,base=base.replace(/^\w+:\/\/[^\/]+/,``)}else base=`/`;return base[0]!==`/`&&base[0]!==`#`&&(base=`/`+base),removeTrailingSlash(base)}const BEFORE_HASH_RE=/^[^#]+#/;function createHref(base,location$1){return base.replace(BEFORE_HASH_RE,`#`)+location$1}function getElementPosition(el$1,offset$2){let docRect=document.documentElement.getBoundingClientRect(),elRect=el$1.getBoundingClientRect();return{behavior:offset$2.behavior,left:elRect.left-docRect.left-(offset$2.left||0),top:elRect.top-docRect.top-(offset$2.top||0)}}const computeScrollPosition=()=>({left:window.scrollX,top:window.scrollY});function scrollToPosition(position$2){let scrollToOptions;if(`el`in position$2){let positionEl=position$2.el,isIdSelector=typeof positionEl==`string`&&positionEl.startsWith(`#`),el$1=typeof positionEl==`string`?isIdSelector?document.getElementById(positionEl.slice(1)):document.querySelector(positionEl):positionEl;if(!el$1)return;scrollToOptions=getElementPosition(el$1,position$2)}else scrollToOptions=position$2;`scrollBehavior`in document.documentElement.style?window.scrollTo(scrollToOptions):window.scrollTo(scrollToOptions.left==null?window.scrollX:scrollToOptions.left,scrollToOptions.top==null?window.scrollY:scrollToOptions.top)}function getScrollKey(path,delta){let position$2=history.state?history.state.position-delta:-1;return position$2+path}const scrollPositions=new Map;function saveScrollPosition(key$2,scrollPosition){scrollPositions.set(key$2,scrollPosition)}function getSavedScrollPosition(key$2){let scroll=scrollPositions.get(key$2);return scrollPositions.delete(key$2),scroll}let createBaseLocation=()=>location.protocol+`//`+location.host;function createCurrentLocation(base,location$1){let{pathname,search:search$1,hash}=location$1,hashPos=base.indexOf(`#`);if(hashPos>-1){let slicePos=hash.includes(base.slice(hashPos))?base.slice(hashPos).length:1,pathFromHash=hash.slice(slicePos);return pathFromHash[0]!==`/`&&(pathFromHash=`/`+pathFromHash),stripBase(pathFromHash,``)}let path=stripBase(pathname,base);return path+search$1+hash}function useHistoryListeners(base,historyState,currentLocation,replace){let listeners=[],teardowns=[],pauseState=null,popStateHandler=({state})=>{let to$2=createCurrentLocation(base,location),from=currentLocation.value,fromState=historyState.value,delta=0;if(state){if(currentLocation.value=to$2,historyState.value=state,pauseState&&pauseState===from){pauseState=null;return}delta=fromState?state.position-fromState.position:0}else replace(to$2);listeners.forEach(listener=>{listener(currentLocation.value,from,{delta,type:NavigationType.pop,direction:delta?delta>0?NavigationDirection.forward:NavigationDirection.back:NavigationDirection.unknown})})};function pauseListeners(){pauseState=currentLocation.value}function listen(callback){listeners.push(callback);let teardown=()=>{let index$1=listeners.indexOf(callback);index$1>-1&&listeners.splice(index$1,1)};return teardowns.push(teardown),teardown}function beforeUnloadListener(){let{history:history$1}=window;history$1.state&&history$1.replaceState(assign$1({},history$1.state,{scroll:computeScrollPosition()}),``)}function destroy(){for(let teardown of teardowns)teardown();teardowns=[],window.removeEventListener(`popstate`,popStateHandler),window.removeEventListener(`beforeunload`,beforeUnloadListener)}return window.addEventListener(`popstate`,popStateHandler),window.addEventListener(`beforeunload`,beforeUnloadListener,{passive:!0}),{pauseListeners,listen,destroy}}function buildState(back,current,forward,replaced=!1,computeScroll=!1){return{back,current,forward,replaced,position:window.history.length,scroll:computeScroll?computeScrollPosition():null}}function useHistoryStateNavigation(base){let{history:history$1,location:location$1}=window,currentLocation={value:createCurrentLocation(base,location$1)},historyState={value:history$1.state};historyState.value||changeLocation(currentLocation.value,{back:null,current:currentLocation.value,forward:null,position:history$1.length-1,replaced:!0,scroll:null},!0);function changeLocation(to$2,state,replace$1){let hashIndex=base.indexOf(`#`),url=hashIndex>-1?(location$1.host&&document.querySelector(`base`)?base:base.slice(hashIndex))+to$2:createBaseLocation()+base+to$2;try{history$1[replace$1?`replaceState`:`pushState`](state,``,url),historyState.value=state}catch(err){console.error(err),location$1[replace$1?`replace`:`assign`](url)}}function replace(to$2,data$12){let state=assign$1({},history$1.state,buildState(historyState.value.back,to$2,historyState.value.forward,!0),data$12,{position:historyState.value.position});changeLocation(to$2,state,!0),currentLocation.value=to$2}function push$1(to$2,data$12){let currentState=assign$1({},historyState.value,history$1.state,{forward:to$2,scroll:computeScrollPosition()});changeLocation(currentState.current,currentState,!0);let state=assign$1({},buildState(currentLocation.value,to$2,null),{position:currentState.position+1},data$12);changeLocation(to$2,state,!1),currentLocation.value=to$2}return{location:currentLocation,state:historyState,push:push$1,replace}}function createWebHistory(base){base=normalizeBase(base);let historyNavigation=useHistoryStateNavigation(base),historyListeners=useHistoryListeners(base,historyNavigation.state,historyNavigation.location,historyNavigation.replace);function go$1(delta,triggerListeners=!0){triggerListeners||historyListeners.pauseListeners(),history.go(delta)}let routerHistory=assign$1({location:``,base,go:go$1,createHref:createHref.bind(null,base)},historyNavigation,historyListeners);return Object.defineProperty(routerHistory,`location`,{enumerable:!0,get:()=>historyNavigation.location.value}),Object.defineProperty(routerHistory,`state`,{enumerable:!0,get:()=>historyNavigation.state.value}),routerHistory}function createWebHashHistory(base){return base=location.host?base||location.pathname+location.search:``,base.includes(`#`)||(base+=`#`),createWebHistory(base)}function isRouteLocation(route){return typeof route==`string`||route&&typeof route==`object`}function isRouteName(name$2){return typeof name$2==`string`||typeof name$2==`symbol`}const NavigationFailureSymbol=Symbol(``);var NavigationFailureType;(function(NavigationFailureType$1){NavigationFailureType$1[NavigationFailureType$1.aborted=4]=`aborted`,NavigationFailureType$1[NavigationFailureType$1.cancelled=8]=`cancelled`,NavigationFailureType$1[NavigationFailureType$1.duplicated=16]=`duplicated`})(NavigationFailureType||={});function createRouterError(type,params){return assign$1(Error(),{type,[NavigationFailureSymbol]:!0},params)}function isNavigationFailure(error,type){return error instanceof Error&&NavigationFailureSymbol in error&&(type==null||!!(error.type&type))}const BASE_PARAM_PATTERN=`[^/]+?`,BASE_PATH_PARSER_OPTIONS={sensitive:!1,strict:!1,start:!0,end:!0},REGEX_CHARS_RE=/[.+*?^${}()[\]/\\]/g;function tokensToParser(segments,extraOptions){let options$1=assign$1({},BASE_PATH_PARSER_OPTIONS,extraOptions),score=[],pattern=options$1.start?`^`:``,keys$3=[];for(let segment of segments){let segmentScores=segment.length?[]:[90];options$1.strict&&!segment.length&&(pattern+=`/`);for(let tokenIndex=0;tokenIndexb$4.length?b$4.length===1&&b$4[0]===80?1:-1:0}function comparePathParserScore(a$2,b$4){let i$1=0,aScore=a$2.score,bScore=b$4.score;for(;i$10&&last[last.length-1]<0}const ROOT_TOKEN={type:0,value:``},VALID_PARAM_RE=/[a-zA-Z0-9_]/;function tokenizePath(path){if(!path)return[[]];if(path===`/`)return[[ROOT_TOKEN]];if(!path.startsWith(`/`))throw Error(`Invalid path "${path}"`);function crash(message$1){throw Error(`ERR (${state})/"${buffer$1}": ${message$1}`)}let state=0,previousState=state,tokens=[],segment;function finalizeSegment(){segment&&tokens.push(segment),segment=[]}let i$1=0,char,buffer$1=``,customRe=``;function consumeBuffer(){buffer$1&&(state===0?segment.push({type:0,value:buffer$1}):state===1||state===2||state===3?(segment.length>1&&(char===`*`||char===`+`)&&crash(`A repeatable param (${buffer$1}) must be alone in its segment. eg: '/:ids+.`),segment.push({type:1,value:buffer$1,regexp:customRe,repeatable:char===`*`||char===`+`,optional:char===`*`||char===`?`})):crash(`Invalid state to consume buffer`),buffer$1=``)}function addCharToBuffer(){buffer$1+=char}for(;i$1{removeRoute(originalMatcher)}:noop$1}function removeRoute(matcherRef){if(isRouteName(matcherRef)){let matcher=matcherMap.get(matcherRef);matcher&&(matcherMap.delete(matcherRef),matchers.splice(matchers.indexOf(matcher),1),matcher.children.forEach(removeRoute),matcher.alias.forEach(removeRoute))}else{let index$1=matchers.indexOf(matcherRef);index$1>-1&&(matchers.splice(index$1,1),matcherRef.record.name&&matcherMap.delete(matcherRef.record.name),matcherRef.children.forEach(removeRoute),matcherRef.alias.forEach(removeRoute))}}function getRoutes(){return matchers}function insertMatcher(matcher){let index$1=findInsertionIndex(matcher,matchers);matchers.splice(index$1,0,matcher),matcher.record.name&&!isAliasRecord(matcher)&&matcherMap.set(matcher.record.name,matcher)}function resolve$1(location$1,currentLocation){let matcher,params={},path,name$2;if(`name`in location$1&&location$1.name){if(matcher=matcherMap.get(location$1.name),!matcher)throw createRouterError(1,{location:location$1});name$2=matcher.record.name,params=assign$1(paramsFromLocation(currentLocation.params,matcher.keys.filter(k$4=>!k$4.optional).concat(matcher.parent?matcher.parent.keys.filter(k$4=>k$4.optional):[]).map(k$4=>k$4.name)),location$1.params&¶msFromLocation(location$1.params,matcher.keys.map(k$4=>k$4.name))),path=matcher.stringify(params)}else if(location$1.path!=null)path=location$1.path,matcher=matchers.find(m$3=>m$3.re.test(path)),matcher&&(params=matcher.parse(path),name$2=matcher.record.name);else{if(matcher=currentLocation.name?matcherMap.get(currentLocation.name):matchers.find(m$3=>m$3.re.test(currentLocation.path)),!matcher)throw createRouterError(1,{location:location$1,currentLocation});name$2=matcher.record.name,params=assign$1({},currentLocation.params,location$1.params),path=matcher.stringify(params)}let matched=[],parentMatcher=matcher;for(;parentMatcher;)matched.unshift(parentMatcher.record),parentMatcher=parentMatcher.parent;return{name:name$2,path,params,matched,meta:mergeMetaFields(matched)}}routes$1.forEach(route=>addRoute(route));function clearRoutes(){matchers.length=0,matcherMap.clear()}return{addRoute,resolve:resolve$1,removeRoute,clearRoutes,getRoutes,getRecordMatcher}}function paramsFromLocation(params,keys$3){let newParams={};for(let key$2 of keys$3)key$2 in params&&(newParams[key$2]=params[key$2]);return newParams}function normalizeRouteRecord(record){let normalized={path:record.path,redirect:record.redirect,name:record.name,meta:record.meta||{},aliasOf:record.aliasOf,beforeEnter:record.beforeEnter,props:normalizeRecordProps(record),children:record.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:`components`in record?record.components||null:record.component&&{default:record.component}};return Object.defineProperty(normalized,`mods`,{value:{}}),normalized}function normalizeRecordProps(record){let propsObject={},props=record.props||!1;if(`component`in record)propsObject.default=props;else for(let name$2 in record.components)propsObject[name$2]=typeof props==`object`?props[name$2]:props;return propsObject}function isAliasRecord(record){for(;record;){if(record.record.aliasOf)return!0;record=record.parent}return!1}function mergeMetaFields(matched){return matched.reduce((meta,record)=>assign$1(meta,record.meta),{})}function mergeOptions(defaults$1,partialOptions){let options$1={};for(let key$2 in defaults$1)options$1[key$2]=key$2 in partialOptions?partialOptions[key$2]:defaults$1[key$2];return options$1}function findInsertionIndex(matcher,matchers){let lower=0,upper=matchers.length;for(;lower!==upper;){let mid=lower+upper>>1,sortOrder=comparePathParserScore(matcher,matchers[mid]);sortOrder<0?upper=mid:lower=mid+1}let insertionAncestor=getInsertionAncestor(matcher);return insertionAncestor&&(upper=matchers.lastIndexOf(insertionAncestor,upper-1)),upper}function getInsertionAncestor(matcher){let ancestor=matcher;for(;ancestor=ancestor.parent;)if(isMatchable(ancestor)&&comparePathParserScore(matcher,ancestor)===0)return ancestor}function isMatchable({record}){return!!(record.name||record.components&&Object.keys(record.components).length||record.redirect)}function parseQuery(search$1){let query={};if(search$1===``||search$1===`?`)return query;let hasLeadingIM=search$1[0]===`?`,searchParams=(hasLeadingIM?search$1.slice(1):search$1).split(`&`);for(let i$1=0;i$1v$2&&encodeQueryValue(v$2)):[value$1&&encodeQueryValue(value$1)];values.forEach(value$2=>{value$2!==void 0&&(search$1+=(search$1.length?`&`:``)+key$2,value$2!=null&&(search$1+=`=`+value$2))})}return search$1}function normalizeQuery(query){let normalizedQuery={};for(let key$2 in query){let value$1=query[key$2];value$1!==void 0&&(normalizedQuery[key$2]=isArray$3(value$1)?value$1.map(v$2=>v$2==null?null:``+v$2):value$1==null?value$1:``+value$1)}return normalizedQuery}const matchedRouteKey=Symbol(``),viewDepthKey=Symbol(``),routerKey=Symbol(``),routeLocationKey=Symbol(``),routerViewLocationKey=Symbol(``);function useCallbacks(){let handlers$3=[];function add$1(handler){return handlers$3.push(handler),()=>{let i$1=handlers$3.indexOf(handler);i$1>-1&&handlers$3.splice(i$1,1)}}function reset(){handlers$3=[]}return{add:add$1,list:()=>handlers$3.slice(),reset}}function guardToPromiseFn(guard,to$2,from,record,name$2,runWithContext=fn$6=>fn$6()){let enterCallbackArray=record&&(record.enterCallbacks[name$2]=record.enterCallbacks[name$2]||[]);return()=>new Promise((resolve$1,reject)=>{let next=valid$1=>{valid$1===!1?reject(createRouterError(4,{from,to:to$2})):valid$1 instanceof Error?reject(valid$1):isRouteLocation(valid$1)?reject(createRouterError(2,{from:to$2,to:valid$1})):(enterCallbackArray&&record.enterCallbacks[name$2]===enterCallbackArray&&typeof valid$1==`function`&&enterCallbackArray.push(valid$1),resolve$1())},guardReturn=runWithContext(()=>guard.call(record&&record.instances[name$2],to$2,from,next)),guardCall=Promise.resolve(guardReturn);guard.length<3&&(guardCall=guardCall.then(next)),guardCall.catch(err=>reject(err))})}function extractComponentsGuards(matched,guardType,to$2,from,runWithContext=fn$6=>fn$6()){let guards=[];for(let record of matched)for(let name$2 in record.components){let rawComponent=record.components[name$2];if(guardType!==`beforeRouteEnter`&&!record.instances[name$2])continue;if(isRouteComponent(rawComponent)){let options$1=rawComponent.__vccOpts||rawComponent,guard=options$1[guardType];guard&&guards.push(guardToPromiseFn(guard,to$2,from,record,name$2,runWithContext))}else{let componentPromise=rawComponent();guards.push(()=>componentPromise.then(resolved=>{if(!resolved)throw Error(`Couldn't resolve component "${name$2}" at "${record.path}"`);let resolvedComponent=isESModule(resolved)?resolved.default:resolved;record.mods[name$2]=resolved,record.components[name$2]=resolvedComponent;let options$1=resolvedComponent.__vccOpts||resolvedComponent,guard=options$1[guardType];return guard&&guardToPromiseFn(guard,to$2,from,record,name$2,runWithContext)()}))}}return guards}function useLink(props){let router$1=inject(routerKey),currentRoute=inject(routeLocationKey),hasPrevious=!1,previousTo=null,route=computed(()=>{let to$2=unref(props.to);return router$1.resolve(to$2)}),activeRecordIndex=computed(()=>{let{matched}=route.value,{length}=matched,routeMatched=matched[length-1],currentMatched=currentRoute.matched;if(!routeMatched||!currentMatched.length)return-1;let index$1=currentMatched.findIndex(isSameRouteRecord.bind(null,routeMatched));if(index$1>-1)return index$1;let parentRecordPath=getOriginalPath(matched[length-2]);return length>1&&getOriginalPath(routeMatched)===parentRecordPath&¤tMatched[currentMatched.length-1].path!==parentRecordPath?currentMatched.findIndex(isSameRouteRecord.bind(null,matched[length-2])):index$1}),isActive=computed(()=>activeRecordIndex.value>-1&&includesParams(currentRoute.params,route.value.params)),isExactActive=computed(()=>activeRecordIndex.value>-1&&activeRecordIndex.value===currentRoute.matched.length-1&&isSameRouteLocationParams(currentRoute.params,route.value.params));function navigate(e$3={}){if(guardEvent(e$3)){let p$5=router$1[unref(props.replace)?`replace`:`push`](unref(props.to)).catch(noop$1);return props.viewTransition&&typeof document<`u`&&`startViewTransition`in document&&document.startViewTransition(()=>p$5),p$5}return Promise.resolve()}return{route,href:computed(()=>route.value.href),isActive,isExactActive,navigate}}function preferSingleVNode(vnodes){return vnodes.length===1?vnodes[0]:vnodes}const RouterLinkImpl=defineComponent({name:`RouterLink`,compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:`page`},viewTransition:Boolean},useLink,setup(props,{slots}){let link$1=reactive(useLink(props)),{options:options$1}=inject(routerKey),elClass=computed(()=>({[getLinkClass(props.activeClass,options$1.linkActiveClass,`router-link-active`)]:link$1.isActive,[getLinkClass(props.exactActiveClass,options$1.linkExactActiveClass,`router-link-exact-active`)]:link$1.isExactActive}));return()=>{let children=slots.default&&preferSingleVNode(slots.default(link$1));return props.custom?children:h(`a`,{"aria-current":link$1.isExactActive?props.ariaCurrentValue:null,href:link$1.href,onClick:link$1.navigate,class:elClass.value},children)}}}),RouterLink=RouterLinkImpl;function guardEvent(e$3){if(!(e$3.metaKey||e$3.altKey||e$3.ctrlKey||e$3.shiftKey)&&!e$3.defaultPrevented&&!(e$3.button!==void 0&&e$3.button!==0)){if(e$3.currentTarget&&e$3.currentTarget.getAttribute){let target$1=e$3.currentTarget.getAttribute(`target`);if(/\b_blank\b/i.test(target$1))return}return e$3.preventDefault&&e$3.preventDefault(),!0}}function includesParams(outer,inner){for(let key$2 in inner){let innerValue=inner[key$2],outerValue=outer[key$2];if(typeof innerValue==`string`){if(innerValue!==outerValue)return!1}else if(!isArray$3(outerValue)||outerValue.length!==innerValue.length||innerValue.some((value$1,i$1)=>value$1!==outerValue[i$1]))return!1}return!0}function getOriginalPath(record){return record?record.aliasOf?record.aliasOf.path:record.path:``}const getLinkClass=(propClass,globalClass,defaultClass)=>propClass??globalClass??defaultClass,RouterViewImpl=defineComponent({name:`RouterView`,inheritAttrs:!1,props:{name:{type:String,default:`default`},route:Object},compatConfig:{MODE:3},setup(props,{attrs,slots}){let injectedRoute=inject(routerViewLocationKey),routeToDisplay=computed(()=>props.route||injectedRoute.value),injectedDepth=inject(viewDepthKey,0),depth=computed(()=>{let initialDepth=unref(injectedDepth),{matched}=routeToDisplay.value,matchedRoute;for(;(matchedRoute=matched[initialDepth])&&!matchedRoute.components;)initialDepth++;return initialDepth}),matchedRouteRef=computed(()=>routeToDisplay.value.matched[depth.value]);provide(viewDepthKey,computed(()=>depth.value+1)),provide(matchedRouteKey,matchedRouteRef),provide(routerViewLocationKey,routeToDisplay);let viewRef=ref();return watch(()=>[viewRef.value,matchedRouteRef.value,props.name],([instance,to$2,name$2],[oldInstance,from,oldName])=>{to$2&&(to$2.instances[name$2]=instance,from&&from!==to$2&&instance&&instance===oldInstance&&(to$2.leaveGuards.size||(to$2.leaveGuards=from.leaveGuards),to$2.updateGuards.size||(to$2.updateGuards=from.updateGuards))),instance&&to$2&&(!from||!isSameRouteRecord(to$2,from)||!oldInstance)&&(to$2.enterCallbacks[name$2]||[]).forEach(callback=>callback(instance))},{flush:`post`}),()=>{let route=routeToDisplay.value,currentName=props.name,matchedRoute=matchedRouteRef.value,ViewComponent=matchedRoute&&matchedRoute.components[currentName];if(!ViewComponent)return normalizeSlot(slots.default,{Component:ViewComponent,route});let routePropsOption=matchedRoute.props[currentName],routeProps=routePropsOption?routePropsOption===!0?route.params:typeof routePropsOption==`function`?routePropsOption(route):routePropsOption:null,onVnodeUnmounted=vnode=>{vnode.component.isUnmounted&&(matchedRoute.instances[currentName]=null)},component=h(ViewComponent,assign$1({},routeProps,attrs,{onVnodeUnmounted,ref:viewRef}));return normalizeSlot(slots.default,{Component:component,route})||component}}});function normalizeSlot(slot,data$12){if(!slot)return null;let slotContent=slot(data$12);return slotContent.length===1?slotContent[0]:slotContent}const RouterView=RouterViewImpl;function createRouter(options$1){let matcher=createRouterMatcher(options$1.routes,options$1),parseQuery$1=options$1.parseQuery||parseQuery,stringifyQuery$1=options$1.stringifyQuery||stringifyQuery,routerHistory=options$1.history,beforeGuards=useCallbacks(),beforeResolveGuards=useCallbacks(),afterGuards=useCallbacks(),currentRoute=shallowRef(START_LOCATION_NORMALIZED),pendingLocation=START_LOCATION_NORMALIZED;isBrowser$2&&options$1.scrollBehavior&&`scrollRestoration`in history&&(history.scrollRestoration=`manual`);let normalizeParams=applyToParams.bind(null,paramValue=>``+paramValue),encodeParams=applyToParams.bind(null,encodeParam),decodeParams=applyToParams.bind(null,decode$1);function addRoute(parentOrRoute,route){let parent,record;return isRouteName(parentOrRoute)?(parent=matcher.getRecordMatcher(parentOrRoute),record=route):record=parentOrRoute,matcher.addRoute(record,parent)}function removeRoute(name$2){let recordMatcher=matcher.getRecordMatcher(name$2);recordMatcher&&matcher.removeRoute(recordMatcher)}function getRoutes(){return matcher.getRoutes().map(routeMatcher=>routeMatcher.record)}function hasRoute(name$2){return!!matcher.getRecordMatcher(name$2)}function resolve$1(rawLocation,currentLocation){if(currentLocation=assign$1({},currentLocation||currentRoute.value),typeof rawLocation==`string`){let locationNormalized=parseURL(parseQuery$1,rawLocation,currentLocation.path),matchedRoute$1=matcher.resolve({path:locationNormalized.path},currentLocation),href$1=routerHistory.createHref(locationNormalized.fullPath);return assign$1(locationNormalized,matchedRoute$1,{params:decodeParams(matchedRoute$1.params),hash:decode$1(locationNormalized.hash),redirectedFrom:void 0,href:href$1})}let matcherLocation;if(rawLocation.path!=null)matcherLocation=assign$1({},rawLocation,{path:parseURL(parseQuery$1,rawLocation.path,currentLocation.path).path});else{let targetParams=assign$1({},rawLocation.params);for(let key$2 in targetParams)targetParams[key$2]??delete targetParams[key$2];matcherLocation=assign$1({},rawLocation,{params:encodeParams(targetParams)}),currentLocation.params=encodeParams(currentLocation.params)}let matchedRoute=matcher.resolve(matcherLocation,currentLocation),hash=rawLocation.hash||``;matchedRoute.params=normalizeParams(decodeParams(matchedRoute.params));let fullPath=stringifyURL(stringifyQuery$1,assign$1({},rawLocation,{hash:encodeHash(hash),path:matchedRoute.path})),href=routerHistory.createHref(fullPath);return assign$1({fullPath,hash,query:stringifyQuery$1===stringifyQuery?normalizeQuery(rawLocation.query):rawLocation.query||{}},matchedRoute,{redirectedFrom:void 0,href})}function locationAsObject(to$2){return typeof to$2==`string`?parseURL(parseQuery$1,to$2,currentRoute.value.path):assign$1({},to$2)}function checkCanceledNavigation(to$2,from){if(pendingLocation!==to$2)return createRouterError(8,{from,to:to$2})}function push$1(to$2){return pushWithRedirect(to$2)}function replace(to$2){return push$1(assign$1(locationAsObject(to$2),{replace:!0}))}function handleRedirectRecord(to$2){let lastMatched=to$2.matched[to$2.matched.length-1];if(lastMatched&&lastMatched.redirect){let{redirect}=lastMatched,newTargetLocation=typeof redirect==`function`?redirect(to$2):redirect;return typeof newTargetLocation==`string`&&(newTargetLocation=newTargetLocation.includes(`?`)||newTargetLocation.includes(`#`)?newTargetLocation=locationAsObject(newTargetLocation):{path:newTargetLocation},newTargetLocation.params={}),assign$1({query:to$2.query,hash:to$2.hash,params:newTargetLocation.path==null?to$2.params:{}},newTargetLocation)}}function pushWithRedirect(to$2,redirectedFrom){let targetLocation=pendingLocation=resolve$1(to$2),from=currentRoute.value,data$12=to$2.state,force=to$2.force,replace$1=to$2.replace===!0,shouldRedirect=handleRedirectRecord(targetLocation);if(shouldRedirect)return pushWithRedirect(assign$1(locationAsObject(shouldRedirect),{state:typeof shouldRedirect==`object`?assign$1({},data$12,shouldRedirect.state):data$12,force,replace:replace$1}),redirectedFrom||targetLocation);let toLocation=targetLocation;toLocation.redirectedFrom=redirectedFrom;let failure;return!force&&isSameRouteLocation(stringifyQuery$1,from,targetLocation)&&(failure=createRouterError(16,{to:toLocation,from}),handleScroll(from,from,!0,!1)),(failure?Promise.resolve(failure):navigate(toLocation,from)).catch(error=>isNavigationFailure(error)?isNavigationFailure(error,2)?error:markAsReady(error):triggerError(error,toLocation,from)).then(failure$1=>{if(failure$1){if(isNavigationFailure(failure$1,2))return pushWithRedirect(assign$1({replace:replace$1},locationAsObject(failure$1.to),{state:typeof failure$1.to==`object`?assign$1({},data$12,failure$1.to.state):data$12,force}),redirectedFrom||toLocation)}else failure$1=finalizeNavigation(toLocation,from,!0,replace$1,data$12);return triggerAfterEach(toLocation,from,failure$1),failure$1})}function checkCanceledNavigationAndReject(to$2,from){let error=checkCanceledNavigation(to$2,from);return error?Promise.reject(error):Promise.resolve()}function runWithContext(fn$6){let app=installedApps.values().next().value;return app&&typeof app.runWithContext==`function`?app.runWithContext(fn$6):fn$6()}function navigate(to$2,from){let guards,[leavingRecords,updatingRecords,enteringRecords]=extractChangingRecords(to$2,from);guards=extractComponentsGuards(leavingRecords.reverse(),`beforeRouteLeave`,to$2,from);for(let record of leavingRecords)record.leaveGuards.forEach(guard=>{guards.push(guardToPromiseFn(guard,to$2,from))});let canceledNavigationCheck=checkCanceledNavigationAndReject.bind(null,to$2,from);return guards.push(canceledNavigationCheck),runGuardQueue(guards).then(()=>{guards=[];for(let guard of beforeGuards.list())guards.push(guardToPromiseFn(guard,to$2,from));return guards.push(canceledNavigationCheck),runGuardQueue(guards)}).then(()=>{guards=extractComponentsGuards(updatingRecords,`beforeRouteUpdate`,to$2,from);for(let record of updatingRecords)record.updateGuards.forEach(guard=>{guards.push(guardToPromiseFn(guard,to$2,from))});return guards.push(canceledNavigationCheck),runGuardQueue(guards)}).then(()=>{guards=[];for(let record of enteringRecords)if(record.beforeEnter)if(isArray$3(record.beforeEnter))for(let beforeEnter of record.beforeEnter)guards.push(guardToPromiseFn(beforeEnter,to$2,from));else guards.push(guardToPromiseFn(record.beforeEnter,to$2,from));return guards.push(canceledNavigationCheck),runGuardQueue(guards)}).then(()=>(to$2.matched.forEach(record=>record.enterCallbacks={}),guards=extractComponentsGuards(enteringRecords,`beforeRouteEnter`,to$2,from,runWithContext),guards.push(canceledNavigationCheck),runGuardQueue(guards))).then(()=>{guards=[];for(let guard of beforeResolveGuards.list())guards.push(guardToPromiseFn(guard,to$2,from));return guards.push(canceledNavigationCheck),runGuardQueue(guards)}).catch(err=>isNavigationFailure(err,8)?err:Promise.reject(err))}function triggerAfterEach(to$2,from,failure){afterGuards.list().forEach(guard=>runWithContext(()=>guard(to$2,from,failure)))}function finalizeNavigation(toLocation,from,isPush,replace$1,data$12){let error=checkCanceledNavigation(toLocation,from);if(error)return error;let isFirstNavigation=from===START_LOCATION_NORMALIZED,state=isBrowser$2?history.state:{};isPush&&(replace$1||isFirstNavigation?routerHistory.replace(toLocation.fullPath,assign$1({scroll:isFirstNavigation&&state&&state.scroll},data$12)):routerHistory.push(toLocation.fullPath,data$12)),currentRoute.value=toLocation,handleScroll(toLocation,from,isPush,isFirstNavigation),markAsReady()}let removeHistoryListener;function setupListeners(){removeHistoryListener||=routerHistory.listen((to$2,_from,info)=>{if(!router$1.listening)return;let toLocation=resolve$1(to$2),shouldRedirect=handleRedirectRecord(toLocation);if(shouldRedirect){pushWithRedirect(assign$1(shouldRedirect,{replace:!0,force:!0}),toLocation).catch(noop$1);return}pendingLocation=toLocation;let from=currentRoute.value;isBrowser$2&&saveScrollPosition(getScrollKey(from.fullPath,info.delta),computeScrollPosition()),navigate(toLocation,from).catch(error=>isNavigationFailure(error,12)?error:isNavigationFailure(error,2)?(pushWithRedirect(assign$1(locationAsObject(error.to),{force:!0}),toLocation).then(failure=>{isNavigationFailure(failure,20)&&!info.delta&&info.type===NavigationType.pop&&routerHistory.go(-1,!1)}).catch(noop$1),Promise.reject()):(info.delta&&routerHistory.go(-info.delta,!1),triggerError(error,toLocation,from))).then(failure=>{failure||=finalizeNavigation(toLocation,from,!1),failure&&(info.delta&&!isNavigationFailure(failure,8)?routerHistory.go(-info.delta,!1):info.type===NavigationType.pop&&isNavigationFailure(failure,20)&&routerHistory.go(-1,!1)),triggerAfterEach(toLocation,from,failure)}).catch(noop$1)})}let readyHandlers=useCallbacks(),errorListeners=useCallbacks(),ready;function triggerError(error,to$2,from){markAsReady(error);let list$2=errorListeners.list();return list$2.length?list$2.forEach(handler=>handler(error,to$2,from)):console.error(error),Promise.reject(error)}function isReady(){return ready&¤tRoute.value!==START_LOCATION_NORMALIZED?Promise.resolve():new Promise((resolve$2,reject)=>{readyHandlers.add([resolve$2,reject])})}function markAsReady(err){return ready||(ready=!err,setupListeners(),readyHandlers.list().forEach(([resolve$2,reject])=>err?reject(err):resolve$2()),readyHandlers.reset()),err}function handleScroll(to$2,from,isPush,isFirstNavigation){let{scrollBehavior}=options$1;if(!isBrowser$2||!scrollBehavior)return Promise.resolve();let scrollPosition=!isPush&&getSavedScrollPosition(getScrollKey(to$2.fullPath,0))||(isFirstNavigation||!isPush)&&history.state&&history.state.scroll||null;return nextTick().then(()=>scrollBehavior(to$2,from,scrollPosition)).then(position$2=>position$2&&scrollToPosition(position$2)).catch(err=>triggerError(err,to$2,from))}let go$1=delta=>routerHistory.go(delta),started,installedApps=new Set,router$1={currentRoute,listening:!0,addRoute,removeRoute,clearRoutes:matcher.clearRoutes,hasRoute,getRoutes,resolve:resolve$1,options:options$1,push:push$1,replace,go:go$1,back:()=>go$1(-1),forward:()=>go$1(1),beforeEach:beforeGuards.add,beforeResolve:beforeResolveGuards.add,afterEach:afterGuards.add,onError:errorListeners.add,isReady,install(app){let router$2=this;app.component(`RouterLink`,RouterLink),app.component(`RouterView`,RouterView),app.config.globalProperties.$router=router$2,Object.defineProperty(app.config.globalProperties,`$route`,{enumerable:!0,get:()=>unref(currentRoute)}),isBrowser$2&&!started&¤tRoute.value===START_LOCATION_NORMALIZED&&(started=!0,push$1(routerHistory.location).catch(err=>{}));let reactiveRoute={};for(let key$2 in START_LOCATION_NORMALIZED)Object.defineProperty(reactiveRoute,key$2,{get:()=>currentRoute.value[key$2],enumerable:!0});app.provide(routerKey,router$2),app.provide(routeLocationKey,shallowReactive(reactiveRoute)),app.provide(routerViewLocationKey,currentRoute);let unmountApp=app.unmount;installedApps.add(app),app.unmount=function(){installedApps.delete(app),installedApps.size<1&&(pendingLocation=START_LOCATION_NORMALIZED,removeHistoryListener&&removeHistoryListener(),removeHistoryListener=null,currentRoute.value=START_LOCATION_NORMALIZED,started=!1,ready=!1),unmountApp()}}};function runGuardQueue(guards){return guards.reduce((promise,guard)=>promise.then(()=>runWithContext(guard)),Promise.resolve())}return router$1}function extractChangingRecords(to$2,from){let leavingRecords=[],updatingRecords=[],enteringRecords=[],len=Math.max(from.matched.length,to$2.matched.length);for(let i$1=0;i$1isSameRouteRecord(record,recordFrom))?updatingRecords.push(recordFrom):leavingRecords.push(recordFrom));let recordTo=to$2.matched[i$1];recordTo&&(from.matched.find(record=>isSameRouteRecord(record,recordTo))||enteringRecords.push(recordTo))}return[leavingRecords,updatingRecords,enteringRecords]}function useRouter(){return inject(routerKey)}function useRoute(_name){return inject(routeLocationKey)}const routes=[{path:`/`,name:`IndexScenePage`,component:()=>__vitePreload(()=>import(`./pages-CqvY_QyT.js`),__vite__mapDeps([5,6,1,2,7,8,9,4,10,11,12])),meta:{layout:`stage`,stageTransition:{name:`bubble-wave-out`}}},{path:`/:all(.*)`,name:`/[...all]`,component:()=>__vitePreload(()=>import(`./_...all_-gC8Dl7gs.js`),[])},{path:`/audio`,name:`/audio`,component:()=>__vitePreload(()=>import(`./audio-XSIo9MwQ.js`),[])},{path:`/devtools`,children:[{path:`audio-record`,name:`/devtools/audio-record`,component:()=>__vitePreload(()=>import(`./audio-record-CqOfJMhf.js`),[])},{path:`background-remove`,name:`/devtools/background-remove`,component:()=>__vitePreload(()=>import(`./background-remove-BIlLHheK.js`),__vite__mapDeps([13,14,15]))},{path:`chat`,name:`/devtools/chat`,component:()=>__vitePreload(()=>import(`./chat-mNT9qYfI.js`),[])},{path:`gesture-circle`,name:`/devtools/gesture-circle`,component:()=>__vitePreload(()=>import(`./gesture-circle-_WCnPwKn.js`),__vite__mapDeps([16,6])),meta:{layout:`plain`}},{path:`image`,name:`/devtools/image`,component:()=>__vitePreload(()=>import(`./image-BLItfOAt.js`),__vite__mapDeps([17,18]))},{path:`polaroid`,name:`/devtools/polaroid`,component:()=>__vitePreload(()=>import(`./polaroid-CgtEjW36.js`),__vite__mapDeps([19,10,11,12]))},{path:`vibrant`,name:`/devtools/vibrant`,component:()=>__vitePreload(()=>import(`./vibrant-Cd0ESToT.js`),__vite__mapDeps([20,21,15]))}]},{path:`/queue`,name:`/queue`,component:()=>__vitePreload(()=>import(`./queue-ljfYlK6R.js`),[])},{path:`/settings`,children:[{path:``,name:`/settings/`,component:()=>__vitePreload(()=>import(`./settings-DIR2jMir.js`),__vite__mapDeps([22,6,23])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`airi-card`,children:[{path:``,name:`/settings/airi-card/`,component:()=>__vitePreload(()=>import(`./airi-card-B7ZfdDe0.js`),__vite__mapDeps([24,6,25,26,27,28,29,30,15])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`components`,children:[{path:`CardCreate`,name:`/settings/airi-card/components/CardCreate`,component:()=>__vitePreload(()=>import(`./CardCreate-B9UkMPmr.js`),__vite__mapDeps([31,25]))},{path:`CardCreationDialog`,name:`/settings/airi-card/components/CardCreationDialog`,component:()=>__vitePreload(()=>import(`./CardCreationDialog-C2t6nzce.js`),__vite__mapDeps([32,26,27]))},{path:`CardDetailDialog`,name:`/settings/airi-card/components/CardDetailDialog`,component:()=>__vitePreload(()=>import(`./CardDetailDialog-C5NS6yu5.js`),__vite__mapDeps([33,28,29]))},{path:`CardListItem`,name:`/settings/airi-card/components/CardListItem`,component:()=>__vitePreload(()=>import(`./CardListItem-B_X4U4tj.js`),__vite__mapDeps([34,30]))},{path:`DeleteCardDialog`,name:`/settings/airi-card/components/DeleteCardDialog`,component:()=>__vitePreload(()=>import(`./DeleteCardDialog-Cmxl4b8s.js`),__vite__mapDeps([35,29]))}]}]},{path:`appearance`,children:[{path:``,name:`/settings/appearance/`,component:()=>__vitePreload(()=>import(`./appearance-DYPH8hMh.js`),__vite__mapDeps([36,6])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}},{path:`color-scheme`,name:`/settings/appearance/color-scheme`,component:()=>__vitePreload(()=>import(`./color-scheme-B8QUMGKo.js`),__vite__mapDeps([37,6,38])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`developer`,name:`/settings/appearance/developer`,component:()=>__vitePreload(()=>import(`./developer-C3KwNa46.js`),__vite__mapDeps([39,6])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`general`,name:`/settings/appearance/general`,component:()=>__vitePreload(()=>import(`./general-Ct2fynUz.js`),__vite__mapDeps([40,6])),meta:{layout:`settings`,stageTransition:{name:`slide`}}}]},{path:`memory`,children:[{path:``,name:`/settings/memory/`,component:()=>__vitePreload(()=>import(`./memory-DF7fLUfS.js`),__vite__mapDeps([41,6])),meta:{layout:`settings`,stageTransition:{name:`slide`}}}]},{path:`models`,children:[{path:``,name:`/settings/models/`,component:()=>__vitePreload(()=>import(`./models-CxyqeYFq.js`),__vite__mapDeps([42,6,23,43,10,11,12,21])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}}]},{path:`modules`,children:[{path:``,name:`/settings/modules/`,component:()=>__vitePreload(()=>import(`./modules-C3lme1kU.js`),__vite__mapDeps([44,6,23,43])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}},{path:`consciousness`,name:`/settings/modules/consciousness`,component:()=>__vitePreload(()=>import(`./consciousness-Bsx6qnki.js`),__vite__mapDeps([45,6])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`hearing`,name:`/settings/modules/hearing`,component:()=>__vitePreload(()=>import(`./hearing-B6PhAbYO.js`),__vite__mapDeps([46,6,14])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`memory-long-term`,name:`/settings/modules/memory-long-term`,component:()=>__vitePreload(()=>import(`./memory-long-term-D5MNuhrd.js`),__vite__mapDeps([47,6])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`memory-short-term`,name:`/settings/modules/memory-short-term`,component:()=>__vitePreload(()=>import(`./memory-short-term-BfW329Pe.js`),__vite__mapDeps([48,6])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`speech`,name:`/settings/modules/speech`,component:()=>__vitePreload(()=>import(`./speech-CHsV5f2H.js`),__vite__mapDeps([49,6,8,50])),meta:{layout:`settings`,stageTransition:{name:`slide`}}}]},{path:`providers`,children:[{path:``,name:`/settings/providers/`,component:()=>__vitePreload(()=>import(`./providers-DsrU6JIK.js`),__vite__mapDeps([51,6,23,43])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}},{path:`alibaba-cloud-model-studio`,name:`/settings/providers/alibaba-cloud-model-studio`,component:()=>__vitePreload(()=>import(`./alibaba-cloud-model-studio-DlNMnmqi.js`),__vite__mapDeps([52,6])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`anthropic`,name:`/settings/providers/anthropic`,component:()=>__vitePreload(()=>import(`./anthropic-B7BAJgzg.js`),__vite__mapDeps([53,6])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`azure-ai-foundry`,name:`/settings/providers/azure-ai-foundry`,component:()=>__vitePreload(()=>import(`./azure-ai-foundry-DlZ-mKi2.js`),__vite__mapDeps([54,6])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`cloudflare-workers-ai`,name:`/settings/providers/cloudflare-workers-ai`,component:()=>__vitePreload(()=>import(`./cloudflare-workers-ai-CoptsH2G.js`),__vite__mapDeps([55,6])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`deepseek`,name:`/settings/providers/deepseek`,component:()=>__vitePreload(()=>import(`./deepseek-Bq3V0xqj.js`),__vite__mapDeps([56,6])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`elevenlabs`,name:`/settings/providers/elevenlabs`,component:()=>__vitePreload(()=>import(`./elevenlabs-BGkmS224.js`),__vite__mapDeps([57,6])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`featherless-ai`,name:`/settings/providers/featherless-ai`,component:()=>__vitePreload(()=>import(`./featherless-ai-CQeyDKta.js`),__vite__mapDeps([58,6])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`fireworks-ai`,name:`/settings/providers/fireworks-ai`,component:()=>__vitePreload(()=>import(`./fireworks-ai-nFwpsnmc.js`),__vite__mapDeps([59,6])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`google-generative-ai`,name:`/settings/providers/google-generative-ai`,component:()=>__vitePreload(()=>import(`./google-generative-ai-DozYAQuF.js`),__vite__mapDeps([60,6])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`microsoft-speech`,name:`/settings/providers/microsoft-speech`,component:()=>__vitePreload(()=>import(`./microsoft-speech-DXgisB08.js`),__vite__mapDeps([61,6])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`mistral-ai`,name:`/settings/providers/mistral-ai`,component:()=>__vitePreload(()=>import(`./mistral-ai-C6OsPDG6.js`),__vite__mapDeps([62,6])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`moonshot-ai`,name:`/settings/providers/moonshot-ai`,component:()=>__vitePreload(()=>import(`./moonshot-ai-Cq0Bgk3R.js`),__vite__mapDeps([63,6])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`novita-ai`,name:`/settings/providers/novita-ai`,component:()=>__vitePreload(()=>import(`./novita-ai-BOoelGDv.js`),__vite__mapDeps([64,6])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`ollama`,name:`/settings/providers/ollama`,component:()=>__vitePreload(()=>import(`./ollama-YEZZT8Xd.js`),__vite__mapDeps([65,6])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`openai`,name:`/settings/providers/openai`,component:()=>__vitePreload(()=>import(`./openai-qf_j7gBp.js`),__vite__mapDeps([66,6])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`openai-audio-speech`,name:`/settings/providers/openai-audio-speech`,component:()=>__vitePreload(()=>import(`./openai-audio-speech-gALEgqPK.js`),__vite__mapDeps([67,6])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`openai-audio-transcription`,name:`/settings/providers/openai-audio-transcription`,component:()=>__vitePreload(()=>import(`./openai-audio-transcription-CdjYX-O2.js`),__vite__mapDeps([68,6])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`openrouter-ai`,name:`/settings/providers/openrouter-ai`,component:()=>__vitePreload(()=>import(`./openrouter-ai-BFMtPxJ7.js`),__vite__mapDeps([69,6])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`player2`,name:`/settings/providers/player2`,component:()=>__vitePreload(()=>import(`./player2-BEEn9lAM.js`),__vite__mapDeps([70,6])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`player2-speech`,name:`/settings/providers/player2-speech`,component:()=>__vitePreload(()=>import(`./player2-speech-bBMC5JEe.js`),__vite__mapDeps([71,6])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`together-ai`,name:`/settings/providers/together-ai`,component:()=>__vitePreload(()=>import(`./together-ai-CyEYaNHN.js`),__vite__mapDeps([72,6])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`volcengine`,name:`/settings/providers/volcengine`,component:()=>__vitePreload(()=>import(`./volcengine-BCpR8HvM.js`),__vite__mapDeps([73,6])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`xai`,name:`/settings/providers/xai`,component:()=>__vitePreload(()=>import(`./xai-Bt7XTBFn.js`),__vite__mapDeps([74,6])),meta:{layout:`settings`,stageTransition:{name:`slide`}}}]},{path:`scene`,children:[{path:``,name:`/settings/scene/`,component:()=>__vitePreload(()=>import(`./scene-Cp8LoaVN.js`),__vite__mapDeps([75,6,23,43])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}}]}]},{path:`/stage`,children:[{path:``,name:`StageScenePage`,component:()=>__vitePreload(()=>import(`./stage-Skn6SMJV.js`),__vite__mapDeps([76,6,1,2,7,8,9,4,10,11,12])),meta:{layout:`stage`,stageTransition:{name:`bubble-wave-out`}}}]},{path:`/test`,children:[{path:`filter-message`,name:`/test/filter-message`,component:()=>__vitePreload(()=>import(`./filter-message-lb-XLsxJ.js`),__vite__mapDeps([77,8,50]))},{path:`queues`,children:[{path:`delays`,name:`/test/queues/delays`,component:()=>__vitePreload(()=>import(`./delays-DOX4ZLru.js`),__vite__mapDeps([78,8,50]))},{path:`emotions`,name:`/test/queues/emotions`,component:()=>__vitePreload(()=>import(`./emotions-BijqzfJR.js`),__vite__mapDeps([79,8,50]))},{path:`messages`,name:`/test/queues/messages`,component:()=>__vitePreload(()=>import(`./messages-COyeBtk8.js`),__vite__mapDeps([80,8,50]))}]}]}];var AudioSpectrum_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`AudioSpectrum`,props:{stream:{},bars:{default:32},minFreq:{default:60},maxFreq:{default:4e3}},setup(__props){let props=__props,frequencies=ref(Array.from({length:props.bars}).fill(0));onMounted(()=>{handleAnalyze()}),watch(()=>props.stream,()=>{handleAnalyze()});function handleAnalyze(){if(!props.stream)return;let audioContext=new(window.AudioContext||window.webkitAudioContext),source=audioContext.createMediaStreamSource(props.stream),analyser=audioContext.createAnalyser();analyser.fftSize=2048,source.connect(analyser);let bufferLength=analyser.frequencyBinCount,dataArray=new Uint8Array(bufferLength),sampleRate=audioContext.sampleRate,frequencyResolution=sampleRate/analyser.fftSize,minBin=Math.floor(props.minFreq/frequencyResolution),maxBin=Math.floor(props.maxFreq/frequencyResolution),usableBins=maxBin-minBin,binsPerBar=Math.floor(usableBins/props.bars),analyze=()=>{try{requestAnimationFrame(analyze),analyser.getByteFrequencyData(dataArray);let bars=Array.from({length:props.bars}).fill(0);for(let i$1=0;i$1renderSlot(_ctx.$slots,`default`,{frequencies:frequencies.value})}}),AudioSpectrum_default=AudioSpectrum_vue_vue_type_script_setup_true_lang_default;const _hoisted_1$48={"h-full":``,flex:``,"items-center":``,"gap-1":``},AMPLIFICATION=5;var AudioSpectrumVisualizer_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`AudioSpectrumVisualizer`,props:{frequencies:{},barsClass:{}},setup(__props){let props=__props;function getReductionFactor(index$1,totalBars){let minFactor=.1,maxFactor=1;return minFactor+(maxFactor-minFactor)*(index$1/totalBars)}function getBarHeight(frequency,index$1){let reductionFactor=getReductionFactor(index$1,props.frequencies.length);return Math.min(100,Math.max(10,frequency*100*AMPLIFICATION*reductionFactor))}return(_ctx,_cache$1)=>(openBlock(),createElementBlock(`div`,_hoisted_1$48,[(openBlock(!0),createElementBlock(Fragment,null,renderList(_ctx.frequencies,(frequency,index$1)=>(openBlock(),createElementBlock(`div`,{key:index$1,"h-full":``,flex:``,"flex-1":``,"items-end":``},[createBaseVNode(`div`,{transition:`all 100 ease-in-out`,"mx-auto":``,"my-0":``,"w-full":``,"rounded-full":``,class:normalizeClass(_ctx.barsClass),style:normalizeStyle({height:`${getBarHeight(frequency,index$1)}%`})},null,6)]))),128))]))}}),AudioSpectrumVisualizer_default=AudioSpectrumVisualizer_vue_vue_type_script_setup_true_lang_default;const _hoisted_1$47={key:0,class:`mb-2 flex items-center justify-between`},_hoisted_2$31={class:`text-sm font-medium`},_hoisted_3$25={class:`text-sm text-neutral-500`};var LevelMeter_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`LevelMeter`,props:{level:{},min:{default:0},max:{default:100},numBars:{default:20},label:{default:`Level`},unit:{default:`%`},height:{default:24},showHeader:{type:Boolean,default:!0},animationSpeed:{default:75},colorThresholds:{default:()=>[{value:60,color:`bg-green-500`},{value:80,color:`bg-yellow-500`},{value:100,color:`bg-red-500`}]},formatValue:{}},setup(__props){let props=__props,levelBars=computed(()=>{let normalizedLevel=Math.max(0,Math.min(100,(props.level-props.min)/(props.max-props.min)*100)),activeBars=Math.floor(normalizedLevel/100*props.numBars);return Array.from({length:props.numBars},(_$2,i$1)=>({active:i$1a$2.value-b$4.value);for(let threshold of thresholds)if(barLevel<=threshold.value)return threshold.color;return thresholds[thresholds.length-1]?.color||`bg-green-500`}return(_ctx,_cache$1)=>(openBlock(),createElementBlock(`div`,null,[_ctx.showHeader?(openBlock(),createElementBlock(`div`,_hoisted_1$47,[createBaseVNode(`span`,_hoisted_2$31,toDisplayString(_ctx.label),1),createBaseVNode(`span`,_hoisted_3$25,toDisplayString(_ctx.formatValue?_ctx.formatValue(_ctx.level):`${Math.round(_ctx.level)}${_ctx.unit}`),1)])):createCommentVNode(``,!0),createBaseVNode(`div`,{class:`flex items-end gap-1 rounded bg-neutral-200/45 p-1 dark:bg-neutral-700`,style:normalizeStyle({height:`${_ctx.height}px`})},[(openBlock(!0),createElementBlock(Fragment,null,renderList(levelBars.value,(bar,index$1)=>(openBlock(),createElementBlock(`div`,{key:index$1,class:normalizeClass([`flex-1 rounded-sm transition-all`,[bar.active?getBarColor(index$1,bar.level):`bg-neutral-200 dark:bg-neutral-600`,`duration-${_ctx.animationSpeed}`]]),style:normalizeStyle({height:bar.active?`100%`:`20%`})},null,6))),128))],4)]))}}),LevelMeter_default=LevelMeter_vue_vue_type_script_setup_true_lang_default,Volumed_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`Volumed`,props:{perspective:{},transform:{}},setup(__props){return(_ctx,_cache$1)=>(openBlock(),createElementBlock(`div`,{class:`volumed`,style:normalizeStyle({perspective:`${_ctx.perspective}px`,transform:_ctx.transform})},[renderSlot(_ctx.$slots,`default`,{},void 0,!0)],4))}}),__plugin_vue_export_helper_default=(sfc,props)=>{let target$1=sfc.__vccOpts||sfc;for(let[key$2,val]of props)target$1[key$2]=val;return target$1},Volumed_default=__plugin_vue_export_helper_default(Volumed_vue_vue_type_script_setup_true_lang_default,[[`__scopeId`,`data-v-d8ce56aa`]]),CursorMomentum_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`CursorMomentum`,props:{baseSpeed:{default:.1},friction:{default:.95},momentumFactor:{default:.005}},setup(__props,{expose:__expose}){let props=__props,momentum=ref(1),currentValue=ref(0),lastTimestamp=0,FRICTION=toRef(()=>props.friction),BASE_SPEED=toRef(()=>props.baseSpeed),MOMENTUM_FACTOR=toRef(()=>props.momentumFactor);function updateMomentum(timestamp$2){lastTimestamp||=timestamp$2;let deltaTime=timestamp$2-lastTimestamp;lastTimestamp=timestamp$2,momentum.value=BASE_SPEED.value+(momentum.value-BASE_SPEED.value)*FRICTION.value,currentValue.value+=momentum.value*deltaTime,requestAnimationFrame(updateMomentum)}function handleMouseMove(event){let speed=Math.sqrt(event.movementX**2+event.movementY**2);momentum.value+=speed*MOMENTUM_FACTOR.value}return onMounted(()=>{window.addEventListener(`mousemove`,handleMouseMove),requestAnimationFrame(updateMomentum)}),onUnmounted(()=>{window.removeEventListener(`mousemove`,handleMouseMove)}),__expose({momentum,currentValue}),(_ctx,_cache$1)=>renderSlot(_ctx.$slots,`default`,{momentum:momentum.value,currentValue:currentValue.value})}}),CursorMomentum_default=CursorMomentum_vue_vue_type_script_setup_true_lang_default,TestDummyMarkerFlat_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`TestDummyMarkerFlat`,props:{size:{}},setup(__props){return(_ctx,_cache$1)=>(openBlock(),createElementBlock(`div`,{class:`test-dummy-flat`,style:normalizeStyle({width:`${_ctx.size}px`,height:`${_ctx.size}px`})},_cache$1[0]||=[createBaseVNode(`div`,{class:`marker`},null,-1)],4))}}),TestDummyMarkerFlat_default=__plugin_vue_export_helper_default(TestDummyMarkerFlat_vue_vue_type_script_setup_true_lang_default,[[`__scopeId`,`data-v-28f8c660`]]),TestDummyMarker_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`TestDummyMarker`,setup(__props){return(_ctx,_cache$1)=>(openBlock(),createBlock(CursorMomentum_default,{"base-speed":.1,friction:.95,"momentum-factor":5e-4},{default:withCtx(({currentValue})=>[createVNode(Volumed_default,{perspective:800,transform:`rotateX(45deg) translateY(3px)`},{default:withCtx(()=>[createVNode(TestDummyMarkerFlat_default,{size:24,style:normalizeStyle({transform:`rotate(${currentValue}deg)`})},null,8,[`style`])]),_:2},1024)]),_:1}))}}),TestDummyMarker_default=TestDummyMarker_vue_vue_type_script_setup_true_lang_default;const _hoisted_1$46={key:0,class:`mb-2 flex items-center justify-between`},_hoisted_2$30={class:`text-sm font-medium`},_hoisted_3$24={class:`text-sm text-neutral-500`},_hoisted_4$20={key:1,class:`mt-1 flex gap-3 text-xs text-neutral-500`},_hoisted_5$16={class:`flex items-center gap-1`},_hoisted_6$14={class:`flex items-center gap-1`},_hoisted_7$9={class:`flex items-center gap-1`};var ThresholdMeter_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`ThresholdMeter`,props:{value:{},threshold:{},min:{default:0},max:{default:1},numBars:{default:20},label:{default:`Value`},unit:{default:`%`},precision:{default:1},height:{default:24},showHeader:{type:Boolean,default:!0},showLegend:{type:Boolean,default:!0},animationSpeed:{default:100},belowThresholdClass:{default:`bg-primary-300 dark:bg-primary-600`},aboveThresholdClass:{default:`bg-green-500`},thresholdBarClass:{default:`bg-white dark:bg-neutral-800`},inactiveBarClass:{default:`bg-neutral-300 dark:bg-neutral-600`},belowLabel:{default:`Below`},aboveLabel:{default:`Above`},thresholdLabel:{default:`Threshold`},formatValue:{}},setup(__props){let props=__props,thresholdBars=computed(()=>{let normalizedValue=Math.max(0,Math.min(1,(props.value-props.min)/(props.max-props.min))),normalizedThreshold=Math.max(0,Math.min(1,(props.threshold-props.min)/(props.max-props.min))),activeBars=Math.floor(normalizedValue*props.numBars),thresholdBar=Math.floor(normalizedThreshold*props.numBars);return Array.from({length:props.numBars},(_$2,i$1)=>({active:i$1=thresholdBar,isBelowThreshold:i$1(openBlock(),createElementBlock(`div`,null,[_ctx.showHeader?(openBlock(),createElementBlock(`div`,_hoisted_1$46,[createBaseVNode(`span`,_hoisted_2$30,toDisplayString(_ctx.label),1),createBaseVNode(`span`,_hoisted_3$24,toDisplayString(_ctx.formatValue?_ctx.formatValue(_ctx.value):`${(_ctx.value*100).toFixed(_ctx.precision)}${_ctx.unit}`),1)])):createCommentVNode(``,!0),createBaseVNode(`div`,{class:`flex items-end gap-1 rounded bg-neutral-200/45 p-1 p-1 dark:bg-neutral-700`,style:normalizeStyle({height:`${_ctx.height}px`})},[(openBlock(!0),createElementBlock(Fragment,null,renderList(thresholdBars.value,(bar,index$1)=>(openBlock(),createElementBlock(`div`,{key:`threshold-${index$1}`,class:normalizeClass([`flex-1 rounded-sm transition-all`,[bar.isThreshold?_ctx.thresholdBarClass:bar.isAboveThreshold?_ctx.aboveThresholdClass:bar.isBelowThreshold?_ctx.belowThresholdClass:_ctx.inactiveBarClass,`duration-${_ctx.animationSpeed}`]]),style:normalizeStyle({height:bar.active||bar.isThreshold?`100%`:`20%`})},null,6))),128))],4),_ctx.showLegend?(openBlock(),createElementBlock(`div`,_hoisted_4$20,[createBaseVNode(`span`,_hoisted_5$16,[createBaseVNode(`div`,{class:normalizeClass(`inline-block h-0.5lh w-1lh rounded-full ${_ctx.belowThresholdClass}`)},null,2),createTextVNode(` `+toDisplayString(_ctx.belowLabel),1)]),createBaseVNode(`span`,_hoisted_6$14,[createBaseVNode(`div`,{class:normalizeClass(`inline-block h-0.5lh w-1lh rounded-full border border-neutral-400 ${_ctx.thresholdBarClass}`)},null,2),createTextVNode(` `+toDisplayString(_ctx.thresholdLabel),1)]),createBaseVNode(`span`,_hoisted_7$9,[createBaseVNode(`div`,{class:normalizeClass(`inline-block h-0.5lh w-1lh rounded-full ${_ctx.aboveThresholdClass}`)},null,2),createTextVNode(` `+toDisplayString(_ctx.aboveLabel),1)])])):createCommentVNode(``,!0)]))}}),ThresholdMeter_default=ThresholdMeter_vue_vue_type_script_setup_true_lang_default;const parseNumber$1=(color$2,len)=>{if(typeof color$2==`number`){if(len===3)return{mode:`rgb`,r:(color$2>>8&15|color$2>>4&240)/255,g:(color$2>>4&15|color$2&240)/255,b:(color$2&15|color$2<<4&240)/255};if(len===4)return{mode:`rgb`,r:(color$2>>12&15|color$2>>8&240)/255,g:(color$2>>8&15|color$2>>4&240)/255,b:(color$2>>4&15|color$2&240)/255,alpha:(color$2&15|color$2<<4&240)/255};if(len===6)return{mode:`rgb`,r:(color$2>>16&255)/255,g:(color$2>>8&255)/255,b:(color$2&255)/255};if(len===8)return{mode:`rgb`,r:(color$2>>24&255)/255,g:(color$2>>16&255)/255,b:(color$2>>8&255)/255,alpha:(color$2&255)/255}}};var parseNumber_default=parseNumber$1;const named={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};var named_default=named;const parseNamed=color$2=>parseNumber_default(named_default[color$2.toLowerCase()],6);var parseNamed_default=parseNamed;const hex=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,parseHex=color$2=>{let match;return(match=color$2.match(hex))?parseNumber_default(parseInt(match[1],16),match[1].length):void 0};var parseHex_default=parseHex;const num$1=`([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)`,num_none=`(?:${num$1}|none)`,per=`${num$1}%`,per_none=`(?:${num$1}%|none)`,num_per=`(?:${num$1}%|${num$1})`,num_per_none=`(?:${num$1}%|${num$1}|none)`,hue=`(?:${num$1}(deg|grad|rad|turn)|${num$1})`,hue_none=`(?:${num$1}(deg|grad|rad|turn)|${num$1}|none)`,c$2=`\\s*,\\s*`,rx_num_per_none=RegExp(`^`+num_per_none+`$`),rgb_num_old=RegExp(`^rgba?\\(\\s*${num$1}${c$2}${num$1}${c$2}${num$1}\\s*(?:,\\s*${num_per}\\s*)?\\)$`),rgb_per_old=RegExp(`^rgba?\\(\\s*${per}${c$2}${per}${c$2}${per}\\s*(?:,\\s*${num_per}\\s*)?\\)$`),parseRgbLegacy=color$2=>{let res={mode:`rgb`},match;if(match=color$2.match(rgb_num_old))match[1]!==void 0&&(res.r=match[1]/255),match[2]!==void 0&&(res.g=match[2]/255),match[3]!==void 0&&(res.b=match[3]/255);else if(match=color$2.match(rgb_per_old))match[1]!==void 0&&(res.r=match[1]/100),match[2]!==void 0&&(res.g=match[2]/100),match[3]!==void 0&&(res.b=match[3]/100);else return;return match[4]===void 0?match[5]!==void 0&&(res.alpha=Math.max(0,Math.min(1,+match[5]))):res.alpha=Math.max(0,Math.min(1,match[4]/100)),res};var parseRgbLegacy_default=parseRgbLegacy;const prepare=(color$2,mode)=>color$2===void 0?void 0:typeof color$2==`object`?color$2.mode===void 0?mode?{...color$2,mode}:void 0:color$2:parse_default(color$2);var _prepare_default=prepare;const converter=(target_mode=`rgb`)=>color$2=>(color$2=_prepare_default(color$2,target_mode))===void 0?void 0:color$2.mode===target_mode?color$2:converters[color$2.mode][target_mode]?converters[color$2.mode][target_mode](color$2):target_mode===`rgb`?converters[color$2.mode].rgb(color$2):converters.rgb[target_mode](converters[color$2.mode].rgb(color$2));var converter_default=converter;const converters={},modes={},parsers=[],colorProfiles={},identity=v$2=>v$2,useMode=definition$29=>(converters[definition$29.mode]={...converters[definition$29.mode],...definition$29.toMode},Object.keys(definition$29.fromMode||{}).forEach(k$4=>{converters[k$4]||(converters[k$4]={}),converters[k$4][definition$29.mode]=definition$29.fromMode[k$4]}),definition$29.ranges||={},definition$29.difference||={},definition$29.channels.forEach(channel=>{if(definition$29.ranges[channel]===void 0&&(definition$29.ranges[channel]=[0,1]),!definition$29.interpolate[channel])throw Error(`Missing interpolator for: ${channel}`);typeof definition$29.interpolate[channel]==`function`&&(definition$29.interpolate[channel]={use:definition$29.interpolate[channel]}),definition$29.interpolate[channel].fixup||(definition$29.interpolate[channel].fixup=identity)}),modes[definition$29.mode]=definition$29,(definition$29.parse||[]).forEach(parser=>{useParser(parser,definition$29.mode)}),converter_default(definition$29.mode)),getMode=mode=>modes[mode],useParser=(parser,mode)=>{if(typeof parser==`string`){if(!mode)throw Error(`'mode' required when 'parser' is a string`);colorProfiles[parser]=mode}else typeof parser==`function`&&parsers.indexOf(parser)<0&&parsers.push(parser)},IdentStartCodePoint=/[^\x00-\x7F]|[a-zA-Z_]/,IdentCodePoint=/[^\x00-\x7F]|[-\w]/,Tok={Function:`function`,Ident:`ident`,Number:`number`,Percentage:`percentage`,ParenClose:`)`,None:`none`,Hue:`hue`,Alpha:`alpha`};let _i$1=0;function is_num(chars){let ch$1=chars[_i$1],ch1=chars[_i$1+1];return ch$1===`-`||ch$1===`+`?/\d/.test(ch1)||ch1===`.`&&/\d/.test(chars[_i$1+2]):ch$1===`.`?/\d/.test(ch1):/\d/.test(ch$1)}function is_ident(chars){if(_i$1>=chars.length)return!1;let ch$1=chars[_i$1];if(IdentStartCodePoint.test(ch$1))return!0;if(ch$1===`-`){if(chars.length-_i$1<2)return!1;let ch1=chars[_i$1+1];return!!(ch1===`-`||IdentStartCodePoint.test(ch1))}return!1}const huenits={deg:1,rad:180/Math.PI,grad:9/10,turn:360};function num(chars){let value$1=``;if((chars[_i$1]===`-`||chars[_i$1]===`+`)&&(value$1+=chars[_i$1++]),value$1+=digits(chars),chars[_i$1]===`.`&&/\d/.test(chars[_i$1+1])&&(value$1+=chars[_i$1++]+digits(chars)),(chars[_i$1]===`e`||chars[_i$1]===`E`)&&((chars[_i$1+1]===`-`||chars[_i$1+1]===`+`)&&/\d/.test(chars[_i$1+2])?value$1+=chars[_i$1++]+chars[_i$1++]+digits(chars):/\d/.test(chars[_i$1+1])&&(value$1+=chars[_i$1++]+digits(chars))),is_ident(chars)){let id$1=ident(chars);return id$1===`deg`||id$1===`rad`||id$1===`turn`||id$1===`grad`?{type:Tok.Hue,value:value$1*huenits[id$1]}:void 0}return chars[_i$1]===`%`?(_i$1++,{type:Tok.Percentage,value:+value$1}):{type:Tok.Number,value:+value$1}}function digits(chars){let v$2=``;for(;/\d/.test(chars[_i$1]);)v$2+=chars[_i$1++];return v$2}function ident(chars){let v$2=``;for(;_i$1store[key$2],set(value$2){store[key$2]=value$2}}):(isRef(value$1)||isReactive(value$1))&&(refs[key$2]=toRef(store,key$2))}return refs}const scriptRel=`modulepreload`,assetsURL=function(dep){return`/`+dep},seen={},__vitePreload=function(baseModule,deps,importerUrl){let promise=Promise.resolve();if(deps&&deps.length>0){let links=document.getElementsByTagName(`link`),cspNonceMeta=document.querySelector(`meta[property=csp-nonce]`),cspNonce=cspNonceMeta?.nonce||cspNonceMeta?.getAttribute(`nonce`);function allSettled(promises$2){return Promise.all(promises$2.map(p$1$1=>Promise.resolve(p$1$1).then(value$1=>({status:`fulfilled`,value:value$1}),reason=>({status:`rejected`,reason}))))}promise=allSettled(deps.map(dep=>{if(dep=assetsURL(dep,importerUrl),dep in seen)return;seen[dep]=!0;let isCss=dep.endsWith(`.css`),cssSelector=isCss?`[rel="stylesheet"]`:``,isBaseRelative=!!importerUrl;if(isBaseRelative)for(let i$1=links.length-1;i$1>=0;i$1--){let link$1$1=links[i$1];if(link$1$1.href===dep&&(!isCss||link$1$1.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${dep}"]${cssSelector}`))return;let link$1=document.createElement(`link`);if(link$1.rel=isCss?`stylesheet`:scriptRel,isCss||(link$1.as=`script`),link$1.crossOrigin=``,link$1.href=dep,cspNonce&&link$1.setAttribute(`nonce`,cspNonce),document.head.appendChild(link$1),isCss)return new Promise((res,rej)=>{link$1.addEventListener(`load`,res),link$1.addEventListener(`error`,()=>rej(Error(`Unable to preload CSS for ${dep}`)))})}))}function handlePreloadError(err$2){let e$1$1=new Event(`vite:preloadError`,{cancelable:!0});if(e$1$1.payload=err$2,window.dispatchEvent(e$1$1),!e$1$1.defaultPrevented)throw err$2}return promise.then(res=>{for(let item of res||[]){if(item.status!==`rejected`)continue;handlePreloadError(item.reason)}return baseModule().catch(handlePreloadError)})},setupLayouts=routes$1=>{let layouts={},modules=Object.assign({"/src/layouts/default.vue":()=>__vitePreload(()=>import(`./default-dHnBRBVa.js`),__vite__mapDeps([0,1,2])),"/src/layouts/home.vue":()=>__vitePreload(()=>import(`./home-CtQR04tF.js`),[]),"/src/layouts/plain.vue":()=>__vitePreload(()=>import(`./plain--3dPFSjT.js`),[]),"/src/layouts/settings.vue":()=>__vitePreload(()=>import(`./settings-Dx_-xTvm.js`),__vite__mapDeps([3,1,2,4])),"/src/layouts/stage.vue":()=>__vitePreload(()=>import(`./stage-kAQNRdiU.js`),[])});Object.entries(modules).forEach(([name$2,module$1])=>{let key$2=name$2.replace(`/src/layouts/`,``).replace(`.vue`,``);layouts[key$2]=module$1});function deepSetupLayout(routes$2,top=!0){return routes$2.map(route=>{if(route.children?.length>0&&(route.children=deepSetupLayout(route.children,!1)),top){let skipLayout=!route.component&&route.children?.find(r$2=>(r$2.path===``||r$2.path===`/`)&&r$2.meta?.isLayout);if(skipLayout)return route;if(route.meta?.layout!==!1)return{path:route.path,component:layouts[route.meta?.layout||`default`],children:route.path===`/`?[route]:[{...route,path:``}],meta:{isLayout:!0}}}return route.meta?.layout?{path:route.path,component:layouts[route.meta?.layout],children:[{...route,path:``}],meta:{isLayout:!0}}:route})}return deepSetupLayout(routes$1)},isBrowser$2=typeof document<`u`;function isRouteComponent(component){return typeof component==`object`||`displayName`in component||`props`in component||`__vccOpts`in component}function isESModule(obj){return obj.__esModule||obj[Symbol.toStringTag]===`Module`||obj.default&&isRouteComponent(obj.default)}const assign$1=Object.assign;function applyToParams(fn$6,params){let newParams={};for(let key$2 in params){let value$1=params[key$2];newParams[key$2]=isArray$3(value$1)?value$1.map(fn$6):fn$6(value$1)}return newParams}const noop$1=()=>{},isArray$3=Array.isArray,HASH_RE=/#/g,AMPERSAND_RE=/&/g,SLASH_RE=/\//g,EQUAL_RE=/=/g,IM_RE=/\?/g,PLUS_RE=/\+/g,ENC_BRACKET_OPEN_RE=/%5B/g,ENC_BRACKET_CLOSE_RE=/%5D/g,ENC_CARET_RE=/%5E/g,ENC_BACKTICK_RE=/%60/g,ENC_CURLY_OPEN_RE=/%7B/g,ENC_PIPE_RE=/%7C/g,ENC_CURLY_CLOSE_RE=/%7D/g,ENC_SPACE_RE=/%20/g;function commonEncode(text$5){return encodeURI(``+text$5).replace(ENC_PIPE_RE,`|`).replace(ENC_BRACKET_OPEN_RE,`[`).replace(ENC_BRACKET_CLOSE_RE,`]`)}function encodeHash(text$5){return commonEncode(text$5).replace(ENC_CURLY_OPEN_RE,`{`).replace(ENC_CURLY_CLOSE_RE,`}`).replace(ENC_CARET_RE,`^`)}function encodeQueryValue(text$5){return commonEncode(text$5).replace(PLUS_RE,`%2B`).replace(ENC_SPACE_RE,`+`).replace(HASH_RE,`%23`).replace(AMPERSAND_RE,`%26`).replace(ENC_BACKTICK_RE,"`").replace(ENC_CURLY_OPEN_RE,`{`).replace(ENC_CURLY_CLOSE_RE,`}`).replace(ENC_CARET_RE,`^`)}function encodeQueryKey(text$5){return encodeQueryValue(text$5).replace(EQUAL_RE,`%3D`)}function encodePath(text$5){return commonEncode(text$5).replace(HASH_RE,`%23`).replace(IM_RE,`%3F`)}function encodeParam(text$5){return text$5==null?``:encodePath(text$5).replace(SLASH_RE,`%2F`)}function decode$1(text$5){try{return decodeURIComponent(``+text$5)}catch{}return``+text$5}const TRAILING_SLASH_RE=/\/$/,removeTrailingSlash=path=>path.replace(TRAILING_SLASH_RE,``);function parseURL(parseQuery$1,location$1,currentLocation=`/`){let path,query={},searchString=``,hash=``,hashPos=location$1.indexOf(`#`),searchPos=location$1.indexOf(`?`);return hashPos=0&&(searchPos=-1),searchPos>-1&&(path=location$1.slice(0,searchPos),searchString=location$1.slice(searchPos+1,hashPos>-1?hashPos:location$1.length),query=parseQuery$1(searchString)),hashPos>-1&&(path||=location$1.slice(0,hashPos),hash=location$1.slice(hashPos,location$1.length)),path=resolveRelativePath(path??location$1,currentLocation),{fullPath:path+(searchString&&`?`)+searchString+hash,path,query,hash:decode$1(hash)}}function stringifyURL(stringifyQuery$1,location$1){let query=location$1.query?stringifyQuery$1(location$1.query):``;return location$1.path+(query&&`?`)+query+(location$1.hash||``)}function stripBase(pathname,base){return!base||!pathname.toLowerCase().startsWith(base.toLowerCase())?pathname:pathname.slice(base.length)||`/`}function isSameRouteLocation(stringifyQuery$1,a$2,b$4){let aLastIndex=a$2.matched.length-1,bLastIndex=b$4.matched.length-1;return aLastIndex>-1&&aLastIndex===bLastIndex&&isSameRouteRecord(a$2.matched[aLastIndex],b$4.matched[bLastIndex])&&isSameRouteLocationParams(a$2.params,b$4.params)&&stringifyQuery$1(a$2.query)===stringifyQuery$1(b$4.query)&&a$2.hash===b$4.hash}function isSameRouteRecord(a$2,b$4){return(a$2.aliasOf||a$2)===(b$4.aliasOf||b$4)}function isSameRouteLocationParams(a$2,b$4){if(Object.keys(a$2).length!==Object.keys(b$4).length)return!1;for(let key$2 in a$2)if(!isSameRouteLocationParamsValue(a$2[key$2],b$4[key$2]))return!1;return!0}function isSameRouteLocationParamsValue(a$2,b$4){return isArray$3(a$2)?isEquivalentArray(a$2,b$4):isArray$3(b$4)?isEquivalentArray(b$4,a$2):a$2===b$4}function isEquivalentArray(a$2,b$4){return isArray$3(b$4)?a$2.length===b$4.length&&a$2.every((value$1,i$1)=>value$1===b$4[i$1]):a$2.length===1&&a$2[0]===b$4}function resolveRelativePath(to$2,from){if(to$2.startsWith(`/`))return to$2;if(!to$2)return from;let fromSegments=from.split(`/`),toSegments=to$2.split(`/`),lastToSegment=toSegments[toSegments.length-1];(lastToSegment===`..`||lastToSegment===`.`)&&toSegments.push(``);let position$2=fromSegments.length-1,toPosition,segment;for(toPosition=0;toPosition1&&position$2--;else break;return fromSegments.slice(0,position$2).join(`/`)+`/`+toSegments.slice(toPosition).join(`/`)}const START_LOCATION_NORMALIZED={path:`/`,name:void 0,params:{},query:{},hash:``,fullPath:`/`,matched:[],meta:{},redirectedFrom:void 0};var NavigationType;(function(NavigationType$1){NavigationType$1.pop=`pop`,NavigationType$1.push=`push`})(NavigationType||={});var NavigationDirection;(function(NavigationDirection$1){NavigationDirection$1.back=`back`,NavigationDirection$1.forward=`forward`,NavigationDirection$1.unknown=``})(NavigationDirection||={});function normalizeBase(base){if(!base)if(isBrowser$2){let baseEl=document.querySelector(`base`);base=baseEl&&baseEl.getAttribute(`href`)||`/`,base=base.replace(/^\w+:\/\/[^\/]+/,``)}else base=`/`;return base[0]!==`/`&&base[0]!==`#`&&(base=`/`+base),removeTrailingSlash(base)}const BEFORE_HASH_RE=/^[^#]+#/;function createHref(base,location$1){return base.replace(BEFORE_HASH_RE,`#`)+location$1}function getElementPosition(el$1,offset$2){let docRect=document.documentElement.getBoundingClientRect(),elRect=el$1.getBoundingClientRect();return{behavior:offset$2.behavior,left:elRect.left-docRect.left-(offset$2.left||0),top:elRect.top-docRect.top-(offset$2.top||0)}}const computeScrollPosition=()=>({left:window.scrollX,top:window.scrollY});function scrollToPosition(position$2){let scrollToOptions;if(`el`in position$2){let positionEl=position$2.el,isIdSelector=typeof positionEl==`string`&&positionEl.startsWith(`#`),el$1=typeof positionEl==`string`?isIdSelector?document.getElementById(positionEl.slice(1)):document.querySelector(positionEl):positionEl;if(!el$1)return;scrollToOptions=getElementPosition(el$1,position$2)}else scrollToOptions=position$2;`scrollBehavior`in document.documentElement.style?window.scrollTo(scrollToOptions):window.scrollTo(scrollToOptions.left==null?window.scrollX:scrollToOptions.left,scrollToOptions.top==null?window.scrollY:scrollToOptions.top)}function getScrollKey(path,delta){let position$2=history.state?history.state.position-delta:-1;return position$2+path}const scrollPositions=new Map;function saveScrollPosition(key$2,scrollPosition){scrollPositions.set(key$2,scrollPosition)}function getSavedScrollPosition(key$2){let scroll=scrollPositions.get(key$2);return scrollPositions.delete(key$2),scroll}let createBaseLocation=()=>location.protocol+`//`+location.host;function createCurrentLocation(base,location$1){let{pathname,search:search$1,hash}=location$1,hashPos=base.indexOf(`#`);if(hashPos>-1){let slicePos=hash.includes(base.slice(hashPos))?base.slice(hashPos).length:1,pathFromHash=hash.slice(slicePos);return pathFromHash[0]!==`/`&&(pathFromHash=`/`+pathFromHash),stripBase(pathFromHash,``)}let path=stripBase(pathname,base);return path+search$1+hash}function useHistoryListeners(base,historyState,currentLocation,replace){let listeners=[],teardowns=[],pauseState=null,popStateHandler=({state})=>{let to$2=createCurrentLocation(base,location),from=currentLocation.value,fromState=historyState.value,delta=0;if(state){if(currentLocation.value=to$2,historyState.value=state,pauseState&&pauseState===from){pauseState=null;return}delta=fromState?state.position-fromState.position:0}else replace(to$2);listeners.forEach(listener=>{listener(currentLocation.value,from,{delta,type:NavigationType.pop,direction:delta?delta>0?NavigationDirection.forward:NavigationDirection.back:NavigationDirection.unknown})})};function pauseListeners(){pauseState=currentLocation.value}function listen(callback){listeners.push(callback);let teardown=()=>{let index$1=listeners.indexOf(callback);index$1>-1&&listeners.splice(index$1,1)};return teardowns.push(teardown),teardown}function beforeUnloadListener(){let{history:history$1}=window;history$1.state&&history$1.replaceState(assign$1({},history$1.state,{scroll:computeScrollPosition()}),``)}function destroy(){for(let teardown of teardowns)teardown();teardowns=[],window.removeEventListener(`popstate`,popStateHandler),window.removeEventListener(`beforeunload`,beforeUnloadListener)}return window.addEventListener(`popstate`,popStateHandler),window.addEventListener(`beforeunload`,beforeUnloadListener,{passive:!0}),{pauseListeners,listen,destroy}}function buildState(back,current,forward,replaced=!1,computeScroll=!1){return{back,current,forward,replaced,position:window.history.length,scroll:computeScroll?computeScrollPosition():null}}function useHistoryStateNavigation(base){let{history:history$1,location:location$1}=window,currentLocation={value:createCurrentLocation(base,location$1)},historyState={value:history$1.state};historyState.value||changeLocation(currentLocation.value,{back:null,current:currentLocation.value,forward:null,position:history$1.length-1,replaced:!0,scroll:null},!0);function changeLocation(to$2,state,replace$1){let hashIndex=base.indexOf(`#`),url=hashIndex>-1?(location$1.host&&document.querySelector(`base`)?base:base.slice(hashIndex))+to$2:createBaseLocation()+base+to$2;try{history$1[replace$1?`replaceState`:`pushState`](state,``,url),historyState.value=state}catch(err){console.error(err),location$1[replace$1?`replace`:`assign`](url)}}function replace(to$2,data$12){let state=assign$1({},history$1.state,buildState(historyState.value.back,to$2,historyState.value.forward,!0),data$12,{position:historyState.value.position});changeLocation(to$2,state,!0),currentLocation.value=to$2}function push$1(to$2,data$12){let currentState=assign$1({},historyState.value,history$1.state,{forward:to$2,scroll:computeScrollPosition()});changeLocation(currentState.current,currentState,!0);let state=assign$1({},buildState(currentLocation.value,to$2,null),{position:currentState.position+1},data$12);changeLocation(to$2,state,!1),currentLocation.value=to$2}return{location:currentLocation,state:historyState,push:push$1,replace}}function createWebHistory(base){base=normalizeBase(base);let historyNavigation=useHistoryStateNavigation(base),historyListeners=useHistoryListeners(base,historyNavigation.state,historyNavigation.location,historyNavigation.replace);function go$1(delta,triggerListeners=!0){triggerListeners||historyListeners.pauseListeners(),history.go(delta)}let routerHistory=assign$1({location:``,base,go:go$1,createHref:createHref.bind(null,base)},historyNavigation,historyListeners);return Object.defineProperty(routerHistory,`location`,{enumerable:!0,get:()=>historyNavigation.location.value}),Object.defineProperty(routerHistory,`state`,{enumerable:!0,get:()=>historyNavigation.state.value}),routerHistory}function createWebHashHistory(base){return base=location.host?base||location.pathname+location.search:``,base.includes(`#`)||(base+=`#`),createWebHistory(base)}function isRouteLocation(route){return typeof route==`string`||route&&typeof route==`object`}function isRouteName(name$2){return typeof name$2==`string`||typeof name$2==`symbol`}const NavigationFailureSymbol=Symbol(``);var NavigationFailureType;(function(NavigationFailureType$1){NavigationFailureType$1[NavigationFailureType$1.aborted=4]=`aborted`,NavigationFailureType$1[NavigationFailureType$1.cancelled=8]=`cancelled`,NavigationFailureType$1[NavigationFailureType$1.duplicated=16]=`duplicated`})(NavigationFailureType||={});function createRouterError(type,params){return assign$1(Error(),{type,[NavigationFailureSymbol]:!0},params)}function isNavigationFailure(error,type){return error instanceof Error&&NavigationFailureSymbol in error&&(type==null||!!(error.type&type))}const BASE_PARAM_PATTERN=`[^/]+?`,BASE_PATH_PARSER_OPTIONS={sensitive:!1,strict:!1,start:!0,end:!0},REGEX_CHARS_RE=/[.+*?^${}()[\]/\\]/g;function tokensToParser(segments,extraOptions){let options$1=assign$1({},BASE_PATH_PARSER_OPTIONS,extraOptions),score=[],pattern=options$1.start?`^`:``,keys$3=[];for(let segment of segments){let segmentScores=segment.length?[]:[90];options$1.strict&&!segment.length&&(pattern+=`/`);for(let tokenIndex=0;tokenIndexb$4.length?b$4.length===1&&b$4[0]===80?1:-1:0}function comparePathParserScore(a$2,b$4){let i$1=0,aScore=a$2.score,bScore=b$4.score;for(;i$10&&last[last.length-1]<0}const ROOT_TOKEN={type:0,value:``},VALID_PARAM_RE=/[a-zA-Z0-9_]/;function tokenizePath(path){if(!path)return[[]];if(path===`/`)return[[ROOT_TOKEN]];if(!path.startsWith(`/`))throw Error(`Invalid path "${path}"`);function crash(message$1){throw Error(`ERR (${state})/"${buffer$1}": ${message$1}`)}let state=0,previousState=state,tokens=[],segment;function finalizeSegment(){segment&&tokens.push(segment),segment=[]}let i$1=0,char,buffer$1=``,customRe=``;function consumeBuffer(){buffer$1&&(state===0?segment.push({type:0,value:buffer$1}):state===1||state===2||state===3?(segment.length>1&&(char===`*`||char===`+`)&&crash(`A repeatable param (${buffer$1}) must be alone in its segment. eg: '/:ids+.`),segment.push({type:1,value:buffer$1,regexp:customRe,repeatable:char===`*`||char===`+`,optional:char===`*`||char===`?`})):crash(`Invalid state to consume buffer`),buffer$1=``)}function addCharToBuffer(){buffer$1+=char}for(;i$1{removeRoute(originalMatcher)}:noop$1}function removeRoute(matcherRef){if(isRouteName(matcherRef)){let matcher=matcherMap.get(matcherRef);matcher&&(matcherMap.delete(matcherRef),matchers.splice(matchers.indexOf(matcher),1),matcher.children.forEach(removeRoute),matcher.alias.forEach(removeRoute))}else{let index$1=matchers.indexOf(matcherRef);index$1>-1&&(matchers.splice(index$1,1),matcherRef.record.name&&matcherMap.delete(matcherRef.record.name),matcherRef.children.forEach(removeRoute),matcherRef.alias.forEach(removeRoute))}}function getRoutes(){return matchers}function insertMatcher(matcher){let index$1=findInsertionIndex(matcher,matchers);matchers.splice(index$1,0,matcher),matcher.record.name&&!isAliasRecord(matcher)&&matcherMap.set(matcher.record.name,matcher)}function resolve$1(location$1,currentLocation){let matcher,params={},path,name$2;if(`name`in location$1&&location$1.name){if(matcher=matcherMap.get(location$1.name),!matcher)throw createRouterError(1,{location:location$1});name$2=matcher.record.name,params=assign$1(paramsFromLocation(currentLocation.params,matcher.keys.filter(k$4=>!k$4.optional).concat(matcher.parent?matcher.parent.keys.filter(k$4=>k$4.optional):[]).map(k$4=>k$4.name)),location$1.params&¶msFromLocation(location$1.params,matcher.keys.map(k$4=>k$4.name))),path=matcher.stringify(params)}else if(location$1.path!=null)path=location$1.path,matcher=matchers.find(m$3=>m$3.re.test(path)),matcher&&(params=matcher.parse(path),name$2=matcher.record.name);else{if(matcher=currentLocation.name?matcherMap.get(currentLocation.name):matchers.find(m$3=>m$3.re.test(currentLocation.path)),!matcher)throw createRouterError(1,{location:location$1,currentLocation});name$2=matcher.record.name,params=assign$1({},currentLocation.params,location$1.params),path=matcher.stringify(params)}let matched=[],parentMatcher=matcher;for(;parentMatcher;)matched.unshift(parentMatcher.record),parentMatcher=parentMatcher.parent;return{name:name$2,path,params,matched,meta:mergeMetaFields(matched)}}routes$1.forEach(route=>addRoute(route));function clearRoutes(){matchers.length=0,matcherMap.clear()}return{addRoute,resolve:resolve$1,removeRoute,clearRoutes,getRoutes,getRecordMatcher}}function paramsFromLocation(params,keys$3){let newParams={};for(let key$2 of keys$3)key$2 in params&&(newParams[key$2]=params[key$2]);return newParams}function normalizeRouteRecord(record){let normalized={path:record.path,redirect:record.redirect,name:record.name,meta:record.meta||{},aliasOf:record.aliasOf,beforeEnter:record.beforeEnter,props:normalizeRecordProps(record),children:record.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:`components`in record?record.components||null:record.component&&{default:record.component}};return Object.defineProperty(normalized,`mods`,{value:{}}),normalized}function normalizeRecordProps(record){let propsObject={},props=record.props||!1;if(`component`in record)propsObject.default=props;else for(let name$2 in record.components)propsObject[name$2]=typeof props==`object`?props[name$2]:props;return propsObject}function isAliasRecord(record){for(;record;){if(record.record.aliasOf)return!0;record=record.parent}return!1}function mergeMetaFields(matched){return matched.reduce((meta,record)=>assign$1(meta,record.meta),{})}function mergeOptions(defaults$1,partialOptions){let options$1={};for(let key$2 in defaults$1)options$1[key$2]=key$2 in partialOptions?partialOptions[key$2]:defaults$1[key$2];return options$1}function findInsertionIndex(matcher,matchers){let lower=0,upper=matchers.length;for(;lower!==upper;){let mid=lower+upper>>1,sortOrder=comparePathParserScore(matcher,matchers[mid]);sortOrder<0?upper=mid:lower=mid+1}let insertionAncestor=getInsertionAncestor(matcher);return insertionAncestor&&(upper=matchers.lastIndexOf(insertionAncestor,upper-1)),upper}function getInsertionAncestor(matcher){let ancestor=matcher;for(;ancestor=ancestor.parent;)if(isMatchable(ancestor)&&comparePathParserScore(matcher,ancestor)===0)return ancestor}function isMatchable({record}){return!!(record.name||record.components&&Object.keys(record.components).length||record.redirect)}function parseQuery(search$1){let query={};if(search$1===``||search$1===`?`)return query;let hasLeadingIM=search$1[0]===`?`,searchParams=(hasLeadingIM?search$1.slice(1):search$1).split(`&`);for(let i$1=0;i$1v$2&&encodeQueryValue(v$2)):[value$1&&encodeQueryValue(value$1)];values.forEach(value$2=>{value$2!==void 0&&(search$1+=(search$1.length?`&`:``)+key$2,value$2!=null&&(search$1+=`=`+value$2))})}return search$1}function normalizeQuery(query){let normalizedQuery={};for(let key$2 in query){let value$1=query[key$2];value$1!==void 0&&(normalizedQuery[key$2]=isArray$3(value$1)?value$1.map(v$2=>v$2==null?null:``+v$2):value$1==null?value$1:``+value$1)}return normalizedQuery}const matchedRouteKey=Symbol(``),viewDepthKey=Symbol(``),routerKey=Symbol(``),routeLocationKey=Symbol(``),routerViewLocationKey=Symbol(``);function useCallbacks(){let handlers$3=[];function add$1(handler){return handlers$3.push(handler),()=>{let i$1=handlers$3.indexOf(handler);i$1>-1&&handlers$3.splice(i$1,1)}}function reset(){handlers$3=[]}return{add:add$1,list:()=>handlers$3.slice(),reset}}function guardToPromiseFn(guard,to$2,from,record,name$2,runWithContext=fn$6=>fn$6()){let enterCallbackArray=record&&(record.enterCallbacks[name$2]=record.enterCallbacks[name$2]||[]);return()=>new Promise((resolve$1,reject)=>{let next=valid$1=>{valid$1===!1?reject(createRouterError(4,{from,to:to$2})):valid$1 instanceof Error?reject(valid$1):isRouteLocation(valid$1)?reject(createRouterError(2,{from:to$2,to:valid$1})):(enterCallbackArray&&record.enterCallbacks[name$2]===enterCallbackArray&&typeof valid$1==`function`&&enterCallbackArray.push(valid$1),resolve$1())},guardReturn=runWithContext(()=>guard.call(record&&record.instances[name$2],to$2,from,next)),guardCall=Promise.resolve(guardReturn);guard.length<3&&(guardCall=guardCall.then(next)),guardCall.catch(err=>reject(err))})}function extractComponentsGuards(matched,guardType,to$2,from,runWithContext=fn$6=>fn$6()){let guards=[];for(let record of matched)for(let name$2 in record.components){let rawComponent=record.components[name$2];if(guardType!==`beforeRouteEnter`&&!record.instances[name$2])continue;if(isRouteComponent(rawComponent)){let options$1=rawComponent.__vccOpts||rawComponent,guard=options$1[guardType];guard&&guards.push(guardToPromiseFn(guard,to$2,from,record,name$2,runWithContext))}else{let componentPromise=rawComponent();guards.push(()=>componentPromise.then(resolved=>{if(!resolved)throw Error(`Couldn't resolve component "${name$2}" at "${record.path}"`);let resolvedComponent=isESModule(resolved)?resolved.default:resolved;record.mods[name$2]=resolved,record.components[name$2]=resolvedComponent;let options$1=resolvedComponent.__vccOpts||resolvedComponent,guard=options$1[guardType];return guard&&guardToPromiseFn(guard,to$2,from,record,name$2,runWithContext)()}))}}return guards}function useLink(props){let router$1=inject(routerKey),currentRoute=inject(routeLocationKey),hasPrevious=!1,previousTo=null,route=computed(()=>{let to$2=unref(props.to);return router$1.resolve(to$2)}),activeRecordIndex=computed(()=>{let{matched}=route.value,{length}=matched,routeMatched=matched[length-1],currentMatched=currentRoute.matched;if(!routeMatched||!currentMatched.length)return-1;let index$1=currentMatched.findIndex(isSameRouteRecord.bind(null,routeMatched));if(index$1>-1)return index$1;let parentRecordPath=getOriginalPath(matched[length-2]);return length>1&&getOriginalPath(routeMatched)===parentRecordPath&¤tMatched[currentMatched.length-1].path!==parentRecordPath?currentMatched.findIndex(isSameRouteRecord.bind(null,matched[length-2])):index$1}),isActive=computed(()=>activeRecordIndex.value>-1&&includesParams(currentRoute.params,route.value.params)),isExactActive=computed(()=>activeRecordIndex.value>-1&&activeRecordIndex.value===currentRoute.matched.length-1&&isSameRouteLocationParams(currentRoute.params,route.value.params));function navigate(e$3={}){if(guardEvent(e$3)){let p$5=router$1[unref(props.replace)?`replace`:`push`](unref(props.to)).catch(noop$1);return props.viewTransition&&typeof document<`u`&&`startViewTransition`in document&&document.startViewTransition(()=>p$5),p$5}return Promise.resolve()}return{route,href:computed(()=>route.value.href),isActive,isExactActive,navigate}}function preferSingleVNode(vnodes){return vnodes.length===1?vnodes[0]:vnodes}const RouterLinkImpl=defineComponent({name:`RouterLink`,compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:`page`},viewTransition:Boolean},useLink,setup(props,{slots}){let link$1=reactive(useLink(props)),{options:options$1}=inject(routerKey),elClass=computed(()=>({[getLinkClass(props.activeClass,options$1.linkActiveClass,`router-link-active`)]:link$1.isActive,[getLinkClass(props.exactActiveClass,options$1.linkExactActiveClass,`router-link-exact-active`)]:link$1.isExactActive}));return()=>{let children=slots.default&&preferSingleVNode(slots.default(link$1));return props.custom?children:h(`a`,{"aria-current":link$1.isExactActive?props.ariaCurrentValue:null,href:link$1.href,onClick:link$1.navigate,class:elClass.value},children)}}}),RouterLink=RouterLinkImpl;function guardEvent(e$3){if(!(e$3.metaKey||e$3.altKey||e$3.ctrlKey||e$3.shiftKey)&&!e$3.defaultPrevented&&!(e$3.button!==void 0&&e$3.button!==0)){if(e$3.currentTarget&&e$3.currentTarget.getAttribute){let target$1=e$3.currentTarget.getAttribute(`target`);if(/\b_blank\b/i.test(target$1))return}return e$3.preventDefault&&e$3.preventDefault(),!0}}function includesParams(outer,inner){for(let key$2 in inner){let innerValue=inner[key$2],outerValue=outer[key$2];if(typeof innerValue==`string`){if(innerValue!==outerValue)return!1}else if(!isArray$3(outerValue)||outerValue.length!==innerValue.length||innerValue.some((value$1,i$1)=>value$1!==outerValue[i$1]))return!1}return!0}function getOriginalPath(record){return record?record.aliasOf?record.aliasOf.path:record.path:``}const getLinkClass=(propClass,globalClass,defaultClass)=>propClass??globalClass??defaultClass,RouterViewImpl=defineComponent({name:`RouterView`,inheritAttrs:!1,props:{name:{type:String,default:`default`},route:Object},compatConfig:{MODE:3},setup(props,{attrs,slots}){let injectedRoute=inject(routerViewLocationKey),routeToDisplay=computed(()=>props.route||injectedRoute.value),injectedDepth=inject(viewDepthKey,0),depth=computed(()=>{let initialDepth=unref(injectedDepth),{matched}=routeToDisplay.value,matchedRoute;for(;(matchedRoute=matched[initialDepth])&&!matchedRoute.components;)initialDepth++;return initialDepth}),matchedRouteRef=computed(()=>routeToDisplay.value.matched[depth.value]);provide(viewDepthKey,computed(()=>depth.value+1)),provide(matchedRouteKey,matchedRouteRef),provide(routerViewLocationKey,routeToDisplay);let viewRef=ref();return watch(()=>[viewRef.value,matchedRouteRef.value,props.name],([instance,to$2,name$2],[oldInstance,from,oldName])=>{to$2&&(to$2.instances[name$2]=instance,from&&from!==to$2&&instance&&instance===oldInstance&&(to$2.leaveGuards.size||(to$2.leaveGuards=from.leaveGuards),to$2.updateGuards.size||(to$2.updateGuards=from.updateGuards))),instance&&to$2&&(!from||!isSameRouteRecord(to$2,from)||!oldInstance)&&(to$2.enterCallbacks[name$2]||[]).forEach(callback=>callback(instance))},{flush:`post`}),()=>{let route=routeToDisplay.value,currentName=props.name,matchedRoute=matchedRouteRef.value,ViewComponent=matchedRoute&&matchedRoute.components[currentName];if(!ViewComponent)return normalizeSlot(slots.default,{Component:ViewComponent,route});let routePropsOption=matchedRoute.props[currentName],routeProps=routePropsOption?routePropsOption===!0?route.params:typeof routePropsOption==`function`?routePropsOption(route):routePropsOption:null,onVnodeUnmounted=vnode=>{vnode.component.isUnmounted&&(matchedRoute.instances[currentName]=null)},component=h(ViewComponent,assign$1({},routeProps,attrs,{onVnodeUnmounted,ref:viewRef}));return normalizeSlot(slots.default,{Component:component,route})||component}}});function normalizeSlot(slot,data$12){if(!slot)return null;let slotContent=slot(data$12);return slotContent.length===1?slotContent[0]:slotContent}const RouterView=RouterViewImpl;function createRouter(options$1){let matcher=createRouterMatcher(options$1.routes,options$1),parseQuery$1=options$1.parseQuery||parseQuery,stringifyQuery$1=options$1.stringifyQuery||stringifyQuery,routerHistory=options$1.history,beforeGuards=useCallbacks(),beforeResolveGuards=useCallbacks(),afterGuards=useCallbacks(),currentRoute=shallowRef(START_LOCATION_NORMALIZED),pendingLocation=START_LOCATION_NORMALIZED;isBrowser$2&&options$1.scrollBehavior&&`scrollRestoration`in history&&(history.scrollRestoration=`manual`);let normalizeParams=applyToParams.bind(null,paramValue=>``+paramValue),encodeParams=applyToParams.bind(null,encodeParam),decodeParams=applyToParams.bind(null,decode$1);function addRoute(parentOrRoute,route){let parent,record;return isRouteName(parentOrRoute)?(parent=matcher.getRecordMatcher(parentOrRoute),record=route):record=parentOrRoute,matcher.addRoute(record,parent)}function removeRoute(name$2){let recordMatcher=matcher.getRecordMatcher(name$2);recordMatcher&&matcher.removeRoute(recordMatcher)}function getRoutes(){return matcher.getRoutes().map(routeMatcher=>routeMatcher.record)}function hasRoute(name$2){return!!matcher.getRecordMatcher(name$2)}function resolve$1(rawLocation,currentLocation){if(currentLocation=assign$1({},currentLocation||currentRoute.value),typeof rawLocation==`string`){let locationNormalized=parseURL(parseQuery$1,rawLocation,currentLocation.path),matchedRoute$1=matcher.resolve({path:locationNormalized.path},currentLocation),href$1=routerHistory.createHref(locationNormalized.fullPath);return assign$1(locationNormalized,matchedRoute$1,{params:decodeParams(matchedRoute$1.params),hash:decode$1(locationNormalized.hash),redirectedFrom:void 0,href:href$1})}let matcherLocation;if(rawLocation.path!=null)matcherLocation=assign$1({},rawLocation,{path:parseURL(parseQuery$1,rawLocation.path,currentLocation.path).path});else{let targetParams=assign$1({},rawLocation.params);for(let key$2 in targetParams)targetParams[key$2]??delete targetParams[key$2];matcherLocation=assign$1({},rawLocation,{params:encodeParams(targetParams)}),currentLocation.params=encodeParams(currentLocation.params)}let matchedRoute=matcher.resolve(matcherLocation,currentLocation),hash=rawLocation.hash||``;matchedRoute.params=normalizeParams(decodeParams(matchedRoute.params));let fullPath=stringifyURL(stringifyQuery$1,assign$1({},rawLocation,{hash:encodeHash(hash),path:matchedRoute.path})),href=routerHistory.createHref(fullPath);return assign$1({fullPath,hash,query:stringifyQuery$1===stringifyQuery?normalizeQuery(rawLocation.query):rawLocation.query||{}},matchedRoute,{redirectedFrom:void 0,href})}function locationAsObject(to$2){return typeof to$2==`string`?parseURL(parseQuery$1,to$2,currentRoute.value.path):assign$1({},to$2)}function checkCanceledNavigation(to$2,from){if(pendingLocation!==to$2)return createRouterError(8,{from,to:to$2})}function push$1(to$2){return pushWithRedirect(to$2)}function replace(to$2){return push$1(assign$1(locationAsObject(to$2),{replace:!0}))}function handleRedirectRecord(to$2){let lastMatched=to$2.matched[to$2.matched.length-1];if(lastMatched&&lastMatched.redirect){let{redirect}=lastMatched,newTargetLocation=typeof redirect==`function`?redirect(to$2):redirect;return typeof newTargetLocation==`string`&&(newTargetLocation=newTargetLocation.includes(`?`)||newTargetLocation.includes(`#`)?newTargetLocation=locationAsObject(newTargetLocation):{path:newTargetLocation},newTargetLocation.params={}),assign$1({query:to$2.query,hash:to$2.hash,params:newTargetLocation.path==null?to$2.params:{}},newTargetLocation)}}function pushWithRedirect(to$2,redirectedFrom){let targetLocation=pendingLocation=resolve$1(to$2),from=currentRoute.value,data$12=to$2.state,force=to$2.force,replace$1=to$2.replace===!0,shouldRedirect=handleRedirectRecord(targetLocation);if(shouldRedirect)return pushWithRedirect(assign$1(locationAsObject(shouldRedirect),{state:typeof shouldRedirect==`object`?assign$1({},data$12,shouldRedirect.state):data$12,force,replace:replace$1}),redirectedFrom||targetLocation);let toLocation=targetLocation;toLocation.redirectedFrom=redirectedFrom;let failure;return!force&&isSameRouteLocation(stringifyQuery$1,from,targetLocation)&&(failure=createRouterError(16,{to:toLocation,from}),handleScroll(from,from,!0,!1)),(failure?Promise.resolve(failure):navigate(toLocation,from)).catch(error=>isNavigationFailure(error)?isNavigationFailure(error,2)?error:markAsReady(error):triggerError(error,toLocation,from)).then(failure$1=>{if(failure$1){if(isNavigationFailure(failure$1,2))return pushWithRedirect(assign$1({replace:replace$1},locationAsObject(failure$1.to),{state:typeof failure$1.to==`object`?assign$1({},data$12,failure$1.to.state):data$12,force}),redirectedFrom||toLocation)}else failure$1=finalizeNavigation(toLocation,from,!0,replace$1,data$12);return triggerAfterEach(toLocation,from,failure$1),failure$1})}function checkCanceledNavigationAndReject(to$2,from){let error=checkCanceledNavigation(to$2,from);return error?Promise.reject(error):Promise.resolve()}function runWithContext(fn$6){let app=installedApps.values().next().value;return app&&typeof app.runWithContext==`function`?app.runWithContext(fn$6):fn$6()}function navigate(to$2,from){let guards,[leavingRecords,updatingRecords,enteringRecords]=extractChangingRecords(to$2,from);guards=extractComponentsGuards(leavingRecords.reverse(),`beforeRouteLeave`,to$2,from);for(let record of leavingRecords)record.leaveGuards.forEach(guard=>{guards.push(guardToPromiseFn(guard,to$2,from))});let canceledNavigationCheck=checkCanceledNavigationAndReject.bind(null,to$2,from);return guards.push(canceledNavigationCheck),runGuardQueue(guards).then(()=>{guards=[];for(let guard of beforeGuards.list())guards.push(guardToPromiseFn(guard,to$2,from));return guards.push(canceledNavigationCheck),runGuardQueue(guards)}).then(()=>{guards=extractComponentsGuards(updatingRecords,`beforeRouteUpdate`,to$2,from);for(let record of updatingRecords)record.updateGuards.forEach(guard=>{guards.push(guardToPromiseFn(guard,to$2,from))});return guards.push(canceledNavigationCheck),runGuardQueue(guards)}).then(()=>{guards=[];for(let record of enteringRecords)if(record.beforeEnter)if(isArray$3(record.beforeEnter))for(let beforeEnter of record.beforeEnter)guards.push(guardToPromiseFn(beforeEnter,to$2,from));else guards.push(guardToPromiseFn(record.beforeEnter,to$2,from));return guards.push(canceledNavigationCheck),runGuardQueue(guards)}).then(()=>(to$2.matched.forEach(record=>record.enterCallbacks={}),guards=extractComponentsGuards(enteringRecords,`beforeRouteEnter`,to$2,from,runWithContext),guards.push(canceledNavigationCheck),runGuardQueue(guards))).then(()=>{guards=[];for(let guard of beforeResolveGuards.list())guards.push(guardToPromiseFn(guard,to$2,from));return guards.push(canceledNavigationCheck),runGuardQueue(guards)}).catch(err=>isNavigationFailure(err,8)?err:Promise.reject(err))}function triggerAfterEach(to$2,from,failure){afterGuards.list().forEach(guard=>runWithContext(()=>guard(to$2,from,failure)))}function finalizeNavigation(toLocation,from,isPush,replace$1,data$12){let error=checkCanceledNavigation(toLocation,from);if(error)return error;let isFirstNavigation=from===START_LOCATION_NORMALIZED,state=isBrowser$2?history.state:{};isPush&&(replace$1||isFirstNavigation?routerHistory.replace(toLocation.fullPath,assign$1({scroll:isFirstNavigation&&state&&state.scroll},data$12)):routerHistory.push(toLocation.fullPath,data$12)),currentRoute.value=toLocation,handleScroll(toLocation,from,isPush,isFirstNavigation),markAsReady()}let removeHistoryListener;function setupListeners(){removeHistoryListener||=routerHistory.listen((to$2,_from,info)=>{if(!router$1.listening)return;let toLocation=resolve$1(to$2),shouldRedirect=handleRedirectRecord(toLocation);if(shouldRedirect){pushWithRedirect(assign$1(shouldRedirect,{replace:!0,force:!0}),toLocation).catch(noop$1);return}pendingLocation=toLocation;let from=currentRoute.value;isBrowser$2&&saveScrollPosition(getScrollKey(from.fullPath,info.delta),computeScrollPosition()),navigate(toLocation,from).catch(error=>isNavigationFailure(error,12)?error:isNavigationFailure(error,2)?(pushWithRedirect(assign$1(locationAsObject(error.to),{force:!0}),toLocation).then(failure=>{isNavigationFailure(failure,20)&&!info.delta&&info.type===NavigationType.pop&&routerHistory.go(-1,!1)}).catch(noop$1),Promise.reject()):(info.delta&&routerHistory.go(-info.delta,!1),triggerError(error,toLocation,from))).then(failure=>{failure||=finalizeNavigation(toLocation,from,!1),failure&&(info.delta&&!isNavigationFailure(failure,8)?routerHistory.go(-info.delta,!1):info.type===NavigationType.pop&&isNavigationFailure(failure,20)&&routerHistory.go(-1,!1)),triggerAfterEach(toLocation,from,failure)}).catch(noop$1)})}let readyHandlers=useCallbacks(),errorListeners=useCallbacks(),ready;function triggerError(error,to$2,from){markAsReady(error);let list$2=errorListeners.list();return list$2.length?list$2.forEach(handler=>handler(error,to$2,from)):console.error(error),Promise.reject(error)}function isReady(){return ready&¤tRoute.value!==START_LOCATION_NORMALIZED?Promise.resolve():new Promise((resolve$2,reject)=>{readyHandlers.add([resolve$2,reject])})}function markAsReady(err){return ready||(ready=!err,setupListeners(),readyHandlers.list().forEach(([resolve$2,reject])=>err?reject(err):resolve$2()),readyHandlers.reset()),err}function handleScroll(to$2,from,isPush,isFirstNavigation){let{scrollBehavior}=options$1;if(!isBrowser$2||!scrollBehavior)return Promise.resolve();let scrollPosition=!isPush&&getSavedScrollPosition(getScrollKey(to$2.fullPath,0))||(isFirstNavigation||!isPush)&&history.state&&history.state.scroll||null;return nextTick().then(()=>scrollBehavior(to$2,from,scrollPosition)).then(position$2=>position$2&&scrollToPosition(position$2)).catch(err=>triggerError(err,to$2,from))}let go$1=delta=>routerHistory.go(delta),started,installedApps=new Set,router$1={currentRoute,listening:!0,addRoute,removeRoute,clearRoutes:matcher.clearRoutes,hasRoute,getRoutes,resolve:resolve$1,options:options$1,push:push$1,replace,go:go$1,back:()=>go$1(-1),forward:()=>go$1(1),beforeEach:beforeGuards.add,beforeResolve:beforeResolveGuards.add,afterEach:afterGuards.add,onError:errorListeners.add,isReady,install(app){let router$2=this;app.component(`RouterLink`,RouterLink),app.component(`RouterView`,RouterView),app.config.globalProperties.$router=router$2,Object.defineProperty(app.config.globalProperties,`$route`,{enumerable:!0,get:()=>unref(currentRoute)}),isBrowser$2&&!started&¤tRoute.value===START_LOCATION_NORMALIZED&&(started=!0,push$1(routerHistory.location).catch(err=>{}));let reactiveRoute={};for(let key$2 in START_LOCATION_NORMALIZED)Object.defineProperty(reactiveRoute,key$2,{get:()=>currentRoute.value[key$2],enumerable:!0});app.provide(routerKey,router$2),app.provide(routeLocationKey,shallowReactive(reactiveRoute)),app.provide(routerViewLocationKey,currentRoute);let unmountApp=app.unmount;installedApps.add(app),app.unmount=function(){installedApps.delete(app),installedApps.size<1&&(pendingLocation=START_LOCATION_NORMALIZED,removeHistoryListener&&removeHistoryListener(),removeHistoryListener=null,currentRoute.value=START_LOCATION_NORMALIZED,started=!1,ready=!1),unmountApp()}}};function runGuardQueue(guards){return guards.reduce((promise,guard)=>promise.then(()=>runWithContext(guard)),Promise.resolve())}return router$1}function extractChangingRecords(to$2,from){let leavingRecords=[],updatingRecords=[],enteringRecords=[],len=Math.max(from.matched.length,to$2.matched.length);for(let i$1=0;i$1isSameRouteRecord(record,recordFrom))?updatingRecords.push(recordFrom):leavingRecords.push(recordFrom));let recordTo=to$2.matched[i$1];recordTo&&(from.matched.find(record=>isSameRouteRecord(record,recordTo))||enteringRecords.push(recordTo))}return[leavingRecords,updatingRecords,enteringRecords]}function useRouter(){return inject(routerKey)}function useRoute(_name){return inject(routeLocationKey)}const routes=[{path:`/`,name:`IndexScenePage`,component:()=>__vitePreload(()=>import(`./pages-DqJj8AHh.js`),__vite__mapDeps([5,6,1,2,7,8,9,4,10,11,12])),meta:{layout:`stage`,stageTransition:{name:`bubble-wave-out`}}},{path:`/:all(.*)`,name:`/[...all]`,component:()=>__vitePreload(()=>import(`./_...all_-FwJQpnSo.js`),[])},{path:`/audio`,name:`/audio`,component:()=>__vitePreload(()=>import(`./audio-BBLd3epQ.js`),[])},{path:`/devtools`,children:[{path:`audio-record`,name:`/devtools/audio-record`,component:()=>__vitePreload(()=>import(`./audio-record-DIcCrdh3.js`),[])},{path:`background-remove`,name:`/devtools/background-remove`,component:()=>__vitePreload(()=>import(`./background-remove-CaMBEs_t.js`),__vite__mapDeps([13,14,15]))},{path:`chat`,name:`/devtools/chat`,component:()=>__vitePreload(()=>import(`./chat-DXU-idBw.js`),[])},{path:`gesture-circle`,name:`/devtools/gesture-circle`,component:()=>__vitePreload(()=>import(`./gesture-circle-BcNJ-k8_.js`),__vite__mapDeps([16,6])),meta:{layout:`plain`}},{path:`image`,name:`/devtools/image`,component:()=>__vitePreload(()=>import(`./image-Y0D9IcSN.js`),__vite__mapDeps([17,18]))},{path:`polaroid`,name:`/devtools/polaroid`,component:()=>__vitePreload(()=>import(`./polaroid-CpEbVTFH.js`),__vite__mapDeps([19,10,11,12]))},{path:`vibrant`,name:`/devtools/vibrant`,component:()=>__vitePreload(()=>import(`./vibrant-CGg8wx9d.js`),__vite__mapDeps([20,21,15]))}]},{path:`/queue`,name:`/queue`,component:()=>__vitePreload(()=>import(`./queue-B4yd_q6Y.js`),[])},{path:`/settings`,children:[{path:``,name:`/settings/`,component:()=>__vitePreload(()=>import(`./settings-BKVfWP0V.js`),__vite__mapDeps([22,6,23])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`airi-card`,children:[{path:``,name:`/settings/airi-card/`,component:()=>__vitePreload(()=>import(`./airi-card-BDbpb8YI.js`),__vite__mapDeps([24,6,25,26,27,28,29,30,15])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`components`,children:[{path:`CardCreate`,name:`/settings/airi-card/components/CardCreate`,component:()=>__vitePreload(()=>import(`./CardCreate-BnBq88i7.js`),__vite__mapDeps([31,25]))},{path:`CardCreationDialog`,name:`/settings/airi-card/components/CardCreationDialog`,component:()=>__vitePreload(()=>import(`./CardCreationDialog-DNJ23ym3.js`),__vite__mapDeps([32,26,27]))},{path:`CardDetailDialog`,name:`/settings/airi-card/components/CardDetailDialog`,component:()=>__vitePreload(()=>import(`./CardDetailDialog-DrRzlnwS.js`),__vite__mapDeps([33,28,29]))},{path:`CardListItem`,name:`/settings/airi-card/components/CardListItem`,component:()=>__vitePreload(()=>import(`./CardListItem-DeblkTcG.js`),__vite__mapDeps([34,30]))},{path:`DeleteCardDialog`,name:`/settings/airi-card/components/DeleteCardDialog`,component:()=>__vitePreload(()=>import(`./DeleteCardDialog-Db_k2voK.js`),__vite__mapDeps([35,29]))}]}]},{path:`appearance`,children:[{path:``,name:`/settings/appearance/`,component:()=>__vitePreload(()=>import(`./appearance-CF2ZynHB.js`),__vite__mapDeps([36,6])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}},{path:`color-scheme`,name:`/settings/appearance/color-scheme`,component:()=>__vitePreload(()=>import(`./color-scheme-DVge0MdZ.js`),__vite__mapDeps([37,6,38])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`developer`,name:`/settings/appearance/developer`,component:()=>__vitePreload(()=>import(`./developer-DlN6BLxq.js`),__vite__mapDeps([39,6])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`general`,name:`/settings/appearance/general`,component:()=>__vitePreload(()=>import(`./general-B5ZCNzAX.js`),__vite__mapDeps([40,6])),meta:{layout:`settings`,stageTransition:{name:`slide`}}}]},{path:`memory`,children:[{path:``,name:`/settings/memory/`,component:()=>__vitePreload(()=>import(`./memory-CxpzfPsV.js`),__vite__mapDeps([41,6])),meta:{layout:`settings`,stageTransition:{name:`slide`}}}]},{path:`models`,children:[{path:``,name:`/settings/models/`,component:()=>__vitePreload(()=>import(`./models-CGf69gF5.js`),__vite__mapDeps([42,6,23,43,10,11,12,21])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}}]},{path:`modules`,children:[{path:``,name:`/settings/modules/`,component:()=>__vitePreload(()=>import(`./modules-DOiXOO9v.js`),__vite__mapDeps([44,6,23,43])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}},{path:`consciousness`,name:`/settings/modules/consciousness`,component:()=>__vitePreload(()=>import(`./consciousness-BZ0UAvpf.js`),__vite__mapDeps([45,6])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`hearing`,name:`/settings/modules/hearing`,component:()=>__vitePreload(()=>import(`./hearing-Xas1IMB8.js`),__vite__mapDeps([46,6,14])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`memory-long-term`,name:`/settings/modules/memory-long-term`,component:()=>__vitePreload(()=>import(`./memory-long-term-g3FFPLwk.js`),__vite__mapDeps([47,6])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`memory-short-term`,name:`/settings/modules/memory-short-term`,component:()=>__vitePreload(()=>import(`./memory-short-term-BGQrHIiR.js`),__vite__mapDeps([48,6])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`speech`,name:`/settings/modules/speech`,component:()=>__vitePreload(()=>import(`./speech-KhxwETXc.js`),__vite__mapDeps([49,6,8,50])),meta:{layout:`settings`,stageTransition:{name:`slide`}}}]},{path:`providers`,children:[{path:``,name:`/settings/providers/`,component:()=>__vitePreload(()=>import(`./providers-B5wbeFJM.js`),__vite__mapDeps([51,6,23,43])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}},{path:`alibaba-cloud-model-studio`,name:`/settings/providers/alibaba-cloud-model-studio`,component:()=>__vitePreload(()=>import(`./alibaba-cloud-model-studio-CKp1Z1Ta.js`),__vite__mapDeps([52,6])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`anthropic`,name:`/settings/providers/anthropic`,component:()=>__vitePreload(()=>import(`./anthropic-CEBNe0YC.js`),__vite__mapDeps([53,6])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`azure-ai-foundry`,name:`/settings/providers/azure-ai-foundry`,component:()=>__vitePreload(()=>import(`./azure-ai-foundry-Bkkz_TjR.js`),__vite__mapDeps([54,6])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`cloudflare-workers-ai`,name:`/settings/providers/cloudflare-workers-ai`,component:()=>__vitePreload(()=>import(`./cloudflare-workers-ai-Di_IJhvu.js`),__vite__mapDeps([55,6])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`deepseek`,name:`/settings/providers/deepseek`,component:()=>__vitePreload(()=>import(`./deepseek-CROq3FT6.js`),__vite__mapDeps([56,6])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`elevenlabs`,name:`/settings/providers/elevenlabs`,component:()=>__vitePreload(()=>import(`./elevenlabs-DBr8vpGg.js`),__vite__mapDeps([57,6])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`featherless-ai`,name:`/settings/providers/featherless-ai`,component:()=>__vitePreload(()=>import(`./featherless-ai-D0EyBsme.js`),__vite__mapDeps([58,6])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`fireworks-ai`,name:`/settings/providers/fireworks-ai`,component:()=>__vitePreload(()=>import(`./fireworks-ai-UvXpnZ_T.js`),__vite__mapDeps([59,6])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`google-generative-ai`,name:`/settings/providers/google-generative-ai`,component:()=>__vitePreload(()=>import(`./google-generative-ai-up4rXKy8.js`),__vite__mapDeps([60,6])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`microsoft-speech`,name:`/settings/providers/microsoft-speech`,component:()=>__vitePreload(()=>import(`./microsoft-speech-BY2LoVCU.js`),__vite__mapDeps([61,6])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`mistral-ai`,name:`/settings/providers/mistral-ai`,component:()=>__vitePreload(()=>import(`./mistral-ai-D39sepT1.js`),__vite__mapDeps([62,6])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`moonshot-ai`,name:`/settings/providers/moonshot-ai`,component:()=>__vitePreload(()=>import(`./moonshot-ai-CTozCMSf.js`),__vite__mapDeps([63,6])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`novita-ai`,name:`/settings/providers/novita-ai`,component:()=>__vitePreload(()=>import(`./novita-ai-dw27Ts63.js`),__vite__mapDeps([64,6])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`ollama`,name:`/settings/providers/ollama`,component:()=>__vitePreload(()=>import(`./ollama-tQHRYGgL.js`),__vite__mapDeps([65,6])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`openai`,name:`/settings/providers/openai`,component:()=>__vitePreload(()=>import(`./openai-Dpz_1L0T.js`),__vite__mapDeps([66,6])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`openai-audio-speech`,name:`/settings/providers/openai-audio-speech`,component:()=>__vitePreload(()=>import(`./openai-audio-speech-BkZ6fMPR.js`),__vite__mapDeps([67,6])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`openai-audio-transcription`,name:`/settings/providers/openai-audio-transcription`,component:()=>__vitePreload(()=>import(`./openai-audio-transcription-DB_zNBWO.js`),__vite__mapDeps([68,6])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`openrouter-ai`,name:`/settings/providers/openrouter-ai`,component:()=>__vitePreload(()=>import(`./openrouter-ai-nUDctjfq.js`),__vite__mapDeps([69,6])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`player2`,name:`/settings/providers/player2`,component:()=>__vitePreload(()=>import(`./player2-BMI1LzL_.js`),__vite__mapDeps([70,6])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`player2-speech`,name:`/settings/providers/player2-speech`,component:()=>__vitePreload(()=>import(`./player2-speech-Dr2qPb6l.js`),__vite__mapDeps([71,6])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`together-ai`,name:`/settings/providers/together-ai`,component:()=>__vitePreload(()=>import(`./together-ai-06SXbXqA.js`),__vite__mapDeps([72,6])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`volcengine`,name:`/settings/providers/volcengine`,component:()=>__vitePreload(()=>import(`./volcengine-XpwUu7NL.js`),__vite__mapDeps([73,6])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`xai`,name:`/settings/providers/xai`,component:()=>__vitePreload(()=>import(`./xai-CxK8L2y1.js`),__vite__mapDeps([74,6])),meta:{layout:`settings`,stageTransition:{name:`slide`}}}]},{path:`scene`,children:[{path:``,name:`/settings/scene/`,component:()=>__vitePreload(()=>import(`./scene-CkCOD6hR.js`),__vite__mapDeps([75,6,23,43])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}}]}]},{path:`/stage`,children:[{path:``,name:`StageScenePage`,component:()=>__vitePreload(()=>import(`./stage-Bsg2THie.js`),__vite__mapDeps([76,6,1,2,7,8,9,4,10,11,12])),meta:{layout:`stage`,stageTransition:{name:`bubble-wave-out`}}}]},{path:`/test`,children:[{path:`filter-message`,name:`/test/filter-message`,component:()=>__vitePreload(()=>import(`./filter-message-BWzou1ED.js`),__vite__mapDeps([77,8,50]))},{path:`queues`,children:[{path:`delays`,name:`/test/queues/delays`,component:()=>__vitePreload(()=>import(`./delays-tYDkCeIB.js`),__vite__mapDeps([78,8,50]))},{path:`emotions`,name:`/test/queues/emotions`,component:()=>__vitePreload(()=>import(`./emotions-DpXE-YF0.js`),__vite__mapDeps([79,8,50]))},{path:`messages`,name:`/test/queues/messages`,component:()=>__vitePreload(()=>import(`./messages-BQuV_Wj8.js`),__vite__mapDeps([80,8,50]))}]}]}];var AudioSpectrum_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`AudioSpectrum`,props:{stream:{},bars:{default:32},minFreq:{default:60},maxFreq:{default:4e3}},setup(__props){let props=__props,frequencies=ref(Array.from({length:props.bars}).fill(0));onMounted(()=>{handleAnalyze()}),watch(()=>props.stream,()=>{handleAnalyze()});function handleAnalyze(){if(!props.stream)return;let audioContext=new(window.AudioContext||window.webkitAudioContext),source=audioContext.createMediaStreamSource(props.stream),analyser=audioContext.createAnalyser();analyser.fftSize=2048,source.connect(analyser);let bufferLength=analyser.frequencyBinCount,dataArray=new Uint8Array(bufferLength),sampleRate=audioContext.sampleRate,frequencyResolution=sampleRate/analyser.fftSize,minBin=Math.floor(props.minFreq/frequencyResolution),maxBin=Math.floor(props.maxFreq/frequencyResolution),usableBins=maxBin-minBin,binsPerBar=Math.floor(usableBins/props.bars),analyze=()=>{try{requestAnimationFrame(analyze),analyser.getByteFrequencyData(dataArray);let bars=Array.from({length:props.bars}).fill(0);for(let i$1=0;i$1renderSlot(_ctx.$slots,`default`,{frequencies:frequencies.value})}}),AudioSpectrum_default=AudioSpectrum_vue_vue_type_script_setup_true_lang_default;const _hoisted_1$48={"h-full":``,flex:``,"items-center":``,"gap-1":``},AMPLIFICATION=5;var AudioSpectrumVisualizer_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`AudioSpectrumVisualizer`,props:{frequencies:{},barsClass:{}},setup(__props){let props=__props;function getReductionFactor(index$1,totalBars){let minFactor=.1,maxFactor=1;return minFactor+(maxFactor-minFactor)*(index$1/totalBars)}function getBarHeight(frequency,index$1){let reductionFactor=getReductionFactor(index$1,props.frequencies.length);return Math.min(100,Math.max(10,frequency*100*AMPLIFICATION*reductionFactor))}return(_ctx,_cache$1)=>(openBlock(),createElementBlock(`div`,_hoisted_1$48,[(openBlock(!0),createElementBlock(Fragment,null,renderList(_ctx.frequencies,(frequency,index$1)=>(openBlock(),createElementBlock(`div`,{key:index$1,"h-full":``,flex:``,"flex-1":``,"items-end":``},[createBaseVNode(`div`,{transition:`all 100 ease-in-out`,"mx-auto":``,"my-0":``,"w-full":``,"rounded-full":``,class:normalizeClass(_ctx.barsClass),style:normalizeStyle({height:`${getBarHeight(frequency,index$1)}%`})},null,6)]))),128))]))}}),AudioSpectrumVisualizer_default=AudioSpectrumVisualizer_vue_vue_type_script_setup_true_lang_default;const _hoisted_1$47={key:0,class:`mb-2 flex items-center justify-between`},_hoisted_2$31={class:`text-sm font-medium`},_hoisted_3$25={class:`text-sm text-neutral-500`};var LevelMeter_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`LevelMeter`,props:{level:{},min:{default:0},max:{default:100},numBars:{default:20},label:{default:`Level`},unit:{default:`%`},height:{default:24},showHeader:{type:Boolean,default:!0},animationSpeed:{default:75},colorThresholds:{default:()=>[{value:60,color:`bg-green-500`},{value:80,color:`bg-yellow-500`},{value:100,color:`bg-red-500`}]},formatValue:{}},setup(__props){let props=__props,levelBars=computed(()=>{let normalizedLevel=Math.max(0,Math.min(100,(props.level-props.min)/(props.max-props.min)*100)),activeBars=Math.floor(normalizedLevel/100*props.numBars);return Array.from({length:props.numBars},(_$2,i$1)=>({active:i$1a$2.value-b$4.value);for(let threshold of thresholds)if(barLevel<=threshold.value)return threshold.color;return thresholds[thresholds.length-1]?.color||`bg-green-500`}return(_ctx,_cache$1)=>(openBlock(),createElementBlock(`div`,null,[_ctx.showHeader?(openBlock(),createElementBlock(`div`,_hoisted_1$47,[createBaseVNode(`span`,_hoisted_2$31,toDisplayString(_ctx.label),1),createBaseVNode(`span`,_hoisted_3$25,toDisplayString(_ctx.formatValue?_ctx.formatValue(_ctx.level):`${Math.round(_ctx.level)}${_ctx.unit}`),1)])):createCommentVNode(``,!0),createBaseVNode(`div`,{class:`flex items-end gap-1 rounded bg-neutral-200/45 p-1 dark:bg-neutral-700`,style:normalizeStyle({height:`${_ctx.height}px`})},[(openBlock(!0),createElementBlock(Fragment,null,renderList(levelBars.value,(bar,index$1)=>(openBlock(),createElementBlock(`div`,{key:index$1,class:normalizeClass([`flex-1 rounded-sm transition-all`,[bar.active?getBarColor(index$1,bar.level):`bg-neutral-200 dark:bg-neutral-600`,`duration-${_ctx.animationSpeed}`]]),style:normalizeStyle({height:bar.active?`100%`:`20%`})},null,6))),128))],4)]))}}),LevelMeter_default=LevelMeter_vue_vue_type_script_setup_true_lang_default,Volumed_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`Volumed`,props:{perspective:{},transform:{}},setup(__props){return(_ctx,_cache$1)=>(openBlock(),createElementBlock(`div`,{class:`volumed`,style:normalizeStyle({perspective:`${_ctx.perspective}px`,transform:_ctx.transform})},[renderSlot(_ctx.$slots,`default`,{},void 0,!0)],4))}}),__plugin_vue_export_helper_default=(sfc,props)=>{let target$1=sfc.__vccOpts||sfc;for(let[key$2,val]of props)target$1[key$2]=val;return target$1},Volumed_default=__plugin_vue_export_helper_default(Volumed_vue_vue_type_script_setup_true_lang_default,[[`__scopeId`,`data-v-d8ce56aa`]]),CursorMomentum_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`CursorMomentum`,props:{baseSpeed:{default:.1},friction:{default:.95},momentumFactor:{default:.005}},setup(__props,{expose:__expose}){let props=__props,momentum=ref(1),currentValue=ref(0),lastTimestamp=0,FRICTION=toRef(()=>props.friction),BASE_SPEED=toRef(()=>props.baseSpeed),MOMENTUM_FACTOR=toRef(()=>props.momentumFactor);function updateMomentum(timestamp$2){lastTimestamp||=timestamp$2;let deltaTime=timestamp$2-lastTimestamp;lastTimestamp=timestamp$2,momentum.value=BASE_SPEED.value+(momentum.value-BASE_SPEED.value)*FRICTION.value,currentValue.value+=momentum.value*deltaTime,requestAnimationFrame(updateMomentum)}function handleMouseMove(event){let speed=Math.sqrt(event.movementX**2+event.movementY**2);momentum.value+=speed*MOMENTUM_FACTOR.value}return onMounted(()=>{window.addEventListener(`mousemove`,handleMouseMove),requestAnimationFrame(updateMomentum)}),onUnmounted(()=>{window.removeEventListener(`mousemove`,handleMouseMove)}),__expose({momentum,currentValue}),(_ctx,_cache$1)=>renderSlot(_ctx.$slots,`default`,{momentum:momentum.value,currentValue:currentValue.value})}}),CursorMomentum_default=CursorMomentum_vue_vue_type_script_setup_true_lang_default,TestDummyMarkerFlat_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`TestDummyMarkerFlat`,props:{size:{}},setup(__props){return(_ctx,_cache$1)=>(openBlock(),createElementBlock(`div`,{class:`test-dummy-flat`,style:normalizeStyle({width:`${_ctx.size}px`,height:`${_ctx.size}px`})},_cache$1[0]||=[createBaseVNode(`div`,{class:`marker`},null,-1)],4))}}),TestDummyMarkerFlat_default=__plugin_vue_export_helper_default(TestDummyMarkerFlat_vue_vue_type_script_setup_true_lang_default,[[`__scopeId`,`data-v-28f8c660`]]),TestDummyMarker_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`TestDummyMarker`,setup(__props){return(_ctx,_cache$1)=>(openBlock(),createBlock(CursorMomentum_default,{"base-speed":.1,friction:.95,"momentum-factor":5e-4},{default:withCtx(({currentValue})=>[createVNode(Volumed_default,{perspective:800,transform:`rotateX(45deg) translateY(3px)`},{default:withCtx(()=>[createVNode(TestDummyMarkerFlat_default,{size:24,style:normalizeStyle({transform:`rotate(${currentValue}deg)`})},null,8,[`style`])]),_:2},1024)]),_:1}))}}),TestDummyMarker_default=TestDummyMarker_vue_vue_type_script_setup_true_lang_default;const _hoisted_1$46={key:0,class:`mb-2 flex items-center justify-between`},_hoisted_2$30={class:`text-sm font-medium`},_hoisted_3$24={class:`text-sm text-neutral-500`},_hoisted_4$20={key:1,class:`mt-1 flex gap-3 text-xs text-neutral-500`},_hoisted_5$16={class:`flex items-center gap-1`},_hoisted_6$14={class:`flex items-center gap-1`},_hoisted_7$9={class:`flex items-center gap-1`};var ThresholdMeter_vue_vue_type_script_setup_true_lang_default=defineComponent({__name:`ThresholdMeter`,props:{value:{},threshold:{},min:{default:0},max:{default:1},numBars:{default:20},label:{default:`Value`},unit:{default:`%`},precision:{default:1},height:{default:24},showHeader:{type:Boolean,default:!0},showLegend:{type:Boolean,default:!0},animationSpeed:{default:100},belowThresholdClass:{default:`bg-primary-300 dark:bg-primary-600`},aboveThresholdClass:{default:`bg-green-500`},thresholdBarClass:{default:`bg-white dark:bg-neutral-800`},inactiveBarClass:{default:`bg-neutral-300 dark:bg-neutral-600`},belowLabel:{default:`Below`},aboveLabel:{default:`Above`},thresholdLabel:{default:`Threshold`},formatValue:{}},setup(__props){let props=__props,thresholdBars=computed(()=>{let normalizedValue=Math.max(0,Math.min(1,(props.value-props.min)/(props.max-props.min))),normalizedThreshold=Math.max(0,Math.min(1,(props.threshold-props.min)/(props.max-props.min))),activeBars=Math.floor(normalizedValue*props.numBars),thresholdBar=Math.floor(normalizedThreshold*props.numBars);return Array.from({length:props.numBars},(_$2,i$1)=>({active:i$1=thresholdBar,isBelowThreshold:i$1(openBlock(),createElementBlock(`div`,null,[_ctx.showHeader?(openBlock(),createElementBlock(`div`,_hoisted_1$46,[createBaseVNode(`span`,_hoisted_2$30,toDisplayString(_ctx.label),1),createBaseVNode(`span`,_hoisted_3$24,toDisplayString(_ctx.formatValue?_ctx.formatValue(_ctx.value):`${(_ctx.value*100).toFixed(_ctx.precision)}${_ctx.unit}`),1)])):createCommentVNode(``,!0),createBaseVNode(`div`,{class:`flex items-end gap-1 rounded bg-neutral-200/45 p-1 p-1 dark:bg-neutral-700`,style:normalizeStyle({height:`${_ctx.height}px`})},[(openBlock(!0),createElementBlock(Fragment,null,renderList(thresholdBars.value,(bar,index$1)=>(openBlock(),createElementBlock(`div`,{key:`threshold-${index$1}`,class:normalizeClass([`flex-1 rounded-sm transition-all`,[bar.isThreshold?_ctx.thresholdBarClass:bar.isAboveThreshold?_ctx.aboveThresholdClass:bar.isBelowThreshold?_ctx.belowThresholdClass:_ctx.inactiveBarClass,`duration-${_ctx.animationSpeed}`]]),style:normalizeStyle({height:bar.active||bar.isThreshold?`100%`:`20%`})},null,6))),128))],4),_ctx.showLegend?(openBlock(),createElementBlock(`div`,_hoisted_4$20,[createBaseVNode(`span`,_hoisted_5$16,[createBaseVNode(`div`,{class:normalizeClass(`inline-block h-0.5lh w-1lh rounded-full ${_ctx.belowThresholdClass}`)},null,2),createTextVNode(` `+toDisplayString(_ctx.belowLabel),1)]),createBaseVNode(`span`,_hoisted_6$14,[createBaseVNode(`div`,{class:normalizeClass(`inline-block h-0.5lh w-1lh rounded-full border border-neutral-400 ${_ctx.thresholdBarClass}`)},null,2),createTextVNode(` `+toDisplayString(_ctx.thresholdLabel),1)]),createBaseVNode(`span`,_hoisted_7$9,[createBaseVNode(`div`,{class:normalizeClass(`inline-block h-0.5lh w-1lh rounded-full ${_ctx.aboveThresholdClass}`)},null,2),createTextVNode(` `+toDisplayString(_ctx.aboveLabel),1)])])):createCommentVNode(``,!0)]))}}),ThresholdMeter_default=ThresholdMeter_vue_vue_type_script_setup_true_lang_default;const parseNumber$1=(color$2,len)=>{if(typeof color$2==`number`){if(len===3)return{mode:`rgb`,r:(color$2>>8&15|color$2>>4&240)/255,g:(color$2>>4&15|color$2&240)/255,b:(color$2&15|color$2<<4&240)/255};if(len===4)return{mode:`rgb`,r:(color$2>>12&15|color$2>>8&240)/255,g:(color$2>>8&15|color$2>>4&240)/255,b:(color$2>>4&15|color$2&240)/255,alpha:(color$2&15|color$2<<4&240)/255};if(len===6)return{mode:`rgb`,r:(color$2>>16&255)/255,g:(color$2>>8&255)/255,b:(color$2&255)/255};if(len===8)return{mode:`rgb`,r:(color$2>>24&255)/255,g:(color$2>>16&255)/255,b:(color$2>>8&255)/255,alpha:(color$2&255)/255}}};var parseNumber_default=parseNumber$1;const named={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};var named_default=named;const parseNamed=color$2=>parseNumber_default(named_default[color$2.toLowerCase()],6);var parseNamed_default=parseNamed;const hex=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,parseHex=color$2=>{let match;return(match=color$2.match(hex))?parseNumber_default(parseInt(match[1],16),match[1].length):void 0};var parseHex_default=parseHex;const num$1=`([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)`,num_none=`(?:${num$1}|none)`,per=`${num$1}%`,per_none=`(?:${num$1}%|none)`,num_per=`(?:${num$1}%|${num$1})`,num_per_none=`(?:${num$1}%|${num$1}|none)`,hue=`(?:${num$1}(deg|grad|rad|turn)|${num$1})`,hue_none=`(?:${num$1}(deg|grad|rad|turn)|${num$1}|none)`,c$2=`\\s*,\\s*`,rx_num_per_none=RegExp(`^`+num_per_none+`$`),rgb_num_old=RegExp(`^rgba?\\(\\s*${num$1}${c$2}${num$1}${c$2}${num$1}\\s*(?:,\\s*${num_per}\\s*)?\\)$`),rgb_per_old=RegExp(`^rgba?\\(\\s*${per}${c$2}${per}${c$2}${per}\\s*(?:,\\s*${num_per}\\s*)?\\)$`),parseRgbLegacy=color$2=>{let res={mode:`rgb`},match;if(match=color$2.match(rgb_num_old))match[1]!==void 0&&(res.r=match[1]/255),match[2]!==void 0&&(res.g=match[2]/255),match[3]!==void 0&&(res.b=match[3]/255);else if(match=color$2.match(rgb_per_old))match[1]!==void 0&&(res.r=match[1]/100),match[2]!==void 0&&(res.g=match[2]/100),match[3]!==void 0&&(res.b=match[3]/100);else return;return match[4]===void 0?match[5]!==void 0&&(res.alpha=Math.max(0,Math.min(1,+match[5]))):res.alpha=Math.max(0,Math.min(1,match[4]/100)),res};var parseRgbLegacy_default=parseRgbLegacy;const prepare=(color$2,mode)=>color$2===void 0?void 0:typeof color$2==`object`?color$2.mode===void 0?mode?{...color$2,mode}:void 0:color$2:parse_default(color$2);var _prepare_default=prepare;const converter=(target_mode=`rgb`)=>color$2=>(color$2=_prepare_default(color$2,target_mode))===void 0?void 0:color$2.mode===target_mode?color$2:converters[color$2.mode][target_mode]?converters[color$2.mode][target_mode](color$2):target_mode===`rgb`?converters[color$2.mode].rgb(color$2):converters.rgb[target_mode](converters[color$2.mode].rgb(color$2));var converter_default=converter;const converters={},modes={},parsers=[],colorProfiles={},identity=v$2=>v$2,useMode=definition$29=>(converters[definition$29.mode]={...converters[definition$29.mode],...definition$29.toMode},Object.keys(definition$29.fromMode||{}).forEach(k$4=>{converters[k$4]||(converters[k$4]={}),converters[k$4][definition$29.mode]=definition$29.fromMode[k$4]}),definition$29.ranges||={},definition$29.difference||={},definition$29.channels.forEach(channel=>{if(definition$29.ranges[channel]===void 0&&(definition$29.ranges[channel]=[0,1]),!definition$29.interpolate[channel])throw Error(`Missing interpolator for: ${channel}`);typeof definition$29.interpolate[channel]==`function`&&(definition$29.interpolate[channel]={use:definition$29.interpolate[channel]}),definition$29.interpolate[channel].fixup||(definition$29.interpolate[channel].fixup=identity)}),modes[definition$29.mode]=definition$29,(definition$29.parse||[]).forEach(parser=>{useParser(parser,definition$29.mode)}),converter_default(definition$29.mode)),getMode=mode=>modes[mode],useParser=(parser,mode)=>{if(typeof parser==`string`){if(!mode)throw Error(`'mode' required when 'parser' is a string`);colorProfiles[parser]=mode}else typeof parser==`function`&&parsers.indexOf(parser)<0&&parsers.push(parser)},IdentStartCodePoint=/[^\x00-\x7F]|[a-zA-Z_]/,IdentCodePoint=/[^\x00-\x7F]|[-\w]/,Tok={Function:`function`,Ident:`ident`,Number:`number`,Percentage:`percentage`,ParenClose:`)`,None:`none`,Hue:`hue`,Alpha:`alpha`};let _i$1=0;function is_num(chars){let ch$1=chars[_i$1],ch1=chars[_i$1+1];return ch$1===`-`||ch$1===`+`?/\d/.test(ch1)||ch1===`.`&&/\d/.test(chars[_i$1+2]):ch$1===`.`?/\d/.test(ch1):/\d/.test(ch$1)}function is_ident(chars){if(_i$1>=chars.length)return!1;let ch$1=chars[_i$1];if(IdentStartCodePoint.test(ch$1))return!0;if(ch$1===`-`){if(chars.length-_i$1<2)return!1;let ch1=chars[_i$1+1];return!!(ch1===`-`||IdentStartCodePoint.test(ch1))}return!1}const huenits={deg:1,rad:180/Math.PI,grad:9/10,turn:360};function num(chars){let value$1=``;if((chars[_i$1]===`-`||chars[_i$1]===`+`)&&(value$1+=chars[_i$1++]),value$1+=digits(chars),chars[_i$1]===`.`&&/\d/.test(chars[_i$1+1])&&(value$1+=chars[_i$1++]+digits(chars)),(chars[_i$1]===`e`||chars[_i$1]===`E`)&&((chars[_i$1+1]===`-`||chars[_i$1+1]===`+`)&&/\d/.test(chars[_i$1+2])?value$1+=chars[_i$1++]+chars[_i$1++]+digits(chars):/\d/.test(chars[_i$1+1])&&(value$1+=chars[_i$1++]+digits(chars))),is_ident(chars)){let id$1=ident(chars);return id$1===`deg`||id$1===`rad`||id$1===`turn`||id$1===`grad`?{type:Tok.Hue,value:value$1*huenits[id$1]}:void 0}return chars[_i$1]===`%`?(_i$1++,{type:Tok.Percentage,value:+value$1}):{type:Tok.Number,value:+value$1}}function digits(chars){let v$2=``;for(;/\d/.test(chars[_i$1]);)v$2+=chars[_i$1++];return v$2}function ident(chars){let v$2=``;for(;_i$14)){if(coords$1.length===4){if(coords$1[3].type!==Tok.Alpha)return;coords$1[3]=coords$1[3].value}return coords$1.length===3&&coords$1.push({type:Tok.None,value:void 0}),coords$1.every(c$4=>c$4.type!==Tok.Alpha)?coords$1:void 0}}function parseModernSyntax(tokens,includeHue){tokens._i=0;let token=tokens[tokens._i++];if(!token||token.type!==Tok.Function)return;let coords$1=consumeCoords(tokens,includeHue);if(coords$1)return coords$1.unshift(token.value),coords$1}const parse$2=color$2=>{if(typeof color$2!=`string`)return;let tokens=tokenize(color$2),parsed=tokens?parseModernSyntax(tokens,!0):void 0,result,i$1=0,len=parsers.length;for(;i$1c$4===`transparent`?{mode:`rgb`,r:0,g:0,b:0,alpha:0}:void 0;var parseTransparent_default=parseTransparent;const lerp$2=(a$2,b$4,t)=>a$2+t*(b$4-a$2),get_classes=arr=>{let classes=[];for(let i$1=0;i$1arr=>{let classes=get_classes(arr);return t=>{let cls=t*classes.length,idx=t>=1?classes.length-1:Math.max(Math.floor(cls),0),pair=classes[idx];return pair===void 0?void 0:interpolator(pair[0],pair[1],cls-idx)}},interpolatorLinear=interpolatorPiecewise(lerp$2),fixupAlpha=arr=>{let some_defined=!1,res=arr.map(v$2=>v$2===void 0?1:(some_defined=!0,v$2));return some_defined?res:arr},definition$28={mode:`rgb`,channels:[`r`,`g`,`b`,`alpha`],parse:[parseRgb_default,parseHex_default,parseRgbLegacy_default,parseNamed_default,parseTransparent_default,`srgb`],serialize:`srgb`,interpolate:{r:interpolatorLinear,g:interpolatorLinear,b:interpolatorLinear,alpha:{use:interpolatorLinear,fixup:fixupAlpha}},gamut:!0,white:{r:1,g:1,b:1},black:{r:0,g:0,b:0}};var definition_default$23=definition$28;const linearize$2=(v$2=0)=>Math.abs(v$2)**(563/256)*Math.sign(v$2),convertA98ToXyz65=a98$1=>{let r$2=linearize$2(a98$1.r),g$2=linearize$2(a98$1.g),b$4=linearize$2(a98$1.b),res={mode:`xyz65`,x:.5766690429101305*r$2+.1855582379065463*g$2+.1882286462349947*b$4,y:.297344975250536*r$2+.6273635662554661*g$2+.0752914584939979*b$4,z:.0270313613864123*r$2+.0706888525358272*g$2+.9913375368376386*b$4};return a98$1.alpha!==void 0&&(res.alpha=a98$1.alpha),res};var convertA98ToXyz65_default=convertA98ToXyz65;const gamma$2=v$2=>Math.abs(v$2)**(256/563)*Math.sign(v$2),convertXyz65ToA98=({x:x$3,y:y$3,z:z$3,alpha:alpha$1})=>{x$3===void 0&&(x$3=0),y$3===void 0&&(y$3=0),z$3===void 0&&(z$3=0);let res={mode:`a98`,r:gamma$2(x$3*2.0415879038107465-y$3*.5650069742788597-.3447313507783297*z$3),g:gamma$2(x$3*-.9692436362808798+y$3*1.8759675015077206+.0415550574071756*z$3),b:gamma$2(x$3*.0134442806320312-y$3*.1183623922310184+1.0151749943912058*z$3)};return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertXyz65ToA98_default=convertXyz65ToA98;const fn$4=(c$4=0)=>{let abs$2=Math.abs(c$4);return abs$2<=.04045?c$4/12.92:(Math.sign(c$4)||1)*((abs$2+.055)/1.055)**2.4},convertRgbToLrgb=({r:r$2,g:g$2,b:b$4,alpha:alpha$1})=>{let res={mode:`lrgb`,r:fn$4(r$2),g:fn$4(g$2),b:fn$4(b$4)};return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertRgbToLrgb_default=convertRgbToLrgb;const convertRgbToXyz65=rgb$2=>{let{r:r$2,g:g$2,b:b$4,alpha:alpha$1}=convertRgbToLrgb_default(rgb$2),res={mode:`xyz65`,x:.4123907992659593*r$2+.357584339383878*g$2+.1804807884018343*b$4,y:.2126390058715102*r$2+.715168678767756*g$2+.0721923153607337*b$4,z:.0193308187155918*r$2+.119194779794626*g$2+.9505321522496607*b$4};return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertRgbToXyz65_default=convertRgbToXyz65;const fn$3=(c$4=0)=>{let abs$2=Math.abs(c$4);return abs$2>.0031308?(Math.sign(c$4)||1)*(1.055*abs$2**(1/2.4)-.055):c$4*12.92},convertLrgbToRgb=({r:r$2,g:g$2,b:b$4,alpha:alpha$1},mode=`rgb`)=>{let res={mode,r:fn$3(r$2),g:fn$3(g$2),b:fn$3(b$4)};return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertLrgbToRgb_default=convertLrgbToRgb;const convertXyz65ToRgb=({x:x$3,y:y$3,z:z$3,alpha:alpha$1})=>{x$3===void 0&&(x$3=0),y$3===void 0&&(y$3=0),z$3===void 0&&(z$3=0);let res=convertLrgbToRgb_default({r:x$3*3.2409699419045226-y$3*1.537383177570094-.4986107602930034*z$3,g:x$3*-.9692436362808796+y$3*1.8759675015077204+.0415550574071756*z$3,b:x$3*.0556300796969936-y$3*.2039769588889765+1.0569715142428784*z$3});return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertXyz65ToRgb_default=convertXyz65ToRgb;const definition$27={...definition_default$23,mode:`a98`,parse:[`a98-rgb`],serialize:`a98-rgb`,fromMode:{rgb:color$2=>convertXyz65ToA98_default(convertRgbToXyz65_default(color$2)),xyz65:convertXyz65ToA98_default},toMode:{rgb:color$2=>convertXyz65ToRgb_default(convertA98ToXyz65_default(color$2)),xyz65:convertA98ToXyz65_default}};var definition_default=definition$27;const normalizeHue=hue$2=>(hue$2%=360)<0?hue$2+360:hue$2;var normalizeHue_default=normalizeHue;const hue$1=(hues,fn$6)=>hues.map((hue$2,idx,arr)=>{if(hue$2===void 0)return hue$2;let normalized=normalizeHue_default(hue$2);return idx===0||hues[idx-1]===void 0?normalized:fn$6(normalized-normalizeHue_default(arr[idx-1]))}).reduce((acc,curr)=>!acc.length||curr===void 0||acc[acc.length-1]===void 0?(acc.push(curr),acc):(acc.push(curr+acc[acc.length-1]),acc),[]),fixupHueShorter=arr=>hue$1(arr,d$2=>Math.abs(d$2)<=180?d$2:d$2-360*Math.sign(d$2)),M=[-.14861,1.78277,-.29227,-.90649,1.97294,0],degToRad$1=Math.PI/180,radToDeg$1=180/Math.PI;let DE=M[3]*M[4],BE=M[1]*M[4],BCAD=M[1]*M[2]-M[0]*M[3];const convertRgbToCubehelix=({r:r$2,g:g$2,b:b$4,alpha:alpha$1})=>{r$2===void 0&&(r$2=0),g$2===void 0&&(g$2=0),b$4===void 0&&(b$4=0);let l$1=(BCAD*b$4+r$2*DE-g$2*BE)/(BCAD+DE-BE),x$3=b$4-l$1,y$3=(M[4]*(g$2-l$1)-M[2]*x$3)/M[3],res={mode:`cubehelix`,l:l$1,s:l$1===0||l$1===1?void 0:Math.sqrt(x$3*x$3+y$3*y$3)/(M[4]*l$1*(1-l$1))};return res.s&&(res.h=Math.atan2(y$3,x$3)*radToDeg$1-120),alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertRgbToCubehelix_default=convertRgbToCubehelix;const convertCubehelixToRgb=({h:h$3,s:s$1,l:l$1,alpha:alpha$1})=>{let res={mode:`rgb`};h$3=(h$3===void 0?0:h$3+120)*degToRad$1,l$1===void 0&&(l$1=0);let amp=s$1===void 0?0:s$1*l$1*(1-l$1),cosh=Math.cos(h$3),sinh=Math.sin(h$3);return res.r=l$1+amp*(M[0]*cosh+M[1]*sinh),res.g=l$1+amp*(M[2]*cosh+M[3]*sinh),res.b=l$1+amp*(M[4]*cosh+M[5]*sinh),alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertCubehelixToRgb_default=convertCubehelixToRgb;const differenceHueSaturation=(std,smp)=>{if(std.h===void 0||smp.h===void 0||!std.s||!smp.s)return 0;let std_h=normalizeHue_default(std.h),smp_h=normalizeHue_default(smp.h),dH=Math.sin((smp_h-std_h+360)/2*Math.PI/180);return 2*Math.sqrt(std.s*smp.s)*dH},differenceHueNaive=(std,smp)=>{if(std.h===void 0||smp.h===void 0)return 0;let std_h=normalizeHue_default(std.h),smp_h=normalizeHue_default(smp.h);return Math.abs(smp_h-std_h)>180?std_h-(smp_h-360*Math.sign(smp_h-std_h)):smp_h-std_h},differenceHueChroma=(std,smp)=>{if(std.h===void 0||smp.h===void 0||!std.c||!smp.c)return 0;let std_h=normalizeHue_default(std.h),smp_h=normalizeHue_default(smp.h),dH=Math.sin((smp_h-std_h+360)/2*Math.PI/180);return 2*Math.sqrt(std.c*smp.c)*dH},averageAngle=val=>{let sum=val.reduce((sum$1,val$1)=>{if(val$1!==void 0){let rad=val$1*Math.PI/180;sum$1.sin+=Math.sin(rad),sum$1.cos+=Math.cos(rad)}return sum$1},{sin:0,cos:0}),angle=Math.atan2(sum.sin,sum.cos)*180/Math.PI;return angle<0?360+angle:angle},definition$26={mode:`cubehelix`,channels:[`h`,`s`,`l`,`alpha`],parse:[`--cubehelix`],serialize:`--cubehelix`,ranges:{h:[0,360],s:[0,4.614],l:[0,1]},fromMode:{rgb:convertRgbToCubehelix_default},toMode:{rgb:convertCubehelixToRgb_default},interpolate:{h:{use:interpolatorLinear,fixup:fixupHueShorter},s:interpolatorLinear,l:interpolatorLinear,alpha:{use:interpolatorLinear,fixup:fixupAlpha}},difference:{h:differenceHueSaturation},average:{h:averageAngle}};var definition_default$1=definition$26;const convertLabToLch=({l:l$1,a:a$2,b:b$4,alpha:alpha$1},mode=`lch`)=>{a$2===void 0&&(a$2=0),b$4===void 0&&(b$4=0);let c$4=Math.sqrt(a$2*a$2+b$4*b$4),res={mode,l:l$1,c:c$4};return c$4&&(res.h=normalizeHue_default(Math.atan2(b$4,a$2)*180/Math.PI)),alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertLabToLch_default=convertLabToLch;const convertLchToLab=({l:l$1,c:c$4,h:h$3,alpha:alpha$1},mode=`lab`)=>{h$3===void 0&&(h$3=0);let res={mode,l:l$1,a:c$4?c$4*Math.cos(h$3/180*Math.PI):0,b:c$4?c$4*Math.sin(h$3/180*Math.PI):0};return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertLchToLab_default=convertLchToLab;const k$2=29**3/3**3,e$1=6**3/29**3,D50={X:.3457/.3585,Y:1,Z:.2958/.3585},D65={X:.3127/.329,Y:1,Z:.3583/.329},k$3=29**3/3**3,e$2=6**3/29**3;let fn$2=v$2=>v$2**3>e$1?v$2**3:(116*v$2-16)/k$2;const convertLab65ToXyz65=({l:l$1,a:a$2,b:b$4,alpha:alpha$1})=>{l$1===void 0&&(l$1=0),a$2===void 0&&(a$2=0),b$4===void 0&&(b$4=0);let fy$1=(l$1+16)/116,fx=a$2/500+fy$1,fz=fy$1-b$4/200,res={mode:`xyz65`,x:fn$2(fx)*D65.X,y:fn$2(fy$1)*D65.Y,z:fn$2(fz)*D65.Z};return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertLab65ToXyz65_default=convertLab65ToXyz65;const convertLab65ToRgb=lab$1=>convertXyz65ToRgb_default(convertLab65ToXyz65_default(lab$1));var convertLab65ToRgb_default=convertLab65ToRgb;const f$2=value$1=>value$1>e$1?Math.cbrt(value$1):(k$2*value$1+16)/116,convertXyz65ToLab65=({x:x$3,y:y$3,z:z$3,alpha:alpha$1})=>{x$3===void 0&&(x$3=0),y$3===void 0&&(y$3=0),z$3===void 0&&(z$3=0);let f0=f$2(x$3/D65.X),f1=f$2(y$3/D65.Y),f2=f$2(z$3/D65.Z),res={mode:`lab65`,l:116*f1-16,a:500*(f0-f1),b:200*(f1-f2)};return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertXyz65ToLab65_default=convertXyz65ToLab65;const convertRgbToLab65=rgb$2=>{let res=convertXyz65ToLab65_default(convertRgbToXyz65_default(rgb$2));return rgb$2.r===rgb$2.b&&rgb$2.b===rgb$2.g&&(res.a=res.b=0),res};var convertRgbToLab65_default=convertRgbToLab65;const kE=1,kCH=1,θ=26/180*Math.PI,cosθ=Math.cos(θ),sinθ=Math.sin(θ),factor=100/Math.log(139/100),convertDlchToLab65=({l:l$1,c:c$4,h:h$3,alpha:alpha$1})=>{l$1===void 0&&(l$1=0),c$4===void 0&&(c$4=0),h$3===void 0&&(h$3=0);let res={mode:`lab65`,l:(Math.exp(l$1*kE/factor)-1)/.0039},G$2=(Math.exp(.0435*c$4*kCH*kE)-1)/.075,e$3=G$2*Math.cos(h$3/180*Math.PI-θ),f$3=G$2*Math.sin(h$3/180*Math.PI-θ);return res.a=e$3*cosθ-f$3/.83*sinθ,res.b=e$3*sinθ+f$3/.83*cosθ,alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertDlchToLab65_default=convertDlchToLab65;const convertLab65ToDlch=({l:l$1,a:a$2,b:b$4,alpha:alpha$1})=>{l$1===void 0&&(l$1=0),a$2===void 0&&(a$2=0),b$4===void 0&&(b$4=0);let e$3=a$2*cosθ+b$4*sinθ,f$3=.83*(b$4*cosθ-a$2*sinθ),G$2=Math.sqrt(e$3*e$3+f$3*f$3),res={mode:`dlch`,l:factor/kE*Math.log(1+.0039*l$1),c:Math.log(1+.075*G$2)/(.0435*kCH*kE)};return res.c&&(res.h=normalizeHue_default((Math.atan2(f$3,e$3)+θ)/Math.PI*180)),alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertLab65ToDlch_default=convertLab65ToDlch;const convertDlabToLab65=c$4=>convertDlchToLab65_default(convertLabToLch_default(c$4,`dlch`)),convertLab65ToDlab=c$4=>convertLchToLab_default(convertLab65ToDlch_default(c$4),`dlab`),definition$25={mode:`dlab`,parse:[`--din99o-lab`],serialize:`--din99o-lab`,toMode:{lab65:convertDlabToLab65,rgb:c$4=>convertLab65ToRgb_default(convertDlabToLab65(c$4))},fromMode:{lab65:convertLab65ToDlab,rgb:c$4=>convertLab65ToDlab(convertRgbToLab65_default(c$4))},channels:[`l`,`a`,`b`,`alpha`],ranges:{l:[0,100],a:[-40.09,45.501],b:[-40.469,44.344]},interpolate:{l:interpolatorLinear,a:interpolatorLinear,b:interpolatorLinear,alpha:{use:interpolatorLinear,fixup:fixupAlpha}}};var definition_default$2=definition$25;const definition$24={mode:`dlch`,parse:[`--din99o-lch`],serialize:`--din99o-lch`,toMode:{lab65:convertDlchToLab65_default,dlab:c$4=>convertLchToLab_default(c$4,`dlab`),rgb:c$4=>convertLab65ToRgb_default(convertDlchToLab65_default(c$4))},fromMode:{lab65:convertLab65ToDlch_default,dlab:c$4=>convertLabToLch_default(c$4,`dlch`),rgb:c$4=>convertLab65ToDlch_default(convertRgbToLab65_default(c$4))},channels:[`l`,`c`,`h`,`alpha`],ranges:{l:[0,100],c:[0,51.484],h:[0,360]},interpolate:{l:interpolatorLinear,c:interpolatorLinear,h:{use:interpolatorLinear,fixup:fixupHueShorter},alpha:{use:interpolatorLinear,fixup:fixupAlpha}},difference:{h:differenceHueChroma},average:{h:averageAngle}};var definition_default$3=definition$24;function convertHsiToRgb({h:h$3,s:s$1,i:i$1,alpha:alpha$1}){h$3=normalizeHue_default(h$3===void 0?0:h$3),s$1===void 0&&(s$1=0),i$1===void 0&&(i$1=0);let f$3=Math.abs(h$3/60%2-1),res;switch(Math.floor(h$3/60)){case 0:res={r:i$1*(1+s$1*(3/(2-f$3)-1)),g:i$1*(1+s$1*(3*(1-f$3)/(2-f$3)-1)),b:i$1*(1-s$1)};break;case 1:res={r:i$1*(1+s$1*(3*(1-f$3)/(2-f$3)-1)),g:i$1*(1+s$1*(3/(2-f$3)-1)),b:i$1*(1-s$1)};break;case 2:res={r:i$1*(1-s$1),g:i$1*(1+s$1*(3/(2-f$3)-1)),b:i$1*(1+s$1*(3*(1-f$3)/(2-f$3)-1))};break;case 3:res={r:i$1*(1-s$1),g:i$1*(1+s$1*(3*(1-f$3)/(2-f$3)-1)),b:i$1*(1+s$1*(3/(2-f$3)-1))};break;case 4:res={r:i$1*(1+s$1*(3*(1-f$3)/(2-f$3)-1)),g:i$1*(1-s$1),b:i$1*(1+s$1*(3/(2-f$3)-1))};break;case 5:res={r:i$1*(1+s$1*(3/(2-f$3)-1)),g:i$1*(1-s$1),b:i$1*(1+s$1*(3*(1-f$3)/(2-f$3)-1))};break;default:res={r:i$1*(1-s$1),g:i$1*(1-s$1),b:i$1*(1-s$1)}}return res.mode=`rgb`,alpha$1!==void 0&&(res.alpha=alpha$1),res}function convertRgbToHsi({r:r$2,g:g$2,b:b$4,alpha:alpha$1}){r$2===void 0&&(r$2=0),g$2===void 0&&(g$2=0),b$4===void 0&&(b$4=0);let M$1=Math.max(r$2,g$2,b$4),m$3=Math.min(r$2,g$2,b$4),res={mode:`hsi`,s:r$2+g$2+b$4===0?0:1-3*m$3/(r$2+g$2+b$4),i:(r$2+g$2+b$4)/3};return M$1-m$3!==0&&(res.h=(M$1===r$2?(g$2-b$4)/(M$1-m$3)+(g$2{switch(unit){case`deg`:return+val;case`rad`:return val/Math.PI*180;case`grad`:return val/10*9;case`turn`:return val*360}};var hue_default=hueToDeg;const hsl_old=RegExp(`^hsla?\\(\\s*${hue}${c$2}${per}${c$2}${per}\\s*(?:,\\s*${num_per}\\s*)?\\)$`),parseHslLegacy=color$2=>{let match=color$2.match(hsl_old);if(!match)return;let res={mode:`hsl`};return match[3]===void 0?match[1]!==void 0&&match[2]!==void 0&&(res.h=hue_default(match[1],match[2])):res.h=+match[3],match[4]!==void 0&&(res.s=Math.min(Math.max(0,match[4]/100),1)),match[5]!==void 0&&(res.l=Math.min(Math.max(0,match[5]/100),1)),match[6]===void 0?match[7]!==void 0&&(res.alpha=Math.max(0,Math.min(1,+match[7]))):res.alpha=Math.max(0,Math.min(1,match[6]/100)),res};var parseHslLegacy_default=parseHslLegacy;function parseHsl(color$2,parsed){if(!parsed||parsed[0]!==`hsl`&&parsed[0]!==`hsla`)return;let res={mode:`hsl`},[,h$3,s$1,l$1,alpha$1]=parsed;if(h$3.type!==Tok.None){if(h$3.type===Tok.Percentage)return;res.h=h$3.value}if(s$1.type!==Tok.None){if(s$1.type===Tok.Hue)return;res.s=s$1.value/100}if(l$1.type!==Tok.None){if(l$1.type===Tok.Hue)return;res.l=l$1.value/100}return alpha$1.type!==Tok.None&&(res.alpha=Math.min(1,Math.max(0,alpha$1.type===Tok.Number?alpha$1.value:alpha$1.value/100))),res}var parseHsl_default=parseHsl;const definition$22={mode:`hsl`,toMode:{rgb:convertHslToRgb},fromMode:{rgb:convertRgbToHsl},channels:[`h`,`s`,`l`,`alpha`],ranges:{h:[0,360]},gamut:`rgb`,parse:[parseHsl_default,parseHslLegacy_default],serialize:c$4=>`hsl(${c$4.h===void 0?`none`:c$4.h} ${c$4.s===void 0?`none`:c$4.s*100+`%`} ${c$4.l===void 0?`none`:c$4.l*100+`%`}${c$4.alpha<1?` / ${c$4.alpha}`:``})`,interpolate:{h:{use:interpolatorLinear,fixup:fixupHueShorter},s:interpolatorLinear,l:interpolatorLinear,alpha:{use:interpolatorLinear,fixup:fixupAlpha}},difference:{h:differenceHueSaturation},average:{h:averageAngle}};var definition_default$5=definition$22;function convertHsvToRgb({h:h$3,s:s$1,v:v$2,alpha:alpha$1}){h$3=normalizeHue_default(h$3===void 0?0:h$3),s$1===void 0&&(s$1=0),v$2===void 0&&(v$2=0);let f$3=Math.abs(h$3/60%2-1),res;switch(Math.floor(h$3/60)){case 0:res={r:v$2,g:v$2*(1-s$1*f$3),b:v$2*(1-s$1)};break;case 1:res={r:v$2*(1-s$1*f$3),g:v$2,b:v$2*(1-s$1)};break;case 2:res={r:v$2*(1-s$1),g:v$2,b:v$2*(1-s$1*f$3)};break;case 3:res={r:v$2*(1-s$1),g:v$2*(1-s$1*f$3),b:v$2};break;case 4:res={r:v$2*(1-s$1*f$3),g:v$2*(1-s$1),b:v$2};break;case 5:res={r:v$2,g:v$2*(1-s$1),b:v$2*(1-s$1*f$3)};break;default:res={r:v$2*(1-s$1),g:v$2*(1-s$1),b:v$2*(1-s$1)}}return res.mode=`rgb`,alpha$1!==void 0&&(res.alpha=alpha$1),res}function convertRgbToHsv({r:r$2,g:g$2,b:b$4,alpha:alpha$1}){r$2===void 0&&(r$2=0),g$2===void 0&&(g$2=0),b$4===void 0&&(b$4=0);let M$1=Math.max(r$2,g$2,b$4),m$3=Math.min(r$2,g$2,b$4),res={mode:`hsv`,s:M$1===0?0:1-m$3/M$1,v:M$1};return M$1-m$3!==0&&(res.h=(M$1===r$2?(g$2-b$4)/(M$1-m$3)+(g$21){let s$1=w$2+b$4;w$2/=s$1,b$4/=s$1}return convertHsvToRgb({h:h$3,s:b$4===1?1:1-w$2/(1-b$4),v:1-b$4,alpha:alpha$1})}function convertRgbToHwb(rgba$1){let hsv$1=convertRgbToHsv(rgba$1);if(hsv$1===void 0)return;let s$1=hsv$1.s===void 0?0:hsv$1.s,v$2=hsv$1.v===void 0?0:hsv$1.v,res={mode:`hwb`,w:(1-s$1)*v$2,b:1-v$2};return hsv$1.h!==void 0&&(res.h=hsv$1.h),hsv$1.alpha!==void 0&&(res.alpha=hsv$1.alpha),res}function ParseHwb(color$2,parsed){if(!parsed||parsed[0]!==`hwb`)return;let res={mode:`hwb`},[,h$3,w$2,b$4,alpha$1]=parsed;if(h$3.type!==Tok.None){if(h$3.type===Tok.Percentage)return;res.h=h$3.value}if(w$2.type!==Tok.None){if(w$2.type===Tok.Hue)return;res.w=w$2.value/100}if(b$4.type!==Tok.None){if(b$4.type===Tok.Hue)return;res.b=b$4.value/100}return alpha$1.type!==Tok.None&&(res.alpha=Math.min(1,Math.max(0,alpha$1.type===Tok.Number?alpha$1.value:alpha$1.value/100))),res}var parseHwb_default=ParseHwb;const definition$20={mode:`hwb`,toMode:{rgb:convertHwbToRgb},fromMode:{rgb:convertRgbToHwb},channels:[`h`,`w`,`b`,`alpha`],ranges:{h:[0,360]},gamut:`rgb`,parse:[parseHwb_default],serialize:c$4=>`hwb(${c$4.h===void 0?`none`:c$4.h} ${c$4.w===void 0?`none`:c$4.w*100+`%`} ${c$4.b===void 0?`none`:c$4.b*100+`%`}${c$4.alpha<1?` / ${c$4.alpha}`:``})`,interpolate:{h:{use:interpolatorLinear,fixup:fixupHueShorter},w:interpolatorLinear,b:interpolatorLinear,alpha:{use:interpolatorLinear,fixup:fixupAlpha}},difference:{h:differenceHueNaive},average:{h:averageAngle}};var definition_default$7=definition$20;const YW=203,M1=.1593017578125,M2=78.84375,C1=.8359375,C2=18.8515625,C3=18.6875;function transferPqDecode(v$2){if(v$2<0)return 0;let c$4=v$2**(1/M2);return 1e4*(Math.max(0,c$4-C1)/(C2-C3*c$4))**(1/M1)}function transferPqEncode(v$2){if(v$2<0)return 0;let c$4=(v$2/1e4)**M1;return((C1+C2*c$4)/(1+C3*c$4))**+M2}const toRel=c$4=>Math.max(c$4/YW,0),convertItpToXyz65=({i:i$1,t,p:p$5,alpha:alpha$1})=>{i$1===void 0&&(i$1=0),t===void 0&&(t=0),p$5===void 0&&(p$5=0);let l$1=transferPqDecode(i$1+.008609037037932761*t+.11102962500302593*p$5),m$3=transferPqDecode(i$1-.00860903703793275*t-.11102962500302599*p$5),s$1=transferPqDecode(i$1+.5600313357106791*t-.32062717498731885*p$5),res={mode:`xyz65`,x:toRel(2.070152218389422*l$1-1.3263473389671556*m$3+.2066510476294051*s$1),y:toRel(.3647385209748074*l$1+.680566024947227*m$3-.0453045459220346*s$1),z:toRel(-.049747207535812*l$1-.0492609666966138*m$3+1.1880659249923042*s$1)};return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertItpToXyz65_default=convertItpToXyz65;const toAbs=(c$4=0)=>Math.max(c$4*YW,0),convertXyz65ToItp=({x:x$3,y:y$3,z:z$3,alpha:alpha$1})=>{let absX=toAbs(x$3),absY=toAbs(y$3),absZ=toAbs(z$3),l$1=transferPqEncode(.3592832590121217*absX+.6976051147779502*absY-.0358915932320289*absZ),m$3=transferPqEncode(-.1920808463704995*absX+1.1004767970374323*absY+.0753748658519118*absZ),s$1=transferPqEncode(.0070797844607477*absX+.0748396662186366*absY+.8433265453898765*absZ),i$1=.5*l$1+.5*m$3,t=1.61376953125*l$1-3.323486328125*m$3+1.709716796875*s$1,p$5=4.378173828125*l$1-4.24560546875*m$3-.132568359375*s$1,res={mode:`itp`,i:i$1,t,p:p$5};return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertXyz65ToItp_default=convertXyz65ToItp;const definition$19={mode:`itp`,channels:[`i`,`t`,`p`,`alpha`],parse:[`--ictcp`],serialize:`--ictcp`,toMode:{xyz65:convertItpToXyz65_default,rgb:color$2=>convertXyz65ToRgb_default(convertItpToXyz65_default(color$2))},fromMode:{xyz65:convertXyz65ToItp_default,rgb:color$2=>convertXyz65ToItp_default(convertRgbToXyz65_default(color$2))},ranges:{i:[0,.581],t:[-.369,.272],p:[-.164,.331]},interpolate:{i:interpolatorLinear,t:interpolatorLinear,p:interpolatorLinear,alpha:{use:interpolatorLinear,fixup:fixupAlpha}}};var definition_default$8=definition$19;const p$3=134.03437499999998,d0$1=16295499532821565e-27,jabPqEncode=v$2=>{if(v$2<0)return 0;let vn$4=(v$2/1e4)**M1;return((C1+C2*vn$4)/(1+C3*vn$4))**+p$3},abs$1=(v$2=0)=>Math.max(v$2*203,0),convertXyz65ToJab=({x:x$3,y:y$3,z:z$3,alpha:alpha$1})=>{x$3=abs$1(x$3),y$3=abs$1(y$3),z$3=abs$1(z$3);let xp$1=1.15*x$3-.15*z$3,yp$1=.66*y$3+.34*x$3,l$1=jabPqEncode(.41478972*xp$1+.579999*yp$1+.014648*z$3),m$3=jabPqEncode(-.20151*xp$1+1.120649*yp$1+.0531008*z$3),s$1=jabPqEncode(-.0166008*xp$1+.2648*yp$1+.6684799*z$3),i$1=(l$1+m$3)/2,res={mode:`jab`,j:.44*i$1/(1-.56*i$1)-d0$1,a:3.524*l$1-4.066708*m$3+.542708*s$1,b:.199076*l$1+1.096799*m$3-1.295875*s$1};return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertXyz65ToJab_default=convertXyz65ToJab;const p$2=134.03437499999998,d0=16295499532821565e-27,jabPqDecode=v$2=>{if(v$2<0)return 0;let vp$1=v$2**(1/p$2);return 1e4*((C1-vp$1)/(C3*vp$1-C2))**(1/M1)},rel=v$2=>v$2/203,convertJabToXyz65=({j:j$1,a:a$2,b:b$4,alpha:alpha$1})=>{j$1===void 0&&(j$1=0),a$2===void 0&&(a$2=0),b$4===void 0&&(b$4=0);let i$1=(j$1+d0)/(.44+.56*(j$1+d0)),l$1=jabPqDecode(i$1+.13860504*a$2+.058047316*b$4),m$3=jabPqDecode(i$1-.13860504*a$2-.058047316*b$4),s$1=jabPqDecode(i$1-.096019242*a$2-.8118919*b$4),res={mode:`xyz65`,x:rel(1.661373024652174*l$1-.914523081304348*m$3+.23136208173913045*s$1),y:rel(-.3250758611844533*l$1+1.571847026732543*m$3-.21825383453227928*s$1),z:rel(-.090982811*l$1-.31272829*m$3+1.5227666*s$1)};return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertJabToXyz65_default=convertJabToXyz65;const convertRgbToJab=rgb$2=>{let res=convertXyz65ToJab_default(convertRgbToXyz65_default(rgb$2));return rgb$2.r===rgb$2.b&&rgb$2.b===rgb$2.g&&(res.a=res.b=0),res};var convertRgbToJab_default=convertRgbToJab;const convertJabToRgb=color$2=>convertXyz65ToRgb_default(convertJabToXyz65_default(color$2));var convertJabToRgb_default=convertJabToRgb;const definition$18={mode:`jab`,channels:[`j`,`a`,`b`,`alpha`],parse:[`--jzazbz`],serialize:`--jzazbz`,fromMode:{rgb:convertRgbToJab_default,xyz65:convertXyz65ToJab_default},toMode:{rgb:convertJabToRgb_default,xyz65:convertJabToXyz65_default},ranges:{j:[0,.222],a:[-.109,.129],b:[-.185,.134]},interpolate:{j:interpolatorLinear,a:interpolatorLinear,b:interpolatorLinear,alpha:{use:interpolatorLinear,fixup:fixupAlpha}}};var definition_default$9=definition$18;const convertJabToJch=({j:j$1,a:a$2,b:b$4,alpha:alpha$1})=>{a$2===void 0&&(a$2=0),b$4===void 0&&(b$4=0);let c$4=Math.sqrt(a$2*a$2+b$4*b$4),res={mode:`jch`,j:j$1,c:c$4};return c$4&&(res.h=normalizeHue_default(Math.atan2(b$4,a$2)*180/Math.PI)),alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertJabToJch_default=convertJabToJch;const convertJchToJab=({j:j$1,c:c$4,h:h$3,alpha:alpha$1})=>{h$3===void 0&&(h$3=0);let res={mode:`jab`,j:j$1,a:c$4?c$4*Math.cos(h$3/180*Math.PI):0,b:c$4?c$4*Math.sin(h$3/180*Math.PI):0};return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertJchToJab_default=convertJchToJab;const definition$17={mode:`jch`,parse:[`--jzczhz`],serialize:`--jzczhz`,toMode:{jab:convertJchToJab_default,rgb:c$4=>convertJabToRgb_default(convertJchToJab_default(c$4))},fromMode:{rgb:c$4=>convertJabToJch_default(convertRgbToJab_default(c$4)),jab:convertJabToJch_default},channels:[`j`,`c`,`h`,`alpha`],ranges:{j:[0,.221],c:[0,.19],h:[0,360]},interpolate:{h:{use:interpolatorLinear,fixup:fixupHueShorter},c:interpolatorLinear,j:interpolatorLinear,alpha:{use:interpolatorLinear,fixup:fixupAlpha}},difference:{h:differenceHueChroma},average:{h:averageAngle}};var definition_default$10=definition$17;const k$1=29**3/3**3,e=6**3/29**3;let fn$1=v$2=>v$2**3>e?v$2**3:(116*v$2-16)/k$1;const convertLabToXyz50=({l:l$1,a:a$2,b:b$4,alpha:alpha$1})=>{l$1===void 0&&(l$1=0),a$2===void 0&&(a$2=0),b$4===void 0&&(b$4=0);let fy$1=(l$1+16)/116,fx=a$2/500+fy$1,fz=fy$1-b$4/200,res={mode:`xyz50`,x:fn$1(fx)*D50.X,y:fn$1(fy$1)*D50.Y,z:fn$1(fz)*D50.Z};return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertLabToXyz50_default=convertLabToXyz50;const convertXyz50ToRgb=({x:x$3,y:y$3,z:z$3,alpha:alpha$1})=>{x$3===void 0&&(x$3=0),y$3===void 0&&(y$3=0),z$3===void 0&&(z$3=0);let res=convertLrgbToRgb_default({r:x$3*3.1341359569958707-y$3*1.6173863321612538-.4906619460083532*z$3,g:x$3*-.978795502912089+y$3*1.916254567259524+.03344273116131949*z$3,b:x$3*.07195537988411677-y$3*.2289768264158322+1.405386058324125*z$3});return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertXyz50ToRgb_default=convertXyz50ToRgb;const convertLabToRgb=lab$1=>convertXyz50ToRgb_default(convertLabToXyz50_default(lab$1));var convertLabToRgb_default=convertLabToRgb;const convertRgbToXyz50=rgb$2=>{let{r:r$2,g:g$2,b:b$4,alpha:alpha$1}=convertRgbToLrgb_default(rgb$2),res={mode:`xyz50`,x:.436065742824811*r$2+.3851514688337912*g$2+.14307845442264197*b$4,y:.22249319175623702*r$2+.7168870538238823*g$2+.06061979053616537*b$4,z:.013923904500943465*r$2+.09708128566574634*g$2+.7140993584005155*b$4};return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertRgbToXyz50_default=convertRgbToXyz50;const f$1=value$1=>value$1>e?Math.cbrt(value$1):(k$1*value$1+16)/116,convertXyz50ToLab=({x:x$3,y:y$3,z:z$3,alpha:alpha$1})=>{x$3===void 0&&(x$3=0),y$3===void 0&&(y$3=0),z$3===void 0&&(z$3=0);let f0=f$1(x$3/D50.X),f1=f$1(y$3/D50.Y),f2=f$1(z$3/D50.Z),res={mode:`lab`,l:116*f1-16,a:500*(f0-f1),b:200*(f1-f2)};return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertXyz50ToLab_default=convertXyz50ToLab;const convertRgbToLab=rgb$2=>{let res=convertXyz50ToLab_default(convertRgbToXyz50_default(rgb$2));return rgb$2.r===rgb$2.b&&rgb$2.b===rgb$2.g&&(res.a=res.b=0),res};var convertRgbToLab_default=convertRgbToLab;function parseLab(color$2,parsed){if(!parsed||parsed[0]!==`lab`)return;let res={mode:`lab`},[,l$1,a$2,b$4,alpha$1]=parsed;if(!(l$1.type===Tok.Hue||a$2.type===Tok.Hue||b$4.type===Tok.Hue))return l$1.type!==Tok.None&&(res.l=Math.min(Math.max(0,l$1.value),100)),a$2.type!==Tok.None&&(res.a=a$2.type===Tok.Number?a$2.value:a$2.value*125/100),b$4.type!==Tok.None&&(res.b=b$4.type===Tok.Number?b$4.value:b$4.value*125/100),alpha$1.type!==Tok.None&&(res.alpha=Math.min(1,Math.max(0,alpha$1.type===Tok.Number?alpha$1.value:alpha$1.value/100))),res}var parseLab_default=parseLab;const definition$16={mode:`lab`,toMode:{xyz50:convertLabToXyz50_default,rgb:convertLabToRgb_default},fromMode:{xyz50:convertXyz50ToLab_default,rgb:convertRgbToLab_default},channels:[`l`,`a`,`b`,`alpha`],ranges:{l:[0,100],a:[-125,125],b:[-125,125]},parse:[parseLab_default],serialize:c$4=>`lab(${c$4.l===void 0?`none`:c$4.l} ${c$4.a===void 0?`none`:c$4.a} ${c$4.b===void 0?`none`:c$4.b}${c$4.alpha<1?` / ${c$4.alpha}`:``})`,interpolate:{l:interpolatorLinear,a:interpolatorLinear,b:interpolatorLinear,alpha:{use:interpolatorLinear,fixup:fixupAlpha}}};var definition_default$11=definition$16;const definition$15={...definition_default$11,mode:`lab65`,parse:[`--lab-d65`],serialize:`--lab-d65`,toMode:{xyz65:convertLab65ToXyz65_default,rgb:convertLab65ToRgb_default},fromMode:{xyz65:convertXyz65ToLab65_default,rgb:convertRgbToLab65_default},ranges:{l:[0,100],a:[-125,125],b:[-125,125]}};var definition_default$12=definition$15;function parseLch(color$2,parsed){if(!parsed||parsed[0]!==`lch`)return;let res={mode:`lch`},[,l$1,c$4,h$3,alpha$1]=parsed;if(l$1.type!==Tok.None){if(l$1.type===Tok.Hue)return;res.l=Math.min(Math.max(0,l$1.value),100)}if(c$4.type!==Tok.None&&(res.c=Math.max(0,c$4.type===Tok.Number?c$4.value:c$4.value*150/100)),h$3.type!==Tok.None){if(h$3.type===Tok.Percentage)return;res.h=h$3.value}return alpha$1.type!==Tok.None&&(res.alpha=Math.min(1,Math.max(0,alpha$1.type===Tok.Number?alpha$1.value:alpha$1.value/100))),res}var parseLch_default=parseLch;const definition$14={mode:`lch`,toMode:{lab:convertLchToLab_default,rgb:c$4=>convertLabToRgb_default(convertLchToLab_default(c$4))},fromMode:{rgb:c$4=>convertLabToLch_default(convertRgbToLab_default(c$4)),lab:convertLabToLch_default},channels:[`l`,`c`,`h`,`alpha`],ranges:{l:[0,100],c:[0,150],h:[0,360]},parse:[parseLch_default],serialize:c$4=>`lch(${c$4.l===void 0?`none`:c$4.l} ${c$4.c===void 0?`none`:c$4.c} ${c$4.h===void 0?`none`:c$4.h}${c$4.alpha<1?` / ${c$4.alpha}`:``})`,interpolate:{h:{use:interpolatorLinear,fixup:fixupHueShorter},c:interpolatorLinear,l:interpolatorLinear,alpha:{use:interpolatorLinear,fixup:fixupAlpha}},difference:{h:differenceHueChroma},average:{h:averageAngle}};var definition_default$13=definition$14;const definition$13={...definition_default$13,mode:`lch65`,parse:[`--lch-d65`],serialize:`--lch-d65`,toMode:{lab65:c$4=>convertLchToLab_default(c$4,`lab65`),rgb:c$4=>convertLab65ToRgb_default(convertLchToLab_default(c$4,`lab65`))},fromMode:{rgb:c$4=>convertLabToLch_default(convertRgbToLab65_default(c$4),`lch65`),lab65:c$4=>convertLabToLch_default(c$4,`lch65`)},ranges:{l:[0,100],c:[0,150],h:[0,360]}};var definition_default$14=definition$13;const convertLuvToLchuv=({l:l$1,u:u$1,v:v$2,alpha:alpha$1})=>{u$1===void 0&&(u$1=0),v$2===void 0&&(v$2=0);let c$4=Math.sqrt(u$1*u$1+v$2*v$2),res={mode:`lchuv`,l:l$1,c:c$4};return c$4&&(res.h=normalizeHue_default(Math.atan2(v$2,u$1)*180/Math.PI)),alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertLuvToLchuv_default=convertLuvToLchuv;const convertLchuvToLuv=({l:l$1,c:c$4,h:h$3,alpha:alpha$1})=>{h$3===void 0&&(h$3=0);let res={mode:`luv`,l:l$1,u:c$4?c$4*Math.cos(h$3/180*Math.PI):0,v:c$4?c$4*Math.sin(h$3/180*Math.PI):0};return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertLchuvToLuv_default=convertLchuvToLuv;const u_fn$1=(x$3,y$3,z$3)=>4*x$3/(x$3+15*y$3+3*z$3),v_fn$1=(x$3,y$3,z$3)=>9*y$3/(x$3+15*y$3+3*z$3),un$2=u_fn$1(D50.X,D50.Y,D50.Z),vn$2=v_fn$1(D50.X,D50.Y,D50.Z),l_fn=value$1=>value$1<=e?k$1*value$1:116*Math.cbrt(value$1)-16,convertXyz50ToLuv=({x:x$3,y:y$3,z:z$3,alpha:alpha$1})=>{x$3===void 0&&(x$3=0),y$3===void 0&&(y$3=0),z$3===void 0&&(z$3=0);let l$1=l_fn(y$3/D50.Y),u$1=u_fn$1(x$3,y$3,z$3),v$2=v_fn$1(x$3,y$3,z$3);!isFinite(u$1)||!isFinite(v$2)?l$1=u$1=v$2=0:(u$1=13*l$1*(u$1-un$2),v$2=13*l$1*(v$2-vn$2));let res={mode:`luv`,l:l$1,u:u$1,v:v$2};return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertXyz50ToLuv_default=convertXyz50ToLuv;const u_fn=(x$3,y$3,z$3)=>4*x$3/(x$3+15*y$3+3*z$3),v_fn=(x$3,y$3,z$3)=>9*y$3/(x$3+15*y$3+3*z$3),un$1=u_fn(D50.X,D50.Y,D50.Z),vn$1=v_fn(D50.X,D50.Y,D50.Z),convertLuvToXyz50=({l:l$1,u:u$1,v:v$2,alpha:alpha$1})=>{if(l$1===void 0&&(l$1=0),l$1===0)return{mode:`xyz50`,x:0,y:0,z:0};u$1===void 0&&(u$1=0),v$2===void 0&&(v$2=0);let up$1=u$1/(13*l$1)+un$1,vp$1=v$2/(13*l$1)+vn$1,y$3=D50.Y*(l$1<=8?l$1/k$1:((l$1+16)/116)**3),x$3=y$3*(9*up$1)/(4*vp$1),z$3=y$3*(12-3*up$1-20*vp$1)/(4*vp$1),res={mode:`xyz50`,x:x$3,y:y$3,z:z$3};return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertLuvToXyz50_default=convertLuvToXyz50;const convertRgbToLchuv=rgb$2=>convertLuvToLchuv_default(convertXyz50ToLuv_default(convertRgbToXyz50_default(rgb$2))),convertLchuvToRgb=lchuv$1=>convertXyz50ToRgb_default(convertLuvToXyz50_default(convertLchuvToLuv_default(lchuv$1))),definition$12={mode:`lchuv`,toMode:{luv:convertLchuvToLuv_default,rgb:convertLchuvToRgb},fromMode:{rgb:convertRgbToLchuv,luv:convertLuvToLchuv_default},channels:[`l`,`c`,`h`,`alpha`],parse:[`--lchuv`],serialize:`--lchuv`,ranges:{l:[0,100],c:[0,176.956],h:[0,360]},interpolate:{h:{use:interpolatorLinear,fixup:fixupHueShorter},c:interpolatorLinear,l:interpolatorLinear,alpha:{use:interpolatorLinear,fixup:fixupAlpha}},difference:{h:differenceHueChroma},average:{h:averageAngle}};var definition_default$15=definition$12;const definition$11={...definition_default$23,mode:`lrgb`,toMode:{rgb:convertLrgbToRgb_default},fromMode:{rgb:convertRgbToLrgb_default},parse:[`srgb-linear`],serialize:`srgb-linear`};var definition_default$16=definition$11;const definition$10={mode:`luv`,toMode:{xyz50:convertLuvToXyz50_default,rgb:luv$1=>convertXyz50ToRgb_default(convertLuvToXyz50_default(luv$1))},fromMode:{xyz50:convertXyz50ToLuv_default,rgb:rgb$2=>convertXyz50ToLuv_default(convertRgbToXyz50_default(rgb$2))},channels:[`l`,`u`,`v`,`alpha`],parse:[`--luv`],serialize:`--luv`,ranges:{l:[0,100],u:[-84.936,175.042],v:[-125.882,87.243]},interpolate:{l:interpolatorLinear,u:interpolatorLinear,v:interpolatorLinear,alpha:{use:interpolatorLinear,fixup:fixupAlpha}}};var definition_default$17=definition$10;const convertLrgbToOklab=({r:r$2,g:g$2,b:b$4,alpha:alpha$1})=>{r$2===void 0&&(r$2=0),g$2===void 0&&(g$2=0),b$4===void 0&&(b$4=0);let L$1=Math.cbrt(.412221469470763*r$2+.5363325372617348*g$2+.0514459932675022*b$4),M$1=Math.cbrt(.2119034958178252*r$2+.6806995506452344*g$2+.1073969535369406*b$4),S$2=Math.cbrt(.0883024591900564*r$2+.2817188391361215*g$2+.6299787016738222*b$4),res={mode:`oklab`,l:.210454268309314*L$1+.7936177747023054*M$1-.0040720430116193*S$2,a:1.9779985324311684*L$1-2.42859224204858*M$1+.450593709617411*S$2,b:.0259040424655478*L$1+.7827717124575296*M$1-.8086757549230774*S$2};return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertLrgbToOklab_default=convertLrgbToOklab;const convertRgbToOklab=rgb$2=>{let res=convertLrgbToOklab_default(convertRgbToLrgb_default(rgb$2));return rgb$2.r===rgb$2.b&&rgb$2.b===rgb$2.g&&(res.a=res.b=0),res};var convertRgbToOklab_default=convertRgbToOklab;const convertOklabToLrgb=({l:l$1,a:a$2,b:b$4,alpha:alpha$1})=>{l$1===void 0&&(l$1=0),a$2===void 0&&(a$2=0),b$4===void 0&&(b$4=0);let L$1=(l$1+.3963377773761749*a$2+.2158037573099136*b$4)**3,M$1=(l$1-.1055613458156586*a$2-.0638541728258133*b$4)**3,S$2=(l$1-.0894841775298119*a$2-1.2914855480194092*b$4)**3,res={mode:`lrgb`,r:4.076741636075957*L$1-3.3077115392580616*M$1+.2309699031821044*S$2,g:-1.2684379732850317*L$1+2.6097573492876887*M$1-.3413193760026573*S$2,b:-.0041960761386756*L$1-.7034186179359362*M$1+1.7076146940746117*S$2};return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertOklabToLrgb_default=convertOklabToLrgb;const convertOklabToRgb=c$4=>convertLrgbToRgb_default(convertOklabToLrgb_default(c$4));var convertOklabToRgb_default=convertOklabToRgb;function toe(x$3){let k_1=.206,k_2=.03,k_3=(1+k_1)/(1+k_2);return .5*(k_3*x$3-k_1+Math.sqrt((k_3*x$3-k_1)*(k_3*x$3-k_1)+4*k_2*k_3*x$3))}function toe_inv(x$3){let k_1=.206,k_2=.03,k_3=(1+k_1)/(1+k_2);return(x$3*x$3+k_1*x$3)/(k_3*(x$3+k_2))}function compute_max_saturation(a$2,b$4){let k0,k1,k2,k3,k4,wl,wm$1,ws$1;-1.88170328*a$2-.80936493*b$4>1?(k0=1.19086277,k1=1.76576728,k2=.59662641,k3=.75515197,k4=.56771245,wl=4.0767416621,wm$1=-3.3077115913,ws$1=.2309699292):1.81444104*a$2-1.19445276*b$4>1?(k0=.73956515,k1=-.45954404,k2=.08285427,k3=.1254107,k4=.14503204,wl=-1.2684380046,wm$1=2.6097574011,ws$1=-.3413193965):(k0=1.35733652,k1=-.00915799,k2=-1.1513021,k3=-.50559606,k4=.00692167,wl=-.0041960863,wm$1=-.7034186147,ws$1=1.707614701);let S$2=k0+k1*a$2+k2*b$4+k3*a$2*a$2+k4*a$2*b$4,k_l=.3963377774*a$2+.2158037573*b$4,k_m=-.1055613458*a$2-.0638541728*b$4,k_s=-.0894841775*a$2-1.291485548*b$4;{let l_=1+S$2*k_l,m_=1+S$2*k_m,s_=1+S$2*k_s,l$1=l_*l_*l_,m$3=m_*m_*m_,s$1=s_*s_*s_,l_dS=3*k_l*l_*l_,m_dS=3*k_m*m_*m_,s_dS=3*k_s*s_*s_,l_dS2=6*k_l*k_l*l_,m_dS2=6*k_m*k_m*m_,s_dS2=6*k_s*k_s*s_,f$3=wl*l$1+wm$1*m$3+ws$1*s$1,f1=wl*l_dS+wm$1*m_dS+ws$1*s_dS,f2=wl*l_dS2+wm$1*m_dS2+ws$1*s_dS2;S$2-=f$3*f1/(f1*f1-.5*f$3*f2)}return S$2}function find_cusp(a$2,b$4){let S_cusp=compute_max_saturation(a$2,b$4),rgb$2=convertOklabToLrgb_default({l:1,a:S_cusp*a$2,b:S_cusp*b$4}),L_cusp=Math.cbrt(1/Math.max(rgb$2.r,rgb$2.g,rgb$2.b)),C_cusp=L_cusp*S_cusp;return[L_cusp,C_cusp]}function find_gamut_intersection(a$2,b$4,L1,C1$1,L0,cusp=null){cusp||=find_cusp(a$2,b$4);let t;if((L1-L0)*cusp[1]-(cusp[0]-L0)*C1$1<=0)t=cusp[1]*L0/(C1$1*cusp[0]+cusp[1]*(L0-L1));else{t=cusp[1]*(L0-1)/(C1$1*(cusp[0]-1)+cusp[1]*(L0-L1));{let dL=L1-L0,dC=C1$1,k_l=.3963377774*a$2+.2158037573*b$4,k_m=-.1055613458*a$2-.0638541728*b$4,k_s=-.0894841775*a$2-1.291485548*b$4,l_dt=dL+dC*k_l,m_dt=dL+dC*k_m,s_dt=dL+dC*k_s;{let L$1=L0*(1-t)+t*L1,C$3=t*C1$1,l_=L$1+C$3*k_l,m_=L$1+C$3*k_m,s_=L$1+C$3*k_s,l$1=l_*l_*l_,m$3=m_*m_*m_,s$1=s_*s_*s_,ldt=3*l_dt*l_*l_,mdt=3*m_dt*m_*m_,sdt=3*s_dt*s_*s_,ldt2=6*l_dt*l_dt*l_,mdt2=6*m_dt*m_dt*m_,sdt2=6*s_dt*s_dt*s_,r$2=4.0767416621*l$1-3.3077115913*m$3+.2309699292*s$1-1,r1=4.0767416621*ldt-3.3077115913*mdt+.2309699292*sdt,r2=4.0767416621*ldt2-3.3077115913*mdt2+.2309699292*sdt2,u_r=r1/(r1*r1-.5*r$2*r2),t_r=-r$2*u_r,g$2=-1.2684380046*l$1+2.6097574011*m$3-.3413193965*s$1-1,g1=-1.2684380046*ldt+2.6097574011*mdt-.3413193965*sdt,g2=-1.2684380046*ldt2+2.6097574011*mdt2-.3413193965*sdt2,u_g=g1/(g1*g1-.5*g$2*g2),t_g=-g$2*u_g,b$5=-.0041960863*l$1-.7034186147*m$3+1.707614701*s$1-1,b1=-.0041960863*ldt-.7034186147*mdt+1.707614701*sdt,b2=-.0041960863*ldt2-.7034186147*mdt2+1.707614701*sdt2,u_b=b1/(b1*b1-.5*b$5*b2),t_b=-b$5*u_b;t_r=u_r>=0?t_r:1e6,t_g=u_g>=0?t_g:1e6,t_b=u_b>=0?t_b:1e6,t+=Math.min(t_r,Math.min(t_g,t_b))}}}return t}function get_ST_max(a_,b_,cusp=null){cusp||=find_cusp(a_,b_);let L$1=cusp[0],C$3=cusp[1];return[C$3/L$1,C$3/(1-L$1)]}function get_Cs(L$1,a_,b_){let cusp=find_cusp(a_,b_),C_max=find_gamut_intersection(a_,b_,L$1,1,L$1,cusp),ST_max=get_ST_max(a_,b_,cusp),S_mid=.11516993+1/(7.4477897+4.1590124*b_+a_*(-2.19557347+1.75198401*b_+a_*(-2.13704948-10.02301043*b_+a_*(-4.24894561+5.38770819*b_+4.69891013*a_)))),T_mid=.11239642+1/(1.6132032-.68124379*b_+a_*(.40370612+.90148123*b_+a_*(-.27087943+.6122399*b_+a_*(.00299215-.45399568*b_-.14661872*a_)))),k$4=C_max/Math.min(L$1*ST_max[0],(1-L$1)*ST_max[1]),C_a=L$1*S_mid,C_b=(1-L$1)*T_mid,C_mid=.9*k$4*Math.sqrt(Math.sqrt(1/(1/(C_a*C_a*C_a*C_a)+1/(C_b*C_b*C_b*C_b))));C_a=L$1*.4,C_b=(1-L$1)*.8;let C_0=Math.sqrt(1/(1/(C_a*C_a)+1/(C_b*C_b)));return[C_0,C_mid,C_max]}function convertOklabToOkhsl(lab$1){let l$1=lab$1.l===void 0?0:lab$1.l,a$2=lab$1.a===void 0?0:lab$1.a,b$4=lab$1.b===void 0?0:lab$1.b,ret={mode:`okhsl`,l:toe(l$1)};lab$1.alpha!==void 0&&(ret.alpha=lab$1.alpha);let c$4=Math.sqrt(a$2*a$2+b$4*b$4);if(!c$4)return ret.s=0,ret;let[C_0,C_mid,C_max]=get_Cs(l$1,a$2/c$4,b$4/c$4),s$1;if(c$4convertOklabToOkhsl(convertRgbToOklab_default(c$4))},toMode:{oklab:convertOkhslToOklab,rgb:c$4=>convertOklabToRgb_default(convertOkhslToOklab(c$4))}};var modeOkhsl_default=modeOkhsl;function convertOklabToOkhsv(lab$1){let l$1=lab$1.l===void 0?0:lab$1.l,a$2=lab$1.a===void 0?0:lab$1.a,b$4=lab$1.b===void 0?0:lab$1.b,c$4=Math.sqrt(a$2*a$2+b$4*b$4),a_=c$4?a$2/c$4:1,b_=c$4?b$4/c$4:1,[S_max,T$1]=get_ST_max(a_,b_),S_0=.5,k$4=1-S_0/S_max,t=T$1/(c$4+l$1*T$1),L_v=t*l$1,C_v=t*c$4,L_vt=toe_inv(L_v),C_vt=C_v*L_vt/L_v,rgb_scale=convertOklabToLrgb_default({l:L_vt,a:a_*C_vt,b:b_*C_vt}),scale_L=Math.cbrt(1/Math.max(rgb_scale.r,rgb_scale.g,rgb_scale.b,0));l$1/=scale_L,c$4=c$4/scale_L*toe(l$1)/l$1,l$1=toe(l$1);let ret={mode:`okhsv`,s:c$4?(S_0+T$1)*C_v/(T$1*S_0+T$1*k$4*C_v):0,v:l$1?l$1/L_v:0};return ret.s&&(ret.h=normalizeHue_default(Math.atan2(b$4,a$2)*180/Math.PI)),lab$1.alpha!==void 0&&(ret.alpha=lab$1.alpha),ret}function convertOkhsvToOklab(hsv$1){let ret={mode:`oklab`};hsv$1.alpha!==void 0&&(ret.alpha=hsv$1.alpha);let h$3=hsv$1.h===void 0?0:hsv$1.h,s$1=hsv$1.s===void 0?0:hsv$1.s,v$2=hsv$1.v===void 0?0:hsv$1.v,a_=Math.cos(h$3/180*Math.PI),b_=Math.sin(h$3/180*Math.PI),[S_max,T$1]=get_ST_max(a_,b_),S_0=.5,k$4=1-S_0/S_max,L_v=1-s$1*S_0/(S_0+T$1-T$1*k$4*s$1),C_v=s$1*T$1*S_0/(S_0+T$1-T$1*k$4*s$1),L_vt=toe_inv(L_v),C_vt=C_v*L_vt/L_v,rgb_scale=convertOklabToLrgb_default({l:L_vt,a:a_*C_vt,b:b_*C_vt}),scale_L=Math.cbrt(1/Math.max(rgb_scale.r,rgb_scale.g,rgb_scale.b,0)),L_new=toe_inv(v$2*L_v),C$3=C_v*L_new/L_v;return ret.l=L_new*scale_L,ret.a=C$3*a_*scale_L,ret.b=C$3*b_*scale_L,ret}const modeOkhsv={...definition_default$6,mode:`okhsv`,channels:[`h`,`s`,`v`,`alpha`],parse:[`--okhsv`],serialize:`--okhsv`,fromMode:{oklab:convertOklabToOkhsv,rgb:c$4=>convertOklabToOkhsv(convertRgbToOklab_default(c$4))},toMode:{oklab:convertOkhsvToOklab,rgb:c$4=>convertOklabToRgb_default(convertOkhsvToOklab(c$4))}};var modeOkhsv_default=modeOkhsv;function parseOklab(color$2,parsed){if(!parsed||parsed[0]!==`oklab`)return;let res={mode:`oklab`},[,l$1,a$2,b$4,alpha$1]=parsed;if(!(l$1.type===Tok.Hue||a$2.type===Tok.Hue||b$4.type===Tok.Hue))return l$1.type!==Tok.None&&(res.l=Math.min(Math.max(0,l$1.type===Tok.Number?l$1.value:l$1.value/100),1)),a$2.type!==Tok.None&&(res.a=a$2.type===Tok.Number?a$2.value:a$2.value*.4/100),b$4.type!==Tok.None&&(res.b=b$4.type===Tok.Number?b$4.value:b$4.value*.4/100),alpha$1.type!==Tok.None&&(res.alpha=Math.min(1,Math.max(0,alpha$1.type===Tok.Number?alpha$1.value:alpha$1.value/100))),res}var parseOklab_default=parseOklab;const definition$9={...definition_default$11,mode:`oklab`,toMode:{lrgb:convertOklabToLrgb_default,rgb:convertOklabToRgb_default},fromMode:{lrgb:convertLrgbToOklab_default,rgb:convertRgbToOklab_default},ranges:{l:[0,1],a:[-.4,.4],b:[-.4,.4]},parse:[parseOklab_default],serialize:c$4=>`oklab(${c$4.l===void 0?`none`:c$4.l} ${c$4.a===void 0?`none`:c$4.a} ${c$4.b===void 0?`none`:c$4.b}${c$4.alpha<1?` / ${c$4.alpha}`:``})`};var definition_default$18=definition$9;function parseOklch(color$2,parsed){if(!parsed||parsed[0]!==`oklch`)return;let res={mode:`oklch`},[,l$1,c$4,h$3,alpha$1]=parsed;if(l$1.type!==Tok.None){if(l$1.type===Tok.Hue)return;res.l=Math.min(Math.max(0,l$1.type===Tok.Number?l$1.value:l$1.value/100),1)}if(c$4.type!==Tok.None&&(res.c=Math.max(0,c$4.type===Tok.Number?c$4.value:c$4.value*.4/100)),h$3.type!==Tok.None){if(h$3.type===Tok.Percentage)return;res.h=h$3.value}return alpha$1.type!==Tok.None&&(res.alpha=Math.min(1,Math.max(0,alpha$1.type===Tok.Number?alpha$1.value:alpha$1.value/100))),res}var parseOklch_default=parseOklch;const definition$8={...definition_default$13,mode:`oklch`,toMode:{oklab:c$4=>convertLchToLab_default(c$4,`oklab`),rgb:c$4=>convertOklabToRgb_default(convertLchToLab_default(c$4,`oklab`))},fromMode:{rgb:c$4=>convertLabToLch_default(convertRgbToOklab_default(c$4),`oklch`),oklab:c$4=>convertLabToLch_default(c$4,`oklch`)},parse:[parseOklch_default],serialize:c$4=>`oklch(${c$4.l===void 0?`none`:c$4.l} ${c$4.c===void 0?`none`:c$4.c} ${c$4.h===void 0?`none`:c$4.h}${c$4.alpha<1?` / ${c$4.alpha}`:``})`,ranges:{l:[0,1],c:[0,.4],h:[0,360]}};var definition_default$19=definition$8;const convertP3ToXyz65=rgb$2=>{let{r:r$2,g:g$2,b:b$4,alpha:alpha$1}=convertRgbToLrgb_default(rgb$2),res={mode:`xyz65`,x:.486570948648216*r$2+.265667693169093*g$2+.1982172852343625*b$4,y:.2289745640697487*r$2+.6917385218365062*g$2+.079286914093745*b$4,z:0*r$2+.0451133818589026*g$2+1.043944368900976*b$4};return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertP3ToXyz65_default=convertP3ToXyz65;const convertXyz65ToP3=({x:x$3,y:y$3,z:z$3,alpha:alpha$1})=>{x$3===void 0&&(x$3=0),y$3===void 0&&(y$3=0),z$3===void 0&&(z$3=0);let res=convertLrgbToRgb_default({r:x$3*2.4934969119414263-y$3*.9313836179191242-.402710784450717*z$3,g:x$3*-.8294889695615749+y$3*1.7626640603183465+.0236246858419436*z$3,b:x$3*.0358458302437845-y$3*.0761723892680418+.9568845240076871*z$3},`p3`);return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertXyz65ToP3_default=convertXyz65ToP3;const definition$7={...definition_default$23,mode:`p3`,parse:[`display-p3`],serialize:`display-p3`,fromMode:{rgb:color$2=>convertXyz65ToP3_default(convertRgbToXyz65_default(color$2)),xyz65:convertXyz65ToP3_default},toMode:{rgb:color$2=>convertXyz65ToRgb_default(convertP3ToXyz65_default(color$2)),xyz65:convertP3ToXyz65_default}};var definition_default$20=definition$7;const gamma$1=v$2=>{let abs$2=Math.abs(v$2);return abs$2>=1/512?Math.sign(v$2)*abs$2**(1/1.8):16*v$2},convertXyz50ToProphoto=({x:x$3,y:y$3,z:z$3,alpha:alpha$1})=>{x$3===void 0&&(x$3=0),y$3===void 0&&(y$3=0),z$3===void 0&&(z$3=0);let res={mode:`prophoto`,r:gamma$1(x$3*1.3457868816471585-y$3*.2555720873797946-.0511018649755453*z$3),g:gamma$1(x$3*-.5446307051249019+y$3*1.5082477428451466+.0205274474364214*z$3),b:gamma$1(x$3*0+y$3*0+1.2119675456389452*z$3)};return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertXyz50ToProphoto_default=convertXyz50ToProphoto;const linearize$1=(v$2=0)=>{let abs$2=Math.abs(v$2);return abs$2>=16/512?Math.sign(v$2)*abs$2**1.8:v$2/16},convertProphotoToXyz50=prophoto$1=>{let r$2=linearize$1(prophoto$1.r),g$2=linearize$1(prophoto$1.g),b$4=linearize$1(prophoto$1.b),res={mode:`xyz50`,x:.7977666449006423*r$2+.1351812974005331*g$2+.0313477341283922*b$4,y:.2880748288194013*r$2+.7118352342418731*g$2+899369387256e-16*b$4,z:0*r$2+0*g$2+.8251046025104602*b$4};return prophoto$1.alpha!==void 0&&(res.alpha=prophoto$1.alpha),res};var convertProphotoToXyz50_default=convertProphotoToXyz50;const definition$6={...definition_default$23,mode:`prophoto`,parse:[`prophoto-rgb`],serialize:`prophoto-rgb`,fromMode:{xyz50:convertXyz50ToProphoto_default,rgb:color$2=>convertXyz50ToProphoto_default(convertRgbToXyz50_default(color$2))},toMode:{xyz50:convertProphotoToXyz50_default,rgb:color$2=>convertXyz50ToRgb_default(convertProphotoToXyz50_default(color$2))}};var definition_default$21=definition$6;const α$1=1.09929682680944,β$1=.018053968510807,gamma=v$2=>{let abs$2=Math.abs(v$2);return abs$2>β$1?(Math.sign(v$2)||1)*(α$1*abs$2**.45-(α$1-1)):4.5*v$2},convertXyz65ToRec2020=({x:x$3,y:y$3,z:z$3,alpha:alpha$1})=>{x$3===void 0&&(x$3=0),y$3===void 0&&(y$3=0),z$3===void 0&&(z$3=0);let res={mode:`rec2020`,r:gamma(x$3*1.7166511879712683-y$3*.3556707837763925-.2533662813736599*z$3),g:gamma(x$3*-.6666843518324893+y$3*1.6164812366349395+.0157685458139111*z$3),b:gamma(x$3*.0176398574453108-y$3*.0427706132578085+.9421031212354739*z$3)};return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertXyz65ToRec2020_default=convertXyz65ToRec2020;const α=1.09929682680944,β=.018053968510807,linearize=(v$2=0)=>{let abs$2=Math.abs(v$2);return abs$2<β*4.5?v$2/4.5:(Math.sign(v$2)||1)*((abs$2+α-1)/α)**(1/.45)},convertRec2020ToXyz65=rec2020$1=>{let r$2=linearize(rec2020$1.r),g$2=linearize(rec2020$1.g),b$4=linearize(rec2020$1.b),res={mode:`xyz65`,x:.6369580483012911*r$2+.1446169035862083*g$2+.1688809751641721*b$4,y:.262700212011267*r$2+.6779980715188708*g$2+.059301716469862*b$4,z:0*r$2+.0280726930490874*g$2+1.0609850577107909*b$4};return rec2020$1.alpha!==void 0&&(res.alpha=rec2020$1.alpha),res};var convertRec2020ToXyz65_default=convertRec2020ToXyz65;const definition$5={...definition_default$23,mode:`rec2020`,fromMode:{xyz65:convertXyz65ToRec2020_default,rgb:color$2=>convertXyz65ToRec2020_default(convertRgbToXyz65_default(color$2))},toMode:{xyz65:convertRec2020ToXyz65_default,rgb:color$2=>convertXyz65ToRgb_default(convertRec2020ToXyz65_default(color$2))},parse:[`rec2020`],serialize:`rec2020`};var definition_default$22=definition$5;const bias=.0037930732552754493,bias_cbrt=Math.cbrt(bias),transfer$1=v$2=>Math.cbrt(v$2)-bias_cbrt,convertRgbToXyb=color$2=>{let{r:r$2,g:g$2,b:b$4,alpha:alpha$1}=convertRgbToLrgb_default(color$2),l$1=transfer$1(.3*r$2+.622*g$2+.078*b$4+bias),m$3=transfer$1(.23*r$2+.692*g$2+.078*b$4+bias),s$1=transfer$1(.2434226892454782*r$2+.2047674442449682*g$2+.5518098665095535*b$4+bias),res={mode:`xyb`,x:(l$1-m$3)/2,y:(l$1+m$3)/2,b:s$1-(l$1+m$3)/2};return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertRgbToXyb_default=convertRgbToXyb;const transfer=v$2=>(v$2+bias_cbrt)**3,convertXybToRgb=({x:x$3,y:y$3,b:b$4,alpha:alpha$1})=>{x$3===void 0&&(x$3=0),y$3===void 0&&(y$3=0),b$4===void 0&&(b$4=0);let l$1=transfer(x$3+y$3)-bias,m$3=transfer(y$3-x$3)-bias,s$1=transfer(b$4+y$3)-bias,res=convertLrgbToRgb_default({r:11.031566904639861*l$1-9.866943908131562*m$3-.16462299650829934*s$1,g:-3.2541473810744237*l$1+4.418770377582723*m$3-.16462299650829934*s$1,b:-3.6588512867136815*l$1+2.7129230459360922*m$3+1.9459282407775895*s$1});return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertXybToRgb_default=convertXybToRgb;const definition$4={mode:`xyb`,channels:[`x`,`y`,`b`,`alpha`],parse:[`--xyb`],serialize:`--xyb`,toMode:{rgb:convertXybToRgb_default},fromMode:{rgb:convertRgbToXyb_default},ranges:{x:[-.0154,.0281],y:[0,.8453],b:[-.2778,.388]},interpolate:{x:interpolatorLinear,y:interpolatorLinear,b:interpolatorLinear,alpha:{use:interpolatorLinear,fixup:fixupAlpha}}};var definition_default$24=definition$4;const definition$3={mode:`xyz50`,parse:[`xyz-d50`],serialize:`xyz-d50`,toMode:{rgb:convertXyz50ToRgb_default,lab:convertXyz50ToLab_default},fromMode:{rgb:convertRgbToXyz50_default,lab:convertLabToXyz50_default},channels:[`x`,`y`,`z`,`alpha`],ranges:{x:[0,.964],y:[0,.999],z:[0,.825]},interpolate:{x:interpolatorLinear,y:interpolatorLinear,z:interpolatorLinear,alpha:{use:interpolatorLinear,fixup:fixupAlpha}}};var definition_default$25=definition$3;const convertXyz65ToXyz50=xyz65$1=>{let{x:x$3,y:y$3,z:z$3,alpha:alpha$1}=xyz65$1;x$3===void 0&&(x$3=0),y$3===void 0&&(y$3=0),z$3===void 0&&(z$3=0);let res={mode:`xyz50`,x:1.0479298208405488*x$3+.0229467933410191*y$3-.0501922295431356*z$3,y:.0296278156881593*x$3+.990434484573249*y$3-.0170738250293851*z$3,z:-.0092430581525912*x$3+.0150551448965779*y$3+.7518742899580008*z$3};return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertXyz65ToXyz50_default=convertXyz65ToXyz50;const convertXyz50ToXyz65=xyz50$1=>{let{x:x$3,y:y$3,z:z$3,alpha:alpha$1}=xyz50$1;x$3===void 0&&(x$3=0),y$3===void 0&&(y$3=0),z$3===void 0&&(z$3=0);let res={mode:`xyz65`,x:.9554734527042182*x$3-.0230985368742614*y$3+.0632593086610217*z$3,y:-.0283697069632081*x$3+1.0099954580058226*y$3+.021041398966943*z$3,z:.0123140016883199*x$3-.0205076964334779*y$3+1.3303659366080753*z$3};return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertXyz50ToXyz65_default=convertXyz50ToXyz65;const definition$2={mode:`xyz65`,toMode:{rgb:convertXyz65ToRgb_default,xyz50:convertXyz65ToXyz50_default},fromMode:{rgb:convertRgbToXyz65_default,xyz50:convertXyz50ToXyz65_default},ranges:{x:[0,.95],y:[0,1],z:[0,1.088]},channels:[`x`,`y`,`z`,`alpha`],parse:[`xyz`,`xyz-d65`],serialize:`xyz-d65`,interpolate:{x:interpolatorLinear,y:interpolatorLinear,z:interpolatorLinear,alpha:{use:interpolatorLinear,fixup:fixupAlpha}}};var definition_default$26=definition$2;const convertRgbToYiq=({r:r$2,g:g$2,b:b$4,alpha:alpha$1})=>{r$2===void 0&&(r$2=0),g$2===void 0&&(g$2=0),b$4===void 0&&(b$4=0);let res={mode:`yiq`,y:.29889531*r$2+.58662247*g$2+.11448223*b$4,i:.59597799*r$2-.2741761*g$2-.32180189*b$4,q:.21147017*r$2-.52261711*g$2+.31114694*b$4};return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertRgbToYiq_default=convertRgbToYiq;const convertYiqToRgb=({y:y$3,i:i$1,q:q$2,alpha:alpha$1})=>{y$3===void 0&&(y$3=0),i$1===void 0&&(i$1=0),q$2===void 0&&(q$2=0);let res={mode:`rgb`,r:y$3+.95608445*i$1+.6208885*q$2,g:y$3-.27137664*i$1-.6486059*q$2,b:y$3-1.10561724*i$1+1.70250126*q$2};return alpha$1!==void 0&&(res.alpha=alpha$1),res};var convertYiqToRgb_default=convertYiqToRgb;const definition$1={mode:`yiq`,toMode:{rgb:convertYiqToRgb_default},fromMode:{rgb:convertRgbToYiq_default},channels:[`y`,`i`,`q`,`alpha`],parse:[`--yiq`],serialize:`--yiq`,ranges:{i:[-.595,.595],q:[-.522,.522]},interpolate:{y:interpolatorLinear,i:interpolatorLinear,q:interpolatorLinear,alpha:{use:interpolatorLinear,fixup:fixupAlpha}}};var definition_default$27=definition$1;const r$1=(value$1,precision)=>Math.round(value$1*(precision=10**precision))/precision,round$2=(precision=4)=>value$1=>typeof value$1==`number`?r$1(value$1,precision):value$1;var round_default=round$2;let twoDecimals=round_default(2);const clamp$2=value$1=>Math.max(0,Math.min(1,value$1||0)),fixup=value$1=>Math.round(clamp$2(value$1)*255),rgb$1=converter_default(`rgb`),hsl$1=converter_default(`hsl`),serializeHex=color$2=>{if(color$2===void 0)return;let r$2=fixup(color$2.r),g$2=fixup(color$2.g),b$4=fixup(color$2.b);return`#`+(1<<24|r$2<<16|g$2<<8|b$4).toString(16).slice(1)},formatCss=c$4=>{let color$2=_prepare_default(c$4);if(!color$2)return;let def$1=getMode(color$2.mode);if(!def$1.serialize||typeof def$1.serialize==`string`){let res=`color(${def$1.serialize||`--${color$2.mode}`} `;return def$1.channels.forEach((ch$1,i$1)=>{ch$1!==`alpha`&&(res+=(i$1?` `:``)+(color$2[ch$1]===void 0?`none`:color$2[ch$1]))}),color$2.alpha!==void 0&&color$2.alpha<1&&(res+=` / ${color$2.alpha}`),res+`)`}if(typeof def$1.serialize==`function`)return def$1.serialize(color$2)},formatHex=c$4=>serializeHex(rgb$1(c$4)),a98=useMode(definition_default),cubehelix=useMode(definition_default$1),dlab=useMode(definition_default$2),dlch=useMode(definition_default$3),hsi=useMode(definition_default$4),hsl=useMode(definition_default$5),hsv=useMode(definition_default$6),hwb=useMode(definition_default$7),itp=useMode(definition_default$8),jab=useMode(definition_default$9),jch=useMode(definition_default$10),lab=useMode(definition_default$11),lab65=useMode(definition_default$12),lch=useMode(definition_default$13),lch65=useMode(definition_default$14),lchuv=useMode(definition_default$15),lrgb=useMode(definition_default$16),luv=useMode(definition_default$17),okhsl=useMode(modeOkhsl_default),okhsv=useMode(modeOkhsv_default),oklab=useMode(definition_default$18),oklch=useMode(definition_default$19),p3=useMode(definition_default$20),prophoto=useMode(definition_default$21),rec2020=useMode(definition_default$22),rgb=useMode(definition_default$23),xyb=useMode(definition_default$24),xyz50=useMode(definition_default$25),xyz65=useMode(definition_default$26),yiq=useMode(definition_default$27);function colorToChromaticColor(color$2){return{color:color$2,withAlpha:alpha$1=>{let rgba$1=oklch(color$2);if(!rgba$1)throw Error(`Invalid color provided for alpha adjustment`);return colorToChromaticColor(oklch({mode:`oklch`,l:rgba$1.l,c:rgba$1.c,h:rgba$1.h,alpha:alpha$1}))},toHex:()=>formatHex(color$2),toCSS:()=>formatCss(color$2)}}function chromaticPaletteFrom(baseHue=200,baseChroma){let chroma=baseChroma??.18+Math.cos(baseHue*Math.PI/180)*.04,shadeConfig={50:{lightness:.95,chromaMultiplier:.3,mixWithWhite:.7},100:{lightness:.95,chromaMultiplier:.5,mixWithWhite:.2},200:{lightness:.9,chromaMultiplier:.6},300:{lightness:.85,chromaMultiplier:.75},400:{lightness:.74,chromaMultiplier:.85},500:{lightness:.62,chromaMultiplier:1},600:{lightness:.54,chromaMultiplier:1.15},700:{lightness:.49,chromaMultiplier:1.1},800:{lightness:.42,chromaMultiplier:.85},900:{lightness:.37,chromaMultiplier:.7},950:{lightness:.29,chromaMultiplier:.5}},shadeBy=(shade,alpha$1,hueOffset=0)=>{let config=shadeConfig[shade],adjustedHue=(baseHue+hueOffset)%360,adjustedChroma=chroma*config.chromaMultiplier,baseColor=oklch({mode:`oklch`,l:config.lightness,c:adjustedChroma,h:adjustedHue,alpha:alpha$1??1});if(config.mixWithWhite){let white=oklch({mode:`oklch`,l:1,c:0,h:0,alpha:alpha$1??1});return colorToChromaticColor(mixColors(baseColor,white,config.mixWithWhite))}return colorToChromaticColor(baseColor)};return{baseHue,chroma,getAllShades:(alpha$1,hueOffset=0)=>{let shades={};for(let shadeKey of Object.keys(shadeConfig)){let shade=Number.parseInt(shadeKey);shades[shade]=shadeBy(shade,alpha$1,hueOffset)}return shades},shadeBy}}function mixColors(color1,color2,ratio=.5){let c1=oklch(color1),c2=oklch(color2);if(!c1||!c2)throw Error(`Invalid colors provided for mixing`);return oklch({mode:`oklch`,l:c1.l*(1-ratio)+c2.l*ratio,c:c1.c*(1-ratio)+c2.c*ratio,h:mixHues(c1.h??0,c2.h??0,ratio)})}function mixHues(h1,h2,ratio){let diff=h2-h1;return diff>180&&(diff-=360),diff<-180&&(diff+=360),(h1+diff*ratio+360)%360}let Emotion=function(Emotion$1){return Emotion$1.Idle=`<|EMOTE_NEUTRAL|>`,Emotion$1.Happy=`<|EMOTE_HAPPY|>`,Emotion$1.Sad=`<|EMOTE_SAD|>`,Emotion$1.Angry=`<|EMOTE_ANGRY|>`,Emotion$1.Think=`<|EMOTE_THINK|>`,Emotion$1.Surprise=`<|EMOTE_SURPRISE|>`,Emotion$1.Awkward=`<|EMOTE_AWKWARD|>`,Emotion$1.Question=`<|EMOTE_QUESTION|>`,Emotion$1}({});const EMOTION_VALUES=Object.values(Emotion),EmotionHappyMotionName=`Happy`,EmotionSadMotionName=`Sad`,EmotionAngryMotionName=`Angry`,EmotionAwkwardMotionName=`Awkward`,EmotionThinkMotionName=`Think`,EmotionSurpriseMotionName=`Surprise`,EmotionQuestionMotionName=`Question`,EmotionNeutralMotionName=`Idle`,EMOTION_EmotionMotionName_value={[Emotion.Happy]:EmotionHappyMotionName,[Emotion.Sad]:EmotionSadMotionName,[Emotion.Angry]:EmotionAngryMotionName,[Emotion.Think]:EmotionThinkMotionName,[Emotion.Surprise]:EmotionSurpriseMotionName,[Emotion.Awkward]:EmotionAwkwardMotionName,[Emotion.Question]:EmotionQuestionMotionName,[Emotion.Idle]:EmotionNeutralMotionName},EMOTION_VRMExpressionName_value={[Emotion.Happy]:`happy`,[Emotion.Sad]:`sad`,[Emotion.Angry]:`angry`,[Emotion.Think]:void 0,[Emotion.Surprise]:`surprised`,[Emotion.Awkward]:void 0,[Emotion.Question]:void 0,[Emotion.Idle]:void 0},chromaticHue=Symbol(`@proj-airi/chromatic-hue`);function message(prefix,suffix){return{role:`system`,content:[prefix,EMOTION_VALUES.map(emotion=>`- ${emotion}`).join(` @@ -4998,7 +4998,7 @@ void main() { * https://github.com/pixiv/three-vrm/blob/release/LICENSE */ function toTrianglesDrawMode(geometry,drawMode){if(drawMode===TrianglesDrawMode)return console.warn(`THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles.`),geometry;if(drawMode===TriangleFanDrawMode||drawMode===TriangleStripDrawMode){let index$1=geometry.getIndex();if(index$1===null){let indices=[],position$2=geometry.getAttribute(`position`);if(position$2!==void 0){for(let i$1=0;i$1=2.0 are supported.`));return}let parser=new GLTFParser(json,{path:path||this.resourcePath||``,crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});parser.fileLoader.setRequestHeader(this.requestHeader);for(let i$1=0;i$1=0&&plugins[extensionName]===void 0&&console.warn(`THREE.GLTFLoader: Unknown extension "`+extensionName+`".`)}}parser.setExtensions(extensions),parser.setPlugins(plugins),parser.parse(onLoad,onError)}parseAsync(data$12,path){let scope=this;return new Promise(function(resolve$1,reject){scope.parse(data$12,path,resolve$1,reject)})}};function GLTFRegistry(){let objects={};return{get:function(key$2){return objects[key$2]},add:function(key$2,object){objects[key$2]=object},remove:function(key$2){delete objects[key$2]},removeAll:function(){objects={}}}}const EXTENSIONS={KHR_BINARY_GLTF:`KHR_binary_glTF`,KHR_DRACO_MESH_COMPRESSION:`KHR_draco_mesh_compression`,KHR_LIGHTS_PUNCTUAL:`KHR_lights_punctual`,KHR_MATERIALS_CLEARCOAT:`KHR_materials_clearcoat`,KHR_MATERIALS_DISPERSION:`KHR_materials_dispersion`,KHR_MATERIALS_IOR:`KHR_materials_ior`,KHR_MATERIALS_SHEEN:`KHR_materials_sheen`,KHR_MATERIALS_SPECULAR:`KHR_materials_specular`,KHR_MATERIALS_TRANSMISSION:`KHR_materials_transmission`,KHR_MATERIALS_IRIDESCENCE:`KHR_materials_iridescence`,KHR_MATERIALS_ANISOTROPY:`KHR_materials_anisotropy`,KHR_MATERIALS_UNLIT:`KHR_materials_unlit`,KHR_MATERIALS_VOLUME:`KHR_materials_volume`,KHR_TEXTURE_BASISU:`KHR_texture_basisu`,KHR_TEXTURE_TRANSFORM:`KHR_texture_transform`,KHR_MESH_QUANTIZATION:`KHR_mesh_quantization`,KHR_MATERIALS_EMISSIVE_STRENGTH:`KHR_materials_emissive_strength`,EXT_MATERIALS_BUMP:`EXT_materials_bump`,EXT_TEXTURE_WEBP:`EXT_texture_webp`,EXT_TEXTURE_AVIF:`EXT_texture_avif`,EXT_MESHOPT_COMPRESSION:`EXT_meshopt_compression`,EXT_MESH_GPU_INSTANCING:`EXT_mesh_gpu_instancing`};var GLTFLightsExtension=class{constructor(parser){this.parser=parser,this.name=EXTENSIONS.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){let parser=this.parser,nodeDefs=this.parser.json.nodes||[];for(let nodeIndex=0,nodeLength=nodeDefs.length;nodeIndex=0)throw Error(`THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures`);return null}return parser.loadTextureImage(textureIndex,extension$1.source,loader$1)}},GLTFTextureWebPExtension=class{constructor(parser){this.parser=parser,this.name=EXTENSIONS.EXT_TEXTURE_WEBP}loadTexture(textureIndex){let name$2=this.name,parser=this.parser,json=parser.json,textureDef=json.textures[textureIndex];if(!textureDef.extensions||!textureDef.extensions[name$2])return null;let extension$1=textureDef.extensions[name$2],source=json.images[extension$1.source],loader$1=parser.textureLoader;if(source.uri){let handler=parser.options.manager.getHandler(source.uri);handler!==null&&(loader$1=handler)}return parser.loadTextureImage(textureIndex,extension$1.source,loader$1)}},GLTFTextureAVIFExtension=class{constructor(parser){this.parser=parser,this.name=EXTENSIONS.EXT_TEXTURE_AVIF}loadTexture(textureIndex){let name$2=this.name,parser=this.parser,json=parser.json,textureDef=json.textures[textureIndex];if(!textureDef.extensions||!textureDef.extensions[name$2])return null;let extension$1=textureDef.extensions[name$2],source=json.images[extension$1.source],loader$1=parser.textureLoader;if(source.uri){let handler=parser.options.manager.getHandler(source.uri);handler!==null&&(loader$1=handler)}return parser.loadTextureImage(textureIndex,extension$1.source,loader$1)}},GLTFMeshoptCompression=class{constructor(parser){this.name=EXTENSIONS.EXT_MESHOPT_COMPRESSION,this.parser=parser}loadBufferView(index$1){let json=this.parser.json,bufferView=json.bufferViews[index$1];if(bufferView.extensions&&bufferView.extensions[this.name]){let extensionDef=bufferView.extensions[this.name],buffer$1=this.parser.getDependency(`buffer`,extensionDef.buffer),decoder=this.parser.options.meshoptDecoder;if(!decoder||!decoder.supported){if(json.extensionsRequired&&json.extensionsRequired.indexOf(this.name)>=0)throw Error(`THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files`);return null}return buffer$1.then(function(res){let byteOffset=extensionDef.byteOffset||0,byteLength=extensionDef.byteLength||0,count$1=extensionDef.count,stride=extensionDef.byteStride,source=new Uint8Array(res,byteOffset,byteLength);return decoder.decodeGltfBufferAsync?decoder.decodeGltfBufferAsync(count$1,stride,source,extensionDef.mode,extensionDef.filter).then(function(res$1){return res$1.buffer}):decoder.ready.then(function(){let result=new ArrayBuffer(count$1*stride);return decoder.decodeGltfBuffer(new Uint8Array(result),count$1,stride,source,extensionDef.mode,extensionDef.filter),result})})}else return null}},GLTFMeshGpuInstancing=class{constructor(parser){this.name=EXTENSIONS.EXT_MESH_GPU_INSTANCING,this.parser=parser}createNodeMesh(nodeIndex){let json=this.parser.json,nodeDef=json.nodes[nodeIndex];if(!nodeDef.extensions||!nodeDef.extensions[this.name]||nodeDef.mesh===void 0)return null;let meshDef=json.meshes[nodeDef.mesh];for(let primitive of meshDef.primitives)if(primitive.mode!==WEBGL_CONSTANTS.TRIANGLES&&primitive.mode!==WEBGL_CONSTANTS.TRIANGLE_STRIP&&primitive.mode!==WEBGL_CONSTANTS.TRIANGLE_FAN&&primitive.mode!==void 0)return null;let extensionDef=nodeDef.extensions[this.name],attributesDef=extensionDef.attributes,pending=[],attributes={};for(let key$2 in attributesDef)pending.push(this.parser.getDependency(`accessor`,attributesDef[key$2]).then(accessor=>(attributes[key$2]=accessor,attributes[key$2])));return pending.length<1?null:(pending.push(this.parser.createNodeMesh(nodeIndex)),Promise.all(pending).then(results=>{let nodeObject=results.pop(),meshes=nodeObject.isGroup?nodeObject.children:[nodeObject],count$1=results[0].count,instancedMeshes=[];for(let mesh of meshes){let m$3=new Matrix4,p$5=new Vector3,q$2=new Quaternion,s$1=new Vector3(1,1,1),instancedMesh=new InstancedMesh(mesh.geometry,mesh.material,count$1);for(let i$1=0;i$10||uri.search(/^data\:image\/jpeg/)===0?`image/jpeg`:uri.search(/\.webp($|\?)/i)>0||uri.search(/^data\:image\/webp/)===0?`image/webp`:uri.search(/\.ktx2($|\?)/i)>0||uri.search(/^data\:image\/ktx2/)===0?`image/ktx2`:`image/png`}const _identityMatrix=new Matrix4;var GLTFParser=class{constructor(json={},options$1={}){this.json=json,this.extensions={},this.plugins={},this.options=options$1,this.cache=new GLTFRegistry,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let isSafari=!1,safariVersion=-1,isFirefox=!1,firefoxVersion=-1;if(typeof navigator<`u`){let userAgent=navigator.userAgent;isSafari=/^((?!chrome|android).)*safari/i.test(userAgent)===!0;let safariMatch=userAgent.match(/Version\/(\d+)/);safariVersion=isSafari&&safariMatch?parseInt(safariMatch[1],10):-1,isFirefox=userAgent.indexOf(`Firefox`)>-1,firefoxVersion=isFirefox?userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>`u`||isSafari&&safariVersion<17||isFirefox&&firefoxVersion<98?this.textureLoader=new TextureLoader(this.options.manager):this.textureLoader=new ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new FileLoader(this.options.manager),this.fileLoader.setResponseType(`arraybuffer`),this.options.crossOrigin===`use-credentials`&&this.fileLoader.setWithCredentials(!0)}setExtensions(extensions){this.extensions=extensions}setPlugins(plugins){this.plugins=plugins}parse(onLoad,onError){let parser=this,json=this.json,extensions=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(ext){return ext._markDefs&&ext._markDefs()}),Promise.all(this._invokeAll(function(ext){return ext.beforeRoot&&ext.beforeRoot()})).then(function(){return Promise.all([parser.getDependencies(`scene`),parser.getDependencies(`animation`),parser.getDependencies(`camera`)])}).then(function(dependencies){let result={scene:dependencies[0][json.scene||0],scenes:dependencies[0],animations:dependencies[1],cameras:dependencies[2],asset:json.asset,parser,userData:{}};return addUnknownExtensionsToUserData(extensions,result,json),assignExtrasToUserData(result,json),Promise.all(parser._invokeAll(function(ext){return ext.afterRoot&&ext.afterRoot(result)})).then(function(){for(let scene of result.scenes)scene.updateMatrixWorld();onLoad(result)})}).catch(onError)}_markDefs(){let nodeDefs=this.json.nodes||[],skinDefs=this.json.skins||[],meshDefs=this.json.meshes||[];for(let skinIndex=0,skinLength=skinDefs.length;skinIndex{let mappings=this.associations.get(original);mappings!=null&&this.associations.set(clone$2,mappings);for(let[i$1,child]of original.children.entries())updateMappings(child,clone$2.children[i$1])};return updateMappings(object,ref$1),ref$1.name+=`_instance_`+ cache$1.uses[index$1]++,ref$1}_invokeOne(func){let extensions=Object.values(this.plugins);extensions.push(this);for(let i$1=0;i$1=2&&bufferAttribute.setY(index$1,sparseValues[i$1*itemSize+1]),itemSize>=3&&bufferAttribute.setZ(index$1,sparseValues[i$1*itemSize+2]),itemSize>=4&&bufferAttribute.setW(index$1,sparseValues[i$1*itemSize+3]),itemSize>=5)throw Error(`THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.`)}bufferAttribute.normalized=normalized}return bufferAttribute})}loadTexture(textureIndex){let json=this.json,options$1=this.options,textureDef=json.textures[textureIndex],sourceIndex=textureDef.source,sourceDef=json.images[sourceIndex],loader$1=this.textureLoader;if(sourceDef.uri){let handler=options$1.manager.getHandler(sourceDef.uri);handler!==null&&(loader$1=handler)}return this.loadTextureImage(textureIndex,sourceIndex,loader$1)}loadTextureImage(textureIndex,sourceIndex,loader$1){let parser=this,json=this.json,textureDef=json.textures[textureIndex],sourceDef=json.images[sourceIndex],cacheKey=(sourceDef.uri||sourceDef.bufferView)+`:`+textureDef.sampler;if(this.textureCache[cacheKey])return this.textureCache[cacheKey];let promise=this.loadImageSource(sourceIndex,loader$1).then(function(texture){texture.flipY=!1,texture.name=textureDef.name||sourceDef.name||``,texture.name===``&&typeof sourceDef.uri==`string`&&sourceDef.uri.startsWith(`data:image/`)===!1&&(texture.name=sourceDef.uri);let samplers=json.samplers||{},sampler=samplers[textureDef.sampler]||{};return texture.magFilter=WEBGL_FILTERS[sampler.magFilter]||LinearFilter,texture.minFilter=WEBGL_FILTERS[sampler.minFilter]||LinearMipmapLinearFilter,texture.wrapS=WEBGL_WRAPPINGS[sampler.wrapS]||RepeatWrapping,texture.wrapT=WEBGL_WRAPPINGS[sampler.wrapT]||RepeatWrapping,texture.generateMipmaps=!texture.isCompressedTexture&&texture.minFilter!==NearestFilter&&texture.minFilter!==LinearFilter,parser.associations.set(texture,{textures:textureIndex}),texture}).catch(function(){return null});return this.textureCache[cacheKey]=promise,promise}loadImageSource(sourceIndex,loader$1){let parser=this,json=this.json,options$1=this.options;if(this.sourceCache[sourceIndex]!==void 0)return this.sourceCache[sourceIndex].then(texture=>texture.clone());let sourceDef=json.images[sourceIndex],URL$1=self.URL||self.webkitURL,sourceURI=sourceDef.uri||``,isObjectURL=!1;if(sourceDef.bufferView!==void 0)sourceURI=parser.getDependency(`bufferView`,sourceDef.bufferView).then(function(bufferView){isObjectURL=!0;let blob=new Blob([bufferView],{type:sourceDef.mimeType});return sourceURI=URL$1.createObjectURL(blob),sourceURI});else if(sourceDef.uri===void 0)throw Error(`THREE.GLTFLoader: Image `+sourceIndex+` is missing URI and bufferView`);let promise=Promise.resolve(sourceURI).then(function(sourceURI$1){return new Promise(function(resolve$1,reject){let onLoad=resolve$1;loader$1.isImageBitmapLoader===!0&&(onLoad=function(imageBitmap){let texture=new Texture(imageBitmap);texture.needsUpdate=!0,resolve$1(texture)}),loader$1.load(LoaderUtils.resolveURL(sourceURI$1,options$1.path),onLoad,void 0,reject)})}).then(function(texture){return isObjectURL===!0&&URL$1.revokeObjectURL(sourceURI),assignExtrasToUserData(texture,sourceDef),texture.userData.mimeType=sourceDef.mimeType||getImageURIMimeType(sourceDef.uri),texture}).catch(function(error){throw console.error(`THREE.GLTFLoader: Couldn't load texture`,sourceURI),error});return this.sourceCache[sourceIndex]=promise,promise}assignTexture(materialParams,mapName,mapDef,colorSpace){let parser=this;return this.getDependency(`texture`,mapDef.index).then(function(texture){if(!texture)return null;if(mapDef.texCoord!==void 0&&mapDef.texCoord>0&&(texture=texture.clone(),texture.channel=mapDef.texCoord),parser.extensions[EXTENSIONS.KHR_TEXTURE_TRANSFORM]){let transform$1=mapDef.extensions===void 0?void 0:mapDef.extensions[EXTENSIONS.KHR_TEXTURE_TRANSFORM];if(transform$1){let gltfReference=parser.associations.get(texture);texture=parser.extensions[EXTENSIONS.KHR_TEXTURE_TRANSFORM].extendTexture(texture,transform$1),parser.associations.set(texture,gltfReference)}}return colorSpace!==void 0&&(texture.colorSpace=colorSpace),materialParams[mapName]=texture,texture})}assignFinalMaterial(mesh){let geometry=mesh.geometry,material=mesh.material,useDerivativeTangents=geometry.attributes.tangent===void 0,useVertexColors=geometry.attributes.color!==void 0,useFlatShading=geometry.attributes.normal===void 0;if(mesh.isPoints){let cacheKey=`PointsMaterial:`+material.uuid,pointsMaterial=this.cache.get(cacheKey);pointsMaterial||(pointsMaterial=new PointsMaterial,Material.prototype.copy.call(pointsMaterial,material),pointsMaterial.color.copy(material.color),pointsMaterial.map=material.map,pointsMaterial.sizeAttenuation=!1,this.cache.add(cacheKey,pointsMaterial)),material=pointsMaterial}else if(mesh.isLine){let cacheKey=`LineBasicMaterial:`+material.uuid,lineMaterial=this.cache.get(cacheKey);lineMaterial||(lineMaterial=new LineBasicMaterial,Material.prototype.copy.call(lineMaterial,material),lineMaterial.color.copy(material.color),lineMaterial.map=material.map,this.cache.add(cacheKey,lineMaterial)),material=lineMaterial}if(useDerivativeTangents||useVertexColors||useFlatShading){let cacheKey=`ClonedMaterial:`+material.uuid+`:`;useDerivativeTangents&&(cacheKey+=`derivative-tangents:`),useVertexColors&&(cacheKey+=`vertex-colors:`),useFlatShading&&(cacheKey+=`flat-shading:`);let cachedMaterial=this.cache.get(cacheKey);cachedMaterial||(cachedMaterial=material.clone(),useVertexColors&&(cachedMaterial.vertexColors=!0),useFlatShading&&(cachedMaterial.flatShading=!0),useDerivativeTangents&&(cachedMaterial.normalScale&&(cachedMaterial.normalScale.y*=-1),cachedMaterial.clearcoatNormalScale&&(cachedMaterial.clearcoatNormalScale.y*=-1)),this.cache.add(cacheKey,cachedMaterial),this.associations.set(cachedMaterial,this.associations.get(material))),material=cachedMaterial}mesh.material=material}getMaterialType(){return MeshStandardMaterial}loadMaterial(materialIndex){let parser=this,json=this.json,extensions=this.extensions,materialDef=json.materials[materialIndex],materialType,materialParams={},materialExtensions=materialDef.extensions||{},pending=[];if(materialExtensions[EXTENSIONS.KHR_MATERIALS_UNLIT]){let kmuExtension=extensions[EXTENSIONS.KHR_MATERIALS_UNLIT];materialType=kmuExtension.getMaterialType(),pending.push(kmuExtension.extendParams(materialParams,materialDef,parser))}else{let metallicRoughness=materialDef.pbrMetallicRoughness||{};if(materialParams.color=new Color(1,1,1),materialParams.opacity=1,Array.isArray(metallicRoughness.baseColorFactor)){let array=metallicRoughness.baseColorFactor;materialParams.color.setRGB(array[0],array[1],array[2],LinearSRGBColorSpace),materialParams.opacity=array[3]}metallicRoughness.baseColorTexture!==void 0&&pending.push(parser.assignTexture(materialParams,`map`,metallicRoughness.baseColorTexture,SRGBColorSpace)),materialParams.metalness=metallicRoughness.metallicFactor===void 0?1:metallicRoughness.metallicFactor,materialParams.roughness=metallicRoughness.roughnessFactor===void 0?1:metallicRoughness.roughnessFactor,metallicRoughness.metallicRoughnessTexture!==void 0&&(pending.push(parser.assignTexture(materialParams,`metalnessMap`,metallicRoughness.metallicRoughnessTexture)),pending.push(parser.assignTexture(materialParams,`roughnessMap`,metallicRoughness.metallicRoughnessTexture))),materialType=this._invokeOne(function(ext){return ext.getMaterialType&&ext.getMaterialType(materialIndex)}),pending.push(Promise.all(this._invokeAll(function(ext){return ext.extendMaterialParams&&ext.extendMaterialParams(materialIndex,materialParams)})))}materialDef.doubleSided===!0&&(materialParams.side=DoubleSide);let alphaMode=materialDef.alphaMode||ALPHA_MODES.OPAQUE;if(alphaMode===ALPHA_MODES.BLEND?(materialParams.transparent=!0,materialParams.depthWrite=!1):(materialParams.transparent=!1,alphaMode===ALPHA_MODES.MASK&&(materialParams.alphaTest=materialDef.alphaCutoff===void 0?.5:materialDef.alphaCutoff)),materialDef.normalTexture!==void 0&&materialType!==MeshBasicMaterial&&(pending.push(parser.assignTexture(materialParams,`normalMap`,materialDef.normalTexture)),materialParams.normalScale=new Vector2(1,1),materialDef.normalTexture.scale!==void 0)){let scale$1=materialDef.normalTexture.scale;materialParams.normalScale.set(scale$1,scale$1)}if(materialDef.occlusionTexture!==void 0&&materialType!==MeshBasicMaterial&&(pending.push(parser.assignTexture(materialParams,`aoMap`,materialDef.occlusionTexture)),materialDef.occlusionTexture.strength!==void 0&&(materialParams.aoMapIntensity=materialDef.occlusionTexture.strength)),materialDef.emissiveFactor!==void 0&&materialType!==MeshBasicMaterial){let emissiveFactor=materialDef.emissiveFactor;materialParams.emissive=new Color().setRGB(emissiveFactor[0],emissiveFactor[1],emissiveFactor[2],LinearSRGBColorSpace)}return materialDef.emissiveTexture!==void 0&&materialType!==MeshBasicMaterial&&pending.push(parser.assignTexture(materialParams,`emissiveMap`,materialDef.emissiveTexture,SRGBColorSpace)),Promise.all(pending).then(function(){let material=new materialType(materialParams);return materialDef.name&&(material.name=materialDef.name),assignExtrasToUserData(material,materialDef),parser.associations.set(material,{materials:materialIndex}),materialDef.extensions&&addUnknownExtensionsToUserData(extensions,material,materialDef),material})}createUniqueName(originalName){let sanitizedName=PropertyBinding.sanitizeNodeName(originalName||``);return sanitizedName in this.nodeNamesUsed?sanitizedName+`_`+ ++this.nodeNamesUsed[sanitizedName]:(this.nodeNamesUsed[sanitizedName]=0,sanitizedName)}loadGeometries(primitives){let parser=this,extensions=this.extensions,cache$1=this.primitiveCache;function createDracoPrimitive(primitive){return extensions[EXTENSIONS.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(primitive,parser).then(function(geometry){return addPrimitiveAttributes(geometry,primitive,parser)})}let pending=[];for(let i$1=0,il$1=primitives.length;i$10&&updateMorphTargets(mesh,meshDef),mesh.name=parser.createUniqueName(meshDef.name||`mesh_`+meshIndex),assignExtrasToUserData(mesh,meshDef),primitive.extensions&&addUnknownExtensionsToUserData(extensions,mesh,primitive),parser.assignFinalMaterial(mesh),meshes.push(mesh)}for(let i$1=0,il$1=meshes.length;i$11?new Group:objects.length===1?objects[0]:new Object3D,node$1!==objects[0])for(let i$1=0,il$1=objects.length;i$11){let mapping=parser.associations.get(node$1);parser.associations.set(node$1,{...mapping})}return parser.associations.get(node$1).nodes=nodeIndex,node$1}),this.nodeCache[nodeIndex]}loadScene(sceneIndex){let extensions=this.extensions,sceneDef=this.json.scenes[sceneIndex],parser=this,scene=new Group;sceneDef.name&&(scene.name=parser.createUniqueName(sceneDef.name)),assignExtrasToUserData(scene,sceneDef),sceneDef.extensions&&addUnknownExtensionsToUserData(extensions,scene,sceneDef);let nodeIds=sceneDef.nodes||[],pending=[];for(let i$1=0,il$1=nodeIds.length;i$1{let reducedAssociations=new Map;for(let[key$2,value$1]of parser.associations)(key$2 instanceof Material||key$2 instanceof Texture)&&reducedAssociations.set(key$2,value$1);return node$1.traverse(node$2=>{let mappings=parser.associations.get(node$2);mappings!=null&&reducedAssociations.set(node$2,mappings)}),reducedAssociations};return parser.associations=reduceAssociations(scene),scene})}_createAnimationTracks(node$1,inputAccessor,outputAccessor,sampler,target$1){let tracks=[],targetName=node$1.name?node$1.name:node$1.uuid,targetNames=[];PATH_PROPERTIES[target$1.path]===PATH_PROPERTIES.weights?node$1.traverse(function(object){object.morphTargetInfluences&&targetNames.push(object.name?object.name:object.uuid)}):targetNames.push(targetName);let TypedKeyframeTrack;switch(PATH_PROPERTIES[target$1.path]){case PATH_PROPERTIES.weights:TypedKeyframeTrack=NumberKeyframeTrack;break;case PATH_PROPERTIES.rotation:TypedKeyframeTrack=QuaternionKeyframeTrack;break;case PATH_PROPERTIES.translation:case PATH_PROPERTIES.scale:TypedKeyframeTrack=VectorKeyframeTrack;break;default:switch(outputAccessor.itemSize){case 1:TypedKeyframeTrack=NumberKeyframeTrack;break;case 2:case 3:default:TypedKeyframeTrack=VectorKeyframeTrack;break}break}let interpolation=sampler.interpolation===void 0?InterpolateLinear:INTERPOLATION[sampler.interpolation],outputArray=this._getArrayFromAccessor(outputAccessor);for(let j$1=0,jl$1=targetNames.length;j$1new VRMLoaderPlugin(parser)),loader.register(parser=>new VRMAnimationLoaderPlugin(parser)),loader)}async function loadVRMAnimation(url){let loader$1=useVRMLoader(),gltf=await loader$1.loadAsync(url),userData=gltf.userData;if(!userData.vrmAnimations){console.warn(`No VRM animations found in the .vrma file`);return}if(userData.vrmAnimations.length===0){console.warn(`No VRM animations found in the .vrma file`);return}return userData.vrmAnimations[0]}async function clipFromVRMAnimation(vrm,animation){if(!vrm){console.warn(`No VRM found`);return}if(animation)return createVRMAnimationClip(animation,vrm)}function useBlink(){let isBlinking=ref(!1),blinkProgress=ref(0),timeSinceLastBlink=ref(0),BLINK_DURATION=.2,MIN_BLINK_INTERVAL=1,MAX_BLINK_INTERVAL=6,nextBlinkTime=ref(Math.random()*(MAX_BLINK_INTERVAL-MIN_BLINK_INTERVAL)+MIN_BLINK_INTERVAL);function update(vrm,delta){if(vrm?.expressionManager&&(timeSinceLastBlink.value+=delta,!isBlinking.value&&timeSinceLastBlink.value>=nextBlinkTime.value&&(isBlinking.value=!0,blinkProgress.value=0),isBlinking.value)){blinkProgress.value+=delta/BLINK_DURATION;let blinkValue=Math.sin(Math.PI*blinkProgress.value);vrm.expressionManager.setValue(`blink`,blinkValue),blinkProgress.value>=1&&(isBlinking.value=!1,timeSinceLastBlink.value=0,vrm.expressionManager.setValue(`blink`,0),nextBlinkTime.value=Math.random()*(MAX_BLINK_INTERVAL-MIN_BLINK_INTERVAL)+MIN_BLINK_INTERVAL)}}return{update}}function useIdleEyeSaccades(){let nextSaccadeAfter=-1,fixationTarget,timeSinceLastSaccade=0;function updateFixationTarget(){fixationTarget?fixationTarget.set(randFloat(-.25,.25),randFloat(-.2,.15),-.65):fixationTarget=new Vector3(randFloat(-.25,.25),randFloat(-.2,.15),-.65)}function update(vrm,delta){!vrm?.expressionManager||!vrm.lookAt||(timeSinceLastSaccade>=nextSaccadeAfter?(updateFixationTarget(),timeSinceLastSaccade=0,nextSaccadeAfter=randomSaccadeInterval()/1e3):fixationTarget||updateFixationTarget(),vrm.lookAt.target||(vrm.lookAt.target=new Object3D),vrm.lookAt.target.position.lerp(fixationTarget,randFloat(.2,.5)),vrm.lookAt?.update(delta),timeSinceLastSaccade+=delta)}return{update}}async function loadVrm(model,options$1){let loader$1=useVRMLoader(),gltf=await loader$1.loadAsync(model,progress$1=>options$1?.onProgress?.(progress$1)),userData=gltf.userData;if(!userData.vrm)return;let _vrm=userData.vrm;if(VRMUtils.removeUnnecessaryVertices(_vrm.scene),VRMUtils.combineSkeletons(_vrm.scene),_vrm.scene.traverse(object=>{object.frustumCulled=!1}),options$1?.lookAt&&_vrm.lookAt){let lookAtQuatProxy=new VRMLookAtQuaternionProxy(_vrm.lookAt);lookAtQuatProxy.name=`lookAtQuaternionProxy`,_vrm.scene.add(lookAtQuatProxy)}options$1?.scene&&options$1.scene.add(_vrm.scene);let box=new Box3().setFromObject(_vrm.scene),modelSize=new Vector3,modelCenter=new Vector3;return box.getSize(modelSize),box.getCenter(modelCenter),modelCenter.negate(),modelCenter.y-=modelSize.y/8,options$1?.positionOffset?_vrm.scene.position.set(modelCenter.x+options$1.positionOffset[0],modelCenter.y+options$1.positionOffset[1],modelCenter.z+options$1.positionOffset[2]):_vrm.scene.position.set(modelCenter.x,modelCenter.y,modelCenter.z),{_vrm,modelCenter,modelSize}}function useVRMEmote(vrm){let currentEmotion=ref(null),isTransitioning=ref(!1),transitionProgress=ref(0),currentExpressionValues=ref(new Map),targetExpressionValues=ref(new Map),resetTimeout=ref(),lerp$4=(start,end,t)=>start+(end-start)*t,easeInOutCubic=t=>t<.5?4*t*t*t:1-(-2*t+2)**3/2,emotionStates=new Map([[`happy`,{expression:[{name:`happy`,value:1,duration:.3},{name:`aa`,value:.3}],blendDuration:.3}],[`sad`,{expression:[{name:`sad`,value:1},{name:`oh`,value:.2}],blendDuration:.3}],[`angry`,{expression:[{name:`angry`,value:1},{name:`ee`,value:.4}],blendDuration:.2}],[`surprised`,{expression:[{name:`Surprised`,value:1},{name:`oh`,value:.6}],blendDuration:.1}],[`neutral`,{expression:[{name:`neutral`,value:1}],blendDuration:.5}]]),clearResetTimeout=()=>{resetTimeout.value&&(clearTimeout(resetTimeout.value),resetTimeout.value=void 0)},setEmotion=emotionName=>{if(clearResetTimeout(),!emotionStates.has(emotionName)){console.warn(`Emotion ${emotionName} not found`);return}let emotionState=emotionStates.get(emotionName);if(currentEmotion.value=emotionName,isTransitioning.value=!0,transitionProgress.value=0,vrm.expressionManager){let expressionNames=Object.keys(vrm.expressionManager.expressionMap);for(let name$2 of expressionNames)vrm.expressionManager.setValue(name$2,0)}currentExpressionValues.value.clear(),targetExpressionValues.value.clear();for(let expr of emotionState.expression||[]){let currentValue=vrm.expressionManager?.getValue(expr.name)||0;currentExpressionValues.value.set(expr.name,currentValue),targetExpressionValues.value.set(expr.name,expr.value)}},setEmotionWithResetAfter=(emotionName,ms$1)=>{clearResetTimeout(),setEmotion(emotionName),resetTimeout.value=setTimeout(()=>{setEmotion(`neutral`),resetTimeout.value=void 0},ms$1)},update=deltaTime=>{if(!isTransitioning.value||!currentEmotion.value)return;let emotionState=emotionStates.get(currentEmotion.value),blendDuration=emotionState.blendDuration||.3;transitionProgress.value+=deltaTime/blendDuration,transitionProgress.value>=1&&(transitionProgress.value=1,isTransitioning.value=!1);for(let[exprName,targetValue]of targetExpressionValues.value){let startValue=currentExpressionValues.value.get(exprName)||0,currentValue=lerp$4(startValue,targetValue,easeInOutCubic(transitionProgress.value));vrm.expressionManager?.setValue(exprName,currentValue)}},addEmotionState=(emotionName,state)=>{emotionStates.set(emotionName,state)},removeEmotionState=emotionName=>{emotionStates.delete(emotionName)},dispose$1=()=>{clearResetTimeout()};return{currentEmotion,isTransitioning,setEmotion,setEmotionWithResetAfter,update,addEmotionState,removeEmotionState,dispose:dispose$1}}function useWhisper(url,options$1){let opts=merge$2({onLoading:()=>{},onInitiate:()=>{},onProgress:()=>{},onDone:()=>{},onReady:()=>{},onStart:()=>{},onUpdate:()=>{},onComplete:()=>{}},options$1),{post:whisperPost,data:whisperData,terminate}=useWebWorker(url,{type:`module`}),status=ref(null),loadingMessage=ref(``),loadingProgress=ref([]),transcribing=ref(!1),tps=ref(0),result=ref(``);return watch(whisperData,e$3=>{switch(e$3.status){case`loading`:status.value=`loading`,loadingMessage.value=e$3.data,opts.onLoading?.(e$3.data);break;case`initiate`:loadingProgress.value.push(e$3),opts.onInitiate?.(e$3);break;case`progress`:loadingProgress.value=loadingProgress.value.map(item=>item.file===e$3.file?{...item,...e$3}:item),opts.onProgress?.(e$3);break;case`done`:loadingProgress.value=loadingProgress.value.filter(item=>item.file!==e$3.file),opts.onDone?.(e$3);break;case`ready`:status.value=`ready`,opts.onReady?.();break;case`start`:transcribing.value=!0,opts.onStart?.();break;case`update`:tps.value=e$3.tps,opts.onUpdate?.(e$3.tps);break;case`complete`:transcribing.value=!1,result.value=e$3.output[0]||``,console.debug(`Whisper result:`,result.value),opts.onComplete?.(e$3.output[0]);break}}),onUnmounted(()=>{terminate()}),{transcribe:message$1=>whisperPost(message$1),status,loadingMessage,loadingProgress,transcribing,tps,result,load:()=>whisperPost({type:`load`}),terminate}}var XSAIError$3=class extends Error{response;constructor(message$1,response){super(message$1),this.name=`XSAIError`,this.response=response}};const strCamelToSnake$2=str=>str.replace(/[A-Z]/g,s$1=>`_${s$1.toLowerCase()}`),objCamelToSnake$1=obj=>Object.fromEntries(Object.entries(obj).map(([k$4,v$2])=>[strCamelToSnake$2(k$4),v$2])),clean$2=obj=>Object.fromEntries(Object.entries(obj).filter(([,v$2])=>v$2!==void 0)),requestBody=body$2=>JSON.stringify(objCamelToSnake$1(clean$2({...body$2,abortSignal:void 0,apiKey:void 0,baseURL:void 0,fetch:void 0,headers:void 0}))),requestHeaders=(headers,apiKey)=>clean$2({Authorization:apiKey===void 0?void 0:`Bearer ${apiKey}`,...headers}),requestURL=(path,baseURL)=>{let base=baseURL.toString();return new URL(path,base.endsWith(`/`)?base:`${base}/`)},responseCatch=async res=>{if(!res.ok)throw new XSAIError$3(`Remote sent ${res.status} response: ${await res.text()}`,res);if(!res.body)throw new XSAIError$3(`Response body is empty from remote server`,res);if(!(res.body instanceof ReadableStream))throw new XSAIError$3(`Expected Response body to be a ReadableStream, but got ${String(res.body)}; Content Type is ${res.headers.get(`Content-Type`)}`,res);return res},responseJSON=async res=>responseCatch(res).then(async res2=>{let text$5=await res2.text();try{return JSON.parse(text$5)}catch{throw Error(`Failed to parse response, response body: ${text$5}`)}}),listModels=async options$1=>(options$1.fetch??globalThis.fetch)(requestURL(`models`,options$1.baseURL),{headers:requestHeaders(options$1.headers,options$1.apiKey),signal:options$1.abortSignal}).then(responseJSON).then(({data:data$12})=>data$12);var XSAIError$1=class extends Error{response;constructor(message$1,response){super(message$1),this.name=`XSAIError`,this.response=response}};const chat=async options$1=>(options$1.fetch??globalThis.fetch)(requestURL(`chat/completions`,options$1.baseURL),{body:requestBody({...options$1,tools:options$1.tools?.map(tool$1=>({function:clean$2({...tool$1.function,returns:void 0}),type:`function`}))}),headers:requestHeaders({"Content-Type":`application/json`,...options$1.headers},options$1.apiKey),method:`POST`,signal:options$1.abortSignal}).then(responseCatch),determineStepType=({finishReason,maxSteps,stepsLength,toolCallsLength})=>{if(stepsLength===0)return`initial`;if(stepsLength0&&finishReason===`tool_calls`)return`tool-result`;if(![`error`,`length`].includes(finishReason))return`continue`}return`done`},wrapToolResult=result=>typeof result==`string`||Array.isArray(result)&&result.every(item=>!!(typeof item==`object`&&`type`in item&&[`audio`,`image`,`text`].includes(item.type)))?result:JSON.stringify(result),executeTool=async({abortSignal,messages,toolCall,tools:tools$2})=>{let tool$1=tools$2?.find(tool2=>tool2.function.name===toolCall.function.name);if(!tool$1){let availableTools=tools$2?.map(tool2=>tool2.function.name),availableToolsErrorMsg=availableTools==null||availableTools.length===0?`No tools are available`:`Available tools: ${availableTools.join(`, `)}`;throw Error(`Model tried to call unavailable tool "${toolCall.function.name}", ${availableToolsErrorMsg}.`)}let toolCallId=toolCall.id,toolName=toolCall.function.name,parsedArgs=JSON.parse(toolCall.function.arguments),result=wrapToolResult(await tool$1.execute(parsedArgs,{abortSignal,messages,toolCallId})),completionToolCall={args:toolCall.function.arguments,toolCallId,toolCallType:toolCall.type,toolName},completionToolResult={args:parsedArgs,result,toolCallId,toolName},message$1={content:result,role:`tool`,tool_call_id:toolCallId};return{completionToolCall,completionToolResult,message:message$1,parsedArgs,result,toolName}},strCamelToSnake$1=str=>str.replace(/[A-Z]/g,s$1=>`_${s$1.toLowerCase()}`),objCamelToSnake$2=obj=>Object.fromEntries(Object.entries(obj).map(([k$4,v$2])=>[strCamelToSnake$1(k$4),v$2]));var XSAIError$2=class extends Error{response;constructor(message$1,response){super(message$1),this.name=`XSAIError`,this.response=response}};const CHUNK_HEADER_PREFIX=`data:`,parseChunk=text$5=>{if(!text$5||!text$5.startsWith(CHUNK_HEADER_PREFIX))return[void 0,!1];let content$2=text$5.slice(5),data$12=content$2.startsWith(` `)?content$2.slice(1):content$2;if(data$12===`[DONE]`)return[void 0,!0];if(data$12.startsWith(`{`)&&data$12.includes(`"error":`))throw Error(`Error from server: ${data$12}`);let chunk=JSON.parse(data$12);return[chunk,!1]},streamText=async options$1=>{let chunkCtrl,stepCtrl,textCtrl,chunkStream=new ReadableStream({start:controller=>chunkCtrl=controller}),stepStream=new ReadableStream({start:controller=>stepCtrl=controller}),textStream=new ReadableStream({start:controller=>textCtrl=controller}),maxSteps=options$1.maxSteps??1,decoder=new TextDecoder,steps$2=[],stepOne=async options2=>{let step={choices:[],finishReason:`error`,messages:structuredClone(options2.messages),stepType:`initial`,toolCalls:[],toolResults:[]},choiceState={},buffer$1=``,finishReason,usage,shouldOutputText=!0,endToolCallByIndex=(state,idx)=>{state.endedToolCallIndex.has(idx)||(state.endedToolCallIndex.add(idx),state.currentToolIndex=null)};if(await chat({...options2,maxSteps:void 0,stream:!0,streamOptions:options2.streamOptions==null?void 0:objCamelToSnake$2(options2.streamOptions)}).then(async res=>res.body.pipeThrough(new TransformStream({transform:async(chunk,controller)=>{let text$5=decoder.decode(chunk,{stream:!0});buffer$1+=text$5;let lines=buffer$1.split(` -`);buffer$1=lines.pop()??``;for(let line of lines)try{let[chunk2,isEnd]=parseChunk(line);if(isEnd)break;chunk2&&controller.enqueue(chunk2)}catch(error){controller.error(error)}}})).pipeTo(new WritableStream({abort:reason=>{chunkCtrl.error(reason),stepCtrl.error(reason),textCtrl.error(reason)},close:()=>{options2.onEvent?.({finishReason,type:`finish`,usage})},write:async chunk=>{if(options2.onChunk?.(chunk),chunkCtrl.enqueue(chunk),usage=chunk.usage,chunk.choices==null||chunk.choices.length===0)return;let choice=chunk.choices[0];choice.delta.tool_calls&&(shouldOutputText=!1);let{delta,finish_reason,index:index$1,...rest}=choice,choiceSnapshot=step.choices[index$1]??={finishReason:finish_reason,index:index$1,message:{role:`assistant`}};if(finish_reason!==void 0){if(finishReason=finish_reason,step.finishReason=finish_reason,choiceSnapshot.finishReason=finish_reason,finish_reason===`length`)throw new XSAIError$2(`length exceeded`);if(finish_reason===`content_filter`)throw new XSAIError$2(`content filter`)}Object.assign(choiceSnapshot,rest);let{content:content$2,refusal,tool_calls,...rests}=delta,message$1=choiceSnapshot.message;Object.assign(message$1,rests),refusal!==void 0&&(message$1.refusal=(message$1.refusal||``)+(refusal||``),options2.onEvent?.({refusal:message$1.refusal,type:`refusal`})),content$2!==void 0&&(message$1.content=(message$1.content||``)+(content$2||``),shouldOutputText&&textCtrl?.enqueue(content$2),options2.onEvent?.({text:content$2,type:`text-delta`}));for(let tool_call of tool_calls||[]){options2.onEvent?.({toolCall:tool_call,type:`tool-call-delta`});let{function:fn$6,id:id$1,index:index2,type}=tool_call;message$1.toolCalls??={};let toolCall=message$1.toolCalls[index2]??={function:{arguments:``,name:fn$6.name,parsedArguments:{}},id:id$1,index:index2,type};toolCall.function.arguments+=fn$6.arguments}let state=choiceState[index$1]??={calledToolCallIndex:new Set,currentToolIndex:null,endedToolCallIndex:new Set,index:index$1,toolCallErrors:{},toolCallResults:{}};finish_reason&&state.currentToolIndex!==null&&endToolCallByIndex(state,state.currentToolIndex);for(let toolCall of delta.tool_calls||[])state.currentToolIndex!==toolCall.index&&state.currentToolIndex!==null&&endToolCallByIndex(state,state.currentToolIndex),state.calledToolCallIndex.add(toolCall.index),state.currentToolIndex=toolCall.index}}))),step.messages.push({content:step.choices[0]?.message.content??``,refusal:step.choices[0]?.message.refusal,role:`assistant`,tool_calls:Object.values(step.choices[0]?.message.toolCalls??{}).map(toolCall=>({function:{arguments:toolCall.function.arguments,name:toolCall.function.name},id:toolCall.id,index:toolCall.index,type:toolCall.type}))}),await Promise.allSettled(step.choices.map(async choice=>{let state=choiceState[choice.index];return Promise.allSettled([...state.endedToolCallIndex].map(async idx=>{let toolCall=choice.message.toolCalls[idx];if(step.toolCalls.push({args:toolCall.function.arguments,toolCallId:toolCall.id,toolCallType:`function`,toolName:toolCall.function.name}),!state.toolCallResults[toolCall.id]){options2.onEvent?.({toolCall,type:`tool-call`});try{let{completionToolResult,message:message$1,parsedArgs,result}=await executeTool({abortSignal:options2.abortSignal,messages:options2.messages,toolCall,tools:options2.tools});toolCall.function.parsedArguments=parsedArgs,state.toolCallResults[toolCall.id]=result,step.messages.push(message$1),step.toolResults.push(completionToolResult),options2.onEvent?.({id:toolCall.id,result,type:`tool-call-result`})}catch(error){state.toolCallErrors[idx]=error}}}))})),step.stepType=determineStepType({finishReason:step.finishReason,maxSteps,stepsLength:steps$2.length,toolCallsLength:step.toolCalls.length}),steps$2.push(step),stepCtrl.enqueue(step),options2.onStepFinish?.(step),!shouldOutputText)return async()=>stepOne({...options2,messages:step.messages})},invokeFunctionCalls=async()=>{let ret=await stepOne(options$1);for(;typeof ret==`function`&&steps$2.length{chunkCtrl.error(error),stepCtrl.error(error),textCtrl.error(error)}),Promise.resolve({chunkStream,stepStream,textStream})},strictJsonSchema=schema=>({...schema,additionalProperties:!1}),missingDependenciesUrl=`https://xsai.js.org/docs/packages-top/xsschema#missing-dependencies`,tryImport=async(result,name$2)=>{try{return await result}catch{throw Error(`xsschema: Missing dependencies "${name$2}". see ${missingDependenciesUrl}`)}},getToJsonSchemaFn=async vendor=>{switch(vendor){case`arktype`:return __vitePreload(()=>import(`./arktype-C-GObzDh-DWDEUAMn.js`),[]).then(async({getToJsonSchemaFn:getToJsonSchemaFn2})=>getToJsonSchemaFn2());case`effect`:return __vitePreload(()=>import(`./effect-DBSVVF8G-CQ9lBH7Y.js`),[]).then(async({getToJsonSchemaFn:getToJsonSchemaFn2})=>getToJsonSchemaFn2());case`sury`:return __vitePreload(()=>import(`./sury-GtnkadyM-_VCptIFV.js`),[]).then(async({getToJsonSchemaFn:getToJsonSchemaFn2})=>getToJsonSchemaFn2());case`valibot`:return __vitePreload(()=>import(`./valibot-CbgwcZn_-C2Mxz5DO.js`),[]).then(async({getToJsonSchemaFn:getToJsonSchemaFn2})=>getToJsonSchemaFn2());case`zod`:return __vitePreload(()=>import(`./zod-CD8IEU5z-Csep__xj.js`),[]).then(async({getToJsonSchemaFn:getToJsonSchemaFn2})=>getToJsonSchemaFn2());default:throw Error(`xsschema: Unsupported schema vendor "${vendor}". see https://xsai.js.org/docs/packages-top/xsschema#unsupported-schema-vendor`)}},toJsonSchema=async schema=>getToJsonSchemaFn(schema[`~standard`].vendor).then(async toJsonSchema2=>toJsonSchema2(schema)),tool=async({description,execute,name:name$2,parameters})=>{let schema=await toJsonSchema(parameters);return{execute,function:{description,name:name$2,parameters:strictJsonSchema(schema),strict:!0},type:`function`}};var util;(function(util$1){util$1.assertEqual=_$2=>{};function assertIs(_arg){}util$1.assertIs=assertIs;function assertNever(_x$1){throw Error()}util$1.assertNever=assertNever,util$1.arrayToEnum=items=>{let obj={};for(let item of items)obj[item]=item;return obj},util$1.getValidEnumValues=obj=>{let validKeys=util$1.objectKeys(obj).filter(k$4=>typeof obj[obj[k$4]]!=`number`),filtered={};for(let k$4 of validKeys)filtered[k$4]=obj[k$4];return util$1.objectValues(filtered)},util$1.objectValues=obj=>util$1.objectKeys(obj).map(function(e$3){return obj[e$3]}),util$1.objectKeys=typeof Object.keys==`function`?obj=>Object.keys(obj):object=>{let keys$3=[];for(let key$2 in object)Object.prototype.hasOwnProperty.call(object,key$2)&&keys$3.push(key$2);return keys$3},util$1.find=(arr,checker)=>{for(let item of arr)if(checker(item))return item},util$1.isInteger=typeof Number.isInteger==`function`?val=>Number.isInteger(val):val=>typeof val==`number`&&Number.isFinite(val)&&Math.floor(val)===val;function joinValues(array,separator=` | `){return array.map(val=>typeof val==`string`?`'${val}'`:val).join(separator)}util$1.joinValues=joinValues,util$1.jsonStringifyReplacer=(_$2,value$1)=>typeof value$1==`bigint`?value$1.toString():value$1})(util||={});var objectUtil;(function(objectUtil$1){objectUtil$1.mergeShapes=(first,second)=>({...first,...second})})(objectUtil||={});const ZodParsedType=util.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),getParsedType=data$12=>{let t=typeof data$12;switch(t){case`undefined`:return ZodParsedType.undefined;case`string`:return ZodParsedType.string;case`number`:return Number.isNaN(data$12)?ZodParsedType.nan:ZodParsedType.number;case`boolean`:return ZodParsedType.boolean;case`function`:return ZodParsedType.function;case`bigint`:return ZodParsedType.bigint;case`symbol`:return ZodParsedType.symbol;case`object`:return Array.isArray(data$12)?ZodParsedType.array:data$12===null?ZodParsedType.null:data$12.then&&typeof data$12.then==`function`&&data$12.catch&&typeof data$12.catch==`function`?ZodParsedType.promise:typeof Map<`u`&&data$12 instanceof Map?ZodParsedType.map:typeof Set<`u`&&data$12 instanceof Set?ZodParsedType.set:typeof Date<`u`&&data$12 instanceof Date?ZodParsedType.date:ZodParsedType.object;default:return ZodParsedType.unknown}},ZodIssueCode=util.arrayToEnum([`invalid_type`,`invalid_literal`,`custom`,`invalid_union`,`invalid_union_discriminator`,`invalid_enum_value`,`unrecognized_keys`,`invalid_arguments`,`invalid_return_type`,`invalid_date`,`invalid_string`,`too_small`,`too_big`,`invalid_intersection_types`,`not_multiple_of`,`not_finite`]);var ZodError=class ZodError extends Error{get errors(){return this.issues}constructor(issues){super(),this.issues=[],this.addIssue=sub=>{this.issues=[...this.issues,sub]},this.addIssues=(subs=[])=>{this.issues=[...this.issues,...subs]};let actualProto=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,actualProto):this.__proto__=actualProto,this.name=`ZodError`,this.issues=issues}format(_mapper){let mapper=_mapper||function(issue){return issue.message},fieldErrors={_errors:[]},processError=error=>{for(let issue of error.issues)if(issue.code===`invalid_union`)issue.unionErrors.map(processError);else if(issue.code===`invalid_return_type`)processError(issue.returnTypeError);else if(issue.code===`invalid_arguments`)processError(issue.argumentsError);else if(issue.path.length===0)fieldErrors._errors.push(mapper(issue));else{let curr=fieldErrors,i$1=0;for(;i$1issue.message){let fieldErrors={},formErrors=[];for(let sub of this.issues)if(sub.path.length>0){let firstEl=sub.path[0];fieldErrors[firstEl]=fieldErrors[firstEl]||[],fieldErrors[firstEl].push(mapper(sub))}else formErrors.push(mapper(sub));return{formErrors,fieldErrors}}get formErrors(){return this.flatten()}};ZodError.create=issues=>{let error=new ZodError(issues);return error};const errorMap=(issue,_ctx)=>{let message$1;switch(issue.code){case ZodIssueCode.invalid_type:message$1=issue.received===ZodParsedType.undefined?`Required`:`Expected ${issue.expected}, received ${issue.received}`;break;case ZodIssueCode.invalid_literal:message$1=`Invalid literal value, expected ${JSON.stringify(issue.expected,util.jsonStringifyReplacer)}`;break;case ZodIssueCode.unrecognized_keys:message$1=`Unrecognized key(s) in object: ${util.joinValues(issue.keys,`, `)}`;break;case ZodIssueCode.invalid_union:message$1=`Invalid input`;break;case ZodIssueCode.invalid_union_discriminator:message$1=`Invalid discriminator value. Expected ${util.joinValues(issue.options)}`;break;case ZodIssueCode.invalid_enum_value:message$1=`Invalid enum value. Expected ${util.joinValues(issue.options)}, received '${issue.received}'`;break;case ZodIssueCode.invalid_arguments:message$1=`Invalid function arguments`;break;case ZodIssueCode.invalid_return_type:message$1=`Invalid function return type`;break;case ZodIssueCode.invalid_date:message$1=`Invalid date`;break;case ZodIssueCode.invalid_string:typeof issue.validation==`object`?`includes`in issue.validation?(message$1=`Invalid input: must include "${issue.validation.includes}"`,typeof issue.validation.position==`number`&&(message$1=`${message$1} at one or more positions greater than or equal to ${issue.validation.position}`)):`startsWith`in issue.validation?message$1=`Invalid input: must start with "${issue.validation.startsWith}"`:`endsWith`in issue.validation?message$1=`Invalid input: must end with "${issue.validation.endsWith}"`:util.assertNever(issue.validation):message$1=issue.validation===`regex`?`Invalid`:`Invalid ${issue.validation}`;break;case ZodIssueCode.too_small:message$1=issue.type===`array`?`Array must contain ${issue.exact?`exactly`:issue.inclusive?`at least`:`more than`} ${issue.minimum} element(s)`:issue.type===`string`?`String must contain ${issue.exact?`exactly`:issue.inclusive?`at least`:`over`} ${issue.minimum} character(s)`:issue.type===`number`||issue.type===`bigint`?`Number must be ${issue.exact?`exactly equal to `:issue.inclusive?`greater than or equal to `:`greater than `}${issue.minimum}`:issue.type===`date`?`Date must be ${issue.exact?`exactly equal to `:issue.inclusive?`greater than or equal to `:`greater than `}${new Date(Number(issue.minimum))}`:`Invalid input`;break;case ZodIssueCode.too_big:message$1=issue.type===`array`?`Array must contain ${issue.exact?`exactly`:issue.inclusive?`at most`:`less than`} ${issue.maximum} element(s)`:issue.type===`string`?`String must contain ${issue.exact?`exactly`:issue.inclusive?`at most`:`under`} ${issue.maximum} character(s)`:issue.type===`number`?`Number must be ${issue.exact?`exactly`:issue.inclusive?`less than or equal to`:`less than`} ${issue.maximum}`:issue.type===`bigint`?`BigInt must be ${issue.exact?`exactly`:issue.inclusive?`less than or equal to`:`less than`} ${issue.maximum}`:issue.type===`date`?`Date must be ${issue.exact?`exactly`:issue.inclusive?`smaller than or equal to`:`smaller than`} ${new Date(Number(issue.maximum))}`:`Invalid input`;break;case ZodIssueCode.custom:message$1=`Invalid input`;break;case ZodIssueCode.invalid_intersection_types:message$1=`Intersection results could not be merged`;break;case ZodIssueCode.not_multiple_of:message$1=`Number must be a multiple of ${issue.multipleOf}`;break;case ZodIssueCode.not_finite:message$1=`Number must be finite`;break;default:message$1=_ctx.defaultError,util.assertNever(issue)}return{message:message$1}};var en_default$1=errorMap;let overrideErrorMap=en_default$1;function getErrorMap(){return overrideErrorMap}const makeIssue=params=>{let{data:data$12,path,errorMaps,issueData}=params,fullPath=[...path,...issueData.path||[]],fullIssue={...issueData,path:fullPath};if(issueData.message!==void 0)return{...issueData,path:fullPath,message:issueData.message};let errorMessage=``,maps=errorMaps.filter(m$3=>!!m$3).slice().reverse();for(let map of maps)errorMessage=map(fullIssue,{data:data$12,defaultError:errorMessage}).message;return{...issueData,path:fullPath,message:errorMessage}};function addIssueToContext(ctx,issueData){let overrideMap=getErrorMap(),issue=makeIssue({issueData,data:ctx.data,path:ctx.path,errorMaps:[ctx.common.contextualErrorMap,ctx.schemaErrorMap,overrideMap,overrideMap===en_default$1?void 0:en_default$1].filter(x$3=>!!x$3)});ctx.common.issues.push(issue)}var ParseStatus=class ParseStatus{constructor(){this.value=`valid`}dirty(){this.value===`valid`&&(this.value=`dirty`)}abort(){this.value!==`aborted`&&(this.value=`aborted`)}static mergeArray(status,results){let arrayValue=[];for(let s$1 of results){if(s$1.status===`aborted`)return INVALID;s$1.status===`dirty`&&status.dirty(),arrayValue.push(s$1.value)}return{status:status.value,value:arrayValue}}static async mergeObjectAsync(status,pairs){let syncPairs=[];for(let pair of pairs){let key$2=await pair.key,value$1=await pair.value;syncPairs.push({key:key$2,value:value$1})}return ParseStatus.mergeObjectSync(status,syncPairs)}static mergeObjectSync(status,pairs){let finalObject={};for(let pair of pairs){let{key:key$2,value:value$1}=pair;if(key$2.status===`aborted`||value$1.status===`aborted`)return INVALID;key$2.status===`dirty`&&status.dirty(),value$1.status===`dirty`&&status.dirty(),key$2.value!==`__proto__`&&(value$1.value!==void 0||pair.alwaysSet)&&(finalObject[key$2.value]=value$1.value)}return{status:status.value,value:finalObject}}};const INVALID=Object.freeze({status:`aborted`}),DIRTY=value$1=>({status:`dirty`,value:value$1}),OK=value$1=>({status:`valid`,value:value$1}),isAborted=x$3=>x$3.status===`aborted`,isDirty=x$3=>x$3.status===`dirty`,isValid=x$3=>x$3.status===`valid`,isAsync=x$3=>typeof Promise<`u`&&x$3 instanceof Promise;var errorUtil;(function(errorUtil$1){errorUtil$1.errToObj=message$1=>typeof message$1==`string`?{message:message$1}:message$1||{},errorUtil$1.toString=message$1=>typeof message$1==`string`?message$1:message$1?.message})(errorUtil||={});var ParseInputLazyPath=class{constructor(parent,value$1,path,key$2){this._cachedPath=[],this.parent=parent,this.data=value$1,this._path=path,this._key=key$2}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};const handleResult=(ctx,result)=>{if(isValid(result))return{success:!0,data:result.value};if(!ctx.common.issues.length)throw Error(`Validation failed but no issues detected.`);return{success:!1,get error(){if(this._error)return this._error;let error=new ZodError(ctx.common.issues);return this._error=error,this._error}}};function processCreateParams(params){if(!params)return{};let{errorMap:errorMap$1,invalid_type_error,required_error,description}=params;if(errorMap$1&&(invalid_type_error||required_error))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(errorMap$1)return{errorMap:errorMap$1,description};let customMap=(iss,ctx)=>{let{message:message$1}=params;return iss.code===`invalid_enum_value`?{message:message$1??ctx.defaultError}:ctx.data===void 0?{message:message$1??required_error??ctx.defaultError}:iss.code===`invalid_type`?{message:message$1??invalid_type_error??ctx.defaultError}:{message:ctx.defaultError}};return{errorMap:customMap,description}}var ZodType=class{get description(){return this._def.description}_getType(input){return getParsedType(input.data)}_getOrReturnCtx(input,ctx){return ctx||{common:input.parent.common,data:input.data,parsedType:getParsedType(input.data),schemaErrorMap:this._def.errorMap,path:input.path,parent:input.parent}}_processInputParams(input){return{status:new ParseStatus,ctx:{common:input.parent.common,data:input.data,parsedType:getParsedType(input.data),schemaErrorMap:this._def.errorMap,path:input.path,parent:input.parent}}}_parseSync(input){let result=this._parse(input);if(isAsync(result))throw Error(`Synchronous parse encountered promise.`);return result}_parseAsync(input){let result=this._parse(input);return Promise.resolve(result)}parse(data$12,params){let result=this.safeParse(data$12,params);if(result.success)return result.data;throw result.error}safeParse(data$12,params){let ctx={common:{issues:[],async:params?.async??!1,contextualErrorMap:params?.errorMap},path:params?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:data$12,parsedType:getParsedType(data$12)},result=this._parseSync({data:data$12,path:ctx.path,parent:ctx});return handleResult(ctx,result)}"~validate"(data$12){let ctx={common:{issues:[],async:!!this[`~standard`].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:data$12,parsedType:getParsedType(data$12)};if(!this[`~standard`].async)try{let result=this._parseSync({data:data$12,path:[],parent:ctx});return isValid(result)?{value:result.value}:{issues:ctx.common.issues}}catch(err){err?.message?.toLowerCase()?.includes(`encountered`)&&(this[`~standard`].async=!0),ctx.common={issues:[],async:!0}}return this._parseAsync({data:data$12,path:[],parent:ctx}).then(result=>isValid(result)?{value:result.value}:{issues:ctx.common.issues})}async parseAsync(data$12,params){let result=await this.safeParseAsync(data$12,params);if(result.success)return result.data;throw result.error}async safeParseAsync(data$12,params){let ctx={common:{issues:[],contextualErrorMap:params?.errorMap,async:!0},path:params?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:data$12,parsedType:getParsedType(data$12)},maybeAsyncResult=this._parse({data:data$12,path:ctx.path,parent:ctx}),result=await(isAsync(maybeAsyncResult)?maybeAsyncResult:Promise.resolve(maybeAsyncResult));return handleResult(ctx,result)}refine(check$1,message$1){let getIssueProperties=val=>typeof message$1==`string`||message$1===void 0?{message:message$1}:typeof message$1==`function`?message$1(val):message$1;return this._refinement((val,ctx)=>{let result=check$1(val),setError=()=>ctx.addIssue({code:ZodIssueCode.custom,...getIssueProperties(val)});return typeof Promise<`u`&&result instanceof Promise?result.then(data$12=>data$12?!0:(setError(),!1)):result?!0:(setError(),!1)})}refinement(check$1,refinementData){return this._refinement((val,ctx)=>check$1(val)?!0:(ctx.addIssue(typeof refinementData==`function`?refinementData(val,ctx):refinementData),!1))}_refinement(refinement){return new ZodEffects({schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:`refinement`,refinement}})}superRefine(refinement){return this._refinement(refinement)}constructor(def$1){this.spa=this.safeParseAsync,this._def=def$1,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this[`~standard`]={version:1,vendor:`zod`,validate:data$12=>this[`~validate`](data$12)}}optional(){return ZodOptional.create(this,this._def)}nullable(){return ZodNullable.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ZodArray.create(this)}promise(){return ZodPromise.create(this,this._def)}or(option$1){return ZodUnion.create([this,option$1],this._def)}and(incoming){return ZodIntersection.create(this,incoming,this._def)}transform(transform$1){return new ZodEffects({...processCreateParams(this._def),schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:`transform`,transform:transform$1}})}default(def$1){let defaultValueFunc=typeof def$1==`function`?def$1:()=>def$1;return new ZodDefault({...processCreateParams(this._def),innerType:this,defaultValue:defaultValueFunc,typeName:ZodFirstPartyTypeKind.ZodDefault})}brand(){return new ZodBranded({typeName:ZodFirstPartyTypeKind.ZodBranded,type:this,...processCreateParams(this._def)})}catch(def$1){let catchValueFunc=typeof def$1==`function`?def$1:()=>def$1;return new ZodCatch({...processCreateParams(this._def),innerType:this,catchValue:catchValueFunc,typeName:ZodFirstPartyTypeKind.ZodCatch})}describe(description){let This=this.constructor;return new This({...this._def,description})}pipe(target$1){return ZodPipeline.create(this,target$1)}readonly(){return ZodReadonly.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};const cuidRegex=/^c[^\s-]{8,}$/i,cuid2Regex=/^[0-9a-z]+$/,ulidRegex=/^[0-9A-HJKMNP-TV-Z]{26}$/i,uuidRegex=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,nanoidRegex=/^[a-z0-9_-]{21}$/i,jwtRegex=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,durationRegex=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,emailRegex=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,_emojiRegex=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;let emojiRegex;const ipv4Regex=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4CidrRegex=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6Regex=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ipv6CidrRegex=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64Regex=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64urlRegex=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,dateRegexSource=`((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`,dateRegex=RegExp(`^${dateRegexSource}$`);function timeRegexSource(args){let secondsRegexSource=`[0-5]\\d`;args.precision?secondsRegexSource=`${secondsRegexSource}\\.\\d{${args.precision}}`:args.precision??(secondsRegexSource=`${secondsRegexSource}(\\.\\d+)?`);let secondsQuantifier=args.precision?`+`:`?`;return`([01]\\d|2[0-3]):[0-5]\\d(:${secondsRegexSource})${secondsQuantifier}`}function timeRegex(args){return RegExp(`^${timeRegexSource(args)}$`)}function datetimeRegex(args){let regex=`${dateRegexSource}T${timeRegexSource(args)}`,opts=[];return opts.push(args.local?`Z?`:`Z`),args.offset&&opts.push(`([+-]\\d{2}:?\\d{2})`),regex=`${regex}(${opts.join(`|`)})`,RegExp(`^${regex}$`)}function isValidIP(ip$1,version$1){return!!((version$1===`v4`||!version$1)&&ipv4Regex.test(ip$1)||(version$1===`v6`||!version$1)&&ipv6Regex.test(ip$1))}function isValidJWT(jwt,alg){if(!jwtRegex.test(jwt))return!1;try{let[header]=jwt.split(`.`);if(!header)return!1;let base64=header.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(header.length+(4-header.length%4)%4,`=`),decoded=JSON.parse(atob(base64));return!(typeof decoded!=`object`||!decoded||`typ`in decoded&&decoded?.typ!==`JWT`||!decoded.alg||alg&&decoded.alg!==alg)}catch{return!1}}function isValidCidr(ip$1,version$1){return!!((version$1===`v4`||!version$1)&&ipv4CidrRegex.test(ip$1)||(version$1===`v6`||!version$1)&&ipv6CidrRegex.test(ip$1))}var ZodString=class ZodString extends ZodType{_parse(input){this._def.coerce&&(input.data=String(input.data));let parsedType=this._getType(input);if(parsedType!==ZodParsedType.string){let ctx$1=this._getOrReturnCtx(input);return addIssueToContext(ctx$1,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.string,received:ctx$1.parsedType}),INVALID}let status=new ParseStatus,ctx;for(let check$1 of this._def.checks)if(check$1.kind===`min`)input.data.lengthcheck$1.value&&(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{code:ZodIssueCode.too_big,maximum:check$1.value,type:`string`,inclusive:!0,exact:!1,message:check$1.message}),status.dirty());else if(check$1.kind===`length`){let tooBig=input.data.length>check$1.value,tooSmall=input.data.lengthregex.test(data$12),{validation,code:ZodIssueCode.invalid_string,...errorUtil.errToObj(message$1)})}_addCheck(check$1){return new ZodString({...this._def,checks:[...this._def.checks,check$1]})}email(message$1){return this._addCheck({kind:`email`,...errorUtil.errToObj(message$1)})}url(message$1){return this._addCheck({kind:`url`,...errorUtil.errToObj(message$1)})}emoji(message$1){return this._addCheck({kind:`emoji`,...errorUtil.errToObj(message$1)})}uuid(message$1){return this._addCheck({kind:`uuid`,...errorUtil.errToObj(message$1)})}nanoid(message$1){return this._addCheck({kind:`nanoid`,...errorUtil.errToObj(message$1)})}cuid(message$1){return this._addCheck({kind:`cuid`,...errorUtil.errToObj(message$1)})}cuid2(message$1){return this._addCheck({kind:`cuid2`,...errorUtil.errToObj(message$1)})}ulid(message$1){return this._addCheck({kind:`ulid`,...errorUtil.errToObj(message$1)})}base64(message$1){return this._addCheck({kind:`base64`,...errorUtil.errToObj(message$1)})}base64url(message$1){return this._addCheck({kind:`base64url`,...errorUtil.errToObj(message$1)})}jwt(options$1){return this._addCheck({kind:`jwt`,...errorUtil.errToObj(options$1)})}ip(options$1){return this._addCheck({kind:`ip`,...errorUtil.errToObj(options$1)})}cidr(options$1){return this._addCheck({kind:`cidr`,...errorUtil.errToObj(options$1)})}datetime(options$1){return typeof options$1==`string`?this._addCheck({kind:`datetime`,precision:null,offset:!1,local:!1,message:options$1}):this._addCheck({kind:`datetime`,precision:options$1?.precision===void 0?null:options$1?.precision,offset:options$1?.offset??!1,local:options$1?.local??!1,...errorUtil.errToObj(options$1?.message)})}date(message$1){return this._addCheck({kind:`date`,message:message$1})}time(options$1){return typeof options$1==`string`?this._addCheck({kind:`time`,precision:null,message:options$1}):this._addCheck({kind:`time`,precision:options$1?.precision===void 0?null:options$1?.precision,...errorUtil.errToObj(options$1?.message)})}duration(message$1){return this._addCheck({kind:`duration`,...errorUtil.errToObj(message$1)})}regex(regex,message$1){return this._addCheck({kind:`regex`,regex,...errorUtil.errToObj(message$1)})}includes(value$1,options$1){return this._addCheck({kind:`includes`,value:value$1,position:options$1?.position,...errorUtil.errToObj(options$1?.message)})}startsWith(value$1,message$1){return this._addCheck({kind:`startsWith`,value:value$1,...errorUtil.errToObj(message$1)})}endsWith(value$1,message$1){return this._addCheck({kind:`endsWith`,value:value$1,...errorUtil.errToObj(message$1)})}min(minLength,message$1){return this._addCheck({kind:`min`,value:minLength,...errorUtil.errToObj(message$1)})}max(maxLength,message$1){return this._addCheck({kind:`max`,value:maxLength,...errorUtil.errToObj(message$1)})}length(len,message$1){return this._addCheck({kind:`length`,value:len,...errorUtil.errToObj(message$1)})}nonempty(message$1){return this.min(1,errorUtil.errToObj(message$1))}trim(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:`trim`}]})}toLowerCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:`toLowerCase`}]})}toUpperCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:`toUpperCase`}]})}get isDatetime(){return!!this._def.checks.find(ch$1=>ch$1.kind===`datetime`)}get isDate(){return!!this._def.checks.find(ch$1=>ch$1.kind===`date`)}get isTime(){return!!this._def.checks.find(ch$1=>ch$1.kind===`time`)}get isDuration(){return!!this._def.checks.find(ch$1=>ch$1.kind===`duration`)}get isEmail(){return!!this._def.checks.find(ch$1=>ch$1.kind===`email`)}get isURL(){return!!this._def.checks.find(ch$1=>ch$1.kind===`url`)}get isEmoji(){return!!this._def.checks.find(ch$1=>ch$1.kind===`emoji`)}get isUUID(){return!!this._def.checks.find(ch$1=>ch$1.kind===`uuid`)}get isNANOID(){return!!this._def.checks.find(ch$1=>ch$1.kind===`nanoid`)}get isCUID(){return!!this._def.checks.find(ch$1=>ch$1.kind===`cuid`)}get isCUID2(){return!!this._def.checks.find(ch$1=>ch$1.kind===`cuid2`)}get isULID(){return!!this._def.checks.find(ch$1=>ch$1.kind===`ulid`)}get isIP(){return!!this._def.checks.find(ch$1=>ch$1.kind===`ip`)}get isCIDR(){return!!this._def.checks.find(ch$1=>ch$1.kind===`cidr`)}get isBase64(){return!!this._def.checks.find(ch$1=>ch$1.kind===`base64`)}get isBase64url(){return!!this._def.checks.find(ch$1=>ch$1.kind===`base64url`)}get minLength(){let min$1=null;for(let ch$1 of this._def.checks)ch$1.kind===`min`&&(min$1===null||ch$1.value>min$1)&&(min$1=ch$1.value);return min$1}get maxLength(){let max$1=null;for(let ch$1 of this._def.checks)ch$1.kind===`max`&&(max$1===null||ch$1.valuenew ZodString({checks:[],typeName:ZodFirstPartyTypeKind.ZodString,coerce:params?.coerce??!1,...processCreateParams(params)});function floatSafeRemainder(val,step){let valDecCount=(val.toString().split(`.`)[1]||``).length,stepDecCount=(step.toString().split(`.`)[1]||``).length,decCount=valDecCount>stepDecCount?valDecCount:stepDecCount,valInt=Number.parseInt(val.toFixed(decCount).replace(`.`,``)),stepInt=Number.parseInt(step.toFixed(decCount).replace(`.`,``));return valInt%stepInt/10**decCount}var ZodNumber=class ZodNumber extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(input){this._def.coerce&&(input.data=Number(input.data));let parsedType=this._getType(input);if(parsedType!==ZodParsedType.number){let ctx$1=this._getOrReturnCtx(input);return addIssueToContext(ctx$1,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.number,received:ctx$1.parsedType}),INVALID}let ctx,status=new ParseStatus;for(let check$1 of this._def.checks)if(check$1.kind===`int`)util.isInteger(input.data)||(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:`integer`,received:`float`,message:check$1.message}),status.dirty());else if(check$1.kind===`min`){let tooSmall=check$1.inclusive?input.datacheck$1.value:input.data>=check$1.value;tooBig&&(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{code:ZodIssueCode.too_big,maximum:check$1.value,type:`number`,inclusive:check$1.inclusive,exact:!1,message:check$1.message}),status.dirty())}else check$1.kind===`multipleOf`?floatSafeRemainder(input.data,check$1.value)!==0&&(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{code:ZodIssueCode.not_multiple_of,multipleOf:check$1.value,message:check$1.message}),status.dirty()):check$1.kind===`finite`?Number.isFinite(input.data)||(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{code:ZodIssueCode.not_finite,message:check$1.message}),status.dirty()):util.assertNever(check$1);return{status:status.value,value:input.data}}gte(value$1,message$1){return this.setLimit(`min`,value$1,!0,errorUtil.toString(message$1))}gt(value$1,message$1){return this.setLimit(`min`,value$1,!1,errorUtil.toString(message$1))}lte(value$1,message$1){return this.setLimit(`max`,value$1,!0,errorUtil.toString(message$1))}lt(value$1,message$1){return this.setLimit(`max`,value$1,!1,errorUtil.toString(message$1))}setLimit(kind,value$1,inclusive,message$1){return new ZodNumber({...this._def,checks:[...this._def.checks,{kind,value:value$1,inclusive,message:errorUtil.toString(message$1)}]})}_addCheck(check$1){return new ZodNumber({...this._def,checks:[...this._def.checks,check$1]})}int(message$1){return this._addCheck({kind:`int`,message:errorUtil.toString(message$1)})}positive(message$1){return this._addCheck({kind:`min`,value:0,inclusive:!1,message:errorUtil.toString(message$1)})}negative(message$1){return this._addCheck({kind:`max`,value:0,inclusive:!1,message:errorUtil.toString(message$1)})}nonpositive(message$1){return this._addCheck({kind:`max`,value:0,inclusive:!0,message:errorUtil.toString(message$1)})}nonnegative(message$1){return this._addCheck({kind:`min`,value:0,inclusive:!0,message:errorUtil.toString(message$1)})}multipleOf(value$1,message$1){return this._addCheck({kind:`multipleOf`,value:value$1,message:errorUtil.toString(message$1)})}finite(message$1){return this._addCheck({kind:`finite`,message:errorUtil.toString(message$1)})}safe(message$1){return this._addCheck({kind:`min`,inclusive:!0,value:-(2**53-1),message:errorUtil.toString(message$1)})._addCheck({kind:`max`,inclusive:!0,value:2**53-1,message:errorUtil.toString(message$1)})}get minValue(){let min$1=null;for(let ch$1 of this._def.checks)ch$1.kind===`min`&&(min$1===null||ch$1.value>min$1)&&(min$1=ch$1.value);return min$1}get maxValue(){let max$1=null;for(let ch$1 of this._def.checks)ch$1.kind===`max`&&(max$1===null||ch$1.valuech$1.kind===`int`||ch$1.kind===`multipleOf`&&util.isInteger(ch$1.value))}get isFinite(){let max$1=null,min$1=null;for(let ch$1 of this._def.checks)if(ch$1.kind===`finite`||ch$1.kind===`int`||ch$1.kind===`multipleOf`)return!0;else ch$1.kind===`min`?(min$1===null||ch$1.value>min$1)&&(min$1=ch$1.value):ch$1.kind===`max`&&(max$1===null||ch$1.valuenew ZodNumber({checks:[],typeName:ZodFirstPartyTypeKind.ZodNumber,coerce:params?.coerce||!1,...processCreateParams(params)});var ZodBigInt=class ZodBigInt extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(input){if(this._def.coerce)try{input.data=BigInt(input.data)}catch{return this._getInvalidInput(input)}let parsedType=this._getType(input);if(parsedType!==ZodParsedType.bigint)return this._getInvalidInput(input);let ctx,status=new ParseStatus;for(let check$1 of this._def.checks)if(check$1.kind===`min`){let tooSmall=check$1.inclusive?input.datacheck$1.value:input.data>=check$1.value;tooBig&&(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{code:ZodIssueCode.too_big,type:`bigint`,maximum:check$1.value,inclusive:check$1.inclusive,message:check$1.message}),status.dirty())}else check$1.kind===`multipleOf`?input.data%check$1.value!==BigInt(0)&&(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{code:ZodIssueCode.not_multiple_of,multipleOf:check$1.value,message:check$1.message}),status.dirty()):util.assertNever(check$1);return{status:status.value,value:input.data}}_getInvalidInput(input){let ctx=this._getOrReturnCtx(input);return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.bigint,received:ctx.parsedType}),INVALID}gte(value$1,message$1){return this.setLimit(`min`,value$1,!0,errorUtil.toString(message$1))}gt(value$1,message$1){return this.setLimit(`min`,value$1,!1,errorUtil.toString(message$1))}lte(value$1,message$1){return this.setLimit(`max`,value$1,!0,errorUtil.toString(message$1))}lt(value$1,message$1){return this.setLimit(`max`,value$1,!1,errorUtil.toString(message$1))}setLimit(kind,value$1,inclusive,message$1){return new ZodBigInt({...this._def,checks:[...this._def.checks,{kind,value:value$1,inclusive,message:errorUtil.toString(message$1)}]})}_addCheck(check$1){return new ZodBigInt({...this._def,checks:[...this._def.checks,check$1]})}positive(message$1){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!1,message:errorUtil.toString(message$1)})}negative(message$1){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!1,message:errorUtil.toString(message$1)})}nonpositive(message$1){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!0,message:errorUtil.toString(message$1)})}nonnegative(message$1){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!0,message:errorUtil.toString(message$1)})}multipleOf(value$1,message$1){return this._addCheck({kind:`multipleOf`,value:value$1,message:errorUtil.toString(message$1)})}get minValue(){let min$1=null;for(let ch$1 of this._def.checks)ch$1.kind===`min`&&(min$1===null||ch$1.value>min$1)&&(min$1=ch$1.value);return min$1}get maxValue(){let max$1=null;for(let ch$1 of this._def.checks)ch$1.kind===`max`&&(max$1===null||ch$1.valuenew ZodBigInt({checks:[],typeName:ZodFirstPartyTypeKind.ZodBigInt,coerce:params?.coerce??!1,...processCreateParams(params)});var ZodBoolean=class extends ZodType{_parse(input){this._def.coerce&&(input.data=!!input.data);let parsedType=this._getType(input);if(parsedType!==ZodParsedType.boolean){let ctx=this._getOrReturnCtx(input);return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.boolean,received:ctx.parsedType}),INVALID}return OK(input.data)}};ZodBoolean.create=params=>new ZodBoolean({typeName:ZodFirstPartyTypeKind.ZodBoolean,coerce:params?.coerce||!1,...processCreateParams(params)});var ZodDate=class ZodDate extends ZodType{_parse(input){this._def.coerce&&(input.data=new Date(input.data));let parsedType=this._getType(input);if(parsedType!==ZodParsedType.date){let ctx$1=this._getOrReturnCtx(input);return addIssueToContext(ctx$1,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.date,received:ctx$1.parsedType}),INVALID}if(Number.isNaN(input.data.getTime())){let ctx$1=this._getOrReturnCtx(input);return addIssueToContext(ctx$1,{code:ZodIssueCode.invalid_date}),INVALID}let status=new ParseStatus,ctx;for(let check$1 of this._def.checks)check$1.kind===`min`?input.data.getTime()check$1.value&&(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{code:ZodIssueCode.too_big,message:check$1.message,inclusive:!0,exact:!1,maximum:check$1.value,type:`date`}),status.dirty()):util.assertNever(check$1);return{status:status.value,value:new Date(input.data.getTime())}}_addCheck(check$1){return new ZodDate({...this._def,checks:[...this._def.checks,check$1]})}min(minDate,message$1){return this._addCheck({kind:`min`,value:minDate.getTime(),message:errorUtil.toString(message$1)})}max(maxDate,message$1){return this._addCheck({kind:`max`,value:maxDate.getTime(),message:errorUtil.toString(message$1)})}get minDate(){let min$1=null;for(let ch$1 of this._def.checks)ch$1.kind===`min`&&(min$1===null||ch$1.value>min$1)&&(min$1=ch$1.value);return min$1==null?null:new Date(min$1)}get maxDate(){let max$1=null;for(let ch$1 of this._def.checks)ch$1.kind===`max`&&(max$1===null||ch$1.valuenew ZodDate({checks:[],coerce:params?.coerce||!1,typeName:ZodFirstPartyTypeKind.ZodDate,...processCreateParams(params)});var ZodSymbol=class extends ZodType{_parse(input){let parsedType=this._getType(input);if(parsedType!==ZodParsedType.symbol){let ctx=this._getOrReturnCtx(input);return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.symbol,received:ctx.parsedType}),INVALID}return OK(input.data)}};ZodSymbol.create=params=>new ZodSymbol({typeName:ZodFirstPartyTypeKind.ZodSymbol,...processCreateParams(params)});var ZodUndefined=class extends ZodType{_parse(input){let parsedType=this._getType(input);if(parsedType!==ZodParsedType.undefined){let ctx=this._getOrReturnCtx(input);return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.undefined,received:ctx.parsedType}),INVALID}return OK(input.data)}};ZodUndefined.create=params=>new ZodUndefined({typeName:ZodFirstPartyTypeKind.ZodUndefined,...processCreateParams(params)});var ZodNull=class extends ZodType{_parse(input){let parsedType=this._getType(input);if(parsedType!==ZodParsedType.null){let ctx=this._getOrReturnCtx(input);return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.null,received:ctx.parsedType}),INVALID}return OK(input.data)}};ZodNull.create=params=>new ZodNull({typeName:ZodFirstPartyTypeKind.ZodNull,...processCreateParams(params)});var ZodAny=class extends ZodType{constructor(){super(...arguments),this._any=!0}_parse(input){return OK(input.data)}};ZodAny.create=params=>new ZodAny({typeName:ZodFirstPartyTypeKind.ZodAny,...processCreateParams(params)});var ZodUnknown=class extends ZodType{constructor(){super(...arguments),this._unknown=!0}_parse(input){return OK(input.data)}};ZodUnknown.create=params=>new ZodUnknown({typeName:ZodFirstPartyTypeKind.ZodUnknown,...processCreateParams(params)});var ZodNever=class extends ZodType{_parse(input){let ctx=this._getOrReturnCtx(input);return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.never,received:ctx.parsedType}),INVALID}};ZodNever.create=params=>new ZodNever({typeName:ZodFirstPartyTypeKind.ZodNever,...processCreateParams(params)});var ZodVoid=class extends ZodType{_parse(input){let parsedType=this._getType(input);if(parsedType!==ZodParsedType.undefined){let ctx=this._getOrReturnCtx(input);return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.void,received:ctx.parsedType}),INVALID}return OK(input.data)}};ZodVoid.create=params=>new ZodVoid({typeName:ZodFirstPartyTypeKind.ZodVoid,...processCreateParams(params)});var ZodArray=class ZodArray extends ZodType{_parse(input){let{ctx,status}=this._processInputParams(input),def$1=this._def;if(ctx.parsedType!==ZodParsedType.array)return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:ctx.parsedType}),INVALID;if(def$1.exactLength!==null){let tooBig=ctx.data.length>def$1.exactLength.value,tooSmall=ctx.data.lengthdef$1.maxLength.value&&(addIssueToContext(ctx,{code:ZodIssueCode.too_big,maximum:def$1.maxLength.value,type:`array`,inclusive:!0,exact:!1,message:def$1.maxLength.message}),status.dirty()),ctx.common.async)return Promise.all([...ctx.data].map((item,i$1)=>def$1.type._parseAsync(new ParseInputLazyPath(ctx,item,ctx.path,i$1)))).then(result$1=>ParseStatus.mergeArray(status,result$1));let result=[...ctx.data].map((item,i$1)=>def$1.type._parseSync(new ParseInputLazyPath(ctx,item,ctx.path,i$1)));return ParseStatus.mergeArray(status,result)}get element(){return this._def.type}min(minLength,message$1){return new ZodArray({...this._def,minLength:{value:minLength,message:errorUtil.toString(message$1)}})}max(maxLength,message$1){return new ZodArray({...this._def,maxLength:{value:maxLength,message:errorUtil.toString(message$1)}})}length(len,message$1){return new ZodArray({...this._def,exactLength:{value:len,message:errorUtil.toString(message$1)}})}nonempty(message$1){return this.min(1,message$1)}};ZodArray.create=(schema,params)=>new ZodArray({type:schema,minLength:null,maxLength:null,exactLength:null,typeName:ZodFirstPartyTypeKind.ZodArray,...processCreateParams(params)});function deepPartialify(schema){if(schema instanceof ZodObject){let newShape={};for(let key$2 in schema.shape){let fieldSchema=schema.shape[key$2];newShape[key$2]=ZodOptional.create(deepPartialify(fieldSchema))}return new ZodObject({...schema._def,shape:()=>newShape})}else if(schema instanceof ZodArray)return new ZodArray({...schema._def,type:deepPartialify(schema.element)});else if(schema instanceof ZodOptional)return ZodOptional.create(deepPartialify(schema.unwrap()));else if(schema instanceof ZodNullable)return ZodNullable.create(deepPartialify(schema.unwrap()));else if(schema instanceof ZodTuple)return ZodTuple.create(schema.items.map(item=>deepPartialify(item)));else return schema}var ZodObject=class ZodObject extends ZodType{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let shape=this._def.shape(),keys$3=util.objectKeys(shape);return this._cached={shape,keys:keys$3},this._cached}_parse(input){let parsedType=this._getType(input);if(parsedType!==ZodParsedType.object){let ctx$1=this._getOrReturnCtx(input);return addIssueToContext(ctx$1,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:ctx$1.parsedType}),INVALID}let{status,ctx}=this._processInputParams(input),{shape,keys:shapeKeys}=this._getCached(),extraKeys=[];if(!(this._def.catchall instanceof ZodNever&&this._def.unknownKeys===`strip`))for(let key$2 in ctx.data)shapeKeys.includes(key$2)||extraKeys.push(key$2);let pairs=[];for(let key$2 of shapeKeys){let keyValidator=shape[key$2],value$1=ctx.data[key$2];pairs.push({key:{status:`valid`,value:key$2},value:keyValidator._parse(new ParseInputLazyPath(ctx,value$1,ctx.path,key$2)),alwaysSet:key$2 in ctx.data})}if(this._def.catchall instanceof ZodNever){let unknownKeys=this._def.unknownKeys;if(unknownKeys===`passthrough`)for(let key$2 of extraKeys)pairs.push({key:{status:`valid`,value:key$2},value:{status:`valid`,value:ctx.data[key$2]}});else if(unknownKeys===`strict`)extraKeys.length>0&&(addIssueToContext(ctx,{code:ZodIssueCode.unrecognized_keys,keys:extraKeys}),status.dirty());else if(unknownKeys!==`strip`)throw Error(`Internal ZodObject error: invalid unknownKeys value.`)}else{let catchall=this._def.catchall;for(let key$2 of extraKeys){let value$1=ctx.data[key$2];pairs.push({key:{status:`valid`,value:key$2},value:catchall._parse(new ParseInputLazyPath(ctx,value$1,ctx.path,key$2)),alwaysSet:key$2 in ctx.data})}}return ctx.common.async?Promise.resolve().then(async()=>{let syncPairs=[];for(let pair of pairs){let key$2=await pair.key,value$1=await pair.value;syncPairs.push({key:key$2,value:value$1,alwaysSet:pair.alwaysSet})}return syncPairs}).then(syncPairs=>ParseStatus.mergeObjectSync(status,syncPairs)):ParseStatus.mergeObjectSync(status,pairs)}get shape(){return this._def.shape()}strict(message$1){return errorUtil.errToObj,new ZodObject({...this._def,unknownKeys:`strict`,...message$1===void 0?{}:{errorMap:(issue,ctx)=>{let defaultError=this._def.errorMap?.(issue,ctx).message??ctx.defaultError;return issue.code===`unrecognized_keys`?{message:errorUtil.errToObj(message$1).message??defaultError}:{message:defaultError}}}})}strip(){return new ZodObject({...this._def,unknownKeys:`strip`})}passthrough(){return new ZodObject({...this._def,unknownKeys:`passthrough`})}extend(augmentation){return new ZodObject({...this._def,shape:()=>({...this._def.shape(),...augmentation})})}merge(merging){let merged=new ZodObject({unknownKeys:merging._def.unknownKeys,catchall:merging._def.catchall,shape:()=>({...this._def.shape(),...merging._def.shape()}),typeName:ZodFirstPartyTypeKind.ZodObject});return merged}setKey(key$2,schema){return this.augment({[key$2]:schema})}catchall(index$1){return new ZodObject({...this._def,catchall:index$1})}pick(mask){let shape={};for(let key$2 of util.objectKeys(mask))mask[key$2]&&this.shape[key$2]&&(shape[key$2]=this.shape[key$2]);return new ZodObject({...this._def,shape:()=>shape})}omit(mask){let shape={};for(let key$2 of util.objectKeys(this.shape))mask[key$2]||(shape[key$2]=this.shape[key$2]);return new ZodObject({...this._def,shape:()=>shape})}deepPartial(){return deepPartialify(this)}partial(mask){let newShape={};for(let key$2 of util.objectKeys(this.shape)){let fieldSchema=this.shape[key$2];mask&&!mask[key$2]?newShape[key$2]=fieldSchema:newShape[key$2]=fieldSchema.optional()}return new ZodObject({...this._def,shape:()=>newShape})}required(mask){let newShape={};for(let key$2 of util.objectKeys(this.shape))if(mask&&!mask[key$2])newShape[key$2]=this.shape[key$2];else{let fieldSchema=this.shape[key$2],newField=fieldSchema;for(;newField instanceof ZodOptional;)newField=newField._def.innerType;newShape[key$2]=newField}return new ZodObject({...this._def,shape:()=>newShape})}keyof(){return createZodEnum(util.objectKeys(this.shape))}};ZodObject.create=(shape,params)=>new ZodObject({shape:()=>shape,unknownKeys:`strip`,catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(params)}),ZodObject.strictCreate=(shape,params)=>new ZodObject({shape:()=>shape,unknownKeys:`strict`,catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(params)}),ZodObject.lazycreate=(shape,params)=>new ZodObject({shape,unknownKeys:`strip`,catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(params)});var ZodUnion=class extends ZodType{_parse(input){let{ctx}=this._processInputParams(input),options$1=this._def.options;function handleResults(results){for(let result of results)if(result.result.status===`valid`)return result.result;for(let result of results)if(result.result.status===`dirty`)return ctx.common.issues.push(...result.ctx.common.issues),result.result;let unionErrors=results.map(result=>new ZodError(result.ctx.common.issues));return addIssueToContext(ctx,{code:ZodIssueCode.invalid_union,unionErrors}),INVALID}if(ctx.common.async)return Promise.all(options$1.map(async option$1=>{let childCtx={...ctx,common:{...ctx.common,issues:[]},parent:null};return{result:await option$1._parseAsync({data:ctx.data,path:ctx.path,parent:childCtx}),ctx:childCtx}})).then(handleResults);{let dirty,issues=[];for(let option$1 of options$1){let childCtx={...ctx,common:{...ctx.common,issues:[]},parent:null},result=option$1._parseSync({data:ctx.data,path:ctx.path,parent:childCtx});if(result.status===`valid`)return result;result.status===`dirty`&&!dirty&&(dirty={result,ctx:childCtx}),childCtx.common.issues.length&&issues.push(childCtx.common.issues)}if(dirty)return ctx.common.issues.push(...dirty.ctx.common.issues),dirty.result;let unionErrors=issues.map(issues$1=>new ZodError(issues$1));return addIssueToContext(ctx,{code:ZodIssueCode.invalid_union,unionErrors}),INVALID}}get options(){return this._def.options}};ZodUnion.create=(types$1,params)=>new ZodUnion({options:types$1,typeName:ZodFirstPartyTypeKind.ZodUnion,...processCreateParams(params)});const getDiscriminator=type=>type instanceof ZodLazy?getDiscriminator(type.schema):type instanceof ZodEffects?getDiscriminator(type.innerType()):type instanceof ZodLiteral?[type.value]:type instanceof ZodEnum?type.options:type instanceof ZodNativeEnum?util.objectValues(type.enum):type instanceof ZodDefault?getDiscriminator(type._def.innerType):type instanceof ZodUndefined?[void 0]:type instanceof ZodNull?[null]:type instanceof ZodOptional?[void 0,...getDiscriminator(type.unwrap())]:type instanceof ZodNullable?[null,...getDiscriminator(type.unwrap())]:type instanceof ZodBranded||type instanceof ZodReadonly?getDiscriminator(type.unwrap()):type instanceof ZodCatch?getDiscriminator(type._def.innerType):[];var ZodDiscriminatedUnion=class ZodDiscriminatedUnion extends ZodType{_parse(input){let{ctx}=this._processInputParams(input);if(ctx.parsedType!==ZodParsedType.object)return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:ctx.parsedType}),INVALID;let discriminator=this.discriminator,discriminatorValue=ctx.data[discriminator],option$1=this.optionsMap.get(discriminatorValue);return option$1?ctx.common.async?option$1._parseAsync({data:ctx.data,path:ctx.path,parent:ctx}):option$1._parseSync({data:ctx.data,path:ctx.path,parent:ctx}):(addIssueToContext(ctx,{code:ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[discriminator]}),INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(discriminator,options$1,params){let optionsMap=new Map;for(let type of options$1){let discriminatorValues=getDiscriminator(type.shape[discriminator]);if(!discriminatorValues.length)throw Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`);for(let value$1 of discriminatorValues){if(optionsMap.has(value$1))throw Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value$1)}`);optionsMap.set(value$1,type)}}return new ZodDiscriminatedUnion({typeName:ZodFirstPartyTypeKind.ZodDiscriminatedUnion,discriminator,options:options$1,optionsMap,...processCreateParams(params)})}};function mergeValues(a$2,b$4){let aType=getParsedType(a$2),bType=getParsedType(b$4);if(a$2===b$4)return{valid:!0,data:a$2};if(aType===ZodParsedType.object&&bType===ZodParsedType.object){let bKeys=util.objectKeys(b$4),sharedKeys=util.objectKeys(a$2).filter(key$2=>bKeys.indexOf(key$2)!==-1),newObj={...a$2,...b$4};for(let key$2 of sharedKeys){let sharedValue=mergeValues(a$2[key$2],b$4[key$2]);if(!sharedValue.valid)return{valid:!1};newObj[key$2]=sharedValue.data}return{valid:!0,data:newObj}}else if(aType===ZodParsedType.array&&bType===ZodParsedType.array){if(a$2.length!==b$4.length)return{valid:!1};let newArray=[];for(let index$1=0;index$1{if(isAborted(parsedLeft)||isAborted(parsedRight))return INVALID;let merged=mergeValues(parsedLeft.value,parsedRight.value);return merged.valid?((isDirty(parsedLeft)||isDirty(parsedRight))&&status.dirty(),{status:status.value,value:merged.data}):(addIssueToContext(ctx,{code:ZodIssueCode.invalid_intersection_types}),INVALID)};return ctx.common.async?Promise.all([this._def.left._parseAsync({data:ctx.data,path:ctx.path,parent:ctx}),this._def.right._parseAsync({data:ctx.data,path:ctx.path,parent:ctx})]).then(([left,right])=>handleParsed(left,right)):handleParsed(this._def.left._parseSync({data:ctx.data,path:ctx.path,parent:ctx}),this._def.right._parseSync({data:ctx.data,path:ctx.path,parent:ctx}))}};ZodIntersection.create=(left,right,params)=>new ZodIntersection({left,right,typeName:ZodFirstPartyTypeKind.ZodIntersection,...processCreateParams(params)});var ZodTuple=class ZodTuple extends ZodType{_parse(input){let{status,ctx}=this._processInputParams(input);if(ctx.parsedType!==ZodParsedType.array)return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:ctx.parsedType}),INVALID;if(ctx.data.lengththis._def.items.length&&(addIssueToContext(ctx,{code:ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),status.dirty());let items=[...ctx.data].map((item,itemIndex)=>{let schema=this._def.items[itemIndex]||this._def.rest;return schema?schema._parse(new ParseInputLazyPath(ctx,item,ctx.path,itemIndex)):null}).filter(x$3=>!!x$3);return ctx.common.async?Promise.all(items).then(results=>ParseStatus.mergeArray(status,results)):ParseStatus.mergeArray(status,items)}get items(){return this._def.items}rest(rest){return new ZodTuple({...this._def,rest})}};ZodTuple.create=(schemas,params)=>{if(!Array.isArray(schemas))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new ZodTuple({items:schemas,typeName:ZodFirstPartyTypeKind.ZodTuple,rest:null,...processCreateParams(params)})};var ZodRecord=class ZodRecord extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(input){let{status,ctx}=this._processInputParams(input);if(ctx.parsedType!==ZodParsedType.object)return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:ctx.parsedType}),INVALID;let pairs=[],keyType=this._def.keyType,valueType=this._def.valueType;for(let key$2 in ctx.data)pairs.push({key:keyType._parse(new ParseInputLazyPath(ctx,key$2,ctx.path,key$2)),value:valueType._parse(new ParseInputLazyPath(ctx,ctx.data[key$2],ctx.path,key$2)),alwaysSet:key$2 in ctx.data});return ctx.common.async?ParseStatus.mergeObjectAsync(status,pairs):ParseStatus.mergeObjectSync(status,pairs)}get element(){return this._def.valueType}static create(first,second,third){return second instanceof ZodType?new ZodRecord({keyType:first,valueType:second,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(third)}):new ZodRecord({keyType:ZodString.create(),valueType:first,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(second)})}},ZodMap=class extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(input){let{status,ctx}=this._processInputParams(input);if(ctx.parsedType!==ZodParsedType.map)return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.map,received:ctx.parsedType}),INVALID;let keyType=this._def.keyType,valueType=this._def.valueType,pairs=[...ctx.data.entries()].map(([key$2,value$1],index$1)=>({key:keyType._parse(new ParseInputLazyPath(ctx,key$2,ctx.path,[index$1,`key`])),value:valueType._parse(new ParseInputLazyPath(ctx,value$1,ctx.path,[index$1,`value`]))}));if(ctx.common.async){let finalMap=new Map;return Promise.resolve().then(async()=>{for(let pair of pairs){let key$2=await pair.key,value$1=await pair.value;if(key$2.status===`aborted`||value$1.status===`aborted`)return INVALID;(key$2.status===`dirty`||value$1.status===`dirty`)&&status.dirty(),finalMap.set(key$2.value,value$1.value)}return{status:status.value,value:finalMap}})}else{let finalMap=new Map;for(let pair of pairs){let key$2=pair.key,value$1=pair.value;if(key$2.status===`aborted`||value$1.status===`aborted`)return INVALID;(key$2.status===`dirty`||value$1.status===`dirty`)&&status.dirty(),finalMap.set(key$2.value,value$1.value)}return{status:status.value,value:finalMap}}}};ZodMap.create=(keyType,valueType,params)=>new ZodMap({valueType,keyType,typeName:ZodFirstPartyTypeKind.ZodMap,...processCreateParams(params)});var ZodSet=class ZodSet extends ZodType{_parse(input){let{status,ctx}=this._processInputParams(input);if(ctx.parsedType!==ZodParsedType.set)return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.set,received:ctx.parsedType}),INVALID;let def$1=this._def;def$1.minSize!==null&&ctx.data.sizedef$1.maxSize.value&&(addIssueToContext(ctx,{code:ZodIssueCode.too_big,maximum:def$1.maxSize.value,type:`set`,inclusive:!0,exact:!1,message:def$1.maxSize.message}),status.dirty());let valueType=this._def.valueType;function finalizeSet(elements$1){let parsedSet=new Set;for(let element$3 of elements$1){if(element$3.status===`aborted`)return INVALID;element$3.status===`dirty`&&status.dirty(),parsedSet.add(element$3.value)}return{status:status.value,value:parsedSet}}let elements=[...ctx.data.values()].map((item,i$1)=>valueType._parse(new ParseInputLazyPath(ctx,item,ctx.path,i$1)));return ctx.common.async?Promise.all(elements).then(elements$1=>finalizeSet(elements$1)):finalizeSet(elements)}min(minSize,message$1){return new ZodSet({...this._def,minSize:{value:minSize,message:errorUtil.toString(message$1)}})}max(maxSize,message$1){return new ZodSet({...this._def,maxSize:{value:maxSize,message:errorUtil.toString(message$1)}})}size(size$2,message$1){return this.min(size$2,message$1).max(size$2,message$1)}nonempty(message$1){return this.min(1,message$1)}};ZodSet.create=(valueType,params)=>new ZodSet({valueType,minSize:null,maxSize:null,typeName:ZodFirstPartyTypeKind.ZodSet,...processCreateParams(params)});var ZodFunction=class ZodFunction extends ZodType{constructor(){super(...arguments),this.validate=this.implement}_parse(input){let{ctx}=this._processInputParams(input);if(ctx.parsedType!==ZodParsedType.function)return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.function,received:ctx.parsedType}),INVALID;function makeArgsIssue(args,error){return makeIssue({data:args,path:ctx.path,errorMaps:[ctx.common.contextualErrorMap,ctx.schemaErrorMap,getErrorMap(),en_default$1].filter(x$3=>!!x$3),issueData:{code:ZodIssueCode.invalid_arguments,argumentsError:error}})}function makeReturnsIssue(returns,error){return makeIssue({data:returns,path:ctx.path,errorMaps:[ctx.common.contextualErrorMap,ctx.schemaErrorMap,getErrorMap(),en_default$1].filter(x$3=>!!x$3),issueData:{code:ZodIssueCode.invalid_return_type,returnTypeError:error}})}let params={errorMap:ctx.common.contextualErrorMap},fn$6=ctx.data;if(this._def.returns instanceof ZodPromise){let me$2=this;return OK(async function(...args){let error=new ZodError([]),parsedArgs=await me$2._def.args.parseAsync(args,params).catch(e$3=>{throw error.addIssue(makeArgsIssue(args,e$3)),error}),result=await Reflect.apply(fn$6,this,parsedArgs),parsedReturns=await me$2._def.returns._def.type.parseAsync(result,params).catch(e$3=>{throw error.addIssue(makeReturnsIssue(result,e$3)),error});return parsedReturns})}else{let me$2=this;return OK(function(...args){let parsedArgs=me$2._def.args.safeParse(args,params);if(!parsedArgs.success)throw new ZodError([makeArgsIssue(args,parsedArgs.error)]);let result=Reflect.apply(fn$6,this,parsedArgs.data),parsedReturns=me$2._def.returns.safeParse(result,params);if(!parsedReturns.success)throw new ZodError([makeReturnsIssue(result,parsedReturns.error)]);return parsedReturns.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...items){return new ZodFunction({...this._def,args:ZodTuple.create(items).rest(ZodUnknown.create())})}returns(returnType){return new ZodFunction({...this._def,returns:returnType})}implement(func){let validatedFunc=this.parse(func);return validatedFunc}strictImplement(func){let validatedFunc=this.parse(func);return validatedFunc}static create(args,returns,params){return new ZodFunction({args:args||ZodTuple.create([]).rest(ZodUnknown.create()),returns:returns||ZodUnknown.create(),typeName:ZodFirstPartyTypeKind.ZodFunction,...processCreateParams(params)})}},ZodLazy=class extends ZodType{get schema(){return this._def.getter()}_parse(input){let{ctx}=this._processInputParams(input),lazySchema=this._def.getter();return lazySchema._parse({data:ctx.data,path:ctx.path,parent:ctx})}};ZodLazy.create=(getter,params)=>new ZodLazy({getter,typeName:ZodFirstPartyTypeKind.ZodLazy,...processCreateParams(params)});var ZodLiteral=class extends ZodType{_parse(input){if(input.data!==this._def.value){let ctx=this._getOrReturnCtx(input);return addIssueToContext(ctx,{received:ctx.data,code:ZodIssueCode.invalid_literal,expected:this._def.value}),INVALID}return{status:`valid`,value:input.data}}get value(){return this._def.value}};ZodLiteral.create=(value$1,params)=>new ZodLiteral({value:value$1,typeName:ZodFirstPartyTypeKind.ZodLiteral,...processCreateParams(params)});function createZodEnum(values,params){return new ZodEnum({values,typeName:ZodFirstPartyTypeKind.ZodEnum,...processCreateParams(params)})}var ZodEnum=class ZodEnum extends ZodType{_parse(input){if(typeof input.data!=`string`){let ctx=this._getOrReturnCtx(input),expectedValues=this._def.values;return addIssueToContext(ctx,{expected:util.joinValues(expectedValues),received:ctx.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(this._cache||=new Set(this._def.values),!this._cache.has(input.data)){let ctx=this._getOrReturnCtx(input),expectedValues=this._def.values;return addIssueToContext(ctx,{received:ctx.data,code:ZodIssueCode.invalid_enum_value,options:expectedValues}),INVALID}return OK(input.data)}get options(){return this._def.values}get enum(){let enumValues={};for(let val of this._def.values)enumValues[val]=val;return enumValues}get Values(){let enumValues={};for(let val of this._def.values)enumValues[val]=val;return enumValues}get Enum(){let enumValues={};for(let val of this._def.values)enumValues[val]=val;return enumValues}extract(values,newDef=this._def){return ZodEnum.create(values,{...this._def,...newDef})}exclude(values,newDef=this._def){return ZodEnum.create(this.options.filter(opt=>!values.includes(opt)),{...this._def,...newDef})}};ZodEnum.create=createZodEnum;var ZodNativeEnum=class extends ZodType{_parse(input){let nativeEnumValues=util.getValidEnumValues(this._def.values),ctx=this._getOrReturnCtx(input);if(ctx.parsedType!==ZodParsedType.string&&ctx.parsedType!==ZodParsedType.number){let expectedValues=util.objectValues(nativeEnumValues);return addIssueToContext(ctx,{expected:util.joinValues(expectedValues),received:ctx.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(this._cache||=new Set(util.getValidEnumValues(this._def.values)),!this._cache.has(input.data)){let expectedValues=util.objectValues(nativeEnumValues);return addIssueToContext(ctx,{received:ctx.data,code:ZodIssueCode.invalid_enum_value,options:expectedValues}),INVALID}return OK(input.data)}get enum(){return this._def.values}};ZodNativeEnum.create=(values,params)=>new ZodNativeEnum({values,typeName:ZodFirstPartyTypeKind.ZodNativeEnum,...processCreateParams(params)});var ZodPromise=class extends ZodType{unwrap(){return this._def.type}_parse(input){let{ctx}=this._processInputParams(input);if(ctx.parsedType!==ZodParsedType.promise&&ctx.common.async===!1)return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.promise,received:ctx.parsedType}),INVALID;let promisified=ctx.parsedType===ZodParsedType.promise?ctx.data:Promise.resolve(ctx.data);return OK(promisified.then(data$12=>this._def.type.parseAsync(data$12,{path:ctx.path,errorMap:ctx.common.contextualErrorMap})))}};ZodPromise.create=(schema,params)=>new ZodPromise({type:schema,typeName:ZodFirstPartyTypeKind.ZodPromise,...processCreateParams(params)});var ZodEffects=class extends ZodType{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ZodFirstPartyTypeKind.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(input){let{status,ctx}=this._processInputParams(input),effect$1=this._def.effect||null,checkCtx={addIssue:arg=>{addIssueToContext(ctx,arg),arg.fatal?status.abort():status.dirty()},get path(){return ctx.path}};if(checkCtx.addIssue=checkCtx.addIssue.bind(checkCtx),effect$1.type===`preprocess`){let processed=effect$1.transform(ctx.data,checkCtx);if(ctx.common.async)return Promise.resolve(processed).then(async processed$1=>{if(status.value===`aborted`)return INVALID;let result=await this._def.schema._parseAsync({data:processed$1,path:ctx.path,parent:ctx});return result.status===`aborted`?INVALID:result.status===`dirty`||status.value===`dirty`?DIRTY(result.value):result});{if(status.value===`aborted`)return INVALID;let result=this._def.schema._parseSync({data:processed,path:ctx.path,parent:ctx});return result.status===`aborted`?INVALID:result.status===`dirty`||status.value===`dirty`?DIRTY(result.value):result}}if(effect$1.type===`refinement`){let executeRefinement=acc=>{let result=effect$1.refinement(acc,checkCtx);if(ctx.common.async)return Promise.resolve(result);if(result instanceof Promise)throw Error(`Async refinement encountered during synchronous parse operation. Use .parseAsync instead.`);return acc};if(ctx.common.async===!1){let inner=this._def.schema._parseSync({data:ctx.data,path:ctx.path,parent:ctx});return inner.status===`aborted`?INVALID:(inner.status===`dirty`&&status.dirty(),executeRefinement(inner.value),{status:status.value,value:inner.value})}else return this._def.schema._parseAsync({data:ctx.data,path:ctx.path,parent:ctx}).then(inner=>inner.status===`aborted`?INVALID:(inner.status===`dirty`&&status.dirty(),executeRefinement(inner.value).then(()=>({status:status.value,value:inner.value}))))}if(effect$1.type===`transform`)if(ctx.common.async===!1){let base=this._def.schema._parseSync({data:ctx.data,path:ctx.path,parent:ctx});if(!isValid(base))return INVALID;let result=effect$1.transform(base.value,checkCtx);if(result instanceof Promise)throw Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);return{status:status.value,value:result}}else return this._def.schema._parseAsync({data:ctx.data,path:ctx.path,parent:ctx}).then(base=>isValid(base)?Promise.resolve(effect$1.transform(base.value,checkCtx)).then(result=>({status:status.value,value:result})):INVALID);util.assertNever(effect$1)}};ZodEffects.create=(schema,effect$1,params)=>new ZodEffects({schema,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:effect$1,...processCreateParams(params)}),ZodEffects.createWithPreprocess=(preprocess$1,schema,params)=>new ZodEffects({schema,effect:{type:`preprocess`,transform:preprocess$1},typeName:ZodFirstPartyTypeKind.ZodEffects,...processCreateParams(params)});var ZodOptional=class extends ZodType{_parse(input){let parsedType=this._getType(input);return parsedType===ZodParsedType.undefined?OK(void 0):this._def.innerType._parse(input)}unwrap(){return this._def.innerType}};ZodOptional.create=(type,params)=>new ZodOptional({innerType:type,typeName:ZodFirstPartyTypeKind.ZodOptional,...processCreateParams(params)});var ZodNullable=class extends ZodType{_parse(input){let parsedType=this._getType(input);return parsedType===ZodParsedType.null?OK(null):this._def.innerType._parse(input)}unwrap(){return this._def.innerType}};ZodNullable.create=(type,params)=>new ZodNullable({innerType:type,typeName:ZodFirstPartyTypeKind.ZodNullable,...processCreateParams(params)});var ZodDefault=class extends ZodType{_parse(input){let{ctx}=this._processInputParams(input),data$12=ctx.data;return ctx.parsedType===ZodParsedType.undefined&&(data$12=this._def.defaultValue()),this._def.innerType._parse({data:data$12,path:ctx.path,parent:ctx})}removeDefault(){return this._def.innerType}};ZodDefault.create=(type,params)=>new ZodDefault({innerType:type,typeName:ZodFirstPartyTypeKind.ZodDefault,defaultValue:typeof params.default==`function`?params.default:()=>params.default,...processCreateParams(params)});var ZodCatch=class extends ZodType{_parse(input){let{ctx}=this._processInputParams(input),newCtx={...ctx,common:{...ctx.common,issues:[]}},result=this._def.innerType._parse({data:newCtx.data,path:newCtx.path,parent:{...newCtx}});return isAsync(result)?result.then(result$1=>({status:`valid`,value:result$1.status===`valid`?result$1.value:this._def.catchValue({get error(){return new ZodError(newCtx.common.issues)},input:newCtx.data})})):{status:`valid`,value:result.status===`valid`?result.value:this._def.catchValue({get error(){return new ZodError(newCtx.common.issues)},input:newCtx.data})}}removeCatch(){return this._def.innerType}};ZodCatch.create=(type,params)=>new ZodCatch({innerType:type,typeName:ZodFirstPartyTypeKind.ZodCatch,catchValue:typeof params.catch==`function`?params.catch:()=>params.catch,...processCreateParams(params)});var ZodNaN=class extends ZodType{_parse(input){let parsedType=this._getType(input);if(parsedType!==ZodParsedType.nan){let ctx=this._getOrReturnCtx(input);return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.nan,received:ctx.parsedType}),INVALID}return{status:`valid`,value:input.data}}};ZodNaN.create=params=>new ZodNaN({typeName:ZodFirstPartyTypeKind.ZodNaN,...processCreateParams(params)});const BRAND=Symbol(`zod_brand`);var ZodBranded=class extends ZodType{_parse(input){let{ctx}=this._processInputParams(input),data$12=ctx.data;return this._def.type._parse({data:data$12,path:ctx.path,parent:ctx})}unwrap(){return this._def.type}},ZodPipeline=class ZodPipeline extends ZodType{_parse(input){let{status,ctx}=this._processInputParams(input);if(ctx.common.async){let handleAsync=async()=>{let inResult=await this._def.in._parseAsync({data:ctx.data,path:ctx.path,parent:ctx});return inResult.status===`aborted`?INVALID:inResult.status===`dirty`?(status.dirty(),DIRTY(inResult.value)):this._def.out._parseAsync({data:inResult.value,path:ctx.path,parent:ctx})};return handleAsync()}else{let inResult=this._def.in._parseSync({data:ctx.data,path:ctx.path,parent:ctx});return inResult.status===`aborted`?INVALID:inResult.status===`dirty`?(status.dirty(),{status:`dirty`,value:inResult.value}):this._def.out._parseSync({data:inResult.value,path:ctx.path,parent:ctx})}}static create(a$2,b$4){return new ZodPipeline({in:a$2,out:b$4,typeName:ZodFirstPartyTypeKind.ZodPipeline})}},ZodReadonly=class extends ZodType{_parse(input){let result=this._def.innerType._parse(input),freeze=data$12=>(isValid(data$12)&&(data$12.value=Object.freeze(data$12.value)),data$12);return isAsync(result)?result.then(data$12=>freeze(data$12)):freeze(result)}unwrap(){return this._def.innerType}};ZodReadonly.create=(type,params)=>new ZodReadonly({innerType:type,typeName:ZodFirstPartyTypeKind.ZodReadonly,...processCreateParams(params)});const late={object:ZodObject.lazycreate};var ZodFirstPartyTypeKind;(function(ZodFirstPartyTypeKind$1){ZodFirstPartyTypeKind$1.ZodString=`ZodString`,ZodFirstPartyTypeKind$1.ZodNumber=`ZodNumber`,ZodFirstPartyTypeKind$1.ZodNaN=`ZodNaN`,ZodFirstPartyTypeKind$1.ZodBigInt=`ZodBigInt`,ZodFirstPartyTypeKind$1.ZodBoolean=`ZodBoolean`,ZodFirstPartyTypeKind$1.ZodDate=`ZodDate`,ZodFirstPartyTypeKind$1.ZodSymbol=`ZodSymbol`,ZodFirstPartyTypeKind$1.ZodUndefined=`ZodUndefined`,ZodFirstPartyTypeKind$1.ZodNull=`ZodNull`,ZodFirstPartyTypeKind$1.ZodAny=`ZodAny`,ZodFirstPartyTypeKind$1.ZodUnknown=`ZodUnknown`,ZodFirstPartyTypeKind$1.ZodNever=`ZodNever`,ZodFirstPartyTypeKind$1.ZodVoid=`ZodVoid`,ZodFirstPartyTypeKind$1.ZodArray=`ZodArray`,ZodFirstPartyTypeKind$1.ZodObject=`ZodObject`,ZodFirstPartyTypeKind$1.ZodUnion=`ZodUnion`,ZodFirstPartyTypeKind$1.ZodDiscriminatedUnion=`ZodDiscriminatedUnion`,ZodFirstPartyTypeKind$1.ZodIntersection=`ZodIntersection`,ZodFirstPartyTypeKind$1.ZodTuple=`ZodTuple`,ZodFirstPartyTypeKind$1.ZodRecord=`ZodRecord`,ZodFirstPartyTypeKind$1.ZodMap=`ZodMap`,ZodFirstPartyTypeKind$1.ZodSet=`ZodSet`,ZodFirstPartyTypeKind$1.ZodFunction=`ZodFunction`,ZodFirstPartyTypeKind$1.ZodLazy=`ZodLazy`,ZodFirstPartyTypeKind$1.ZodLiteral=`ZodLiteral`,ZodFirstPartyTypeKind$1.ZodEnum=`ZodEnum`,ZodFirstPartyTypeKind$1.ZodEffects=`ZodEffects`,ZodFirstPartyTypeKind$1.ZodNativeEnum=`ZodNativeEnum`,ZodFirstPartyTypeKind$1.ZodOptional=`ZodOptional`,ZodFirstPartyTypeKind$1.ZodNullable=`ZodNullable`,ZodFirstPartyTypeKind$1.ZodDefault=`ZodDefault`,ZodFirstPartyTypeKind$1.ZodCatch=`ZodCatch`,ZodFirstPartyTypeKind$1.ZodPromise=`ZodPromise`,ZodFirstPartyTypeKind$1.ZodBranded=`ZodBranded`,ZodFirstPartyTypeKind$1.ZodPipeline=`ZodPipeline`,ZodFirstPartyTypeKind$1.ZodReadonly=`ZodReadonly`})(ZodFirstPartyTypeKind||={});const stringType=ZodString.create,numberType=ZodNumber.create,nanType=ZodNaN.create,bigIntType=ZodBigInt.create,booleanType=ZodBoolean.create,dateType=ZodDate.create,symbolType=ZodSymbol.create,undefinedType=ZodUndefined.create,nullType=ZodNull.create,anyType=ZodAny.create,unknownType=ZodUnknown.create,neverType=ZodNever.create,voidType=ZodVoid.create,arrayType=ZodArray.create,objectType=ZodObject.create,strictObjectType=ZodObject.strictCreate,unionType=ZodUnion.create,discriminatedUnionType=ZodDiscriminatedUnion.create,intersectionType=ZodIntersection.create,tupleType=ZodTuple.create,recordType=ZodRecord.create,mapType=ZodMap.create,setType=ZodSet.create,functionType=ZodFunction.create,lazyType=ZodLazy.create,literalType=ZodLiteral.create,enumType=ZodEnum.create,nativeEnumType=ZodNativeEnum.create,promiseType=ZodPromise.create,effectsType=ZodEffects.create,optionalType=ZodOptional.create,nullableType=ZodNullable.create,preprocessType=ZodEffects.createWithPreprocess,pipelineType=ZodPipeline.create,tools$1=[tool({name:`debug_random_number`,description:`Generate a random number between 0 and 1`,execute:async()=>new Promise(resolve$1=>{setTimeout(()=>{resolve$1(Math.random().toString())},1e3)}),parameters:objectType({})})],debug=async()=>Promise.all(tools$1);function __classPrivateFieldGet(receiver,state,kind,f$3){if(kind===`a`&&!f$3)throw TypeError(`Private accessor was defined without a getter`);if(typeof state==`function`?receiver!==state||!f$3:!state.has(receiver))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return kind===`m`?f$3:kind===`a`?f$3.call(receiver):f$3?f$3.value:state.get(receiver)}function __classPrivateFieldSet(receiver,state,value$1,kind,f$3){if(kind===`m`)throw TypeError(`Private method is not writable`);if(kind===`a`&&!f$3)throw TypeError(`Private accessor was defined without a setter`);if(typeof state==`function`?receiver!==state||!f$3:!state.has(receiver))throw TypeError(`Cannot write private member to an object whose class did not declare it`);return kind===`a`?f$3.call(receiver,value$1):f$3?f$3.value=value$1:state.set(receiver,value$1),value$1}var _Channel_onmessage,_Channel_nextMessageIndex,_Channel_pendingMessages,_Channel_messageEndIndex,_Resource_rid;const SERIALIZE_TO_IPC_FN=`__TAURI_TO_IPC_KEY__`;function transformCallback(callback,once=!1){return window.__TAURI_INTERNALS__.transformCallback(callback,once)}var Channel=class{constructor(onmessage){_Channel_onmessage.set(this,void 0),_Channel_nextMessageIndex.set(this,0),_Channel_pendingMessages.set(this,[]),_Channel_messageEndIndex.set(this,void 0),__classPrivateFieldSet(this,_Channel_onmessage,onmessage||(()=>{}),`f`),this.id=transformCallback(rawMessage=>{let index$1=rawMessage.index;if(`end`in rawMessage){index$1==__classPrivateFieldGet(this,_Channel_nextMessageIndex,`f`)?this.cleanupCallback():__classPrivateFieldSet(this,_Channel_messageEndIndex,index$1,`f`);return}let message$1=rawMessage.message;if(index$1==__classPrivateFieldGet(this,_Channel_nextMessageIndex,`f`)){for(__classPrivateFieldGet(this,_Channel_onmessage,`f`).call(this,message$1),__classPrivateFieldSet(this,_Channel_nextMessageIndex,__classPrivateFieldGet(this,_Channel_nextMessageIndex,`f`)+1,`f`);__classPrivateFieldGet(this,_Channel_nextMessageIndex,`f`)in __classPrivateFieldGet(this,_Channel_pendingMessages,`f`);){let message$2=__classPrivateFieldGet(this,_Channel_pendingMessages,`f`)[__classPrivateFieldGet(this,_Channel_nextMessageIndex,`f`)];__classPrivateFieldGet(this,_Channel_onmessage,`f`).call(this,message$2),delete __classPrivateFieldGet(this,_Channel_pendingMessages,`f`)[__classPrivateFieldGet(this,_Channel_nextMessageIndex,`f`)],__classPrivateFieldSet(this,_Channel_nextMessageIndex,__classPrivateFieldGet(this,_Channel_nextMessageIndex,`f`)+1,`f`)}__classPrivateFieldGet(this,_Channel_nextMessageIndex,`f`)===__classPrivateFieldGet(this,_Channel_messageEndIndex,`f`)&&this.cleanupCallback()}else __classPrivateFieldGet(this,_Channel_pendingMessages,`f`)[index$1]=message$1})}cleanupCallback(){window.__TAURI_INTERNALS__.unregisterCallback(this.id)}set onmessage(handler){__classPrivateFieldSet(this,_Channel_onmessage,handler,`f`)}get onmessage(){return __classPrivateFieldGet(this,_Channel_onmessage,`f`)}[(_Channel_onmessage=new WeakMap,_Channel_nextMessageIndex=new WeakMap,_Channel_pendingMessages=new WeakMap,_Channel_messageEndIndex=new WeakMap,SERIALIZE_TO_IPC_FN)](){return`__CHANNEL__:${this.id}`}toJSON(){return this[SERIALIZE_TO_IPC_FN]()}};async function invoke(cmd,args={},options$1){return window.__TAURI_INTERNALS__.invoke(cmd,args,options$1)}_Resource_rid=new WeakMap;async function connectServer(command,args){await invoke(`plugin:mcp|connect_server`,{command,args})}async function disconnectServer(){await invoke(`plugin:mcp|disconnect_server`)}async function listTools(){return await invoke(`plugin:mcp|list_tools`)}async function callTool(name$2,args){return await invoke(`plugin:mcp|call_tool`,{name:name$2,args})}const tools=[tool({name:`mcp_list_tools`,description:`List all tools available on the MCP server`,execute:async(_$2,__)=>await listTools(),parameters:objectType({})}),tool({name:`mcp_connect_server`,description:`Connect to the MCP server. If "success", the connection to the MCP server is successful. Otherwise, the connection fails.`,execute:async({command,args})=>(await connectServer(command,args),`success`),parameters:objectType({command:stringType().describe(`The command to connect to the MCP server`),args:arrayType(stringType()).describe(`The arguments to pass to the MCP server`)})}),tool({name:`mcp_disconnect_server`,description:`Disconnect from the MCP server. If "success", the disconnection from the MCP server is successful. Otherwise, the disconnection fails.`,execute:async()=>(await disconnectServer(),`success`),parameters:objectType({})}),tool({name:`mcp_call_tool`,description:`Call a tool on the MCP server. The result is a list of content and a boolean indicating whether the tool call is an error.`,execute:async({name:name$2,parameters})=>{let parametersObject=Object.fromEntries(parameters.map(({name:name$3,value:value$1})=>[name$3,value$1])),result=await callTool(name$2,parametersObject);return result},parameters:objectType({name:stringType().describe(`The name of the tool to call`),parameters:arrayType(objectType({name:stringType().describe(`The name of the parameter`),value:unionType([stringType(),numberType(),booleanType(),objectType({})]).describe(`The value of the parameter, it can be a string, a number, a boolean, or an object`)})).describe(`The parameters to pass to the tool`)})})],mcp=async()=>Promise.all(tools);function streamOptionsToolsCompatibilityOk(model,chatProvider,_$2,options$1,toolsCompatibility=new Map){return!!(options$1?.supportsTools||toolsCompatibility.get(`${chatProvider.chat(model).baseURL}-${model}`))}async function streamFrom(model,chatProvider,messages,options$1){let headers=options$1?.headers;return await streamText({...chatProvider.chat(model),maxSteps:10,messages:messages.map(msg=>({...msg,content:msg.role===`error`?`User encountered error: ${msg.content}`:msg.content,role:msg.role===`error`?`user`:msg.role})),headers,tools:streamOptionsToolsCompatibilityOk(model,chatProvider,messages,options$1)?[...await mcp(),...await debug()]:void 0,onEvent(event){event.type===`tool-call`?options$1?.onToolCall?.(event.toolCall):event.type===`tool-call-result`&&options$1?.onToolCallResult?.({id:event.id,result:event.result})}})}async function attemptForToolsCompatibilityDiscovery(model,chatProvider,_$2,options$1){async function attempt(enable){try{let res=await streamFrom(model,chatProvider,[{role:`user`,content:`Hello, world!`}],{...options$1,supportsTools:enable});for await(let _$3 of readableStreamToAsyncIterator(res.textStream,async v$2=>v$2));return!0}catch(err){if(err instanceof Error&&err.name===new XSAIError$1(``).name&&(String(err).includes(`does not support tools`)||String(err).includes(`No endpoints found that support tool use.`)))return!1;throw err}}function promiseAllWithInterval(promises,interval){return new Promise(resolve$1=>{let results=[],completed=0;promises.forEach((promiseFn,index$1)=>{setTimeout(()=>{promiseFn().then(result=>{results[index$1]={result}}).catch(err=>{results[index$1]={error:err}}).finally(()=>{completed++,completed===promises.length&&resolve$1(results)})},index$1*interval)})})}let attempts=[()=>attempt(!0),()=>attempt(!1)],attemptsResults=await promiseAllWithInterval(attempts,1e3);if(attemptsResults.some(res=>res.error)){let err=Error(`Error during tools compatibility discovery for model: ${model}. Errors: ${attemptsResults.map(res=>res.error).filter(Boolean).join(`, `)}`);throw err.cause=attemptsResults.map(res=>res.error).filter(Boolean),err}return attemptsResults[0].result===!0&&attemptsResults[1].result===!0}const useLLM=defineStore(`llm`,()=>{let toolsCompatibility=ref(new Map);async function discoverToolsCompatibility(model,chatProvider,_$2,options$1){if(toolsCompatibility.value.has(`${chatProvider.chat(model).baseURL}-${model}`))return;let res=await attemptForToolsCompatibilityDiscovery(model,chatProvider,_$2,{...options$1,toolsCompatibility:toolsCompatibility.value});toolsCompatibility.value.set(`${chatProvider.chat(model).baseURL}-${model}`,res)}function stream(model,chatProvider,messages,options$1){return streamFrom(model,chatProvider,messages,{...options$1,toolsCompatibility:toolsCompatibility.value})}async function models$1(apiUrl,apiKey){if(apiUrl===``)return[];try{return await listModels({baseURL:apiUrl.endsWith(`/`)?apiUrl:`${apiUrl}/`,apiKey})}catch(err){if(String(err).includes(`Failed to construct 'URL': Invalid URL`))return[];throw err}}return{models:models$1,stream,discoverToolsCompatibility}}),createChatProvider=options$1=>({chat:model=>Object.assign(options$1,{model})}),createEmbedProvider=options$1=>({embed:model=>Object.assign(options$1,{model})}),createImageProvider=options$1=>({image:model=>Object.assign(options$1,{model})}),createModelProvider=options$1=>({model:()=>options$1}),createSpeechProvider=options$1=>({speech:model=>Object.assign(options$1,{model})}),createTranscriptionProvider=options$1=>({transcription:model=>Object.assign(options$1,{model})}),createMetadataProvider=(id$1,otherMeta)=>({metadata:{id:id$1,...otherMeta}}),merge$1=(...arr)=>Object.assign(arr[0],...arr.slice(1)),createAnthropic=(apiKey,baseURL=`https://api.anthropic.com/v1/`)=>merge$1(createMetadataProvider(`anthropic`),createChatProvider({apiKey,baseURL}),createModelProvider({apiKey,baseURL})),createAzure=async options$1=>{let headers=typeof options$1.apiKey==`string`?{"api-key":options$1.apiKey}:void 0,baseURL=`https://${options$1.resourceName}.services.ai.azure.com/models/`,fetch$1=async(input,init)=>{if(options$1.apiVersion!=null&&input.searchParams.set(`api-version`,options$1.apiVersion),typeof options$1.apiKey==`function`){init.headers??={};let token=`Bearer ${await options$1.apiKey()}`;Array.isArray(init.headers)?init.headers.push([`Authorization`,token]):init.headers instanceof Headers?init.headers.append(`Authorization`,token):init.headers.Authorization=token}return globalThis.fetch(input,init)};return merge$1(createMetadataProvider(`azure`),createChatProvider({baseURL,fetch:fetch$1,headers}),createEmbedProvider({baseURL,fetch:fetch$1,headers}),createSpeechProvider({baseURL,fetch:fetch$1,headers}),createTranscriptionProvider({baseURL,fetch:fetch$1,headers}),createModelProvider({baseURL,fetch:fetch$1,headers}))},createDeepSeek=(apiKey,baseURL=`https://api.deepseek.com/`)=>merge$1(createMetadataProvider(`deepseek`),createChatProvider({apiKey,baseURL}),createModelProvider({apiKey,baseURL})),createFireworks=(apiKey,baseURL=`https://api.fireworks.ai/inference/v1/`)=>merge$1(createMetadataProvider(`fireworks`),createChatProvider({apiKey,baseURL}),createEmbedProvider({apiKey,baseURL}),createModelProvider({apiKey,baseURL})),createGoogleGenerativeAI=(apiKey,baseURL=`https://generativelanguage.googleapis.com/v1beta/openai/`)=>merge$1(createMetadataProvider(`google-generative-ai`),createChatProvider({apiKey,baseURL}),createEmbedProvider({apiKey,baseURL}),createModelProvider({apiKey,baseURL})),createMistral=(apiKey,baseURL=`https://api.mistral.ai/v1/`)=>merge$1(createMetadataProvider(`mistral`),createChatProvider({apiKey,baseURL}),createEmbedProvider({apiKey,baseURL}),createModelProvider({apiKey,baseURL})),createMoonshot=(apiKey,baseURL=`https://api.moonshot.cn/v1/`)=>merge$1(createMetadataProvider(`moonshot`),createChatProvider({apiKey,baseURL}),createModelProvider({apiKey,baseURL})),createNovita=(apiKey,baseURL=`https://api.novita.ai/v3/openai/`)=>merge$1(createMetadataProvider(`novita`),createChatProvider({apiKey,baseURL}),createModelProvider({apiKey,baseURL})),createOpenAI=(apiKey,baseURL=`https://api.openai.com/v1/`)=>merge$1(createMetadataProvider(`openai`),createChatProvider({apiKey,baseURL}),createEmbedProvider({apiKey,baseURL}),createImageProvider({apiKey,baseURL}),createModelProvider({apiKey,baseURL}),createSpeechProvider({apiKey,baseURL}),createTranscriptionProvider({apiKey,baseURL})),createOpenRouter=(apiKey,baseURL=``)=>merge$1(createMetadataProvider(`openrouter`),{chat:(model,openRouterOptions)=>{let requestOptions={apiKey,baseURL,model},toOpenRouterOptions=({extraHeaders,models:models$1,provider})=>{extraHeaders!=null&&(requestOptions.headers??={},Object.assign(requestOptions.headers,extraHeaders));let transformedProvider;return provider!=null&&(transformedProvider=objCamelToSnake$1(provider)),objCamelToSnake$1({models:models$1,provider:transformedProvider})};return{...openRouterOptions?toOpenRouterOptions(openRouterOptions):{},...requestOptions}}},createModelProvider({apiKey,baseURL})),createPerplexity=(apiKey,baseURL=`https://api.perplexity.ai/`)=>merge$1(createMetadataProvider(`perplexity`),createChatProvider({apiKey,baseURL})),createTogetherAI=(apiKey,baseURL=`https://api.together.xyz/v1/`)=>merge$1(createMetadataProvider(`together-ai`),createChatProvider({apiKey,baseURL}),createEmbedProvider({apiKey,baseURL}),createModelProvider({apiKey,baseURL,fetch:async(...args)=>globalThis.fetch(...args).then(async res=>res.json()).then(data$12=>Response.json({data:data$12,object:`list`}))})),createWorkersAI=(apiKey,accountId)=>{let baseURL=`https://api.cloudflare.com/client/v4/accounts/${accountId}/ai/v1/`;return merge$1(createMetadataProvider(`workers-ai`),createChatProvider({apiKey,baseURL}),createEmbedProvider({apiKey,baseURL}))},createXAI=(apiKey,baseURL=`https://api.x.ai/v1/`)=>merge$1(createMetadataProvider(`xai`),createChatProvider({apiKey,baseURL}),createModelProvider({apiKey,baseURL})),createOllama=(baseURL=`http://localhost:11434/v1/`)=>merge$1(createMetadataProvider(`ollama`),createChatProvider({baseURL}),createEmbedProvider({baseURL}),createModelProvider({baseURL})),decodeBase64=b64=>{let binString=atob(b64),size$2=binString.length,bytes=new Uint8Array(size$2);for(let i$1=0;i$1merge$1(createMetadataProvider(`player2`),createChatProvider({baseURL,headers:{"player2-game-key":gameKey}}),createSpeechProvider({baseURL,fetch:async(input,reqInit)=>{let newUrl=`${input.toString().slice(0,-12)}tts/speak`;try{let{input:input2,response_format,speed,voice,...rest}=JSON.parse(reqInit?.body),modified={audio_format:response_format,play_in_app:!1,speed:speed??1,text:input2,voice_ids:voice==null?[]:[voice],...rest};reqInit&&(reqInit.body=JSON.stringify(modified))}catch(err){console.warn(`Could not parse body as JSON:`,err)}return globalThis.fetch(newUrl,reqInit).then(async res=>res.json()).then(json=>{let base64=json.data??``,bytes=decodeBase64(base64);return new Response(bytes,{headers:{"Content-Type":`audio/mpeg`},status:200})})},headers:{"player2-game-key":gameKey}}));async function check(){try{if(isInNodejsRuntime())return{supported:!1,isNode:!0,reason:``,fp16Supported:!1};if(typeof navigator>`u`||!navigator.gpu)return{supported:!1,isNode:!1,reason:`WebGPU is not available (navigator.gpu is undefined)`,fp16Supported:!1};let adapter=await navigator.gpu.requestAdapter();return adapter?{supported:!0,isNode:!1,reason:``,adapter,fp16Supported:adapter.features.has(`shader-f16`)}:{supported:!1,isNode:!1,reason:`WebGPU is not supported (no adapter found)`,fp16Supported:!1}}catch(error){let errorMessage=error instanceof Error?error.toString():String(error);return{supported:!1,isNode:!1,reason:errorMessage,fp16Supported:!1}}}function isInNodejsRuntime(){return typeof process<`u`&&`versions`in process&&process.versions!=null&&typeof process.versions==`object`&&`node`in process.versions&&process.versions.node!=null}async function isWebGPUSupported(){return check().then(result=>result.supported)}const merge=(...arr)=>Object.assign(arr[0],...arr.slice(1));var XSAIError=class extends Error{response;constructor(message$1,response){super(message$1),this.name=`XSAIError`,this.response=response}};const strCamelToSnake=str=>str.replace(/[A-Z]/g,s$1=>`_${s$1.toLowerCase()}`),objCamelToSnake=obj=>Object.fromEntries(Object.entries(obj).map(([k$4,v$2])=>[strCamelToSnake(k$4),v$2])),clean$1=obj=>Object.fromEntries(Object.entries(obj).filter(([,v$2])=>v$2!==void 0)),requestHeaders$1=(headers,apiKey)=>clean$1({Authorization:apiKey===void 0?void 0:`Bearer ${apiKey}`,...headers}),requestURL$1=(path,baseURL)=>{let base=baseURL.toString();return new URL(path,base.endsWith(`/`)?base:`${base}/`)},responseCatch$1=async res=>{if(!res.ok)throw new XSAIError(`Remote sent ${res.status} response: ${await res.text()}`,res);if(!res.body)throw new XSAIError(`Response body is empty from remote server`,res);if(!(res.body instanceof ReadableStream))throw new XSAIError(`Expected Response body to be a ReadableStream, but got ${String(res.body)}; Content Type is ${res.headers.get(`Content-Type`)}`,res);return res},responseJSON$1=async res=>responseCatch$1(res).then(async res2=>{let text$5=await res2.text();try{return JSON.parse(text$5)}catch{throw Error(`Failed to parse response, response body: ${text$5}`)}});var createUnElevenLabs=(apiKey,baseURL=`http://localhost:5933/v1/`)=>{let toUnSpeechOptions=({applyTextNormalization,languageCode,nextRequestIds,nextText,previousRequestIds,previousText,pronunciationDictionaryLocators,seed,voiceSettings})=>({extraBody:objCamelToSnake({applyTextNormalization,languageCode,nextRequestIds,nextText,previousRequestIds,previousText,pronunciationDictionaryLocators:pronunciationDictionaryLocators?pronunciationDictionaryLocators.map(pdl=>objCamelToSnake(pdl)):void 0,seed,voiceSettings:objCamelToSnake(voiceSettings??{similarityBoost:.75,stability:.5})})}),speechProvider={speech:(model,options$1)=>({...options$1?toUnSpeechOptions(options$1):{},apiKey,baseURL,model:`elevenlabs/${model}`})},voiceProvider={voice:options$1=>(baseURL.endsWith(`v1/`)?baseURL=baseURL.slice(0,-3):baseURL.endsWith(`v1`)&&(baseURL=baseURL.slice(0,-2)),{query:`provider=elevenlabs`,...options$1?toUnSpeechOptions(options$1):{},apiKey,baseURL})};return merge(speechProvider,voiceProvider)},createUnMicrosoft=(apiKey,baseURL=`http://localhost:5933/v1/`)=>{let toUnSpeechOptions=options$1=>{let{deploymentId,region,sampleRate}=options$1,extraBody={deploymentId,region,sampleRate};return`disableSsml`in options$1?extraBody.disableSsml=options$1.disableSsml:`lang`in options$1&&(extraBody.lang=options$1.lang,extraBody.gender=options$1.gender,extraBody.voice=options$1.voice),{extraBody:objCamelToSnake(extraBody)}},speechProvider={speech:(model,options$1)=>({...options$1?toUnSpeechOptions(options$1):{},apiKey,baseURL,model:`microsoft/${model}`})},voiceProvider={voice:options$1=>(baseURL.endsWith(`v1/`)?baseURL=baseURL.slice(0,-3):baseURL.endsWith(`v1`)&&(baseURL=baseURL.slice(0,-2)),{query:`region=${options$1?.region}&provider=microsoft`,...options$1?toUnSpeechOptions(options$1):{},apiKey,baseURL})};return merge(speechProvider,voiceProvider)},createUnVolcengine=(apiKey,baseURL=`http://localhost:5933/v1/`)=>{let toUnSpeechOptions=options$1=>{let extraBody={app:{appid:options$1.app?.appId,token:apiKey}};return options$1.app!==void 0&&(extraBody.app={...options$1.app,appid:options$1.app?.appId,token:apiKey}),options$1.user!==void 0&&(extraBody.user=options$1.user),options$1.audio!==void 0&&(extraBody.audio=options$1.audio),{extraBody:objCamelToSnake(extraBody)}},speechProvider={speech:(model,options$1)=>({...options$1?toUnSpeechOptions(options$1):{},apiKey,baseURL,model:`volcengine/${model}`})},voiceProvider={voice:options$1=>(baseURL.endsWith(`v1/`)?baseURL=baseURL.slice(0,-3):baseURL.endsWith(`v1`)&&(baseURL=baseURL.slice(0,-2)),{query:`provider=volcengine`,...options$1?toUnSpeechOptions(options$1):{},apiKey,baseURL})};return merge(speechProvider,voiceProvider)},createUnAlibabaCloud=(apiKey,baseURL=`http://localhost:5933/v1/`)=>{let toUnSpeechOptions=options$1=>{let{sampleRate,volume,rate,pitch}=options$1,extraBody={sampleRate,volume,rate,pitch};return Object.keys(extraBody).forEach(key$2=>extraBody[key$2]===void 0&&delete extraBody[key$2]),{extraBody:objCamelToSnake(extraBody)}},speechProvider={speech:(model,options$1)=>({...options$1?toUnSpeechOptions(options$1):{},apiKey,baseURL,model:`alibaba/${model}`})},voiceProvider={voice:options$1=>{let adjustedBaseURL=baseURL;return adjustedBaseURL.endsWith(`v1/`)?adjustedBaseURL=adjustedBaseURL.slice(0,-3):adjustedBaseURL.endsWith(`v1`)&&(adjustedBaseURL=adjustedBaseURL.slice(0,-2)),{query:`provider=alibaba`,...options$1?toUnSpeechOptions(options$1):{},apiKey,baseURL:adjustedBaseURL}}};return merge(speechProvider,voiceProvider)},listVoices=async options$1=>(options$1.fetch??globalThis.fetch)(requestURL$1(options$1.query?`api/voices?${options$1.query}`:`api/voices`,options$1.baseURL),{headers:requestHeaders$1({...options$1.headers},options$1.apiKey),method:`GET`,signal:options$1.abortSignal}).then(responseJSON$1).then(({voices})=>voices);const models=[{model_id:`eleven_multilingual_v2`,name:`Eleven Multilingual v2`,can_be_finetuned:!0,can_do_text_to_speech:!0,can_do_voice_conversion:!1,can_use_style:!0,can_use_speaker_boost:!0,serves_pro_voices:!1,token_cost_factor:1,description:`Our most life-like, emotionally rich mode in 29 languages. Best for voice overs, audiobooks, post-production, or any other content creation needs.`,requires_alpha_access:!1,max_characters_request_free_user:1e4,max_characters_request_subscribed_user:1e4,maximum_text_length_per_request:1e4,languages:[{language_id:`en`,name:`English`},{language_id:`ja`,name:`Japanese`},{language_id:`zh`,name:`Chinese`},{language_id:`de`,name:`German`},{language_id:`hi`,name:`Hindi`},{language_id:`fr`,name:`French`},{language_id:`ko`,name:`Korean`},{language_id:`pt`,name:`Portuguese`},{language_id:`it`,name:`Italian`},{language_id:`es`,name:`Spanish`},{language_id:`id`,name:`Indonesian`},{language_id:`nl`,name:`Dutch`},{language_id:`tr`,name:`Turkish`},{language_id:`fil`,name:`Filipino`},{language_id:`pl`,name:`Polish`},{language_id:`sv`,name:`Swedish`},{language_id:`bg`,name:`Bulgarian`},{language_id:`ro`,name:`Romanian`},{language_id:`ar`,name:`Arabic`},{language_id:`cs`,name:`Czech`},{language_id:`el`,name:`Greek`},{language_id:`fi`,name:`Finnish`},{language_id:`hr`,name:`Croatian`},{language_id:`ms`,name:`Malay`},{language_id:`sk`,name:`Slovak`},{language_id:`da`,name:`Danish`},{language_id:`ta`,name:`Tamil`},{language_id:`uk`,name:`Ukrainian`},{language_id:`ru`,name:`Russian`}],model_rates:{character_cost_multiplier:1},concurrency_group:`standard`},{model_id:`eleven_flash_v2_5`,name:`Eleven Flash v2.5`,can_be_finetuned:!0,can_do_text_to_speech:!0,can_do_voice_conversion:!1,can_use_style:!1,can_use_speaker_boost:!1,serves_pro_voices:!1,token_cost_factor:1,description:`Our ultra low latency model in 32 languages. Ideal for conversational use cases.`,requires_alpha_access:!1,max_characters_request_free_user:4e4,max_characters_request_subscribed_user:4e4,maximum_text_length_per_request:4e4,languages:[{language_id:`en`,name:`English`},{language_id:`ja`,name:`Japanese`},{language_id:`zh`,name:`Chinese`},{language_id:`de`,name:`German`},{language_id:`hi`,name:`Hindi`},{language_id:`fr`,name:`French`},{language_id:`ko`,name:`Korean`},{language_id:`pt`,name:`Portuguese`},{language_id:`it`,name:`Italian`},{language_id:`es`,name:`Spanish`},{language_id:`ru`,name:`Russian`},{language_id:`id`,name:`Indonesian`},{language_id:`nl`,name:`Dutch`},{language_id:`tr`,name:`Turkish`},{language_id:`fil`,name:`Filipino`},{language_id:`pl`,name:`Polish`},{language_id:`sv`,name:`Swedish`},{language_id:`bg`,name:`Bulgarian`},{language_id:`ro`,name:`Romanian`},{language_id:`ar`,name:`Arabic`},{language_id:`cs`,name:`Czech`},{language_id:`el`,name:`Greek`},{language_id:`fi`,name:`Finnish`},{language_id:`hr`,name:`Croatian`},{language_id:`ms`,name:`Malay`},{language_id:`sk`,name:`Slovak`},{language_id:`da`,name:`Danish`},{language_id:`ta`,name:`Tamil`},{language_id:`uk`,name:`Ukrainian`},{language_id:`hu`,name:`Hungarian`},{language_id:`no`,name:`Norwegian`},{language_id:`vi`,name:`Vietnamese`}],model_rates:{character_cost_multiplier:.5},concurrency_group:`turbo`},{model_id:`eleven_turbo_v2_5`,name:`Eleven Turbo v2.5`,can_be_finetuned:!0,can_do_text_to_speech:!0,can_do_voice_conversion:!1,can_use_style:!1,can_use_speaker_boost:!1,serves_pro_voices:!1,token_cost_factor:1,description:`Our high quality, low latency model in 32 languages. Best for developer use cases where speed matters and you need non-English languages.`,requires_alpha_access:!1,max_characters_request_free_user:4e4,max_characters_request_subscribed_user:4e4,maximum_text_length_per_request:4e4,languages:[{language_id:`en`,name:`English`},{language_id:`ja`,name:`Japanese`},{language_id:`zh`,name:`Chinese`},{language_id:`de`,name:`German`},{language_id:`hi`,name:`Hindi`},{language_id:`fr`,name:`French`},{language_id:`ko`,name:`Korean`},{language_id:`pt`,name:`Portuguese`},{language_id:`it`,name:`Italian`},{language_id:`es`,name:`Spanish`},{language_id:`ru`,name:`Russian`},{language_id:`id`,name:`Indonesian`},{language_id:`nl`,name:`Dutch`},{language_id:`tr`,name:`Turkish`},{language_id:`fil`,name:`Filipino`},{language_id:`pl`,name:`Polish`},{language_id:`sv`,name:`Swedish`},{language_id:`bg`,name:`Bulgarian`},{language_id:`ro`,name:`Romanian`},{language_id:`ar`,name:`Arabic`},{language_id:`cs`,name:`Czech`},{language_id:`el`,name:`Greek`},{language_id:`fi`,name:`Finnish`},{language_id:`hr`,name:`Croatian`},{language_id:`ms`,name:`Malay`},{language_id:`sk`,name:`Slovak`},{language_id:`da`,name:`Danish`},{language_id:`ta`,name:`Tamil`},{language_id:`uk`,name:`Ukrainian`},{language_id:`vi`,name:`Vietnamese`},{language_id:`no`,name:`Norwegian`},{language_id:`hu`,name:`Hungarian`}],model_rates:{character_cost_multiplier:.5},concurrency_group:`turbo`},{model_id:`eleven_turbo_v2`,name:`Eleven Turbo v2`,can_be_finetuned:!0,can_do_text_to_speech:!0,can_do_voice_conversion:!1,can_use_style:!1,can_use_speaker_boost:!1,serves_pro_voices:!1,token_cost_factor:1,description:`Our English-only, low latency model. Best for developer use cases where speed matters and you only need English. Performance is on par with Turbo v2.5.`,requires_alpha_access:!1,max_characters_request_free_user:3e4,max_characters_request_subscribed_user:3e4,maximum_text_length_per_request:3e4,languages:[{language_id:`en`,name:`English`}],model_rates:{character_cost_multiplier:.5},concurrency_group:`turbo`},{model_id:`eleven_flash_v2`,name:`Eleven Flash v2`,can_be_finetuned:!0,can_do_text_to_speech:!0,can_do_voice_conversion:!1,can_use_style:!1,can_use_speaker_boost:!1,serves_pro_voices:!1,token_cost_factor:1,description:`Our ultra low latency model in english. Ideal for conversational use cases.`,requires_alpha_access:!1,max_characters_request_free_user:3e4,max_characters_request_subscribed_user:3e4,maximum_text_length_per_request:3e4,languages:[{language_id:`en`,name:`English`}],model_rates:{character_cost_multiplier:.5},concurrency_group:`turbo`},{model_id:`eleven_english_sts_v2`,name:`Eleven English v2`,can_be_finetuned:!1,can_do_text_to_speech:!1,can_do_voice_conversion:!0,can_use_style:!0,can_use_speaker_boost:!0,serves_pro_voices:!1,token_cost_factor:1,description:`Our state-of-the-art speech to speech model suitable for scenarios where you need maximum control over the content and prosody of your generations.`,requires_alpha_access:!1,max_characters_request_free_user:5e3,max_characters_request_subscribed_user:5e3,maximum_text_length_per_request:5e3,languages:[{language_id:`en`,name:`English`}],model_rates:{character_cost_multiplier:1},concurrency_group:`standard`},{model_id:`eleven_multilingual_v1`,name:`Eleven Multilingual v1`,can_be_finetuned:!1,can_do_text_to_speech:!0,can_do_voice_conversion:!1,can_use_style:!1,can_use_speaker_boost:!1,serves_pro_voices:!1,token_cost_factor:1,description:`Our first Multilingual model, capability of generating speech in 10 languages. Now outclassed by Multilingual v2 (for content creation) and Turbo v2.5 (for low latency use cases).`,requires_alpha_access:!1,max_characters_request_free_user:1e4,max_characters_request_subscribed_user:1e4,maximum_text_length_per_request:1e4,languages:[{language_id:`en`,name:`English`},{language_id:`de`,name:`German`},{language_id:`pl`,name:`Polish`},{language_id:`es`,name:`Spanish`},{language_id:`it`,name:`Italian`},{language_id:`fr`,name:`French`},{language_id:`pt`,name:`Portuguese`},{language_id:`hi`,name:`Hindi`},{language_id:`ar`,name:`Arabic`}],model_rates:{character_cost_multiplier:1},concurrency_group:`standard`},{model_id:`eleven_multilingual_sts_v2`,name:`Eleven Multilingual v2`,can_be_finetuned:!0,can_do_text_to_speech:!1,can_do_voice_conversion:!0,can_use_style:!0,can_use_speaker_boost:!0,serves_pro_voices:!1,token_cost_factor:1,description:`Our cutting-edge, multilingual speech-to-speech model is designed for situations that demand unparalleled control over both the content and the prosody of the generated speech across various languages.`,requires_alpha_access:!1,max_characters_request_free_user:1e4,max_characters_request_subscribed_user:1e4,maximum_text_length_per_request:1e4,languages:[{language_id:`en`,name:`English`},{language_id:`ja`,name:`Japanese`},{language_id:`zh`,name:`Chinese`},{language_id:`de`,name:`German`},{language_id:`hi`,name:`Hindi`},{language_id:`fr`,name:`French`},{language_id:`ko`,name:`Korean`},{language_id:`pt`,name:`Portuguese`},{language_id:`it`,name:`Italian`},{language_id:`es`,name:`Spanish`},{language_id:`ru`,name:`Russian`},{language_id:`id`,name:`Indonesian`},{language_id:`nl`,name:`Dutch`},{language_id:`tr`,name:`Turkish`},{language_id:`fil`,name:`Filipino`},{language_id:`pl`,name:`Polish`},{language_id:`sv`,name:`Swedish`},{language_id:`bg`,name:`Bulgarian`},{language_id:`ro`,name:`Romanian`},{language_id:`ar`,name:`Arabic`},{language_id:`cs`,name:`Czech`},{language_id:`el`,name:`Greek`},{language_id:`fi`,name:`Finnish`},{language_id:`hr`,name:`Croatian`},{language_id:`ms`,name:`Malay`},{language_id:`sk`,name:`Slovak`},{language_id:`da`,name:`Danish`},{language_id:`ta`,name:`Tamil`},{language_id:`uk`,name:`Ukrainian`}],model_rates:{character_cost_multiplier:1},concurrency_group:`standard`},{model_id:`eleven_monolingual_v1`,name:`Eleven English v1`,can_be_finetuned:!1,can_do_text_to_speech:!0,can_do_voice_conversion:!1,can_use_style:!1,can_use_speaker_boost:!1,serves_pro_voices:!1,token_cost_factor:1,description:`Our first ever text to speech model. Now outclassed by Multilingual v2 (for content creation) and Turbo v2.5 (for low latency use cases).`,requires_alpha_access:!1,max_characters_request_free_user:1e4,max_characters_request_subscribed_user:1e4,maximum_text_length_per_request:1e4,languages:[{language_id:`en`,name:`English`}],model_rates:{character_cost_multiplier:1},concurrency_group:`standard`}],useProvidersStore=defineStore(`providers`,()=>{let providerCredentials=useLocalStorage(`settings/credentials/providers`,{}),{t}=useI18n();async function fetchOpenRouterModels(config){try{let response=await fetch(`https://openrouter.ai/api/v1/models`,{headers:{Authorization:`Bearer ${config.apiKey.trim()}`,"Content-Type":`application/json`}});if(!response.ok)throw Error(`Failed to fetch OpenRouter models: ${response.statusText}`);let data$12=await response.json();return data$12.data.map(model=>({id:model.id,name:model.name||model.id,provider:`openrouter-ai`,description:model.description||``,contextLength:model.context_length,deprecated:!1}))}catch(error){throw console.error(`Error fetching OpenRouter models:`,error),error}}let providerMetadata={"openrouter-ai":{id:`openrouter-ai`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.openrouter.title`,name:`OpenRouter`,descriptionKey:`settings.pages.providers.provider.openrouter.description`,description:`openrouter.ai`,icon:`i-lobe-icons:openrouter`,defaultOptions:()=>({baseUrl:`https://openrouter.ai/api/v1/`}),createProvider:async config=>createOpenRouter(config.apiKey.trim(),config.baseUrl.trim()),capabilities:{listModels:async config=>fetchOpenRouterModels(config)},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.baseUrl}},"app-local-audio-speech":{id:`app-local-audio-speech`,category:`speech`,tasks:[`text-to-speech`,`tts`],isAvailableBy:async()=>`window`in globalThis&&globalThis.window!=null&&`__TAURI__`in globalThis.window&&globalThis.window.__TAURI__!=null,nameKey:`settings.pages.providers.provider.app-local-audio-speech.title`,name:`App (Local)`,descriptionKey:`settings.pages.providers.provider.app-local-audio-speech.description`,description:`https://github.com/huggingface/candle`,icon:`i-lobe-icons:huggingface`,defaultOptions:()=>({}),createProvider:async config=>createOpenAI(config.baseUrl.trim()),capabilities:{listModels:async config=>(await listModels({...createOpenAI(config.baseUrl.trim()).model()})).map(model=>({id:model.id,name:model.id,provider:`app-local-candle`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:config=>config.baseUrl?fetch(`${config.baseUrl.trim()}models`).then(response=>response.ok).catch(()=>!1):!1}},"app-local-audio-transcription":{id:`app-local-audio-transcription`,category:`transcription`,tasks:[`speech-to-text`,`automatic-speech-recognition`,`asr`,`stt`],isAvailableBy:async()=>`window`in globalThis&&globalThis.window!=null&&`__TAURI__`in globalThis.window&&globalThis.window.__TAURI__!=null,nameKey:`settings.pages.providers.provider.app-local-audio-transcription.title`,name:`App (Local)`,descriptionKey:`settings.pages.providers.provider.app-local-audio-transcription.description`,description:`https://github.com/huggingface/candle`,icon:`i-lobe-icons:huggingface`,defaultOptions:()=>({}),createProvider:async config=>createOpenAI(config.baseUrl.trim()),capabilities:{listModels:async config=>(await listModels({...createOpenAI(config.baseUrl.trim()).model()})).map(model=>({id:model.id,name:model.id,provider:`app-local-candle`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:config=>config.baseUrl?fetch(`${config.baseUrl.trim()}models`).then(response=>response.ok).catch(()=>!1):!1}},"browser-local-audio-speech":{id:`browser-local-audio-speech`,category:`speech`,tasks:[`text-to-speech`,`tts`],isAvailableBy:async()=>{let webGPUAvailable=await isWebGPUSupported();if(webGPUAvailable)return!0;if(`navigator`in globalThis&&globalThis.navigator!=null&&`deviceMemory`in globalThis.navigator&&typeof globalThis.navigator.deviceMemory==`number`){let memory=globalThis.navigator.deviceMemory;if(memory>=8)return!0}return!1},nameKey:`settings.pages.providers.provider.browser-local-audio-speech.title`,name:`Browser (Local)`,descriptionKey:`settings.pages.providers.provider.browser-local-audio-speech.description`,description:`https://github.com/moeru-ai/xsai-transformers`,icon:`i-lobe-icons:huggingface`,defaultOptions:()=>({}),createProvider:async config=>createOpenAI(config.baseUrl.trim()),capabilities:{listModels:async config=>(await listModels({...createOpenAI(config.baseUrl.trim()).model()})).map(model=>({id:model.id,name:model.id,provider:`browser-local-transformers`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:config=>config.baseUrl?fetch(`${config.baseUrl.trim()}models`).then(response=>response.ok).catch(()=>!1):!1}},"browser-local-audio-transcription":{id:`browser-local-audio-transcription`,category:`transcription`,tasks:[`speech-to-text`,`automatic-speech-recognition`,`asr`,`stt`],isAvailableBy:async()=>{let webGPUAvailable=await isWebGPUSupported();if(webGPUAvailable)return!0;if(`navigator`in globalThis&&globalThis.navigator!=null&&`deviceMemory`in globalThis.navigator&&typeof globalThis.navigator.deviceMemory==`number`){let memory=globalThis.navigator.deviceMemory;if(memory>=8)return!0}return!1},nameKey:`settings.pages.providers.provider.browser-local-audio-transcription.title`,name:`Browser (Local)`,descriptionKey:`settings.pages.providers.provider.browser-local-audio-transcription.description`,description:`https://github.com/moeru-ai/xsai-transformers`,icon:`i-lobe-icons:huggingface`,defaultOptions:()=>({}),createProvider:async config=>createOpenAI(config.baseUrl.trim()),capabilities:{listModels:async config=>(await listModels({...createOpenAI(config.baseUrl.trim()).model()})).map(model=>({id:model.id,name:model.id,provider:`browser-local-transformers`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:config=>config.baseUrl?fetch(`${config.baseUrl.trim()}models`).then(response=>response.ok).catch(()=>!1):!1}},ollama:{id:`ollama`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.ollama.title`,name:`Ollama`,descriptionKey:`settings.pages.providers.provider.ollama.description`,description:`ollama.com`,icon:`i-lobe-icons:ollama`,defaultOptions:()=>({baseUrl:`http://localhost:11434/v1/`}),createProvider:async config=>createOllama(config.baseUrl.trim()),capabilities:{listModels:async config=>(await listModels({...createOllama(config.baseUrl.trim()).model()})).map(model=>({id:model.id,name:model.id,provider:`ollama`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:config=>config.baseUrl?fetch(`${config.baseUrl.trim()}models`).then(response=>response.ok).catch(()=>!1):!1}},"ollama-embedding":{id:`ollama-embedding`,category:`embed`,tasks:[`text-feature-extraction`],nameKey:`settings.pages.providers.provider.ollama.title`,name:`Ollama`,descriptionKey:`settings.pages.providers.provider.ollama.description`,description:`ollama.com`,icon:`i-lobe-icons:ollama`,defaultOptions:()=>({baseUrl:`http://localhost:11434/v1/`}),createProvider:async config=>createOllama(config.baseUrl.trim()),capabilities:{listModels:async config=>(await listModels({...createOllama(config.baseUrl.trim()).model()})).map(model=>({id:model.id,name:model.id,provider:`ollama`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:config=>!!config.baseUrl}},vllm:{id:`vllm`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.vllm.title`,name:`vLLM`,descriptionKey:`settings.pages.providers.provider.vllm.description`,description:`vllm.ai`,iconColor:`i-lobe-icons:vllm`,createProvider:async config=>createOllama(config.baseUrl.trim()),capabilities:{listModels:async()=>[{id:`llama-2-7b`,name:`Llama 2 (7B)`,provider:`vllm`,description:`Meta's Llama 2 7B parameter model`,contextLength:4096},{id:`llama-2-13b`,name:`Llama 2 (13B)`,provider:`vllm`,description:`Meta's Llama 2 13B parameter model`,contextLength:4096},{id:`llama-2-70b`,name:`Llama 2 (70B)`,provider:`vllm`,description:`Meta's Llama 2 70B parameter model`,contextLength:4096},{id:`mistral-7b`,name:`Mistral (7B)`,provider:`vllm`,description:`Mistral AI's 7B parameter model`,contextLength:8192},{id:`mixtral-8x7b`,name:`Mixtral (8x7B)`,provider:`vllm`,description:`Mistral AI's Mixtral 8x7B MoE model`,contextLength:32768},{id:`custom`,name:`Custom Model`,provider:`vllm`,description:`Specify a custom model name`,contextLength:0}]},validators:{validateProviderConfig:config=>!!config.baseUrl}},openai:{id:`openai`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.openai.title`,name:`OpenAI`,descriptionKey:`settings.pages.providers.provider.openai.description`,description:`openai.com`,icon:`i-lobe-icons:openai`,defaultOptions:()=>({baseUrl:`https://api.openai.com/v1/`}),createProvider:async config=>createOpenAI(config.apiKey.trim(),config.baseUrl.trim()),capabilities:{listModels:async config=>(await listModels({...createOpenAI(config.apiKey.trim(),config.baseUrl.trim()).model()})).map(model=>({id:model.id,name:model.id,provider:`openai`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.baseUrl}},"openai-audio-speech":{id:`openai-audio-speech`,category:`speech`,tasks:[`text-to-speech`],nameKey:`settings.pages.providers.provider.openai.title`,name:`OpenAI`,descriptionKey:`settings.pages.providers.provider.openai.description`,description:`openai.com`,icon:`i-lobe-icons:openai`,defaultOptions:()=>({baseUrl:`https://api.openai.com/v1/`}),createProvider:async config=>createOpenAI(config.apiKey.trim(),config.baseUrl.trim()),capabilities:{listModels:async config=>(await listModels({...createOpenAI(config.apiKey.trim(),config.baseUrl.trim()).model()})).map(model=>({id:model.id,name:model.id,provider:`openai`,description:``,contextLength:0,deprecated:!1})),listVoices:async()=>[{id:`alloy`,name:`Alloy`,provider:`openai-audio-speech`,languages:[]},{id:`ash`,name:`Ash`,provider:`openai-audio-speech`,languages:[]},{id:`ballad`,name:`Ballad`,provider:`openai-audio-speech`,languages:[]},{id:`coral`,name:`Coral`,provider:`openai-audio-speech`,languages:[]},{id:`echo`,name:`Echo`,provider:`openai-audio-speech`,languages:[]},{id:`fable`,name:`Fable`,provider:`openai-audio-speech`,languages:[]},{id:`onyx`,name:`Onyx`,provider:`openai-audio-speech`,languages:[]},{id:`nova`,name:`Nova`,provider:`openai-audio-speech`,languages:[]},{id:`sage`,name:`Sage`,provider:`openai-audio-speech`,languages:[]},{id:`shimmer`,name:`Shimmer`,provider:`openai-audio-speech`,languages:[]},{id:`verse`,name:`Verse`,provider:`openai-audio-speech`,languages:[]}]},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.baseUrl}},"openai-audio-transcription":{id:`openai-audio-transcription`,category:`transcription`,tasks:[`speech-to-text`,`automatic-speech-recognition`,`asr`,`stt`],nameKey:`settings.pages.providers.provider.openai.title`,name:`OpenAI`,descriptionKey:`settings.pages.providers.provider.openai.description`,description:`openai.com`,icon:`i-lobe-icons:openai`,defaultOptions:()=>({baseUrl:`https://api.openai.com/v1/`}),createProvider:async config=>createOpenAI(config.apiKey.trim(),config.baseUrl.trim()),capabilities:{listModels:async config=>(await listModels({...createOpenAI(config.apiKey.trim(),config.baseUrl.trim()).model()})).map(model=>({id:model.id,name:model.id,provider:`openai`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.baseUrl}},"azure-ai-foundry":{id:`azure-ai-foundry`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.azure_ai_foundry.title`,name:`Azure AI Foundry`,descriptionKey:`settings.pages.providers.provider.azure_ai_foundry.description`,description:`azure.com`,icon:`i-lobe-icons:microsoft`,defaultOptions:()=>({}),createProvider:async config=>await createAzure({apiKey:async()=>config.apiKey.trim(),resourceName:config.resourceName,apiVersion:config.apiVersion}),capabilities:{listModels:async config=>[{id:config.modelId}].map(model=>({id:model.id,name:model.id,provider:`azure-ai-foundry`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.resourceName&&!!config.modelId}},anthropic:{id:`anthropic`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.anthropic.title`,name:`Anthropic`,descriptionKey:`settings.pages.providers.provider.anthropic.description`,description:`anthropic.com`,icon:`i-lobe-icons:anthropic`,defaultOptions:()=>({baseUrl:`https://api.anthropic.com/v1/`}),createProvider:async config=>createAnthropic(config.apiKey.trim(),config.baseUrl.trim()),capabilities:{listModels:async()=>[{id:`claude-3-7-sonnet-20250219`,name:`Claude 3.7 Sonnet`,provider:`anthropic`,description:``,contextLength:0,deprecated:!1},{id:`claude-3-5-sonnet-20241022`,name:`Claude 3.5 Sonnet (New)`,provider:`anthropic`,description:``,contextLength:0,deprecated:!1},{id:`claude-3-5-haiku-20241022`,name:`Claude 3.5 Haiku`,provider:`anthropic`,description:``,contextLength:0,deprecated:!1},{id:`claude-3-5-sonnet-20240620`,name:`Claude 3.5 Sonnet (Old)`,provider:`anthropic`,description:``,contextLength:0,deprecated:!1},{id:`claude-3-haiku-20240307`,name:`Claude 3 Haiku`,provider:`anthropic`,description:``,contextLength:0,deprecated:!1},{id:`claude-3-opus-20240229`,name:`Claude 3 Opus`,provider:`anthropic`,description:``,contextLength:0,deprecated:!1}]},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.baseUrl}},"google-generative-ai":{id:`google-generative-ai`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.google-generative-ai.title`,name:`Google Gemini`,descriptionKey:`settings.pages.providers.provider.google-generative-ai.description`,description:`ai.google.dev`,icon:`i-lobe-icons:gemini`,defaultOptions:()=>({baseUrl:`https://generativelanguage.googleapis.com/v1beta/openai/`}),createProvider:async config=>createGoogleGenerativeAI(config.apiKey.trim(),config.baseUrl.trim()),capabilities:{listModels:async config=>(await listModels({...createGoogleGenerativeAI(config.apiKey.trim(),config.baseUrl.trim()).model()})).map(model=>({id:model.id,name:model.id,provider:`google-generative-ai`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.baseUrl}},xai:{id:`xai`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.xai.title`,name:`xAI`,descriptionKey:`settings.pages.providers.provider.xai.description`,description:`x.ai`,icon:`i-lobe-icons:xai`,createProvider:async config=>createXAI(config.apiKey.trim(),config.baseUrl.trim()),capabilities:{listModels:async config=>(await listModels({...createXAI(config.apiKey.trim(),config.baseUrl.trim()).model()})).map(model=>({id:model.id,name:model.id,provider:`xai`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.baseUrl}},deepseek:{id:`deepseek`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.deepseek.title`,name:`DeepSeek`,descriptionKey:`settings.pages.providers.provider.deepseek.description`,description:`deepseek.com`,iconColor:`i-lobe-icons:deepseek`,defaultOptions:()=>({baseUrl:`https://api.deepseek.com/`}),createProvider:async config=>createDeepSeek(config.apiKey.trim(),config.baseUrl.trim()),capabilities:{listModels:async config=>(await listModels({...createDeepSeek(config.apiKey.trim(),config.baseUrl.trim()).model()})).map(model=>({id:model.id,name:model.id,provider:`deepseek`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.baseUrl}},elevenlabs:{id:`elevenlabs`,category:`speech`,tasks:[`text-to-speech`],nameKey:`settings.pages.providers.provider.elevenlabs.title`,name:`ElevenLabs`,descriptionKey:`settings.pages.providers.provider.elevenlabs.description`,description:`elevenlabs.io`,icon:`i-simple-icons:elevenlabs`,defaultOptions:()=>({baseUrl:`https://unspeech.hyp3r.link/v1/`,voiceSettings:{similarityBoost:.75,stability:.5}}),createProvider:async config=>createUnElevenLabs(config.apiKey.trim(),config.baseUrl.trim()),capabilities:{listModels:async()=>models.map(model=>({id:model.model_id,name:model.name,provider:`elevenlabs`,description:model.description,contextLength:0,deprecated:!1})),listVoices:async config=>{let provider=createUnElevenLabs(config.apiKey.trim(),config.baseUrl.trim()),voices=await listVoices({...provider.voice()}),ariaIndex=voices.findIndex(voice=>voice.name.includes(`Aria`)),billIndex=voices.findIndex(voice=>voice.name.includes(`Bill`)),startIndex=ariaIndex===-1?0:ariaIndex,endIndex=billIndex===-1?voices.length-1:billIndex,lowerIndex=Math.min(startIndex,endIndex),higherIndex=Math.max(startIndex,endIndex),rearrangedVoices=[...voices.slice(0,lowerIndex),...voices.slice(higherIndex+1),...voices.slice(lowerIndex,higherIndex+1)];return rearrangedVoices.map(voice=>({id:voice.id,name:voice.name,provider:`elevenlabs`,previewURL:voice.preview_audio_url,languages:voice.languages}))}},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.baseUrl}},"microsoft-speech":{id:`microsoft-speech`,category:`speech`,tasks:[`text-to-speech`],nameKey:`settings.pages.providers.provider.microsoft-speech.title`,name:`Microsoft / Azure Speech`,descriptionKey:`settings.pages.providers.provider.microsoft-speech.description`,description:`speech.microsoft.com`,iconColor:`i-lobe-icons:microsoft`,defaultOptions:()=>({baseUrl:`https://unspeech.hyp3r.link/v1/`}),createProvider:async config=>createUnMicrosoft(config.apiKey.trim(),config.baseUrl.trim()),capabilities:{listModels:async()=>[{id:`v1`,name:`v1`,provider:`microsoft-speech`,description:``,contextLength:0,deprecated:!1}],listVoices:async config=>{let provider=createUnMicrosoft(config.apiKey.trim(),config.baseUrl.trim()),voices=await listVoices({...provider.voice({region:config.region})});return voices.map(voice=>({id:voice.id,name:voice.name,provider:`microsoft-speech`,previewURL:voice.preview_audio_url,languages:voice.languages,gender:voice.labels?.gender}))}},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.baseUrl}},"alibaba-cloud-model-studio":{id:`alibaba-cloud-model-studio`,category:`speech`,tasks:[`text-to-speech`],nameKey:`settings.pages.providers.provider.alibaba-cloud-model-studio.title`,name:`Alibaba Cloud Model Studio`,descriptionKey:`settings.pages.providers.provider.alibaba-cloud-model-studio.description`,description:`bailian.console.aliyun.com`,iconColor:`i-lobe-icons:alibabacloud`,defaultOptions:()=>({baseUrl:`https://unspeech.hyp3r.link/v1/`}),createProvider:async config=>createUnAlibabaCloud(config.apiKey.trim(),config.baseUrl.trim()),capabilities:{listVoices:async config=>{let provider=createUnAlibabaCloud(config.apiKey.trim(),config.baseUrl.trim()),voices=await listVoices({...provider.voice()});return voices.map(voice=>({id:voice.id,name:voice.name,provider:`alibaba-cloud-model-studio`,previewURL:voice.preview_audio_url,languages:voice.languages,gender:voice.labels?.gender}))},listModels:async()=>[{id:`cozyvoice-v1`,name:`CozyVoice`,provider:`alibaba-cloud-model-studio`,description:``,contextLength:0,deprecated:!1},{id:`cozyvoice-v2`,name:`CozyVoice (New)`,provider:`alibaba-cloud-model-studio`,description:``,contextLength:0,deprecated:!1}]},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.baseUrl}},volcengine:{id:`volcengine`,category:`speech`,tasks:[`text-to-speech`],nameKey:`settings.pages.providers.provider.volcengine.title`,name:`settings.pages.providers.provider.volcengine.title`,descriptionKey:`settings.pages.providers.provider.volcengine.description`,description:`volcengine.com`,iconColor:`i-lobe-icons:volcengine`,defaultOptions:()=>({baseUrl:`https://unspeech.hyp3r.link/v1/`}),createProvider:async config=>createUnVolcengine(config.apiKey.trim(),config.baseUrl.trim()),capabilities:{listVoices:async config=>{let provider=createUnVolcengine(config.apiKey.trim(),config.baseUrl.trim()),voices=await listVoices({...provider.voice()});return voices.map(voice=>({id:voice.id,name:voice.name,provider:`volcano-engine`,previewURL:voice.preview_audio_url,languages:voice.languages,gender:voice.labels?.gender}))},listModels:async()=>[{id:`v1`,name:`v1`,provider:`volcano-engine`,description:``,contextLength:0,deprecated:!1}]},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.baseUrl&&!!config.app&&!!config.app.appId}},"together-ai":{id:`together-ai`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.together.title`,name:`Together.ai`,descriptionKey:`settings.pages.providers.provider.together.description`,description:`together.ai`,iconColor:`i-lobe-icons:together`,createProvider:async config=>createTogetherAI(config.apiKey.trim(),config.baseUrl.trim()),capabilities:{listModels:async config=>(await listModels({...createTogetherAI(config.apiKey.trim(),config.baseUrl.trim()).model()})).map(model=>({id:model.id,name:model.id,provider:`together-ai`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.baseUrl}},"novita-ai":{id:`novita-ai`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.novita.title`,name:`Novita`,descriptionKey:`settings.pages.providers.provider.novita.description`,description:`novita.ai`,iconColor:`i-lobe-icons:novita`,createProvider:async config=>createNovita(config.apiKey.trim(),config.baseUrl.trim()),capabilities:{listModels:async config=>(await listModels({...createNovita(config.apiKey.trim(),config.baseUrl.trim()).model()})).map(model=>({id:model.id,name:model.id,provider:`novita-ai`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.baseUrl}},"fireworks-ai":{id:`fireworks-ai`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.fireworks.title`,name:`Fireworks.ai`,descriptionKey:`settings.pages.providers.provider.fireworks.description`,description:`fireworks.ai`,icon:`i-lobe-icons:fireworks`,createProvider:async config=>createFireworks(config.apiKey.trim(),config.baseUrl.trim()),capabilities:{listModels:async config=>(await listModels({...createFireworks(config.apiKey.trim(),config.baseUrl.trim()).model()})).map(model=>({id:model.id,name:model.id,provider:`fireworks-ai`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.baseUrl}},"featherless-ai":{id:`featherless-ai`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.featherless.title`,name:`Featherless.ai`,descriptionKey:`settings.pages.providers.provider.featherless.description`,description:`featherless.ai`,icon:`i-lobe-icons:featherless-ai`,defaultOptions:()=>({baseUrl:`https://api.featherless.ai/v1/`}),createProvider:async config=>createOpenAI(config.apiKey.trim(),config.baseUrl.trim()),capabilities:{listModels:async config=>(await listModels({...createOpenAI(config.apiKey.trim(),config.baseUrl.trim()).model()})).map(model=>({id:model.id,name:model.id,provider:`featherless-ai`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.baseUrl}},"cloudflare-workers-ai":{id:`cloudflare-workers-ai`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.cloudflare-workers-ai.title`,name:`Cloudflare Workers AI`,descriptionKey:`settings.pages.providers.provider.cloudflare-workers-ai.description`,description:`cloudflare.com`,iconColor:`i-lobe-icons:cloudflare`,createProvider:async config=>createWorkersAI(config.apiKey.trim(),config.accountId),capabilities:{listModels:async()=>[]},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.accountId}},"perplexity-ai":{id:`perplexity-ai`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.perplexity.title`,name:`Perplexity`,descriptionKey:`settings.pages.providers.provider.perplexity.description`,description:`perplexity.ai`,icon:`i-lobe-icons:perplexity`,defaultOptions:()=>({baseUrl:`https://api.perplexity.ai`}),createProvider:async config=>createPerplexity(config.apiKey.trim(),config.baseUrl.trim()),capabilities:{listModels:async()=>[{id:`sonar-small-online`,name:`Sonar Small (Online)`,provider:`perplexity-ai`,description:`Efficient model with online search capabilities`,contextLength:12e3},{id:`sonar-medium-online`,name:`Sonar Medium (Online)`,provider:`perplexity-ai`,description:`Balanced model with online search capabilities`,contextLength:12e3},{id:`sonar-large-online`,name:`Sonar Large (Online)`,provider:`perplexity-ai`,description:`Powerful model with online search capabilities`,contextLength:12e3},{id:`codey-small`,name:`Codey Small`,provider:`perplexity-ai`,description:`Specialized for code generation and understanding`,contextLength:12e3},{id:`codey-large`,name:`Codey Large`,provider:`perplexity-ai`,description:`Advanced code generation and understanding`,contextLength:12e3}]},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.baseUrl}},"mistral-ai":{id:`mistral-ai`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.mistral.title`,name:`Mistral`,descriptionKey:`settings.pages.providers.provider.mistral.description`,description:`mistral.ai`,iconColor:`i-lobe-icons:mistral`,createProvider:async config=>createMistral(config.apiKey.trim(),config.baseUrl.trim()),capabilities:{listModels:async config=>(await listModels({...createMistral(config.apiKey.trim(),config.baseUrl.trim()).model()})).map(model=>({id:model.id,name:model.id,provider:`mistral-ai`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.baseUrl}},"moonshot-ai":{id:`moonshot-ai`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.moonshot.title`,name:`Moonshot AI`,descriptionKey:`settings.pages.providers.provider.moonshot.description`,description:`moonshot.ai`,icon:`i-lobe-icons:moonshot`,createProvider:async config=>createMoonshot(config.apiKey.trim(),config.baseUrl.trim()),capabilities:{listModels:async config=>(await listModels({...createMoonshot(config.apiKey.trim(),config.baseUrl.trim()).model()})).map(model=>({id:model.id,name:model.id,provider:`moonshot-ai`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.baseUrl}},player2:{id:`player2`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.player2.title`,name:`Player2`,descriptionKey:`settings.pages.providers.provider.player2.description`,description:`player2.game`,icon:`i-lobe-icons:player2`,defaultOptions:()=>({baseUrl:`http://localhost:4315/v1/`}),createProvider:config=>createPlayer2(config.baseUrl.trim()),capabilities:{listModels:async()=>[{id:`player2-model`,name:`Player2 Model`,provider:`player2`}]},validators:{validateProviderConfig:async config=>!!config.baseUrl&&await fetch(`${config.baseUrl}/health`,{method:`GET`,headers:{"player2-game-key":`airi`}}).then(response=>response.ok).catch(()=>!1)}},"player2-speech":{id:`player2-speech`,category:`speech`,tasks:[`text-to-speech`],nameKey:`settings.pages.providers.provider.player2.title`,name:`Player2 Speech`,descriptionKey:`settings.pages.providers.provider.player2.description`,description:`player2.game`,icon:`i-lobe-icons:player2`,defaultOptions:()=>({baseUrl:`http://localhost:4315/v1/`}),createProvider:async config=>createPlayer2(config.baseUrl.trim(),`airi`),capabilities:{listVoices:async()=>await fetch(`http://localhost:4315/v1/tts/voices`).then(res=>res.json()).then(({voices})=>voices.map(({id:id$1,language,name:name$2,gender})=>({id:id$1,name:name$2,provider:`player2-speech`,gender,languages:[{american_english:{code:`en`,title:`English`},british_english:{code:`en`,title:`English`},japanese:{code:`ja`,title:`Japanese`},mandarin_chinese:{code:`zh`,title:`Chinese`},spanish:{code:`es`,title:`Spanish`},french:{code:`fr`,title:`French`},hindi:{code:`hi`,title:`Hindi`},italian:{code:`it`,title:`Italian`},brazilian_portuguese:{code:`pt`,title:`Portuguese`}}[language]]})))},validators:{validateProviderConfig:config=>!!config.baseUrl}}};async function validateProvider(providerId){let config=providerCredentials.value[providerId];if(!config)return!1;let metadata=providerMetadata[providerId];return metadata?await metadata.validators.validateProviderConfig(config):!1}let configuredProviders=ref({});function initializeProvider(providerId){if(!providerCredentials.value[providerId]){let metadata=providerMetadata[providerId],defaultOptions=metadata.defaultOptions?.()||{};providerCredentials.value[providerId]={baseUrl:defaultOptions.baseUrl||``}}}Object.keys(providerMetadata).forEach(initializeProvider);async function updateConfigurationStatus(){await Promise.all(Object.keys(providerMetadata).map(async providerId=>{configuredProviders.value[providerId]=await validateProvider(providerId)}))}updateConfigurationStatus(),watch(providerCredentials,updateConfigurationStatus,{deep:!0});let availableProviders=computed(()=>Object.keys(providerMetadata).filter(providerId=>configuredProviders.value[providerId])),availableModels=ref({}),isLoadingModels=ref({}),modelLoadError=ref({});async function fetchModelsForProvider(providerId){let config=providerCredentials.value[providerId];if(!config)return[];let metadata=providerMetadata[providerId];if(!metadata)return[];isLoadingModels.value[providerId]=!0,modelLoadError.value[providerId]=null;try{let models$1=metadata.capabilities.listModels?await metadata.capabilities.listModels(config):[];return availableModels.value[providerId]=models$1.map(model=>({id:model.id,name:model.name,description:model.description,contextLength:model.contextLength,deprecated:model.deprecated,provider:providerId})),availableModels.value[providerId]}catch(error){return console.error(`Error fetching models for ${providerId}:`,error),modelLoadError.value[providerId]=error instanceof Error?error.message:`Unknown error`,[]}finally{isLoadingModels.value[providerId]=!1}}function getModelsForProvider(providerId){return availableModels.value[providerId]||[]}let allAvailableModels=computed(()=>{let models$1=[];for(let providerId of availableProviders.value)models$1.push(...availableModels.value[providerId]||[]);return models$1});async function loadModelsForConfiguredProviders(){for(let providerId of availableProviders.value)providerMetadata[providerId].capabilities.listModels&&await fetchModelsForProvider(providerId)}function getProviderMetadata(providerId){let metadata=providerMetadata[providerId];if(!metadata)throw Error(`Provider metadata for ${providerId} not found`);return{...metadata,localizedName:t(metadata.nameKey,metadata.name),localizedDescription:t(metadata.descriptionKey,metadata.description)}}let allProvidersMetadata=computed(()=>Object.values(providerMetadata).map(metadata=>({...metadata,localizedName:t(metadata.nameKey,metadata.name),localizedDescription:t(metadata.descriptionKey,metadata.description),configured:configuredProviders.value[metadata.id]||!1})));async function getProviderInstance(providerId){let config=providerCredentials.value[providerId];if(!config)throw Error(`Provider credentials for ${providerId} not found`);let metadata=providerMetadata[providerId];if(!metadata)throw Error(`Provider metadata for ${providerId} not found`);try{return await metadata.createProvider(config)}catch(error){throw console.error(`Error creating provider instance for ${providerId}:`,error),error}}let availableProvidersMetadata=computedAsync(async()=>{let providers=[];for(let provider of allProvidersMetadata.value){let p$5=getProviderMetadata(provider.id),isAvailableBy=p$5.isAvailableBy||(()=>!0),isAvailable=await isAvailableBy();isAvailable&&providers.push(provider)}return providers},[]),allChatProvidersMetadata=computed(()=>availableProvidersMetadata.value.filter(metadata=>metadata.category===`chat`)),allAudioSpeechProvidersMetadata=computed(()=>availableProvidersMetadata.value.filter(metadata=>metadata.category===`speech`)),allAudioTranscriptionProvidersMetadata=computed(()=>availableProvidersMetadata.value.filter(metadata=>metadata.category===`transcription`)),configuredChatProvidersMetadata=computed(()=>allChatProvidersMetadata.value.filter(metadata=>configuredProviders.value[metadata.id])),configuredSpeechProvidersMetadata=computed(()=>allAudioSpeechProvidersMetadata.value.filter(metadata=>configuredProviders.value[metadata.id])),configuredTranscriptionProvidersMetadata=computed(()=>allAudioTranscriptionProvidersMetadata.value.filter(metadata=>configuredProviders.value[metadata.id]));function getProviderConfig(providerId){return providerCredentials.value[providerId]}return{providers:providerCredentials,getProviderConfig,availableProviders,configuredProviders,providerMetadata,getProviderMetadata,allProvidersMetadata,initializeProvider,validateProvider,availableModels,isLoadingModels,modelLoadError,fetchModelsForProvider,getModelsForProvider,allAvailableModels,loadModelsForConfiguredProviders,getProviderInstance,availableProvidersMetadata,allChatProvidersMetadata,allAudioSpeechProvidersMetadata,allAudioTranscriptionProvidersMetadata,configuredChatProvidersMetadata,configuredSpeechProvidersMetadata,configuredTranscriptionProvidersMetadata}}),useConsciousnessStore=defineStore(`consciousness`,()=>{let providersStore=useProvidersStore(),activeProvider=useLocalStorage(`settings/consciousness/active-provider`,``),activeModel=useLocalStorage(`settings/consciousness/active-model`,``),activeCustomModelName=useLocalStorage(`settings/consciousness/active-custom-model`,``),expandedDescriptions=ref({}),modelSearchQuery=ref(``),supportsModelListing=computed(()=>providersStore.getProviderMetadata(activeProvider.value)?.capabilities.listModels!==void 0),providerModels=computed(()=>providersStore.getModelsForProvider(activeProvider.value)),isLoadingActiveProviderModels=computed(()=>providersStore.isLoadingModels[activeProvider.value]||!1),activeProviderModelError=computed(()=>providersStore.modelLoadError[activeProvider.value]||null),filteredModels=computed(()=>{if(!modelSearchQuery.value.trim())return providerModels.value;let query=modelSearchQuery.value.toLowerCase().trim();return providerModels.value.filter(model=>model.name.toLowerCase().includes(query)||model.id.toLowerCase().includes(query)||model.description&&model.description.toLowerCase().includes(query))});function resetModelSelection(){activeModel.value=``,activeCustomModelName.value=``,expandedDescriptions.value={},modelSearchQuery.value=``}async function loadModelsForProvider(provider){provider&&providersStore.getProviderMetadata(provider)?.capabilities.listModels!==void 0&&await providersStore.fetchModelsForProvider(provider)}async function getModelsForProvider(provider){return provider&&providersStore.getProviderMetadata(provider)?.capabilities.listModels!==void 0?providersStore.getModelsForProvider(provider):[]}let configured=computed(()=>!!activeProvider.value&&!!activeModel.value);return{configured,activeProvider,activeModel,customModelName:activeCustomModelName,expandedDescriptions,modelSearchQuery,supportsModelListing,providerModels,isLoadingActiveProviderModels,activeProviderModelError,filteredModels,resetModelSelection,loadModelsForProvider,getModelsForProvider}}),generateSpeech=async options$1=>(options$1.fetch??globalThis.fetch)(requestURL(`audio/speech`,options$1.baseURL),{body:requestBody(options$1),headers:requestHeaders({"Content-Type":`application/json`,...options$1.headers},options$1.apiKey),method:`POST`,signal:options$1.abortSignal}).then(responseCatch).then(async res=>res.arrayBuffer()),noncharacter=/[\u0000-\u0008\u000B\u000C\u000E-\u001F]/g;function escape(value$1,subset$4,unsafe$2){let result=clean(value$1);return unsafe$2?result.replace(unsafe$2,encode):encode(result);function encode(value$2){return stringifyEntitiesLight(value$2,{subset:subset$4})}}function clean(value$1){return String(value$1||``).replace(noncharacter,``)}const unsafe$1=/]]>/g,subset$3=[`>`];function cdata(node$1){return``}function comment(node$1){return``}const subset$2=[` `,` +`);buffer$1=lines.pop()??``;for(let line of lines)try{let[chunk2,isEnd]=parseChunk(line);if(isEnd)break;chunk2&&controller.enqueue(chunk2)}catch(error){controller.error(error)}}})).pipeTo(new WritableStream({abort:reason=>{chunkCtrl.error(reason),stepCtrl.error(reason),textCtrl.error(reason)},close:()=>{options2.onEvent?.({finishReason,type:`finish`,usage})},write:async chunk=>{if(options2.onChunk?.(chunk),chunkCtrl.enqueue(chunk),usage=chunk.usage,chunk.choices==null||chunk.choices.length===0)return;let choice=chunk.choices[0];choice.delta.tool_calls&&(shouldOutputText=!1);let{delta,finish_reason,index:index$1,...rest}=choice,choiceSnapshot=step.choices[index$1]??={finishReason:finish_reason,index:index$1,message:{role:`assistant`}};if(finish_reason!==void 0){if(finishReason=finish_reason,step.finishReason=finish_reason,choiceSnapshot.finishReason=finish_reason,finish_reason===`length`)throw new XSAIError$2(`length exceeded`);if(finish_reason===`content_filter`)throw new XSAIError$2(`content filter`)}Object.assign(choiceSnapshot,rest);let{content:content$2,refusal,tool_calls,...rests}=delta,message$1=choiceSnapshot.message;Object.assign(message$1,rests),refusal!==void 0&&(message$1.refusal=(message$1.refusal||``)+(refusal||``),options2.onEvent?.({refusal:message$1.refusal,type:`refusal`})),content$2!==void 0&&(message$1.content=(message$1.content||``)+(content$2||``),shouldOutputText&&textCtrl?.enqueue(content$2),options2.onEvent?.({text:content$2,type:`text-delta`}));for(let tool_call of tool_calls||[]){options2.onEvent?.({toolCall:tool_call,type:`tool-call-delta`});let{function:fn$6,id:id$1,index:index2,type}=tool_call;message$1.toolCalls??={};let toolCall=message$1.toolCalls[index2]??={function:{arguments:``,name:fn$6.name,parsedArguments:{}},id:id$1,index:index2,type};toolCall.function.arguments+=fn$6.arguments}let state=choiceState[index$1]??={calledToolCallIndex:new Set,currentToolIndex:null,endedToolCallIndex:new Set,index:index$1,toolCallErrors:{},toolCallResults:{}};finish_reason&&state.currentToolIndex!==null&&endToolCallByIndex(state,state.currentToolIndex);for(let toolCall of delta.tool_calls||[])state.currentToolIndex!==toolCall.index&&state.currentToolIndex!==null&&endToolCallByIndex(state,state.currentToolIndex),state.calledToolCallIndex.add(toolCall.index),state.currentToolIndex=toolCall.index}}))),step.messages.push({content:step.choices[0]?.message.content??``,refusal:step.choices[0]?.message.refusal,role:`assistant`,tool_calls:Object.values(step.choices[0]?.message.toolCalls??{}).map(toolCall=>({function:{arguments:toolCall.function.arguments,name:toolCall.function.name},id:toolCall.id,index:toolCall.index,type:toolCall.type}))}),await Promise.allSettled(step.choices.map(async choice=>{let state=choiceState[choice.index];return Promise.allSettled([...state.endedToolCallIndex].map(async idx=>{let toolCall=choice.message.toolCalls[idx];if(step.toolCalls.push({args:toolCall.function.arguments,toolCallId:toolCall.id,toolCallType:`function`,toolName:toolCall.function.name}),!state.toolCallResults[toolCall.id]){options2.onEvent?.({toolCall,type:`tool-call`});try{let{completionToolResult,message:message$1,parsedArgs,result}=await executeTool({abortSignal:options2.abortSignal,messages:options2.messages,toolCall,tools:options2.tools});toolCall.function.parsedArguments=parsedArgs,state.toolCallResults[toolCall.id]=result,step.messages.push(message$1),step.toolResults.push(completionToolResult),options2.onEvent?.({id:toolCall.id,result,type:`tool-call-result`})}catch(error){state.toolCallErrors[idx]=error}}}))})),step.stepType=determineStepType({finishReason:step.finishReason,maxSteps,stepsLength:steps$2.length,toolCallsLength:step.toolCalls.length}),steps$2.push(step),stepCtrl.enqueue(step),options2.onStepFinish?.(step),!shouldOutputText)return async()=>stepOne({...options2,messages:step.messages})},invokeFunctionCalls=async()=>{let ret=await stepOne(options$1);for(;typeof ret==`function`&&steps$2.length{chunkCtrl.error(error),stepCtrl.error(error),textCtrl.error(error)}),Promise.resolve({chunkStream,stepStream,textStream})},strictJsonSchema=schema=>({...schema,additionalProperties:!1}),missingDependenciesUrl=`https://xsai.js.org/docs/packages-top/xsschema#missing-dependencies`,tryImport=async(result,name$2)=>{try{return await result}catch{throw Error(`xsschema: Missing dependencies "${name$2}". see ${missingDependenciesUrl}`)}},getToJsonSchemaFn=async vendor=>{switch(vendor){case`arktype`:return __vitePreload(()=>import(`./arktype-C-GObzDh-DWDEUAMn.js`),[]).then(async({getToJsonSchemaFn:getToJsonSchemaFn2})=>getToJsonSchemaFn2());case`effect`:return __vitePreload(()=>import(`./effect-DBSVVF8G-DSdeZPIg.js`),[]).then(async({getToJsonSchemaFn:getToJsonSchemaFn2})=>getToJsonSchemaFn2());case`sury`:return __vitePreload(()=>import(`./sury-GtnkadyM-C_RygoD3.js`),[]).then(async({getToJsonSchemaFn:getToJsonSchemaFn2})=>getToJsonSchemaFn2());case`valibot`:return __vitePreload(()=>import(`./valibot-CbgwcZn_-kvK6hLPP.js`),[]).then(async({getToJsonSchemaFn:getToJsonSchemaFn2})=>getToJsonSchemaFn2());case`zod`:return __vitePreload(()=>import(`./zod-CD8IEU5z-DbMl9YTb.js`),[]).then(async({getToJsonSchemaFn:getToJsonSchemaFn2})=>getToJsonSchemaFn2());default:throw Error(`xsschema: Unsupported schema vendor "${vendor}". see https://xsai.js.org/docs/packages-top/xsschema#unsupported-schema-vendor`)}},toJsonSchema=async schema=>getToJsonSchemaFn(schema[`~standard`].vendor).then(async toJsonSchema2=>toJsonSchema2(schema)),tool=async({description,execute,name:name$2,parameters})=>{let schema=await toJsonSchema(parameters);return{execute,function:{description,name:name$2,parameters:strictJsonSchema(schema),strict:!0},type:`function`}};var util;(function(util$1){util$1.assertEqual=_$2=>{};function assertIs(_arg){}util$1.assertIs=assertIs;function assertNever(_x$1){throw Error()}util$1.assertNever=assertNever,util$1.arrayToEnum=items=>{let obj={};for(let item of items)obj[item]=item;return obj},util$1.getValidEnumValues=obj=>{let validKeys=util$1.objectKeys(obj).filter(k$4=>typeof obj[obj[k$4]]!=`number`),filtered={};for(let k$4 of validKeys)filtered[k$4]=obj[k$4];return util$1.objectValues(filtered)},util$1.objectValues=obj=>util$1.objectKeys(obj).map(function(e$3){return obj[e$3]}),util$1.objectKeys=typeof Object.keys==`function`?obj=>Object.keys(obj):object=>{let keys$3=[];for(let key$2 in object)Object.prototype.hasOwnProperty.call(object,key$2)&&keys$3.push(key$2);return keys$3},util$1.find=(arr,checker)=>{for(let item of arr)if(checker(item))return item},util$1.isInteger=typeof Number.isInteger==`function`?val=>Number.isInteger(val):val=>typeof val==`number`&&Number.isFinite(val)&&Math.floor(val)===val;function joinValues(array,separator=` | `){return array.map(val=>typeof val==`string`?`'${val}'`:val).join(separator)}util$1.joinValues=joinValues,util$1.jsonStringifyReplacer=(_$2,value$1)=>typeof value$1==`bigint`?value$1.toString():value$1})(util||={});var objectUtil;(function(objectUtil$1){objectUtil$1.mergeShapes=(first,second)=>({...first,...second})})(objectUtil||={});const ZodParsedType=util.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),getParsedType=data$12=>{let t=typeof data$12;switch(t){case`undefined`:return ZodParsedType.undefined;case`string`:return ZodParsedType.string;case`number`:return Number.isNaN(data$12)?ZodParsedType.nan:ZodParsedType.number;case`boolean`:return ZodParsedType.boolean;case`function`:return ZodParsedType.function;case`bigint`:return ZodParsedType.bigint;case`symbol`:return ZodParsedType.symbol;case`object`:return Array.isArray(data$12)?ZodParsedType.array:data$12===null?ZodParsedType.null:data$12.then&&typeof data$12.then==`function`&&data$12.catch&&typeof data$12.catch==`function`?ZodParsedType.promise:typeof Map<`u`&&data$12 instanceof Map?ZodParsedType.map:typeof Set<`u`&&data$12 instanceof Set?ZodParsedType.set:typeof Date<`u`&&data$12 instanceof Date?ZodParsedType.date:ZodParsedType.object;default:return ZodParsedType.unknown}},ZodIssueCode=util.arrayToEnum([`invalid_type`,`invalid_literal`,`custom`,`invalid_union`,`invalid_union_discriminator`,`invalid_enum_value`,`unrecognized_keys`,`invalid_arguments`,`invalid_return_type`,`invalid_date`,`invalid_string`,`too_small`,`too_big`,`invalid_intersection_types`,`not_multiple_of`,`not_finite`]);var ZodError=class ZodError extends Error{get errors(){return this.issues}constructor(issues){super(),this.issues=[],this.addIssue=sub=>{this.issues=[...this.issues,sub]},this.addIssues=(subs=[])=>{this.issues=[...this.issues,...subs]};let actualProto=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,actualProto):this.__proto__=actualProto,this.name=`ZodError`,this.issues=issues}format(_mapper){let mapper=_mapper||function(issue){return issue.message},fieldErrors={_errors:[]},processError=error=>{for(let issue of error.issues)if(issue.code===`invalid_union`)issue.unionErrors.map(processError);else if(issue.code===`invalid_return_type`)processError(issue.returnTypeError);else if(issue.code===`invalid_arguments`)processError(issue.argumentsError);else if(issue.path.length===0)fieldErrors._errors.push(mapper(issue));else{let curr=fieldErrors,i$1=0;for(;i$1issue.message){let fieldErrors={},formErrors=[];for(let sub of this.issues)if(sub.path.length>0){let firstEl=sub.path[0];fieldErrors[firstEl]=fieldErrors[firstEl]||[],fieldErrors[firstEl].push(mapper(sub))}else formErrors.push(mapper(sub));return{formErrors,fieldErrors}}get formErrors(){return this.flatten()}};ZodError.create=issues=>{let error=new ZodError(issues);return error};const errorMap=(issue,_ctx)=>{let message$1;switch(issue.code){case ZodIssueCode.invalid_type:message$1=issue.received===ZodParsedType.undefined?`Required`:`Expected ${issue.expected}, received ${issue.received}`;break;case ZodIssueCode.invalid_literal:message$1=`Invalid literal value, expected ${JSON.stringify(issue.expected,util.jsonStringifyReplacer)}`;break;case ZodIssueCode.unrecognized_keys:message$1=`Unrecognized key(s) in object: ${util.joinValues(issue.keys,`, `)}`;break;case ZodIssueCode.invalid_union:message$1=`Invalid input`;break;case ZodIssueCode.invalid_union_discriminator:message$1=`Invalid discriminator value. Expected ${util.joinValues(issue.options)}`;break;case ZodIssueCode.invalid_enum_value:message$1=`Invalid enum value. Expected ${util.joinValues(issue.options)}, received '${issue.received}'`;break;case ZodIssueCode.invalid_arguments:message$1=`Invalid function arguments`;break;case ZodIssueCode.invalid_return_type:message$1=`Invalid function return type`;break;case ZodIssueCode.invalid_date:message$1=`Invalid date`;break;case ZodIssueCode.invalid_string:typeof issue.validation==`object`?`includes`in issue.validation?(message$1=`Invalid input: must include "${issue.validation.includes}"`,typeof issue.validation.position==`number`&&(message$1=`${message$1} at one or more positions greater than or equal to ${issue.validation.position}`)):`startsWith`in issue.validation?message$1=`Invalid input: must start with "${issue.validation.startsWith}"`:`endsWith`in issue.validation?message$1=`Invalid input: must end with "${issue.validation.endsWith}"`:util.assertNever(issue.validation):message$1=issue.validation===`regex`?`Invalid`:`Invalid ${issue.validation}`;break;case ZodIssueCode.too_small:message$1=issue.type===`array`?`Array must contain ${issue.exact?`exactly`:issue.inclusive?`at least`:`more than`} ${issue.minimum} element(s)`:issue.type===`string`?`String must contain ${issue.exact?`exactly`:issue.inclusive?`at least`:`over`} ${issue.minimum} character(s)`:issue.type===`number`||issue.type===`bigint`?`Number must be ${issue.exact?`exactly equal to `:issue.inclusive?`greater than or equal to `:`greater than `}${issue.minimum}`:issue.type===`date`?`Date must be ${issue.exact?`exactly equal to `:issue.inclusive?`greater than or equal to `:`greater than `}${new Date(Number(issue.minimum))}`:`Invalid input`;break;case ZodIssueCode.too_big:message$1=issue.type===`array`?`Array must contain ${issue.exact?`exactly`:issue.inclusive?`at most`:`less than`} ${issue.maximum} element(s)`:issue.type===`string`?`String must contain ${issue.exact?`exactly`:issue.inclusive?`at most`:`under`} ${issue.maximum} character(s)`:issue.type===`number`?`Number must be ${issue.exact?`exactly`:issue.inclusive?`less than or equal to`:`less than`} ${issue.maximum}`:issue.type===`bigint`?`BigInt must be ${issue.exact?`exactly`:issue.inclusive?`less than or equal to`:`less than`} ${issue.maximum}`:issue.type===`date`?`Date must be ${issue.exact?`exactly`:issue.inclusive?`smaller than or equal to`:`smaller than`} ${new Date(Number(issue.maximum))}`:`Invalid input`;break;case ZodIssueCode.custom:message$1=`Invalid input`;break;case ZodIssueCode.invalid_intersection_types:message$1=`Intersection results could not be merged`;break;case ZodIssueCode.not_multiple_of:message$1=`Number must be a multiple of ${issue.multipleOf}`;break;case ZodIssueCode.not_finite:message$1=`Number must be finite`;break;default:message$1=_ctx.defaultError,util.assertNever(issue)}return{message:message$1}};var en_default$1=errorMap;let overrideErrorMap=en_default$1;function getErrorMap(){return overrideErrorMap}const makeIssue=params=>{let{data:data$12,path,errorMaps,issueData}=params,fullPath=[...path,...issueData.path||[]],fullIssue={...issueData,path:fullPath};if(issueData.message!==void 0)return{...issueData,path:fullPath,message:issueData.message};let errorMessage=``,maps=errorMaps.filter(m$3=>!!m$3).slice().reverse();for(let map of maps)errorMessage=map(fullIssue,{data:data$12,defaultError:errorMessage}).message;return{...issueData,path:fullPath,message:errorMessage}};function addIssueToContext(ctx,issueData){let overrideMap=getErrorMap(),issue=makeIssue({issueData,data:ctx.data,path:ctx.path,errorMaps:[ctx.common.contextualErrorMap,ctx.schemaErrorMap,overrideMap,overrideMap===en_default$1?void 0:en_default$1].filter(x$3=>!!x$3)});ctx.common.issues.push(issue)}var ParseStatus=class ParseStatus{constructor(){this.value=`valid`}dirty(){this.value===`valid`&&(this.value=`dirty`)}abort(){this.value!==`aborted`&&(this.value=`aborted`)}static mergeArray(status,results){let arrayValue=[];for(let s$1 of results){if(s$1.status===`aborted`)return INVALID;s$1.status===`dirty`&&status.dirty(),arrayValue.push(s$1.value)}return{status:status.value,value:arrayValue}}static async mergeObjectAsync(status,pairs){let syncPairs=[];for(let pair of pairs){let key$2=await pair.key,value$1=await pair.value;syncPairs.push({key:key$2,value:value$1})}return ParseStatus.mergeObjectSync(status,syncPairs)}static mergeObjectSync(status,pairs){let finalObject={};for(let pair of pairs){let{key:key$2,value:value$1}=pair;if(key$2.status===`aborted`||value$1.status===`aborted`)return INVALID;key$2.status===`dirty`&&status.dirty(),value$1.status===`dirty`&&status.dirty(),key$2.value!==`__proto__`&&(value$1.value!==void 0||pair.alwaysSet)&&(finalObject[key$2.value]=value$1.value)}return{status:status.value,value:finalObject}}};const INVALID=Object.freeze({status:`aborted`}),DIRTY=value$1=>({status:`dirty`,value:value$1}),OK=value$1=>({status:`valid`,value:value$1}),isAborted=x$3=>x$3.status===`aborted`,isDirty=x$3=>x$3.status===`dirty`,isValid=x$3=>x$3.status===`valid`,isAsync=x$3=>typeof Promise<`u`&&x$3 instanceof Promise;var errorUtil;(function(errorUtil$1){errorUtil$1.errToObj=message$1=>typeof message$1==`string`?{message:message$1}:message$1||{},errorUtil$1.toString=message$1=>typeof message$1==`string`?message$1:message$1?.message})(errorUtil||={});var ParseInputLazyPath=class{constructor(parent,value$1,path,key$2){this._cachedPath=[],this.parent=parent,this.data=value$1,this._path=path,this._key=key$2}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};const handleResult=(ctx,result)=>{if(isValid(result))return{success:!0,data:result.value};if(!ctx.common.issues.length)throw Error(`Validation failed but no issues detected.`);return{success:!1,get error(){if(this._error)return this._error;let error=new ZodError(ctx.common.issues);return this._error=error,this._error}}};function processCreateParams(params){if(!params)return{};let{errorMap:errorMap$1,invalid_type_error,required_error,description}=params;if(errorMap$1&&(invalid_type_error||required_error))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(errorMap$1)return{errorMap:errorMap$1,description};let customMap=(iss,ctx)=>{let{message:message$1}=params;return iss.code===`invalid_enum_value`?{message:message$1??ctx.defaultError}:ctx.data===void 0?{message:message$1??required_error??ctx.defaultError}:iss.code===`invalid_type`?{message:message$1??invalid_type_error??ctx.defaultError}:{message:ctx.defaultError}};return{errorMap:customMap,description}}var ZodType=class{get description(){return this._def.description}_getType(input){return getParsedType(input.data)}_getOrReturnCtx(input,ctx){return ctx||{common:input.parent.common,data:input.data,parsedType:getParsedType(input.data),schemaErrorMap:this._def.errorMap,path:input.path,parent:input.parent}}_processInputParams(input){return{status:new ParseStatus,ctx:{common:input.parent.common,data:input.data,parsedType:getParsedType(input.data),schemaErrorMap:this._def.errorMap,path:input.path,parent:input.parent}}}_parseSync(input){let result=this._parse(input);if(isAsync(result))throw Error(`Synchronous parse encountered promise.`);return result}_parseAsync(input){let result=this._parse(input);return Promise.resolve(result)}parse(data$12,params){let result=this.safeParse(data$12,params);if(result.success)return result.data;throw result.error}safeParse(data$12,params){let ctx={common:{issues:[],async:params?.async??!1,contextualErrorMap:params?.errorMap},path:params?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:data$12,parsedType:getParsedType(data$12)},result=this._parseSync({data:data$12,path:ctx.path,parent:ctx});return handleResult(ctx,result)}"~validate"(data$12){let ctx={common:{issues:[],async:!!this[`~standard`].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:data$12,parsedType:getParsedType(data$12)};if(!this[`~standard`].async)try{let result=this._parseSync({data:data$12,path:[],parent:ctx});return isValid(result)?{value:result.value}:{issues:ctx.common.issues}}catch(err){err?.message?.toLowerCase()?.includes(`encountered`)&&(this[`~standard`].async=!0),ctx.common={issues:[],async:!0}}return this._parseAsync({data:data$12,path:[],parent:ctx}).then(result=>isValid(result)?{value:result.value}:{issues:ctx.common.issues})}async parseAsync(data$12,params){let result=await this.safeParseAsync(data$12,params);if(result.success)return result.data;throw result.error}async safeParseAsync(data$12,params){let ctx={common:{issues:[],contextualErrorMap:params?.errorMap,async:!0},path:params?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:data$12,parsedType:getParsedType(data$12)},maybeAsyncResult=this._parse({data:data$12,path:ctx.path,parent:ctx}),result=await(isAsync(maybeAsyncResult)?maybeAsyncResult:Promise.resolve(maybeAsyncResult));return handleResult(ctx,result)}refine(check$1,message$1){let getIssueProperties=val=>typeof message$1==`string`||message$1===void 0?{message:message$1}:typeof message$1==`function`?message$1(val):message$1;return this._refinement((val,ctx)=>{let result=check$1(val),setError=()=>ctx.addIssue({code:ZodIssueCode.custom,...getIssueProperties(val)});return typeof Promise<`u`&&result instanceof Promise?result.then(data$12=>data$12?!0:(setError(),!1)):result?!0:(setError(),!1)})}refinement(check$1,refinementData){return this._refinement((val,ctx)=>check$1(val)?!0:(ctx.addIssue(typeof refinementData==`function`?refinementData(val,ctx):refinementData),!1))}_refinement(refinement){return new ZodEffects({schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:`refinement`,refinement}})}superRefine(refinement){return this._refinement(refinement)}constructor(def$1){this.spa=this.safeParseAsync,this._def=def$1,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this[`~standard`]={version:1,vendor:`zod`,validate:data$12=>this[`~validate`](data$12)}}optional(){return ZodOptional.create(this,this._def)}nullable(){return ZodNullable.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ZodArray.create(this)}promise(){return ZodPromise.create(this,this._def)}or(option$1){return ZodUnion.create([this,option$1],this._def)}and(incoming){return ZodIntersection.create(this,incoming,this._def)}transform(transform$1){return new ZodEffects({...processCreateParams(this._def),schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:`transform`,transform:transform$1}})}default(def$1){let defaultValueFunc=typeof def$1==`function`?def$1:()=>def$1;return new ZodDefault({...processCreateParams(this._def),innerType:this,defaultValue:defaultValueFunc,typeName:ZodFirstPartyTypeKind.ZodDefault})}brand(){return new ZodBranded({typeName:ZodFirstPartyTypeKind.ZodBranded,type:this,...processCreateParams(this._def)})}catch(def$1){let catchValueFunc=typeof def$1==`function`?def$1:()=>def$1;return new ZodCatch({...processCreateParams(this._def),innerType:this,catchValue:catchValueFunc,typeName:ZodFirstPartyTypeKind.ZodCatch})}describe(description){let This=this.constructor;return new This({...this._def,description})}pipe(target$1){return ZodPipeline.create(this,target$1)}readonly(){return ZodReadonly.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};const cuidRegex=/^c[^\s-]{8,}$/i,cuid2Regex=/^[0-9a-z]+$/,ulidRegex=/^[0-9A-HJKMNP-TV-Z]{26}$/i,uuidRegex=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,nanoidRegex=/^[a-z0-9_-]{21}$/i,jwtRegex=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,durationRegex=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,emailRegex=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,_emojiRegex=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;let emojiRegex;const ipv4Regex=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4CidrRegex=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6Regex=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ipv6CidrRegex=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64Regex=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64urlRegex=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,dateRegexSource=`((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`,dateRegex=RegExp(`^${dateRegexSource}$`);function timeRegexSource(args){let secondsRegexSource=`[0-5]\\d`;args.precision?secondsRegexSource=`${secondsRegexSource}\\.\\d{${args.precision}}`:args.precision??(secondsRegexSource=`${secondsRegexSource}(\\.\\d+)?`);let secondsQuantifier=args.precision?`+`:`?`;return`([01]\\d|2[0-3]):[0-5]\\d(:${secondsRegexSource})${secondsQuantifier}`}function timeRegex(args){return RegExp(`^${timeRegexSource(args)}$`)}function datetimeRegex(args){let regex=`${dateRegexSource}T${timeRegexSource(args)}`,opts=[];return opts.push(args.local?`Z?`:`Z`),args.offset&&opts.push(`([+-]\\d{2}:?\\d{2})`),regex=`${regex}(${opts.join(`|`)})`,RegExp(`^${regex}$`)}function isValidIP(ip$1,version$1){return!!((version$1===`v4`||!version$1)&&ipv4Regex.test(ip$1)||(version$1===`v6`||!version$1)&&ipv6Regex.test(ip$1))}function isValidJWT(jwt,alg){if(!jwtRegex.test(jwt))return!1;try{let[header]=jwt.split(`.`);if(!header)return!1;let base64=header.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(header.length+(4-header.length%4)%4,`=`),decoded=JSON.parse(atob(base64));return!(typeof decoded!=`object`||!decoded||`typ`in decoded&&decoded?.typ!==`JWT`||!decoded.alg||alg&&decoded.alg!==alg)}catch{return!1}}function isValidCidr(ip$1,version$1){return!!((version$1===`v4`||!version$1)&&ipv4CidrRegex.test(ip$1)||(version$1===`v6`||!version$1)&&ipv6CidrRegex.test(ip$1))}var ZodString=class ZodString extends ZodType{_parse(input){this._def.coerce&&(input.data=String(input.data));let parsedType=this._getType(input);if(parsedType!==ZodParsedType.string){let ctx$1=this._getOrReturnCtx(input);return addIssueToContext(ctx$1,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.string,received:ctx$1.parsedType}),INVALID}let status=new ParseStatus,ctx;for(let check$1 of this._def.checks)if(check$1.kind===`min`)input.data.lengthcheck$1.value&&(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{code:ZodIssueCode.too_big,maximum:check$1.value,type:`string`,inclusive:!0,exact:!1,message:check$1.message}),status.dirty());else if(check$1.kind===`length`){let tooBig=input.data.length>check$1.value,tooSmall=input.data.lengthregex.test(data$12),{validation,code:ZodIssueCode.invalid_string,...errorUtil.errToObj(message$1)})}_addCheck(check$1){return new ZodString({...this._def,checks:[...this._def.checks,check$1]})}email(message$1){return this._addCheck({kind:`email`,...errorUtil.errToObj(message$1)})}url(message$1){return this._addCheck({kind:`url`,...errorUtil.errToObj(message$1)})}emoji(message$1){return this._addCheck({kind:`emoji`,...errorUtil.errToObj(message$1)})}uuid(message$1){return this._addCheck({kind:`uuid`,...errorUtil.errToObj(message$1)})}nanoid(message$1){return this._addCheck({kind:`nanoid`,...errorUtil.errToObj(message$1)})}cuid(message$1){return this._addCheck({kind:`cuid`,...errorUtil.errToObj(message$1)})}cuid2(message$1){return this._addCheck({kind:`cuid2`,...errorUtil.errToObj(message$1)})}ulid(message$1){return this._addCheck({kind:`ulid`,...errorUtil.errToObj(message$1)})}base64(message$1){return this._addCheck({kind:`base64`,...errorUtil.errToObj(message$1)})}base64url(message$1){return this._addCheck({kind:`base64url`,...errorUtil.errToObj(message$1)})}jwt(options$1){return this._addCheck({kind:`jwt`,...errorUtil.errToObj(options$1)})}ip(options$1){return this._addCheck({kind:`ip`,...errorUtil.errToObj(options$1)})}cidr(options$1){return this._addCheck({kind:`cidr`,...errorUtil.errToObj(options$1)})}datetime(options$1){return typeof options$1==`string`?this._addCheck({kind:`datetime`,precision:null,offset:!1,local:!1,message:options$1}):this._addCheck({kind:`datetime`,precision:options$1?.precision===void 0?null:options$1?.precision,offset:options$1?.offset??!1,local:options$1?.local??!1,...errorUtil.errToObj(options$1?.message)})}date(message$1){return this._addCheck({kind:`date`,message:message$1})}time(options$1){return typeof options$1==`string`?this._addCheck({kind:`time`,precision:null,message:options$1}):this._addCheck({kind:`time`,precision:options$1?.precision===void 0?null:options$1?.precision,...errorUtil.errToObj(options$1?.message)})}duration(message$1){return this._addCheck({kind:`duration`,...errorUtil.errToObj(message$1)})}regex(regex,message$1){return this._addCheck({kind:`regex`,regex,...errorUtil.errToObj(message$1)})}includes(value$1,options$1){return this._addCheck({kind:`includes`,value:value$1,position:options$1?.position,...errorUtil.errToObj(options$1?.message)})}startsWith(value$1,message$1){return this._addCheck({kind:`startsWith`,value:value$1,...errorUtil.errToObj(message$1)})}endsWith(value$1,message$1){return this._addCheck({kind:`endsWith`,value:value$1,...errorUtil.errToObj(message$1)})}min(minLength,message$1){return this._addCheck({kind:`min`,value:minLength,...errorUtil.errToObj(message$1)})}max(maxLength,message$1){return this._addCheck({kind:`max`,value:maxLength,...errorUtil.errToObj(message$1)})}length(len,message$1){return this._addCheck({kind:`length`,value:len,...errorUtil.errToObj(message$1)})}nonempty(message$1){return this.min(1,errorUtil.errToObj(message$1))}trim(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:`trim`}]})}toLowerCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:`toLowerCase`}]})}toUpperCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:`toUpperCase`}]})}get isDatetime(){return!!this._def.checks.find(ch$1=>ch$1.kind===`datetime`)}get isDate(){return!!this._def.checks.find(ch$1=>ch$1.kind===`date`)}get isTime(){return!!this._def.checks.find(ch$1=>ch$1.kind===`time`)}get isDuration(){return!!this._def.checks.find(ch$1=>ch$1.kind===`duration`)}get isEmail(){return!!this._def.checks.find(ch$1=>ch$1.kind===`email`)}get isURL(){return!!this._def.checks.find(ch$1=>ch$1.kind===`url`)}get isEmoji(){return!!this._def.checks.find(ch$1=>ch$1.kind===`emoji`)}get isUUID(){return!!this._def.checks.find(ch$1=>ch$1.kind===`uuid`)}get isNANOID(){return!!this._def.checks.find(ch$1=>ch$1.kind===`nanoid`)}get isCUID(){return!!this._def.checks.find(ch$1=>ch$1.kind===`cuid`)}get isCUID2(){return!!this._def.checks.find(ch$1=>ch$1.kind===`cuid2`)}get isULID(){return!!this._def.checks.find(ch$1=>ch$1.kind===`ulid`)}get isIP(){return!!this._def.checks.find(ch$1=>ch$1.kind===`ip`)}get isCIDR(){return!!this._def.checks.find(ch$1=>ch$1.kind===`cidr`)}get isBase64(){return!!this._def.checks.find(ch$1=>ch$1.kind===`base64`)}get isBase64url(){return!!this._def.checks.find(ch$1=>ch$1.kind===`base64url`)}get minLength(){let min$1=null;for(let ch$1 of this._def.checks)ch$1.kind===`min`&&(min$1===null||ch$1.value>min$1)&&(min$1=ch$1.value);return min$1}get maxLength(){let max$1=null;for(let ch$1 of this._def.checks)ch$1.kind===`max`&&(max$1===null||ch$1.valuenew ZodString({checks:[],typeName:ZodFirstPartyTypeKind.ZodString,coerce:params?.coerce??!1,...processCreateParams(params)});function floatSafeRemainder(val,step){let valDecCount=(val.toString().split(`.`)[1]||``).length,stepDecCount=(step.toString().split(`.`)[1]||``).length,decCount=valDecCount>stepDecCount?valDecCount:stepDecCount,valInt=Number.parseInt(val.toFixed(decCount).replace(`.`,``)),stepInt=Number.parseInt(step.toFixed(decCount).replace(`.`,``));return valInt%stepInt/10**decCount}var ZodNumber=class ZodNumber extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(input){this._def.coerce&&(input.data=Number(input.data));let parsedType=this._getType(input);if(parsedType!==ZodParsedType.number){let ctx$1=this._getOrReturnCtx(input);return addIssueToContext(ctx$1,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.number,received:ctx$1.parsedType}),INVALID}let ctx,status=new ParseStatus;for(let check$1 of this._def.checks)if(check$1.kind===`int`)util.isInteger(input.data)||(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:`integer`,received:`float`,message:check$1.message}),status.dirty());else if(check$1.kind===`min`){let tooSmall=check$1.inclusive?input.datacheck$1.value:input.data>=check$1.value;tooBig&&(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{code:ZodIssueCode.too_big,maximum:check$1.value,type:`number`,inclusive:check$1.inclusive,exact:!1,message:check$1.message}),status.dirty())}else check$1.kind===`multipleOf`?floatSafeRemainder(input.data,check$1.value)!==0&&(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{code:ZodIssueCode.not_multiple_of,multipleOf:check$1.value,message:check$1.message}),status.dirty()):check$1.kind===`finite`?Number.isFinite(input.data)||(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{code:ZodIssueCode.not_finite,message:check$1.message}),status.dirty()):util.assertNever(check$1);return{status:status.value,value:input.data}}gte(value$1,message$1){return this.setLimit(`min`,value$1,!0,errorUtil.toString(message$1))}gt(value$1,message$1){return this.setLimit(`min`,value$1,!1,errorUtil.toString(message$1))}lte(value$1,message$1){return this.setLimit(`max`,value$1,!0,errorUtil.toString(message$1))}lt(value$1,message$1){return this.setLimit(`max`,value$1,!1,errorUtil.toString(message$1))}setLimit(kind,value$1,inclusive,message$1){return new ZodNumber({...this._def,checks:[...this._def.checks,{kind,value:value$1,inclusive,message:errorUtil.toString(message$1)}]})}_addCheck(check$1){return new ZodNumber({...this._def,checks:[...this._def.checks,check$1]})}int(message$1){return this._addCheck({kind:`int`,message:errorUtil.toString(message$1)})}positive(message$1){return this._addCheck({kind:`min`,value:0,inclusive:!1,message:errorUtil.toString(message$1)})}negative(message$1){return this._addCheck({kind:`max`,value:0,inclusive:!1,message:errorUtil.toString(message$1)})}nonpositive(message$1){return this._addCheck({kind:`max`,value:0,inclusive:!0,message:errorUtil.toString(message$1)})}nonnegative(message$1){return this._addCheck({kind:`min`,value:0,inclusive:!0,message:errorUtil.toString(message$1)})}multipleOf(value$1,message$1){return this._addCheck({kind:`multipleOf`,value:value$1,message:errorUtil.toString(message$1)})}finite(message$1){return this._addCheck({kind:`finite`,message:errorUtil.toString(message$1)})}safe(message$1){return this._addCheck({kind:`min`,inclusive:!0,value:-(2**53-1),message:errorUtil.toString(message$1)})._addCheck({kind:`max`,inclusive:!0,value:2**53-1,message:errorUtil.toString(message$1)})}get minValue(){let min$1=null;for(let ch$1 of this._def.checks)ch$1.kind===`min`&&(min$1===null||ch$1.value>min$1)&&(min$1=ch$1.value);return min$1}get maxValue(){let max$1=null;for(let ch$1 of this._def.checks)ch$1.kind===`max`&&(max$1===null||ch$1.valuech$1.kind===`int`||ch$1.kind===`multipleOf`&&util.isInteger(ch$1.value))}get isFinite(){let max$1=null,min$1=null;for(let ch$1 of this._def.checks)if(ch$1.kind===`finite`||ch$1.kind===`int`||ch$1.kind===`multipleOf`)return!0;else ch$1.kind===`min`?(min$1===null||ch$1.value>min$1)&&(min$1=ch$1.value):ch$1.kind===`max`&&(max$1===null||ch$1.valuenew ZodNumber({checks:[],typeName:ZodFirstPartyTypeKind.ZodNumber,coerce:params?.coerce||!1,...processCreateParams(params)});var ZodBigInt=class ZodBigInt extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(input){if(this._def.coerce)try{input.data=BigInt(input.data)}catch{return this._getInvalidInput(input)}let parsedType=this._getType(input);if(parsedType!==ZodParsedType.bigint)return this._getInvalidInput(input);let ctx,status=new ParseStatus;for(let check$1 of this._def.checks)if(check$1.kind===`min`){let tooSmall=check$1.inclusive?input.datacheck$1.value:input.data>=check$1.value;tooBig&&(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{code:ZodIssueCode.too_big,type:`bigint`,maximum:check$1.value,inclusive:check$1.inclusive,message:check$1.message}),status.dirty())}else check$1.kind===`multipleOf`?input.data%check$1.value!==BigInt(0)&&(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{code:ZodIssueCode.not_multiple_of,multipleOf:check$1.value,message:check$1.message}),status.dirty()):util.assertNever(check$1);return{status:status.value,value:input.data}}_getInvalidInput(input){let ctx=this._getOrReturnCtx(input);return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.bigint,received:ctx.parsedType}),INVALID}gte(value$1,message$1){return this.setLimit(`min`,value$1,!0,errorUtil.toString(message$1))}gt(value$1,message$1){return this.setLimit(`min`,value$1,!1,errorUtil.toString(message$1))}lte(value$1,message$1){return this.setLimit(`max`,value$1,!0,errorUtil.toString(message$1))}lt(value$1,message$1){return this.setLimit(`max`,value$1,!1,errorUtil.toString(message$1))}setLimit(kind,value$1,inclusive,message$1){return new ZodBigInt({...this._def,checks:[...this._def.checks,{kind,value:value$1,inclusive,message:errorUtil.toString(message$1)}]})}_addCheck(check$1){return new ZodBigInt({...this._def,checks:[...this._def.checks,check$1]})}positive(message$1){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!1,message:errorUtil.toString(message$1)})}negative(message$1){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!1,message:errorUtil.toString(message$1)})}nonpositive(message$1){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!0,message:errorUtil.toString(message$1)})}nonnegative(message$1){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!0,message:errorUtil.toString(message$1)})}multipleOf(value$1,message$1){return this._addCheck({kind:`multipleOf`,value:value$1,message:errorUtil.toString(message$1)})}get minValue(){let min$1=null;for(let ch$1 of this._def.checks)ch$1.kind===`min`&&(min$1===null||ch$1.value>min$1)&&(min$1=ch$1.value);return min$1}get maxValue(){let max$1=null;for(let ch$1 of this._def.checks)ch$1.kind===`max`&&(max$1===null||ch$1.valuenew ZodBigInt({checks:[],typeName:ZodFirstPartyTypeKind.ZodBigInt,coerce:params?.coerce??!1,...processCreateParams(params)});var ZodBoolean=class extends ZodType{_parse(input){this._def.coerce&&(input.data=!!input.data);let parsedType=this._getType(input);if(parsedType!==ZodParsedType.boolean){let ctx=this._getOrReturnCtx(input);return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.boolean,received:ctx.parsedType}),INVALID}return OK(input.data)}};ZodBoolean.create=params=>new ZodBoolean({typeName:ZodFirstPartyTypeKind.ZodBoolean,coerce:params?.coerce||!1,...processCreateParams(params)});var ZodDate=class ZodDate extends ZodType{_parse(input){this._def.coerce&&(input.data=new Date(input.data));let parsedType=this._getType(input);if(parsedType!==ZodParsedType.date){let ctx$1=this._getOrReturnCtx(input);return addIssueToContext(ctx$1,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.date,received:ctx$1.parsedType}),INVALID}if(Number.isNaN(input.data.getTime())){let ctx$1=this._getOrReturnCtx(input);return addIssueToContext(ctx$1,{code:ZodIssueCode.invalid_date}),INVALID}let status=new ParseStatus,ctx;for(let check$1 of this._def.checks)check$1.kind===`min`?input.data.getTime()check$1.value&&(ctx=this._getOrReturnCtx(input,ctx),addIssueToContext(ctx,{code:ZodIssueCode.too_big,message:check$1.message,inclusive:!0,exact:!1,maximum:check$1.value,type:`date`}),status.dirty()):util.assertNever(check$1);return{status:status.value,value:new Date(input.data.getTime())}}_addCheck(check$1){return new ZodDate({...this._def,checks:[...this._def.checks,check$1]})}min(minDate,message$1){return this._addCheck({kind:`min`,value:minDate.getTime(),message:errorUtil.toString(message$1)})}max(maxDate,message$1){return this._addCheck({kind:`max`,value:maxDate.getTime(),message:errorUtil.toString(message$1)})}get minDate(){let min$1=null;for(let ch$1 of this._def.checks)ch$1.kind===`min`&&(min$1===null||ch$1.value>min$1)&&(min$1=ch$1.value);return min$1==null?null:new Date(min$1)}get maxDate(){let max$1=null;for(let ch$1 of this._def.checks)ch$1.kind===`max`&&(max$1===null||ch$1.valuenew ZodDate({checks:[],coerce:params?.coerce||!1,typeName:ZodFirstPartyTypeKind.ZodDate,...processCreateParams(params)});var ZodSymbol=class extends ZodType{_parse(input){let parsedType=this._getType(input);if(parsedType!==ZodParsedType.symbol){let ctx=this._getOrReturnCtx(input);return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.symbol,received:ctx.parsedType}),INVALID}return OK(input.data)}};ZodSymbol.create=params=>new ZodSymbol({typeName:ZodFirstPartyTypeKind.ZodSymbol,...processCreateParams(params)});var ZodUndefined=class extends ZodType{_parse(input){let parsedType=this._getType(input);if(parsedType!==ZodParsedType.undefined){let ctx=this._getOrReturnCtx(input);return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.undefined,received:ctx.parsedType}),INVALID}return OK(input.data)}};ZodUndefined.create=params=>new ZodUndefined({typeName:ZodFirstPartyTypeKind.ZodUndefined,...processCreateParams(params)});var ZodNull=class extends ZodType{_parse(input){let parsedType=this._getType(input);if(parsedType!==ZodParsedType.null){let ctx=this._getOrReturnCtx(input);return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.null,received:ctx.parsedType}),INVALID}return OK(input.data)}};ZodNull.create=params=>new ZodNull({typeName:ZodFirstPartyTypeKind.ZodNull,...processCreateParams(params)});var ZodAny=class extends ZodType{constructor(){super(...arguments),this._any=!0}_parse(input){return OK(input.data)}};ZodAny.create=params=>new ZodAny({typeName:ZodFirstPartyTypeKind.ZodAny,...processCreateParams(params)});var ZodUnknown=class extends ZodType{constructor(){super(...arguments),this._unknown=!0}_parse(input){return OK(input.data)}};ZodUnknown.create=params=>new ZodUnknown({typeName:ZodFirstPartyTypeKind.ZodUnknown,...processCreateParams(params)});var ZodNever=class extends ZodType{_parse(input){let ctx=this._getOrReturnCtx(input);return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.never,received:ctx.parsedType}),INVALID}};ZodNever.create=params=>new ZodNever({typeName:ZodFirstPartyTypeKind.ZodNever,...processCreateParams(params)});var ZodVoid=class extends ZodType{_parse(input){let parsedType=this._getType(input);if(parsedType!==ZodParsedType.undefined){let ctx=this._getOrReturnCtx(input);return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.void,received:ctx.parsedType}),INVALID}return OK(input.data)}};ZodVoid.create=params=>new ZodVoid({typeName:ZodFirstPartyTypeKind.ZodVoid,...processCreateParams(params)});var ZodArray=class ZodArray extends ZodType{_parse(input){let{ctx,status}=this._processInputParams(input),def$1=this._def;if(ctx.parsedType!==ZodParsedType.array)return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:ctx.parsedType}),INVALID;if(def$1.exactLength!==null){let tooBig=ctx.data.length>def$1.exactLength.value,tooSmall=ctx.data.lengthdef$1.maxLength.value&&(addIssueToContext(ctx,{code:ZodIssueCode.too_big,maximum:def$1.maxLength.value,type:`array`,inclusive:!0,exact:!1,message:def$1.maxLength.message}),status.dirty()),ctx.common.async)return Promise.all([...ctx.data].map((item,i$1)=>def$1.type._parseAsync(new ParseInputLazyPath(ctx,item,ctx.path,i$1)))).then(result$1=>ParseStatus.mergeArray(status,result$1));let result=[...ctx.data].map((item,i$1)=>def$1.type._parseSync(new ParseInputLazyPath(ctx,item,ctx.path,i$1)));return ParseStatus.mergeArray(status,result)}get element(){return this._def.type}min(minLength,message$1){return new ZodArray({...this._def,minLength:{value:minLength,message:errorUtil.toString(message$1)}})}max(maxLength,message$1){return new ZodArray({...this._def,maxLength:{value:maxLength,message:errorUtil.toString(message$1)}})}length(len,message$1){return new ZodArray({...this._def,exactLength:{value:len,message:errorUtil.toString(message$1)}})}nonempty(message$1){return this.min(1,message$1)}};ZodArray.create=(schema,params)=>new ZodArray({type:schema,minLength:null,maxLength:null,exactLength:null,typeName:ZodFirstPartyTypeKind.ZodArray,...processCreateParams(params)});function deepPartialify(schema){if(schema instanceof ZodObject){let newShape={};for(let key$2 in schema.shape){let fieldSchema=schema.shape[key$2];newShape[key$2]=ZodOptional.create(deepPartialify(fieldSchema))}return new ZodObject({...schema._def,shape:()=>newShape})}else if(schema instanceof ZodArray)return new ZodArray({...schema._def,type:deepPartialify(schema.element)});else if(schema instanceof ZodOptional)return ZodOptional.create(deepPartialify(schema.unwrap()));else if(schema instanceof ZodNullable)return ZodNullable.create(deepPartialify(schema.unwrap()));else if(schema instanceof ZodTuple)return ZodTuple.create(schema.items.map(item=>deepPartialify(item)));else return schema}var ZodObject=class ZodObject extends ZodType{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let shape=this._def.shape(),keys$3=util.objectKeys(shape);return this._cached={shape,keys:keys$3},this._cached}_parse(input){let parsedType=this._getType(input);if(parsedType!==ZodParsedType.object){let ctx$1=this._getOrReturnCtx(input);return addIssueToContext(ctx$1,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:ctx$1.parsedType}),INVALID}let{status,ctx}=this._processInputParams(input),{shape,keys:shapeKeys}=this._getCached(),extraKeys=[];if(!(this._def.catchall instanceof ZodNever&&this._def.unknownKeys===`strip`))for(let key$2 in ctx.data)shapeKeys.includes(key$2)||extraKeys.push(key$2);let pairs=[];for(let key$2 of shapeKeys){let keyValidator=shape[key$2],value$1=ctx.data[key$2];pairs.push({key:{status:`valid`,value:key$2},value:keyValidator._parse(new ParseInputLazyPath(ctx,value$1,ctx.path,key$2)),alwaysSet:key$2 in ctx.data})}if(this._def.catchall instanceof ZodNever){let unknownKeys=this._def.unknownKeys;if(unknownKeys===`passthrough`)for(let key$2 of extraKeys)pairs.push({key:{status:`valid`,value:key$2},value:{status:`valid`,value:ctx.data[key$2]}});else if(unknownKeys===`strict`)extraKeys.length>0&&(addIssueToContext(ctx,{code:ZodIssueCode.unrecognized_keys,keys:extraKeys}),status.dirty());else if(unknownKeys!==`strip`)throw Error(`Internal ZodObject error: invalid unknownKeys value.`)}else{let catchall=this._def.catchall;for(let key$2 of extraKeys){let value$1=ctx.data[key$2];pairs.push({key:{status:`valid`,value:key$2},value:catchall._parse(new ParseInputLazyPath(ctx,value$1,ctx.path,key$2)),alwaysSet:key$2 in ctx.data})}}return ctx.common.async?Promise.resolve().then(async()=>{let syncPairs=[];for(let pair of pairs){let key$2=await pair.key,value$1=await pair.value;syncPairs.push({key:key$2,value:value$1,alwaysSet:pair.alwaysSet})}return syncPairs}).then(syncPairs=>ParseStatus.mergeObjectSync(status,syncPairs)):ParseStatus.mergeObjectSync(status,pairs)}get shape(){return this._def.shape()}strict(message$1){return errorUtil.errToObj,new ZodObject({...this._def,unknownKeys:`strict`,...message$1===void 0?{}:{errorMap:(issue,ctx)=>{let defaultError=this._def.errorMap?.(issue,ctx).message??ctx.defaultError;return issue.code===`unrecognized_keys`?{message:errorUtil.errToObj(message$1).message??defaultError}:{message:defaultError}}}})}strip(){return new ZodObject({...this._def,unknownKeys:`strip`})}passthrough(){return new ZodObject({...this._def,unknownKeys:`passthrough`})}extend(augmentation){return new ZodObject({...this._def,shape:()=>({...this._def.shape(),...augmentation})})}merge(merging){let merged=new ZodObject({unknownKeys:merging._def.unknownKeys,catchall:merging._def.catchall,shape:()=>({...this._def.shape(),...merging._def.shape()}),typeName:ZodFirstPartyTypeKind.ZodObject});return merged}setKey(key$2,schema){return this.augment({[key$2]:schema})}catchall(index$1){return new ZodObject({...this._def,catchall:index$1})}pick(mask){let shape={};for(let key$2 of util.objectKeys(mask))mask[key$2]&&this.shape[key$2]&&(shape[key$2]=this.shape[key$2]);return new ZodObject({...this._def,shape:()=>shape})}omit(mask){let shape={};for(let key$2 of util.objectKeys(this.shape))mask[key$2]||(shape[key$2]=this.shape[key$2]);return new ZodObject({...this._def,shape:()=>shape})}deepPartial(){return deepPartialify(this)}partial(mask){let newShape={};for(let key$2 of util.objectKeys(this.shape)){let fieldSchema=this.shape[key$2];mask&&!mask[key$2]?newShape[key$2]=fieldSchema:newShape[key$2]=fieldSchema.optional()}return new ZodObject({...this._def,shape:()=>newShape})}required(mask){let newShape={};for(let key$2 of util.objectKeys(this.shape))if(mask&&!mask[key$2])newShape[key$2]=this.shape[key$2];else{let fieldSchema=this.shape[key$2],newField=fieldSchema;for(;newField instanceof ZodOptional;)newField=newField._def.innerType;newShape[key$2]=newField}return new ZodObject({...this._def,shape:()=>newShape})}keyof(){return createZodEnum(util.objectKeys(this.shape))}};ZodObject.create=(shape,params)=>new ZodObject({shape:()=>shape,unknownKeys:`strip`,catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(params)}),ZodObject.strictCreate=(shape,params)=>new ZodObject({shape:()=>shape,unknownKeys:`strict`,catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(params)}),ZodObject.lazycreate=(shape,params)=>new ZodObject({shape,unknownKeys:`strip`,catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(params)});var ZodUnion=class extends ZodType{_parse(input){let{ctx}=this._processInputParams(input),options$1=this._def.options;function handleResults(results){for(let result of results)if(result.result.status===`valid`)return result.result;for(let result of results)if(result.result.status===`dirty`)return ctx.common.issues.push(...result.ctx.common.issues),result.result;let unionErrors=results.map(result=>new ZodError(result.ctx.common.issues));return addIssueToContext(ctx,{code:ZodIssueCode.invalid_union,unionErrors}),INVALID}if(ctx.common.async)return Promise.all(options$1.map(async option$1=>{let childCtx={...ctx,common:{...ctx.common,issues:[]},parent:null};return{result:await option$1._parseAsync({data:ctx.data,path:ctx.path,parent:childCtx}),ctx:childCtx}})).then(handleResults);{let dirty,issues=[];for(let option$1 of options$1){let childCtx={...ctx,common:{...ctx.common,issues:[]},parent:null},result=option$1._parseSync({data:ctx.data,path:ctx.path,parent:childCtx});if(result.status===`valid`)return result;result.status===`dirty`&&!dirty&&(dirty={result,ctx:childCtx}),childCtx.common.issues.length&&issues.push(childCtx.common.issues)}if(dirty)return ctx.common.issues.push(...dirty.ctx.common.issues),dirty.result;let unionErrors=issues.map(issues$1=>new ZodError(issues$1));return addIssueToContext(ctx,{code:ZodIssueCode.invalid_union,unionErrors}),INVALID}}get options(){return this._def.options}};ZodUnion.create=(types$1,params)=>new ZodUnion({options:types$1,typeName:ZodFirstPartyTypeKind.ZodUnion,...processCreateParams(params)});const getDiscriminator=type=>type instanceof ZodLazy?getDiscriminator(type.schema):type instanceof ZodEffects?getDiscriminator(type.innerType()):type instanceof ZodLiteral?[type.value]:type instanceof ZodEnum?type.options:type instanceof ZodNativeEnum?util.objectValues(type.enum):type instanceof ZodDefault?getDiscriminator(type._def.innerType):type instanceof ZodUndefined?[void 0]:type instanceof ZodNull?[null]:type instanceof ZodOptional?[void 0,...getDiscriminator(type.unwrap())]:type instanceof ZodNullable?[null,...getDiscriminator(type.unwrap())]:type instanceof ZodBranded||type instanceof ZodReadonly?getDiscriminator(type.unwrap()):type instanceof ZodCatch?getDiscriminator(type._def.innerType):[];var ZodDiscriminatedUnion=class ZodDiscriminatedUnion extends ZodType{_parse(input){let{ctx}=this._processInputParams(input);if(ctx.parsedType!==ZodParsedType.object)return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:ctx.parsedType}),INVALID;let discriminator=this.discriminator,discriminatorValue=ctx.data[discriminator],option$1=this.optionsMap.get(discriminatorValue);return option$1?ctx.common.async?option$1._parseAsync({data:ctx.data,path:ctx.path,parent:ctx}):option$1._parseSync({data:ctx.data,path:ctx.path,parent:ctx}):(addIssueToContext(ctx,{code:ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[discriminator]}),INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(discriminator,options$1,params){let optionsMap=new Map;for(let type of options$1){let discriminatorValues=getDiscriminator(type.shape[discriminator]);if(!discriminatorValues.length)throw Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`);for(let value$1 of discriminatorValues){if(optionsMap.has(value$1))throw Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value$1)}`);optionsMap.set(value$1,type)}}return new ZodDiscriminatedUnion({typeName:ZodFirstPartyTypeKind.ZodDiscriminatedUnion,discriminator,options:options$1,optionsMap,...processCreateParams(params)})}};function mergeValues(a$2,b$4){let aType=getParsedType(a$2),bType=getParsedType(b$4);if(a$2===b$4)return{valid:!0,data:a$2};if(aType===ZodParsedType.object&&bType===ZodParsedType.object){let bKeys=util.objectKeys(b$4),sharedKeys=util.objectKeys(a$2).filter(key$2=>bKeys.indexOf(key$2)!==-1),newObj={...a$2,...b$4};for(let key$2 of sharedKeys){let sharedValue=mergeValues(a$2[key$2],b$4[key$2]);if(!sharedValue.valid)return{valid:!1};newObj[key$2]=sharedValue.data}return{valid:!0,data:newObj}}else if(aType===ZodParsedType.array&&bType===ZodParsedType.array){if(a$2.length!==b$4.length)return{valid:!1};let newArray=[];for(let index$1=0;index$1{if(isAborted(parsedLeft)||isAborted(parsedRight))return INVALID;let merged=mergeValues(parsedLeft.value,parsedRight.value);return merged.valid?((isDirty(parsedLeft)||isDirty(parsedRight))&&status.dirty(),{status:status.value,value:merged.data}):(addIssueToContext(ctx,{code:ZodIssueCode.invalid_intersection_types}),INVALID)};return ctx.common.async?Promise.all([this._def.left._parseAsync({data:ctx.data,path:ctx.path,parent:ctx}),this._def.right._parseAsync({data:ctx.data,path:ctx.path,parent:ctx})]).then(([left,right])=>handleParsed(left,right)):handleParsed(this._def.left._parseSync({data:ctx.data,path:ctx.path,parent:ctx}),this._def.right._parseSync({data:ctx.data,path:ctx.path,parent:ctx}))}};ZodIntersection.create=(left,right,params)=>new ZodIntersection({left,right,typeName:ZodFirstPartyTypeKind.ZodIntersection,...processCreateParams(params)});var ZodTuple=class ZodTuple extends ZodType{_parse(input){let{status,ctx}=this._processInputParams(input);if(ctx.parsedType!==ZodParsedType.array)return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:ctx.parsedType}),INVALID;if(ctx.data.lengththis._def.items.length&&(addIssueToContext(ctx,{code:ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),status.dirty());let items=[...ctx.data].map((item,itemIndex)=>{let schema=this._def.items[itemIndex]||this._def.rest;return schema?schema._parse(new ParseInputLazyPath(ctx,item,ctx.path,itemIndex)):null}).filter(x$3=>!!x$3);return ctx.common.async?Promise.all(items).then(results=>ParseStatus.mergeArray(status,results)):ParseStatus.mergeArray(status,items)}get items(){return this._def.items}rest(rest){return new ZodTuple({...this._def,rest})}};ZodTuple.create=(schemas,params)=>{if(!Array.isArray(schemas))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new ZodTuple({items:schemas,typeName:ZodFirstPartyTypeKind.ZodTuple,rest:null,...processCreateParams(params)})};var ZodRecord=class ZodRecord extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(input){let{status,ctx}=this._processInputParams(input);if(ctx.parsedType!==ZodParsedType.object)return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:ctx.parsedType}),INVALID;let pairs=[],keyType=this._def.keyType,valueType=this._def.valueType;for(let key$2 in ctx.data)pairs.push({key:keyType._parse(new ParseInputLazyPath(ctx,key$2,ctx.path,key$2)),value:valueType._parse(new ParseInputLazyPath(ctx,ctx.data[key$2],ctx.path,key$2)),alwaysSet:key$2 in ctx.data});return ctx.common.async?ParseStatus.mergeObjectAsync(status,pairs):ParseStatus.mergeObjectSync(status,pairs)}get element(){return this._def.valueType}static create(first,second,third){return second instanceof ZodType?new ZodRecord({keyType:first,valueType:second,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(third)}):new ZodRecord({keyType:ZodString.create(),valueType:first,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(second)})}},ZodMap=class extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(input){let{status,ctx}=this._processInputParams(input);if(ctx.parsedType!==ZodParsedType.map)return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.map,received:ctx.parsedType}),INVALID;let keyType=this._def.keyType,valueType=this._def.valueType,pairs=[...ctx.data.entries()].map(([key$2,value$1],index$1)=>({key:keyType._parse(new ParseInputLazyPath(ctx,key$2,ctx.path,[index$1,`key`])),value:valueType._parse(new ParseInputLazyPath(ctx,value$1,ctx.path,[index$1,`value`]))}));if(ctx.common.async){let finalMap=new Map;return Promise.resolve().then(async()=>{for(let pair of pairs){let key$2=await pair.key,value$1=await pair.value;if(key$2.status===`aborted`||value$1.status===`aborted`)return INVALID;(key$2.status===`dirty`||value$1.status===`dirty`)&&status.dirty(),finalMap.set(key$2.value,value$1.value)}return{status:status.value,value:finalMap}})}else{let finalMap=new Map;for(let pair of pairs){let key$2=pair.key,value$1=pair.value;if(key$2.status===`aborted`||value$1.status===`aborted`)return INVALID;(key$2.status===`dirty`||value$1.status===`dirty`)&&status.dirty(),finalMap.set(key$2.value,value$1.value)}return{status:status.value,value:finalMap}}}};ZodMap.create=(keyType,valueType,params)=>new ZodMap({valueType,keyType,typeName:ZodFirstPartyTypeKind.ZodMap,...processCreateParams(params)});var ZodSet=class ZodSet extends ZodType{_parse(input){let{status,ctx}=this._processInputParams(input);if(ctx.parsedType!==ZodParsedType.set)return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.set,received:ctx.parsedType}),INVALID;let def$1=this._def;def$1.minSize!==null&&ctx.data.sizedef$1.maxSize.value&&(addIssueToContext(ctx,{code:ZodIssueCode.too_big,maximum:def$1.maxSize.value,type:`set`,inclusive:!0,exact:!1,message:def$1.maxSize.message}),status.dirty());let valueType=this._def.valueType;function finalizeSet(elements$1){let parsedSet=new Set;for(let element$3 of elements$1){if(element$3.status===`aborted`)return INVALID;element$3.status===`dirty`&&status.dirty(),parsedSet.add(element$3.value)}return{status:status.value,value:parsedSet}}let elements=[...ctx.data.values()].map((item,i$1)=>valueType._parse(new ParseInputLazyPath(ctx,item,ctx.path,i$1)));return ctx.common.async?Promise.all(elements).then(elements$1=>finalizeSet(elements$1)):finalizeSet(elements)}min(minSize,message$1){return new ZodSet({...this._def,minSize:{value:minSize,message:errorUtil.toString(message$1)}})}max(maxSize,message$1){return new ZodSet({...this._def,maxSize:{value:maxSize,message:errorUtil.toString(message$1)}})}size(size$2,message$1){return this.min(size$2,message$1).max(size$2,message$1)}nonempty(message$1){return this.min(1,message$1)}};ZodSet.create=(valueType,params)=>new ZodSet({valueType,minSize:null,maxSize:null,typeName:ZodFirstPartyTypeKind.ZodSet,...processCreateParams(params)});var ZodFunction=class ZodFunction extends ZodType{constructor(){super(...arguments),this.validate=this.implement}_parse(input){let{ctx}=this._processInputParams(input);if(ctx.parsedType!==ZodParsedType.function)return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.function,received:ctx.parsedType}),INVALID;function makeArgsIssue(args,error){return makeIssue({data:args,path:ctx.path,errorMaps:[ctx.common.contextualErrorMap,ctx.schemaErrorMap,getErrorMap(),en_default$1].filter(x$3=>!!x$3),issueData:{code:ZodIssueCode.invalid_arguments,argumentsError:error}})}function makeReturnsIssue(returns,error){return makeIssue({data:returns,path:ctx.path,errorMaps:[ctx.common.contextualErrorMap,ctx.schemaErrorMap,getErrorMap(),en_default$1].filter(x$3=>!!x$3),issueData:{code:ZodIssueCode.invalid_return_type,returnTypeError:error}})}let params={errorMap:ctx.common.contextualErrorMap},fn$6=ctx.data;if(this._def.returns instanceof ZodPromise){let me$2=this;return OK(async function(...args){let error=new ZodError([]),parsedArgs=await me$2._def.args.parseAsync(args,params).catch(e$3=>{throw error.addIssue(makeArgsIssue(args,e$3)),error}),result=await Reflect.apply(fn$6,this,parsedArgs),parsedReturns=await me$2._def.returns._def.type.parseAsync(result,params).catch(e$3=>{throw error.addIssue(makeReturnsIssue(result,e$3)),error});return parsedReturns})}else{let me$2=this;return OK(function(...args){let parsedArgs=me$2._def.args.safeParse(args,params);if(!parsedArgs.success)throw new ZodError([makeArgsIssue(args,parsedArgs.error)]);let result=Reflect.apply(fn$6,this,parsedArgs.data),parsedReturns=me$2._def.returns.safeParse(result,params);if(!parsedReturns.success)throw new ZodError([makeReturnsIssue(result,parsedReturns.error)]);return parsedReturns.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...items){return new ZodFunction({...this._def,args:ZodTuple.create(items).rest(ZodUnknown.create())})}returns(returnType){return new ZodFunction({...this._def,returns:returnType})}implement(func){let validatedFunc=this.parse(func);return validatedFunc}strictImplement(func){let validatedFunc=this.parse(func);return validatedFunc}static create(args,returns,params){return new ZodFunction({args:args||ZodTuple.create([]).rest(ZodUnknown.create()),returns:returns||ZodUnknown.create(),typeName:ZodFirstPartyTypeKind.ZodFunction,...processCreateParams(params)})}},ZodLazy=class extends ZodType{get schema(){return this._def.getter()}_parse(input){let{ctx}=this._processInputParams(input),lazySchema=this._def.getter();return lazySchema._parse({data:ctx.data,path:ctx.path,parent:ctx})}};ZodLazy.create=(getter,params)=>new ZodLazy({getter,typeName:ZodFirstPartyTypeKind.ZodLazy,...processCreateParams(params)});var ZodLiteral=class extends ZodType{_parse(input){if(input.data!==this._def.value){let ctx=this._getOrReturnCtx(input);return addIssueToContext(ctx,{received:ctx.data,code:ZodIssueCode.invalid_literal,expected:this._def.value}),INVALID}return{status:`valid`,value:input.data}}get value(){return this._def.value}};ZodLiteral.create=(value$1,params)=>new ZodLiteral({value:value$1,typeName:ZodFirstPartyTypeKind.ZodLiteral,...processCreateParams(params)});function createZodEnum(values,params){return new ZodEnum({values,typeName:ZodFirstPartyTypeKind.ZodEnum,...processCreateParams(params)})}var ZodEnum=class ZodEnum extends ZodType{_parse(input){if(typeof input.data!=`string`){let ctx=this._getOrReturnCtx(input),expectedValues=this._def.values;return addIssueToContext(ctx,{expected:util.joinValues(expectedValues),received:ctx.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(this._cache||=new Set(this._def.values),!this._cache.has(input.data)){let ctx=this._getOrReturnCtx(input),expectedValues=this._def.values;return addIssueToContext(ctx,{received:ctx.data,code:ZodIssueCode.invalid_enum_value,options:expectedValues}),INVALID}return OK(input.data)}get options(){return this._def.values}get enum(){let enumValues={};for(let val of this._def.values)enumValues[val]=val;return enumValues}get Values(){let enumValues={};for(let val of this._def.values)enumValues[val]=val;return enumValues}get Enum(){let enumValues={};for(let val of this._def.values)enumValues[val]=val;return enumValues}extract(values,newDef=this._def){return ZodEnum.create(values,{...this._def,...newDef})}exclude(values,newDef=this._def){return ZodEnum.create(this.options.filter(opt=>!values.includes(opt)),{...this._def,...newDef})}};ZodEnum.create=createZodEnum;var ZodNativeEnum=class extends ZodType{_parse(input){let nativeEnumValues=util.getValidEnumValues(this._def.values),ctx=this._getOrReturnCtx(input);if(ctx.parsedType!==ZodParsedType.string&&ctx.parsedType!==ZodParsedType.number){let expectedValues=util.objectValues(nativeEnumValues);return addIssueToContext(ctx,{expected:util.joinValues(expectedValues),received:ctx.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(this._cache||=new Set(util.getValidEnumValues(this._def.values)),!this._cache.has(input.data)){let expectedValues=util.objectValues(nativeEnumValues);return addIssueToContext(ctx,{received:ctx.data,code:ZodIssueCode.invalid_enum_value,options:expectedValues}),INVALID}return OK(input.data)}get enum(){return this._def.values}};ZodNativeEnum.create=(values,params)=>new ZodNativeEnum({values,typeName:ZodFirstPartyTypeKind.ZodNativeEnum,...processCreateParams(params)});var ZodPromise=class extends ZodType{unwrap(){return this._def.type}_parse(input){let{ctx}=this._processInputParams(input);if(ctx.parsedType!==ZodParsedType.promise&&ctx.common.async===!1)return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.promise,received:ctx.parsedType}),INVALID;let promisified=ctx.parsedType===ZodParsedType.promise?ctx.data:Promise.resolve(ctx.data);return OK(promisified.then(data$12=>this._def.type.parseAsync(data$12,{path:ctx.path,errorMap:ctx.common.contextualErrorMap})))}};ZodPromise.create=(schema,params)=>new ZodPromise({type:schema,typeName:ZodFirstPartyTypeKind.ZodPromise,...processCreateParams(params)});var ZodEffects=class extends ZodType{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ZodFirstPartyTypeKind.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(input){let{status,ctx}=this._processInputParams(input),effect$1=this._def.effect||null,checkCtx={addIssue:arg=>{addIssueToContext(ctx,arg),arg.fatal?status.abort():status.dirty()},get path(){return ctx.path}};if(checkCtx.addIssue=checkCtx.addIssue.bind(checkCtx),effect$1.type===`preprocess`){let processed=effect$1.transform(ctx.data,checkCtx);if(ctx.common.async)return Promise.resolve(processed).then(async processed$1=>{if(status.value===`aborted`)return INVALID;let result=await this._def.schema._parseAsync({data:processed$1,path:ctx.path,parent:ctx});return result.status===`aborted`?INVALID:result.status===`dirty`||status.value===`dirty`?DIRTY(result.value):result});{if(status.value===`aborted`)return INVALID;let result=this._def.schema._parseSync({data:processed,path:ctx.path,parent:ctx});return result.status===`aborted`?INVALID:result.status===`dirty`||status.value===`dirty`?DIRTY(result.value):result}}if(effect$1.type===`refinement`){let executeRefinement=acc=>{let result=effect$1.refinement(acc,checkCtx);if(ctx.common.async)return Promise.resolve(result);if(result instanceof Promise)throw Error(`Async refinement encountered during synchronous parse operation. Use .parseAsync instead.`);return acc};if(ctx.common.async===!1){let inner=this._def.schema._parseSync({data:ctx.data,path:ctx.path,parent:ctx});return inner.status===`aborted`?INVALID:(inner.status===`dirty`&&status.dirty(),executeRefinement(inner.value),{status:status.value,value:inner.value})}else return this._def.schema._parseAsync({data:ctx.data,path:ctx.path,parent:ctx}).then(inner=>inner.status===`aborted`?INVALID:(inner.status===`dirty`&&status.dirty(),executeRefinement(inner.value).then(()=>({status:status.value,value:inner.value}))))}if(effect$1.type===`transform`)if(ctx.common.async===!1){let base=this._def.schema._parseSync({data:ctx.data,path:ctx.path,parent:ctx});if(!isValid(base))return INVALID;let result=effect$1.transform(base.value,checkCtx);if(result instanceof Promise)throw Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);return{status:status.value,value:result}}else return this._def.schema._parseAsync({data:ctx.data,path:ctx.path,parent:ctx}).then(base=>isValid(base)?Promise.resolve(effect$1.transform(base.value,checkCtx)).then(result=>({status:status.value,value:result})):INVALID);util.assertNever(effect$1)}};ZodEffects.create=(schema,effect$1,params)=>new ZodEffects({schema,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:effect$1,...processCreateParams(params)}),ZodEffects.createWithPreprocess=(preprocess$1,schema,params)=>new ZodEffects({schema,effect:{type:`preprocess`,transform:preprocess$1},typeName:ZodFirstPartyTypeKind.ZodEffects,...processCreateParams(params)});var ZodOptional=class extends ZodType{_parse(input){let parsedType=this._getType(input);return parsedType===ZodParsedType.undefined?OK(void 0):this._def.innerType._parse(input)}unwrap(){return this._def.innerType}};ZodOptional.create=(type,params)=>new ZodOptional({innerType:type,typeName:ZodFirstPartyTypeKind.ZodOptional,...processCreateParams(params)});var ZodNullable=class extends ZodType{_parse(input){let parsedType=this._getType(input);return parsedType===ZodParsedType.null?OK(null):this._def.innerType._parse(input)}unwrap(){return this._def.innerType}};ZodNullable.create=(type,params)=>new ZodNullable({innerType:type,typeName:ZodFirstPartyTypeKind.ZodNullable,...processCreateParams(params)});var ZodDefault=class extends ZodType{_parse(input){let{ctx}=this._processInputParams(input),data$12=ctx.data;return ctx.parsedType===ZodParsedType.undefined&&(data$12=this._def.defaultValue()),this._def.innerType._parse({data:data$12,path:ctx.path,parent:ctx})}removeDefault(){return this._def.innerType}};ZodDefault.create=(type,params)=>new ZodDefault({innerType:type,typeName:ZodFirstPartyTypeKind.ZodDefault,defaultValue:typeof params.default==`function`?params.default:()=>params.default,...processCreateParams(params)});var ZodCatch=class extends ZodType{_parse(input){let{ctx}=this._processInputParams(input),newCtx={...ctx,common:{...ctx.common,issues:[]}},result=this._def.innerType._parse({data:newCtx.data,path:newCtx.path,parent:{...newCtx}});return isAsync(result)?result.then(result$1=>({status:`valid`,value:result$1.status===`valid`?result$1.value:this._def.catchValue({get error(){return new ZodError(newCtx.common.issues)},input:newCtx.data})})):{status:`valid`,value:result.status===`valid`?result.value:this._def.catchValue({get error(){return new ZodError(newCtx.common.issues)},input:newCtx.data})}}removeCatch(){return this._def.innerType}};ZodCatch.create=(type,params)=>new ZodCatch({innerType:type,typeName:ZodFirstPartyTypeKind.ZodCatch,catchValue:typeof params.catch==`function`?params.catch:()=>params.catch,...processCreateParams(params)});var ZodNaN=class extends ZodType{_parse(input){let parsedType=this._getType(input);if(parsedType!==ZodParsedType.nan){let ctx=this._getOrReturnCtx(input);return addIssueToContext(ctx,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.nan,received:ctx.parsedType}),INVALID}return{status:`valid`,value:input.data}}};ZodNaN.create=params=>new ZodNaN({typeName:ZodFirstPartyTypeKind.ZodNaN,...processCreateParams(params)});const BRAND=Symbol(`zod_brand`);var ZodBranded=class extends ZodType{_parse(input){let{ctx}=this._processInputParams(input),data$12=ctx.data;return this._def.type._parse({data:data$12,path:ctx.path,parent:ctx})}unwrap(){return this._def.type}},ZodPipeline=class ZodPipeline extends ZodType{_parse(input){let{status,ctx}=this._processInputParams(input);if(ctx.common.async){let handleAsync=async()=>{let inResult=await this._def.in._parseAsync({data:ctx.data,path:ctx.path,parent:ctx});return inResult.status===`aborted`?INVALID:inResult.status===`dirty`?(status.dirty(),DIRTY(inResult.value)):this._def.out._parseAsync({data:inResult.value,path:ctx.path,parent:ctx})};return handleAsync()}else{let inResult=this._def.in._parseSync({data:ctx.data,path:ctx.path,parent:ctx});return inResult.status===`aborted`?INVALID:inResult.status===`dirty`?(status.dirty(),{status:`dirty`,value:inResult.value}):this._def.out._parseSync({data:inResult.value,path:ctx.path,parent:ctx})}}static create(a$2,b$4){return new ZodPipeline({in:a$2,out:b$4,typeName:ZodFirstPartyTypeKind.ZodPipeline})}},ZodReadonly=class extends ZodType{_parse(input){let result=this._def.innerType._parse(input),freeze=data$12=>(isValid(data$12)&&(data$12.value=Object.freeze(data$12.value)),data$12);return isAsync(result)?result.then(data$12=>freeze(data$12)):freeze(result)}unwrap(){return this._def.innerType}};ZodReadonly.create=(type,params)=>new ZodReadonly({innerType:type,typeName:ZodFirstPartyTypeKind.ZodReadonly,...processCreateParams(params)});const late={object:ZodObject.lazycreate};var ZodFirstPartyTypeKind;(function(ZodFirstPartyTypeKind$1){ZodFirstPartyTypeKind$1.ZodString=`ZodString`,ZodFirstPartyTypeKind$1.ZodNumber=`ZodNumber`,ZodFirstPartyTypeKind$1.ZodNaN=`ZodNaN`,ZodFirstPartyTypeKind$1.ZodBigInt=`ZodBigInt`,ZodFirstPartyTypeKind$1.ZodBoolean=`ZodBoolean`,ZodFirstPartyTypeKind$1.ZodDate=`ZodDate`,ZodFirstPartyTypeKind$1.ZodSymbol=`ZodSymbol`,ZodFirstPartyTypeKind$1.ZodUndefined=`ZodUndefined`,ZodFirstPartyTypeKind$1.ZodNull=`ZodNull`,ZodFirstPartyTypeKind$1.ZodAny=`ZodAny`,ZodFirstPartyTypeKind$1.ZodUnknown=`ZodUnknown`,ZodFirstPartyTypeKind$1.ZodNever=`ZodNever`,ZodFirstPartyTypeKind$1.ZodVoid=`ZodVoid`,ZodFirstPartyTypeKind$1.ZodArray=`ZodArray`,ZodFirstPartyTypeKind$1.ZodObject=`ZodObject`,ZodFirstPartyTypeKind$1.ZodUnion=`ZodUnion`,ZodFirstPartyTypeKind$1.ZodDiscriminatedUnion=`ZodDiscriminatedUnion`,ZodFirstPartyTypeKind$1.ZodIntersection=`ZodIntersection`,ZodFirstPartyTypeKind$1.ZodTuple=`ZodTuple`,ZodFirstPartyTypeKind$1.ZodRecord=`ZodRecord`,ZodFirstPartyTypeKind$1.ZodMap=`ZodMap`,ZodFirstPartyTypeKind$1.ZodSet=`ZodSet`,ZodFirstPartyTypeKind$1.ZodFunction=`ZodFunction`,ZodFirstPartyTypeKind$1.ZodLazy=`ZodLazy`,ZodFirstPartyTypeKind$1.ZodLiteral=`ZodLiteral`,ZodFirstPartyTypeKind$1.ZodEnum=`ZodEnum`,ZodFirstPartyTypeKind$1.ZodEffects=`ZodEffects`,ZodFirstPartyTypeKind$1.ZodNativeEnum=`ZodNativeEnum`,ZodFirstPartyTypeKind$1.ZodOptional=`ZodOptional`,ZodFirstPartyTypeKind$1.ZodNullable=`ZodNullable`,ZodFirstPartyTypeKind$1.ZodDefault=`ZodDefault`,ZodFirstPartyTypeKind$1.ZodCatch=`ZodCatch`,ZodFirstPartyTypeKind$1.ZodPromise=`ZodPromise`,ZodFirstPartyTypeKind$1.ZodBranded=`ZodBranded`,ZodFirstPartyTypeKind$1.ZodPipeline=`ZodPipeline`,ZodFirstPartyTypeKind$1.ZodReadonly=`ZodReadonly`})(ZodFirstPartyTypeKind||={});const stringType=ZodString.create,numberType=ZodNumber.create,nanType=ZodNaN.create,bigIntType=ZodBigInt.create,booleanType=ZodBoolean.create,dateType=ZodDate.create,symbolType=ZodSymbol.create,undefinedType=ZodUndefined.create,nullType=ZodNull.create,anyType=ZodAny.create,unknownType=ZodUnknown.create,neverType=ZodNever.create,voidType=ZodVoid.create,arrayType=ZodArray.create,objectType=ZodObject.create,strictObjectType=ZodObject.strictCreate,unionType=ZodUnion.create,discriminatedUnionType=ZodDiscriminatedUnion.create,intersectionType=ZodIntersection.create,tupleType=ZodTuple.create,recordType=ZodRecord.create,mapType=ZodMap.create,setType=ZodSet.create,functionType=ZodFunction.create,lazyType=ZodLazy.create,literalType=ZodLiteral.create,enumType=ZodEnum.create,nativeEnumType=ZodNativeEnum.create,promiseType=ZodPromise.create,effectsType=ZodEffects.create,optionalType=ZodOptional.create,nullableType=ZodNullable.create,preprocessType=ZodEffects.createWithPreprocess,pipelineType=ZodPipeline.create,tools$1=[tool({name:`debug_random_number`,description:`Generate a random number between 0 and 1`,execute:async()=>new Promise(resolve$1=>{setTimeout(()=>{resolve$1(Math.random().toString())},1e3)}),parameters:objectType({})})],debug=async()=>Promise.all(tools$1);function __classPrivateFieldGet(receiver,state,kind,f$3){if(kind===`a`&&!f$3)throw TypeError(`Private accessor was defined without a getter`);if(typeof state==`function`?receiver!==state||!f$3:!state.has(receiver))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return kind===`m`?f$3:kind===`a`?f$3.call(receiver):f$3?f$3.value:state.get(receiver)}function __classPrivateFieldSet(receiver,state,value$1,kind,f$3){if(kind===`m`)throw TypeError(`Private method is not writable`);if(kind===`a`&&!f$3)throw TypeError(`Private accessor was defined without a setter`);if(typeof state==`function`?receiver!==state||!f$3:!state.has(receiver))throw TypeError(`Cannot write private member to an object whose class did not declare it`);return kind===`a`?f$3.call(receiver,value$1):f$3?f$3.value=value$1:state.set(receiver,value$1),value$1}var _Channel_onmessage,_Channel_nextMessageIndex,_Channel_pendingMessages,_Channel_messageEndIndex,_Resource_rid;const SERIALIZE_TO_IPC_FN=`__TAURI_TO_IPC_KEY__`;function transformCallback(callback,once=!1){return window.__TAURI_INTERNALS__.transformCallback(callback,once)}var Channel=class{constructor(onmessage){_Channel_onmessage.set(this,void 0),_Channel_nextMessageIndex.set(this,0),_Channel_pendingMessages.set(this,[]),_Channel_messageEndIndex.set(this,void 0),__classPrivateFieldSet(this,_Channel_onmessage,onmessage||(()=>{}),`f`),this.id=transformCallback(rawMessage=>{let index$1=rawMessage.index;if(`end`in rawMessage){index$1==__classPrivateFieldGet(this,_Channel_nextMessageIndex,`f`)?this.cleanupCallback():__classPrivateFieldSet(this,_Channel_messageEndIndex,index$1,`f`);return}let message$1=rawMessage.message;if(index$1==__classPrivateFieldGet(this,_Channel_nextMessageIndex,`f`)){for(__classPrivateFieldGet(this,_Channel_onmessage,`f`).call(this,message$1),__classPrivateFieldSet(this,_Channel_nextMessageIndex,__classPrivateFieldGet(this,_Channel_nextMessageIndex,`f`)+1,`f`);__classPrivateFieldGet(this,_Channel_nextMessageIndex,`f`)in __classPrivateFieldGet(this,_Channel_pendingMessages,`f`);){let message$2=__classPrivateFieldGet(this,_Channel_pendingMessages,`f`)[__classPrivateFieldGet(this,_Channel_nextMessageIndex,`f`)];__classPrivateFieldGet(this,_Channel_onmessage,`f`).call(this,message$2),delete __classPrivateFieldGet(this,_Channel_pendingMessages,`f`)[__classPrivateFieldGet(this,_Channel_nextMessageIndex,`f`)],__classPrivateFieldSet(this,_Channel_nextMessageIndex,__classPrivateFieldGet(this,_Channel_nextMessageIndex,`f`)+1,`f`)}__classPrivateFieldGet(this,_Channel_nextMessageIndex,`f`)===__classPrivateFieldGet(this,_Channel_messageEndIndex,`f`)&&this.cleanupCallback()}else __classPrivateFieldGet(this,_Channel_pendingMessages,`f`)[index$1]=message$1})}cleanupCallback(){window.__TAURI_INTERNALS__.unregisterCallback(this.id)}set onmessage(handler){__classPrivateFieldSet(this,_Channel_onmessage,handler,`f`)}get onmessage(){return __classPrivateFieldGet(this,_Channel_onmessage,`f`)}[(_Channel_onmessage=new WeakMap,_Channel_nextMessageIndex=new WeakMap,_Channel_pendingMessages=new WeakMap,_Channel_messageEndIndex=new WeakMap,SERIALIZE_TO_IPC_FN)](){return`__CHANNEL__:${this.id}`}toJSON(){return this[SERIALIZE_TO_IPC_FN]()}};async function invoke(cmd,args={},options$1){return window.__TAURI_INTERNALS__.invoke(cmd,args,options$1)}_Resource_rid=new WeakMap;async function connectServer(command,args){await invoke(`plugin:mcp|connect_server`,{command,args})}async function disconnectServer(){await invoke(`plugin:mcp|disconnect_server`)}async function listTools(){return await invoke(`plugin:mcp|list_tools`)}async function callTool(name$2,args){return await invoke(`plugin:mcp|call_tool`,{name:name$2,args})}const tools=[tool({name:`mcp_list_tools`,description:`List all tools available on the MCP server`,execute:async(_$2,__)=>await listTools(),parameters:objectType({})}),tool({name:`mcp_connect_server`,description:`Connect to the MCP server. If "success", the connection to the MCP server is successful. Otherwise, the connection fails.`,execute:async({command,args})=>(await connectServer(command,args),`success`),parameters:objectType({command:stringType().describe(`The command to connect to the MCP server`),args:arrayType(stringType()).describe(`The arguments to pass to the MCP server`)})}),tool({name:`mcp_disconnect_server`,description:`Disconnect from the MCP server. If "success", the disconnection from the MCP server is successful. Otherwise, the disconnection fails.`,execute:async()=>(await disconnectServer(),`success`),parameters:objectType({})}),tool({name:`mcp_call_tool`,description:`Call a tool on the MCP server. The result is a list of content and a boolean indicating whether the tool call is an error.`,execute:async({name:name$2,parameters})=>{let parametersObject=Object.fromEntries(parameters.map(({name:name$3,value:value$1})=>[name$3,value$1])),result=await callTool(name$2,parametersObject);return result},parameters:objectType({name:stringType().describe(`The name of the tool to call`),parameters:arrayType(objectType({name:stringType().describe(`The name of the parameter`),value:unionType([stringType(),numberType(),booleanType(),objectType({})]).describe(`The value of the parameter, it can be a string, a number, a boolean, or an object`)})).describe(`The parameters to pass to the tool`)})})],mcp=async()=>Promise.all(tools);function streamOptionsToolsCompatibilityOk(model,chatProvider,_$2,options$1,toolsCompatibility=new Map){return!!(options$1?.supportsTools||toolsCompatibility.get(`${chatProvider.chat(model).baseURL}-${model}`))}async function streamFrom(model,chatProvider,messages,options$1){let headers=options$1?.headers;return await streamText({...chatProvider.chat(model),maxSteps:10,messages:messages.map(msg=>({...msg,content:msg.role===`error`?`User encountered error: ${msg.content}`:msg.content,role:msg.role===`error`?`user`:msg.role})),headers,tools:streamOptionsToolsCompatibilityOk(model,chatProvider,messages,options$1)?[...await mcp(),...await debug()]:void 0,onEvent(event){event.type===`tool-call`?options$1?.onToolCall?.(event.toolCall):event.type===`tool-call-result`&&options$1?.onToolCallResult?.({id:event.id,result:event.result})}})}async function attemptForToolsCompatibilityDiscovery(model,chatProvider,_$2,options$1){async function attempt(enable){try{let res=await streamFrom(model,chatProvider,[{role:`user`,content:`Hello, world!`}],{...options$1,supportsTools:enable});for await(let _$3 of readableStreamToAsyncIterator(res.textStream,async v$2=>v$2));return!0}catch(err){if(err instanceof Error&&err.name===new XSAIError$1(``).name&&(String(err).includes(`does not support tools`)||String(err).includes(`No endpoints found that support tool use.`)))return!1;throw err}}function promiseAllWithInterval(promises,interval){return new Promise(resolve$1=>{let results=[],completed=0;promises.forEach((promiseFn,index$1)=>{setTimeout(()=>{promiseFn().then(result=>{results[index$1]={result}}).catch(err=>{results[index$1]={error:err}}).finally(()=>{completed++,completed===promises.length&&resolve$1(results)})},index$1*interval)})})}let attempts=[()=>attempt(!0),()=>attempt(!1)],attemptsResults=await promiseAllWithInterval(attempts,1e3);if(attemptsResults.some(res=>res.error)){let err=Error(`Error during tools compatibility discovery for model: ${model}. Errors: ${attemptsResults.map(res=>res.error).filter(Boolean).join(`, `)}`);throw err.cause=attemptsResults.map(res=>res.error).filter(Boolean),err}return attemptsResults[0].result===!0&&attemptsResults[1].result===!0}const useLLM=defineStore(`llm`,()=>{let toolsCompatibility=ref(new Map);async function discoverToolsCompatibility(model,chatProvider,_$2,options$1){if(toolsCompatibility.value.has(`${chatProvider.chat(model).baseURL}-${model}`))return;let res=await attemptForToolsCompatibilityDiscovery(model,chatProvider,_$2,{...options$1,toolsCompatibility:toolsCompatibility.value});toolsCompatibility.value.set(`${chatProvider.chat(model).baseURL}-${model}`,res)}function stream(model,chatProvider,messages,options$1){return streamFrom(model,chatProvider,messages,{...options$1,toolsCompatibility:toolsCompatibility.value})}async function models$1(apiUrl,apiKey){if(apiUrl===``)return[];try{return await listModels({baseURL:apiUrl.endsWith(`/`)?apiUrl:`${apiUrl}/`,apiKey})}catch(err){if(String(err).includes(`Failed to construct 'URL': Invalid URL`))return[];throw err}}return{models:models$1,stream,discoverToolsCompatibility}}),createChatProvider=options$1=>({chat:model=>Object.assign(options$1,{model})}),createEmbedProvider=options$1=>({embed:model=>Object.assign(options$1,{model})}),createImageProvider=options$1=>({image:model=>Object.assign(options$1,{model})}),createModelProvider=options$1=>({model:()=>options$1}),createSpeechProvider=options$1=>({speech:model=>Object.assign(options$1,{model})}),createTranscriptionProvider=options$1=>({transcription:model=>Object.assign(options$1,{model})}),createMetadataProvider=(id$1,otherMeta)=>({metadata:{id:id$1,...otherMeta}}),merge$1=(...arr)=>Object.assign(arr[0],...arr.slice(1)),createAnthropic=(apiKey,baseURL=`https://api.anthropic.com/v1/`)=>merge$1(createMetadataProvider(`anthropic`),createChatProvider({apiKey,baseURL}),createModelProvider({apiKey,baseURL})),createAzure=async options$1=>{let headers=typeof options$1.apiKey==`string`?{"api-key":options$1.apiKey}:void 0,baseURL=`https://${options$1.resourceName}.services.ai.azure.com/models/`,fetch$1=async(input,init)=>{if(options$1.apiVersion!=null&&input.searchParams.set(`api-version`,options$1.apiVersion),typeof options$1.apiKey==`function`){init.headers??={};let token=`Bearer ${await options$1.apiKey()}`;Array.isArray(init.headers)?init.headers.push([`Authorization`,token]):init.headers instanceof Headers?init.headers.append(`Authorization`,token):init.headers.Authorization=token}return globalThis.fetch(input,init)};return merge$1(createMetadataProvider(`azure`),createChatProvider({baseURL,fetch:fetch$1,headers}),createEmbedProvider({baseURL,fetch:fetch$1,headers}),createSpeechProvider({baseURL,fetch:fetch$1,headers}),createTranscriptionProvider({baseURL,fetch:fetch$1,headers}),createModelProvider({baseURL,fetch:fetch$1,headers}))},createDeepSeek=(apiKey,baseURL=`https://api.deepseek.com/`)=>merge$1(createMetadataProvider(`deepseek`),createChatProvider({apiKey,baseURL}),createModelProvider({apiKey,baseURL})),createFireworks=(apiKey,baseURL=`https://api.fireworks.ai/inference/v1/`)=>merge$1(createMetadataProvider(`fireworks`),createChatProvider({apiKey,baseURL}),createEmbedProvider({apiKey,baseURL}),createModelProvider({apiKey,baseURL})),createGoogleGenerativeAI=(apiKey,baseURL=`https://generativelanguage.googleapis.com/v1beta/openai/`)=>merge$1(createMetadataProvider(`google-generative-ai`),createChatProvider({apiKey,baseURL}),createEmbedProvider({apiKey,baseURL}),createModelProvider({apiKey,baseURL})),createMistral=(apiKey,baseURL=`https://api.mistral.ai/v1/`)=>merge$1(createMetadataProvider(`mistral`),createChatProvider({apiKey,baseURL}),createEmbedProvider({apiKey,baseURL}),createModelProvider({apiKey,baseURL})),createMoonshot=(apiKey,baseURL=`https://api.moonshot.cn/v1/`)=>merge$1(createMetadataProvider(`moonshot`),createChatProvider({apiKey,baseURL}),createModelProvider({apiKey,baseURL})),createNovita=(apiKey,baseURL=`https://api.novita.ai/v3/openai/`)=>merge$1(createMetadataProvider(`novita`),createChatProvider({apiKey,baseURL}),createModelProvider({apiKey,baseURL})),createOpenAI=(apiKey,baseURL=`https://api.openai.com/v1/`)=>merge$1(createMetadataProvider(`openai`),createChatProvider({apiKey,baseURL}),createEmbedProvider({apiKey,baseURL}),createImageProvider({apiKey,baseURL}),createModelProvider({apiKey,baseURL}),createSpeechProvider({apiKey,baseURL}),createTranscriptionProvider({apiKey,baseURL})),createOpenRouter=(apiKey,baseURL=``)=>merge$1(createMetadataProvider(`openrouter`),{chat:(model,openRouterOptions)=>{let requestOptions={apiKey,baseURL,model},toOpenRouterOptions=({extraHeaders,models:models$1,provider})=>{extraHeaders!=null&&(requestOptions.headers??={},Object.assign(requestOptions.headers,extraHeaders));let transformedProvider;return provider!=null&&(transformedProvider=objCamelToSnake$1(provider)),objCamelToSnake$1({models:models$1,provider:transformedProvider})};return{...openRouterOptions?toOpenRouterOptions(openRouterOptions):{},...requestOptions}}},createModelProvider({apiKey,baseURL})),createPerplexity=(apiKey,baseURL=`https://api.perplexity.ai/`)=>merge$1(createMetadataProvider(`perplexity`),createChatProvider({apiKey,baseURL})),createTogetherAI=(apiKey,baseURL=`https://api.together.xyz/v1/`)=>merge$1(createMetadataProvider(`together-ai`),createChatProvider({apiKey,baseURL}),createEmbedProvider({apiKey,baseURL}),createModelProvider({apiKey,baseURL,fetch:async(...args)=>globalThis.fetch(...args).then(async res=>res.json()).then(data$12=>Response.json({data:data$12,object:`list`}))})),createWorkersAI=(apiKey,accountId)=>{let baseURL=`https://api.cloudflare.com/client/v4/accounts/${accountId}/ai/v1/`;return merge$1(createMetadataProvider(`workers-ai`),createChatProvider({apiKey,baseURL}),createEmbedProvider({apiKey,baseURL}))},createXAI=(apiKey,baseURL=`https://api.x.ai/v1/`)=>merge$1(createMetadataProvider(`xai`),createChatProvider({apiKey,baseURL}),createModelProvider({apiKey,baseURL})),createOllama=(baseURL=`http://localhost:11434/v1/`)=>merge$1(createMetadataProvider(`ollama`),createChatProvider({baseURL}),createEmbedProvider({baseURL}),createModelProvider({baseURL})),decodeBase64=b64=>{let binString=atob(b64),size$2=binString.length,bytes=new Uint8Array(size$2);for(let i$1=0;i$1merge$1(createMetadataProvider(`player2`),createChatProvider({baseURL,headers:{"player2-game-key":gameKey}}),createSpeechProvider({baseURL,fetch:async(input,reqInit)=>{let newUrl=`${input.toString().slice(0,-12)}tts/speak`;try{let{input:input2,response_format,speed,voice,...rest}=JSON.parse(reqInit?.body),modified={audio_format:response_format,play_in_app:!1,speed:speed??1,text:input2,voice_ids:voice==null?[]:[voice],...rest};reqInit&&(reqInit.body=JSON.stringify(modified))}catch(err){console.warn(`Could not parse body as JSON:`,err)}return globalThis.fetch(newUrl,reqInit).then(async res=>res.json()).then(json=>{let base64=json.data??``,bytes=decodeBase64(base64);return new Response(bytes,{headers:{"Content-Type":`audio/mpeg`},status:200})})},headers:{"player2-game-key":gameKey}}));async function check(){try{if(isInNodejsRuntime())return{supported:!1,isNode:!0,reason:``,fp16Supported:!1};if(typeof navigator>`u`||!navigator.gpu)return{supported:!1,isNode:!1,reason:`WebGPU is not available (navigator.gpu is undefined)`,fp16Supported:!1};let adapter=await navigator.gpu.requestAdapter();return adapter?{supported:!0,isNode:!1,reason:``,adapter,fp16Supported:adapter.features.has(`shader-f16`)}:{supported:!1,isNode:!1,reason:`WebGPU is not supported (no adapter found)`,fp16Supported:!1}}catch(error){let errorMessage=error instanceof Error?error.toString():String(error);return{supported:!1,isNode:!1,reason:errorMessage,fp16Supported:!1}}}function isInNodejsRuntime(){return typeof process<`u`&&`versions`in process&&process.versions!=null&&typeof process.versions==`object`&&`node`in process.versions&&process.versions.node!=null}async function isWebGPUSupported(){return check().then(result=>result.supported)}const merge=(...arr)=>Object.assign(arr[0],...arr.slice(1));var XSAIError=class extends Error{response;constructor(message$1,response){super(message$1),this.name=`XSAIError`,this.response=response}};const strCamelToSnake=str=>str.replace(/[A-Z]/g,s$1=>`_${s$1.toLowerCase()}`),objCamelToSnake=obj=>Object.fromEntries(Object.entries(obj).map(([k$4,v$2])=>[strCamelToSnake(k$4),v$2])),clean$1=obj=>Object.fromEntries(Object.entries(obj).filter(([,v$2])=>v$2!==void 0)),requestHeaders$1=(headers,apiKey)=>clean$1({Authorization:apiKey===void 0?void 0:`Bearer ${apiKey}`,...headers}),requestURL$1=(path,baseURL)=>{let base=baseURL.toString();return new URL(path,base.endsWith(`/`)?base:`${base}/`)},responseCatch$1=async res=>{if(!res.ok)throw new XSAIError(`Remote sent ${res.status} response: ${await res.text()}`,res);if(!res.body)throw new XSAIError(`Response body is empty from remote server`,res);if(!(res.body instanceof ReadableStream))throw new XSAIError(`Expected Response body to be a ReadableStream, but got ${String(res.body)}; Content Type is ${res.headers.get(`Content-Type`)}`,res);return res},responseJSON$1=async res=>responseCatch$1(res).then(async res2=>{let text$5=await res2.text();try{return JSON.parse(text$5)}catch{throw Error(`Failed to parse response, response body: ${text$5}`)}});var createUnElevenLabs=(apiKey,baseURL=`http://localhost:5933/v1/`)=>{let toUnSpeechOptions=({applyTextNormalization,languageCode,nextRequestIds,nextText,previousRequestIds,previousText,pronunciationDictionaryLocators,seed,voiceSettings})=>({extraBody:objCamelToSnake({applyTextNormalization,languageCode,nextRequestIds,nextText,previousRequestIds,previousText,pronunciationDictionaryLocators:pronunciationDictionaryLocators?pronunciationDictionaryLocators.map(pdl=>objCamelToSnake(pdl)):void 0,seed,voiceSettings:objCamelToSnake(voiceSettings??{similarityBoost:.75,stability:.5})})}),speechProvider={speech:(model,options$1)=>({...options$1?toUnSpeechOptions(options$1):{},apiKey,baseURL,model:`elevenlabs/${model}`})},voiceProvider={voice:options$1=>(baseURL.endsWith(`v1/`)?baseURL=baseURL.slice(0,-3):baseURL.endsWith(`v1`)&&(baseURL=baseURL.slice(0,-2)),{query:`provider=elevenlabs`,...options$1?toUnSpeechOptions(options$1):{},apiKey,baseURL})};return merge(speechProvider,voiceProvider)},createUnMicrosoft=(apiKey,baseURL=`http://localhost:5933/v1/`)=>{let toUnSpeechOptions=options$1=>{let{deploymentId,region,sampleRate}=options$1,extraBody={deploymentId,region,sampleRate};return`disableSsml`in options$1?extraBody.disableSsml=options$1.disableSsml:`lang`in options$1&&(extraBody.lang=options$1.lang,extraBody.gender=options$1.gender,extraBody.voice=options$1.voice),{extraBody:objCamelToSnake(extraBody)}},speechProvider={speech:(model,options$1)=>({...options$1?toUnSpeechOptions(options$1):{},apiKey,baseURL,model:`microsoft/${model}`})},voiceProvider={voice:options$1=>(baseURL.endsWith(`v1/`)?baseURL=baseURL.slice(0,-3):baseURL.endsWith(`v1`)&&(baseURL=baseURL.slice(0,-2)),{query:`region=${options$1?.region}&provider=microsoft`,...options$1?toUnSpeechOptions(options$1):{},apiKey,baseURL})};return merge(speechProvider,voiceProvider)},createUnVolcengine=(apiKey,baseURL=`http://localhost:5933/v1/`)=>{let toUnSpeechOptions=options$1=>{let extraBody={app:{appid:options$1.app?.appId,token:apiKey}};return options$1.app!==void 0&&(extraBody.app={...options$1.app,appid:options$1.app?.appId,token:apiKey}),options$1.user!==void 0&&(extraBody.user=options$1.user),options$1.audio!==void 0&&(extraBody.audio=options$1.audio),{extraBody:objCamelToSnake(extraBody)}},speechProvider={speech:(model,options$1)=>({...options$1?toUnSpeechOptions(options$1):{},apiKey,baseURL,model:`volcengine/${model}`})},voiceProvider={voice:options$1=>(baseURL.endsWith(`v1/`)?baseURL=baseURL.slice(0,-3):baseURL.endsWith(`v1`)&&(baseURL=baseURL.slice(0,-2)),{query:`provider=volcengine`,...options$1?toUnSpeechOptions(options$1):{},apiKey,baseURL})};return merge(speechProvider,voiceProvider)},createUnAlibabaCloud=(apiKey,baseURL=`http://localhost:5933/v1/`)=>{let toUnSpeechOptions=options$1=>{let{sampleRate,volume,rate,pitch}=options$1,extraBody={sampleRate,volume,rate,pitch};return Object.keys(extraBody).forEach(key$2=>extraBody[key$2]===void 0&&delete extraBody[key$2]),{extraBody:objCamelToSnake(extraBody)}},speechProvider={speech:(model,options$1)=>({...options$1?toUnSpeechOptions(options$1):{},apiKey,baseURL,model:`alibaba/${model}`})},voiceProvider={voice:options$1=>{let adjustedBaseURL=baseURL;return adjustedBaseURL.endsWith(`v1/`)?adjustedBaseURL=adjustedBaseURL.slice(0,-3):adjustedBaseURL.endsWith(`v1`)&&(adjustedBaseURL=adjustedBaseURL.slice(0,-2)),{query:`provider=alibaba`,...options$1?toUnSpeechOptions(options$1):{},apiKey,baseURL:adjustedBaseURL}}};return merge(speechProvider,voiceProvider)},listVoices=async options$1=>(options$1.fetch??globalThis.fetch)(requestURL$1(options$1.query?`api/voices?${options$1.query}`:`api/voices`,options$1.baseURL),{headers:requestHeaders$1({...options$1.headers},options$1.apiKey),method:`GET`,signal:options$1.abortSignal}).then(responseJSON$1).then(({voices})=>voices);const models=[{model_id:`eleven_multilingual_v2`,name:`Eleven Multilingual v2`,can_be_finetuned:!0,can_do_text_to_speech:!0,can_do_voice_conversion:!1,can_use_style:!0,can_use_speaker_boost:!0,serves_pro_voices:!1,token_cost_factor:1,description:`Our most life-like, emotionally rich mode in 29 languages. Best for voice overs, audiobooks, post-production, or any other content creation needs.`,requires_alpha_access:!1,max_characters_request_free_user:1e4,max_characters_request_subscribed_user:1e4,maximum_text_length_per_request:1e4,languages:[{language_id:`en`,name:`English`},{language_id:`ja`,name:`Japanese`},{language_id:`zh`,name:`Chinese`},{language_id:`de`,name:`German`},{language_id:`hi`,name:`Hindi`},{language_id:`fr`,name:`French`},{language_id:`ko`,name:`Korean`},{language_id:`pt`,name:`Portuguese`},{language_id:`it`,name:`Italian`},{language_id:`es`,name:`Spanish`},{language_id:`id`,name:`Indonesian`},{language_id:`nl`,name:`Dutch`},{language_id:`tr`,name:`Turkish`},{language_id:`fil`,name:`Filipino`},{language_id:`pl`,name:`Polish`},{language_id:`sv`,name:`Swedish`},{language_id:`bg`,name:`Bulgarian`},{language_id:`ro`,name:`Romanian`},{language_id:`ar`,name:`Arabic`},{language_id:`cs`,name:`Czech`},{language_id:`el`,name:`Greek`},{language_id:`fi`,name:`Finnish`},{language_id:`hr`,name:`Croatian`},{language_id:`ms`,name:`Malay`},{language_id:`sk`,name:`Slovak`},{language_id:`da`,name:`Danish`},{language_id:`ta`,name:`Tamil`},{language_id:`uk`,name:`Ukrainian`},{language_id:`ru`,name:`Russian`}],model_rates:{character_cost_multiplier:1},concurrency_group:`standard`},{model_id:`eleven_flash_v2_5`,name:`Eleven Flash v2.5`,can_be_finetuned:!0,can_do_text_to_speech:!0,can_do_voice_conversion:!1,can_use_style:!1,can_use_speaker_boost:!1,serves_pro_voices:!1,token_cost_factor:1,description:`Our ultra low latency model in 32 languages. Ideal for conversational use cases.`,requires_alpha_access:!1,max_characters_request_free_user:4e4,max_characters_request_subscribed_user:4e4,maximum_text_length_per_request:4e4,languages:[{language_id:`en`,name:`English`},{language_id:`ja`,name:`Japanese`},{language_id:`zh`,name:`Chinese`},{language_id:`de`,name:`German`},{language_id:`hi`,name:`Hindi`},{language_id:`fr`,name:`French`},{language_id:`ko`,name:`Korean`},{language_id:`pt`,name:`Portuguese`},{language_id:`it`,name:`Italian`},{language_id:`es`,name:`Spanish`},{language_id:`ru`,name:`Russian`},{language_id:`id`,name:`Indonesian`},{language_id:`nl`,name:`Dutch`},{language_id:`tr`,name:`Turkish`},{language_id:`fil`,name:`Filipino`},{language_id:`pl`,name:`Polish`},{language_id:`sv`,name:`Swedish`},{language_id:`bg`,name:`Bulgarian`},{language_id:`ro`,name:`Romanian`},{language_id:`ar`,name:`Arabic`},{language_id:`cs`,name:`Czech`},{language_id:`el`,name:`Greek`},{language_id:`fi`,name:`Finnish`},{language_id:`hr`,name:`Croatian`},{language_id:`ms`,name:`Malay`},{language_id:`sk`,name:`Slovak`},{language_id:`da`,name:`Danish`},{language_id:`ta`,name:`Tamil`},{language_id:`uk`,name:`Ukrainian`},{language_id:`hu`,name:`Hungarian`},{language_id:`no`,name:`Norwegian`},{language_id:`vi`,name:`Vietnamese`}],model_rates:{character_cost_multiplier:.5},concurrency_group:`turbo`},{model_id:`eleven_turbo_v2_5`,name:`Eleven Turbo v2.5`,can_be_finetuned:!0,can_do_text_to_speech:!0,can_do_voice_conversion:!1,can_use_style:!1,can_use_speaker_boost:!1,serves_pro_voices:!1,token_cost_factor:1,description:`Our high quality, low latency model in 32 languages. Best for developer use cases where speed matters and you need non-English languages.`,requires_alpha_access:!1,max_characters_request_free_user:4e4,max_characters_request_subscribed_user:4e4,maximum_text_length_per_request:4e4,languages:[{language_id:`en`,name:`English`},{language_id:`ja`,name:`Japanese`},{language_id:`zh`,name:`Chinese`},{language_id:`de`,name:`German`},{language_id:`hi`,name:`Hindi`},{language_id:`fr`,name:`French`},{language_id:`ko`,name:`Korean`},{language_id:`pt`,name:`Portuguese`},{language_id:`it`,name:`Italian`},{language_id:`es`,name:`Spanish`},{language_id:`ru`,name:`Russian`},{language_id:`id`,name:`Indonesian`},{language_id:`nl`,name:`Dutch`},{language_id:`tr`,name:`Turkish`},{language_id:`fil`,name:`Filipino`},{language_id:`pl`,name:`Polish`},{language_id:`sv`,name:`Swedish`},{language_id:`bg`,name:`Bulgarian`},{language_id:`ro`,name:`Romanian`},{language_id:`ar`,name:`Arabic`},{language_id:`cs`,name:`Czech`},{language_id:`el`,name:`Greek`},{language_id:`fi`,name:`Finnish`},{language_id:`hr`,name:`Croatian`},{language_id:`ms`,name:`Malay`},{language_id:`sk`,name:`Slovak`},{language_id:`da`,name:`Danish`},{language_id:`ta`,name:`Tamil`},{language_id:`uk`,name:`Ukrainian`},{language_id:`vi`,name:`Vietnamese`},{language_id:`no`,name:`Norwegian`},{language_id:`hu`,name:`Hungarian`}],model_rates:{character_cost_multiplier:.5},concurrency_group:`turbo`},{model_id:`eleven_turbo_v2`,name:`Eleven Turbo v2`,can_be_finetuned:!0,can_do_text_to_speech:!0,can_do_voice_conversion:!1,can_use_style:!1,can_use_speaker_boost:!1,serves_pro_voices:!1,token_cost_factor:1,description:`Our English-only, low latency model. Best for developer use cases where speed matters and you only need English. Performance is on par with Turbo v2.5.`,requires_alpha_access:!1,max_characters_request_free_user:3e4,max_characters_request_subscribed_user:3e4,maximum_text_length_per_request:3e4,languages:[{language_id:`en`,name:`English`}],model_rates:{character_cost_multiplier:.5},concurrency_group:`turbo`},{model_id:`eleven_flash_v2`,name:`Eleven Flash v2`,can_be_finetuned:!0,can_do_text_to_speech:!0,can_do_voice_conversion:!1,can_use_style:!1,can_use_speaker_boost:!1,serves_pro_voices:!1,token_cost_factor:1,description:`Our ultra low latency model in english. Ideal for conversational use cases.`,requires_alpha_access:!1,max_characters_request_free_user:3e4,max_characters_request_subscribed_user:3e4,maximum_text_length_per_request:3e4,languages:[{language_id:`en`,name:`English`}],model_rates:{character_cost_multiplier:.5},concurrency_group:`turbo`},{model_id:`eleven_english_sts_v2`,name:`Eleven English v2`,can_be_finetuned:!1,can_do_text_to_speech:!1,can_do_voice_conversion:!0,can_use_style:!0,can_use_speaker_boost:!0,serves_pro_voices:!1,token_cost_factor:1,description:`Our state-of-the-art speech to speech model suitable for scenarios where you need maximum control over the content and prosody of your generations.`,requires_alpha_access:!1,max_characters_request_free_user:5e3,max_characters_request_subscribed_user:5e3,maximum_text_length_per_request:5e3,languages:[{language_id:`en`,name:`English`}],model_rates:{character_cost_multiplier:1},concurrency_group:`standard`},{model_id:`eleven_multilingual_v1`,name:`Eleven Multilingual v1`,can_be_finetuned:!1,can_do_text_to_speech:!0,can_do_voice_conversion:!1,can_use_style:!1,can_use_speaker_boost:!1,serves_pro_voices:!1,token_cost_factor:1,description:`Our first Multilingual model, capability of generating speech in 10 languages. Now outclassed by Multilingual v2 (for content creation) and Turbo v2.5 (for low latency use cases).`,requires_alpha_access:!1,max_characters_request_free_user:1e4,max_characters_request_subscribed_user:1e4,maximum_text_length_per_request:1e4,languages:[{language_id:`en`,name:`English`},{language_id:`de`,name:`German`},{language_id:`pl`,name:`Polish`},{language_id:`es`,name:`Spanish`},{language_id:`it`,name:`Italian`},{language_id:`fr`,name:`French`},{language_id:`pt`,name:`Portuguese`},{language_id:`hi`,name:`Hindi`},{language_id:`ar`,name:`Arabic`}],model_rates:{character_cost_multiplier:1},concurrency_group:`standard`},{model_id:`eleven_multilingual_sts_v2`,name:`Eleven Multilingual v2`,can_be_finetuned:!0,can_do_text_to_speech:!1,can_do_voice_conversion:!0,can_use_style:!0,can_use_speaker_boost:!0,serves_pro_voices:!1,token_cost_factor:1,description:`Our cutting-edge, multilingual speech-to-speech model is designed for situations that demand unparalleled control over both the content and the prosody of the generated speech across various languages.`,requires_alpha_access:!1,max_characters_request_free_user:1e4,max_characters_request_subscribed_user:1e4,maximum_text_length_per_request:1e4,languages:[{language_id:`en`,name:`English`},{language_id:`ja`,name:`Japanese`},{language_id:`zh`,name:`Chinese`},{language_id:`de`,name:`German`},{language_id:`hi`,name:`Hindi`},{language_id:`fr`,name:`French`},{language_id:`ko`,name:`Korean`},{language_id:`pt`,name:`Portuguese`},{language_id:`it`,name:`Italian`},{language_id:`es`,name:`Spanish`},{language_id:`ru`,name:`Russian`},{language_id:`id`,name:`Indonesian`},{language_id:`nl`,name:`Dutch`},{language_id:`tr`,name:`Turkish`},{language_id:`fil`,name:`Filipino`},{language_id:`pl`,name:`Polish`},{language_id:`sv`,name:`Swedish`},{language_id:`bg`,name:`Bulgarian`},{language_id:`ro`,name:`Romanian`},{language_id:`ar`,name:`Arabic`},{language_id:`cs`,name:`Czech`},{language_id:`el`,name:`Greek`},{language_id:`fi`,name:`Finnish`},{language_id:`hr`,name:`Croatian`},{language_id:`ms`,name:`Malay`},{language_id:`sk`,name:`Slovak`},{language_id:`da`,name:`Danish`},{language_id:`ta`,name:`Tamil`},{language_id:`uk`,name:`Ukrainian`}],model_rates:{character_cost_multiplier:1},concurrency_group:`standard`},{model_id:`eleven_monolingual_v1`,name:`Eleven English v1`,can_be_finetuned:!1,can_do_text_to_speech:!0,can_do_voice_conversion:!1,can_use_style:!1,can_use_speaker_boost:!1,serves_pro_voices:!1,token_cost_factor:1,description:`Our first ever text to speech model. Now outclassed by Multilingual v2 (for content creation) and Turbo v2.5 (for low latency use cases).`,requires_alpha_access:!1,max_characters_request_free_user:1e4,max_characters_request_subscribed_user:1e4,maximum_text_length_per_request:1e4,languages:[{language_id:`en`,name:`English`}],model_rates:{character_cost_multiplier:1},concurrency_group:`standard`}],useProvidersStore=defineStore(`providers`,()=>{let providerCredentials=useLocalStorage(`settings/credentials/providers`,{}),{t}=useI18n();async function fetchOpenRouterModels(config){try{let response=await fetch(`https://openrouter.ai/api/v1/models`,{headers:{Authorization:`Bearer ${config.apiKey.trim()}`,"Content-Type":`application/json`}});if(!response.ok)throw Error(`Failed to fetch OpenRouter models: ${response.statusText}`);let data$12=await response.json();return data$12.data.map(model=>({id:model.id,name:model.name||model.id,provider:`openrouter-ai`,description:model.description||``,contextLength:model.context_length,deprecated:!1}))}catch(error){throw console.error(`Error fetching OpenRouter models:`,error),error}}let providerMetadata={"openrouter-ai":{id:`openrouter-ai`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.openrouter.title`,name:`OpenRouter`,descriptionKey:`settings.pages.providers.provider.openrouter.description`,description:`openrouter.ai`,icon:`i-lobe-icons:openrouter`,defaultOptions:()=>({baseUrl:`https://openrouter.ai/api/v1/`}),createProvider:async config=>createOpenRouter(config.apiKey.trim(),config.baseUrl.trim()),capabilities:{listModels:async config=>fetchOpenRouterModels(config)},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.baseUrl}},"app-local-audio-speech":{id:`app-local-audio-speech`,category:`speech`,tasks:[`text-to-speech`,`tts`],isAvailableBy:async()=>`window`in globalThis&&globalThis.window!=null&&`__TAURI__`in globalThis.window&&globalThis.window.__TAURI__!=null,nameKey:`settings.pages.providers.provider.app-local-audio-speech.title`,name:`App (Local)`,descriptionKey:`settings.pages.providers.provider.app-local-audio-speech.description`,description:`https://github.com/huggingface/candle`,icon:`i-lobe-icons:huggingface`,defaultOptions:()=>({}),createProvider:async config=>createOpenAI(config.baseUrl.trim()),capabilities:{listModels:async config=>(await listModels({...createOpenAI(config.baseUrl.trim()).model()})).map(model=>({id:model.id,name:model.id,provider:`app-local-candle`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:config=>config.baseUrl?fetch(`${config.baseUrl.trim()}models`).then(response=>response.ok).catch(()=>!1):!1}},"app-local-audio-transcription":{id:`app-local-audio-transcription`,category:`transcription`,tasks:[`speech-to-text`,`automatic-speech-recognition`,`asr`,`stt`],isAvailableBy:async()=>`window`in globalThis&&globalThis.window!=null&&`__TAURI__`in globalThis.window&&globalThis.window.__TAURI__!=null,nameKey:`settings.pages.providers.provider.app-local-audio-transcription.title`,name:`App (Local)`,descriptionKey:`settings.pages.providers.provider.app-local-audio-transcription.description`,description:`https://github.com/huggingface/candle`,icon:`i-lobe-icons:huggingface`,defaultOptions:()=>({}),createProvider:async config=>createOpenAI(config.baseUrl.trim()),capabilities:{listModels:async config=>(await listModels({...createOpenAI(config.baseUrl.trim()).model()})).map(model=>({id:model.id,name:model.id,provider:`app-local-candle`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:config=>config.baseUrl?fetch(`${config.baseUrl.trim()}models`).then(response=>response.ok).catch(()=>!1):!1}},"browser-local-audio-speech":{id:`browser-local-audio-speech`,category:`speech`,tasks:[`text-to-speech`,`tts`],isAvailableBy:async()=>{let webGPUAvailable=await isWebGPUSupported();if(webGPUAvailable)return!0;if(`navigator`in globalThis&&globalThis.navigator!=null&&`deviceMemory`in globalThis.navigator&&typeof globalThis.navigator.deviceMemory==`number`){let memory=globalThis.navigator.deviceMemory;if(memory>=8)return!0}return!1},nameKey:`settings.pages.providers.provider.browser-local-audio-speech.title`,name:`Browser (Local)`,descriptionKey:`settings.pages.providers.provider.browser-local-audio-speech.description`,description:`https://github.com/moeru-ai/xsai-transformers`,icon:`i-lobe-icons:huggingface`,defaultOptions:()=>({}),createProvider:async config=>createOpenAI(config.baseUrl.trim()),capabilities:{listModels:async config=>(await listModels({...createOpenAI(config.baseUrl.trim()).model()})).map(model=>({id:model.id,name:model.id,provider:`browser-local-transformers`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:config=>config.baseUrl?fetch(`${config.baseUrl.trim()}models`).then(response=>response.ok).catch(()=>!1):!1}},"browser-local-audio-transcription":{id:`browser-local-audio-transcription`,category:`transcription`,tasks:[`speech-to-text`,`automatic-speech-recognition`,`asr`,`stt`],isAvailableBy:async()=>{let webGPUAvailable=await isWebGPUSupported();if(webGPUAvailable)return!0;if(`navigator`in globalThis&&globalThis.navigator!=null&&`deviceMemory`in globalThis.navigator&&typeof globalThis.navigator.deviceMemory==`number`){let memory=globalThis.navigator.deviceMemory;if(memory>=8)return!0}return!1},nameKey:`settings.pages.providers.provider.browser-local-audio-transcription.title`,name:`Browser (Local)`,descriptionKey:`settings.pages.providers.provider.browser-local-audio-transcription.description`,description:`https://github.com/moeru-ai/xsai-transformers`,icon:`i-lobe-icons:huggingface`,defaultOptions:()=>({}),createProvider:async config=>createOpenAI(config.baseUrl.trim()),capabilities:{listModels:async config=>(await listModels({...createOpenAI(config.baseUrl.trim()).model()})).map(model=>({id:model.id,name:model.id,provider:`browser-local-transformers`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:config=>config.baseUrl?fetch(`${config.baseUrl.trim()}models`).then(response=>response.ok).catch(()=>!1):!1}},ollama:{id:`ollama`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.ollama.title`,name:`Ollama`,descriptionKey:`settings.pages.providers.provider.ollama.description`,description:`ollama.com`,icon:`i-lobe-icons:ollama`,defaultOptions:()=>({baseUrl:`http://localhost:11434/v1/`}),createProvider:async config=>createOllama(config.baseUrl.trim()),capabilities:{listModels:async config=>(await listModels({...createOllama(config.baseUrl.trim()).model()})).map(model=>({id:model.id,name:model.id,provider:`ollama`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:config=>config.baseUrl?fetch(`${config.baseUrl.trim()}models`).then(response=>response.ok).catch(()=>!1):!1}},"ollama-embedding":{id:`ollama-embedding`,category:`embed`,tasks:[`text-feature-extraction`],nameKey:`settings.pages.providers.provider.ollama.title`,name:`Ollama`,descriptionKey:`settings.pages.providers.provider.ollama.description`,description:`ollama.com`,icon:`i-lobe-icons:ollama`,defaultOptions:()=>({baseUrl:`http://localhost:11434/v1/`}),createProvider:async config=>createOllama(config.baseUrl.trim()),capabilities:{listModels:async config=>(await listModels({...createOllama(config.baseUrl.trim()).model()})).map(model=>({id:model.id,name:model.id,provider:`ollama`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:config=>!!config.baseUrl}},vllm:{id:`vllm`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.vllm.title`,name:`vLLM`,descriptionKey:`settings.pages.providers.provider.vllm.description`,description:`vllm.ai`,iconColor:`i-lobe-icons:vllm`,createProvider:async config=>createOllama(config.baseUrl.trim()),capabilities:{listModels:async()=>[{id:`llama-2-7b`,name:`Llama 2 (7B)`,provider:`vllm`,description:`Meta's Llama 2 7B parameter model`,contextLength:4096},{id:`llama-2-13b`,name:`Llama 2 (13B)`,provider:`vllm`,description:`Meta's Llama 2 13B parameter model`,contextLength:4096},{id:`llama-2-70b`,name:`Llama 2 (70B)`,provider:`vllm`,description:`Meta's Llama 2 70B parameter model`,contextLength:4096},{id:`mistral-7b`,name:`Mistral (7B)`,provider:`vllm`,description:`Mistral AI's 7B parameter model`,contextLength:8192},{id:`mixtral-8x7b`,name:`Mixtral (8x7B)`,provider:`vllm`,description:`Mistral AI's Mixtral 8x7B MoE model`,contextLength:32768},{id:`custom`,name:`Custom Model`,provider:`vllm`,description:`Specify a custom model name`,contextLength:0}]},validators:{validateProviderConfig:config=>!!config.baseUrl}},openai:{id:`openai`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.openai.title`,name:`OpenAI`,descriptionKey:`settings.pages.providers.provider.openai.description`,description:`openai.com`,icon:`i-lobe-icons:openai`,defaultOptions:()=>({baseUrl:`https://api.openai.com/v1/`}),createProvider:async config=>createOpenAI(config.apiKey.trim(),config.baseUrl.trim()),capabilities:{listModels:async config=>(await listModels({...createOpenAI(config.apiKey.trim(),config.baseUrl.trim()).model()})).map(model=>({id:model.id,name:model.id,provider:`openai`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.baseUrl}},"openai-audio-speech":{id:`openai-audio-speech`,category:`speech`,tasks:[`text-to-speech`],nameKey:`settings.pages.providers.provider.openai.title`,name:`OpenAI`,descriptionKey:`settings.pages.providers.provider.openai.description`,description:`openai.com`,icon:`i-lobe-icons:openai`,defaultOptions:()=>({baseUrl:`https://api.openai.com/v1/`}),createProvider:async config=>createOpenAI(config.apiKey.trim(),config.baseUrl.trim()),capabilities:{listModels:async config=>(await listModels({...createOpenAI(config.apiKey.trim(),config.baseUrl.trim()).model()})).map(model=>({id:model.id,name:model.id,provider:`openai`,description:``,contextLength:0,deprecated:!1})),listVoices:async()=>[{id:`alloy`,name:`Alloy`,provider:`openai-audio-speech`,languages:[]},{id:`ash`,name:`Ash`,provider:`openai-audio-speech`,languages:[]},{id:`ballad`,name:`Ballad`,provider:`openai-audio-speech`,languages:[]},{id:`coral`,name:`Coral`,provider:`openai-audio-speech`,languages:[]},{id:`echo`,name:`Echo`,provider:`openai-audio-speech`,languages:[]},{id:`fable`,name:`Fable`,provider:`openai-audio-speech`,languages:[]},{id:`onyx`,name:`Onyx`,provider:`openai-audio-speech`,languages:[]},{id:`nova`,name:`Nova`,provider:`openai-audio-speech`,languages:[]},{id:`sage`,name:`Sage`,provider:`openai-audio-speech`,languages:[]},{id:`shimmer`,name:`Shimmer`,provider:`openai-audio-speech`,languages:[]},{id:`verse`,name:`Verse`,provider:`openai-audio-speech`,languages:[]}]},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.baseUrl}},"openai-audio-transcription":{id:`openai-audio-transcription`,category:`transcription`,tasks:[`speech-to-text`,`automatic-speech-recognition`,`asr`,`stt`],nameKey:`settings.pages.providers.provider.openai.title`,name:`OpenAI`,descriptionKey:`settings.pages.providers.provider.openai.description`,description:`openai.com`,icon:`i-lobe-icons:openai`,defaultOptions:()=>({baseUrl:`https://api.openai.com/v1/`}),createProvider:async config=>createOpenAI(config.apiKey.trim(),config.baseUrl.trim()),capabilities:{listModels:async config=>(await listModels({...createOpenAI(config.apiKey.trim(),config.baseUrl.trim()).model()})).map(model=>({id:model.id,name:model.id,provider:`openai`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.baseUrl}},"azure-ai-foundry":{id:`azure-ai-foundry`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.azure_ai_foundry.title`,name:`Azure AI Foundry`,descriptionKey:`settings.pages.providers.provider.azure_ai_foundry.description`,description:`azure.com`,icon:`i-lobe-icons:microsoft`,defaultOptions:()=>({}),createProvider:async config=>await createAzure({apiKey:async()=>config.apiKey.trim(),resourceName:config.resourceName,apiVersion:config.apiVersion}),capabilities:{listModels:async config=>[{id:config.modelId}].map(model=>({id:model.id,name:model.id,provider:`azure-ai-foundry`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.resourceName&&!!config.modelId}},anthropic:{id:`anthropic`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.anthropic.title`,name:`Anthropic`,descriptionKey:`settings.pages.providers.provider.anthropic.description`,description:`anthropic.com`,icon:`i-lobe-icons:anthropic`,defaultOptions:()=>({baseUrl:`https://api.anthropic.com/v1/`}),createProvider:async config=>createAnthropic(config.apiKey.trim(),config.baseUrl.trim()),capabilities:{listModels:async()=>[{id:`claude-3-7-sonnet-20250219`,name:`Claude 3.7 Sonnet`,provider:`anthropic`,description:``,contextLength:0,deprecated:!1},{id:`claude-3-5-sonnet-20241022`,name:`Claude 3.5 Sonnet (New)`,provider:`anthropic`,description:``,contextLength:0,deprecated:!1},{id:`claude-3-5-haiku-20241022`,name:`Claude 3.5 Haiku`,provider:`anthropic`,description:``,contextLength:0,deprecated:!1},{id:`claude-3-5-sonnet-20240620`,name:`Claude 3.5 Sonnet (Old)`,provider:`anthropic`,description:``,contextLength:0,deprecated:!1},{id:`claude-3-haiku-20240307`,name:`Claude 3 Haiku`,provider:`anthropic`,description:``,contextLength:0,deprecated:!1},{id:`claude-3-opus-20240229`,name:`Claude 3 Opus`,provider:`anthropic`,description:``,contextLength:0,deprecated:!1}]},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.baseUrl}},"google-generative-ai":{id:`google-generative-ai`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.google-generative-ai.title`,name:`Google Gemini`,descriptionKey:`settings.pages.providers.provider.google-generative-ai.description`,description:`ai.google.dev`,icon:`i-lobe-icons:gemini`,defaultOptions:()=>({baseUrl:`https://generativelanguage.googleapis.com/v1beta/openai/`}),createProvider:async config=>createGoogleGenerativeAI(config.apiKey.trim(),config.baseUrl.trim()),capabilities:{listModels:async config=>(await listModels({...createGoogleGenerativeAI(config.apiKey.trim(),config.baseUrl.trim()).model()})).map(model=>({id:model.id,name:model.id,provider:`google-generative-ai`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.baseUrl}},xai:{id:`xai`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.xai.title`,name:`xAI`,descriptionKey:`settings.pages.providers.provider.xai.description`,description:`x.ai`,icon:`i-lobe-icons:xai`,createProvider:async config=>createXAI(config.apiKey.trim(),config.baseUrl.trim()),capabilities:{listModels:async config=>(await listModels({...createXAI(config.apiKey.trim(),config.baseUrl.trim()).model()})).map(model=>({id:model.id,name:model.id,provider:`xai`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.baseUrl}},deepseek:{id:`deepseek`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.deepseek.title`,name:`DeepSeek`,descriptionKey:`settings.pages.providers.provider.deepseek.description`,description:`deepseek.com`,iconColor:`i-lobe-icons:deepseek`,defaultOptions:()=>({baseUrl:`https://api.deepseek.com/`}),createProvider:async config=>createDeepSeek(config.apiKey.trim(),config.baseUrl.trim()),capabilities:{listModels:async config=>(await listModels({...createDeepSeek(config.apiKey.trim(),config.baseUrl.trim()).model()})).map(model=>({id:model.id,name:model.id,provider:`deepseek`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.baseUrl}},elevenlabs:{id:`elevenlabs`,category:`speech`,tasks:[`text-to-speech`],nameKey:`settings.pages.providers.provider.elevenlabs.title`,name:`ElevenLabs`,descriptionKey:`settings.pages.providers.provider.elevenlabs.description`,description:`elevenlabs.io`,icon:`i-simple-icons:elevenlabs`,defaultOptions:()=>({baseUrl:`https://unspeech.hyp3r.link/v1/`,voiceSettings:{similarityBoost:.75,stability:.5}}),createProvider:async config=>createUnElevenLabs(config.apiKey.trim(),config.baseUrl.trim()),capabilities:{listModels:async()=>models.map(model=>({id:model.model_id,name:model.name,provider:`elevenlabs`,description:model.description,contextLength:0,deprecated:!1})),listVoices:async config=>{let provider=createUnElevenLabs(config.apiKey.trim(),config.baseUrl.trim()),voices=await listVoices({...provider.voice()}),ariaIndex=voices.findIndex(voice=>voice.name.includes(`Aria`)),billIndex=voices.findIndex(voice=>voice.name.includes(`Bill`)),startIndex=ariaIndex===-1?0:ariaIndex,endIndex=billIndex===-1?voices.length-1:billIndex,lowerIndex=Math.min(startIndex,endIndex),higherIndex=Math.max(startIndex,endIndex),rearrangedVoices=[...voices.slice(0,lowerIndex),...voices.slice(higherIndex+1),...voices.slice(lowerIndex,higherIndex+1)];return rearrangedVoices.map(voice=>({id:voice.id,name:voice.name,provider:`elevenlabs`,previewURL:voice.preview_audio_url,languages:voice.languages}))}},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.baseUrl}},"microsoft-speech":{id:`microsoft-speech`,category:`speech`,tasks:[`text-to-speech`],nameKey:`settings.pages.providers.provider.microsoft-speech.title`,name:`Microsoft / Azure Speech`,descriptionKey:`settings.pages.providers.provider.microsoft-speech.description`,description:`speech.microsoft.com`,iconColor:`i-lobe-icons:microsoft`,defaultOptions:()=>({baseUrl:`https://unspeech.hyp3r.link/v1/`}),createProvider:async config=>createUnMicrosoft(config.apiKey.trim(),config.baseUrl.trim()),capabilities:{listModels:async()=>[{id:`v1`,name:`v1`,provider:`microsoft-speech`,description:``,contextLength:0,deprecated:!1}],listVoices:async config=>{let provider=createUnMicrosoft(config.apiKey.trim(),config.baseUrl.trim()),voices=await listVoices({...provider.voice({region:config.region})});return voices.map(voice=>({id:voice.id,name:voice.name,provider:`microsoft-speech`,previewURL:voice.preview_audio_url,languages:voice.languages,gender:voice.labels?.gender}))}},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.baseUrl}},"alibaba-cloud-model-studio":{id:`alibaba-cloud-model-studio`,category:`speech`,tasks:[`text-to-speech`],nameKey:`settings.pages.providers.provider.alibaba-cloud-model-studio.title`,name:`Alibaba Cloud Model Studio`,descriptionKey:`settings.pages.providers.provider.alibaba-cloud-model-studio.description`,description:`bailian.console.aliyun.com`,iconColor:`i-lobe-icons:alibabacloud`,defaultOptions:()=>({baseUrl:`https://unspeech.hyp3r.link/v1/`}),createProvider:async config=>createUnAlibabaCloud(config.apiKey.trim(),config.baseUrl.trim()),capabilities:{listVoices:async config=>{let provider=createUnAlibabaCloud(config.apiKey.trim(),config.baseUrl.trim()),voices=await listVoices({...provider.voice()});return voices.map(voice=>({id:voice.id,name:voice.name,provider:`alibaba-cloud-model-studio`,previewURL:voice.preview_audio_url,languages:voice.languages,gender:voice.labels?.gender}))},listModels:async()=>[{id:`cozyvoice-v1`,name:`CozyVoice`,provider:`alibaba-cloud-model-studio`,description:``,contextLength:0,deprecated:!1},{id:`cozyvoice-v2`,name:`CozyVoice (New)`,provider:`alibaba-cloud-model-studio`,description:``,contextLength:0,deprecated:!1}]},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.baseUrl}},volcengine:{id:`volcengine`,category:`speech`,tasks:[`text-to-speech`],nameKey:`settings.pages.providers.provider.volcengine.title`,name:`settings.pages.providers.provider.volcengine.title`,descriptionKey:`settings.pages.providers.provider.volcengine.description`,description:`volcengine.com`,iconColor:`i-lobe-icons:volcengine`,defaultOptions:()=>({baseUrl:`https://unspeech.hyp3r.link/v1/`}),createProvider:async config=>createUnVolcengine(config.apiKey.trim(),config.baseUrl.trim()),capabilities:{listVoices:async config=>{let provider=createUnVolcengine(config.apiKey.trim(),config.baseUrl.trim()),voices=await listVoices({...provider.voice()});return voices.map(voice=>({id:voice.id,name:voice.name,provider:`volcano-engine`,previewURL:voice.preview_audio_url,languages:voice.languages,gender:voice.labels?.gender}))},listModels:async()=>[{id:`v1`,name:`v1`,provider:`volcano-engine`,description:``,contextLength:0,deprecated:!1}]},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.baseUrl&&!!config.app&&!!config.app.appId}},"together-ai":{id:`together-ai`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.together.title`,name:`Together.ai`,descriptionKey:`settings.pages.providers.provider.together.description`,description:`together.ai`,iconColor:`i-lobe-icons:together`,createProvider:async config=>createTogetherAI(config.apiKey.trim(),config.baseUrl.trim()),capabilities:{listModels:async config=>(await listModels({...createTogetherAI(config.apiKey.trim(),config.baseUrl.trim()).model()})).map(model=>({id:model.id,name:model.id,provider:`together-ai`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.baseUrl}},"novita-ai":{id:`novita-ai`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.novita.title`,name:`Novita`,descriptionKey:`settings.pages.providers.provider.novita.description`,description:`novita.ai`,iconColor:`i-lobe-icons:novita`,createProvider:async config=>createNovita(config.apiKey.trim(),config.baseUrl.trim()),capabilities:{listModels:async config=>(await listModels({...createNovita(config.apiKey.trim(),config.baseUrl.trim()).model()})).map(model=>({id:model.id,name:model.id,provider:`novita-ai`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.baseUrl}},"fireworks-ai":{id:`fireworks-ai`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.fireworks.title`,name:`Fireworks.ai`,descriptionKey:`settings.pages.providers.provider.fireworks.description`,description:`fireworks.ai`,icon:`i-lobe-icons:fireworks`,createProvider:async config=>createFireworks(config.apiKey.trim(),config.baseUrl.trim()),capabilities:{listModels:async config=>(await listModels({...createFireworks(config.apiKey.trim(),config.baseUrl.trim()).model()})).map(model=>({id:model.id,name:model.id,provider:`fireworks-ai`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.baseUrl}},"featherless-ai":{id:`featherless-ai`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.featherless.title`,name:`Featherless.ai`,descriptionKey:`settings.pages.providers.provider.featherless.description`,description:`featherless.ai`,icon:`i-lobe-icons:featherless-ai`,defaultOptions:()=>({baseUrl:`https://api.featherless.ai/v1/`}),createProvider:async config=>createOpenAI(config.apiKey.trim(),config.baseUrl.trim()),capabilities:{listModels:async config=>(await listModels({...createOpenAI(config.apiKey.trim(),config.baseUrl.trim()).model()})).map(model=>({id:model.id,name:model.id,provider:`featherless-ai`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.baseUrl}},"cloudflare-workers-ai":{id:`cloudflare-workers-ai`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.cloudflare-workers-ai.title`,name:`Cloudflare Workers AI`,descriptionKey:`settings.pages.providers.provider.cloudflare-workers-ai.description`,description:`cloudflare.com`,iconColor:`i-lobe-icons:cloudflare`,createProvider:async config=>createWorkersAI(config.apiKey.trim(),config.accountId),capabilities:{listModels:async()=>[]},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.accountId}},"perplexity-ai":{id:`perplexity-ai`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.perplexity.title`,name:`Perplexity`,descriptionKey:`settings.pages.providers.provider.perplexity.description`,description:`perplexity.ai`,icon:`i-lobe-icons:perplexity`,defaultOptions:()=>({baseUrl:`https://api.perplexity.ai`}),createProvider:async config=>createPerplexity(config.apiKey.trim(),config.baseUrl.trim()),capabilities:{listModels:async()=>[{id:`sonar-small-online`,name:`Sonar Small (Online)`,provider:`perplexity-ai`,description:`Efficient model with online search capabilities`,contextLength:12e3},{id:`sonar-medium-online`,name:`Sonar Medium (Online)`,provider:`perplexity-ai`,description:`Balanced model with online search capabilities`,contextLength:12e3},{id:`sonar-large-online`,name:`Sonar Large (Online)`,provider:`perplexity-ai`,description:`Powerful model with online search capabilities`,contextLength:12e3},{id:`codey-small`,name:`Codey Small`,provider:`perplexity-ai`,description:`Specialized for code generation and understanding`,contextLength:12e3},{id:`codey-large`,name:`Codey Large`,provider:`perplexity-ai`,description:`Advanced code generation and understanding`,contextLength:12e3}]},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.baseUrl}},"mistral-ai":{id:`mistral-ai`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.mistral.title`,name:`Mistral`,descriptionKey:`settings.pages.providers.provider.mistral.description`,description:`mistral.ai`,iconColor:`i-lobe-icons:mistral`,createProvider:async config=>createMistral(config.apiKey.trim(),config.baseUrl.trim()),capabilities:{listModels:async config=>(await listModels({...createMistral(config.apiKey.trim(),config.baseUrl.trim()).model()})).map(model=>({id:model.id,name:model.id,provider:`mistral-ai`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.baseUrl}},"moonshot-ai":{id:`moonshot-ai`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.moonshot.title`,name:`Moonshot AI`,descriptionKey:`settings.pages.providers.provider.moonshot.description`,description:`moonshot.ai`,icon:`i-lobe-icons:moonshot`,createProvider:async config=>createMoonshot(config.apiKey.trim(),config.baseUrl.trim()),capabilities:{listModels:async config=>(await listModels({...createMoonshot(config.apiKey.trim(),config.baseUrl.trim()).model()})).map(model=>({id:model.id,name:model.id,provider:`moonshot-ai`,description:``,contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:config=>!!config.apiKey&&!!config.baseUrl}},player2:{id:`player2`,category:`chat`,tasks:[`text-generation`],nameKey:`settings.pages.providers.provider.player2.title`,name:`Player2`,descriptionKey:`settings.pages.providers.provider.player2.description`,description:`player2.game`,icon:`i-lobe-icons:player2`,defaultOptions:()=>({baseUrl:`http://localhost:4315/v1/`}),createProvider:config=>createPlayer2(config.baseUrl.trim()),capabilities:{listModels:async()=>[{id:`player2-model`,name:`Player2 Model`,provider:`player2`}]},validators:{validateProviderConfig:async config=>!!config.baseUrl&&await fetch(`${config.baseUrl}/health`,{method:`GET`,headers:{"player2-game-key":`airi`}}).then(response=>response.ok).catch(()=>!1)}},"player2-speech":{id:`player2-speech`,category:`speech`,tasks:[`text-to-speech`],nameKey:`settings.pages.providers.provider.player2.title`,name:`Player2 Speech`,descriptionKey:`settings.pages.providers.provider.player2.description`,description:`player2.game`,icon:`i-lobe-icons:player2`,defaultOptions:()=>({baseUrl:`http://localhost:4315/v1/`}),createProvider:async config=>createPlayer2(config.baseUrl.trim(),`airi`),capabilities:{listVoices:async()=>await fetch(`http://localhost:4315/v1/tts/voices`).then(res=>res.json()).then(({voices})=>voices.map(({id:id$1,language,name:name$2,gender})=>({id:id$1,name:name$2,provider:`player2-speech`,gender,languages:[{american_english:{code:`en`,title:`English`},british_english:{code:`en`,title:`English`},japanese:{code:`ja`,title:`Japanese`},mandarin_chinese:{code:`zh`,title:`Chinese`},spanish:{code:`es`,title:`Spanish`},french:{code:`fr`,title:`French`},hindi:{code:`hi`,title:`Hindi`},italian:{code:`it`,title:`Italian`},brazilian_portuguese:{code:`pt`,title:`Portuguese`}}[language]]})))},validators:{validateProviderConfig:config=>!!config.baseUrl}}};async function validateProvider(providerId){let config=providerCredentials.value[providerId];if(!config)return!1;let metadata=providerMetadata[providerId];return metadata?await metadata.validators.validateProviderConfig(config):!1}let configuredProviders=ref({});function initializeProvider(providerId){if(!providerCredentials.value[providerId]){let metadata=providerMetadata[providerId],defaultOptions=metadata.defaultOptions?.()||{};providerCredentials.value[providerId]={baseUrl:defaultOptions.baseUrl||``}}}Object.keys(providerMetadata).forEach(initializeProvider);async function updateConfigurationStatus(){await Promise.all(Object.keys(providerMetadata).map(async providerId=>{configuredProviders.value[providerId]=await validateProvider(providerId)}))}updateConfigurationStatus(),watch(providerCredentials,updateConfigurationStatus,{deep:!0});let availableProviders=computed(()=>Object.keys(providerMetadata).filter(providerId=>configuredProviders.value[providerId])),availableModels=ref({}),isLoadingModels=ref({}),modelLoadError=ref({});async function fetchModelsForProvider(providerId){let config=providerCredentials.value[providerId];if(!config)return[];let metadata=providerMetadata[providerId];if(!metadata)return[];isLoadingModels.value[providerId]=!0,modelLoadError.value[providerId]=null;try{let models$1=metadata.capabilities.listModels?await metadata.capabilities.listModels(config):[];return availableModels.value[providerId]=models$1.map(model=>({id:model.id,name:model.name,description:model.description,contextLength:model.contextLength,deprecated:model.deprecated,provider:providerId})),availableModels.value[providerId]}catch(error){return console.error(`Error fetching models for ${providerId}:`,error),modelLoadError.value[providerId]=error instanceof Error?error.message:`Unknown error`,[]}finally{isLoadingModels.value[providerId]=!1}}function getModelsForProvider(providerId){return availableModels.value[providerId]||[]}let allAvailableModels=computed(()=>{let models$1=[];for(let providerId of availableProviders.value)models$1.push(...availableModels.value[providerId]||[]);return models$1});async function loadModelsForConfiguredProviders(){for(let providerId of availableProviders.value)providerMetadata[providerId].capabilities.listModels&&await fetchModelsForProvider(providerId)}function getProviderMetadata(providerId){let metadata=providerMetadata[providerId];if(!metadata)throw Error(`Provider metadata for ${providerId} not found`);return{...metadata,localizedName:t(metadata.nameKey,metadata.name),localizedDescription:t(metadata.descriptionKey,metadata.description)}}let allProvidersMetadata=computed(()=>Object.values(providerMetadata).map(metadata=>({...metadata,localizedName:t(metadata.nameKey,metadata.name),localizedDescription:t(metadata.descriptionKey,metadata.description),configured:configuredProviders.value[metadata.id]||!1})));async function getProviderInstance(providerId){let config=providerCredentials.value[providerId];if(!config)throw Error(`Provider credentials for ${providerId} not found`);let metadata=providerMetadata[providerId];if(!metadata)throw Error(`Provider metadata for ${providerId} not found`);try{return await metadata.createProvider(config)}catch(error){throw console.error(`Error creating provider instance for ${providerId}:`,error),error}}let availableProvidersMetadata=computedAsync(async()=>{let providers=[];for(let provider of allProvidersMetadata.value){let p$5=getProviderMetadata(provider.id),isAvailableBy=p$5.isAvailableBy||(()=>!0),isAvailable=await isAvailableBy();isAvailable&&providers.push(provider)}return providers},[]),allChatProvidersMetadata=computed(()=>availableProvidersMetadata.value.filter(metadata=>metadata.category===`chat`)),allAudioSpeechProvidersMetadata=computed(()=>availableProvidersMetadata.value.filter(metadata=>metadata.category===`speech`)),allAudioTranscriptionProvidersMetadata=computed(()=>availableProvidersMetadata.value.filter(metadata=>metadata.category===`transcription`)),configuredChatProvidersMetadata=computed(()=>allChatProvidersMetadata.value.filter(metadata=>configuredProviders.value[metadata.id])),configuredSpeechProvidersMetadata=computed(()=>allAudioSpeechProvidersMetadata.value.filter(metadata=>configuredProviders.value[metadata.id])),configuredTranscriptionProvidersMetadata=computed(()=>allAudioTranscriptionProvidersMetadata.value.filter(metadata=>configuredProviders.value[metadata.id]));function getProviderConfig(providerId){return providerCredentials.value[providerId]}return{providers:providerCredentials,getProviderConfig,availableProviders,configuredProviders,providerMetadata,getProviderMetadata,allProvidersMetadata,initializeProvider,validateProvider,availableModels,isLoadingModels,modelLoadError,fetchModelsForProvider,getModelsForProvider,allAvailableModels,loadModelsForConfiguredProviders,getProviderInstance,availableProvidersMetadata,allChatProvidersMetadata,allAudioSpeechProvidersMetadata,allAudioTranscriptionProvidersMetadata,configuredChatProvidersMetadata,configuredSpeechProvidersMetadata,configuredTranscriptionProvidersMetadata}}),useConsciousnessStore=defineStore(`consciousness`,()=>{let providersStore=useProvidersStore(),activeProvider=useLocalStorage(`settings/consciousness/active-provider`,``),activeModel=useLocalStorage(`settings/consciousness/active-model`,``),activeCustomModelName=useLocalStorage(`settings/consciousness/active-custom-model`,``),expandedDescriptions=ref({}),modelSearchQuery=ref(``),supportsModelListing=computed(()=>providersStore.getProviderMetadata(activeProvider.value)?.capabilities.listModels!==void 0),providerModels=computed(()=>providersStore.getModelsForProvider(activeProvider.value)),isLoadingActiveProviderModels=computed(()=>providersStore.isLoadingModels[activeProvider.value]||!1),activeProviderModelError=computed(()=>providersStore.modelLoadError[activeProvider.value]||null),filteredModels=computed(()=>{if(!modelSearchQuery.value.trim())return providerModels.value;let query=modelSearchQuery.value.toLowerCase().trim();return providerModels.value.filter(model=>model.name.toLowerCase().includes(query)||model.id.toLowerCase().includes(query)||model.description&&model.description.toLowerCase().includes(query))});function resetModelSelection(){activeModel.value=``,activeCustomModelName.value=``,expandedDescriptions.value={},modelSearchQuery.value=``}async function loadModelsForProvider(provider){provider&&providersStore.getProviderMetadata(provider)?.capabilities.listModels!==void 0&&await providersStore.fetchModelsForProvider(provider)}async function getModelsForProvider(provider){return provider&&providersStore.getProviderMetadata(provider)?.capabilities.listModels!==void 0?providersStore.getModelsForProvider(provider):[]}let configured=computed(()=>!!activeProvider.value&&!!activeModel.value);return{configured,activeProvider,activeModel,customModelName:activeCustomModelName,expandedDescriptions,modelSearchQuery,supportsModelListing,providerModels,isLoadingActiveProviderModels,activeProviderModelError,filteredModels,resetModelSelection,loadModelsForProvider,getModelsForProvider}}),generateSpeech=async options$1=>(options$1.fetch??globalThis.fetch)(requestURL(`audio/speech`,options$1.baseURL),{body:requestBody(options$1),headers:requestHeaders({"Content-Type":`application/json`,...options$1.headers},options$1.apiKey),method:`POST`,signal:options$1.abortSignal}).then(responseCatch).then(async res=>res.arrayBuffer()),noncharacter=/[\u0000-\u0008\u000B\u000C\u000E-\u001F]/g;function escape(value$1,subset$4,unsafe$2){let result=clean(value$1);return unsafe$2?result.replace(unsafe$2,encode):encode(result);function encode(value$2){return stringifyEntitiesLight(value$2,{subset:subset$4})}}function clean(value$1){return String(value$1||``).replace(noncharacter,``)}const unsafe$1=/]]>/g,subset$3=[`>`];function cdata(node$1){return``}function comment(node$1){return``}const subset$2=[` `,` `,` `,`"`,`&`,`'`,`/`,`<`,`=`,`>`];function name$1(value$1){return escape(value$1,subset$2)}function value(value$1,state){let result=String(value$1),quote=state.options.quote||`"`;if(state.options.quoteSmart){let other=quote===`"`?`'`:`"`;ccount(result,quote)>ccount(result,other)&&(quote=other)}return quote+escape(result,[`<`,`&`,quote])+quote}function doctype(node$1,state){let nodeName=name$1(node$1.name),pub=node$1.public,sys=node$1.system,result=``}const own$1={}.hasOwnProperty;function element(node$1,state){let nodeName=name$1(node$1.name),content$2=all(node$1,state),attributes=node$1.attributes||{},close=content$2?!1:state.options.closeEmptyElements,attrs=[],key$2;for(key$2 in attributes)if(own$1.call(attributes,key$2)){let result=attributes[key$2];result!=null&&attrs.push(name$1(key$2)+`=`+value(result,state))}return`<`+nodeName+(attrs.length===0?``:` `+attrs.join(` `))+(close?(state.options.tightClose?``:` `)+`/`:``)+`>`+content$2+(close?``:``)}const unsafe=/\?>/g,subset$1=[`>`];function instruction(node$1){let nodeName=name$1(node$1.name)||`x`,result=escape(node$1.value,subset$1,unsafe);return``}const subset=[`&`,`<`];function text(node$1){return escape(node$1.value,subset)}function raw(node$1,state){return state.options.allowDangerousXml?node$1.value:text(node$1)}const own={}.hasOwnProperty,handlers={cdata,comment,doctype,element,instruction,raw,root:all,text};function one(node$1,state){let type=node$1&&node$1.type;if(!type)throw Error("Expected node, not `"+node$1+"`");if(!own.call(handlers,type))throw Error("Cannot compile unknown node `"+type+"`");let handle$1=handlers[type],result=handle$1(node$1,state);return result}function all(parent,state){let children=parent&&parent.children||[],index$1=-1,results=[];for(;++index$1{let providersStore=useProvidersStore(),{allAudioSpeechProvidersMetadata}=storeToRefs(providersStore),activeSpeechProvider=useLocalStorage(`settings/speech/active-provider`,``),activeSpeechModel=useLocalStorage(`settings/speech/active-model`,`eleven_multilingual_v2`),activeSpeechVoiceId=useLocalStorage(`settings/speech/voice`,``),activeSpeechVoice=ref(),pitch=useLocalStorage(`settings/speech/pitch`,0),rate=useLocalStorage(`settings/speech/rate`,1),ssmlEnabled=useLocalStorage(`settings/speech/ssml-enabled`,!1),isLoadingSpeechProviderVoices=ref(!1),speechProviderError=ref(null),availableVoices=ref({}),selectedLanguage=useLocalStorage(`settings/speech/language`,`en-US`),modelSearchQuery=ref(``),availableSpeechProvidersMetadata=computed(()=>allAudioSpeechProvidersMetadata.value),supportsModelListing=computed(()=>providersStore.getProviderMetadata(activeSpeechProvider.value)?.capabilities.listModels!==void 0),providerModels=computed(()=>providersStore.getModelsForProvider(activeSpeechProvider.value)),isLoadingActiveProviderModels=computed(()=>providersStore.isLoadingModels[activeSpeechProvider.value]||!1),activeProviderModelError=computed(()=>providersStore.modelLoadError[activeSpeechProvider.value]||null),filteredModels=computed(()=>{if(!modelSearchQuery.value.trim())return providerModels.value;let query=modelSearchQuery.value.toLowerCase().trim();return providerModels.value.filter(model=>model.name.toLowerCase().includes(query)||model.id.toLowerCase().includes(query)||model.description&&model.description.toLowerCase().includes(query))}),supportsSSML=computed(()=>[`elevenlabs`,`microsoft-speech`,`azure-speech`,`google`,`alibaba-cloud-model-studio`,`volcengine`].includes(activeSpeechProvider.value));async function loadVoicesForProvider(provider){if(!provider)return[];isLoadingSpeechProviderVoices.value=!0,speechProviderError.value=null;try{let voices=await providersStore.getProviderMetadata(provider).capabilities.listVoices?.(providersStore.getProviderConfig(provider))||[];return availableVoices.value[provider]=voices,voices}catch(error){return console.error(`Error fetching voices for ${provider}:`,error),speechProviderError.value=error instanceof Error?error.message:`Unknown error`,[]}finally{isLoadingSpeechProviderVoices.value=!1}}function getVoicesForProvider(provider){return availableVoices.value[provider]||[]}watch(activeSpeechProvider,async newProvider=>{newProvider&&await loadVoicesForProvider(newProvider)}),onMounted(()=>{loadVoicesForProvider(activeSpeechProvider.value).then(()=>{activeSpeechVoiceId.value&&(activeSpeechVoice.value=availableVoices.value[activeSpeechProvider.value]?.find(voice=>voice.id===activeSpeechVoiceId.value))})}),watch(activeSpeechVoiceId,voiceId=>{voiceId&&(activeSpeechVoice.value=availableVoices.value[activeSpeechProvider.value]?.find(voice=>voice.id===voiceId))},{immediate:!0}),watch(availableVoices,voices=>{activeSpeechVoiceId.value&&(activeSpeechVoice.value=voices[activeSpeechProvider.value]?.find(voice=>voice.id===activeSpeechVoiceId.value))},{immediate:!0});async function speech(provider,model,input,voice,providerConfig={}){let response=await generateSpeech({...provider.speech(model,{...providerConfig}),input,voice});return response}function generateSSML(text$5,voice,providerConfig){let pitch$1=providerConfig?.pitch,speed=providerConfig?.speed,volume=providerConfig?.volume,prosody={pitch:pitch$1==null?void 0:pitch$1>0?`+${pitch$1}%`:`-${pitch$1}%`,rate:speed==null?void 0:speed===1?`1`:`${speed}`,volume:volume==null?void 0:volume>0?`+${volume}%`:`${volume}%`},ssmlXast=x(`speak`,{version:`1.0`,xmlns:`http://www.w3.org/2001/10/synthesis`,"xml:lang":voice.languages[0]?.code||`en-US`},[x(`voice`,{name:voice.id,gender:voice.gender||`neutral`},[Object.entries(prosody).filter(([_$2,value$1])=>value$1!=null).length>0?x(`prosody`,{pitch:pitch$1==null?void 0:pitch$1>0?`+${pitch$1}%`:`-${pitch$1}%`,rate:speed==null?void 0:speed===1?`1`:`${speed}`,volume:volume==null?void 0:volume>0?`+${volume}%`:`${volume}%`},[text$5]):text$5])]);return toXml(ssmlXast)}let configured=computed(()=>!!activeSpeechProvider.value&&!!activeSpeechModel.value&&!!activeSpeechVoiceId.value);return{configured,activeSpeechProvider,activeSpeechModel,activeSpeechVoice,activeSpeechVoiceId,pitch,rate,ssmlEnabled,selectedLanguage,isLoadingSpeechProviderVoices,speechProviderError,availableVoices,modelSearchQuery,availableSpeechProvidersMetadata,supportsSSML,supportsModelListing,providerModels,isLoadingActiveProviderModels,activeProviderModelError,filteredModels,speech,loadVoicesForProvider,getVoicesForProvider,generateSSML}}),useAiriCardStore=defineStore(`airi-card`,()=>{let cards=useLocalStorage(`airi-cards`,new Map),activeCardId=useLocalStorage(`airi-card-active-id`,`default`),activeCard=computed(()=>cards.value.get(activeCardId.value)),consciousnessStore=useConsciousnessStore(),speechStore=useSpeechStore(),{activeModel:activeConsciousnessModel}=storeToRefs(consciousnessStore),{activeSpeechVoiceId,activeSpeechModel}=storeToRefs(speechStore),addCard=card=>{let newCardId=crypto.randomUUID();return cards.value.set(newCardId,newAiriCard(card)),newCardId},removeCard=id$1=>{cards.value.delete(id$1)},getCard=id$1=>cards.value.get(id$1);function resolveAiriExtension(card){let existingExtension=`data`in card?card.data?.extensions?.airi:card.extensions?.airi,defaultModules={consciousness:{model:activeConsciousnessModel.value},speech:{model:activeSpeechModel.value,voice_id:activeSpeechVoiceId.value}};return existingExtension?{modules:{consciousness:{model:existingExtension.modules?.consciousness?.model??defaultModules.consciousness.model},speech:{model:existingExtension.modules?.speech?.model??defaultModules.speech.model,voice_id:existingExtension.modules?.speech?.voice_id??defaultModules.speech.voice_id,pitch:existingExtension.modules?.speech?.pitch,rate:existingExtension.modules?.speech?.rate,ssml:existingExtension.modules?.speech?.ssml,language:existingExtension.modules?.speech?.language},vrm:existingExtension.modules?.vrm,live2d:existingExtension.modules?.live2d},agents:existingExtension.agents??{}}:{modules:defaultModules,agents:{}}}function newAiriCard(card){if(`data`in card){let ccv3Card=card;return{name:ccv3Card.data.name,version:ccv3Card.data.character_version??`1.0.0`,description:ccv3Card.data.description??``,creator:ccv3Card.data.creator??``,notes:ccv3Card.data.creator_notes??``,notesMultilingual:ccv3Card.data.creator_notes_multilingual,personality:ccv3Card.data.personality??``,scenario:ccv3Card.data.scenario??``,greetings:[ccv3Card.data.first_mes,...ccv3Card.data.alternate_greetings??[]],greetingsGroupOnly:ccv3Card.data.group_only_greetings??[],systemPrompt:ccv3Card.data.system_prompt??``,postHistoryInstructions:ccv3Card.data.post_history_instructions??``,messageExample:ccv3Card.data.mes_example?ccv3Card.data.mes_example.split(` `).filter(Boolean).map(example=>example.split(` `).map(line=>{if(line.startsWith(`{{char}}:`)||line.startsWith(`{{user}}:`))return line;throw Error(`Invalid message example format: ${line}`)})):[],tags:ccv3Card.data.tags??[],extensions:{airi:resolveAiriExtension(ccv3Card),...ccv3Card.data.extensions}}}return{...card,extensions:{airi:resolveAiriExtension(card),...card.extensions}}}return onMounted(()=>{let{t}=useI18n();cards.value.set(`default`,newAiriCard({name:`ReLU`,version:`1.0.0`,description:system_v2_default(t(`base.prompt.prefix`),t(`base.prompt.suffix`)).content}))}),watch(activeCard,newCard=>{if(!newCard)return;let extension$1=resolveAiriExtension(newCard);extension$1&&(activeConsciousnessModel.value=extension$1?.modules?.consciousness?.model,activeSpeechModel.value=extension$1?.modules?.speech?.model,activeSpeechVoiceId.value=extension$1?.modules?.speech?.voice_id)}),{cards,activeCard,activeCardId,addCard,removeCard,getCard,currentModels:computed(()=>({consciousness:{model:activeConsciousnessModel.value},speech:{model:activeSpeechModel.value,voice_id:activeSpeechVoiceId.value}})),systemPrompt:computed(()=>{let card=activeCard.value;if(!card)return``;let components=[card.systemPrompt,card.description,card.personality].filter(Boolean);return components.join(` @@ -5058,4 +5058,4 @@ Coordinate axes are visualised. `},common:{fields:{field:{"api-key":{label:`API 密钥`}}},section:{advanced:{fields:{field:{headers:{description:`添加自定义 HTTP 标头`,key:{placeholder:`请求头名字`},label:`HTTP 请求头`,value:{placeholder:`请求头数值`}}}},title:`高级配置`},basic:{description:`基本设置`,title:`基础配置`},voice:{title:`声音配置`}}},description:`LLM,语音合成,语音识别服务来源等`,provider:{"app-local-audio-transcription":{title:`应用内(本地)`,description:`https://github.com/moeru-ai/xsai-transformers`},"app-local-audio-speech":{title:`应用内(本地)`,description:`https://github.com/moeru-ai/xsai-transformers`},"browser-local-audio-transcription":{title:`浏览器内(本地)`,description:`https://github.com/moeru-ai/xsai-transformers`},"browser-local-audio-speech":{title:`浏览器内(本地)`,description:`https://github.com/moeru-ai/xsai-transformers`},"alibaba-cloud-model-studio":{description:`bailian.console.aliyun.com`,title:`阿里百炼`},anthropic:{description:`anthropic.com`,title:`Anthropic | Claude`,helpinfo:{title:`开始之前`,description:{part1:`虽然 Anthropic 最近宣布他们正在提供对 OpenAI SDK 兼容性的 Beta 版支持`,part2:`(您可以在此处阅读更多信息)`,part3:`但由于实现细节附带`,part4:`与 OpenAI SDK 不一致,目前无法在浏览器中使用此提供程序。`,part5:`如果您确实需要使用此提供程序,则需要一个专用的代理后端,例如在`,part6:`上运行的Serverless Function,或者一些绕过 CORS 的服务,以绕过 CORS 限制。`}}},"cloudflare-workers-ai":{description:`Cloudflare.com`,fields:{field:{"account-id":{description:`Cloudflare 帐户 ID`,label:`Cloudflare Account ID`,placeholder:`请输入 Cloudflare Account ID`},"api-key":{placeholder:`请输入 Cloudflare Workers AI 的 API Key`}}},title:`Workers AI`},common:{fields:{field:{pitch:{description:`调节合成语音的音高(比如更尖锐或者更粗旷)`,label:`音高`},speed:{description:`调节说话的语速`,label:`语速`},volume:{description:`调节语音的响度`,label:`响度`}}}},deepseek:{description:`DeepSeek.com`,title:`深度求索 DeepSeek`},elevenlabs:{description:`Elevenlabs.io`,fields:{field:{"simularity-boost":{description:`声音相似性与依从性`,label:`相似度修正`},"speaker-boost":{description:`增强说话者的相似性`,label:`扬声器增强`},speed:{description:`语音生成速度`,label:`语速`},stability:{description:`语音稳定性和随机性`,label:`稳定性`},style:{description:`夸张的语音风格`,label:`风格`}}},playground:{buttons:{button:{"test-voice":{generating:`生成中...`,label:`测试声音`}}},fields:{field:{input:{placeholder:`输入用于测试发音的文本`},language:{description:`选择语音语言`,label:`语言`},voice:{description:`选择首选语音`,label:`声线`}}},title:`实验平台`,validation:{"error-missing-api-key":`需要填写 API Key 才能用哦!`}},title:`ElevenLabs (11labs)`},fireworks:{description:`Fireworks.ai`,title:`Fireworks.ai`},"microsoft-speech":{description:`speech.microsoft.com`,fields:{field:{region:{description:`服务 Endpoint 地区(比如亚太 eastasia 区域)`,label:`Endpoint 地区`}}},title:`Microsoft / Azure 语音服务`},mistral:{description:`mistral.ai`,title:`Mistral`},moonshot:{description:`Moonshot.ai`,title:`月之暗面`},novita:{description:`novita.ai`,title:`Novita`},ollama:{description:`ollama.ai`,title:`Ollama`},openai:{description:`OpenAi.com`,title:`OpenAI`},openrouter:{description:`OpenRouter.ai`,title:`OpenRouter`},perplexity:{description:`perplexity.ai`,title:`Perplexity`},player2:{description:`player2.game`,title:`Player2`},together:{description:`together.ai`,title:`Together.ai`},"google-generative-ai":{description:`gemini.google.com`,title:`Google Gemini`},featherless:{description:`featherless.ai`,title:`Featherless AI`},vllm:{description:`vllm.ai`,title:`vLLM`},volcengine:{description:`volcengine.com`,fields:{field:{appId:{description:`可在控制台获取的 App ID`,label:`App ID`}}},title:`火山引擎`},xai:{description:`X.AI`,title:`xAI`},transcriptions:{playground:{title:`实验平台`}}},title:`服务来源`},scene:{description:`配置角色所在环境`,title:`场景`},themes:{"color-scheme":{description:`更改舞台的配色方案`,title:`配色方案`},developer:{description:`为开发者提供的选项`,title:`开发者`},general:{description:`深色主题、语言等选项`,title:`通用`},description:`自定义你的舞台外观!`,sections:{section:{"custom-color":{fields:{field:{"primary-color":{label:`强调色`,"rgb-on":{title:`RGB ON!`}}}},title:`配色`},developer:{title:`开发者`},"theme-presets":{presets:[{colors:[`AIRI 绿`],description:`默认的绿色主题,由 AIRI 为您带来!`,title:`默认颜色`},{colors:[`灰褐色`,`米色`,`灰白色`,`浅灰褐色`,`象牙色`,`橄榄灰`,`沙色`,`暖灰色`],description:`受乔治·莫兰迪绘画启发的柔和、低调的色调`,title:`Morandi 颜色`},{colors:[`天蓝色`,`薄雾色`,`沙色`,`苔藓绿`,`睡莲色`,`小麦色`,`板岩蓝`,`鼠尾草色`],description:`受克劳德·莫奈作品启发的印象派调色板`,title:`莫奈颜色`},{colors:[`棕褐色`,`暖灰褐色`,`赭色`,`咖啡色`,`青铜色`,`金色`,`芥末色`,`琥珀色`],description:`传统日本色彩调色板`,title:`日本颜色`},{colors:[`北欧蓝`,`冰色`,`峡湾色`,`钢铁色`,`冰川色`,`板岩色`,`云色`,`石头色`],description:`北欧极简主义配色方案`,title:`北欧颜色`},{colors:[`霞光红`,`枣红`,`黄栌`,`竹青`,`乌梅紫`,`缃色`,`青冥`,`赭石`],description:`中国传统色彩,源自古代纺织品、瓷器和绘画`,title:`中国传统颜色`}],title:`预设`}}},title:`外观`}},sections:{section:{general:{title:`通用`}}},theme:{title:`主题`,description:`切换 AIRI 的基础主题,亮色模式或暗色模式。 `},title:`设置`,voices:`声线`,vrm:{"change-model":{"from-file":`从文件加载`,"from-file-select":`选择`,"from-url":`从 URL 加载`,"from-url-confirm":`加载`,"from-url-placeholder":`输入 VRM 模型 URL`,title:`更换模型`},title:`VRM 设置`,"scale-and-position":{"model-info-title":`模型尺寸信息`,"model-info-x":`宽度(X轴)`,"model-info-y":`高度(Y轴)`,"model-info-z":`深度(Z轴)`,tips:`设定模型放置的空间坐标。 坐标轴已被可视化。 -`,title:`缩放与位置`,scale:`缩放`,x:`X轴偏移`,y:`Y 轴偏移`,z:`Z轴偏移`},"switch-to-vrm":{title:`想切换至Live2D虚拟形象?`,"change-to-vrm":`切换至Live2D虚拟形象设定页面`},"theme-color-from-model":{"button-extract":{title:`提取`}}}},settings_default=data$3,data$2={chat:{message:{"character-name":{airi:`AIRI`,"core-system":`核心系统`,you:`你`}},tabs:{chat:`聊天`,clothes:`换装`,custom:`自定义`}},message:`说点什么...`,"select-a-audio-input":`选择一个音频输入设备`,"select-a-model":`选择一个模型`,"select-a-voice":`选择一个声线`,viewers:{"debug-menu":{emotions:`表情`,"emotions-btn":{angry:`😠 生气`,awkward:`😳 尴尬`,happy:`😄 开心`,neutral:`🙂 日常`,question:`🤔 疑问`,sad:`😫 难过`,surprised:`🤯 惊喜`,think:`🤨 思考`},vrm:{camera:`摄像机`,model:{title:`模型`}}}},waiting:`等待中`,operations:{"load-models":`加载模型`,"load-models-status":{loading:`模型加载中`,ready:`已就绪`}}},stage_default=data$2,data$1={"allow-visible-on-all-workspaces":{title:`跨桌面可见性`,description:`允许窗口在所有虚拟桌面中可见,仅限 macOS。`},pages:{modules:{"mcp-server":{description:`连接与管理 MCP 服务器和工具`,title:`MCP 服务器`}},themes:{sections:{section:{"window-shortcuts":{title:`键盘快捷键`}}},"window-shortcuts":{description:`修改窗口快捷方式`,title:`窗口快捷方式`,"toggle-move":{label:`切换移动状态`},"toggle-resize":{label:`调整大小`},"toggle-ignore-mouse-event":{label:`忽略鼠标事件`},"press-keys":`请按下按键...`}}}},settings_default$1=data$1,data={operations:{"load-models":`加载推理模型`,"load-models-status":{loading:`加载中`,ready:`已就绪`}}},stage_default$1=data,tamagotchi_default={stage:stage_default$1,settings:settings_default$1},zh_Hans_default={base:base_default,docs:docs_default,settings:settings_default,stage:stage_default,tamagotchi:tamagotchi_default},locales_default={en:en_default,"zh-Hans":zh_Hans_default};const languageRemap={"zh-CN":`zh-Hans`,"zh-TW":`zh-Hans`,"zh-HK":`zh-Hans`,"zh-Hant":`zh-Hans`,"en-US":`en`,"en-GB":`en`,"en-AU":`en`,en:`en`};function getLocale(){let language=localStorage.getItem(`settings/language`),languages=Object.keys(locales_default);return languageRemap[language||`en`]!=null&&(language=languageRemap[language||`en`]),language&&languages.includes(language)?language:`en`}const i18n=createI18n({legacy:!1,locale:getLocale(),fallbackLocale:`en`,messages:locales_default});var import_nprogress=__toESM(require_nprogress());const pinia=createPinia(),routeRecords=setupLayouts(routes);let router;router=createRouter({routes:routeRecords,history:createWebHashHistory()}),router.beforeEach((to$2,from)=>{to$2.path!==from.path&&import_nprogress.default.start()}),router.afterEach(()=>{import_nprogress.default.done()}),router.isReady().then(async()=>{}).catch(()=>{}),createApp(App_default).use(MotionPlugin).use(autoAnimatePlugin).use(router).use(pinia).use(i18n).use(mo).mount(`#app`);export{sleep$1 as $,useConsciousnessStore as A,useProvidersStore as B,check as C,ZodFirstPartyTypeKind as D,missingDependenciesUrl as E,tryImport as F,streamText as G,useWhisper as H,useVRMEmote as I,loadVrm as J,useIdleEyeSaccades as K,loadVRMAnimation as L,clipFromVRMAnimation as M,useBlink as N,VRMUtils as O,randomSaccadeInterval as P,lerp as Q,randFloat as R,useMicVAD as S,useMarkdown as T,useAudioRecorder as U,SpeechPlayground_default as V,useAudioContext as W,useSpeakingStore as X,useDelayMessageQueue as Y,useMessageContentQueue as Z,useEmotionsMessageQueue as _,useFileDialog as a$,merge$2 as a1,useQueue as a2,ProviderSettingsLayout_default as a3,ProviderSettingsContainer_default as a4,ProviderBasicSettings_default as a5,ProviderBaseUrlInput_default as a6,ProviderApiKeyInput_default as a7,useI18n as a8,ProviderAdvancedSettings_default as a9,TimeSeriesChart_default as aA,llmInferenceEndToken as aB,EmotionNeutralMotionName as aC,EMOTION_EmotionMotionName_value as aD,EMOTION_VRMExpressionName_value as aE,Emotion as aF,EmotionThinkMotionName as aG,formatHex as aH,ThresholdMeter_default as aI,TestDummyMarker_default as aJ,__plugin_vue_export_helper_default as aK,LevelMeter_default as aL,useRouter as aM,useRoute as aN,RouterLink as aO,RouterView as aP,__vitePreload as aQ,storeToRefs as aR,breakpointsTailwind as aS,useMouse as aT,usePointer as aU,useDevicesList as aV,useClipboard as aW,useElementBounding as aX,useBreakpoints as aY,useDark as aZ,useScreenSafeArea as a_,ProviderAccountIdInput_default as aa,CursorFloating_default as ab,Skeleton_default as ac,Screen_default as ad,ErrorContainer_default as ae,Button_default as af,VoiceCardManySelect_default as ag,RadioCardSimple_default as ah,RadioCardManySelect_default as ai,Alert_default as aj,IconStatusItem_default as ak,IconItem_default as al,Section_default as am,Select_default as an,Option_default as ao,RoundRange_default as ap,ColorHueRange_default as aq,FieldValues_default as ar,FieldSelect_default as as,FieldRange_default as at,FieldKeyValues_default as au,FieldInput_default as av,Input_default as aw,FieldCheckbox_default as ax,PageHeader_default as ay,Callout_default as az,ColorPalette_default as b,NearestMipmapLinearFilter as b$,useLocalStorage as b0,useObjectUrl as b1,useResizeObserver as b2,useUserMedia as b3,until as b4,refThrottled as b5,watchDebounced as b6,useDebounceFn as b7,refDebounced as b8,defu as b9,TorusGeometry as bA,EquirectangularReflectionMapping as bB,OrthographicCamera as bC,LineBasicMaterial as bD,AdditiveBlending as bE,RepeatWrapping as bF,Path as bG,ClampToEdgeWrapping as bH,OctahedronGeometry as bI,WireframeGeometry as bJ,Box3 as bK,WebGLRenderTarget as bL,RGBAFormat as bM,Uniform as bN,MirroredRepeatWrapping as bO,BufferAttribute as bP,CompressedTexture as bQ,AudioListener as bR,ExtrudeGeometry as bS,FileLoader as bT,NearestFilter as bU,Float32BufferAttribute as bV,NearestMipmapNearestFilter as bW,ShapeUtils as bX,Color as bY,Object3D as bZ,Group as b_,so$1 as ba,io$1 as bb,dn$1 as bc,Mn$1 as bd,Q$2 as be,Vn$1 as bf,Ee$1 as bg,Ir as bh,pe$2 as bi,ShaderChunk as bj,UniformsLib as bk,WebGLRenderer as bl,Matrix4 as bm,CubeReflectionMapping as bn,InterpolateDiscrete as bo,InterleavedBuffer as bp,BackSide as bq,Vector3 as br,Spherical as bs,Euler as bt,ShapePath as bu,DataUtils as bv,Material as bw,DoubleSide as bx,InterpolateLinear as by,Ray as bz,Av as c,Transition as c$,Matrix3 as c0,TextureLoader as c1,CubeTextureLoader as c2,PerspectiveCamera as c3,PropertyBinding as c4,PlaneGeometry as c5,EventDispatcher as c6,AlwaysStencilFunc as c7,Line as c8,LinearFilter as c9,ShapeGeometry as cA,MeshDepthMaterial as cB,MeshStandardMaterial as cC,BufferGeometry as cD,MathUtils as cE,Raycaster as cF,Line3 as cG,AnimationMixer as cH,AudioLoader as cI,CubeCamera as cJ,Vector2 as cK,Scene as cL,Mesh as cM,DataTexture as cN,InterleavedBufferAttribute as cO,InstancedInterleavedBuffer as cP,BoxGeometry as cQ,MeshBasicMaterial as cR,QuadraticBezierCurve3 as cS,CatmullRomCurve3 as cT,InstancedBufferGeometry as cU,FloatType as cV,DataTextureLoader as cW,ReplaceStencilOp as cX,FrontSide as cY,HalfFloatType as cZ,vModelSelect as c_,REVISION as ca,SkinnedMesh as cb,UniformsUtils as cc,Audio$1 as cd,LinearMipmapNearestFilter as ce,Sphere as cf,NoToneMapping as cg,Box2 as ch,MOUSE as ci,SphereGeometry as cj,Plane as ck,TOUCH as cl,Triangle as cm,Quaternion as cn,LinearMipmapLinearFilter as co,ShaderMaterial as cp,WebGLCubeRenderTarget as cq,RawShaderMaterial as cr,Loader as cs,DepthTexture as ct,InstancedMesh as cu,CylinderGeometry as cv,Shape as cw,EdgesGeometry as cx,Vector4 as cy,Texture as cz,Bu as d,vModelText as d0,render$1 as d1,withModifiers as d2,vModelRadio as d3,vModelCheckbox as d4,renderSlot as d5,withDirectives as d6,withAsyncContext as d7,resolveComponent as d8,Fragment as d9,toRaw as dA,reactive as dB,onScopeDispose as dC,unref as dD,shallowReactive as dE,toValue$1 as dF,isRef as dG,toRef as dH,ref as dI,shallowRef as dJ,isReactive as dK,toRefs as dL,getCurrentScope as dM,toDisplayString as dN,normalizeClass as dO,normalizeStyle as dP,__commonJSMin as dQ,__export as dR,__toDynamicImportESM as dS,__require as dT,__toESM as dU,computed as da,getCurrentInstance as db,useSlots as dc,mergeProps as dd,createVNode as de,useAttrs as df,watch as dg,resolveDirective as dh,openBlock as di,createTextVNode as dj,onMounted as dk,nextTick as dl,defineComponent as dm,createCommentVNode as dn,withCtx as do,createElementBlock as dp,onBeforeUnmount as dq,onUnmounted as dr,mergeModels as ds,KeepAlive as dt,createBaseVNode as du,renderList as dv,watchEffect as dw,useTemplateRef as dx,createBlock as dy,useModel as dz,Vv as e,Ov as f,Fv as g,$u as h,Tv as i,Nv as j,kv as k,Iv as l,nu as m,Mv as n,Pu as o,TranscriptionProviderSettings_default as p,TranscriptionPlayground_default as q,SpeechProviderSettings_default as r,useVRM as s,useSettings as t,useLive2d as u,useChatStore as v,useHearingStore as w,useAiriCardStore as x,useSpeechStore as y,generateSpeech as z}; \ No newline at end of file +`,title:`缩放与位置`,scale:`缩放`,x:`X轴偏移`,y:`Y 轴偏移`,z:`Z轴偏移`},"switch-to-vrm":{title:`想切换至Live2D虚拟形象?`,"change-to-vrm":`切换至Live2D虚拟形象设定页面`},"theme-color-from-model":{"button-extract":{title:`提取`}}}},settings_default=data$3,data$2={chat:{message:{"character-name":{airi:`AIRI`,"core-system":`核心系统`,you:`你`}},tabs:{chat:`聊天`,clothes:`换装`,custom:`自定义`}},message:`说点什么...`,"select-a-audio-input":`选择一个音频输入设备`,"select-a-model":`选择一个模型`,"select-a-voice":`选择一个声线`,viewers:{"debug-menu":{emotions:`表情`,"emotions-btn":{angry:`😠 生气`,awkward:`😳 尴尬`,happy:`😄 开心`,neutral:`🙂 日常`,question:`🤔 疑问`,sad:`😫 难过`,surprised:`🤯 惊喜`,think:`🤨 思考`},vrm:{camera:`摄像机`,model:{title:`模型`}}}},waiting:`等待中`,operations:{"load-models":`加载模型`,"load-models-status":{loading:`模型加载中`,ready:`已就绪`}}},stage_default=data$2,data$1={"allow-visible-on-all-workspaces":{title:`跨桌面可见性`,description:`允许窗口在所有虚拟桌面中可见,仅限 macOS。`},pages:{modules:{"mcp-server":{description:`连接与管理 MCP 服务器和工具`,title:`MCP 服务器`}},themes:{sections:{section:{"window-shortcuts":{title:`键盘快捷键`}}},"window-shortcuts":{description:`修改窗口快捷方式`,title:`窗口快捷方式`,"toggle-move":{label:`切换移动状态`},"toggle-resize":{label:`调整大小`},"toggle-ignore-mouse-event":{label:`忽略鼠标事件`},"press-keys":`请按下按键...`}}}},settings_default$1=data$1,data={operations:{"load-models":`加载推理模型`,"load-models-status":{loading:`加载中`,ready:`已就绪`}}},stage_default$1=data,tamagotchi_default={stage:stage_default$1,settings:settings_default$1},zh_Hans_default={base:base_default,docs:docs_default,settings:settings_default,stage:stage_default,tamagotchi:tamagotchi_default},locales_default={en:en_default,"zh-Hans":zh_Hans_default};const languageRemap={"zh-CN":`zh-Hans`,"zh-TW":`zh-Hans`,"zh-HK":`zh-Hans`,"zh-Hant":`zh-Hans`,"en-US":`en`,"en-GB":`en`,"en-AU":`en`,en:`en`};function getLocale(){let language=localStorage.getItem(`settings/language`),languages=Object.keys(locales_default);return languageRemap[language||`en`]!=null&&(language=languageRemap[language||`en`]),language&&languages.includes(language)?language:`en`}const i18n=createI18n({legacy:!1,locale:getLocale(),fallbackLocale:`en`,messages:locales_default});var import_nprogress=__toESM(require_nprogress());const pinia=createPinia(),routeRecords=setupLayouts(routes);let router;router=createRouter({routes:routeRecords,history:createWebHashHistory()}),router.beforeEach((to$2,from)=>{to$2.path!==from.path&&import_nprogress.default.start()}),router.afterEach(()=>{import_nprogress.default.done()}),router.isReady().then(async()=>{}).catch(()=>{}),createApp(App_default).use(MotionPlugin).use(autoAnimatePlugin).use(router).use(pinia).use(i18n).use(mo).mount(`#app`);export{sleep$1 as $,useConsciousnessStore as A,useProvidersStore as B,check as C,ZodFirstPartyTypeKind as D,missingDependenciesUrl as E,tryImport as F,streamText as G,useWhisper as H,useVRMEmote as I,loadVrm as J,useBlink as K,useIdleEyeSaccades as L,loadVRMAnimation as M,clipFromVRMAnimation as N,VRMUtils as O,randomSaccadeInterval as P,randFloat as Q,lerp as R,useMicVAD as S,useMarkdown as T,useAudioRecorder as U,SpeechPlayground_default as V,useAudioContext as W,useSpeakingStore as X,useMessageContentQueue as Y,useEmotionsMessageQueue as Z,useDelayMessageQueue as _,usePointer as a$,merge$2 as a1,useQueue as a2,ProviderSettingsLayout_default as a3,ProviderSettingsContainer_default as a4,ProviderBasicSettings_default as a5,ProviderBaseUrlInput_default as a6,ProviderApiKeyInput_default as a7,useI18n as a8,ProviderAdvancedSettings_default as a9,TimeSeriesChart_default as aA,llmInferenceEndToken as aB,Emotion as aC,EmotionThinkMotionName as aD,EmotionNeutralMotionName as aE,EMOTION_EmotionMotionName_value as aF,EMOTION_VRMExpressionName_value as aG,formatHex as aH,ThresholdMeter_default as aI,TestDummyMarker_default as aJ,__plugin_vue_export_helper_default as aK,LevelMeter_default as aL,useRouter as aM,useRoute as aN,RouterLink as aO,RouterView as aP,__vitePreload as aQ,storeToRefs as aR,useDark as aS,useScreenSafeArea as aT,useFileDialog as aU,useLocalStorage as aV,useObjectUrl as aW,useResizeObserver as aX,useUserMedia as aY,breakpointsTailwind as aZ,useMouse as a_,ProviderAccountIdInput_default as aa,CursorFloating_default as ab,Skeleton_default as ac,Screen_default as ad,ErrorContainer_default as ae,Button_default as af,VoiceCardManySelect_default as ag,RadioCardSimple_default as ah,RadioCardManySelect_default as ai,Alert_default as aj,IconStatusItem_default as ak,IconItem_default as al,Section_default as am,Select_default as an,Option_default as ao,RoundRange_default as ap,ColorHueRange_default as aq,FieldValues_default as ar,FieldSelect_default as as,FieldRange_default as at,FieldKeyValues_default as au,FieldInput_default as av,Input_default as aw,FieldCheckbox_default as ax,PageHeader_default as ay,Callout_default as az,ColorPalette_default as b,TextureLoader as b$,useDevicesList as b0,useClipboard as b1,useElementBounding as b2,useBreakpoints as b3,refThrottled as b4,watchDebounced as b5,useDebounceFn as b6,refDebounced as b7,until as b8,defu as b9,LineBasicMaterial as bA,OrthographicCamera as bB,AdditiveBlending as bC,RepeatWrapping as bD,Path as bE,ClampToEdgeWrapping as bF,OctahedronGeometry as bG,WireframeGeometry as bH,Box3 as bI,WebGLRenderTarget as bJ,RGBAFormat as bK,Uniform as bL,MirroredRepeatWrapping as bM,BufferAttribute as bN,CompressedTexture as bO,AudioListener as bP,ExtrudeGeometry as bQ,NearestFilter as bR,FileLoader as bS,Float32BufferAttribute as bT,NearestMipmapNearestFilter as bU,ShapeUtils as bV,Color as bW,Object3D as bX,Group as bY,NearestMipmapLinearFilter as bZ,Matrix3 as b_,so$1 as ba,io$1 as bb,dn$1 as bc,Mn$1 as bd,Q$2 as be,Vn$1 as bf,Ee$1 as bg,Ir as bh,pe$2 as bi,ShaderChunk as bj,UniformsLib as bk,WebGLRenderer as bl,InterpolateDiscrete as bm,InterleavedBuffer as bn,BackSide as bo,Spherical as bp,ShapePath as bq,Material as br,Vector3 as bs,Euler as bt,DataUtils as bu,DoubleSide as bv,InterpolateLinear as bw,Ray as bx,TorusGeometry as by,EquirectangularReflectionMapping as bz,Av as c,vModelSelect as c$,CubeTextureLoader as c0,PerspectiveCamera as c1,PropertyBinding as c2,PlaneGeometry as c3,EventDispatcher as c4,AlwaysStencilFunc as c5,Line as c6,LinearFilter as c7,REVISION as c8,SkinnedMesh as c9,MeshStandardMaterial as cA,BufferGeometry as cB,MathUtils as cC,Raycaster as cD,Line3 as cE,AnimationMixer as cF,AudioLoader as cG,CubeCamera as cH,Vector2 as cI,Scene as cJ,Mesh as cK,DataTexture as cL,InterleavedBufferAttribute as cM,InstancedInterleavedBuffer as cN,BoxGeometry as cO,MeshBasicMaterial as cP,CatmullRomCurve3 as cQ,QuadraticBezierCurve3 as cR,InstancedBufferGeometry as cS,FloatType as cT,DataTextureLoader as cU,ReplaceStencilOp as cV,FrontSide as cW,HalfFloatType as cX,CubeReflectionMapping as cY,Matrix4 as cZ,vModelCheckbox as c_,Audio$1 as ca,UniformsUtils as cb,LinearMipmapNearestFilter as cc,NoToneMapping as cd,Box2 as ce,Sphere as cf,MOUSE as cg,SphereGeometry as ch,Plane as ci,TOUCH as cj,Triangle as ck,Quaternion as cl,LinearMipmapLinearFilter as cm,ShaderMaterial as cn,WebGLCubeRenderTarget as co,Loader as cp,RawShaderMaterial as cq,DepthTexture as cr,InstancedMesh as cs,Shape as ct,EdgesGeometry as cu,CylinderGeometry as cv,Vector4 as cw,Texture as cx,ShapeGeometry as cy,MeshDepthMaterial as cz,Bu as d,Transition as d0,vModelText as d1,render$1 as d2,withModifiers as d3,vModelRadio as d4,nextTick as d5,defineComponent as d6,createCommentVNode as d7,withCtx as d8,createElementBlock as d9,toRefs as dA,getCurrentScope as dB,toRaw as dC,reactive as dD,onScopeDispose as dE,unref as dF,shallowReactive as dG,toValue$1 as dH,isRef as dI,toRef as dJ,ref as dK,shallowRef as dL,isReactive as dM,toDisplayString as dN,normalizeClass as dO,normalizeStyle as dP,__commonJSMin as dQ,__export as dR,__toDynamicImportESM as dS,__require as dT,__toESM as dU,onBeforeUnmount as da,onUnmounted as db,mergeModels as dc,KeepAlive as dd,createBaseVNode as de,renderList as df,watchEffect as dg,useTemplateRef as dh,createBlock as di,useModel as dj,renderSlot as dk,withDirectives as dl,withAsyncContext as dm,resolveComponent as dn,Fragment as do,computed as dp,getCurrentInstance as dq,useSlots as dr,mergeProps as ds,createVNode as dt,useAttrs as du,watch as dv,resolveDirective as dw,openBlock as dx,createTextVNode as dy,onMounted as dz,Vv as e,Ov as f,Fv as g,$u as h,Tv as i,Nv as j,kv as k,Iv as l,nu as m,Mv as n,Pu as o,TranscriptionProviderSettings_default as p,TranscriptionPlayground_default as q,SpeechProviderSettings_default as r,useVRM as s,useSettings as t,useLive2d as u,useChatStore as v,useHearingStore as w,useAiriCardStore as x,useSpeechStore as y,generateSpeech as z}; \ No newline at end of file diff --git a/assets/memory-CxpzfPsV.js b/assets/memory-CxpzfPsV.js new file mode 100644 index 0000000000000000000000000000000000000000..a0767cf7bad0b91c67308dcc284f6627c39c061f --- /dev/null +++ b/assets/memory-CxpzfPsV.js @@ -0,0 +1 @@ +import{az as e,d6 as t,d8 as n,d9 as r,dF as i,de as a,dl as o,do as s,dt as c,dw as l,dx as u,dy as d}from"./index-TXtvn0DM.js";import{b as f}from"./route-block-DVyt-3Cw.js";const p={text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-15rem)]`,"bottom-0":``,"right--5":``,"z--1":``,initial:{scale:.9,opacity:0,y:15},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``};var m=t({__name:`index`,setup(t){return(t,f)=>{let m=l(`motion`);return u(),r(s,null,[a(`div`,null,[c(i(e),{label:`In development, needs your help!`,theme:`orange`},{default:n(()=>f[0]||=[a(`div`,null,[d(` This functionality is still under development. If you have any suggestions or would like to contribute, please reach out to us on our `),a(`a`,{underline:``,"decoration-dotted":``,href:`https://github.com/moeru-ai/airi/issues`},`GitHub issues page`),d(`. The source code of this page is located at `),a(`a`,{underline:``,"decoration-dotted":``,href:`https://github.com/moeru-ai/airi/tree/main/apps/stage-web/src/pages/settings/memory/index.vue`},`here`),d(`. `)],-1)]),_:1,__:[0]})]),o((u(),r(`div`,p,f[1]||=[a(`div`,{text:`60`,"i-solar:leaf-bold-duotone":``},null,-1)])),[[m]])],64)}}});typeof f==`function`&&f(m);var h=m;export{h as default}; \ No newline at end of file diff --git a/assets/memory-DF7fLUfS.js b/assets/memory-DF7fLUfS.js deleted file mode 100644 index 154aa4c4c9c7e638ca31dd1e39a02ed5f84eb6d0..0000000000000000000000000000000000000000 --- a/assets/memory-DF7fLUfS.js +++ /dev/null @@ -1 +0,0 @@ -import{az as e,d6 as t,d9 as n,dD as r,de as i,dh as a,di as o,dj as s,dm as c,do as l,dp as u,du as d}from"./index-Bcb2irKh.js";import{b as f}from"./route-block-DVyt-3Cw.js";const p={text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-15rem)]`,"bottom-0":``,"right--5":``,"z--1":``,initial:{scale:.9,opacity:0,y:15},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``};var m=c({__name:`index`,setup(c){return(c,f)=>{let m=a(`motion`);return o(),u(n,null,[d(`div`,null,[i(r(e),{label:`In development, needs your help!`,theme:`orange`},{default:l(()=>f[0]||=[d(`div`,null,[s(` This functionality is still under development. If you have any suggestions or would like to contribute, please reach out to us on our `),d(`a`,{underline:``,"decoration-dotted":``,href:`https://github.com/moeru-ai/airi/issues`},`GitHub issues page`),s(`. The source code of this page is located at `),d(`a`,{underline:``,"decoration-dotted":``,href:`https://github.com/moeru-ai/airi/tree/main/apps/stage-web/src/pages/settings/memory/index.vue`},`here`),s(`. `)],-1)]),_:1,__:[0]})]),t((o(),u(`div`,p,f[1]||=[d(`div`,{text:`60`,"i-solar:leaf-bold-duotone":``},null,-1)])),[[m]])],64)}}});typeof f==`function`&&f(m);var h=m;export{h as default}; \ No newline at end of file diff --git a/assets/memory-long-term-D5MNuhrd.js b/assets/memory-long-term-D5MNuhrd.js deleted file mode 100644 index a1f99314a1f3af6ef2d30fce65301f402b063681..0000000000000000000000000000000000000000 --- a/assets/memory-long-term-D5MNuhrd.js +++ /dev/null @@ -1 +0,0 @@ -import{di as e,dm as t,dp as n}from"./index-Bcb2irKh.js";import{b as r}from"./route-block-DVyt-3Cw.js";var i=t({__name:`memory-long-term`,setup(t){return(t,r)=>(e(),n(`div`))}});typeof r==`function`&&r(i);var a=i;export{a as default}; \ No newline at end of file diff --git a/assets/memory-long-term-g3FFPLwk.js b/assets/memory-long-term-g3FFPLwk.js new file mode 100644 index 0000000000000000000000000000000000000000..874a710513ec74df6ae1d86c992652731e248eca --- /dev/null +++ b/assets/memory-long-term-g3FFPLwk.js @@ -0,0 +1 @@ +import{d6 as e,d9 as t,dx as n}from"./index-TXtvn0DM.js";import{b as r}from"./route-block-DVyt-3Cw.js";var i=e({__name:`memory-long-term`,setup(e){return(e,r)=>(n(),t(`div`))}});typeof r==`function`&&r(i);var a=i;export{a as default}; \ No newline at end of file diff --git a/assets/memory-short-term-BGQrHIiR.js b/assets/memory-short-term-BGQrHIiR.js new file mode 100644 index 0000000000000000000000000000000000000000..6215f1570f18cf059fd29e03a6b04ce1999a7797 --- /dev/null +++ b/assets/memory-short-term-BGQrHIiR.js @@ -0,0 +1 @@ +import{d6 as e,d9 as t,dx as n}from"./index-TXtvn0DM.js";import{b as r}from"./route-block-DVyt-3Cw.js";var i=e({__name:`memory-short-term`,setup(e){return(e,r)=>(n(),t(`div`))}});typeof r==`function`&&r(i);var a=i;export{a as default}; \ No newline at end of file diff --git a/assets/memory-short-term-BfW329Pe.js b/assets/memory-short-term-BfW329Pe.js deleted file mode 100644 index 0f861ced5af601b57d4d9fe69f75a5e8ac51c543..0000000000000000000000000000000000000000 --- a/assets/memory-short-term-BfW329Pe.js +++ /dev/null @@ -1 +0,0 @@ -import{di as e,dm as t,dp as n}from"./index-Bcb2irKh.js";import{b as r}from"./route-block-DVyt-3Cw.js";var i=t({__name:`memory-short-term`,setup(t){return(t,r)=>(e(),n(`div`))}});typeof r==`function`&&r(i);var a=i;export{a as default}; \ No newline at end of file diff --git a/assets/messages-BQuV_Wj8.js b/assets/messages-BQuV_Wj8.js new file mode 100644 index 0000000000000000000000000000000000000000..06efc21542e29470d2f2e76e4d37e60ee58120d4 --- /dev/null +++ b/assets/messages-BQuV_Wj8.js @@ -0,0 +1 @@ +import"./Basic-8xhCMoI8.js";import{b as e}from"./Textarea-BsLlwm-1.js";import{Y as t,a2 as n,aB as r,d6 as i,d9 as a,dF as o,dK as s,dN as c,de as l,df as u,do as d,dt as f,dx as p}from"./index-TXtvn0DM.js";const m={flex:``,"flex-col":``,"gap-2":``,"p-2":``},h={flex:``,"flex-row":``,"gap-2":``},g={"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-4":``},_={"w-full":``,flex:``,"flex-row":``,"gap-4":``},v={"w-full":``,"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-2":``};var y=i({__name:`messages`,setup(i){let y=s(``),b=s([]),x=s(!1),S=n({handlers:[async e=>{b.value.push(e.data)}]}),C=t(S);async function w(){x.value=!0,C.add(y.value),C.add(r),y.value=``,x.value=!1}return(t,n)=>(p(),a(`div`,m,[l(`div`,h,[f(o(e),{modelValue:y.value,"onUpdate:modelValue":n[0]||=e=>y.value=e,placeholder:`Message`,p:`2`,bg:`neutral-100 dark:neutral-700`,"w-full":``,"rounded-lg":``,"outline-none":``,onSubmit:w},null,8,[`modelValue`]),l(`button`,g,c(x.value?`Processing...`:`Send`),1)]),l(`div`,_,[l(`div`,v,[n[1]||=l(`h3`,{"font-normal":``},` TTS Message `,-1),(p(!0),a(d,null,u(b.value,e=>(p(),a(`div`,{key:e},[l(`div`,null,c(e),1)]))),128))])])]))}}),b=y;export{b as default}; \ No newline at end of file diff --git a/assets/messages-COyeBtk8.js b/assets/messages-COyeBtk8.js deleted file mode 100644 index 89d6c7eb0c66c2c962345cf400e6b2137accc2cc..0000000000000000000000000000000000000000 --- a/assets/messages-COyeBtk8.js +++ /dev/null @@ -1 +0,0 @@ -import"./Basic-BIq-Of0k.js";import{b as e}from"./Textarea-BFPvaePN.js";import{Z as t,a2 as n,aB as r,d9 as i,dD as a,dI as o,dN as s,de as c,di as l,dm as u,dp as d,du as f,dv as p}from"./index-Bcb2irKh.js";const m={flex:``,"flex-col":``,"gap-2":``,"p-2":``},h={flex:``,"flex-row":``,"gap-2":``},g={"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-4":``},_={"w-full":``,flex:``,"flex-row":``,"gap-4":``},v={"w-full":``,"rounded-lg":``,bg:`neutral-100 dark:neutral-700`,"p-2":``};var y=u({__name:`messages`,setup(u){let y=o(``),b=o([]),x=o(!1),S=n({handlers:[async e=>{b.value.push(e.data)}]}),C=t(S);async function w(){x.value=!0,C.add(y.value),C.add(r),y.value=``,x.value=!1}return(t,n)=>(l(),d(`div`,m,[f(`div`,h,[c(a(e),{modelValue:y.value,"onUpdate:modelValue":n[0]||=e=>y.value=e,placeholder:`Message`,p:`2`,bg:`neutral-100 dark:neutral-700`,"w-full":``,"rounded-lg":``,"outline-none":``,onSubmit:w},null,8,[`modelValue`]),f(`button`,g,s(x.value?`Processing...`:`Send`),1)]),f(`div`,_,[f(`div`,v,[n[1]||=f(`h3`,{"font-normal":``},` TTS Message `,-1),(l(!0),d(i,null,p(b.value,e=>(l(),d(`div`,{key:e},[f(`div`,null,s(e),1)]))),128))])])]))}}),b=y;export{b as default}; \ No newline at end of file diff --git a/assets/microsoft-speech-BY2LoVCU.js b/assets/microsoft-speech-BY2LoVCU.js new file mode 100644 index 0000000000000000000000000000000000000000..ad7f7dfb632336899176a94ca1861f8ff7861617 --- /dev/null +++ b/assets/microsoft-speech-BY2LoVCU.js @@ -0,0 +1 @@ +import{B as e,V as t,a8 as n,aR as r,at as i,av as a,d6 as o,d8 as s,dF as c,dK as l,de as u,di as d,dp as f,dt as p,dv as m,dx as h,dz as g,r as _,y as v}from"./index-TXtvn0DM.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b={flex:`~ col gap-4`},x=`microsoft-speech`,S=`v1`;var C=o({__name:`microsoft-speech`,setup(o){let{t:y}=n(),C={pitch:0,speed:1,volume:0},w=v(),T=e(),{providers:E}=r(T),D=l(0),O=l(1),k=l(0),A=f({get:()=>E.value[x]?.region,set:e=>{E.value[x]||(E.value[x]={region:`eastasia`}),E.value[x].region=e}}),j=f(()=>!!E.value[x]?.apiKey),M=f(()=>w.availableVoices[x]||[]);g(async()=>{A.value||=`eastasia`,await w.loadVoicesForProvider(x)}),m([j,A],async()=>{await w.loadVoicesForProvider(x)});async function N(e,t,n){let r=await T.getProviderInstance(x);if(!r)throw Error(`Failed to initialize speech provider`);let i=T.getProviderConfig(x),a=i.model||S,o={...i,region:A.value,disableSsml:!n};if(!n&&t){let n=M.value.find(e=>e.id===t);if(n){let s=w.generateSSML(e,n,{...i,pitch:D.value});return await w.speech(r,a,s,t,o)}}return await w.speech(r,a,e,t,o)}return(e,n)=>(h(),d(c(_),{"provider-id":x,"default-model":S,"additional-settings":C},{"basic-settings":s(()=>[p(c(a),{modelValue:A.value,"onUpdate:modelValue":n[0]||=e=>A.value=e,label:c(y)(`settings.pages.providers.provider.microsoft-speech.fields.field.region.label`),description:c(y)(`settings.pages.providers.provider.microsoft-speech.fields.field.region.description`),placeholder:`eastasia`,required:``,type:`text`},null,8,[`modelValue`,`label`,`description`])]),"voice-settings":s(()=>[u(`div`,b,[p(c(i),{modelValue:D.value,"onUpdate:modelValue":n[1]||=e=>D.value=e,label:c(y)(`settings.pages.providers.provider.common.fields.field.pitch.label`),description:c(y)(`settings.pages.providers.provider.common.fields.field.pitch.description`),min:-100,max:100,step:1,"format-value":e=>`${e}%`},null,8,[`modelValue`,`label`,`description`,`format-value`]),p(c(i),{modelValue:O.value,"onUpdate:modelValue":n[2]||=e=>O.value=e,label:c(y)(`settings.pages.providers.provider.common.fields.field.speed.label`),description:c(y)(`settings.pages.providers.provider.common.fields.field.speed.description`),min:.5,max:2,step:.01},null,8,[`modelValue`,`label`,`description`]),p(c(i),{modelValue:k.value,"onUpdate:modelValue":n[3]||=e=>k.value=e,label:c(y)(`settings.pages.providers.provider.common.fields.field.volume.label`),description:c(y)(`settings.pages.providers.provider.common.fields.field.volume.description`),min:-100,max:100,step:1,"format-value":e=>`${e}%`},null,8,[`modelValue`,`label`,`description`,`format-value`])])]),playground:s(()=>[p(c(t),{"available-voices":M.value,"generate-speech":N,"api-key-configured":j.value,"default-text":`Hello! This is a test of the Microsoft Speech synthesis.`},null,8,[`available-voices`,`api-key-configured`])]),_:1}))}});typeof y==`function`&&y(C);var w=C;export{w as default}; \ No newline at end of file diff --git a/assets/microsoft-speech-DXgisB08.js b/assets/microsoft-speech-DXgisB08.js deleted file mode 100644 index 2a985cf3efd1ac0ab43e29b74e92503297ed7154..0000000000000000000000000000000000000000 --- a/assets/microsoft-speech-DXgisB08.js +++ /dev/null @@ -1 +0,0 @@ -import{B as e,V as t,a8 as n,aR as r,at as i,av as a,dD as o,dI as s,da as c,de as l,dg as u,di as d,dk as f,dm as p,do as m,du as h,dy as g,r as _,y as v}from"./index-Bcb2irKh.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b={flex:`~ col gap-4`},x=`microsoft-speech`,S=`v1`;var C=p({__name:`microsoft-speech`,setup(p){let{t:y}=n(),C={pitch:0,speed:1,volume:0},w=v(),T=e(),{providers:E}=r(T),D=s(0),O=s(1),k=s(0),A=c({get:()=>E.value[x]?.region,set:e=>{E.value[x]||(E.value[x]={region:`eastasia`}),E.value[x].region=e}}),j=c(()=>!!E.value[x]?.apiKey),M=c(()=>w.availableVoices[x]||[]);f(async()=>{A.value||=`eastasia`,await w.loadVoicesForProvider(x)}),u([j,A],async()=>{await w.loadVoicesForProvider(x)});async function N(e,t,n){let r=await T.getProviderInstance(x);if(!r)throw Error(`Failed to initialize speech provider`);let i=T.getProviderConfig(x),a=i.model||S,o={...i,region:A.value,disableSsml:!n};if(!n&&t){let n=M.value.find(e=>e.id===t);if(n){let s=w.generateSSML(e,n,{...i,pitch:D.value});return await w.speech(r,a,s,t,o)}}return await w.speech(r,a,e,t,o)}return(e,n)=>(d(),g(o(_),{"provider-id":x,"default-model":S,"additional-settings":C},{"basic-settings":m(()=>[l(o(a),{modelValue:A.value,"onUpdate:modelValue":n[0]||=e=>A.value=e,label:o(y)(`settings.pages.providers.provider.microsoft-speech.fields.field.region.label`),description:o(y)(`settings.pages.providers.provider.microsoft-speech.fields.field.region.description`),placeholder:`eastasia`,required:``,type:`text`},null,8,[`modelValue`,`label`,`description`])]),"voice-settings":m(()=>[h(`div`,b,[l(o(i),{modelValue:D.value,"onUpdate:modelValue":n[1]||=e=>D.value=e,label:o(y)(`settings.pages.providers.provider.common.fields.field.pitch.label`),description:o(y)(`settings.pages.providers.provider.common.fields.field.pitch.description`),min:-100,max:100,step:1,"format-value":e=>`${e}%`},null,8,[`modelValue`,`label`,`description`,`format-value`]),l(o(i),{modelValue:O.value,"onUpdate:modelValue":n[2]||=e=>O.value=e,label:o(y)(`settings.pages.providers.provider.common.fields.field.speed.label`),description:o(y)(`settings.pages.providers.provider.common.fields.field.speed.description`),min:.5,max:2,step:.01},null,8,[`modelValue`,`label`,`description`]),l(o(i),{modelValue:k.value,"onUpdate:modelValue":n[3]||=e=>k.value=e,label:o(y)(`settings.pages.providers.provider.common.fields.field.volume.label`),description:o(y)(`settings.pages.providers.provider.common.fields.field.volume.description`),min:-100,max:100,step:1,"format-value":e=>`${e}%`},null,8,[`modelValue`,`label`,`description`,`format-value`])])]),playground:m(()=>[l(o(t),{"available-voices":M.value,"generate-speech":N,"api-key-configured":j.value,"default-text":`Hello! This is a test of the Microsoft Speech synthesis.`},null,8,[`available-voices`,`api-key-configured`])]),_:1}))}});typeof y==`function`&&y(C);var w=C;export{w as default}; \ No newline at end of file diff --git a/assets/mistral-ai-C6OsPDG6.js b/assets/mistral-ai-C6OsPDG6.js deleted file mode 100644 index 4f2d3c82004b2f902a5327f95a1a76bf06785b7d..0000000000000000000000000000000000000000 --- a/assets/mistral-ai-C6OsPDG6.js +++ /dev/null @@ -1 +0,0 @@ -import{B as e,a3 as t,a4 as n,a5 as r,a6 as i,a7 as a,a8 as o,a9 as s,aM as c,aR as l,dD as u,da as d,de as f,dg as p,di as m,dk as h,dm as g,do as _,dy as v}from"./index-Bcb2irKh.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b=`mistral-ai`;var x=g({__name:`mistral-ai`,setup(g){let{t:y}=o(),x=c(),S=e(),{providers:C}=l(S),w=d(()=>S.getProviderMetadata(b)),T=d({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=d({get:()=>C.value[b]?.baseUrl||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});h(()=>{S.initializeProvider(b),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||``}),p([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||``}});function D(){C.value[b]={...w.value?.defaultOptions}}return(e,o)=>(m(),v(u(t),{"provider-name":w.value?.localizedName,"provider-icon-color":w.value?.iconColor,"on-back":()=>u(x).back()},{default:_(()=>[f(u(n),null,{default:_(()=>[f(u(r),{title:u(y)(`settings.pages.providers.common.section.basic.title`),description:u(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:_(()=>[f(u(a),{modelValue:T.value,"onUpdate:modelValue":o[0]||=e=>T.value=e,"provider-name":w.value?.localizedName,placeholder:`mis-...`},null,8,[`modelValue`,`provider-name`])]),_:1},8,[`title`,`description`]),f(u(s),{title:u(y)(`settings.pages.providers.common.section.advanced.title`)},{default:_(()=>[f(u(i),{modelValue:E.value,"onUpdate:modelValue":o[1]||=e=>E.value=e,placeholder:`https://api.mistral.ai/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon-color`,`on-back`]))}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file diff --git a/assets/mistral-ai-D39sepT1.js b/assets/mistral-ai-D39sepT1.js new file mode 100644 index 0000000000000000000000000000000000000000..d5428cb6c4250e7ede1fdc3bc9ddd98d5ccbf006 --- /dev/null +++ b/assets/mistral-ai-D39sepT1.js @@ -0,0 +1 @@ +import{B as e,a3 as t,a4 as n,a5 as r,a6 as i,a7 as a,a8 as o,a9 as s,aM as c,aR as l,d6 as u,d8 as d,dF as f,di as p,dp as m,dt as h,dv as g,dx as _,dz as v}from"./index-TXtvn0DM.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b=`mistral-ai`;var x=u({__name:`mistral-ai`,setup(u){let{t:y}=o(),x=c(),S=e(),{providers:C}=l(S),w=m(()=>S.getProviderMetadata(b)),T=m({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=m({get:()=>C.value[b]?.baseUrl||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});v(()=>{S.initializeProvider(b),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||``}),g([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||``}});function D(){C.value[b]={...w.value?.defaultOptions}}return(e,o)=>(_(),p(f(t),{"provider-name":w.value?.localizedName,"provider-icon-color":w.value?.iconColor,"on-back":()=>f(x).back()},{default:d(()=>[h(f(n),null,{default:d(()=>[h(f(r),{title:f(y)(`settings.pages.providers.common.section.basic.title`),description:f(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:d(()=>[h(f(a),{modelValue:T.value,"onUpdate:modelValue":o[0]||=e=>T.value=e,"provider-name":w.value?.localizedName,placeholder:`mis-...`},null,8,[`modelValue`,`provider-name`])]),_:1},8,[`title`,`description`]),h(f(s),{title:f(y)(`settings.pages.providers.common.section.advanced.title`)},{default:d(()=>[h(f(i),{modelValue:E.value,"onUpdate:modelValue":o[1]||=e=>E.value=e,placeholder:`https://api.mistral.ai/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon-color`,`on-back`]))}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file diff --git a/assets/models-CGf69gF5.js b/assets/models-CGf69gF5.js new file mode 100644 index 0000000000000000000000000000000000000000..3af9c8ea3a0038fd9cc26804923a2eb4d8898b27 --- /dev/null +++ b/assets/models-CGf69gF5.js @@ -0,0 +1 @@ +import{a8 as e,aC as t,aE as n,aR as r,aU as i,aW as a,af as o,am as s,at as c,aw as l,az as u,b as d,c$ as f,d6 as p,d7 as m,d8 as h,d9 as g,dF as _,dI as v,dK as y,dN as b,dO as x,dU as S,de as C,df as w,di as T,dl as E,do as D,dt as O,dv as k,dw as A,dx as j,dy as M,s as N,t as P,u as ee}from"./index-TXtvn0DM.js";import"./import-url-browser-CzbE4_30.js";import"./duckdb-mvp-1eM9E9sB.js";import{b as F}from"./route-block-DVyt-3Cw.js";import{c as I,d as L,e as R,g as z}from"./Scenes-D6JBpdgW.js";import{b as B}from"./browser-CJhr0Svl.js";import{b as V}from"./IconAnimation-Cx_ji59L.js";import{b as H}from"./icon-animation-Tj7r0tub.js";var te=S(R()),ne=S(z());const re={flex:``,"items-center":``,"gap-2":``},ie={"font-medium":``,"font-mono":``},U={flex:``,"gap-2":``},W=[`onUpdate:modelValue`],G=[`href`,`download`],K={flex:``,"items-center":``},q={flex:``,"items-center":``},J={flex:``,"items-center":``};var Y=p({__name:`Live2D`,props:{palette:{}},emits:[`extractColorsFromModel`,`switchToVRM`],setup(u){let{t:p}=e(),S=i({accept:`application/zip`}),A=ee(),{modelFile:N,motionMap:P,loadSource:F,loadingModel:I,availableMotions:L,modelUrl:R,currentMotion:z,scale:B,position:V}=r(A),H=y(R.value);S.onChange(e=>{e&&e.length>0&&(P.value={},N.value=e[0],F.value=`file`,I.value=!0)}),k(I,e=>{e||F.value===`file`&&L.value.forEach(e=>{e.motionName in t?P.value[e.fileName]=e.motionName:P.value[e.fileName]=n})});async function Y(e,t){if(!Object.keys(t).length)return e;let n=new te.default,r=await n.loadAsync(e),i=Object.keys(r.files).find(e=>e.endsWith(`model3.json`));if(!i)throw Error(`model3.json not found`);let a=await r.file(i).async(`string`),o=JSON.parse(a),s={};Object.entries(t).forEach(([e,t])=>{if(s[t]){s[t].push({File:e});return}s[t]=[{File:e}]}),o.FileReferences.Motions=s,r.file(i,JSON.stringify(o,null,2));let c=await r.generateAsync({type:`blob`});return new File([c],e.name,{type:e.type,lastModified:e.lastModified})}async function X(){let e=await ne.default.getItem(`live2dModel`);if(!e)return;let t=await Y(e,P.value);N.value=t,F.value=`file`,I.value=!0}let Z=a(N);return(e,n)=>(j(),g(D,null,[O(_(s),{title:_(p)(`settings.live2d.switch-to-vrm.title`),icon:`i-solar:magic-stick-3-bold-duotone`,class:x([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`])},{default:h(()=>[O(_(o),{variant:`secondary`,onClick:n[0]||=t=>e.$emit(`switchToVRM`)},{default:h(()=>[M(b(_(p)(`settings.live2d.switch-to-vrm.change-to-vrm`)),1)]),_:1})]),_:1},8,[`title`]),O(_(s),{title:_(p)(`settings.live2d.change-model.title`),icon:`i-solar:magic-stick-3-bold-duotone`,"inner-class":`text-sm`,class:x([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`])},{default:h(()=>[O(_(o),{variant:`secondary`,onClick:n[1]||=e=>_(S).open()},{default:h(()=>[M(b(_(p)(`settings.live2d.change-model.from-file`))+`... `,1)]),_:1}),C(`div`,re,[O(_(l),{modelValue:H.value,"onUpdate:modelValue":n[2]||=e=>H.value=e,disabled:_(I),class:`flex-1`,placeholder:_(p)(`settings.live2d.change-model.from-url-placeholder`)},null,8,[`modelValue`,`disabled`,`placeholder`]),O(_(o),{size:`sm`,variant:`secondary`,onClick:n[3]||=e=>R.value=H.value},{default:h(()=>[M(b(_(p)(`settings.live2d.change-model.from-url`)),1)]),_:1})])]),_:1},8,[`title`]),O(_(s),{title:_(p)(`settings.live2d.theme-color-from-model.title`),icon:`i-solar:magic-stick-3-bold-duotone`,"inner-class":`text-sm`,class:x([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`])},{default:h(()=>[O(_(d),{class:`mb-4 mt-2`,colors:e.palette.map(e=>({hex:e,name:e})),"mx-auto":``},null,8,[`colors`]),O(_(o),{variant:`secondary`,onClick:n[4]||=t=>e.$emit(`extractColorsFromModel`)},{default:h(()=>[M(b(_(p)(`settings.live2d.theme-color-from-model.button-extract.title`)),1)]),_:1})]),_:1},8,[`title`]),_(F)===`file`?(j(),T(_(s),{key:0,title:_(p)(`settings.live2d.edit-motion-map.title`),icon:`i-solar:face-scan-circle-bold-duotone`,class:x([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`])},{default:h(()=>[(j(!0),g(D,null,w(_(L),e=>(j(),g(`div`,{key:e.fileName,flex:``,"items-center":``,"justify-between":``,"text-sm":``},[C(`span`,ie,b(e.fileName),1),C(`div`,U,[E(C(`select`,{"onUpdate:modelValue":t=>_(P)[e.fileName]=t},[(j(!0),g(D,null,w(Object.keys(_(t)),e=>(j(),g(`option`,{key:e},b(e),1))),128))],8,W),[[f,_(P)[e.fileName]]]),O(_(o),{class:`form-control`,onClick:t=>z.value={group:e.motionName,index:e.motionIndex}},{default:h(()=>n[11]||=[M(` Play `)]),_:2,__:[11]},1032,[`onClick`])])]))),128)),O(_(o),{onClick:X},{default:h(()=>n[12]||=[M(` Save and patch `)]),_:1,__:[12]}),C(`a`,{"mt-2":``,block:``,href:_(Z),download:`${_(N)?.name||`live2d`}-motion-edited.zip`},[O(_(o),{"w-full":``},{default:h(()=>n[13]||=[M(`Export`)]),_:1,__:[13]})],8,G)]),_:1},8,[`title`])):m(``,!0),O(_(s),{title:_(p)(`settings.live2d.scale-and-position.title`),icon:`i-solar:scale-bold-duotone`,class:x([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`])},{default:h(()=>[O(_(c),{modelValue:_(B),"onUpdate:modelValue":n[6]||=e=>v(B)?B.value=e:null,as:`div`,min:.5,max:2,step:.01,label:_(p)(`settings.live2d.scale-and-position.scale`)},{label:h(()=>[C(`div`,K,[C(`div`,null,b(_(p)(`settings.live2d.scale-and-position.scale`)),1),C(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:n[5]||=()=>B.value=1},n[14]||=[C(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)])])]),_:1},8,[`modelValue`,`label`]),O(_(c),{modelValue:_(V).x,"onUpdate:modelValue":n[8]||=e=>_(V).x=e,as:`div`,min:-100,max:100,step:1,label:_(p)(`settings.live2d.scale-and-position.x`)},{label:h(()=>[C(`div`,q,[C(`div`,null,b(_(p)(`settings.live2d.scale-and-position.x`)),1),C(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:n[7]||=()=>_(V).x=0},n[15]||=[C(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)])])]),_:1},8,[`modelValue`,`label`]),O(_(c),{modelValue:_(V).y,"onUpdate:modelValue":n[10]||=e=>_(V).y=e,as:`div`,min:-100,max:100,step:1,label:_(p)(`settings.live2d.scale-and-position.y`)},{label:h(()=>[C(`div`,J,[C(`div`,null,b(_(p)(`settings.live2d.scale-and-position.y`)),1),C(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:n[9]||=()=>_(V).y=0},n[16]||=[C(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)])])]),_:1},8,[`modelValue`,`label`])]),_:1},8,[`title`])],64))}}),X=Y;const Z={class:`text-sm text-neutral-600 space-y-1`},ae={class:`flex justify-between`},oe={class:`flex justify-between`},se={class:`flex justify-between`},ce={class:`text-sm text-neutral-600 space-y-1`},le={flex:``,"items-center":``},ue={flex:``,"items-center":``},de={flex:``,"items-center":``},fe={flex:``,"items-center":``},pe={flex:``,"items-center":``,"gap-2":``};var me=p({__name:`VRM`,props:{palette:{}},emits:[`extractColorsFromModel`,`switchToLive2D`],setup(t){let{t:n}=e(),a=i({accept:`.vrm`}),f=N(),{modelFile:p,loadSource:m,loadingModel:S,modelUrl:w,scale:T,modelSize:E,modelOffset:k}=r(f),A=y(w.value);return a.onChange(e=>{e&&e.length>0&&(p.value=e[0],m.value=`file`,S.value=!0)}),(e,t)=>(j(),g(D,null,[O(_(s),{title:_(n)(`settings.vrm.switch-to-vrm.title`),icon:`i-solar:magic-stick-3-bold-duotone`,class:x([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`])},{default:h(()=>[O(_(o),{variant:`secondary`,onClick:t[0]||=t=>e.$emit(`switchToLive2D`)},{default:h(()=>[M(b(_(n)(`settings.vrm.switch-to-vrm.change-to-vrm`)),1)]),_:1})]),_:1},8,[`title`]),O(_(s),{title:_(n)(`settings.vrm.scale-and-position.title`),icon:`i-solar:scale-bold-duotone`,class:x([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`])},{default:h(()=>[O(_(u),{label:_(n)(`settings.vrm.scale-and-position.model-info-title`),"w-full":``},{default:h(()=>[C(`div`,null,[C(`div`,Z,[C(`div`,ae,[C(`span`,null,b(_(n)(`settings.vrm.scale-and-position.model-info-x`)),1),C(`span`,null,b(_(E).x.toFixed(4)),1)]),C(`div`,oe,[C(`span`,null,b(_(n)(`settings.vrm.scale-and-position.model-info-y`)),1),C(`span`,null,b(_(E).y.toFixed(4)),1)]),C(`div`,se,[C(`span`,null,b(_(n)(`settings.vrm.scale-and-position.model-info-z`)),1),C(`span`,null,b(_(E).z.toFixed(4)),1)])])])]),_:1},8,[`label`]),O(_(u),{theme:`lime`,label:`Tips!`,"w-full":``},{default:h(()=>[C(`div`,ce,b(_(n)(`settings.vrm.scale-and-position.tips`)),1)]),_:1}),O(_(c),{modelValue:_(T),"onUpdate:modelValue":t[2]||=e=>v(T)?T.value=e:null,as:`div`,min:0,max:5,step:_(T)/100,label:_(n)(`settings.vrm.scale-and-position.x`),"format-value":e=>e.toFixed(4)},{label:h(()=>[C(`div`,le,[C(`div`,null,b(_(n)(`settings.vrm.scale-and-position.scale`)),1),C(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:t[1]||=()=>T.value=1},t[13]||=[C(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)])])]),_:1},8,[`modelValue`,`step`,`label`,`format-value`]),O(_(c),{modelValue:_(k).x,"onUpdate:modelValue":t[4]||=e=>_(k).x=e,as:`div`,min:-_(E).x-10,max:_(E).x+10,step:_(E).x/100,label:_(n)(`settings.vrm.scale-and-position.x`),"format-value":e=>e.toFixed(4)},{label:h(()=>[C(`div`,ue,[C(`div`,null,b(_(n)(`settings.vrm.scale-and-position.x`)),1),C(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:t[3]||=()=>_(k).x=0},t[14]||=[C(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)])])]),_:1},8,[`modelValue`,`min`,`max`,`step`,`label`,`format-value`]),O(_(c),{modelValue:_(k).y,"onUpdate:modelValue":t[6]||=e=>_(k).y=e,as:`div`,min:-_(E).y-10,max:_(E).y+10,step:_(E).y/100,label:_(n)(`settings.vrm.scale-and-position.y`),"format-value":e=>e.toFixed(4)},{label:h(()=>[C(`div`,de,[C(`div`,null,b(_(n)(`settings.vrm.scale-and-position.y`)),1),C(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:t[5]||=()=>_(k).y=0},t[15]||=[C(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)])])]),_:1},8,[`modelValue`,`min`,`max`,`step`,`label`,`format-value`]),O(_(c),{modelValue:_(k).z,"onUpdate:modelValue":t[8]||=e=>_(k).z=e,as:`div`,min:-_(E).z-10,max:_(E).z+10,step:_(E).z/100,label:_(n)(`settings.vrm.scale-and-position.z`),"format-value":e=>e.toFixed(4)},{label:h(()=>[C(`div`,fe,[C(`div`,null,b(_(n)(`settings.vrm.scale-and-position.z`)),1),C(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:t[7]||=()=>_(k).z=0},t[16]||=[C(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)])])]),_:1},8,[`modelValue`,`min`,`max`,`step`,`label`,`format-value`])]),_:1},8,[`title`]),O(_(s),{title:_(n)(`settings.vrm.change-model.title`),icon:`i-solar:magic-stick-3-bold-duotone`,"inner-class":`text-sm`,class:x([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`])},{default:h(()=>[O(_(o),{variant:`secondary`,onClick:t[9]||=e=>_(a).open()},{default:h(()=>[M(b(_(n)(`settings.vrm.change-model.from-file`))+`... `,1)]),_:1}),C(`div`,pe,[O(_(l),{modelValue:A.value,"onUpdate:modelValue":t[10]||=e=>A.value=e,disabled:_(S),class:`flex-1`,placeholder:_(n)(`settings.vrm.change-model.from-url-placeholder`)},null,8,[`modelValue`,`disabled`,`placeholder`]),O(_(o),{size:`sm`,variant:`secondary`,onClick:t[11]||=()=>{w.value=A.value,m.value=`url`,S.value=!0}},{default:h(()=>[M(b(_(n)(`settings.vrm.change-model.from-url`)),1)]),_:1})])]),_:1},8,[`title`]),O(_(s),{title:_(n)(`settings.vrm.theme-color-from-model.title`),icon:`i-solar:magic-stick-3-bold-duotone`,"inner-class":`text-sm`,class:x([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`])},{default:h(()=>[O(_(d),{class:`mb-4 mt-2`,colors:e.palette.map(e=>({hex:e,name:e})),"mx-auto":``},null,8,[`colors`]),O(_(o),{variant:`secondary`,onClick:t[12]||=t=>e.$emit(`extractColorsFromModel`)},{default:h(()=>[M(b(_(n)(`settings.vrm.theme-color-from-model.button-extract.title`)),1)]),_:1})]),_:1},8,[`title`])],64))}}),he=me;const Q={"h-full":``,"w-full":``,"p-2":``};var ge=p({__name:`index`,props:{palette:{},live2dSceneClass:{},live2dSettingsClass:{},vrmSceneClass:{},vrmSettingsClass:{}},emits:[`extractColorsFromModel`],setup(e){let t=e,{stageView:n}=r(P());return(e,r)=>(j(),g(D,null,[_(n)===`2d`?(j(),g(D,{key:0},[C(`div`,{class:x([...t.live2dSceneClass?typeof t.live2dSceneClass==`string`?[t.live2dSceneClass]:t.live2dSceneClass:[]])},[O(L)],2),C(`div`,{flex:`~ col gap-2`,class:x([...t.live2dSettingsClass?typeof t.live2dSettingsClass==`string`?[t.live2dSettingsClass]:t.live2dSettingsClass:[]])},[O(X,{palette:e.palette,onExtractColorsFromModel:r[0]||=t=>e.$emit(`extractColorsFromModel`),onSwitchToVRM:r[1]||=e=>n.value=`3d`},null,8,[`palette`])],2)],64)):m(``,!0),_(n)===`3d`?(j(),g(D,{key:1},[C(`div`,{class:x([...t.vrmSceneClass?typeof t.vrmSceneClass==`string`?[t.vrmSceneClass]:t.vrmSceneClass:[]])},[O(I)],2),C(`div`,Q,[C(`div`,{flex:`~ col gap-2`,class:x([...t.vrmSettingsClass?typeof t.vrmSettingsClass==`string`?[t.vrmSettingsClass]:t.vrmSettingsClass:[]])},[O(he,{palette:e.palette,onExtractColorsFromModel:r[2]||=t=>e.$emit(`extractColorsFromModel`),onSwitchToLive2D:r[3]||=e=>n.value=`2d`},null,8,[`palette`])],2)])],64)):m(``,!0)],64))}}),_e=ge;const ve={flex:``,class:`relative h-full flex-col-reverse md:flex-row`},ye={key:1,text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-15rem)]`,"bottom-0":``,"right--5":``,"z--1":``,initial:{scale:.9,opacity:0,y:15},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``};var $=p({__name:`index`,setup(e){let t=y(),n=y([]);async function r(){if(!t.value)return;let e=await t.value.captureFrame();if(!e){console.error(`No frame captured`);return}let r=URL.createObjectURL(e);try{let e=new B(r),t=await e.getPalette();n.value=Object.values(t).map(e=>e?.hex).filter(e=>typeof e==`string`)}finally{URL.revokeObjectURL(r)}}let{iconAnimationStarted:i,showIconAnimation:a,animationIcon:o}=H(`i-solar:people-nearby-bold-duotone`);return(e,t)=>{let s=A(`motion`);return j(),g(D,null,[C(`div`,ve,[O(_(_e),{"live-2d-scene-class":`absolute max-h-[calc(100dvh-100px-56px)] w-full h-full`,"live-2d-settings-class":`w-100% md:w-40% lg:w-30% xl:w-30% 2xl:w-30% h-fit sm:max-h-80dvh overflow-y-scroll relative`,"vrm-scene-class":`absolute max-h-[calc(100dvh-100px-56px)] w-full h-full`,"vrm-settings-class":`w-100% md:w-40% lg:w-30% xl:w-30% 2xl:w-30% h-fit sm:max-h-80dvh overflow-y-scroll relative`,palette:n.value,onExtractColorsFromModel:r},null,8,[`palette`])]),_(a)?(j(),T(V,{key:0,"z-index":-1,icon:_(o),"icon-size":12,duration:1e3,started:_(i),"is-reverse":!0,position:`calc(100dvw - 9.5rem), calc(100dvh - 9.5rem)`,"text-color":`text-neutral-200/50 dark:text-neutral-600/20`},null,8,[`icon`,`started`])):E((j(),g(`div`,ye,t[0]||=[C(`div`,{text:`60`,"i-solar:people-nearby-bold-duotone":``},null,-1)])),[[s]])],64)}}});typeof F==`function`&&F($);var be=$;export{be as default}; \ No newline at end of file diff --git a/assets/models-CxyqeYFq.js b/assets/models-CxyqeYFq.js deleted file mode 100644 index 7047457458da00687f114ed27a95579dcd941fe4..0000000000000000000000000000000000000000 --- a/assets/models-CxyqeYFq.js +++ /dev/null @@ -1 +0,0 @@ -import{a$ as e,a8 as t,aC as n,aF as r,aR as i,af as a,am as o,at as s,aw as c,az as l,b as u,b1 as d,c_ as f,d6 as p,d9 as m,dD as h,dG as g,dI as _,dN as v,dO as y,dU as b,de as x,dg as S,dh as C,di as w,dj as T,dm as E,dn as D,do as O,dp as k,du as A,dv as j,dy as M,s as N,t as P,u as ee}from"./index-Bcb2irKh.js";import"./import-url-browser-CzbE4_30.js";import"./duckdb-mvp-1eM9E9sB.js";import{b as F}from"./route-block-DVyt-3Cw.js";import{c as I,d as L,e as R,g as z}from"./Scenes-ELpQ5xkP.js";import{b as B}from"./browser-CJhr0Svl.js";import{b as V}from"./IconAnimation-BSHXCi3V.js";import{b as H}from"./icon-animation-aqma-gkh.js";var te=b(R()),ne=b(z());const re={flex:``,"items-center":``,"gap-2":``},ie={"font-medium":``,"font-mono":``},U={flex:``,"gap-2":``},W=[`onUpdate:modelValue`],G=[`href`,`download`],K={flex:``,"items-center":``},q={flex:``,"items-center":``},J={flex:``,"items-center":``};var Y=E({__name:`Live2D`,props:{palette:{}},emits:[`extractColorsFromModel`,`switchToVRM`],setup(l){let{t:b}=t(),C=e({accept:`application/zip`}),E=ee(),{modelFile:N,motionMap:P,loadSource:F,loadingModel:I,availableMotions:L,modelUrl:R,currentMotion:z,scale:B,position:V}=i(E),H=_(R.value);C.onChange(e=>{e&&e.length>0&&(P.value={},N.value=e[0],F.value=`file`,I.value=!0)}),S(I,e=>{e||F.value===`file`&&L.value.forEach(e=>{e.motionName in r?P.value[e.fileName]=e.motionName:P.value[e.fileName]=n})});async function Y(e,t){if(!Object.keys(t).length)return e;let n=new te.default,r=await n.loadAsync(e),i=Object.keys(r.files).find(e=>e.endsWith(`model3.json`));if(!i)throw Error(`model3.json not found`);let a=await r.file(i).async(`string`),o=JSON.parse(a),s={};Object.entries(t).forEach(([e,t])=>{if(s[t]){s[t].push({File:e});return}s[t]=[{File:e}]}),o.FileReferences.Motions=s,r.file(i,JSON.stringify(o,null,2));let c=await r.generateAsync({type:`blob`});return new File([c],e.name,{type:e.type,lastModified:e.lastModified})}async function X(){let e=await ne.default.getItem(`live2dModel`);if(!e)return;let t=await Y(e,P.value);N.value=t,F.value=`file`,I.value=!0}let Z=d(N);return(e,t)=>(w(),k(m,null,[x(h(o),{title:h(b)(`settings.live2d.switch-to-vrm.title`),icon:`i-solar:magic-stick-3-bold-duotone`,class:y([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`])},{default:O(()=>[x(h(a),{variant:`secondary`,onClick:t[0]||=t=>e.$emit(`switchToVRM`)},{default:O(()=>[T(v(h(b)(`settings.live2d.switch-to-vrm.change-to-vrm`)),1)]),_:1})]),_:1},8,[`title`]),x(h(o),{title:h(b)(`settings.live2d.change-model.title`),icon:`i-solar:magic-stick-3-bold-duotone`,"inner-class":`text-sm`,class:y([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`])},{default:O(()=>[x(h(a),{variant:`secondary`,onClick:t[1]||=e=>h(C).open()},{default:O(()=>[T(v(h(b)(`settings.live2d.change-model.from-file`))+`... `,1)]),_:1}),A(`div`,re,[x(h(c),{modelValue:H.value,"onUpdate:modelValue":t[2]||=e=>H.value=e,disabled:h(I),class:`flex-1`,placeholder:h(b)(`settings.live2d.change-model.from-url-placeholder`)},null,8,[`modelValue`,`disabled`,`placeholder`]),x(h(a),{size:`sm`,variant:`secondary`,onClick:t[3]||=e=>R.value=H.value},{default:O(()=>[T(v(h(b)(`settings.live2d.change-model.from-url`)),1)]),_:1})])]),_:1},8,[`title`]),x(h(o),{title:h(b)(`settings.live2d.theme-color-from-model.title`),icon:`i-solar:magic-stick-3-bold-duotone`,"inner-class":`text-sm`,class:y([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`])},{default:O(()=>[x(h(u),{class:`mb-4 mt-2`,colors:e.palette.map(e=>({hex:e,name:e})),"mx-auto":``},null,8,[`colors`]),x(h(a),{variant:`secondary`,onClick:t[4]||=t=>e.$emit(`extractColorsFromModel`)},{default:O(()=>[T(v(h(b)(`settings.live2d.theme-color-from-model.button-extract.title`)),1)]),_:1})]),_:1},8,[`title`]),h(F)===`file`?(w(),M(h(o),{key:0,title:h(b)(`settings.live2d.edit-motion-map.title`),icon:`i-solar:face-scan-circle-bold-duotone`,class:y([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`])},{default:O(()=>[(w(!0),k(m,null,j(h(L),e=>(w(),k(`div`,{key:e.fileName,flex:``,"items-center":``,"justify-between":``,"text-sm":``},[A(`span`,ie,v(e.fileName),1),A(`div`,U,[p(A(`select`,{"onUpdate:modelValue":t=>h(P)[e.fileName]=t},[(w(!0),k(m,null,j(Object.keys(h(r)),e=>(w(),k(`option`,{key:e},v(e),1))),128))],8,W),[[f,h(P)[e.fileName]]]),x(h(a),{class:`form-control`,onClick:t=>z.value={group:e.motionName,index:e.motionIndex}},{default:O(()=>t[11]||=[T(` Play `)]),_:2,__:[11]},1032,[`onClick`])])]))),128)),x(h(a),{onClick:X},{default:O(()=>t[12]||=[T(` Save and patch `)]),_:1,__:[12]}),A(`a`,{"mt-2":``,block:``,href:h(Z),download:`${h(N)?.name||`live2d`}-motion-edited.zip`},[x(h(a),{"w-full":``},{default:O(()=>t[13]||=[T(`Export`)]),_:1,__:[13]})],8,G)]),_:1},8,[`title`])):D(``,!0),x(h(o),{title:h(b)(`settings.live2d.scale-and-position.title`),icon:`i-solar:scale-bold-duotone`,class:y([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`])},{default:O(()=>[x(h(s),{modelValue:h(B),"onUpdate:modelValue":t[6]||=e=>g(B)?B.value=e:null,as:`div`,min:.5,max:2,step:.01,label:h(b)(`settings.live2d.scale-and-position.scale`)},{label:O(()=>[A(`div`,K,[A(`div`,null,v(h(b)(`settings.live2d.scale-and-position.scale`)),1),A(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:t[5]||=()=>B.value=1},t[14]||=[A(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)])])]),_:1},8,[`modelValue`,`label`]),x(h(s),{modelValue:h(V).x,"onUpdate:modelValue":t[8]||=e=>h(V).x=e,as:`div`,min:-100,max:100,step:1,label:h(b)(`settings.live2d.scale-and-position.x`)},{label:O(()=>[A(`div`,q,[A(`div`,null,v(h(b)(`settings.live2d.scale-and-position.x`)),1),A(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:t[7]||=()=>h(V).x=0},t[15]||=[A(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)])])]),_:1},8,[`modelValue`,`label`]),x(h(s),{modelValue:h(V).y,"onUpdate:modelValue":t[10]||=e=>h(V).y=e,as:`div`,min:-100,max:100,step:1,label:h(b)(`settings.live2d.scale-and-position.y`)},{label:O(()=>[A(`div`,J,[A(`div`,null,v(h(b)(`settings.live2d.scale-and-position.y`)),1),A(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:t[9]||=()=>h(V).y=0},t[16]||=[A(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)])])]),_:1},8,[`modelValue`,`label`])]),_:1},8,[`title`])],64))}}),X=Y;const Z={class:`text-sm text-neutral-600 space-y-1`},ae={class:`flex justify-between`},oe={class:`flex justify-between`},se={class:`flex justify-between`},ce={class:`text-sm text-neutral-600 space-y-1`},le={flex:``,"items-center":``},ue={flex:``,"items-center":``},de={flex:``,"items-center":``},fe={flex:``,"items-center":``},pe={flex:``,"items-center":``,"gap-2":``};var Q=E({__name:`VRM`,props:{palette:{}},emits:[`extractColorsFromModel`,`switchToLive2D`],setup(n){let{t:r}=t(),d=e({accept:`.vrm`}),f=N(),{modelFile:p,loadSource:b,loadingModel:S,modelUrl:C,scale:E,modelSize:D,modelOffset:j}=i(f),M=_(C.value);return d.onChange(e=>{e&&e.length>0&&(p.value=e[0],b.value=`file`,S.value=!0)}),(e,t)=>(w(),k(m,null,[x(h(o),{title:h(r)(`settings.vrm.switch-to-vrm.title`),icon:`i-solar:magic-stick-3-bold-duotone`,class:y([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`])},{default:O(()=>[x(h(a),{variant:`secondary`,onClick:t[0]||=t=>e.$emit(`switchToLive2D`)},{default:O(()=>[T(v(h(r)(`settings.vrm.switch-to-vrm.change-to-vrm`)),1)]),_:1})]),_:1},8,[`title`]),x(h(o),{title:h(r)(`settings.vrm.scale-and-position.title`),icon:`i-solar:scale-bold-duotone`,class:y([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`])},{default:O(()=>[x(h(l),{label:h(r)(`settings.vrm.scale-and-position.model-info-title`),"w-full":``},{default:O(()=>[A(`div`,null,[A(`div`,Z,[A(`div`,ae,[A(`span`,null,v(h(r)(`settings.vrm.scale-and-position.model-info-x`)),1),A(`span`,null,v(h(D).x.toFixed(4)),1)]),A(`div`,oe,[A(`span`,null,v(h(r)(`settings.vrm.scale-and-position.model-info-y`)),1),A(`span`,null,v(h(D).y.toFixed(4)),1)]),A(`div`,se,[A(`span`,null,v(h(r)(`settings.vrm.scale-and-position.model-info-z`)),1),A(`span`,null,v(h(D).z.toFixed(4)),1)])])])]),_:1},8,[`label`]),x(h(l),{theme:`lime`,label:`Tips!`,"w-full":``},{default:O(()=>[A(`div`,ce,v(h(r)(`settings.vrm.scale-and-position.tips`)),1)]),_:1}),x(h(s),{modelValue:h(E),"onUpdate:modelValue":t[2]||=e=>g(E)?E.value=e:null,as:`div`,min:0,max:5,step:h(E)/100,label:h(r)(`settings.vrm.scale-and-position.x`),"format-value":e=>e.toFixed(4)},{label:O(()=>[A(`div`,le,[A(`div`,null,v(h(r)(`settings.vrm.scale-and-position.scale`)),1),A(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:t[1]||=()=>E.value=1},t[13]||=[A(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)])])]),_:1},8,[`modelValue`,`step`,`label`,`format-value`]),x(h(s),{modelValue:h(j).x,"onUpdate:modelValue":t[4]||=e=>h(j).x=e,as:`div`,min:-h(D).x-10,max:h(D).x+10,step:h(D).x/100,label:h(r)(`settings.vrm.scale-and-position.x`),"format-value":e=>e.toFixed(4)},{label:O(()=>[A(`div`,ue,[A(`div`,null,v(h(r)(`settings.vrm.scale-and-position.x`)),1),A(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:t[3]||=()=>h(j).x=0},t[14]||=[A(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)])])]),_:1},8,[`modelValue`,`min`,`max`,`step`,`label`,`format-value`]),x(h(s),{modelValue:h(j).y,"onUpdate:modelValue":t[6]||=e=>h(j).y=e,as:`div`,min:-h(D).y-10,max:h(D).y+10,step:h(D).y/100,label:h(r)(`settings.vrm.scale-and-position.y`),"format-value":e=>e.toFixed(4)},{label:O(()=>[A(`div`,de,[A(`div`,null,v(h(r)(`settings.vrm.scale-and-position.y`)),1),A(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:t[5]||=()=>h(j).y=0},t[15]||=[A(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)])])]),_:1},8,[`modelValue`,`min`,`max`,`step`,`label`,`format-value`]),x(h(s),{modelValue:h(j).z,"onUpdate:modelValue":t[8]||=e=>h(j).z=e,as:`div`,min:-h(D).z-10,max:h(D).z+10,step:h(D).z/100,label:h(r)(`settings.vrm.scale-and-position.z`),"format-value":e=>e.toFixed(4)},{label:O(()=>[A(`div`,fe,[A(`div`,null,v(h(r)(`settings.vrm.scale-and-position.z`)),1),A(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:t[7]||=()=>h(j).z=0},t[16]||=[A(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)])])]),_:1},8,[`modelValue`,`min`,`max`,`step`,`label`,`format-value`])]),_:1},8,[`title`]),x(h(o),{title:h(r)(`settings.vrm.change-model.title`),icon:`i-solar:magic-stick-3-bold-duotone`,"inner-class":`text-sm`,class:y([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`])},{default:O(()=>[x(h(a),{variant:`secondary`,onClick:t[9]||=e=>h(d).open()},{default:O(()=>[T(v(h(r)(`settings.vrm.change-model.from-file`))+`... `,1)]),_:1}),A(`div`,pe,[x(h(c),{modelValue:M.value,"onUpdate:modelValue":t[10]||=e=>M.value=e,disabled:h(S),class:`flex-1`,placeholder:h(r)(`settings.vrm.change-model.from-url-placeholder`)},null,8,[`modelValue`,`disabled`,`placeholder`]),x(h(a),{size:`sm`,variant:`secondary`,onClick:t[11]||=()=>{C.value=M.value,b.value=`url`,S.value=!0}},{default:O(()=>[T(v(h(r)(`settings.vrm.change-model.from-url`)),1)]),_:1})])]),_:1},8,[`title`]),x(h(o),{title:h(r)(`settings.vrm.theme-color-from-model.title`),icon:`i-solar:magic-stick-3-bold-duotone`,"inner-class":`text-sm`,class:y([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`])},{default:O(()=>[x(h(u),{class:`mb-4 mt-2`,colors:e.palette.map(e=>({hex:e,name:e})),"mx-auto":``},null,8,[`colors`]),x(h(a),{variant:`secondary`,onClick:t[12]||=t=>e.$emit(`extractColorsFromModel`)},{default:O(()=>[T(v(h(r)(`settings.vrm.theme-color-from-model.button-extract.title`)),1)]),_:1})]),_:1},8,[`title`])],64))}}),me=Q;const he={"h-full":``,"w-full":``,"p-2":``};var ge=E({__name:`index`,props:{palette:{},live2dSceneClass:{},live2dSettingsClass:{},vrmSceneClass:{},vrmSettingsClass:{}},emits:[`extractColorsFromModel`],setup(e){let t=e,{stageView:n}=i(P());return(e,r)=>(w(),k(m,null,[h(n)===`2d`?(w(),k(m,{key:0},[A(`div`,{class:y([...t.live2dSceneClass?typeof t.live2dSceneClass==`string`?[t.live2dSceneClass]:t.live2dSceneClass:[]])},[x(L)],2),A(`div`,{flex:`~ col gap-2`,class:y([...t.live2dSettingsClass?typeof t.live2dSettingsClass==`string`?[t.live2dSettingsClass]:t.live2dSettingsClass:[]])},[x(X,{palette:e.palette,onExtractColorsFromModel:r[0]||=t=>e.$emit(`extractColorsFromModel`),onSwitchToVRM:r[1]||=e=>n.value=`3d`},null,8,[`palette`])],2)],64)):D(``,!0),h(n)===`3d`?(w(),k(m,{key:1},[A(`div`,{class:y([...t.vrmSceneClass?typeof t.vrmSceneClass==`string`?[t.vrmSceneClass]:t.vrmSceneClass:[]])},[x(I)],2),A(`div`,he,[A(`div`,{flex:`~ col gap-2`,class:y([...t.vrmSettingsClass?typeof t.vrmSettingsClass==`string`?[t.vrmSettingsClass]:t.vrmSettingsClass:[]])},[x(me,{palette:e.palette,onExtractColorsFromModel:r[2]||=t=>e.$emit(`extractColorsFromModel`),onSwitchToLive2D:r[3]||=e=>n.value=`2d`},null,8,[`palette`])],2)])],64)):D(``,!0)],64))}}),_e=ge;const ve={flex:``,class:`relative h-full flex-col-reverse md:flex-row`},ye={key:1,text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-15rem)]`,"bottom-0":``,"right--5":``,"z--1":``,initial:{scale:.9,opacity:0,y:15},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``};var $=E({__name:`index`,setup(e){let t=_(),n=_([]);async function r(){if(!t.value)return;let e=await t.value.captureFrame();if(!e){console.error(`No frame captured`);return}let r=URL.createObjectURL(e);try{let e=new B(r),t=await e.getPalette();n.value=Object.values(t).map(e=>e?.hex).filter(e=>typeof e==`string`)}finally{URL.revokeObjectURL(r)}}let{iconAnimationStarted:i,showIconAnimation:a,animationIcon:o}=H(`i-solar:people-nearby-bold-duotone`);return(e,t)=>{let s=C(`motion`);return w(),k(m,null,[A(`div`,ve,[x(h(_e),{"live-2d-scene-class":`absolute max-h-[calc(100dvh-100px-56px)] w-full h-full`,"live-2d-settings-class":`w-100% md:w-40% lg:w-30% xl:w-30% 2xl:w-30% h-fit sm:max-h-80dvh overflow-y-scroll relative`,"vrm-scene-class":`absolute max-h-[calc(100dvh-100px-56px)] w-full h-full`,"vrm-settings-class":`w-100% md:w-40% lg:w-30% xl:w-30% 2xl:w-30% h-fit sm:max-h-80dvh overflow-y-scroll relative`,palette:n.value,onExtractColorsFromModel:r},null,8,[`palette`])]),h(a)?(w(),M(V,{key:0,"z-index":-1,icon:h(o),"icon-size":12,duration:1e3,started:h(i),"is-reverse":!0,position:`calc(100dvw - 9.5rem), calc(100dvh - 9.5rem)`,"text-color":`text-neutral-200/50 dark:text-neutral-600/20`},null,8,[`icon`,`started`])):p((w(),k(`div`,ye,t[0]||=[A(`div`,{text:`60`,"i-solar:people-nearby-bold-duotone":``},null,-1)])),[[s]])],64)}}});typeof F==`function`&&F($);var be=$;export{be as default}; \ No newline at end of file diff --git a/assets/modules-C3lme1kU.js b/assets/modules-DOiXOO9v.js similarity index 77% rename from assets/modules-C3lme1kU.js rename to assets/modules-DOiXOO9v.js index 174ba96071378ec649fbb6e7a29fd7ca37e27686..480967f1613aec8be5df366f0d4ead7c561ef5e1 100644 --- a/assets/modules-C3lme1kU.js +++ b/assets/modules-DOiXOO9v.js @@ -1 +1 @@ -import{A as e,a8 as t,ak as n,d6 as r,d9 as i,dD as a,da as o,dh as s,di as c,dm as l,dp as u,du as d,dv as f,dy as p,y as m}from"./index-Bcb2irKh.js";import{b as h}from"./route-block-DVyt-3Cw.js";import{b as g}from"./IconAnimation-BSHXCi3V.js";import{b as _}from"./icon-animation-aqma-gkh.js";const v={grid:`~ cols-1 sm:cols-2 gap-4`},y={key:1,text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-15rem)]`,"bottom-0":``,"right--5":``,"z--1":``,initial:{scale:.9,opacity:0,y:20},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``};var b=l({__name:`index`,setup(l){let{t:h}=t(),b=o(()=>[{id:`consciousness`,name:h(`settings.pages.modules.consciousness.title`),description:h(`settings.pages.modules.consciousness.description`),icon:`i-solar:ghost-bold-duotone`,to:`/settings/modules/consciousness`,configured:e().configured},{id:`speech`,name:h(`settings.pages.modules.speech.title`),description:h(`settings.pages.modules.speech.description`),icon:`i-solar:user-speak-rounded-bold-duotone`,to:`/settings/modules/speech`,configured:m().configured},{id:`hearing`,name:h(`settings.pages.modules.hearing.title`),description:h(`settings.pages.modules.hearing.description`),icon:`i-solar:microphone-3-bold-duotone`,to:`/settings/modules/hearing`,configured:!1},{id:`vision`,name:h(`settings.pages.modules.vision.title`),description:h(`settings.pages.modules.vision.description`),icon:`i-solar:eye-closed-bold-duotone`,to:``,configured:!1},{id:`memory-short-term`,name:h(`settings.pages.modules.memory-short-term.title`),description:h(`settings.pages.modules.memory-short-term.description`),icon:`i-solar:bookmark-bold-duotone`,to:`/settings/modules/memory-short-term`,configured:!1},{id:`memory-long-term`,name:h(`settings.pages.modules.memory-long-term.title`),description:h(`settings.pages.modules.memory-long-term.description`),icon:`i-solar:book-bookmark-bold-duotone`,to:`/settings/modules/memory-long-term`,configured:!1},{id:`messaging-discord`,name:h(`settings.pages.modules.messaging-discord.title`),description:h(`settings.pages.modules.messaging-discord.description`),icon:`i-simple-icons:discord`,to:``,configured:!1},{id:`x`,name:h(`settings.pages.modules.x.title`),description:h(`settings.pages.modules.x.description`),icon:`i-simple-icons:x`,to:``,configured:!1},{id:`game-minecraft`,name:h(`settings.pages.modules.gaming-minecraft.title`),description:h(`settings.pages.modules.gaming-minecraft.description`),iconColor:`i-vscode-icons:file-type-minecraft`,to:``,configured:!1},{id:`game-factorio`,name:h(`settings.pages.modules.gaming-factorio.title`),description:h(`settings.pages.modules.gaming-factorio.description`),iconImage:``,to:``,configured:!1}]),{iconAnimationStarted:x,showIconAnimation:S,animationIcon:C}=_(`i-solar:layers-bold-duotone`);return(e,t)=>{let o=s(`motion`);return c(),u(i,null,[d(`div`,v,[(c(!0),u(i,null,f(b.value,(e,t)=>r((c(),p(a(n),{key:e.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+t*10,delay:t*50,title:e.name,description:e.description,icon:e.icon,"icon-color":e.iconColor,"icon-image":e.iconImage,to:e.to,configured:e.configured},null,8,[`duration`,`delay`,`title`,`description`,`icon`,`icon-color`,`icon-image`,`to`,`configured`])),[[o]])),128))]),a(S)?(c(),p(g,{key:0,icon:a(C),"icon-size":12,duration:1e3,started:a(x),"is-reverse":!0,"z-index":-1,"text-color":`text-neutral-200/50 dark:text-neutral-600/20`,position:`calc(100dvw - 9.5rem), calc(100dvh - 9.5rem)`},null,8,[`icon`,`started`])):r((c(),u(`div`,y,t[0]||=[d(`div`,{text:`60`,"i-solar:layers-bold-duotone":``},null,-1)])),[[o]])],64)}}});typeof h==`function`&&h(b);var x=b;export{x as default}; \ No newline at end of file +import{A as e,a8 as t,ak as n,d6 as r,d9 as i,dF as a,de as o,df as s,di as c,dl as l,do as u,dp as d,dw as f,dx as p,y as m}from"./index-TXtvn0DM.js";import{b as h}from"./route-block-DVyt-3Cw.js";import{b as g}from"./IconAnimation-Cx_ji59L.js";import{b as _}from"./icon-animation-Tj7r0tub.js";const v={grid:`~ cols-1 sm:cols-2 gap-4`},y={key:1,text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-15rem)]`,"bottom-0":``,"right--5":``,"z--1":``,initial:{scale:.9,opacity:0,y:20},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``};var b=r({__name:`index`,setup(r){let{t:h}=t(),b=d(()=>[{id:`consciousness`,name:h(`settings.pages.modules.consciousness.title`),description:h(`settings.pages.modules.consciousness.description`),icon:`i-solar:ghost-bold-duotone`,to:`/settings/modules/consciousness`,configured:e().configured},{id:`speech`,name:h(`settings.pages.modules.speech.title`),description:h(`settings.pages.modules.speech.description`),icon:`i-solar:user-speak-rounded-bold-duotone`,to:`/settings/modules/speech`,configured:m().configured},{id:`hearing`,name:h(`settings.pages.modules.hearing.title`),description:h(`settings.pages.modules.hearing.description`),icon:`i-solar:microphone-3-bold-duotone`,to:`/settings/modules/hearing`,configured:!1},{id:`vision`,name:h(`settings.pages.modules.vision.title`),description:h(`settings.pages.modules.vision.description`),icon:`i-solar:eye-closed-bold-duotone`,to:``,configured:!1},{id:`memory-short-term`,name:h(`settings.pages.modules.memory-short-term.title`),description:h(`settings.pages.modules.memory-short-term.description`),icon:`i-solar:bookmark-bold-duotone`,to:`/settings/modules/memory-short-term`,configured:!1},{id:`memory-long-term`,name:h(`settings.pages.modules.memory-long-term.title`),description:h(`settings.pages.modules.memory-long-term.description`),icon:`i-solar:book-bookmark-bold-duotone`,to:`/settings/modules/memory-long-term`,configured:!1},{id:`messaging-discord`,name:h(`settings.pages.modules.messaging-discord.title`),description:h(`settings.pages.modules.messaging-discord.description`),icon:`i-simple-icons:discord`,to:``,configured:!1},{id:`x`,name:h(`settings.pages.modules.x.title`),description:h(`settings.pages.modules.x.description`),icon:`i-simple-icons:x`,to:``,configured:!1},{id:`game-minecraft`,name:h(`settings.pages.modules.gaming-minecraft.title`),description:h(`settings.pages.modules.gaming-minecraft.description`),iconColor:`i-vscode-icons:file-type-minecraft`,to:``,configured:!1},{id:`game-factorio`,name:h(`settings.pages.modules.gaming-factorio.title`),description:h(`settings.pages.modules.gaming-factorio.description`),iconImage:``,to:``,configured:!1}]),{iconAnimationStarted:x,showIconAnimation:S,animationIcon:C}=_(`i-solar:layers-bold-duotone`);return(e,t)=>{let r=f(`motion`);return p(),i(u,null,[o(`div`,v,[(p(!0),i(u,null,s(b.value,(e,t)=>l((p(),c(a(n),{key:e.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+t*10,delay:t*50,title:e.name,description:e.description,icon:e.icon,"icon-color":e.iconColor,"icon-image":e.iconImage,to:e.to,configured:e.configured},null,8,[`duration`,`delay`,`title`,`description`,`icon`,`icon-color`,`icon-image`,`to`,`configured`])),[[r]])),128))]),a(S)?(p(),c(g,{key:0,icon:a(C),"icon-size":12,duration:1e3,started:a(x),"is-reverse":!0,"z-index":-1,"text-color":`text-neutral-200/50 dark:text-neutral-600/20`,position:`calc(100dvw - 9.5rem), calc(100dvh - 9.5rem)`},null,8,[`icon`,`started`])):l((p(),i(`div`,y,t[0]||=[o(`div`,{text:`60`,"i-solar:layers-bold-duotone":``},null,-1)])),[[r]])],64)}}});typeof h==`function`&&h(b);var x=b;export{x as default}; \ No newline at end of file diff --git a/assets/moonshot-ai-CTozCMSf.js b/assets/moonshot-ai-CTozCMSf.js new file mode 100644 index 0000000000000000000000000000000000000000..58d1781160c92dd394df15edea0c7e307a602d2f --- /dev/null +++ b/assets/moonshot-ai-CTozCMSf.js @@ -0,0 +1 @@ +import{B as e,a3 as t,a4 as n,a5 as r,a6 as i,a7 as a,a8 as o,a9 as s,aM as c,aR as l,d6 as u,d8 as d,dF as f,di as p,dp as m,dt as h,dv as g,dx as _,dz as v}from"./index-TXtvn0DM.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b=`moonshot-ai`;var x=u({__name:`moonshot-ai`,setup(u){let{t:y}=o(),x=c(),S=e(),{providers:C}=l(S),w=m(()=>S.getProviderMetadata(b)),T=m({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=m({get:()=>C.value[b]?.baseUrl||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});v(()=>{S.initializeProvider(b),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||``}),g([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||``}});function D(){C.value[b]={...w.value?.defaultOptions}}return(e,o)=>(_(),p(f(t),{"provider-name":w.value?.localizedName,"provider-icon":w.value?.icon,"on-back":()=>f(x).back()},{default:d(()=>[h(f(n),null,{default:d(()=>[h(f(r),{title:f(y)(`settings.pages.providers.common.section.basic.title`),description:f(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:d(()=>[h(f(a),{modelValue:T.value,"onUpdate:modelValue":o[0]||=e=>T.value=e,"provider-name":w.value?.localizedName,placeholder:`ms-...`},null,8,[`modelValue`,`provider-name`])]),_:1},8,[`title`,`description`]),h(f(s),{title:f(y)(`settings.pages.providers.common.section.advanced.title`)},{default:d(()=>[h(f(i),{modelValue:E.value,"onUpdate:modelValue":o[1]||=e=>E.value=e,placeholder:`https://api.moonshot.cn/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`]))}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file diff --git a/assets/moonshot-ai-Cq0Bgk3R.js b/assets/moonshot-ai-Cq0Bgk3R.js deleted file mode 100644 index 37a2433c3c92cd49e98f8aa8ca3bbc6962fd9b9f..0000000000000000000000000000000000000000 --- a/assets/moonshot-ai-Cq0Bgk3R.js +++ /dev/null @@ -1 +0,0 @@ -import{B as e,a3 as t,a4 as n,a5 as r,a6 as i,a7 as a,a8 as o,a9 as s,aM as c,aR as l,dD as u,da as d,de as f,dg as p,di as m,dk as h,dm as g,do as _,dy as v}from"./index-Bcb2irKh.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b=`moonshot-ai`;var x=g({__name:`moonshot-ai`,setup(g){let{t:y}=o(),x=c(),S=e(),{providers:C}=l(S),w=d(()=>S.getProviderMetadata(b)),T=d({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=d({get:()=>C.value[b]?.baseUrl||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});h(()=>{S.initializeProvider(b),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||``}),p([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||``}});function D(){C.value[b]={...w.value?.defaultOptions}}return(e,o)=>(m(),v(u(t),{"provider-name":w.value?.localizedName,"provider-icon":w.value?.icon,"on-back":()=>u(x).back()},{default:_(()=>[f(u(n),null,{default:_(()=>[f(u(r),{title:u(y)(`settings.pages.providers.common.section.basic.title`),description:u(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:_(()=>[f(u(a),{modelValue:T.value,"onUpdate:modelValue":o[0]||=e=>T.value=e,"provider-name":w.value?.localizedName,placeholder:`ms-...`},null,8,[`modelValue`,`provider-name`])]),_:1},8,[`title`,`description`]),f(u(s),{title:u(y)(`settings.pages.providers.common.section.advanced.title`)},{default:_(()=>[f(u(i),{modelValue:E.value,"onUpdate:modelValue":o[1]||=e=>E.value=e,placeholder:`https://api.moonshot.cn/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`]))}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file diff --git a/assets/novita-ai-BOoelGDv.js b/assets/novita-ai-BOoelGDv.js deleted file mode 100644 index 91d52eaa430c1e5b7185c074bcf6db77b51ffea6..0000000000000000000000000000000000000000 --- a/assets/novita-ai-BOoelGDv.js +++ /dev/null @@ -1 +0,0 @@ -import{B as e,a3 as t,a4 as n,a5 as r,a6 as i,a7 as a,a8 as o,a9 as s,aM as c,aR as l,dD as u,da as d,de as f,dg as p,di as m,dk as h,dm as g,do as _,dy as v}from"./index-Bcb2irKh.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b=`novita-ai`;var x=g({__name:`novita-ai`,setup(g){let{t:y}=o(),x=c(),S=e(),{providers:C}=l(S),w=d(()=>S.getProviderMetadata(b)),T=d({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=d({get:()=>C.value[b]?.baseUrl||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});h(()=>{S.initializeProvider(b),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||``}),p([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||``}});function D(){C.value[b]={...w.value?.defaultOptions}}return(e,o)=>(m(),v(u(t),{"provider-name":w.value?.localizedName,"provider-icon-color":w.value?.iconColor,"on-back":()=>u(x).back()},{default:_(()=>[f(u(n),null,{default:_(()=>[f(u(r),{title:u(y)(`settings.pages.providers.common.section.basic.title`),description:u(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:_(()=>[f(u(a),{modelValue:T.value,"onUpdate:modelValue":o[0]||=e=>T.value=e,"provider-name":w.value?.localizedName,placeholder:`nvt-...`},null,8,[`modelValue`,`provider-name`])]),_:1},8,[`title`,`description`]),f(u(s),{title:u(y)(`settings.pages.providers.common.section.advanced.title`)},{default:_(()=>[f(u(i),{modelValue:E.value,"onUpdate:modelValue":o[1]||=e=>E.value=e,placeholder:`https://api.novita.ai/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon-color`,`on-back`]))}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file diff --git a/assets/novita-ai-dw27Ts63.js b/assets/novita-ai-dw27Ts63.js new file mode 100644 index 0000000000000000000000000000000000000000..6a3ad64343b0bd270a85dae24d71bc625f2ccb7b --- /dev/null +++ b/assets/novita-ai-dw27Ts63.js @@ -0,0 +1 @@ +import{B as e,a3 as t,a4 as n,a5 as r,a6 as i,a7 as a,a8 as o,a9 as s,aM as c,aR as l,d6 as u,d8 as d,dF as f,di as p,dp as m,dt as h,dv as g,dx as _,dz as v}from"./index-TXtvn0DM.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b=`novita-ai`;var x=u({__name:`novita-ai`,setup(u){let{t:y}=o(),x=c(),S=e(),{providers:C}=l(S),w=m(()=>S.getProviderMetadata(b)),T=m({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=m({get:()=>C.value[b]?.baseUrl||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});v(()=>{S.initializeProvider(b),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||``}),g([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||``}});function D(){C.value[b]={...w.value?.defaultOptions}}return(e,o)=>(_(),p(f(t),{"provider-name":w.value?.localizedName,"provider-icon-color":w.value?.iconColor,"on-back":()=>f(x).back()},{default:d(()=>[h(f(n),null,{default:d(()=>[h(f(r),{title:f(y)(`settings.pages.providers.common.section.basic.title`),description:f(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:d(()=>[h(f(a),{modelValue:T.value,"onUpdate:modelValue":o[0]||=e=>T.value=e,"provider-name":w.value?.localizedName,placeholder:`nvt-...`},null,8,[`modelValue`,`provider-name`])]),_:1},8,[`title`,`description`]),h(f(s),{title:f(y)(`settings.pages.providers.common.section.advanced.title`)},{default:d(()=>[h(f(i),{modelValue:E.value,"onUpdate:modelValue":o[1]||=e=>E.value=e,placeholder:`https://api.novita.ai/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon-color`,`on-back`]))}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file diff --git a/assets/ollama-YEZZT8Xd.js b/assets/ollama-YEZZT8Xd.js deleted file mode 100644 index 53a91dc88ce9be65f08c61b36de5bb3f18280c46..0000000000000000000000000000000000000000 --- a/assets/ollama-YEZZT8Xd.js +++ /dev/null @@ -1 +0,0 @@ -import{B as e,a3 as t,a4 as n,a5 as r,a6 as i,a8 as a,a9 as o,aM as s,aR as c,au as l,dD as u,dI as d,da as f,de as p,dg as m,di as h,dk as g,dm as _,do as v,dy as y}from"./index-Bcb2irKh.js";import{b}from"./route-block-DVyt-3Cw.js";const x=`ollama`;var S=_({__name:`ollama`,setup(_){let{t:b}=a(),S=s(),C=e(),{providers:w}=c(C),T=f(()=>C.getProviderMetadata(x)),E=f({get:()=>w.value[x]?.baseUrl||T.value?.defaultOptions?.().baseUrl||``,set:e=>{w.value[x]||(w.value[x]={}),w.value[x].baseUrl=e}});g(()=>{C.initializeProvider(x),E.value=w.value[x]?.baseUrl||T.value?.defaultOptions?.().baseUrl||``,w.value[x]?.headers||(w.value[x].headers={})});function D(){w.value[x]={...T.value?.defaultOptions}}let O=d([{key:``,value:``}]);function k(e,t,n){e&&e.push({key:t,value:n})}function A(e,t){t&&(t.length===1?(t[0].key=``,t[0].value=``):t.splice(e,1))}return m(O,e=>{e.length>0&&(e[e.length-1].key!==``||e[e.length-1].value!==``)&&e.push({key:``,value:``})},{deep:!0,immediate:!0}),(e,a)=>(h(),y(u(t),{"provider-name":T.value?.localizedName,"provider-icon":T.value?.icon,"on-back":()=>u(S).back()},{default:v(()=>[p(u(n),null,{default:v(()=>[p(u(r),{title:u(b)(`settings.pages.providers.common.section.basic.title`),description:u(b)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:v(()=>[p(u(i),{modelValue:E.value,"onUpdate:modelValue":a[0]||=e=>E.value=e,placeholder:T.value?.defaultOptions?.().baseUrl||``,required:``},null,8,[`modelValue`,`placeholder`])]),_:1},8,[`title`,`description`]),p(u(o),{title:u(b)(`settings.pages.providers.common.section.advanced.title`)},{default:v(()=>[p(u(l),{modelValue:O.value,"onUpdate:modelValue":a[1]||=e=>O.value=e,label:u(b)(`settings.pages.providers.common.section.advanced.fields.field.headers.label`),description:u(b)(`settings.pages.providers.common.section.advanced.fields.field.headers.description`),"key-placeholder":u(b)(`settings.pages.providers.common.section.advanced.fields.field.headers.key.placeholder`),"value-placeholder":u(b)(`settings.pages.providers.common.section.advanced.fields.field.headers.value.placeholder`),onAdd:a[2]||=(e,t)=>k(O.value,e,t),onRemove:a[3]||=e=>A(e,O.value)},null,8,[`modelValue`,`label`,`description`,`key-placeholder`,`value-placeholder`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`]))}});typeof b==`function`&&b(S);var C=S;export{C as default}; \ No newline at end of file diff --git a/assets/ollama-tQHRYGgL.js b/assets/ollama-tQHRYGgL.js new file mode 100644 index 0000000000000000000000000000000000000000..e340a41ebbf918800e03021881270c9e51b2fd5c --- /dev/null +++ b/assets/ollama-tQHRYGgL.js @@ -0,0 +1 @@ +import{B as e,a3 as t,a4 as n,a5 as r,a6 as i,a8 as a,a9 as o,aM as s,aR as c,au as l,d6 as u,d8 as d,dF as f,dK as p,di as m,dp as h,dt as g,dv as _,dx as v,dz as y}from"./index-TXtvn0DM.js";import{b}from"./route-block-DVyt-3Cw.js";const x=`ollama`;var S=u({__name:`ollama`,setup(u){let{t:b}=a(),S=s(),C=e(),{providers:w}=c(C),T=h(()=>C.getProviderMetadata(x)),E=h({get:()=>w.value[x]?.baseUrl||T.value?.defaultOptions?.().baseUrl||``,set:e=>{w.value[x]||(w.value[x]={}),w.value[x].baseUrl=e}});y(()=>{C.initializeProvider(x),E.value=w.value[x]?.baseUrl||T.value?.defaultOptions?.().baseUrl||``,w.value[x]?.headers||(w.value[x].headers={})});function D(){w.value[x]={...T.value?.defaultOptions}}let O=p([{key:``,value:``}]);function k(e,t,n){e&&e.push({key:t,value:n})}function A(e,t){t&&(t.length===1?(t[0].key=``,t[0].value=``):t.splice(e,1))}return _(O,e=>{e.length>0&&(e[e.length-1].key!==``||e[e.length-1].value!==``)&&e.push({key:``,value:``})},{deep:!0,immediate:!0}),(e,a)=>(v(),m(f(t),{"provider-name":T.value?.localizedName,"provider-icon":T.value?.icon,"on-back":()=>f(S).back()},{default:d(()=>[g(f(n),null,{default:d(()=>[g(f(r),{title:f(b)(`settings.pages.providers.common.section.basic.title`),description:f(b)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:d(()=>[g(f(i),{modelValue:E.value,"onUpdate:modelValue":a[0]||=e=>E.value=e,placeholder:T.value?.defaultOptions?.().baseUrl||``,required:``},null,8,[`modelValue`,`placeholder`])]),_:1},8,[`title`,`description`]),g(f(o),{title:f(b)(`settings.pages.providers.common.section.advanced.title`)},{default:d(()=>[g(f(l),{modelValue:O.value,"onUpdate:modelValue":a[1]||=e=>O.value=e,label:f(b)(`settings.pages.providers.common.section.advanced.fields.field.headers.label`),description:f(b)(`settings.pages.providers.common.section.advanced.fields.field.headers.description`),"key-placeholder":f(b)(`settings.pages.providers.common.section.advanced.fields.field.headers.key.placeholder`),"value-placeholder":f(b)(`settings.pages.providers.common.section.advanced.fields.field.headers.value.placeholder`),onAdd:a[2]||=(e,t)=>k(O.value,e,t),onRemove:a[3]||=e=>A(e,O.value)},null,8,[`modelValue`,`label`,`description`,`key-placeholder`,`value-placeholder`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`]))}});typeof b==`function`&&b(S);var C=S;export{C as default}; \ No newline at end of file diff --git a/assets/openai-Dpz_1L0T.js b/assets/openai-Dpz_1L0T.js new file mode 100644 index 0000000000000000000000000000000000000000..ac55d5ce0570c006b5cd4110824c670381760a11 --- /dev/null +++ b/assets/openai-Dpz_1L0T.js @@ -0,0 +1 @@ +import{B as e,a3 as t,a4 as n,a5 as r,a6 as i,a7 as a,a8 as o,a9 as s,aM as c,aR as l,d6 as u,d8 as d,dF as f,di as p,dp as m,dt as h,dv as g,dx as _,dz as v}from"./index-TXtvn0DM.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b=`openai`;var x=u({__name:`openai`,setup(u){let{t:y}=o(),x=c(),S=e(),{providers:C}=l(S),w=m(()=>S.getProviderMetadata(b)),T=m({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=m({get:()=>C.value[b]?.baseUrl||`https://api.openai.com/v1/`,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});v(()=>{C.value[b]||(C.value[b]={baseUrl:`https://api.openai.com/v1/`}),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||`https://api.openai.com/v1/`}),g([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||`https://api.openai.com/v1/`}});function D(){C.value[b]={baseUrl:`https://api.openai.com/v1/`}}return(e,o)=>(_(),p(f(t),{"provider-name":w.value?.localizedName||`OpenAI`,"provider-icon":w.value?.icon,"on-back":()=>f(x).back()},{default:d(()=>[h(f(n),null,{default:d(()=>[h(f(r),{title:f(y)(`settings.pages.providers.common.section.basic.title`),description:f(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:d(()=>[h(f(a),{modelValue:T.value,"onUpdate:modelValue":o[0]||=e=>T.value=e,"provider-name":w.value?.localizedName||`OpenAI`,placeholder:`sk-...`},null,8,[`modelValue`,`provider-name`])]),_:1},8,[`title`,`description`]),h(f(s),{title:f(y)(`settings.pages.providers.common.section.advanced.title`)},{default:d(()=>[h(f(i),{modelValue:E.value,"onUpdate:modelValue":o[1]||=e=>E.value=e,placeholder:`https://api.openai.com/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`]))}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file diff --git a/assets/openai-audio-speech-BkZ6fMPR.js b/assets/openai-audio-speech-BkZ6fMPR.js new file mode 100644 index 0000000000000000000000000000000000000000..2f28266e282fe999ceccb862ec29eff897d5cbcc --- /dev/null +++ b/assets/openai-audio-speech-BkZ6fMPR.js @@ -0,0 +1 @@ +import{B as e,V as t,a8 as n,aR as r,at as i,d6 as a,d8 as o,dF as s,dK as c,di as l,dp as u,dt as d,dv as f,dx as p,r as m,y as h}from"./index-TXtvn0DM.js";import{b as g}from"./route-block-DVyt-3Cw.js";const _=`openai-audio-speech`,v=`gpt-4o-mini-tts`;var y=a({__name:`openai-audio-speech`,setup(a){let g=h(),y=e(),{providers:b}=r(y),{t:x}=n(),S={speed:1},C=c(1),w=u(()=>!!b.value[_]?.apiKey),T=u(()=>g.availableVoices[_]||[]);async function E(e,t,n){let r=await y.getProviderInstance(_);if(!r)throw Error(`Failed to initialize speech provider`);let i=y.getProviderConfig(_),a=i.model||v;return await g.speech(r,a,e,t,{...i,...S})}return f(C,async()=>{let e=y.getProviderConfig(_);e.speed=C.value}),(e,n)=>(p(),l(s(m),{"provider-id":_,"default-model":v,"additional-settings":S},{"voice-settings":o(()=>[d(s(i),{modelValue:C.value,"onUpdate:modelValue":n[0]||=e=>C.value=e,label:s(x)(`settings.pages.providers.provider.common.fields.field.speed.label`),description:s(x)(`settings.pages.providers.provider.common.fields.field.speed.description`),min:.5,max:2,step:.01},null,8,[`modelValue`,`label`,`description`])]),playground:o(()=>[d(s(t),{"available-voices":T.value,"generate-speech":E,"api-key-configured":w.value,"default-text":`Hello! This is a test of the OpenAI Speech.`},null,8,[`available-voices`,`api-key-configured`])]),_:1}))}});typeof g==`function`&&g(y);var b=y;export{b as default}; \ No newline at end of file diff --git a/assets/openai-audio-speech-gALEgqPK.js b/assets/openai-audio-speech-gALEgqPK.js deleted file mode 100644 index 20211ee45bf90a4ed58ffc9aff2f5bd2d9c60547..0000000000000000000000000000000000000000 --- a/assets/openai-audio-speech-gALEgqPK.js +++ /dev/null @@ -1 +0,0 @@ -import{B as e,V as t,a8 as n,aR as r,at as i,dD as a,dI as o,da as s,de as c,dg as l,di as u,dm as d,do as f,dy as p,r as m,y as h}from"./index-Bcb2irKh.js";import{b as g}from"./route-block-DVyt-3Cw.js";const _=`openai-audio-speech`,v=`gpt-4o-mini-tts`;var y=d({__name:`openai-audio-speech`,setup(d){let g=h(),y=e(),{providers:b}=r(y),{t:x}=n(),S={speed:1},C=o(1),w=s(()=>!!b.value[_]?.apiKey),T=s(()=>g.availableVoices[_]||[]);async function E(e,t,n){let r=await y.getProviderInstance(_);if(!r)throw Error(`Failed to initialize speech provider`);let i=y.getProviderConfig(_),a=i.model||v;return await g.speech(r,a,e,t,{...i,...S})}return l(C,async()=>{let e=y.getProviderConfig(_);e.speed=C.value}),(e,n)=>(u(),p(a(m),{"provider-id":_,"default-model":v,"additional-settings":S},{"voice-settings":f(()=>[c(a(i),{modelValue:C.value,"onUpdate:modelValue":n[0]||=e=>C.value=e,label:a(x)(`settings.pages.providers.provider.common.fields.field.speed.label`),description:a(x)(`settings.pages.providers.provider.common.fields.field.speed.description`),min:.5,max:2,step:.01},null,8,[`modelValue`,`label`,`description`])]),playground:f(()=>[c(a(t),{"available-voices":T.value,"generate-speech":E,"api-key-configured":w.value,"default-text":`Hello! This is a test of the OpenAI Speech.`},null,8,[`available-voices`,`api-key-configured`])]),_:1}))}});typeof g==`function`&&g(y);var b=y;export{b as default}; \ No newline at end of file diff --git a/assets/openai-audio-transcription-CdjYX-O2.js b/assets/openai-audio-transcription-DB_zNBWO.js similarity index 51% rename from assets/openai-audio-transcription-CdjYX-O2.js rename to assets/openai-audio-transcription-DB_zNBWO.js index 6f3ec4bae206659b60efc43d472b801b7f8d9afd..e0e99f790d01323a850b345ca267c5a0cb059d2f 100644 --- a/assets/openai-audio-transcription-CdjYX-O2.js +++ b/assets/openai-audio-transcription-DB_zNBWO.js @@ -1 +1 @@ -import{B as e,aR as t,dD as n,da as r,de as i,di as a,dm as o,do as s,dy as c,p as l,q as u,w as d}from"./index-Bcb2irKh.js";import{b as f}from"./route-block-DVyt-3Cw.js";const p=`openai-audio-transcription`,m=`whisper-1`;var h=o({__name:`openai-audio-transcription`,setup(o){let f=d(),h=e(),{providers:g}=t(h),_=r(()=>!!g.value[p]?.apiKey);async function v(e){let t=await h.getProviderInstance(p);if(!t)throw Error(`Failed to initialize speech provider`);let n=h.getProviderConfig(p),r=n.model||m;return await f.transcription(t,r,e,`json`)}return(e,t)=>(a(),c(n(l),{"provider-id":p,"default-model":m},{playground:s(()=>[i(n(u),{"generate-transcription":v,"api-key-configured":_.value},null,8,[`api-key-configured`])]),_:1}))}});typeof f==`function`&&f(h);var g=h;export{g as default}; \ No newline at end of file +import{B as e,aR as t,d6 as n,d8 as r,dF as i,di as a,dp as o,dt as s,dx as c,p as l,q as u,w as d}from"./index-TXtvn0DM.js";import{b as f}from"./route-block-DVyt-3Cw.js";const p=`openai-audio-transcription`,m=`whisper-1`;var h=n({__name:`openai-audio-transcription`,setup(n){let f=d(),h=e(),{providers:g}=t(h),_=o(()=>!!g.value[p]?.apiKey);async function v(e){let t=await h.getProviderInstance(p);if(!t)throw Error(`Failed to initialize speech provider`);let n=h.getProviderConfig(p),r=n.model||m;return await f.transcription(t,r,e,`json`)}return(e,t)=>(c(),a(i(l),{"provider-id":p,"default-model":m},{playground:r(()=>[s(i(u),{"generate-transcription":v,"api-key-configured":_.value},null,8,[`api-key-configured`])]),_:1}))}});typeof f==`function`&&f(h);var g=h;export{g as default}; \ No newline at end of file diff --git a/assets/openai-qf_j7gBp.js b/assets/openai-qf_j7gBp.js deleted file mode 100644 index 1b2e4777764bc4a7aaf6e90ee85d741bd372da20..0000000000000000000000000000000000000000 --- a/assets/openai-qf_j7gBp.js +++ /dev/null @@ -1 +0,0 @@ -import{B as e,a3 as t,a4 as n,a5 as r,a6 as i,a7 as a,a8 as o,a9 as s,aM as c,aR as l,dD as u,da as d,de as f,dg as p,di as m,dk as h,dm as g,do as _,dy as v}from"./index-Bcb2irKh.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b=`openai`;var x=g({__name:`openai`,setup(g){let{t:y}=o(),x=c(),S=e(),{providers:C}=l(S),w=d(()=>S.getProviderMetadata(b)),T=d({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=d({get:()=>C.value[b]?.baseUrl||`https://api.openai.com/v1/`,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});h(()=>{C.value[b]||(C.value[b]={baseUrl:`https://api.openai.com/v1/`}),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||`https://api.openai.com/v1/`}),p([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||`https://api.openai.com/v1/`}});function D(){C.value[b]={baseUrl:`https://api.openai.com/v1/`}}return(e,o)=>(m(),v(u(t),{"provider-name":w.value?.localizedName||`OpenAI`,"provider-icon":w.value?.icon,"on-back":()=>u(x).back()},{default:_(()=>[f(u(n),null,{default:_(()=>[f(u(r),{title:u(y)(`settings.pages.providers.common.section.basic.title`),description:u(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:_(()=>[f(u(a),{modelValue:T.value,"onUpdate:modelValue":o[0]||=e=>T.value=e,"provider-name":w.value?.localizedName||`OpenAI`,placeholder:`sk-...`},null,8,[`modelValue`,`provider-name`])]),_:1},8,[`title`,`description`]),f(u(s),{title:u(y)(`settings.pages.providers.common.section.advanced.title`)},{default:_(()=>[f(u(i),{modelValue:E.value,"onUpdate:modelValue":o[1]||=e=>E.value=e,placeholder:`https://api.openai.com/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`]))}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file diff --git a/assets/openrouter-ai-BFMtPxJ7.js b/assets/openrouter-ai-nUDctjfq.js similarity index 51% rename from assets/openrouter-ai-BFMtPxJ7.js rename to assets/openrouter-ai-nUDctjfq.js index 2c8af1a9a48c2bb95e84ef86c14966ae963555a7..7e97929f257d7119c07041f2654df1028b7fd3e8 100644 --- a/assets/openrouter-ai-BFMtPxJ7.js +++ b/assets/openrouter-ai-nUDctjfq.js @@ -1 +1 @@ -import{B as e,a3 as t,a4 as n,a5 as r,a6 as i,a7 as a,a8 as o,a9 as s,aM as c,aR as l,dD as u,da as d,de as f,dg as p,di as m,dk as h,dm as g,do as _,dy as v}from"./index-Bcb2irKh.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b=`openrouter-ai`;var x=g({__name:`openrouter-ai`,setup(g){let{t:y}=o(),x=c(),S=e(),{providers:C}=l(S),w=d(()=>S.getProviderMetadata(b)),T=d({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=d({get:()=>C.value[b]?.baseUrl||w.value?.defaultOptions?.().baseUrl||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});h(()=>{S.initializeProvider(b),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||w.value?.defaultOptions?.().baseUrl||``}),p([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||w.value?.defaultOptions?.().baseUrl||``}});function D(){C.value[b]={...w.value?.defaultOptions}}return(e,o)=>(m(),v(u(t),{"provider-name":w.value?.localizedName,"provider-icon":w.value?.icon,"on-back":()=>u(x).back()},{default:_(()=>[f(u(n),null,{default:_(()=>[f(u(r),{title:u(y)(`settings.pages.providers.common.section.basic.title`),description:u(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:_(()=>[f(u(a),{modelValue:T.value,"onUpdate:modelValue":o[0]||=e=>T.value=e,"provider-name":w.value?.localizedName,placeholder:`sk-or-...`},null,8,[`modelValue`,`provider-name`])]),_:1},8,[`title`,`description`]),f(u(s),{title:u(y)(`settings.pages.providers.common.section.advanced.title`)},{default:_(()=>[f(u(i),{modelValue:E.value,"onUpdate:modelValue":o[1]||=e=>E.value=e,placeholder:w.value?.defaultOptions?.().baseUrl||``},null,8,[`modelValue`,`placeholder`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`]))}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file +import{B as e,a3 as t,a4 as n,a5 as r,a6 as i,a7 as a,a8 as o,a9 as s,aM as c,aR as l,d6 as u,d8 as d,dF as f,di as p,dp as m,dt as h,dv as g,dx as _,dz as v}from"./index-TXtvn0DM.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b=`openrouter-ai`;var x=u({__name:`openrouter-ai`,setup(u){let{t:y}=o(),x=c(),S=e(),{providers:C}=l(S),w=m(()=>S.getProviderMetadata(b)),T=m({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=m({get:()=>C.value[b]?.baseUrl||w.value?.defaultOptions?.().baseUrl||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});v(()=>{S.initializeProvider(b),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||w.value?.defaultOptions?.().baseUrl||``}),g([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||w.value?.defaultOptions?.().baseUrl||``}});function D(){C.value[b]={...w.value?.defaultOptions}}return(e,o)=>(_(),p(f(t),{"provider-name":w.value?.localizedName,"provider-icon":w.value?.icon,"on-back":()=>f(x).back()},{default:d(()=>[h(f(n),null,{default:d(()=>[h(f(r),{title:f(y)(`settings.pages.providers.common.section.basic.title`),description:f(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:d(()=>[h(f(a),{modelValue:T.value,"onUpdate:modelValue":o[0]||=e=>T.value=e,"provider-name":w.value?.localizedName,placeholder:`sk-or-...`},null,8,[`modelValue`,`provider-name`])]),_:1},8,[`title`,`description`]),h(f(s),{title:f(y)(`settings.pages.providers.common.section.advanced.title`)},{default:d(()=>[h(f(i),{modelValue:E.value,"onUpdate:modelValue":o[1]||=e=>E.value=e,placeholder:w.value?.defaultOptions?.().baseUrl||``},null,8,[`modelValue`,`placeholder`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`]))}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file diff --git a/assets/pages-CqvY_QyT.js b/assets/pages-CqvY_QyT.js deleted file mode 100644 index c6d7da289163e534b5489dc6685a80185ee22b96..0000000000000000000000000000000000000000 --- a/assets/pages-CqvY_QyT.js +++ /dev/null @@ -1 +0,0 @@ -import"./Basic-BIq-Of0k.js";import{b as e,d as t}from"./theme-color-C-tbz8cx.js";import{aR as n,aS as r,aT as i,aY as a,aZ as o,dD as s,dI as c,de as l,dg as u,di as d,dk as f,dm as p,dn as m,do as h,du as g,dy as _,u as v}from"./index-Bcb2irKh.js";import"./import-url-browser-CzbE4_30.js";import"./duckdb-mvp-1eM9E9sB.js";import"./HeaderLink-BvOcNkh0.js";import{b as y}from"./route-block-DVyt-3Cw.js";import{b}from"./Scenes-ELpQ5xkP.js";import{b as x,c as S,d as C,e as w,f as T,g as E}from"./AnimatedWave-Co1wJ2Kd.js";const D={relative:``,flex:`~ col`,"z-2":``,"h-100dvh":``,"w-100vw":``,"of-hidden":``},O={class:`px-0 py-1 md:px-3 md:py-3`,"w-full":``,"gap-2":``},k={relative:``,flex:`~ 1 row gap-y-0 gap-x-2 R(),{immediate:!0}),f(()=>R()),(e,t)=>(d(),_(E,null,{default:h(()=>[l(x,{class:`widgets top-widgets`,"fill-color":s(y)?`oklch(35% calc(var(--chromatic-chroma) * 0.6) var(--chromatic-hue))`:`color-mix(in srgb, oklch(95% calc(var(--chromatic-chroma-50) * 0.5) var(--chromatic-hue)) 80%, oklch(100% 0 360))`},{default:h(()=>[g(`div`,D,[g(`div`,O,[l(T,{class:`hidden md:flex`}),l(C,{class:`flex md:hidden`})]),g(`div`,k,[l(s(b),{"flex-1":``,"min-w":`1/2`,paused:A.value,"focus-at":{x:s(M).x.value,y:s(M).y.value},"x-offset":`${s(L)?s(P).x:s(P).x-10}%`,"y-offset":s(F).y,scale:s(N)},null,8,[`paused`,`focus-at`,`x-offset`,`y-offset`,`scale`]),s(L)?m(``,!0):(d(),_(w,{key:0,h:`85dvh`,absolute:``,"right-4":``,flex:``,"flex-1":``,"flex-col":``,"max-w":`500px`,"min-w":`30%`})),s(L)?(d(),_(S,{key:1,onSettingsOpen:j})):m(``,!0)])])]),_:1},8,[`fill-color`])]),_:1}))}});typeof y==`function`&&y(A);var j=A;export{j as default}; \ No newline at end of file diff --git a/assets/pages-DqJj8AHh.js b/assets/pages-DqJj8AHh.js new file mode 100644 index 0000000000000000000000000000000000000000..8fc90bb3cb15fca84a6afc4fb19d864b4085d193 --- /dev/null +++ b/assets/pages-DqJj8AHh.js @@ -0,0 +1 @@ +import"./Basic-8xhCMoI8.js";import{c as e,d as t}from"./theme-color-CrZYT1IJ.js";import{aR as n,aS as r,aZ as i,a_ as a,b3 as o,d6 as s,d7 as c,d8 as l,dF as u,dK as d,de as f,di as p,dt as m,dv as h,dx as g,dz as _,u as v}from"./index-TXtvn0DM.js";import"./import-url-browser-CzbE4_30.js";import"./duckdb-mvp-1eM9E9sB.js";import"./HeaderLink-BMtWjY7k.js";import{b as y}from"./route-block-DVyt-3Cw.js";import{b}from"./Scenes-D6JBpdgW.js";import{b as x,c as S,d as C,e as w,f as T,g as E}from"./AnimatedWave-1XImhiJl.js";const D={relative:``,flex:`~ col`,"z-2":``,"h-100dvh":``,"w-100vw":``,"of-hidden":``},O={class:`px-0 py-1 md:px-3 md:py-3`,"w-full":``,"gap-2":``},k={relative:``,flex:`~ 1 row gap-y-0 gap-x-2 R(),{immediate:!0}),_(()=>R()),(e,t)=>(g(),p(E,null,{default:l(()=>[m(x,{class:`widgets top-widgets`,"fill-color":u(y)?`oklch(35% calc(var(--chromatic-chroma) * 0.6) var(--chromatic-hue))`:`color-mix(in srgb, oklch(95% calc(var(--chromatic-chroma-50) * 0.5) var(--chromatic-hue)) 80%, oklch(100% 0 360))`},{default:l(()=>[f(`div`,D,[f(`div`,O,[m(T,{class:`hidden md:flex`}),m(C,{class:`flex md:hidden`})]),f(`div`,k,[m(u(b),{"flex-1":``,"min-w":`1/2`,paused:A.value,"focus-at":{x:u(M).x.value,y:u(M).y.value},"x-offset":`${u(L)?u(P).x:u(P).x-10}%`,"y-offset":u(F).y,scale:u(N)},null,8,[`paused`,`focus-at`,`x-offset`,`y-offset`,`scale`]),u(L)?c(``,!0):(g(),p(w,{key:0,h:`85dvh`,absolute:``,"right-4":``,flex:``,"flex-1":``,"flex-col":``,"max-w":`500px`,"min-w":`30%`})),u(L)?(g(),p(S,{key:1,onSettingsOpen:j})):c(``,!0)])])]),_:1},8,[`fill-color`])]),_:1}))}});typeof y==`function`&&y(A);var j=A;export{j as default}; \ No newline at end of file diff --git a/assets/plain--3dPFSjT.js b/assets/plain--3dPFSjT.js new file mode 100644 index 0000000000000000000000000000000000000000..399aba40fd46704794c4d99fdef8da12ea1c8885 --- /dev/null +++ b/assets/plain--3dPFSjT.js @@ -0,0 +1 @@ +import{aK as e,di as t,dn as n,dx as r}from"./index-TXtvn0DM.js";const i={};function a(e,i){let a=n(`RouterView`);return r(),t(a)}var o=e(i,[[`render`,a]]);export{o as default}; \ No newline at end of file diff --git a/assets/plain-rPj2okum.js b/assets/plain-rPj2okum.js deleted file mode 100644 index f293adbcf557c442cab0d2b9cd4aff5616f06b1f..0000000000000000000000000000000000000000 --- a/assets/plain-rPj2okum.js +++ /dev/null @@ -1 +0,0 @@ -import{aK as e,d8 as t,di as n,dy as r}from"./index-Bcb2irKh.js";const i={};function a(e,i){let a=t(`RouterView`);return n(),r(a)}var o=e(i,[[`render`,a]]);export{o as default}; \ No newline at end of file diff --git a/assets/player2-BEEn9lAM.js b/assets/player2-BEEn9lAM.js deleted file mode 100644 index f5c6a2466e65ed682e7899efeda41f0ba803a193..0000000000000000000000000000000000000000 --- a/assets/player2-BEEn9lAM.js +++ /dev/null @@ -1 +0,0 @@ -import{B as e,a3 as t,a4 as n,a5 as r,a6 as i,a8 as a,aM as o,aR as s,az as c,d9 as l,dD as u,dI as d,da as f,de as p,dg as m,di as h,dj as g,dk as _,dm as v,dn as y,do as b,dp as x,du as S}from"./index-Bcb2irKh.js";import{b as C}from"./route-block-DVyt-3Cw.js";const w={key:0,"mb-1":``},T=`player2`;var E=v({__name:`player2`,setup(v){let{t:C}=a(),E=o(),D=e(),{providers:O}=s(D),k=f(()=>D.getProviderMetadata(T)),A=f({get:()=>O.value[T]?.baseUrl||``,set:e=>{O.value[T]||(O.value[T]={}),O.value[T].baseUrl=e}}),j=d(!0);_(async()=>{D.initializeProvider(T),A.value=O.value[T]?.baseUrl||``;try{let e=await fetch(`${A.value}health`,{method:`GET`,headers:{"player2-game-key":`airi`}});j.value=e.status===200}catch(e){console.error(e),j.value=!1}}),m([A],()=>{O.value[T]={...O.value[T],baseUrl:A.value||``}});function M(){O.value[T]={...k.value?.defaultOptions}}return(e,a)=>(h(),x(l,null,[j.value?y(``,!0):(h(),x(`div`,w,[p(u(c),{theme:`orange`},{label:b(()=>a[1]||=[g(` Player 2 is not running `)]),default:b(()=>[a[2]||=S(`div`,null,[g(` Please download and run the Player2 App: `),S(`a`,{href:`https://player2.game`,target:`_blank`,rel:`noopener noreferrer`},` https://player2.game `),S(`div`,null,[g(` After downloading, if you still are having trouble, please reach out to us on Discord: `),S(`a`,{href:`https://player2.game/discord`,target:`_blank`,rel:`noopener noreferrer`},` https://player2.game/discord `),g(`. `)])],-1)]),_:1,__:[2]})])),p(u(t),{"provider-name":k.value?.localizedName,"provider-icon":k.value?.icon,"on-back":()=>u(E).back()},{default:b(()=>[p(u(n),null,{default:b(()=>[p(u(r),{title:u(C)(`settings.pages.providers.common.section.basic.title`),description:u(C)(`settings.pages.providers.common.section.basic.description`),"on-reset":M},{default:b(()=>[p(u(i),{modelValue:A.value,"onUpdate:modelValue":a[0]||=e=>A.value=e,placeholder:`http://localhost:4315/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`,`description`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`])],64))}});typeof C==`function`&&C(E);var D=E;export{D as default}; \ No newline at end of file diff --git a/assets/player2-BMI1LzL_.js b/assets/player2-BMI1LzL_.js new file mode 100644 index 0000000000000000000000000000000000000000..371315356b1fb55a6683f09fb4411a170ac81fd2 --- /dev/null +++ b/assets/player2-BMI1LzL_.js @@ -0,0 +1 @@ +import{B as e,a3 as t,a4 as n,a5 as r,a6 as i,a8 as a,aM as o,aR as s,az as c,d6 as l,d7 as u,d8 as d,d9 as f,dF as p,dK as m,de as h,do as g,dp as _,dt as v,dv as y,dx as b,dy as x,dz as S}from"./index-TXtvn0DM.js";import{b as C}from"./route-block-DVyt-3Cw.js";const w={key:0,"mb-1":``},T=`player2`;var E=l({__name:`player2`,setup(l){let{t:C}=a(),E=o(),D=e(),{providers:O}=s(D),k=_(()=>D.getProviderMetadata(T)),A=_({get:()=>O.value[T]?.baseUrl||``,set:e=>{O.value[T]||(O.value[T]={}),O.value[T].baseUrl=e}}),j=m(!0);S(async()=>{D.initializeProvider(T),A.value=O.value[T]?.baseUrl||``;try{let e=await fetch(`${A.value}health`,{method:`GET`,headers:{"player2-game-key":`airi`}});j.value=e.status===200}catch(e){console.error(e),j.value=!1}}),y([A],()=>{O.value[T]={...O.value[T],baseUrl:A.value||``}});function M(){O.value[T]={...k.value?.defaultOptions}}return(e,a)=>(b(),f(g,null,[j.value?u(``,!0):(b(),f(`div`,w,[v(p(c),{theme:`orange`},{label:d(()=>a[1]||=[x(` Player 2 is not running `)]),default:d(()=>[a[2]||=h(`div`,null,[x(` Please download and run the Player2 App: `),h(`a`,{href:`https://player2.game`,target:`_blank`,rel:`noopener noreferrer`},` https://player2.game `),h(`div`,null,[x(` After downloading, if you still are having trouble, please reach out to us on Discord: `),h(`a`,{href:`https://player2.game/discord`,target:`_blank`,rel:`noopener noreferrer`},` https://player2.game/discord `),x(`. `)])],-1)]),_:1,__:[2]})])),v(p(t),{"provider-name":k.value?.localizedName,"provider-icon":k.value?.icon,"on-back":()=>p(E).back()},{default:d(()=>[v(p(n),null,{default:d(()=>[v(p(r),{title:p(C)(`settings.pages.providers.common.section.basic.title`),description:p(C)(`settings.pages.providers.common.section.basic.description`),"on-reset":M},{default:d(()=>[v(p(i),{modelValue:A.value,"onUpdate:modelValue":a[0]||=e=>A.value=e,placeholder:`http://localhost:4315/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`,`description`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`])],64))}});typeof C==`function`&&C(E);var D=E;export{D as default}; \ No newline at end of file diff --git a/assets/player2-speech-Dr2qPb6l.js b/assets/player2-speech-Dr2qPb6l.js new file mode 100644 index 0000000000000000000000000000000000000000..b8692ec6d1cd3e0c48edcc9839d527b7e87a3294 --- /dev/null +++ b/assets/player2-speech-Dr2qPb6l.js @@ -0,0 +1 @@ +import{B as e,V as t,a8 as n,at as r,az as i,d6 as a,d7 as o,d8 as s,d9 as c,dF as l,dK as u,de as d,do as f,dp as p,dt as m,dv as h,dx as g,dy as _,dz as v,r as y,y as b}from"./index-TXtvn0DM.js";import{b as x}from"./route-block-DVyt-3Cw.js";const S={key:0,style:{color:`red`,"margin-bottom":`1rem`}},C=`player2-speech`,w=`v1`;var T=a({__name:`player2-speech`,setup(a){let x=u(1),T=b(),E=e(),{t:D}=n(),O=p(()=>T.availableVoices[C]||[]);async function k(e,t,n){let r=await E.getProviderInstance(C);if(!r)throw Error(`Failed to initialize speech provider`);let i=E.getProviderConfig(C),a=i.model||w;return await T.speech(r,a,e,t,{...i})}let A=u(!0);return v(async()=>{let e=E.getProviderConfig(C),t=E.getProviderMetadata(C);await t.validators.validateProviderConfig(e)?await T.loadVoicesForProvider(C):console.error(`Failed to validate provider config`,e);try{let t=await fetch(`${e.baseUrl}/v1/health`,{method:`GET`,headers:{"player2-game-key":`airi`}});A.value=t.status===200}catch(e){console.error(e),A.value=!1}}),h(x,async()=>{let e=E.getProviderConfig(C);e.speed=x.value}),(e,n)=>(g(),c(f,null,[A.value?o(``,!0):(g(),c(`div`,S,[m(l(i),{theme:`orange`},{label:s(()=>n[1]||=[_(` Player 2 is not running `)]),default:s(()=>[n[2]||=d(`div`,null,[_(` Please download and run the Player2 App: `),d(`a`,{href:`https://player2.game`,target:`_blank`,rel:`noopener noreferrer`},` https://player2.game `),d(`div`,null,[_(` After downloading, if you still are having trouble, please reach out to us on Discord: `),d(`a`,{href:`https://player2.game/discord`,target:`_blank`,rel:`noopener noreferrer`},` https://player2.game/discord `),_(`. `)])],-1)]),_:1,__:[2]})])),m(l(y),{"provider-id":C,"default-model":w},{"voice-settings":s(()=>[m(l(r),{modelValue:x.value,"onUpdate:modelValue":n[0]||=e=>x.value=e,label:l(D)(`settings.pages.providers.provider.common.fields.field.speed.label`),description:l(D)(`settings.pages.providers.provider.common.fields.field.speed.description`),min:.5,max:5,step:.01},null,8,[`modelValue`,`label`,`description`])]),playground:s(()=>[m(l(t),{"available-voices":O.value,"generate-speech":k,"api-key-configured":!0,"default-text":`Hello! This is a test of the Player 2 voice synthesis.`},null,8,[`available-voices`])]),_:1})],64))}});typeof x==`function`&&x(T);var E=T;export{E as default}; \ No newline at end of file diff --git a/assets/player2-speech-bBMC5JEe.js b/assets/player2-speech-bBMC5JEe.js deleted file mode 100644 index c96342a7ad5716741e40828a9cfe2f5e6e3fba73..0000000000000000000000000000000000000000 --- a/assets/player2-speech-bBMC5JEe.js +++ /dev/null @@ -1 +0,0 @@ -import{B as e,V as t,a8 as n,at as r,az as i,d9 as a,dD as o,dI as s,da as c,de as l,dg as u,di as d,dj as f,dk as p,dm as m,dn as h,do as g,dp as _,du as v,r as y,y as b}from"./index-Bcb2irKh.js";import{b as x}from"./route-block-DVyt-3Cw.js";const S={key:0,style:{color:`red`,"margin-bottom":`1rem`}},C=`player2-speech`,w=`v1`;var T=m({__name:`player2-speech`,setup(m){let x=s(1),T=b(),E=e(),{t:D}=n(),O=c(()=>T.availableVoices[C]||[]);async function k(e,t,n){let r=await E.getProviderInstance(C);if(!r)throw Error(`Failed to initialize speech provider`);let i=E.getProviderConfig(C),a=i.model||w;return await T.speech(r,a,e,t,{...i})}let A=s(!0);return p(async()=>{let e=E.getProviderConfig(C),t=E.getProviderMetadata(C);await t.validators.validateProviderConfig(e)?await T.loadVoicesForProvider(C):console.error(`Failed to validate provider config`,e);try{let t=await fetch(`${e.baseUrl}/v1/health`,{method:`GET`,headers:{"player2-game-key":`airi`}});A.value=t.status===200}catch(e){console.error(e),A.value=!1}}),u(x,async()=>{let e=E.getProviderConfig(C);e.speed=x.value}),(e,n)=>(d(),_(a,null,[A.value?h(``,!0):(d(),_(`div`,S,[l(o(i),{theme:`orange`},{label:g(()=>n[1]||=[f(` Player 2 is not running `)]),default:g(()=>[n[2]||=v(`div`,null,[f(` Please download and run the Player2 App: `),v(`a`,{href:`https://player2.game`,target:`_blank`,rel:`noopener noreferrer`},` https://player2.game `),v(`div`,null,[f(` After downloading, if you still are having trouble, please reach out to us on Discord: `),v(`a`,{href:`https://player2.game/discord`,target:`_blank`,rel:`noopener noreferrer`},` https://player2.game/discord `),f(`. `)])],-1)]),_:1,__:[2]})])),l(o(y),{"provider-id":C,"default-model":w},{"voice-settings":g(()=>[l(o(r),{modelValue:x.value,"onUpdate:modelValue":n[0]||=e=>x.value=e,label:o(D)(`settings.pages.providers.provider.common.fields.field.speed.label`),description:o(D)(`settings.pages.providers.provider.common.fields.field.speed.description`),min:.5,max:5,step:.01},null,8,[`modelValue`,`label`,`description`])]),playground:g(()=>[l(o(t),{"available-voices":O.value,"generate-speech":k,"api-key-configured":!0,"default-text":`Hello! This is a test of the Player 2 voice synthesis.`},null,8,[`available-voices`])]),_:1})],64))}});typeof x==`function`&&x(T);var E=T;export{E as default}; \ No newline at end of file diff --git a/assets/polaroid-CgtEjW36.js b/assets/polaroid-CgtEjW36.js deleted file mode 100644 index c618b48cd137223c813c85311486b272f0c3c543..0000000000000000000000000000000000000000 --- a/assets/polaroid-CgtEjW36.js +++ /dev/null @@ -1 +0,0 @@ -import{ad as e,c_ as t,d6 as n,d9 as r,dD as i,dI as a,dN as o,de as s,dg as c,di as l,dm as u,do as d,dp as f,du as p,dv as m}from"./index-Bcb2irKh.js";import"./import-url-browser-CzbE4_30.js";import"./duckdb-mvp-1eM9E9sB.js";import{f as h,h as g}from"./Scenes-ELpQ5xkP.js";const _={flex:``,"flex-col":``,"items-center":``,"gap-4":``},v={"h-full":``,"w-full":``},y=[`value`];var b=u({__name:`polaroid`,setup(u){let b=a(),x=a(),S=a(`idle`),C=a([]);function w(e,t){let n=document.createElement(`a`);n.href=e,n.download=t,document.body.appendChild(n),n.click(),document.body.removeChild(n)}function T(e){x.value?.setMotion(e)}c(x,e=>{C.value=e?.listMotionGroups()||[]},{immediate:!0});function E(){x.value&&(x.value?.setMotion(S.value),C.value=x.value.listMotionGroups())}function D(){if(!b.value||!x.value)return;let e=b.value.canvasElement(),t=e.toDataURL(`image/png`);w(t,`live2d-screenshot.png`)}return(a,c)=>(l(),f(`div`,_,[p(`div`,v,[s(i(e),{relative:``,"min-h-70dvh":``},{default:d(({width:e,height:t})=>[s(i(g),{ref_key:`live2dCanvasRef`,ref:b,width:e,height:t,resolution:3,"rounded-full":``},{default:d(({app:n})=>[s(i(h),{ref_key:`live2dModelRef`,ref:x,app:n,width:e,height:t,"focus-at":{x:e/2,y:t/2},onModelLoaded:E},null,8,[`app`,`width`,`height`,`focus-at`])]),_:2},1032,[`width`,`height`])]),_:1})]),p(`div`,null,[n(p(`select`,{"onUpdate:modelValue":c[0]||=e=>S.value=e,"rounded-lg":``,"px-3":``,"py-2":``,onChange:c[1]||=e=>T(S.value)},[(l(!0),f(r,null,m(C.value,e=>(l(),f(`option`,{key:e.motionIndex,value:e.motionName},o(e.fileName),9,y))),128))],544),[[t,S.value]])]),p(`div`,{border:`2px solid white`,flex:``,"items-center":``,"justify-center":``,"rounded-full":``,"p-1":``},[p(`button`,{"h-18":``,"w-18":``,"rounded-full":``,bg:`white active:gray-50`,"outline-none":``,"transition-colors":``,"duration-200":``,"ease-in-out":``,onClick:D})])]))}}),x=b;export{x as default}; \ No newline at end of file diff --git a/assets/polaroid-CpEbVTFH.js b/assets/polaroid-CpEbVTFH.js new file mode 100644 index 0000000000000000000000000000000000000000..364efe3b5f07a547ec0668e0d08ffdcd0a86cc9a --- /dev/null +++ b/assets/polaroid-CpEbVTFH.js @@ -0,0 +1 @@ +import{ad as e,c$ as t,d6 as n,d8 as r,d9 as i,dF as a,dK as o,dN as s,de as c,df as l,dl as u,do as d,dt as f,dv as p,dx as m}from"./index-TXtvn0DM.js";import"./import-url-browser-CzbE4_30.js";import"./duckdb-mvp-1eM9E9sB.js";import{f as h,h as g}from"./Scenes-D6JBpdgW.js";const _={flex:``,"flex-col":``,"items-center":``,"gap-4":``},v={"h-full":``,"w-full":``},y=[`value`];var b=n({__name:`polaroid`,setup(n){let b=o(),x=o(),S=o(`idle`),C=o([]);function w(e,t){let n=document.createElement(`a`);n.href=e,n.download=t,document.body.appendChild(n),n.click(),document.body.removeChild(n)}function T(e){x.value?.setMotion(e)}p(x,e=>{C.value=e?.listMotionGroups()||[]},{immediate:!0});function E(){x.value&&(x.value?.setMotion(S.value),C.value=x.value.listMotionGroups())}function D(){if(!b.value||!x.value)return;let e=b.value.canvasElement(),t=e.toDataURL(`image/png`);w(t,`live2d-screenshot.png`)}return(n,o)=>(m(),i(`div`,_,[c(`div`,v,[f(a(e),{relative:``,"min-h-70dvh":``},{default:r(({width:e,height:t})=>[f(a(g),{ref_key:`live2dCanvasRef`,ref:b,width:e,height:t,resolution:3,"rounded-full":``},{default:r(({app:n})=>[f(a(h),{ref_key:`live2dModelRef`,ref:x,app:n,width:e,height:t,"focus-at":{x:e/2,y:t/2},onModelLoaded:E},null,8,[`app`,`width`,`height`,`focus-at`])]),_:2},1032,[`width`,`height`])]),_:1})]),c(`div`,null,[u(c(`select`,{"onUpdate:modelValue":o[0]||=e=>S.value=e,"rounded-lg":``,"px-3":``,"py-2":``,onChange:o[1]||=e=>T(S.value)},[(m(!0),i(d,null,l(C.value,e=>(m(),i(`option`,{key:e.motionIndex,value:e.motionName},s(e.fileName),9,y))),128))],544),[[t,S.value]])]),c(`div`,{border:`2px solid white`,flex:``,"items-center":``,"justify-center":``,"rounded-full":``,"p-1":``},[c(`button`,{"h-18":``,"w-18":``,"rounded-full":``,bg:`white active:gray-50`,"outline-none":``,"transition-colors":``,"duration-200":``,"ease-in-out":``,onClick:D})])]))}}),x=b;export{x as default}; \ No newline at end of file diff --git a/assets/providers-DsrU6JIK.js b/assets/providers-B5wbeFJM.js similarity index 57% rename from assets/providers-DsrU6JIK.js rename to assets/providers-B5wbeFJM.js index 568100298ae572fe1268a4a29b1ade709a76e803..e620f9e2d0e7073f48dbc9ae9304ee4e45737a79 100644 --- a/assets/providers-DsrU6JIK.js +++ b/assets/providers-B5wbeFJM.js @@ -1 +1 @@ -import{B as e,a8 as t,aR as n,ak as r,d6 as i,d8 as a,d9 as o,dD as s,dN as c,de as l,dh as u,di as d,dm as f,do as p,dp as m,du as h,dv as g,dy as _}from"./index-Bcb2irKh.js";import{b as v}from"./route-block-DVyt-3Cw.js";import{b as y}from"./IconAnimation-BSHXCi3V.js";import{b}from"./icon-animation-aqma-gkh.js";const x={flex:``,"flex-col":``,"gap-5":``,"pb-12":``},S={class:`rounded-lg bg-primary-500/10 p-4 dark:bg-primary-800/25`},C={class:`mb-2 text-xl text-primary-800 font-semibold dark:text-primary-100`},w={class:`text-primary-700 dark:text-primary-300`},T={flex:`~ row items-center gap-2`},E={text:`neutral-300 dark:neutral-500`},D={grid:`~ cols-1 sm:cols-2 xl:cols-3 gap-4`},O={flex:`~ row items-center gap-2`,"my-5":``},k={text:`neutral-300 dark:neutral-500`},A={grid:`~ cols-1 sm:cols-2 xl:cols-3 gap-4`},j={flex:`~ row items-center gap-2`,"my-5":``},M={text:`neutral-300 dark:neutral-500`},N={grid:`~ cols-1 sm:cols-2 xl:cols-3 gap-4`},P={key:1,text:`neutral-500/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-15rem)]`,"bottom-0":``,"right--5":``,"z--1":``,initial:{scale:.9,opacity:0,y:20},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``};var F=f({__name:`index`,setup(f){let{t:v}=t(),F=e(),{allChatProvidersMetadata:I,allAudioSpeechProvidersMetadata:L,allAudioTranscriptionProvidersMetadata:R}=n(F),{iconAnimationStarted:z,showIconAnimation:B,animationIcon:V}=b(`i-solar:box-minimalistic-bold-duotone`);return(e,t)=>{let n=a(`i18n-t`),f=u(`motion`);return d(),m(o,null,[h(`div`,x,[h(`div`,S,[h(`div`,C,c(e.$t(`settings.pages.providers.helpinfo.title`)),1),h(`div`,w,[l(n,{keypath:`settings.pages.providers.helpinfo.description`},{chat:p(()=>t[0]||=[h(`span`,{class:`inline-flex translate-y-[0.25lh] items-center gap-1 rounded-lg bg-primary-500/10 px-2 py-0.5 dark:bg-primary-800/25`},[h(`div`,{class:`i-solar:chat-square-like-bold-duotone`}),h(`strong`,{class:`font-semibold`},`Chat`)],-1)]),_:1})])]),h(`div`,T,[t[2]||=h(`div`,{"i-solar:chat-square-like-bold-duotone":``,text:`neutral-500 dark:neutral-400 4xl`},null,-1),h(`div`,null,[h(`div`,null,[h(`span`,E,c(s(v)(`settings.pages.providers.explained.chat`)),1)]),t[1]||=h(`div`,{flex:``,"text-nowrap":``,"text-3xl":``,"font-normal":``},[h(`div`,null,` Chat `)],-1)])]),h(`div`,D,[(d(!0),m(o,null,g(s(I),(e,t)=>i((d(),_(s(r),{key:e.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+t*10,delay:t*50,title:e.localizedName||`Unknown`,description:e.localizedDescription,icon:e.icon,"icon-color":e.iconColor,"icon-image":e.iconImage,to:`/settings/providers/${e.id}`,configured:e.configured},null,8,[`duration`,`delay`,`title`,`description`,`icon`,`icon-color`,`icon-image`,`to`,`configured`])),[[f]])),128))]),h(`div`,O,[t[4]||=h(`div`,{"i-solar:user-speak-rounded-bold-duotone":``,text:`neutral-500 dark:neutral-400 4xl`},null,-1),h(`div`,null,[h(`div`,null,[h(`span`,k,c(s(v)(`settings.pages.providers.explained.Speech`)),1)]),t[3]||=h(`div`,{flex:``,"text-nowrap":``,"text-3xl":``,"font-normal":``},[h(`div`,null,` Speech `)],-1)])]),h(`div`,A,[(d(!0),m(o,null,g(s(L),(e,t)=>i((d(),_(s(r),{key:e.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+t*10,delay:(s(I).length+t)*50,title:e.localizedName||`Unknown`,description:e.localizedDescription,icon:e.icon,"icon-color":e.iconColor,"icon-image":e.iconImage,to:`/settings/providers/${e.id}`,configured:e.configured},null,8,[`duration`,`delay`,`title`,`description`,`icon`,`icon-color`,`icon-image`,`to`,`configured`])),[[f]])),128))]),h(`div`,j,[t[6]||=h(`div`,{"i-solar:microphone-3-bold-duotone":``,text:`neutral-500 dark:neutral-400 4xl`},null,-1),h(`div`,null,[h(`div`,null,[h(`span`,M,c(s(v)(`settings.pages.providers.explained.Transcription`)),1)]),t[5]||=h(`div`,{flex:``,"text-nowrap":``,"text-3xl":``,"font-normal":``},[h(`div`,null,` Transcription `)],-1)])]),h(`div`,N,[(d(!0),m(o,null,g(s(R),(e,t)=>i((d(),_(s(r),{key:e.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+t*10,delay:(s(I).length+s(L).length+t)*50,title:e.localizedName||`Unknown`,description:e.localizedDescription,icon:e.icon,"icon-color":e.iconColor,"icon-image":e.iconImage,to:`/settings/providers/${e.id}`,configured:e.configured},null,8,[`duration`,`delay`,`title`,`description`,`icon`,`icon-color`,`icon-image`,`to`,`configured`])),[[f]])),128))])]),s(B)?(d(),_(y,{key:0,"z-index":-1,icon:s(V),"icon-size":12,duration:1e3,started:s(z),"is-reverse":!0,position:`calc(100dvw - 9.5rem), calc(100dvh - 9.5rem)`,"text-color":`text-neutral-200/50 dark:text-neutral-600/20`},null,8,[`icon`,`started`])):i((d(),m(`div`,P,t[7]||=[h(`div`,{text:`60`,"i-solar:box-minimalistic-bold-duotone":``},null,-1)])),[[f]])],64)}}});typeof v==`function`&&v(F);var I=F;export{I as default}; \ No newline at end of file +import{B as e,a8 as t,aR as n,ak as r,d6 as i,d8 as a,d9 as o,dF as s,dN as c,de as l,df as u,di as d,dl as f,dn as p,do as m,dt as h,dw as g,dx as _}from"./index-TXtvn0DM.js";import{b as v}from"./route-block-DVyt-3Cw.js";import{b as y}from"./IconAnimation-Cx_ji59L.js";import{b}from"./icon-animation-Tj7r0tub.js";const x={flex:``,"flex-col":``,"gap-5":``,"pb-12":``},S={class:`rounded-lg bg-primary-500/10 p-4 dark:bg-primary-800/25`},C={class:`mb-2 text-xl text-primary-800 font-semibold dark:text-primary-100`},w={class:`text-primary-700 dark:text-primary-300`},T={flex:`~ row items-center gap-2`},E={text:`neutral-300 dark:neutral-500`},D={grid:`~ cols-1 sm:cols-2 xl:cols-3 gap-4`},O={flex:`~ row items-center gap-2`,"my-5":``},k={text:`neutral-300 dark:neutral-500`},A={grid:`~ cols-1 sm:cols-2 xl:cols-3 gap-4`},j={flex:`~ row items-center gap-2`,"my-5":``},M={text:`neutral-300 dark:neutral-500`},N={grid:`~ cols-1 sm:cols-2 xl:cols-3 gap-4`},P={key:1,text:`neutral-500/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-15rem)]`,"bottom-0":``,"right--5":``,"z--1":``,initial:{scale:.9,opacity:0,y:20},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``};var F=i({__name:`index`,setup(i){let{t:v}=t(),F=e(),{allChatProvidersMetadata:I,allAudioSpeechProvidersMetadata:L,allAudioTranscriptionProvidersMetadata:R}=n(F),{iconAnimationStarted:z,showIconAnimation:B,animationIcon:V}=b(`i-solar:box-minimalistic-bold-duotone`);return(e,t)=>{let n=p(`i18n-t`),i=g(`motion`);return _(),o(m,null,[l(`div`,x,[l(`div`,S,[l(`div`,C,c(e.$t(`settings.pages.providers.helpinfo.title`)),1),l(`div`,w,[h(n,{keypath:`settings.pages.providers.helpinfo.description`},{chat:a(()=>t[0]||=[l(`span`,{class:`inline-flex translate-y-[0.25lh] items-center gap-1 rounded-lg bg-primary-500/10 px-2 py-0.5 dark:bg-primary-800/25`},[l(`div`,{class:`i-solar:chat-square-like-bold-duotone`}),l(`strong`,{class:`font-semibold`},`Chat`)],-1)]),_:1})])]),l(`div`,T,[t[2]||=l(`div`,{"i-solar:chat-square-like-bold-duotone":``,text:`neutral-500 dark:neutral-400 4xl`},null,-1),l(`div`,null,[l(`div`,null,[l(`span`,E,c(s(v)(`settings.pages.providers.explained.chat`)),1)]),t[1]||=l(`div`,{flex:``,"text-nowrap":``,"text-3xl":``,"font-normal":``},[l(`div`,null,` Chat `)],-1)])]),l(`div`,D,[(_(!0),o(m,null,u(s(I),(e,t)=>f((_(),d(s(r),{key:e.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+t*10,delay:t*50,title:e.localizedName||`Unknown`,description:e.localizedDescription,icon:e.icon,"icon-color":e.iconColor,"icon-image":e.iconImage,to:`/settings/providers/${e.id}`,configured:e.configured},null,8,[`duration`,`delay`,`title`,`description`,`icon`,`icon-color`,`icon-image`,`to`,`configured`])),[[i]])),128))]),l(`div`,O,[t[4]||=l(`div`,{"i-solar:user-speak-rounded-bold-duotone":``,text:`neutral-500 dark:neutral-400 4xl`},null,-1),l(`div`,null,[l(`div`,null,[l(`span`,k,c(s(v)(`settings.pages.providers.explained.Speech`)),1)]),t[3]||=l(`div`,{flex:``,"text-nowrap":``,"text-3xl":``,"font-normal":``},[l(`div`,null,` Speech `)],-1)])]),l(`div`,A,[(_(!0),o(m,null,u(s(L),(e,t)=>f((_(),d(s(r),{key:e.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+t*10,delay:(s(I).length+t)*50,title:e.localizedName||`Unknown`,description:e.localizedDescription,icon:e.icon,"icon-color":e.iconColor,"icon-image":e.iconImage,to:`/settings/providers/${e.id}`,configured:e.configured},null,8,[`duration`,`delay`,`title`,`description`,`icon`,`icon-color`,`icon-image`,`to`,`configured`])),[[i]])),128))]),l(`div`,j,[t[6]||=l(`div`,{"i-solar:microphone-3-bold-duotone":``,text:`neutral-500 dark:neutral-400 4xl`},null,-1),l(`div`,null,[l(`div`,null,[l(`span`,M,c(s(v)(`settings.pages.providers.explained.Transcription`)),1)]),t[5]||=l(`div`,{flex:``,"text-nowrap":``,"text-3xl":``,"font-normal":``},[l(`div`,null,` Transcription `)],-1)])]),l(`div`,N,[(_(!0),o(m,null,u(s(R),(e,t)=>f((_(),d(s(r),{key:e.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+t*10,delay:(s(I).length+s(L).length+t)*50,title:e.localizedName||`Unknown`,description:e.localizedDescription,icon:e.icon,"icon-color":e.iconColor,"icon-image":e.iconImage,to:`/settings/providers/${e.id}`,configured:e.configured},null,8,[`duration`,`delay`,`title`,`description`,`icon`,`icon-color`,`icon-image`,`to`,`configured`])),[[i]])),128))])]),s(B)?(_(),d(y,{key:0,"z-index":-1,icon:s(V),"icon-size":12,duration:1e3,started:s(z),"is-reverse":!0,position:`calc(100dvw - 9.5rem), calc(100dvh - 9.5rem)`,"text-color":`text-neutral-200/50 dark:text-neutral-600/20`},null,8,[`icon`,`started`])):f((_(),o(`div`,P,t[7]||=[l(`div`,{text:`60`,"i-solar:box-minimalistic-bold-duotone":``},null,-1)])),[[i]])],64)}}});typeof v==`function`&&v(F);var I=F;export{I as default}; \ No newline at end of file diff --git a/assets/queue-ljfYlK6R.js b/assets/queue-B4yd_q6Y.js similarity index 72% rename from assets/queue-ljfYlK6R.js rename to assets/queue-B4yd_q6Y.js index e7a89aa16f67bee4b7a2d246c927cca87a3e9fa2..648350a3906e9cc783bd31e8b6c566f84ca87f3d 100644 --- a/assets/queue-ljfYlK6R.js +++ b/assets/queue-B4yd_q6Y.js @@ -1 +1 @@ -import{$ as e,a2 as t,dI as n,di as r,dk as i,dm as a,dp as o,du as s}from"./index-Bcb2irKh.js";var c=a({__name:`queue`,setup(a){let c=n(``),l=t({handlers:[async e=>{console.log(`ready to play speech audio for`,e)}]}),u=t({handlers:[async e=>{console.log(`ready to stream speech audio for`,e),l.add(e.data)}]}),d=t({handlers:[async e=>{let t=[`.`,`?`,`!`],n=!1;for(let r of t){if(!e.data.includes(r))continue;let t=e.data.indexOf(r),i=e.data.slice(0,t+1),a=e.data.slice(t+1);c.value+=i,u.add(c.value.trim()),c.value=a,n=!0}n||(c.value+=e.data)}]}),f=`Hello( N(eko(! I( am( an( AI( assistant( trained( to( help( with( a( variety( of( tasks( such( as( answering( questions(,( providing( information(,( giving( recommendations(,( and( more(. How( can( I( assist( you( today(?(Hello( N(eko(,( I( am( an( AI( assistant(.( I( can( help( answer( questions(,( provide( information(,( assist( with( tasks(,( and( engage( in( conversation(.( How( can( I( assist( you( today(?`.split(`(`);async function p(){for(let t of f)await e(100),d.add(t)}async function m(){p()}return i(()=>{m()}),(e,t)=>(r(),o(`div`,null,t[0]||=[s(`div`,null,null,-1)]))}}),l=c;export{l as default}; \ No newline at end of file +import{$ as e,a2 as t,d6 as n,d9 as r,dK as i,de as a,dx as o,dz as s}from"./index-TXtvn0DM.js";var c=n({__name:`queue`,setup(n){let c=i(``),l=t({handlers:[async e=>{console.log(`ready to play speech audio for`,e)}]}),u=t({handlers:[async e=>{console.log(`ready to stream speech audio for`,e),l.add(e.data)}]}),d=t({handlers:[async e=>{let t=[`.`,`?`,`!`],n=!1;for(let r of t){if(!e.data.includes(r))continue;let t=e.data.indexOf(r),i=e.data.slice(0,t+1),a=e.data.slice(t+1);c.value+=i,u.add(c.value.trim()),c.value=a,n=!0}n||(c.value+=e.data)}]}),f=`Hello( N(eko(! I( am( an( AI( assistant( trained( to( help( with( a( variety( of( tasks( such( as( answering( questions(,( providing( information(,( giving( recommendations(,( and( more(. How( can( I( assist( you( today(?(Hello( N(eko(,( I( am( an( AI( assistant(.( I( can( help( answer( questions(,( provide( information(,( assist( with( tasks(,( and( engage( in( conversation(.( How( can( I( assist( you( today(?`.split(`(`);async function p(){for(let t of f)await e(100),d.add(t)}async function m(){p()}return s(()=>{m()}),(e,t)=>(o(),r(`div`,null,t[0]||=[a(`div`,null,null,-1)]))}}),l=c;export{l as default}; \ No newline at end of file diff --git a/assets/scene-CkCOD6hR.js b/assets/scene-CkCOD6hR.js new file mode 100644 index 0000000000000000000000000000000000000000..707b6930e0f0326696ea5c1994bc08de1f6fe6e9 --- /dev/null +++ b/assets/scene-CkCOD6hR.js @@ -0,0 +1 @@ +import{az as e,d6 as t,d8 as n,d9 as r,dF as i,de as a,di as o,dl as s,do as c,dt as l,dw as u,dx as d,dy as f}from"./index-TXtvn0DM.js";import{b as p}from"./route-block-DVyt-3Cw.js";import{b as m}from"./IconAnimation-Cx_ji59L.js";import{b as h}from"./icon-animation-Tj7r0tub.js";const g={key:1,text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-15rem)]`,"bottom-0":``,"right--5":``,"z--1":``,initial:{scale:.9,opacity:0,y:20},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``};var _=t({__name:`index`,setup(t){let{iconAnimationStarted:p,showIconAnimation:_,animationIcon:v}=h(`i-solar:armchair-2-bold-duotone`);return(t,h)=>{let y=u(`motion`);return d(),r(c,null,[a(`div`,null,[l(i(e),{label:`In development, needs your help!`,theme:`orange`},{default:n(()=>h[0]||=[a(`div`,null,[f(` This functionality is still under development. If you have any suggestions or would like to contribute, please reach out to us on our `),a(`a`,{underline:``,"decoration-dotted":``,href:`https://github.com/moeru-ai/airi/issues`},`GitHub issues page`),f(`. The source code of this page is located at `),a(`a`,{underline:``,"decoration-dotted":``,href:`https://github.com/moeru-ai/airi/tree/main/apps/stage-web/src/pages/settings/scene/index.vue`},`here`),f(`. `)],-1)]),_:1,__:[0]})]),i(_)?(d(),o(m,{key:0,"z-index":-1,icon:i(v),"icon-size":12,duration:1e3,started:i(p),"is-reverse":!0,position:`calc(100dvw - 9.5rem), calc(100dvh - 9.5rem)`,"text-color":`text-neutral-200/50 dark:text-neutral-600/20`},null,8,[`icon`,`started`])):s((d(),r(`div`,g,h[1]||=[a(`div`,{text:`60`,"i-solar:armchair-2-bold-duotone":``},null,-1)])),[[y]])],64)}}});typeof p==`function`&&p(_);var v=_;export{v as default}; \ No newline at end of file diff --git a/assets/scene-Cp8LoaVN.js b/assets/scene-Cp8LoaVN.js deleted file mode 100644 index e3ec0a5e64f1495e3c0c04ce95678be5d1566cd0..0000000000000000000000000000000000000000 --- a/assets/scene-Cp8LoaVN.js +++ /dev/null @@ -1 +0,0 @@ -import{az as e,d6 as t,d9 as n,dD as r,de as i,dh as a,di as o,dj as s,dm as c,do as l,dp as u,du as d,dy as f}from"./index-Bcb2irKh.js";import{b as p}from"./route-block-DVyt-3Cw.js";import{b as m}from"./IconAnimation-BSHXCi3V.js";import{b as h}from"./icon-animation-aqma-gkh.js";const g={key:1,text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-15rem)]`,"bottom-0":``,"right--5":``,"z--1":``,initial:{scale:.9,opacity:0,y:20},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``};var _=c({__name:`index`,setup(c){let{iconAnimationStarted:p,showIconAnimation:_,animationIcon:v}=h(`i-solar:armchair-2-bold-duotone`);return(c,h)=>{let y=a(`motion`);return o(),u(n,null,[d(`div`,null,[i(r(e),{label:`In development, needs your help!`,theme:`orange`},{default:l(()=>h[0]||=[d(`div`,null,[s(` This functionality is still under development. If you have any suggestions or would like to contribute, please reach out to us on our `),d(`a`,{underline:``,"decoration-dotted":``,href:`https://github.com/moeru-ai/airi/issues`},`GitHub issues page`),s(`. The source code of this page is located at `),d(`a`,{underline:``,"decoration-dotted":``,href:`https://github.com/moeru-ai/airi/tree/main/apps/stage-web/src/pages/settings/scene/index.vue`},`here`),s(`. `)],-1)]),_:1,__:[0]})]),r(_)?(o(),f(m,{key:0,"z-index":-1,icon:r(v),"icon-size":12,duration:1e3,started:r(p),"is-reverse":!0,position:`calc(100dvw - 9.5rem), calc(100dvh - 9.5rem)`,"text-color":`text-neutral-200/50 dark:text-neutral-600/20`},null,8,[`icon`,`started`])):t((o(),u(`div`,g,h[1]||=[d(`div`,{text:`60`,"i-solar:armchair-2-bold-duotone":``},null,-1)])),[[y]])],64)}}});typeof p==`function`&&p(_);var v=_;export{v as default}; \ No newline at end of file diff --git a/assets/settings-DIR2jMir.js b/assets/settings-BKVfWP0V.js similarity index 59% rename from assets/settings-DIR2jMir.js rename to assets/settings-BKVfWP0V.js index 15b946b35eb15ed266209848da3d97cc1f7d9bbf..ddd4e8a48c2540849c1654a0811a3345ea2e6553 100644 --- a/assets/settings-DIR2jMir.js +++ b/assets/settings-BKVfWP0V.js @@ -1 +1 @@ -import{a8 as e,aM as t,al as n,d6 as r,d9 as i,dD as a,dI as o,dP as s,da as c,dh as l,di as u,dl as d,dm as f,dp as p,du as m,dv as h,dy as g,t as _}from"./index-Bcb2irKh.js";import{b as v}from"./route-block-DVyt-3Cw.js";import{b as y}from"./IconAnimation-BSHXCi3V.js";const b={flex:`~ col gap-4`,"font-normal":``},x={flex:`~ col gap-4`,"pb-12":``},S={key:1,text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-12rem)]`,"bottom-0":``,"right--10":``,"z--1":``,initial:{scale:.9,opacity:0,rotate:180},enter:{scale:1,opacity:1,rotate:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``},C={text:`60`,"i-solar:settings-bold-duotone":``};var w=f({__name:`index`,setup(f){let v=t(),w=o(!1),T=o(),E=o(),{t:D}=e(),O=o(``),k=o(``),A=o(!1),j=_();function M(){E.value?.()}async function N(e,t){let n=e.currentTarget,r=n.querySelector(`.menu-icon-item-icon`);if(!r)return;let i=r.getBoundingClientRect(),a=`${i.left}px, ${i.top}px`;O.value=t.icon,k.value=a,A.value=!0,await d(),w.value=!0}let P=v.beforeEach(async(e,t,n)=>{if(!j.usePageSpecificTransitions||j.disableTransitions){n();return}await new Promise(e=>{E.value=e}),P(),n()}),F=c(()=>[{title:D(`settings.pages.card.title`),description:D(`settings.pages.card.description`),icon:`i-solar:emoji-funny-square-bold-duotone`,to:`/settings/airi-card`},{title:D(`settings.pages.modules.title`),description:D(`settings.pages.modules.description`),icon:`i-solar:layers-bold-duotone`,to:`/settings/modules`},{title:D(`settings.pages.scene.title`),description:D(`settings.pages.scene.description`),icon:`i-solar:armchair-2-bold-duotone`,to:`/settings/scene`},{title:D(`settings.pages.models.title`),description:D(`settings.pages.models.description`),icon:`i-solar:people-nearby-bold-duotone`,to:`/settings/models`},{title:D(`settings.pages.memory.title`),description:D(`settings.pages.memory.description`),icon:`i-solar:leaf-bold-duotone`,to:`/settings/memory`},{title:D(`settings.pages.providers.title`),description:D(`settings.pages.providers.description`),icon:`i-solar:box-minimalistic-bold-duotone`,to:`/settings/providers`},{title:D(`settings.pages.themes.title`),description:D(`settings.pages.themes.description`),icon:`i-solar:filters-bold-duotone`,to:`/settings/appearance`}]);return(e,t)=>{let o=l(`motion`);return u(),p(`div`,b,[t[0]||=m(`div`,null,null,-1),m(`div`,x,[(u(!0),p(i,null,h(F.value,(e,t)=>r((u(),g(a(n),{key:e.to,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250,style:s({transitionDelay:`${t*50}ms`}),title:e.title,description:e.description,icon:e.icon,to:e.to,onClick:t=>N(t,e)},null,8,[`style`,`title`,`description`,`icon`,`to`,`onClick`])),[[o]])),128))]),A.value&&!a(j).disableTransitions&&a(j).usePageSpecificTransitions?(u(),g(y,{key:0,ref_key:`iconAnimation`,ref:T,icon:O.value,"icon-size":6*1.2,position:k.value,duration:1e3,"text-color":`text-neutral-400/50 dark:text-neutral-600/20`,started:w.value,onAnimationEndedOnce:M},null,8,[`icon`,`position`,`started`])):r((u(),p(`div`,S,[r(m(`div`,C,null,512),[[o]])])),[[o]])])}}});typeof v==`function`&&v(w);var T=w;export{T as default}; \ No newline at end of file +import{a8 as e,aM as t,al as n,d5 as r,d6 as i,d9 as a,dF as o,dK as s,dP as c,de as l,df as u,di as d,dl as f,do as p,dp as m,dw as h,dx as g,t as _}from"./index-TXtvn0DM.js";import{b as v}from"./route-block-DVyt-3Cw.js";import{b as y}from"./IconAnimation-Cx_ji59L.js";const b={flex:`~ col gap-4`,"font-normal":``},x={flex:`~ col gap-4`,"pb-12":``},S={key:1,text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-12rem)]`,"bottom-0":``,"right--10":``,"z--1":``,initial:{scale:.9,opacity:0,rotate:180},enter:{scale:1,opacity:1,rotate:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``},C={text:`60`,"i-solar:settings-bold-duotone":``};var w=i({__name:`index`,setup(i){let v=t(),w=s(!1),T=s(),E=s(),{t:D}=e(),O=s(``),k=s(``),A=s(!1),j=_();function M(){E.value?.()}async function N(e,t){let n=e.currentTarget,i=n.querySelector(`.menu-icon-item-icon`);if(!i)return;let a=i.getBoundingClientRect(),o=`${a.left}px, ${a.top}px`;O.value=t.icon,k.value=o,A.value=!0,await r(),w.value=!0}let P=v.beforeEach(async(e,t,n)=>{if(!j.usePageSpecificTransitions||j.disableTransitions){n();return}await new Promise(e=>{E.value=e}),P(),n()}),F=m(()=>[{title:D(`settings.pages.card.title`),description:D(`settings.pages.card.description`),icon:`i-solar:emoji-funny-square-bold-duotone`,to:`/settings/airi-card`},{title:D(`settings.pages.modules.title`),description:D(`settings.pages.modules.description`),icon:`i-solar:layers-bold-duotone`,to:`/settings/modules`},{title:D(`settings.pages.scene.title`),description:D(`settings.pages.scene.description`),icon:`i-solar:armchair-2-bold-duotone`,to:`/settings/scene`},{title:D(`settings.pages.models.title`),description:D(`settings.pages.models.description`),icon:`i-solar:people-nearby-bold-duotone`,to:`/settings/models`},{title:D(`settings.pages.memory.title`),description:D(`settings.pages.memory.description`),icon:`i-solar:leaf-bold-duotone`,to:`/settings/memory`},{title:D(`settings.pages.providers.title`),description:D(`settings.pages.providers.description`),icon:`i-solar:box-minimalistic-bold-duotone`,to:`/settings/providers`},{title:D(`settings.pages.themes.title`),description:D(`settings.pages.themes.description`),icon:`i-solar:filters-bold-duotone`,to:`/settings/appearance`}]);return(e,t)=>{let r=h(`motion`);return g(),a(`div`,b,[t[0]||=l(`div`,null,null,-1),l(`div`,x,[(g(!0),a(p,null,u(F.value,(e,t)=>f((g(),d(o(n),{key:e.to,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250,style:c({transitionDelay:`${t*50}ms`}),title:e.title,description:e.description,icon:e.icon,to:e.to,onClick:t=>N(t,e)},null,8,[`style`,`title`,`description`,`icon`,`to`,`onClick`])),[[r]])),128))]),A.value&&!o(j).disableTransitions&&o(j).usePageSpecificTransitions?(g(),d(y,{key:0,ref_key:`iconAnimation`,ref:T,icon:O.value,"icon-size":6*1.2,position:k.value,duration:1e3,"text-color":`text-neutral-400/50 dark:text-neutral-600/20`,started:w.value,onAnimationEndedOnce:M},null,8,[`icon`,`position`,`started`])):f((g(),a(`div`,S,[f(l(`div`,C,null,512),[[r]])])),[[r]])])}}});typeof v==`function`&&v(w);var T=w;export{T as default}; \ No newline at end of file diff --git a/assets/settings-CdksUo4j.js b/assets/settings-Dx_-xTvm.js similarity index 79% rename from assets/settings-CdksUo4j.js rename to assets/settings-Dx_-xTvm.js index a333ac145a3bbe5dc2cd7ea5ac0b4f7b37c43e1a..ed223f3c1aaec012929162d519ee39d8d4573f1b 100644 --- a/assets/settings-CdksUo4j.js +++ b/assets/settings-Dx_-xTvm.js @@ -1 +1 @@ -import{c as e,d as t}from"./theme-color-C-tbz8cx.js";import{B as n,a8 as r,aN as i,aP as a,aR as o,aZ as s,ay as c,dD as l,da as u,de as d,dg as f,di as p,dk as m,dm as h,dp as g,du as _}from"./index-Bcb2irKh.js";import{b as v}from"./HeaderLink-BvOcNkh0.js";const y={style:{paddingBottom:`env(safe-area-inset-bottom, 0px)`,paddingTop:`env(safe-area-inset-top, 0px)`,paddingRight:`env(safe-area-inset-right, 0px)`,paddingLeft:`env(safe-area-inset-left, 0px)`},"h-full":``,"w-full":``},b={class:`px-0 py-1 hidden sm:block md:px-3 md:py-3`,"w-full":``,"gap-2":``,bg:`$bg-color`},x={class:`h-[calc(100%-40px)] px-3 py-0 2xl:max-w-[2160px] sm:h-[calc(100%-56px)] md:py-0 xl:px-4`,flex:`~ col`,"mx-auto":``};var S=h({__name:`settings`,setup(h){let S=i(),C=s(),{t:w}=r(),T=n(),{allProvidersMetadata:E}=o(T),D=u(()=>{let e={"/settings/airi-card":{subtitle:w(`settings.title`),title:w(`settings.pages.card.title`)},"/settings/appearance":{subtitle:w(`settings.title`),title:w(`settings.pages.themes.title`)},"/settings/appearance/general":{subtitle:w(`settings.title`),title:w(`settings.pages.themes.general.title`)},"/settings/appearance/color-scheme":{subtitle:w(`settings.title`),title:w(`settings.pages.themes.color-scheme.title`)},"/settings/appearance/developer":{subtitle:w(`settings.title`),title:w(`settings.pages.themes.developer.title`)},"/settings/memory":{subtitle:w(`settings.title`),title:w(`settings.pages.memory.title`)},"/settings/models":{subtitle:w(`settings.title`),title:w(`settings.pages.models.title`)},"/settings/modules":{subtitle:w(`settings.title`),title:w(`settings.pages.modules.title`)},"/settings/modules/consciousness":{subtitle:w(`settings.title`),title:w(`settings.pages.modules.consciousness.title`)},"/settings/modules/speech":{subtitle:w(`settings.title`),title:w(`settings.pages.modules.speech.title`)},"/settings/modules/hearing":{subtitle:w(`settings.title`),title:w(`settings.pages.modules.hearing.title`)},"/settings/modules/memory-short-term":{subtitle:w(`settings.title`),title:w(`settings.pages.modules.memory-short-term.title`)},"/settings/modules/memory-long-term":{subtitle:w(`settings.title`),title:w(`settings.pages.modules.memory-long-term.title`)},"/settings/modules/messaging-discord":{subtitle:w(`settings.title`),title:w(`settings.pages.modules.messaging-discord.title`)},"/settings/modules/x":{subtitle:w(`settings.title`),title:w(`settings.pages.modules.x.title`)},"/settings/modules/gaming-minecraft":{subtitle:w(`settings.title`),title:w(`settings.pages.modules.gaming-minecraft.title`)},"/settings/modules/gaming-factorio":{subtitle:w(`settings.title`),title:w(`settings.pages.modules.gaming-factorio.title`)},"/settings/providers":{subtitle:w(`settings.title`),title:w(`settings.pages.providers.title`)},"/settings/scene":{subtitle:w(`settings.title`),title:w(`settings.pages.scene.title`)},"/settings":{title:w(`settings.title`)}};for(let t of E.value)e[`/settings/providers/${t.id}`]={subtitle:w(`settings.title`),title:w(t.nameKey)};return e}),O=u(()=>D.value[S.path]),{updateThemeColor:k}=t(e({light:`rgb(255 255 255)`,dark:`rgb(18 18 18)`}));return f(C,()=>k(),{immediate:!0}),f(S,()=>k(),{immediate:!0}),m(()=>k()),(e,t)=>(p(),g(`div`,y,[_(`div`,b,[d(v)]),_(`div`,x,[d(l(c),{title:O.value?.title,subtitle:O.value?.subtitle},null,8,[`title`,`subtitle`]),d(l(a))])]))}}),C=S;export{C as default}; \ No newline at end of file +import{b as e,c as t}from"./theme-color-CrZYT1IJ.js";import{B as n,a8 as r,aN as i,aP as a,aR as o,aS as s,ay as c,d6 as l,d9 as u,dF as d,de as f,dp as p,dt as m,dv as h,dx as g,dz as _}from"./index-TXtvn0DM.js";import{b as v}from"./HeaderLink-BMtWjY7k.js";const y={style:{paddingBottom:`env(safe-area-inset-bottom, 0px)`,paddingTop:`env(safe-area-inset-top, 0px)`,paddingRight:`env(safe-area-inset-right, 0px)`,paddingLeft:`env(safe-area-inset-left, 0px)`},"h-full":``,"w-full":``},b={class:`px-0 py-1 hidden sm:block md:px-3 md:py-3`,"w-full":``,"gap-2":``,bg:`$bg-color`},x={class:`h-[calc(100%-40px)] px-3 py-0 2xl:max-w-[2160px] sm:h-[calc(100%-56px)] md:py-0 xl:px-4`,flex:`~ col`,"mx-auto":``};var S=l({__name:`settings`,setup(l){let S=i(),C=s(),{t:w}=r(),T=n(),{allProvidersMetadata:E}=o(T),D=p(()=>{let e={"/settings/airi-card":{subtitle:w(`settings.title`),title:w(`settings.pages.card.title`)},"/settings/appearance":{subtitle:w(`settings.title`),title:w(`settings.pages.themes.title`)},"/settings/appearance/general":{subtitle:w(`settings.title`),title:w(`settings.pages.themes.general.title`)},"/settings/appearance/color-scheme":{subtitle:w(`settings.title`),title:w(`settings.pages.themes.color-scheme.title`)},"/settings/appearance/developer":{subtitle:w(`settings.title`),title:w(`settings.pages.themes.developer.title`)},"/settings/memory":{subtitle:w(`settings.title`),title:w(`settings.pages.memory.title`)},"/settings/models":{subtitle:w(`settings.title`),title:w(`settings.pages.models.title`)},"/settings/modules":{subtitle:w(`settings.title`),title:w(`settings.pages.modules.title`)},"/settings/modules/consciousness":{subtitle:w(`settings.title`),title:w(`settings.pages.modules.consciousness.title`)},"/settings/modules/speech":{subtitle:w(`settings.title`),title:w(`settings.pages.modules.speech.title`)},"/settings/modules/hearing":{subtitle:w(`settings.title`),title:w(`settings.pages.modules.hearing.title`)},"/settings/modules/memory-short-term":{subtitle:w(`settings.title`),title:w(`settings.pages.modules.memory-short-term.title`)},"/settings/modules/memory-long-term":{subtitle:w(`settings.title`),title:w(`settings.pages.modules.memory-long-term.title`)},"/settings/modules/messaging-discord":{subtitle:w(`settings.title`),title:w(`settings.pages.modules.messaging-discord.title`)},"/settings/modules/x":{subtitle:w(`settings.title`),title:w(`settings.pages.modules.x.title`)},"/settings/modules/gaming-minecraft":{subtitle:w(`settings.title`),title:w(`settings.pages.modules.gaming-minecraft.title`)},"/settings/modules/gaming-factorio":{subtitle:w(`settings.title`),title:w(`settings.pages.modules.gaming-factorio.title`)},"/settings/providers":{subtitle:w(`settings.title`),title:w(`settings.pages.providers.title`)},"/settings/scene":{subtitle:w(`settings.title`),title:w(`settings.pages.scene.title`)},"/settings":{title:w(`settings.title`)}};for(let t of E.value)e[`/settings/providers/${t.id}`]={subtitle:w(`settings.title`),title:w(t.nameKey)};return e}),O=p(()=>D.value[S.path]),{updateThemeColor:k}=t(e({light:`rgb(255 255 255)`,dark:`rgb(18 18 18)`}));return h(C,()=>k(),{immediate:!0}),h(S,()=>k(),{immediate:!0}),_(()=>k()),(e,t)=>(g(),u(`div`,y,[f(`div`,b,[m(v)]),f(`div`,x,[m(d(c),{title:O.value?.title,subtitle:O.value?.subtitle},null,8,[`title`,`subtitle`]),m(d(a))])]))}}),C=S;export{C as default}; \ No newline at end of file diff --git a/assets/speech-CHsV5f2H.js b/assets/speech-CHsV5f2H.js deleted file mode 100644 index 39f95006bf22810214f30bb7aaf8136eca11e1fa..0000000000000000000000000000000000000000 --- a/assets/speech-CHsV5f2H.js +++ /dev/null @@ -1 +0,0 @@ -import"./Basic-BIq-Of0k.js";import{b as e}from"./Textarea-BFPvaePN.js";import{B as t,a8 as n,aJ as r,aO as ee,aR as i,ac as a,ae as o,ag as te,ah as ne,ai as re,aj as s,at as c,av as ie,ax as l,c_ as ae,d0 as oe,d6 as u,d9 as d,dD as f,dG as p,dI as m,dN as h,dO as se,de as g,dg as ce,dh as le,di as _,dj as v,dk as ue,dm as de,dn as y,do as b,dp as x,dr as fe,du as S,dv as pe,dy as C,y as me,z as he}from"./index-Bcb2irKh.js";import{b as w}from"./route-block-DVyt-3Cw.js";const ge={flex:`~ col md:row gap-6`},_e={bg:`neutral-100 dark:[rgba(0,0,0,0.3)]`,"rounded-xl":``,"p-4":``,flex:`~ col gap-4`,class:`h-fit w-full md:w-[40%]`},ve={flex:`~ col gap-4`},ye={class:`text-lg text-neutral-500 md:text-2xl dark:text-neutral-400`},be={text:`neutral-400 dark:neutral-500`},xe={"max-w-full":``},Se={key:0,flex:`~ row gap-4`,style:{"scrollbar-width":`none`},"min-w-0":``,"of-x-scroll":``,"scroll-smooth":``,role:`radiogroup`},Ce={key:1},we={key:0},Te={flex:`~ col gap-4`},T={class:`text-lg md:text-2xl`},E={text:`neutral-400 dark:neutral-400`},D={key:0,class:`flex items-center justify-center py-4`},O={key:0},Ee={flex:`~ col gap-4`},De={key:0},Oe={class:`flex flex-col gap-4`},ke={flex:`~ row gap-4`},Ae={key:1,class:`space-y-6`},je={flex:`~ col gap-4`},Me={key:4,class:`mt-2 space-y-6`},Ne={key:0},Pe={flex:`~ col gap-4`},Fe={flex:`~ col gap-6`,class:`w-full md:w-[60%]`},Ie={"w-full":``,"rounded-xl":``},Le={class:`mb-4 text-lg text-neutral-500 md:text-2xl dark:text-neutral-400`,"w-full":``},Re={class:`inline-flex items-center gap-4`},ze={flex:`~ col gap-4`},Be={flex:`~ row`,"gap-4":``},Ve=[`disabled`],He={flex:`~ row`,"items-center":``,"gap-2":``},Ue=[`src`],k={text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-15rem)]`,"bottom-0":``,"right--5":``,"z--1":``,initial:{scale:.9,opacity:0,x:20},enter:{scale:1,opacity:1,x:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``};var A=de({__name:`speech`,setup(de){let{t:w}=n(),A=t(),j=me(),{configuredSpeechProvidersMetadata:M}=i(A),{activeSpeechProvider:N,activeSpeechModel:P,activeSpeechVoice:F,activeSpeechVoiceId:I,pitch:L,isLoadingSpeechProviderVoices:We,supportsModelListing:Ge,providerModels:R,isLoadingActiveProviderModels:z,activeProviderModelError:B,modelSearchQuery:V,speechProviderError:H,ssmlEnabled:U,availableVoices:W}=i(j),G=m(``),K=m(!1),q=m(`Hello, my name is AI Assistant`),J=m(``),Y=m(!1),X=m(``),Z=m(null),Q=m(``);ue(async()=>{await A.loadModelsForConfiguredProviders(),await j.loadVoicesForProvider(N.value)}),ce(N,async()=>{await A.loadModelsForConfiguredProviders(),await j.loadVoicesForProvider(N.value)});async function Ke(){if(!q.value.trim()&&!K.value||K.value&&!J.value.trim())return;if(!P.value){console.error(`No model selected`);return}if(!F.value){console.error(`No voice selected`);return}let e=await A.getProviderInstance(N.value);if(!e){console.error(`Failed to initialize speech provider`);return}let t=A.getProviderConfig(N.value);Y.value=!0,Q.value=``;try{X.value&&$();let n=K.value?J.value:j.supportsSSML?j.generateSSML(q.value,F.value,{...t,pitch:L.value}):q.value,r=await he({...e.speech(P.value,t),input:n,voice:F.value.id});X.value=URL.createObjectURL(new Blob([r])),setTimeout(()=>{Z.value&&Z.value.play()},100)}catch(e){console.error(`Error generating speech:`,e),Q.value=e instanceof Error?e.message:`An unknown error occurred`}finally{Y.value=!1}}function $(){Z.value&&(Z.value.pause(),Z.value.currentTime=0),X.value&&(URL.revokeObjectURL(X.value),X.value=``)}fe(()=>{X.value&&URL.revokeObjectURL(X.value)});function qe(e){F.value={id:e,name:e,description:e,previewURL:e,languages:[{code:`en`,title:`English`}],provider:N.value,gender:`male`}}function Je(e){P.value=e}return(t,n)=>{let i=le(`motion`);return _(),x(d,null,[S(`div`,ge,[S(`div`,_e,[S(`div`,null,[S(`div`,ve,[S(`div`,null,[S(`h2`,ye,h(f(w)(`settings.pages.modules.speech.sections.section.provider-voice-selection.title`)),1),S(`div`,be,[S(`span`,null,h(f(w)(`settings.pages.modules.speech.sections.section.provider-voice-selection.description`)),1)])]),S(`div`,xe,[f(M).length>0?(_(),x(`fieldset`,Se,[(_(!0),x(d,null,pe(f(M),e=>(_(),C(f(ne),{id:e.id,key:e.id,modelValue:f(N),"onUpdate:modelValue":n[0]||=e=>p(N)?N.value=e:null,name:`speech-provider`,value:e.id,title:e.localizedName||`Unknown`,description:e.localizedDescription},null,8,[`id`,`modelValue`,`value`,`title`,`description`]))),128))])):(_(),x(`div`,Ce,[g(f(ee),{class:`flex items-center gap-3 rounded-lg p-4`,border:`2 dashed neutral-200 dark:neutral-800`,bg:`neutral-50 dark:neutral-800`,transition:`colors duration-200 ease-in-out`,to:`/settings/providers`},{default:b(()=>n[13]||=[S(`div`,{"i-solar:warning-circle-line-duotone":``,class:`text-2xl text-amber-500 dark:text-amber-400`},null,-1),S(`div`,{class:`flex flex-col`},[S(`span`,{class:`font-medium`},`No Speech Providers Configured`),S(`span`,{class:`text-sm text-neutral-400 dark:text-neutral-500`},`Click here to set up your speech providers`)],-1),S(`div`,{"i-solar:arrow-right-line-duotone":``,class:`ml-auto text-xl text-neutral-400 dark:text-neutral-500`},null,-1)]),_:1,__:[13]})]))])]),S(`div`,null,[f(N)&&f(Ge)?(_(),x(`div`,we,[S(`div`,Te,[S(`div`,null,[S(`h2`,T,h(f(w)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.title`)),1),S(`div`,E,[S(`span`,null,h(f(w)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle`)),1)])]),f(z)?(_(),x(`div`,D,[n[14]||=S(`div`,{class:`mr-2 animate-spin`},[S(`div`,{"i-solar:spinner-line-duotone":``,"text-xl":``})],-1),S(`span`,null,h(f(w)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.loading`)),1)])):f(B)?(_(),C(f(o),{key:1,title:f(w)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.error`),error:f(B)},null,8,[`title`,`error`])):f(R).length===0&&!f(z)?(_(),C(f(s),{key:2,type:`warning`},{title:b(()=>[v(h(f(w)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models`)),1)]),content:b(()=>[v(h(f(w)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models_description`)),1)]),_:1})):f(R).length>0?(_(),C(f(re),{key:3,modelValue:f(P),"onUpdate:modelValue":n[1]||=e=>p(P)?P.value=e:null,"search-query":f(V),"onUpdate:searchQuery":n[2]||=e=>p(V)?V.value=e:null,items:f(R),searchable:!0,"search-placeholder":f(w)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.search_placeholder`),"search-no-results-title":f(w)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results`),"search-no-results-description":f(w)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results_description`,{query:f(V)}),"search-results-text":f(w)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.search_results`,{count:`{count}`,total:`{total}`}),"custom-input-placeholder":f(w)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.custom_model_placeholder`),"expand-button-text":f(w)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.expand`),"collapse-button-text":f(w)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.collapse`),"onUpdate:customValue":Je},null,8,[`modelValue`,`search-query`,`items`,`search-placeholder`,`search-no-results-title`,`search-no-results-description`,`search-results-text`,`custom-input-placeholder`,`expand-button-text`,`collapse-button-text`])):y(``,!0)])])):y(``,!0)])]),f(N)?(_(),x(`div`,O,[S(`div`,Ee,[n[24]||=S(`div`,null,[S(`h2`,{class:`text-lg text-neutral-500 md:text-2xl dark:text-neutral-400`},` Voice Configuration `),S(`div`,{text:`neutral-400 dark:neutral-500`},[S(`span`,null,`Customize how your AI assistant speaks`)])],-1),f(We)?(_(),x(`div`,De,[S(`div`,Oe,[g(f(a),{class:`w-full rounded-lg p-2.5 text-sm`},{default:b(()=>n[15]||=[S(`div`,{class:`h-1lh`},null,-1)]),_:1,__:[15]}),S(`div`,ke,[g(f(a),{class:`w-full rounded-lg p-4 text-sm`},{default:b(()=>n[16]||=[S(`div`,{class:`h-1lh`},null,-1)]),_:1,__:[16]}),g(f(a),{class:`w-full rounded-lg p-4 text-sm`},{default:b(()=>n[17]||=[S(`div`,{class:`h-1lh`},null,-1)]),_:1,__:[17]}),g(f(a),{class:`w-full rounded-lg p-4 text-sm`},{default:b(()=>n[18]||=[S(`div`,{class:`h-1lh`},null,-1)]),_:1,__:[18]})]),g(f(a),{class:`w-full rounded-lg p-3 text-sm`},{default:b(()=>n[19]||=[S(`div`,{class:`h-1lh`},null,-1)]),_:1,__:[19]})])])):f(W)[f(N)]&&f(W)[f(N)].length>0?(_(),x(`div`,Ae,[g(f(te),{"search-query":G.value,"onUpdate:searchQuery":n[3]||=e=>G.value=e,"voice-id":f(I),"onUpdate:voiceId":n[4]||=e=>p(I)?I.value=e:null,voices:f(W)[f(N)]?.map(e=>({id:e.id,name:e.name,description:e.description,previewURL:e.previewURL,customizable:!1})),searchable:!0,"search-placeholder":f(w)(`settings.pages.modules.speech.sections.section.provider-voice-selection.search_voices_placeholder`),"search-no-results-title":f(w)(`settings.pages.modules.speech.sections.section.provider-voice-selection.no_voices`),"search-no-results-description":f(w)(`settings.pages.modules.speech.sections.section.provider-voice-selection.no_voices_description`),"search-results-text":f(w)(`settings.pages.modules.speech.sections.section.provider-voice-selection.search_voices_results`,{count:0,total:0}),"custom-input-placeholder":f(w)(`settings.pages.modules.speech.sections.section.provider-voice-selection.custom_voice_placeholder`),"expand-button-text":f(w)(`settings.pages.modules.speech.sections.section.provider-voice-selection.show_more`),"collapse-button-text":f(w)(`settings.pages.modules.speech.sections.section.provider-voice-selection.show_less`),"play-button-text":f(w)(`settings.pages.modules.speech.sections.section.provider-voice-selection.play_sample`),"pause-button-text":f(w)(`settings.pages.modules.speech.sections.section.provider-voice-selection.pause`),"onUpdate:customValue":qe},null,8,[`search-query`,`voice-id`,`voices`,`search-placeholder`,`search-no-results-title`,`search-no-results-description`,`search-results-text`,`custom-input-placeholder`,`expand-button-text`,`collapse-button-text`,`play-button-text`,`pause-button-text`])])):f(H)?(_(),C(f(o),{key:2,class:`mb-2`,title:`Error loading voices`,error:f(H)},null,8,[`error`])):(_(),C(f(s),{key:3,type:`warning`,icon:`i-solar:info-circle-line-duotone`,class:`mb-2`},{title:b(()=>n[20]||=[v(` No voices available `)]),content:b(()=>n[21]||=[v(` No voices were found for this provider. You can enter a custom voice name below. `)]),_:1})),S(`div`,je,[g(f(c),{modelValue:f(L),"onUpdate:modelValue":n[5]||=e=>p(L)?L.value=e:null,label:`Pitch`,description:`Tune the pitch of the voice`,min:-100,max:100,step:1,"format-value":e=>`${e}%`},null,8,[`modelValue`,`format-value`]),g(f(l),{modelValue:f(U),"onUpdate:modelValue":n[6]||=e=>p(U)?U.value=e:null,label:`Enable SSML`,description:`Enable Speech Synthesis Markup Language for more control over speech output`},null,8,[`modelValue`])]),!f(W)[f(N)]||f(W)[f(N)].length===0?(_(),x(`div`,Me,[g(f(ie),{modelValue:f(I),"onUpdate:modelValue":n[7]||=e=>p(I)?I.value=e:null,type:`text`,label:`Voice ID`,description:`Enter the voice ID for your custom voice`,placeholder:`Enter voice name (e.g., 'Rachel', 'Josh')`},null,8,[`modelValue`]),f(N)===`elevenlabs`?(_(),x(`div`,Ne,[n[23]||=S(`label`,{class:`mb-1 block text-sm font-medium`},` Model `,-1),u(S(`select`,{"onUpdate:modelValue":n[8]||=e=>p(P)?P.value=e:null,class:`w-full border border-neutral-300 rounded bg-white px-3 py-2 dark:border-neutral-700 dark:bg-neutral-900`},n[22]||=[S(`option`,{value:`eleven_monolingual_v1`},` Monolingual v1 `,-1),S(`option`,{value:`eleven_multilingual_v1`},` Multilingual v1 `,-1),S(`option`,{value:`eleven_multilingual_v2`},` Multilingual v2 `,-1)],512),[[ae,f(P)]])])):y(``,!0),S(`div`,Pe,[g(f(c),{modelValue:f(L),"onUpdate:modelValue":n[9]||=e=>p(L)?L.value=e:null,label:`Pitch`,description:`Tune the pitch of the voice`,min:-100,max:100,step:1,"format-value":e=>`${e}%`},null,8,[`modelValue`,`format-value`])])])):y(``,!0)])])):y(``,!0)]),S(`div`,Fe,[S(`div`,Ie,[S(`h2`,Le,[S(`div`,Re,[g(f(r)),S(`div`,null,h(f(w)(`settings.pages.providers.provider.elevenlabs.playground.title`)),1)])]),S(`div`,ze,[g(f(l),{modelValue:K.value,"onUpdate:modelValue":n[10]||=e=>K.value=e,label:`Use Custom SSML`,description:`Enable to input raw SSML instead of plain text`},null,8,[`modelValue`]),K.value?u((_(),x(`textarea`,{key:1,"onUpdate:modelValue":n[12]||=e=>J.value=e,placeholder:`Enter SSML text...`,border:`neutral-100 dark:neutral-800 solid 2 focus:neutral-200 dark:focus:neutral-700`,transition:`all duration-250 ease-in-out`,bg:`neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900`,"h-48":``,"w-full":``,"rounded-lg":``,"px-3":``,"py-2":``,"text-sm":``,"font-mono":``,"outline-none":``},null,512)),[[oe,J.value]]):(_(),C(f(e),{key:0,modelValue:q.value,"onUpdate:modelValue":n[11]||=e=>q.value=e,"h-24":``,"w-full":``,placeholder:f(w)(`settings.pages.providers.provider.elevenlabs.playground.fields.field.input.placeholder`)},null,8,[`modelValue`,`placeholder`])),S(`div`,Be,[S(`button`,{border:`neutral-800 dark:neutral-200 solid 2`,transition:`border duration-250 ease-in-out`,"rounded-lg":``,"px-4":``,text:`neutral-100 dark:neutral-900`,"py-2":``,"text-sm":``,disabled:Y.value||!q.value.trim()&&!K.value||K.value&&!J.value.trim()||!f(F),class:se({"opacity-50 cursor-not-allowed":Y.value||!q.value.trim()&&!K.value||K.value&&!J.value.trim()||!f(F)}),bg:`neutral-700 dark:neutral-300`,onClick:Ke},[S(`div`,He,[n[25]||=S(`div`,{"i-solar:play-circle-bold-duotone":``},null,-1),S(`span`,null,h(Y.value?f(w)(`settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.generating`):f(w)(`settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.label`)),1)])],10,Ve),X.value?(_(),x(`button`,{key:0,border:`primary-300 dark:primary-800 solid 2`,transition:`border duration-250 ease-in-out`,"rounded-lg":``,"px-4":``,"py-2":``,"text-sm":``,onClick:$},n[26]||=[S(`div`,{flex:`~ row`,"items-center":``,"gap-2":``},[S(`div`,{"i-solar:stop-circle-bold-duotone":``}),S(`span`,null,`Stop`)],-1)])):y(``,!0)]),X.value?(_(),x(`audio`,{key:2,ref_key:`audioPlayer`,ref:Z,src:X.value,controls:``,class:`mt-2 w-full`},null,8,Ue)):y(``,!0)])])])]),u((_(),x(`div`,k,n[27]||=[S(`div`,{text:`60`,"i-solar:user-speak-rounded-bold-duotone":``},null,-1)])),[[i]])],64)}}});typeof w==`function`&&w(A);var j=A;export{j as default}; \ No newline at end of file diff --git a/assets/speech-KhxwETXc.js b/assets/speech-KhxwETXc.js new file mode 100644 index 0000000000000000000000000000000000000000..c2595cff276646c4039ac13a74177b4274ece92a --- /dev/null +++ b/assets/speech-KhxwETXc.js @@ -0,0 +1 @@ +import"./Basic-8xhCMoI8.js";import{b as e}from"./Textarea-BsLlwm-1.js";import{B as t,a8 as n,aJ as r,aO as ee,aR as i,ac as a,ae as o,ag as te,ah as ne,ai as re,aj as s,at as c,av as ie,ax as l,c$ as ae,d1 as oe,d6 as se,d7 as u,d8 as d,d9 as f,dF as p,dI as m,dK as h,dN as g,dO as ce,db as le,de as _,df as ue,di as v,dl as y,do as b,dt as x,dv as de,dw as fe,dx as S,dy as C,dz as pe,y as me,z as he}from"./index-TXtvn0DM.js";import{b as w}from"./route-block-DVyt-3Cw.js";const ge={flex:`~ col md:row gap-6`},_e={bg:`neutral-100 dark:[rgba(0,0,0,0.3)]`,"rounded-xl":``,"p-4":``,flex:`~ col gap-4`,class:`h-fit w-full md:w-[40%]`},ve={flex:`~ col gap-4`},ye={class:`text-lg text-neutral-500 md:text-2xl dark:text-neutral-400`},be={text:`neutral-400 dark:neutral-500`},xe={"max-w-full":``},Se={key:0,flex:`~ row gap-4`,style:{"scrollbar-width":`none`},"min-w-0":``,"of-x-scroll":``,"scroll-smooth":``,role:`radiogroup`},Ce={key:1},we={key:0},Te={flex:`~ col gap-4`},T={class:`text-lg md:text-2xl`},E={text:`neutral-400 dark:neutral-400`},D={key:0,class:`flex items-center justify-center py-4`},O={key:0},Ee={flex:`~ col gap-4`},De={key:0},Oe={class:`flex flex-col gap-4`},ke={flex:`~ row gap-4`},Ae={key:1,class:`space-y-6`},je={flex:`~ col gap-4`},Me={key:4,class:`mt-2 space-y-6`},Ne={key:0},Pe={flex:`~ col gap-4`},Fe={flex:`~ col gap-6`,class:`w-full md:w-[60%]`},Ie={"w-full":``,"rounded-xl":``},Le={class:`mb-4 text-lg text-neutral-500 md:text-2xl dark:text-neutral-400`,"w-full":``},Re={class:`inline-flex items-center gap-4`},ze={flex:`~ col gap-4`},Be={flex:`~ row`,"gap-4":``},Ve=[`disabled`],He={flex:`~ row`,"items-center":``,"gap-2":``},Ue=[`src`],k={text:`neutral-200/50 dark:neutral-600/20`,"pointer-events-none":``,fixed:``,top:`[calc(100dvh-15rem)]`,"bottom-0":``,"right--5":``,"z--1":``,initial:{scale:.9,opacity:0,x:20},enter:{scale:1,opacity:1,x:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``};var A=se({__name:`speech`,setup(se){let{t:w}=n(),A=t(),j=me(),{configuredSpeechProvidersMetadata:M}=i(A),{activeSpeechProvider:N,activeSpeechModel:P,activeSpeechVoice:F,activeSpeechVoiceId:I,pitch:L,isLoadingSpeechProviderVoices:We,supportsModelListing:Ge,providerModels:R,isLoadingActiveProviderModels:z,activeProviderModelError:B,modelSearchQuery:V,speechProviderError:H,ssmlEnabled:U,availableVoices:W}=i(j),G=h(``),K=h(!1),q=h(`Hello, my name is AI Assistant`),J=h(``),Y=h(!1),X=h(``),Z=h(null),Q=h(``);pe(async()=>{await A.loadModelsForConfiguredProviders(),await j.loadVoicesForProvider(N.value)}),de(N,async()=>{await A.loadModelsForConfiguredProviders(),await j.loadVoicesForProvider(N.value)});async function Ke(){if(!q.value.trim()&&!K.value||K.value&&!J.value.trim())return;if(!P.value){console.error(`No model selected`);return}if(!F.value){console.error(`No voice selected`);return}let e=await A.getProviderInstance(N.value);if(!e){console.error(`Failed to initialize speech provider`);return}let t=A.getProviderConfig(N.value);Y.value=!0,Q.value=``;try{X.value&&$();let n=K.value?J.value:j.supportsSSML?j.generateSSML(q.value,F.value,{...t,pitch:L.value}):q.value,r=await he({...e.speech(P.value,t),input:n,voice:F.value.id});X.value=URL.createObjectURL(new Blob([r])),setTimeout(()=>{Z.value&&Z.value.play()},100)}catch(e){console.error(`Error generating speech:`,e),Q.value=e instanceof Error?e.message:`An unknown error occurred`}finally{Y.value=!1}}function $(){Z.value&&(Z.value.pause(),Z.value.currentTime=0),X.value&&(URL.revokeObjectURL(X.value),X.value=``)}le(()=>{X.value&&URL.revokeObjectURL(X.value)});function qe(e){F.value={id:e,name:e,description:e,previewURL:e,languages:[{code:`en`,title:`English`}],provider:N.value,gender:`male`}}function Je(e){P.value=e}return(t,n)=>{let i=fe(`motion`);return S(),f(b,null,[_(`div`,ge,[_(`div`,_e,[_(`div`,null,[_(`div`,ve,[_(`div`,null,[_(`h2`,ye,g(p(w)(`settings.pages.modules.speech.sections.section.provider-voice-selection.title`)),1),_(`div`,be,[_(`span`,null,g(p(w)(`settings.pages.modules.speech.sections.section.provider-voice-selection.description`)),1)])]),_(`div`,xe,[p(M).length>0?(S(),f(`fieldset`,Se,[(S(!0),f(b,null,ue(p(M),e=>(S(),v(p(ne),{id:e.id,key:e.id,modelValue:p(N),"onUpdate:modelValue":n[0]||=e=>m(N)?N.value=e:null,name:`speech-provider`,value:e.id,title:e.localizedName||`Unknown`,description:e.localizedDescription},null,8,[`id`,`modelValue`,`value`,`title`,`description`]))),128))])):(S(),f(`div`,Ce,[x(p(ee),{class:`flex items-center gap-3 rounded-lg p-4`,border:`2 dashed neutral-200 dark:neutral-800`,bg:`neutral-50 dark:neutral-800`,transition:`colors duration-200 ease-in-out`,to:`/settings/providers`},{default:d(()=>n[13]||=[_(`div`,{"i-solar:warning-circle-line-duotone":``,class:`text-2xl text-amber-500 dark:text-amber-400`},null,-1),_(`div`,{class:`flex flex-col`},[_(`span`,{class:`font-medium`},`No Speech Providers Configured`),_(`span`,{class:`text-sm text-neutral-400 dark:text-neutral-500`},`Click here to set up your speech providers`)],-1),_(`div`,{"i-solar:arrow-right-line-duotone":``,class:`ml-auto text-xl text-neutral-400 dark:text-neutral-500`},null,-1)]),_:1,__:[13]})]))])]),_(`div`,null,[p(N)&&p(Ge)?(S(),f(`div`,we,[_(`div`,Te,[_(`div`,null,[_(`h2`,T,g(p(w)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.title`)),1),_(`div`,E,[_(`span`,null,g(p(w)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle`)),1)])]),p(z)?(S(),f(`div`,D,[n[14]||=_(`div`,{class:`mr-2 animate-spin`},[_(`div`,{"i-solar:spinner-line-duotone":``,"text-xl":``})],-1),_(`span`,null,g(p(w)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.loading`)),1)])):p(B)?(S(),v(p(o),{key:1,title:p(w)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.error`),error:p(B)},null,8,[`title`,`error`])):p(R).length===0&&!p(z)?(S(),v(p(s),{key:2,type:`warning`},{title:d(()=>[C(g(p(w)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models`)),1)]),content:d(()=>[C(g(p(w)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models_description`)),1)]),_:1})):p(R).length>0?(S(),v(p(re),{key:3,modelValue:p(P),"onUpdate:modelValue":n[1]||=e=>m(P)?P.value=e:null,"search-query":p(V),"onUpdate:searchQuery":n[2]||=e=>m(V)?V.value=e:null,items:p(R),searchable:!0,"search-placeholder":p(w)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.search_placeholder`),"search-no-results-title":p(w)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results`),"search-no-results-description":p(w)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results_description`,{query:p(V)}),"search-results-text":p(w)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.search_results`,{count:`{count}`,total:`{total}`}),"custom-input-placeholder":p(w)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.custom_model_placeholder`),"expand-button-text":p(w)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.expand`),"collapse-button-text":p(w)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.collapse`),"onUpdate:customValue":Je},null,8,[`modelValue`,`search-query`,`items`,`search-placeholder`,`search-no-results-title`,`search-no-results-description`,`search-results-text`,`custom-input-placeholder`,`expand-button-text`,`collapse-button-text`])):u(``,!0)])])):u(``,!0)])]),p(N)?(S(),f(`div`,O,[_(`div`,Ee,[n[24]||=_(`div`,null,[_(`h2`,{class:`text-lg text-neutral-500 md:text-2xl dark:text-neutral-400`},` Voice Configuration `),_(`div`,{text:`neutral-400 dark:neutral-500`},[_(`span`,null,`Customize how your AI assistant speaks`)])],-1),p(We)?(S(),f(`div`,De,[_(`div`,Oe,[x(p(a),{class:`w-full rounded-lg p-2.5 text-sm`},{default:d(()=>n[15]||=[_(`div`,{class:`h-1lh`},null,-1)]),_:1,__:[15]}),_(`div`,ke,[x(p(a),{class:`w-full rounded-lg p-4 text-sm`},{default:d(()=>n[16]||=[_(`div`,{class:`h-1lh`},null,-1)]),_:1,__:[16]}),x(p(a),{class:`w-full rounded-lg p-4 text-sm`},{default:d(()=>n[17]||=[_(`div`,{class:`h-1lh`},null,-1)]),_:1,__:[17]}),x(p(a),{class:`w-full rounded-lg p-4 text-sm`},{default:d(()=>n[18]||=[_(`div`,{class:`h-1lh`},null,-1)]),_:1,__:[18]})]),x(p(a),{class:`w-full rounded-lg p-3 text-sm`},{default:d(()=>n[19]||=[_(`div`,{class:`h-1lh`},null,-1)]),_:1,__:[19]})])])):p(W)[p(N)]&&p(W)[p(N)].length>0?(S(),f(`div`,Ae,[x(p(te),{"search-query":G.value,"onUpdate:searchQuery":n[3]||=e=>G.value=e,"voice-id":p(I),"onUpdate:voiceId":n[4]||=e=>m(I)?I.value=e:null,voices:p(W)[p(N)]?.map(e=>({id:e.id,name:e.name,description:e.description,previewURL:e.previewURL,customizable:!1})),searchable:!0,"search-placeholder":p(w)(`settings.pages.modules.speech.sections.section.provider-voice-selection.search_voices_placeholder`),"search-no-results-title":p(w)(`settings.pages.modules.speech.sections.section.provider-voice-selection.no_voices`),"search-no-results-description":p(w)(`settings.pages.modules.speech.sections.section.provider-voice-selection.no_voices_description`),"search-results-text":p(w)(`settings.pages.modules.speech.sections.section.provider-voice-selection.search_voices_results`,{count:0,total:0}),"custom-input-placeholder":p(w)(`settings.pages.modules.speech.sections.section.provider-voice-selection.custom_voice_placeholder`),"expand-button-text":p(w)(`settings.pages.modules.speech.sections.section.provider-voice-selection.show_more`),"collapse-button-text":p(w)(`settings.pages.modules.speech.sections.section.provider-voice-selection.show_less`),"play-button-text":p(w)(`settings.pages.modules.speech.sections.section.provider-voice-selection.play_sample`),"pause-button-text":p(w)(`settings.pages.modules.speech.sections.section.provider-voice-selection.pause`),"onUpdate:customValue":qe},null,8,[`search-query`,`voice-id`,`voices`,`search-placeholder`,`search-no-results-title`,`search-no-results-description`,`search-results-text`,`custom-input-placeholder`,`expand-button-text`,`collapse-button-text`,`play-button-text`,`pause-button-text`])])):p(H)?(S(),v(p(o),{key:2,class:`mb-2`,title:`Error loading voices`,error:p(H)},null,8,[`error`])):(S(),v(p(s),{key:3,type:`warning`,icon:`i-solar:info-circle-line-duotone`,class:`mb-2`},{title:d(()=>n[20]||=[C(` No voices available `)]),content:d(()=>n[21]||=[C(` No voices were found for this provider. You can enter a custom voice name below. `)]),_:1})),_(`div`,je,[x(p(c),{modelValue:p(L),"onUpdate:modelValue":n[5]||=e=>m(L)?L.value=e:null,label:`Pitch`,description:`Tune the pitch of the voice`,min:-100,max:100,step:1,"format-value":e=>`${e}%`},null,8,[`modelValue`,`format-value`]),x(p(l),{modelValue:p(U),"onUpdate:modelValue":n[6]||=e=>m(U)?U.value=e:null,label:`Enable SSML`,description:`Enable Speech Synthesis Markup Language for more control over speech output`},null,8,[`modelValue`])]),!p(W)[p(N)]||p(W)[p(N)].length===0?(S(),f(`div`,Me,[x(p(ie),{modelValue:p(I),"onUpdate:modelValue":n[7]||=e=>m(I)?I.value=e:null,type:`text`,label:`Voice ID`,description:`Enter the voice ID for your custom voice`,placeholder:`Enter voice name (e.g., 'Rachel', 'Josh')`},null,8,[`modelValue`]),p(N)===`elevenlabs`?(S(),f(`div`,Ne,[n[23]||=_(`label`,{class:`mb-1 block text-sm font-medium`},` Model `,-1),y(_(`select`,{"onUpdate:modelValue":n[8]||=e=>m(P)?P.value=e:null,class:`w-full border border-neutral-300 rounded bg-white px-3 py-2 dark:border-neutral-700 dark:bg-neutral-900`},n[22]||=[_(`option`,{value:`eleven_monolingual_v1`},` Monolingual v1 `,-1),_(`option`,{value:`eleven_multilingual_v1`},` Multilingual v1 `,-1),_(`option`,{value:`eleven_multilingual_v2`},` Multilingual v2 `,-1)],512),[[ae,p(P)]])])):u(``,!0),_(`div`,Pe,[x(p(c),{modelValue:p(L),"onUpdate:modelValue":n[9]||=e=>m(L)?L.value=e:null,label:`Pitch`,description:`Tune the pitch of the voice`,min:-100,max:100,step:1,"format-value":e=>`${e}%`},null,8,[`modelValue`,`format-value`])])])):u(``,!0)])])):u(``,!0)]),_(`div`,Fe,[_(`div`,Ie,[_(`h2`,Le,[_(`div`,Re,[x(p(r)),_(`div`,null,g(p(w)(`settings.pages.providers.provider.elevenlabs.playground.title`)),1)])]),_(`div`,ze,[x(p(l),{modelValue:K.value,"onUpdate:modelValue":n[10]||=e=>K.value=e,label:`Use Custom SSML`,description:`Enable to input raw SSML instead of plain text`},null,8,[`modelValue`]),K.value?y((S(),f(`textarea`,{key:1,"onUpdate:modelValue":n[12]||=e=>J.value=e,placeholder:`Enter SSML text...`,border:`neutral-100 dark:neutral-800 solid 2 focus:neutral-200 dark:focus:neutral-700`,transition:`all duration-250 ease-in-out`,bg:`neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900`,"h-48":``,"w-full":``,"rounded-lg":``,"px-3":``,"py-2":``,"text-sm":``,"font-mono":``,"outline-none":``},null,512)),[[oe,J.value]]):(S(),v(p(e),{key:0,modelValue:q.value,"onUpdate:modelValue":n[11]||=e=>q.value=e,"h-24":``,"w-full":``,placeholder:p(w)(`settings.pages.providers.provider.elevenlabs.playground.fields.field.input.placeholder`)},null,8,[`modelValue`,`placeholder`])),_(`div`,Be,[_(`button`,{border:`neutral-800 dark:neutral-200 solid 2`,transition:`border duration-250 ease-in-out`,"rounded-lg":``,"px-4":``,text:`neutral-100 dark:neutral-900`,"py-2":``,"text-sm":``,disabled:Y.value||!q.value.trim()&&!K.value||K.value&&!J.value.trim()||!p(F),class:ce({"opacity-50 cursor-not-allowed":Y.value||!q.value.trim()&&!K.value||K.value&&!J.value.trim()||!p(F)}),bg:`neutral-700 dark:neutral-300`,onClick:Ke},[_(`div`,He,[n[25]||=_(`div`,{"i-solar:play-circle-bold-duotone":``},null,-1),_(`span`,null,g(Y.value?p(w)(`settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.generating`):p(w)(`settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.label`)),1)])],10,Ve),X.value?(S(),f(`button`,{key:0,border:`primary-300 dark:primary-800 solid 2`,transition:`border duration-250 ease-in-out`,"rounded-lg":``,"px-4":``,"py-2":``,"text-sm":``,onClick:$},n[26]||=[_(`div`,{flex:`~ row`,"items-center":``,"gap-2":``},[_(`div`,{"i-solar:stop-circle-bold-duotone":``}),_(`span`,null,`Stop`)],-1)])):u(``,!0)]),X.value?(S(),f(`audio`,{key:2,ref_key:`audioPlayer`,ref:Z,src:X.value,controls:``,class:`mt-2 w-full`},null,8,Ue)):u(``,!0)])])])]),y((S(),f(`div`,k,n[27]||=[_(`div`,{text:`60`,"i-solar:user-speak-rounded-bold-duotone":``},null,-1)])),[[i]])],64)}}});typeof w==`function`&&w(A);var j=A;export{j as default}; \ No newline at end of file diff --git a/assets/stage-Bsg2THie.js b/assets/stage-Bsg2THie.js new file mode 100644 index 0000000000000000000000000000000000000000..8fc90bb3cb15fca84a6afc4fb19d864b4085d193 --- /dev/null +++ b/assets/stage-Bsg2THie.js @@ -0,0 +1 @@ +import"./Basic-8xhCMoI8.js";import{c as e,d as t}from"./theme-color-CrZYT1IJ.js";import{aR as n,aS as r,aZ as i,a_ as a,b3 as o,d6 as s,d7 as c,d8 as l,dF as u,dK as d,de as f,di as p,dt as m,dv as h,dx as g,dz as _,u as v}from"./index-TXtvn0DM.js";import"./import-url-browser-CzbE4_30.js";import"./duckdb-mvp-1eM9E9sB.js";import"./HeaderLink-BMtWjY7k.js";import{b as y}from"./route-block-DVyt-3Cw.js";import{b}from"./Scenes-D6JBpdgW.js";import{b as x,c as S,d as C,e as w,f as T,g as E}from"./AnimatedWave-1XImhiJl.js";const D={relative:``,flex:`~ col`,"z-2":``,"h-100dvh":``,"w-100vw":``,"of-hidden":``},O={class:`px-0 py-1 md:px-3 md:py-3`,"w-full":``,"gap-2":``},k={relative:``,flex:`~ 1 row gap-y-0 gap-x-2 R(),{immediate:!0}),_(()=>R()),(e,t)=>(g(),p(E,null,{default:l(()=>[m(x,{class:`widgets top-widgets`,"fill-color":u(y)?`oklch(35% calc(var(--chromatic-chroma) * 0.6) var(--chromatic-hue))`:`color-mix(in srgb, oklch(95% calc(var(--chromatic-chroma-50) * 0.5) var(--chromatic-hue)) 80%, oklch(100% 0 360))`},{default:l(()=>[f(`div`,D,[f(`div`,O,[m(T,{class:`hidden md:flex`}),m(C,{class:`flex md:hidden`})]),f(`div`,k,[m(u(b),{"flex-1":``,"min-w":`1/2`,paused:A.value,"focus-at":{x:u(M).x.value,y:u(M).y.value},"x-offset":`${u(L)?u(P).x:u(P).x-10}%`,"y-offset":u(F).y,scale:u(N)},null,8,[`paused`,`focus-at`,`x-offset`,`y-offset`,`scale`]),u(L)?c(``,!0):(g(),p(w,{key:0,h:`85dvh`,absolute:``,"right-4":``,flex:``,"flex-1":``,"flex-col":``,"max-w":`500px`,"min-w":`30%`})),u(L)?(g(),p(S,{key:1,onSettingsOpen:j})):c(``,!0)])])]),_:1},8,[`fill-color`])]),_:1}))}});typeof y==`function`&&y(A);var j=A;export{j as default}; \ No newline at end of file diff --git a/assets/stage-DR-1n1Ev.js b/assets/stage-DR-1n1Ev.js deleted file mode 100644 index def2d458ae607ffd89bda869bfa6d67bacead585..0000000000000000000000000000000000000000 --- a/assets/stage-DR-1n1Ev.js +++ /dev/null @@ -1 +0,0 @@ -import{a_ as e,d8 as t,dD as n,dP as r,de as i,di as a,dm as o,dp as s}from"./index-Bcb2irKh.js";var c=o({__name:`stage`,setup(o){let{top:c,right:l,bottom:u,left:d}=e();return(e,o)=>{let f=t(`RouterView`);return a(),s(`main`,{text:`gray-700 dark:gray-200`,"h-full":``,"font-cuteen":``,style:r({paddingTop:`${n(c)}px`,paddingRight:`${n(l)}px`,paddingBottom:`${n(u)}px`,paddingLeft:`${n(d)}px`})},[i(f)],4)}}}),l=c;export{l as default}; \ No newline at end of file diff --git a/assets/stage-Skn6SMJV.js b/assets/stage-Skn6SMJV.js deleted file mode 100644 index c6d7da289163e534b5489dc6685a80185ee22b96..0000000000000000000000000000000000000000 --- a/assets/stage-Skn6SMJV.js +++ /dev/null @@ -1 +0,0 @@ -import"./Basic-BIq-Of0k.js";import{b as e,d as t}from"./theme-color-C-tbz8cx.js";import{aR as n,aS as r,aT as i,aY as a,aZ as o,dD as s,dI as c,de as l,dg as u,di as d,dk as f,dm as p,dn as m,do as h,du as g,dy as _,u as v}from"./index-Bcb2irKh.js";import"./import-url-browser-CzbE4_30.js";import"./duckdb-mvp-1eM9E9sB.js";import"./HeaderLink-BvOcNkh0.js";import{b as y}from"./route-block-DVyt-3Cw.js";import{b}from"./Scenes-ELpQ5xkP.js";import{b as x,c as S,d as C,e as w,f as T,g as E}from"./AnimatedWave-Co1wJ2Kd.js";const D={relative:``,flex:`~ col`,"z-2":``,"h-100dvh":``,"w-100vw":``,"of-hidden":``},O={class:`px-0 py-1 md:px-3 md:py-3`,"w-full":``,"gap-2":``},k={relative:``,flex:`~ 1 row gap-y-0 gap-x-2 R(),{immediate:!0}),f(()=>R()),(e,t)=>(d(),_(E,null,{default:h(()=>[l(x,{class:`widgets top-widgets`,"fill-color":s(y)?`oklch(35% calc(var(--chromatic-chroma) * 0.6) var(--chromatic-hue))`:`color-mix(in srgb, oklch(95% calc(var(--chromatic-chroma-50) * 0.5) var(--chromatic-hue)) 80%, oklch(100% 0 360))`},{default:h(()=>[g(`div`,D,[g(`div`,O,[l(T,{class:`hidden md:flex`}),l(C,{class:`flex md:hidden`})]),g(`div`,k,[l(s(b),{"flex-1":``,"min-w":`1/2`,paused:A.value,"focus-at":{x:s(M).x.value,y:s(M).y.value},"x-offset":`${s(L)?s(P).x:s(P).x-10}%`,"y-offset":s(F).y,scale:s(N)},null,8,[`paused`,`focus-at`,`x-offset`,`y-offset`,`scale`]),s(L)?m(``,!0):(d(),_(w,{key:0,h:`85dvh`,absolute:``,"right-4":``,flex:``,"flex-1":``,"flex-col":``,"max-w":`500px`,"min-w":`30%`})),s(L)?(d(),_(S,{key:1,onSettingsOpen:j})):m(``,!0)])])]),_:1},8,[`fill-color`])]),_:1}))}});typeof y==`function`&&y(A);var j=A;export{j as default}; \ No newline at end of file diff --git a/assets/stage-kAQNRdiU.js b/assets/stage-kAQNRdiU.js new file mode 100644 index 0000000000000000000000000000000000000000..2fe07424709680f0a6f67b7b095b87e25555554b --- /dev/null +++ b/assets/stage-kAQNRdiU.js @@ -0,0 +1 @@ +import{aT as e,d6 as t,d9 as n,dF as r,dP as i,dn as a,dt as o,dx as s}from"./index-TXtvn0DM.js";var c=t({__name:`stage`,setup(t){let{top:c,right:l,bottom:u,left:d}=e();return(e,t)=>{let f=a(`RouterView`);return s(),n(`main`,{text:`gray-700 dark:gray-200`,"h-full":``,"font-cuteen":``,style:i({paddingTop:`${r(c)}px`,paddingRight:`${r(l)}px`,paddingBottom:`${r(u)}px`,paddingLeft:`${r(d)}px`})},[o(f)],4)}}}),l=c;export{l as default}; \ No newline at end of file diff --git a/assets/sury-GtnkadyM-_VCptIFV.js b/assets/sury-GtnkadyM-C_RygoD3.js similarity index 71% rename from assets/sury-GtnkadyM-_VCptIFV.js rename to assets/sury-GtnkadyM-C_RygoD3.js index a3e160fe456d0289e7306efe789a2f24ac77175f..04fc96e7b8275c97a58a1cdddbf873102a6234fc 100644 --- a/assets/sury-GtnkadyM-_VCptIFV.js +++ b/assets/sury-GtnkadyM-C_RygoD3.js @@ -1 +1 @@ -import{F as e,aQ as t}from"./index-Bcb2irKh.js";const n=async()=>{let{toJSONSchema:n}=await e(t(()=>import(`./__vite-optional-peer-dep_sury_xsschema-DBCftJAj.js`),[]),`sury`);return e=>n(e)};export{n as getToJsonSchemaFn}; \ No newline at end of file +import{F as e,aQ as t}from"./index-TXtvn0DM.js";const n=async()=>{let{toJSONSchema:n}=await e(t(()=>import(`./__vite-optional-peer-dep_sury_xsschema-DBCftJAj.js`),[]),`sury`);return e=>n(e)};export{n as getToJsonSchemaFn}; \ No newline at end of file diff --git a/assets/theme-color-C-tbz8cx.js b/assets/theme-color-CrZYT1IJ.js similarity index 99% rename from assets/theme-color-C-tbz8cx.js rename to assets/theme-color-CrZYT1IJ.js index 1f7d0e125496831438be8c5bc2a5995151fa2d77..1caa0d89157b72efd2bc0fda5f14e9361a167e4c 100644 --- a/assets/theme-color-C-tbz8cx.js +++ b/assets/theme-color-CrZYT1IJ.js @@ -1 +1 @@ -import{$ as e,a1 as t,aZ as n}from"./index-Bcb2irKh.js";const r=async e=>{let t=await e();for(;t instanceof Function;)t=await t();return t},i={retry:3,retryCount:0,retryDelay:500},a=(n,o)=>{let{onError:s,retry:c,retryCount:l,retryDelay:u}=t(i,o),d=async(...t)=>{try{return await n(...t)}catch(r){if(s?.(r),la(n,{onError:s,retry:c,retryCount:l+1,retryDelay:u})(...t);throw r}};return async(...e)=>r(async()=>d(...e))};function o(e,t){let n=e.length;Array.isArray(e[0])||(e=[e]),Array.isArray(t[0])||(t=t.map(e=>[e]));let r=t[0].length,i=t[0].map((e,n)=>t.map(e=>e[n])),a=e.map(e=>i.map(t=>{let n=0;if(!Array.isArray(e)){for(let r of t)n+=e*r;return n}for(let r=0;re[0]):a}function s(e){return c(e)===`string`}function c(e){let t=Object.prototype.toString.call(e);return(t.match(/^\[object\s+(.*?)\]$/)[1]||``).toLowerCase()}function l(e,{precision:t,unit:n}){return u(e)?`none`:f(e,t)+(n??``)}function u(e){return Number.isNaN(e)||e instanceof Number&&e?.none}function d(e){return u(e)?0:e}function f(e,t){if(e===0)return 0;let n=~~e,r=0;n&&t&&(r=~~Math.log10(Math.abs(n))+1);let i=10**(t-r);return Math.floor(e*i+.5)/i}const p={deg:1,grad:.9,rad:180/Math.PI,turn:360};function m(e){if(!e)return;e=e.trim();let t=/^([a-z]+)\((.+?)\)$/i,n=/^-?[\d.]+$/,r=/%|deg|g?rad|turn$/,i=/\/?\s*(none|[-\w.]+(?:%|deg|g?rad|turn)?)/g,a=e.match(t);if(a){let e=[];return a[2].replace(i,(t,i)=>{let a=i.match(r),o=i;if(a){let e=a[0],t=o.slice(0,-e.length);e===`%`?(o=new Number(t/100),o.type=``):(o=new Number(t*p[e]),o.type=``,o.unit=e)}else n.test(o)?(o=new Number(o),o.type=``):o===`none`&&(o=new Number(NaN),o.none=!0);t.startsWith(`/`)&&(o=o instanceof Number?o:new Number(o),o.alpha=!0),typeof o==`object`&&o instanceof Number&&(o.raw=i),e.push(o)}),{name:a[1].toLowerCase(),rawName:a[1],rawArgs:a[2],args:e}}}function h(e){return e[e.length-1]}function g(e,t,n){return isNaN(e)?t:isNaN(t)?e:e+(t-e)*n}function _(e,t,n){return(n-e)/(t-e)}function v(e,t,n){return g(t[0],t[1],_(e[0],e[1],n))}function y(e){return e.map(e=>e.split(`|`).map(e=>{e=e.trim();let t=e.match(/^(<[a-z]+>)\[(-?[.\d]+),\s*(-?[.\d]+)\]?$/);if(t){let e=new String(t[1]);return e.range=[+t[2],+t[3]],e}return e}))}function b(e,t,n){return Math.max(Math.min(n,t),e)}function x(e,t){return Math.sign(e)===Math.sign(t)?e:-e}function S(e,t){return x(Math.abs(e)**t,e)}function C(e,t){return t===0?0:e/t}function w(e,t,n=0,r=e.length){for(;n>1;e[i]`,``,``]);function A(e,t,n,r){let i=Object.entries(e.coords).map(([e,i],a)=>{let o=t.coordGrammar[a],s=r[a],c=s?.type,l;if(l=s.none?o.find(e=>ne.has(e)):o.find(e=>e==c),!l){let t=i.name||e;throw TypeError(`${c??s.raw} not allowed for ${t} in ${n}()`)}let u=l.range;c===``&&(u||=[0,1]);let d=i.range||i.refRange;return u&&d&&(r[a]=v(u,d,r[a])),l});return i}function re(e,{meta:t}={}){let n={str:String(e)?.trim()};if(E.run(`parse-start`,n),n.color)return n.color;if(n.parsed=m(n.str),n.parsed){let e=n.parsed.name;if(e===`color`){let e=n.parsed.args.shift(),r=e.startsWith(`--`)?e.substring(2):`--${e}`,i=[e,r],a=n.parsed.rawArgs.indexOf(`/`)>0?n.parsed.args.pop():1;for(let r of M.all){let o=r.getFormat(`color`);if(o&&(i.includes(o.id)||o.ids?.filter(e=>i.includes(e)).length)){let i=Object.keys(r.coords).map((e,t)=>n.parsed.args[t]||0),s;return o.coordGrammar&&(s=A(r,o,`color`,i)),t&&Object.assign(t,{formatId:`color`,types:s}),o.id.startsWith(`--`)&&!e.startsWith(`--`)&&D.warn(`${r.name} is a non-standard space and not currently supported in the CSS spec. Use prefixed color(${o.id}) instead of color(${e}).`),e.startsWith(`--`)&&!o.id.startsWith(`--`)&&D.warn(`${r.name} is a standard space and supported in the CSS spec. Use color(${o.id}) instead of prefixed color(${e}).`),{spaceId:r.id,coords:i,alpha:a}}}let o=``,s=e in M.registry?e:r;if(s in M.registry){let e=M.registry[s].formats?.color?.id;e&&(o=`Did you mean color(${e})?`)}throw TypeError(`Cannot parse color(${e}). `+(o||`Missing a plugin?`))}else for(let r of M.all){let i=r.getFormat(e);if(i&&i.type===`function`){let a=1;(i.lastAlpha||h(n.parsed.args).alpha)&&(a=n.parsed.args.pop());let o=n.parsed.args,s;return i.coordGrammar&&(s=A(r,i,e,o)),t&&Object.assign(t,{formatId:i.name,types:s}),{spaceId:r.id,coords:o,alpha:a}}}}else for(let e of M.all)for(let r in e.formats){let i=e.formats[r];if(i.type!==`custom`||i.test&&!i.test(n.str))continue;let a=i.parse(n.str);if(a)return a.alpha??=1,t&&(t.formatId=r),a}throw TypeError(`Could not parse ${e} as a color. Missing a plugin?`)}function j(e){if(Array.isArray(e))return e.map(j);if(!e)throw TypeError(`Empty color reference`);s(e)&&(e=re(e));let t=e.space||e.spaceId;return t instanceof M||(e.space=M.get(t)),e.alpha===void 0&&(e.alpha=1),e}const ie=75e-6;var M=class e{constructor(t){this.id=t.id,this.name=t.name,this.base=t.base?e.get(t.base):null,this.aliases=t.aliases,this.base&&(this.fromBase=t.fromBase,this.toBase=t.toBase);let n=t.coords??this.base.coords;for(let e in n)`name`in n[e]||(n[e].name=e);this.coords=n;let r=t.white??this.base.white??`D65`;for(let e in this.white=te(r),this.formats=t.formats??{},this.formats){let t=this.formats[e];t.type||=`function`,t.name||=e}this.formats.color?.id||(this.formats.color={...this.formats.color??{},id:t.cssId||this.id}),t.gamutSpace?this.gamutSpace=t.gamutSpace===`self`?this:e.get(t.gamutSpace):this.isPolar?this.gamutSpace=this.base:this.gamutSpace=this,this.gamutSpace.isUnbounded&&(this.inGamut=(e,t)=>!0),this.referred=t.referred,Object.defineProperty(this,`path`,{value:N(this).reverse(),writable:!1,enumerable:!0,configurable:!0}),E.run(`colorspace-init-end`,this)}inGamut(e,{epsilon:t=ie}={}){if(!this.equals(this.gamutSpace))return e=this.to(this.gamutSpace,e),this.gamutSpace.inGamut(e,{epsilon:t});let n=Object.values(this.coords);return e.every((e,r)=>{let i=n[r];if(i.type!==`angle`&&i.range){if(Number.isNaN(e))return!0;let[n,r]=i.range;return(n===void 0||e>=n-t)&&(r===void 0||e<=r+t)}return!0})}get isUnbounded(){return Object.values(this.coords).every(e=>!(`range`in e))}get cssId(){return this.formats?.color?.id||this.id}get isPolar(){for(let e in this.coords)if(this.coords[e].type===`angle`)return!0;return!1}getFormat(e){if(typeof e==`object`)return e=ae(e,this),e;let t;return t=e===`default`?Object.values(this.formats)[0]:this.formats[e],t?(t=ae(t,this),t):null}equals(e){return e?this===e||this.id===e||this.id===e.id:!1}to(t,n){if(arguments.length===1){let e=j(t);[t,n]=[e.space,e.coords]}if(t=e.get(t),this.equals(t))return n;n=n.map(e=>Number.isNaN(e)?0:e);let r=this.path,i=t.path,a,o;for(let e=0;eo;e--)n=r[e].toBase(n);for(let e=o+1;e=0){let e=Object.entries(i.coords)[a];if(e)return{space:i,id:e[0],index:a,...e[1]}}i=e.get(i);let o=a.toLowerCase(),s=0;for(let e in i.coords){let t=i.coords[e];if(e.toLowerCase()===o||t.name?.toLowerCase()===o)return{space:i,id:e,index:s,...t};s++}throw TypeError(`No "${a}" coordinate found in ${i.name}. Its coordinates are: ${Object.keys(i.coords).join(`, `)}`)}static DEFAULT_FORMAT={type:`functions`,name:`color`}};function N(e){let t=[e];for(let n=e;n=n.base;)t.push(n);return t}function ae(e,{coords:t}={}){if(e.coords&&!e.coordGrammar){e.type||=`function`,e.name||=`color`,e.coordGrammar=y(e.coords);let n=Object.entries(t).map(([t,n],r)=>{let i=e.coordGrammar[r][0],a=n.range||n.refRange,o=i.range,s=``;return i==``?(o=[0,100],s=`%`):i==``&&(s=`deg`),{fromRange:a,toRange:o,suffix:s}});e.serializeCoords=(e,t)=>e.map((e,r)=>{let{fromRange:i,toRange:a,suffix:o}=n[r];return i&&a&&(e=v(i,a,e)),e=l(e,{precision:t,unit:o}),e})}return e}var P=new M({id:`xyz-d65`,name:`XYZ D65`,coords:{x:{name:`X`},y:{name:`Y`},z:{name:`Z`}},white:`D65`,formats:{color:{ids:[`xyz-d65`,`xyz`]}},aliases:[`xyz`]}),F=class extends M{constructor(e){e.coords||={r:{range:[0,1],name:`Red`},g:{range:[0,1],name:`Green`},b:{range:[0,1],name:`Blue`}},e.base||=P,e.toXYZ_M&&e.fromXYZ_M&&(e.toBase??=t=>{let n=o(e.toXYZ_M,t);return this.white!==this.base.white&&(n=k(this.white,this.base.white,n)),n},e.fromBase??=t=>(t=k(this.base.white,this.white,t),o(e.fromXYZ_M,t))),e.referred??=`display`,super(e)}};function I(e,t){return e=j(e),!t||e.space.equals(t)?e.coords.slice():(t=M.get(t),t.from(e))}function L(e,t){e=j(e);let{space:n,index:r}=M.resolveCoord(t,e.space),i=I(e,n);return i[r]}function oe(e,t,n){return e=j(e),t=M.get(t),e.coords=t.to(e.space,n),e}oe.returns=`color`;function R(e,t,n){if(e=j(e),arguments.length===2&&c(arguments[1])===`object`){let t=arguments[1];for(let n in t)R(e,n,t[n])}else{typeof n==`function`&&(n=n(L(e,t)));let{space:r,index:i}=M.resolveCoord(t,e.space),a=I(e,r);a[i]=n,oe(e,r,a)}return e}R.returns=`color`;var se=new M({id:`xyz-d50`,name:`XYZ D50`,white:`D50`,base:P,fromBase:e=>k(P.white,`D50`,e),toBase:e=>k(`D50`,P.white,e)});const ce=216/24389,le=24/116,ue=24389/27;let de=O.D50;var z=new M({id:`lab`,name:`Lab`,coords:{l:{refRange:[0,100],name:`Lightness`},a:{refRange:[-125,125]},b:{refRange:[-125,125]}},white:de,base:se,fromBase(e){let t=e.map((e,t)=>e/de[t]),n=t.map(e=>e>ce?Math.cbrt(e):(ue*e+16)/116);return[116*n[1]-16,500*(n[0]-n[1]),200*(n[1]-n[2])]},toBase(e){let t=[];t[1]=(e[0]+16)/116,t[0]=e[1]/500+t[1],t[2]=t[1]-e[2]/200;let n=[t[0]>le?t[0]**3:(116*t[0]-16)/ue,e[0]>8?((e[0]+16)/116)**3:e[0]/ue,t[2]>le?t[2]**3:(116*t[2]-16)/ue];return n.map((e,t)=>e*de[t])},formats:{lab:{coords:[` | `,` | [-1,1]`,` | [-1,1]`]}}});function B(e){return(e%360+360)%360}function fe(e,t){if(e===`raw`)return t;let[n,r]=t.map(B),i=r-n;return e===`increasing`?i<0&&(r+=360):e===`decreasing`?i>0&&(n+=360):e===`longer`?-1800?n+=360:r+=360):e===`shorter`&&(i>180?n+=360:i<-180&&(r+=360)),[n,r]}var pe=new M({id:`lch`,name:`LCH`,coords:{l:{refRange:[0,100],name:`Lightness`},c:{refRange:[0,150],name:`Chroma`},h:{refRange:[0,360],type:`angle`,name:`Hue`}},base:z,fromBase(e){let[t,n,r]=e,i,a=.02;return i=Math.abs(n) | `,` | `,` | `]}}});const me=25**7,he=Math.PI,ge=180/he,V=he/180;function _e(e){let t=e*e,n=t*t*t*e;return n}function ve(e,t,{kL:n=1,kC:r=1,kH:i=1}={}){[e,t]=j([e,t]);let[a,o,s]=z.from(e),c=pe.from(z,[a,o,s])[1],[l,u,d]=z.from(t),f=pe.from(z,[l,u,d])[1];c<0&&(c=0),f<0&&(f=0);let p=(c+f)/2,m=_e(p),h=.5*(1-Math.sqrt(m/(m+me))),g=(1+h)*o,_=(1+h)*u,v=Math.sqrt(g**2+s**2),y=Math.sqrt(_**2+d**2),b=g===0&&s===0?0:Math.atan2(s,g),x=_===0&&d===0?0:Math.atan2(d,_);b<0&&(b+=2*he),x<0&&(x+=2*he),b*=ge,x*=ge;let S=l-a,C=y-v,w=x-b,T=b+x,ee=Math.abs(w),E;v*y===0?E=0:ee<=180?E=w:w>180?E=w-360:w<-180?E=w+360:D.warn(`the unthinkable has happened`);let O=2*Math.sqrt(y*v)*Math.sin(E*V/2),te=(a+l)/2,k=(v+y)/2,ne=_e(k),A;A=v*y===0?T:ee<=180?T/2:T<360?(T+360)/2:(T-360)/2;let re=(te-50)**2,ie=1+.015*re/Math.sqrt(20+re),M=1+.045*k,N=1;N-=.17*Math.cos((A-30)*V),N+=.24*Math.cos(2*A*V),N+=.32*Math.cos((3*A+6)*V),N-=.2*Math.cos((4*A-63)*V);let ae=1+.015*k*N,P=30*Math.exp(-1*((A-275)/25)**2),F=2*Math.sqrt(ne/(ne+me)),I=-1*Math.sin(2*P*V)*F,L=(S/(n*ie))**2;return L+=(C/(r*M))**2,L+=(O/(i*ae))**2,L+=I*(C/(r*M))*(O/(i*ae)),Math.sqrt(L)}const ye=[[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],be=[[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],xe=[[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],Se=[[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]];var H=new M({id:`oklab`,name:`Oklab`,coords:{l:{refRange:[0,1],name:`Lightness`},a:{refRange:[-.4,.4]},b:{refRange:[-.4,.4]}},white:`D65`,base:P,fromBase(e){let t=o(ye,e),n=t.map(e=>Math.cbrt(e));return o(xe,n)},toBase(e){let t=o(Se,e),n=t.map(e=>e**3);return o(be,n)},formats:{oklab:{coords:[` | `,` | [-1,1]`,` | [-1,1]`]}}});function Ce(e,t){[e,t]=j([e,t]);let[n,r,i]=H.from(e),[a,o,s]=H.from(t),c=n-a,l=r-o,u=i-s;return Math.sqrt(c**2+l**2+u**2)}const we=75e-6;function U(e,t,{epsilon:n=we}={}){e=j(e),t||=e.space,t=M.get(t);let r=e.coords;return t!==e.space&&(r=t.from(e)),t.inGamut(r,{epsilon:n})}function W(e){return{space:e.space,coords:e.coords.slice(),alpha:e.alpha}}function Te(e,t,n=`lab`){n=M.get(n);let r=n.from(e),i=n.from(t);return Math.sqrt(r.reduce((e,t,n)=>{let r=i[n];return isNaN(t)||isNaN(r)?e:e+(r-t)**2},0))}function Ee(e,t){return Te(e,t,`lab`)}const De=Math.PI,Oe=De/180;function ke(e,t,{l:n=2,c:r=1}={}){[e,t]=j([e,t]);let[i,a,o]=z.from(e),[,s,c]=pe.from(z,[i,a,o]),[l,u,d]=z.from(t),f=pe.from(z,[l,u,d])[1];s<0&&(s=0),f<0&&(f=0);let p=i-l,m=s-f,h=a-u,g=o-d,_=h**2+g**2-m**2,v=.511;i>=16&&(v=.040975*i/(1+.01765*i));let y=.0638*s/(1+.0131*s)+.638,b;Number.isNaN(c)&&(c=0),b=c>=164&&c<=345?.56+Math.abs(.2*Math.cos((c+168)*Oe)):.36+Math.abs(.4*Math.cos((c+35)*Oe));let x=s**4,S=Math.sqrt(x/(x+1900)),C=y*(S*b+1-S),w=(p/(n*v))**2;return w+=(m/(r*y))**2,w+=_/C**2,Math.sqrt(w)}const Ae=203;var je=new M({id:`xyz-abs-d65`,cssId:`--xyz-abs-d65`,name:`Absolute XYZ D65`,coords:{x:{refRange:[0,9504.7],name:`Xa`},y:{refRange:[0,1e4],name:`Ya`},z:{refRange:[0,10888.3],name:`Za`}},base:P,fromBase(e){return e.map(e=>Math.max(e*Ae,0))},toBase(e){return e.map(e=>Math.max(e/Ae,0))}});const Me=1.15,Ne=.66,Pe=2610/2**14,Fe=2**14/2610,Ie=3424/2**12,Le=2413/2**7,Re=2392/2**7,ze=1.7*2523/2**5,Be=2**5/(1.7*2523),Ve=-.56,He=16295499532821565e-27,Ue=[[.41478972,.579999,.014648],[-.20151,1.120649,.0531008],[-.0166008,.2648,.6684799]],We=[[1.9242264357876067,-1.0047923125953657,.037651404030618],[.35031676209499907,.7264811939316552,-.06538442294808501],[-.09098281098284752,-.3127282905230739,1.5227665613052603]],Ge=[[.5,.5,0],[3.524,-4.066708,.542708],[.199076,1.096799,-1.295875]],Ke=[[1,.1386050432715393,.05804731615611886],[.9999999999999999,-.1386050432715393,-.05804731615611886],[.9999999999999998,-.09601924202631895,-.8118918960560388]];var qe=new M({id:`jzazbz`,name:`Jzazbz`,coords:{jz:{refRange:[0,1],name:`Jz`},az:{refRange:[-.5,.5]},bz:{refRange:[-.5,.5]}},base:je,fromBase(e){let[t,n,r]=e,i=Me*t-(Me-1)*r,a=Ne*n-(Ne-1)*t,s=o(Ue,[i,a,r]),c=s.map(function(e){let t=Ie+Le*(e/1e4)**Pe,n=1+Re*(e/1e4)**Pe;return(t/n)**ze}),[l,u,d]=o(Ge,c),f=(1+Ve)*l/(1+Ve*l)-He;return[f,u,d]},toBase(e){let[t,n,r]=e,i=(t+He)/(1+Ve-Ve*(t+He)),a=o(Ke,[i,n,r]),s=a.map(function(e){let t=Ie-e**Be,n=Re*e**Be-Le,r=1e4*(t/n)**Fe;return r}),[c,l,u]=o(We,s),d=(c+(Me-1)*u)/Me,f=(l+(Ne-1)*d)/Ne;return[d,f,u]},formats:{color:{coords:[` | `,` | [-1,1]`,` | [-1,1]`]}}}),Je=new M({id:`jzczhz`,name:`JzCzHz`,coords:{jz:{refRange:[0,1],name:`Jz`},cz:{refRange:[0,1],name:`Chroma`},hz:{refRange:[0,360],type:`angle`,name:`Hue`}},base:qe,fromBase(e){let[t,n,r]=e,i,a=2e-4;return i=Math.abs(n){let n=S(t*Math.abs(e)*.01,ft);return 400*x(n,e)/(n+27.13)});return n}function St(e,t){let n=100/t*27.13**pt;return e.map(e=>{let t=Math.abs(e);return x(n*S(t/(400-t),pt),e)})}function Ct(e){let t=B(e);t<=G.h[0]&&(t+=360);let n=w(G.h,t)-1,[r,i]=G.h.slice(n,n+2),[a,o]=G.e.slice(n,n+2),s=G.H[n],c=(t-r)/a;return s+100*c/(c+(i-t)/o)}function wt(e){let t=(e%400+400)%400,n=Math.floor(.01*t);t%=100;let[r,i]=G.h.slice(n,n+2),[a,o]=G.e.slice(n,n+2);return B((t*(o*r-a*i)-100*r*o)/(t*(o-a)-100*o))}function Tt(e,t,n,r,i){let a={};a.discounting=i,a.refWhite=e,a.surround=r;let s=e.map(e=>e*100);a.la=t,a.yb=n;let c=s[1],l=o(ht,s);r=vt[a.surround];let u=r[0];a.c=r[1],a.nc=r[2];let d=1/(5*a.la+1),f=d**4;a.fl=f*a.la+.1*(1-f)*(1-f)*Math.cbrt(5*a.la),a.flRoot=a.fl**.25,a.n=a.yb/c,a.z=1.48+Math.sqrt(a.n),a.nbb=.725*a.n**-.2,a.ncb=a.nbb;let p=i?1:Math.max(Math.min(u*(1-1/3.6*Math.exp((-a.la-42)/92)),1),0);a.dRgb=l.map(e=>g(1,c/e,p)),a.dRgbInv=a.dRgb.map(e=>1/e);let m=l.map((e,t)=>e*a.dRgb[t]),h=xt(m,a.fl);return a.aW=a.nbb*(2*h[0]+h[1]+.05*h[2]),a}const Et=Tt(dt,64/Math.PI*.2,20,`average`,!1);function Dt(e,t){if(!(e.J!==void 0^e.Q!==void 0))throw Error(`Conversion requires one and only one: 'J' or 'Q'`);if(!(e.C!==void 0^e.M!==void 0^e.s!==void 0))throw Error(`Conversion requires one and only one: 'C', 'M' or 's'`);if(!(e.h!==void 0^e.H!==void 0))throw Error(`Conversion requires one and only one: 'h' or 'H'`);if(e.J===0||e.Q===0)return[0,0,0];let n=0;n=e.h===void 0?wt(e.H)*bt:B(e.h)*bt;let r=Math.cos(n),i=Math.sin(n),a=0;e.J===void 0?e.Q!==void 0&&(a=.25*t.c*e.Q/((t.aW+4)*t.flRoot)):a=S(e.J,1/2)*.1;let s=0;e.C===void 0?e.M===void 0?e.s!==void 0&&(s=4e-4*e.s**2*(t.aW+4)/t.c):s=e.M/t.flRoot/a:s=e.C/a;let c=S(s*(1.64-.29**t.n)**-.73,10/9),l=.25*(Math.cos(n+2)+3.8),u=t.aW*S(a,2/t.c/t.z),d=5e4/13*t.nc*t.ncb*l,f=u/t.nbb,p=23*(f+.305)*C(c,23*d+c*(11*r+108*i)),m=p*r,h=p*i,g=St(o(_t,[f,m,h]).map(e=>e*1/1403),t.fl);return o(gt,g.map((e,n)=>e*t.dRgbInv[n])).map(e=>e/100)}function Ot(e,t){let n=e.map(e=>e*100),r=xt(o(ht,n).map((e,n)=>e*t.dRgb[n]),t.fl),i=r[0]+(-12*r[1]+r[2])/11,a=(r[0]+r[1]-2*r[2])/9,s=(Math.atan2(a,i)%mt+mt)%mt,c=.25*(Math.cos(s+2)+3.8),l=5e4/13*t.nc*t.ncb*C(c*Math.sqrt(i**2+a**2),r[0]+r[1]+1.05*r[2]+.305),u=S(l,.9)*(1.64-.29**t.n)**.73,d=t.nbb*(2*r[0]+r[1]+.05*r[2]),f=S(d/t.aW,.5*t.c*t.z),p=100*S(f,2),m=4/t.c*f*(t.aW+4)*t.flRoot,h=u*f,g=h*t.flRoot,_=B(s*yt),v=Ct(_),y=50*S(t.c*u/(t.aW+4),1/2);return{J:p,C:h,h:_,s:y,Q:m,M:g,H:v}}var kt=new M({id:`cam16-jmh`,cssId:`--cam16-jmh`,name:`CAM16-JMh`,coords:{j:{refRange:[0,100],name:`J`},m:{refRange:[0,105],name:`Colorfulness`},h:{refRange:[0,360],type:`angle`,name:`Hue`}},base:P,fromBase(e){let t=Ot(e,Et);return[t.J,t.M,t.h]},toBase(e){return Dt({J:e[0],M:e[1],h:e[2]},Et)}});const At=O.D65,jt=216/24389,Mt=24389/27;function Nt(e){let t=e>jt?Math.cbrt(e):(Mt*e+16)/116;return 116*t-16}function Pt(e){return e>8?((e+16)/116)**3:e/Mt}function Ft(e,t){let[n,r,i]=e,a=[],o=0;if(i===0)return[0,0,0];let s=Pt(i);o=i>0?.00379058511492914*i**2+.608983189401032*i+.9155088574762233:9514440756550361e-21*i**2+.08693057439788597*i-21.928975842194614;let c=2e-12,l=15,u=0,d=1/0;for(;u<=l;){a=Dt({J:o,C:r,h:n},t);let e=Math.abs(a[1]-s);if(e | `,` | `,` | `]}}});const zt=Math.PI/180,Bt=[1,.007,.0228];function Vt(e){e[1]<0&&(e=Rt.fromBase(Rt.toBase(e)));let t=Math.log(Math.max(1+Bt[2]*e[1]*Lt.flRoot,1))/Bt[2],n=e[0]*zt,r=t*Math.cos(n),i=t*Math.sin(n);return[e[2],r,i]}function Ht(e,t){[e,t]=j([e,t]);let[n,r,i]=Vt(Rt.from(e)),[a,o,s]=Vt(Rt.from(t));return Math.sqrt((n-a)**2+(r-o)**2+(i-s)**2)}var K={deltaE76:Ee,deltaECMC:ke,deltaE2000:ve,deltaEJz:Ye,deltaEITP:ut,deltaEOK:Ce,deltaEHCT:Ht};function Ut(e){let t=e?Math.floor(Math.log10(Math.abs(e))):0;return Math.max(parseFloat(`1e${t-2}`),1e-6)}const Wt={hct:{method:`hct.c`,jnd:2,deltaEMethod:`hct`,blackWhiteClamp:{}},"hct-tonal":{method:`hct.c`,jnd:0,deltaEMethod:`hct`,blackWhiteClamp:{channel:`hct.t`,min:0,max:100}}};function q(e,{method:t=D.gamut_mapping,space:n=void 0,deltaEMethod:r=``,jnd:i=2,blackWhiteClamp:a={}}={}){if(e=j(e),s(arguments[1])?n=arguments[1]:n||=e.space,n=M.get(n),U(e,n,{epsilon:0}))return e;let o;if(t===`css`)o=Kt(e,{space:n});else{if(t!==`clip`&&!U(e,n)){Object.prototype.hasOwnProperty.call(Wt,t)&&({method:t,jnd:i,deltaEMethod:r,blackWhiteClamp:a}=Wt[t]);let s=ve;if(r!==``){for(let e in K)if(`deltae`+r.toLowerCase()===e.toLowerCase()){s=K[e];break}}let c=q(J(e,n),{method:`clip`,space:n});if(s(e,c)>i){if(Object.keys(a).length===3){let t=M.resolveCoord(a.channel),n=L(J(e,t.space),t.id);if(u(n)&&(n=0),n>=a.max)return J({space:`xyz-d65`,coords:O.D65},e.space);if(n<=a.min)return J({space:`xyz-d65`,coords:[0,0,0]},e.space)}let r=M.resolveCoord(t),c=r.space,l=r.id,d=J(e,c);d.coords.forEach((e,t)=>{u(e)&&(d.coords[t]=0)});let f=r.range||r.refRange,p=f[0],m=Ut(i),h=p,g=L(d,l);for(;g-h>m;){let e=W(d);e=q(e,{space:n,method:`clip`});let t=s(d,e);t-ie.range||[]);o.coords=o.coords.map((t,n)=>{let[r,i]=e[n];return r!==void 0&&(t=Math.max(r,t)),i!==void 0&&(t=Math.min(t,i)),t})}}return n!==e.space&&(o=J(o,e.space)),e.coords=o.coords,e}q.returns=`color`;const Gt={WHITE:{space:H,coords:[1,0,0]},BLACK:{space:H,coords:[0,0,0]}};function Kt(e,{space:t}={}){let n=.02,r=1e-4;e=j(e),t||=e.space,t=M.get(t);let i=M.get(`oklch`);if(t.isUnbounded)return J(e,t);let a=J(e,i),o=a.coords[0];if(o>=1){let n=J(Gt.WHITE,t);return n.alpha=e.alpha,J(n,t)}if(o<=0){let n=J(Gt.BLACK,t);return n.alpha=e.alpha,J(n,t)}if(U(a,t,{epsilon:0}))return J(a,t);function s(e){let n=J(e,t),r=Object.values(t.coords);return n.coords=n.coords.map((e,t)=>{if(`range`in r[t]){let[n,i]=r[t].range;return b(n,e,i)}return e}),n}let c=0,l=a.coords[1],u=!0,d=W(a),f=s(d),p=Ce(f,d);if(pr;){let e=(c+l)/2;if(d.coords[1]=e,u&&U(d,t,{epsilon:0}))c=e;else if(f=s(d),p=Ce(f,d),pl(e,{precision:t})));let i=[...s];if(r===`color`){let t=n.id||n.ids?.[0]||e.space.id;i.unshift(t)}let o=e.alpha;t!==null&&(o=l(o,{precision:t}));let c=e.alpha>=1||n.noAlpha?``:`${n.commas?`,`:` /`} ${o}`;a=`${r}(${i.join(n.commas?`, `:` `)}${c})`}return a}const Jt=[[.6369580483012914,.14461690358620832,.1688809751641721],[.2627002120112671,.6779980715188708,.05930171646986196],[0,.028072693049087428,1.060985057710791]],Yt=[[1.716651187971268,-.355670783776392,-.25336628137366],[-.666684351832489,1.616481236634939,.0157685458139111],[.017639857445311,-.042770613257809,.942103121235474]];var Xt=new F({id:`rec2020-linear`,cssId:`--rec2020-linear`,name:`Linear REC.2020`,white:`D65`,toXYZ_M:Jt,fromXYZ_M:Yt});const Zt=1.09929682680944,Qt=.018053968510807;var $t=new F({id:`rec2020`,name:`REC.2020`,base:Xt,toBase(e){return e.map(function(e){return e=Qt?Zt*e**.45-(Zt-1):4.5*e})}});const en=[[.4865709486482162,.26566769316909306,.1982172852343625],[.2289745640697488,.6917385218365064,.079286914093745],[0,.04511338185890264,1.043944368900976]],tn=[[2.493496911941425,-.9313836179191239,-.40271078445071684],[-.8294889695615747,1.7626640603183463,.023624685841943577],[.03584583024378447,-.07617238926804182,.9568845240076872]];var nn=new F({id:`p3-linear`,cssId:`--display-p3-linear`,name:`Linear P3`,white:`D65`,toXYZ_M:en,fromXYZ_M:tn});const rn=[[.41239079926595934,.357584339383878,.1804807884018343],[.21263900587151027,.715168678767756,.07219231536073371],[.01933081871559182,.11919477979462598,.9505321522496607]],Y=[[3.2409699419045226,-1.537383177570094,-.4986107602930034],[-.9692436362808796,1.8759675015077202,.04155505740717559],[.05563007969699366,-.20397695888897652,1.0569715142428786]];var an=new F({id:`srgb-linear`,name:`Linear sRGB`,white:`D65`,toXYZ_M:rn,fromXYZ_M:Y}),on={aliceblue:[240/255,248/255,1],antiquewhite:[250/255,235/255,215/255],aqua:[0,1,1],aquamarine:[127/255,1,212/255],azure:[240/255,1,1],beige:[245/255,245/255,220/255],bisque:[1,228/255,196/255],black:[0,0,0],blanchedalmond:[1,235/255,205/255],blue:[0,0,1],blueviolet:[138/255,43/255,226/255],brown:[165/255,42/255,42/255],burlywood:[222/255,184/255,135/255],cadetblue:[95/255,158/255,160/255],chartreuse:[127/255,1,0],chocolate:[210/255,105/255,30/255],coral:[1,127/255,80/255],cornflowerblue:[100/255,149/255,237/255],cornsilk:[1,248/255,220/255],crimson:[220/255,20/255,60/255],cyan:[0,1,1],darkblue:[0,0,139/255],darkcyan:[0,139/255,139/255],darkgoldenrod:[184/255,134/255,11/255],darkgray:[169/255,169/255,169/255],darkgreen:[0,100/255,0],darkgrey:[169/255,169/255,169/255],darkkhaki:[189/255,183/255,107/255],darkmagenta:[139/255,0,139/255],darkolivegreen:[85/255,107/255,47/255],darkorange:[1,140/255,0],darkorchid:[153/255,50/255,204/255],darkred:[139/255,0,0],darksalmon:[233/255,150/255,122/255],darkseagreen:[143/255,188/255,143/255],darkslateblue:[72/255,61/255,139/255],darkslategray:[47/255,79/255,79/255],darkslategrey:[47/255,79/255,79/255],darkturquoise:[0,206/255,209/255],darkviolet:[148/255,0,211/255],deeppink:[1,20/255,147/255],deepskyblue:[0,191/255,1],dimgray:[105/255,105/255,105/255],dimgrey:[105/255,105/255,105/255],dodgerblue:[30/255,144/255,1],firebrick:[178/255,34/255,34/255],floralwhite:[1,250/255,240/255],forestgreen:[34/255,139/255,34/255],fuchsia:[1,0,1],gainsboro:[220/255,220/255,220/255],ghostwhite:[248/255,248/255,1],gold:[1,215/255,0],goldenrod:[218/255,165/255,32/255],gray:[128/255,128/255,128/255],green:[0,128/255,0],greenyellow:[173/255,1,47/255],grey:[128/255,128/255,128/255],honeydew:[240/255,1,240/255],hotpink:[1,105/255,180/255],indianred:[205/255,92/255,92/255],indigo:[75/255,0,130/255],ivory:[1,1,240/255],khaki:[240/255,230/255,140/255],lavender:[230/255,230/255,250/255],lavenderblush:[1,240/255,245/255],lawngreen:[124/255,252/255,0],lemonchiffon:[1,250/255,205/255],lightblue:[173/255,216/255,230/255],lightcoral:[240/255,128/255,128/255],lightcyan:[224/255,1,1],lightgoldenrodyellow:[250/255,250/255,210/255],lightgray:[211/255,211/255,211/255],lightgreen:[144/255,238/255,144/255],lightgrey:[211/255,211/255,211/255],lightpink:[1,182/255,193/255],lightsalmon:[1,160/255,122/255],lightseagreen:[32/255,178/255,170/255],lightskyblue:[135/255,206/255,250/255],lightslategray:[119/255,136/255,153/255],lightslategrey:[119/255,136/255,153/255],lightsteelblue:[176/255,196/255,222/255],lightyellow:[1,1,224/255],lime:[0,1,0],limegreen:[50/255,205/255,50/255],linen:[250/255,240/255,230/255],magenta:[1,0,1],maroon:[128/255,0,0],mediumaquamarine:[102/255,205/255,170/255],mediumblue:[0,0,205/255],mediumorchid:[186/255,85/255,211/255],mediumpurple:[147/255,112/255,219/255],mediumseagreen:[60/255,179/255,113/255],mediumslateblue:[123/255,104/255,238/255],mediumspringgreen:[0,250/255,154/255],mediumturquoise:[72/255,209/255,204/255],mediumvioletred:[199/255,21/255,133/255],midnightblue:[25/255,25/255,112/255],mintcream:[245/255,1,250/255],mistyrose:[1,228/255,225/255],moccasin:[1,228/255,181/255],navajowhite:[1,222/255,173/255],navy:[0,0,128/255],oldlace:[253/255,245/255,230/255],olive:[128/255,128/255,0],olivedrab:[107/255,142/255,35/255],orange:[1,165/255,0],orangered:[1,69/255,0],orchid:[218/255,112/255,214/255],palegoldenrod:[238/255,232/255,170/255],palegreen:[152/255,251/255,152/255],paleturquoise:[175/255,238/255,238/255],palevioletred:[219/255,112/255,147/255],papayawhip:[1,239/255,213/255],peachpuff:[1,218/255,185/255],peru:[205/255,133/255,63/255],pink:[1,192/255,203/255],plum:[221/255,160/255,221/255],powderblue:[176/255,224/255,230/255],purple:[128/255,0,128/255],rebeccapurple:[102/255,51/255,153/255],red:[1,0,0],rosybrown:[188/255,143/255,143/255],royalblue:[65/255,105/255,225/255],saddlebrown:[139/255,69/255,19/255],salmon:[250/255,128/255,114/255],sandybrown:[244/255,164/255,96/255],seagreen:[46/255,139/255,87/255],seashell:[1,245/255,238/255],sienna:[160/255,82/255,45/255],silver:[192/255,192/255,192/255],skyblue:[135/255,206/255,235/255],slateblue:[106/255,90/255,205/255],slategray:[112/255,128/255,144/255],slategrey:[112/255,128/255,144/255],snow:[1,250/255,250/255],springgreen:[0,1,127/255],steelblue:[70/255,130/255,180/255],tan:[210/255,180/255,140/255],teal:[0,128/255,128/255],thistle:[216/255,191/255,216/255],tomato:[1,99/255,71/255],turquoise:[64/255,224/255,208/255],violet:[238/255,130/255,238/255],wheat:[245/255,222/255,179/255],white:[1,1,1],whitesmoke:[245/255,245/255,245/255],yellow:[1,1,0],yellowgreen:[154/255,205/255,50/255]};let sn=[,,,].fill(` | [0, 255]`),cn=[,,,].fill(`[0, 255]`);var X=new F({id:`srgb`,name:`sRGB`,base:an,fromBase:e=>e.map(e=>{let t=e<0?-1:1,n=e*t;return n>.0031308?t*(1.055*n**(1/2.4)-.055):12.92*e}),toBase:e=>e.map(e=>{let t=e<0?-1:1,n=e*t;return n<=.04045?e/12.92:t*((n+.055)/1.055)**2.4}),formats:{rgb:{coords:sn},rgb_number:{name:`rgb`,commas:!0,coords:cn,noAlpha:!0},color:{},rgba:{coords:sn,commas:!0,lastAlpha:!0},rgba_number:{name:`rgba`,commas:!0,coords:cn},hex:{type:`custom`,toGamut:!0,test:e=>/^#([a-f0-9]{3,4}){1,2}$/i.test(e),parse(e){e.length<=5&&(e=e.replace(/[a-f0-9]/gi,`$&$&`));let t=[];return e.replace(/[a-f0-9]{2}/gi,e=>{t.push(parseInt(e,16)/255)}),{spaceId:`srgb`,coords:t.slice(0,3),alpha:t.slice(3)[0]}},serialize:(e,t,{collapse:n=!0}={})=>{t<1&&e.push(t),e=e.map(e=>Math.round(e*255));let r=n&&e.every(e=>e%17==0),i=e.map(e=>r?(e/17).toString(16):e.toString(16).padStart(2,`0`)).join(``);return`#`+i}},keyword:{type:`custom`,test:e=>/^[a-z]+$/i.test(e),parse(e){e=e.toLowerCase();let t={spaceId:`srgb`,coords:null,alpha:1};if(e===`transparent`?(t.coords=on.black,t.alpha=0):t.coords=on[e],t.coords)return t}}}}),ln=new F({id:`p3`,cssId:`display-p3`,name:`P3`,base:nn,fromBase:X.fromBase,toBase:X.toBase});D.display_space=X;let un;if(typeof CSS<`u`&&CSS.supports)for(let e of[z,$t,ln]){let t=e.getMinCoords(),n={space:e,coords:t,alpha:1},r=qt(n);if(CSS.supports(`color`,r)){D.display_space=e;break}}function dn(e,{space:t=D.display_space,...n}={}){let r=qt(e,n);if(typeof CSS>`u`||CSS.supports(`color`,r)||!D.display_space)r=new String(r),r.color=e;else{let i=e,a=e.coords.some(u)||u(e.alpha);if(a&&!(un??=CSS.supports(`color`,`hsl(none 50% 50%)`))&&(i=W(e),i.coords=i.coords.map(d),i.alpha=d(i.alpha),r=qt(i,n),CSS.supports(`color`,r)))return r=new String(r),r.color=i,r;i=J(i,t),r=new String(qt(i,n)),r.color=i}return r}function fn(e,t){return e=j(e),t=j(t),e.space===t.space&&e.alpha===t.alpha&&e.coords.every((e,n)=>e===t.coords[n])}function Z(e){return L(e,[P,`y`])}function pn(e,t){R(e,[P,`y`],t)}function mn(e){Object.defineProperty(e.prototype,`luminance`,{get(){return Z(this)},set(e){pn(this,e)}})}var hn=Object.freeze({__proto__:null,getLuminance:Z,register:mn,setLuminance:pn});function gn(e,t){e=j(e),t=j(t);let n=Math.max(Z(e),0),r=Math.max(Z(t),0);return r>n&&([n,r]=[r,n]),(n+.05)/(r+.05)}const _n=.56,vn=.57,yn=.62,bn=.65,xn=.022,Sn=1.414,Cn=.1,wn=5e-4,Tn=1.14,En=.027,Dn=1.14;function On(e){return e>=xn?e:e+(xn-e)**Sn}function kn(e){let t=e<0?-1:1,n=Math.abs(e);return t*n**2.4}function An(e,t){t=j(t),e=j(e);let n,r,i,a,o,s;t=J(t,`srgb`),[a,o,s]=t.coords;let c=kn(a)*.2126729+kn(o)*.7151522+kn(s)*.072175;e=J(e,`srgb`),[a,o,s]=e.coords;let l=kn(a)*.2126729+kn(o)*.7151522+kn(s)*.072175,u=On(c),d=On(l),f=d>u;return Math.abs(d-u)0?r-En:r+En,i*100}function jn(e,t){e=j(e),t=j(t);let n=Math.max(Z(e),0),r=Math.max(Z(t),0);r>n&&([n,r]=[r,n]);let i=n+r;return i===0?0:(n-r)/i}const Mn=5e4;function Nn(e,t){e=j(e),t=j(t);let n=Math.max(Z(e),0),r=Math.max(Z(t),0);return r>n&&([n,r]=[r,n]),r===0?Mn:(n-r)/r}function Pn(e,t){e=j(e),t=j(t);let n=L(e,[z,`l`]),r=L(t,[z,`l`]);return Math.abs(n-r)}const Fn=216/24389,In=24/116,Ln=24389/27;let Rn=O.D65;var zn=new M({id:`lab-d65`,name:`Lab D65`,coords:{l:{refRange:[0,100],name:`Lightness`},a:{refRange:[-125,125]},b:{refRange:[-125,125]}},white:Rn,base:P,fromBase(e){let t=e.map((e,t)=>e/Rn[t]),n=t.map(e=>e>Fn?Math.cbrt(e):(Ln*e+16)/116);return[116*n[1]-16,500*(n[0]-n[1]),200*(n[1]-n[2])]},toBase(e){let t=[];t[1]=(e[0]+16)/116,t[0]=e[1]/500+t[1],t[2]=t[1]-e[2]/200;let n=[t[0]>In?t[0]**3:(116*t[0]-16)/Ln,e[0]>8?((e[0]+16)/116)**3:e[0]/Ln,t[2]>In?t[2]**3:(116*t[2]-16)/Ln];return n.map((e,t)=>e*Rn[t])},formats:{"lab-d65":{coords:[` | `,` | [-1,1]`,` | [-1,1]`]}}});const Bn=5**.5*.5+.5;function Vn(e,t){e=j(e),t=j(t);let n=L(e,[zn,`l`]),r=L(t,[zn,`l`]),i=Math.abs(n**+Bn-r**+Bn),a=i**(1/Bn)*Math.SQRT2-40;return a<7.5?0:a}var Hn=Object.freeze({__proto__:null,contrastAPCA:An,contrastDeltaPhi:Vn,contrastLstar:Pn,contrastMichelson:jn,contrastWCAG21:gn,contrastWeber:Nn});function Un(e,t,n={}){s(n)&&(n={algorithm:n});let{algorithm:r,...i}=n;if(!r){let e=Object.keys(Hn).map(e=>e.replace(/^contrast/,``)).join(`, `);throw TypeError(`contrast() function needs a contrast algorithm. Please specify one of: ${e}`)}for(let n in e=j(e),t=j(t),Hn)if(`contrast`+r.toLowerCase()===n.toLowerCase())return Hn[n](e,t,i);throw TypeError(`Unknown contrast algorithm: ${r}`)}function Wn(e){let[t,n,r]=I(e,P),i=t+15*n+3*r;return[4*t/i,9*n/i]}function Gn(e){let[t,n,r]=I(e,P),i=t+n+r;return[t/i,n/i]}function Kn(e){Object.defineProperty(e.prototype,`uv`,{get(){return Wn(this)}}),Object.defineProperty(e.prototype,`xy`,{get(){return Gn(this)}})}var qn=Object.freeze({__proto__:null,register:Kn,uv:Wn,xy:Gn});function Jn(e,t,n={}){s(n)&&(n={method:n});let{method:r=D.deltaE,...i}=n;for(let n in K)if(`deltae`+r.toLowerCase()===n.toLowerCase())return K[n](e,t,i);throw TypeError(`Unknown deltaE method: ${r}`)}function Yn(e,t=.25){let n=M.get(`oklch`,`lch`),r=[n,`l`];return R(e,r,e=>e*(1+t))}function Xn(e,t=.25){let n=M.get(`oklch`,`lch`),r=[n,`l`];return R(e,r,e=>e*(1-t))}var Zn=Object.freeze({__proto__:null,darken:Xn,lighten:Yn});function Qn(e,t,n=.5,r={}){[e,t]=[j(e),j(t)],c(n)===`object`&&([n,r]=[.5,n]);let i=er(e,t,r);return i(n)}function $n(e,t,n={}){let r;tr(e)&&([r,n]=[e,t],[e,t]=r.rangeArgs.colors);let{maxDeltaE:i,deltaEMethod:a,steps:o=2,maxSteps:s=1e3,...c}=n;r||([e,t]=[j(e),j(t)],r=er(e,t,c));let l=Jn(e,t),u=i>0?Math.max(o,Math.ceil(l/i)+1):o,d=[];if(s!==void 0&&(u=Math.min(u,s)),u===1)d=[{p:.5,color:r(.5)}];else{let e=1/(u-1);d=Array.from({length:u},(t,n)=>{let i=n*e;return{p:i,color:r(i)}})}if(i>0){let e=d.reduce((e,t,n)=>{if(n===0)return 0;let r=Jn(t.color,d[n-1].color,a);return Math.max(e,r)},0);for(;e>i;){e=0;for(let t=1;te.color),d}function er(e,t,n={}){if(tr(e)){let[n,r]=[e,t];return er(...n.rangeArgs.colors,{...n.rangeArgs.options,...r})}let{space:r,outputSpace:i,progression:a,premultiplied:o}=n;e=j(e),t=j(t),e=W(e),t=W(t);let s={colors:[e,t],options:n};if(r=r?M.get(r):M.registry[D.interpolationSpace]||e.space,i=i?M.get(i):r,e=J(e,r),t=J(t,r),e=q(e),t=q(t),r.coords.h&&r.coords.h.type===`angle`){let i=n.hue=n.hue||`shorter`,a=[r,`h`],[o,s]=[L(e,a),L(t,a)];isNaN(o)&&!isNaN(s)?o=s:isNaN(s)&&!isNaN(o)&&(s=o),[o,s]=fe(i,[o,s]),R(e,a,o),R(t,a,s)}return o&&(e.coords=e.coords.map(t=>t*e.alpha),t.coords=t.coords.map(e=>e*t.alpha)),Object.assign(n=>{n=a?a(n):n;let s=e.coords.map((e,r)=>{let i=t.coords[r];return g(e,i,n)}),c=g(e.alpha,t.alpha,n),l={space:r,coords:s,alpha:c};return o&&(l.coords=l.coords.map(e=>e/c)),i!==r&&(l=J(l,i)),l},{rangeArgs:s})}function tr(e){return c(e)===`function`&&!!e.rangeArgs}D.interpolationSpace=`lab`;function nr(e){e.defineFunction(`mix`,Qn,{returns:`color`}),e.defineFunction(`range`,er,{returns:`function`}),e.defineFunction(`steps`,$n,{returns:`array`})}var rr=Object.freeze({__proto__:null,isRange:tr,mix:Qn,range:er,register:nr,steps:$n}),ir=new M({id:`hsl`,name:`HSL`,coords:{h:{refRange:[0,360],type:`angle`,name:`Hue`},s:{range:[0,100],name:`Saturation`},l:{range:[0,100],name:`Lightness`}},base:X,fromBase:e=>{let t=Math.max(...e),n=Math.min(...e),[r,i,a]=e,[o,s,c]=[NaN,0,(n+t)/2],l=t-n;if(l!==0){switch(s=c===0||c===1?0:(t-c)/Math.min(c,1-c),t){case r:o=(i-a)/l+(i=360&&(o-=360),[o,s*100,c*100]},toBase:e=>{let[t,n,r]=e;t%=360,t<0&&(t+=360),n/=100,r/=100;function i(e){let i=(e+t/30)%12,a=n*Math.min(r,1-r);return r-a*Math.max(-1,Math.min(i-3,9-i,1))}return[i(0),i(8),i(4)]},formats:{hsl:{coords:[` | `,``,``]},hsla:{coords:[` | `,``,``],commas:!0,lastAlpha:!0}}}),ar=new M({id:`hsv`,name:`HSV`,coords:{h:{refRange:[0,360],type:`angle`,name:`Hue`},s:{range:[0,100],name:`Saturation`},v:{range:[0,100],name:`Value`}},base:ir,fromBase(e){let[t,n,r]=e;n/=100,r/=100;let i=r+n*Math.min(r,1-r);return[t,i===0?0:200*(1-r/i),100*i]},toBase(e){let[t,n,r]=e;n/=100,r/=100;let i=r*(1-n/2);return[t,i===0||i===1?0:(r-i)/Math.min(i,1-i)*100,i*100]},formats:{color:{id:`--hsv`,coords:[` | `,` | `,` | `]}}}),or=new M({id:`hwb`,name:`HWB`,coords:{h:{refRange:[0,360],type:`angle`,name:`Hue`},w:{range:[0,100],name:`Whiteness`},b:{range:[0,100],name:`Blackness`}},base:ar,fromBase(e){let[t,n,r]=e;return[t,r*(100-n)/100,100-r]},toBase(e){let[t,n,r]=e;n/=100,r/=100;let i=n+r;if(i>=1){let e=n/i;return[t,0,e*100]}let a=1-r,o=a===0?0:1-n/a;return[t,o*100,a*100]},formats:{hwb:{coords:[` | `,` | `,` | `]}}});const sr=[[.5766690429101305,.1855582379065463,.1882286462349947],[.29734497525053605,.6273635662554661,.07529145849399788],[.02703136138641234,.07068885253582723,.9913375368376388]],cr=[[2.0415879038107465,-.5650069742788596,-.34473135077832956],[-.9692436362808795,1.8759675015077202,.04155505740717557],[.013444280632031142,-.11836239223101838,1.0151749943912054]];var lr=new F({id:`a98rgb-linear`,cssId:`--a98-rgb-linear`,name:`Linear Adobe® 98 RGB compatible`,white:`D65`,toXYZ_M:sr,fromXYZ_M:cr}),ur=new F({id:`a98rgb`,cssId:`a98-rgb`,name:`Adobe® 98 RGB compatible`,base:lr,toBase:e=>e.map(e=>Math.abs(e)**(563/256)*Math.sign(e)),fromBase:e=>e.map(e=>Math.abs(e)**(256/563)*Math.sign(e))});const dr=[[.7977666449006423,.13518129740053308,.0313477341283922],[.2880748288194013,.711835234241873,8993693872564e-17],[0,0,.8251046025104602]],fr=[[1.3457868816471583,-.25557208737979464,-.05110186497554526],[-.5446307051249019,1.5082477428451468,.02052744743642139],[0,0,1.2119675456389452]];var pr=new F({id:`prophoto-linear`,cssId:`--prophoto-rgb-linear`,name:`Linear ProPhoto`,white:`D50`,base:se,toXYZ_M:dr,fromXYZ_M:fr});const mr=1/512,hr=16/512;var gr=new F({id:`prophoto`,cssId:`prophoto-rgb`,name:`ProPhoto`,base:pr,toBase(e){return e.map(e=>ee>=mr?e**(1/1.8):16*e)}}),_r=new M({id:`oklch`,name:`Oklch`,coords:{l:{refRange:[0,1],name:`Lightness`},c:{refRange:[0,.4],name:`Chroma`},h:{refRange:[0,360],type:`angle`,name:`Hue`}},white:`D65`,base:H,fromBase(e){let[t,n,r]=e,i,a=2e-4;return i=Math.abs(n) | `,` | [0,1]`,` | `]}}});let vr=O.D65;const yr=216/24389,br=24389/27,[xr,Sr]=Wn({space:P,coords:vr});var Cr=new M({id:`luv`,name:`Luv`,coords:{l:{refRange:[0,100],name:`Lightness`},u:{refRange:[-215,215]},v:{refRange:[-215,215]}},white:vr,base:P,fromBase(e){let t=[d(e[0]),d(e[1]),d(e[2])],n=t[1],[r,i]=Wn({space:P,coords:t});if(!Number.isFinite(r)||!Number.isFinite(i))return[0,0,0];let a=n<=yr?br*n:116*Math.cbrt(n)-16;return[a,13*a*(r-xr),13*a*(i-Sr)]},toBase(e){let[t,n,r]=e;if(t===0||u(t))return[0,0,0];n=d(n),r=d(r);let i=n/(13*t)+xr,a=r/(13*t)+Sr,o=t<=8?t/br:((t+16)/116)**3;return[o*(9*i/(4*a)),o,o*((12-3*i-20*a)/(4*a))]},formats:{color:{id:`--luv`,coords:[` | `,` | [-1,1]`,` | [-1,1]`]}}}),wr=new M({id:`lchuv`,name:`LChuv`,coords:{l:{refRange:[0,100],name:`Lightness`},c:{refRange:[0,220],name:`Chroma`},h:{refRange:[0,360],type:`angle`,name:`Hue`}},base:Cr,fromBase(e){let[t,n,r]=e,i,a=.02;return i=Math.abs(n) | `,` | `,` | `]}}});const Tr=216/24389,Er=24389/27,Dr=Y[0][0],Or=Y[0][1],kr=Y[0][2],Ar=Y[1][0],jr=Y[1][1],Mr=Y[1][2],Nr=Y[2][0],Pr=Y[2][1],Fr=Y[2][2];function Ir(e,t,n){let r=t/(Math.sin(n)-e*Math.cos(n));return r<0?1/0:r}function Lr(e){let t=(e+16)**3/1560896,n=t>Tr?t:e/Er,r=n*(284517*Dr-94839*kr),i=n*(838422*kr+769860*Or+731718*Dr),a=n*(632260*kr-126452*Or),o=n*(284517*Ar-94839*Mr),s=n*(838422*Mr+769860*jr+731718*Ar),c=n*(632260*Mr-126452*jr),l=n*(284517*Nr-94839*Fr),u=n*(838422*Fr+769860*Pr+731718*Nr),d=n*(632260*Fr-126452*Pr);return{r0s:r/a,r0i:i*e/a,r1s:r/(a+126452),r1i:(i-769860)*e/(a+126452),g0s:o/c,g0i:s*e/c,g1s:o/(c+126452),g1i:(s-769860)*e/(c+126452),b0s:l/d,b0i:u*e/d,b1s:l/(d+126452),b1i:(u-769860)*e/(d+126452)}}function Rr(e,t){let n=t/360*Math.PI*2,r=Ir(e.r0s,e.r0i,n),i=Ir(e.r1s,e.r1i,n),a=Ir(e.g0s,e.g0i,n),o=Ir(e.g1s,e.g1i,n),s=Ir(e.b0s,e.b0i,n),c=Ir(e.b1s,e.b1i,n);return Math.min(r,i,a,o,s,c)}var zr=new M({id:`hsluv`,name:`HSLuv`,coords:{h:{refRange:[0,360],type:`angle`,name:`Hue`},s:{range:[0,100],name:`Saturation`},l:{range:[0,100],name:`Lightness`}},base:wr,gamutSpace:X,fromBase(e){let[t,n,r]=[d(e[0]),d(e[1]),d(e[2])],i;if(t>99.9999999)i=0,t=100;else if(t<1e-8)i=0,t=0;else{let e=Lr(t),a=Rr(e,r);i=n/a*100}return[r,i,t]},toBase(e){let[t,n,r]=[d(e[0]),d(e[1]),d(e[2])],i;if(r>99.9999999)r=100,i=0;else if(r<1e-8)r=0,i=0;else{let e=Lr(r),a=Rr(e,t);i=a/100*n}return[r,i,t]},formats:{color:{id:`--hsluv`,coords:[` | `,` | `,` | `]}}});Y[0][0],Y[0][1],Y[0][2],Y[1][0],Y[1][1],Y[1][2],Y[2][0],Y[2][1],Y[2][2];function Q(e,t){return Math.abs(t)/Math.sqrt(e**2+1)}function Br(e){let t=Q(e.r0s,e.r0i),n=Q(e.r1s,e.r1i),r=Q(e.g0s,e.g0i),i=Q(e.g1s,e.g1i),a=Q(e.b0s,e.b0i),o=Q(e.b1s,e.b1i);return Math.min(t,n,r,i,a,o)}var Vr=new M({id:`hpluv`,name:`HPLuv`,coords:{h:{refRange:[0,360],type:`angle`,name:`Hue`},s:{range:[0,100],name:`Saturation`},l:{range:[0,100],name:`Lightness`}},base:wr,gamutSpace:`self`,fromBase(e){let[t,n,r]=[d(e[0]),d(e[1]),d(e[2])],i;if(t>99.9999999)i=0,t=100;else if(t<1e-8)i=0,t=0;else{let e=Lr(t),r=Br(e);i=n/r*100}return[r,i,t]},toBase(e){let[t,n,r]=[d(e[0]),d(e[1]),d(e[2])],i;if(r>99.9999999)r=100,i=0;else if(r<1e-8)r=0,i=0;else{let e=Lr(r),t=Br(e);i=t/100*n}return[r,i,t]},formats:{color:{id:`--hpluv`,coords:[` | `,` | `,` | `]}}});const Hr=203,Ur=2610/2**14,Wr=2**14/2610,Gr=2523/2**5,Kr=2**5/2523,qr=3424/2**12,Jr=2413/2**7,Yr=2392/2**7;var Xr=new F({id:`rec2100pq`,cssId:`rec2100-pq`,name:`REC.2100-PQ`,base:Xt,toBase(e){return e.map(function(e){let t=(Math.max(e**Kr-qr,0)/(Jr-Yr*e**Kr))**Wr;return t*1e4/Hr})},fromBase(e){return e.map(function(e){let t=Math.max(e*Hr/1e4,0),n=qr+Jr*t**Ur,r=1+Yr*t**Ur;return(n/r)**Gr})}});const Zr=.17883277,Qr=.28466892,$r=.55991073,ei=3.7743;var ti=new F({id:`rec2100hlg`,cssId:`rec2100-hlg`,name:`REC.2100-HLG`,referred:`scene`,base:Xt,toBase(e){return e.map(function(e){return e<=.5?e**2/3*ei:(Math.exp((e-$r)/Zr)+Qr)/12*ei})},fromBase(e){return e.map(function(e){return e/=ei,e<=1/12?Math.sqrt(3*e):Zr*Math.log(12*e-Qr)+$r})}});const ni={};E.add(`chromatic-adaptation-start`,e=>{e.options.method&&(e.M=ii(e.W1,e.W2,e.options.method))}),E.add(`chromatic-adaptation-end`,e=>{e.M||=ii(e.W1,e.W2,e.options.method)});function ri({id:e,toCone_M:t,fromCone_M:n}){ni[e]=arguments[0]}function ii(e,t,n=`Bradford`){let r=ni[n],[i,a,s]=o(r.toCone_M,e),[c,l,u]=o(r.toCone_M,t),d=[[c/i,0,0],[0,l/a,0],[0,0,u/s]],f=o(d,r.toCone_M),p=o(r.fromCone_M,f);return p}ri({id:`von Kries`,toCone_M:[[.40024,.7076,-.08081],[-.2263,1.16532,.0457],[0,0,.91822]],fromCone_M:[[1.8599363874558397,-1.1293816185800916,.21989740959619328],[.3611914362417676,.6388124632850422,-6370596838649899e-21],[0,0,1.0890636230968613]]}),ri({id:`Bradford`,toCone_M:[[.8951,.2664,-.1614],[-.7502,1.7135,.0367],[.0389,-.0685,1.0296]],fromCone_M:[[.9869929054667121,-.14705425642099013,.15996265166373122],[.4323052697233945,.5183602715367774,.049291228212855594],[-.00852866457517732,.04004282165408486,.96848669578755]]}),ri({id:`CAT02`,toCone_M:[[.7328,.4296,-.1624],[-.7036,1.6975,.0061],[.003,.0136,.9834]],fromCone_M:[[1.0961238208355142,-.27886900021828726,.18274517938277307],[.4543690419753592,.4735331543074117,.07209780371722911],[-.009627608738429355,-.00569803121611342,1.0153256399545427]]}),ri({id:`CAT16`,toCone_M:[[.401288,.650173,-.051461],[-.250268,1.204414,.045854],[-.002079,.048952,.953127]],fromCone_M:[[1.862067855087233,-1.0112546305316845,.14918677544445172],[.3875265432361372,.6214474419314753,-.008973985167612521],[-.01584149884933386,-.03412293802851557,1.0499644368778496]]}),Object.assign(O,{A:[1.0985,1,.35585],C:[.98074,1,1.18232],D55:[.95682,1,.92149],D75:[.94972,1,1.22638],E:[1,1,1],F2:[.99186,1,.67393],F7:[.95041,1,1.08747],F11:[1.00962,1,.6435]}),O.ACES=[.32168/.33767,1,.34065/.33767];const ai=[[.6624541811085053,.13400420645643313,.1561876870049078],[.27222871678091454,.6740817658111484,.05368951740793705],[-.005574649490394108,.004060733528982826,1.0103391003129971]],oi=[[1.6410233796943257,-.32480329418479,-.23642469523761225],[-.6636628587229829,1.6153315916573379,.016756347685530137],[.011721894328375376,-.008284441996237409,.9883948585390215]];var si=new F({id:`acescg`,cssId:`--acescg`,name:`ACEScg`,coords:{r:{range:[0,65504],name:`Red`},g:{range:[0,65504],name:`Green`},b:{range:[0,65504],name:`Blue`}},referred:`scene`,white:O.ACES,toXYZ_M:ai,fromXYZ_M:oi});const ci=2**-16,li=-.35828683,ui=(Math.log2(65504)+9.72)/17.52;var di=new F({id:`acescc`,cssId:`--acescc`,name:`ACEScc`,coords:{r:{range:[li,ui],name:`Red`},g:{range:[li,ui],name:`Green`},b:{range:[li,ui],name:`Blue`}},referred:`scene`,base:si,toBase(e){let t=-5.279999999999999/17.52;return e.map(function(e){return e<=t?(2**(e*17.52-9.72)-ci)*2:e1||i===void 0?1:i<0?0:i;for(let e=0;ethis.get(e),set:t=>this.set(e,t)})}get spaceId(){return this.space.id}clone(){return new e(this.space,this.coords,this.alpha)}toJSON(){return{spaceId:this.spaceId,coords:this.coords,alpha:this.alpha}}display(...t){let n=dn(this,...t);return n.color=new e(n.color),n}static get(t,...n){return t instanceof e?t:new e(t,...n)}static defineFunction(t,n,r=n){let{instance:i=!0,returns:a}=r,o=function(...t){let r=n(...t);if(a===`color`)r=e.get(r);else if(a===`function`){let t=r;r=function(...n){let r=t(...n);return e.get(r)},Object.assign(r,t)}else a===`array`&&(r=r.map(t=>e.get(t)));return r};t in e||(e[t]=o),i&&(e.prototype[t]=function(...e){return o(this,...e)})}static defineFunctions(t){for(let n in t)e.defineFunction(n,t[n],t[n])}static extend(exports){if(exports.register)exports.register(e);else for(let n in exports)e.defineFunction(n,exports[n])}};$.defineFunctions({get:L,getAll:I,set:R,setAll:oe,to:J,equals:fn,inGamut:U,toGamut:q,distance:Te,toString:qt}),Object.assign($,{util:T,hooks:E,WHITES:O,Space:M,spaces:M.registry,parse:re,defaults:D});for(let e of Object.keys(fi))M.register(fi[e]);for(let e in M.registry)pi(e,M.registry[e]);E.add(`colorspace-init-end`,e=>{pi(e.id,e),e.aliases?.forEach(t=>{pi(t,e)})});function pi(e,t){let n=e.replace(/-/g,`_`);Object.defineProperty($.prototype,n,{get(){let n=this.getAll(e);return typeof Proxy>`u`?n:new Proxy(n,{has:(e,n)=>{try{return M.resolveCoord([t,n]),!0}catch{}return Reflect.has(e,n)},get:(e,n,r)=>{if(n&&typeof n!=`symbol`&&!(n in e)){let{index:r}=M.resolveCoord([t,n]);if(r>=0)return e[r]}return Reflect.get(e,n,r)},set:(n,r,i,a)=>{if(r&&typeof r!=`symbol`&&!(r in n)||r>=0){let{index:a}=M.resolveCoord([t,r]);if(a>=0)return n[a]=i,this.setAll(e,n),!0}return Reflect.set(n,r,i,a)}})},set(t){this.setAll(e,t)},configurable:!0,enumerable:!0})}$.extend(K),$.extend({deltaE:Jn}),Object.assign($,{deltaEMethods:K}),$.extend(Zn),$.extend({contrast:Un}),$.extend(qn),$.extend(hn),$.extend(rr),$.extend(Hn);function mi(e,t){return async()=>{let n=a(()=>{let t=document.querySelector(e);if(!t)throw Error(`Widgets element not found`);return t},{retry:10,retryDelay:1e3}),r=await n();return window.getComputedStyle(r).getPropertyValue(t)}}function hi(e){return async()=>{if(typeof e==`string`)return e;{let t=n();return t.value?e.dark:e.light}}}function gi(e){async function t(){`document`in globalThis&&globalThis.document!=null&&`window`in globalThis&&globalThis.window!=null&&document.querySelector(`meta[name="theme-color"]`)?.setAttribute(`content`,new $(await e()).to(`srgb`).toString({format:`hex`}))}return{updateThemeColor:t}}export{mi as b,hi as c,gi as d}; \ No newline at end of file +import{$ as e,a1 as t,aS as n}from"./index-TXtvn0DM.js";const r=async e=>{let t=await e();for(;t instanceof Function;)t=await t();return t},i={retry:3,retryCount:0,retryDelay:500},a=(n,o)=>{let{onError:s,retry:c,retryCount:l,retryDelay:u}=t(i,o),d=async(...t)=>{try{return await n(...t)}catch(r){if(s?.(r),la(n,{onError:s,retry:c,retryCount:l+1,retryDelay:u})(...t);throw r}};return async(...e)=>r(async()=>d(...e))};function o(e,t){let n=e.length;Array.isArray(e[0])||(e=[e]),Array.isArray(t[0])||(t=t.map(e=>[e]));let r=t[0].length,i=t[0].map((e,n)=>t.map(e=>e[n])),a=e.map(e=>i.map(t=>{let n=0;if(!Array.isArray(e)){for(let r of t)n+=e*r;return n}for(let r=0;re[0]):a}function s(e){return c(e)===`string`}function c(e){let t=Object.prototype.toString.call(e);return(t.match(/^\[object\s+(.*?)\]$/)[1]||``).toLowerCase()}function l(e,{precision:t,unit:n}){return u(e)?`none`:f(e,t)+(n??``)}function u(e){return Number.isNaN(e)||e instanceof Number&&e?.none}function d(e){return u(e)?0:e}function f(e,t){if(e===0)return 0;let n=~~e,r=0;n&&t&&(r=~~Math.log10(Math.abs(n))+1);let i=10**(t-r);return Math.floor(e*i+.5)/i}const p={deg:1,grad:.9,rad:180/Math.PI,turn:360};function m(e){if(!e)return;e=e.trim();let t=/^([a-z]+)\((.+?)\)$/i,n=/^-?[\d.]+$/,r=/%|deg|g?rad|turn$/,i=/\/?\s*(none|[-\w.]+(?:%|deg|g?rad|turn)?)/g,a=e.match(t);if(a){let e=[];return a[2].replace(i,(t,i)=>{let a=i.match(r),o=i;if(a){let e=a[0],t=o.slice(0,-e.length);e===`%`?(o=new Number(t/100),o.type=``):(o=new Number(t*p[e]),o.type=``,o.unit=e)}else n.test(o)?(o=new Number(o),o.type=``):o===`none`&&(o=new Number(NaN),o.none=!0);t.startsWith(`/`)&&(o=o instanceof Number?o:new Number(o),o.alpha=!0),typeof o==`object`&&o instanceof Number&&(o.raw=i),e.push(o)}),{name:a[1].toLowerCase(),rawName:a[1],rawArgs:a[2],args:e}}}function h(e){return e[e.length-1]}function g(e,t,n){return isNaN(e)?t:isNaN(t)?e:e+(t-e)*n}function _(e,t,n){return(n-e)/(t-e)}function v(e,t,n){return g(t[0],t[1],_(e[0],e[1],n))}function y(e){return e.map(e=>e.split(`|`).map(e=>{e=e.trim();let t=e.match(/^(<[a-z]+>)\[(-?[.\d]+),\s*(-?[.\d]+)\]?$/);if(t){let e=new String(t[1]);return e.range=[+t[2],+t[3]],e}return e}))}function b(e,t,n){return Math.max(Math.min(n,t),e)}function x(e,t){return Math.sign(e)===Math.sign(t)?e:-e}function S(e,t){return x(Math.abs(e)**t,e)}function C(e,t){return t===0?0:e/t}function w(e,t,n=0,r=e.length){for(;n>1;e[i]`,``,``]);function A(e,t,n,r){let i=Object.entries(e.coords).map(([e,i],a)=>{let o=t.coordGrammar[a],s=r[a],c=s?.type,l;if(l=s.none?o.find(e=>ne.has(e)):o.find(e=>e==c),!l){let t=i.name||e;throw TypeError(`${c??s.raw} not allowed for ${t} in ${n}()`)}let u=l.range;c===``&&(u||=[0,1]);let d=i.range||i.refRange;return u&&d&&(r[a]=v(u,d,r[a])),l});return i}function re(e,{meta:t}={}){let n={str:String(e)?.trim()};if(E.run(`parse-start`,n),n.color)return n.color;if(n.parsed=m(n.str),n.parsed){let e=n.parsed.name;if(e===`color`){let e=n.parsed.args.shift(),r=e.startsWith(`--`)?e.substring(2):`--${e}`,i=[e,r],a=n.parsed.rawArgs.indexOf(`/`)>0?n.parsed.args.pop():1;for(let r of M.all){let o=r.getFormat(`color`);if(o&&(i.includes(o.id)||o.ids?.filter(e=>i.includes(e)).length)){let i=Object.keys(r.coords).map((e,t)=>n.parsed.args[t]||0),s;return o.coordGrammar&&(s=A(r,o,`color`,i)),t&&Object.assign(t,{formatId:`color`,types:s}),o.id.startsWith(`--`)&&!e.startsWith(`--`)&&D.warn(`${r.name} is a non-standard space and not currently supported in the CSS spec. Use prefixed color(${o.id}) instead of color(${e}).`),e.startsWith(`--`)&&!o.id.startsWith(`--`)&&D.warn(`${r.name} is a standard space and supported in the CSS spec. Use color(${o.id}) instead of prefixed color(${e}).`),{spaceId:r.id,coords:i,alpha:a}}}let o=``,s=e in M.registry?e:r;if(s in M.registry){let e=M.registry[s].formats?.color?.id;e&&(o=`Did you mean color(${e})?`)}throw TypeError(`Cannot parse color(${e}). `+(o||`Missing a plugin?`))}else for(let r of M.all){let i=r.getFormat(e);if(i&&i.type===`function`){let a=1;(i.lastAlpha||h(n.parsed.args).alpha)&&(a=n.parsed.args.pop());let o=n.parsed.args,s;return i.coordGrammar&&(s=A(r,i,e,o)),t&&Object.assign(t,{formatId:i.name,types:s}),{spaceId:r.id,coords:o,alpha:a}}}}else for(let e of M.all)for(let r in e.formats){let i=e.formats[r];if(i.type!==`custom`||i.test&&!i.test(n.str))continue;let a=i.parse(n.str);if(a)return a.alpha??=1,t&&(t.formatId=r),a}throw TypeError(`Could not parse ${e} as a color. Missing a plugin?`)}function j(e){if(Array.isArray(e))return e.map(j);if(!e)throw TypeError(`Empty color reference`);s(e)&&(e=re(e));let t=e.space||e.spaceId;return t instanceof M||(e.space=M.get(t)),e.alpha===void 0&&(e.alpha=1),e}const ie=75e-6;var M=class e{constructor(t){this.id=t.id,this.name=t.name,this.base=t.base?e.get(t.base):null,this.aliases=t.aliases,this.base&&(this.fromBase=t.fromBase,this.toBase=t.toBase);let n=t.coords??this.base.coords;for(let e in n)`name`in n[e]||(n[e].name=e);this.coords=n;let r=t.white??this.base.white??`D65`;for(let e in this.white=te(r),this.formats=t.formats??{},this.formats){let t=this.formats[e];t.type||=`function`,t.name||=e}this.formats.color?.id||(this.formats.color={...this.formats.color??{},id:t.cssId||this.id}),t.gamutSpace?this.gamutSpace=t.gamutSpace===`self`?this:e.get(t.gamutSpace):this.isPolar?this.gamutSpace=this.base:this.gamutSpace=this,this.gamutSpace.isUnbounded&&(this.inGamut=(e,t)=>!0),this.referred=t.referred,Object.defineProperty(this,`path`,{value:N(this).reverse(),writable:!1,enumerable:!0,configurable:!0}),E.run(`colorspace-init-end`,this)}inGamut(e,{epsilon:t=ie}={}){if(!this.equals(this.gamutSpace))return e=this.to(this.gamutSpace,e),this.gamutSpace.inGamut(e,{epsilon:t});let n=Object.values(this.coords);return e.every((e,r)=>{let i=n[r];if(i.type!==`angle`&&i.range){if(Number.isNaN(e))return!0;let[n,r]=i.range;return(n===void 0||e>=n-t)&&(r===void 0||e<=r+t)}return!0})}get isUnbounded(){return Object.values(this.coords).every(e=>!(`range`in e))}get cssId(){return this.formats?.color?.id||this.id}get isPolar(){for(let e in this.coords)if(this.coords[e].type===`angle`)return!0;return!1}getFormat(e){if(typeof e==`object`)return e=ae(e,this),e;let t;return t=e===`default`?Object.values(this.formats)[0]:this.formats[e],t?(t=ae(t,this),t):null}equals(e){return e?this===e||this.id===e||this.id===e.id:!1}to(t,n){if(arguments.length===1){let e=j(t);[t,n]=[e.space,e.coords]}if(t=e.get(t),this.equals(t))return n;n=n.map(e=>Number.isNaN(e)?0:e);let r=this.path,i=t.path,a,o;for(let e=0;eo;e--)n=r[e].toBase(n);for(let e=o+1;e=0){let e=Object.entries(i.coords)[a];if(e)return{space:i,id:e[0],index:a,...e[1]}}i=e.get(i);let o=a.toLowerCase(),s=0;for(let e in i.coords){let t=i.coords[e];if(e.toLowerCase()===o||t.name?.toLowerCase()===o)return{space:i,id:e,index:s,...t};s++}throw TypeError(`No "${a}" coordinate found in ${i.name}. Its coordinates are: ${Object.keys(i.coords).join(`, `)}`)}static DEFAULT_FORMAT={type:`functions`,name:`color`}};function N(e){let t=[e];for(let n=e;n=n.base;)t.push(n);return t}function ae(e,{coords:t}={}){if(e.coords&&!e.coordGrammar){e.type||=`function`,e.name||=`color`,e.coordGrammar=y(e.coords);let n=Object.entries(t).map(([t,n],r)=>{let i=e.coordGrammar[r][0],a=n.range||n.refRange,o=i.range,s=``;return i==``?(o=[0,100],s=`%`):i==``&&(s=`deg`),{fromRange:a,toRange:o,suffix:s}});e.serializeCoords=(e,t)=>e.map((e,r)=>{let{fromRange:i,toRange:a,suffix:o}=n[r];return i&&a&&(e=v(i,a,e)),e=l(e,{precision:t,unit:o}),e})}return e}var P=new M({id:`xyz-d65`,name:`XYZ D65`,coords:{x:{name:`X`},y:{name:`Y`},z:{name:`Z`}},white:`D65`,formats:{color:{ids:[`xyz-d65`,`xyz`]}},aliases:[`xyz`]}),F=class extends M{constructor(e){e.coords||={r:{range:[0,1],name:`Red`},g:{range:[0,1],name:`Green`},b:{range:[0,1],name:`Blue`}},e.base||=P,e.toXYZ_M&&e.fromXYZ_M&&(e.toBase??=t=>{let n=o(e.toXYZ_M,t);return this.white!==this.base.white&&(n=k(this.white,this.base.white,n)),n},e.fromBase??=t=>(t=k(this.base.white,this.white,t),o(e.fromXYZ_M,t))),e.referred??=`display`,super(e)}};function I(e,t){return e=j(e),!t||e.space.equals(t)?e.coords.slice():(t=M.get(t),t.from(e))}function L(e,t){e=j(e);let{space:n,index:r}=M.resolveCoord(t,e.space),i=I(e,n);return i[r]}function oe(e,t,n){return e=j(e),t=M.get(t),e.coords=t.to(e.space,n),e}oe.returns=`color`;function R(e,t,n){if(e=j(e),arguments.length===2&&c(arguments[1])===`object`){let t=arguments[1];for(let n in t)R(e,n,t[n])}else{typeof n==`function`&&(n=n(L(e,t)));let{space:r,index:i}=M.resolveCoord(t,e.space),a=I(e,r);a[i]=n,oe(e,r,a)}return e}R.returns=`color`;var se=new M({id:`xyz-d50`,name:`XYZ D50`,white:`D50`,base:P,fromBase:e=>k(P.white,`D50`,e),toBase:e=>k(`D50`,P.white,e)});const ce=216/24389,le=24/116,ue=24389/27;let de=O.D50;var z=new M({id:`lab`,name:`Lab`,coords:{l:{refRange:[0,100],name:`Lightness`},a:{refRange:[-125,125]},b:{refRange:[-125,125]}},white:de,base:se,fromBase(e){let t=e.map((e,t)=>e/de[t]),n=t.map(e=>e>ce?Math.cbrt(e):(ue*e+16)/116);return[116*n[1]-16,500*(n[0]-n[1]),200*(n[1]-n[2])]},toBase(e){let t=[];t[1]=(e[0]+16)/116,t[0]=e[1]/500+t[1],t[2]=t[1]-e[2]/200;let n=[t[0]>le?t[0]**3:(116*t[0]-16)/ue,e[0]>8?((e[0]+16)/116)**3:e[0]/ue,t[2]>le?t[2]**3:(116*t[2]-16)/ue];return n.map((e,t)=>e*de[t])},formats:{lab:{coords:[` | `,` | [-1,1]`,` | [-1,1]`]}}});function B(e){return(e%360+360)%360}function fe(e,t){if(e===`raw`)return t;let[n,r]=t.map(B),i=r-n;return e===`increasing`?i<0&&(r+=360):e===`decreasing`?i>0&&(n+=360):e===`longer`?-1800?n+=360:r+=360):e===`shorter`&&(i>180?n+=360:i<-180&&(r+=360)),[n,r]}var pe=new M({id:`lch`,name:`LCH`,coords:{l:{refRange:[0,100],name:`Lightness`},c:{refRange:[0,150],name:`Chroma`},h:{refRange:[0,360],type:`angle`,name:`Hue`}},base:z,fromBase(e){let[t,n,r]=e,i,a=.02;return i=Math.abs(n) | `,` | `,` | `]}}});const me=25**7,he=Math.PI,ge=180/he,V=he/180;function _e(e){let t=e*e,n=t*t*t*e;return n}function ve(e,t,{kL:n=1,kC:r=1,kH:i=1}={}){[e,t]=j([e,t]);let[a,o,s]=z.from(e),c=pe.from(z,[a,o,s])[1],[l,u,d]=z.from(t),f=pe.from(z,[l,u,d])[1];c<0&&(c=0),f<0&&(f=0);let p=(c+f)/2,m=_e(p),h=.5*(1-Math.sqrt(m/(m+me))),g=(1+h)*o,_=(1+h)*u,v=Math.sqrt(g**2+s**2),y=Math.sqrt(_**2+d**2),b=g===0&&s===0?0:Math.atan2(s,g),x=_===0&&d===0?0:Math.atan2(d,_);b<0&&(b+=2*he),x<0&&(x+=2*he),b*=ge,x*=ge;let S=l-a,C=y-v,w=x-b,T=b+x,ee=Math.abs(w),E;v*y===0?E=0:ee<=180?E=w:w>180?E=w-360:w<-180?E=w+360:D.warn(`the unthinkable has happened`);let O=2*Math.sqrt(y*v)*Math.sin(E*V/2),te=(a+l)/2,k=(v+y)/2,ne=_e(k),A;A=v*y===0?T:ee<=180?T/2:T<360?(T+360)/2:(T-360)/2;let re=(te-50)**2,ie=1+.015*re/Math.sqrt(20+re),M=1+.045*k,N=1;N-=.17*Math.cos((A-30)*V),N+=.24*Math.cos(2*A*V),N+=.32*Math.cos((3*A+6)*V),N-=.2*Math.cos((4*A-63)*V);let ae=1+.015*k*N,P=30*Math.exp(-1*((A-275)/25)**2),F=2*Math.sqrt(ne/(ne+me)),I=-1*Math.sin(2*P*V)*F,L=(S/(n*ie))**2;return L+=(C/(r*M))**2,L+=(O/(i*ae))**2,L+=I*(C/(r*M))*(O/(i*ae)),Math.sqrt(L)}const ye=[[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],be=[[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],xe=[[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],Se=[[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]];var H=new M({id:`oklab`,name:`Oklab`,coords:{l:{refRange:[0,1],name:`Lightness`},a:{refRange:[-.4,.4]},b:{refRange:[-.4,.4]}},white:`D65`,base:P,fromBase(e){let t=o(ye,e),n=t.map(e=>Math.cbrt(e));return o(xe,n)},toBase(e){let t=o(Se,e),n=t.map(e=>e**3);return o(be,n)},formats:{oklab:{coords:[` | `,` | [-1,1]`,` | [-1,1]`]}}});function Ce(e,t){[e,t]=j([e,t]);let[n,r,i]=H.from(e),[a,o,s]=H.from(t),c=n-a,l=r-o,u=i-s;return Math.sqrt(c**2+l**2+u**2)}const we=75e-6;function U(e,t,{epsilon:n=we}={}){e=j(e),t||=e.space,t=M.get(t);let r=e.coords;return t!==e.space&&(r=t.from(e)),t.inGamut(r,{epsilon:n})}function W(e){return{space:e.space,coords:e.coords.slice(),alpha:e.alpha}}function Te(e,t,n=`lab`){n=M.get(n);let r=n.from(e),i=n.from(t);return Math.sqrt(r.reduce((e,t,n)=>{let r=i[n];return isNaN(t)||isNaN(r)?e:e+(r-t)**2},0))}function Ee(e,t){return Te(e,t,`lab`)}const De=Math.PI,Oe=De/180;function ke(e,t,{l:n=2,c:r=1}={}){[e,t]=j([e,t]);let[i,a,o]=z.from(e),[,s,c]=pe.from(z,[i,a,o]),[l,u,d]=z.from(t),f=pe.from(z,[l,u,d])[1];s<0&&(s=0),f<0&&(f=0);let p=i-l,m=s-f,h=a-u,g=o-d,_=h**2+g**2-m**2,v=.511;i>=16&&(v=.040975*i/(1+.01765*i));let y=.0638*s/(1+.0131*s)+.638,b;Number.isNaN(c)&&(c=0),b=c>=164&&c<=345?.56+Math.abs(.2*Math.cos((c+168)*Oe)):.36+Math.abs(.4*Math.cos((c+35)*Oe));let x=s**4,S=Math.sqrt(x/(x+1900)),C=y*(S*b+1-S),w=(p/(n*v))**2;return w+=(m/(r*y))**2,w+=_/C**2,Math.sqrt(w)}const Ae=203;var je=new M({id:`xyz-abs-d65`,cssId:`--xyz-abs-d65`,name:`Absolute XYZ D65`,coords:{x:{refRange:[0,9504.7],name:`Xa`},y:{refRange:[0,1e4],name:`Ya`},z:{refRange:[0,10888.3],name:`Za`}},base:P,fromBase(e){return e.map(e=>Math.max(e*Ae,0))},toBase(e){return e.map(e=>Math.max(e/Ae,0))}});const Me=1.15,Ne=.66,Pe=2610/2**14,Fe=2**14/2610,Ie=3424/2**12,Le=2413/2**7,Re=2392/2**7,ze=1.7*2523/2**5,Be=2**5/(1.7*2523),Ve=-.56,He=16295499532821565e-27,Ue=[[.41478972,.579999,.014648],[-.20151,1.120649,.0531008],[-.0166008,.2648,.6684799]],We=[[1.9242264357876067,-1.0047923125953657,.037651404030618],[.35031676209499907,.7264811939316552,-.06538442294808501],[-.09098281098284752,-.3127282905230739,1.5227665613052603]],Ge=[[.5,.5,0],[3.524,-4.066708,.542708],[.199076,1.096799,-1.295875]],Ke=[[1,.1386050432715393,.05804731615611886],[.9999999999999999,-.1386050432715393,-.05804731615611886],[.9999999999999998,-.09601924202631895,-.8118918960560388]];var qe=new M({id:`jzazbz`,name:`Jzazbz`,coords:{jz:{refRange:[0,1],name:`Jz`},az:{refRange:[-.5,.5]},bz:{refRange:[-.5,.5]}},base:je,fromBase(e){let[t,n,r]=e,i=Me*t-(Me-1)*r,a=Ne*n-(Ne-1)*t,s=o(Ue,[i,a,r]),c=s.map(function(e){let t=Ie+Le*(e/1e4)**Pe,n=1+Re*(e/1e4)**Pe;return(t/n)**ze}),[l,u,d]=o(Ge,c),f=(1+Ve)*l/(1+Ve*l)-He;return[f,u,d]},toBase(e){let[t,n,r]=e,i=(t+He)/(1+Ve-Ve*(t+He)),a=o(Ke,[i,n,r]),s=a.map(function(e){let t=Ie-e**Be,n=Re*e**Be-Le,r=1e4*(t/n)**Fe;return r}),[c,l,u]=o(We,s),d=(c+(Me-1)*u)/Me,f=(l+(Ne-1)*d)/Ne;return[d,f,u]},formats:{color:{coords:[` | `,` | [-1,1]`,` | [-1,1]`]}}}),Je=new M({id:`jzczhz`,name:`JzCzHz`,coords:{jz:{refRange:[0,1],name:`Jz`},cz:{refRange:[0,1],name:`Chroma`},hz:{refRange:[0,360],type:`angle`,name:`Hue`}},base:qe,fromBase(e){let[t,n,r]=e,i,a=2e-4;return i=Math.abs(n){let n=S(t*Math.abs(e)*.01,ft);return 400*x(n,e)/(n+27.13)});return n}function St(e,t){let n=100/t*27.13**pt;return e.map(e=>{let t=Math.abs(e);return x(n*S(t/(400-t),pt),e)})}function Ct(e){let t=B(e);t<=G.h[0]&&(t+=360);let n=w(G.h,t)-1,[r,i]=G.h.slice(n,n+2),[a,o]=G.e.slice(n,n+2),s=G.H[n],c=(t-r)/a;return s+100*c/(c+(i-t)/o)}function wt(e){let t=(e%400+400)%400,n=Math.floor(.01*t);t%=100;let[r,i]=G.h.slice(n,n+2),[a,o]=G.e.slice(n,n+2);return B((t*(o*r-a*i)-100*r*o)/(t*(o-a)-100*o))}function Tt(e,t,n,r,i){let a={};a.discounting=i,a.refWhite=e,a.surround=r;let s=e.map(e=>e*100);a.la=t,a.yb=n;let c=s[1],l=o(ht,s);r=vt[a.surround];let u=r[0];a.c=r[1],a.nc=r[2];let d=1/(5*a.la+1),f=d**4;a.fl=f*a.la+.1*(1-f)*(1-f)*Math.cbrt(5*a.la),a.flRoot=a.fl**.25,a.n=a.yb/c,a.z=1.48+Math.sqrt(a.n),a.nbb=.725*a.n**-.2,a.ncb=a.nbb;let p=i?1:Math.max(Math.min(u*(1-1/3.6*Math.exp((-a.la-42)/92)),1),0);a.dRgb=l.map(e=>g(1,c/e,p)),a.dRgbInv=a.dRgb.map(e=>1/e);let m=l.map((e,t)=>e*a.dRgb[t]),h=xt(m,a.fl);return a.aW=a.nbb*(2*h[0]+h[1]+.05*h[2]),a}const Et=Tt(dt,64/Math.PI*.2,20,`average`,!1);function Dt(e,t){if(!(e.J!==void 0^e.Q!==void 0))throw Error(`Conversion requires one and only one: 'J' or 'Q'`);if(!(e.C!==void 0^e.M!==void 0^e.s!==void 0))throw Error(`Conversion requires one and only one: 'C', 'M' or 's'`);if(!(e.h!==void 0^e.H!==void 0))throw Error(`Conversion requires one and only one: 'h' or 'H'`);if(e.J===0||e.Q===0)return[0,0,0];let n=0;n=e.h===void 0?wt(e.H)*bt:B(e.h)*bt;let r=Math.cos(n),i=Math.sin(n),a=0;e.J===void 0?e.Q!==void 0&&(a=.25*t.c*e.Q/((t.aW+4)*t.flRoot)):a=S(e.J,1/2)*.1;let s=0;e.C===void 0?e.M===void 0?e.s!==void 0&&(s=4e-4*e.s**2*(t.aW+4)/t.c):s=e.M/t.flRoot/a:s=e.C/a;let c=S(s*(1.64-.29**t.n)**-.73,10/9),l=.25*(Math.cos(n+2)+3.8),u=t.aW*S(a,2/t.c/t.z),d=5e4/13*t.nc*t.ncb*l,f=u/t.nbb,p=23*(f+.305)*C(c,23*d+c*(11*r+108*i)),m=p*r,h=p*i,g=St(o(_t,[f,m,h]).map(e=>e*1/1403),t.fl);return o(gt,g.map((e,n)=>e*t.dRgbInv[n])).map(e=>e/100)}function Ot(e,t){let n=e.map(e=>e*100),r=xt(o(ht,n).map((e,n)=>e*t.dRgb[n]),t.fl),i=r[0]+(-12*r[1]+r[2])/11,a=(r[0]+r[1]-2*r[2])/9,s=(Math.atan2(a,i)%mt+mt)%mt,c=.25*(Math.cos(s+2)+3.8),l=5e4/13*t.nc*t.ncb*C(c*Math.sqrt(i**2+a**2),r[0]+r[1]+1.05*r[2]+.305),u=S(l,.9)*(1.64-.29**t.n)**.73,d=t.nbb*(2*r[0]+r[1]+.05*r[2]),f=S(d/t.aW,.5*t.c*t.z),p=100*S(f,2),m=4/t.c*f*(t.aW+4)*t.flRoot,h=u*f,g=h*t.flRoot,_=B(s*yt),v=Ct(_),y=50*S(t.c*u/(t.aW+4),1/2);return{J:p,C:h,h:_,s:y,Q:m,M:g,H:v}}var kt=new M({id:`cam16-jmh`,cssId:`--cam16-jmh`,name:`CAM16-JMh`,coords:{j:{refRange:[0,100],name:`J`},m:{refRange:[0,105],name:`Colorfulness`},h:{refRange:[0,360],type:`angle`,name:`Hue`}},base:P,fromBase(e){let t=Ot(e,Et);return[t.J,t.M,t.h]},toBase(e){return Dt({J:e[0],M:e[1],h:e[2]},Et)}});const At=O.D65,jt=216/24389,Mt=24389/27;function Nt(e){let t=e>jt?Math.cbrt(e):(Mt*e+16)/116;return 116*t-16}function Pt(e){return e>8?((e+16)/116)**3:e/Mt}function Ft(e,t){let[n,r,i]=e,a=[],o=0;if(i===0)return[0,0,0];let s=Pt(i);o=i>0?.00379058511492914*i**2+.608983189401032*i+.9155088574762233:9514440756550361e-21*i**2+.08693057439788597*i-21.928975842194614;let c=2e-12,l=15,u=0,d=1/0;for(;u<=l;){a=Dt({J:o,C:r,h:n},t);let e=Math.abs(a[1]-s);if(e | `,` | `,` | `]}}});const zt=Math.PI/180,Bt=[1,.007,.0228];function Vt(e){e[1]<0&&(e=Rt.fromBase(Rt.toBase(e)));let t=Math.log(Math.max(1+Bt[2]*e[1]*Lt.flRoot,1))/Bt[2],n=e[0]*zt,r=t*Math.cos(n),i=t*Math.sin(n);return[e[2],r,i]}function Ht(e,t){[e,t]=j([e,t]);let[n,r,i]=Vt(Rt.from(e)),[a,o,s]=Vt(Rt.from(t));return Math.sqrt((n-a)**2+(r-o)**2+(i-s)**2)}var K={deltaE76:Ee,deltaECMC:ke,deltaE2000:ve,deltaEJz:Ye,deltaEITP:ut,deltaEOK:Ce,deltaEHCT:Ht};function Ut(e){let t=e?Math.floor(Math.log10(Math.abs(e))):0;return Math.max(parseFloat(`1e${t-2}`),1e-6)}const Wt={hct:{method:`hct.c`,jnd:2,deltaEMethod:`hct`,blackWhiteClamp:{}},"hct-tonal":{method:`hct.c`,jnd:0,deltaEMethod:`hct`,blackWhiteClamp:{channel:`hct.t`,min:0,max:100}}};function q(e,{method:t=D.gamut_mapping,space:n=void 0,deltaEMethod:r=``,jnd:i=2,blackWhiteClamp:a={}}={}){if(e=j(e),s(arguments[1])?n=arguments[1]:n||=e.space,n=M.get(n),U(e,n,{epsilon:0}))return e;let o;if(t===`css`)o=Kt(e,{space:n});else{if(t!==`clip`&&!U(e,n)){Object.prototype.hasOwnProperty.call(Wt,t)&&({method:t,jnd:i,deltaEMethod:r,blackWhiteClamp:a}=Wt[t]);let s=ve;if(r!==``){for(let e in K)if(`deltae`+r.toLowerCase()===e.toLowerCase()){s=K[e];break}}let c=q(J(e,n),{method:`clip`,space:n});if(s(e,c)>i){if(Object.keys(a).length===3){let t=M.resolveCoord(a.channel),n=L(J(e,t.space),t.id);if(u(n)&&(n=0),n>=a.max)return J({space:`xyz-d65`,coords:O.D65},e.space);if(n<=a.min)return J({space:`xyz-d65`,coords:[0,0,0]},e.space)}let r=M.resolveCoord(t),c=r.space,l=r.id,d=J(e,c);d.coords.forEach((e,t)=>{u(e)&&(d.coords[t]=0)});let f=r.range||r.refRange,p=f[0],m=Ut(i),h=p,g=L(d,l);for(;g-h>m;){let e=W(d);e=q(e,{space:n,method:`clip`});let t=s(d,e);t-ie.range||[]);o.coords=o.coords.map((t,n)=>{let[r,i]=e[n];return r!==void 0&&(t=Math.max(r,t)),i!==void 0&&(t=Math.min(t,i)),t})}}return n!==e.space&&(o=J(o,e.space)),e.coords=o.coords,e}q.returns=`color`;const Gt={WHITE:{space:H,coords:[1,0,0]},BLACK:{space:H,coords:[0,0,0]}};function Kt(e,{space:t}={}){let n=.02,r=1e-4;e=j(e),t||=e.space,t=M.get(t);let i=M.get(`oklch`);if(t.isUnbounded)return J(e,t);let a=J(e,i),o=a.coords[0];if(o>=1){let n=J(Gt.WHITE,t);return n.alpha=e.alpha,J(n,t)}if(o<=0){let n=J(Gt.BLACK,t);return n.alpha=e.alpha,J(n,t)}if(U(a,t,{epsilon:0}))return J(a,t);function s(e){let n=J(e,t),r=Object.values(t.coords);return n.coords=n.coords.map((e,t)=>{if(`range`in r[t]){let[n,i]=r[t].range;return b(n,e,i)}return e}),n}let c=0,l=a.coords[1],u=!0,d=W(a),f=s(d),p=Ce(f,d);if(pr;){let e=(c+l)/2;if(d.coords[1]=e,u&&U(d,t,{epsilon:0}))c=e;else if(f=s(d),p=Ce(f,d),pl(e,{precision:t})));let i=[...s];if(r===`color`){let t=n.id||n.ids?.[0]||e.space.id;i.unshift(t)}let o=e.alpha;t!==null&&(o=l(o,{precision:t}));let c=e.alpha>=1||n.noAlpha?``:`${n.commas?`,`:` /`} ${o}`;a=`${r}(${i.join(n.commas?`, `:` `)}${c})`}return a}const Jt=[[.6369580483012914,.14461690358620832,.1688809751641721],[.2627002120112671,.6779980715188708,.05930171646986196],[0,.028072693049087428,1.060985057710791]],Yt=[[1.716651187971268,-.355670783776392,-.25336628137366],[-.666684351832489,1.616481236634939,.0157685458139111],[.017639857445311,-.042770613257809,.942103121235474]];var Xt=new F({id:`rec2020-linear`,cssId:`--rec2020-linear`,name:`Linear REC.2020`,white:`D65`,toXYZ_M:Jt,fromXYZ_M:Yt});const Zt=1.09929682680944,Qt=.018053968510807;var $t=new F({id:`rec2020`,name:`REC.2020`,base:Xt,toBase(e){return e.map(function(e){return e=Qt?Zt*e**.45-(Zt-1):4.5*e})}});const en=[[.4865709486482162,.26566769316909306,.1982172852343625],[.2289745640697488,.6917385218365064,.079286914093745],[0,.04511338185890264,1.043944368900976]],tn=[[2.493496911941425,-.9313836179191239,-.40271078445071684],[-.8294889695615747,1.7626640603183463,.023624685841943577],[.03584583024378447,-.07617238926804182,.9568845240076872]];var nn=new F({id:`p3-linear`,cssId:`--display-p3-linear`,name:`Linear P3`,white:`D65`,toXYZ_M:en,fromXYZ_M:tn});const rn=[[.41239079926595934,.357584339383878,.1804807884018343],[.21263900587151027,.715168678767756,.07219231536073371],[.01933081871559182,.11919477979462598,.9505321522496607]],Y=[[3.2409699419045226,-1.537383177570094,-.4986107602930034],[-.9692436362808796,1.8759675015077202,.04155505740717559],[.05563007969699366,-.20397695888897652,1.0569715142428786]];var an=new F({id:`srgb-linear`,name:`Linear sRGB`,white:`D65`,toXYZ_M:rn,fromXYZ_M:Y}),on={aliceblue:[240/255,248/255,1],antiquewhite:[250/255,235/255,215/255],aqua:[0,1,1],aquamarine:[127/255,1,212/255],azure:[240/255,1,1],beige:[245/255,245/255,220/255],bisque:[1,228/255,196/255],black:[0,0,0],blanchedalmond:[1,235/255,205/255],blue:[0,0,1],blueviolet:[138/255,43/255,226/255],brown:[165/255,42/255,42/255],burlywood:[222/255,184/255,135/255],cadetblue:[95/255,158/255,160/255],chartreuse:[127/255,1,0],chocolate:[210/255,105/255,30/255],coral:[1,127/255,80/255],cornflowerblue:[100/255,149/255,237/255],cornsilk:[1,248/255,220/255],crimson:[220/255,20/255,60/255],cyan:[0,1,1],darkblue:[0,0,139/255],darkcyan:[0,139/255,139/255],darkgoldenrod:[184/255,134/255,11/255],darkgray:[169/255,169/255,169/255],darkgreen:[0,100/255,0],darkgrey:[169/255,169/255,169/255],darkkhaki:[189/255,183/255,107/255],darkmagenta:[139/255,0,139/255],darkolivegreen:[85/255,107/255,47/255],darkorange:[1,140/255,0],darkorchid:[153/255,50/255,204/255],darkred:[139/255,0,0],darksalmon:[233/255,150/255,122/255],darkseagreen:[143/255,188/255,143/255],darkslateblue:[72/255,61/255,139/255],darkslategray:[47/255,79/255,79/255],darkslategrey:[47/255,79/255,79/255],darkturquoise:[0,206/255,209/255],darkviolet:[148/255,0,211/255],deeppink:[1,20/255,147/255],deepskyblue:[0,191/255,1],dimgray:[105/255,105/255,105/255],dimgrey:[105/255,105/255,105/255],dodgerblue:[30/255,144/255,1],firebrick:[178/255,34/255,34/255],floralwhite:[1,250/255,240/255],forestgreen:[34/255,139/255,34/255],fuchsia:[1,0,1],gainsboro:[220/255,220/255,220/255],ghostwhite:[248/255,248/255,1],gold:[1,215/255,0],goldenrod:[218/255,165/255,32/255],gray:[128/255,128/255,128/255],green:[0,128/255,0],greenyellow:[173/255,1,47/255],grey:[128/255,128/255,128/255],honeydew:[240/255,1,240/255],hotpink:[1,105/255,180/255],indianred:[205/255,92/255,92/255],indigo:[75/255,0,130/255],ivory:[1,1,240/255],khaki:[240/255,230/255,140/255],lavender:[230/255,230/255,250/255],lavenderblush:[1,240/255,245/255],lawngreen:[124/255,252/255,0],lemonchiffon:[1,250/255,205/255],lightblue:[173/255,216/255,230/255],lightcoral:[240/255,128/255,128/255],lightcyan:[224/255,1,1],lightgoldenrodyellow:[250/255,250/255,210/255],lightgray:[211/255,211/255,211/255],lightgreen:[144/255,238/255,144/255],lightgrey:[211/255,211/255,211/255],lightpink:[1,182/255,193/255],lightsalmon:[1,160/255,122/255],lightseagreen:[32/255,178/255,170/255],lightskyblue:[135/255,206/255,250/255],lightslategray:[119/255,136/255,153/255],lightslategrey:[119/255,136/255,153/255],lightsteelblue:[176/255,196/255,222/255],lightyellow:[1,1,224/255],lime:[0,1,0],limegreen:[50/255,205/255,50/255],linen:[250/255,240/255,230/255],magenta:[1,0,1],maroon:[128/255,0,0],mediumaquamarine:[102/255,205/255,170/255],mediumblue:[0,0,205/255],mediumorchid:[186/255,85/255,211/255],mediumpurple:[147/255,112/255,219/255],mediumseagreen:[60/255,179/255,113/255],mediumslateblue:[123/255,104/255,238/255],mediumspringgreen:[0,250/255,154/255],mediumturquoise:[72/255,209/255,204/255],mediumvioletred:[199/255,21/255,133/255],midnightblue:[25/255,25/255,112/255],mintcream:[245/255,1,250/255],mistyrose:[1,228/255,225/255],moccasin:[1,228/255,181/255],navajowhite:[1,222/255,173/255],navy:[0,0,128/255],oldlace:[253/255,245/255,230/255],olive:[128/255,128/255,0],olivedrab:[107/255,142/255,35/255],orange:[1,165/255,0],orangered:[1,69/255,0],orchid:[218/255,112/255,214/255],palegoldenrod:[238/255,232/255,170/255],palegreen:[152/255,251/255,152/255],paleturquoise:[175/255,238/255,238/255],palevioletred:[219/255,112/255,147/255],papayawhip:[1,239/255,213/255],peachpuff:[1,218/255,185/255],peru:[205/255,133/255,63/255],pink:[1,192/255,203/255],plum:[221/255,160/255,221/255],powderblue:[176/255,224/255,230/255],purple:[128/255,0,128/255],rebeccapurple:[102/255,51/255,153/255],red:[1,0,0],rosybrown:[188/255,143/255,143/255],royalblue:[65/255,105/255,225/255],saddlebrown:[139/255,69/255,19/255],salmon:[250/255,128/255,114/255],sandybrown:[244/255,164/255,96/255],seagreen:[46/255,139/255,87/255],seashell:[1,245/255,238/255],sienna:[160/255,82/255,45/255],silver:[192/255,192/255,192/255],skyblue:[135/255,206/255,235/255],slateblue:[106/255,90/255,205/255],slategray:[112/255,128/255,144/255],slategrey:[112/255,128/255,144/255],snow:[1,250/255,250/255],springgreen:[0,1,127/255],steelblue:[70/255,130/255,180/255],tan:[210/255,180/255,140/255],teal:[0,128/255,128/255],thistle:[216/255,191/255,216/255],tomato:[1,99/255,71/255],turquoise:[64/255,224/255,208/255],violet:[238/255,130/255,238/255],wheat:[245/255,222/255,179/255],white:[1,1,1],whitesmoke:[245/255,245/255,245/255],yellow:[1,1,0],yellowgreen:[154/255,205/255,50/255]};let sn=[,,,].fill(` | [0, 255]`),cn=[,,,].fill(`[0, 255]`);var X=new F({id:`srgb`,name:`sRGB`,base:an,fromBase:e=>e.map(e=>{let t=e<0?-1:1,n=e*t;return n>.0031308?t*(1.055*n**(1/2.4)-.055):12.92*e}),toBase:e=>e.map(e=>{let t=e<0?-1:1,n=e*t;return n<=.04045?e/12.92:t*((n+.055)/1.055)**2.4}),formats:{rgb:{coords:sn},rgb_number:{name:`rgb`,commas:!0,coords:cn,noAlpha:!0},color:{},rgba:{coords:sn,commas:!0,lastAlpha:!0},rgba_number:{name:`rgba`,commas:!0,coords:cn},hex:{type:`custom`,toGamut:!0,test:e=>/^#([a-f0-9]{3,4}){1,2}$/i.test(e),parse(e){e.length<=5&&(e=e.replace(/[a-f0-9]/gi,`$&$&`));let t=[];return e.replace(/[a-f0-9]{2}/gi,e=>{t.push(parseInt(e,16)/255)}),{spaceId:`srgb`,coords:t.slice(0,3),alpha:t.slice(3)[0]}},serialize:(e,t,{collapse:n=!0}={})=>{t<1&&e.push(t),e=e.map(e=>Math.round(e*255));let r=n&&e.every(e=>e%17==0),i=e.map(e=>r?(e/17).toString(16):e.toString(16).padStart(2,`0`)).join(``);return`#`+i}},keyword:{type:`custom`,test:e=>/^[a-z]+$/i.test(e),parse(e){e=e.toLowerCase();let t={spaceId:`srgb`,coords:null,alpha:1};if(e===`transparent`?(t.coords=on.black,t.alpha=0):t.coords=on[e],t.coords)return t}}}}),ln=new F({id:`p3`,cssId:`display-p3`,name:`P3`,base:nn,fromBase:X.fromBase,toBase:X.toBase});D.display_space=X;let un;if(typeof CSS<`u`&&CSS.supports)for(let e of[z,$t,ln]){let t=e.getMinCoords(),n={space:e,coords:t,alpha:1},r=qt(n);if(CSS.supports(`color`,r)){D.display_space=e;break}}function dn(e,{space:t=D.display_space,...n}={}){let r=qt(e,n);if(typeof CSS>`u`||CSS.supports(`color`,r)||!D.display_space)r=new String(r),r.color=e;else{let i=e,a=e.coords.some(u)||u(e.alpha);if(a&&!(un??=CSS.supports(`color`,`hsl(none 50% 50%)`))&&(i=W(e),i.coords=i.coords.map(d),i.alpha=d(i.alpha),r=qt(i,n),CSS.supports(`color`,r)))return r=new String(r),r.color=i,r;i=J(i,t),r=new String(qt(i,n)),r.color=i}return r}function fn(e,t){return e=j(e),t=j(t),e.space===t.space&&e.alpha===t.alpha&&e.coords.every((e,n)=>e===t.coords[n])}function Z(e){return L(e,[P,`y`])}function pn(e,t){R(e,[P,`y`],t)}function mn(e){Object.defineProperty(e.prototype,`luminance`,{get(){return Z(this)},set(e){pn(this,e)}})}var hn=Object.freeze({__proto__:null,getLuminance:Z,register:mn,setLuminance:pn});function gn(e,t){e=j(e),t=j(t);let n=Math.max(Z(e),0),r=Math.max(Z(t),0);return r>n&&([n,r]=[r,n]),(n+.05)/(r+.05)}const _n=.56,vn=.57,yn=.62,bn=.65,xn=.022,Sn=1.414,Cn=.1,wn=5e-4,Tn=1.14,En=.027,Dn=1.14;function On(e){return e>=xn?e:e+(xn-e)**Sn}function kn(e){let t=e<0?-1:1,n=Math.abs(e);return t*n**2.4}function An(e,t){t=j(t),e=j(e);let n,r,i,a,o,s;t=J(t,`srgb`),[a,o,s]=t.coords;let c=kn(a)*.2126729+kn(o)*.7151522+kn(s)*.072175;e=J(e,`srgb`),[a,o,s]=e.coords;let l=kn(a)*.2126729+kn(o)*.7151522+kn(s)*.072175,u=On(c),d=On(l),f=d>u;return Math.abs(d-u)0?r-En:r+En,i*100}function jn(e,t){e=j(e),t=j(t);let n=Math.max(Z(e),0),r=Math.max(Z(t),0);r>n&&([n,r]=[r,n]);let i=n+r;return i===0?0:(n-r)/i}const Mn=5e4;function Nn(e,t){e=j(e),t=j(t);let n=Math.max(Z(e),0),r=Math.max(Z(t),0);return r>n&&([n,r]=[r,n]),r===0?Mn:(n-r)/r}function Pn(e,t){e=j(e),t=j(t);let n=L(e,[z,`l`]),r=L(t,[z,`l`]);return Math.abs(n-r)}const Fn=216/24389,In=24/116,Ln=24389/27;let Rn=O.D65;var zn=new M({id:`lab-d65`,name:`Lab D65`,coords:{l:{refRange:[0,100],name:`Lightness`},a:{refRange:[-125,125]},b:{refRange:[-125,125]}},white:Rn,base:P,fromBase(e){let t=e.map((e,t)=>e/Rn[t]),n=t.map(e=>e>Fn?Math.cbrt(e):(Ln*e+16)/116);return[116*n[1]-16,500*(n[0]-n[1]),200*(n[1]-n[2])]},toBase(e){let t=[];t[1]=(e[0]+16)/116,t[0]=e[1]/500+t[1],t[2]=t[1]-e[2]/200;let n=[t[0]>In?t[0]**3:(116*t[0]-16)/Ln,e[0]>8?((e[0]+16)/116)**3:e[0]/Ln,t[2]>In?t[2]**3:(116*t[2]-16)/Ln];return n.map((e,t)=>e*Rn[t])},formats:{"lab-d65":{coords:[` | `,` | [-1,1]`,` | [-1,1]`]}}});const Bn=5**.5*.5+.5;function Vn(e,t){e=j(e),t=j(t);let n=L(e,[zn,`l`]),r=L(t,[zn,`l`]),i=Math.abs(n**+Bn-r**+Bn),a=i**(1/Bn)*Math.SQRT2-40;return a<7.5?0:a}var Hn=Object.freeze({__proto__:null,contrastAPCA:An,contrastDeltaPhi:Vn,contrastLstar:Pn,contrastMichelson:jn,contrastWCAG21:gn,contrastWeber:Nn});function Un(e,t,n={}){s(n)&&(n={algorithm:n});let{algorithm:r,...i}=n;if(!r){let e=Object.keys(Hn).map(e=>e.replace(/^contrast/,``)).join(`, `);throw TypeError(`contrast() function needs a contrast algorithm. Please specify one of: ${e}`)}for(let n in e=j(e),t=j(t),Hn)if(`contrast`+r.toLowerCase()===n.toLowerCase())return Hn[n](e,t,i);throw TypeError(`Unknown contrast algorithm: ${r}`)}function Wn(e){let[t,n,r]=I(e,P),i=t+15*n+3*r;return[4*t/i,9*n/i]}function Gn(e){let[t,n,r]=I(e,P),i=t+n+r;return[t/i,n/i]}function Kn(e){Object.defineProperty(e.prototype,`uv`,{get(){return Wn(this)}}),Object.defineProperty(e.prototype,`xy`,{get(){return Gn(this)}})}var qn=Object.freeze({__proto__:null,register:Kn,uv:Wn,xy:Gn});function Jn(e,t,n={}){s(n)&&(n={method:n});let{method:r=D.deltaE,...i}=n;for(let n in K)if(`deltae`+r.toLowerCase()===n.toLowerCase())return K[n](e,t,i);throw TypeError(`Unknown deltaE method: ${r}`)}function Yn(e,t=.25){let n=M.get(`oklch`,`lch`),r=[n,`l`];return R(e,r,e=>e*(1+t))}function Xn(e,t=.25){let n=M.get(`oklch`,`lch`),r=[n,`l`];return R(e,r,e=>e*(1-t))}var Zn=Object.freeze({__proto__:null,darken:Xn,lighten:Yn});function Qn(e,t,n=.5,r={}){[e,t]=[j(e),j(t)],c(n)===`object`&&([n,r]=[.5,n]);let i=er(e,t,r);return i(n)}function $n(e,t,n={}){let r;tr(e)&&([r,n]=[e,t],[e,t]=r.rangeArgs.colors);let{maxDeltaE:i,deltaEMethod:a,steps:o=2,maxSteps:s=1e3,...c}=n;r||([e,t]=[j(e),j(t)],r=er(e,t,c));let l=Jn(e,t),u=i>0?Math.max(o,Math.ceil(l/i)+1):o,d=[];if(s!==void 0&&(u=Math.min(u,s)),u===1)d=[{p:.5,color:r(.5)}];else{let e=1/(u-1);d=Array.from({length:u},(t,n)=>{let i=n*e;return{p:i,color:r(i)}})}if(i>0){let e=d.reduce((e,t,n)=>{if(n===0)return 0;let r=Jn(t.color,d[n-1].color,a);return Math.max(e,r)},0);for(;e>i;){e=0;for(let t=1;te.color),d}function er(e,t,n={}){if(tr(e)){let[n,r]=[e,t];return er(...n.rangeArgs.colors,{...n.rangeArgs.options,...r})}let{space:r,outputSpace:i,progression:a,premultiplied:o}=n;e=j(e),t=j(t),e=W(e),t=W(t);let s={colors:[e,t],options:n};if(r=r?M.get(r):M.registry[D.interpolationSpace]||e.space,i=i?M.get(i):r,e=J(e,r),t=J(t,r),e=q(e),t=q(t),r.coords.h&&r.coords.h.type===`angle`){let i=n.hue=n.hue||`shorter`,a=[r,`h`],[o,s]=[L(e,a),L(t,a)];isNaN(o)&&!isNaN(s)?o=s:isNaN(s)&&!isNaN(o)&&(s=o),[o,s]=fe(i,[o,s]),R(e,a,o),R(t,a,s)}return o&&(e.coords=e.coords.map(t=>t*e.alpha),t.coords=t.coords.map(e=>e*t.alpha)),Object.assign(n=>{n=a?a(n):n;let s=e.coords.map((e,r)=>{let i=t.coords[r];return g(e,i,n)}),c=g(e.alpha,t.alpha,n),l={space:r,coords:s,alpha:c};return o&&(l.coords=l.coords.map(e=>e/c)),i!==r&&(l=J(l,i)),l},{rangeArgs:s})}function tr(e){return c(e)===`function`&&!!e.rangeArgs}D.interpolationSpace=`lab`;function nr(e){e.defineFunction(`mix`,Qn,{returns:`color`}),e.defineFunction(`range`,er,{returns:`function`}),e.defineFunction(`steps`,$n,{returns:`array`})}var rr=Object.freeze({__proto__:null,isRange:tr,mix:Qn,range:er,register:nr,steps:$n}),ir=new M({id:`hsl`,name:`HSL`,coords:{h:{refRange:[0,360],type:`angle`,name:`Hue`},s:{range:[0,100],name:`Saturation`},l:{range:[0,100],name:`Lightness`}},base:X,fromBase:e=>{let t=Math.max(...e),n=Math.min(...e),[r,i,a]=e,[o,s,c]=[NaN,0,(n+t)/2],l=t-n;if(l!==0){switch(s=c===0||c===1?0:(t-c)/Math.min(c,1-c),t){case r:o=(i-a)/l+(i=360&&(o-=360),[o,s*100,c*100]},toBase:e=>{let[t,n,r]=e;t%=360,t<0&&(t+=360),n/=100,r/=100;function i(e){let i=(e+t/30)%12,a=n*Math.min(r,1-r);return r-a*Math.max(-1,Math.min(i-3,9-i,1))}return[i(0),i(8),i(4)]},formats:{hsl:{coords:[` | `,``,``]},hsla:{coords:[` | `,``,``],commas:!0,lastAlpha:!0}}}),ar=new M({id:`hsv`,name:`HSV`,coords:{h:{refRange:[0,360],type:`angle`,name:`Hue`},s:{range:[0,100],name:`Saturation`},v:{range:[0,100],name:`Value`}},base:ir,fromBase(e){let[t,n,r]=e;n/=100,r/=100;let i=r+n*Math.min(r,1-r);return[t,i===0?0:200*(1-r/i),100*i]},toBase(e){let[t,n,r]=e;n/=100,r/=100;let i=r*(1-n/2);return[t,i===0||i===1?0:(r-i)/Math.min(i,1-i)*100,i*100]},formats:{color:{id:`--hsv`,coords:[` | `,` | `,` | `]}}}),or=new M({id:`hwb`,name:`HWB`,coords:{h:{refRange:[0,360],type:`angle`,name:`Hue`},w:{range:[0,100],name:`Whiteness`},b:{range:[0,100],name:`Blackness`}},base:ar,fromBase(e){let[t,n,r]=e;return[t,r*(100-n)/100,100-r]},toBase(e){let[t,n,r]=e;n/=100,r/=100;let i=n+r;if(i>=1){let e=n/i;return[t,0,e*100]}let a=1-r,o=a===0?0:1-n/a;return[t,o*100,a*100]},formats:{hwb:{coords:[` | `,` | `,` | `]}}});const sr=[[.5766690429101305,.1855582379065463,.1882286462349947],[.29734497525053605,.6273635662554661,.07529145849399788],[.02703136138641234,.07068885253582723,.9913375368376388]],cr=[[2.0415879038107465,-.5650069742788596,-.34473135077832956],[-.9692436362808795,1.8759675015077202,.04155505740717557],[.013444280632031142,-.11836239223101838,1.0151749943912054]];var lr=new F({id:`a98rgb-linear`,cssId:`--a98-rgb-linear`,name:`Linear Adobe® 98 RGB compatible`,white:`D65`,toXYZ_M:sr,fromXYZ_M:cr}),ur=new F({id:`a98rgb`,cssId:`a98-rgb`,name:`Adobe® 98 RGB compatible`,base:lr,toBase:e=>e.map(e=>Math.abs(e)**(563/256)*Math.sign(e)),fromBase:e=>e.map(e=>Math.abs(e)**(256/563)*Math.sign(e))});const dr=[[.7977666449006423,.13518129740053308,.0313477341283922],[.2880748288194013,.711835234241873,8993693872564e-17],[0,0,.8251046025104602]],fr=[[1.3457868816471583,-.25557208737979464,-.05110186497554526],[-.5446307051249019,1.5082477428451468,.02052744743642139],[0,0,1.2119675456389452]];var pr=new F({id:`prophoto-linear`,cssId:`--prophoto-rgb-linear`,name:`Linear ProPhoto`,white:`D50`,base:se,toXYZ_M:dr,fromXYZ_M:fr});const mr=1/512,hr=16/512;var gr=new F({id:`prophoto`,cssId:`prophoto-rgb`,name:`ProPhoto`,base:pr,toBase(e){return e.map(e=>ee>=mr?e**(1/1.8):16*e)}}),_r=new M({id:`oklch`,name:`Oklch`,coords:{l:{refRange:[0,1],name:`Lightness`},c:{refRange:[0,.4],name:`Chroma`},h:{refRange:[0,360],type:`angle`,name:`Hue`}},white:`D65`,base:H,fromBase(e){let[t,n,r]=e,i,a=2e-4;return i=Math.abs(n) | `,` | [0,1]`,` | `]}}});let vr=O.D65;const yr=216/24389,br=24389/27,[xr,Sr]=Wn({space:P,coords:vr});var Cr=new M({id:`luv`,name:`Luv`,coords:{l:{refRange:[0,100],name:`Lightness`},u:{refRange:[-215,215]},v:{refRange:[-215,215]}},white:vr,base:P,fromBase(e){let t=[d(e[0]),d(e[1]),d(e[2])],n=t[1],[r,i]=Wn({space:P,coords:t});if(!Number.isFinite(r)||!Number.isFinite(i))return[0,0,0];let a=n<=yr?br*n:116*Math.cbrt(n)-16;return[a,13*a*(r-xr),13*a*(i-Sr)]},toBase(e){let[t,n,r]=e;if(t===0||u(t))return[0,0,0];n=d(n),r=d(r);let i=n/(13*t)+xr,a=r/(13*t)+Sr,o=t<=8?t/br:((t+16)/116)**3;return[o*(9*i/(4*a)),o,o*((12-3*i-20*a)/(4*a))]},formats:{color:{id:`--luv`,coords:[` | `,` | [-1,1]`,` | [-1,1]`]}}}),wr=new M({id:`lchuv`,name:`LChuv`,coords:{l:{refRange:[0,100],name:`Lightness`},c:{refRange:[0,220],name:`Chroma`},h:{refRange:[0,360],type:`angle`,name:`Hue`}},base:Cr,fromBase(e){let[t,n,r]=e,i,a=.02;return i=Math.abs(n) | `,` | `,` | `]}}});const Tr=216/24389,Er=24389/27,Dr=Y[0][0],Or=Y[0][1],kr=Y[0][2],Ar=Y[1][0],jr=Y[1][1],Mr=Y[1][2],Nr=Y[2][0],Pr=Y[2][1],Fr=Y[2][2];function Ir(e,t,n){let r=t/(Math.sin(n)-e*Math.cos(n));return r<0?1/0:r}function Lr(e){let t=(e+16)**3/1560896,n=t>Tr?t:e/Er,r=n*(284517*Dr-94839*kr),i=n*(838422*kr+769860*Or+731718*Dr),a=n*(632260*kr-126452*Or),o=n*(284517*Ar-94839*Mr),s=n*(838422*Mr+769860*jr+731718*Ar),c=n*(632260*Mr-126452*jr),l=n*(284517*Nr-94839*Fr),u=n*(838422*Fr+769860*Pr+731718*Nr),d=n*(632260*Fr-126452*Pr);return{r0s:r/a,r0i:i*e/a,r1s:r/(a+126452),r1i:(i-769860)*e/(a+126452),g0s:o/c,g0i:s*e/c,g1s:o/(c+126452),g1i:(s-769860)*e/(c+126452),b0s:l/d,b0i:u*e/d,b1s:l/(d+126452),b1i:(u-769860)*e/(d+126452)}}function Rr(e,t){let n=t/360*Math.PI*2,r=Ir(e.r0s,e.r0i,n),i=Ir(e.r1s,e.r1i,n),a=Ir(e.g0s,e.g0i,n),o=Ir(e.g1s,e.g1i,n),s=Ir(e.b0s,e.b0i,n),c=Ir(e.b1s,e.b1i,n);return Math.min(r,i,a,o,s,c)}var zr=new M({id:`hsluv`,name:`HSLuv`,coords:{h:{refRange:[0,360],type:`angle`,name:`Hue`},s:{range:[0,100],name:`Saturation`},l:{range:[0,100],name:`Lightness`}},base:wr,gamutSpace:X,fromBase(e){let[t,n,r]=[d(e[0]),d(e[1]),d(e[2])],i;if(t>99.9999999)i=0,t=100;else if(t<1e-8)i=0,t=0;else{let e=Lr(t),a=Rr(e,r);i=n/a*100}return[r,i,t]},toBase(e){let[t,n,r]=[d(e[0]),d(e[1]),d(e[2])],i;if(r>99.9999999)r=100,i=0;else if(r<1e-8)r=0,i=0;else{let e=Lr(r),a=Rr(e,t);i=a/100*n}return[r,i,t]},formats:{color:{id:`--hsluv`,coords:[` | `,` | `,` | `]}}});Y[0][0],Y[0][1],Y[0][2],Y[1][0],Y[1][1],Y[1][2],Y[2][0],Y[2][1],Y[2][2];function Q(e,t){return Math.abs(t)/Math.sqrt(e**2+1)}function Br(e){let t=Q(e.r0s,e.r0i),n=Q(e.r1s,e.r1i),r=Q(e.g0s,e.g0i),i=Q(e.g1s,e.g1i),a=Q(e.b0s,e.b0i),o=Q(e.b1s,e.b1i);return Math.min(t,n,r,i,a,o)}var Vr=new M({id:`hpluv`,name:`HPLuv`,coords:{h:{refRange:[0,360],type:`angle`,name:`Hue`},s:{range:[0,100],name:`Saturation`},l:{range:[0,100],name:`Lightness`}},base:wr,gamutSpace:`self`,fromBase(e){let[t,n,r]=[d(e[0]),d(e[1]),d(e[2])],i;if(t>99.9999999)i=0,t=100;else if(t<1e-8)i=0,t=0;else{let e=Lr(t),r=Br(e);i=n/r*100}return[r,i,t]},toBase(e){let[t,n,r]=[d(e[0]),d(e[1]),d(e[2])],i;if(r>99.9999999)r=100,i=0;else if(r<1e-8)r=0,i=0;else{let e=Lr(r),t=Br(e);i=t/100*n}return[r,i,t]},formats:{color:{id:`--hpluv`,coords:[` | `,` | `,` | `]}}});const Hr=203,Ur=2610/2**14,Wr=2**14/2610,Gr=2523/2**5,Kr=2**5/2523,qr=3424/2**12,Jr=2413/2**7,Yr=2392/2**7;var Xr=new F({id:`rec2100pq`,cssId:`rec2100-pq`,name:`REC.2100-PQ`,base:Xt,toBase(e){return e.map(function(e){let t=(Math.max(e**Kr-qr,0)/(Jr-Yr*e**Kr))**Wr;return t*1e4/Hr})},fromBase(e){return e.map(function(e){let t=Math.max(e*Hr/1e4,0),n=qr+Jr*t**Ur,r=1+Yr*t**Ur;return(n/r)**Gr})}});const Zr=.17883277,Qr=.28466892,$r=.55991073,ei=3.7743;var ti=new F({id:`rec2100hlg`,cssId:`rec2100-hlg`,name:`REC.2100-HLG`,referred:`scene`,base:Xt,toBase(e){return e.map(function(e){return e<=.5?e**2/3*ei:(Math.exp((e-$r)/Zr)+Qr)/12*ei})},fromBase(e){return e.map(function(e){return e/=ei,e<=1/12?Math.sqrt(3*e):Zr*Math.log(12*e-Qr)+$r})}});const ni={};E.add(`chromatic-adaptation-start`,e=>{e.options.method&&(e.M=ii(e.W1,e.W2,e.options.method))}),E.add(`chromatic-adaptation-end`,e=>{e.M||=ii(e.W1,e.W2,e.options.method)});function ri({id:e,toCone_M:t,fromCone_M:n}){ni[e]=arguments[0]}function ii(e,t,n=`Bradford`){let r=ni[n],[i,a,s]=o(r.toCone_M,e),[c,l,u]=o(r.toCone_M,t),d=[[c/i,0,0],[0,l/a,0],[0,0,u/s]],f=o(d,r.toCone_M),p=o(r.fromCone_M,f);return p}ri({id:`von Kries`,toCone_M:[[.40024,.7076,-.08081],[-.2263,1.16532,.0457],[0,0,.91822]],fromCone_M:[[1.8599363874558397,-1.1293816185800916,.21989740959619328],[.3611914362417676,.6388124632850422,-6370596838649899e-21],[0,0,1.0890636230968613]]}),ri({id:`Bradford`,toCone_M:[[.8951,.2664,-.1614],[-.7502,1.7135,.0367],[.0389,-.0685,1.0296]],fromCone_M:[[.9869929054667121,-.14705425642099013,.15996265166373122],[.4323052697233945,.5183602715367774,.049291228212855594],[-.00852866457517732,.04004282165408486,.96848669578755]]}),ri({id:`CAT02`,toCone_M:[[.7328,.4296,-.1624],[-.7036,1.6975,.0061],[.003,.0136,.9834]],fromCone_M:[[1.0961238208355142,-.27886900021828726,.18274517938277307],[.4543690419753592,.4735331543074117,.07209780371722911],[-.009627608738429355,-.00569803121611342,1.0153256399545427]]}),ri({id:`CAT16`,toCone_M:[[.401288,.650173,-.051461],[-.250268,1.204414,.045854],[-.002079,.048952,.953127]],fromCone_M:[[1.862067855087233,-1.0112546305316845,.14918677544445172],[.3875265432361372,.6214474419314753,-.008973985167612521],[-.01584149884933386,-.03412293802851557,1.0499644368778496]]}),Object.assign(O,{A:[1.0985,1,.35585],C:[.98074,1,1.18232],D55:[.95682,1,.92149],D75:[.94972,1,1.22638],E:[1,1,1],F2:[.99186,1,.67393],F7:[.95041,1,1.08747],F11:[1.00962,1,.6435]}),O.ACES=[.32168/.33767,1,.34065/.33767];const ai=[[.6624541811085053,.13400420645643313,.1561876870049078],[.27222871678091454,.6740817658111484,.05368951740793705],[-.005574649490394108,.004060733528982826,1.0103391003129971]],oi=[[1.6410233796943257,-.32480329418479,-.23642469523761225],[-.6636628587229829,1.6153315916573379,.016756347685530137],[.011721894328375376,-.008284441996237409,.9883948585390215]];var si=new F({id:`acescg`,cssId:`--acescg`,name:`ACEScg`,coords:{r:{range:[0,65504],name:`Red`},g:{range:[0,65504],name:`Green`},b:{range:[0,65504],name:`Blue`}},referred:`scene`,white:O.ACES,toXYZ_M:ai,fromXYZ_M:oi});const ci=2**-16,li=-.35828683,ui=(Math.log2(65504)+9.72)/17.52;var di=new F({id:`acescc`,cssId:`--acescc`,name:`ACEScc`,coords:{r:{range:[li,ui],name:`Red`},g:{range:[li,ui],name:`Green`},b:{range:[li,ui],name:`Blue`}},referred:`scene`,base:si,toBase(e){let t=-5.279999999999999/17.52;return e.map(function(e){return e<=t?(2**(e*17.52-9.72)-ci)*2:e1||i===void 0?1:i<0?0:i;for(let e=0;ethis.get(e),set:t=>this.set(e,t)})}get spaceId(){return this.space.id}clone(){return new e(this.space,this.coords,this.alpha)}toJSON(){return{spaceId:this.spaceId,coords:this.coords,alpha:this.alpha}}display(...t){let n=dn(this,...t);return n.color=new e(n.color),n}static get(t,...n){return t instanceof e?t:new e(t,...n)}static defineFunction(t,n,r=n){let{instance:i=!0,returns:a}=r,o=function(...t){let r=n(...t);if(a===`color`)r=e.get(r);else if(a===`function`){let t=r;r=function(...n){let r=t(...n);return e.get(r)},Object.assign(r,t)}else a===`array`&&(r=r.map(t=>e.get(t)));return r};t in e||(e[t]=o),i&&(e.prototype[t]=function(...e){return o(this,...e)})}static defineFunctions(t){for(let n in t)e.defineFunction(n,t[n],t[n])}static extend(exports){if(exports.register)exports.register(e);else for(let n in exports)e.defineFunction(n,exports[n])}};$.defineFunctions({get:L,getAll:I,set:R,setAll:oe,to:J,equals:fn,inGamut:U,toGamut:q,distance:Te,toString:qt}),Object.assign($,{util:T,hooks:E,WHITES:O,Space:M,spaces:M.registry,parse:re,defaults:D});for(let e of Object.keys(fi))M.register(fi[e]);for(let e in M.registry)pi(e,M.registry[e]);E.add(`colorspace-init-end`,e=>{pi(e.id,e),e.aliases?.forEach(t=>{pi(t,e)})});function pi(e,t){let n=e.replace(/-/g,`_`);Object.defineProperty($.prototype,n,{get(){let n=this.getAll(e);return typeof Proxy>`u`?n:new Proxy(n,{has:(e,n)=>{try{return M.resolveCoord([t,n]),!0}catch{}return Reflect.has(e,n)},get:(e,n,r)=>{if(n&&typeof n!=`symbol`&&!(n in e)){let{index:r}=M.resolveCoord([t,n]);if(r>=0)return e[r]}return Reflect.get(e,n,r)},set:(n,r,i,a)=>{if(r&&typeof r!=`symbol`&&!(r in n)||r>=0){let{index:a}=M.resolveCoord([t,r]);if(a>=0)return n[a]=i,this.setAll(e,n),!0}return Reflect.set(n,r,i,a)}})},set(t){this.setAll(e,t)},configurable:!0,enumerable:!0})}$.extend(K),$.extend({deltaE:Jn}),Object.assign($,{deltaEMethods:K}),$.extend(Zn),$.extend({contrast:Un}),$.extend(qn),$.extend(hn),$.extend(rr),$.extend(Hn);function mi(e,t){return async()=>{let n=a(()=>{let t=document.querySelector(e);if(!t)throw Error(`Widgets element not found`);return t},{retry:10,retryDelay:1e3}),r=await n();return window.getComputedStyle(r).getPropertyValue(t)}}function hi(e){return async()=>{if(typeof e==`string`)return e;{let t=n();return t.value?e.dark:e.light}}}function gi(e){async function t(){`document`in globalThis&&globalThis.document!=null&&`window`in globalThis&&globalThis.window!=null&&document.querySelector(`meta[name="theme-color"]`)?.setAttribute(`content`,new $(await e()).to(`srgb`).toString({format:`hex`}))}return{updateThemeColor:t}}export{hi as b,gi as c,mi as d}; \ No newline at end of file diff --git a/assets/together-ai-06SXbXqA.js b/assets/together-ai-06SXbXqA.js new file mode 100644 index 0000000000000000000000000000000000000000..bd7928f63314b270773398e8918e3c9a4d7a7301 --- /dev/null +++ b/assets/together-ai-06SXbXqA.js @@ -0,0 +1 @@ +import{B as e,a3 as t,a4 as n,a5 as r,a6 as i,a7 as a,a8 as o,a9 as s,aM as c,aR as l,d6 as u,d8 as d,dF as f,di as p,dp as m,dt as h,dv as g,dx as _,dz as v}from"./index-TXtvn0DM.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b=`together-ai`;var x=u({__name:`together-ai`,setup(u){let{t:y}=o(),x=c(),S=e(),{providers:C}=l(S),w=m(()=>S.getProviderMetadata(b)),T=m({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=m({get:()=>C.value[b]?.baseUrl||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});v(()=>{S.initializeProvider(b),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||``}),g([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||``}});function D(){C.value[b]={...w.value?.defaultOptions}}return(e,o)=>(_(),p(f(t),{"provider-name":w.value?.localizedName,"provider-icon-color":w.value?.iconColor,"on-back":()=>f(x).back()},{default:d(()=>[h(f(n),null,{default:d(()=>[h(f(r),{title:f(y)(`settings.pages.providers.common.section.basic.title`),description:f(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:d(()=>[h(f(a),{modelValue:T.value,"onUpdate:modelValue":o[0]||=e=>T.value=e,"provider-name":w.value?.localizedName,placeholder:`togetherapi-...`},null,8,[`modelValue`,`provider-name`])]),_:1},8,[`title`,`description`]),h(f(s),{title:f(y)(`settings.pages.providers.common.section.advanced.title`)},{default:d(()=>[h(f(i),{modelValue:E.value,"onUpdate:modelValue":o[1]||=e=>E.value=e,placeholder:`https://api.together.xyz/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon-color`,`on-back`]))}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file diff --git a/assets/together-ai-CyEYaNHN.js b/assets/together-ai-CyEYaNHN.js deleted file mode 100644 index 2df49fc7e9389f279ea58af12c722795b21f4f70..0000000000000000000000000000000000000000 --- a/assets/together-ai-CyEYaNHN.js +++ /dev/null @@ -1 +0,0 @@ -import{B as e,a3 as t,a4 as n,a5 as r,a6 as i,a7 as a,a8 as o,a9 as s,aM as c,aR as l,dD as u,da as d,de as f,dg as p,di as m,dk as h,dm as g,do as _,dy as v}from"./index-Bcb2irKh.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b=`together-ai`;var x=g({__name:`together-ai`,setup(g){let{t:y}=o(),x=c(),S=e(),{providers:C}=l(S),w=d(()=>S.getProviderMetadata(b)),T=d({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=d({get:()=>C.value[b]?.baseUrl||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});h(()=>{S.initializeProvider(b),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||``}),p([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||``}});function D(){C.value[b]={...w.value?.defaultOptions}}return(e,o)=>(m(),v(u(t),{"provider-name":w.value?.localizedName,"provider-icon-color":w.value?.iconColor,"on-back":()=>u(x).back()},{default:_(()=>[f(u(n),null,{default:_(()=>[f(u(r),{title:u(y)(`settings.pages.providers.common.section.basic.title`),description:u(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:_(()=>[f(u(a),{modelValue:T.value,"onUpdate:modelValue":o[0]||=e=>T.value=e,"provider-name":w.value?.localizedName,placeholder:`togetherapi-...`},null,8,[`modelValue`,`provider-name`])]),_:1},8,[`title`,`description`]),f(u(s),{title:u(y)(`settings.pages.providers.common.section.advanced.title`)},{default:_(()=>[f(u(i),{modelValue:E.value,"onUpdate:modelValue":o[1]||=e=>E.value=e,placeholder:`https://api.together.xyz/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon-color`,`on-back`]))}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file diff --git a/assets/transformers.web-CQlzVquP.js b/assets/transformers.web-7B3It45j.js similarity index 99% rename from assets/transformers.web-CQlzVquP.js rename to assets/transformers.web-7B3It45j.js index 823f45849bf9d9970716d8743d7a56f81486e312..ffde697b8b188b95f2c6c7dfe1097ed9b999bc9f 100644 --- a/assets/transformers.web-CQlzVquP.js +++ b/assets/transformers.web-7B3It45j.js @@ -1,4 +1,4 @@ -import{dR as e,dT as t}from"./index-Bcb2irKh.js";const n=new Map,r=[],i=(e,t,i)=>{if(t&&typeof t.init==`function`&&typeof t.createInferenceSessionHandler==`function`){let a=n.get(e);if(a===void 0)n.set(e,{backend:t,priority:i});else if(a.priority>i)return;else if(a.priority===i&&a.backend!==t)throw Error(`cannot register backend "${e}" using priority ${i}`);if(i>=0){let t=r.indexOf(e);t!==-1&&r.splice(t,1);for(let t=0;t{let t=n.get(e);if(!t)return`backend not found.`;if(t.initialized)return t.backend;if(t.aborted)return t.error;{let n=!!t.initPromise;try{return n||(t.initPromise=t.backend.init(e)),await t.initPromise,t.initialized=!0,t.backend}catch(e){return n||(t.error=`${e}`,t.aborted=!0),t.error}finally{delete t.initPromise}}},o=async e=>{let t=e.executionProviders||[],n=t.map(e=>typeof e==`string`?e:e.name),i=n.length===0?r:n,o,s=[],c=new Set;for(let e of i){let t=await a(e);typeof t==`string`?s.push({name:e,err:t}):(o||=t,o===t&&c.add(e))}if(!o)throw Error(`no available backend found. ERR: ${s.map(e=>`[${e.name}] ${e.err}`).join(`, `)}`);for(let{name:e,err:t}of s)n.includes(e)&&console.warn(`removing requested execution provider "${e}" from session options because it is not available: ${t}`);let l=t.filter(e=>c.has(typeof e==`string`?e:e.name));return[o,new Proxy(e,{get:(e,t)=>t===`executionProviders`?l:Reflect.get(e,t)})]},s=`1.22.0`;let c=`warning`;const l={wasm:{},webgl:{},webgpu:{},versions:{common:s},set logLevel(e){if(e!==void 0){if(typeof e!=`string`||[`verbose`,`info`,`warning`,`error`,`fatal`].indexOf(e)===-1)throw Error(`Unsupported logging level: ${e}`);c=e}},get logLevel(){return c}};Object.defineProperty(l,`logLevel`,{enumerable:!0});const u=l,d=(e,t)=>{let n=typeof document<`u`?document.createElement(`canvas`):new OffscreenCanvas(1,1);n.width=e.dims[3],n.height=e.dims[2];let r=n.getContext(`2d`);if(r!=null){let i,a;t?.tensorLayout!==void 0&&t.tensorLayout===`NHWC`?(i=e.dims[2],a=e.dims[3]):(i=e.dims[3],a=e.dims[2]);let o=t?.format===void 0?`RGB`:t.format,s=t?.norm,c,l;s===void 0||s.mean===void 0?c=[255,255,255,255]:typeof s.mean==`number`?c=[s.mean,s.mean,s.mean,s.mean]:(c=[s.mean[0],s.mean[1],s.mean[2],0],s.mean[3]!==void 0&&(c[3]=s.mean[3])),s===void 0||s.bias===void 0?l=[0,0,0,0]:typeof s.bias==`number`?l=[s.bias,s.bias,s.bias,s.bias]:(l=[s.bias[0],s.bias[1],s.bias[2],0],s.bias[3]!==void 0&&(l[3]=s.bias[3]));let u=a*i,d=0,f=u,p=u*2,m=-1;o===`RGBA`?(d=0,f=u,p=u*2,m=u*3):o===`RGB`?(d=0,f=u,p=u*2):o===`RBG`&&(d=0,p=u,f=u*2);for(let t=0;t{let n=typeof document<`u`?document.createElement(`canvas`).getContext(`2d`):new OffscreenCanvas(1,1).getContext(`2d`),r;if(n!=null){let i,a,o;t?.tensorLayout!==void 0&&t.tensorLayout===`NHWC`?(i=e.dims[2],a=e.dims[1],o=e.dims[3]):(i=e.dims[3],a=e.dims[2],o=e.dims[1]);let s=t===void 0||t.format===void 0?`RGB`:t.format,c=t?.norm,l,u;c===void 0||c.mean===void 0?l=[255,255,255,255]:typeof c.mean==`number`?l=[c.mean,c.mean,c.mean,c.mean]:(l=[c.mean[0],c.mean[1],c.mean[2],255],c.mean[3]!==void 0&&(l[3]=c.mean[3])),c===void 0||c.bias===void 0?u=[0,0,0,0]:typeof c.bias==`number`?u=[c.bias,c.bias,c.bias,c.bias]:(u=[c.bias[0],c.bias[1],c.bias[2],0],c.bias[3]!==void 0&&(u[3]=c.bias[3]));let d=a*i;if(t!==void 0&&(t.format!==void 0&&o===4&&t.format!==`RGBA`||o===3&&t.format!==`RGB`&&t.format!==`BGR`))throw Error(`Tensor format doesn't match input tensor dims`);let f=4,p=0,m=1,h=2,g=3,_=0,v=d,y=d*2,b=-1;s===`RGBA`?(_=0,v=d,y=d*2,b=d*3):s===`RGB`?(_=0,v=d,y=d*2):s===`RBG`&&(_=0,y=d,v=d*2),r=n.createImageData(i,a);for(let t=0;t{if(e===void 0)throw Error(`Image buffer must be defined`);if(t.height===void 0||t.width===void 0)throw Error(`Image height and width must be defined`);if(t.tensorLayout===`NHWC`)throw Error(`NHWC Tensor layout is not supported yet`);let{height:n,width:r}=t,i=t.norm??{mean:255,bias:0},a,o;a=typeof i.mean==`number`?[i.mean,i.mean,i.mean,i.mean]:[i.mean[0],i.mean[1],i.mean[2],i.mean[3]??255],o=typeof i.bias==`number`?[i.bias,i.bias,i.bias,i.bias]:[i.bias[0],i.bias[1],i.bias[2],i.bias[3]??0];let s=t.format===void 0?`RGBA`:t.format,c=t.tensorFormat===void 0||t.tensorFormat===void 0?`RGB`:t.tensorFormat,l=n*r,u=c===`RGBA`?new Float32Array(l*4):new Float32Array(l*3),d=4,f=0,p=1,m=2,h=3,g=0,_=l,v=l*2,y=-1;s===`RGB`&&(d=3,f=0,p=1,m=2,h=-1),c===`RGBA`?y=l*3:c===`RBG`?(g=0,v=l,_=l*2):c===`BGR`&&(v=0,_=l,g=l*2);for(let t=0;t{let n=typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement,r=typeof ImageData<`u`&&e instanceof ImageData,i=typeof ImageBitmap<`u`&&e instanceof ImageBitmap,a=typeof e==`string`,o,s=t??{},c=()=>{if(typeof document<`u`)return document.createElement(`canvas`);if(typeof OffscreenCanvas<`u`)return new OffscreenCanvas(1,1);throw Error(`Canvas is not supported`)},l=e=>typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||e instanceof OffscreenCanvas?e.getContext(`2d`):null;if(n){let n=c();n.width=e.width,n.height=e.height;let r=l(n);if(r!=null){let n=e.height,i=e.width;if(t!==void 0&&t.resizedHeight!==void 0&&t.resizedWidth!==void 0&&(n=t.resizedHeight,i=t.resizedWidth),t!==void 0){if(s=t,t.tensorFormat!==void 0)throw Error(`Image input config format must be RGBA for HTMLImageElement`);s.tensorFormat=`RGBA`,s.height=n,s.width=i}else s.tensorFormat=`RGBA`,s.height=n,s.width=i;r.drawImage(e,0,0),o=r.getImageData(0,0,i,n).data}else throw Error(`Can not access image data`)}else if(r){let n,r;if(t!==void 0&&t.resizedWidth!==void 0&&t.resizedHeight!==void 0?(n=t.resizedHeight,r=t.resizedWidth):(n=e.height,r=e.width),t!==void 0&&(s=t),s.format=`RGBA`,s.height=n,s.width=r,t!==void 0){let t=c();t.width=r,t.height=n;let i=l(t);if(i!=null)i.putImageData(e,0,0),o=i.getImageData(0,0,r,n).data;else throw Error(`Can not access image data`)}else o=e.data}else if(i){if(t===void 0)throw Error(`Please provide image config with format for Imagebitmap`);let n=c();n.width=e.width,n.height=e.height;let r=l(n);if(r!=null){let t=e.height,n=e.width;return r.drawImage(e,0,0,n,t),o=r.getImageData(0,0,n,t).data,s.height=t,s.width=n,p(o,s)}else throw Error(`Can not access image data`)}else if(a)return new Promise((t,n)=>{let r=c(),i=l(r);if(!e||!i)return n();let a=new Image;a.crossOrigin=`Anonymous`,a.src=e,a.onload=()=>{r.width=a.width,r.height=a.height,i.drawImage(a,0,0,r.width,r.height);let e=i.getImageData(0,0,r.width,r.height);s.height=r.height,s.width=r.width,t(p(e.data,s))}});else throw Error(`Input data provided is not supported - aborted tensor creation`);if(o!==void 0)return p(o,s);throw Error(`Input data provided is not supported - aborted tensor creation`)},h=(e,t)=>{let{width:n,height:r,download:i,dispose:a}=t,o=[1,r,n,4];return new T({location:`texture`,type:`float32`,texture:e,dims:o,download:i,dispose:a})},g=(e,t)=>{let{dataType:n,dims:r,download:i,dispose:a}=t;return new T({location:`gpu-buffer`,type:n??`float32`,gpuBuffer:e,dims:r,download:i,dispose:a})},_=(e,t)=>{let{dataType:n,dims:r,download:i,dispose:a}=t;return new T({location:`ml-tensor`,type:n??`float32`,mlTensor:e,dims:r,download:i,dispose:a})},v=(e,t,n)=>new T({location:`cpu-pinned`,type:e,data:t,dims:n??[t.length]}),y=new Map([[`float32`,Float32Array],[`uint8`,Uint8Array],[`int8`,Int8Array],[`uint16`,Uint16Array],[`int16`,Int16Array],[`int32`,Int32Array],[`bool`,Uint8Array],[`float64`,Float64Array],[`uint32`,Uint32Array],[`int4`,Uint8Array],[`uint4`,Uint8Array]]),b=new Map([[Float32Array,`float32`],[Uint8Array,`uint8`],[Int8Array,`int8`],[Uint16Array,`uint16`],[Int16Array,`int16`],[Int32Array,`int32`],[Float64Array,`float64`],[Uint32Array,`uint32`]]);let x=!1;const S=()=>{if(!x){x=!0;let e=typeof BigInt64Array<`u`&&BigInt64Array.from,t=typeof BigUint64Array<`u`&&BigUint64Array.from,n=globalThis.Float16Array,r=n!==void 0&&n.from;e&&(y.set(`int64`,BigInt64Array),b.set(BigInt64Array,`int64`)),t&&(y.set(`uint64`,BigUint64Array),b.set(BigUint64Array,`uint64`)),r?(y.set(`float16`,n),b.set(n,`float16`)):y.set(`float16`,Uint16Array)}},C=e=>{let t=1;for(let n=0;n{switch(e.location){case`cpu`:return new T(e.type,e.data,t);case`cpu-pinned`:return new T({location:`cpu-pinned`,data:e.data,type:e.type,dims:t});case`texture`:return new T({location:`texture`,texture:e.texture,type:e.type,dims:t});case`gpu-buffer`:return new T({location:`gpu-buffer`,gpuBuffer:e.gpuBuffer,type:e.type,dims:t});case`ml-tensor`:return new T({location:`ml-tensor`,mlTensor:e.mlTensor,type:e.type,dims:t});default:throw Error(`tensorReshape: tensor location ${e.location} is not supported`)}};var T=class{constructor(e,t,n){S();let r,i;if(typeof e==`object`&&`location`in e)switch(this.dataLocation=e.location,r=e.type,i=e.dims,e.location){case`cpu-pinned`:{let t=y.get(r);if(!t)throw TypeError(`unsupported type "${r}" to create tensor from pinned buffer`);if(!(e.data instanceof t))throw TypeError(`buffer should be of type ${t.name}`);this.cpuData=e.data;break}case`texture`:if(r!==`float32`)throw TypeError(`unsupported type "${r}" to create tensor from texture`);this.gpuTextureData=e.texture,this.downloader=e.download,this.disposer=e.dispose;break;case`gpu-buffer`:if(r!==`float32`&&r!==`float16`&&r!==`int32`&&r!==`int64`&&r!==`uint32`&&r!==`uint8`&&r!==`bool`&&r!==`uint4`&&r!==`int4`)throw TypeError(`unsupported type "${r}" to create tensor from gpu buffer`);this.gpuBufferData=e.gpuBuffer,this.downloader=e.download,this.disposer=e.dispose;break;case`ml-tensor`:if(r!==`float32`&&r!==`float16`&&r!==`int32`&&r!==`int64`&&r!==`uint32`&&r!==`uint64`&&r!==`int8`&&r!==`uint8`&&r!==`bool`&&r!==`uint4`&&r!==`int4`)throw TypeError(`unsupported type "${r}" to create tensor from MLTensor`);this.mlTensorData=e.mlTensor,this.downloader=e.download,this.disposer=e.dispose;break;default:throw Error(`Tensor constructor: unsupported location '${this.dataLocation}'`)}else{let a,o;if(typeof e==`string`)if(r=e,o=n,e===`string`){if(!Array.isArray(t))throw TypeError(`A string tensor's data must be a string array.`);a=t}else{let n=y.get(e);if(n===void 0)throw TypeError(`Unsupported tensor type: ${e}.`);if(Array.isArray(t)){if(e===`float16`&&n===Uint16Array||e===`uint4`||e===`int4`)throw TypeError(`Creating a ${e} tensor from number array is not supported. Please use ${n.name} as data.`);a=e===`uint64`||e===`int64`?n.from(t,BigInt):n.from(t)}else if(t instanceof n)a=t;else if(t instanceof Uint8ClampedArray)if(e===`uint8`)a=Uint8Array.from(t);else throw TypeError(`A Uint8ClampedArray tensor's data must be type of uint8`);else if(e===`float16`&&t instanceof Uint16Array&&n!==Uint16Array)a=new globalThis.Float16Array(t.buffer,t.byteOffset,t.length);else throw TypeError(`A ${r} tensor's data must be type of ${n}`)}else if(o=t,Array.isArray(e)){if(e.length===0)throw TypeError(`Tensor type cannot be inferred from an empty array.`);let t=typeof e[0];if(t===`string`)r=`string`,a=e;else if(t===`boolean`)r=`bool`,a=Uint8Array.from(e);else throw TypeError(`Invalid element type of data array: ${t}.`)}else if(e instanceof Uint8ClampedArray)r=`uint8`,a=Uint8Array.from(e);else{let t=b.get(e.constructor);if(t===void 0)throw TypeError(`Unsupported type for tensor data: ${e.constructor}.`);r=t,a=e}if(o===void 0)o=[a.length];else if(!Array.isArray(o))throw TypeError(`A tensor's dims must be a number array`);i=o,this.cpuData=a,this.dataLocation=`cpu`}let a=C(i);if(this.cpuData&&a!==this.cpuData.length&&!((r===`uint4`||r===`int4`)&&Math.ceil(a/2)===this.cpuData.length))throw Error(`Tensor's size(${a}) does not match data length(${this.cpuData.length}).`);this.type=r,this.dims=i,this.size=a}static async fromImage(e,t){return m(e,t)}static fromTexture(e,t){return h(e,t)}static fromGpuBuffer(e,t){return g(e,t)}static fromMLTensor(e,t){return _(e,t)}static fromPinnedBuffer(e,t,n){return v(e,t,n)}toDataURL(e){return d(this,e)}toImageData(e){return f(this,e)}get data(){if(this.ensureValid(),!this.cpuData)throw Error("The data is not on CPU. Use `getData()` to download GPU data to CPU, or use `texture` or `gpuBuffer` property to access the GPU data directly.");return this.cpuData}get location(){return this.dataLocation}get texture(){if(this.ensureValid(),!this.gpuTextureData)throw Error(`The data is not stored as a WebGL texture.`);return this.gpuTextureData}get gpuBuffer(){if(this.ensureValid(),!this.gpuBufferData)throw Error(`The data is not stored as a WebGPU buffer.`);return this.gpuBufferData}get mlTensor(){if(this.ensureValid(),!this.mlTensorData)throw Error(`The data is not stored as a WebNN MLTensor.`);return this.mlTensorData}async getData(e){switch(this.ensureValid(),this.dataLocation){case`cpu`:case`cpu-pinned`:return this.data;case`texture`:case`gpu-buffer`:case`ml-tensor`:if(!this.downloader)throw Error(`The current tensor is not created with a specified data downloader.`);if(this.isDownloading)throw Error(`The current tensor is being downloaded.`);try{this.isDownloading=!0;let t=await this.downloader();return this.downloader=void 0,this.dataLocation=`cpu`,this.cpuData=t,e&&this.disposer&&(this.disposer(),this.disposer=void 0),t}finally{this.isDownloading=!1}default:throw Error(`cannot get data from location: ${this.dataLocation}`)}}dispose(){if(this.isDownloading)throw Error(`The current tensor is being downloaded.`);this.disposer&&(this.disposer(),this.disposer=void 0),this.cpuData=void 0,this.gpuTextureData=void 0,this.gpuBufferData=void 0,this.mlTensorData=void 0,this.downloader=void 0,this.isDownloading=void 0,this.dataLocation=`none`}ensureValid(){if(this.dataLocation===`none`)throw Error(`The tensor is disposed.`)}reshape(e){if(this.ensureValid(),this.downloader||this.disposer)throw Error(`Cannot reshape a tensor that owns GPU resource.`);return w(this,e)}};const E=T,D=(e,t)=>{(l.trace===void 0?!l.wasm.trace:!l.trace)||console.timeStamp(`${e}::ORT::${t}`)},O=(e,t)=>{let n=Error().stack?.split(/\r\n|\r|\n/g)||[],r=!1;for(let i=0;i{(l.trace===void 0?!l.wasm.trace:!l.trace)||O(`BEGIN`,e)},A=e=>{(l.trace===void 0?!l.wasm.trace:!l.trace)||O(`END`,e)};var ee=class e{constructor(e){this.handler=e}async run(e,t,n){k();let r={},i={};if(typeof e!=`object`||!e||e instanceof E||Array.isArray(e))throw TypeError(`'feeds' must be an object that use input names as keys and OnnxValue as corresponding values.`);let a=!0;if(typeof t==`object`){if(t===null)throw TypeError(`Unexpected argument[1]: cannot be null.`);if(t instanceof E)throw TypeError(`'fetches' cannot be a Tensor`);if(Array.isArray(t)){if(t.length===0)throw TypeError(`'fetches' cannot be an empty array.`);a=!1;for(let e of t){if(typeof e!=`string`)throw TypeError(`'fetches' must be a string array or an object.`);if(this.outputNames.indexOf(e)===-1)throw RangeError(`'fetches' contains invalid output name: ${e}.`);r[e]=null}if(typeof n==`object`&&n)i=n;else if(n!==void 0)throw TypeError(`'options' must be an object.`)}else{let e=!1,o=Object.getOwnPropertyNames(t);for(let n of this.outputNames)if(o.indexOf(n)!==-1){let i=t[n];(i===null||i instanceof E)&&(e=!0,a=!1,r[n]=i)}if(e){if(typeof n==`object`&&n)i=n;else if(n!==void 0)throw TypeError(`'options' must be an object.`)}else i=t}}else if(t!==void 0)throw TypeError(`Unexpected argument[1]: must be 'fetches' or 'options'.`);for(let t of this.inputNames)if(e[t]===void 0)throw Error(`input '${t}' is missing in 'feeds'.`);if(a)for(let e of this.outputNames)r[e]=null;let o=await this.handler.run(e,r,i),s={};for(let e in o)if(Object.hasOwnProperty.call(o,e)){let t=o[e];t instanceof E?s[e]=t:s[e]=new E(t.type,t.data,t.dims)}return A(),s}async release(){return this.handler.dispose()}static async create(t,n,r,i){k();let a,s={};if(typeof t==`string`){if(a=t,typeof n==`object`&&n)s=n;else if(n!==void 0)throw TypeError(`'options' must be an object.`)}else if(t instanceof Uint8Array){if(a=t,typeof n==`object`&&n)s=n;else if(n!==void 0)throw TypeError(`'options' must be an object.`)}else if(t instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&t instanceof SharedArrayBuffer){let e=t,o=0,c=t.byteLength;if(typeof n==`object`&&n)s=n;else if(typeof n==`number`){if(o=n,!Number.isSafeInteger(o))throw RangeError(`'byteOffset' must be an integer.`);if(o<0||o>=e.byteLength)throw RangeError(`'byteOffset' is out of range [0, ${e.byteLength}).`);if(c=t.byteLength-o,typeof r==`number`){if(c=r,!Number.isSafeInteger(c))throw RangeError(`'byteLength' must be an integer.`);if(c<=0||o+c>e.byteLength)throw RangeError(`'byteLength' is out of range (0, ${e.byteLength-o}].`);if(typeof i==`object`&&i)s=i;else if(i!==void 0)throw TypeError(`'options' must be an object.`)}else if(r!==void 0)throw TypeError(`'byteLength' must be a number.`)}else if(n!==void 0)throw TypeError(`'options' must be an object.`);a=new Uint8Array(e,o,c)}else throw TypeError(`Unexpected argument[0]: must be 'path' or 'buffer'.`);let[c,l]=await o(s),u=await c.createInferenceSessionHandler(a,l);return A(),new e(u)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}get inputMetadata(){return this.handler.inputMetadata}get outputMetadata(){return this.handler.outputMetadata}};const te=ee;var ne={};e(ne,{InferenceSession:()=>te,TRACE:()=>D,TRACE_FUNC_BEGIN:()=>k,TRACE_FUNC_END:()=>A,Tensor:()=>E,env:()=>u,registerBackend:()=>i});var j={};e(j,{InferenceSession:()=>Ke,TRACE:()=>z,TRACE_FUNC_BEGIN:()=>He,TRACE_FUNC_END:()=>B,Tensor:()=>ze,default:()=>rf,env:()=>L,registerBackend:()=>P}); +import{dR as e,dT as t}from"./index-TXtvn0DM.js";const n=new Map,r=[],i=(e,t,i)=>{if(t&&typeof t.init==`function`&&typeof t.createInferenceSessionHandler==`function`){let a=n.get(e);if(a===void 0)n.set(e,{backend:t,priority:i});else if(a.priority>i)return;else if(a.priority===i&&a.backend!==t)throw Error(`cannot register backend "${e}" using priority ${i}`);if(i>=0){let t=r.indexOf(e);t!==-1&&r.splice(t,1);for(let t=0;t{let t=n.get(e);if(!t)return`backend not found.`;if(t.initialized)return t.backend;if(t.aborted)return t.error;{let n=!!t.initPromise;try{return n||(t.initPromise=t.backend.init(e)),await t.initPromise,t.initialized=!0,t.backend}catch(e){return n||(t.error=`${e}`,t.aborted=!0),t.error}finally{delete t.initPromise}}},o=async e=>{let t=e.executionProviders||[],n=t.map(e=>typeof e==`string`?e:e.name),i=n.length===0?r:n,o,s=[],c=new Set;for(let e of i){let t=await a(e);typeof t==`string`?s.push({name:e,err:t}):(o||=t,o===t&&c.add(e))}if(!o)throw Error(`no available backend found. ERR: ${s.map(e=>`[${e.name}] ${e.err}`).join(`, `)}`);for(let{name:e,err:t}of s)n.includes(e)&&console.warn(`removing requested execution provider "${e}" from session options because it is not available: ${t}`);let l=t.filter(e=>c.has(typeof e==`string`?e:e.name));return[o,new Proxy(e,{get:(e,t)=>t===`executionProviders`?l:Reflect.get(e,t)})]},s=`1.22.0`;let c=`warning`;const l={wasm:{},webgl:{},webgpu:{},versions:{common:s},set logLevel(e){if(e!==void 0){if(typeof e!=`string`||[`verbose`,`info`,`warning`,`error`,`fatal`].indexOf(e)===-1)throw Error(`Unsupported logging level: ${e}`);c=e}},get logLevel(){return c}};Object.defineProperty(l,`logLevel`,{enumerable:!0});const u=l,d=(e,t)=>{let n=typeof document<`u`?document.createElement(`canvas`):new OffscreenCanvas(1,1);n.width=e.dims[3],n.height=e.dims[2];let r=n.getContext(`2d`);if(r!=null){let i,a;t?.tensorLayout!==void 0&&t.tensorLayout===`NHWC`?(i=e.dims[2],a=e.dims[3]):(i=e.dims[3],a=e.dims[2]);let o=t?.format===void 0?`RGB`:t.format,s=t?.norm,c,l;s===void 0||s.mean===void 0?c=[255,255,255,255]:typeof s.mean==`number`?c=[s.mean,s.mean,s.mean,s.mean]:(c=[s.mean[0],s.mean[1],s.mean[2],0],s.mean[3]!==void 0&&(c[3]=s.mean[3])),s===void 0||s.bias===void 0?l=[0,0,0,0]:typeof s.bias==`number`?l=[s.bias,s.bias,s.bias,s.bias]:(l=[s.bias[0],s.bias[1],s.bias[2],0],s.bias[3]!==void 0&&(l[3]=s.bias[3]));let u=a*i,d=0,f=u,p=u*2,m=-1;o===`RGBA`?(d=0,f=u,p=u*2,m=u*3):o===`RGB`?(d=0,f=u,p=u*2):o===`RBG`&&(d=0,p=u,f=u*2);for(let t=0;t{let n=typeof document<`u`?document.createElement(`canvas`).getContext(`2d`):new OffscreenCanvas(1,1).getContext(`2d`),r;if(n!=null){let i,a,o;t?.tensorLayout!==void 0&&t.tensorLayout===`NHWC`?(i=e.dims[2],a=e.dims[1],o=e.dims[3]):(i=e.dims[3],a=e.dims[2],o=e.dims[1]);let s=t===void 0||t.format===void 0?`RGB`:t.format,c=t?.norm,l,u;c===void 0||c.mean===void 0?l=[255,255,255,255]:typeof c.mean==`number`?l=[c.mean,c.mean,c.mean,c.mean]:(l=[c.mean[0],c.mean[1],c.mean[2],255],c.mean[3]!==void 0&&(l[3]=c.mean[3])),c===void 0||c.bias===void 0?u=[0,0,0,0]:typeof c.bias==`number`?u=[c.bias,c.bias,c.bias,c.bias]:(u=[c.bias[0],c.bias[1],c.bias[2],0],c.bias[3]!==void 0&&(u[3]=c.bias[3]));let d=a*i;if(t!==void 0&&(t.format!==void 0&&o===4&&t.format!==`RGBA`||o===3&&t.format!==`RGB`&&t.format!==`BGR`))throw Error(`Tensor format doesn't match input tensor dims`);let f=4,p=0,m=1,h=2,g=3,_=0,v=d,y=d*2,b=-1;s===`RGBA`?(_=0,v=d,y=d*2,b=d*3):s===`RGB`?(_=0,v=d,y=d*2):s===`RBG`&&(_=0,y=d,v=d*2),r=n.createImageData(i,a);for(let t=0;t{if(e===void 0)throw Error(`Image buffer must be defined`);if(t.height===void 0||t.width===void 0)throw Error(`Image height and width must be defined`);if(t.tensorLayout===`NHWC`)throw Error(`NHWC Tensor layout is not supported yet`);let{height:n,width:r}=t,i=t.norm??{mean:255,bias:0},a,o;a=typeof i.mean==`number`?[i.mean,i.mean,i.mean,i.mean]:[i.mean[0],i.mean[1],i.mean[2],i.mean[3]??255],o=typeof i.bias==`number`?[i.bias,i.bias,i.bias,i.bias]:[i.bias[0],i.bias[1],i.bias[2],i.bias[3]??0];let s=t.format===void 0?`RGBA`:t.format,c=t.tensorFormat===void 0||t.tensorFormat===void 0?`RGB`:t.tensorFormat,l=n*r,u=c===`RGBA`?new Float32Array(l*4):new Float32Array(l*3),d=4,f=0,p=1,m=2,h=3,g=0,_=l,v=l*2,y=-1;s===`RGB`&&(d=3,f=0,p=1,m=2,h=-1),c===`RGBA`?y=l*3:c===`RBG`?(g=0,v=l,_=l*2):c===`BGR`&&(v=0,_=l,g=l*2);for(let t=0;t{let n=typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement,r=typeof ImageData<`u`&&e instanceof ImageData,i=typeof ImageBitmap<`u`&&e instanceof ImageBitmap,a=typeof e==`string`,o,s=t??{},c=()=>{if(typeof document<`u`)return document.createElement(`canvas`);if(typeof OffscreenCanvas<`u`)return new OffscreenCanvas(1,1);throw Error(`Canvas is not supported`)},l=e=>typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||e instanceof OffscreenCanvas?e.getContext(`2d`):null;if(n){let n=c();n.width=e.width,n.height=e.height;let r=l(n);if(r!=null){let n=e.height,i=e.width;if(t!==void 0&&t.resizedHeight!==void 0&&t.resizedWidth!==void 0&&(n=t.resizedHeight,i=t.resizedWidth),t!==void 0){if(s=t,t.tensorFormat!==void 0)throw Error(`Image input config format must be RGBA for HTMLImageElement`);s.tensorFormat=`RGBA`,s.height=n,s.width=i}else s.tensorFormat=`RGBA`,s.height=n,s.width=i;r.drawImage(e,0,0),o=r.getImageData(0,0,i,n).data}else throw Error(`Can not access image data`)}else if(r){let n,r;if(t!==void 0&&t.resizedWidth!==void 0&&t.resizedHeight!==void 0?(n=t.resizedHeight,r=t.resizedWidth):(n=e.height,r=e.width),t!==void 0&&(s=t),s.format=`RGBA`,s.height=n,s.width=r,t!==void 0){let t=c();t.width=r,t.height=n;let i=l(t);if(i!=null)i.putImageData(e,0,0),o=i.getImageData(0,0,r,n).data;else throw Error(`Can not access image data`)}else o=e.data}else if(i){if(t===void 0)throw Error(`Please provide image config with format for Imagebitmap`);let n=c();n.width=e.width,n.height=e.height;let r=l(n);if(r!=null){let t=e.height,n=e.width;return r.drawImage(e,0,0,n,t),o=r.getImageData(0,0,n,t).data,s.height=t,s.width=n,p(o,s)}else throw Error(`Can not access image data`)}else if(a)return new Promise((t,n)=>{let r=c(),i=l(r);if(!e||!i)return n();let a=new Image;a.crossOrigin=`Anonymous`,a.src=e,a.onload=()=>{r.width=a.width,r.height=a.height,i.drawImage(a,0,0,r.width,r.height);let e=i.getImageData(0,0,r.width,r.height);s.height=r.height,s.width=r.width,t(p(e.data,s))}});else throw Error(`Input data provided is not supported - aborted tensor creation`);if(o!==void 0)return p(o,s);throw Error(`Input data provided is not supported - aborted tensor creation`)},h=(e,t)=>{let{width:n,height:r,download:i,dispose:a}=t,o=[1,r,n,4];return new T({location:`texture`,type:`float32`,texture:e,dims:o,download:i,dispose:a})},g=(e,t)=>{let{dataType:n,dims:r,download:i,dispose:a}=t;return new T({location:`gpu-buffer`,type:n??`float32`,gpuBuffer:e,dims:r,download:i,dispose:a})},_=(e,t)=>{let{dataType:n,dims:r,download:i,dispose:a}=t;return new T({location:`ml-tensor`,type:n??`float32`,mlTensor:e,dims:r,download:i,dispose:a})},v=(e,t,n)=>new T({location:`cpu-pinned`,type:e,data:t,dims:n??[t.length]}),y=new Map([[`float32`,Float32Array],[`uint8`,Uint8Array],[`int8`,Int8Array],[`uint16`,Uint16Array],[`int16`,Int16Array],[`int32`,Int32Array],[`bool`,Uint8Array],[`float64`,Float64Array],[`uint32`,Uint32Array],[`int4`,Uint8Array],[`uint4`,Uint8Array]]),b=new Map([[Float32Array,`float32`],[Uint8Array,`uint8`],[Int8Array,`int8`],[Uint16Array,`uint16`],[Int16Array,`int16`],[Int32Array,`int32`],[Float64Array,`float64`],[Uint32Array,`uint32`]]);let x=!1;const S=()=>{if(!x){x=!0;let e=typeof BigInt64Array<`u`&&BigInt64Array.from,t=typeof BigUint64Array<`u`&&BigUint64Array.from,n=globalThis.Float16Array,r=n!==void 0&&n.from;e&&(y.set(`int64`,BigInt64Array),b.set(BigInt64Array,`int64`)),t&&(y.set(`uint64`,BigUint64Array),b.set(BigUint64Array,`uint64`)),r?(y.set(`float16`,n),b.set(n,`float16`)):y.set(`float16`,Uint16Array)}},C=e=>{let t=1;for(let n=0;n{switch(e.location){case`cpu`:return new T(e.type,e.data,t);case`cpu-pinned`:return new T({location:`cpu-pinned`,data:e.data,type:e.type,dims:t});case`texture`:return new T({location:`texture`,texture:e.texture,type:e.type,dims:t});case`gpu-buffer`:return new T({location:`gpu-buffer`,gpuBuffer:e.gpuBuffer,type:e.type,dims:t});case`ml-tensor`:return new T({location:`ml-tensor`,mlTensor:e.mlTensor,type:e.type,dims:t});default:throw Error(`tensorReshape: tensor location ${e.location} is not supported`)}};var T=class{constructor(e,t,n){S();let r,i;if(typeof e==`object`&&`location`in e)switch(this.dataLocation=e.location,r=e.type,i=e.dims,e.location){case`cpu-pinned`:{let t=y.get(r);if(!t)throw TypeError(`unsupported type "${r}" to create tensor from pinned buffer`);if(!(e.data instanceof t))throw TypeError(`buffer should be of type ${t.name}`);this.cpuData=e.data;break}case`texture`:if(r!==`float32`)throw TypeError(`unsupported type "${r}" to create tensor from texture`);this.gpuTextureData=e.texture,this.downloader=e.download,this.disposer=e.dispose;break;case`gpu-buffer`:if(r!==`float32`&&r!==`float16`&&r!==`int32`&&r!==`int64`&&r!==`uint32`&&r!==`uint8`&&r!==`bool`&&r!==`uint4`&&r!==`int4`)throw TypeError(`unsupported type "${r}" to create tensor from gpu buffer`);this.gpuBufferData=e.gpuBuffer,this.downloader=e.download,this.disposer=e.dispose;break;case`ml-tensor`:if(r!==`float32`&&r!==`float16`&&r!==`int32`&&r!==`int64`&&r!==`uint32`&&r!==`uint64`&&r!==`int8`&&r!==`uint8`&&r!==`bool`&&r!==`uint4`&&r!==`int4`)throw TypeError(`unsupported type "${r}" to create tensor from MLTensor`);this.mlTensorData=e.mlTensor,this.downloader=e.download,this.disposer=e.dispose;break;default:throw Error(`Tensor constructor: unsupported location '${this.dataLocation}'`)}else{let a,o;if(typeof e==`string`)if(r=e,o=n,e===`string`){if(!Array.isArray(t))throw TypeError(`A string tensor's data must be a string array.`);a=t}else{let n=y.get(e);if(n===void 0)throw TypeError(`Unsupported tensor type: ${e}.`);if(Array.isArray(t)){if(e===`float16`&&n===Uint16Array||e===`uint4`||e===`int4`)throw TypeError(`Creating a ${e} tensor from number array is not supported. Please use ${n.name} as data.`);a=e===`uint64`||e===`int64`?n.from(t,BigInt):n.from(t)}else if(t instanceof n)a=t;else if(t instanceof Uint8ClampedArray)if(e===`uint8`)a=Uint8Array.from(t);else throw TypeError(`A Uint8ClampedArray tensor's data must be type of uint8`);else if(e===`float16`&&t instanceof Uint16Array&&n!==Uint16Array)a=new globalThis.Float16Array(t.buffer,t.byteOffset,t.length);else throw TypeError(`A ${r} tensor's data must be type of ${n}`)}else if(o=t,Array.isArray(e)){if(e.length===0)throw TypeError(`Tensor type cannot be inferred from an empty array.`);let t=typeof e[0];if(t===`string`)r=`string`,a=e;else if(t===`boolean`)r=`bool`,a=Uint8Array.from(e);else throw TypeError(`Invalid element type of data array: ${t}.`)}else if(e instanceof Uint8ClampedArray)r=`uint8`,a=Uint8Array.from(e);else{let t=b.get(e.constructor);if(t===void 0)throw TypeError(`Unsupported type for tensor data: ${e.constructor}.`);r=t,a=e}if(o===void 0)o=[a.length];else if(!Array.isArray(o))throw TypeError(`A tensor's dims must be a number array`);i=o,this.cpuData=a,this.dataLocation=`cpu`}let a=C(i);if(this.cpuData&&a!==this.cpuData.length&&!((r===`uint4`||r===`int4`)&&Math.ceil(a/2)===this.cpuData.length))throw Error(`Tensor's size(${a}) does not match data length(${this.cpuData.length}).`);this.type=r,this.dims=i,this.size=a}static async fromImage(e,t){return m(e,t)}static fromTexture(e,t){return h(e,t)}static fromGpuBuffer(e,t){return g(e,t)}static fromMLTensor(e,t){return _(e,t)}static fromPinnedBuffer(e,t,n){return v(e,t,n)}toDataURL(e){return d(this,e)}toImageData(e){return f(this,e)}get data(){if(this.ensureValid(),!this.cpuData)throw Error("The data is not on CPU. Use `getData()` to download GPU data to CPU, or use `texture` or `gpuBuffer` property to access the GPU data directly.");return this.cpuData}get location(){return this.dataLocation}get texture(){if(this.ensureValid(),!this.gpuTextureData)throw Error(`The data is not stored as a WebGL texture.`);return this.gpuTextureData}get gpuBuffer(){if(this.ensureValid(),!this.gpuBufferData)throw Error(`The data is not stored as a WebGPU buffer.`);return this.gpuBufferData}get mlTensor(){if(this.ensureValid(),!this.mlTensorData)throw Error(`The data is not stored as a WebNN MLTensor.`);return this.mlTensorData}async getData(e){switch(this.ensureValid(),this.dataLocation){case`cpu`:case`cpu-pinned`:return this.data;case`texture`:case`gpu-buffer`:case`ml-tensor`:if(!this.downloader)throw Error(`The current tensor is not created with a specified data downloader.`);if(this.isDownloading)throw Error(`The current tensor is being downloaded.`);try{this.isDownloading=!0;let t=await this.downloader();return this.downloader=void 0,this.dataLocation=`cpu`,this.cpuData=t,e&&this.disposer&&(this.disposer(),this.disposer=void 0),t}finally{this.isDownloading=!1}default:throw Error(`cannot get data from location: ${this.dataLocation}`)}}dispose(){if(this.isDownloading)throw Error(`The current tensor is being downloaded.`);this.disposer&&(this.disposer(),this.disposer=void 0),this.cpuData=void 0,this.gpuTextureData=void 0,this.gpuBufferData=void 0,this.mlTensorData=void 0,this.downloader=void 0,this.isDownloading=void 0,this.dataLocation=`none`}ensureValid(){if(this.dataLocation===`none`)throw Error(`The tensor is disposed.`)}reshape(e){if(this.ensureValid(),this.downloader||this.disposer)throw Error(`Cannot reshape a tensor that owns GPU resource.`);return w(this,e)}};const E=T,D=(e,t)=>{(l.trace===void 0?!l.wasm.trace:!l.trace)||console.timeStamp(`${e}::ORT::${t}`)},O=(e,t)=>{let n=Error().stack?.split(/\r\n|\r|\n/g)||[],r=!1;for(let i=0;i{(l.trace===void 0?!l.wasm.trace:!l.trace)||O(`BEGIN`,e)},A=e=>{(l.trace===void 0?!l.wasm.trace:!l.trace)||O(`END`,e)};var ee=class e{constructor(e){this.handler=e}async run(e,t,n){k();let r={},i={};if(typeof e!=`object`||!e||e instanceof E||Array.isArray(e))throw TypeError(`'feeds' must be an object that use input names as keys and OnnxValue as corresponding values.`);let a=!0;if(typeof t==`object`){if(t===null)throw TypeError(`Unexpected argument[1]: cannot be null.`);if(t instanceof E)throw TypeError(`'fetches' cannot be a Tensor`);if(Array.isArray(t)){if(t.length===0)throw TypeError(`'fetches' cannot be an empty array.`);a=!1;for(let e of t){if(typeof e!=`string`)throw TypeError(`'fetches' must be a string array or an object.`);if(this.outputNames.indexOf(e)===-1)throw RangeError(`'fetches' contains invalid output name: ${e}.`);r[e]=null}if(typeof n==`object`&&n)i=n;else if(n!==void 0)throw TypeError(`'options' must be an object.`)}else{let e=!1,o=Object.getOwnPropertyNames(t);for(let n of this.outputNames)if(o.indexOf(n)!==-1){let i=t[n];(i===null||i instanceof E)&&(e=!0,a=!1,r[n]=i)}if(e){if(typeof n==`object`&&n)i=n;else if(n!==void 0)throw TypeError(`'options' must be an object.`)}else i=t}}else if(t!==void 0)throw TypeError(`Unexpected argument[1]: must be 'fetches' or 'options'.`);for(let t of this.inputNames)if(e[t]===void 0)throw Error(`input '${t}' is missing in 'feeds'.`);if(a)for(let e of this.outputNames)r[e]=null;let o=await this.handler.run(e,r,i),s={};for(let e in o)if(Object.hasOwnProperty.call(o,e)){let t=o[e];t instanceof E?s[e]=t:s[e]=new E(t.type,t.data,t.dims)}return A(),s}async release(){return this.handler.dispose()}static async create(t,n,r,i){k();let a,s={};if(typeof t==`string`){if(a=t,typeof n==`object`&&n)s=n;else if(n!==void 0)throw TypeError(`'options' must be an object.`)}else if(t instanceof Uint8Array){if(a=t,typeof n==`object`&&n)s=n;else if(n!==void 0)throw TypeError(`'options' must be an object.`)}else if(t instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&t instanceof SharedArrayBuffer){let e=t,o=0,c=t.byteLength;if(typeof n==`object`&&n)s=n;else if(typeof n==`number`){if(o=n,!Number.isSafeInteger(o))throw RangeError(`'byteOffset' must be an integer.`);if(o<0||o>=e.byteLength)throw RangeError(`'byteOffset' is out of range [0, ${e.byteLength}).`);if(c=t.byteLength-o,typeof r==`number`){if(c=r,!Number.isSafeInteger(c))throw RangeError(`'byteLength' must be an integer.`);if(c<=0||o+c>e.byteLength)throw RangeError(`'byteLength' is out of range (0, ${e.byteLength-o}].`);if(typeof i==`object`&&i)s=i;else if(i!==void 0)throw TypeError(`'options' must be an object.`)}else if(r!==void 0)throw TypeError(`'byteLength' must be a number.`)}else if(n!==void 0)throw TypeError(`'options' must be an object.`);a=new Uint8Array(e,o,c)}else throw TypeError(`Unexpected argument[0]: must be 'path' or 'buffer'.`);let[c,l]=await o(s),u=await c.createInferenceSessionHandler(a,l);return A(),new e(u)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}get inputMetadata(){return this.handler.inputMetadata}get outputMetadata(){return this.handler.outputMetadata}};const te=ee;var ne={};e(ne,{InferenceSession:()=>te,TRACE:()=>D,TRACE_FUNC_BEGIN:()=>k,TRACE_FUNC_END:()=>A,Tensor:()=>E,env:()=>u,registerBackend:()=>i});var j={};e(j,{InferenceSession:()=>Ke,TRACE:()=>z,TRACE_FUNC_BEGIN:()=>He,TRACE_FUNC_END:()=>B,Tensor:()=>ze,default:()=>rf,env:()=>L,registerBackend:()=>P}); /*! * ONNX Runtime Web v1.22.0-dev.20250409-89f8206ba4 * Copyright (c) Microsoft Corporation. All rights reserved. @@ -3595,4 +3595,4 @@ var af={"onnxruntime-common":e=>{e.exports=ne},"onnxruntime-web":e=>{e.exports=j /*! ./generation/stopping_criteria.js */ `./src/generation/stopping_criteria.js`),x=cf( /*! ./generation/logits_process.js */ -`./src/generation/logits_process.js`)})();var lf=$.ASTFeatureExtractor,uf=$.ASTForAudioClassification,df=$.ASTModel,ff=$.ASTPreTrainedModel,pf=$.AlbertForMaskedLM,mf=$.AlbertForQuestionAnswering,hf=$.AlbertForSequenceClassification,gf=$.AlbertModel,_f=$.AlbertPreTrainedModel,vf=$.AlbertTokenizer,yf=$.AudioClassificationPipeline,bf=$.AutoConfig,xf=$.AutoFeatureExtractor,Sf=$.AutoImageProcessor,Cf=$.AutoModel,wf=$.AutoModelForAudioClassification,Tf=$.AutoModelForAudioFrameClassification,Ef=$.AutoModelForAudioTextToText,Df=$.AutoModelForCTC,Of=$.AutoModelForCausalLM,kf=$.AutoModelForDepthEstimation,Af=$.AutoModelForDocumentQuestionAnswering,jf=$.AutoModelForImageClassification,Mf=$.AutoModelForImageFeatureExtraction,Nf=$.AutoModelForImageMatting,Pf=$.AutoModelForImageSegmentation,Ff=$.AutoModelForImageTextToText,If=$.AutoModelForImageToImage,Lf=$.AutoModelForMaskGeneration,Rf=$.AutoModelForMaskedLM,zf=$.AutoModelForNormalEstimation,Bf=$.AutoModelForObjectDetection,Vf=$.AutoModelForPoseEstimation,Hf=$.AutoModelForQuestionAnswering,Uf=$.AutoModelForSemanticSegmentation,Wf=$.AutoModelForSeq2SeqLM,Gf=$.AutoModelForSequenceClassification,Kf=$.AutoModelForSpeechSeq2Seq,qf=$.AutoModelForTextToSpectrogram,Jf=$.AutoModelForTextToWaveform,Yf=$.AutoModelForTokenClassification,Xf=$.AutoModelForUniversalSegmentation,Zf=$.AutoModelForVision2Seq,Qf=$.AutoModelForXVector,$f=$.AutoModelForZeroShotObjectDetection,ep=$.AutoProcessor,tp=$.AutoTokenizer,np=$.AutomaticSpeechRecognitionPipeline,rp=$.BackgroundRemovalPipeline,ip=$.BartForConditionalGeneration,ap=$.BartForSequenceClassification,op=$.BartModel,sp=$.BartPretrainedModel,cp=$.BartTokenizer,lp=$.BaseModelOutput,up=$.BaseStreamer,dp=$.BeitFeatureExtractor,fp=$.BeitForImageClassification,pp=$.BeitModel,mp=$.BeitPreTrainedModel,hp=$.BertForMaskedLM,gp=$.BertForQuestionAnswering,_p=$.BertForSequenceClassification,vp=$.BertForTokenClassification,yp=$.BertModel,bp=$.BertPreTrainedModel,xp=$.BertTokenizer,Sp=$.BitImageProcessor,Cp=$.BlenderbotForConditionalGeneration,wp=$.BlenderbotModel,Tp=$.BlenderbotPreTrainedModel,Ep=$.BlenderbotSmallForConditionalGeneration,Dp=$.BlenderbotSmallModel,Op=$.BlenderbotSmallPreTrainedModel,kp=$.BlenderbotSmallTokenizer,Ap=$.BlenderbotTokenizer,jp=$.BloomForCausalLM,Mp=$.BloomModel,Np=$.BloomPreTrainedModel,Pp=$.BloomTokenizer,Fp=$.CLIPFeatureExtractor,Ip=$.CLIPImageProcessor,Lp=$.CLIPModel,Rp=$.CLIPPreTrainedModel,zp=$.CLIPSegForImageSegmentation,Bp=$.CLIPSegModel,Vp=$.CLIPSegPreTrainedModel,Hp=$.CLIPTextModel,Up=$.CLIPTextModelWithProjection,Wp=$.CLIPTokenizer,Gp=$.CLIPVisionModel,Kp=$.CLIPVisionModelWithProjection,qp=$.CamembertForMaskedLM,Jp=$.CamembertForQuestionAnswering,Yp=$.CamembertForSequenceClassification,Xp=$.CamembertForTokenClassification,Zp=$.CamembertModel,Qp=$.CamembertPreTrainedModel,$p=$.CamembertTokenizer,em=$.CausalLMOutput,tm=$.CausalLMOutputWithPast,nm=$.ChineseCLIPFeatureExtractor,rm=$.ChineseCLIPModel,im=$.ChineseCLIPPreTrainedModel,am=$.ClapAudioModelWithProjection,om=$.ClapFeatureExtractor,sm=$.ClapModel,cm=$.ClapPreTrainedModel,lm=$.ClapTextModelWithProjection,um=$.ClassifierFreeGuidanceLogitsProcessor,dm=$.CodeGenForCausalLM,fm=$.CodeGenModel,pm=$.CodeGenPreTrainedModel,mm=$.CodeGenTokenizer,hm=$.CodeLlamaTokenizer,gm=$.CohereForCausalLM,_m=$.CohereModel,vm=$.CoherePreTrainedModel,ym=$.CohereTokenizer,bm=$.ConvBertForMaskedLM,xm=$.ConvBertForQuestionAnswering,Sm=$.ConvBertForSequenceClassification,Cm=$.ConvBertForTokenClassification,wm=$.ConvBertModel,Tm=$.ConvBertPreTrainedModel,Em=$.ConvBertTokenizer,Dm=$.ConvNextFeatureExtractor,Om=$.ConvNextForImageClassification,km=$.ConvNextImageProcessor,Am=$.ConvNextModel,jm=$.ConvNextPreTrainedModel,Mm=$.ConvNextV2ForImageClassification,Nm=$.ConvNextV2Model,Pm=$.ConvNextV2PreTrainedModel,Fm=$.DFineForObjectDetection,Im=$.DFineModel,Lm=$.DFinePreTrainedModel,Rm=$.DPTFeatureExtractor,zm=$.DPTForDepthEstimation,Bm=$.DPTImageProcessor,Vm=$.DPTModel,Hm=$.DPTPreTrainedModel,Um=$.DacDecoderModel,Wm=$.DacDecoderOutput,Gm=$.DacEncoderModel,Km=$.DacEncoderOutput,qm=$.DacFeatureExtractor,Jm=$.DacModel,Ym=$.DacPreTrainedModel,Xm=$.DataTypeMap,Zm=$.DebertaForMaskedLM,Qm=$.DebertaForQuestionAnswering,$m=$.DebertaForSequenceClassification,eh=$.DebertaForTokenClassification,th=$.DebertaModel,nh=$.DebertaPreTrainedModel,rh=$.DebertaTokenizer,ih=$.DebertaV2ForMaskedLM,ah=$.DebertaV2ForQuestionAnswering,oh=$.DebertaV2ForSequenceClassification,sh=$.DebertaV2ForTokenClassification,ch=$.DebertaV2Model,lh=$.DebertaV2PreTrainedModel,uh=$.DebertaV2Tokenizer,dh=$.DecisionTransformerModel,fh=$.DecisionTransformerPreTrainedModel,ph=$.DeiTFeatureExtractor,mh=$.DeiTForImageClassification,hh=$.DeiTImageProcessor,gh=$.DeiTModel,_h=$.DeiTPreTrainedModel,vh=$.DepthAnythingForDepthEstimation,yh=$.DepthAnythingPreTrainedModel,bh=$.DepthEstimationPipeline,xh=$.DepthProForDepthEstimation,Sh=$.DepthProPreTrainedModel,Ch=$.DetrFeatureExtractor,wh=$.DetrForObjectDetection,Th=$.DetrForSegmentation,Eh=$.DetrImageProcessor,Dh=$.DetrModel,Oh=$.DetrObjectDetectionOutput,kh=$.DetrPreTrainedModel,Ah=$.DetrSegmentationOutput,jh=$.Dinov2ForImageClassification,Mh=$.Dinov2Model,Nh=$.Dinov2PreTrainedModel,Ph=$.Dinov2WithRegistersForImageClassification,Fh=$.Dinov2WithRegistersModel,Ih=$.Dinov2WithRegistersPreTrainedModel,Lh=$.DistilBertForMaskedLM,Rh=$.DistilBertForQuestionAnswering,zh=$.DistilBertForSequenceClassification,Bh=$.DistilBertForTokenClassification,Vh=$.DistilBertModel,Hh=$.DistilBertPreTrainedModel,Uh=$.DistilBertTokenizer,Wh=$.DocumentQuestionAnsweringPipeline,Gh=$.DonutFeatureExtractor,Kh=$.DonutImageProcessor,qh=$.DonutSwinModel,Jh=$.DonutSwinPreTrainedModel,Yh=$.EfficientNetForImageClassification,Xh=$.EfficientNetImageProcessor,Zh=$.EfficientNetModel,Qh=$.EfficientNetPreTrainedModel,$h=$.ElectraForMaskedLM,eg=$.ElectraForQuestionAnswering,tg=$.ElectraForSequenceClassification,ng=$.ElectraForTokenClassification,rg=$.ElectraModel,ig=$.ElectraPreTrainedModel,ag=$.ElectraTokenizer,og=$.EncodecFeatureExtractor,sg=$.EosTokenCriteria,cg=$.EsmForMaskedLM,lg=$.EsmForSequenceClassification,ug=$.EsmForTokenClassification,dg=$.EsmModel,fg=$.EsmPreTrainedModel,pg=$.EsmTokenizer,mg=$.ExaoneForCausalLM,hg=$.ExaoneModel,gg=$.ExaonePreTrainedModel,_g=$.FFT,vg=$.FalconForCausalLM,yg=$.FalconModel,bg=$.FalconPreTrainedModel,xg=$.FalconTokenizer,Sg=$.FastViTForImageClassification,Cg=$.FastViTModel,wg=$.FastViTPreTrainedModel,Tg=$.FeatureExtractionPipeline,Eg=$.FeatureExtractor,Dg=$.FillMaskPipeline,Og=$.Florence2ForConditionalGeneration,kg=$.Florence2PreTrainedModel,Ag=$.Florence2Processor,jg=$.ForcedBOSTokenLogitsProcessor,Mg=$.ForcedEOSTokenLogitsProcessor,Ng=$.GLPNFeatureExtractor,Pg=$.GLPNForDepthEstimation,Fg=$.GLPNModel,Ig=$.GLPNPreTrainedModel,Lg=$.GPT2LMHeadModel,Rg=$.GPT2Model,zg=$.GPT2PreTrainedModel,Bg=$.GPT2Tokenizer,Vg=$.GPTBigCodeForCausalLM,Hg=$.GPTBigCodeModel,Ug=$.GPTBigCodePreTrainedModel,Wg=$.GPTJForCausalLM,Gg=$.GPTJModel,Kg=$.GPTJPreTrainedModel,qg=$.GPTNeoForCausalLM,Jg=$.GPTNeoModel,Yg=$.GPTNeoPreTrainedModel,Xg=$.GPTNeoXForCausalLM,Zg=$.GPTNeoXModel,Qg=$.GPTNeoXPreTrainedModel,$g=$.GPTNeoXTokenizer,e_=$.Gemma2ForCausalLM,t_=$.Gemma2Model,n_=$.Gemma2PreTrainedModel,r_=$.Gemma3ForCausalLM,i_=$.Gemma3Model,a_=$.Gemma3PreTrainedModel,o_=$.Gemma3nAudioFeatureExtractor,s_=$.Gemma3nForConditionalGeneration,c_=$.Gemma3nPreTrainedModel,l_=$.Gemma3nProcessor,u_=$.GemmaForCausalLM,d_=$.GemmaModel,f_=$.GemmaPreTrainedModel,p_=$.GemmaTokenizer,m_=$.GlmForCausalLM,h_=$.GlmModel,g_=$.GlmPreTrainedModel,__=$.GraniteForCausalLM,v_=$.GraniteModel,y_=$.GranitePreTrainedModel,b_=$.Grok1Tokenizer,x_=$.GroundingDinoForObjectDetection,S_=$.GroundingDinoImageProcessor,C_=$.GroundingDinoPreTrainedModel,w_=$.GroundingDinoProcessor,T_=$.GroupViTModel,E_=$.GroupViTPreTrainedModel,D_=$.HeliumForCausalLM,O_=$.HeliumModel,k_=$.HeliumPreTrainedModel,A_=$.HerbertTokenizer,j_=$.HieraForImageClassification,M_=$.HieraModel,N_=$.HieraPreTrainedModel,P_=$.HubertForCTC,F_=$.HubertForSequenceClassification,I_=$.HubertModel,L_=$.HubertPreTrainedModel,R_=$.IJepaForImageClassification,z_=$.IJepaModel,B_=$.IJepaPreTrainedModel,V_=$.Idefics3ForConditionalGeneration,H_=$.Idefics3ImageProcessor,U_=$.Idefics3PreTrainedModel,W_=$.Idefics3Processor,G_=$.ImageClassificationPipeline,K_=$.ImageFeatureExtractionPipeline,q_=$.ImageFeatureExtractor,J_=$.ImageMattingOutput,Y_=$.ImageProcessor,X_=$.ImageSegmentationPipeline,Z_=$.ImageToImagePipeline,Q_=$.ImageToTextPipeline,$_=$.InterruptableStoppingCriteria,ev=$.JAISLMHeadModel,tv=$.JAISModel,nv=$.JAISPreTrainedModel,rv=$.JinaCLIPImageProcessor,iv=$.JinaCLIPModel,av=$.JinaCLIPPreTrainedModel,ov=$.JinaCLIPProcessor,sv=$.JinaCLIPTextModel,cv=$.JinaCLIPVisionModel,lv=$.LiteWhisperForConditionalGeneration,uv=$.LlamaForCausalLM,dv=$.LlamaModel,fv=$.LlamaPreTrainedModel,pv=$.LlamaTokenizer,mv=$.LlavaForConditionalGeneration,hv=$.LlavaOnevisionForConditionalGeneration,gv=$.LlavaOnevisionImageProcessor,_v=$.LlavaPreTrainedModel,vv=$.LlavaProcessor,yv=$.LlavaQwen2ForCausalLM,bv=$.LogitsProcessor,xv=$.LogitsProcessorList,Sv=$.LogitsWarper,Cv=$.LongT5ForConditionalGeneration,wv=$.LongT5Model,Tv=$.LongT5PreTrainedModel,Ev=$.M2M100ForConditionalGeneration,Dv=$.M2M100Model,Ov=$.M2M100PreTrainedModel,kv=$.M2M100Tokenizer,Av=$.MBart50Tokenizer,jv=$.MBartForCausalLM,Mv=$.MBartForConditionalGeneration,Nv=$.MBartForSequenceClassification,Pv=$.MBartModel,Fv=$.MBartPreTrainedModel,Iv=$.MBartTokenizer,Lv=$.MPNetForMaskedLM,Rv=$.MPNetForQuestionAnswering,zv=$.MPNetForSequenceClassification,Bv=$.MPNetForTokenClassification,Vv=$.MPNetModel,Hv=$.MPNetPreTrainedModel,Uv=$.MPNetTokenizer,Wv=$.MT5ForConditionalGeneration,Gv=$.MT5Model,Kv=$.MT5PreTrainedModel,qv=$.MarianMTModel,Jv=$.MarianModel,Yv=$.MarianPreTrainedModel,Xv=$.MarianTokenizer,Zv=$.Mask2FormerImageProcessor,Qv=$.MaskFormerFeatureExtractor,$v=$.MaskFormerForInstanceSegmentation,ey=$.MaskFormerImageProcessor,ty=$.MaskFormerModel,ny=$.MaskFormerPreTrainedModel,ry=$.MaskedLMOutput,iy=$.MaxLengthCriteria,ay=$.Metric3DForDepthEstimation,oy=$.Metric3DPreTrainedModel,sy=$.Metric3Dv2ForDepthEstimation,cy=$.Metric3Dv2PreTrainedModel,ly=$.MgpstrForSceneTextRecognition,uy=$.MgpstrModelOutput,dy=$.MgpstrPreTrainedModel,fy=$.MgpstrProcessor,py=$.MgpstrTokenizer,my=$.MimiDecoderModel,hy=$.MimiDecoderOutput,gy=$.MimiEncoderModel,_y=$.MimiEncoderOutput,vy=$.MimiModel,yy=$.MimiPreTrainedModel,by=$.MinLengthLogitsProcessor,xy=$.MinNewTokensLengthLogitsProcessor,Sy=$.MistralForCausalLM,Cy=$.MistralModel,wy=$.MistralPreTrainedModel,Ty=$.MobileBertForMaskedLM,Ey=$.MobileBertForQuestionAnswering,Dy=$.MobileBertForSequenceClassification,Oy=$.MobileBertModel,ky=$.MobileBertPreTrainedModel,Ay=$.MobileBertTokenizer,jy=$.MobileLLMForCausalLM,My=$.MobileLLMModel,Ny=$.MobileLLMPreTrainedModel,Py=$.MobileNetV1FeatureExtractor,Fy=$.MobileNetV1ForImageClassification,Iy=$.MobileNetV1ForSemanticSegmentation,Ly=$.MobileNetV1ImageProcessor,Ry=$.MobileNetV1Model,zy=$.MobileNetV1PreTrainedModel,By=$.MobileNetV2FeatureExtractor,Vy=$.MobileNetV2ForImageClassification,Hy=$.MobileNetV2ForSemanticSegmentation,Uy=$.MobileNetV2ImageProcessor,Wy=$.MobileNetV2Model,Gy=$.MobileNetV2PreTrainedModel,Ky=$.MobileNetV3FeatureExtractor,qy=$.MobileNetV3ForImageClassification,Jy=$.MobileNetV3ForSemanticSegmentation,Yy=$.MobileNetV3ImageProcessor,Xy=$.MobileNetV3Model,Zy=$.MobileNetV3PreTrainedModel,Qy=$.MobileNetV4FeatureExtractor,$y=$.MobileNetV4ForImageClassification,eb=$.MobileNetV4ForSemanticSegmentation,tb=$.MobileNetV4ImageProcessor,nb=$.MobileNetV4Model,rb=$.MobileNetV4PreTrainedModel,ib=$.MobileViTFeatureExtractor,ab=$.MobileViTForImageClassification,ob=$.MobileViTImageProcessor,sb=$.MobileViTModel,cb=$.MobileViTPreTrainedModel,lb=$.MobileViTV2ForImageClassification,ub=$.MobileViTV2Model,db=$.MobileViTV2PreTrainedModel,fb=$.ModelOutput,pb=$.ModernBertForMaskedLM,mb=$.ModernBertForSequenceClassification,hb=$.ModernBertForTokenClassification,gb=$.ModernBertModel,_b=$.ModernBertPreTrainedModel,vb=$.Moondream1ForConditionalGeneration,yb=$.MoonshineFeatureExtractor,bb=$.MoonshineForConditionalGeneration,xb=$.MoonshineModel,Sb=$.MoonshinePreTrainedModel,Cb=$.MoonshineProcessor,wb=$.MptForCausalLM,Tb=$.MptModel,Eb=$.MptPreTrainedModel,Db=$.MultiModalityCausalLM,Ob=$.MultiModalityPreTrainedModel,kb=$.MusicgenForCausalLM,Ab=$.MusicgenForConditionalGeneration,jb=$.MusicgenModel,Mb=$.MusicgenPreTrainedModel,Nb=$.NeoBertForMaskedLM,Pb=$.NeoBertForQuestionAnswering,Fb=$.NeoBertForSequenceClassification,Ib=$.NeoBertForTokenClassification,Lb=$.NeoBertModel,Rb=$.NeoBertPreTrainedModel,zb=$.NllbTokenizer,Bb=$.NoBadWordsLogitsProcessor,Vb=$.NoRepeatNGramLogitsProcessor,Hb=$.NomicBertModel,Ub=$.NomicBertPreTrainedModel,Wb=$.NougatImageProcessor,Gb=$.NougatTokenizer,Kb=$.OPTForCausalLM,qb=$.OPTModel,Jb=$.OPTPreTrainedModel,Yb=$.ObjectDetectionPipeline,Xb=$.Olmo2ForCausalLM,Zb=$.Olmo2Model,Qb=$.Olmo2PreTrainedModel,$b=$.OlmoForCausalLM,ex=$.OlmoModel,tx=$.OlmoPreTrainedModel,nx=$.OpenELMForCausalLM,rx=$.OpenELMModel,ix=$.OpenELMPreTrainedModel,ax=$.OwlViTFeatureExtractor,ox=$.OwlViTForObjectDetection,sx=$.OwlViTImageProcessor,cx=$.OwlViTModel,lx=$.OwlViTPreTrainedModel,ux=$.OwlViTProcessor,dx=$.Owlv2ForObjectDetection,fx=$.Owlv2ImageProcessor,px=$.Owlv2Model,mx=$.Owlv2PreTrainedModel,hx=$.PaliGemmaForConditionalGeneration,gx=$.PaliGemmaPreTrainedModel,_x=$.PaliGemmaProcessor,vx=$.PatchTSMixerForPrediction,yx=$.PatchTSMixerModel,bx=$.PatchTSMixerPreTrainedModel,xx=$.PatchTSTForPrediction,Sx=$.PatchTSTModel,Cx=$.PatchTSTPreTrainedModel,wx=$.Phi3ForCausalLM,Tx=$.Phi3Model,Ex=$.Phi3PreTrainedModel,Dx=$.Phi3VForCausalLM,Ox=$.Phi3VImageProcessor,kx=$.Phi3VPreTrainedModel,Ax=$.Phi3VProcessor,jx=$.PhiForCausalLM,Mx=$.PhiModel,Nx=$.PhiPreTrainedModel,Px=$.Pipeline,Fx=$.PreTrainedModel,Ix=$.PreTrainedTokenizer,Lx=$.PretrainedConfig,Rx=$.PretrainedMixin,zx=$.Processor,Bx=$.PvtForImageClassification,Vx=$.PvtImageProcessor,Hx=$.PvtModel,Ux=$.PvtPreTrainedModel,Wx=$.PyAnnoteFeatureExtractor,Gx=$.PyAnnoteForAudioFrameClassification,Kx=$.PyAnnoteModel,qx=$.PyAnnotePreTrainedModel,Jx=$.PyAnnoteProcessor,Yx=$.QuestionAnsweringModelOutput,Xx=$.QuestionAnsweringPipeline,Zx=$.Qwen2ForCausalLM,Qx=$.Qwen2Model,$x=$.Qwen2PreTrainedModel,eS=$.Qwen2Tokenizer,tS=$.Qwen2VLForConditionalGeneration,nS=$.Qwen2VLImageProcessor,rS=$.Qwen2VLPreTrainedModel,iS=$.Qwen2VLProcessor,aS=$.Qwen3ForCausalLM,oS=$.Qwen3Model,sS=$.Qwen3PreTrainedModel,cS=$.RFDetrForObjectDetection,lS=$.RFDetrModel,uS=$.RFDetrObjectDetectionOutput,dS=$.RFDetrPreTrainedModel,fS=$.RTDetrForObjectDetection,pS=$.RTDetrImageProcessor,mS=$.RTDetrModel,hS=$.RTDetrObjectDetectionOutput,gS=$.RTDetrPreTrainedModel,_S=$.RTDetrV2ForObjectDetection,vS=$.RTDetrV2Model,yS=$.RTDetrV2ObjectDetectionOutput,bS=$.RTDetrV2PreTrainedModel,xS=$.RawAudio,SS=$.RawImage,CS=$.RawVideo,wS=$.RawVideoFrame,TS=$.RepetitionPenaltyLogitsProcessor,ES=$.ResNetForImageClassification,DS=$.ResNetModel,OS=$.ResNetPreTrainedModel,kS=$.RoFormerForMaskedLM,AS=$.RoFormerForQuestionAnswering,jS=$.RoFormerForSequenceClassification,MS=$.RoFormerForTokenClassification,NS=$.RoFormerModel,PS=$.RoFormerPreTrainedModel,FS=$.RoFormerTokenizer,IS=$.RobertaForMaskedLM,LS=$.RobertaForQuestionAnswering,RS=$.RobertaForSequenceClassification,zS=$.RobertaForTokenClassification,BS=$.RobertaModel,VS=$.RobertaPreTrainedModel,HS=$.RobertaTokenizer,US=$.SamImageProcessor,WS=$.SamImageSegmentationOutput,GS=$.SamModel,KS=$.SamPreTrainedModel,qS=$.SamProcessor,JS=$.SapiensForDepthEstimation,YS=$.SapiensForNormalEstimation,XS=$.SapiensForSemanticSegmentation,ZS=$.SapiensPreTrainedModel,QS=$.SeamlessM4TFeatureExtractor,$S=$.SegformerFeatureExtractor,eC=$.SegformerForImageClassification,tC=$.SegformerForSemanticSegmentation,nC=$.SegformerImageProcessor,rC=$.SegformerModel,iC=$.SegformerPreTrainedModel,aC=$.Seq2SeqLMOutput,oC=$.SequenceClassifierOutput,sC=$.SiglipImageProcessor,cC=$.SiglipModel,lC=$.SiglipPreTrainedModel,uC=$.SiglipTextModel,dC=$.SiglipTokenizer,fC=$.SiglipVisionModel,pC=$.SmolVLMForConditionalGeneration,mC=$.SmolVLMImageProcessor,hC=$.SmolVLMProcessor,gC=$.SnacDecoderModel,_C=$.SnacEncoderModel,vC=$.SnacFeatureExtractor,yC=$.SnacModel,bC=$.SnacPreTrainedModel,xC=$.SpeechT5FeatureExtractor,SC=$.SpeechT5ForSpeechToText,CC=$.SpeechT5ForTextToSpeech,wC=$.SpeechT5HifiGan,TC=$.SpeechT5Model,EC=$.SpeechT5PreTrainedModel,DC=$.SpeechT5Processor,OC=$.SpeechT5Tokenizer,kC=$.SqueezeBertForMaskedLM,AC=$.SqueezeBertForQuestionAnswering,jC=$.SqueezeBertForSequenceClassification,MC=$.SqueezeBertModel,NC=$.SqueezeBertPreTrainedModel,PC=$.SqueezeBertTokenizer,FC=$.StableLmForCausalLM,IC=$.StableLmModel,LC=$.StableLmPreTrainedModel,RC=$.Starcoder2ForCausalLM,zC=$.Starcoder2Model,BC=$.Starcoder2PreTrainedModel,VC=$.StoppingCriteria,HC=$.StoppingCriteriaList,UC=$.StyleTextToSpeech2Model,WC=$.StyleTextToSpeech2PreTrainedModel,GC=$.SummarizationPipeline,KC=$.SuppressTokensAtBeginLogitsProcessor,qC=$.Swin2SRForImageSuperResolution,JC=$.Swin2SRImageProcessor,YC=$.Swin2SRModel,XC=$.Swin2SRPreTrainedModel,ZC=$.SwinForImageClassification,QC=$.SwinForSemanticSegmentation,$C=$.SwinModel,ew=$.SwinPreTrainedModel,tw=$.T5ForConditionalGeneration,nw=$.T5Model,rw=$.T5PreTrainedModel,iw=$.T5Tokenizer,aw=$.TableTransformerForObjectDetection,ow=$.TableTransformerModel,sw=$.TableTransformerObjectDetectionOutput,cw=$.TableTransformerPreTrainedModel,lw=$.TemperatureLogitsWarper,uw=$.Tensor,dw=$.Text2TextGenerationPipeline,fw=$.TextClassificationPipeline,pw=$.TextGenerationPipeline,mw=$.TextStreamer,hw=$.TextToAudioPipeline,gw=$.TokenClassificationPipeline,_w=$.TokenClassifierOutput,vw=$.TokenizerModel,yw=$.TopKLogitsWarper,bw=$.TopPLogitsWarper,xw=$.TrOCRForCausalLM,Sw=$.TrOCRPreTrainedModel,Cw=$.TranslationPipeline,ww=$.UltravoxModel,Tw=$.UltravoxPreTrainedModel,Ew=$.UltravoxProcessor,Dw=$.UniSpeechForCTC,Ow=$.UniSpeechForSequenceClassification,kw=$.UniSpeechModel,Aw=$.UniSpeechPreTrainedModel,jw=$.UniSpeechSatForAudioFrameClassification,Mw=$.UniSpeechSatForCTC,Nw=$.UniSpeechSatForSequenceClassification,Pw=$.UniSpeechSatModel,Fw=$.UniSpeechSatPreTrainedModel,Iw=$.VLChatProcessor,Lw=$.VLMImageProcessor,Rw=$.ViTFeatureExtractor,zw=$.ViTForImageClassification,Bw=$.ViTImageProcessor,Vw=$.ViTMAEModel,Hw=$.ViTMAEPreTrainedModel,Uw=$.ViTMSNForImageClassification,Ww=$.ViTMSNModel,Gw=$.ViTMSNPreTrainedModel,Kw=$.ViTModel,qw=$.ViTPreTrainedModel,Jw=$.VisionEncoderDecoderModel,Yw=$.VitMatteForImageMatting,Xw=$.VitMatteImageProcessor,Zw=$.VitMattePreTrainedModel,Qw=$.VitPoseForPoseEstimation,$w=$.VitPoseImageProcessor,eT=$.VitPosePreTrainedModel,tT=$.VitsModel,nT=$.VitsModelOutput,rT=$.VitsPreTrainedModel,iT=$.VitsTokenizer,aT=$.Wav2Vec2BertForCTC,oT=$.Wav2Vec2BertForSequenceClassification,sT=$.Wav2Vec2BertModel,cT=$.Wav2Vec2BertPreTrainedModel,lT=$.Wav2Vec2CTCTokenizer,uT=$.Wav2Vec2FeatureExtractor,dT=$.Wav2Vec2ForAudioFrameClassification,fT=$.Wav2Vec2ForCTC,pT=$.Wav2Vec2ForSequenceClassification,mT=$.Wav2Vec2Model,hT=$.Wav2Vec2PreTrainedModel,gT=$.Wav2Vec2Processor,_T=$.Wav2Vec2ProcessorWithLM,vT=$.WavLMForAudioFrameClassification,yT=$.WavLMForCTC,bT=$.WavLMForSequenceClassification,xT=$.WavLMForXVector,ST=$.WavLMModel,CT=$.WavLMPreTrainedModel,wT=$.WeSpeakerFeatureExtractor,TT=$.WeSpeakerResNetModel,ET=$.WeSpeakerResNetPreTrainedModel,DT=$.WhisperFeatureExtractor,OT=$.WhisperForConditionalGeneration,kT=$.WhisperModel,AT=$.WhisperPreTrainedModel,jT=$.WhisperProcessor,MT=$.WhisperTextStreamer,NT=$.WhisperTimeStampLogitsProcessor,PT=$.WhisperTokenizer,FT=$.XLMForQuestionAnswering,IT=$.XLMForSequenceClassification,LT=$.XLMForTokenClassification,RT=$.XLMModel,zT=$.XLMPreTrainedModel,BT=$.XLMRobertaForMaskedLM,VT=$.XLMRobertaForQuestionAnswering,HT=$.XLMRobertaForSequenceClassification,UT=$.XLMRobertaForTokenClassification,WT=$.XLMRobertaModel,GT=$.XLMRobertaPreTrainedModel,KT=$.XLMRobertaTokenizer,qT=$.XLMTokenizer,JT=$.XLMWithLMHeadModel,YT=$.XVectorOutput,XT=$.YolosFeatureExtractor,ZT=$.YolosForObjectDetection,QT=$.YolosImageProcessor,$T=$.YolosModel,eE=$.YolosObjectDetectionOutput,tE=$.YolosPreTrainedModel,nE=$.ZeroShotAudioClassificationPipeline,rE=$.ZeroShotClassificationPipeline,iE=$.ZeroShotImageClassificationPipeline,aE=$.ZeroShotObjectDetectionPipeline,oE=$.bankers_round,sE=$.cat,cE=$.cos_sim,lE=$.dot,uE=$.dynamic_time_warping,dE=$.env,fE=$.full,pE=$.full_like,mE=$.getKeyValueShapes,hE=$.hamming,gE=$.hanning,_E=$.interpolate,vE=$.interpolate_4d,yE=$.interpolate_data,bE=$.is_chinese_char,xE=$.layer_norm,SE=$.load_image,CE=$.load_video,wE=$.log_softmax,TE=$.magnitude,EE=$.matmul,DE=$.max,OE=$.mean,kE=$.mean_pooling,AE=$.medianFilter,jE=$.mel_filter_bank,ME=$.min,NE=$.ones,PE=$.ones_like,FE=$.permute,IE=$.permute_data,LE=$.pipeline,RE=$.quantize_embeddings,zE=$.rand,BE=$.read_audio,VE=$.rfft,HE=$.round,UE=$.slice,WE=$.softmax,GE=$.spectrogram,KE=$.stack,qE=$.std_mean,JE=$.topk,YE=$.window_function,XE=$.zeros,ZE=$.zeros_like;export{SS as b,uw as c,dE as d,ep as e,Cf as f}; \ No newline at end of file +`./src/generation/logits_process.js`)})();var lf=$.ASTFeatureExtractor,uf=$.ASTForAudioClassification,df=$.ASTModel,ff=$.ASTPreTrainedModel,pf=$.AlbertForMaskedLM,mf=$.AlbertForQuestionAnswering,hf=$.AlbertForSequenceClassification,gf=$.AlbertModel,_f=$.AlbertPreTrainedModel,vf=$.AlbertTokenizer,yf=$.AudioClassificationPipeline,bf=$.AutoConfig,xf=$.AutoFeatureExtractor,Sf=$.AutoImageProcessor,Cf=$.AutoModel,wf=$.AutoModelForAudioClassification,Tf=$.AutoModelForAudioFrameClassification,Ef=$.AutoModelForAudioTextToText,Df=$.AutoModelForCTC,Of=$.AutoModelForCausalLM,kf=$.AutoModelForDepthEstimation,Af=$.AutoModelForDocumentQuestionAnswering,jf=$.AutoModelForImageClassification,Mf=$.AutoModelForImageFeatureExtraction,Nf=$.AutoModelForImageMatting,Pf=$.AutoModelForImageSegmentation,Ff=$.AutoModelForImageTextToText,If=$.AutoModelForImageToImage,Lf=$.AutoModelForMaskGeneration,Rf=$.AutoModelForMaskedLM,zf=$.AutoModelForNormalEstimation,Bf=$.AutoModelForObjectDetection,Vf=$.AutoModelForPoseEstimation,Hf=$.AutoModelForQuestionAnswering,Uf=$.AutoModelForSemanticSegmentation,Wf=$.AutoModelForSeq2SeqLM,Gf=$.AutoModelForSequenceClassification,Kf=$.AutoModelForSpeechSeq2Seq,qf=$.AutoModelForTextToSpectrogram,Jf=$.AutoModelForTextToWaveform,Yf=$.AutoModelForTokenClassification,Xf=$.AutoModelForUniversalSegmentation,Zf=$.AutoModelForVision2Seq,Qf=$.AutoModelForXVector,$f=$.AutoModelForZeroShotObjectDetection,ep=$.AutoProcessor,tp=$.AutoTokenizer,np=$.AutomaticSpeechRecognitionPipeline,rp=$.BackgroundRemovalPipeline,ip=$.BartForConditionalGeneration,ap=$.BartForSequenceClassification,op=$.BartModel,sp=$.BartPretrainedModel,cp=$.BartTokenizer,lp=$.BaseModelOutput,up=$.BaseStreamer,dp=$.BeitFeatureExtractor,fp=$.BeitForImageClassification,pp=$.BeitModel,mp=$.BeitPreTrainedModel,hp=$.BertForMaskedLM,gp=$.BertForQuestionAnswering,_p=$.BertForSequenceClassification,vp=$.BertForTokenClassification,yp=$.BertModel,bp=$.BertPreTrainedModel,xp=$.BertTokenizer,Sp=$.BitImageProcessor,Cp=$.BlenderbotForConditionalGeneration,wp=$.BlenderbotModel,Tp=$.BlenderbotPreTrainedModel,Ep=$.BlenderbotSmallForConditionalGeneration,Dp=$.BlenderbotSmallModel,Op=$.BlenderbotSmallPreTrainedModel,kp=$.BlenderbotSmallTokenizer,Ap=$.BlenderbotTokenizer,jp=$.BloomForCausalLM,Mp=$.BloomModel,Np=$.BloomPreTrainedModel,Pp=$.BloomTokenizer,Fp=$.CLIPFeatureExtractor,Ip=$.CLIPImageProcessor,Lp=$.CLIPModel,Rp=$.CLIPPreTrainedModel,zp=$.CLIPSegForImageSegmentation,Bp=$.CLIPSegModel,Vp=$.CLIPSegPreTrainedModel,Hp=$.CLIPTextModel,Up=$.CLIPTextModelWithProjection,Wp=$.CLIPTokenizer,Gp=$.CLIPVisionModel,Kp=$.CLIPVisionModelWithProjection,qp=$.CamembertForMaskedLM,Jp=$.CamembertForQuestionAnswering,Yp=$.CamembertForSequenceClassification,Xp=$.CamembertForTokenClassification,Zp=$.CamembertModel,Qp=$.CamembertPreTrainedModel,$p=$.CamembertTokenizer,em=$.CausalLMOutput,tm=$.CausalLMOutputWithPast,nm=$.ChineseCLIPFeatureExtractor,rm=$.ChineseCLIPModel,im=$.ChineseCLIPPreTrainedModel,am=$.ClapAudioModelWithProjection,om=$.ClapFeatureExtractor,sm=$.ClapModel,cm=$.ClapPreTrainedModel,lm=$.ClapTextModelWithProjection,um=$.ClassifierFreeGuidanceLogitsProcessor,dm=$.CodeGenForCausalLM,fm=$.CodeGenModel,pm=$.CodeGenPreTrainedModel,mm=$.CodeGenTokenizer,hm=$.CodeLlamaTokenizer,gm=$.CohereForCausalLM,_m=$.CohereModel,vm=$.CoherePreTrainedModel,ym=$.CohereTokenizer,bm=$.ConvBertForMaskedLM,xm=$.ConvBertForQuestionAnswering,Sm=$.ConvBertForSequenceClassification,Cm=$.ConvBertForTokenClassification,wm=$.ConvBertModel,Tm=$.ConvBertPreTrainedModel,Em=$.ConvBertTokenizer,Dm=$.ConvNextFeatureExtractor,Om=$.ConvNextForImageClassification,km=$.ConvNextImageProcessor,Am=$.ConvNextModel,jm=$.ConvNextPreTrainedModel,Mm=$.ConvNextV2ForImageClassification,Nm=$.ConvNextV2Model,Pm=$.ConvNextV2PreTrainedModel,Fm=$.DFineForObjectDetection,Im=$.DFineModel,Lm=$.DFinePreTrainedModel,Rm=$.DPTFeatureExtractor,zm=$.DPTForDepthEstimation,Bm=$.DPTImageProcessor,Vm=$.DPTModel,Hm=$.DPTPreTrainedModel,Um=$.DacDecoderModel,Wm=$.DacDecoderOutput,Gm=$.DacEncoderModel,Km=$.DacEncoderOutput,qm=$.DacFeatureExtractor,Jm=$.DacModel,Ym=$.DacPreTrainedModel,Xm=$.DataTypeMap,Zm=$.DebertaForMaskedLM,Qm=$.DebertaForQuestionAnswering,$m=$.DebertaForSequenceClassification,eh=$.DebertaForTokenClassification,th=$.DebertaModel,nh=$.DebertaPreTrainedModel,rh=$.DebertaTokenizer,ih=$.DebertaV2ForMaskedLM,ah=$.DebertaV2ForQuestionAnswering,oh=$.DebertaV2ForSequenceClassification,sh=$.DebertaV2ForTokenClassification,ch=$.DebertaV2Model,lh=$.DebertaV2PreTrainedModel,uh=$.DebertaV2Tokenizer,dh=$.DecisionTransformerModel,fh=$.DecisionTransformerPreTrainedModel,ph=$.DeiTFeatureExtractor,mh=$.DeiTForImageClassification,hh=$.DeiTImageProcessor,gh=$.DeiTModel,_h=$.DeiTPreTrainedModel,vh=$.DepthAnythingForDepthEstimation,yh=$.DepthAnythingPreTrainedModel,bh=$.DepthEstimationPipeline,xh=$.DepthProForDepthEstimation,Sh=$.DepthProPreTrainedModel,Ch=$.DetrFeatureExtractor,wh=$.DetrForObjectDetection,Th=$.DetrForSegmentation,Eh=$.DetrImageProcessor,Dh=$.DetrModel,Oh=$.DetrObjectDetectionOutput,kh=$.DetrPreTrainedModel,Ah=$.DetrSegmentationOutput,jh=$.Dinov2ForImageClassification,Mh=$.Dinov2Model,Nh=$.Dinov2PreTrainedModel,Ph=$.Dinov2WithRegistersForImageClassification,Fh=$.Dinov2WithRegistersModel,Ih=$.Dinov2WithRegistersPreTrainedModel,Lh=$.DistilBertForMaskedLM,Rh=$.DistilBertForQuestionAnswering,zh=$.DistilBertForSequenceClassification,Bh=$.DistilBertForTokenClassification,Vh=$.DistilBertModel,Hh=$.DistilBertPreTrainedModel,Uh=$.DistilBertTokenizer,Wh=$.DocumentQuestionAnsweringPipeline,Gh=$.DonutFeatureExtractor,Kh=$.DonutImageProcessor,qh=$.DonutSwinModel,Jh=$.DonutSwinPreTrainedModel,Yh=$.EfficientNetForImageClassification,Xh=$.EfficientNetImageProcessor,Zh=$.EfficientNetModel,Qh=$.EfficientNetPreTrainedModel,$h=$.ElectraForMaskedLM,eg=$.ElectraForQuestionAnswering,tg=$.ElectraForSequenceClassification,ng=$.ElectraForTokenClassification,rg=$.ElectraModel,ig=$.ElectraPreTrainedModel,ag=$.ElectraTokenizer,og=$.EncodecFeatureExtractor,sg=$.EosTokenCriteria,cg=$.EsmForMaskedLM,lg=$.EsmForSequenceClassification,ug=$.EsmForTokenClassification,dg=$.EsmModel,fg=$.EsmPreTrainedModel,pg=$.EsmTokenizer,mg=$.ExaoneForCausalLM,hg=$.ExaoneModel,gg=$.ExaonePreTrainedModel,_g=$.FFT,vg=$.FalconForCausalLM,yg=$.FalconModel,bg=$.FalconPreTrainedModel,xg=$.FalconTokenizer,Sg=$.FastViTForImageClassification,Cg=$.FastViTModel,wg=$.FastViTPreTrainedModel,Tg=$.FeatureExtractionPipeline,Eg=$.FeatureExtractor,Dg=$.FillMaskPipeline,Og=$.Florence2ForConditionalGeneration,kg=$.Florence2PreTrainedModel,Ag=$.Florence2Processor,jg=$.ForcedBOSTokenLogitsProcessor,Mg=$.ForcedEOSTokenLogitsProcessor,Ng=$.GLPNFeatureExtractor,Pg=$.GLPNForDepthEstimation,Fg=$.GLPNModel,Ig=$.GLPNPreTrainedModel,Lg=$.GPT2LMHeadModel,Rg=$.GPT2Model,zg=$.GPT2PreTrainedModel,Bg=$.GPT2Tokenizer,Vg=$.GPTBigCodeForCausalLM,Hg=$.GPTBigCodeModel,Ug=$.GPTBigCodePreTrainedModel,Wg=$.GPTJForCausalLM,Gg=$.GPTJModel,Kg=$.GPTJPreTrainedModel,qg=$.GPTNeoForCausalLM,Jg=$.GPTNeoModel,Yg=$.GPTNeoPreTrainedModel,Xg=$.GPTNeoXForCausalLM,Zg=$.GPTNeoXModel,Qg=$.GPTNeoXPreTrainedModel,$g=$.GPTNeoXTokenizer,e_=$.Gemma2ForCausalLM,t_=$.Gemma2Model,n_=$.Gemma2PreTrainedModel,r_=$.Gemma3ForCausalLM,i_=$.Gemma3Model,a_=$.Gemma3PreTrainedModel,o_=$.Gemma3nAudioFeatureExtractor,s_=$.Gemma3nForConditionalGeneration,c_=$.Gemma3nPreTrainedModel,l_=$.Gemma3nProcessor,u_=$.GemmaForCausalLM,d_=$.GemmaModel,f_=$.GemmaPreTrainedModel,p_=$.GemmaTokenizer,m_=$.GlmForCausalLM,h_=$.GlmModel,g_=$.GlmPreTrainedModel,__=$.GraniteForCausalLM,v_=$.GraniteModel,y_=$.GranitePreTrainedModel,b_=$.Grok1Tokenizer,x_=$.GroundingDinoForObjectDetection,S_=$.GroundingDinoImageProcessor,C_=$.GroundingDinoPreTrainedModel,w_=$.GroundingDinoProcessor,T_=$.GroupViTModel,E_=$.GroupViTPreTrainedModel,D_=$.HeliumForCausalLM,O_=$.HeliumModel,k_=$.HeliumPreTrainedModel,A_=$.HerbertTokenizer,j_=$.HieraForImageClassification,M_=$.HieraModel,N_=$.HieraPreTrainedModel,P_=$.HubertForCTC,F_=$.HubertForSequenceClassification,I_=$.HubertModel,L_=$.HubertPreTrainedModel,R_=$.IJepaForImageClassification,z_=$.IJepaModel,B_=$.IJepaPreTrainedModel,V_=$.Idefics3ForConditionalGeneration,H_=$.Idefics3ImageProcessor,U_=$.Idefics3PreTrainedModel,W_=$.Idefics3Processor,G_=$.ImageClassificationPipeline,K_=$.ImageFeatureExtractionPipeline,q_=$.ImageFeatureExtractor,J_=$.ImageMattingOutput,Y_=$.ImageProcessor,X_=$.ImageSegmentationPipeline,Z_=$.ImageToImagePipeline,Q_=$.ImageToTextPipeline,$_=$.InterruptableStoppingCriteria,ev=$.JAISLMHeadModel,tv=$.JAISModel,nv=$.JAISPreTrainedModel,rv=$.JinaCLIPImageProcessor,iv=$.JinaCLIPModel,av=$.JinaCLIPPreTrainedModel,ov=$.JinaCLIPProcessor,sv=$.JinaCLIPTextModel,cv=$.JinaCLIPVisionModel,lv=$.LiteWhisperForConditionalGeneration,uv=$.LlamaForCausalLM,dv=$.LlamaModel,fv=$.LlamaPreTrainedModel,pv=$.LlamaTokenizer,mv=$.LlavaForConditionalGeneration,hv=$.LlavaOnevisionForConditionalGeneration,gv=$.LlavaOnevisionImageProcessor,_v=$.LlavaPreTrainedModel,vv=$.LlavaProcessor,yv=$.LlavaQwen2ForCausalLM,bv=$.LogitsProcessor,xv=$.LogitsProcessorList,Sv=$.LogitsWarper,Cv=$.LongT5ForConditionalGeneration,wv=$.LongT5Model,Tv=$.LongT5PreTrainedModel,Ev=$.M2M100ForConditionalGeneration,Dv=$.M2M100Model,Ov=$.M2M100PreTrainedModel,kv=$.M2M100Tokenizer,Av=$.MBart50Tokenizer,jv=$.MBartForCausalLM,Mv=$.MBartForConditionalGeneration,Nv=$.MBartForSequenceClassification,Pv=$.MBartModel,Fv=$.MBartPreTrainedModel,Iv=$.MBartTokenizer,Lv=$.MPNetForMaskedLM,Rv=$.MPNetForQuestionAnswering,zv=$.MPNetForSequenceClassification,Bv=$.MPNetForTokenClassification,Vv=$.MPNetModel,Hv=$.MPNetPreTrainedModel,Uv=$.MPNetTokenizer,Wv=$.MT5ForConditionalGeneration,Gv=$.MT5Model,Kv=$.MT5PreTrainedModel,qv=$.MarianMTModel,Jv=$.MarianModel,Yv=$.MarianPreTrainedModel,Xv=$.MarianTokenizer,Zv=$.Mask2FormerImageProcessor,Qv=$.MaskFormerFeatureExtractor,$v=$.MaskFormerForInstanceSegmentation,ey=$.MaskFormerImageProcessor,ty=$.MaskFormerModel,ny=$.MaskFormerPreTrainedModel,ry=$.MaskedLMOutput,iy=$.MaxLengthCriteria,ay=$.Metric3DForDepthEstimation,oy=$.Metric3DPreTrainedModel,sy=$.Metric3Dv2ForDepthEstimation,cy=$.Metric3Dv2PreTrainedModel,ly=$.MgpstrForSceneTextRecognition,uy=$.MgpstrModelOutput,dy=$.MgpstrPreTrainedModel,fy=$.MgpstrProcessor,py=$.MgpstrTokenizer,my=$.MimiDecoderModel,hy=$.MimiDecoderOutput,gy=$.MimiEncoderModel,_y=$.MimiEncoderOutput,vy=$.MimiModel,yy=$.MimiPreTrainedModel,by=$.MinLengthLogitsProcessor,xy=$.MinNewTokensLengthLogitsProcessor,Sy=$.MistralForCausalLM,Cy=$.MistralModel,wy=$.MistralPreTrainedModel,Ty=$.MobileBertForMaskedLM,Ey=$.MobileBertForQuestionAnswering,Dy=$.MobileBertForSequenceClassification,Oy=$.MobileBertModel,ky=$.MobileBertPreTrainedModel,Ay=$.MobileBertTokenizer,jy=$.MobileLLMForCausalLM,My=$.MobileLLMModel,Ny=$.MobileLLMPreTrainedModel,Py=$.MobileNetV1FeatureExtractor,Fy=$.MobileNetV1ForImageClassification,Iy=$.MobileNetV1ForSemanticSegmentation,Ly=$.MobileNetV1ImageProcessor,Ry=$.MobileNetV1Model,zy=$.MobileNetV1PreTrainedModel,By=$.MobileNetV2FeatureExtractor,Vy=$.MobileNetV2ForImageClassification,Hy=$.MobileNetV2ForSemanticSegmentation,Uy=$.MobileNetV2ImageProcessor,Wy=$.MobileNetV2Model,Gy=$.MobileNetV2PreTrainedModel,Ky=$.MobileNetV3FeatureExtractor,qy=$.MobileNetV3ForImageClassification,Jy=$.MobileNetV3ForSemanticSegmentation,Yy=$.MobileNetV3ImageProcessor,Xy=$.MobileNetV3Model,Zy=$.MobileNetV3PreTrainedModel,Qy=$.MobileNetV4FeatureExtractor,$y=$.MobileNetV4ForImageClassification,eb=$.MobileNetV4ForSemanticSegmentation,tb=$.MobileNetV4ImageProcessor,nb=$.MobileNetV4Model,rb=$.MobileNetV4PreTrainedModel,ib=$.MobileViTFeatureExtractor,ab=$.MobileViTForImageClassification,ob=$.MobileViTImageProcessor,sb=$.MobileViTModel,cb=$.MobileViTPreTrainedModel,lb=$.MobileViTV2ForImageClassification,ub=$.MobileViTV2Model,db=$.MobileViTV2PreTrainedModel,fb=$.ModelOutput,pb=$.ModernBertForMaskedLM,mb=$.ModernBertForSequenceClassification,hb=$.ModernBertForTokenClassification,gb=$.ModernBertModel,_b=$.ModernBertPreTrainedModel,vb=$.Moondream1ForConditionalGeneration,yb=$.MoonshineFeatureExtractor,bb=$.MoonshineForConditionalGeneration,xb=$.MoonshineModel,Sb=$.MoonshinePreTrainedModel,Cb=$.MoonshineProcessor,wb=$.MptForCausalLM,Tb=$.MptModel,Eb=$.MptPreTrainedModel,Db=$.MultiModalityCausalLM,Ob=$.MultiModalityPreTrainedModel,kb=$.MusicgenForCausalLM,Ab=$.MusicgenForConditionalGeneration,jb=$.MusicgenModel,Mb=$.MusicgenPreTrainedModel,Nb=$.NeoBertForMaskedLM,Pb=$.NeoBertForQuestionAnswering,Fb=$.NeoBertForSequenceClassification,Ib=$.NeoBertForTokenClassification,Lb=$.NeoBertModel,Rb=$.NeoBertPreTrainedModel,zb=$.NllbTokenizer,Bb=$.NoBadWordsLogitsProcessor,Vb=$.NoRepeatNGramLogitsProcessor,Hb=$.NomicBertModel,Ub=$.NomicBertPreTrainedModel,Wb=$.NougatImageProcessor,Gb=$.NougatTokenizer,Kb=$.OPTForCausalLM,qb=$.OPTModel,Jb=$.OPTPreTrainedModel,Yb=$.ObjectDetectionPipeline,Xb=$.Olmo2ForCausalLM,Zb=$.Olmo2Model,Qb=$.Olmo2PreTrainedModel,$b=$.OlmoForCausalLM,ex=$.OlmoModel,tx=$.OlmoPreTrainedModel,nx=$.OpenELMForCausalLM,rx=$.OpenELMModel,ix=$.OpenELMPreTrainedModel,ax=$.OwlViTFeatureExtractor,ox=$.OwlViTForObjectDetection,sx=$.OwlViTImageProcessor,cx=$.OwlViTModel,lx=$.OwlViTPreTrainedModel,ux=$.OwlViTProcessor,dx=$.Owlv2ForObjectDetection,fx=$.Owlv2ImageProcessor,px=$.Owlv2Model,mx=$.Owlv2PreTrainedModel,hx=$.PaliGemmaForConditionalGeneration,gx=$.PaliGemmaPreTrainedModel,_x=$.PaliGemmaProcessor,vx=$.PatchTSMixerForPrediction,yx=$.PatchTSMixerModel,bx=$.PatchTSMixerPreTrainedModel,xx=$.PatchTSTForPrediction,Sx=$.PatchTSTModel,Cx=$.PatchTSTPreTrainedModel,wx=$.Phi3ForCausalLM,Tx=$.Phi3Model,Ex=$.Phi3PreTrainedModel,Dx=$.Phi3VForCausalLM,Ox=$.Phi3VImageProcessor,kx=$.Phi3VPreTrainedModel,Ax=$.Phi3VProcessor,jx=$.PhiForCausalLM,Mx=$.PhiModel,Nx=$.PhiPreTrainedModel,Px=$.Pipeline,Fx=$.PreTrainedModel,Ix=$.PreTrainedTokenizer,Lx=$.PretrainedConfig,Rx=$.PretrainedMixin,zx=$.Processor,Bx=$.PvtForImageClassification,Vx=$.PvtImageProcessor,Hx=$.PvtModel,Ux=$.PvtPreTrainedModel,Wx=$.PyAnnoteFeatureExtractor,Gx=$.PyAnnoteForAudioFrameClassification,Kx=$.PyAnnoteModel,qx=$.PyAnnotePreTrainedModel,Jx=$.PyAnnoteProcessor,Yx=$.QuestionAnsweringModelOutput,Xx=$.QuestionAnsweringPipeline,Zx=$.Qwen2ForCausalLM,Qx=$.Qwen2Model,$x=$.Qwen2PreTrainedModel,eS=$.Qwen2Tokenizer,tS=$.Qwen2VLForConditionalGeneration,nS=$.Qwen2VLImageProcessor,rS=$.Qwen2VLPreTrainedModel,iS=$.Qwen2VLProcessor,aS=$.Qwen3ForCausalLM,oS=$.Qwen3Model,sS=$.Qwen3PreTrainedModel,cS=$.RFDetrForObjectDetection,lS=$.RFDetrModel,uS=$.RFDetrObjectDetectionOutput,dS=$.RFDetrPreTrainedModel,fS=$.RTDetrForObjectDetection,pS=$.RTDetrImageProcessor,mS=$.RTDetrModel,hS=$.RTDetrObjectDetectionOutput,gS=$.RTDetrPreTrainedModel,_S=$.RTDetrV2ForObjectDetection,vS=$.RTDetrV2Model,yS=$.RTDetrV2ObjectDetectionOutput,bS=$.RTDetrV2PreTrainedModel,xS=$.RawAudio,SS=$.RawImage,CS=$.RawVideo,wS=$.RawVideoFrame,TS=$.RepetitionPenaltyLogitsProcessor,ES=$.ResNetForImageClassification,DS=$.ResNetModel,OS=$.ResNetPreTrainedModel,kS=$.RoFormerForMaskedLM,AS=$.RoFormerForQuestionAnswering,jS=$.RoFormerForSequenceClassification,MS=$.RoFormerForTokenClassification,NS=$.RoFormerModel,PS=$.RoFormerPreTrainedModel,FS=$.RoFormerTokenizer,IS=$.RobertaForMaskedLM,LS=$.RobertaForQuestionAnswering,RS=$.RobertaForSequenceClassification,zS=$.RobertaForTokenClassification,BS=$.RobertaModel,VS=$.RobertaPreTrainedModel,HS=$.RobertaTokenizer,US=$.SamImageProcessor,WS=$.SamImageSegmentationOutput,GS=$.SamModel,KS=$.SamPreTrainedModel,qS=$.SamProcessor,JS=$.SapiensForDepthEstimation,YS=$.SapiensForNormalEstimation,XS=$.SapiensForSemanticSegmentation,ZS=$.SapiensPreTrainedModel,QS=$.SeamlessM4TFeatureExtractor,$S=$.SegformerFeatureExtractor,eC=$.SegformerForImageClassification,tC=$.SegformerForSemanticSegmentation,nC=$.SegformerImageProcessor,rC=$.SegformerModel,iC=$.SegformerPreTrainedModel,aC=$.Seq2SeqLMOutput,oC=$.SequenceClassifierOutput,sC=$.SiglipImageProcessor,cC=$.SiglipModel,lC=$.SiglipPreTrainedModel,uC=$.SiglipTextModel,dC=$.SiglipTokenizer,fC=$.SiglipVisionModel,pC=$.SmolVLMForConditionalGeneration,mC=$.SmolVLMImageProcessor,hC=$.SmolVLMProcessor,gC=$.SnacDecoderModel,_C=$.SnacEncoderModel,vC=$.SnacFeatureExtractor,yC=$.SnacModel,bC=$.SnacPreTrainedModel,xC=$.SpeechT5FeatureExtractor,SC=$.SpeechT5ForSpeechToText,CC=$.SpeechT5ForTextToSpeech,wC=$.SpeechT5HifiGan,TC=$.SpeechT5Model,EC=$.SpeechT5PreTrainedModel,DC=$.SpeechT5Processor,OC=$.SpeechT5Tokenizer,kC=$.SqueezeBertForMaskedLM,AC=$.SqueezeBertForQuestionAnswering,jC=$.SqueezeBertForSequenceClassification,MC=$.SqueezeBertModel,NC=$.SqueezeBertPreTrainedModel,PC=$.SqueezeBertTokenizer,FC=$.StableLmForCausalLM,IC=$.StableLmModel,LC=$.StableLmPreTrainedModel,RC=$.Starcoder2ForCausalLM,zC=$.Starcoder2Model,BC=$.Starcoder2PreTrainedModel,VC=$.StoppingCriteria,HC=$.StoppingCriteriaList,UC=$.StyleTextToSpeech2Model,WC=$.StyleTextToSpeech2PreTrainedModel,GC=$.SummarizationPipeline,KC=$.SuppressTokensAtBeginLogitsProcessor,qC=$.Swin2SRForImageSuperResolution,JC=$.Swin2SRImageProcessor,YC=$.Swin2SRModel,XC=$.Swin2SRPreTrainedModel,ZC=$.SwinForImageClassification,QC=$.SwinForSemanticSegmentation,$C=$.SwinModel,ew=$.SwinPreTrainedModel,tw=$.T5ForConditionalGeneration,nw=$.T5Model,rw=$.T5PreTrainedModel,iw=$.T5Tokenizer,aw=$.TableTransformerForObjectDetection,ow=$.TableTransformerModel,sw=$.TableTransformerObjectDetectionOutput,cw=$.TableTransformerPreTrainedModel,lw=$.TemperatureLogitsWarper,uw=$.Tensor,dw=$.Text2TextGenerationPipeline,fw=$.TextClassificationPipeline,pw=$.TextGenerationPipeline,mw=$.TextStreamer,hw=$.TextToAudioPipeline,gw=$.TokenClassificationPipeline,_w=$.TokenClassifierOutput,vw=$.TokenizerModel,yw=$.TopKLogitsWarper,bw=$.TopPLogitsWarper,xw=$.TrOCRForCausalLM,Sw=$.TrOCRPreTrainedModel,Cw=$.TranslationPipeline,ww=$.UltravoxModel,Tw=$.UltravoxPreTrainedModel,Ew=$.UltravoxProcessor,Dw=$.UniSpeechForCTC,Ow=$.UniSpeechForSequenceClassification,kw=$.UniSpeechModel,Aw=$.UniSpeechPreTrainedModel,jw=$.UniSpeechSatForAudioFrameClassification,Mw=$.UniSpeechSatForCTC,Nw=$.UniSpeechSatForSequenceClassification,Pw=$.UniSpeechSatModel,Fw=$.UniSpeechSatPreTrainedModel,Iw=$.VLChatProcessor,Lw=$.VLMImageProcessor,Rw=$.ViTFeatureExtractor,zw=$.ViTForImageClassification,Bw=$.ViTImageProcessor,Vw=$.ViTMAEModel,Hw=$.ViTMAEPreTrainedModel,Uw=$.ViTMSNForImageClassification,Ww=$.ViTMSNModel,Gw=$.ViTMSNPreTrainedModel,Kw=$.ViTModel,qw=$.ViTPreTrainedModel,Jw=$.VisionEncoderDecoderModel,Yw=$.VitMatteForImageMatting,Xw=$.VitMatteImageProcessor,Zw=$.VitMattePreTrainedModel,Qw=$.VitPoseForPoseEstimation,$w=$.VitPoseImageProcessor,eT=$.VitPosePreTrainedModel,tT=$.VitsModel,nT=$.VitsModelOutput,rT=$.VitsPreTrainedModel,iT=$.VitsTokenizer,aT=$.Wav2Vec2BertForCTC,oT=$.Wav2Vec2BertForSequenceClassification,sT=$.Wav2Vec2BertModel,cT=$.Wav2Vec2BertPreTrainedModel,lT=$.Wav2Vec2CTCTokenizer,uT=$.Wav2Vec2FeatureExtractor,dT=$.Wav2Vec2ForAudioFrameClassification,fT=$.Wav2Vec2ForCTC,pT=$.Wav2Vec2ForSequenceClassification,mT=$.Wav2Vec2Model,hT=$.Wav2Vec2PreTrainedModel,gT=$.Wav2Vec2Processor,_T=$.Wav2Vec2ProcessorWithLM,vT=$.WavLMForAudioFrameClassification,yT=$.WavLMForCTC,bT=$.WavLMForSequenceClassification,xT=$.WavLMForXVector,ST=$.WavLMModel,CT=$.WavLMPreTrainedModel,wT=$.WeSpeakerFeatureExtractor,TT=$.WeSpeakerResNetModel,ET=$.WeSpeakerResNetPreTrainedModel,DT=$.WhisperFeatureExtractor,OT=$.WhisperForConditionalGeneration,kT=$.WhisperModel,AT=$.WhisperPreTrainedModel,jT=$.WhisperProcessor,MT=$.WhisperTextStreamer,NT=$.WhisperTimeStampLogitsProcessor,PT=$.WhisperTokenizer,FT=$.XLMForQuestionAnswering,IT=$.XLMForSequenceClassification,LT=$.XLMForTokenClassification,RT=$.XLMModel,zT=$.XLMPreTrainedModel,BT=$.XLMRobertaForMaskedLM,VT=$.XLMRobertaForQuestionAnswering,HT=$.XLMRobertaForSequenceClassification,UT=$.XLMRobertaForTokenClassification,WT=$.XLMRobertaModel,GT=$.XLMRobertaPreTrainedModel,KT=$.XLMRobertaTokenizer,qT=$.XLMTokenizer,JT=$.XLMWithLMHeadModel,YT=$.XVectorOutput,XT=$.YolosFeatureExtractor,ZT=$.YolosForObjectDetection,QT=$.YolosImageProcessor,$T=$.YolosModel,eE=$.YolosObjectDetectionOutput,tE=$.YolosPreTrainedModel,nE=$.ZeroShotAudioClassificationPipeline,rE=$.ZeroShotClassificationPipeline,iE=$.ZeroShotImageClassificationPipeline,aE=$.ZeroShotObjectDetectionPipeline,oE=$.bankers_round,sE=$.cat,cE=$.cos_sim,lE=$.dot,uE=$.dynamic_time_warping,dE=$.env,fE=$.full,pE=$.full_like,mE=$.getKeyValueShapes,hE=$.hamming,gE=$.hanning,_E=$.interpolate,vE=$.interpolate_4d,yE=$.interpolate_data,bE=$.is_chinese_char,xE=$.layer_norm,SE=$.load_image,CE=$.load_video,wE=$.log_softmax,TE=$.magnitude,EE=$.matmul,DE=$.max,OE=$.mean,kE=$.mean_pooling,AE=$.medianFilter,jE=$.mel_filter_bank,ME=$.min,NE=$.ones,PE=$.ones_like,FE=$.permute,IE=$.permute_data,LE=$.pipeline,RE=$.quantize_embeddings,zE=$.rand,BE=$.read_audio,VE=$.rfft,HE=$.round,UE=$.slice,WE=$.softmax,GE=$.spectrogram,KE=$.stack,qE=$.std_mean,JE=$.topk,YE=$.window_function,XE=$.zeros,ZE=$.zeros_like;export{ep as b,Cf as c,SS as d,uw as e,dE as f}; \ No newline at end of file diff --git a/assets/valibot-CbgwcZn_-C2Mxz5DO.js b/assets/valibot-CbgwcZn_-kvK6hLPP.js similarity index 69% rename from assets/valibot-CbgwcZn_-C2Mxz5DO.js rename to assets/valibot-CbgwcZn_-kvK6hLPP.js index f7397012176c518cd7cb1062594bf5970fe7c6cd..98e6da1953d97798d384a64a16bc768d2e84f232 100644 --- a/assets/valibot-CbgwcZn_-C2Mxz5DO.js +++ b/assets/valibot-CbgwcZn_-kvK6hLPP.js @@ -1 +1 @@ -import{F as e,aQ as t}from"./index-Bcb2irKh.js";const n=async()=>{let{toJsonSchema:n}=await e(t(()=>import(`./dist-CshDQrOa.js`),[]),`@valibot/to-json-schema`);return e=>n(e)};export{n as getToJsonSchemaFn}; \ No newline at end of file +import{F as e,aQ as t}from"./index-TXtvn0DM.js";const n=async()=>{let{toJsonSchema:n}=await e(t(()=>import(`./dist-CshDQrOa.js`),[]),`@valibot/to-json-schema`);return e=>n(e)};export{n as getToJsonSchemaFn}; \ No newline at end of file diff --git a/assets/vibrant-CGg8wx9d.js b/assets/vibrant-CGg8wx9d.js new file mode 100644 index 0000000000000000000000000000000000000000..19bacd1efb254fc63fd17086e39b78dd01d4ec0e --- /dev/null +++ b/assets/vibrant-CGg8wx9d.js @@ -0,0 +1 @@ +import{b as e}from"./InputFile-BduVApi9.js";import{d6 as t,d7 as n,d9 as r,dF as i,dK as a,dN as o,dP as s,de as c,df as l,do as u,dt as d,dv as f,dx as p}from"./index-TXtvn0DM.js";import{b as m}from"./browser-CJhr0Svl.js";const h={flex:``,"flex-col":``,"gap-4":``},g={border:`2 solid neutral-200 dark:neutral-800`,bg:`neutral-50 dark:neutral-900`,"w-full":``,flex:``,"gap-2":``,"rounded-lg":``,"p-4":``},_={border:`2 solid neutral-200 dark:neutral-800`,bg:`neutral-50 dark:neutral-900`,"w-full":``,flex:``,"gap-2":``,"rounded-lg":``,"p-4":``},v={flex:``,"gap-2":``},y={"h-60":``,border:`2 solid neutral-200 dark:neutral-800`,bg:`neutral-50 dark:neutral-900`,"rounded-lg":``},b=[`src`];var x=t({__name:`vibrant`,setup(t){let x=a([]),S=a(),C=a([]),w=a([]);function T(e){let t=new Image;t.src=URL.createObjectURL(e),t.onload=E,S.value=t}async function E(){if(!S.value)return;let e=new m(S.value),t=await e.getPalette();C.value=Object.values(t).map(e=>e?.hex).filter(e=>typeof e==`string`),w.value=Object.values(t).map(e=>JSON.stringify(e))}return f(x,e=>{T(e[0])},{deep:!0}),(t,a)=>(p(),r(`div`,h,[c(`div`,g,[(p(!0),r(u,null,l(C.value,(e,t)=>(p(),r(`div`,{key:t,style:s({backgroundColor:e}),"size-20":``,"rounded-full":``},null,4))),128))]),c(`div`,_,o(w.value),1),c(`div`,v,[d(i(e),{modelValue:x.value,"onUpdate:modelValue":a[0]||=e=>x.value=e,"h-60":``,"w-full":``},null,8,[`modelValue`])]),c(`div`,y,[S.value?(p(),r(`img`,{key:0,src:S.value.src,"h-full":``,"w-full":``,"object-contain":``},null,8,b)):n(``,!0)])]))}}),S=x;export{S as default}; \ No newline at end of file diff --git a/assets/vibrant-Cd0ESToT.js b/assets/vibrant-Cd0ESToT.js deleted file mode 100644 index e9742934ab19ba19a41ad9e9cbefbd92a66914cf..0000000000000000000000000000000000000000 --- a/assets/vibrant-Cd0ESToT.js +++ /dev/null @@ -1 +0,0 @@ -import{b as e}from"./InputFile-DaDBm_4w.js";import{d9 as t,dD as n,dI as r,dN as i,dP as a,de as o,dg as s,di as c,dm as l,dn as u,dp as d,du as f,dv as p}from"./index-Bcb2irKh.js";import{b as m}from"./browser-CJhr0Svl.js";const h={flex:``,"flex-col":``,"gap-4":``},g={border:`2 solid neutral-200 dark:neutral-800`,bg:`neutral-50 dark:neutral-900`,"w-full":``,flex:``,"gap-2":``,"rounded-lg":``,"p-4":``},_={border:`2 solid neutral-200 dark:neutral-800`,bg:`neutral-50 dark:neutral-900`,"w-full":``,flex:``,"gap-2":``,"rounded-lg":``,"p-4":``},v={flex:``,"gap-2":``},y={"h-60":``,border:`2 solid neutral-200 dark:neutral-800`,bg:`neutral-50 dark:neutral-900`,"rounded-lg":``},b=[`src`];var x=l({__name:`vibrant`,setup(l){let x=r([]),S=r(),C=r([]),w=r([]);function T(e){let t=new Image;t.src=URL.createObjectURL(e),t.onload=E,S.value=t}async function E(){if(!S.value)return;let e=new m(S.value),t=await e.getPalette();C.value=Object.values(t).map(e=>e?.hex).filter(e=>typeof e==`string`),w.value=Object.values(t).map(e=>JSON.stringify(e))}return s(x,e=>{T(e[0])},{deep:!0}),(r,s)=>(c(),d(`div`,h,[f(`div`,g,[(c(!0),d(t,null,p(C.value,(e,t)=>(c(),d(`div`,{key:t,style:a({backgroundColor:e}),"size-20":``,"rounded-full":``},null,4))),128))]),f(`div`,_,i(w.value),1),f(`div`,v,[o(n(e),{modelValue:x.value,"onUpdate:modelValue":s[0]||=e=>x.value=e,"h-60":``,"w-full":``},null,8,[`modelValue`])]),f(`div`,y,[S.value?(c(),d(`img`,{key:0,src:S.value.src,"h-full":``,"w-full":``,"object-contain":``},null,8,b)):u(``,!0)])]))}}),S=x;export{S as default}; \ No newline at end of file diff --git a/assets/volcengine-BCpR8HvM.js b/assets/volcengine-BCpR8HvM.js deleted file mode 100644 index 2d9572a8e539036b4f89a6c2bf434adf8d31023d..0000000000000000000000000000000000000000 --- a/assets/volcengine-BCpR8HvM.js +++ /dev/null @@ -1 +0,0 @@ -import{B as e,V as t,a8 as n,aR as r,at as i,av as a,dD as o,dI as s,da as c,de as l,dg as u,di as d,dk as f,dm as p,do as m,du as h,dy as g,r as _,y as v}from"./index-Bcb2irKh.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b={flex:`~ col gap-4`},x=`volcengine`,S=`v1`;var C=p({__name:`volcengine`,setup(p){let y=s(1),C=v(),w=e(),{providers:T}=r(w),{t:E}=n(),D=c({get:()=>(T.value[x]?.app)?.appId||``,set:e=>{T.value[x]||(T.value[x]={}),T.value[x].app={appId:e}}}),O=c(()=>!!T.value[x]?.apiKey),k=c(()=>C.availableVoices[x]||[]);async function A(e,t,n){let r=await w.getProviderInstance(x);if(!r)throw Error(`Failed to initialize speech provider`);let i=w.getProviderConfig(x),a=i.model||S;return await C.speech(r,a,e,t,{...i})}return f(async()=>{let e=w.getProviderConfig(x),t=w.getProviderMetadata(x);await t.validators.validateProviderConfig(e)?await C.loadVoicesForProvider(x):console.error(`Failed to validate provider config`,e)}),u(y,async()=>{let e=w.getProviderConfig(x);e.audio||={},e.audio.speedRatio=y.value}),u([T,D],async()=>{let e=w.getProviderConfig(x),t=w.getProviderMetadata(x);await t.validators.validateProviderConfig(e)?await C.loadVoicesForProvider(x):console.error(`Failed to validate provider config`,e)},{immediate:!0}),(e,n)=>(d(),g(o(_),{"provider-id":x,"default-model":S},{"basic-settings":m(()=>[h(`div`,b,[l(o(a),{modelValue:D.value,"onUpdate:modelValue":n[0]||=e=>D.value=e,label:o(E)(`settings.pages.providers.provider.volcengine.fields.field.appId.label`),description:o(E)(`settings.pages.providers.provider.volcengine.fields.field.appId.description`),required:``},null,8,[`modelValue`,`label`,`description`])])]),"voice-settings":m(()=>[l(o(i),{modelValue:y.value,"onUpdate:modelValue":n[1]||=e=>y.value=e,label:o(E)(`settings.pages.providers.provider.common.fields.field.speed.label`),description:o(E)(`settings.pages.providers.provider.common.fields.field.speed.description`),min:.5,max:2,step:.01},null,8,[`modelValue`,`label`,`description`])]),playground:m(()=>[l(o(t),{"available-voices":k.value,"generate-speech":A,"api-key-configured":O.value,"default-text":`Hello! This is a test of the ElevenLabs voice synthesis.`},null,8,[`available-voices`,`api-key-configured`])]),_:1}))}});typeof y==`function`&&y(C);var w=C;export{w as default}; \ No newline at end of file diff --git a/assets/volcengine-XpwUu7NL.js b/assets/volcengine-XpwUu7NL.js new file mode 100644 index 0000000000000000000000000000000000000000..b699b5f7783724dd3266eade10868698714ed91e --- /dev/null +++ b/assets/volcengine-XpwUu7NL.js @@ -0,0 +1 @@ +import{B as e,V as t,a8 as n,aR as r,at as i,av as a,d6 as o,d8 as s,dF as c,dK as l,de as u,di as d,dp as f,dt as p,dv as m,dx as h,dz as g,r as _,y as v}from"./index-TXtvn0DM.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b={flex:`~ col gap-4`},x=`volcengine`,S=`v1`;var C=o({__name:`volcengine`,setup(o){let y=l(1),C=v(),w=e(),{providers:T}=r(w),{t:E}=n(),D=f({get:()=>(T.value[x]?.app)?.appId||``,set:e=>{T.value[x]||(T.value[x]={}),T.value[x].app={appId:e}}}),O=f(()=>!!T.value[x]?.apiKey),k=f(()=>C.availableVoices[x]||[]);async function A(e,t,n){let r=await w.getProviderInstance(x);if(!r)throw Error(`Failed to initialize speech provider`);let i=w.getProviderConfig(x),a=i.model||S;return await C.speech(r,a,e,t,{...i})}return g(async()=>{let e=w.getProviderConfig(x),t=w.getProviderMetadata(x);await t.validators.validateProviderConfig(e)?await C.loadVoicesForProvider(x):console.error(`Failed to validate provider config`,e)}),m(y,async()=>{let e=w.getProviderConfig(x);e.audio||={},e.audio.speedRatio=y.value}),m([T,D],async()=>{let e=w.getProviderConfig(x),t=w.getProviderMetadata(x);await t.validators.validateProviderConfig(e)?await C.loadVoicesForProvider(x):console.error(`Failed to validate provider config`,e)},{immediate:!0}),(e,n)=>(h(),d(c(_),{"provider-id":x,"default-model":S},{"basic-settings":s(()=>[u(`div`,b,[p(c(a),{modelValue:D.value,"onUpdate:modelValue":n[0]||=e=>D.value=e,label:c(E)(`settings.pages.providers.provider.volcengine.fields.field.appId.label`),description:c(E)(`settings.pages.providers.provider.volcengine.fields.field.appId.description`),required:``},null,8,[`modelValue`,`label`,`description`])])]),"voice-settings":s(()=>[p(c(i),{modelValue:y.value,"onUpdate:modelValue":n[1]||=e=>y.value=e,label:c(E)(`settings.pages.providers.provider.common.fields.field.speed.label`),description:c(E)(`settings.pages.providers.provider.common.fields.field.speed.description`),min:.5,max:2,step:.01},null,8,[`modelValue`,`label`,`description`])]),playground:s(()=>[p(c(t),{"available-voices":k.value,"generate-speech":A,"api-key-configured":O.value,"default-text":`Hello! This is a test of the ElevenLabs voice synthesis.`},null,8,[`available-voices`,`api-key-configured`])]),_:1}))}});typeof y==`function`&&y(C);var w=C;export{w as default}; \ No newline at end of file diff --git a/assets/xai-Bt7XTBFn.js b/assets/xai-Bt7XTBFn.js deleted file mode 100644 index c75940939e043e941486a9ca959d443b824ff166..0000000000000000000000000000000000000000 --- a/assets/xai-Bt7XTBFn.js +++ /dev/null @@ -1 +0,0 @@ -import{B as e,a3 as t,a4 as n,a5 as r,a6 as i,a7 as a,a8 as o,a9 as s,aM as c,aR as l,dD as u,da as d,de as f,dg as p,di as m,dk as h,dm as g,do as _,dy as v}from"./index-Bcb2irKh.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b=`xai`;var x=g({__name:`xai`,setup(g){let{t:y}=o(),x=c(),S=e(),{providers:C}=l(S),w=d(()=>S.getProviderMetadata(b)),T=d({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=d({get:()=>C.value[b]?.baseUrl||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});h(()=>{S.initializeProvider(b),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||``}),p([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||``}});function D(){C.value[b]={...w.value?.defaultOptions}}return(e,o)=>(m(),v(u(t),{"provider-name":w.value?.localizedName,"provider-icon":w.value?.icon,"on-back":()=>u(x).back()},{default:_(()=>[f(u(n),null,{default:_(()=>[f(u(r),{title:u(y)(`settings.pages.providers.common.section.basic.title`),description:u(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:_(()=>[f(u(a),{modelValue:T.value,"onUpdate:modelValue":o[0]||=e=>T.value=e,"provider-name":w.value?.localizedName,placeholder:`xai-...`},null,8,[`modelValue`,`provider-name`])]),_:1},8,[`title`,`description`]),f(u(s),{title:u(y)(`settings.pages.providers.common.section.advanced.title`)},{default:_(()=>[f(u(i),{modelValue:E.value,"onUpdate:modelValue":o[1]||=e=>E.value=e,placeholder:`https://api.x.ai/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`]))}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file diff --git a/assets/xai-CxK8L2y1.js b/assets/xai-CxK8L2y1.js new file mode 100644 index 0000000000000000000000000000000000000000..a3cb18dbe183ef44fa91d36f066012da24d1a8dc --- /dev/null +++ b/assets/xai-CxK8L2y1.js @@ -0,0 +1 @@ +import{B as e,a3 as t,a4 as n,a5 as r,a6 as i,a7 as a,a8 as o,a9 as s,aM as c,aR as l,d6 as u,d8 as d,dF as f,di as p,dp as m,dt as h,dv as g,dx as _,dz as v}from"./index-TXtvn0DM.js";import{b as y}from"./route-block-DVyt-3Cw.js";const b=`xai`;var x=u({__name:`xai`,setup(u){let{t:y}=o(),x=c(),S=e(),{providers:C}=l(S),w=m(()=>S.getProviderMetadata(b)),T=m({get:()=>C.value[b]?.apiKey||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].apiKey=e}}),E=m({get:()=>C.value[b]?.baseUrl||``,set:e=>{C.value[b]||(C.value[b]={}),C.value[b].baseUrl=e}});v(()=>{S.initializeProvider(b),T.value=C.value[b]?.apiKey||``,E.value=C.value[b]?.baseUrl||``}),g([T,E],()=>{C.value[b]={...C.value[b],apiKey:T.value,baseUrl:E.value||``}});function D(){C.value[b]={...w.value?.defaultOptions}}return(e,o)=>(_(),p(f(t),{"provider-name":w.value?.localizedName,"provider-icon":w.value?.icon,"on-back":()=>f(x).back()},{default:d(()=>[h(f(n),null,{default:d(()=>[h(f(r),{title:f(y)(`settings.pages.providers.common.section.basic.title`),description:f(y)(`settings.pages.providers.common.section.basic.description`),"on-reset":D},{default:d(()=>[h(f(a),{modelValue:T.value,"onUpdate:modelValue":o[0]||=e=>T.value=e,"provider-name":w.value?.localizedName,placeholder:`xai-...`},null,8,[`modelValue`,`provider-name`])]),_:1},8,[`title`,`description`]),h(f(s),{title:f(y)(`settings.pages.providers.common.section.advanced.title`)},{default:d(()=>[h(f(i),{modelValue:E.value,"onUpdate:modelValue":o[1]||=e=>E.value=e,placeholder:`https://api.x.ai/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`])]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`on-back`]))}});typeof y==`function`&&y(x);var S=x;export{S as default}; \ No newline at end of file diff --git a/assets/zod-CD8IEU5z-Csep__xj.js b/assets/zod-CD8IEU5z-DbMl9YTb.js similarity index 70% rename from assets/zod-CD8IEU5z-Csep__xj.js rename to assets/zod-CD8IEU5z-DbMl9YTb.js index 26dc8fa41ca28f6a50aa85f8e3a0716f3c88654e..528d33616bd308d17f6806edf0f1db6dd2a0f098 100644 --- a/assets/zod-CD8IEU5z-Csep__xj.js +++ b/assets/zod-CD8IEU5z-DbMl9YTb.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/esm-lKof8WUt.js","assets/index-Bcb2irKh.js","assets/index-DdvhN8Iu.css"])))=>i.map(i=>d[i]); -import{E as e,aQ as t}from"./index-Bcb2irKh.js";const n=async()=>{let n=t=>{throw Error(`xsschema: Missing zod v4 dependencies "zod". see ${e}`)},r=t=>{throw Error(`xsschema: Missing zod v3 dependencies "zod-to-json-schema". see ${e}`)};try{let{toJSONSchema:e}=await t(async()=>{let{toJSONSchema:e}=await import(`./core-Bo_5D72p.js`);return{toJSONSchema:e}},[]);n=e}catch(e){e instanceof Error&&console.error(e.message)}try{let{zodToJsonSchema:e}=await t(async()=>{let{zodToJsonSchema:e}=await import(`./esm-lKof8WUt.js`);return{zodToJsonSchema:e}},__vite__mapDeps([0,1,2]));r=e}catch(e){e instanceof Error&&console.error(e.message)}return async e=>`_zod`in e?n(e):r(e)};export{n as getToJsonSchemaFn}; \ No newline at end of file +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/esm-4AUyG2HJ.js","assets/index-TXtvn0DM.js","assets/index-DdvhN8Iu.css"])))=>i.map(i=>d[i]); +import{E as e,aQ as t}from"./index-TXtvn0DM.js";const n=async()=>{let n=t=>{throw Error(`xsschema: Missing zod v4 dependencies "zod". see ${e}`)},r=t=>{throw Error(`xsschema: Missing zod v3 dependencies "zod-to-json-schema". see ${e}`)};try{let{toJSONSchema:e}=await t(async()=>{let{toJSONSchema:e}=await import(`./core-Bo_5D72p.js`);return{toJSONSchema:e}},[]);n=e}catch(e){e instanceof Error&&console.error(e.message)}try{let{zodToJsonSchema:e}=await t(async()=>{let{zodToJsonSchema:e}=await import(`./esm-4AUyG2HJ.js`);return{zodToJsonSchema:e}},__vite__mapDeps([0,1,2]));r=e}catch(e){e instanceof Error&&console.error(e.message)}return async e=>`_zod`in e?n(e):r(e)};export{n as getToJsonSchemaFn}; \ No newline at end of file diff --git a/index.html b/index.html index 87ba0497271c28cfdd8040814a36fa5be8e930c1..744994b2d48a0cc8a84498013c5adfe5913306c5 100644 --- a/index.html +++ b/index.html @@ -32,7 +32,7 @@ src="/remote-assets/page-external-data/js/script.js" > - + diff --git a/sw.js b/sw.js index 3b07cb9d9ec6d5d12614e042165c7f6030f282ec..ebfe23dc31b8176dd23c46ea1f4e072561eff09f 100644 --- a/sw.js +++ b/sw.js @@ -1 +1 @@ -if(!self.define){let s,e={};const l=(l,r)=>(l=new URL(l+".js",r).href,e[l]||new Promise(e=>{if("document"in self){const s=document.createElement("script");s.src=l,s.onload=e,document.head.appendChild(s)}else s=l,importScripts(l),e()}).then(()=>{let s=e[l];if(!s)throw new Error(`Module ${l} didn’t register its module`);return s}));self.define=(r,i)=>{const n=s||("document"in self?document.currentScript.src:"")||location.href;if(e[n])return;let u={};const o=s=>l(s,n),a={module:{uri:n},exports:u,require:o};e[n]=Promise.all(r.map(s=>a[s]||o(s))).then(s=>(i(...s),u))}}define(["./workbox-3aa584b4"],function(s){"use strict";self.skipWaiting(),s.clientsClaim(),s.precacheAndRoute([{url:"assets/__vite-browser-external-hz9OYH6e.js",revision:null},{url:"assets/__vite-optional-peer-dep_effect_xsschema-CXIfmAu1.js",revision:null},{url:"assets/__vite-optional-peer-dep_sury_xsschema-DBCftJAj.js",revision:null},{url:"assets/_...all_-gC8Dl7gs.js",revision:null},{url:"assets/airi-card-B7ZfdDe0.js",revision:null},{url:"assets/alibaba-cloud-model-studio-DlNMnmqi.js",revision:null},{url:"assets/AnimatedWave-Co1wJ2Kd.js",revision:null},{url:"assets/AnimatedWave-D0GIVVa8.css",revision:null},{url:"assets/anthropic-B7BAJgzg.js",revision:null},{url:"assets/appearance-DYPH8hMh.js",revision:null},{url:"assets/arktype-C-GObzDh-DWDEUAMn.js",revision:null},{url:"assets/audio-record-CqOfJMhf.js",revision:null},{url:"assets/audio-XSIo9MwQ.js",revision:null},{url:"assets/azure-ai-foundry-DlZ-mKi2.js",revision:null},{url:"assets/background-remove-BIlLHheK.js",revision:null},{url:"assets/Basic-BIq-Of0k.js",revision:null},{url:"assets/browser-CJhr0Svl.js",revision:null},{url:"assets/browser-CoZYwbon.js",revision:null},{url:"assets/CardCreate-B9UkMPmr.js",revision:null},{url:"assets/CardCreate-DUt9F6Lp.js",revision:null},{url:"assets/CardCreationDialog-C2t6nzce.js",revision:null},{url:"assets/CardCreationDialog-CG2KLbdk.css",revision:null},{url:"assets/CardCreationDialog-vXdEoAe9.js",revision:null},{url:"assets/CardDetailDialog-C5NS6yu5.js",revision:null},{url:"assets/CardDetailDialog-PAuW-O48.js",revision:null},{url:"assets/CardListItem-B_X4U4tj.js",revision:null},{url:"assets/CardListItem-Zshbg3UA.js",revision:null},{url:"assets/chat-mNT9qYfI.js",revision:null},{url:"assets/cloudflare-workers-ai-CoptsH2G.js",revision:null},{url:"assets/color-scheme-B8QUMGKo.js",revision:null},{url:"assets/color-scheme-ZSHYHslH.css",revision:null},{url:"assets/consciousness-Bsx6qnki.js",revision:null},{url:"assets/core-Bo_5D72p.js",revision:null},{url:"assets/deepseek-Bq3V0xqj.js",revision:null},{url:"assets/default-browser-BsyDD-mc.js",revision:null},{url:"assets/default-DP_2zDq7.js",revision:null},{url:"assets/default-node-BiFBkIjL.js",revision:null},{url:"assets/delays-DOX4ZLru.js",revision:null},{url:"assets/DeleteCardDialog-CfSwu3w5.js",revision:null},{url:"assets/DeleteCardDialog-Cmxl4b8s.js",revision:null},{url:"assets/developer-C3KwNa46.js",revision:null},{url:"assets/dist-CshDQrOa.js",revision:null},{url:"assets/duckdb-browser-coi.pthread.worker-WD1J30pV.js",revision:null},{url:"assets/duckdb-browser-coi.worker-Ji2I_m5s.js",revision:null},{url:"assets/duckdb-browser-eh.worker-B2xnDV1H.js",revision:null},{url:"assets/duckdb-browser-mvp.worker-DCs3_EjR.js",revision:null},{url:"assets/duckdb-coi-CSr8FQO4.wasm",revision:null},{url:"assets/duckdb-eh-BJOC5S4x.wasm",revision:null},{url:"assets/duckdb-mvp-1eM9E9sB.js",revision:null},{url:"assets/duckdb-mvp-8HYqhb4i.wasm",revision:null},{url:"assets/effect-DBSVVF8G-CQ9lBH7Y.js",revision:null},{url:"assets/elevenlabs-BGkmS224.js",revision:null},{url:"assets/emotions-BijqzfJR.js",revision:null},{url:"assets/esm-lKof8WUt.js",revision:null},{url:"assets/featherless-ai-CQeyDKta.js",revision:null},{url:"assets/filter-message-lb-XLsxJ.js",revision:null},{url:"assets/fireworks-ai-nFwpsnmc.js",revision:null},{url:"assets/general-Ct2fynUz.js",revision:null},{url:"assets/gesture-circle-_WCnPwKn.js",revision:null},{url:"assets/google-generative-ai-DozYAQuF.js",revision:null},{url:"assets/HeaderLink-BvOcNkh0.js",revision:null},{url:"assets/HeaderLink-Bxs3yYEi.css",revision:null},{url:"assets/hearing-B6PhAbYO.js",revision:null},{url:"assets/home-D7dZM1bj.js",revision:null},{url:"assets/icon-animation-aqma-gkh.js",revision:null},{url:"assets/IconAnimation-BSHXCi3V.js",revision:null},{url:"assets/image-BhuwcwI9.css",revision:null},{url:"assets/image-BLItfOAt.js",revision:null},{url:"assets/import-url-browser-CkMcxt8_.js",revision:null},{url:"assets/import-url-browser-CzbE4_30.js",revision:null},{url:"assets/import-url-node-DmUEwuAI.js",revision:null},{url:"assets/index-Bcb2irKh.js",revision:null},{url:"assets/index-DdvhN8Iu.css",revision:null},{url:"assets/InputFile-DaDBm_4w.js",revision:null},{url:"assets/js/CubismSdkForWeb-5-r.3/Core/live2dcubismcore.min.js",revision:null},{url:"assets/memory-DF7fLUfS.js",revision:null},{url:"assets/memory-long-term-D5MNuhrd.js",revision:null},{url:"assets/memory-short-term-BfW329Pe.js",revision:null},{url:"assets/messages-COyeBtk8.js",revision:null},{url:"assets/microsoft-speech-DXgisB08.js",revision:null},{url:"assets/mistral-ai-C6OsPDG6.js",revision:null},{url:"assets/models-CxyqeYFq.js",revision:null},{url:"assets/modules-C3lme1kU.js",revision:null},{url:"assets/moonshot-ai-Cq0Bgk3R.js",revision:null},{url:"assets/novita-ai-BOoelGDv.js",revision:null},{url:"assets/ollama-YEZZT8Xd.js",revision:null},{url:"assets/openai-audio-speech-gALEgqPK.js",revision:null},{url:"assets/openai-audio-transcription-CdjYX-O2.js",revision:null},{url:"assets/openai-qf_j7gBp.js",revision:null},{url:"assets/openrouter-ai-BFMtPxJ7.js",revision:null},{url:"assets/ort-wasm-simd-threaded.jsep-B0T3yYHD.wasm",revision:null},{url:"assets/pages-CqvY_QyT.js",revision:null},{url:"assets/plain-rPj2okum.js",revision:null},{url:"assets/player2-BEEn9lAM.js",revision:null},{url:"assets/player2-speech-bBMC5JEe.js",revision:null},{url:"assets/polaroid-CgtEjW36.js",revision:null},{url:"assets/process.worklet-CF6Ao8XG.js",revision:null},{url:"assets/providers-DsrU6JIK.js",revision:null},{url:"assets/queue-ljfYlK6R.js",revision:null},{url:"assets/route-block-DVyt-3Cw.js",revision:null},{url:"assets/scene-Cp8LoaVN.js",revision:null},{url:"assets/Scenes-ELpQ5xkP.js",revision:null},{url:"assets/settings-CdksUo4j.js",revision:null},{url:"assets/settings-DIR2jMir.js",revision:null},{url:"assets/speech-CHsV5f2H.js",revision:null},{url:"assets/stage-DR-1n1Ev.js",revision:null},{url:"assets/stage-Skn6SMJV.js",revision:null},{url:"assets/sury-GtnkadyM-_VCptIFV.js",revision:null},{url:"assets/Textarea-BFPvaePN.js",revision:null},{url:"assets/theme-color-C-tbz8cx.js",revision:null},{url:"assets/together-ai-CyEYaNHN.js",revision:null},{url:"assets/transformers.web-CQlzVquP.js",revision:null},{url:"assets/valibot-CbgwcZn_-C2Mxz5DO.js",revision:null},{url:"assets/vibrant-Cd0ESToT.js",revision:null},{url:"assets/volcengine-BCpR8HvM.js",revision:null},{url:"assets/worker-Bv82ofgX.js",revision:null},{url:"assets/xai-Bt7XTBFn.js",revision:null},{url:"assets/zod-CD8IEU5z-Csep__xj.js",revision:null},{url:"index.html",revision:"5b7d7942c5e48267d8fcf364b15a5037"},{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"apple-touch-icon.png",revision:"b41f3c1ba3c98364c640fe2b7348bd39"},{url:"favicon.svg",revision:"47d50a7bc31b26d14f3895982906935f"},{url:"maskable_icon_x192.png",revision:"a6ed025fb1491e8b498c9f4c0064d190"},{url:"maskable_icon_x512.png",revision:"b7b2c2d9bda88c74a295695c8a0e7468"},{url:"web-app-manifest-192x192.png",revision:"c9731148ea6befa78a495f63536c82eb"},{url:"web-app-manifest-512x512.png",revision:"bcae855d5ff588b682314fe1c6e530f0"},{url:"manifest.webmanifest",revision:"0a5a207cc5b76af4bd35f0b587dd1902"}],{}),s.cleanupOutdatedCaches(),s.registerRoute(new s.NavigationRoute(s.createHandlerBoundToURL("index.html"),{denylist:[/^\/docs\//,/^\/ui\//,/^\/remote-assets\//,/^\/api\//]}))}); +if(!self.define){let s,e={};const l=(l,r)=>(l=new URL(l+".js",r).href,e[l]||new Promise(e=>{if("document"in self){const s=document.createElement("script");s.src=l,s.onload=e,document.head.appendChild(s)}else s=l,importScripts(l),e()}).then(()=>{let s=e[l];if(!s)throw new Error(`Module ${l} didn’t register its module`);return s}));self.define=(r,i)=>{const n=s||("document"in self?document.currentScript.src:"")||location.href;if(e[n])return;let u={};const o=s=>l(s,n),a={module:{uri:n},exports:u,require:o};e[n]=Promise.all(r.map(s=>a[s]||o(s))).then(s=>(i(...s),u))}}define(["./workbox-3aa584b4"],function(s){"use strict";self.skipWaiting(),s.clientsClaim(),s.precacheAndRoute([{url:"assets/__vite-browser-external-C1t5aXtc.js",revision:null},{url:"assets/__vite-optional-peer-dep_effect_xsschema-CXIfmAu1.js",revision:null},{url:"assets/__vite-optional-peer-dep_sury_xsschema-DBCftJAj.js",revision:null},{url:"assets/_...all_-FwJQpnSo.js",revision:null},{url:"assets/airi-card-BDbpb8YI.js",revision:null},{url:"assets/alibaba-cloud-model-studio-CKp1Z1Ta.js",revision:null},{url:"assets/AnimatedWave-1XImhiJl.js",revision:null},{url:"assets/AnimatedWave-D0GIVVa8.css",revision:null},{url:"assets/anthropic-CEBNe0YC.js",revision:null},{url:"assets/appearance-CF2ZynHB.js",revision:null},{url:"assets/arktype-C-GObzDh-DWDEUAMn.js",revision:null},{url:"assets/audio-BBLd3epQ.js",revision:null},{url:"assets/audio-record-DIcCrdh3.js",revision:null},{url:"assets/azure-ai-foundry-Bkkz_TjR.js",revision:null},{url:"assets/background-remove-CaMBEs_t.js",revision:null},{url:"assets/Basic-8xhCMoI8.js",revision:null},{url:"assets/browser-CJhr0Svl.js",revision:null},{url:"assets/browser-CoZYwbon.js",revision:null},{url:"assets/CardCreate-BnBq88i7.js",revision:null},{url:"assets/CardCreate-Cwl18tMa.js",revision:null},{url:"assets/CardCreationDialog-CG2KLbdk.css",revision:null},{url:"assets/CardCreationDialog-DBoOEet-.js",revision:null},{url:"assets/CardCreationDialog-DNJ23ym3.js",revision:null},{url:"assets/CardDetailDialog-CTqSCcym.js",revision:null},{url:"assets/CardDetailDialog-DrRzlnwS.js",revision:null},{url:"assets/CardListItem-B9_yTni-.js",revision:null},{url:"assets/CardListItem-DeblkTcG.js",revision:null},{url:"assets/chat-DXU-idBw.js",revision:null},{url:"assets/cloudflare-workers-ai-Di_IJhvu.js",revision:null},{url:"assets/color-scheme-DVge0MdZ.js",revision:null},{url:"assets/color-scheme-ZSHYHslH.css",revision:null},{url:"assets/consciousness-BZ0UAvpf.js",revision:null},{url:"assets/core-Bo_5D72p.js",revision:null},{url:"assets/deepseek-CROq3FT6.js",revision:null},{url:"assets/default-browser-BsyDD-mc.js",revision:null},{url:"assets/default-dHnBRBVa.js",revision:null},{url:"assets/default-node-BI20WiOb.js",revision:null},{url:"assets/delays-tYDkCeIB.js",revision:null},{url:"assets/DeleteCardDialog-Db_k2voK.js",revision:null},{url:"assets/DeleteCardDialog-DeUARo5-.js",revision:null},{url:"assets/developer-DlN6BLxq.js",revision:null},{url:"assets/dist-CshDQrOa.js",revision:null},{url:"assets/duckdb-browser-coi.pthread.worker-WD1J30pV.js",revision:null},{url:"assets/duckdb-browser-coi.worker-Ji2I_m5s.js",revision:null},{url:"assets/duckdb-browser-eh.worker-B2xnDV1H.js",revision:null},{url:"assets/duckdb-browser-mvp.worker-DCs3_EjR.js",revision:null},{url:"assets/duckdb-coi-CSr8FQO4.wasm",revision:null},{url:"assets/duckdb-eh-BJOC5S4x.wasm",revision:null},{url:"assets/duckdb-mvp-1eM9E9sB.js",revision:null},{url:"assets/duckdb-mvp-8HYqhb4i.wasm",revision:null},{url:"assets/effect-DBSVVF8G-DSdeZPIg.js",revision:null},{url:"assets/elevenlabs-DBr8vpGg.js",revision:null},{url:"assets/emotions-DpXE-YF0.js",revision:null},{url:"assets/esm-4AUyG2HJ.js",revision:null},{url:"assets/featherless-ai-D0EyBsme.js",revision:null},{url:"assets/filter-message-BWzou1ED.js",revision:null},{url:"assets/fireworks-ai-UvXpnZ_T.js",revision:null},{url:"assets/general-B5ZCNzAX.js",revision:null},{url:"assets/gesture-circle-BcNJ-k8_.js",revision:null},{url:"assets/google-generative-ai-up4rXKy8.js",revision:null},{url:"assets/HeaderLink-BMtWjY7k.js",revision:null},{url:"assets/HeaderLink-Bxs3yYEi.css",revision:null},{url:"assets/hearing-Xas1IMB8.js",revision:null},{url:"assets/home-CtQR04tF.js",revision:null},{url:"assets/icon-animation-Tj7r0tub.js",revision:null},{url:"assets/IconAnimation-Cx_ji59L.js",revision:null},{url:"assets/image-BhuwcwI9.css",revision:null},{url:"assets/image-Y0D9IcSN.js",revision:null},{url:"assets/import-url-browser-CkMcxt8_.js",revision:null},{url:"assets/import-url-browser-CzbE4_30.js",revision:null},{url:"assets/import-url-node-DmUEwuAI.js",revision:null},{url:"assets/index-DdvhN8Iu.css",revision:null},{url:"assets/index-TXtvn0DM.js",revision:null},{url:"assets/InputFile-BduVApi9.js",revision:null},{url:"assets/js/CubismSdkForWeb-5-r.3/Core/live2dcubismcore.min.js",revision:null},{url:"assets/memory-CxpzfPsV.js",revision:null},{url:"assets/memory-long-term-g3FFPLwk.js",revision:null},{url:"assets/memory-short-term-BGQrHIiR.js",revision:null},{url:"assets/messages-BQuV_Wj8.js",revision:null},{url:"assets/microsoft-speech-BY2LoVCU.js",revision:null},{url:"assets/mistral-ai-D39sepT1.js",revision:null},{url:"assets/models-CGf69gF5.js",revision:null},{url:"assets/modules-DOiXOO9v.js",revision:null},{url:"assets/moonshot-ai-CTozCMSf.js",revision:null},{url:"assets/novita-ai-dw27Ts63.js",revision:null},{url:"assets/ollama-tQHRYGgL.js",revision:null},{url:"assets/openai-audio-speech-BkZ6fMPR.js",revision:null},{url:"assets/openai-audio-transcription-DB_zNBWO.js",revision:null},{url:"assets/openai-Dpz_1L0T.js",revision:null},{url:"assets/openrouter-ai-nUDctjfq.js",revision:null},{url:"assets/ort-wasm-simd-threaded.jsep-B0T3yYHD.wasm",revision:null},{url:"assets/pages-DqJj8AHh.js",revision:null},{url:"assets/plain--3dPFSjT.js",revision:null},{url:"assets/player2-BMI1LzL_.js",revision:null},{url:"assets/player2-speech-Dr2qPb6l.js",revision:null},{url:"assets/polaroid-CpEbVTFH.js",revision:null},{url:"assets/process.worklet-CF6Ao8XG.js",revision:null},{url:"assets/providers-B5wbeFJM.js",revision:null},{url:"assets/queue-B4yd_q6Y.js",revision:null},{url:"assets/route-block-DVyt-3Cw.js",revision:null},{url:"assets/scene-CkCOD6hR.js",revision:null},{url:"assets/Scenes-D6JBpdgW.js",revision:null},{url:"assets/settings-BKVfWP0V.js",revision:null},{url:"assets/settings-Dx_-xTvm.js",revision:null},{url:"assets/speech-KhxwETXc.js",revision:null},{url:"assets/stage-Bsg2THie.js",revision:null},{url:"assets/stage-kAQNRdiU.js",revision:null},{url:"assets/sury-GtnkadyM-C_RygoD3.js",revision:null},{url:"assets/Textarea-BsLlwm-1.js",revision:null},{url:"assets/theme-color-CrZYT1IJ.js",revision:null},{url:"assets/together-ai-06SXbXqA.js",revision:null},{url:"assets/transformers.web-7B3It45j.js",revision:null},{url:"assets/valibot-CbgwcZn_-kvK6hLPP.js",revision:null},{url:"assets/vibrant-CGg8wx9d.js",revision:null},{url:"assets/volcengine-XpwUu7NL.js",revision:null},{url:"assets/worker-Bv82ofgX.js",revision:null},{url:"assets/xai-CxK8L2y1.js",revision:null},{url:"assets/zod-CD8IEU5z-DbMl9YTb.js",revision:null},{url:"index.html",revision:"1a64f022f004b3ae9adb5a5f890e21d9"},{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"apple-touch-icon.png",revision:"b41f3c1ba3c98364c640fe2b7348bd39"},{url:"favicon.svg",revision:"47d50a7bc31b26d14f3895982906935f"},{url:"maskable_icon_x192.png",revision:"a6ed025fb1491e8b498c9f4c0064d190"},{url:"maskable_icon_x512.png",revision:"b7b2c2d9bda88c74a295695c8a0e7468"},{url:"web-app-manifest-192x192.png",revision:"c9731148ea6befa78a495f63536c82eb"},{url:"web-app-manifest-512x512.png",revision:"bcae855d5ff588b682314fe1c6e530f0"},{url:"manifest.webmanifest",revision:"0a5a207cc5b76af4bd35f0b587dd1902"}],{}),s.cleanupOutdatedCaches(),s.registerRoute(new s.NavigationRoute(s.createHandlerBoundToURL("index.html"),{denylist:[/^\/docs\//,/^\/ui\//,/^\/remote-assets\//,/^\/api\//]}))});