diff --git a/assets/CardListItem-CRpic1C1.js b/assets/CardListItem-CRpic1C1.js new file mode 100644 index 0000000000000000000000000000000000000000..fe8e963856647f3cfccf6b73a58205b82606c140 --- /dev/null +++ b/assets/CardListItem-CRpic1C1.js @@ -0,0 +1 @@ +import"./widgets-C0YByt49.js";import"./src-DYQXbDgu.js";import"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import"./components-CeE-UiLT.js";import"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-73vyHOZs.js";import"./__vite-browser-external-BaycPy5b.js";import{t as e}from"./CardListItem-D0jnzgCC.js";export{e as default}; \ No newline at end of file diff --git a/assets/CardListItem-CbOMiA5T.js b/assets/CardListItem-CbOMiA5T.js deleted file mode 100644 index aaad9b774a9467b0d1291e4e3e2dfa91d388fa18..0000000000000000000000000000000000000000 --- a/assets/CardListItem-CbOMiA5T.js +++ /dev/null @@ -1 +0,0 @@ -import"./widgets-CZ9Rvki9.js";import"./src-DYQXbDgu.js";import"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import"./components-BR_Kqwtu.js";import"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-D1kLcsvA.js";import"./__vite-browser-external-BaycPy5b.js";import{t as e}from"./CardListItem-CyBP3HUt.js";export{e as default}; \ No newline at end of file diff --git a/assets/CardListItem-CyBP3HUt.js b/assets/CardListItem-D0jnzgCC.js similarity index 98% rename from assets/CardListItem-CyBP3HUt.js rename to assets/CardListItem-D0jnzgCC.js index 14e0f11866a69ed9fb1fd8fd3835ae18e05dd8f9..ea14cf0b0bac1d17191b484d1bb324333ed0bd2c 100644 --- a/assets/CardListItem-CyBP3HUt.js +++ b/assets/CardListItem-D0jnzgCC.js @@ -1 +1 @@ -import{A as e,C as t,K as n,Pt as r,S as i,f as a,jt as o,kt as s,lt as c,w as l,x as u}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import{$ as d}from"./components-BR_Kqwtu.js";var 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`],C=e({__name:`CardListItem`,props:{id:{},name:{},description:{},isActive:{type:Boolean},isSelected:{type:Boolean},version:{},consciousnessModel:{},voiceModel:{}},emits:[`select`,`activate`,`delete`],setup(e,{emit:C}){let w=C;return(C,T)=>(n(),i(s(d),{relative:``,"min-h-120px":``,flex:`~ col`,"cursor-pointer":``,"overflow-hidden":``,"rounded-xl":``,class:o([e.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:T[2]||=e=>w(`select`)},{default:c(()=>[u(`div`,f,[u(`div`,p,[u(`h3`,m,r(e.name),1),e.isActive?(n(),l(`div`,h,[...T[3]||=[u(`div`,{"i-solar:check-circle-bold-duotone":``,"text-sm":``},null,-1)]])):t(``,!0)]),e.description?(n(),l(`p`,g,r(e.description),1)):t(``,!0),u(`div`,_,[u(`div`,null,`v`+r(e.version),1),u(`div`,v,[u(`div`,y,[T[4]||=u(`div`,{"i-lucide:ghost":``,"text-xs":``},null,-1),u(`span`,null,r(e.consciousnessModel),1)]),u(`div`,b,[T[5]||=u(`div`,{"i-lucide:mic":``,"text-xs":``},null,-1),u(`span`,null,r(e.voiceModel),1)])])])]),u(`div`,x,[u(`button`,{"rounded-lg":``,"p-1.5":``,"transition-colors":``,hover:`bg-neutral-200 dark:bg-neutral-700/50`,disabled:e.isActive,onClick:T[0]||=a(e=>w(`activate`),[`stop`])},[u(`div`,{class:o([e.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),e.id===`default`?t(``,!0):(n(),l(`button`,{key:0,"rounded-lg":``,"p-1.5":``,"transition-colors":``,hover:`bg-neutral-200 dark:bg-neutral-700/50`,onClick:T[1]||=a(e=>w(`delete`),[`stop`])},[...T[6]||=[u(`div`,{"i-solar:trash-bin-trash-linear":``,text:`neutral-500 dark:neutral-400`},null,-1)]]))])]),_:1},8,[`class`]))}});export{C as t}; \ No newline at end of file +import{A as e,C as t,K as n,Pt as r,S as i,f as a,jt as o,kt as s,lt as c,w as l,x as u}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import{$ as d}from"./components-CeE-UiLT.js";var 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`],C=e({__name:`CardListItem`,props:{id:{},name:{},description:{},isActive:{type:Boolean},isSelected:{type:Boolean},version:{},consciousnessModel:{},voiceModel:{}},emits:[`select`,`activate`,`delete`],setup(e,{emit:C}){let w=C;return(C,T)=>(n(),i(s(d),{relative:``,"min-h-120px":``,flex:`~ col`,"cursor-pointer":``,"overflow-hidden":``,"rounded-xl":``,class:o([e.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:T[2]||=e=>w(`select`)},{default:c(()=>[u(`div`,f,[u(`div`,p,[u(`h3`,m,r(e.name),1),e.isActive?(n(),l(`div`,h,[...T[3]||=[u(`div`,{"i-solar:check-circle-bold-duotone":``,"text-sm":``},null,-1)]])):t(``,!0)]),e.description?(n(),l(`p`,g,r(e.description),1)):t(``,!0),u(`div`,_,[u(`div`,null,`v`+r(e.version),1),u(`div`,v,[u(`div`,y,[T[4]||=u(`div`,{"i-lucide:ghost":``,"text-xs":``},null,-1),u(`span`,null,r(e.consciousnessModel),1)]),u(`div`,b,[T[5]||=u(`div`,{"i-lucide:mic":``,"text-xs":``},null,-1),u(`span`,null,r(e.voiceModel),1)])])])]),u(`div`,x,[u(`button`,{"rounded-lg":``,"p-1.5":``,"transition-colors":``,hover:`bg-neutral-200 dark:bg-neutral-700/50`,disabled:e.isActive,onClick:T[0]||=a(e=>w(`activate`),[`stop`])},[u(`div`,{class:o([e.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),e.id===`default`?t(``,!0):(n(),l(`button`,{key:0,"rounded-lg":``,"p-1.5":``,"transition-colors":``,hover:`bg-neutral-200 dark:bg-neutral-700/50`,onClick:T[1]||=a(e=>w(`delete`),[`stop`])},[...T[6]||=[u(`div`,{"i-solar:trash-bin-trash-linear":``,text:`neutral-500 dark:neutral-400`},null,-1)]]))])]),_:1},8,[`class`]))}});export{C as t}; \ No newline at end of file diff --git a/assets/_providerId_-CIYsM20M.js b/assets/_providerId_-DkkPbN-6.js similarity index 92% rename from assets/_providerId_-CIYsM20M.js rename to assets/_providerId_-DkkPbN-6.js index 9b79670ea4722131caa07ca78be30cbd07a7d775..dc1411cea08880810c7fe6343d6f25dc67460196 100644 --- a/assets/_providerId_-CIYsM20M.js +++ b/assets/_providerId_-DkkPbN-6.js @@ -1 +1 @@ -import{A as e,C as t,E as n,K as r,O as i,Pt as a,S as o,b as s,k as c,kt as l,lt as u,x as d}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-CZ9Rvki9.js";import"./src-DYQXbDgu.js";import{a as f}from"./resettable-CbXzRviW.js";import{a as p}from"./vue-router-Chhv6vZu.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{G as m,J as h,K as g,U as _,W as v,gt as y,q as b}from"./components-BR_Kqwtu.js";import{i as x}from"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-D1kLcsvA.js";import"./__vite-browser-external-BaycPy5b.js";import{t as S}from"./route-block-CpjdOEnv.js";import{t as C}from"./use-provider-validation-DbXr83wX.js";var w={class:`whitespace-pre-wrap break-all`},T=e({__name:`[providerId]`,setup(e){let S=p().params.providerId,{providers:T}=f(x()),E=s({get:()=>T.value[S]?.apiKey||``,set:e=>{T.value[S]||(T.value[S]={}),T.value[S].apiKey=e}}),D=s({get:()=>T.value[S]?.baseUrl||``,set:e=>{T.value[S]||(T.value[S]={}),T.value[S].baseUrl=e}}),{t:O,router:k,providerMetadata:A,isValidating:j,isValid:M,validationMessage:N,handleResetSettings:P}=C(S);return(e,s)=>(r(),o(l(_),{"provider-name":l(A)?.localizedName,"provider-icon-color":l(A)?.iconColor,"on-back":()=>l(k).back()},{default:u(()=>[c(l(v),null,{default:u(()=>[c(l(m),{title:l(O)(`settings.pages.providers.common.section.basic.title`),description:l(O)(`settings.pages.providers.common.section.basic.description`),"on-reset":l(P)},{default:u(()=>[c(l(b),{modelValue:E.value,"onUpdate:modelValue":s[0]||=e=>E.value=e,"provider-name":l(A)?.localizedName,placeholder:`sk-...`},null,8,[`modelValue`,`provider-name`])]),_:1},8,[`title`,`description`,`on-reset`]),c(l(h),{title:l(O)(`settings.pages.providers.common.section.advanced.title`)},{default:u(()=>[c(l(g),{modelValue:D.value,"onUpdate:modelValue":s[1]||=e=>D.value=e,placeholder:l(A)?.defaultOptions?.().baseUrl||`Base URL of your provider`},null,8,[`modelValue`,`placeholder`])]),_:1},8,[`title`]),!l(M)&&l(j)===0&&l(N)?(r(),o(l(y),{key:0,type:`error`},n({title:u(()=>[i(a(l(O)(`settings.dialogs.onboarding.validationFailed`)),1)]),_:2},[l(N)?{name:`content`,fn:u(()=>[d(`div`,w,a(l(N)),1)]),key:`0`}:void 0]),1024)):t(``,!0),l(M)&&l(j)===0?(r(),o(l(y),{key:1,type:`success`},{title:u(()=>[i(a(l(O)(`settings.dialogs.onboarding.validationSuccess`)),1)]),_:1})):t(``,!0)]),_:1})]),_:1},8,[`provider-name`,`provider-icon-color`,`on-back`]))}});typeof S==`function`&&S(T);var E=T;export{E as default}; \ No newline at end of file +import{A as e,C as t,E as n,K as r,O as i,Pt as a,S as o,b as s,k as c,kt as l,lt as u,x as d}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-C0YByt49.js";import"./src-DYQXbDgu.js";import{a as f}from"./resettable-CbXzRviW.js";import{a as p}from"./vue-router-Chhv6vZu.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{G as m,J as h,K as g,U as _,W as v,gt as y,q as b}from"./components-CeE-UiLT.js";import{i as x}from"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-73vyHOZs.js";import"./__vite-browser-external-BaycPy5b.js";import{t as S}from"./route-block-CpjdOEnv.js";import{t as C}from"./use-provider-validation-DbXr83wX.js";var w={class:`whitespace-pre-wrap break-all`},T=e({__name:`[providerId]`,setup(e){let S=p().params.providerId,{providers:T}=f(x()),E=s({get:()=>T.value[S]?.apiKey||``,set:e=>{T.value[S]||(T.value[S]={}),T.value[S].apiKey=e}}),D=s({get:()=>T.value[S]?.baseUrl||``,set:e=>{T.value[S]||(T.value[S]={}),T.value[S].baseUrl=e}}),{t:O,router:k,providerMetadata:A,isValidating:j,isValid:M,validationMessage:N,handleResetSettings:P}=C(S);return(e,s)=>(r(),o(l(_),{"provider-name":l(A)?.localizedName,"provider-icon-color":l(A)?.iconColor,"on-back":()=>l(k).back()},{default:u(()=>[c(l(v),null,{default:u(()=>[c(l(m),{title:l(O)(`settings.pages.providers.common.section.basic.title`),description:l(O)(`settings.pages.providers.common.section.basic.description`),"on-reset":l(P)},{default:u(()=>[c(l(b),{modelValue:E.value,"onUpdate:modelValue":s[0]||=e=>E.value=e,"provider-name":l(A)?.localizedName,placeholder:`sk-...`},null,8,[`modelValue`,`provider-name`])]),_:1},8,[`title`,`description`,`on-reset`]),c(l(h),{title:l(O)(`settings.pages.providers.common.section.advanced.title`)},{default:u(()=>[c(l(g),{modelValue:D.value,"onUpdate:modelValue":s[1]||=e=>D.value=e,placeholder:l(A)?.defaultOptions?.().baseUrl||`Base URL of your provider`},null,8,[`modelValue`,`placeholder`])]),_:1},8,[`title`]),!l(M)&&l(j)===0&&l(N)?(r(),o(l(y),{key:0,type:`error`},n({title:u(()=>[i(a(l(O)(`settings.dialogs.onboarding.validationFailed`)),1)]),_:2},[l(N)?{name:`content`,fn:u(()=>[d(`div`,w,a(l(N)),1)]),key:`0`}:void 0]),1024)):t(``,!0),l(M)&&l(j)===0?(r(),o(l(y),{key:1,type:`success`},{title:u(()=>[i(a(l(O)(`settings.dialogs.onboarding.validationSuccess`)),1)]),_:1})):t(``,!0)]),_:1})]),_:1},8,[`provider-name`,`provider-icon-color`,`on-back`]))}});typeof S==`function`&&S(T);var E=T;export{E as default}; \ No newline at end of file diff --git a/assets/airi-card-BeLYaKHl.js b/assets/airi-card-DD-Ao_D4.js similarity index 95% rename from assets/airi-card-BeLYaKHl.js rename to assets/airi-card-DD-Ao_D4.js index a57bc0b89345ace6f1495b576a670e78e8b86fa7..83db3f4c0980d15aa9a0216154e1d663351bc13e 100644 --- a/assets/airi-card-BeLYaKHl.js +++ b/assets/airi-card-DD-Ao_D4.js @@ -1 +1 @@ -import{A as e,C as t,J as n,K as r,O as i,Pt as a,S as o,Z as s,at as c,b as l,jt as u,k as d,kt as f,l as p,lt as m,m as h,ut as g,w as _,x as v,xt as y}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-CZ9Rvki9.js";import{i as b}from"./src-DYQXbDgu.js";import{a as x}from"./resettable-CbXzRviW.js";import{t as ee}from"./DeleteCardDialog-Bby7Qwvm.js";import"./environment-CyZLTg97.js";import{t as te}from"./InputFile-CjPYZ8S-.js";import"./src-C83SCWbW.js";import{gt as S}from"./components-BR_Kqwtu.js";import"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import{n as ne}from"./vue-i18n.runtime-Dah5zGm4.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-D1kLcsvA.js";import"./__vite-browser-external-BaycPy5b.js";import{t as C}from"./airi-card-DuhaYjQU.js";import{t as w}from"./route-block-CpjdOEnv.js";import{t as T}from"./CardCreate-CdxiTrqh.js";import{t as E}from"./CardCreationDialog-B2njkXhJ.js";import{t as D}from"./CardDetailDialog-BFPxHsY4.js";import{t as re}from"./CardListItem-CyBP3HUt.js";var 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":``},O=[`placeholder`],k={class:`relative flex flex-row justify-start gap-2 lg:flex-col`},A={class:`top-[-32px] whitespace-nowrap text-sm text-neutral-500 leading-10 lg:absolute dark:text-neutral-400`},j={key:0,flex:``,"flex-col":``,"items-center":``},M={"font-medium":``,text:`neutral-600 dark:neutral-300`},N={text:`neutral-500 dark:neutral-400`,"mt-2":``,"text-sm":``},P={key:1,flex:``,"flex-col":``,"items-center":``},F={"font-medium":``,text:`primary-600 dark:primary-300`},I={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`},L={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":``},R=e({__name:`index`,setup(e){let{t:w}=ne(),R=C(),{addCard:z,removeCard:B}=R,{cards:V,activeCardId:H}=x(R),U=y(``),W=y(!1),G=y(!1),K=y(``),q=y(`nameAsc`),J=y([]);c(J,async e=>{let t=e[0];if(t)try{let e=await t.text();U.value=z(JSON.parse(e)),W.value=!0}catch(e){console.error(`Error processing card file:`,e)}});let Y=l(()=>Array.from(V.value.entries()).map(([e,t])=>({id:e,name:t.name,description:t.description}))),se=l(()=>{if(!K.value)return Y.value;let e=K.value.toLowerCase();return Y.value.filter(t=>t.name.toLowerCase().includes(e)||t.description&&t.description.toLowerCase().includes(e))}),X=l(()=>{let e=[...se.value];return q.value===`nameAsc`?e.sort((e,t)=>e.name.localeCompare(t.name)):q.value===`nameDesc`?e.sort((e,t)=>t.name.localeCompare(e.name)):q.value===`recent`?e.sort((e,t)=>t.id.localeCompare(e.id)):e}),Z=y(!1),Q=y(null);function ce(){Q.value&&(B(Q.value),Q.value=null,Z.value=!1)}function le(e){Q.value=e,Z.value=!0}function ue(e){U.value=e,W.value=!0}function de(){G.value=!0}function fe(e){H.value=e}function pe(e){return V.value.get(e)?.version||`1.0.0`}function $(e,t){let n=V.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(e,c)=>{let l=s(`motion`);return r(),_(h,null,[v(`div`,ie,[v(`div`,ae,[v(`div`,oe,[c[7]||=v(`div`,{class:`pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3`},[v(`div`,{"i-solar:magnifer-line-duotone":``,class:`text-neutral-500 dark:text-neutral-400`})],-1),g(v(`input`,{"onUpdate:modelValue":c[0]||=e=>K.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:f(w)(`settings.pages.card.search`)},null,8,O),[[p,K.value]])]),v(`div`,k,[v(`div`,A,a(f(w)(`settings.pages.card.sort_by`))+`: `,1),d(f(b),{modelValue:q.value,"onUpdate:modelValue":c[1]||=e=>q.value=e,options:[{value:`nameAsc`,label:f(w)(`settings.pages.card.name_asc`)},{value:`nameDesc`,label:f(w)(`settings.pages.card.name_desc`)},{value:`recent`,label:f(w)(`settings.pages.card.recent`)}],placeholder:`Select sort option`,class:`min-w-[150px]`},null,8,[`modelValue`,`options`])])]),v(`div`,{class:u([`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))]":f(V).size>0}])},[d(f(te),{modelValue:J.value,"onUpdate:modelValue":c[2]||=e=>J.value=e,accept:`*.json`},{default:m(({isDragging:e})=>[e?(r(),_(`div`,P,[c[9]||=v(`div`,{"i-solar:upload-minimalistic-bold":``,class:`mb-2 text-5xl text-primary-500 dark:text-primary-400`},null,-1),v(`p`,F,a(f(w)(`settings.pages.card.drop_here`)),1)])):(r(),_(`div`,j,[c[8]||=v(`div`,{"i-solar:upload-square-line-duotone":``,"mb-4":``,"text-5xl":``,text:`neutral-400 dark:neutral-500`},null,-1),v(`p`,M,a(f(w)(`settings.pages.card.upload`)),1),v(`p`,N,a(f(w)(`settings.pages.card.upload_desc`)),1)]))]),_:1},8,[`modelValue`]),d(T,{onClick:de}),f(V).size>0?(r(!0),_(h,{key:0},n(X.value,e=>(r(),o(re,{id:e.id,key:e.id,name:e.name,description:e.description,"is-active":e.id===f(H),"is-selected":e.id===U.value&&W.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)):t(``,!0),f(V).size===0?(r(),_(`div`,I,[c[10]||=v(`div`,{"i-solar:card-search-broken":``,"mx-auto":``,"mb-3":``,"text-6xl":``,"text-neutral-400":``},null,-1),v(`p`,null,a(f(w)(`settings.pages.card.no_cards`)),1)])):t(``,!0),K.value&&X.value.length===0?(r(),o(f(S),{key:2,type:`warning`},{title:m(()=>[i(a(f(w)(`settings.pages.card.no_results`)),1)]),content:m(()=>[i(a(f(w)(`settings.pages.card.try_different_search`)),1)]),_:1})):t(``,!0)],2)]),d(ee,{modelValue:Z.value,"onUpdate:modelValue":c[3]||=e=>Z.value=e,"card-name":Q.value?f(R).getCard(Q.value)?.name:``,onConfirm:ce,onCancel:c[4]||=e=>Q.value=null},null,8,[`modelValue`,`card-name`]),d(D,{modelValue:W.value,"onUpdate:modelValue":c[5]||=e=>W.value=e,"card-id":U.value},null,8,[`modelValue`,`card-id`]),d(E,{modelValue:G.value,"onUpdate:modelValue":c[6]||=e=>G.value=e},null,8,[`modelValue`]),g((r(),_(`div`,L,[...c[11]||=[v(`div`,{text:`60`,"i-solar:emoji-funny-square-bold-duotone":``},null,-1)]])),[[l]])],64)}}});typeof w==`function`&&w(R);var z=R;export{z as default}; \ No newline at end of file +import{A as e,C as t,J as n,K as r,O as i,Pt as a,S as o,Z as s,at as c,b as l,jt as u,k as d,kt as f,l as p,lt as m,m as h,ut as g,w as _,x as v,xt as y}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-C0YByt49.js";import{i as b}from"./src-DYQXbDgu.js";import{a as x}from"./resettable-CbXzRviW.js";import{t as ee}from"./DeleteCardDialog-Bby7Qwvm.js";import"./environment-CyZLTg97.js";import{t as te}from"./InputFile-CjPYZ8S-.js";import"./src-C83SCWbW.js";import{gt as S}from"./components-CeE-UiLT.js";import"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import{n as ne}from"./vue-i18n.runtime-Dah5zGm4.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-73vyHOZs.js";import"./__vite-browser-external-BaycPy5b.js";import{t as C}from"./airi-card-DuhaYjQU.js";import{t as w}from"./route-block-CpjdOEnv.js";import{t as T}from"./CardCreate-CdxiTrqh.js";import{t as E}from"./CardCreationDialog-B2njkXhJ.js";import{t as D}from"./CardDetailDialog-BFPxHsY4.js";import{t as re}from"./CardListItem-D0jnzgCC.js";var 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":``},O=[`placeholder`],k={class:`relative flex flex-row justify-start gap-2 lg:flex-col`},A={class:`top-[-32px] whitespace-nowrap text-sm text-neutral-500 leading-10 lg:absolute dark:text-neutral-400`},j={key:0,flex:``,"flex-col":``,"items-center":``},M={"font-medium":``,text:`neutral-600 dark:neutral-300`},N={text:`neutral-500 dark:neutral-400`,"mt-2":``,"text-sm":``},P={key:1,flex:``,"flex-col":``,"items-center":``},F={"font-medium":``,text:`primary-600 dark:primary-300`},I={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`},L={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":``},R=e({__name:`index`,setup(e){let{t:w}=ne(),R=C(),{addCard:z,removeCard:B}=R,{cards:V,activeCardId:H}=x(R),U=y(``),W=y(!1),G=y(!1),K=y(``),q=y(`nameAsc`),J=y([]);c(J,async e=>{let t=e[0];if(t)try{let e=await t.text();U.value=z(JSON.parse(e)),W.value=!0}catch(e){console.error(`Error processing card file:`,e)}});let Y=l(()=>Array.from(V.value.entries()).map(([e,t])=>({id:e,name:t.name,description:t.description}))),se=l(()=>{if(!K.value)return Y.value;let e=K.value.toLowerCase();return Y.value.filter(t=>t.name.toLowerCase().includes(e)||t.description&&t.description.toLowerCase().includes(e))}),X=l(()=>{let e=[...se.value];return q.value===`nameAsc`?e.sort((e,t)=>e.name.localeCompare(t.name)):q.value===`nameDesc`?e.sort((e,t)=>t.name.localeCompare(e.name)):q.value===`recent`?e.sort((e,t)=>t.id.localeCompare(e.id)):e}),Z=y(!1),Q=y(null);function ce(){Q.value&&(B(Q.value),Q.value=null,Z.value=!1)}function le(e){Q.value=e,Z.value=!0}function ue(e){U.value=e,W.value=!0}function de(){G.value=!0}function fe(e){H.value=e}function pe(e){return V.value.get(e)?.version||`1.0.0`}function $(e,t){let n=V.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(e,c)=>{let l=s(`motion`);return r(),_(h,null,[v(`div`,ie,[v(`div`,ae,[v(`div`,oe,[c[7]||=v(`div`,{class:`pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3`},[v(`div`,{"i-solar:magnifer-line-duotone":``,class:`text-neutral-500 dark:text-neutral-400`})],-1),g(v(`input`,{"onUpdate:modelValue":c[0]||=e=>K.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:f(w)(`settings.pages.card.search`)},null,8,O),[[p,K.value]])]),v(`div`,k,[v(`div`,A,a(f(w)(`settings.pages.card.sort_by`))+`: `,1),d(f(b),{modelValue:q.value,"onUpdate:modelValue":c[1]||=e=>q.value=e,options:[{value:`nameAsc`,label:f(w)(`settings.pages.card.name_asc`)},{value:`nameDesc`,label:f(w)(`settings.pages.card.name_desc`)},{value:`recent`,label:f(w)(`settings.pages.card.recent`)}],placeholder:`Select sort option`,class:`min-w-[150px]`},null,8,[`modelValue`,`options`])])]),v(`div`,{class:u([`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))]":f(V).size>0}])},[d(f(te),{modelValue:J.value,"onUpdate:modelValue":c[2]||=e=>J.value=e,accept:`*.json`},{default:m(({isDragging:e})=>[e?(r(),_(`div`,P,[c[9]||=v(`div`,{"i-solar:upload-minimalistic-bold":``,class:`mb-2 text-5xl text-primary-500 dark:text-primary-400`},null,-1),v(`p`,F,a(f(w)(`settings.pages.card.drop_here`)),1)])):(r(),_(`div`,j,[c[8]||=v(`div`,{"i-solar:upload-square-line-duotone":``,"mb-4":``,"text-5xl":``,text:`neutral-400 dark:neutral-500`},null,-1),v(`p`,M,a(f(w)(`settings.pages.card.upload`)),1),v(`p`,N,a(f(w)(`settings.pages.card.upload_desc`)),1)]))]),_:1},8,[`modelValue`]),d(T,{onClick:de}),f(V).size>0?(r(!0),_(h,{key:0},n(X.value,e=>(r(),o(re,{id:e.id,key:e.id,name:e.name,description:e.description,"is-active":e.id===f(H),"is-selected":e.id===U.value&&W.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)):t(``,!0),f(V).size===0?(r(),_(`div`,I,[c[10]||=v(`div`,{"i-solar:card-search-broken":``,"mx-auto":``,"mb-3":``,"text-6xl":``,"text-neutral-400":``},null,-1),v(`p`,null,a(f(w)(`settings.pages.card.no_cards`)),1)])):t(``,!0),K.value&&X.value.length===0?(r(),o(f(S),{key:2,type:`warning`},{title:m(()=>[i(a(f(w)(`settings.pages.card.no_results`)),1)]),content:m(()=>[i(a(f(w)(`settings.pages.card.try_different_search`)),1)]),_:1})):t(``,!0)],2)]),d(ee,{modelValue:Z.value,"onUpdate:modelValue":c[3]||=e=>Z.value=e,"card-name":Q.value?f(R).getCard(Q.value)?.name:``,onConfirm:ce,onCancel:c[4]||=e=>Q.value=null},null,8,[`modelValue`,`card-name`]),d(D,{modelValue:W.value,"onUpdate:modelValue":c[5]||=e=>W.value=e,"card-id":U.value},null,8,[`modelValue`,`card-id`]),d(E,{modelValue:G.value,"onUpdate:modelValue":c[6]||=e=>G.value=e},null,8,[`modelValue`]),g((r(),_(`div`,L,[...c[11]||=[v(`div`,{text:`60`,"i-solar:emoji-funny-square-bold-duotone":``},null,-1)]])),[[l]])],64)}}});typeof w==`function`&&w(R);var z=R;export{z as default}; \ No newline at end of file diff --git a/assets/alibaba-cloud-model-studio-Bs3uT3_h.js b/assets/alibaba-cloud-model-studio-y2JPUG5u.js similarity index 93% rename from assets/alibaba-cloud-model-studio-Bs3uT3_h.js rename to assets/alibaba-cloud-model-studio-y2JPUG5u.js index ca5a65f330708a888bfb09f4972f9ab0f8793396..08c07671b2de5947f8cefc4a8e229db2dd763cc0 100644 --- a/assets/alibaba-cloud-model-studio-Bs3uT3_h.js +++ b/assets/alibaba-cloud-model-studio-y2JPUG5u.js @@ -1 +1 @@ -import{A as e,K as t,S as n,W as r,at as i,b as a,k as o,kt as s,lt as c,x as l,xt as u}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-CZ9Rvki9.js";import{l as d}from"./src-DYQXbDgu.js";import{a as f}from"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{c as p,u as m}from"./components-BR_Kqwtu.js";import{i as h,t as g}from"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import{n as _}from"./vue-i18n.runtime-Dah5zGm4.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-D1kLcsvA.js";import"./__vite-browser-external-BaycPy5b.js";import{t as v}from"./route-block-CpjdOEnv.js";var y={flex:`~ col gap-4`},b=`alibaba-cloud-model-studio`,x=`cosyvoice-v1`,S=e({__name:`alibaba-cloud-model-studio`,setup(e){let v={speed:1},S=u(0),C=u(1),w=u(0),T=g(),E=h(),{providers:D}=f(E),{t:O}=_(),k=a(()=>!!D.value[b]?.apiKey),A=a(()=>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 r(async()=>{let e=E.getProviderConfig(b);await E.getProviderMetadata(b).validators.validateProviderConfig(e)?await T.loadVoicesForProvider(b):console.error(`Failed to validate provider config`,e)}),i(S,async()=>{let e=E.getProviderConfig(b);e.pitch=S.value}),i(C,async()=>{let e=E.getProviderConfig(b);e.speed=C.value}),i(w,async()=>{let e=E.getProviderConfig(b);e.volume=w.value}),i(D,async()=>{let e=E.getProviderConfig(b);await E.getProviderMetadata(b).validators.validateProviderConfig(e)?await T.loadVoicesForProvider(b):console.error(`Failed to validate provider config`,e)},{immediate:!0}),(e,r)=>(t(),n(s(p),{"provider-id":b,"default-model":x,"additional-settings":v},{"voice-settings":c(()=>[l(`div`,y,[o(s(d),{modelValue:S.value,"onUpdate:modelValue":r[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`]),o(s(d),{modelValue:C.value,"onUpdate:modelValue":r[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`]),o(s(d),{modelValue:w.value,"onUpdate:modelValue":r[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:c(()=>[o(s(m),{"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 +import{A as e,K as t,S as n,W as r,at as i,b as a,k as o,kt as s,lt as c,x as l,xt as u}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-C0YByt49.js";import{l as d}from"./src-DYQXbDgu.js";import{a as f}from"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{c as p,u as m}from"./components-CeE-UiLT.js";import{i as h,t as g}from"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import{n as _}from"./vue-i18n.runtime-Dah5zGm4.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-73vyHOZs.js";import"./__vite-browser-external-BaycPy5b.js";import{t as v}from"./route-block-CpjdOEnv.js";var y={flex:`~ col gap-4`},b=`alibaba-cloud-model-studio`,x=`cosyvoice-v1`,S=e({__name:`alibaba-cloud-model-studio`,setup(e){let v={speed:1},S=u(0),C=u(1),w=u(0),T=g(),E=h(),{providers:D}=f(E),{t:O}=_(),k=a(()=>!!D.value[b]?.apiKey),A=a(()=>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 r(async()=>{let e=E.getProviderConfig(b);await E.getProviderMetadata(b).validators.validateProviderConfig(e)?await T.loadVoicesForProvider(b):console.error(`Failed to validate provider config`,e)}),i(S,async()=>{let e=E.getProviderConfig(b);e.pitch=S.value}),i(C,async()=>{let e=E.getProviderConfig(b);e.speed=C.value}),i(w,async()=>{let e=E.getProviderConfig(b);e.volume=w.value}),i(D,async()=>{let e=E.getProviderConfig(b);await E.getProviderMetadata(b).validators.validateProviderConfig(e)?await T.loadVoicesForProvider(b):console.error(`Failed to validate provider config`,e)},{immediate:!0}),(e,r)=>(t(),n(s(p),{"provider-id":b,"default-model":x,"additional-settings":v},{"voice-settings":c(()=>[l(`div`,y,[o(s(d),{modelValue:S.value,"onUpdate:modelValue":r[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`]),o(s(d),{modelValue:C.value,"onUpdate:modelValue":r[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`]),o(s(d),{modelValue:w.value,"onUpdate:modelValue":r[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:c(()=>[o(s(m),{"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/aliyun-nls-transcription-ThiG_Ak6.js b/assets/aliyun-nls-transcription-BDaEju68.js similarity index 97% rename from assets/aliyun-nls-transcription-ThiG_Ak6.js rename to assets/aliyun-nls-transcription-BDaEju68.js index 488feaddaa1741c36fd9412d546a7e4e5fe56e7e..7f330891b8714440cd16d0c1989fd902007bbbbf 100644 --- a/assets/aliyun-nls-transcription-ThiG_Ak6.js +++ b/assets/aliyun-nls-transcription-BDaEju68.js @@ -1 +1 @@ -import{A as e,C as t,H as n,J as r,K as i,O as a,Pt as o,S as s,b as c,jt as ee,k as l,kt as u,lt as d,m as f,w as p,wt as m,x as h,xt as g,yt as te}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-CZ9Rvki9.js";import{c as ne,d as _,r as v}from"./src-DYQXbDgu.js";import{a as y}from"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{G as b,U as x,W as re,gt as S}from"./components-BR_Kqwtu.js";import{i as ie}from"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-D1kLcsvA.js";import"./__vite-browser-external-BaycPy5b.js";import{n as ae}from"./hearing-BH9rth_f.js";import{t as C}from"./route-block-CpjdOEnv.js";import{t as oe}from"./process.worklet-Cmmnc6Go.js";import{t as se}from"./use-provider-validation-DbXr83wX.js";var ce={class:`flex flex-col gap-6 md:flex-row`},le={class:`whitespace-pre-wrap break-all`},ue={class:`w-full flex flex-1 flex-col gap-6`},de={class:`border border-neutral-200/80 rounded-xl bg-neutral-50/60 p-4 dark:border-neutral-700 dark:bg-neutral-900/40`},fe={class:`flex flex-wrap items-center justify-between gap-3`},pe={class:`space-x-3`},me={class:`text-sm text-neutral-500 dark:text-neutral-400`},he={key:0,class:`rounded bg-red-500/10 px-2 py-0.5 text-xs text-red-500`},ge={key:1,class:`rounded bg-blue-500/10 px-2 py-0.5 text-xs text-blue-500`},_e={key:0,class:`mt-3 text-sm text-red-500`},ve={class:`border border-neutral-200/80 rounded-xl bg-neutral-50/60 p-4 dark:border-neutral-700 dark:bg-neutral-900/40`},ye={key:0,class:`mt-3 text-sm text-neutral-500 dark:text-neutral-400`},be={class:`mt-1 font-medium`},xe={key:1,class:`mt-3 text-sm text-neutral-400 dark:text-neutral-600`},Se={class:`mt-4 text-sm space-y-3`},Ce={class:`mt-0.5 rounded bg-neutral-200/80 px-2 py-0.5 text-xs text-neutral-700 dark:bg-neutral-800/70 dark:text-neutral-200`},we={key:0,class:`text-xs text-neutral-400`},w=`aliyun-nls-transcription`,Te=`aliyun-nls-v1`,T=16e3,E=e({__name:`aliyun-nls-transcription`,setup(e){let C=[{label:`cn-shanghai`,value:`cn-shanghai`},{label:`cn-beijing`,value:`cn-beijing`},{label:`cn-shenzhen`,value:`cn-shenzhen`},{label:`cn-shanghai (internal)`,value:`cn-shanghai-internal`},{label:`cn-beijing (internal)`,value:`cn-beijing-internal`},{label:`cn-shenzhen (internal)`,value:`cn-shenzhen-internal`}],E=ae(),D=ie(),{providers:O}=y(D);D.initializeProvider(w);let k=te({get accessKeyId(){return O.value[w]?.accessKeyId||``},set accessKeyId(e){A(),O.value[w].accessKeyId=e},get accessKeySecret(){return O.value[w]?.accessKeySecret||``},set accessKeySecret(e){A(),O.value[w].accessKeySecret=e},get appKey(){return O.value[w]?.appKey||``},set appKey(e){A(),O.value[w].appKey=e},get region(){return O.value[w]?.region||`cn-shanghai`},set region(e){A(),O.value[w].region=e}});function A(){O.value[w]||(O.value[w]={accessKeyId:``,accessKeySecret:``,appKey:``,region:`cn-shanghai`})}let Ee=c(()=>!!(k.accessKeyId.trim()&&k.accessKeySecret.trim()&&k.appKey.trim())),j=g(!1),M=g(!1),N=g(null),P=g(``),F=g([]),I=m(),L=m(),R=m(),z=m(),B=m(),V=m(),H=m(null),U=m(null),W=c(()=>Ee.value&&!j.value&&!M.value),De=c(()=>j.value||M.value),Oe=c(()=>M.value&&!!V.value),{t:G,router:ke,providerMetadata:K,isValidating:q,isValid:J,validationMessage:Y,handleResetSettings:Ae}=se(w);function je(e){let t=new Int16Array(e.length);for(let n=0;n{let t=e.buffer,n=B.value;if(!t||!n)return;let r=je(t);n.enqueue(r.buffer.slice(0))};let r=t.createMediaStreamSource(e);r.connect(n);let i=t.createGain();i.gain.value=0,n.connect(i),i.connect(t.destination),I.value=t,L.value=n,z.value=r}function Ne(){P.value=``,F.value=[]}function X(e){switch(e.header.name){case`TranscriptionResultChanged`:{let t=e.payload;P.value=t.result,Z(t.index,t.result,!1);break}case`SentenceEnd`:{let t=e.payload;P.value=``,Z(t.index,t.result,!0);break}default:break}}function Z(e,t,n){let r=F.value.findIndex(t=>t.index===e);if(r>=0){let i=F.value[r];F.value.splice(r,1,{index:e,text:t,final:i.final||n})}else F.value.push({index:e,text:t,final:n});F.value.sort((e,t)=>e.index-t.index)}async function Pe(){if(!W.value)return;N.value=null,Ne();let e=new AbortController;V.value=e;let t=new ReadableStream({start(e){B.value=e},cancel:()=>{B.value=void 0}});try{let n=await D.getProviderInstance(w);if(!n)throw Error(`Failed to initialize Aliyun NLS provider.`);let r=await E.transcription(w,n,Te,{inputAudioStream:t},void 0,{providerOptions:{abortSignal:e.signal,hooks:{onServerEvent:e=>{X(e)}},onSessionTerminated:async e=>{e&&(N.value=e instanceof Error?e.message:String(e)),M.value=!1,V.value=void 0},sessionOptions:{format:`pcm`,sample_rate:T,enable_punctuation_prediction:!0}}});if(r.mode!==`stream`)throw Error(`Aliyun NLS returned a non-streaming result unexpectedly.`);H.value=r,U.value=r.text.catch(e=>{throw N.value=e instanceof Error?e.message:String(e),e});let i=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,sampleRate:T,echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}});R.value=i,await Me(i),I.value?.state===`suspended`&&await I.value.resume(),j.value=!0,M.value=!0}catch(e){N.value=e instanceof Error?e.message:String(e),await Q()}}async function Q(){try{L.value?.port.postMessage({type:`stop`})}catch{}if(z.value&&=(z.value.disconnect(),void 0),L.value&&=(L.value.port.onmessage=null,L.value.disconnect(),void 0),R.value&&=(R.value.getTracks().forEach(e=>e.stop()),void 0),I.value){try{await I.value.close()}catch{}I.value=void 0}if(B.value?.close(),B.value=void 0,j.value=!1,U.value)try{await U.value}catch{}finally{U.value=null}M.value=!1,V.value=void 0,H.value=null}function $(){let e=V.value;e&&(e.abort(new DOMException(`Aborted by user`,`AbortError`)),B.value?.error(new DOMException(`Aborted by user`,`AbortError`)),B.value=void 0,Q())}return n(async()=>{$(),await Q()}),(e,n)=>(i(),s(u(x),{"provider-name":u(K)?.localizedName,"provider-icon":u(K)?.icon,"provider-icon-color":u(K)?.iconColor,"on-back":()=>u(ke).back()},{default:d(()=>[h(`div`,ce,[l(u(re),{class:`w-full md:w-[40%] space-y-6`},{default:d(()=>[l(u(b),{title:u(G)(`settings.pages.providers.common.section.basic.title`),description:u(G)(`settings.pages.providers.common.section.basic.description`),"on-reset":u(Ae)},{default:d(()=>[l(u(_),{modelValue:k.accessKeyId,"onUpdate:modelValue":n[0]||=e=>k.accessKeyId=e,label:`Access Key ID`,placeholder:`LTAI...`},null,8,[`modelValue`]),l(u(_),{modelValue:k.accessKeySecret,"onUpdate:modelValue":n[1]||=e=>k.accessKeySecret=e,label:`Access Key Secret`,type:`password`,placeholder:`****************`},null,8,[`modelValue`]),l(u(_),{modelValue:k.appKey,"onUpdate:modelValue":n[2]||=e=>k.appKey=e,label:`App Key`,placeholder:`请输入 AppKey`},null,8,[`modelValue`]),l(u(ne),{modelValue:k.region,"onUpdate:modelValue":n[3]||=e=>k.region=e,label:`Region`,options:C,layout:`vertical`},null,8,[`modelValue`])]),_:1},8,[`title`,`description`,`on-reset`]),!u(J)&&u(q)===0&&u(Y)?(i(),s(u(S),{key:0,type:`error`},{title:d(()=>[a(o(u(G)(`settings.dialogs.onboarding.validationFailed`)),1)]),content:d(()=>[h(`div`,le,o(u(Y)),1)]),_:1})):t(``,!0),u(J)&&u(q)===0?(i(),s(u(S),{key:1,type:`success`},{title:d(()=>[a(o(u(G)(`settings.dialogs.onboarding.validationSuccess`)),1)]),_:1})):t(``,!0)]),_:1}),h(`div`,ue,[h(`div`,de,[h(`div`,fe,[h(`div`,pe,[l(u(v),{disabled:!W.value,variant:`primary`,onClick:Pe},{default:d(()=>[a(o(j.value?`Streaming...`:`Start Realtime Transcription`),1)]),_:1},8,[`disabled`]),l(u(v),{disabled:!De.value,variant:`secondary`,onClick:Q},{default:d(()=>[...n[4]||=[a(` Stop `,-1)]]),_:1},8,[`disabled`]),M.value?(i(),s(u(v),{key:0,disabled:!Oe.value,onClick:$},{default:d(()=>[...n[5]||=[a(` Abort Session `,-1)]]),_:1},8,[`disabled`])):t(``,!0)]),h(`div`,me,[j.value?(i(),p(`span`,he,` Recording `)):M.value?(i(),p(`span`,ge,` Connected `)):t(``,!0)])]),N.value?(i(),p(`p`,_e,o(N.value),1)):t(``,!0)]),h(`div`,ve,[n[7]||=h(`h2`,{class:`text-lg font-semibold`},` Transcripts `,-1),P.value?(i(),p(`div`,ye,[n[6]||=h(`div`,{class:`text-xs text-neutral-400 tracking-wide uppercase dark:text-neutral-500`},` Partial `,-1),h(`div`,be,o(P.value),1)])):t(``,!0),!F.value.length&&!P.value?(i(),p(`div`,xe,` Waiting for audio... `)):t(``,!0),h(`ul`,Se,[(i(!0),p(f,null,r(F.value,e=>(i(),p(`li`,{key:e.index,class:`flex items-start gap-3`},[h(`span`,Ce,` #`+o(e.index),1),h(`div`,null,[h(`div`,{class:ee([`font-medium`,e.final?``:`italic text-neutral-500 dark:text-neutral-400`])},o(e.text),3),e.final?t(``,!0):(i(),p(`div`,we,` Awaiting final result... `))])]))),128))])])])])]),_:1},8,[`provider-name`,`provider-icon`,`provider-icon-color`,`on-back`]))}});typeof C==`function`&&C(E);var D=E;export{D as default}; \ No newline at end of file +import{A as e,C as t,H as n,J as r,K as i,O as a,Pt as o,S as s,b as c,jt as ee,k as l,kt as u,lt as d,m as f,w as p,wt as m,x as h,xt as g,yt as te}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-C0YByt49.js";import{c as ne,d as _,r as v}from"./src-DYQXbDgu.js";import{a as y}from"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{G as b,U as x,W as re,gt as S}from"./components-CeE-UiLT.js";import{i as ie}from"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-73vyHOZs.js";import"./__vite-browser-external-BaycPy5b.js";import{n as ae}from"./hearing-BH9rth_f.js";import{t as C}from"./route-block-CpjdOEnv.js";import{t as oe}from"./process.worklet-Cmmnc6Go.js";import{t as se}from"./use-provider-validation-DbXr83wX.js";var ce={class:`flex flex-col gap-6 md:flex-row`},le={class:`whitespace-pre-wrap break-all`},ue={class:`w-full flex flex-1 flex-col gap-6`},de={class:`border border-neutral-200/80 rounded-xl bg-neutral-50/60 p-4 dark:border-neutral-700 dark:bg-neutral-900/40`},fe={class:`flex flex-wrap items-center justify-between gap-3`},pe={class:`space-x-3`},me={class:`text-sm text-neutral-500 dark:text-neutral-400`},he={key:0,class:`rounded bg-red-500/10 px-2 py-0.5 text-xs text-red-500`},ge={key:1,class:`rounded bg-blue-500/10 px-2 py-0.5 text-xs text-blue-500`},_e={key:0,class:`mt-3 text-sm text-red-500`},ve={class:`border border-neutral-200/80 rounded-xl bg-neutral-50/60 p-4 dark:border-neutral-700 dark:bg-neutral-900/40`},ye={key:0,class:`mt-3 text-sm text-neutral-500 dark:text-neutral-400`},be={class:`mt-1 font-medium`},xe={key:1,class:`mt-3 text-sm text-neutral-400 dark:text-neutral-600`},Se={class:`mt-4 text-sm space-y-3`},Ce={class:`mt-0.5 rounded bg-neutral-200/80 px-2 py-0.5 text-xs text-neutral-700 dark:bg-neutral-800/70 dark:text-neutral-200`},we={key:0,class:`text-xs text-neutral-400`},w=`aliyun-nls-transcription`,Te=`aliyun-nls-v1`,T=16e3,E=e({__name:`aliyun-nls-transcription`,setup(e){let C=[{label:`cn-shanghai`,value:`cn-shanghai`},{label:`cn-beijing`,value:`cn-beijing`},{label:`cn-shenzhen`,value:`cn-shenzhen`},{label:`cn-shanghai (internal)`,value:`cn-shanghai-internal`},{label:`cn-beijing (internal)`,value:`cn-beijing-internal`},{label:`cn-shenzhen (internal)`,value:`cn-shenzhen-internal`}],E=ae(),D=ie(),{providers:O}=y(D);D.initializeProvider(w);let k=te({get accessKeyId(){return O.value[w]?.accessKeyId||``},set accessKeyId(e){A(),O.value[w].accessKeyId=e},get accessKeySecret(){return O.value[w]?.accessKeySecret||``},set accessKeySecret(e){A(),O.value[w].accessKeySecret=e},get appKey(){return O.value[w]?.appKey||``},set appKey(e){A(),O.value[w].appKey=e},get region(){return O.value[w]?.region||`cn-shanghai`},set region(e){A(),O.value[w].region=e}});function A(){O.value[w]||(O.value[w]={accessKeyId:``,accessKeySecret:``,appKey:``,region:`cn-shanghai`})}let Ee=c(()=>!!(k.accessKeyId.trim()&&k.accessKeySecret.trim()&&k.appKey.trim())),j=g(!1),M=g(!1),N=g(null),P=g(``),F=g([]),I=m(),L=m(),R=m(),z=m(),B=m(),V=m(),H=m(null),U=m(null),W=c(()=>Ee.value&&!j.value&&!M.value),De=c(()=>j.value||M.value),Oe=c(()=>M.value&&!!V.value),{t:G,router:ke,providerMetadata:K,isValidating:q,isValid:J,validationMessage:Y,handleResetSettings:Ae}=se(w);function je(e){let t=new Int16Array(e.length);for(let n=0;n{let t=e.buffer,n=B.value;if(!t||!n)return;let r=je(t);n.enqueue(r.buffer.slice(0))};let r=t.createMediaStreamSource(e);r.connect(n);let i=t.createGain();i.gain.value=0,n.connect(i),i.connect(t.destination),I.value=t,L.value=n,z.value=r}function Ne(){P.value=``,F.value=[]}function X(e){switch(e.header.name){case`TranscriptionResultChanged`:{let t=e.payload;P.value=t.result,Z(t.index,t.result,!1);break}case`SentenceEnd`:{let t=e.payload;P.value=``,Z(t.index,t.result,!0);break}default:break}}function Z(e,t,n){let r=F.value.findIndex(t=>t.index===e);if(r>=0){let i=F.value[r];F.value.splice(r,1,{index:e,text:t,final:i.final||n})}else F.value.push({index:e,text:t,final:n});F.value.sort((e,t)=>e.index-t.index)}async function Pe(){if(!W.value)return;N.value=null,Ne();let e=new AbortController;V.value=e;let t=new ReadableStream({start(e){B.value=e},cancel:()=>{B.value=void 0}});try{let n=await D.getProviderInstance(w);if(!n)throw Error(`Failed to initialize Aliyun NLS provider.`);let r=await E.transcription(w,n,Te,{inputAudioStream:t},void 0,{providerOptions:{abortSignal:e.signal,hooks:{onServerEvent:e=>{X(e)}},onSessionTerminated:async e=>{e&&(N.value=e instanceof Error?e.message:String(e)),M.value=!1,V.value=void 0},sessionOptions:{format:`pcm`,sample_rate:T,enable_punctuation_prediction:!0}}});if(r.mode!==`stream`)throw Error(`Aliyun NLS returned a non-streaming result unexpectedly.`);H.value=r,U.value=r.text.catch(e=>{throw N.value=e instanceof Error?e.message:String(e),e});let i=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,sampleRate:T,echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}});R.value=i,await Me(i),I.value?.state===`suspended`&&await I.value.resume(),j.value=!0,M.value=!0}catch(e){N.value=e instanceof Error?e.message:String(e),await Q()}}async function Q(){try{L.value?.port.postMessage({type:`stop`})}catch{}if(z.value&&=(z.value.disconnect(),void 0),L.value&&=(L.value.port.onmessage=null,L.value.disconnect(),void 0),R.value&&=(R.value.getTracks().forEach(e=>e.stop()),void 0),I.value){try{await I.value.close()}catch{}I.value=void 0}if(B.value?.close(),B.value=void 0,j.value=!1,U.value)try{await U.value}catch{}finally{U.value=null}M.value=!1,V.value=void 0,H.value=null}function $(){let e=V.value;e&&(e.abort(new DOMException(`Aborted by user`,`AbortError`)),B.value?.error(new DOMException(`Aborted by user`,`AbortError`)),B.value=void 0,Q())}return n(async()=>{$(),await Q()}),(e,n)=>(i(),s(u(x),{"provider-name":u(K)?.localizedName,"provider-icon":u(K)?.icon,"provider-icon-color":u(K)?.iconColor,"on-back":()=>u(ke).back()},{default:d(()=>[h(`div`,ce,[l(u(re),{class:`w-full md:w-[40%] space-y-6`},{default:d(()=>[l(u(b),{title:u(G)(`settings.pages.providers.common.section.basic.title`),description:u(G)(`settings.pages.providers.common.section.basic.description`),"on-reset":u(Ae)},{default:d(()=>[l(u(_),{modelValue:k.accessKeyId,"onUpdate:modelValue":n[0]||=e=>k.accessKeyId=e,label:`Access Key ID`,placeholder:`LTAI...`},null,8,[`modelValue`]),l(u(_),{modelValue:k.accessKeySecret,"onUpdate:modelValue":n[1]||=e=>k.accessKeySecret=e,label:`Access Key Secret`,type:`password`,placeholder:`****************`},null,8,[`modelValue`]),l(u(_),{modelValue:k.appKey,"onUpdate:modelValue":n[2]||=e=>k.appKey=e,label:`App Key`,placeholder:`请输入 AppKey`},null,8,[`modelValue`]),l(u(ne),{modelValue:k.region,"onUpdate:modelValue":n[3]||=e=>k.region=e,label:`Region`,options:C,layout:`vertical`},null,8,[`modelValue`])]),_:1},8,[`title`,`description`,`on-reset`]),!u(J)&&u(q)===0&&u(Y)?(i(),s(u(S),{key:0,type:`error`},{title:d(()=>[a(o(u(G)(`settings.dialogs.onboarding.validationFailed`)),1)]),content:d(()=>[h(`div`,le,o(u(Y)),1)]),_:1})):t(``,!0),u(J)&&u(q)===0?(i(),s(u(S),{key:1,type:`success`},{title:d(()=>[a(o(u(G)(`settings.dialogs.onboarding.validationSuccess`)),1)]),_:1})):t(``,!0)]),_:1}),h(`div`,ue,[h(`div`,de,[h(`div`,fe,[h(`div`,pe,[l(u(v),{disabled:!W.value,variant:`primary`,onClick:Pe},{default:d(()=>[a(o(j.value?`Streaming...`:`Start Realtime Transcription`),1)]),_:1},8,[`disabled`]),l(u(v),{disabled:!De.value,variant:`secondary`,onClick:Q},{default:d(()=>[...n[4]||=[a(` Stop `,-1)]]),_:1},8,[`disabled`]),M.value?(i(),s(u(v),{key:0,disabled:!Oe.value,onClick:$},{default:d(()=>[...n[5]||=[a(` Abort Session `,-1)]]),_:1},8,[`disabled`])):t(``,!0)]),h(`div`,me,[j.value?(i(),p(`span`,he,` Recording `)):M.value?(i(),p(`span`,ge,` Connected `)):t(``,!0)])]),N.value?(i(),p(`p`,_e,o(N.value),1)):t(``,!0)]),h(`div`,ve,[n[7]||=h(`h2`,{class:`text-lg font-semibold`},` Transcripts `,-1),P.value?(i(),p(`div`,ye,[n[6]||=h(`div`,{class:`text-xs text-neutral-400 tracking-wide uppercase dark:text-neutral-500`},` Partial `,-1),h(`div`,be,o(P.value),1)])):t(``,!0),!F.value.length&&!P.value?(i(),p(`div`,xe,` Waiting for audio... `)):t(``,!0),h(`ul`,Se,[(i(!0),p(f,null,r(F.value,e=>(i(),p(`li`,{key:e.index,class:`flex items-start gap-3`},[h(`span`,Ce,` #`+o(e.index),1),h(`div`,null,[h(`div`,{class:ee([`font-medium`,e.final?``:`italic text-neutral-500 dark:text-neutral-400`])},o(e.text),3),e.final?t(``,!0):(i(),p(`div`,we,` Awaiting final result... `))])]))),128))])])])])]),_:1},8,[`provider-name`,`provider-icon`,`provider-icon-color`,`on-back`]))}});typeof C==`function`&&C(E);var D=E;export{D as default}; \ No newline at end of file diff --git a/assets/azure-ai-foundry-DEqvloeQ.js b/assets/azure-ai-foundry-J2oDBayK.js similarity index 93% rename from assets/azure-ai-foundry-DEqvloeQ.js rename to assets/azure-ai-foundry-J2oDBayK.js index 51ef86092bfac16be1d5c78e8dd6f97ff3536f1c..790f7608532d3e9ecf4852a1d8d06ac26f3ac8cd 100644 --- a/assets/azure-ai-foundry-DEqvloeQ.js +++ b/assets/azure-ai-foundry-J2oDBayK.js @@ -1 +1 @@ -import{A as e,C as t,E as n,K as r,O as i,Pt as a,S as o,b as s,k as c,kt as l,lt as u,x as d}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-CZ9Rvki9.js";import"./src-DYQXbDgu.js";import{a as f}from"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{G as p,J as m,U as h,W as g,Y as _,gt as v,q as y}from"./components-BR_Kqwtu.js";import{i as b}from"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-D1kLcsvA.js";import"./__vite-browser-external-BaycPy5b.js";import{t as x}from"./route-block-CpjdOEnv.js";import{t as S}from"./use-provider-validation-DbXr83wX.js";var C={class:`whitespace-pre-wrap break-all`},w=`azure-ai-foundry`,T=e({__name:`azure-ai-foundry`,setup(e){let{providers:x}=f(b()),T=s({get:()=>x.value[w]?.apiKey||``,set:e=>{x.value[w]||(x.value[w]={}),x.value[w].apiKey=e}}),E=s({get:()=>x.value[w]?.resourceName||``,set:e=>{x.value[w]||(x.value[w]={}),x.value[w].resourceName=e}}),D=s({get:()=>x.value[w]?.apiVersion||``,set:e=>{x.value[w]||(x.value[w]={}),x.value[w].apiVersion=e}}),O=s({get:()=>x.value[w]?.modelId||``,set:e=>{x.value[w]||(x.value[w]={}),x.value[w].modelId=e}}),{t:k,router:A,providerMetadata:j,isValidating:M,isValid:N,validationMessage:P,handleResetSettings:F}=S(w);return(e,s)=>(r(),o(l(h),{"provider-name":l(j)?.localizedName,"provider-icon-color":l(j)?.iconColor,"on-back":()=>l(A).back()},{default:u(()=>[c(l(g),null,{default:u(()=>[c(l(p),{title:l(k)(`settings.pages.providers.common.section.basic.title`),description:l(k)(`settings.pages.providers.common.section.basic.description`),"on-reset":l(F)},{default:u(()=>[c(l(y),{modelValue:T.value,"onUpdate:modelValue":s[0]||=e=>T.value=e,"provider-name":l(j)?.localizedName,placeholder:`...`,required:``},null,8,[`modelValue`,`provider-name`]),c(l(_),{modelValue:E.value,"onUpdate:modelValue":s[1]||=e=>E.value=e,label:`Resouce name`,placeholder:`...`,description:`Prefix used in https://.services.ai.azure.com`,required:``},null,8,[`modelValue`]),c(l(_),{modelValue:O.value,"onUpdate:modelValue":s[2]||=e=>O.value=e,label:`Model id`,placeholder:`...`,description:`Model ID on Azure AI Foundry`,required:``},null,8,[`modelValue`])]),_:1},8,[`title`,`description`,`on-reset`]),c(l(m),{title:l(k)(`settings.pages.providers.common.section.advanced.title`)},{default:u(()=>[c(l(_),{modelValue:D.value,"onUpdate:modelValue":s[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`]),!l(N)&&l(M)===0&&l(P)?(r(),o(l(v),{key:0,type:`error`},n({title:u(()=>[i(a(l(k)(`settings.dialogs.onboarding.validationFailed`)),1)]),_:2},[l(P)?{name:`content`,fn:u(()=>[d(`div`,C,a(l(P)),1)]),key:`0`}:void 0]),1024)):t(``,!0),l(N)&&l(M)===0?(r(),o(l(v),{key:1,type:`success`},{title:u(()=>[i(a(l(k)(`settings.dialogs.onboarding.validationSuccess`)),1)]),_:1})):t(``,!0)]),_:1})]),_:1},8,[`provider-name`,`provider-icon-color`,`on-back`]))}});typeof x==`function`&&x(T);var E=T;export{E as default}; \ No newline at end of file +import{A as e,C as t,E as n,K as r,O as i,Pt as a,S as o,b as s,k as c,kt as l,lt as u,x as d}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-C0YByt49.js";import"./src-DYQXbDgu.js";import{a as f}from"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{G as p,J as m,U as h,W as g,Y as _,gt as v,q as y}from"./components-CeE-UiLT.js";import{i as b}from"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-73vyHOZs.js";import"./__vite-browser-external-BaycPy5b.js";import{t as x}from"./route-block-CpjdOEnv.js";import{t as S}from"./use-provider-validation-DbXr83wX.js";var C={class:`whitespace-pre-wrap break-all`},w=`azure-ai-foundry`,T=e({__name:`azure-ai-foundry`,setup(e){let{providers:x}=f(b()),T=s({get:()=>x.value[w]?.apiKey||``,set:e=>{x.value[w]||(x.value[w]={}),x.value[w].apiKey=e}}),E=s({get:()=>x.value[w]?.resourceName||``,set:e=>{x.value[w]||(x.value[w]={}),x.value[w].resourceName=e}}),D=s({get:()=>x.value[w]?.apiVersion||``,set:e=>{x.value[w]||(x.value[w]={}),x.value[w].apiVersion=e}}),O=s({get:()=>x.value[w]?.modelId||``,set:e=>{x.value[w]||(x.value[w]={}),x.value[w].modelId=e}}),{t:k,router:A,providerMetadata:j,isValidating:M,isValid:N,validationMessage:P,handleResetSettings:F}=S(w);return(e,s)=>(r(),o(l(h),{"provider-name":l(j)?.localizedName,"provider-icon-color":l(j)?.iconColor,"on-back":()=>l(A).back()},{default:u(()=>[c(l(g),null,{default:u(()=>[c(l(p),{title:l(k)(`settings.pages.providers.common.section.basic.title`),description:l(k)(`settings.pages.providers.common.section.basic.description`),"on-reset":l(F)},{default:u(()=>[c(l(y),{modelValue:T.value,"onUpdate:modelValue":s[0]||=e=>T.value=e,"provider-name":l(j)?.localizedName,placeholder:`...`,required:``},null,8,[`modelValue`,`provider-name`]),c(l(_),{modelValue:E.value,"onUpdate:modelValue":s[1]||=e=>E.value=e,label:`Resouce name`,placeholder:`...`,description:`Prefix used in https://.services.ai.azure.com`,required:``},null,8,[`modelValue`]),c(l(_),{modelValue:O.value,"onUpdate:modelValue":s[2]||=e=>O.value=e,label:`Model id`,placeholder:`...`,description:`Model ID on Azure AI Foundry`,required:``},null,8,[`modelValue`])]),_:1},8,[`title`,`description`,`on-reset`]),c(l(m),{title:l(k)(`settings.pages.providers.common.section.advanced.title`)},{default:u(()=>[c(l(_),{modelValue:D.value,"onUpdate:modelValue":s[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`]),!l(N)&&l(M)===0&&l(P)?(r(),o(l(v),{key:0,type:`error`},n({title:u(()=>[i(a(l(k)(`settings.dialogs.onboarding.validationFailed`)),1)]),_:2},[l(P)?{name:`content`,fn:u(()=>[d(`div`,C,a(l(P)),1)]),key:`0`}:void 0]),1024)):t(``,!0),l(N)&&l(M)===0?(r(),o(l(v),{key:1,type:`success`},{title:u(()=>[i(a(l(k)(`settings.dialogs.onboarding.validationSuccess`)),1)]),_:1})):t(``,!0)]),_:1})]),_:1},8,[`provider-name`,`provider-icon-color`,`on-back`]))}});typeof x==`function`&&x(T);var E=T;export{E as default}; \ No newline at end of file diff --git a/assets/beat-sync-HWqNDh-f.js b/assets/beat-sync-BiFnmXe_.js similarity index 98% rename from assets/beat-sync-HWqNDh-f.js rename to assets/beat-sync-BiFnmXe_.js index 916f526ee7bb9f0695a9364c7731402dcbf49697..8b37b683981c961c40b868918391e2858edbc547 100644 --- a/assets/beat-sync-HWqNDh-f.js +++ b/assets/beat-sync-BiFnmXe_.js @@ -1 +1 @@ -import{A as e,C as t,G as n,J as r,K as i,O as a,Pt as o,S as s,Tt as c,W as l,at as u,k as d,kt as f,lt as p,m as ee,r as te,w as m,x as h,xt as g}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-CZ9Rvki9.js";import{l as _,p as v,r as y}from"./src-DYQXbDgu.js";import"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{A as b,B as x,C as S,D as C,E as w,F as T,H as E,I as D,L as O,M as k,N as ne,O as A,P as j,R as M,S as N,T as re,Tt as ie,V as ae,_ as oe,b as P,j as F,k as I,v as L,w as R,x as z,y as B,z as V}from"./components-BR_Kqwtu.js";import"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import{n as H}from"./vue-i18n.runtime-Dah5zGm4.js";import"./stream-transcription-_Xuw_VzN.js";import{a as U,i as W,n as G,o as K,r as q,s as J,t as se}from"./browser-DY5K31Vk.js";import{n as ce}from"./index.browser-Dc5HQ32a.js";import"./settings-D1kLcsvA.js";import"./__vite-browser-external-BaycPy5b.js";import{t as Y}from"./route-block-CpjdOEnv.js";var le=(e,t)=>{if(O(t,`<`)){let n=t[1]===`<`,r=e._tail,i=r?r._offset+r._delay:0;return n?i:i+r.duration}},X=(e,t)=>{let n=e.iterationDuration;if(n===1e-11&&(n=0),j(t))return n;if(F(+t))return+t;let r=t,i=e?e.labels:null,a=!b(i),o=le(e,r),s=!j(o),c=ae.exec(r);if(c){let e=c[0],t=r.split(e),l=a&&t[0]?i[t[0]]:n;return R(s?o:a?l:n,+t[1],e[0])}else return s?o:a?j(i[r])?n:i[r]:n};function ue(e){return C((e.iterationDuration+e._loopDelay)*e.iterationCount-e._loopDelay)||1e-11}function Z(e,t,n,r,i,a){let o=F(e.duration)&&e.duration<=1e-11?n-x:n;S(t,o,1,1,E.AUTO);let s=r?new oe(r,e,t,o,!1,i,a):new P(e,t,o);return s.init(!0),w(t,s),A(t,e=>{let n=e._offset+e._delay+e.duration;n>t.iterationDuration&&(t.iterationDuration=n)}),t.duration=ue(t),t}var de=class extends P{constructor(e={}){super(e,null,0),this.duration=0,this.labels={};let t=e.defaults,n=M.defaults;this.defaults=t?T(t,n):n,this.onRender=e.onRender||n.onRender;let r=re(e.playbackEase,n.playbackEase);this._ease=r?L(r):null,this.iterationDuration=0}add(e,t,n){let r=k(t),i=k(e);if(r||i){if(this._hasChildren=!0,r){let r=t;if(I(n)){let t=n,i=B(e),a=this.duration,o=this.iterationDuration,s=r.id,c=0,l=i.length;i.forEach(e=>{let n={...r};this.duration=a,this.iterationDuration=o,j(s)||(n.id=s+`-`+c),Z(n,this,X(this,t(e,c,l,this)),e,c,l),c++})}else Z(r,this,X(this,n),e)}else Z(e,this,X(this,t));return this.init(!0)}}sync(e,t){if(j(e)||e&&j(e.pause))return this;e.pause();let n=+(e.effect?e.effect.getTiming().duration:e.duration);return this.add(e,{currentTime:[0,n],duration:n,ease:`linear`},t)}set(e,t,n){return j(t)?this:(t.duration=x,t.composition=V.replace,this.add(e,t,n))}call(e,t){return j(e)||e&&!I(e)?this:this.add({duration:0,onComplete:()=>e(this)},t)}label(e,t){return j(e)||e&&!ne(e)||(this.labels[e]=X(this,t)),this}remove(e,t){return z(B(e),this,t),this}stretch(e){let t=this.duration;if(t===D(e))return this;let n=e/t,r=this.labels;for(let e in A(this,e=>e.stretch(e.duration*n)),r)r[e]*=n;return super.stretch(e)}refresh(){return A(this,e=>{e.refresh&&e.refresh()}),this}revert(){return super.revert(),A(this,e=>e.revert,!0),N(this)}then(e){return super.then(e)}},fe=e=>new de(e).init(),pe={flex:`~ col md:row gap-6`},me={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-[60%]`},he={flex:`~ col gap-6`},ge={flex:`~ col gap-4`},_e={class:`text-lg text-neutral-500 md:text-2xl dark:text-neutral-500`},ve={text:`neutral-400 dark:neutral-400`},ye={"max-w-full":``,flex:`~ row gap-4 wrap`},be={flex:`~ col gap-4`},xe={flex:`~ row`,"items-center":``,"justify-between":``},Q={class:`text-lg text-neutral-500 md:text-2xl dark:text-neutral-500`},Se={text:`neutral-400 dark:neutral-400`},Ce={"max-w-full":``,flex:`~ col gap-4`},we={class:`text text-neutral-500 md:text-xl dark:text-neutral-500`},Te={flex:`~ col gap-6 items-center`,class:`w-full md:w-[40%]`},Ee={class:`mb-4 text-lg text-neutral-500 md:text-2xl dark:text-neutral-400`,"w-full":``},De={class:`inline-flex items-center gap-4`},Oe={bg:`neutral/10`,"h-64px":``,"max-w-400px":``,"w-full":``,"overflow-hidden":``,"rounded-2xl":``},ke=[`data-beat-id`],$=e({__name:`beat-sync`,setup(e){let b=g(),x=g([]),S=g(!1),{t:C}=H(),w=g([]),T=g({...J});u(T,e=>K(c(e)),{deep:!0});function E(e){return((2**e-1)/1)**.5}function D(e,t){let n=e.dataset.beatId;fe().set(e,{opacity:1,scale:0}).add(e,{opacity:0,scale:1,duration:2e3,delay:0,ease:`out(5)`,onComplete:()=>{if(!n)return;let e=w.value.findIndex(e=>e.id===n);e>=0&&w.value.splice(e,1),t()}})}function O(){T.value={...J}}async function k(){x.value=Array.from(await se()),S.value?requestAnimationFrame(k):x.value=[0]}return u(b,async e=>{e?.isActive?S.value||(S.value=!0,k()):S.value=!1},{immediate:!0,deep:!0}),l(()=>{G().then(e=>b.value=e);let e=[W(e=>{b.value={...e}}),q(({energy:e})=>{w.value.unshift({id:ce(),energy:e,normalizedEnergy:E(e)})})],t=()=>e.forEach(e=>e());n(()=>t())}),n(()=>{S.value=!1}),(e,n)=>(i(),m(`div`,pe,[h(`div`,me,[h(`div`,he,[h(`div`,ge,[h(`div`,null,[h(`h2`,_e,o(f(C)(`settings.pages.modules.beat_sync.sections.audio_source.title`)),1),h(`div`,ve,[h(`span`,null,o(f(C)(`settings.pages.modules.beat_sync.sections.audio_source.description`)),1)])]),h(`div`,ye,[b.value?.isActive?(i(),s(f(y),{key:0,onClick:n[0]||=e=>f(U)(!1)},{default:p(()=>[a(o(f(C)(`settings.pages.modules.beat_sync.sections.audio_source.actions.stop`)),1)]),_:1})):(i(),s(f(y),{key:1,onClick:n[1]||=e=>f(U)(!0)},{default:p(()=>[a(o(f(C)(`settings.pages.modules.beat_sync.sections.audio_source.actions.start_screen_capture`)),1)]),_:1}))])]),h(`div`,be,[h(`div`,xe,[h(`div`,null,[h(`h2`,Q,o(f(C)(`settings.pages.modules.beat_sync.sections.parameters.title`)),1),h(`div`,Se,[h(`span`,null,o(f(C)(`settings.pages.modules.beat_sync.sections.parameters.description`)),1)])]),h(`button`,{title:`Reset settings`,flex:``,"items-center":``,"justify-center":``,"rounded-full":``,"p-2":``,transition:`all duration-250 ease-in-out`,text:`neutral-500 dark:neutral-400`,bg:`transparent dark:transparent hover:neutral-200 dark:hover:neutral-800 active:neutral-300 dark:active:neutral-700`,onClick:O},[...n[11]||=[h(`div`,{"i-solar:refresh-bold-duotone":``,"text-xl":``},null,-1)]])]),h(`div`,Ce,[d(f(_),{modelValue:T.value.sensitivity,"onUpdate:modelValue":n[2]||=e=>T.value.sensitivity=e,label:f(C)(`settings.pages.modules.beat_sync.sections.parameters.parameters.sensitivity.label`),min:0,max:1,step:.01,"format-value":e=>e.toFixed(1)},null,8,[`modelValue`,`label`,`format-value`]),d(f(_),{modelValue:T.value.minBeatInterval,"onUpdate:modelValue":n[3]||=e=>T.value.minBeatInterval=e,label:f(C)(`settings.pages.modules.beat_sync.sections.parameters.parameters.min_beat_interval.label`),description:f(C)(`settings.pages.modules.beat_sync.sections.parameters.parameters.min_beat_interval.description`),min:.05,max:1,step:.01,"format-value":e=>`${(60/e).toFixed(1)} BPM / ${e.toFixed(2)} s`},null,8,[`modelValue`,`label`,`description`,`format-value`]),h(`div`,null,[h(`h3`,we,o(f(C)(`settings.pages.modules.beat_sync.sections.parameters.advanced_parameters`)),1)]),d(f(_),{modelValue:T.value.lowpassFilterFrequency,"onUpdate:modelValue":n[4]||=e=>T.value.lowpassFilterFrequency=e,label:f(C)(`settings.pages.modules.beat_sync.sections.parameters.parameters.lowpass_filter_frequency.label`),description:f(C)(`settings.pages.modules.beat_sync.sections.parameters.parameters.lowpass_filter_frequency.description`),min:20,max:600,step:10,"format-value":e=>`${e.toFixed(0)} Hz`},null,8,[`modelValue`,`label`,`description`,`format-value`]),d(f(_),{modelValue:T.value.highpassFilterFrequency,"onUpdate:modelValue":n[5]||=e=>T.value.highpassFilterFrequency=e,label:f(C)(`settings.pages.modules.beat_sync.sections.parameters.parameters.highpass_filter_frequency.label`),description:f(C)(`settings.pages.modules.beat_sync.sections.parameters.parameters.highpass_filter_frequency.description`),min:150,max:2e3,step:10,"format-value":e=>`${e.toFixed(0)} Hz`},null,8,[`modelValue`,`label`,`description`,`format-value`]),d(f(_),{modelValue:T.value.envelopeFilterFrequency,"onUpdate:modelValue":n[6]||=e=>T.value.envelopeFilterFrequency=e,label:f(C)(`settings.pages.modules.beat_sync.sections.parameters.parameters.envelope_filter_frequency.label`),description:f(C)(`settings.pages.modules.beat_sync.sections.parameters.parameters.envelope_filter_frequency.description`),min:20,max:200,step:10,"format-value":e=>`${e.toFixed(0)} Hz`},null,8,[`modelValue`,`label`,`description`,`format-value`]),d(f(v),{modelValue:T.value.warmup,"onUpdate:modelValue":n[7]||=e=>T.value.warmup=e,label:f(C)(`settings.pages.modules.beat_sync.sections.parameters.parameters.warmup.label`),description:f(C)(`settings.pages.modules.beat_sync.sections.parameters.parameters.warmup.description`)},null,8,[`modelValue`,`label`,`description`]),d(f(v),{modelValue:T.value.adaptiveThreshold,"onUpdate:modelValue":n[8]||=e=>T.value.adaptiveThreshold=e,label:f(C)(`settings.pages.modules.beat_sync.sections.parameters.parameters.adaptive_threshold.label`),description:f(C)(`settings.pages.modules.beat_sync.sections.parameters.parameters.adaptive_threshold.description`)},null,8,[`modelValue`,`label`,`description`]),d(f(v),{modelValue:T.value.spectralFlux,"onUpdate:modelValue":n[9]||=e=>T.value.spectralFlux=e,label:f(C)(`settings.pages.modules.beat_sync.sections.parameters.parameters.spectral_flux.label`),description:f(C)(`settings.pages.modules.beat_sync.sections.parameters.parameters.spectral_flux.description`)},null,8,[`modelValue`,`label`,`description`]),d(f(_),{modelValue:T.value.bufferDuration,"onUpdate:modelValue":n[10]||=e=>T.value.bufferDuration=e,label:f(C)(`settings.pages.modules.beat_sync.sections.parameters.parameters.buffer_duration.label`),description:f(C)(`settings.pages.modules.beat_sync.sections.parameters.parameters.buffer_duration.description`),min:2,max:10,step:.5,"format-value":e=>`${e.toFixed(1)} s`},null,8,[`modelValue`,`label`,`description`,`format-value`])])])])]),h(`div`,Te,[h(`h2`,Ee,[h(`div`,De,o(f(C)(`settings.pages.modules.beat_sync.sections.beat_visualizer.title`)),1)]),h(`div`,Oe,[S.value?(i(),s(f(ie),{key:0,frequencies:x.value,"h-full":``,"w-full":``,"gap-0":``,"bars-class":`bg-primary-400/50 dark:bg-primary-500/50 rounded-none`},null,8,[`frequencies`])):t(``,!0)]),d(te,{tag:`div`,bg:`neutral/10`,relative:``,"box-border":``,"aspect-square":``,"h-full":``,"max-h-400px":``,"max-w-400px":``,"w-full":``,"rounded-2xl":``,flex:`~ row gap-2 wrap items-center`,css:!1,onEnter:D},{default:p(()=>[(i(!0),m(ee,null,r(w.value,e=>(i(),m(`div`,{key:e.id,"data-beat-id":e.id,absolute:``,"h-full":``,"w-full":``,"rounded-full":``,bg:`primary/50`},null,8,ke))),128))]),_:1})])]))}});typeof Y==`function`&&Y($);var Ae=$;export{Ae as default}; \ No newline at end of file +import{A as e,C as t,G as n,J as r,K as i,O as a,Pt as o,S as s,Tt as c,W as l,at as u,k as d,kt as f,lt as p,m as ee,r as te,w as m,x as h,xt as g}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-C0YByt49.js";import{l as _,p as v,r as y}from"./src-DYQXbDgu.js";import"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{A as b,B as x,C as S,D as C,E as w,F as T,H as E,I as D,L as O,M as k,N as ne,O as A,P as j,R as M,S as N,T as re,Tt as ie,V as ae,_ as oe,b as P,j as F,k as I,v as L,w as R,x as z,y as B,z as V}from"./components-CeE-UiLT.js";import"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import{n as H}from"./vue-i18n.runtime-Dah5zGm4.js";import"./stream-transcription-_Xuw_VzN.js";import{a as U,i as W,n as G,o as K,r as q,s as J,t as se}from"./browser-DY5K31Vk.js";import{n as ce}from"./index.browser-Dc5HQ32a.js";import"./settings-73vyHOZs.js";import"./__vite-browser-external-BaycPy5b.js";import{t as Y}from"./route-block-CpjdOEnv.js";var le=(e,t)=>{if(O(t,`<`)){let n=t[1]===`<`,r=e._tail,i=r?r._offset+r._delay:0;return n?i:i+r.duration}},X=(e,t)=>{let n=e.iterationDuration;if(n===1e-11&&(n=0),j(t))return n;if(F(+t))return+t;let r=t,i=e?e.labels:null,a=!b(i),o=le(e,r),s=!j(o),c=ae.exec(r);if(c){let e=c[0],t=r.split(e),l=a&&t[0]?i[t[0]]:n;return R(s?o:a?l:n,+t[1],e[0])}else return s?o:a?j(i[r])?n:i[r]:n};function ue(e){return C((e.iterationDuration+e._loopDelay)*e.iterationCount-e._loopDelay)||1e-11}function Z(e,t,n,r,i,a){let o=F(e.duration)&&e.duration<=1e-11?n-x:n;S(t,o,1,1,E.AUTO);let s=r?new oe(r,e,t,o,!1,i,a):new P(e,t,o);return s.init(!0),w(t,s),A(t,e=>{let n=e._offset+e._delay+e.duration;n>t.iterationDuration&&(t.iterationDuration=n)}),t.duration=ue(t),t}var de=class extends P{constructor(e={}){super(e,null,0),this.duration=0,this.labels={};let t=e.defaults,n=M.defaults;this.defaults=t?T(t,n):n,this.onRender=e.onRender||n.onRender;let r=re(e.playbackEase,n.playbackEase);this._ease=r?L(r):null,this.iterationDuration=0}add(e,t,n){let r=k(t),i=k(e);if(r||i){if(this._hasChildren=!0,r){let r=t;if(I(n)){let t=n,i=B(e),a=this.duration,o=this.iterationDuration,s=r.id,c=0,l=i.length;i.forEach(e=>{let n={...r};this.duration=a,this.iterationDuration=o,j(s)||(n.id=s+`-`+c),Z(n,this,X(this,t(e,c,l,this)),e,c,l),c++})}else Z(r,this,X(this,n),e)}else Z(e,this,X(this,t));return this.init(!0)}}sync(e,t){if(j(e)||e&&j(e.pause))return this;e.pause();let n=+(e.effect?e.effect.getTiming().duration:e.duration);return this.add(e,{currentTime:[0,n],duration:n,ease:`linear`},t)}set(e,t,n){return j(t)?this:(t.duration=x,t.composition=V.replace,this.add(e,t,n))}call(e,t){return j(e)||e&&!I(e)?this:this.add({duration:0,onComplete:()=>e(this)},t)}label(e,t){return j(e)||e&&!ne(e)||(this.labels[e]=X(this,t)),this}remove(e,t){return z(B(e),this,t),this}stretch(e){let t=this.duration;if(t===D(e))return this;let n=e/t,r=this.labels;for(let e in A(this,e=>e.stretch(e.duration*n)),r)r[e]*=n;return super.stretch(e)}refresh(){return A(this,e=>{e.refresh&&e.refresh()}),this}revert(){return super.revert(),A(this,e=>e.revert,!0),N(this)}then(e){return super.then(e)}},fe=e=>new de(e).init(),pe={flex:`~ col md:row gap-6`},me={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-[60%]`},he={flex:`~ col gap-6`},ge={flex:`~ col gap-4`},_e={class:`text-lg text-neutral-500 md:text-2xl dark:text-neutral-500`},ve={text:`neutral-400 dark:neutral-400`},ye={"max-w-full":``,flex:`~ row gap-4 wrap`},be={flex:`~ col gap-4`},xe={flex:`~ row`,"items-center":``,"justify-between":``},Q={class:`text-lg text-neutral-500 md:text-2xl dark:text-neutral-500`},Se={text:`neutral-400 dark:neutral-400`},Ce={"max-w-full":``,flex:`~ col gap-4`},we={class:`text text-neutral-500 md:text-xl dark:text-neutral-500`},Te={flex:`~ col gap-6 items-center`,class:`w-full md:w-[40%]`},Ee={class:`mb-4 text-lg text-neutral-500 md:text-2xl dark:text-neutral-400`,"w-full":``},De={class:`inline-flex items-center gap-4`},Oe={bg:`neutral/10`,"h-64px":``,"max-w-400px":``,"w-full":``,"overflow-hidden":``,"rounded-2xl":``},ke=[`data-beat-id`],$=e({__name:`beat-sync`,setup(e){let b=g(),x=g([]),S=g(!1),{t:C}=H(),w=g([]),T=g({...J});u(T,e=>K(c(e)),{deep:!0});function E(e){return((2**e-1)/1)**.5}function D(e,t){let n=e.dataset.beatId;fe().set(e,{opacity:1,scale:0}).add(e,{opacity:0,scale:1,duration:2e3,delay:0,ease:`out(5)`,onComplete:()=>{if(!n)return;let e=w.value.findIndex(e=>e.id===n);e>=0&&w.value.splice(e,1),t()}})}function O(){T.value={...J}}async function k(){x.value=Array.from(await se()),S.value?requestAnimationFrame(k):x.value=[0]}return u(b,async e=>{e?.isActive?S.value||(S.value=!0,k()):S.value=!1},{immediate:!0,deep:!0}),l(()=>{G().then(e=>b.value=e);let e=[W(e=>{b.value={...e}}),q(({energy:e})=>{w.value.unshift({id:ce(),energy:e,normalizedEnergy:E(e)})})],t=()=>e.forEach(e=>e());n(()=>t())}),n(()=>{S.value=!1}),(e,n)=>(i(),m(`div`,pe,[h(`div`,me,[h(`div`,he,[h(`div`,ge,[h(`div`,null,[h(`h2`,_e,o(f(C)(`settings.pages.modules.beat_sync.sections.audio_source.title`)),1),h(`div`,ve,[h(`span`,null,o(f(C)(`settings.pages.modules.beat_sync.sections.audio_source.description`)),1)])]),h(`div`,ye,[b.value?.isActive?(i(),s(f(y),{key:0,onClick:n[0]||=e=>f(U)(!1)},{default:p(()=>[a(o(f(C)(`settings.pages.modules.beat_sync.sections.audio_source.actions.stop`)),1)]),_:1})):(i(),s(f(y),{key:1,onClick:n[1]||=e=>f(U)(!0)},{default:p(()=>[a(o(f(C)(`settings.pages.modules.beat_sync.sections.audio_source.actions.start_screen_capture`)),1)]),_:1}))])]),h(`div`,be,[h(`div`,xe,[h(`div`,null,[h(`h2`,Q,o(f(C)(`settings.pages.modules.beat_sync.sections.parameters.title`)),1),h(`div`,Se,[h(`span`,null,o(f(C)(`settings.pages.modules.beat_sync.sections.parameters.description`)),1)])]),h(`button`,{title:`Reset settings`,flex:``,"items-center":``,"justify-center":``,"rounded-full":``,"p-2":``,transition:`all duration-250 ease-in-out`,text:`neutral-500 dark:neutral-400`,bg:`transparent dark:transparent hover:neutral-200 dark:hover:neutral-800 active:neutral-300 dark:active:neutral-700`,onClick:O},[...n[11]||=[h(`div`,{"i-solar:refresh-bold-duotone":``,"text-xl":``},null,-1)]])]),h(`div`,Ce,[d(f(_),{modelValue:T.value.sensitivity,"onUpdate:modelValue":n[2]||=e=>T.value.sensitivity=e,label:f(C)(`settings.pages.modules.beat_sync.sections.parameters.parameters.sensitivity.label`),min:0,max:1,step:.01,"format-value":e=>e.toFixed(1)},null,8,[`modelValue`,`label`,`format-value`]),d(f(_),{modelValue:T.value.minBeatInterval,"onUpdate:modelValue":n[3]||=e=>T.value.minBeatInterval=e,label:f(C)(`settings.pages.modules.beat_sync.sections.parameters.parameters.min_beat_interval.label`),description:f(C)(`settings.pages.modules.beat_sync.sections.parameters.parameters.min_beat_interval.description`),min:.05,max:1,step:.01,"format-value":e=>`${(60/e).toFixed(1)} BPM / ${e.toFixed(2)} s`},null,8,[`modelValue`,`label`,`description`,`format-value`]),h(`div`,null,[h(`h3`,we,o(f(C)(`settings.pages.modules.beat_sync.sections.parameters.advanced_parameters`)),1)]),d(f(_),{modelValue:T.value.lowpassFilterFrequency,"onUpdate:modelValue":n[4]||=e=>T.value.lowpassFilterFrequency=e,label:f(C)(`settings.pages.modules.beat_sync.sections.parameters.parameters.lowpass_filter_frequency.label`),description:f(C)(`settings.pages.modules.beat_sync.sections.parameters.parameters.lowpass_filter_frequency.description`),min:20,max:600,step:10,"format-value":e=>`${e.toFixed(0)} Hz`},null,8,[`modelValue`,`label`,`description`,`format-value`]),d(f(_),{modelValue:T.value.highpassFilterFrequency,"onUpdate:modelValue":n[5]||=e=>T.value.highpassFilterFrequency=e,label:f(C)(`settings.pages.modules.beat_sync.sections.parameters.parameters.highpass_filter_frequency.label`),description:f(C)(`settings.pages.modules.beat_sync.sections.parameters.parameters.highpass_filter_frequency.description`),min:150,max:2e3,step:10,"format-value":e=>`${e.toFixed(0)} Hz`},null,8,[`modelValue`,`label`,`description`,`format-value`]),d(f(_),{modelValue:T.value.envelopeFilterFrequency,"onUpdate:modelValue":n[6]||=e=>T.value.envelopeFilterFrequency=e,label:f(C)(`settings.pages.modules.beat_sync.sections.parameters.parameters.envelope_filter_frequency.label`),description:f(C)(`settings.pages.modules.beat_sync.sections.parameters.parameters.envelope_filter_frequency.description`),min:20,max:200,step:10,"format-value":e=>`${e.toFixed(0)} Hz`},null,8,[`modelValue`,`label`,`description`,`format-value`]),d(f(v),{modelValue:T.value.warmup,"onUpdate:modelValue":n[7]||=e=>T.value.warmup=e,label:f(C)(`settings.pages.modules.beat_sync.sections.parameters.parameters.warmup.label`),description:f(C)(`settings.pages.modules.beat_sync.sections.parameters.parameters.warmup.description`)},null,8,[`modelValue`,`label`,`description`]),d(f(v),{modelValue:T.value.adaptiveThreshold,"onUpdate:modelValue":n[8]||=e=>T.value.adaptiveThreshold=e,label:f(C)(`settings.pages.modules.beat_sync.sections.parameters.parameters.adaptive_threshold.label`),description:f(C)(`settings.pages.modules.beat_sync.sections.parameters.parameters.adaptive_threshold.description`)},null,8,[`modelValue`,`label`,`description`]),d(f(v),{modelValue:T.value.spectralFlux,"onUpdate:modelValue":n[9]||=e=>T.value.spectralFlux=e,label:f(C)(`settings.pages.modules.beat_sync.sections.parameters.parameters.spectral_flux.label`),description:f(C)(`settings.pages.modules.beat_sync.sections.parameters.parameters.spectral_flux.description`)},null,8,[`modelValue`,`label`,`description`]),d(f(_),{modelValue:T.value.bufferDuration,"onUpdate:modelValue":n[10]||=e=>T.value.bufferDuration=e,label:f(C)(`settings.pages.modules.beat_sync.sections.parameters.parameters.buffer_duration.label`),description:f(C)(`settings.pages.modules.beat_sync.sections.parameters.parameters.buffer_duration.description`),min:2,max:10,step:.5,"format-value":e=>`${e.toFixed(1)} s`},null,8,[`modelValue`,`label`,`description`,`format-value`])])])])]),h(`div`,Te,[h(`h2`,Ee,[h(`div`,De,o(f(C)(`settings.pages.modules.beat_sync.sections.beat_visualizer.title`)),1)]),h(`div`,Oe,[S.value?(i(),s(f(ie),{key:0,frequencies:x.value,"h-full":``,"w-full":``,"gap-0":``,"bars-class":`bg-primary-400/50 dark:bg-primary-500/50 rounded-none`},null,8,[`frequencies`])):t(``,!0)]),d(te,{tag:`div`,bg:`neutral/10`,relative:``,"box-border":``,"aspect-square":``,"h-full":``,"max-h-400px":``,"max-w-400px":``,"w-full":``,"rounded-2xl":``,flex:`~ row gap-2 wrap items-center`,css:!1,onEnter:D},{default:p(()=>[(i(!0),m(ee,null,r(w.value,e=>(i(),m(`div`,{key:e.id,"data-beat-id":e.id,absolute:``,"h-full":``,"w-full":``,"rounded-full":``,bg:`primary/50`},null,8,ke))),128))]),_:1})])]))}});typeof Y==`function`&&Y($);var Ae=$;export{Ae as default}; \ No newline at end of file diff --git a/assets/beat-sync-DNJSgBlH.js b/assets/beat-sync-CMy6-y_I.js similarity index 97% rename from assets/beat-sync-DNJSgBlH.js rename to assets/beat-sync-CMy6-y_I.js index e2c8621c7cdf34744ad60fd1a62cafaa6bf1ad23..f9dcbb079ffce4b29e6a3873a3107e9a818ce371 100644 --- a/assets/beat-sync-DNJSgBlH.js +++ b/assets/beat-sync-CMy6-y_I.js @@ -1 +1 @@ -import{A as e,C as t,K as n,Pt as r,W as i,at as a,b as o,k as s,kt as c,lt as l,w as u,x as d,xt as f,yt as p}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import{c as m,u as h}from"./widgets-CZ9Rvki9.js";import{c as ee,l as g,p as _,r as v}from"./src-DYQXbDgu.js";import"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import{v as y}from"./dist-Che88T83.js";import"./src-C83SCWbW.js";import"./components-BR_Kqwtu.js";import"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-D1kLcsvA.js";import"./__vite-browser-external-BaycPy5b.js";import{t as b}from"./beat-sync-GCfX3UHH.js";var x={class:`grid gap-4 p-4 lg:grid-cols-[2fr_1fr]`},S={class:`flex flex-wrap items-center gap-3`},C={class:`grid gap-4 md:grid-cols-2`},w={class:`text-sm text-neutral-800 dark:text-neutral-100`},T={class:`grid gap-4 md:grid-cols-2`},E={class:`grid gap-4 md:grid-cols-2`},D={class:`h-80 w-full overflow-hidden border border-neutral-200/70 rounded-xl bg-neutral-900/80 dark:border-neutral-800/60`},te={class:`space-y-3`},O={class:`text-sm text-neutral-500 dark:text-neutral-400`},k={class:`text-xs text-neutral-500 space-y-1 dark:text-neutral-400`},A={key:0},j=4e3,M=e({__name:`beat-sync`,setup(e){let M=f(0),N=f(0),P=f(0),F=f(6),I=f(.08),L=f(`punchy-v`),R=f(!1),z=b({baseAngles:()=>({x:M.value,y:N.value,z:P.value}),initialStyle:L.value,autoStyleShift:R.value}),B=p({angleX:M.value,angleY:N.value,angleZ:P.value,velX:0,velY:0,velZ:0,last:performance.now()}),V=f([]),H=f([]),U=f(),W=o(()=>z.debugState()),G=f(performance.now()),K=[{label:`Punchy V (10/8/4)`,value:`punchy-v`},{label:`Balanced V (6/0/6)`,value:`balanced-v`},{label:`Swing L/R (A-shape side-to-side)`,value:`swing-lr`},{label:`Sway Sine (lifted arc between sides)`,value:`sway-sine`}];a(L,e=>z.setStyle(e)),a(R,e=>z.setAutoStyleShift(e));let q=o(()=>({x:z.targetX.value,y:z.targetY.value,z:z.targetZ.value})),J=e=>`${e.toFixed(1)}°`,Y=e=>`${e.toFixed(1)} px/deg`,X=e=>e.toFixed(2);function Z(e){let t=e-B.last;if(Number.isFinite(t)){B.last=e,z.updateTargets(e);{let e=z.targetX.value,n=B.angleX,r=B.velX;B.velX=r+(120*(e-n)-16*r)/1*t,B.angleX=n+B.velX*t}{let e=z.targetY.value,n=B.angleY,r=B.velY;B.velY=r+(120*(e-n)-16*r)/1*t,B.angleY=n+B.velY*t}{let e=z.targetZ.value,n=B.angleZ,r=B.velZ;B.velZ=r+(120*(e-n)-16*r)/1*t,B.angleZ=n+B.velZ*t}}}function Q(e){if(!Number.isFinite(B.angleX)||!Number.isFinite(B.angleZ))return;V.value.push({x:B.angleX,y:B.angleZ,t:e}),H.value.push({t:e,x:B.angleX,y:B.angleY,z:B.angleZ});let t=e-j;for(;V.value.length&&V.value[0].t{let n=a+e.x*F.value,r=o-e.y*F.value;t===0?i.moveTo(n,r):i.lineTo(n,r)}),i.stroke();let s=V.value[V.value.length-1];s&&(i.beginPath(),i.arc(a+s.x*F.value,o-s.y*F.value,5,0,Math.PI*2),i.fill()),i.fillStyle=`rgba(244,114,182,0.8)`,i.beginPath(),i.arc(a+z.targetY.value*F.value,o-z.targetZ.value*F.value,4,0,Math.PI*2),i.fill(),i.restore()}y(({timestamp:e})=>{G.value=e,Z(e),Q(e),$()}),i(()=>{Q(performance.now()),$()});function ne(){z.scheduleBeat(performance.now())}function re(){let e=performance.now();z.scheduleBeat(e),z.scheduleBeat(e+180),z.scheduleBeat(e+360)}return(e,i)=>(n(),u(`div`,x,[s(c(m),{title:`Beat sync driver`,icon:`i-solar:cursor-linear`,"inner-class":`gap-4`},{default:l(()=>[d(`div`,S,[s(c(v),{label:`Hit beat`,icon:`i-solar:flash-bold-duotone`,size:`sm`,onClick:ne}),s(c(v),{label:`Hit V sequence`,icon:`i-solar:repeat-one-minimalistic-bold-duotone`,size:`sm`,variant:`secondary`,onClick:re}),s(c(_),{modelValue:R.value,"onUpdate:modelValue":i[0]||=e=>R.value=e,class:`min-w-[240px]`,label:`Auto style by BPM`,description:`Switch styles based on detected tempo`},null,8,[`modelValue`])]),d(`div`,C,[s(c(ee),{modelValue:L.value,"onUpdate:modelValue":i[1]||=e=>L.value=e,label:`Style`,description:`Choose how head motion is sculpted between beats`,options:K,layout:`vertical`,"select-class":`w-full`},null,8,[`modelValue`]),s(c(h),{label:`Current targets`,theme:`violet`},{default:l(()=>[d(`div`,w,` X/Y/Z: `+r(q.value.x.toFixed(2))+` / `+r(q.value.y.toFixed(2))+` / `+r(q.value.z.toFixed(2)),1),i[7]||=d(`div`,{class:`text-xs text-neutral-500 dark:text-neutral-400`},` Live targets fed into the spring solver. `,-1)]),_:1})]),d(`div`,T,[s(c(g),{modelValue:M.value,"onUpdate:modelValue":i[2]||=e=>M.value=e,label:`Base X`,description:`Baseline tilt forward/back`,min:-20,max:20,step:.1,"format-value":J},null,8,[`modelValue`]),s(c(g),{modelValue:N.value,"onUpdate:modelValue":i[3]||=e=>N.value=e,label:`Base Y`,description:`Baseline tilt left/right`,min:-20,max:20,step:.1,"format-value":J},null,8,[`modelValue`]),s(c(g),{modelValue:P.value,"onUpdate:modelValue":i[4]||=e=>P.value=e,label:`Base Z`,description:`Baseline roll`,min:-20,max:20,step:.1,"format-value":J},null,8,[`modelValue`]),s(c(g),{modelValue:F.value,"onUpdate:modelValue":i[5]||=e=>F.value=e,label:`Scale (px/deg)`,description:`Trail & marker scale`,min:2,max:18,step:.5,"format-value":Y},null,8,[`modelValue`])]),d(`div`,E,[s(c(g),{modelValue:I.value,"onUpdate:modelValue":i[6]||=e=>I.value=e,label:`Trail fade`,description:`Overlay alpha for XY trace`,min:.02,max:.3,step:.01,"format-value":X},null,8,[`modelValue`]),s(c(h),{label:`Controller`,theme:`lime`},{default:l(()=>[...i[8]||=[d(`div`,{class:`text-xs text-neutral-700 dark:text-neutral-200`},` Beat targets update each frame; the spring here mirrors the runtime Live2D hook. `,-1)]]),_:1})]),d(`div`,D,[d(`canvas`,{ref_key:`canvasXY`,ref:U,class:`h-full w-full`},null,512)])]),_:1}),s(c(m),{title:`Signals & debug`,icon:`i-solar:chart-2-bold-duotone`,"inner-class":`gap-4`},{default:l(()=>[d(`div`,te,[d(`div`,O,` Scalars (Y / Z over time, last `+r((j/1e3).toFixed(1))+`s) `,1)]),s(c(h),{label:`Spring model`,theme:`orange`},{default:l(()=>[...i[9]||=[d(`div`,{class:`text-xs text-neutral-700 dark:text-neutral-200`},` Semi-implicit Euler spring matches Live2D hook (stiffness 120, damping 16). Targets driven by beat controller. `,-1)]]),_:1}),d(`div`,k,[d(`div`,null,`Style: `+r(W.value.style),1),d(`div`,null,`BPM (avg): `+r(W.value.bpm?W.value.bpm.toFixed(1):`—`),1),d(`div`,null,`Primed: `+r(W.value.primed),1),d(`div`,null,`Pattern started: `+r(W.value.patternStarted),1),d(`div`,null,`Segments: `+r(W.value.segments.length),1),W.value.segments.length?(n(),u(`div`,A,` Next segment: toY `+r(W.value.segments[0].toY.toFixed(2))+`, toZ `+r(W.value.segments[0].toZ.toFixed(2))+`, starts in `+r(Math.max(0,W.value.segments[0].start-G.value).toFixed(0))+` ms `,1)):t(``,!0)])]),_:1})]))}});export{M as default}; \ No newline at end of file +import{A as e,C as t,K as n,Pt as r,W as i,at as a,b as o,k as s,kt as c,lt as l,w as u,x as d,xt as f,yt as p}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import{c as m,u as h}from"./widgets-C0YByt49.js";import{c as ee,l as g,p as _,r as v}from"./src-DYQXbDgu.js";import"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import{v as y}from"./dist-Che88T83.js";import"./src-C83SCWbW.js";import"./components-CeE-UiLT.js";import"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-73vyHOZs.js";import"./__vite-browser-external-BaycPy5b.js";import{t as b}from"./beat-sync-GCfX3UHH.js";var x={class:`grid gap-4 p-4 lg:grid-cols-[2fr_1fr]`},S={class:`flex flex-wrap items-center gap-3`},C={class:`grid gap-4 md:grid-cols-2`},w={class:`text-sm text-neutral-800 dark:text-neutral-100`},T={class:`grid gap-4 md:grid-cols-2`},E={class:`grid gap-4 md:grid-cols-2`},D={class:`h-80 w-full overflow-hidden border border-neutral-200/70 rounded-xl bg-neutral-900/80 dark:border-neutral-800/60`},te={class:`space-y-3`},O={class:`text-sm text-neutral-500 dark:text-neutral-400`},k={class:`text-xs text-neutral-500 space-y-1 dark:text-neutral-400`},A={key:0},j=4e3,M=e({__name:`beat-sync`,setup(e){let M=f(0),N=f(0),P=f(0),F=f(6),I=f(.08),L=f(`punchy-v`),R=f(!1),z=b({baseAngles:()=>({x:M.value,y:N.value,z:P.value}),initialStyle:L.value,autoStyleShift:R.value}),B=p({angleX:M.value,angleY:N.value,angleZ:P.value,velX:0,velY:0,velZ:0,last:performance.now()}),V=f([]),H=f([]),U=f(),W=o(()=>z.debugState()),G=f(performance.now()),K=[{label:`Punchy V (10/8/4)`,value:`punchy-v`},{label:`Balanced V (6/0/6)`,value:`balanced-v`},{label:`Swing L/R (A-shape side-to-side)`,value:`swing-lr`},{label:`Sway Sine (lifted arc between sides)`,value:`sway-sine`}];a(L,e=>z.setStyle(e)),a(R,e=>z.setAutoStyleShift(e));let q=o(()=>({x:z.targetX.value,y:z.targetY.value,z:z.targetZ.value})),J=e=>`${e.toFixed(1)}°`,Y=e=>`${e.toFixed(1)} px/deg`,X=e=>e.toFixed(2);function Z(e){let t=e-B.last;if(Number.isFinite(t)){B.last=e,z.updateTargets(e);{let e=z.targetX.value,n=B.angleX,r=B.velX;B.velX=r+(120*(e-n)-16*r)/1*t,B.angleX=n+B.velX*t}{let e=z.targetY.value,n=B.angleY,r=B.velY;B.velY=r+(120*(e-n)-16*r)/1*t,B.angleY=n+B.velY*t}{let e=z.targetZ.value,n=B.angleZ,r=B.velZ;B.velZ=r+(120*(e-n)-16*r)/1*t,B.angleZ=n+B.velZ*t}}}function Q(e){if(!Number.isFinite(B.angleX)||!Number.isFinite(B.angleZ))return;V.value.push({x:B.angleX,y:B.angleZ,t:e}),H.value.push({t:e,x:B.angleX,y:B.angleY,z:B.angleZ});let t=e-j;for(;V.value.length&&V.value[0].t{let n=a+e.x*F.value,r=o-e.y*F.value;t===0?i.moveTo(n,r):i.lineTo(n,r)}),i.stroke();let s=V.value[V.value.length-1];s&&(i.beginPath(),i.arc(a+s.x*F.value,o-s.y*F.value,5,0,Math.PI*2),i.fill()),i.fillStyle=`rgba(244,114,182,0.8)`,i.beginPath(),i.arc(a+z.targetY.value*F.value,o-z.targetZ.value*F.value,4,0,Math.PI*2),i.fill(),i.restore()}y(({timestamp:e})=>{G.value=e,Z(e),Q(e),$()}),i(()=>{Q(performance.now()),$()});function ne(){z.scheduleBeat(performance.now())}function re(){let e=performance.now();z.scheduleBeat(e),z.scheduleBeat(e+180),z.scheduleBeat(e+360)}return(e,i)=>(n(),u(`div`,x,[s(c(m),{title:`Beat sync driver`,icon:`i-solar:cursor-linear`,"inner-class":`gap-4`},{default:l(()=>[d(`div`,S,[s(c(v),{label:`Hit beat`,icon:`i-solar:flash-bold-duotone`,size:`sm`,onClick:ne}),s(c(v),{label:`Hit V sequence`,icon:`i-solar:repeat-one-minimalistic-bold-duotone`,size:`sm`,variant:`secondary`,onClick:re}),s(c(_),{modelValue:R.value,"onUpdate:modelValue":i[0]||=e=>R.value=e,class:`min-w-[240px]`,label:`Auto style by BPM`,description:`Switch styles based on detected tempo`},null,8,[`modelValue`])]),d(`div`,C,[s(c(ee),{modelValue:L.value,"onUpdate:modelValue":i[1]||=e=>L.value=e,label:`Style`,description:`Choose how head motion is sculpted between beats`,options:K,layout:`vertical`,"select-class":`w-full`},null,8,[`modelValue`]),s(c(h),{label:`Current targets`,theme:`violet`},{default:l(()=>[d(`div`,w,` X/Y/Z: `+r(q.value.x.toFixed(2))+` / `+r(q.value.y.toFixed(2))+` / `+r(q.value.z.toFixed(2)),1),i[7]||=d(`div`,{class:`text-xs text-neutral-500 dark:text-neutral-400`},` Live targets fed into the spring solver. `,-1)]),_:1})]),d(`div`,T,[s(c(g),{modelValue:M.value,"onUpdate:modelValue":i[2]||=e=>M.value=e,label:`Base X`,description:`Baseline tilt forward/back`,min:-20,max:20,step:.1,"format-value":J},null,8,[`modelValue`]),s(c(g),{modelValue:N.value,"onUpdate:modelValue":i[3]||=e=>N.value=e,label:`Base Y`,description:`Baseline tilt left/right`,min:-20,max:20,step:.1,"format-value":J},null,8,[`modelValue`]),s(c(g),{modelValue:P.value,"onUpdate:modelValue":i[4]||=e=>P.value=e,label:`Base Z`,description:`Baseline roll`,min:-20,max:20,step:.1,"format-value":J},null,8,[`modelValue`]),s(c(g),{modelValue:F.value,"onUpdate:modelValue":i[5]||=e=>F.value=e,label:`Scale (px/deg)`,description:`Trail & marker scale`,min:2,max:18,step:.5,"format-value":Y},null,8,[`modelValue`])]),d(`div`,E,[s(c(g),{modelValue:I.value,"onUpdate:modelValue":i[6]||=e=>I.value=e,label:`Trail fade`,description:`Overlay alpha for XY trace`,min:.02,max:.3,step:.01,"format-value":X},null,8,[`modelValue`]),s(c(h),{label:`Controller`,theme:`lime`},{default:l(()=>[...i[8]||=[d(`div`,{class:`text-xs text-neutral-700 dark:text-neutral-200`},` Beat targets update each frame; the spring here mirrors the runtime Live2D hook. `,-1)]]),_:1})]),d(`div`,D,[d(`canvas`,{ref_key:`canvasXY`,ref:U,class:`h-full w-full`},null,512)])]),_:1}),s(c(m),{title:`Signals & debug`,icon:`i-solar:chart-2-bold-duotone`,"inner-class":`gap-4`},{default:l(()=>[d(`div`,te,[d(`div`,O,` Scalars (Y / Z over time, last `+r((j/1e3).toFixed(1))+`s) `,1)]),s(c(h),{label:`Spring model`,theme:`orange`},{default:l(()=>[...i[9]||=[d(`div`,{class:`text-xs text-neutral-700 dark:text-neutral-200`},` Semi-implicit Euler spring matches Live2D hook (stiffness 120, damping 16). Targets driven by beat controller. `,-1)]]),_:1}),d(`div`,k,[d(`div`,null,`Style: `+r(W.value.style),1),d(`div`,null,`BPM (avg): `+r(W.value.bpm?W.value.bpm.toFixed(1):`—`),1),d(`div`,null,`Primed: `+r(W.value.primed),1),d(`div`,null,`Pattern started: `+r(W.value.patternStarted),1),d(`div`,null,`Segments: `+r(W.value.segments.length),1),W.value.segments.length?(n(),u(`div`,A,` Next segment: toY `+r(W.value.segments[0].toY.toFixed(2))+`, toZ `+r(W.value.segments[0].toZ.toFixed(2))+`, starts in `+r(Math.max(0,W.value.segments[0].start-G.value).toFixed(0))+` ms `,1)):t(``,!0)])]),_:1})]))}});export{M as default}; \ No newline at end of file diff --git a/assets/chat-CSFza6dY.js b/assets/chat-CxQ_IGrj.js similarity index 99% rename from assets/chat-CSFza6dY.js rename to assets/chat-CxQ_IGrj.js index f77ccc41d6df4f182ffcf9b8087b9a0e939c288d..5a52dd9619b5eef96b1fe14532997e118457a901 100644 --- a/assets/chat-CSFza6dY.js +++ b/assets/chat-CxQ_IGrj.js @@ -1,2 +1,2 @@ -import{Tt as e,at as t,b as n,xt as r}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import{a as i,i as a}from"./resettable-CbXzRviW.js";import{f as o}from"./dist-Che88T83.js";import{g as s,h as c}from"./components-BR_Kqwtu.js";import{a as l,c as u,o as d,s as f}from"./speech-6W29lyZ_.js";import{_ as p,c as m,d as h,l as g}from"./stream-transcription-_Xuw_VzN.js";import{t as _}from"./llmmarkerParser-CpinDrSK.js";import{n as v,r as y}from"./index-Cx_srAfm-DhadnX4q.js";import{$ as b,$n as x,$t as S,A as C,An as w,At as T,B as ee,Bn as te,Bt as ne,C as re,Ct as ie,D as E,Dn as D,Dt as O,E as k,En as A,Et as ae,F as j,Fn as oe,Ft as se,G as ce,Gn as M,Gt as le,H as N,Hn as P,Ht as ue,I as de,It as fe,J as pe,Jn as me,Jt as he,K as ge,Kn as _e,Kt as ve,L as ye,Lt as be,M as F,Mn as xe,Mt as Se,N as Ce,Nn as we,Nt as Te,O as Ee,On as De,Ot as Oe,P as I,Pn as ke,Pt as Ae,Q as je,Qn as Me,Qt as Ne,R as Pe,Rn as Fe,Rt as Ie,S as Le,St as Re,T as ze,Tn as Be,Tt as Ve,U as He,Un as Ue,Ut as We,V as Ge,Vn as Ke,W as qe,Wn as Je,Wt as Ye,X as Xe,Xn as Ze,Xt as Qe,Y as $e,Yn as L,Yt as et,Z as tt,Zn as nt,Zt as rt,_ as R,_t as it,a as at,at as ot,b as st,bt as ct,c as lt,ct as z,d as ut,dt,en as ft,er as pt,et as mt,f as ht,ft as gt,g as B,gt as _t,h as vt,ht as yt,i as bt,ir as V,it as xt,j as H,jn as St,jt as Ct,k as wt,kn as Tt,kt as Et,l as Dt,m as Ot,mt as kt,nn as At,nt as jt,o as Mt,ot as Nt,p as Pt,pt as Ft,q as It,qn as Lt,qt as Rt,r as zt,rr as Bt,rt as Vt,tn as Ht,tr as Ut,tt as Wt,u as Gt,ut as Kt,v as qt,vt as Jt,w as Yt,wn as Xt,wt as Zt,x as Qt,xt as $t,y as en,yt as tn,z as nn,zt as rn}from"./core-Bb6Rlujp.js";import{t as an}from"./airi-card-DuhaYjQU.js";var on=e=>{if(!e||!e.startsWith(`data:`))return[void 0,!1];let t=e.slice(5),n=t.startsWith(` `)?t.slice(1):t;if(n===`[DONE]`)return[void 0,!0];if(n.startsWith(`{`)&&n.includes(`"error":`))throw Error(`Error from server: ${n}`);return[JSON.parse(n),!1]},sn=()=>{let e=new TextDecoder,t=``;return new TransformStream({transform:async(n,r)=>{let i=e.decode(n,{stream:!0});t+=i;let a=t.split(` +import{Tt as e,at as t,b as n,xt as r}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import{a as i,i as a}from"./resettable-CbXzRviW.js";import{f as o}from"./dist-Che88T83.js";import{g as s,h as c}from"./components-CeE-UiLT.js";import{a as l,c as u,o as d,s as f}from"./speech-6W29lyZ_.js";import{_ as p,c as m,d as h,l as g}from"./stream-transcription-_Xuw_VzN.js";import{t as _}from"./llmmarkerParser-CpinDrSK.js";import{n as v,r as y}from"./index-Cx_srAfm-DhadnX4q.js";import{$ as b,$n as x,$t as S,A as C,An as w,At as T,B as ee,Bn as te,Bt as ne,C as re,Ct as ie,D as E,Dn as D,Dt as O,E as k,En as A,Et as ae,F as j,Fn as oe,Ft as se,G as ce,Gn as M,Gt as le,H as N,Hn as P,Ht as ue,I as de,It as fe,J as pe,Jn as me,Jt as he,K as ge,Kn as _e,Kt as ve,L as ye,Lt as be,M as F,Mn as xe,Mt as Se,N as Ce,Nn as we,Nt as Te,O as Ee,On as De,Ot as Oe,P as I,Pn as ke,Pt as Ae,Q as je,Qn as Me,Qt as Ne,R as Pe,Rn as Fe,Rt as Ie,S as Le,St as Re,T as ze,Tn as Be,Tt as Ve,U as He,Un as Ue,Ut as We,V as Ge,Vn as Ke,W as qe,Wn as Je,Wt as Ye,X as Xe,Xn as Ze,Xt as Qe,Y as $e,Yn as L,Yt as et,Z as tt,Zn as nt,Zt as rt,_ as R,_t as it,a as at,at as ot,b as st,bt as ct,c as lt,ct as z,d as ut,dt,en as ft,er as pt,et as mt,f as ht,ft as gt,g as B,gt as _t,h as vt,ht as yt,i as bt,ir as V,it as xt,j as H,jn as St,jt as Ct,k as wt,kn as Tt,kt as Et,l as Dt,m as Ot,mt as kt,nn as At,nt as jt,o as Mt,ot as Nt,p as Pt,pt as Ft,q as It,qn as Lt,qt as Rt,r as zt,rr as Bt,rt as Vt,tn as Ht,tr as Ut,tt as Wt,u as Gt,ut as Kt,v as qt,vt as Jt,w as Yt,wn as Xt,wt as Zt,x as Qt,xt as $t,y as en,yt as tn,z as nn,zt as rn}from"./core-Bb6Rlujp.js";import{t as an}from"./airi-card-DuhaYjQU.js";var on=e=>{if(!e||!e.startsWith(`data:`))return[void 0,!1];let t=e.slice(5),n=t.startsWith(` `)?t.slice(1):t;if(n===`[DONE]`)return[void 0,!0];if(n.startsWith(`{`)&&n.includes(`"error":`))throw Error(`Error from server: ${n}`);return[JSON.parse(n),!1]},sn=()=>{let e=new TextDecoder,t=``;return new TransformStream({transform:async(n,r)=>{let i=e.decode(n,{stream:!0});t+=i;let a=t.split(` `);t=a.pop()??``;for(let e of a)try{let[t,n]=on(e);if(n)break;t&&r.enqueue(t)}catch(e){r.error(e)}}})},cn=e=>{let t=[],n=structuredClone(e.messages),r=e.maxSteps??1,i,a,o=new m,s=new m,c=new m,u=new m,g,_,v=new ReadableStream({start:e=>g=e}),y=new ReadableStream({start:e=>_=e}),b=t=>{g?.enqueue(t),e.onEvent?.(t)},x=n=>{t.push(n),e.onStepFinish?.(n)},S=async()=>{let{body:o}=await l({...e,maxSteps:void 0,messages:n,stream:!0,streamOptions:e.streamOptions==null?void 0:h(e.streamOptions)}),s=e=>{i=e,a=a?{completion_tokens:a.completion_tokens+e.completion_tokens,prompt_tokens:a.prompt_tokens+e.prompt_tokens,total_tokens:a.total_tokens+e.total_tokens}:{...e}},c=``,u=e=>{_?.enqueue(e),c+=e},p=[],m=[],v=[],y=`other`;if(await o.pipeThrough(sn()).pipeTo(new WritableStream({abort:e=>{g?.error(e),_?.error(e)},close:()=>{},write:e=>{if(e.usage&&s(e.usage),e.choices==null||e.choices.length===0)return;let t=e.choices[0];if(t.delta.reasoning_content!=null&&b({text:t.delta.reasoning_content,type:`reasoning-delta`}),t.finish_reason!=null&&(y=t.finish_reason),t.delta.tool_calls?.length===0||t.delta.tool_calls==null)t.delta.content==null?t.delta.refusal==null?t.finish_reason!=null&&b({finishReason:t.finish_reason,type:`finish`,usage:i}):b({error:t.delta.refusal,type:`error`}):(b({text:t.delta.content,type:`text-delta`}),u(t.delta.content));else for(let e of t.delta.tool_calls){let{index:t}=e;p.at(t)?(p[t].function.arguments+=e.function.arguments,b({argsTextDelta:e.function.arguments,toolCallId:e.id,toolName:e.function.name??p[t].function.name,type:`tool-call-delta`})):(p[t]={...e,function:{...e.function,arguments:e.function.arguments??``}},b({toolCallId:e.id,toolName:e.function.name,type:`tool-call-streaming-start`}))}}})),n.push({content:c,role:`assistant`,tool_calls:p}),p.length!==0)for(let t of p){if(t==null)continue;let{completionToolCall:r,completionToolResult:i,message:a}=await f({abortSignal:e.abortSignal,messages:n,toolCall:t,tools:e.tools});m.push(r),v.push(i),n.push(a),b({...r,type:`tool-call`}),b({...i,type:`tool-result`})}else b({finishReason:y,type:`finish`,usage:i});if(x({finishReason:y,stepType:d({finishReason:y,maxSteps:r,stepsLength:t.length,toolCallsLength:m.length}),text:c,toolCalls:m,toolResults:v,usage:i}),m.length!==0&&t.lengthS()};return(async()=>{try{await p(async()=>S()),g?.close(),_?.close()}catch(e){g?.error(e),_?.error(e),o.reject(e),s.reject(e),c.reject(e),u.reject(e)}finally{o.resolve(t),s.resolve(n),c.resolve(i),u.resolve(a),e.onFinish?.(t.at(-1))}})(),{fullStream:v,messages:s.promise,steps:o.promise,textStream:y,totalUsage:u.promise,usage:c.promise}},U=async({description:e,execute:t,name:n,parameters:r,strict:i})=>{let a=await y(r);return{execute:t,function:{description:e,name:n,parameters:i===!1?a:v(a),strict:i??!0},type:`function`}};const ln=V(`ZodISODateTime`,(e,t)=>{Et.init(e,t),q.init(e,t)});function un(e){return Yt(ln,e)}const dn=V(`ZodISODate`,(e,t)=>{Oe.init(e,t),q.init(e,t)});function fn(e){return re(dn,e)}const pn=V(`ZodISOTime`,(e,t)=>{Ct.init(e,t),q.init(e,t)});function mn(e){return k(pn,e)}const hn=V(`ZodISODuration`,(e,t)=>{T.init(e,t),q.init(e,t)});function gn(e){return ze(hn,e)}var _n=(e,t)=>{Fe.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Ke(e,t)},flatten:{value:t=>te(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,_e,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,_e,2)}},isEmpty:{get(){return e.issues.length===0}}})};V(`ZodError`,_n);const W=V(`ZodError`,_n,{Parent:Error}),vn=De(W),yn=Tt(W),bn=ke(W),xn=oe(W),Sn=A(W),Cn=Xt(W),wn=D(W),Tn=Be(W),En=xe(W),Dn=w(W),On=we(W),kn=St(W),G=V(`ZodType`,(e,t)=>(Qe.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,`_def`,{value:t}),e.check=(...n)=>e.clone(me(t,{checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]})),e.clone=(t,n)=>P(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>vn(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>bn(e,t,n),e.parseAsync=async(t,n)=>yn(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>xn(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Sn(e,t,n),e.decode=(t,n)=>Cn(e,t,n),e.encodeAsync=async(t,n)=>wn(e,t,n),e.decodeAsync=async(t,n)=>Tn(e,t,n),e.safeEncode=(t,n)=>En(e,t,n),e.safeDecode=(t,n)=>Dn(e,t,n),e.safeEncodeAsync=async(t,n)=>On(e,t,n),e.safeDecodeAsync=async(t,n)=>kn(e,t,n),e.refine=(t,n)=>e.check(jr(t,n)),e.superRefine=t=>e.check(Mr(t)),e.overwrite=t=>e.check(ee(t)),e.optional=()=>gr(e),e.nullable=()=>Q(e),e.nullish=()=>gr(Q(e)),e.nonoptional=t=>Cr(e,t),e.array=()=>Y(e),e.or=t=>lr([e,t]),e.and=t=>dr(e,t),e.transform=t=>Dr(e,mr(t)),e.default=t=>yr(e,t),e.prefault=t=>xr(e,t),e.catch=t=>Tr(e,t),e.pipe=t=>Dr(e,t),e.readonly=()=>kr(e),e.describe=t=>{let n=e.clone();return z.add(n,{description:t}),n},Object.defineProperty(e,`description`,{get(){return z.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return z.get(e);let n=e.clone();return z.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),An=V(`_ZodString`,(e,t)=>{Rt.init(e,t),G.init(e,t);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(N(...t)),e.includes=(...t)=>e.check(en(...t)),e.startsWith=(...t)=>e.check(qe(...t)),e.endsWith=(...t)=>e.check(vt(...t)),e.min=(...t)=>e.check(I(...t)),e.max=(...t)=>e.check(Ce(...t)),e.length=(...t)=>e.check(wt(...t)),e.nonempty=(...t)=>e.check(I(1,...t)),e.lowercase=t=>e.check(C(t)),e.uppercase=t=>e.check(je(t)),e.trim=()=>e.check($e()),e.normalize=(...t)=>e.check(Pe(...t)),e.toLowerCase=()=>e.check(It()),e.toUpperCase=()=>e.check(pe()),e.slugify=()=>e.check(He())}),jn=V(`ZodString`,(e,t)=>{Rt.init(e,t),An.init(e,t),e.email=t=>e.check(Pt(Mn,t)),e.url=t=>e.check(b(Pn,t)),e.jwt=t=>e.check(E(Yn,t)),e.emoji=t=>e.check(Ot(Fn,t)),e.guid=t=>e.check(qt(Nn,t)),e.uuid=t=>e.check(mt(J,t)),e.uuidv4=t=>e.check(Wt(J,t)),e.uuidv6=t=>e.check(jt(J,t)),e.uuidv7=t=>e.check(Vt(J,t)),e.nanoid=t=>e.check(de(In,t)),e.guid=t=>e.check(qt(Nn,t)),e.cuid=t=>e.check(Gt(Ln,t)),e.cuid2=t=>e.check(ut(Rn,t)),e.ulid=t=>e.check(Xe(zn,t)),e.base64=t=>e.check(bt(Kn,t)),e.base64url=t=>e.check(at(qn,t)),e.xid=t=>e.check(xt(Bn,t)),e.ksuid=t=>e.check(Ee(Vn,t)),e.ipv4=t=>e.check(Qt(Hn,t)),e.ipv6=t=>e.check(Le(Un,t)),e.cidrv4=t=>e.check(lt(Wn,t)),e.cidrv6=t=>e.check(Dt(Gn,t)),e.e164=t=>e.check(ht(Jn,t)),e.datetime=t=>e.check(un(t)),e.date=t=>e.check(fn(t)),e.time=t=>e.check(mn(t)),e.duration=t=>e.check(gn(t))});function K(e){return ce(jn,e)}const q=V(`ZodStringFormat`,(e,t)=>{he.init(e,t),An.init(e,t)}),Mn=V(`ZodEmail`,(e,t)=>{Re.init(e,t),q.init(e,t)}),Nn=V(`ZodGUID`,(e,t)=>{Ve.init(e,t),q.init(e,t)}),J=V(`ZodUUID`,(e,t)=>{S.init(e,t),q.init(e,t)}),Pn=V(`ZodURL`,(e,t)=>{Ne.init(e,t),q.init(e,t)}),Fn=V(`ZodEmoji`,(e,t)=>{ie.init(e,t),q.init(e,t)}),In=V(`ZodNanoID`,(e,t)=>{se.init(e,t),q.init(e,t)}),Ln=V(`ZodCUID`,(e,t)=>{_t.init(e,t),q.init(e,t)}),Rn=V(`ZodCUID2`,(e,t)=>{it.init(e,t),q.init(e,t)}),zn=V(`ZodULID`,(e,t)=>{rt.init(e,t),q.init(e,t)}),Bn=V(`ZodXID`,(e,t)=>{At.init(e,t),q.init(e,t)}),Vn=V(`ZodKSUID`,(e,t)=>{Ae.init(e,t),q.init(e,t)}),Hn=V(`ZodIPv4`,(e,t)=>{ae.init(e,t),q.init(e,t)}),Un=V(`ZodIPv6`,(e,t)=>{O.init(e,t),q.init(e,t)}),Wn=V(`ZodCIDRv4`,(e,t)=>{kt.init(e,t),q.init(e,t)}),Gn=V(`ZodCIDRv6`,(e,t)=>{yt.init(e,t),q.init(e,t)}),Kn=V(`ZodBase64`,(e,t)=>{dt.init(e,t),q.init(e,t)}),qn=V(`ZodBase64URL`,(e,t)=>{gt.init(e,t),q.init(e,t)}),Jn=V(`ZodE164`,(e,t)=>{$t.init(e,t),q.init(e,t)}),Yn=V(`ZodJWT`,(e,t)=>{Te.init(e,t),q.init(e,t)}),Xn=V(`ZodNumber`,(e,t)=>{rn.init(e,t),G.init(e,t),e.gt=(t,n)=>e.check(B(t,n)),e.gte=(t,n)=>e.check(R(t,n)),e.min=(t,n)=>e.check(R(t,n)),e.lt=(t,n)=>e.check(H(t,n)),e.lte=(t,n)=>e.check(F(t,n)),e.max=(t,n)=>e.check(F(t,n)),e.int=t=>e.check($n(t)),e.safe=t=>e.check($n(t)),e.positive=t=>e.check(B(0,t)),e.nonnegative=t=>e.check(R(0,t)),e.negative=t=>e.check(H(0,t)),e.nonpositive=t=>e.check(F(0,t)),e.multipleOf=(t,n)=>e.check(j(t,n)),e.step=(t,n)=>e.check(j(t,n)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Zn(e){return nn(Xn,e)}const Qn=V(`ZodNumberFormat`,(e,t)=>{ne.init(e,t),Xn.init(e,t)});function $n(e){return st(Qn,e)}const er=V(`ZodBoolean`,(e,t)=>{Ft.init(e,t),G.init(e,t)});function tr(e){return Mt(er,e)}const nr=V(`ZodUnknown`,(e,t)=>{Ht.init(e,t),G.init(e,t)});function rr(){return tt(nr)}const ir=V(`ZodNever`,(e,t)=>{fe.init(e,t),G.init(e,t)});function ar(e){return ye(ir,e)}const or=V(`ZodArray`,(e,t)=>{Kt.init(e,t),G.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(I(t,n)),e.nonempty=t=>e.check(I(1,t)),e.max=(t,n)=>e.check(Ce(t,n)),e.length=(t,n)=>e.check(wt(t,n)),e.unwrap=()=>e.element});function Y(e,t){return zt(or,e,t)}const sr=V(`ZodObject`,(e,t)=>{ue.init(e,t),G.init(e,t),Ue(e,`shape`,()=>t.shape),e.keyof=()=>fr(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:rr()}),e.loose=()=>e.clone({...e._zod.def,catchall:rr()}),e.strict=()=>e.clone({...e._zod.def,catchall:ar()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>Je(e,t),e.safeExtend=t=>pt(e,t),e.merge=t=>Lt(e,t),e.pick=t=>Me(e,t),e.omit=t=>Ze(e,t),e.partial=(...t)=>nt(hr,e,t[0]),e.required=(...t)=>x(Sr,e,t[0])});function X(e,t){return new sr({type:`object`,shape:e??{},...L(t)})}const cr=V(`ZodUnion`,(e,t)=>{ft.init(e,t),G.init(e,t),e.options=t.options});function lr(e,t){return new cr({type:`union`,options:e,...L(t)})}const ur=V(`ZodIntersection`,(e,t)=>{Se.init(e,t),G.init(e,t)});function dr(e,t){return new ur({type:`intersection`,left:e,right:t})}const Z=V(`ZodEnum`,(e,t)=>{Zt.init(e,t),G.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Z({...t,checks:[],...L(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Z({...t,checks:[],...L(r),entries:i})}});function fr(e,t){return new Z({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...L(t)})}const pr=V(`ZodTransform`,(e,t)=>{et.init(e,t),G.init(e,t),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Bt(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(M(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(M(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function mr(e){return new pr({type:`transform`,transform:e})}const hr=V(`ZodOptional`,(e,t)=>{We.init(e,t),G.init(e,t),e.unwrap=()=>e._zod.def.innerType});function gr(e){return new hr({type:`optional`,innerType:e})}const _r=V(`ZodNullable`,(e,t)=>{Ie.init(e,t),G.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Q(e){return new _r({type:`nullable`,innerType:e})}const vr=V(`ZodDefault`,(e,t)=>{ct.init(e,t),G.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function yr(e,t){return new vr({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Ut(t)}})}const br=V(`ZodPrefault`,(e,t)=>{le.init(e,t),G.init(e,t),e.unwrap=()=>e._zod.def.innerType});function xr(e,t){return new br({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Ut(t)}})}const Sr=V(`ZodNonOptional`,(e,t)=>{be.init(e,t),G.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Cr(e,t){return new Sr({type:`nonoptional`,innerType:e,...L(t)})}const wr=V(`ZodCatch`,(e,t)=>{Jt.init(e,t),G.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Tr(e,t){return new wr({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}const Er=V(`ZodPipe`,(e,t)=>{Ye.init(e,t),G.init(e,t),e.in=t.in,e.out=t.out});function Dr(e,t){return new Er({type:`pipe`,in:e,out:t})}const Or=V(`ZodReadonly`,(e,t)=>{ve.init(e,t),G.init(e,t),e.unwrap=()=>e._zod.def.innerType});function kr(e){return new Or({type:`readonly`,innerType:e})}const Ar=V(`ZodCustom`,(e,t)=>{tn.init(e,t),G.init(e,t)});function jr(e,t={}){return Ge(Ar,e,t)}function Mr(e){return ge(e)}var Nr=[U({name:`debug_random_number`,description:`Generate a random number between 0 and 1`,execute:async()=>new Promise(e=>{setTimeout(()=>{e(Math.random().toString())},1e3)}),parameters:X({})})];const Pr=async()=>Promise.all(Nr);async function $(e,t={},n){return window.__TAURI_INTERNALS__.invoke(e,t,n)}async function Fr(e,t){await $(`plugin:mcp|connect_server`,{command:e,args:t})}async function Ir(){await $(`plugin:mcp|disconnect_server`)}async function Lr(){return await $(`plugin:mcp|list_tools`)}async function Rr(e,t){return await $(`plugin:mcp|call_tool`,{name:e,args:t})}var zr=[U({name:`mcp_list_tools`,description:`List all tools available on the MCP server`,execute:async(e,t)=>await Lr(),parameters:X({})}),U({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:e,args:t})=>(await Fr(e,t),`success`),parameters:X({command:K().describe(`The command to connect to the MCP server`),args:Y(K()).describe(`The arguments to pass to the MCP server`)})}),U({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 Ir(),`success`),parameters:X({})}),U({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:e,parameters:t})=>await Rr(e,Object.fromEntries(t.map(({name:e,value:t})=>[e,t]))),parameters:X({name:K().describe(`The name of the tool to call`),parameters:Y(X({name:K().describe(`The name of the parameter`),value:lr([K(),Zn(),tr(),X({})]).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`)})})];const Br=async()=>Promise.all(zr);function Vr(e){return e.map(e=>e&&e.role===`error`?{role:`user`,content:`User encountered error: ${String(e.content??``)}`}:e)}function Hr(e,t,n,r){return!!(r?.supportsTools||r?.toolsCompatibility?.get(`${t.chat(e).baseURL}-${e}`))}async function Ur(e,t,n,r){let i=r?.headers,a=Vr(n),o=async()=>(typeof r?.tools==`function`?await r.tools():r?.tools)??[];return new Promise(async(s,c)=>{try{let l=Hr(e,t,n,r);await cn({...t.chat(e),maxSteps:10,messages:a,headers:i,tools:l?[...await Br(),...await Pr(),...await o()]:void 0,async onEvent(e){try{await r?.onStreamEvent?.(e),e.type===`finish`?s():e.type===`error`&&c(e.error??Error(`Stream error`))}catch(e){c(e)}}})}catch(e){c(e)}})}async function Wr(e,t,n,r){async function i(n){try{return await Ur(e,t,[{role:`user`,content:`Hello, world!`}],{...r,supportsTools:n}),!0}catch(e){if(e instanceof Error&&e.name===new g(``).name&&(String(e).includes(`does not support tools`)||String(e).includes(`No endpoints found that support tool use.`)))return!1;throw e}}function a(e,t){return new Promise(n=>{let r=[],i=0;e.forEach((a,o)=>{setTimeout(()=>{a().then(e=>{r[o]={result:e}}).catch(e=>{r[o]={error:e}}).finally(()=>{i++,i===e.length&&n(r)})},o*t)})})}let o=await a([()=>i(!0),()=>i(!1)],1e3);if(o.some(e=>e.error)){let t=Error(`Error during tools compatibility discovery for model: ${e}. Errors: ${o.map(e=>e.error).filter(Boolean).join(`, `)}`);throw t.cause=o.map(e=>e.error).filter(Boolean),t}return o[0].result===!0&&o[1].result===!0}const Gr=a(`llm`,()=>{let e=r(new Map);async function t(t,n,r,i){if(e.value.has(`${n.chat(t).baseURL}-${t}`))return;let a=await Wr(t,n,r,{...i,toolsCompatibility:e.value});e.value.set(`${n.chat(t).baseURL}-${t}`,a)}function n(t,n,r,i){return Ur(t,n,r,{...i,toolsCompatibility:e.value})}async function i(e,t){if(e===``)return[];try{return await u({baseURL:e.endsWith(`/`)?e:`${e}/`,apiKey:t})}catch(e){if(String(e).includes(`Failed to construct 'URL': Invalid URL`))return[];throw e}}return{models:i,stream:n,discoverToolsCompatibility:t}});var Kr=`chat/messages/v2`,qr=`chat/active-session`;const Jr=`airi-context-update`,Yr=a(`chat`,()=>{let{stream:a,discoverToolsCompatibility:c}=Gr(),{systemPrompt:l}=i(an()),u=o(qr,`default`),d=o(Kr,{}),f=r(!1),p=r([]),m=r([]),h=r([]),g=r([]),v=r([]),y=r([]),b=r([]),x=r([]),S=r([]);function C(e){p.value.push(e)}function w(e){m.value.push(e)}function T(e){h.value.push(e)}function ee(e){g.value.push(e)}function te(e){v.value.push(e)}function ne(e){y.value.push(e)}function re(e){b.value.push(e)}function ie(e){x.value.push(e)}function E(e){return S.value.push(e),()=>{S.value=S.value.filter(t=>t!==e)}}function D(){p.value=[],m.value=[],h.value=[],g.value=[],v.value=[],y.value=[],b.value=[],x.value=[],S.value=[]}function O(){return{role:`system`,content:"- For any programming code block, always specify the programming language that supported on @shikijs/rehype on the rendered markdown, eg. ```python ... ```\n- For any math equation, use LaTeX format, eg: $ x^3 $, always escape dollar sign outside math equation\n"+l.value}}function k(e){(!d.value[e]||d.value[e].length===0)&&(d.value[e]=[{...O(),context:{sessionId:e,source:`system`,ts:Date.now()}}])}k(u.value);let A=n({get:()=>(k(u.value),d.value[u.value]),set:e=>{d.value[u.value]=e}});function ae(e){u.value=e,k(e)}function j(e=u.value){d.value[e]=[{...O(),context:{sessionId:e,source:`system`,ts:Date.now()}}]}function oe(){return JSON.parse(JSON.stringify(e(d.value)))}function se(e){d.value=e;let[t]=Object.keys(e);!d.value[u.value]&&t&&(u.value=t),k(u.value)}function ce(){d.value={},u.value=`default`,k(u.value)}t(l,()=>{for(let[e,t]of Object.entries(d.value))t.length>0&&t[0].role===`system`&&(d.value[e][0]={...O(),context:{sessionId:e,source:`system`,ts:Date.now()}})},{immediate:!0});function M(e){let t=e?.content??e?.text??``;return{content:typeof t==`string`||Array.isArray(t)?t:JSON.stringify(t),slices:e?.slices??[],tool_results:e?.tool_results??[]}}function le(e){k(e.sessionId);let{content:t,slices:n,tool_results:r}=M(e.payload),i={sessionId:e.sessionId,source:e.source,ts:e.ts,meta:e.meta},a=d.value[e.sessionId];e.role===`assistant`?a.push({role:`assistant`,content:t,slices:n,tool_results:r,context:i}):e.role===`error`?a.push({role:`error`,content:typeof t==`string`?t:JSON.stringify(t),context:i}):a.push({role:e.role,content:t,context:i})}function N(e,t=`local`){for(let n of S.value)n(e,t)}let P=r({role:`assistant`,content:``,slices:[],tool_results:[]});async function ue(t,n){if(!(!t&&!n.attachments?.length)){f.value=!0;try{for(let e of p.value)await e(t);let r=[{type:`text`,text:t}];if(n.attachments)for(let e of n.attachments)e.type===`image`&&r.push({type:`image_url`,image_url:{url:`data:${e.mimeType};base64,${e.data}`}});let i=r.length>1?r:t,o={sessionId:u.value,source:`text`,ts:Date.now()};A.value.push({role:`user`,content:i,context:o}),N({sessionId:o.sessionId,ts:o.ts,role:`user`,source:o.source,payload:{content:i}},`local`);let c=_({onLiteral:async e=>{for(let t of v.value)await t(e);P.value.content+=e;let t=P.value.slices.at(-1);if(t?.type===`text`){t.text+=e;return}P.value.slices.push({type:`text`,text:e})},onSpecial:async e=>{for(let t of y.value)await t(e)},minLiteralEmitLength:24}),l=s({handlers:[async e=>{if(e.data.type===`tool-call`){P.value.slices.push(e.data);return}e.data.type===`tool-call-result`&&P.value.tool_results.push(e.data)}]});P.value={role:`assistant`,content:``,slices:[],tool_results:[]};let d=A.value.map(t=>{let{context:n,...r}=t,i=e(r);if(i.role===`assistant`){let{slices:t,tool_results:n,...r}=i;return{...e(r),tool_results:e(n)}}return i});for(let e of m.value)await e(t);for(let e of h.value)await e(t);let f=``,S=n.providerConfig?.headers||{};if(await a(n.model,n.chatProvider,d,{headers:S,tools:n.tools,onStreamEvent:async e=>{switch(e.type){case`tool-call`:l.enqueue({type:`tool-call`,toolCall:e});break;case`tool-result`:l.enqueue({type:`tool-call-result`,id:e.toolCallId,result:e.result});break;case`text-delta`:f+=e.text,await c.consume(e.text);break;case`finish`:break;case`error`:throw e.error??Error(`Stream error`)}}}),await c.end(),P.value.slices.length>0){let t={sessionId:u.value,source:`llm`,ts:Date.now()},n={...e(P.value),context:t};A.value.push(n),N({sessionId:t.sessionId,ts:t.ts,role:`assistant`,source:t.source,payload:{content:n.content,slices:n.slices,tool_results:n.tool_results}},`local`)}P.value={role:`assistant`,content:``,slices:[],tool_results:[]};for(let e of v.value)await e(`​​`);for(let e of b.value)await e();for(let e of x.value)await e(f);console.debug(`LLM output:`,f);for(let e of g.value)await e(t)}catch(e){throw console.error(`Error sending message:`,e),e}finally{f.value=!1}}}return{sending:f,activeSessionId:u,messages:A,streamingMessage:P,discoverToolsCompatibility:c,send:ue,setActiveSession:ae,ingestContextMessage:le,publishContextMessage:N,cleanupMessages:j,getAllSessions:oe,replaceSessions:se,resetAllSessions:ce,clearHooks:D,onBeforeMessageComposed:C,onAfterMessageComposed:w,onBeforeSend:T,onAfterSend:ee,onTokenLiteral:te,onTokenSpecial:ne,onStreamEnd:re,onAssistantResponseEnd:ie,onContextPublish:E}});export{Yr as n,Jr as t}; \ No newline at end of file diff --git a/assets/cloudflare-workers-ai-BgN6F-61.js b/assets/cloudflare-workers-ai-Cx078Khx.js similarity index 93% rename from assets/cloudflare-workers-ai-BgN6F-61.js rename to assets/cloudflare-workers-ai-Cx078Khx.js index e3cd973373e5a1b31d790156091dce2a7dd0e68f..1ee2c7d3e391f3418cc6f610fb8751580a4d7d59 100644 --- a/assets/cloudflare-workers-ai-BgN6F-61.js +++ b/assets/cloudflare-workers-ai-Cx078Khx.js @@ -1 +1 @@ -import{A as e,C as t,E as n,K as r,O as i,Pt as a,S as o,b as s,k as c,kt as l,lt as u,x as d}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-CZ9Rvki9.js";import"./src-DYQXbDgu.js";import{a as f}from"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{G as p,U as m,W as h,Y as g,gt as _,q as v}from"./components-BR_Kqwtu.js";import{i as y}from"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-D1kLcsvA.js";import"./__vite-browser-external-BaycPy5b.js";import{t as b}from"./route-block-CpjdOEnv.js";import{t as x}from"./use-provider-validation-DbXr83wX.js";var S={class:`whitespace-pre-wrap break-all`},C=`cloudflare-workers-ai`,w=e({__name:`cloudflare-workers-ai`,setup(e){let{providers:b}=f(y()),w=s({get:()=>b.value[C]?.apiKey||``,set:e=>{b.value[C]||(b.value[C]={}),b.value[C].apiKey=e}}),T=s({get:()=>b.value[C]?.accountId||``,set:e=>{b.value[C]||(b.value[C]={}),b.value[C].accountId=e}}),{t:E,router:D,providerMetadata:O,isValidating:k,isValid:A,validationMessage:j,handleResetSettings:M}=x(C);return(e,s)=>(r(),o(l(m),{"provider-name":l(O)?.localizedName,"provider-icon":l(O)?.icon,"provider-icon-color":l(O)?.iconColor,"on-back":()=>l(D).back()},{default:u(()=>[c(l(h),null,{default:u(()=>[c(l(p),{title:l(E)(`settings.pages.providers.common.section.basic.title`),description:l(E)(`settings.pages.providers.common.section.basic.description`),"on-reset":l(M)},{default:u(()=>[c(l(v),{modelValue:w.value,"onUpdate:modelValue":s[0]||=e=>w.value=e,"provider-name":l(O)?.localizedName,placeholder:l(E)(`settings.pages.providers.provider.cloudflare-workers-ai.fields.field.api-key.placeholder`)},null,8,[`modelValue`,`provider-name`,`placeholder`]),c(l(g),{modelValue:T.value,"onUpdate:modelValue":s[1]||=e=>T.value=e,label:l(E)(`settings.pages.providers.provider.cloudflare-workers-ai.fields.field.account-id.label`),description:l(E)(`settings.pages.providers.provider.cloudflare-workers-ai.fields.field.account-id.description`),placeholder:l(E)(`settings.pages.providers.provider.cloudflare-workers-ai.fields.field.account-id.placeholder`)},null,8,[`modelValue`,`label`,`description`,`placeholder`])]),_:1},8,[`title`,`description`,`on-reset`]),!l(A)&&l(k)===0&&l(j)?(r(),o(l(_),{key:0,type:`error`},n({title:u(()=>[i(a(l(E)(`settings.dialogs.onboarding.validationFailed`)),1)]),_:2},[l(j)?{name:`content`,fn:u(()=>[d(`div`,S,a(l(j)),1)]),key:`0`}:void 0]),1024)):t(``,!0),l(A)&&l(k)===0?(r(),o(l(_),{key:1,type:`success`},{title:u(()=>[i(a(l(E)(`settings.dialogs.onboarding.validationSuccess`)),1)]),_:1})):t(``,!0)]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`provider-icon-color`,`on-back`]))}});typeof b==`function`&&b(w);var T=w;export{T as default}; \ No newline at end of file +import{A as e,C as t,E as n,K as r,O as i,Pt as a,S as o,b as s,k as c,kt as l,lt as u,x as d}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-C0YByt49.js";import"./src-DYQXbDgu.js";import{a as f}from"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{G as p,U as m,W as h,Y as g,gt as _,q as v}from"./components-CeE-UiLT.js";import{i as y}from"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-73vyHOZs.js";import"./__vite-browser-external-BaycPy5b.js";import{t as b}from"./route-block-CpjdOEnv.js";import{t as x}from"./use-provider-validation-DbXr83wX.js";var S={class:`whitespace-pre-wrap break-all`},C=`cloudflare-workers-ai`,w=e({__name:`cloudflare-workers-ai`,setup(e){let{providers:b}=f(y()),w=s({get:()=>b.value[C]?.apiKey||``,set:e=>{b.value[C]||(b.value[C]={}),b.value[C].apiKey=e}}),T=s({get:()=>b.value[C]?.accountId||``,set:e=>{b.value[C]||(b.value[C]={}),b.value[C].accountId=e}}),{t:E,router:D,providerMetadata:O,isValidating:k,isValid:A,validationMessage:j,handleResetSettings:M}=x(C);return(e,s)=>(r(),o(l(m),{"provider-name":l(O)?.localizedName,"provider-icon":l(O)?.icon,"provider-icon-color":l(O)?.iconColor,"on-back":()=>l(D).back()},{default:u(()=>[c(l(h),null,{default:u(()=>[c(l(p),{title:l(E)(`settings.pages.providers.common.section.basic.title`),description:l(E)(`settings.pages.providers.common.section.basic.description`),"on-reset":l(M)},{default:u(()=>[c(l(v),{modelValue:w.value,"onUpdate:modelValue":s[0]||=e=>w.value=e,"provider-name":l(O)?.localizedName,placeholder:l(E)(`settings.pages.providers.provider.cloudflare-workers-ai.fields.field.api-key.placeholder`)},null,8,[`modelValue`,`provider-name`,`placeholder`]),c(l(g),{modelValue:T.value,"onUpdate:modelValue":s[1]||=e=>T.value=e,label:l(E)(`settings.pages.providers.provider.cloudflare-workers-ai.fields.field.account-id.label`),description:l(E)(`settings.pages.providers.provider.cloudflare-workers-ai.fields.field.account-id.description`),placeholder:l(E)(`settings.pages.providers.provider.cloudflare-workers-ai.fields.field.account-id.placeholder`)},null,8,[`modelValue`,`label`,`description`,`placeholder`])]),_:1},8,[`title`,`description`,`on-reset`]),!l(A)&&l(k)===0&&l(j)?(r(),o(l(_),{key:0,type:`error`},n({title:u(()=>[i(a(l(E)(`settings.dialogs.onboarding.validationFailed`)),1)]),_:2},[l(j)?{name:`content`,fn:u(()=>[d(`div`,S,a(l(j)),1)]),key:`0`}:void 0]),1024)):t(``,!0),l(A)&&l(k)===0?(r(),o(l(_),{key:1,type:`success`},{title:u(()=>[i(a(l(E)(`settings.dialogs.onboarding.validationSuccess`)),1)]),_:1})):t(``,!0)]),_:1})]),_:1},8,[`provider-name`,`provider-icon`,`provider-icon-color`,`on-back`]))}});typeof b==`function`&&b(w);var T=w;export{T as default}; \ No newline at end of file diff --git a/assets/color-scheme-0i0L0wxO.js b/assets/color-scheme-CBrwAUe-.js similarity index 97% rename from assets/color-scheme-0i0L0wxO.js rename to assets/color-scheme-CBrwAUe-.js index f9401986c8ee2b5d553b6f366df95d7fb579e1bc..ffd97103f5f52736c2faa85b3d9539d11764a7d7 100644 --- a/assets/color-scheme-0i0L0wxO.js +++ b/assets/color-scheme-CBrwAUe-.js @@ -1 +1 @@ -import{A as e,J as t,K as n,O as r,Pt as i,S as a,Z as o,a as s,b as c,k as l,kt as u,lt as d,m as f,ut as p,w as m,x as h}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import{c as g,t as _}from"./widgets-CZ9Rvki9.js";import{o as v}from"./src-DYQXbDgu.js";import"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import{t as y}from"./_plugin-vue_export-helper-DGA9ry_j.js";import"./src-C83SCWbW.js";import"./components-BR_Kqwtu.js";import"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import{n as b}from"./vue-i18n.runtime-Dah5zGm4.js";import"./stream-transcription-_Xuw_VzN.js";import{n as x}from"./settings-D1kLcsvA.js";import"./__vite-browser-external-BaycPy5b.js";import{t as S}from"./route-block-CpjdOEnv.js";const C={"color-1":`#A5978B`,"color-2":`#D8CAAF`,"color-3":`#B8B4A7`,"color-4":`#C4BCB1`,"color-5":`#E5DED8`,"color-6":`#9A8F7D`,"color-7":`#BEB5A7`,"color-8":`#C9C0B6`},w={"color-1":`#7A9EAF`,"color-2":`#B8C7CC`,"color-3":`#D4B79C`,"color-4":`#8B9D77`,"color-5":`#C7D5CB`,"color-6":`#E6D0B1`,"color-7":`#94A7B1`,"color-8":`#B4C8C3`},T={"color-1":`#D9B48F`,"color-2":`#B5917A`,"color-3":`#8C7A6B`,"color-4":`#A17F5F`,"color-5":`#B98C46`,"color-6":`#C7A252`,"color-7":`#DAB300`,"color-8":`#D19826`},E={"color-1":`#9BA7B0`,"color-2":`#C1CBD4`,"color-3":`#A5ADB6`,"color-4":`#8B959E`,"color-5":`#D4DCE4`,"color-6":`#7F8A94`,"color-7":`#B3BCC6`,"color-8":`#98A4AE`},D={"color-1":`#E4C6D0`,"color-2":`#A61B29`,"color-3":`#5D513C`,"color-4":`#789262`,"color-5":`#1C0D1A`,"color-6":`#F7C242`,"color-7":`#62A9DD`,"color-8":`#8C4B3C`};var O={default:{"color-1":null},morandi:C,monet:w,japanese:T,nordic:E,chinese:D},k={flex:``,"items-center":``,"justify-between":``,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:300,delay:250,transition:`all ease-in-out duration-250`},A={"text-lg":``,"font-normal":``},j={relative:``,flex:``,"cursor-pointer":``,"items-center":``,"gap-2":``},M={class:`color-bar text-[10px] md:text-base sm:text-xs`,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:320,delay:350,transition:`all ease-in-out duration-250`},N={"text-white":``,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:330,delay:400,transition:`all ease-in-out duration-250`},P={class:`color-bar transparency-grid text-[10px] md:text-base sm:text-xs`,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:340,delay:450,transition:`all ease-in-out duration-250`},F=[`duration`,`delay`],I={"font-medium":``},L={text:`sm neutral-500`},R={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":``},z=e({__name:`color-scheme`,setup(e){let y=x(),{t:S,tm:C}=b(),w=[`default`,`morandi`,`monet`,`japanese`,`nordic`,`chinese`],T=c(()=>{let e=C(`settings.pages.system.sections.section.theme-presets.presets`);return!e||typeof e!=`object`?[]:w.map(t=>{let n=e[t];if(!n)return null;let r=O[t]||{},i=Object.entries(n.colors??{}).map(([e,t])=>{let n=r[e];return{key:e,name:t,hex:typeof n==`string`&&n.length?n:void 0}});return{key:t,title:n.title,description:n.description,colors:i}}).filter(e=>!!e)});return(e,c)=>{let b=o(`motion`);return n(),m(f,null,[p((n(),a(u(g),{"mb-2":``,title:u(S)(`settings.pages.system.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:200,transition:`all ease-in-out duration-250`},{default:d(()=>[p((n(),m(`div`,k,[h(`span`,A,i(e.$t(`settings.pages.system.sections.section.custom-color.fields.field.primary-color.label`)),1),h(`label`,j,[p(h(`input`,{"onUpdate:modelValue":c[0]||=e=>u(y).themeColorsHueDynamic=e,type:`checkbox`,class:`peer sr-only`},null,512),[[s,u(y).themeColorsHueDynamic]]),c[2]||=h(`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),r(` `+i(e.$t(`settings.pages.system.sections.section.custom-color.fields.field.primary-color.rgb-on.title`)),1)])])),[[b]]),p(l(u(v),{modelValue:u(y).themeColorsHue,"onUpdate:modelValue":c[1]||=e=>u(y).themeColorsHue=e,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:310,delay:300,disabled:u(y).themeColorsHueDynamic},null,8,[`modelValue`,`disabled`]),[[b]]),p((n(),m(`div`,M,[c[4]||=h(`span`,{"bg-primary-50":``},`50`,-1),c[5]||=h(`span`,{"bg-primary-100":``},`100`,-1),c[6]||=h(`span`,{"bg-primary-200":``},`200`,-1),c[7]||=h(`span`,{"bg-primary-300":``},`300`,-1),c[8]||=h(`span`,{"bg-primary-400":``},`400`,-1),c[9]||=h(`span`,{"bg-primary-500":``},`500`,-1),p((n(),m(`div`,N,[...c[3]||=[h(`span`,{"bg-primary-600":``},`600`,-1),h(`span`,{"bg-primary-700":``},`700`,-1),h(`span`,{"bg-primary-800":``},`800`,-1),h(`span`,{"bg-primary-900":``},`900`,-1),h(`span`,{"bg-primary-950":``},`950`,-1)]])),[[b]])])),[[b]]),p((n(),m(`div`,P,[...c[10]||=[h(`span`,{bg:`primary-500/5`},`500/5`,-1),h(`span`,{bg:`primary-500/10`},`500/10`,-1),h(`span`,{bg:`primary-500/20`},`500/20`,-1),h(`span`,{bg:`primary-500/30`},`500/30`,-1),h(`span`,{bg:`primary-500/40`},`500/40`,-1),h(`span`,{bg:`primary-500/50`},`500/50`,-1),h(`span`,{bg:`primary-500/60`},`500/60`,-1),h(`span`,{bg:`primary-500/70`},`500/70`,-1),h(`span`,{bg:`primary-500/80`},`500/80`,-1),h(`span`,{bg:`primary-500/90`},`500/90`,-1),h(`span`,{bg:`primary-500`},`500`,-1)]])),[[b]])]),_:1},8,[`title`])),[[b]]),p((n(),a(u(g),{"mb-2":``,title:u(S)(`settings.pages.system.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:500,transition:`all ease-in-out duration-250`},{default:d(()=>[(n(!0),m(f,null,t(T.value,(t,r)=>p((n(),m(`div`,{key:t.key,class:`w-full flex flex-col items-start justify-between gap-2 rounded-lg px-4 py-3 outline-none transition-all duration-250 ease-in-out md:flex-row md:items-center md:gap-0`,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+r*10,delay:550+r*50,transition:`all ease-in-out duration-250`},[h(`div`,null,[h(`span`,I,i(e.$rt(t.title)),1),h(`div`,L,i(e.$rt(t.description)),1)]),l(u(_),{colors:t.colors.map(({hex:t,name:n})=>({hex:t,name:e.$rt(n)}))},null,8,[`colors`])],8,F)),[[b]])),128))]),_:1},8,[`title`])),[[b]]),p((n(),m(`div`,R,[...c[11]||=[h(`div`,{text:`60`,"i-solar:pallete-2-bold-duotone":``},null,-1)]])),[[b]])],64)}}});typeof S==`function`&&S(z);var B=y(z,[[`__scopeId`,`data-v-16e5a478`]]);export{B as default}; \ No newline at end of file +import{A as e,J as t,K as n,O as r,Pt as i,S as a,Z as o,a as s,b as c,k as l,kt as u,lt as d,m as f,ut as p,w as m,x as h}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import{c as g,t as _}from"./widgets-C0YByt49.js";import{o as v}from"./src-DYQXbDgu.js";import"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import{t as y}from"./_plugin-vue_export-helper-DGA9ry_j.js";import"./src-C83SCWbW.js";import"./components-CeE-UiLT.js";import"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import{n as b}from"./vue-i18n.runtime-Dah5zGm4.js";import"./stream-transcription-_Xuw_VzN.js";import{n as x}from"./settings-73vyHOZs.js";import"./__vite-browser-external-BaycPy5b.js";import{t as S}from"./route-block-CpjdOEnv.js";const C={"color-1":`#A5978B`,"color-2":`#D8CAAF`,"color-3":`#B8B4A7`,"color-4":`#C4BCB1`,"color-5":`#E5DED8`,"color-6":`#9A8F7D`,"color-7":`#BEB5A7`,"color-8":`#C9C0B6`},w={"color-1":`#7A9EAF`,"color-2":`#B8C7CC`,"color-3":`#D4B79C`,"color-4":`#8B9D77`,"color-5":`#C7D5CB`,"color-6":`#E6D0B1`,"color-7":`#94A7B1`,"color-8":`#B4C8C3`},T={"color-1":`#D9B48F`,"color-2":`#B5917A`,"color-3":`#8C7A6B`,"color-4":`#A17F5F`,"color-5":`#B98C46`,"color-6":`#C7A252`,"color-7":`#DAB300`,"color-8":`#D19826`},E={"color-1":`#9BA7B0`,"color-2":`#C1CBD4`,"color-3":`#A5ADB6`,"color-4":`#8B959E`,"color-5":`#D4DCE4`,"color-6":`#7F8A94`,"color-7":`#B3BCC6`,"color-8":`#98A4AE`},D={"color-1":`#E4C6D0`,"color-2":`#A61B29`,"color-3":`#5D513C`,"color-4":`#789262`,"color-5":`#1C0D1A`,"color-6":`#F7C242`,"color-7":`#62A9DD`,"color-8":`#8C4B3C`};var O={default:{"color-1":null},morandi:C,monet:w,japanese:T,nordic:E,chinese:D},k={flex:``,"items-center":``,"justify-between":``,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:300,delay:250,transition:`all ease-in-out duration-250`},A={"text-lg":``,"font-normal":``},j={relative:``,flex:``,"cursor-pointer":``,"items-center":``,"gap-2":``},M={class:`color-bar text-[10px] md:text-base sm:text-xs`,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:320,delay:350,transition:`all ease-in-out duration-250`},N={"text-white":``,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:330,delay:400,transition:`all ease-in-out duration-250`},P={class:`color-bar transparency-grid text-[10px] md:text-base sm:text-xs`,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:340,delay:450,transition:`all ease-in-out duration-250`},F=[`duration`,`delay`],I={"font-medium":``},L={text:`sm neutral-500`},R={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":``},z=e({__name:`color-scheme`,setup(e){let y=x(),{t:S,tm:C}=b(),w=[`default`,`morandi`,`monet`,`japanese`,`nordic`,`chinese`],T=c(()=>{let e=C(`settings.pages.system.sections.section.theme-presets.presets`);return!e||typeof e!=`object`?[]:w.map(t=>{let n=e[t];if(!n)return null;let r=O[t]||{},i=Object.entries(n.colors??{}).map(([e,t])=>{let n=r[e];return{key:e,name:t,hex:typeof n==`string`&&n.length?n:void 0}});return{key:t,title:n.title,description:n.description,colors:i}}).filter(e=>!!e)});return(e,c)=>{let b=o(`motion`);return n(),m(f,null,[p((n(),a(u(g),{"mb-2":``,title:u(S)(`settings.pages.system.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:200,transition:`all ease-in-out duration-250`},{default:d(()=>[p((n(),m(`div`,k,[h(`span`,A,i(e.$t(`settings.pages.system.sections.section.custom-color.fields.field.primary-color.label`)),1),h(`label`,j,[p(h(`input`,{"onUpdate:modelValue":c[0]||=e=>u(y).themeColorsHueDynamic=e,type:`checkbox`,class:`peer sr-only`},null,512),[[s,u(y).themeColorsHueDynamic]]),c[2]||=h(`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),r(` `+i(e.$t(`settings.pages.system.sections.section.custom-color.fields.field.primary-color.rgb-on.title`)),1)])])),[[b]]),p(l(u(v),{modelValue:u(y).themeColorsHue,"onUpdate:modelValue":c[1]||=e=>u(y).themeColorsHue=e,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:310,delay:300,disabled:u(y).themeColorsHueDynamic},null,8,[`modelValue`,`disabled`]),[[b]]),p((n(),m(`div`,M,[c[4]||=h(`span`,{"bg-primary-50":``},`50`,-1),c[5]||=h(`span`,{"bg-primary-100":``},`100`,-1),c[6]||=h(`span`,{"bg-primary-200":``},`200`,-1),c[7]||=h(`span`,{"bg-primary-300":``},`300`,-1),c[8]||=h(`span`,{"bg-primary-400":``},`400`,-1),c[9]||=h(`span`,{"bg-primary-500":``},`500`,-1),p((n(),m(`div`,N,[...c[3]||=[h(`span`,{"bg-primary-600":``},`600`,-1),h(`span`,{"bg-primary-700":``},`700`,-1),h(`span`,{"bg-primary-800":``},`800`,-1),h(`span`,{"bg-primary-900":``},`900`,-1),h(`span`,{"bg-primary-950":``},`950`,-1)]])),[[b]])])),[[b]]),p((n(),m(`div`,P,[...c[10]||=[h(`span`,{bg:`primary-500/5`},`500/5`,-1),h(`span`,{bg:`primary-500/10`},`500/10`,-1),h(`span`,{bg:`primary-500/20`},`500/20`,-1),h(`span`,{bg:`primary-500/30`},`500/30`,-1),h(`span`,{bg:`primary-500/40`},`500/40`,-1),h(`span`,{bg:`primary-500/50`},`500/50`,-1),h(`span`,{bg:`primary-500/60`},`500/60`,-1),h(`span`,{bg:`primary-500/70`},`500/70`,-1),h(`span`,{bg:`primary-500/80`},`500/80`,-1),h(`span`,{bg:`primary-500/90`},`500/90`,-1),h(`span`,{bg:`primary-500`},`500`,-1)]])),[[b]])]),_:1},8,[`title`])),[[b]]),p((n(),a(u(g),{"mb-2":``,title:u(S)(`settings.pages.system.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:500,transition:`all ease-in-out duration-250`},{default:d(()=>[(n(!0),m(f,null,t(T.value,(t,r)=>p((n(),m(`div`,{key:t.key,class:`w-full flex flex-col items-start justify-between gap-2 rounded-lg px-4 py-3 outline-none transition-all duration-250 ease-in-out md:flex-row md:items-center md:gap-0`,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+r*10,delay:550+r*50,transition:`all ease-in-out duration-250`},[h(`div`,null,[h(`span`,I,i(e.$rt(t.title)),1),h(`div`,L,i(e.$rt(t.description)),1)]),l(u(_),{colors:t.colors.map(({hex:t,name:n})=>({hex:t,name:e.$rt(n)}))},null,8,[`colors`])],8,F)),[[b]])),128))]),_:1},8,[`title`])),[[b]]),p((n(),m(`div`,R,[...c[11]||=[h(`div`,{text:`60`,"i-solar:pallete-2-bold-duotone":``},null,-1)]])),[[b]])],64)}}});typeof S==`function`&&S(z);var B=y(z,[[`__scopeId`,`data-v-16e5a478`]]);export{B as default}; \ No newline at end of file diff --git a/assets/comet-api-speech-Dfu-r2Ac.js b/assets/comet-api-speech-bC6Lt6Xh.js similarity index 89% rename from assets/comet-api-speech-Dfu-r2Ac.js rename to assets/comet-api-speech-bC6Lt6Xh.js index a9dbb3b6a91978a38c0d8f0c937cdae5b01431a2..ebc56ebf05de7ad89596fde53a4cfe1c86a8e4a2 100644 --- a/assets/comet-api-speech-Dfu-r2Ac.js +++ b/assets/comet-api-speech-bC6Lt6Xh.js @@ -1 +1 @@ -import{A as e,K as t,S as n,at as r,b as i,k as a,kt as o,lt as s,xt as c}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-CZ9Rvki9.js";import{l}from"./src-DYQXbDgu.js";import{a as u}from"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{c as d,u as f}from"./components-BR_Kqwtu.js";import{i as p,t as m}from"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import{n as h}from"./vue-i18n.runtime-Dah5zGm4.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-D1kLcsvA.js";import"./__vite-browser-external-BaycPy5b.js";import{t as g}from"./route-block-CpjdOEnv.js";var _=`comet-api-speech`,v=`gpt-4o-mini-tts`,y=e({__name:`comet-api-speech`,setup(e){let g=m(),y=p(),{providers:b}=u(y),{t:x}=h(),S={speed:1},C=c(1),w=i(()=>!!b.value[_]?.apiKey),T=i(()=>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 r(C,async()=>{let e=y.getProviderConfig(_);e.speed=C.value}),(e,r)=>(t(),n(o(d),{"provider-id":_,"default-model":v,"additional-settings":S},{"voice-settings":s(()=>[a(o(l),{modelValue:C.value,"onUpdate:modelValue":r[0]||=e=>C.value=e,label:o(x)(`settings.pages.providers.provider.common.fields.field.speed.label`),description:o(x)(`settings.pages.providers.provider.common.fields.field.speed.description`),min:.5,max:2,step:.01},null,8,[`modelValue`,`label`,`description`])]),playground:s(()=>[a(o(f),{"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 +import{A as e,K as t,S as n,at as r,b as i,k as a,kt as o,lt as s,xt as c}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-C0YByt49.js";import{l}from"./src-DYQXbDgu.js";import{a as u}from"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{c as d,u as f}from"./components-CeE-UiLT.js";import{i as p,t as m}from"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import{n as h}from"./vue-i18n.runtime-Dah5zGm4.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-73vyHOZs.js";import"./__vite-browser-external-BaycPy5b.js";import{t as g}from"./route-block-CpjdOEnv.js";var _=`comet-api-speech`,v=`gpt-4o-mini-tts`,y=e({__name:`comet-api-speech`,setup(e){let g=m(),y=p(),{providers:b}=u(y),{t:x}=h(),S={speed:1},C=c(1),w=i(()=>!!b.value[_]?.apiKey),T=i(()=>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 r(C,async()=>{let e=y.getProviderConfig(_);e.speed=C.value}),(e,r)=>(t(),n(o(d),{"provider-id":_,"default-model":v,"additional-settings":S},{"voice-settings":s(()=>[a(o(l),{modelValue:C.value,"onUpdate:modelValue":r[0]||=e=>C.value=e,label:o(x)(`settings.pages.providers.provider.common.fields.field.speed.label`),description:o(x)(`settings.pages.providers.provider.common.fields.field.speed.description`),min:.5,max:2,step:.01},null,8,[`modelValue`,`label`,`description`])]),playground:s(()=>[a(o(f),{"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/comet-api-transcription-BxkdP1WS.js b/assets/comet-api-transcription-B8mNI5J9.js similarity index 94% rename from assets/comet-api-transcription-BxkdP1WS.js rename to assets/comet-api-transcription-B8mNI5J9.js index 671d222ef413884149caf924d565a669edf48f93..353c9896f8ac2a5d57ae59d5fa0b6328f9f42e50 100644 --- a/assets/comet-api-transcription-BxkdP1WS.js +++ b/assets/comet-api-transcription-B8mNI5J9.js @@ -1 +1 @@ -import{A as e,C as t,E as n,K as r,O as i,Pt as a,S as o,b as s,k as c,kt as l,lt as u,x as d}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-CZ9Rvki9.js";import{d as f}from"./src-DYQXbDgu.js";import{a as p}from"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{G as m,J as h,K as g,U as _,W as v,a as y,gt as b,q as x}from"./components-BR_Kqwtu.js";import{i as S}from"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-D1kLcsvA.js";import"./__vite-browser-external-BaycPy5b.js";import{n as C}from"./hearing-BH9rth_f.js";import{t as w}from"./route-block-CpjdOEnv.js";import{t as T}from"./use-provider-validation-DbXr83wX.js";var E={class:`whitespace-pre-wrap break-all`},D=`comet-api-transcription`,O=e({__name:`comet-api-transcription`,setup(e){let w=C(),O=S(),{providers:k}=p(O),A=s({get:()=>k.value[D]?.apiKey||``,set:e=>{k.value[D]||(k.value[D]={}),k.value[D].apiKey=e}}),j=s({get:()=>k.value[D]?.baseUrl||``,set:e=>{k.value[D]||(k.value[D]={}),k.value[D].baseUrl=e}}),M=s({get:()=>k.value[D]?.model||``,set:e=>{k.value[D]||(k.value[D]={}),k.value[D].model=e}}),N=s(()=>!!k.value[D]?.apiKey);async function P(e){let t=await O.getProviderInstance(D);if(!t)throw Error(`Failed to initialize transcription provider`);return await w.transcription(D,t,M.value,e,`json`)}let{t:F,router:I,providerMetadata:L,isValidating:R,isValid:z,validationMessage:B,handleResetSettings:V}=T(D);return(e,s)=>(r(),o(l(_),{"provider-name":l(L)?.localizedName,"provider-icon-color":l(L)?.iconColor,"on-back":()=>l(I).back()},{default:u(()=>[c(l(v),null,{default:u(()=>[c(l(m),{title:l(F)(`settings.pages.providers.common.section.basic.title`),description:l(F)(`settings.pages.providers.common.section.basic.description`),"on-reset":l(V)},{default:u(()=>[c(l(x),{modelValue:A.value,"onUpdate:modelValue":s[0]||=e=>A.value=e,"provider-name":l(L)?.localizedName,placeholder:`sk-...`},null,8,[`modelValue`,`provider-name`]),c(l(f),{modelValue:M.value,"onUpdate:modelValue":s[1]||=e=>M.value=e,label:l(F)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.manual_model_name`),placeholder:l(F)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.manual_model_placeholder`)},null,8,[`modelValue`,`label`,`placeholder`])]),_:1},8,[`title`,`description`,`on-reset`]),c(l(h),{title:l(F)(`settings.pages.providers.common.section.advanced.title`)},{default:u(()=>[c(l(g),{modelValue:j.value,"onUpdate:modelValue":s[2]||=e=>j.value=e,placeholder:l(L)?.defaultOptions?.().baseUrl||`https://api.cometapi.com/v1/`},null,8,[`modelValue`,`placeholder`])]),_:1},8,[`title`]),!l(z)&&l(R)===0&&l(B)?(r(),o(l(b),{key:0,type:`error`},n({title:u(()=>[i(a(l(F)(`settings.dialogs.onboarding.validationFailed`)),1)]),_:2},[l(B)?{name:`content`,fn:u(()=>[d(`div`,E,a(l(B)),1)]),key:`0`}:void 0]),1024)):t(``,!0),l(z)&&l(R)===0?(r(),o(l(b),{key:1,type:`success`},{title:u(()=>[i(a(l(F)(`settings.dialogs.onboarding.validationSuccess`)),1)]),_:1})):t(``,!0)]),_:1}),c(l(y),{"generate-transcription":P,"api-key-configured":N.value},null,8,[`api-key-configured`])]),_:1},8,[`provider-name`,`provider-icon-color`,`on-back`]))}});typeof w==`function`&&w(O);var k=O;export{k as default}; \ No newline at end of file +import{A as e,C as t,E as n,K as r,O as i,Pt as a,S as o,b as s,k as c,kt as l,lt as u,x as d}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-C0YByt49.js";import{d as f}from"./src-DYQXbDgu.js";import{a as p}from"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{G as m,J as h,K as g,U as _,W as v,a as y,gt as b,q as x}from"./components-CeE-UiLT.js";import{i as S}from"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-73vyHOZs.js";import"./__vite-browser-external-BaycPy5b.js";import{n as C}from"./hearing-BH9rth_f.js";import{t as w}from"./route-block-CpjdOEnv.js";import{t as T}from"./use-provider-validation-DbXr83wX.js";var E={class:`whitespace-pre-wrap break-all`},D=`comet-api-transcription`,O=e({__name:`comet-api-transcription`,setup(e){let w=C(),O=S(),{providers:k}=p(O),A=s({get:()=>k.value[D]?.apiKey||``,set:e=>{k.value[D]||(k.value[D]={}),k.value[D].apiKey=e}}),j=s({get:()=>k.value[D]?.baseUrl||``,set:e=>{k.value[D]||(k.value[D]={}),k.value[D].baseUrl=e}}),M=s({get:()=>k.value[D]?.model||``,set:e=>{k.value[D]||(k.value[D]={}),k.value[D].model=e}}),N=s(()=>!!k.value[D]?.apiKey);async function P(e){let t=await O.getProviderInstance(D);if(!t)throw Error(`Failed to initialize transcription provider`);return await w.transcription(D,t,M.value,e,`json`)}let{t:F,router:I,providerMetadata:L,isValidating:R,isValid:z,validationMessage:B,handleResetSettings:V}=T(D);return(e,s)=>(r(),o(l(_),{"provider-name":l(L)?.localizedName,"provider-icon-color":l(L)?.iconColor,"on-back":()=>l(I).back()},{default:u(()=>[c(l(v),null,{default:u(()=>[c(l(m),{title:l(F)(`settings.pages.providers.common.section.basic.title`),description:l(F)(`settings.pages.providers.common.section.basic.description`),"on-reset":l(V)},{default:u(()=>[c(l(x),{modelValue:A.value,"onUpdate:modelValue":s[0]||=e=>A.value=e,"provider-name":l(L)?.localizedName,placeholder:`sk-...`},null,8,[`modelValue`,`provider-name`]),c(l(f),{modelValue:M.value,"onUpdate:modelValue":s[1]||=e=>M.value=e,label:l(F)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.manual_model_name`),placeholder:l(F)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.manual_model_placeholder`)},null,8,[`modelValue`,`label`,`placeholder`])]),_:1},8,[`title`,`description`,`on-reset`]),c(l(h),{title:l(F)(`settings.pages.providers.common.section.advanced.title`)},{default:u(()=>[c(l(g),{modelValue:j.value,"onUpdate:modelValue":s[2]||=e=>j.value=e,placeholder:l(L)?.defaultOptions?.().baseUrl||`https://api.cometapi.com/v1/`},null,8,[`modelValue`,`placeholder`])]),_:1},8,[`title`]),!l(z)&&l(R)===0&&l(B)?(r(),o(l(b),{key:0,type:`error`},n({title:u(()=>[i(a(l(F)(`settings.dialogs.onboarding.validationFailed`)),1)]),_:2},[l(B)?{name:`content`,fn:u(()=>[d(`div`,E,a(l(B)),1)]),key:`0`}:void 0]),1024)):t(``,!0),l(z)&&l(R)===0?(r(),o(l(b),{key:1,type:`success`},{title:u(()=>[i(a(l(F)(`settings.dialogs.onboarding.validationSuccess`)),1)]),_:1})):t(``,!0)]),_:1}),c(l(y),{"generate-transcription":P,"api-key-configured":N.value},null,8,[`api-key-configured`])]),_:1},8,[`provider-name`,`provider-icon-color`,`on-back`]))}});typeof w==`function`&&w(O);var k=O;export{k as default}; \ No newline at end of file diff --git a/assets/components-BR_Kqwtu.js b/assets/components-CeE-UiLT.js similarity index 99% rename from assets/components-BR_Kqwtu.js rename to assets/components-CeE-UiLT.js index 820eb00c80a9a7ac01dac34fb8c2468c039816c8..f5e551229739db51fa79515a598c4ba9aeea7ff2 100644 --- a/assets/components-BR_Kqwtu.js +++ b/assets/components-CeE-UiLT.js @@ -1,5 +1,5 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-Dluh5dHB.js","assets/angular-html-BsVOYn8U.js","assets/html-HW8A3Dcn.js","assets/css-0NmOwaIy.js","assets/javascript-Cwo-aX3E.js","assets/angular-ts-DENmNPbC.js","assets/scss-D5x63j_P.js","assets/apl-VtBj-tPm.js","assets/json-BybUBpwp.js","assets/xml-CLaxgXK0.js","assets/java-BxPaqRPc.js","assets/astro-gQZvG91z.js","assets/postcss-DEmBk4B9.js","assets/tsx-CNS5Dh9u.js","assets/typescript-U0J5IFfI.js","assets/blade-BEEM-9q_.js","assets/html-derivative-Def2Eh7H.js","assets/sql-DEHoZ3CS.js","assets/bsl-BV-OxT7W.js","assets/sdbl-6qSwaYs5.js","assets/c-jsZCKY_j.js","assets/c-Db_j_sRr.js","assets/cairo-BfHIMykh.js","assets/python-BYCXN1fG.js","assets/cmake-B4HUKzrc.js","assets/cmake-DHYimkbZ.js","assets/cobol-BnpJdJAJ.js","assets/coffee-C3vE_C0-.js","assets/cpp-DWHzviHr.js","assets/cpp-QskMk08h.js","assets/glsl-Br38NFbK.js","assets/regexp-BSO1rOx5.js","assets/crystal-ODocUc7k.js","assets/shellscript-pp2ez-I0.js","assets/csharp-CBbPrYij.js","assets/csharp-C0f2l-Yr.js","assets/css-D-dnNlYl.js","assets/csv-CXNsSmCZ.js","assets/csv-D09rDnp3.js","assets/diff-DF-bn-p5.js","assets/diff-LBCBSdFv.js","assets/edge-DGGGOGiX.js","assets/elixir-DdmtoNcn.js","assets/elm-C87e-l4N.js","assets/erb-Cf-BYXiS.js","assets/ruby-BGDggo_i.js","assets/graphql-DMjFSnc1.js","assets/jsx-B4JCk6gF.js","assets/haml-rbnFKDKe.js","assets/lua-CZfvyPhi.js","assets/yaml-DnYR2pUT.js","assets/erlang-CIu3zK3d.js","assets/markdown-Dxe2aSDX.js","assets/fortran-fixed-form-CXwy3AN3.js","assets/fortran-free-form-Dnk4Dl5P.js","assets/fortran-free-form-D272xYfW.js","assets/fsharp-BqHhZ4Us.js","assets/gdresource-B-8GQb7C.js","assets/gdscript-DZ-vcsgQ.js","assets/gdshader-CUDFl6z8.js","assets/gdscript-D1a8fDKt.js","assets/gdshader-BOC-sw7F.js","assets/git-commit-CNjwX6_5.js","assets/git-rebase-CmHNvJSJ.js","assets/glimmer-js-FOvWOlAr.js","assets/glimmer-ts-DN_oCYdM.js","assets/glsl-DdAWLLg-.js","assets/go-B6mD6ydg.js","assets/go-DiF8FLLy.js","assets/graphql-9u5LjVmy.js","assets/hack-BUnBSK8E.js","assets/haml-Cu_s5oUC.js","assets/handlebars-Bit6i92P.js","assets/haxe-DyFF3WBQ.js","assets/haxe-BRLPuKN2.js","assets/hlsl-D_WlsJ5R.js","assets/hlsl-DO1yDaS5.js","assets/html-CttVmCOa.js","assets/html-derivative-D-UoP5du.js","assets/http-BPUd0Zxi.js","assets/hurl-ArZMoDH7.js","assets/hxml-iqbx3G6B.js","assets/java-DNbb1Epk.js","assets/javascript-DGYr-y5f.js","assets/jinja-DCr5FxIa.js","assets/jison-oyMrken4.js","assets/json-BatLJ8q8.js","assets/jsx-3S_5mzm5.js","assets/julia-BCLgBE7O.js","assets/r-DXVBc-0d.js","assets/latex-CTNmyalJ.js","assets/tex-BPt6iNUT.js","assets/less-DdxGSI8R.js","assets/less-82bUNl9Z.js","assets/liquid-Ctt3EYNO.js","assets/lua-DTYqVhuF.js","assets/markdown-CxX2QUo5.js","assets/marko-B1C6HK5k.js","assets/mdc-BiFfzJRB.js","assets/nginx-DDvT-Ioe.js","assets/nim-CYFIfJqN.js","assets/perl-gbQ4EDQp.js","assets/php-CY6yUTFD.js","assets/php-C_J3wAEq.js","assets/postcss-BUQ4KAJ7.js","assets/pug-HFyCGSoj.js","assets/python-I5cicAGo.js","assets/qml-CA7WJUu7.js","assets/r-Ddhwej8I.js","assets/razor-CZbfBDaQ.js","assets/regexp-B_5nnJWQ.js","assets/rst-C_Pj8QDw.js","assets/ruby-D5-34Kc7.js","assets/sas-ClgPuXh9.js","assets/scss-SahjZYbx.js","assets/sdbl-BFRivVXs.js","assets/shaderlab-BJ9GiKkz.js","assets/shellscript-vAa2iWrr.js","assets/shellsession-D5QvUGYH.js","assets/soy-CrDbnlG-.js","assets/sparql-CIWSOXvP.js","assets/turtle-DhkuLyiH.js","assets/sql-CNGZv43K.js","assets/stata-D6hNc7qD.js","assets/stylus-CTQWQil7.js","assets/stylus-elBmfiaN.js","assets/svelte-CcfQZqL8.js","assets/templ-BWumpO_4.js","assets/tex-C_wmpywk.js","assets/ts-tags-BAPF9r3N.js","assets/tsx-DMd3gS0e.js","assets/turtle-Bl_4e10u.js","assets/twig-Db3qd8yh.js","assets/typescript-DWWSNqcd.js","assets/vue-BGjJvQz8.js","assets/vue-CTSsf9M1.js","assets/vue-html-HA0p16KG.js","assets/vue-vine-CBJbFliW.js","assets/xml-CHddl9DN.js","assets/xsl-DcWTn_FV.js","assets/yaml-Cx7z1uMB.js"])))=>i.map(i=>d[i]); -import{o as e,r as t,t as n}from"./chunk-B78Zgmat.js";import{A as r,B as i,C as a,E as o,Et as s,F as c,G as l,H as u,J as d,K as f,Nt as p,O as m,Ot as h,Pt as g,R as _,S as v,W as y,X as b,Y as x,Z as S,a as C,at as ee,b as w,f as T,gt as te,jt as E,k as D,kt as O,l as ne,lt as k,m as re,n as ie,nt as ae,q as oe,rt as se,s as ce,ut as le,w as A,wt as ue,x as j,xt as M}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import{S as de,a as fe,b as pe,h as me,i as he,n as ge,r as _e,u as ve}from"./widgets-CZ9Rvki9.js";import{c as ye,d as be,f as xe,l as Se,p as Ce,r as we,x as Te}from"./src-DYQXbDgu.js";import{a as Ee,i as De,t as Oe}from"./resettable-CbXzRviW.js";import{n as ke,t as N}from"./preload-helper-Dn1uWANL.js";import{o as Ae}from"./vue-router-Chhv6vZu.js";import{i as je,m as Me,r as Ne,t as Pe}from"./DialogTitle-ytlEE0A-.js";import{a as Fe,u as Ie}from"./environment-CyZLTg97.js";import{t as Le}from"./_plugin-vue_export-helper-DGA9ry_j.js";import{C as Re,E as ze,O as Be,b as Ve,c as He,i as Ue,l as We,m as Ge,t as Ke,x as qe,y as Je}from"./dist-Che88T83.js";import{n as Ye,r as Xe,t as Ze}from"./src-C83SCWbW.js";import{i as Qe,l as $e,r as et,t as tt,u as nt}from"./speech-6W29lyZ_.js";import{t as rt}from"./purify.es-Dld0-TNF.js";import{n as it}from"./vue-i18n.runtime-Dah5zGm4.js";import{t as at}from"./sleep-CkgWku9y.js";import{D as ot}from"./settings-D1kLcsvA.js";import{a as st,i as ct,n as lt,r as ut,t as dt}from"./output-C8zlODy6.js";var ft=r({__name:`AudioSpectrum`,props:{stream:{},bars:{default:32},minFreq:{default:60},maxFreq:{default:4e3}},setup(e){let t=e,n=M(Array.from({length:t.bars}).fill(0));y(()=>{r()}),ee(()=>t.stream,()=>{r()});function r(){if(!t.stream)return;let e=new(window.AudioContext||window.webkitAudioContext),r=e.createMediaStreamSource(t.stream),i=e.createAnalyser();i.fftSize=2048,r.connect(i);let a=i.frequencyBinCount,o=new Uint8Array(a),s=e.sampleRate/i.fftSize,c=Math.floor(t.minFreq/s),l=Math.floor(t.maxFreq/s),u=l-c,d=Math.floor(u/t.bars),f=()=>{try{requestAnimationFrame(f),i.getByteFrequencyData(o);let e=Array.from({length:t.bars}).fill(0);for(let n=0;nx(e.$slots,`default`,{frequencies:n.value})}}),pt={"h-full":``,flex:``,"items-center":``,"gap-1":``},mt=5,ht=r({__name:`AudioSpectrumVisualizer`,props:{frequencies:{},barsClass:{}},setup(e){let t=e;function n(e,t){let n=.1;return n+(1-n)*(e/t)}function r(e,r){let i=n(r,t.frequencies.length);return Math.min(100,Math.max(10,e*100*mt*i))}return(t,n)=>(f(),A(`div`,pt,[(f(!0),A(re,null,d(e.frequencies,(t,n)=>(f(),A(`div`,{key:n,"h-full":``,flex:``,"flex-1":``,"items-end":``},[j(`div`,{transition:`all 100 ease-in-out`,"mx-auto":``,"my-0":``,"w-full":``,"rounded-full":``,class:E(e.barsClass),style:p({height:`${r(t,n)}%`})},null,6)]))),128))]))}}),gt={key:0,class:`mb-2 flex items-center justify-between`},_t={class:`text-sm font-medium`},vt={class:`text-sm text-neutral-500`},yt=r({__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(e){let t=e,n=w(()=>{let e=Math.max(0,Math.min(100,(t.level-t.min)/(t.max-t.min)*100)),n=Math.floor(e/100*t.numBars);return Array.from({length:t.numBars},(e,r)=>({active:re.value-t.value);for(let e of r)if(n<=e.value)return e.color;return r[r.length-1]?.color||`bg-green-500`}return(t,i)=>(f(),A(`div`,null,[e.showHeader?(f(),A(`div`,gt,[j(`span`,_t,g(e.label),1),j(`span`,vt,g(e.formatValue?e.formatValue(e.level):`${Math.round(e.level)}${e.unit}`),1)])):a(``,!0),j(`div`,{class:`flex items-end gap-1 rounded bg-neutral-200/45 p-1 dark:bg-neutral-700`,style:p({height:`${e.height}px`})},[(f(!0),A(re,null,d(n.value,(t,n)=>(f(),A(`div`,{key:n,class:E([`flex-1 rounded-sm transition-all`,[t.active?r(n,t.level):`bg-neutral-200 dark:bg-neutral-600`,`duration-${e.animationSpeed}`]]),style:p({height:t.active?`100%`:`20%`})},null,6))),128))],4)]))}}),bt=Le(r({__name:`Volumed`,props:{perspective:{},transform:{}},setup(e){return(t,n)=>(f(),A(`div`,{class:`volumed`,style:p({perspective:`${e.perspective}px`,transform:e.transform})},[x(t.$slots,`default`,{},void 0,!0)],4))}}),[[`__scopeId`,`data-v-45a50d47`]]),xt=r({__name:`CursorMomentum`,props:{baseSpeed:{default:.1},friction:{default:.95},momentumFactor:{default:.005}},setup(e,{expose:t}){let n=e,r=M(1),i=M(0),a=0,o=s(()=>n.friction),c=s(()=>n.baseSpeed),u=s(()=>n.momentumFactor);function d(e){a||=e;let t=e-a;a=e,r.value=c.value+(r.value-c.value)*o.value,i.value+=r.value*t,requestAnimationFrame(d)}function f(e){let t=Math.sqrt(e.movementX**2+e.movementY**2);r.value+=t*u.value}return y(()=>{window.addEventListener(`mousemove`,f),requestAnimationFrame(d)}),l(()=>{window.removeEventListener(`mousemove`,f)}),t({momentum:r,currentValue:i}),(e,t)=>x(e.$slots,`default`,{momentum:r.value,currentValue:i.value})}}),St=Le(r({__name:`TestDummyMarkerFlat`,props:{size:{}},setup(e){return(t,n)=>(f(),A(`div`,{class:`test-dummy-flat`,style:p({width:`${e.size}px`,height:`${e.size}px`})},[...n[0]||=[j(`div`,{class:`marker`},null,-1)]],4))}}),[[`__scopeId`,`data-v-aa597cdd`]]),Ct=r({__name:`TestDummyMarker`,setup(e){return(e,t)=>(f(),v(xt,{"base-speed":.1,friction:.95,"momentum-factor":5e-4},{default:k(({currentValue:e})=>[D(bt,{perspective:800,transform:`rotateX(45deg) translateY(3px)`},{default:k(()=>[D(St,{size:24,style:p({transform:`rotate(${e}deg)`})},null,8,[`style`])]),_:2},1024)]),_:1}))}}),wt={key:0,class:`mb-2 flex items-center justify-between`},Tt={class:`text-sm font-medium`},Et={class:`text-sm text-neutral-500`},Dt={key:1,class:`mt-1 flex gap-3 text-xs text-neutral-500`},Ot={class:`flex items-center gap-1`},kt={class:`flex items-center gap-1`},At={class:`flex items-center gap-1`},jt=r({__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(e){let t=e,n=w(()=>{let e=Math.max(0,Math.min(1,(t.value-t.min)/(t.max-t.min))),n=Math.max(0,Math.min(1,(t.threshold-t.min)/(t.max-t.min))),r=Math.floor(e*t.numBars),i=Math.floor(n*t.numBars);return Array.from({length:t.numBars},(e,t)=>({active:t=i,isBelowThreshold:t(f(),A(`div`,null,[e.showHeader?(f(),A(`div`,wt,[j(`span`,Tt,g(e.label),1),j(`span`,Et,g(e.formatValue?e.formatValue(e.value):`${(e.value*100).toFixed(e.precision)}${e.unit}`),1)])):a(``,!0),j(`div`,{class:`flex items-end gap-1 rounded bg-neutral-200/45 p-1 p-1 dark:bg-neutral-700`,style:p({height:`${e.height}px`})},[(f(!0),A(re,null,d(n.value,(t,n)=>(f(),A(`div`,{key:`threshold-${n}`,class:E([`flex-1 rounded-sm transition-all`,[t.isThreshold?e.thresholdBarClass:t.isAboveThreshold?e.aboveThresholdClass:t.isBelowThreshold?e.belowThresholdClass:e.inactiveBarClass,`duration-${e.animationSpeed}`]]),style:p({height:t.active||t.isThreshold?`100%`:`20%`})},null,6))),128))],4),e.showLegend?(f(),A(`div`,Dt,[j(`span`,Ot,[j(`div`,{class:E(`inline-block h-0.5lh w-1lh rounded-full ${e.belowThresholdClass}`)},null,2),m(` `+g(e.belowLabel),1)]),j(`span`,kt,[j(`div`,{class:E(`inline-block h-0.5lh w-1lh rounded-full border border-neutral-400 ${e.thresholdBarClass}`)},null,2),m(` `+g(e.thresholdLabel),1)]),j(`span`,At,[j(`div`,{class:E(`inline-block h-0.5lh w-1lh rounded-full ${e.aboveThresholdClass}`)},null,2),m(` `+g(e.aboveLabel),1)])])):a(``,!0)]))}});function Mt(e){return{color:e,withAlpha:t=>{let n=Ze(e);if(!n)throw Error(`Invalid color provided for alpha adjustment`);return Mt(Ze({mode:`oklch`,l:n.l,c:n.c,h:n.h,alpha:t}))},toHex:()=>Xe(e),toCSS:()=>Ye(e)}}function Nt(e=200,t){let n=t??.18+Math.cos(e*Math.PI/180)*.04,r={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}},i=(t,i,a=0)=>{let o=r[t],s=(e+a)%360,c=n*o.chromaMultiplier,l=Ze({mode:`oklch`,l:o.lightness,c,h:s,alpha:i??1});return o.mixWithWhite?Mt(Pt(l,Ze({mode:`oklch`,l:1,c:0,h:0,alpha:i??1}),o.mixWithWhite)):Mt(l)};return{baseHue:e,chroma:n,getAllShades:(e,t=0)=>{let n={};for(let a of Object.keys(r)){let r=Number.parseInt(a);n[r]=i(r,e,t)}return n},shadeBy:i}}function Pt(e,t,n=.5){let r=Ze(e),i=Ze(t);if(!r||!i)throw Error(`Invalid colors provided for mixing`);return Ze({mode:`oklch`,l:r.l*(1-n)+i.l*n,c:r.c*(1-n)+i.c*n,h:Ft(r.h??0,i.h??0,n)})}function Ft(e,t,n){let r=t-e;return r>180&&(r-=360),r<-180&&(r+=360),(e+r*n+360)%360}const It=Symbol(`@proj-airi/chromatic-hue`),Lt=`<|llm_inference_end|>`;var Rt={key:0,class:`flex items-center justify-between`},zt={class:`text-sm font-medium`},Bt={class:`text-xs text-neutral-500`},Vt={class:`h-full w-full`},Ht={id:`below-threshold-gradient`,x1:`0%`,y1:`0%`,x2:`0%`,y2:`100%`},Ut=[`fill`],Wt=[`y`,`height`,`fill`],Gt=[`y1`,`y2`,`stroke`,`fill`],Kt=[`d`,`fill`],qt=[`d`,`stroke`,`stroke-width`],Jt={key:0,class:`absolute left-2 top-2 flex items-center gap-1.5 border border-primary-200 rounded-md bg-primary-50 px-2 py-1 dark:border-primary-800 dark:bg-primary-900`},Yt={class:`text-xs text-primary-700 font-medium dark:text-primary-300`},Xt={key:1,class:`flex flex-wrap items-center justify-between text-xs text-neutral-500`},Zt={class:`flex items-center gap-3`},Qt={class:`flex items-center gap-1 text-nowrap`},$t={class:`flex items-center gap-1 text-nowrap`},en={key:0,class:`text-nowrap`},tn=Le(r({__name:`TimeSeriesChart`,props:{history:{},currentValue:{},threshold:{default:null},isActive:{type:Boolean},title:{default:`Time Series`},colorsHue:{},lineColor:{},thresholdColor:{},activeColor:{},inactiveColor:{},subtitle:{default:`Recent data`},activeLabel:{default:`Active`},activeLegendLabel:{default:`Active state`},inactiveLegendLabel:{default:`Inactive state`},thresholdLabel:{default:`Threshold`},height:{default:80},lineWidth:{default:1.5},chartHeight:{},minDataPoints:{default:5},precision:{default:0},unit:{default:`%`},showHeader:{type:Boolean,default:!0},showThreshold:{type:Boolean,default:!0},showArea:{type:Boolean,default:!0},showThresholdAreas:{type:Boolean,default:!0},showCurrentValue:{type:Boolean,default:!0},showActiveIndicator:{type:Boolean,default:!0},showLegend:{type:Boolean,default:!0},formatValue:{}},setup(e){let t=e,n=w(()=>t.height),r=M(),i=c(It,220.44),o=s(()=>t.colorsHue||i||220.44),l=w(()=>Nt(o.value)),u=We(r,{windowResize:!0});ee([o,r],()=>{r.value&&r.value.style.setProperty(`--chromatic-hue`,o.value.toString())},{immediate:!0});let d=s(()=>t.lineColor),h=w(()=>d.value?d.value:l.value.shadeBy(500).toHex()),_=s(()=>t.thresholdColor),v=w(()=>{if(!_.value){let e=l.value.shadeBy(500).withAlpha(.1).color;return`oklch(${e.l} ${e.c} ${e.h} / ${e.alpha})`}return _.value}),y=s(()=>t.activeColor),b=w(()=>y.value?y.value:l.value.shadeBy(600).toHex()),x=s(()=>t.inactiveColor),S=w(()=>x.value?x.value:l.value.shadeBy(400).toHex()),C=Math.random().toString(36).substring(2,9),T=`grid-${C}`,te=`area-gradient-${C}`,O=`threshold-gradient-${C}`,ne=w(()=>t.threshold===null?0:Math.max(0,Math.min(1,t.threshold))),re=w(()=>t.threshold===null?0:n.value-ne.value*n.value),ae=w(()=>{let e=t.history;if(e.length<2)return``;let r=u.width.value,i=n.value,a=`M0,${i-e[0]*i}`;for(let t=1;t{let e=t.history;if(e.length<2)return``;let r=u.width.value,i=n.value,a=`M0,${i} L0,${i-e[0]*i}`;for(let t=1;te.history.length>e.minDataPoints?(f(),A(`div`,{key:0,ref_key:`timeSeriesChartRef`,ref:r,class:`time-series-chart space-y-3`},[e.showHeader?(f(),A(`div`,Rt,[j(`div`,zt,g(e.title),1),j(`div`,Bt,g(e.subtitle),1)])):a(``,!0),j(`div`,{class:`relative overflow-hidden border border-neutral-200 rounded-lg from-neutral-50 to-neutral-100 bg-gradient-to-b dark:border-neutral-800 dark:from-neutral-800 dark:to-neutral-900`,style:p({height:`${n.value}px`})},[(f(),A(`svg`,Vt,[j(`defs`,null,[j(`pattern`,{id:T,width:`20`,height:`10`,patternUnits:`userSpaceOnUse`},[...i[0]||=[j(`path`,{d:`M 20 0 L 0 0 0 10`,fill:`none`,stroke:`rgb(156 163 175 / 0.1)`,"stroke-width":`0.5`},null,-1)]]),j(`linearGradient`,{id:te,x1:`0%`,y1:`0%`,x2:`0%`,y2:`100%`},[j(`stop`,{offset:`0%`,style:p(`stop-color:${h.value};stop-opacity:0.3`)},null,4),j(`stop`,{offset:`50%`,style:p(`stop-color:${h.value};stop-opacity:0.15`)},null,4),j(`stop`,{offset:`100%`,style:p(`stop-color:${h.value};stop-opacity:0.05`)},null,4)]),j(`linearGradient`,{id:O,x1:`0%`,y1:`0%`,x2:`0%`,y2:`100%`},[j(`stop`,{offset:`0%`,style:p(`stop-color:${b.value};stop-opacity:0.3`)},null,4),j(`stop`,{offset:`50%`,style:p(`stop-color:${b.value};stop-opacity:0.15`)},null,4),j(`stop`,{offset:`100%`,style:p(`stop-color:${b.value};stop-opacity:0.05`)},null,4)]),j(`linearGradient`,Ht,[j(`stop`,{offset:`0%`,style:p(`stop-color:${v.value};stop-opacity:0.2`)},null,4),j(`stop`,{offset:`50%`,style:p(`stop-color:${v.value};stop-opacity:0.1`)},null,4),j(`stop`,{offset:`100%`,style:p(`stop-color:${v.value};stop-opacity:0.05`)},null,4)])]),j(`rect`,{width:`100%`,height:`100%`,fill:`url(#${T})`},null,8,Ut),e.showThreshold&&e.threshold!==null?(f(),A(`rect`,{key:0,x:`0`,y:re.value,width:`100%`,height:n.value-re.value,fill:v.value,class:`transition-all duration-300`},null,8,Wt)):a(``,!0),e.showThreshold&&e.threshold!==null?(f(),A(`line`,{key:1,x1:`0`,y1:re.value,x2:`100%`,y2:re.value,stroke:v.value,"stroke-width":`1.5`,"stroke-dasharray":`4,4`,fill:v.value,class:`transition-all duration-300`},null,8,Gt)):a(``,!0),oe.value&&e.showArea?(f(),A(`path`,{key:2,d:oe.value,fill:`url(#${te})`,class:`transition-all duration-75`},null,8,Kt)):a(``,!0),ae.value?(f(),A(`path`,{key:3,d:ae.value,fill:`none`,stroke:h.value,"stroke-width":e.lineWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:`drop-shadow-sm transition-all duration-75`},null,8,qt)):a(``,!0)])),e.showCurrentValue?(f(),A(`div`,{key:0,class:E([`absolute right-2 top-2 border border-neutral-200 rounded-md bg-white px-2 py-1 shadow-sm transition-all duration-200 dark:border-neutral-700 dark:bg-neutral-800`,e.isActive?`bg-primary-50 dark:bg-primary-900 border-primary-200 dark:border-primary-800`:``])},[j(`div`,{class:E([`text-xs font-medium`,e.isActive?`text-primary-700 dark:text-primary-300`:`text-neutral-600 dark:text-neutral-400`])},g(e.formatValue?e.formatValue(e.currentValue):`${(e.currentValue*100).toFixed(e.precision)}${e.unit}`),3)],2)):a(``,!0),D(ie,{name:`fade`},{default:k(()=>[e.isActive&&e.showActiveIndicator?(f(),A(`div`,Jt,[i[1]||=j(`div`,{class:`h-1.5 w-1.5 animate-pulse rounded-full bg-primary-500`},null,-1),j(`span`,Yt,g(e.activeLabel),1)])):a(``,!0)]),_:1})],4),e.showLegend?(f(),A(`div`,Xt,[j(`div`,Zt,[j(`span`,Qt,[j(`div`,{class:`h-2 w-2 rounded-full`,style:p({backgroundColor:b.value})},null,4),m(` `+g(e.activeLegendLabel),1)]),j(`span`,$t,[j(`div`,{class:`h-2 w-2 rounded-full`,style:p({backgroundColor:S.value})},null,4),m(` `+g(e.inactiveLegendLabel),1)])]),e.threshold===null?a(``,!0):(f(),A(`span`,en,g(e.thresholdLabel)+`: `+g((e.threshold*100).toFixed(0))+`%`,1))])):a(``,!0)],512)):a(``,!0)}}),[[`__scopeId`,`data-v-3b2e411d`]]);function nn(e){let{cols:t,originIndex:n,sectionItemCounts:r,delayPerUnit:i=80}=e,a=w(()=>{let e=[],n=0,i=0,a=h(t),o=h(r);for(let t of o){let r=Math.ceil(t/a);e.push({startLinearIndex:n,startRow:i,itemCount:t}),n+=t,i+=r}return e}),o=w(()=>{let e=new Map,n=h(t);for(let t of a.value)for(let r=0;rs(h(n)||0));function l(e){let t=s(e),n=c.value;return(Math.abs(t.row-n.row)+Math.abs(t.col-n.col))*i}return{getDelay:l}}var rn={class:`flex flex-col gap-5`},an=[`initial`,`enter`,`onClick`],on=r({__name:`RippleGrid`,props:{items:{},sections:{},getItems:{type:Function,default:e=>e.items||[]},getKey:{type:Function,default:e=>e.id??e.key},columns:{default:()=>({default:1,sm:2,xl:3})},originIndex:{default:0},animationInitial:{default:()=>({opacity:0,y:10})},animationEnter:{default:()=>({opacity:1,y:0})},animationDuration:{default:250},delayPerUnit:{default:80}},emits:[`itemClick`],setup(e,{emit:t}){let n=e,r=t,i=Ue(Ke),o=[`2xl`,`xl`,`lg`,`md`,`sm`],c=w(()=>!!n.items&&!n.sections),l=w(()=>c.value&&n.items?[{_isVirtual:!0,items:n.items}]:n.sections||[]),u=w(()=>{if(typeof n.columns==`number`)return n.columns;for(let e of o)if(n.columns[e]&&i.greaterOrEqual(e).value)return n.columns[e];return n.columns.default||1}),m=w(()=>{let e=0;return l.value.map(t=>{let r=c.value?t.items:n.getItems(t),i=e;return e+=r.length,{items:r,startIndex:i,count:r.length}})}),h=w(()=>m.value.map(e=>e.count)),{getDelay:g}=nn({cols:u,originIndex:s(n,`originIndex`),sectionItemCounts:h,delayPerUnit:n.delayPerUnit});function _(e,t){r(`itemClick`,{item:e,globalIndex:t})}return(t,r)=>{let i=S(`motion`);return f(),A(`div`,rn,[(f(!0),A(re,null,d(l.value,(r,o)=>(f(),A(re,{key:o},[t.$slots.header&&!c.value?(f(),A(`div`,{key:0,class:E({"my-5":o>0})},[x(t.$slots,`header`,{section:r,index:o})],2)):a(``,!0),j(`div`,{class:`grid gap-4`,style:p({gridTemplateColumns:`repeat(${u.value}, minmax(0, 1fr))`})},[(f(!0),A(re,null,d(m.value[o].items,(r,a)=>le((f(),A(`div`,{key:n.getKey(r),initial:e.animationInitial,enter:{...e.animationEnter,transition:{duration:e.animationDuration,delay:O(g)(m.value[o].startIndex+a)}},onClick:e=>_(r,m.value[o].startIndex+a)},[x(t.$slots,`item`,{item:r,index:m.value[o].startIndex+a,active:e.originIndex===m.value[o].startIndex+a})],8,an)),[[i]])),128))],4)],64))),128))])}}}),sn=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function cn(e){return ln(e)}function ln(e){return Array.isArray(e)?un(e):e instanceof RegExp?e:typeof e==`object`?dn(e):e}function un(e){let t=[];for(let n=0,r=e.length;n{for(let n in t)e[n]=t[n]}),e}function pn(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?pn(e.substring(0,e.length-1)):e.substr(~t+1)}var mn=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,hn=class{static hasCaptures(e){return e===null?!1:(mn.lastIndex=0,mn.test(e))}static replaceCaptures(e,t,n){return e.replace(mn,(e,r,i,a)=>{let o=n[parseInt(r||i,10)];if(o){let e=t.substring(o.start,o.end);for(;e[0]===`.`;)e=e.substring(1);switch(a){case`downcase`:return e.toLowerCase();case`upcase`:return e.toUpperCase();default:return e}}else return e})}};function gn(e,t){return et?1:0}function _n(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let r=0;rthis._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>Cn(e.parent,t.parentScopes));return n?new Tn(n.fontStyle,n.foreground,n.background):null}},Sn=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(let r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r`){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!wn(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function wn(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var Tn=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function En(e){if(!e||!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let e=0,i=t.length;e1&&(u=i.slice(0,i.length-1),u.reverse()),n[r++]=new Dn(l,u,e,o,s,c)}}return n}var Dn=class{constructor(e,t,n,r,i,a){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=a}},On=(e=>(e[e.NotSet=-1]=`NotSet`,e[e.None=0]=`None`,e[e.Italic=1]=`Italic`,e[e.Bold=2]=`Bold`,e[e.Underline=4]=`Underline`,e[e.Strikethrough=8]=`Strikethrough`,e))(On||{});function kn(e,t){e.sort((e,t)=>{let n=gn(e.scope,t.scope);return n!==0||(n=_n(e.parentScopes,t.parentScopes),n!==0)?n:e.index-t.index});let n=0,r=`#000000`,i=`#ffffff`;for(;e.length>=1&&e[0].scope===``;){let t=e.shift();t.fontStyle!==-1&&(n=t.fontStyle),t.foreground!==null&&(r=t.foreground),t.background!==null&&(i=t.background)}let a=new An(t),o=new Tn(n,a.getId(r),a.getId(i)),s=new Nn(new Mn(0,null,-1,0,0),[]);for(let t=0,n=e.length;te?console.log(`how did this happen?`):this.scopeDepth=e,t!==-1&&(this.fontStyle=t),n!==0&&(this.foreground=n),r!==0&&(this.background=r)}},Nn=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let n=0,r=0;for(;e.parentScopes[n]===`>`&&n++,t.parentScopes[r]===`>`&&r++,!(n>=e.parentScopes.length||r>=t.parentScopes.length);){let i=t.parentScopes[r].length-e.parentScopes[n].length;if(i!==0)return i;n++,r++}return t.parentScopes.length-e.parentScopes.length}match(t){if(t!==``){let e=t.indexOf(`.`),n,r;if(e===-1?(n=t,r=``):(n=t.substring(0,e),r=t.substring(e+1)),this._children.hasOwnProperty(n))return this._children[n].match(r)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(e._cmpBySpecificity),n}insert(t,n,r,i,a,o){if(n===``){this._doInsertHere(t,r,i,a,o);return}let s=n.indexOf(`.`),c,l;s===-1?(c=n,l=``):(c=n.substring(0,s),l=n.substring(s+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new e(this._mainRule.clone(),Mn.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(t+1,l,r,i,a,o)}_doInsertHere(e,t,n,r,i){if(t===null){this._mainRule.acceptOverwrite(e,n,r,i);return}for(let a=0,o=this._rulesWithParentScopes.length;a>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!=0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(t,n,r,i,a,o,s){let c=e.getLanguageId(t),l=e.getTokenType(t),u=e.containsBalancedBrackets(t)?1:0,d=e.getFontStyle(t),f=e.getForeground(t),p=e.getBackground(t);return n!==0&&(c=n),r!==8&&(l=In(r)),i!==null&&(u=i?1:0),a!==-1&&(d=a),o!==0&&(f=o),s!==0&&(p=s),(c<<0|l<<8|u<<10|d<<11|f<<15|p<<24)>>>0}};function Fn(e){return e}function In(e){return e}function Ln(e,t){let n=[],r=zn(e),i=r.next();for(;i!==null;){let e=0;if(i.length===2&&i.charAt(1)===`:`){switch(i.charAt(0)){case`R`:e=1;break;case`L`:e=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let t=o();if(n.push({matcher:t,priority:e}),i!==`,`)break;i=r.next()}return n;function a(){if(i===`-`){i=r.next();let e=a();return t=>!!e&&!e(t)}if(i===`(`){i=r.next();let e=s();return i===`)`&&(i=r.next()),e}if(Rn(i)){let e=[];do e.push(i),i=r.next();while(Rn(i));return n=>t(e,n)}return null}function o(){let e=[],t=a();for(;t;)e.push(t),t=a();return t=>e.every(e=>e(t))}function s(){let e=[],t=o();for(;t&&(e.push(t),i===`|`||i===`,`);){do i=r.next();while(i===`|`||i===`,`);t=o()}return t=>e.some(e=>e(t))}}function Rn(e){return!!e&&!!e.match(/[\w\.:]+/)}function zn(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let r=n[0];return n=t.exec(e),r}}}function Bn(e){typeof e.dispose==`function`&&e.dispose()}var Vn=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},Hn=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},Un=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},Wn=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Vn(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new Un;for(let n of e)Gn(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof Vn){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName)||this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function Gn(e,t,n,r){let i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw Error(`No grammar provided for <${t}>`);return}let a=n.lookup(t);e instanceof Vn?qn({baseGrammar:a,selfGrammar:i},r):Kn(e.ruleName,{baseGrammar:a,selfGrammar:i,repository:i.repository},r);let o=n.injections(e.scopeName);if(o)for(let e of o)r.add(new Vn(e))}function Kn(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];Jn([r],t,n)}}function qn(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&Jn(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&Jn(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function Jn(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?fn({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&Jn(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=er(i);switch(a.kind){case 0:qn({...t,selfGrammar:t.baseGrammar},n);break;case 1:qn(t,n);break;case 2:Kn(a.ruleName,{...t,repository:e},n);break;case 3:case 4:let r=a.scopeName===t.selfGrammar.scopeName?t.selfGrammar:a.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(r){let i={baseGrammar:t.baseGrammar,selfGrammar:r,repository:e};a.kind===4?Kn(a.ruleName,i,n):qn(i,n)}else a.kind===4?n.add(new Hn(a.scopeName,a.ruleName)):n.add(new Vn(a.scopeName));break}}}var Yn=class{kind=0},Xn=class{kind=1},Zn=class{constructor(e){this.ruleName=e}kind=2},Qn=class{constructor(e){this.scopeName=e}kind=3},$n=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function er(e){if(e===`$base`)return new Yn;if(e===`$self`)return new Xn;let t=e.indexOf(`#`);return t===-1?new Qn(e):t===0?new Zn(e.substring(1)):new $n(e.substring(0,t),e.substring(t+1))}var tr=/\\(\d+)/,nr=/\\(\d+)/g,rr=-1,ir=-2;function ar(e){return e}function or(e){return e}var sr=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=hn.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=hn.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${pn(this.$location.filename)}:${this.$location.line}`:`unknown`;return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:hn.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:hn.replaceCaptures(this._contentName,e,t)}},cr=class extends sr{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw Error(`Not supported!`)}compile(e,t){throw Error(`Not supported!`)}compileAG(e,t,n,r){throw Error(`Not supported!`)}},lr=class extends sr{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new mr(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new hr,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},ur=class extends sr{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new hr,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},dr=class extends sr{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r),this._begin=new mr(i,this.id),this.beginCaptures=a,this._end=new mr(o||`￿`,-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=s,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new hr;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},fr=class extends sr{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r),this._begin=new mr(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new mr(o,ir),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null),this._cachedCompiledWhilePatterns&&=(this._cachedCompiledWhilePatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new hr;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new hr,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||`￿`),this._cachedCompiledWhilePatterns}},pr=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new cr(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new lr(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=fn({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new ur(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new fr(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,r),e._compilePatterns(t.patterns,n,r)):new dr(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,e._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let a=0;for(let e in t){if(e===`$vscodeTextmateLocation`)continue;let t=parseInt(e,10);t>a&&(a=t)}for(let e=0;e<=a;e++)i[e]=null;for(let a in t){if(a===`$vscodeTextmateLocation`)continue;let o=parseInt(a,10),s=0;t[a].patterns&&(s=e.getCompiledRuleId(t[a],n,r)),i[o]=e.createCaptureRule(n,t[a].$vscodeTextmateLocation,t[a].name,t[a].contentName,s)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let a=0,o=t.length;ae.substring(t.start,t.end));return nr.lastIndex=0,this.source.replace(nr,(e,t)=>yn(n[parseInt(t,10)]||``))}_buildAnchorCache(){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let e=[],t=[],n=[],r=[],i,a,o,s;for(i=0,a=this.source.length;ie.source),this._items.map(e=>e.ruleId)),this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){return new gr(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},gr=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose==`function`&&this.scanner.dispose()}toString(){let e=[];for(let t=0,n=this.rules.length;t{r()}),ee(()=>t.stream,()=>{r()});function r(){if(!t.stream)return;let e=new(window.AudioContext||window.webkitAudioContext),r=e.createMediaStreamSource(t.stream),i=e.createAnalyser();i.fftSize=2048,r.connect(i);let a=i.frequencyBinCount,o=new Uint8Array(a),s=e.sampleRate/i.fftSize,c=Math.floor(t.minFreq/s),l=Math.floor(t.maxFreq/s),u=l-c,d=Math.floor(u/t.bars),f=()=>{try{requestAnimationFrame(f),i.getByteFrequencyData(o);let e=Array.from({length:t.bars}).fill(0);for(let n=0;nx(e.$slots,`default`,{frequencies:n.value})}}),pt={"h-full":``,flex:``,"items-center":``,"gap-1":``},mt=5,ht=r({__name:`AudioSpectrumVisualizer`,props:{frequencies:{},barsClass:{}},setup(e){let t=e;function n(e,t){let n=.1;return n+(1-n)*(e/t)}function r(e,r){let i=n(r,t.frequencies.length);return Math.min(100,Math.max(10,e*100*mt*i))}return(t,n)=>(f(),A(`div`,pt,[(f(!0),A(re,null,d(e.frequencies,(t,n)=>(f(),A(`div`,{key:n,"h-full":``,flex:``,"flex-1":``,"items-end":``},[j(`div`,{transition:`all 100 ease-in-out`,"mx-auto":``,"my-0":``,"w-full":``,"rounded-full":``,class:E(e.barsClass),style:p({height:`${r(t,n)}%`})},null,6)]))),128))]))}}),gt={key:0,class:`mb-2 flex items-center justify-between`},_t={class:`text-sm font-medium`},vt={class:`text-sm text-neutral-500`},yt=r({__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(e){let t=e,n=w(()=>{let e=Math.max(0,Math.min(100,(t.level-t.min)/(t.max-t.min)*100)),n=Math.floor(e/100*t.numBars);return Array.from({length:t.numBars},(e,r)=>({active:re.value-t.value);for(let e of r)if(n<=e.value)return e.color;return r[r.length-1]?.color||`bg-green-500`}return(t,i)=>(f(),A(`div`,null,[e.showHeader?(f(),A(`div`,gt,[j(`span`,_t,g(e.label),1),j(`span`,vt,g(e.formatValue?e.formatValue(e.level):`${Math.round(e.level)}${e.unit}`),1)])):a(``,!0),j(`div`,{class:`flex items-end gap-1 rounded bg-neutral-200/45 p-1 dark:bg-neutral-700`,style:p({height:`${e.height}px`})},[(f(!0),A(re,null,d(n.value,(t,n)=>(f(),A(`div`,{key:n,class:E([`flex-1 rounded-sm transition-all`,[t.active?r(n,t.level):`bg-neutral-200 dark:bg-neutral-600`,`duration-${e.animationSpeed}`]]),style:p({height:t.active?`100%`:`20%`})},null,6))),128))],4)]))}}),bt=Le(r({__name:`Volumed`,props:{perspective:{},transform:{}},setup(e){return(t,n)=>(f(),A(`div`,{class:`volumed`,style:p({perspective:`${e.perspective}px`,transform:e.transform})},[x(t.$slots,`default`,{},void 0,!0)],4))}}),[[`__scopeId`,`data-v-45a50d47`]]),xt=r({__name:`CursorMomentum`,props:{baseSpeed:{default:.1},friction:{default:.95},momentumFactor:{default:.005}},setup(e,{expose:t}){let n=e,r=M(1),i=M(0),a=0,o=s(()=>n.friction),c=s(()=>n.baseSpeed),u=s(()=>n.momentumFactor);function d(e){a||=e;let t=e-a;a=e,r.value=c.value+(r.value-c.value)*o.value,i.value+=r.value*t,requestAnimationFrame(d)}function f(e){let t=Math.sqrt(e.movementX**2+e.movementY**2);r.value+=t*u.value}return y(()=>{window.addEventListener(`mousemove`,f),requestAnimationFrame(d)}),l(()=>{window.removeEventListener(`mousemove`,f)}),t({momentum:r,currentValue:i}),(e,t)=>x(e.$slots,`default`,{momentum:r.value,currentValue:i.value})}}),St=Le(r({__name:`TestDummyMarkerFlat`,props:{size:{}},setup(e){return(t,n)=>(f(),A(`div`,{class:`test-dummy-flat`,style:p({width:`${e.size}px`,height:`${e.size}px`})},[...n[0]||=[j(`div`,{class:`marker`},null,-1)]],4))}}),[[`__scopeId`,`data-v-aa597cdd`]]),Ct=r({__name:`TestDummyMarker`,setup(e){return(e,t)=>(f(),v(xt,{"base-speed":.1,friction:.95,"momentum-factor":5e-4},{default:k(({currentValue:e})=>[D(bt,{perspective:800,transform:`rotateX(45deg) translateY(3px)`},{default:k(()=>[D(St,{size:24,style:p({transform:`rotate(${e}deg)`})},null,8,[`style`])]),_:2},1024)]),_:1}))}}),wt={key:0,class:`mb-2 flex items-center justify-between`},Tt={class:`text-sm font-medium`},Et={class:`text-sm text-neutral-500`},Dt={key:1,class:`mt-1 flex gap-3 text-xs text-neutral-500`},Ot={class:`flex items-center gap-1`},kt={class:`flex items-center gap-1`},At={class:`flex items-center gap-1`},jt=r({__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(e){let t=e,n=w(()=>{let e=Math.max(0,Math.min(1,(t.value-t.min)/(t.max-t.min))),n=Math.max(0,Math.min(1,(t.threshold-t.min)/(t.max-t.min))),r=Math.floor(e*t.numBars),i=Math.floor(n*t.numBars);return Array.from({length:t.numBars},(e,t)=>({active:t=i,isBelowThreshold:t(f(),A(`div`,null,[e.showHeader?(f(),A(`div`,wt,[j(`span`,Tt,g(e.label),1),j(`span`,Et,g(e.formatValue?e.formatValue(e.value):`${(e.value*100).toFixed(e.precision)}${e.unit}`),1)])):a(``,!0),j(`div`,{class:`flex items-end gap-1 rounded bg-neutral-200/45 p-1 p-1 dark:bg-neutral-700`,style:p({height:`${e.height}px`})},[(f(!0),A(re,null,d(n.value,(t,n)=>(f(),A(`div`,{key:`threshold-${n}`,class:E([`flex-1 rounded-sm transition-all`,[t.isThreshold?e.thresholdBarClass:t.isAboveThreshold?e.aboveThresholdClass:t.isBelowThreshold?e.belowThresholdClass:e.inactiveBarClass,`duration-${e.animationSpeed}`]]),style:p({height:t.active||t.isThreshold?`100%`:`20%`})},null,6))),128))],4),e.showLegend?(f(),A(`div`,Dt,[j(`span`,Ot,[j(`div`,{class:E(`inline-block h-0.5lh w-1lh rounded-full ${e.belowThresholdClass}`)},null,2),m(` `+g(e.belowLabel),1)]),j(`span`,kt,[j(`div`,{class:E(`inline-block h-0.5lh w-1lh rounded-full border border-neutral-400 ${e.thresholdBarClass}`)},null,2),m(` `+g(e.thresholdLabel),1)]),j(`span`,At,[j(`div`,{class:E(`inline-block h-0.5lh w-1lh rounded-full ${e.aboveThresholdClass}`)},null,2),m(` `+g(e.aboveLabel),1)])])):a(``,!0)]))}});function Mt(e){return{color:e,withAlpha:t=>{let n=Ze(e);if(!n)throw Error(`Invalid color provided for alpha adjustment`);return Mt(Ze({mode:`oklch`,l:n.l,c:n.c,h:n.h,alpha:t}))},toHex:()=>Xe(e),toCSS:()=>Ye(e)}}function Nt(e=200,t){let n=t??.18+Math.cos(e*Math.PI/180)*.04,r={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}},i=(t,i,a=0)=>{let o=r[t],s=(e+a)%360,c=n*o.chromaMultiplier,l=Ze({mode:`oklch`,l:o.lightness,c,h:s,alpha:i??1});return o.mixWithWhite?Mt(Pt(l,Ze({mode:`oklch`,l:1,c:0,h:0,alpha:i??1}),o.mixWithWhite)):Mt(l)};return{baseHue:e,chroma:n,getAllShades:(e,t=0)=>{let n={};for(let a of Object.keys(r)){let r=Number.parseInt(a);n[r]=i(r,e,t)}return n},shadeBy:i}}function Pt(e,t,n=.5){let r=Ze(e),i=Ze(t);if(!r||!i)throw Error(`Invalid colors provided for mixing`);return Ze({mode:`oklch`,l:r.l*(1-n)+i.l*n,c:r.c*(1-n)+i.c*n,h:Ft(r.h??0,i.h??0,n)})}function Ft(e,t,n){let r=t-e;return r>180&&(r-=360),r<-180&&(r+=360),(e+r*n+360)%360}const It=Symbol(`@proj-airi/chromatic-hue`),Lt=`<|llm_inference_end|>`;var Rt={key:0,class:`flex items-center justify-between`},zt={class:`text-sm font-medium`},Bt={class:`text-xs text-neutral-500`},Vt={class:`h-full w-full`},Ht={id:`below-threshold-gradient`,x1:`0%`,y1:`0%`,x2:`0%`,y2:`100%`},Ut=[`fill`],Wt=[`y`,`height`,`fill`],Gt=[`y1`,`y2`,`stroke`,`fill`],Kt=[`d`,`fill`],qt=[`d`,`stroke`,`stroke-width`],Jt={key:0,class:`absolute left-2 top-2 flex items-center gap-1.5 border border-primary-200 rounded-md bg-primary-50 px-2 py-1 dark:border-primary-800 dark:bg-primary-900`},Yt={class:`text-xs text-primary-700 font-medium dark:text-primary-300`},Xt={key:1,class:`flex flex-wrap items-center justify-between text-xs text-neutral-500`},Zt={class:`flex items-center gap-3`},Qt={class:`flex items-center gap-1 text-nowrap`},$t={class:`flex items-center gap-1 text-nowrap`},en={key:0,class:`text-nowrap`},tn=Le(r({__name:`TimeSeriesChart`,props:{history:{},currentValue:{},threshold:{default:null},isActive:{type:Boolean},title:{default:`Time Series`},colorsHue:{},lineColor:{},thresholdColor:{},activeColor:{},inactiveColor:{},subtitle:{default:`Recent data`},activeLabel:{default:`Active`},activeLegendLabel:{default:`Active state`},inactiveLegendLabel:{default:`Inactive state`},thresholdLabel:{default:`Threshold`},height:{default:80},lineWidth:{default:1.5},chartHeight:{},minDataPoints:{default:5},precision:{default:0},unit:{default:`%`},showHeader:{type:Boolean,default:!0},showThreshold:{type:Boolean,default:!0},showArea:{type:Boolean,default:!0},showThresholdAreas:{type:Boolean,default:!0},showCurrentValue:{type:Boolean,default:!0},showActiveIndicator:{type:Boolean,default:!0},showLegend:{type:Boolean,default:!0},formatValue:{}},setup(e){let t=e,n=w(()=>t.height),r=M(),i=c(It,220.44),o=s(()=>t.colorsHue||i||220.44),l=w(()=>Nt(o.value)),u=We(r,{windowResize:!0});ee([o,r],()=>{r.value&&r.value.style.setProperty(`--chromatic-hue`,o.value.toString())},{immediate:!0});let d=s(()=>t.lineColor),h=w(()=>d.value?d.value:l.value.shadeBy(500).toHex()),_=s(()=>t.thresholdColor),v=w(()=>{if(!_.value){let e=l.value.shadeBy(500).withAlpha(.1).color;return`oklch(${e.l} ${e.c} ${e.h} / ${e.alpha})`}return _.value}),y=s(()=>t.activeColor),b=w(()=>y.value?y.value:l.value.shadeBy(600).toHex()),x=s(()=>t.inactiveColor),S=w(()=>x.value?x.value:l.value.shadeBy(400).toHex()),C=Math.random().toString(36).substring(2,9),T=`grid-${C}`,te=`area-gradient-${C}`,O=`threshold-gradient-${C}`,ne=w(()=>t.threshold===null?0:Math.max(0,Math.min(1,t.threshold))),re=w(()=>t.threshold===null?0:n.value-ne.value*n.value),ae=w(()=>{let e=t.history;if(e.length<2)return``;let r=u.width.value,i=n.value,a=`M0,${i-e[0]*i}`;for(let t=1;t{let e=t.history;if(e.length<2)return``;let r=u.width.value,i=n.value,a=`M0,${i} L0,${i-e[0]*i}`;for(let t=1;te.history.length>e.minDataPoints?(f(),A(`div`,{key:0,ref_key:`timeSeriesChartRef`,ref:r,class:`time-series-chart space-y-3`},[e.showHeader?(f(),A(`div`,Rt,[j(`div`,zt,g(e.title),1),j(`div`,Bt,g(e.subtitle),1)])):a(``,!0),j(`div`,{class:`relative overflow-hidden border border-neutral-200 rounded-lg from-neutral-50 to-neutral-100 bg-gradient-to-b dark:border-neutral-800 dark:from-neutral-800 dark:to-neutral-900`,style:p({height:`${n.value}px`})},[(f(),A(`svg`,Vt,[j(`defs`,null,[j(`pattern`,{id:T,width:`20`,height:`10`,patternUnits:`userSpaceOnUse`},[...i[0]||=[j(`path`,{d:`M 20 0 L 0 0 0 10`,fill:`none`,stroke:`rgb(156 163 175 / 0.1)`,"stroke-width":`0.5`},null,-1)]]),j(`linearGradient`,{id:te,x1:`0%`,y1:`0%`,x2:`0%`,y2:`100%`},[j(`stop`,{offset:`0%`,style:p(`stop-color:${h.value};stop-opacity:0.3`)},null,4),j(`stop`,{offset:`50%`,style:p(`stop-color:${h.value};stop-opacity:0.15`)},null,4),j(`stop`,{offset:`100%`,style:p(`stop-color:${h.value};stop-opacity:0.05`)},null,4)]),j(`linearGradient`,{id:O,x1:`0%`,y1:`0%`,x2:`0%`,y2:`100%`},[j(`stop`,{offset:`0%`,style:p(`stop-color:${b.value};stop-opacity:0.3`)},null,4),j(`stop`,{offset:`50%`,style:p(`stop-color:${b.value};stop-opacity:0.15`)},null,4),j(`stop`,{offset:`100%`,style:p(`stop-color:${b.value};stop-opacity:0.05`)},null,4)]),j(`linearGradient`,Ht,[j(`stop`,{offset:`0%`,style:p(`stop-color:${v.value};stop-opacity:0.2`)},null,4),j(`stop`,{offset:`50%`,style:p(`stop-color:${v.value};stop-opacity:0.1`)},null,4),j(`stop`,{offset:`100%`,style:p(`stop-color:${v.value};stop-opacity:0.05`)},null,4)])]),j(`rect`,{width:`100%`,height:`100%`,fill:`url(#${T})`},null,8,Ut),e.showThreshold&&e.threshold!==null?(f(),A(`rect`,{key:0,x:`0`,y:re.value,width:`100%`,height:n.value-re.value,fill:v.value,class:`transition-all duration-300`},null,8,Wt)):a(``,!0),e.showThreshold&&e.threshold!==null?(f(),A(`line`,{key:1,x1:`0`,y1:re.value,x2:`100%`,y2:re.value,stroke:v.value,"stroke-width":`1.5`,"stroke-dasharray":`4,4`,fill:v.value,class:`transition-all duration-300`},null,8,Gt)):a(``,!0),oe.value&&e.showArea?(f(),A(`path`,{key:2,d:oe.value,fill:`url(#${te})`,class:`transition-all duration-75`},null,8,Kt)):a(``,!0),ae.value?(f(),A(`path`,{key:3,d:ae.value,fill:`none`,stroke:h.value,"stroke-width":e.lineWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:`drop-shadow-sm transition-all duration-75`},null,8,qt)):a(``,!0)])),e.showCurrentValue?(f(),A(`div`,{key:0,class:E([`absolute right-2 top-2 border border-neutral-200 rounded-md bg-white px-2 py-1 shadow-sm transition-all duration-200 dark:border-neutral-700 dark:bg-neutral-800`,e.isActive?`bg-primary-50 dark:bg-primary-900 border-primary-200 dark:border-primary-800`:``])},[j(`div`,{class:E([`text-xs font-medium`,e.isActive?`text-primary-700 dark:text-primary-300`:`text-neutral-600 dark:text-neutral-400`])},g(e.formatValue?e.formatValue(e.currentValue):`${(e.currentValue*100).toFixed(e.precision)}${e.unit}`),3)],2)):a(``,!0),D(ie,{name:`fade`},{default:k(()=>[e.isActive&&e.showActiveIndicator?(f(),A(`div`,Jt,[i[1]||=j(`div`,{class:`h-1.5 w-1.5 animate-pulse rounded-full bg-primary-500`},null,-1),j(`span`,Yt,g(e.activeLabel),1)])):a(``,!0)]),_:1})],4),e.showLegend?(f(),A(`div`,Xt,[j(`div`,Zt,[j(`span`,Qt,[j(`div`,{class:`h-2 w-2 rounded-full`,style:p({backgroundColor:b.value})},null,4),m(` `+g(e.activeLegendLabel),1)]),j(`span`,$t,[j(`div`,{class:`h-2 w-2 rounded-full`,style:p({backgroundColor:S.value})},null,4),m(` `+g(e.inactiveLegendLabel),1)])]),e.threshold===null?a(``,!0):(f(),A(`span`,en,g(e.thresholdLabel)+`: `+g((e.threshold*100).toFixed(0))+`%`,1))])):a(``,!0)],512)):a(``,!0)}}),[[`__scopeId`,`data-v-3b2e411d`]]);function nn(e){let{cols:t,originIndex:n,sectionItemCounts:r,delayPerUnit:i=80}=e,a=w(()=>{let e=[],n=0,i=0,a=h(t),o=h(r);for(let t of o){let r=Math.ceil(t/a);e.push({startLinearIndex:n,startRow:i,itemCount:t}),n+=t,i+=r}return e}),o=w(()=>{let e=new Map,n=h(t);for(let t of a.value)for(let r=0;rs(h(n)||0));function l(e){let t=s(e),n=c.value;return(Math.abs(t.row-n.row)+Math.abs(t.col-n.col))*i}return{getDelay:l}}var rn={class:`flex flex-col gap-5`},an=[`initial`,`enter`,`onClick`],on=r({__name:`RippleGrid`,props:{items:{},sections:{},getItems:{type:Function,default:e=>e.items||[]},getKey:{type:Function,default:e=>e.id??e.key},columns:{default:()=>({default:1,sm:2,xl:3})},originIndex:{default:0},animationInitial:{default:()=>({opacity:0,y:10})},animationEnter:{default:()=>({opacity:1,y:0})},animationDuration:{default:250},delayPerUnit:{default:80}},emits:[`itemClick`],setup(e,{emit:t}){let n=e,r=t,i=Ue(Ke),o=[`2xl`,`xl`,`lg`,`md`,`sm`],c=w(()=>!!n.items&&!n.sections),l=w(()=>c.value&&n.items?[{_isVirtual:!0,items:n.items}]:n.sections||[]),u=w(()=>{if(typeof n.columns==`number`)return n.columns;for(let e of o)if(n.columns[e]&&i.greaterOrEqual(e).value)return n.columns[e];return n.columns.default||1}),m=w(()=>{let e=0;return l.value.map(t=>{let r=c.value?t.items:n.getItems(t),i=e;return e+=r.length,{items:r,startIndex:i,count:r.length}})}),h=w(()=>m.value.map(e=>e.count)),{getDelay:g}=nn({cols:u,originIndex:s(n,`originIndex`),sectionItemCounts:h,delayPerUnit:n.delayPerUnit});function _(e,t){r(`itemClick`,{item:e,globalIndex:t})}return(t,r)=>{let i=S(`motion`);return f(),A(`div`,rn,[(f(!0),A(re,null,d(l.value,(r,o)=>(f(),A(re,{key:o},[t.$slots.header&&!c.value?(f(),A(`div`,{key:0,class:E({"my-5":o>0})},[x(t.$slots,`header`,{section:r,index:o})],2)):a(``,!0),j(`div`,{class:`grid gap-4`,style:p({gridTemplateColumns:`repeat(${u.value}, minmax(0, 1fr))`})},[(f(!0),A(re,null,d(m.value[o].items,(r,a)=>le((f(),A(`div`,{key:n.getKey(r),initial:e.animationInitial,enter:{...e.animationEnter,transition:{duration:e.animationDuration,delay:O(g)(m.value[o].startIndex+a)}},onClick:e=>_(r,m.value[o].startIndex+a)},[x(t.$slots,`item`,{item:r,index:m.value[o].startIndex+a,active:e.originIndex===m.value[o].startIndex+a})],8,an)),[[i]])),128))],4)],64))),128))])}}}),sn=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function cn(e){return ln(e)}function ln(e){return Array.isArray(e)?un(e):e instanceof RegExp?e:typeof e==`object`?dn(e):e}function un(e){let t=[];for(let n=0,r=e.length;n{for(let n in t)e[n]=t[n]}),e}function pn(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?pn(e.substring(0,e.length-1)):e.substr(~t+1)}var mn=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,hn=class{static hasCaptures(e){return e===null?!1:(mn.lastIndex=0,mn.test(e))}static replaceCaptures(e,t,n){return e.replace(mn,(e,r,i,a)=>{let o=n[parseInt(r||i,10)];if(o){let e=t.substring(o.start,o.end);for(;e[0]===`.`;)e=e.substring(1);switch(a){case`downcase`:return e.toLowerCase();case`upcase`:return e.toUpperCase();default:return e}}else return e})}};function gn(e,t){return et?1:0}function _n(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let r=0;rthis._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>Cn(e.parent,t.parentScopes));return n?new Tn(n.fontStyle,n.foreground,n.background):null}},Sn=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(let r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r`){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!wn(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function wn(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var Tn=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function En(e){if(!e||!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let e=0,i=t.length;e1&&(u=i.slice(0,i.length-1),u.reverse()),n[r++]=new Dn(l,u,e,o,s,c)}}return n}var Dn=class{constructor(e,t,n,r,i,a){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=a}},On=(e=>(e[e.NotSet=-1]=`NotSet`,e[e.None=0]=`None`,e[e.Italic=1]=`Italic`,e[e.Bold=2]=`Bold`,e[e.Underline=4]=`Underline`,e[e.Strikethrough=8]=`Strikethrough`,e))(On||{});function kn(e,t){e.sort((e,t)=>{let n=gn(e.scope,t.scope);return n!==0||(n=_n(e.parentScopes,t.parentScopes),n!==0)?n:e.index-t.index});let n=0,r=`#000000`,i=`#ffffff`;for(;e.length>=1&&e[0].scope===``;){let t=e.shift();t.fontStyle!==-1&&(n=t.fontStyle),t.foreground!==null&&(r=t.foreground),t.background!==null&&(i=t.background)}let a=new An(t),o=new Tn(n,a.getId(r),a.getId(i)),s=new Nn(new Mn(0,null,-1,0,0),[]);for(let t=0,n=e.length;te?console.log(`how did this happen?`):this.scopeDepth=e,t!==-1&&(this.fontStyle=t),n!==0&&(this.foreground=n),r!==0&&(this.background=r)}},Nn=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let n=0,r=0;for(;e.parentScopes[n]===`>`&&n++,t.parentScopes[r]===`>`&&r++,!(n>=e.parentScopes.length||r>=t.parentScopes.length);){let i=t.parentScopes[r].length-e.parentScopes[n].length;if(i!==0)return i;n++,r++}return t.parentScopes.length-e.parentScopes.length}match(t){if(t!==``){let e=t.indexOf(`.`),n,r;if(e===-1?(n=t,r=``):(n=t.substring(0,e),r=t.substring(e+1)),this._children.hasOwnProperty(n))return this._children[n].match(r)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(e._cmpBySpecificity),n}insert(t,n,r,i,a,o){if(n===``){this._doInsertHere(t,r,i,a,o);return}let s=n.indexOf(`.`),c,l;s===-1?(c=n,l=``):(c=n.substring(0,s),l=n.substring(s+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new e(this._mainRule.clone(),Mn.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(t+1,l,r,i,a,o)}_doInsertHere(e,t,n,r,i){if(t===null){this._mainRule.acceptOverwrite(e,n,r,i);return}for(let a=0,o=this._rulesWithParentScopes.length;a>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!=0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(t,n,r,i,a,o,s){let c=e.getLanguageId(t),l=e.getTokenType(t),u=e.containsBalancedBrackets(t)?1:0,d=e.getFontStyle(t),f=e.getForeground(t),p=e.getBackground(t);return n!==0&&(c=n),r!==8&&(l=In(r)),i!==null&&(u=i?1:0),a!==-1&&(d=a),o!==0&&(f=o),s!==0&&(p=s),(c<<0|l<<8|u<<10|d<<11|f<<15|p<<24)>>>0}};function Fn(e){return e}function In(e){return e}function Ln(e,t){let n=[],r=zn(e),i=r.next();for(;i!==null;){let e=0;if(i.length===2&&i.charAt(1)===`:`){switch(i.charAt(0)){case`R`:e=1;break;case`L`:e=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let t=o();if(n.push({matcher:t,priority:e}),i!==`,`)break;i=r.next()}return n;function a(){if(i===`-`){i=r.next();let e=a();return t=>!!e&&!e(t)}if(i===`(`){i=r.next();let e=s();return i===`)`&&(i=r.next()),e}if(Rn(i)){let e=[];do e.push(i),i=r.next();while(Rn(i));return n=>t(e,n)}return null}function o(){let e=[],t=a();for(;t;)e.push(t),t=a();return t=>e.every(e=>e(t))}function s(){let e=[],t=o();for(;t&&(e.push(t),i===`|`||i===`,`);){do i=r.next();while(i===`|`||i===`,`);t=o()}return t=>e.some(e=>e(t))}}function Rn(e){return!!e&&!!e.match(/[\w\.:]+/)}function zn(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let r=n[0];return n=t.exec(e),r}}}function Bn(e){typeof e.dispose==`function`&&e.dispose()}var Vn=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},Hn=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},Un=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},Wn=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Vn(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new Un;for(let n of e)Gn(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof Vn){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName)||this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function Gn(e,t,n,r){let i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw Error(`No grammar provided for <${t}>`);return}let a=n.lookup(t);e instanceof Vn?qn({baseGrammar:a,selfGrammar:i},r):Kn(e.ruleName,{baseGrammar:a,selfGrammar:i,repository:i.repository},r);let o=n.injections(e.scopeName);if(o)for(let e of o)r.add(new Vn(e))}function Kn(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];Jn([r],t,n)}}function qn(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&Jn(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&Jn(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function Jn(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?fn({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&Jn(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=er(i);switch(a.kind){case 0:qn({...t,selfGrammar:t.baseGrammar},n);break;case 1:qn(t,n);break;case 2:Kn(a.ruleName,{...t,repository:e},n);break;case 3:case 4:let r=a.scopeName===t.selfGrammar.scopeName?t.selfGrammar:a.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(r){let i={baseGrammar:t.baseGrammar,selfGrammar:r,repository:e};a.kind===4?Kn(a.ruleName,i,n):qn(i,n)}else a.kind===4?n.add(new Hn(a.scopeName,a.ruleName)):n.add(new Vn(a.scopeName));break}}}var Yn=class{kind=0},Xn=class{kind=1},Zn=class{constructor(e){this.ruleName=e}kind=2},Qn=class{constructor(e){this.scopeName=e}kind=3},$n=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function er(e){if(e===`$base`)return new Yn;if(e===`$self`)return new Xn;let t=e.indexOf(`#`);return t===-1?new Qn(e):t===0?new Zn(e.substring(1)):new $n(e.substring(0,t),e.substring(t+1))}var tr=/\\(\d+)/,nr=/\\(\d+)/g,rr=-1,ir=-2;function ar(e){return e}function or(e){return e}var sr=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=hn.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=hn.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${pn(this.$location.filename)}:${this.$location.line}`:`unknown`;return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:hn.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:hn.replaceCaptures(this._contentName,e,t)}},cr=class extends sr{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw Error(`Not supported!`)}compile(e,t){throw Error(`Not supported!`)}compileAG(e,t,n,r){throw Error(`Not supported!`)}},lr=class extends sr{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new mr(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new hr,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},ur=class extends sr{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new hr,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},dr=class extends sr{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r),this._begin=new mr(i,this.id),this.beginCaptures=a,this._end=new mr(o||`￿`,-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=s,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new hr;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},fr=class extends sr{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r),this._begin=new mr(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new mr(o,ir),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null),this._cachedCompiledWhilePatterns&&=(this._cachedCompiledWhilePatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new hr;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new hr,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||`￿`),this._cachedCompiledWhilePatterns}},pr=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new cr(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new lr(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=fn({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new ur(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new fr(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,r),e._compilePatterns(t.patterns,n,r)):new dr(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,e._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let a=0;for(let e in t){if(e===`$vscodeTextmateLocation`)continue;let t=parseInt(e,10);t>a&&(a=t)}for(let e=0;e<=a;e++)i[e]=null;for(let a in t){if(a===`$vscodeTextmateLocation`)continue;let o=parseInt(a,10),s=0;t[a].patterns&&(s=e.getCompiledRuleId(t[a],n,r)),i[o]=e.createCaptureRule(n,t[a].$vscodeTextmateLocation,t[a].name,t[a].contentName,s)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let a=0,o=t.length;ae.substring(t.start,t.end));return nr.lastIndex=0,this.source.replace(nr,(e,t)=>yn(n[parseInt(t,10)]||``))}_buildAnchorCache(){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let e=[],t=[],n=[],r=[],i,a,o,s;for(i=0,a=this.source.length;ie.source),this._items.map(e=>e.ruleId)),this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){return new gr(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},gr=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose==`function`&&this.scanner.dispose()}toString(){let e=[];for(let t=0,n=this.rules.length;tnew _r(this._scopeToLanguage(e),this._toStandardTokenType(e)));_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(t){let n=t.match(e.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case`comment`:return 1;case`string`:return 2;case`regex`:return 3;case`meta.embedded`:return 0}throw Error(`Unexpected match for standard token type!`)}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},yr=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);let t=e.map(([e,t])=>yn(e));t.sort(),t.reverse(),this.scopesRegExp=RegExp(`^((${t.join(`)|(`)}))($|\\.)`,``)}}match(e){if(!this.scopesRegExp)return;let t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}};typeof process<`u`&&{}.VSCODE_TEXTMATE_DEBUG;var br=!1,xr=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function Sr(e,t,n,r,i,a,o,s){let c=t.content.length,l=!1,u=-1;if(o){let o=Cr(e,t,n,r,i,a);i=o.stack,r=o.linePos,n=o.isFirstLine,u=o.anchorPosition}let d=Date.now();for(;!l;){if(s!==0&&Date.now()-d>s)return new xr(i,!0);f()}return new xr(i,!1);function f(){let o=wr(e,t,n,r,i,u);if(!o){a.produce(i,c),l=!0;return}let s=o.captureIndices,d=o.matchedRuleId,f=s&&s.length>0?s[0].end>r:!1;if(d===rr){let o=i.getRule(e);a.produce(i,s[0].start),i=i.withContentNameScopesList(i.nameScopesList),Ar(e,t,n,i,a,o.endCaptures,s),a.produce(i,s[0].end);let d=i;if(i=i.parent,u=d.getAnchorPos(),!f&&d.getEnterPos()===r){i=d,a.produce(i,c),l=!0;return}}else{let o=e.getRule(d);a.produce(i,s[0].start);let p=i,m=o.getName(t.content,s),h=i.contentNameScopesList.pushAttributed(m,e);if(i=i.push(d,r,u,s[0].end===c,null,h,h),o instanceof dr){let r=o;Ar(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.endHasBackReferences&&(i=i.withEndRule(r.getEndWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(o instanceof fr){let r=o;Ar(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.whileHasBackReferences&&(i=i.withEndRule(r.getWhileWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(Ar(e,t,n,i,a,o.captures,s),a.produce(i,s[0].end),i=i.pop(),!f){i=i.safePop(),a.produce(i,c),l=!0;return}}s[0].end>r&&(r=s[0].end,n=!1)}}function Cr(e,t,n,r,i,a){let o=i.beginRuleCapturedEOL?0:-1,s=[];for(let t=i;t;t=t.pop()){let n=t.getRule(e);n instanceof fr&&s.push({rule:n,stack:t})}for(let c=s.pop();c;c=s.pop()){let{ruleScanner:s,findOptions:l}=Or(c.rule,e,c.stack.endRule,n,r===o),u=s.findNextMatchSync(t,r,l);if(u){if(u.ruleId!==ir){i=c.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(a.produce(c.stack,u.captureIndices[0].start),Ar(e,t,n,c.stack,a,c.rule.whileCaptures,u.captureIndices),a.produce(c.stack,u.captureIndices[0].end),o=u.captureIndices[0].end,u.captureIndices[0].end>r&&(r=u.captureIndices[0].end,n=!1))}else{i=c.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}function wr(e,t,n,r,i,a){let o=Tr(e,t,n,r,i,a),s=e.getInjections();if(s.length===0)return o;let c=Er(s,e,t,n,r,i,a);if(!c)return o;if(!o)return c;let l=o.captureIndices[0].start,u=c.captureIndices[0].start;return u=s)&&(s=g,c=h.captureIndices,l=h.ruleId,u=f.priority,s===i))break}return c?{priorityMatch:u===-1,captureIndices:c,matchedRuleId:l}:null}function Dr(e,t,n,r,i){return br?{ruleScanner:e.compile(t,n),findOptions:kr(r,i)}:{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function Or(e,t,n,r,i){return br?{ruleScanner:e.compileWhile(t,n),findOptions:kr(r,i)}:{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function kr(e,t){let n=0;return e||(n|=1),t||(n|=4),n}function Ar(e,t,n,r,i,a,o){if(a.length===0)return;let s=t.content,c=Math.min(a.length,o.length),l=[],u=o[0].end;for(let t=0;tu)break;for(;l.length>0&&l[l.length-1].endPos<=d.start;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0?i.produceFromScopes(l[l.length-1].scopes,d.start):i.produce(r,d.start),c.retokenizeCapturedWithRuleId){let t=c.getName(s,o),a=r.contentNameScopesList.pushAttributed(t,e),l=c.getContentName(s,o),u=a.pushAttributed(l,e),f=r.push(c.retokenizeCapturedWithRuleId,d.start,-1,!1,null,a,u),p=e.createOnigString(s.substring(0,d.end));Sr(e,p,n&&d.start===0,d.start,f,i,!1,0),Bn(p);continue}let f=c.getName(s,o);if(f!==null){let t=(l.length>0?l[l.length-1].scopes:r.contentNameScopesList).pushAttributed(f,e);l.push(new jr(t,d.end))}}for(;l.length>0;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var jr=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function Mr(e,t,n,r,i,a,o,s){return new Ir(e,t,n,r,i,a,o,s)}function Nr(e,t,n,r,i){let a=Ln(t,Pr),o=pr.getCompiledRuleId(n,r,i.repository);for(let n of a)e.push({debugSelector:t,matcher:n.matcher,ruleId:o,grammar:i,priority:n.priority})}function Pr(e,t){if(t.length{for(let r=n;rn&&e.substr(0,n)===t&&e[n]===`.`}var Ir=class{constructor(e,t,n,r,i,a,o,s){if(this._rootScopeName=e,this.balancedBracketSelectors=a,this._onigLib=s,this._basicScopeAttributesProvider=new vr(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=Lr(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(let e of Object.keys(i)){let t=Ln(e,Pr);for(let n of t)this._tokenTypeMatchers.push({matcher:n.matcher,type:i[e]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(let e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){let e={lookup:e=>e===this._rootScopeName?this._grammar:this.getExternalGrammar(e),injections:e=>this._grammarRepository.injections(e)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){let e=r.injections;if(e)for(let n in e)Nr(t,n,e[n],this,r);let i=this._grammarRepository.injections(n);i&&i.forEach(e=>{let n=this.getExternalGrammar(e);if(n){let e=n.injectionSelector;e&&Nr(t,e,n,this,n)}})}return t.sort((e,t)=>e.priority-t.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){let t=++this._lastRuleId,n=e(ar(t));return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[or(e)]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){let n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=Lr(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){let r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){let r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=pr.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===zr.NULL){i=!0;let e=this._basicScopeAttributesProvider.getDefaultAttributes(),n=this.themeProvider.getDefaults(),r=Pn.set(0,e.languageId,e.tokenType,null,n.fontStyle,n.foregroundId,n.backgroundId),a=this.getRule(this._rootId).getName(null,null),o;o=a?Rr.createRootAndLookUpScopeName(a,r,this):Rr.createRoot(`unknown`,r),t=new zr(null,this._rootId,-1,-1,!1,null,o,o)}else i=!1,t.reset();e+=` `;let a=this.createOnigString(e),o=a.content.length,s=new Vr(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=Sr(this,a,i,0,t,s,!0,r);return Bn(a),{lineLength:o,lineTokens:s,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function Lr(e,t){return e=cn(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var Rr=class e{constructor(e,t,n){this.parent=e,this.scopePath=t,this.tokenAttributes=n}static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(let t of n)i=Sn.push(i,t.scopeNames),r=new e(r,i,t.encodedTokenAttributes);return r}static createRoot(t,n){return new e(null,new Sn(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let i=r.getMetadataForScope(t),a=new Sn(null,t),o=r.themeProvider.themeMatch(a);return new e(null,a,e.mergeAttributes(n,i,o))}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(` `)}equals(t){return e.equals(this,t)}static equals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}while(!0)}static mergeAttributes(e,t,n){let r=-1,i=0,a=0;return n!==null&&(r=n.fontStyle,i=n.foregroundId,a=n.backgroundId),Pn.set(e,t.languageId,t.tokenType,null,r,i,a)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(` `)===-1)return e._pushAttributed(this,t,n);let r=t.split(/ /g),i=this;for(let t of r)i=e._pushAttributed(i,t,n);return i}static _pushAttributed(t,n,r){let i=r.getMetadataForScope(n),a=t.scopePath.push(n),o=r.themeProvider.themeMatch(a);return new e(t,a,e.mergeAttributes(t.tokenAttributes,i,o))}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===e?t.reverse():void 0}},zr=class e{constructor(e,t,n,r,i,a,o,s){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=i,this.endRule=a,this.nameScopesList=o,this.contentNameScopesList=s,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new e(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:e._equals(this,t)}static _equals(e,t){return e===t?!0:this._structuralEquals(e,t)?Rr.equals(e.contentNameScopesList,t.contentNameScopesList):!1}static _structuralEquals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}while(!0)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){e._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,a,o,s){return new e(this,t,n,r,i,a,o,s)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){let e=[];return this._writeString(e,0),`[`+e.join(`,`)+`]`}_writeString(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,t}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(t){return this.endRule===t?this:new e(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}toStateStackFrame(){return{ruleId:or(this.ruleId),beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){let r=Rr.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,ar(n.ruleId),n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,Rr.fromExtension(r,n.contentNameScopesList))}},Br=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>e===`*`?(this.allowAny=!0,[]):Ln(e,Pr).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>Ln(e,Pr).map(e=>e.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(let t of this.unbalancedBracketScopes)if(t(e))return!1;for(let t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},Vr=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let n=e?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let t=e?.getScopeNames()??[];for(let e of this._tokenTypeOverrides)e.matcher(t)&&(n=Pn.set(n,0,Fn(e.type),null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(t))}if(r&&(n=Pn.set(n,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===n){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(n),this._lastTokenEndIndex=t;return}let n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);let n=new Uint32Array(this._binaryTokens.length);for(let e=0,t=this._binaryTokens.length;e0;)a.Q.map(e=>this._loadSingleGrammar(e.scopeName)),a.processQueue();return this._grammarForScopeName(e,t,n,r,i)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){let t=this._options.loadGrammar(e);if(t){let n=typeof this._options.getInjections==`function`?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,n)}}addGrammar(e,t=[],n=0,r=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,n,r)}_grammarForScopeName(e,t=0,n=null,r=null,i=null){return this._syncRegistry.grammarForScopeName(e,t,n,r,i)}},Wr=zr.NULL;const Gr=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`];var Kr=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};Kr.prototype.normal={},Kr.prototype.property={},Kr.prototype.space=void 0;function qr(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new Kr(n,r,t)}function Jr(e){return e.toLowerCase()}var Yr=class{constructor(e,t){this.attribute=t,this.property=e}};Yr.prototype.attribute=``,Yr.prototype.booleanish=!1,Yr.prototype.boolean=!1,Yr.prototype.commaOrSpaceSeparated=!1,Yr.prototype.commaSeparated=!1,Yr.prototype.defined=!1,Yr.prototype.mustUseProperty=!1,Yr.prototype.number=!1,Yr.prototype.overloadedBoolean=!1,Yr.prototype.property=``,Yr.prototype.spaceSeparated=!1,Yr.prototype.space=void 0;var Xr=t({boolean:()=>Qr,booleanish:()=>$r,commaOrSpaceSeparated:()=>ri,commaSeparated:()=>ni,number:()=>P,overloadedBoolean:()=>ei,spaceSeparated:()=>ti},1),Zr=0;const Qr=ii(),$r=ii(),ei=ii(),P=ii(),ti=ii(),ni=ii(),ri=ii();function ii(){return 2**++Zr}var ai=Object.keys(Xr),oi=class extends Yr{constructor(e,t,n,r){let i=-1;if(super(e,t),si(this,`space`,r),typeof n==`number`)for(;++i4&&n.slice(0,4)===`data`&&yi.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(vi,Si);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!vi.test(e)){let n=e.replace(_i,xi);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=oi}return new i(r,t)}function xi(e){return`-`+e.toLowerCase()}function Si(e){return e.charAt(1).toUpperCase()}const Ci=qr([li,fi,mi,hi,gi],`html`),wi=qr([li,pi,mi,hi,gi],`svg`);var Ti={}.hasOwnProperty;function Ei(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&Ti.call(t,e)){let n=String(t[e]);i=Ti.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var Di=/^>|^->||--!>|`],ki=[`<`,`>`];function Ai(e,t,n,r){return r.settings.bogusComments?``:``;function i(e){return nt(e,Object.assign({},r.settings.characterReferences,{subset:ki}))}}function ji(e,t,n,r){return``}function Mi(e){let t=[],n=String(e||``),r=n.indexOf(`,`),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);let e=n.slice(i,r).trim();(e||!a)&&t.push(e),i=r+1,r=n.indexOf(`,`,i)}return t}function Ni(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}function Pi(e){let t=String(e||``).trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function Fi(e){return e.join(` `).trim()}var Ii=/[ \t\n\f\r]/g;function Li(e){return typeof e==`object`?e.type===`text`?Ri(e.value):!1:Ri(e)}function Ri(e){return e.replace(Ii,``)===``}const zi=Hi(1),Bi=Hi(-1);var Vi=[];function Hi(e){return t;function t(t,n,r){let i=t?t.children:Vi,a=(n||0)+e,o=i[a];if(!r)for(;o&&Li(o);)a+=e,o=i[a];return o}}var Ui={}.hasOwnProperty;function Wi(e){return t;function t(t,n,r){return Ui.call(e,t.tagName)&&e[t.tagName](t,n,r)}}const Gi=Wi({body:Ji,caption:Ki,colgroup:Ki,dd:Qi,dt:Zi,head:Ki,html:qi,li:Xi,optgroup:ea,option:ta,p:Yi,rp:$i,rt:$i,tbody:ra,td:oa,tfoot:ia,th:oa,thead:na,tr:aa});function Ki(e,t,n){let r=zi(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&Li(r.value.charAt(0)))}function qi(e,t,n){let r=zi(n,t);return!r||r.type!==`comment`}function Ji(e,t,n){let r=zi(n,t);return!r||r.type!==`comment`}function Yi(e,t,n){let r=zi(n,t);return r?r.type===`element`&&(r.tagName===`address`||r.tagName===`article`||r.tagName===`aside`||r.tagName===`blockquote`||r.tagName===`details`||r.tagName===`div`||r.tagName===`dl`||r.tagName===`fieldset`||r.tagName===`figcaption`||r.tagName===`figure`||r.tagName===`footer`||r.tagName===`form`||r.tagName===`h1`||r.tagName===`h2`||r.tagName===`h3`||r.tagName===`h4`||r.tagName===`h5`||r.tagName===`h6`||r.tagName===`header`||r.tagName===`hgroup`||r.tagName===`hr`||r.tagName===`main`||r.tagName===`menu`||r.tagName===`nav`||r.tagName===`ol`||r.tagName===`p`||r.tagName===`pre`||r.tagName===`section`||r.tagName===`table`||r.tagName===`ul`):!n||!(n.type===`element`&&(n.tagName===`a`||n.tagName===`audio`||n.tagName===`del`||n.tagName===`ins`||n.tagName===`map`||n.tagName===`noscript`||n.tagName===`video`))}function Xi(e,t,n){let r=zi(n,t);return!r||r.type===`element`&&r.tagName===`li`}function Zi(e,t,n){let r=zi(n,t);return!!(r&&r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`))}function Qi(e,t,n){let r=zi(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function $i(e,t,n){let r=zi(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function ea(e,t,n){let r=zi(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function ta(e,t,n){let r=zi(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function na(e,t,n){let r=zi(n,t);return!!(r&&r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`))}function ra(e,t,n){let r=zi(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function ia(e,t,n){return!zi(n,t)}function aa(e,t,n){let r=zi(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function oa(e,t,n){let r=zi(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}const sa=Wi({body:ua,colgroup:da,head:la,html:ca,tbody:fa});function ca(e){let t=zi(e,-1);return!t||t.type!==`comment`}function la(e){let t=new Set;for(let n of e.children)if(n.type===`element`&&(n.tagName===`base`||n.tagName===`title`)){if(t.has(n.tagName))return!1;t.add(n.tagName)}let n=e.children[0];return!n||n.type===`element`}function ua(e){let t=zi(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&Li(t.value.charAt(0)))&&!(t.type===`element`&&(t.tagName===`meta`||t.tagName===`link`||t.tagName===`script`||t.tagName===`style`||t.tagName===`template`))}function da(e,t,n){let r=Bi(n,t),i=zi(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&Gi(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function fa(e,t,n){let r=Bi(n,t),i=zi(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&Gi(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var pa={name:[[` \f\r &/=>`.split(``),` diff --git a/assets/consciousness-OW8mu5uI.js b/assets/consciousness-C5rSlsFJ.js similarity index 97% rename from assets/consciousness-OW8mu5uI.js rename to assets/consciousness-C5rSlsFJ.js index 8af1cf9b6348f82d443311deb23591af18a0459d..8b80ee7d2545e28c65b3f186fa6d1933384ed013 100644 --- a/assets/consciousness-OW8mu5uI.js +++ b/assets/consciousness-C5rSlsFJ.js @@ -1 +1 @@ -import{A as e,C as t,J as n,K as r,O as i,Pt as a,S as o,Z as ee,at as s,gt as c,k as l,kt as u,l as d,lt as f,m as p,ut as m,w as h,x as g}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-CZ9Rvki9.js";import"./src-DYQXbDgu.js";import{a as _}from"./resettable-CbXzRviW.js";import{t as v}from"./vue-router-Chhv6vZu.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{dt as y,gt as te,ht as ne,mt as re}from"./components-BR_Kqwtu.js";import{i as ie,r as ae}from"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import{n as oe}from"./vue-i18n.runtime-Dah5zGm4.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-D1kLcsvA.js";import"./__vite-browser-external-BaycPy5b.js";import{t as b}from"./route-block-CpjdOEnv.js";var se={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`},I={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`},ce={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":``},U=e({__name:`consciousness`,setup(e){let b=ie(),U=ae(),{configuredChatProvidersMetadata:W}=_(b),{activeProvider:G,activeModel:K,customModelName:le,modelSearchQuery:q,supportsModelListing:J,providerModels:Y,isLoadingActiveProviderModels:X,activeProviderModelError:Z}=_(U),{t:Q}=oe();s(G,async e=>{await U.loadModelsForProvider(e)},{immediate:!0});function $(e){le.value=e}return(e,s)=>{let _=ee(`motion`);return r(),h(p,null,[g(`div`,se,[g(`div`,null,[g(`div`,x,[g(`div`,null,[g(`h2`,S,a(u(Q)(`settings.pages.providers.title`)),1),g(`div`,C,[g(`span`,null,a(u(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.description`)),1)])]),g(`div`,w,[u(W).length>0?(r(),h(`fieldset`,T,[(r(!0),h(p,null,n(u(W),e=>(r(),o(u(re),{id:e.id,key:e.id,modelValue:u(G),"onUpdate:modelValue":s[0]||=e=>c(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)),l(u(v),{to:`/settings/providers`,border:`2px solid`,class:`border-neutral-100 bg-white dark:border-neutral-900 hover:border-primary-500/30 dark:bg-neutral-900/20 dark:hover:border-primary-400/30`,flex:`~ col items-center justify-center`,transition:`all duration-200 ease-in-out`,relative:``,"min-w-50":``,"w-fit":``,"rounded-xl":``,"p-4":``},{default:f(()=>[...s[4]||=[g(`div`,{"i-solar:add-circle-line-duotone":``,class:`text-2xl text-neutral-500 dark:text-neutral-500`},null,-1),g(`div`,{class:`bg-dotted-neutral-200/80 dark:bg-dotted-neutral-700/50`,absolute:``,"inset-0":``,"z--1":``,style:{"background-size":`10px 10px`,"mask-image":`linear-gradient(165deg, white 30%, transparent 50%)`}},null,-1)]]),_:1})])):(r(),h(`div`,E,[l(u(v),{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(()=>[...s[5]||=[g(`div`,{"i-solar:warning-circle-line-duotone":``,class:`text-2xl text-amber-500 dark:text-amber-400`},null,-1),g(`div`,{class:`flex flex-col`},[g(`span`,{class:`font-medium`},`No Providers Configured`),g(`span`,{class:`text-sm text-neutral-400 dark:text-neutral-500`},`Click here to set up your LLM providers`)],-1),g(`div`,{"i-solar:arrow-right-line-duotone":``,class:`ml-auto text-xl text-neutral-400 dark:text-neutral-500`},null,-1)]]),_:1})]))])])]),u(G)&&u(J)?(r(),h(`div`,D,[g(`div`,O,[g(`div`,null,[g(`h2`,k,a(u(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.title`)),1),g(`div`,A,[g(`span`,null,a(u(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle`)),1)])]),u(X)?(r(),h(`div`,j,[s[6]||=g(`div`,{class:`mr-2 animate-spin`},[g(`div`,{"i-solar:spinner-line-duotone":``,"text-xl":``})],-1),g(`span`,null,a(u(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.loading`)),1)])):u(Z)?(r(),o(u(y),{key:1,title:u(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.error`),error:u(Z)},null,8,[`title`,`error`])):u(Y).length===0&&!u(X)?(r(),o(u(te),{key:2,type:`warning`},{title:f(()=>[i(a(u(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models`)),1)]),content:f(()=>[i(a(u(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models_description`)),1)]),_:1})):u(Y).length>0?(r(),o(u(ne),{key:3,modelValue:u(K),"onUpdate:modelValue":s[1]||=e=>c(K)?K.value=e:null,"search-query":u(q),"onUpdate:searchQuery":s[2]||=e=>c(q)?q.value=e:null,items:u(Y).sort((e,t)=>e.id===u(K)?-1:t.id===u(K)?1:0),searchable:!0,"search-placeholder":u(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.search_placeholder`),"search-no-results-title":u(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results`),"search-no-results-description":u(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results_description`,{query:u(q)}),"search-results-text":u(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.search_results`,{count:`{count}`,total:`{total}`}),"custom-input-placeholder":u(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.custom_model_placeholder`),"expand-button-text":u(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.expand`),"collapse-button-text":u(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`])):t(``,!0)])])):u(G)&&!u(J)?(r(),h(`div`,M,[g(`div`,N,[g(`div`,null,[g(`h2`,P,a(u(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.title`)),1),g(`div`,F,[g(`span`,null,a(u(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle`)),1)])]),g(`div`,I,[s[7]||=g(`div`,{"i-solar:info-circle-line-duotone":``,class:`text-2xl text-primary-500 dark:text-primary-400`},null,-1),g(`div`,ce,[g(`span`,L,a(u(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.not_supported`)),1),g(`span`,R,a(u(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.not_supported_description`)),1)])]),g(`div`,z,[g(`label`,B,a(u(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.manual_model_name`)),1),m(g(`input`,{"onUpdate:modelValue":s[3]||=e=>c(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:u(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.manual_model_placeholder`)},null,8,V),[[d,u(K)]])])])])):t(``,!0)]),m((r(),h(`div`,H,[...s[8]||=[g(`div`,{text:`60`,"i-solar:ghost-bold-duotone":``},null,-1)]])),[[_]])],64)}}});typeof b==`function`&&b(U);var W=U;export{W as default}; \ No newline at end of file +import{A as e,C as t,J as n,K as r,O as i,Pt as a,S as o,Z as ee,at as s,gt as c,k as l,kt as u,l as d,lt as f,m as p,ut as m,w as h,x as g}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-C0YByt49.js";import"./src-DYQXbDgu.js";import{a as _}from"./resettable-CbXzRviW.js";import{t as v}from"./vue-router-Chhv6vZu.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{dt as y,gt as te,ht as ne,mt as re}from"./components-CeE-UiLT.js";import{i as ie,r as ae}from"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import{n as oe}from"./vue-i18n.runtime-Dah5zGm4.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-73vyHOZs.js";import"./__vite-browser-external-BaycPy5b.js";import{t as b}from"./route-block-CpjdOEnv.js";var se={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`},I={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`},ce={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":``},U=e({__name:`consciousness`,setup(e){let b=ie(),U=ae(),{configuredChatProvidersMetadata:W}=_(b),{activeProvider:G,activeModel:K,customModelName:le,modelSearchQuery:q,supportsModelListing:J,providerModels:Y,isLoadingActiveProviderModels:X,activeProviderModelError:Z}=_(U),{t:Q}=oe();s(G,async e=>{await U.loadModelsForProvider(e)},{immediate:!0});function $(e){le.value=e}return(e,s)=>{let _=ee(`motion`);return r(),h(p,null,[g(`div`,se,[g(`div`,null,[g(`div`,x,[g(`div`,null,[g(`h2`,S,a(u(Q)(`settings.pages.providers.title`)),1),g(`div`,C,[g(`span`,null,a(u(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.description`)),1)])]),g(`div`,w,[u(W).length>0?(r(),h(`fieldset`,T,[(r(!0),h(p,null,n(u(W),e=>(r(),o(u(re),{id:e.id,key:e.id,modelValue:u(G),"onUpdate:modelValue":s[0]||=e=>c(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)),l(u(v),{to:`/settings/providers`,border:`2px solid`,class:`border-neutral-100 bg-white dark:border-neutral-900 hover:border-primary-500/30 dark:bg-neutral-900/20 dark:hover:border-primary-400/30`,flex:`~ col items-center justify-center`,transition:`all duration-200 ease-in-out`,relative:``,"min-w-50":``,"w-fit":``,"rounded-xl":``,"p-4":``},{default:f(()=>[...s[4]||=[g(`div`,{"i-solar:add-circle-line-duotone":``,class:`text-2xl text-neutral-500 dark:text-neutral-500`},null,-1),g(`div`,{class:`bg-dotted-neutral-200/80 dark:bg-dotted-neutral-700/50`,absolute:``,"inset-0":``,"z--1":``,style:{"background-size":`10px 10px`,"mask-image":`linear-gradient(165deg, white 30%, transparent 50%)`}},null,-1)]]),_:1})])):(r(),h(`div`,E,[l(u(v),{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(()=>[...s[5]||=[g(`div`,{"i-solar:warning-circle-line-duotone":``,class:`text-2xl text-amber-500 dark:text-amber-400`},null,-1),g(`div`,{class:`flex flex-col`},[g(`span`,{class:`font-medium`},`No Providers Configured`),g(`span`,{class:`text-sm text-neutral-400 dark:text-neutral-500`},`Click here to set up your LLM providers`)],-1),g(`div`,{"i-solar:arrow-right-line-duotone":``,class:`ml-auto text-xl text-neutral-400 dark:text-neutral-500`},null,-1)]]),_:1})]))])])]),u(G)&&u(J)?(r(),h(`div`,D,[g(`div`,O,[g(`div`,null,[g(`h2`,k,a(u(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.title`)),1),g(`div`,A,[g(`span`,null,a(u(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle`)),1)])]),u(X)?(r(),h(`div`,j,[s[6]||=g(`div`,{class:`mr-2 animate-spin`},[g(`div`,{"i-solar:spinner-line-duotone":``,"text-xl":``})],-1),g(`span`,null,a(u(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.loading`)),1)])):u(Z)?(r(),o(u(y),{key:1,title:u(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.error`),error:u(Z)},null,8,[`title`,`error`])):u(Y).length===0&&!u(X)?(r(),o(u(te),{key:2,type:`warning`},{title:f(()=>[i(a(u(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models`)),1)]),content:f(()=>[i(a(u(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models_description`)),1)]),_:1})):u(Y).length>0?(r(),o(u(ne),{key:3,modelValue:u(K),"onUpdate:modelValue":s[1]||=e=>c(K)?K.value=e:null,"search-query":u(q),"onUpdate:searchQuery":s[2]||=e=>c(q)?q.value=e:null,items:u(Y).sort((e,t)=>e.id===u(K)?-1:t.id===u(K)?1:0),searchable:!0,"search-placeholder":u(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.search_placeholder`),"search-no-results-title":u(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results`),"search-no-results-description":u(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results_description`,{query:u(q)}),"search-results-text":u(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.search_results`,{count:`{count}`,total:`{total}`}),"custom-input-placeholder":u(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.custom_model_placeholder`),"expand-button-text":u(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.expand`),"collapse-button-text":u(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`])):t(``,!0)])])):u(G)&&!u(J)?(r(),h(`div`,M,[g(`div`,N,[g(`div`,null,[g(`h2`,P,a(u(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.title`)),1),g(`div`,F,[g(`span`,null,a(u(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle`)),1)])]),g(`div`,I,[s[7]||=g(`div`,{"i-solar:info-circle-line-duotone":``,class:`text-2xl text-primary-500 dark:text-primary-400`},null,-1),g(`div`,ce,[g(`span`,L,a(u(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.not_supported`)),1),g(`span`,R,a(u(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.not_supported_description`)),1)])]),g(`div`,z,[g(`label`,B,a(u(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.manual_model_name`)),1),m(g(`input`,{"onUpdate:modelValue":s[3]||=e=>c(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:u(Q)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.manual_model_placeholder`)},null,8,V),[[d,u(K)]])])])])):t(``,!0)]),m((r(),h(`div`,H,[...s[8]||=[g(`div`,{text:`60`,"i-solar:ghost-bold-duotone":``},null,-1)]])),[[_]])],64)}}});typeof b==`function`&&b(U);var W=U;export{W as default}; \ No newline at end of file diff --git a/assets/data-CBvyhmZq.js b/assets/data-gBWwTXY5.js similarity index 96% rename from assets/data-CBvyhmZq.js rename to assets/data-gBWwTXY5.js index 528d5fbbe6bea73b045a8f55cf32cf6ac23afea3..97255de8aa6605dfaa1333717dc779f24f966c13 100644 --- a/assets/data-CBvyhmZq.js +++ b/assets/data-gBWwTXY5.js @@ -1 +1 @@ -import{A as e,C as t,K as n,O as r,Pt as i,b as a,k as o,kt as s,lt as c,w as l,x as u,xt as d}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-CZ9Rvki9.js";import{r as f}from"./src-DYQXbDgu.js";import{i as p,t as m}from"./resettable-CbXzRviW.js";import{n as h}from"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{at as g,ft as _,rt as v,st as y,tt as b}from"./components-BR_Kqwtu.js";import{i as x,r as S,t as C}from"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import{n as w}from"./vue-i18n.runtime-Dah5zGm4.js";import"./stream-transcription-_Xuw_VzN.js";import{a as T,n as E,r as D}from"./settings-D1kLcsvA.js";import"./__vite-browser-external-BaycPy5b.js";import{t as O}from"./onboarding-DCg6WaMD.js";import{n as k}from"./chat-CSFza6dY.js";import{t as A}from"./airi-card-DuhaYjQU.js";import{n as j}from"./hearing-BH9rth_f.js";import{t as M}from"./route-block-CpjdOEnv.js";import{n as N}from"./live2d-DukystQI.js";const P=p(`mcp`,()=>{let[e,t]=m(`settings/mcp/server-cmd`,``),[n,r]=m(`settings/mcp/server-args`,``),[i,a]=m(`mcp/connected`,!1);function o(){t(),r(),a()}return{serverCmd:e,serverArgs:n,connected:i,resetState:o}});function F(){let e=k(),t=T(),n=x(),r=E(),i=D(),a=N(),o=j(),s=C(),c=S(),l=b(),u=v(),d=y(),f=g(),p=P(),m=O(),_=A();async function w(){await t.resetDisplayModels(),r.stageModelSelected=`preset-live2d-1`,await r.updateStageModel()}async function M(){await n.resetProviderSettings()}function F(){o.resetState(),s.resetState(),c.resetState(),l.resetState(),u.resetState(),d.resetState(),f.resetState()}function I(){e.resetAllSessions()}function L(){let t=e.getAllSessions();return new Blob([JSON.stringify(t,null,2)],{type:`application/json`})}function R(t){let n=t,r={};for(let[e,t]of Object.entries(n))Array.isArray(t)&&(r[e]=t);e.replaceSessions(r)}async function z(){await r.resetState(),i.resetState(),a.resetState(),p.resetState(),m.resetSetupState(),_.resetState()}async function B(){await w(),await M(),F(),I(),await z()}async function V(){h()&&(await z(),F())}return{deleteAllModels:w,resetProvidersSettings:M,resetModulesSettings:F,deleteAllChatSessions:I,exportChatSessions:L,importChatSessions:R,deleteAllData:B,resetDesktopApplicationState:V}}var I={class:`flex flex-col gap-4`},L={class:`border-2 border-neutral-200/50 rounded-xl bg-white/70 p-4 shadow-sm dark:border-neutral-800/60 dark:bg-neutral-900/60`},R={class:`grid grid-cols-1 items-start gap-3 md:grid-cols-[minmax(0,1fr)_auto]`},z={class:`flex flex-col gap-1 md:max-w-[560px]`},B={class:`text-lg font-medium`},V={class:`text-sm text-neutral-600 dark:text-neutral-400`},ee={class:`flex flex-col items-start gap-2 sm:items-end`},te={class:`flex flex-wrap gap-2`},ne={key:0,class:`text-sm text-red-500`},H={class:`border-2 border-neutral-200/50 rounded-xl bg-white/70 p-4 shadow-sm dark:border-neutral-800/60 dark:bg-neutral-900/60`},U={class:`flex flex-col gap-3`},W={class:`grid grid-cols-1 items-start gap-3 md:grid-cols-[minmax(0,1fr)_auto]`},G={class:`flex flex-col gap-1 md:max-w-[560px]`},K={class:`text-lg font-medium`},q={class:`text-sm text-neutral-600 dark:text-neutral-400`},J={class:`flex flex-col items-start gap-2`},Y={class:`grid grid-cols-1 items-start gap-3 md:grid-cols-[minmax(0,1fr)_auto]`},X={class:`flex flex-col gap-1 md:max-w-[560px]`},Z={class:`text-lg font-medium`},re={class:`text-sm text-neutral-600 dark:text-neutral-400`},ie={class:`flex flex-col items-start gap-2`},ae={class:`border-2 border-neutral-200/50 rounded-xl bg-white/70 p-4 shadow-sm dark:border-neutral-800/60 dark:bg-neutral-900/60`},oe={class:`flex flex-col gap-3`},se={class:`text-lg text-red-600 font-semibold dark:text-red-300`},ce={class:`text-sm text-red-600/80 dark:text-red-200/80`},le={class:`flex flex-col gap-3`},ue={class:`grid gap-3 md:grid-cols-2`},de={class:`rounded-lg bg-white/70 p-3 dark:bg-red-950/40`},fe={class:`grid grid-cols-1 items-start gap-2 md:grid-cols-[minmax(0,1fr)_auto]`},pe={class:`flex flex-col gap-1 md:max-w-[560px]`},me={class:`text-sm text-red-700 font-medium dark:text-red-200`},he={class:`text-xs text-red-700/80 dark:text-red-200/80`},ge={class:`flex flex-col items-start gap-2`},_e={class:`rounded-lg bg-white/70 p-3 dark:bg-red-950/40`},ve={class:`grid grid-cols-1 items-start gap-2 md:grid-cols-[minmax(0,1fr)_auto]`},ye={class:`flex flex-col gap-1 md:max-w-[560px]`},be={class:`text-sm text-red-700 font-medium dark:text-red-200`},xe={class:`text-xs text-red-700/80 dark:text-red-200/80`},Q={class:`flex flex-col items-start gap-2`},Se={key:0,class:`border-2 border-amber-300/80 rounded-xl bg-amber-50/80 p-4 shadow-sm dark:border-amber-500/60 dark:bg-amber-500/10`},Ce={class:`grid grid-cols-1 items-start gap-3 md:grid-cols-[minmax(0,1fr)_auto]`},we={class:`flex flex-col gap-1 md:max-w-[560px]`},Te={class:`text-lg text-amber-700 font-medium dark:text-amber-200`},Ee={class:`text-sm text-amber-700/80 dark:text-amber-200/80`},De={class:`flex flex-col items-start gap-2`},$=e({__name:`index`,setup(e){let{t:p}=w(),{deleteAllModels:m,resetProvidersSettings:g,resetModulesSettings:v,deleteAllChatSessions:y,exportChatSessions:b,importChatSessions:x,deleteAllData:S,resetDesktopApplicationState:C}=F(),T=d(``),E=d(`neutral`),D=d(``),O=d(),k=a(()=>h());function A(e,t=`success`){T.value=e,E.value=t}async function j(e,t){try{await e(),A(p(t),`success`)}catch(e){console.error(e),A(e instanceof Error?e.message:String(e),`error`)}}function M(){try{let e=b(),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=`airi-chat-sessions-${new Date().toISOString()}.json`,n.click(),URL.revokeObjectURL(t),A(p(`settings.pages.data.status.exported`))}catch(e){console.error(e),A(e instanceof Error?e.message:String(e),`error`)}}function N(){D.value=``,O.value?.click()}async function P(e){let t=e.target,n=t.files?.[0];if(n)try{let e=await n.text();x(JSON.parse(e)),A(p(`settings.pages.data.status.imported`)),D.value=``}catch(e){console.error(e),D.value=p(`settings.pages.data.status.import_error`),A(e instanceof Error?e.message:String(e),`error`)}finally{t.value=``}}return(e,a)=>(n(),l(`div`,I,[u(`div`,L,[u(`div`,R,[u(`div`,z,[u(`div`,B,i(s(p)(`settings.pages.data.sections.chats.title`)),1),u(`p`,V,i(s(p)(`settings.pages.data.sections.chats.description`)),1)]),u(`div`,ee,[u(`div`,te,[o(s(f),{variant:`secondary`,onClick:M},{default:c(()=>[r(i(s(p)(`settings.pages.data.sections.chats.export`)),1)]),_:1}),o(s(f),{variant:`primary`,onClick:N},{default:c(()=>[r(i(s(p)(`settings.pages.data.sections.chats.import`)),1)]),_:1})]),o(s(_),{variant:`danger`,onConfirm:a[0]||=e=>j(s(y),`settings.pages.data.status.chats_deleted`)},{confirm:c(()=>[r(i(s(p)(`settings.pages.data.confirmations.yes`)),1)]),cancel:c(()=>[r(i(s(p)(`pages.card.cancel`)),1)]),default:c(()=>[r(i(s(p)(`settings.pages.data.sections.chats.delete`))+` `,1)]),_:1})])]),u(`input`,{ref_key:`importFileInput`,ref:O,type:`file`,accept:`application/json`,class:`hidden`,onChange:P},null,544),D.value?(n(),l(`p`,ne,i(D.value),1)):t(``,!0)]),u(`div`,H,[u(`div`,U,[u(`div`,W,[u(`div`,G,[u(`div`,K,i(s(p)(`settings.pages.data.sections.models.title`)),1),u(`p`,q,i(s(p)(`settings.pages.data.sections.models.description`)),1)]),u(`div`,J,[o(s(_),{variant:`danger`,onConfirm:a[1]||=e=>j(s(m),`settings.pages.data.status.models_deleted`)},{confirm:c(()=>[r(i(s(p)(`settings.pages.data.confirmations.yes`)),1)]),cancel:c(()=>[r(i(s(p)(`pages.card.cancel`)),1)]),default:c(()=>[r(i(s(p)(`settings.pages.data.sections.models.delete`))+` `,1)]),_:1})])]),u(`div`,Y,[u(`div`,X,[u(`div`,Z,i(s(p)(`settings.pages.data.sections.modules.title`)),1),u(`p`,re,i(s(p)(`settings.pages.data.sections.modules.description`)),1)]),u(`div`,ie,[o(s(_),{variant:`caution`,onConfirm:a[2]||=e=>j(s(v),`settings.pages.data.status.modules_reset`)},{confirm:c(()=>[r(i(s(p)(`settings.pages.data.confirmations.yes`)),1)]),cancel:c(()=>[r(i(s(p)(`pages.card.cancel`)),1)]),default:c(()=>[r(i(s(p)(`settings.pages.data.sections.modules.reset`))+` `,1)]),_:1})])])])]),u(`div`,ae,[u(`div`,oe,[u(`div`,null,[u(`div`,se,i(s(p)(`settings.pages.data.sections.danger.title`)),1),u(`p`,ce,i(s(p)(`settings.pages.data.sections.danger.description`)),1)]),u(`div`,le,[u(`div`,ue,[u(`div`,de,[u(`div`,fe,[u(`div`,pe,[u(`div`,me,i(s(p)(`settings.pages.data.sections.providers.title`)),1),u(`p`,he,i(s(p)(`settings.pages.data.sections.providers.description`)),1)]),u(`div`,ge,[o(s(_),{variant:`danger`,onConfirm:a[3]||=e=>j(s(g),`settings.pages.data.status.providers_reset`)},{confirm:c(()=>[r(i(s(p)(`settings.pages.data.confirmations.yes`)),1)]),cancel:c(()=>[r(i(s(p)(`pages.card.cancel`)),1)]),default:c(()=>[r(i(s(p)(`settings.pages.data.sections.providers.reset`))+` `,1)]),_:1})])])]),u(`div`,_e,[u(`div`,ve,[u(`div`,ye,[u(`div`,be,i(s(p)(`settings.pages.data.sections.all.title`)),1),u(`p`,xe,i(s(p)(`settings.pages.data.sections.all.description`)),1)]),u(`div`,Q,[o(s(_),{variant:`danger`,onConfirm:a[4]||=e=>j(s(S),`settings.pages.data.status.all_deleted`)},{confirm:c(()=>[r(i(s(p)(`settings.pages.data.confirmations.yes`)),1)]),cancel:c(()=>[r(i(s(p)(`pages.card.cancel`)),1)]),default:c(()=>[r(i(s(p)(`settings.pages.data.sections.all.delete`))+` `,1)]),_:1})])])])])])])]),k.value?(n(),l(`div`,Se,[u(`div`,Ce,[u(`div`,we,[u(`div`,Te,i(s(p)(`settings.pages.data.sections.desktop.title`)),1),u(`p`,Ee,i(s(p)(`settings.pages.data.sections.desktop.description`)),1)]),u(`div`,De,[o(s(_),{variant:`caution`,onConfirm:a[5]||=e=>j(s(C),`settings.pages.data.status.desktop_reset`)},{confirm:c(()=>[r(i(s(p)(`settings.pages.data.confirmations.yes`)),1)]),cancel:c(()=>[r(i(s(p)(`pages.card.cancel`)),1)]),default:c(()=>[r(i(s(p)(`settings.pages.data.sections.desktop.reset`))+` `,1)]),_:1})])])])):t(``,!0)]))}});typeof M==`function`&&M($);var Oe=$;export{Oe as default}; \ No newline at end of file +import{A as e,C as t,K as n,O as r,Pt as i,b as a,k as o,kt as s,lt as c,w as l,x as u,xt as d}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-C0YByt49.js";import{r as f}from"./src-DYQXbDgu.js";import{i as p,t as m}from"./resettable-CbXzRviW.js";import{n as h}from"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{at as g,ft as _,rt as v,st as y,tt as b}from"./components-CeE-UiLT.js";import{i as x,r as S,t as C}from"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import{n as w}from"./vue-i18n.runtime-Dah5zGm4.js";import"./stream-transcription-_Xuw_VzN.js";import{a as T,n as E,r as D}from"./settings-73vyHOZs.js";import"./__vite-browser-external-BaycPy5b.js";import{t as O}from"./onboarding-DCg6WaMD.js";import{n as k}from"./chat-CxQ_IGrj.js";import{t as A}from"./airi-card-DuhaYjQU.js";import{n as j}from"./hearing-BH9rth_f.js";import{t as M}from"./route-block-CpjdOEnv.js";import{n as N}from"./live2d-DukystQI.js";const P=p(`mcp`,()=>{let[e,t]=m(`settings/mcp/server-cmd`,``),[n,r]=m(`settings/mcp/server-args`,``),[i,a]=m(`mcp/connected`,!1);function o(){t(),r(),a()}return{serverCmd:e,serverArgs:n,connected:i,resetState:o}});function F(){let e=k(),t=T(),n=x(),r=E(),i=D(),a=N(),o=j(),s=C(),c=S(),l=b(),u=v(),d=y(),f=g(),p=P(),m=O(),_=A();async function w(){await t.resetDisplayModels(),r.stageModelSelected=`preset-live2d-1`,await r.updateStageModel()}async function M(){await n.resetProviderSettings()}function F(){o.resetState(),s.resetState(),c.resetState(),l.resetState(),u.resetState(),d.resetState(),f.resetState()}function I(){e.resetAllSessions()}function L(){let t=e.getAllSessions();return new Blob([JSON.stringify(t,null,2)],{type:`application/json`})}function R(t){let n=t,r={};for(let[e,t]of Object.entries(n))Array.isArray(t)&&(r[e]=t);e.replaceSessions(r)}async function z(){await r.resetState(),i.resetState(),a.resetState(),p.resetState(),m.resetSetupState(),_.resetState()}async function B(){await w(),await M(),F(),I(),await z()}async function V(){h()&&(await z(),F())}return{deleteAllModels:w,resetProvidersSettings:M,resetModulesSettings:F,deleteAllChatSessions:I,exportChatSessions:L,importChatSessions:R,deleteAllData:B,resetDesktopApplicationState:V}}var I={class:`flex flex-col gap-4`},L={class:`border-2 border-neutral-200/50 rounded-xl bg-white/70 p-4 shadow-sm dark:border-neutral-800/60 dark:bg-neutral-900/60`},R={class:`grid grid-cols-1 items-start gap-3 md:grid-cols-[minmax(0,1fr)_auto]`},z={class:`flex flex-col gap-1 md:max-w-[560px]`},B={class:`text-lg font-medium`},V={class:`text-sm text-neutral-600 dark:text-neutral-400`},ee={class:`flex flex-col items-start gap-2 sm:items-end`},te={class:`flex flex-wrap gap-2`},ne={key:0,class:`text-sm text-red-500`},H={class:`border-2 border-neutral-200/50 rounded-xl bg-white/70 p-4 shadow-sm dark:border-neutral-800/60 dark:bg-neutral-900/60`},U={class:`flex flex-col gap-3`},W={class:`grid grid-cols-1 items-start gap-3 md:grid-cols-[minmax(0,1fr)_auto]`},G={class:`flex flex-col gap-1 md:max-w-[560px]`},K={class:`text-lg font-medium`},q={class:`text-sm text-neutral-600 dark:text-neutral-400`},J={class:`flex flex-col items-start gap-2`},Y={class:`grid grid-cols-1 items-start gap-3 md:grid-cols-[minmax(0,1fr)_auto]`},X={class:`flex flex-col gap-1 md:max-w-[560px]`},Z={class:`text-lg font-medium`},re={class:`text-sm text-neutral-600 dark:text-neutral-400`},ie={class:`flex flex-col items-start gap-2`},ae={class:`border-2 border-neutral-200/50 rounded-xl bg-white/70 p-4 shadow-sm dark:border-neutral-800/60 dark:bg-neutral-900/60`},oe={class:`flex flex-col gap-3`},se={class:`text-lg text-red-600 font-semibold dark:text-red-300`},ce={class:`text-sm text-red-600/80 dark:text-red-200/80`},le={class:`flex flex-col gap-3`},ue={class:`grid gap-3 md:grid-cols-2`},de={class:`rounded-lg bg-white/70 p-3 dark:bg-red-950/40`},fe={class:`grid grid-cols-1 items-start gap-2 md:grid-cols-[minmax(0,1fr)_auto]`},pe={class:`flex flex-col gap-1 md:max-w-[560px]`},me={class:`text-sm text-red-700 font-medium dark:text-red-200`},he={class:`text-xs text-red-700/80 dark:text-red-200/80`},ge={class:`flex flex-col items-start gap-2`},_e={class:`rounded-lg bg-white/70 p-3 dark:bg-red-950/40`},ve={class:`grid grid-cols-1 items-start gap-2 md:grid-cols-[minmax(0,1fr)_auto]`},ye={class:`flex flex-col gap-1 md:max-w-[560px]`},be={class:`text-sm text-red-700 font-medium dark:text-red-200`},xe={class:`text-xs text-red-700/80 dark:text-red-200/80`},Q={class:`flex flex-col items-start gap-2`},Se={key:0,class:`border-2 border-amber-300/80 rounded-xl bg-amber-50/80 p-4 shadow-sm dark:border-amber-500/60 dark:bg-amber-500/10`},Ce={class:`grid grid-cols-1 items-start gap-3 md:grid-cols-[minmax(0,1fr)_auto]`},we={class:`flex flex-col gap-1 md:max-w-[560px]`},Te={class:`text-lg text-amber-700 font-medium dark:text-amber-200`},Ee={class:`text-sm text-amber-700/80 dark:text-amber-200/80`},De={class:`flex flex-col items-start gap-2`},$=e({__name:`index`,setup(e){let{t:p}=w(),{deleteAllModels:m,resetProvidersSettings:g,resetModulesSettings:v,deleteAllChatSessions:y,exportChatSessions:b,importChatSessions:x,deleteAllData:S,resetDesktopApplicationState:C}=F(),T=d(``),E=d(`neutral`),D=d(``),O=d(),k=a(()=>h());function A(e,t=`success`){T.value=e,E.value=t}async function j(e,t){try{await e(),A(p(t),`success`)}catch(e){console.error(e),A(e instanceof Error?e.message:String(e),`error`)}}function M(){try{let e=b(),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=`airi-chat-sessions-${new Date().toISOString()}.json`,n.click(),URL.revokeObjectURL(t),A(p(`settings.pages.data.status.exported`))}catch(e){console.error(e),A(e instanceof Error?e.message:String(e),`error`)}}function N(){D.value=``,O.value?.click()}async function P(e){let t=e.target,n=t.files?.[0];if(n)try{let e=await n.text();x(JSON.parse(e)),A(p(`settings.pages.data.status.imported`)),D.value=``}catch(e){console.error(e),D.value=p(`settings.pages.data.status.import_error`),A(e instanceof Error?e.message:String(e),`error`)}finally{t.value=``}}return(e,a)=>(n(),l(`div`,I,[u(`div`,L,[u(`div`,R,[u(`div`,z,[u(`div`,B,i(s(p)(`settings.pages.data.sections.chats.title`)),1),u(`p`,V,i(s(p)(`settings.pages.data.sections.chats.description`)),1)]),u(`div`,ee,[u(`div`,te,[o(s(f),{variant:`secondary`,onClick:M},{default:c(()=>[r(i(s(p)(`settings.pages.data.sections.chats.export`)),1)]),_:1}),o(s(f),{variant:`primary`,onClick:N},{default:c(()=>[r(i(s(p)(`settings.pages.data.sections.chats.import`)),1)]),_:1})]),o(s(_),{variant:`danger`,onConfirm:a[0]||=e=>j(s(y),`settings.pages.data.status.chats_deleted`)},{confirm:c(()=>[r(i(s(p)(`settings.pages.data.confirmations.yes`)),1)]),cancel:c(()=>[r(i(s(p)(`pages.card.cancel`)),1)]),default:c(()=>[r(i(s(p)(`settings.pages.data.sections.chats.delete`))+` `,1)]),_:1})])]),u(`input`,{ref_key:`importFileInput`,ref:O,type:`file`,accept:`application/json`,class:`hidden`,onChange:P},null,544),D.value?(n(),l(`p`,ne,i(D.value),1)):t(``,!0)]),u(`div`,H,[u(`div`,U,[u(`div`,W,[u(`div`,G,[u(`div`,K,i(s(p)(`settings.pages.data.sections.models.title`)),1),u(`p`,q,i(s(p)(`settings.pages.data.sections.models.description`)),1)]),u(`div`,J,[o(s(_),{variant:`danger`,onConfirm:a[1]||=e=>j(s(m),`settings.pages.data.status.models_deleted`)},{confirm:c(()=>[r(i(s(p)(`settings.pages.data.confirmations.yes`)),1)]),cancel:c(()=>[r(i(s(p)(`pages.card.cancel`)),1)]),default:c(()=>[r(i(s(p)(`settings.pages.data.sections.models.delete`))+` `,1)]),_:1})])]),u(`div`,Y,[u(`div`,X,[u(`div`,Z,i(s(p)(`settings.pages.data.sections.modules.title`)),1),u(`p`,re,i(s(p)(`settings.pages.data.sections.modules.description`)),1)]),u(`div`,ie,[o(s(_),{variant:`caution`,onConfirm:a[2]||=e=>j(s(v),`settings.pages.data.status.modules_reset`)},{confirm:c(()=>[r(i(s(p)(`settings.pages.data.confirmations.yes`)),1)]),cancel:c(()=>[r(i(s(p)(`pages.card.cancel`)),1)]),default:c(()=>[r(i(s(p)(`settings.pages.data.sections.modules.reset`))+` `,1)]),_:1})])])])]),u(`div`,ae,[u(`div`,oe,[u(`div`,null,[u(`div`,se,i(s(p)(`settings.pages.data.sections.danger.title`)),1),u(`p`,ce,i(s(p)(`settings.pages.data.sections.danger.description`)),1)]),u(`div`,le,[u(`div`,ue,[u(`div`,de,[u(`div`,fe,[u(`div`,pe,[u(`div`,me,i(s(p)(`settings.pages.data.sections.providers.title`)),1),u(`p`,he,i(s(p)(`settings.pages.data.sections.providers.description`)),1)]),u(`div`,ge,[o(s(_),{variant:`danger`,onConfirm:a[3]||=e=>j(s(g),`settings.pages.data.status.providers_reset`)},{confirm:c(()=>[r(i(s(p)(`settings.pages.data.confirmations.yes`)),1)]),cancel:c(()=>[r(i(s(p)(`pages.card.cancel`)),1)]),default:c(()=>[r(i(s(p)(`settings.pages.data.sections.providers.reset`))+` `,1)]),_:1})])])]),u(`div`,_e,[u(`div`,ve,[u(`div`,ye,[u(`div`,be,i(s(p)(`settings.pages.data.sections.all.title`)),1),u(`p`,xe,i(s(p)(`settings.pages.data.sections.all.description`)),1)]),u(`div`,Q,[o(s(_),{variant:`danger`,onConfirm:a[4]||=e=>j(s(S),`settings.pages.data.status.all_deleted`)},{confirm:c(()=>[r(i(s(p)(`settings.pages.data.confirmations.yes`)),1)]),cancel:c(()=>[r(i(s(p)(`pages.card.cancel`)),1)]),default:c(()=>[r(i(s(p)(`settings.pages.data.sections.all.delete`))+` `,1)]),_:1})])])])])])])]),k.value?(n(),l(`div`,Se,[u(`div`,Ce,[u(`div`,we,[u(`div`,Te,i(s(p)(`settings.pages.data.sections.desktop.title`)),1),u(`p`,Ee,i(s(p)(`settings.pages.data.sections.desktop.description`)),1)]),u(`div`,De,[o(s(_),{variant:`caution`,onConfirm:a[5]||=e=>j(s(C),`settings.pages.data.status.desktop_reset`)},{confirm:c(()=>[r(i(s(p)(`settings.pages.data.confirmations.yes`)),1)]),cancel:c(()=>[r(i(s(p)(`pages.card.cancel`)),1)]),default:c(()=>[r(i(s(p)(`settings.pages.data.sections.desktop.reset`))+` `,1)]),_:1})])])])):t(``,!0)]))}});typeof M==`function`&&M($);var Oe=$;export{Oe as default}; \ No newline at end of file diff --git a/assets/developer-Da1vuucL.js b/assets/developer-DhPQaokR.js similarity index 95% rename from assets/developer-Da1vuucL.js rename to assets/developer-DhPQaokR.js index 8485df0bd5066805e1b5b6a51797da93972d9d6c..0a35c4aff1903c4cf4819d15e1d2636923889b2c 100644 --- a/assets/developer-Da1vuucL.js +++ b/assets/developer-DhPQaokR.js @@ -1 +1 @@ -import{A as e,J as t,K as n,Nt as r,S as i,Z as a,b as o,k as s,kt as c,m as l,ut as u,w as d,x as f}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-CZ9Rvki9.js";import"./src-DYQXbDgu.js";import"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{n as p,vt as m}from"./components-BR_Kqwtu.js";import"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import{n as h}from"./vue-i18n.runtime-Dah5zGm4.js";import"./stream-transcription-_Xuw_VzN.js";import{n as g}from"./settings-D1kLcsvA.js";import"./__vite-browser-external-BaycPy5b.js";import{t as _}from"./route-block-CpjdOEnv.js";var v={flex:`~ col gap-4`,"pb-12":``},y={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":``},b=e({__name:`developer`,setup(e){let{t:_}=h(),b=g(),x=o(()=>[{title:`Audio Record`,description:`Test Audio related composables`,icon:`i-solar:sledgehammer-bold-duotone`,to:`/devtools/audio-record`},{title:`Background Theme color blending`,description:`Test blending & theme`,icon:`i-solar:sledgehammer-bold-duotone`,to:`/devtools/background-gradient-blending`},{title:`Background removal (WebGPU required)`,description:`Utility for background removal`,icon:`i-solar:sledgehammer-bold-duotone`,to:`/devtools/background-removal`},{title:`Chat`,description:`Chat`,icon:`i-solar:sledgehammer-bold-duotone`,to:`/devtools/chat`},{title:`Gesture Circle (Desktop only)`,description:`Test gesture recognition`,icon:`i-solar:sledgehammer-bold-duotone`,to:`/devtools/gesture-circle`},{title:`Image`,description:`Image`,icon:`i-solar:sledgehammer-bold-duotone`,to:`/devtools/image`},{title:`Polaroid`,description:`Utility for taking shots of models`,icon:`i-solar:sledgehammer-bold-duotone`,to:`/devtools/polaroid`},{title:_(`settings.pages.system.sections.section.developer.sections.section.use-magic-keys.title`),description:_(`settings.pages.system.sections.section.developer.sections.section.use-magic-keys.description`),icon:`i-solar:sledgehammer-bold-duotone`,to:`/devtools/use-magic-keys`},{title:`Color extract`,description:`Test color extraction`,icon:`i-solar:sledgehammer-bold-duotone`,to:`/devtools/vibrant`},{title:`Aliyun Real-time Transcriber`,description:`Stream microphone audio to Aliyun NLS and inspect live transcripts`,icon:`i-solar:sledgehammer-bold-duotone`,to:`/devtools/providers-transcription-realtime-aliyun-nls`}]);return(e,o)=>{let h=a(`motion`);return n(),d(l,null,[u(s(c(p),{modelValue:c(b).disableTransitions,"onUpdate:modelValue":o[0]||=e=>c(b).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:50,transition:`all ease-in-out duration-250`},null,8,[`modelValue`]),[[h]]),u(s(c(p),{modelValue:c(b).usePageSpecificTransitions,"onUpdate:modelValue":o[1]||=e=>c(b).usePageSpecificTransitions=e,disabled:c(b).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:100,transition:`all ease-in-out duration-250`},null,8,[`modelValue`,`disabled`]),[[h]]),f(`div`,v,[(n(!0),d(l,null,t(x.value,(e,t)=>u((n(),i(c(m),{key:e.to,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250,style:r({transitionDelay:`${t*50}ms`}),title:e.title,description:e.description,icon:e.icon,to:e.to},null,8,[`style`,`title`,`description`,`icon`,`to`])),[[h]])),128))]),u((n(),d(`div`,y,[...o[2]||=[f(`div`,{text:`60`,"i-solar:code-bold-duotone":``},null,-1)]])),[[h]])],64)}}});typeof _==`function`&&_(b);var x=b;export{x as default}; \ No newline at end of file +import{A as e,J as t,K as n,Nt as r,S as i,Z as a,b as o,k as s,kt as c,m as l,ut as u,w as d,x as f}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-C0YByt49.js";import"./src-DYQXbDgu.js";import"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{n as p,vt as m}from"./components-CeE-UiLT.js";import"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import{n as h}from"./vue-i18n.runtime-Dah5zGm4.js";import"./stream-transcription-_Xuw_VzN.js";import{n as g}from"./settings-73vyHOZs.js";import"./__vite-browser-external-BaycPy5b.js";import{t as _}from"./route-block-CpjdOEnv.js";var v={flex:`~ col gap-4`,"pb-12":``},y={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":``},b=e({__name:`developer`,setup(e){let{t:_}=h(),b=g(),x=o(()=>[{title:`Audio Record`,description:`Test Audio related composables`,icon:`i-solar:sledgehammer-bold-duotone`,to:`/devtools/audio-record`},{title:`Background Theme color blending`,description:`Test blending & theme`,icon:`i-solar:sledgehammer-bold-duotone`,to:`/devtools/background-gradient-blending`},{title:`Background removal (WebGPU required)`,description:`Utility for background removal`,icon:`i-solar:sledgehammer-bold-duotone`,to:`/devtools/background-removal`},{title:`Chat`,description:`Chat`,icon:`i-solar:sledgehammer-bold-duotone`,to:`/devtools/chat`},{title:`Gesture Circle (Desktop only)`,description:`Test gesture recognition`,icon:`i-solar:sledgehammer-bold-duotone`,to:`/devtools/gesture-circle`},{title:`Image`,description:`Image`,icon:`i-solar:sledgehammer-bold-duotone`,to:`/devtools/image`},{title:`Polaroid`,description:`Utility for taking shots of models`,icon:`i-solar:sledgehammer-bold-duotone`,to:`/devtools/polaroid`},{title:_(`settings.pages.system.sections.section.developer.sections.section.use-magic-keys.title`),description:_(`settings.pages.system.sections.section.developer.sections.section.use-magic-keys.description`),icon:`i-solar:sledgehammer-bold-duotone`,to:`/devtools/use-magic-keys`},{title:`Color extract`,description:`Test color extraction`,icon:`i-solar:sledgehammer-bold-duotone`,to:`/devtools/vibrant`},{title:`Aliyun Real-time Transcriber`,description:`Stream microphone audio to Aliyun NLS and inspect live transcripts`,icon:`i-solar:sledgehammer-bold-duotone`,to:`/devtools/providers-transcription-realtime-aliyun-nls`}]);return(e,o)=>{let h=a(`motion`);return n(),d(l,null,[u(s(c(p),{modelValue:c(b).disableTransitions,"onUpdate:modelValue":o[0]||=e=>c(b).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:50,transition:`all ease-in-out duration-250`},null,8,[`modelValue`]),[[h]]),u(s(c(p),{modelValue:c(b).usePageSpecificTransitions,"onUpdate:modelValue":o[1]||=e=>c(b).usePageSpecificTransitions=e,disabled:c(b).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:100,transition:`all ease-in-out duration-250`},null,8,[`modelValue`,`disabled`]),[[h]]),f(`div`,v,[(n(!0),d(l,null,t(x.value,(e,t)=>u((n(),i(c(m),{key:e.to,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250,style:r({transitionDelay:`${t*50}ms`}),title:e.title,description:e.description,icon:e.icon,to:e.to},null,8,[`style`,`title`,`description`,`icon`,`to`])),[[h]])),128))]),u((n(),d(`div`,y,[...o[2]||=[f(`div`,{text:`60`,"i-solar:code-bold-duotone":``},null,-1)]])),[[h]])],64)}}});typeof _==`function`&&_(b);var x=b;export{x as default}; \ No newline at end of file diff --git a/assets/elevenlabs-DdLCiM18.js b/assets/elevenlabs-C4xZyC-g.js similarity index 95% rename from assets/elevenlabs-DdLCiM18.js rename to assets/elevenlabs-C4xZyC-g.js index 52bdacad53c4ddeaa26f2f77eae77403b80a6d77..360a3a0d4ccbc58eda363a577d32432af0a4f62a 100644 --- a/assets/elevenlabs-DdLCiM18.js +++ b/assets/elevenlabs-C4xZyC-g.js @@ -1 +1 @@ -import{A as e,K as t,S as n,W as r,at as i,b as a,k as o,kt as s,lt as c,x as l,xt as u}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-CZ9Rvki9.js";import{l as d,p as f}from"./src-DYQXbDgu.js";import{a as p}from"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{c as m,u as h}from"./components-BR_Kqwtu.js";import{i as g,t as _}from"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import{n as v}from"./vue-i18n.runtime-Dah5zGm4.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-D1kLcsvA.js";import"./__vite-browser-external-BaycPy5b.js";import{t as y}from"./route-block-CpjdOEnv.js";var b={flex:`~ col gap-4`},x=`elevenlabs`,S=`eleven_multilingual_v2`,C=e({__name:`elevenlabs`,setup(e){let y={similarityBoost:.75,stability:.5,speed:1,style:0,useSpeakerBoost:!0},C=u(0),w=u(1),T=u(0),E=u(0),D=u(.5),O=u(.75),k=u(!1),A=_(),j=g(),{providers:M}=p(j),{t:N}=v(),P=a(()=>!!M.value[x]?.apiKey),F=a(()=>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 r(async()=>{let e=j.getProviderConfig(x);await j.getProviderMetadata(x).validators.validateProviderConfig(e)?await A.loadVoicesForProvider(x):console.error(`Failed to validate provider config`,e)}),i(C,async()=>{let e=j.getProviderConfig(x);e.pitch=C.value}),i(w,async()=>{let e=j.getProviderConfig(x);e.speed=w.value}),i(T,async()=>{let e=j.getProviderConfig(x);e.volume=T.value}),i(E,async()=>{let e=j.getProviderConfig(x);e.style=E.value}),i(D,async()=>{let e=j.getProviderConfig(x);e.stability=D.value}),i(O,async()=>{let e=j.getProviderConfig(x);e.similarityBoost=O.value}),i(k,async()=>{let e=j.getProviderConfig(x);e.useSpeakerBoost=k.value}),i(M,async()=>{let e=j.getProviderConfig(x);await j.getProviderMetadata(x).validators.validateProviderConfig(e)?await A.loadVoicesForProvider(x):console.error(`Failed to validate provider config`,e)},{immediate:!0}),(e,r)=>(t(),n(s(m),{"provider-id":x,"default-model":S,"additional-settings":y},{"voice-settings":c(()=>[l(`div`,b,[o(s(d),{modelValue:C.value,"onUpdate:modelValue":r[0]||=e=>C.value=e,label:s(N)(`settings.pages.providers.provider.common.fields.field.pitch.label`),description:s(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`]),o(s(d),{modelValue:w.value,"onUpdate:modelValue":r[1]||=e=>w.value=e,label:s(N)(`settings.pages.providers.provider.common.fields.field.speed.label`),description:s(N)(`settings.pages.providers.provider.common.fields.field.speed.description`),min:.5,max:2,step:.01},null,8,[`modelValue`,`label`,`description`]),o(s(d),{modelValue:T.value,"onUpdate:modelValue":r[2]||=e=>T.value=e,label:s(N)(`settings.pages.providers.provider.common.fields.field.volume.label`),description:s(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`]),o(s(d),{modelValue:E.value,"onUpdate:modelValue":r[3]||=e=>E.value=e,label:s(N)(`settings.pages.providers.provider.elevenlabs.fields.field.style.label`),description:s(N)(`settings.pages.providers.provider.elevenlabs.fields.field.style.description`),min:0,max:1,step:.01},null,8,[`modelValue`,`label`,`description`]),o(s(d),{modelValue:D.value,"onUpdate:modelValue":r[4]||=e=>D.value=e,label:s(N)(`settings.pages.providers.provider.elevenlabs.fields.field.stability.label`),description:s(N)(`settings.pages.providers.provider.elevenlabs.fields.field.stability.description`),min:0,max:1,step:.01},null,8,[`modelValue`,`label`,`description`]),o(s(d),{modelValue:O.value,"onUpdate:modelValue":r[5]||=e=>O.value=e,label:s(N)(`settings.pages.providers.provider.elevenlabs.fields.field.simularity-boost.label`),description:s(N)(`settings.pages.providers.provider.elevenlabs.fields.field.simularity-boost.description`),min:0,max:1,step:.01},null,8,[`modelValue`,`label`,`description`]),o(s(f),{modelValue:k.value,"onUpdate:modelValue":r[6]||=e=>k.value=e,label:s(N)(`settings.pages.providers.provider.elevenlabs.fields.field.speaker-boost.label`),description:s(N)(`settings.pages.providers.provider.elevenlabs.fields.field.speaker-boost.description`)},null,8,[`modelValue`,`label`,`description`])])]),playground:c(()=>[o(s(h),{"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 +import{A as e,K as t,S as n,W as r,at as i,b as a,k as o,kt as s,lt as c,x as l,xt as u}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-C0YByt49.js";import{l as d,p as f}from"./src-DYQXbDgu.js";import{a as p}from"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{c as m,u as h}from"./components-CeE-UiLT.js";import{i as g,t as _}from"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import{n as v}from"./vue-i18n.runtime-Dah5zGm4.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-73vyHOZs.js";import"./__vite-browser-external-BaycPy5b.js";import{t as y}from"./route-block-CpjdOEnv.js";var b={flex:`~ col gap-4`},x=`elevenlabs`,S=`eleven_multilingual_v2`,C=e({__name:`elevenlabs`,setup(e){let y={similarityBoost:.75,stability:.5,speed:1,style:0,useSpeakerBoost:!0},C=u(0),w=u(1),T=u(0),E=u(0),D=u(.5),O=u(.75),k=u(!1),A=_(),j=g(),{providers:M}=p(j),{t:N}=v(),P=a(()=>!!M.value[x]?.apiKey),F=a(()=>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 r(async()=>{let e=j.getProviderConfig(x);await j.getProviderMetadata(x).validators.validateProviderConfig(e)?await A.loadVoicesForProvider(x):console.error(`Failed to validate provider config`,e)}),i(C,async()=>{let e=j.getProviderConfig(x);e.pitch=C.value}),i(w,async()=>{let e=j.getProviderConfig(x);e.speed=w.value}),i(T,async()=>{let e=j.getProviderConfig(x);e.volume=T.value}),i(E,async()=>{let e=j.getProviderConfig(x);e.style=E.value}),i(D,async()=>{let e=j.getProviderConfig(x);e.stability=D.value}),i(O,async()=>{let e=j.getProviderConfig(x);e.similarityBoost=O.value}),i(k,async()=>{let e=j.getProviderConfig(x);e.useSpeakerBoost=k.value}),i(M,async()=>{let e=j.getProviderConfig(x);await j.getProviderMetadata(x).validators.validateProviderConfig(e)?await A.loadVoicesForProvider(x):console.error(`Failed to validate provider config`,e)},{immediate:!0}),(e,r)=>(t(),n(s(m),{"provider-id":x,"default-model":S,"additional-settings":y},{"voice-settings":c(()=>[l(`div`,b,[o(s(d),{modelValue:C.value,"onUpdate:modelValue":r[0]||=e=>C.value=e,label:s(N)(`settings.pages.providers.provider.common.fields.field.pitch.label`),description:s(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`]),o(s(d),{modelValue:w.value,"onUpdate:modelValue":r[1]||=e=>w.value=e,label:s(N)(`settings.pages.providers.provider.common.fields.field.speed.label`),description:s(N)(`settings.pages.providers.provider.common.fields.field.speed.description`),min:.5,max:2,step:.01},null,8,[`modelValue`,`label`,`description`]),o(s(d),{modelValue:T.value,"onUpdate:modelValue":r[2]||=e=>T.value=e,label:s(N)(`settings.pages.providers.provider.common.fields.field.volume.label`),description:s(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`]),o(s(d),{modelValue:E.value,"onUpdate:modelValue":r[3]||=e=>E.value=e,label:s(N)(`settings.pages.providers.provider.elevenlabs.fields.field.style.label`),description:s(N)(`settings.pages.providers.provider.elevenlabs.fields.field.style.description`),min:0,max:1,step:.01},null,8,[`modelValue`,`label`,`description`]),o(s(d),{modelValue:D.value,"onUpdate:modelValue":r[4]||=e=>D.value=e,label:s(N)(`settings.pages.providers.provider.elevenlabs.fields.field.stability.label`),description:s(N)(`settings.pages.providers.provider.elevenlabs.fields.field.stability.description`),min:0,max:1,step:.01},null,8,[`modelValue`,`label`,`description`]),o(s(d),{modelValue:O.value,"onUpdate:modelValue":r[5]||=e=>O.value=e,label:s(N)(`settings.pages.providers.provider.elevenlabs.fields.field.simularity-boost.label`),description:s(N)(`settings.pages.providers.provider.elevenlabs.fields.field.simularity-boost.description`),min:0,max:1,step:.01},null,8,[`modelValue`,`label`,`description`]),o(s(f),{modelValue:k.value,"onUpdate:modelValue":r[6]||=e=>k.value=e,label:s(N)(`settings.pages.providers.provider.elevenlabs.fields.field.speaker-boost.label`),description:s(N)(`settings.pages.providers.provider.elevenlabs.fields.field.speaker-boost.description`)},null,8,[`modelValue`,`label`,`description`])])]),playground:c(()=>[o(s(h),{"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/gaming-factorio-SBqYhlLF.js b/assets/gaming-factorio-l8EQ5MQM.js similarity index 69% rename from assets/gaming-factorio-SBqYhlLF.js rename to assets/gaming-factorio-l8EQ5MQM.js index 51961726914c58bf3800e05660183adbd0422fba..7647acbda4fee657d78d8d37cdb4c006c28280b6 100644 --- a/assets/gaming-factorio-SBqYhlLF.js +++ b/assets/gaming-factorio-l8EQ5MQM.js @@ -1 +1 @@ -import{A as e,K as t,S as n,kt as r}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-CZ9Rvki9.js";import"./src-DYQXbDgu.js";import"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{ot as i}from"./components-BR_Kqwtu.js";import"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-D1kLcsvA.js";import"./__vite-browser-external-BaycPy5b.js";import{t as a}from"./route-block-CpjdOEnv.js";var o=e({__name:`gaming-factorio`,setup(e){return(e,a)=>(t(),n(r(i)))}});typeof a==`function`&&a(o);var s=o;export{s as default}; \ No newline at end of file +import{A as e,K as t,S as n,kt as r}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-C0YByt49.js";import"./src-DYQXbDgu.js";import"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{ot as i}from"./components-CeE-UiLT.js";import"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-73vyHOZs.js";import"./__vite-browser-external-BaycPy5b.js";import{t as a}from"./route-block-CpjdOEnv.js";var o=e({__name:`gaming-factorio`,setup(e){return(e,a)=>(t(),n(r(i)))}});typeof a==`function`&&a(o);var s=o;export{s as default}; \ No newline at end of file diff --git a/assets/gaming-minecraft-DqVnVTyA.js b/assets/gaming-minecraft-DfdBhRo1.js similarity index 69% rename from assets/gaming-minecraft-DqVnVTyA.js rename to assets/gaming-minecraft-DfdBhRo1.js index 5f0a6b5b036dfc03107a9ebdcfb9d48937a1e4d8..deca5ec4b50f57f0a28ca385acb78a4c435a3808 100644 --- a/assets/gaming-minecraft-DqVnVTyA.js +++ b/assets/gaming-minecraft-DfdBhRo1.js @@ -1 +1 @@ -import{A as e,K as t,S as n,kt as r}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-CZ9Rvki9.js";import"./src-DYQXbDgu.js";import"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{it as i}from"./components-BR_Kqwtu.js";import"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-D1kLcsvA.js";import"./__vite-browser-external-BaycPy5b.js";import{t as a}from"./route-block-CpjdOEnv.js";var o=e({__name:`gaming-minecraft`,setup(e){return(e,a)=>(t(),n(r(i)))}});typeof a==`function`&&a(o);var s=o;export{s as default}; \ No newline at end of file +import{A as e,K as t,S as n,kt as r}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-C0YByt49.js";import"./src-DYQXbDgu.js";import"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{it as i}from"./components-CeE-UiLT.js";import"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-73vyHOZs.js";import"./__vite-browser-external-BaycPy5b.js";import{t as a}from"./route-block-CpjdOEnv.js";var o=e({__name:`gaming-minecraft`,setup(e){return(e,a)=>(t(),n(r(i)))}});typeof a==`function`&&a(o);var s=o;export{s as default}; \ No newline at end of file diff --git a/assets/general-Bvs5oF0L.js b/assets/general-BGIB4bwV.js similarity index 96% rename from assets/general-Bvs5oF0L.js rename to assets/general-BGIB4bwV.js index 7f6fb53bcc56c427cabb8295a7b8ac00fdbe08fc..a11dbe66087265cafd7d3cabe157574d51650af2 100644 --- a/assets/general-Bvs5oF0L.js +++ b/assets/general-BGIB4bwV.js @@ -1 +1 @@ -import{A as e,K as t,X as n,Z as r,b as i,gt as a,k as o,kt as s,ut as c,w as l,x as u}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import{t as d}from"./src-DYQXbDgu.js";import"./resettable-CbXzRviW.js";import"./src-C83SCWbW.js";import{n as f}from"./vue-i18n.runtime-Dah5zGm4.js";import{n as p}from"./settings-D1kLcsvA.js";import{t as m}from"./route-block-CpjdOEnv.js";const h={en:`English`,es:`Español`,fr:`Français`,ru:`Русский`,vi:`Tiếng Việt`,"zh-Hans":`简体中文`,"zh-Hant":`繁體中文`};var g={"rounded-lg":``,"bg-neutral-50":``,"p-4":``,"dark:bg-neutral-800":``,flex:`~ col gap-4`},_={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":``},v=e({__name:`general`,setup(e){let m=p(),{t:v}=f(),{isDark:y}=d(),b=i(()=>Object.entries(h).map(([e,t])=>({value:e,label:t})));return(e,i)=>{let d=n(`FieldCheckbox`),f=n(`FieldSelect`),p=r(`motion`);return t(),l(`div`,g,[c(o(d,{modelValue:s(y),"onUpdate:modelValue":i[0]||=e=>a(y)?y.value=e:null,"mb-2":``,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:270,delay:100,label:s(v)(`settings.theme.title`),description:s(v)(`settings.theme.description`)},null,8,[`modelValue`,`label`,`description`]),[[p]]),c(o(f,{modelValue:s(m).language,"onUpdate:modelValue":i[1]||=e=>s(m).language=e,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:280,delay:150,transition:`all ease-in-out duration-250`,label:s(v)(`settings.language.title`),description:s(v)(`settings.language.description`),options:b.value},null,8,[`modelValue`,`label`,`description`,`options`]),[[p]]),c((t(),l(`div`,_,[...i[2]||=[u(`div`,{text:`60`,"i-solar:emoji-funny-square-bold-duotone":``},null,-1)]])),[[p]])])}}});typeof m==`function`&&m(v);var y=v;export{y as default}; \ No newline at end of file +import{A as e,K as t,X as n,Z as r,b as i,gt as a,k as o,kt as s,ut as c,w as l,x as u}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import{t as d}from"./src-DYQXbDgu.js";import"./resettable-CbXzRviW.js";import"./src-C83SCWbW.js";import{n as f}from"./vue-i18n.runtime-Dah5zGm4.js";import{n as p}from"./settings-73vyHOZs.js";import{t as m}from"./route-block-CpjdOEnv.js";const h={en:`English`,es:`Español`,fr:`Français`,ru:`Русский`,vi:`Tiếng Việt`,"zh-Hans":`简体中文`,"zh-Hant":`繁體中文`};var g={"rounded-lg":``,"bg-neutral-50":``,"p-4":``,"dark:bg-neutral-800":``,flex:`~ col gap-4`},_={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":``},v=e({__name:`general`,setup(e){let m=p(),{t:v}=f(),{isDark:y}=d(),b=i(()=>Object.entries(h).map(([e,t])=>({value:e,label:t})));return(e,i)=>{let d=n(`FieldCheckbox`),f=n(`FieldSelect`),p=r(`motion`);return t(),l(`div`,g,[c(o(d,{modelValue:s(y),"onUpdate:modelValue":i[0]||=e=>a(y)?y.value=e:null,"mb-2":``,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:270,delay:100,label:s(v)(`settings.theme.title`),description:s(v)(`settings.theme.description`)},null,8,[`modelValue`,`label`,`description`]),[[p]]),c(o(f,{modelValue:s(m).language,"onUpdate:modelValue":i[1]||=e=>s(m).language=e,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:280,delay:150,transition:`all ease-in-out duration-250`,label:s(v)(`settings.language.title`),description:s(v)(`settings.language.description`),options:b.value},null,8,[`modelValue`,`label`,`description`,`options`]),[[p]]),c((t(),l(`div`,_,[...i[2]||=[u(`div`,{text:`60`,"i-solar:emoji-funny-square-bold-duotone":``},null,-1)]])),[[p]])])}}});typeof m==`function`&&m(v);var y=v;export{y as default}; \ No newline at end of file diff --git a/assets/hearing-CzJ5MFBH.js b/assets/hearing-D9i_dzhe.js similarity index 98% rename from assets/hearing-CzJ5MFBH.js rename to assets/hearing-D9i_dzhe.js index 0ffa752cc9b40ca2fddee348b779315104a55a51..954f95cc1aa097f356769c1c554549e47409d736 100644 --- a/assets/hearing-CzJ5MFBH.js +++ b/assets/hearing-D9i_dzhe.js @@ -1 +1 @@ -import{A as e,C as t,G as n,J as r,K as i,O as a,Pt as o,S as s,W as c,X as l,at as ee,b as u,gt as d,jt as te,k as f,kt as p,lt as m,m as h,w as g,x as _,xt as v}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-CZ9Rvki9.js";import{c as ne,l as y,p as re,r as ie}from"./src-DYQXbDgu.js";import{a as b}from"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{Ct as ae,St as oe,bt as se,dt as x,gt as ce,ht as le,mt as ue,o as de,s as fe,wt as pe}from"./components-BR_Kqwtu.js";import{i as me}from"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import{n as he}from"./vue-i18n.runtime-Dah5zGm4.js";import"./stream-transcription-_Xuw_VzN.js";import{D as ge,r as S}from"./settings-D1kLcsvA.js";import"./__vite-browser-external-BaycPy5b.js";import{n as _e,t as ve}from"./hearing-BH9rth_f.js";import"./transformers.web-DAjDoeaJ.js";import{t as C}from"./route-block-CpjdOEnv.js";import{t as ye}from"./process.worklet-Cmmnc6Go.js";import{t as be}from"./composables-eN7drneV.js";var xe={flex:`~ col md:row gap-6`},Se={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%]`},Ce={flex:`~ col gap-4`},we={flex:`~ col gap-4`},Te={class:`text-lg text-neutral-500 md:text-2xl dark:text-neutral-500`},Ee={text:`neutral-400 dark:neutral-400`},De={"max-w-full":``},w={key:0,flex:`~ row gap-4`,style:{"scrollbar-width":`none`},"min-w-0":``,"of-x-scroll":``,"scroll-smooth":``,role:`radiogroup`},T={key:1},E={key:0},Oe={flex:`~ col gap-4`},ke={class:`text-lg md:text-2xl`},Ae={text:`neutral-400 dark:neutral-400`},je={key:0,class:`flex items-center justify-center py-4`},Me={flex:`~ col gap-6`,class:`w-full md:w-[60%]`},Ne={"w-full":``,"rounded-xl":``},Pe={class:`mb-4 text-lg text-neutral-500 md:text-2xl dark:text-neutral-400`,"w-full":``},Fe={class:`inline-flex items-center gap-4`},Ie=[`src`],Le={key:0,class:`mt-2 text-sm text-neutral-500 dark:text-neutral-400`},Re={flex:`~ col gap-4`},ze={class:`space-y-4`},Be={class:`space-y-3`},Ve={key:1,class:`space-y-3`},He={key:2,class:`space-y-3`},Ue={class:`flex items-center gap-3`},We={class:`text-sm font-medium`},Ge={class:`ml-auto text-xs text-neutral-500`},Ke={class:`border-t border-neutral-200 pt-3 dark:border-neutral-700`},qe={key:0,class:`mt-3 space-y-2`},Je={key:0,class:`flex items-center gap-2 text-primary-600 dark:text-primary-400`},Ye={key:2,class:`flex items-center gap-2 text-green-600 dark:text-green-400`},Xe={class:`ml-auto text-xs text-neutral-500`},D=e({__name:`hearing`,setup(e){let{t:C}=he(),D=_e(),{activeTranscriptionProvider:O,activeTranscriptionModel:k,providerModels:A,activeProviderModelError:j,isLoadingActiveProviderModels:M,supportsModelListing:Ze,transcriptionModelSearchQuery:N,activeCustomModelName:Qe}=b(D),{configuredTranscriptionProvidersMetadata:P}=b(me()),{stopStream:$e,startStream:et}=S(),{audioInputs:tt,selectedAudioInput:F,stream:I}=b(S()),{startRecord:nt,stopRecord:rt,onStopRecord:it}=de(I),{startAnalyzer:at,stopAnalyzer:ot,onAnalyzerUpdate:st,volumeLevel:ct}=fe(),{audioContext:L}=b(ge()),{transcribeForRecording:lt}=ve(),R=v(),z=v(``),B=v(!1),V=v([]),H=v([]),U=v([]),ut=u(()=>H.value.map(e=>{let t=URL.createObjectURL(e);return U.value.push(()=>URL.revokeObjectURL(t)),t})),W=v(.6),G=v(!0),{init:dt,dispose:K,isSpeech:ft,isSpeechProb:q,isSpeechHistory:pt,inferenceError:J,start:mt,loaded:Y,loading:ht}=be(ye,{threshold:W,onSpeechStart:()=>nt(),onSpeechEnd:()=>rt()}),X=v(!1),Z=u(()=>G.value&&Y.value?ft.value:X.value);async function Q(){try{if(!F.value){console.warn(`No audio input device selected`);return}if(await $(),await et(),!I.value){console.warn(`No audio stream available`);return}let e=L.value.createMediaStreamSource(I.value),t=at(L.value);st(e=>{(!G.value||!Y.value)&&(X.value=e>W.value)}),t&&e.connect(t),G.value&&(await dt(),await mt(I.value))}catch(e){console.error(`Error setting up audio monitoring:`,e),J.value=e instanceof Error?e.message:String(e)}}async function $(){R.value&&=(cancelAnimationFrame(R.value),void 0),I.value&&$e(),ot(),K()}async function gt(){B.value?(await $(),B.value=!1):(await Q(),B.value=!0)}let _t=u(()=>{if(!G.value||!Y.value)return X.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=q.value,t=W.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`});function vt(e){Qe.value=e}return it(async e=>{e&&e.size>0&&H.value.push(e);let t=await lt(e);t&&V.value.push(t)}),ee(F,async()=>B.value&&await Q()),c(async()=>{await D.loadModelsForProvider(O.value)}),n(()=>{$(),K(),U.value.forEach(e=>e())}),(e,n)=>{let c=l(`RouterLink`);return i(),g(`div`,xe,[_(`div`,Se,[_(`div`,Ce,[_(`div`,null,[f(p(ne),{modelValue:p(F),"onUpdate:modelValue":n[0]||=e=>d(F)?F.value=e:null,label:`Audio Input Device`,description:`Select the audio input device for your hearing module.`,options:p(tt).map(e=>({label:e.label||e.deviceId,value:e.deviceId})),placeholder:`Select an audio input device`,layout:`vertical`},null,8,[`modelValue`,`options`])]),_(`div`,we,[_(`div`,null,[_(`h2`,Te,o(p(C)(`settings.pages.providers.title`)),1),_(`div`,Ee,[_(`span`,null,o(p(C)(`settings.pages.modules.hearing.sections.section.provider-selection.description`)),1)])]),_(`div`,De,[p(P).length>0?(i(),g(`fieldset`,w,[(i(!0),g(h,null,r(p(P),e=>(i(),s(p(ue),{id:e.id,key:e.id,modelValue:p(O),"onUpdate:modelValue":n[1]||=e=>d(O)?O.value=e:null,name:`provider`,value:e.id,title:e.localizedName||`Unknown`,description:e.localizedDescription},null,8,[`id`,`modelValue`,`value`,`title`,`description`]))),128)),f(c,{to:`/settings/providers#transcription`,border:`2px solid`,class:`border-neutral-100 bg-white dark:border-neutral-900 hover:border-primary-500/30 dark:bg-neutral-900/20 dark:hover:border-primary-400/30`,flex:`~ col items-center justify-center`,transition:`all duration-200 ease-in-out`,relative:``,"min-w-50":``,"w-fit":``,"rounded-xl":``,"p-4":``},{default:m(()=>[...n[7]||=[_(`div`,{"i-solar:add-circle-line-duotone":``,class:`text-2xl text-neutral-500 dark:text-neutral-500`},null,-1),_(`div`,{class:`bg-dotted-neutral-200/80 dark:bg-dotted-neutral-700/50`,absolute:``,"inset-0":``,"z--1":``,style:{"background-size":`10px 10px`,"mask-image":`linear-gradient(165deg, white 30%, transparent 50%)`}},null,-1)]]),_:1})])):(i(),g(`div`,T,[f(c,{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:m(()=>[...n[8]||=[_(`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})]))])]),p(O)&&p(Ze)?(i(),g(`div`,E,[_(`div`,Oe,[_(`div`,null,[_(`h2`,ke,o(p(C)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.title`)),1),_(`div`,Ae,[_(`span`,null,o(p(C)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle`)),1)])]),p(M)?(i(),g(`div`,je,[n[9]||=_(`div`,{class:`mr-2 animate-spin`},[_(`div`,{"i-solar:spinner-line-duotone":``,"text-xl":``})],-1),_(`span`,null,o(p(C)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.loading`)),1)])):p(j)?(i(),s(p(x),{key:1,title:p(C)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.error`),error:p(j)},null,8,[`title`,`error`])):p(A).length===0&&!p(M)?(i(),s(p(ce),{key:2,type:`warning`},{title:m(()=>[a(o(p(C)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models`)),1)]),content:m(()=>[a(o(p(C)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models_description`)),1)]),_:1})):p(A).length>0?(i(),s(p(le),{key:3,modelValue:p(k),"onUpdate:modelValue":n[2]||=e=>d(k)?k.value=e:null,"search-query":p(N),"onUpdate:searchQuery":n[3]||=e=>d(N)?N.value=e:null,items:p(A).sort((e,t)=>e.id===p(k)?-1:t.id===p(k)?1:0),searchable:!0,"search-placeholder":p(C)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.search_placeholder`),"search-no-results-title":p(C)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results`),"search-no-results-description":p(C)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results_description`,{query:p(N)}),"search-results-text":p(C)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.search_results`,{count:`{count}`,total:`{total}`}),"custom-input-placeholder":p(C)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.custom_model_placeholder`),"expand-button-text":p(C)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.expand`),"collapse-button-text":p(C)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.collapse`),"onUpdate:customValue":vt},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`])):t(``,!0)])])):t(``,!0)])]),_(`div`,Me,[_(`div`,Ne,[_(`h2`,Pe,[_(`div`,Fe,[f(p(ae)),_(`div`,null,o(p(C)(`settings.pages.providers.provider.elevenlabs.playground.title`)),1)])]),z.value?(i(),s(p(x),{key:0,title:`Error occurred`,error:z.value,"mb-4":``},null,8,[`error`])):t(``,!0),f(p(ie),{class:`mb-4`,"w-full":``,onClick:gt},{default:m(()=>[a(o(B.value?`Stop Monitoring`:`Start Monitoring`),1)]),_:1}),_(`div`,null,[(i(!0),g(h,null,r(ut.value,(e,n)=>(i(),g(`div`,{key:n,class:`mb-2`},[_(`audio`,{src:e,controls:``,class:`w-full`},null,8,Ie),V.value[n]?(i(),g(`div`,Le,o(V.value[n]),1)):t(``,!0)]))),128))]),_(`div`,Re,[_(`div`,ze,[_(`div`,Be,[f(p(pe),{level:p(ct),label:`Input Level`},null,8,[`level`]),G.value&&p(Y)?(i(),s(p(oe),{key:0,value:p(q),threshold:W.value,label:`Probability of Speech`,"below-label":`Silence`,"above-label":`Speech`,"threshold-label":`Detection threshold`},null,8,[`value`,`threshold`])):t(``,!0),G.value&&p(Y)?(i(),g(`div`,Ve,[f(p(y),{modelValue:W.value,"onUpdate:modelValue":n[4]||=e=>W.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`])])):(i(),g(`div`,He,[f(p(y),{modelValue:W.value,"onUpdate:modelValue":n[5]||=e=>W.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`,Ue,[_(`div`,{class:te([`h-4 w-4 rounded-full transition-all duration-200`,_t.value])},null,2),_(`span`,We,o(Z.value?`Speaking Detected`:`Silence`),1),_(`span`,Ge,o(G.value&&p(Y)?`Model Based`:`Volume Based`),1)]),_(`div`,Ke,[f(p(re),{modelValue:G.value,"onUpdate:modelValue":n[6]||=e=>G.value=e,label:`Model Based`,description:`Use AI models for more accurate speech detection`},null,8,[`modelValue`]),G.value?(i(),g(`div`,qe,[p(ht)?(i(),g(`div`,Je,[...n[10]||=[_(`div`,{class:`animate-spin text-sm`,"i-solar:spinner-line-duotone":``},null,-1),_(`span`,{class:`text-sm`},`Loading...`,-1)]])):p(J)?(i(),s(p(x),{key:1,title:`Inference error`,error:p(J)},null,8,[`error`])):p(Y)?(i(),g(`div`,Ye,[n[11]||=_(`div`,{class:`text-sm`,"i-solar:check-circle-bold-duotone":``},null,-1),n[12]||=_(`span`,{class:`text-sm`},`Activated`,-1),_(`span`,Xe,` Probability: `+o((p(q)*100).toFixed(1))+`% `,1)])):t(``,!0)])):t(``,!0)]),G.value&&p(Y)?(i(),s(p(se),{key:3,history:p(pt),"current-value":p(q),threshold:W.value,"is-active":Z.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`])):t(``,!0)])])])])])])}}});typeof C==`function`&&C(D);var O=D;export{O as default}; \ No newline at end of file +import{A as e,C as t,G as n,J as r,K as i,O as a,Pt as o,S as s,W as c,X as l,at as ee,b as u,gt as d,jt as te,k as f,kt as p,lt as m,m as h,w as g,x as _,xt as v}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-C0YByt49.js";import{c as ne,l as y,p as re,r as ie}from"./src-DYQXbDgu.js";import{a as b}from"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{Ct as ae,St as oe,bt as se,dt as x,gt as ce,ht as le,mt as ue,o as de,s as fe,wt as pe}from"./components-CeE-UiLT.js";import{i as me}from"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import{n as he}from"./vue-i18n.runtime-Dah5zGm4.js";import"./stream-transcription-_Xuw_VzN.js";import{D as ge,r as S}from"./settings-73vyHOZs.js";import"./__vite-browser-external-BaycPy5b.js";import{n as _e,t as ve}from"./hearing-BH9rth_f.js";import"./transformers.web-DAjDoeaJ.js";import{t as C}from"./route-block-CpjdOEnv.js";import{t as ye}from"./process.worklet-Cmmnc6Go.js";import{t as be}from"./composables-eN7drneV.js";var xe={flex:`~ col md:row gap-6`},Se={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%]`},Ce={flex:`~ col gap-4`},we={flex:`~ col gap-4`},Te={class:`text-lg text-neutral-500 md:text-2xl dark:text-neutral-500`},Ee={text:`neutral-400 dark:neutral-400`},De={"max-w-full":``},w={key:0,flex:`~ row gap-4`,style:{"scrollbar-width":`none`},"min-w-0":``,"of-x-scroll":``,"scroll-smooth":``,role:`radiogroup`},T={key:1},E={key:0},Oe={flex:`~ col gap-4`},ke={class:`text-lg md:text-2xl`},Ae={text:`neutral-400 dark:neutral-400`},je={key:0,class:`flex items-center justify-center py-4`},Me={flex:`~ col gap-6`,class:`w-full md:w-[60%]`},Ne={"w-full":``,"rounded-xl":``},Pe={class:`mb-4 text-lg text-neutral-500 md:text-2xl dark:text-neutral-400`,"w-full":``},Fe={class:`inline-flex items-center gap-4`},Ie=[`src`],Le={key:0,class:`mt-2 text-sm text-neutral-500 dark:text-neutral-400`},Re={flex:`~ col gap-4`},ze={class:`space-y-4`},Be={class:`space-y-3`},Ve={key:1,class:`space-y-3`},He={key:2,class:`space-y-3`},Ue={class:`flex items-center gap-3`},We={class:`text-sm font-medium`},Ge={class:`ml-auto text-xs text-neutral-500`},Ke={class:`border-t border-neutral-200 pt-3 dark:border-neutral-700`},qe={key:0,class:`mt-3 space-y-2`},Je={key:0,class:`flex items-center gap-2 text-primary-600 dark:text-primary-400`},Ye={key:2,class:`flex items-center gap-2 text-green-600 dark:text-green-400`},Xe={class:`ml-auto text-xs text-neutral-500`},D=e({__name:`hearing`,setup(e){let{t:C}=he(),D=_e(),{activeTranscriptionProvider:O,activeTranscriptionModel:k,providerModels:A,activeProviderModelError:j,isLoadingActiveProviderModels:M,supportsModelListing:Ze,transcriptionModelSearchQuery:N,activeCustomModelName:Qe}=b(D),{configuredTranscriptionProvidersMetadata:P}=b(me()),{stopStream:$e,startStream:et}=S(),{audioInputs:tt,selectedAudioInput:F,stream:I}=b(S()),{startRecord:nt,stopRecord:rt,onStopRecord:it}=de(I),{startAnalyzer:at,stopAnalyzer:ot,onAnalyzerUpdate:st,volumeLevel:ct}=fe(),{audioContext:L}=b(ge()),{transcribeForRecording:lt}=ve(),R=v(),z=v(``),B=v(!1),V=v([]),H=v([]),U=v([]),ut=u(()=>H.value.map(e=>{let t=URL.createObjectURL(e);return U.value.push(()=>URL.revokeObjectURL(t)),t})),W=v(.6),G=v(!0),{init:dt,dispose:K,isSpeech:ft,isSpeechProb:q,isSpeechHistory:pt,inferenceError:J,start:mt,loaded:Y,loading:ht}=be(ye,{threshold:W,onSpeechStart:()=>nt(),onSpeechEnd:()=>rt()}),X=v(!1),Z=u(()=>G.value&&Y.value?ft.value:X.value);async function Q(){try{if(!F.value){console.warn(`No audio input device selected`);return}if(await $(),await et(),!I.value){console.warn(`No audio stream available`);return}let e=L.value.createMediaStreamSource(I.value),t=at(L.value);st(e=>{(!G.value||!Y.value)&&(X.value=e>W.value)}),t&&e.connect(t),G.value&&(await dt(),await mt(I.value))}catch(e){console.error(`Error setting up audio monitoring:`,e),J.value=e instanceof Error?e.message:String(e)}}async function $(){R.value&&=(cancelAnimationFrame(R.value),void 0),I.value&&$e(),ot(),K()}async function gt(){B.value?(await $(),B.value=!1):(await Q(),B.value=!0)}let _t=u(()=>{if(!G.value||!Y.value)return X.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=q.value,t=W.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`});function vt(e){Qe.value=e}return it(async e=>{e&&e.size>0&&H.value.push(e);let t=await lt(e);t&&V.value.push(t)}),ee(F,async()=>B.value&&await Q()),c(async()=>{await D.loadModelsForProvider(O.value)}),n(()=>{$(),K(),U.value.forEach(e=>e())}),(e,n)=>{let c=l(`RouterLink`);return i(),g(`div`,xe,[_(`div`,Se,[_(`div`,Ce,[_(`div`,null,[f(p(ne),{modelValue:p(F),"onUpdate:modelValue":n[0]||=e=>d(F)?F.value=e:null,label:`Audio Input Device`,description:`Select the audio input device for your hearing module.`,options:p(tt).map(e=>({label:e.label||e.deviceId,value:e.deviceId})),placeholder:`Select an audio input device`,layout:`vertical`},null,8,[`modelValue`,`options`])]),_(`div`,we,[_(`div`,null,[_(`h2`,Te,o(p(C)(`settings.pages.providers.title`)),1),_(`div`,Ee,[_(`span`,null,o(p(C)(`settings.pages.modules.hearing.sections.section.provider-selection.description`)),1)])]),_(`div`,De,[p(P).length>0?(i(),g(`fieldset`,w,[(i(!0),g(h,null,r(p(P),e=>(i(),s(p(ue),{id:e.id,key:e.id,modelValue:p(O),"onUpdate:modelValue":n[1]||=e=>d(O)?O.value=e:null,name:`provider`,value:e.id,title:e.localizedName||`Unknown`,description:e.localizedDescription},null,8,[`id`,`modelValue`,`value`,`title`,`description`]))),128)),f(c,{to:`/settings/providers#transcription`,border:`2px solid`,class:`border-neutral-100 bg-white dark:border-neutral-900 hover:border-primary-500/30 dark:bg-neutral-900/20 dark:hover:border-primary-400/30`,flex:`~ col items-center justify-center`,transition:`all duration-200 ease-in-out`,relative:``,"min-w-50":``,"w-fit":``,"rounded-xl":``,"p-4":``},{default:m(()=>[...n[7]||=[_(`div`,{"i-solar:add-circle-line-duotone":``,class:`text-2xl text-neutral-500 dark:text-neutral-500`},null,-1),_(`div`,{class:`bg-dotted-neutral-200/80 dark:bg-dotted-neutral-700/50`,absolute:``,"inset-0":``,"z--1":``,style:{"background-size":`10px 10px`,"mask-image":`linear-gradient(165deg, white 30%, transparent 50%)`}},null,-1)]]),_:1})])):(i(),g(`div`,T,[f(c,{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:m(()=>[...n[8]||=[_(`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})]))])]),p(O)&&p(Ze)?(i(),g(`div`,E,[_(`div`,Oe,[_(`div`,null,[_(`h2`,ke,o(p(C)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.title`)),1),_(`div`,Ae,[_(`span`,null,o(p(C)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle`)),1)])]),p(M)?(i(),g(`div`,je,[n[9]||=_(`div`,{class:`mr-2 animate-spin`},[_(`div`,{"i-solar:spinner-line-duotone":``,"text-xl":``})],-1),_(`span`,null,o(p(C)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.loading`)),1)])):p(j)?(i(),s(p(x),{key:1,title:p(C)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.error`),error:p(j)},null,8,[`title`,`error`])):p(A).length===0&&!p(M)?(i(),s(p(ce),{key:2,type:`warning`},{title:m(()=>[a(o(p(C)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models`)),1)]),content:m(()=>[a(o(p(C)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models_description`)),1)]),_:1})):p(A).length>0?(i(),s(p(le),{key:3,modelValue:p(k),"onUpdate:modelValue":n[2]||=e=>d(k)?k.value=e:null,"search-query":p(N),"onUpdate:searchQuery":n[3]||=e=>d(N)?N.value=e:null,items:p(A).sort((e,t)=>e.id===p(k)?-1:t.id===p(k)?1:0),searchable:!0,"search-placeholder":p(C)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.search_placeholder`),"search-no-results-title":p(C)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results`),"search-no-results-description":p(C)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results_description`,{query:p(N)}),"search-results-text":p(C)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.search_results`,{count:`{count}`,total:`{total}`}),"custom-input-placeholder":p(C)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.custom_model_placeholder`),"expand-button-text":p(C)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.expand`),"collapse-button-text":p(C)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.collapse`),"onUpdate:customValue":vt},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`])):t(``,!0)])])):t(``,!0)])]),_(`div`,Me,[_(`div`,Ne,[_(`h2`,Pe,[_(`div`,Fe,[f(p(ae)),_(`div`,null,o(p(C)(`settings.pages.providers.provider.elevenlabs.playground.title`)),1)])]),z.value?(i(),s(p(x),{key:0,title:`Error occurred`,error:z.value,"mb-4":``},null,8,[`error`])):t(``,!0),f(p(ie),{class:`mb-4`,"w-full":``,onClick:gt},{default:m(()=>[a(o(B.value?`Stop Monitoring`:`Start Monitoring`),1)]),_:1}),_(`div`,null,[(i(!0),g(h,null,r(ut.value,(e,n)=>(i(),g(`div`,{key:n,class:`mb-2`},[_(`audio`,{src:e,controls:``,class:`w-full`},null,8,Ie),V.value[n]?(i(),g(`div`,Le,o(V.value[n]),1)):t(``,!0)]))),128))]),_(`div`,Re,[_(`div`,ze,[_(`div`,Be,[f(p(pe),{level:p(ct),label:`Input Level`},null,8,[`level`]),G.value&&p(Y)?(i(),s(p(oe),{key:0,value:p(q),threshold:W.value,label:`Probability of Speech`,"below-label":`Silence`,"above-label":`Speech`,"threshold-label":`Detection threshold`},null,8,[`value`,`threshold`])):t(``,!0),G.value&&p(Y)?(i(),g(`div`,Ve,[f(p(y),{modelValue:W.value,"onUpdate:modelValue":n[4]||=e=>W.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`])])):(i(),g(`div`,He,[f(p(y),{modelValue:W.value,"onUpdate:modelValue":n[5]||=e=>W.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`,Ue,[_(`div`,{class:te([`h-4 w-4 rounded-full transition-all duration-200`,_t.value])},null,2),_(`span`,We,o(Z.value?`Speaking Detected`:`Silence`),1),_(`span`,Ge,o(G.value&&p(Y)?`Model Based`:`Volume Based`),1)]),_(`div`,Ke,[f(p(re),{modelValue:G.value,"onUpdate:modelValue":n[6]||=e=>G.value=e,label:`Model Based`,description:`Use AI models for more accurate speech detection`},null,8,[`modelValue`]),G.value?(i(),g(`div`,qe,[p(ht)?(i(),g(`div`,Je,[...n[10]||=[_(`div`,{class:`animate-spin text-sm`,"i-solar:spinner-line-duotone":``},null,-1),_(`span`,{class:`text-sm`},`Loading...`,-1)]])):p(J)?(i(),s(p(x),{key:1,title:`Inference error`,error:p(J)},null,8,[`error`])):p(Y)?(i(),g(`div`,Ye,[n[11]||=_(`div`,{class:`text-sm`,"i-solar:check-circle-bold-duotone":``},null,-1),n[12]||=_(`span`,{class:`text-sm`},`Activated`,-1),_(`span`,Xe,` Probability: `+o((p(q)*100).toFixed(1))+`% `,1)])):t(``,!0)])):t(``,!0)]),G.value&&p(Y)?(i(),s(p(se),{key:3,history:p(pt),"current-value":p(q),threshold:W.value,"is-active":Z.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`])):t(``,!0)])])])])])])}}});typeof C==`function`&&C(D);var O=D;export{O as default}; \ No newline at end of file diff --git a/assets/index-L0ZWxoOt.js b/assets/index-CbpKegAc.js similarity index 91% rename from assets/index-L0ZWxoOt.js rename to assets/index-CbpKegAc.js index cc44f5f78f153d5ea8f6fa9aa73ccfd48109ec87..4d9d94ffbb872ba33bf3351f1a2eedd1385aedb8 100644 --- a/assets/index-L0ZWxoOt.js +++ b/assets/index-CbpKegAc.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/default-CTPUQ2Uf.js","assets/HeaderLink-CNK9co0e.js","assets/_plugin-vue_export-helper-DGA9ry_j.js","assets/src-DYQXbDgu.js","assets/vue.runtime.esm-bundler-_ZPRHVd_.js","assets/chunk-B78Zgmat.js","assets/dist-Che88T83.js","assets/src-CO8_9JkB.css","assets/vue-router-Chhv6vZu.js","assets/HeaderLink-CO18o3XU.css","assets/home-BH9GCqHR.js","assets/plain-B9tCnS2r.js","assets/settings-C2pLQvYa.js","assets/theme-color-CCXuu6C1.js","assets/merge-BvxP9iBC.js","assets/sleep-CkgWku9y.js","assets/stream-transcription-_Xuw_VzN.js","assets/index.browser-Dc5HQ32a.js","assets/vue-i18n.runtime-Dah5zGm4.js","assets/settings-D1kLcsvA.js","assets/src-C83SCWbW.js","assets/resettable-CbXzRviW.js","assets/components-BR_Kqwtu.js","assets/preload-helper-Dn1uWANL.js","assets/widgets-CZ9Rvki9.js","assets/DialogTitle-ytlEE0A-.js","assets/widgets-CeetJ7Oc.css","assets/speech-6W29lyZ_.js","assets/webgpu-C-1YCssS.js","assets/environment-CyZLTg97.js","assets/purify.es-Dld0-TNF.js","assets/output-C8zlODy6.js","assets/__vite-browser-external-BaycPy5b.js","assets/components-DBIH4UgO.css","assets/stage-DZQk1vzw.js","assets/pages-JQnTlB9Y.js","assets/route-block-CpjdOEnv.js","assets/scenes-Ct-xUphs.js","assets/import-url-browser-DRsAP6zH.js","assets/duckdb-mvp-BP8S3C4a.js","assets/src-BccD0BFR.js","assets/browser-DY5K31Vk.js","assets/tres-B5z5lcdF.js","assets/beat-sync-GCfX3UHH.js","assets/live2d-DukystQI.js","assets/chat-CSFza6dY.js","assets/index-Cx_srAfm-DhadnX4q.js","assets/core-Bb6Rlujp.js","assets/llmmarkerParser-CpinDrSK.js","assets/airi-card-DuhaYjQU.js","assets/transformers.web-DAjDoeaJ.js","assets/composables-eN7drneV.js","assets/hearing-BH9rth_f.js","assets/dist-CB18iuyA.js","assets/process.worklet-Cmmnc6Go.js","assets/Basic-EclD3L6X.js","assets/pages-BHkaRTzj.css","assets/_...all_-fHhcuF9K.js","assets/audio-record-DfNNs2vE.js","assets/background-gradient-blending-DV35Xxp1.js","assets/browser-2lyKKTPE.js","assets/BasicInputFile-C2AMSzxu.js","assets/background-gradient-blending-B88qVe8m.css","assets/background-removal-SpmG5Lvm.js","assets/InputFile-CjPYZ8S-.js","assets/beat-sync-DNJSgBlH.js","assets/gesture-circle-Dz-6GhkK.js","assets/image-CCjIWUuW.js","assets/image-DolN1ewS.css","assets/polaroid-CqSaE7FQ.js","assets/providers-transcription-realtime-aliyun-nls-5fvDNN_K.js","assets/use-magic-keys-NMOzQ56z.js","assets/vibrant-DaA7KX3v.js","assets/settings-B7G0W455.js","assets/use-ripple-grid-state-DcESPJAf.js","assets/airi-card-BeLYaKHl.js","assets/CardCreationDialog-B2njkXhJ.js","assets/CardCreationDialog-BEG0qYyE.css","assets/DeleteCardDialog-Bby7Qwvm.js","assets/CardCreate-CdxiTrqh.js","assets/CardDetailDialog-BFPxHsY4.js","assets/CardListItem-CyBP3HUt.js","assets/CardCreate-CQTxdn4D.js","assets/CardCreationDialog-cN7py1P6.js","assets/CardDetailDialog-CsobWwkt.js","assets/CardListItem-CbOMiA5T.js","assets/DeleteCardDialog-DkR1Cc9E.js","assets/data-CBvyhmZq.js","assets/onboarding-DCg6WaMD.js","assets/memory-BtlxAq98.js","assets/models-CcEJuOe_.js","assets/modules-pq5SkWez.js","assets/beat-sync-HWqNDh-f.js","assets/consciousness-OW8mu5uI.js","assets/gaming-factorio-SBqYhlLF.js","assets/gaming-minecraft-DqVnVTyA.js","assets/hearing-CzJ5MFBH.js","assets/memory-long-term-CtgFbvBe.js","assets/memory-short-term-Dgai2Btn.js","assets/messaging-discord-BMzg_O9F.js","assets/speech-DH-rHMWX.js","assets/vision-DhhLFD5o.js","assets/x-CfzkhX9_.js","assets/providers-CP--1bBf.js","assets/_providerId_-CIYsM20M.js","assets/use-provider-validation-DbXr83wX.js","assets/azure-ai-foundry-DEqvloeQ.js","assets/cloudflare-workers-ai-BgN6F-61.js","assets/lm-studio-Cu1JvZVB.js","assets/ollama-B5mymzO5.js","assets/alibaba-cloud-model-studio-Bs3uT3_h.js","assets/comet-api-speech-Dfu-r2Ac.js","assets/elevenlabs-DdLCiM18.js","assets/index-tts-vllm-CnKZjGZI.js","assets/microsoft-speech-DXFkeIFV.js","assets/openai-audio-speech-CK11JEyg.js","assets/openai-compatible-audio-speech-Dg21-D2M.js","assets/player2-speech-DRfVfleA.js","assets/volcengine-CwHpcYQ0.js","assets/aliyun-nls-transcription-ThiG_Ak6.js","assets/comet-api-transcription-BxkdP1WS.js","assets/openai-audio-transcription-C9jVbePt.js","assets/openai-compatible-audio-transcription-DQYIeBVK.js","assets/scene-NwOIl7WX.js","assets/system-BRtfNILC.js","assets/color-scheme-0i0L0wxO.js","assets/color-scheme-B_nVc7uH.css","assets/developer-Da1vuucL.js","assets/general-Bvs5oF0L.js"])))=>i.map(i=>d[i]); -import{o as e,t}from"./chunk-B78Zgmat.js";import{A as n,B as r,C as i,D as a,G as o,H as s,I as c,J as l,K as u,Mt as d,Nt as f,O as p,Pt as m,Q as h,S as g,W as _,Y as v,at as y,b,et as ee,gt as x,h as S,i as te,jt as C,k as w,kt as T,lt as E,m as D,ot as O,w as k,wt as A,x as j,xt as M,z as ne}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import{r as re}from"./tres-B5z5lcdF.js";import{C as N}from"./widgets-CZ9Rvki9.js";import{t as ie}from"./src-DYQXbDgu.js";import{a as ae,i as P,r as F}from"./resettable-CbXzRviW.js";import{n as oe,t as I}from"./preload-helper-Dn1uWANL.js";import{i as se,n as ce,o as le,r as ue}from"./vue-router-Chhv6vZu.js";import"./environment-CyZLTg97.js";import{t as L}from"./_plugin-vue_export-helper-DGA9ry_j.js";import{a as de,i as fe,t as R}from"./dist-Che88T83.js";import"./src-C83SCWbW.js";import{ct as pe,r as me,t as he}from"./components-BR_Kqwtu.js";import"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import{n as ge,t as _e}from"./vue-i18n.runtime-Dah5zGm4.js";import"./stream-transcription-_Xuw_VzN.js";import{E as ve,a as ye,n as z}from"./settings-D1kLcsvA.js";import"./__vite-browser-external-BaycPy5b.js";import{t as be}from"./onboarding-DCg6WaMD.js";import{n as xe,t as Se}from"./chat-CSFza6dY.js";import"./airi-card-DuhaYjQU.js";import"./hearing-BH9rth_f.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var Ce=e(t(((e,t)=>{(function(n,r){typeof define==`function`&&define.amd?define(r):typeof e==`object`?t.exports=r():n.NProgress=r()})(e,function(){var e={};e.version=`0.2.0`;var t=e.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:`
`};e.configure=function(e){var n,r;for(n in e)r=e[n],r!==void 0&&e.hasOwnProperty(n)&&(t[n]=r);return this},e.status=null,e.set=function(r){var s=e.isStarted();r=n(r,t.minimum,1),e.status=r===1?null:r;var c=e.render(!s),l=c.querySelector(t.barSelector),u=t.speed,d=t.easing;return c.offsetWidth,a(function(n){t.positionUsing===``&&(t.positionUsing=e.getPositioningCSS()),o(l,i(r,u,d)),r===1?(o(c,{transition:`none`,opacity:1}),c.offsetWidth,setTimeout(function(){o(c,{transition:`all `+u+`ms linear`,opacity:0}),setTimeout(function(){e.remove(),n()},u)},u)):setTimeout(n,u)}),this},e.isStarted=function(){return typeof e.status==`number`},e.start=function(){e.status||e.set(0);var n=function(){setTimeout(function(){e.status&&(e.trickle(),n())},t.trickleSpeed)};return t.trickle&&n(),this},e.done=function(t){return!t&&!e.status?this:e.inc(.3+.5*Math.random()).set(1)},e.inc=function(t){var r=e.status;return r?(typeof t!=`number`&&(t=(1-r)*n(Math.random()*r,.1,.95)),r=n(r+t,0,.994),e.set(r)):e.start()},e.trickle=function(){return e.inc(Math.random()*t.trickleRate)},(function(){var t=0,n=0;e.promise=function(r){return!r||r.state()===`resolved`?this:(n===0&&e.start(),t++,n++,r.always(function(){n--,n===0?(t=0,e.done()):e.set((t-n)/t)}),this)}})(),e.render=function(n){if(e.isRendered())return document.getElementById(`nprogress`);c(document.documentElement,`nprogress-busy`);var i=document.createElement(`div`);i.id=`nprogress`,i.innerHTML=t.template;var a=i.querySelector(t.barSelector),s=n?`-100`:r(e.status||0),l=document.querySelector(t.parent),u;return o(a,{transition:`all 0 linear`,transform:`translate3d(`+s+`%,0,0)`}),t.showSpinner||(u=i.querySelector(t.spinnerSelector),u&&d(u)),l!=document.body&&c(l,`nprogress-custom-parent`),l.appendChild(i),i},e.remove=function(){l(document.documentElement,`nprogress-busy`),l(document.querySelector(t.parent),`nprogress-custom-parent`);var e=document.getElementById(`nprogress`);e&&d(e)},e.isRendered=function(){return!!document.getElementById(`nprogress`)},e.getPositioningCSS=function(){var e=document.body.style,t=`WebkitTransform`in e?`Webkit`:`MozTransform`in e?`Moz`:`msTransform`in e?`ms`:`OTransform`in e?`O`:``;return t+`Perspective`in e?`translate3d`:t+`Transform`in e?`translate`:`margin`};function n(e,t,n){return en?n:e}function r(e){return(-1+e)*100}function i(e,n,i){var a=t.positionUsing===`translate3d`?{transform:`translate3d(`+r(e)+`%,0,0)`}:t.positionUsing===`translate`?{transform:`translate(`+r(e)+`%,0)`}:{"margin-left":r(e)+`%`};return a.transition=`all `+n+`ms `+i,a}var a=(function(){var e=[];function t(){var n=e.shift();n&&n(t)}return function(n){e.push(n),e.length==1&&t()}})(),o=(function(){var e=[`Webkit`,`O`,`Moz`,`ms`],t={};function n(e){return e.replace(/^-ms-/,`ms-`).replace(/-([\da-z])/gi,function(e,t){return t.toUpperCase()})}function r(t){var n=document.body.style;if(t in n)return t;for(var r=e.length,i=t.charAt(0).toUpperCase()+t.slice(1),a;r--;)if(a=e[r]+i,a in n)return a;return t}function i(e){return e=n(e),t[e]||(t[e]=r(e))}function a(e,t,n){t=i(t),e.style[t]=n}return function(e,t){var n=arguments,r,i;if(n.length==2)for(r in t)i=t[r],i!==void 0&&t.hasOwnProperty(r)&&a(e,r,i);else a(e,n[1],n[2])}})();function s(e,t){return(typeof e==`string`?e:u(e)).indexOf(` `+t+` `)>=0}function c(e,t){var n=u(e),r=n+t;s(n,t)||(e.className=r.substring(1))}function l(e,t){var n=u(e),r;s(e,t)&&(r=n.replace(` `+t+` `,` `),e.className=r.substring(1,r.length-1))}function u(e){return(` `+(e.className||``)+` `).replace(/\s+/gi,` `)}function d(e){e&&e.parentNode&&e.parentNode.removeChild(e)}return e})}))(),1),we=new Set,B=new WeakMap,V=new WeakMap,H=new WeakMap,Te=new WeakMap,Ee=new WeakMap,De=new WeakMap,U=new WeakMap,W=new WeakMap,G=new WeakSet,K,Oe=0,ke=0,q=`__aa_tgt`,Ae=`__aa_del`,je=`__aa_new`,Me=e=>{let t=Be(e);t&&t.forEach(e=>He(e))},Ne=e=>{e.forEach(e=>{e.target===K&&Ie(),B.has(e.target)&&J(e.target)})};function Pe(e){let t=e.getBoundingClientRect(),n=K?.clientWidth||0,r=K?.clientHeight||0;return t.bottom<0||t.top>r||t.right<0||t.left>n}function Fe(e){Te.get(e)?.disconnect();let t=B.get(e),n=0;t||(t=Z(e),B.set(e,t));let{offsetWidth:r,offsetHeight:i}=K,a=[t.top-5,r-(t.left+5+t.width),i-(t.top+5+t.height),t.left-5].map(e=>`${-1*Math.floor(e)}px`).join(` `),o=new IntersectionObserver(()=>{++n>1&&J(e)},{root:K,threshold:1,rootMargin:a});o.observe(e),Te.set(e,o)}function J(e,t=!0){clearTimeout(W.get(e));let n=Ge(e),r=t?Xe(n)?500:n.duration:0;W.set(e,setTimeout(async()=>{let t=H.get(e);try{await t?.finished,B.set(e,Z(e)),Fe(e)}catch{}},r))}function Ie(){clearTimeout(W.get(K)),W.set(K,setTimeout(()=>{we.forEach(e=>Je(e,e=>Re(()=>J(e))))},100))}function Le(e){setTimeout(()=>{De.set(e,setInterval(()=>Re(J.bind(null,e)),2e3))},Math.round(2e3*Math.random()))}function Re(e){typeof requestIdleCallback==`function`?requestIdleCallback(()=>e()):requestAnimationFrame(()=>e())}var Y,ze=typeof window<`u`&&`ResizeObserver`in window;ze&&(K=document.documentElement,new MutationObserver(Me),Y=new ResizeObserver(Ne),window.addEventListener(`scroll`,()=>{ke=window.scrollY,Oe=window.scrollX}),Y.observe(K));function Be(e){return e.reduce((e,t)=>[...e,...Array.from(t.addedNodes),...Array.from(t.removedNodes)],[]).every(e=>e.nodeName===`#comment`)?!1:e.reduce((e,t)=>{if(e===!1)return!1;if(t.target instanceof Element){if(Ve(t.target),!e.has(t.target)){e.add(t.target);for(let n=0;nt(e,U.has(e)));for(let n=0;ne(r,U.has(r)))}}function Ye(e){return Array.isArray(e)?e:[e]}function Xe(e){return typeof e==`function`}function Ze(e){let t=B.get(e),n=Z(e);if(!qe(e))return B.set(e,n);if(Pe(e)){B.set(e,n),Fe(e);return}let r;if(!t)return;let i=Ge(e);if(typeof i!=`function`){let a=t.left-n.left,o=t.top-n.top,s=t.left+t.width-(n.left+n.width);t.top+t.height-(n.top+n.height)==0&&(o=0),s==0&&(a=0);let[c,l,u,d]=We(e,t,n),f={transform:`translate(${a}px, ${o}px)`},p={transform:`translate(0, 0)`};c!==l&&(f.width=`${c}px`,p.width=`${l}px`),u!==d&&(f.height=`${u}px`,p.height=`${d}px`),r=e.animate([f,p],{duration:i.duration,easing:i.easing})}else{let[a]=Ye(i(e,`remain`,t,n));r=new Animation(a),r.play()}H.set(e,r),B.set(e,n),r.addEventListener(`finish`,J.bind(null,e,!1),{once:!0})}function Qe(e){je in e&&delete e[je];let t=Z(e);B.set(e,t);let n=Ge(e);if(!qe(e))return;if(Pe(e)){Fe(e);return}let r;if(typeof n!=`function`)r=e.animate([{transform:`scale(.98)`,opacity:0},{transform:`scale(0.98)`,opacity:0,offset:.5},{transform:`scale(1)`,opacity:1}],{duration:n.duration*1.5,easing:`ease-in`});else{let[i]=Ye(n(e,`add`,t));r=new Animation(i),r.play()}H.set(e,r),r.addEventListener(`finish`,J.bind(null,e,!1),{once:!0})}function $e(e,t){var n;e.remove(),B.delete(e),V.delete(e),H.delete(e),(n=Te.get(e))==null||n.disconnect(),setTimeout(()=>{if(Ae in e&&delete e[Ae],Object.defineProperty(e,je,{value:!0,configurable:!0}),t&&e instanceof HTMLElement)for(let n in t)e.style[n]=``},0)}function et(e){var t;if(!V.has(e)||!B.has(e))return;let[n,r]=V.get(e);Object.defineProperty(e,Ae,{value:!0,configurable:!0});let i=window.scrollX,a=window.scrollY;if(r&&r.parentNode&&r.parentNode instanceof Element?r.parentNode.insertBefore(e,r):n&&n.parentNode?n.parentNode.appendChild(e):(t=Ke(e))==null||t.appendChild(e),!qe(e))return $e(e);let[o,s,c,l]=nt(e),u=Ge(e),d=B.get(e);(i!==Oe||a!==ke)&&tt(e,i,a,u);let f,p={position:`absolute`,top:`${o}px`,left:`${s}px`,width:`${c}px`,height:`${l}px`,margin:`0`,pointerEvents:`none`,transformOrigin:`center`,zIndex:`100`};if(!Xe(u))Object.assign(e.style,p),f=e.animate([{transform:`scale(1)`,opacity:1},{transform:`scale(.98)`,opacity:0}],{duration:u.duration,easing:`ease-out`});else{let[t,n]=Ye(u(e,`remove`,d));n?.styleReset!==!1&&(p=n?.styleReset||p,Object.assign(e.style,p)),f=new Animation(t),f.play()}H.set(e,f),f.addEventListener(`finish`,()=>$e(e,p),{once:!0})}function tt(e,t,n,r){let i=Oe-t,a=ke-n,o=document.documentElement.style.scrollBehavior;if(getComputedStyle(K).scrollBehavior===`smooth`&&(document.documentElement.style.scrollBehavior=`auto`),window.scrollTo(window.scrollX+i,window.scrollY+a),!e.parentElement)return;let s=e.parentElement,c=s.clientHeight,l=s.clientWidth,u=performance.now();function d(){requestAnimationFrame(()=>{if(!Xe(r)){let e=c-s.clientHeight,t=l-s.clientWidth;u+r.duration>performance.now()?(window.scrollTo({left:window.scrollX-t,top:window.scrollY-e}),c=s.clientHeight,l=s.clientWidth,d()):document.documentElement.style.scrollBehavior=o}})}d()}function nt(e){let t=B.get(e),[n,,r]=We(e,t,Z(e)),i=e.parentElement;for(;i&&(getComputedStyle(i).position===`static`||i instanceof HTMLBodyElement);)i=i.parentElement;i||=document.body;let a=getComputedStyle(i),o=!H.has(e)||H.get(e)?.playState===`finished`?Z(i):B.get(i);return[Math.round(t.top-o.top)-X(a.borderTopWidth),Math.round(t.left-o.left)-X(a.borderLeftWidth),n,r]}function rt(e,t={}){if(ze&&Y&&!(window.matchMedia(`(prefers-reduced-motion: reduce)`).matches&&!Xe(t)&&!t.disrespectUserMotionPreference)){G.add(e),getComputedStyle(e).position===`static`&&Object.assign(e.style,{position:`relative`}),Je(e,J,Le,e=>Y?.observe(e)),Xe(t)?U.set(e,t):U.set(e,{duration:250,easing:`ease-in-out`,...t});let n=new MutationObserver(Me);n.observe(e,{childList:!0}),Ee.set(e,n),we.add(e)}return Object.freeze({parent:e,enable:()=>{G.add(e)},disable:()=>{G.delete(e),Je(e,e=>{let t=H.get(e);try{t?.cancel()}catch{}H.delete(e);let n=W.get(e);n&&clearTimeout(n),W.delete(e);let r=De.get(e);r&&clearInterval(r),De.delete(e)})},isEnabled:()=>G.has(e),destroy:()=>{G.delete(e),we.delete(e),U.delete(e),Ee.get(e)?.disconnect(),Ee.delete(e),Je(e,e=>{Y?.unobserve(e);let t=H.get(e);try{t?.cancel()}catch{}H.delete(e),Te.get(e)?.disconnect(),Te.delete(e);let n=De.get(e);n&&clearInterval(n),De.delete(e);let r=W.get(e);r&&clearTimeout(r),W.delete(e),B.delete(e),V.delete(e)})}})}function it(e){return{mounted(t,n){let r={},i=n.value;r=typeof i==`function`?i:typeof e==`function`?e:{...e||{},...i||{}};let a=rt(t,r);Object.defineProperty(t,`__aa_ctl`,{value:a,configurable:!0})},unmounted(e){var t;let n=e.__aa_ctl;(t=n?.destroy)==null||t.call(n);try{delete e.__aa_ctl}catch{}},getSSRProps:()=>({})}}var at={install(e,t){e.directive(`auto-animate`,it(t))}};oe();const ot=e=>{let t={};Object.entries({"/src/layouts/default.vue":()=>I(()=>import(`./default-CTPUQ2Uf.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9])),"/src/layouts/home.vue":()=>I(()=>import(`./home-BH9GCqHR.js`),__vite__mapDeps([10,4,5,8])),"/src/layouts/plain.vue":()=>I(()=>import(`./plain-B9tCnS2r.js`),__vite__mapDeps([11,2,4,5])),"/src/layouts/settings.vue":()=>I(()=>import(`./settings-C2pLQvYa.js`),__vite__mapDeps([12,1,2,3,4,5,6,7,8,9,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33])),"/src/layouts/stage.vue":()=>I(()=>import(`./stage-DZQk1vzw.js`),__vite__mapDeps([34,4,5,8]))}).forEach(([e,n])=>{let r=e.replace(`/src/layouts/`,``).replace(`.vue`,``);t[r]=n});function n(e,r=!0){return e.map(e=>{if(e.children?.length>0&&(e.children=n(e.children,!1)),r){if(!e.component&&e.children?.find(e=>(e.path===``||e.path===`/`)&&e.meta?.isLayout))return e;if(e.meta?.layout!==!1)return{path:e.path,component:t[e.meta?.layout||`default`],children:e.path===`/`?[e]:[{...e,path:``}],meta:{isLayout:!0}}}return e.meta?.layout?{path:e.path,component:t[e.meta?.layout],children:[{...e,path:``}],meta:{isLayout:!0}}:e})}return n(e)};oe();const st=[{path:`/`,name:`IndexScenePage`,component:()=>I(()=>import(`./pages-JQnTlB9Y.js`),__vite__mapDeps([35,2,36,1,3,4,5,6,7,8,9,13,14,15,37,23,16,17,38,39,19,20,21,40,41,29,25,42,24,26,43,44,22,18,27,28,30,31,32,33,45,46,47,48,49,50,51,52,53,54,55,56])),meta:{layout:`stage`,stageTransition:{name:`bubble-wave-out`}}},{path:`/:all(.*)`,name:`/[...all]`,component:()=>I(()=>import(`./_...all_-fHhcuF9K.js`),__vite__mapDeps([57,3,2,4,5,6,7,8]))},{path:`/devtools`,children:[{path:`audio-record`,name:`/devtools/audio-record`,component:()=>I(()=>import(`./audio-record-DfNNs2vE.js`),__vite__mapDeps([58,4,5,6,31,32]))},{path:`background-gradient-blending`,name:`/devtools/background-gradient-blending`,component:()=>I(()=>import(`./background-gradient-blending-DV35Xxp1.js`),__vite__mapDeps([59,2,13,3,4,5,6,7,14,15,60,20,61,62]))},{path:`background-removal`,name:`/devtools/background-removal`,component:()=>I(()=>import(`./background-removal-SpmG5Lvm.js`),__vite__mapDeps([63,3,2,4,5,6,7,50,23,28,64,61]))},{path:`beat-sync`,name:`/devtools/beat-sync`,component:()=>I(()=>import(`./beat-sync-DNJSgBlH.js`),__vite__mapDeps([65,16,14,17,3,2,4,5,6,7,19,20,21,22,23,18,15,24,25,8,26,27,28,29,30,31,32,33,43]))},{path:`gesture-circle`,name:`/devtools/gesture-circle`,component:()=>I(()=>import(`./gesture-circle-Dz-6GhkK.js`),__vite__mapDeps([66,36,4,5,6])),meta:{layout:`plain`}},{path:`image`,name:`/devtools/image`,component:()=>I(()=>import(`./image-CCjIWUuW.js`),__vite__mapDeps([67,2,4,5,6,68]))},{path:`polaroid`,name:`/devtools/polaroid`,component:()=>I(()=>import(`./polaroid-CqSaE7FQ.js`),__vite__mapDeps([69,37,23,5,16,14,17,38,39,3,2,4,6,7,19,20,21,40,41,29,25,42,24,8,26,43,44,22,18,15,27,28,30,31,32,33,45,46,47,48,49,52,53]))},{path:`providers-transcription-realtime-aliyun-nls`,name:`/devtools/providers-transcription-realtime-aliyun-nls`,component:()=>I(()=>import(`./providers-transcription-realtime-aliyun-nls-5fvDNN_K.js`),__vite__mapDeps([70,36,16,14,17,3,2,4,5,6,7,53,54])),meta:{layout:`settings`}},{path:`use-magic-keys`,name:`/devtools/use-magic-keys`,component:()=>I(()=>import(`./use-magic-keys-NMOzQ56z.js`),__vite__mapDeps([71,4,5,6]))},{path:`vibrant`,name:`/devtools/vibrant`,component:()=>I(()=>import(`./vibrant-DaA7KX3v.js`),__vite__mapDeps([72,3,2,4,5,6,7,60,64,61]))}]},{path:`/settings`,children:[{path:``,name:`/settings/`,component:()=>I(()=>import(`./settings-B7G0W455.js`),__vite__mapDeps([73,36,16,14,17,3,2,4,5,6,7,18,19,20,21,22,23,15,24,25,8,26,27,28,29,30,31,32,33,74])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`airi-card`,children:[{path:``,name:`/settings/airi-card/`,component:()=>I(()=>import(`./airi-card-BeLYaKHl.js`),__vite__mapDeps([75,36,16,14,17,3,2,4,5,6,7,18,19,20,21,22,23,15,24,25,8,26,27,28,29,30,31,32,33,76,49,77,78,79,80,81,64,61])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`components`,children:[{path:`CardCreate`,name:`/settings/airi-card/components/CardCreate`,component:()=>I(()=>import(`./CardCreate-CQTxdn4D.js`),__vite__mapDeps([82,79,18,4,5]))},{path:`CardCreationDialog`,name:`/settings/airi-card/components/CardCreationDialog`,component:()=>I(()=>import(`./CardCreationDialog-cN7py1P6.js`),__vite__mapDeps([83,16,14,17,3,2,4,5,6,7,76,18,25,29,49,27,28,21,77]))},{path:`CardDetailDialog`,name:`/settings/airi-card/components/CardDetailDialog`,component:()=>I(()=>import(`./CardDetailDialog-CsobWwkt.js`),__vite__mapDeps([84,16,14,17,3,2,4,5,6,7,27,18,28,21,29,25,30,78,80,49]))},{path:`CardListItem`,name:`/settings/airi-card/components/CardListItem`,component:()=>I(()=>import(`./CardListItem-CbOMiA5T.js`),__vite__mapDeps([85,16,14,17,3,2,4,5,6,7,19,20,21,22,23,18,15,24,25,8,26,27,28,29,30,31,32,33,81]))},{path:`DeleteCardDialog`,name:`/settings/airi-card/components/DeleteCardDialog`,component:()=>I(()=>import(`./DeleteCardDialog-DkR1Cc9E.js`),__vite__mapDeps([86,3,2,4,5,6,7,78,18,25]))}]}]},{path:`data`,children:[{path:``,name:`/settings/data/`,component:()=>I(()=>import(`./data-CBvyhmZq.js`),__vite__mapDeps([87,36,16,14,17,3,2,4,5,6,7,18,19,20,21,22,23,15,24,25,8,26,27,28,29,30,31,32,33,45,46,47,48,49,52,53,44,88])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}}]},{path:`memory`,children:[{path:``,name:`/settings/memory/`,component:()=>I(()=>import(`./memory-BtlxAq98.js`),__vite__mapDeps([89,36,16,14,17,3,2,4,5,6,7,19,20,21,22,23,18,15,24,25,8,26,27,28,29,30,31,32,33])),meta:{layout:`settings`,stageTransition:{name:`slide`}}}]},{path:`models`,children:[{path:``,name:`/settings/models/`,component:()=>I(()=>import(`./models-CcEJuOe_.js`),__vite__mapDeps([90,36,3,2,4,5,6,7,18,19,20,17,21,41,29,25,40,42,24,8,26,43,44,60])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}}]},{path:`modules`,children:[{path:``,name:`/settings/modules/`,component:()=>I(()=>import(`./modules-pq5SkWez.js`),__vite__mapDeps([91,36,16,14,17,3,2,4,5,6,7,18,19,20,21,41,29,25,22,23,15,24,8,26,27,28,30,31,32,33,74])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}},{path:`beat-sync`,name:`/settings/modules/beat-sync`,component:()=>I(()=>import(`./beat-sync-HWqNDh-f.js`),__vite__mapDeps([92,36,16,14,17,3,2,4,5,6,7,18,19,20,21,41,29,25,22,23,15,24,8,26,27,28,30,31,32,33])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`consciousness`,name:`/settings/modules/consciousness`,component:()=>I(()=>import(`./consciousness-OW8mu5uI.js`),__vite__mapDeps([93,36,16,14,17,3,2,4,5,6,7,18,19,20,21,22,23,15,24,25,8,26,27,28,29,30,31,32,33])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`gaming-factorio`,name:`/settings/modules/gaming-factorio`,component:()=>I(()=>import(`./gaming-factorio-SBqYhlLF.js`),__vite__mapDeps([94,36,16,14,17,3,2,4,5,6,7,19,20,21,22,23,18,15,24,25,8,26,27,28,29,30,31,32,33])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}},{path:`gaming-minecraft`,name:`/settings/modules/gaming-minecraft`,component:()=>I(()=>import(`./gaming-minecraft-DqVnVTyA.js`),__vite__mapDeps([95,36,16,14,17,3,2,4,5,6,7,19,20,21,22,23,18,15,24,25,8,26,27,28,29,30,31,32,33])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}},{path:`hearing`,name:`/settings/modules/hearing`,component:()=>I(()=>import(`./hearing-CzJ5MFBH.js`),__vite__mapDeps([96,36,16,14,17,3,2,4,5,6,7,50,23,18,19,20,21,22,15,24,25,8,26,27,28,29,30,31,32,33,51,52,53,54])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`memory-long-term`,name:`/settings/modules/memory-long-term`,component:()=>I(()=>import(`./memory-long-term-CtgFbvBe.js`),__vite__mapDeps([97,36,4,5])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`memory-short-term`,name:`/settings/modules/memory-short-term`,component:()=>I(()=>import(`./memory-short-term-Dgai2Btn.js`),__vite__mapDeps([98,36,4,5])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`messaging-discord`,name:`/settings/modules/messaging-discord`,component:()=>I(()=>import(`./messaging-discord-BMzg_O9F.js`),__vite__mapDeps([99,36,16,14,17,3,2,4,5,6,7,19,20,21,22,23,18,15,24,25,8,26,27,28,29,30,31,32,33])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}},{path:`speech`,name:`/settings/modules/speech`,component:()=>I(()=>import(`./speech-DH-rHMWX.js`),__vite__mapDeps([100,36,16,14,17,3,2,4,5,6,7,18,19,20,21,22,23,15,24,25,8,26,27,28,29,30,31,32,33,55])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`vision`,name:`/settings/modules/vision`,component:()=>I(()=>import(`./vision-DhhLFD5o.js`),__vite__mapDeps([101,36,16,14,17,3,2,4,5,6,7,19,20,21,22,23,18,15,24,25,8,26,27,28,29,30,31,32,33])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}},{path:`x`,name:`/settings/modules/x`,component:()=>I(()=>import(`./x-CfzkhX9_.js`),__vite__mapDeps([102,36,16,14,17,3,2,4,5,6,7,19,20,21,22,23,18,15,24,25,8,26,27,28,29,30,31,32,33])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}}]},{path:`providers`,children:[{path:``,name:`/settings/providers/`,component:()=>I(()=>import(`./providers-CP--1bBf.js`),__vite__mapDeps([103,36,16,14,17,3,2,4,5,6,7,19,20,21,22,23,18,15,24,25,8,26,27,28,29,30,31,32,33,74])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}},{path:`chat`,children:[{path:`:providerId`,name:`/settings/providers/chat/[providerId]`,component:()=>I(()=>import(`./_providerId_-CIYsM20M.js`),__vite__mapDeps([104,36,16,14,17,3,2,4,5,6,7,19,20,21,22,23,18,15,24,25,8,26,27,28,29,30,31,32,33,105])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`azure-ai-foundry`,name:`/settings/providers/chat/azure-ai-foundry`,component:()=>I(()=>import(`./azure-ai-foundry-DEqvloeQ.js`),__vite__mapDeps([106,36,16,14,17,3,2,4,5,6,7,19,20,21,22,23,18,15,24,25,8,26,27,28,29,30,31,32,33,105])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`cloudflare-workers-ai`,name:`/settings/providers/chat/cloudflare-workers-ai`,component:()=>I(()=>import(`./cloudflare-workers-ai-BgN6F-61.js`),__vite__mapDeps([107,36,16,14,17,3,2,4,5,6,7,19,20,21,22,23,18,15,24,25,8,26,27,28,29,30,31,32,33,105])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`lm-studio`,name:`/settings/providers/chat/lm-studio`,component:()=>I(()=>import(`./lm-studio-Cu1JvZVB.js`),__vite__mapDeps([108,36,16,14,17,3,2,4,5,6,7,19,20,21,22,23,18,15,24,25,8,26,27,28,29,30,31,32,33,105])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`ollama`,name:`/settings/providers/chat/ollama`,component:()=>I(()=>import(`./ollama-B5mymzO5.js`),__vite__mapDeps([109,36,16,14,17,3,2,4,5,6,7,19,20,21,22,23,18,15,24,25,8,26,27,28,29,30,31,32,33,105])),meta:{layout:`settings`,stageTransition:{name:`slide`}}}]},{path:`speech`,children:[{path:`alibaba-cloud-model-studio`,name:`/settings/providers/speech/alibaba-cloud-model-studio`,component:()=>I(()=>import(`./alibaba-cloud-model-studio-Bs3uT3_h.js`),__vite__mapDeps([110,36,16,14,17,3,2,4,5,6,7,18,19,20,21,22,23,15,24,25,8,26,27,28,29,30,31,32,33])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`comet-api-speech`,name:`/settings/providers/speech/comet-api-speech`,component:()=>I(()=>import(`./comet-api-speech-Dfu-r2Ac.js`),__vite__mapDeps([111,36,16,14,17,3,2,4,5,6,7,18,19,20,21,22,23,15,24,25,8,26,27,28,29,30,31,32,33])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`elevenlabs`,name:`/settings/providers/speech/elevenlabs`,component:()=>I(()=>import(`./elevenlabs-DdLCiM18.js`),__vite__mapDeps([112,36,16,14,17,3,2,4,5,6,7,18,19,20,21,22,23,15,24,25,8,26,27,28,29,30,31,32,33])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`index-tts-vllm`,name:`/settings/providers/speech/index-tts-vllm`,component:()=>I(()=>import(`./index-tts-vllm-CnKZjGZI.js`),__vite__mapDeps([113,36,16,14,17,3,2,4,5,6,7,19,20,21,22,23,18,15,24,25,8,26,27,28,29,30,31,32,33])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`microsoft-speech`,name:`/settings/providers/speech/microsoft-speech`,component:()=>I(()=>import(`./microsoft-speech-DXFkeIFV.js`),__vite__mapDeps([114,36,16,14,17,3,2,4,5,6,7,18,19,20,21,22,23,15,24,25,8,26,27,28,29,30,31,32,33])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`openai-audio-speech`,name:`/settings/providers/speech/openai-audio-speech`,component:()=>I(()=>import(`./openai-audio-speech-CK11JEyg.js`),__vite__mapDeps([115,36,16,14,17,3,2,4,5,6,7,18,19,20,21,22,23,15,24,25,8,26,27,28,29,30,31,32,33])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`openai-compatible-audio-speech`,name:`/settings/providers/speech/openai-compatible-audio-speech`,component:()=>I(()=>import(`./openai-compatible-audio-speech-Dg21-D2M.js`),__vite__mapDeps([116,36,16,14,17,3,2,4,5,6,7,19,20,21,22,23,18,15,24,25,8,26,27,28,29,30,31,32,33,105])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`player2-speech`,name:`/settings/providers/speech/player2-speech`,component:()=>I(()=>import(`./player2-speech-DRfVfleA.js`),__vite__mapDeps([117,36,16,14,17,3,2,4,5,6,7,18,19,20,21,22,23,15,24,25,8,26,27,28,29,30,31,32,33])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`volcengine`,name:`/settings/providers/speech/volcengine`,component:()=>I(()=>import(`./volcengine-CwHpcYQ0.js`),__vite__mapDeps([118,36,16,14,17,3,2,4,5,6,7,18,19,20,21,22,23,15,24,25,8,26,27,28,29,30,31,32,33])),meta:{layout:`settings`,stageTransition:{name:`slide`}}}]},{path:`transcription`,children:[{path:`aliyun-nls-transcription`,name:`/settings/providers/transcription/aliyun-nls-transcription`,component:()=>I(()=>import(`./aliyun-nls-transcription-ThiG_Ak6.js`),__vite__mapDeps([119,36,16,14,17,3,2,4,5,6,7,19,20,21,22,23,18,15,24,25,8,26,27,28,29,30,31,32,33,52,53,105,54])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`comet-api-transcription`,name:`/settings/providers/transcription/comet-api-transcription`,component:()=>I(()=>import(`./comet-api-transcription-BxkdP1WS.js`),__vite__mapDeps([120,36,16,14,17,3,2,4,5,6,7,19,20,21,22,23,18,15,24,25,8,26,27,28,29,30,31,32,33,52,53,105])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`openai-audio-transcription`,name:`/settings/providers/transcription/openai-audio-transcription`,component:()=>I(()=>import(`./openai-audio-transcription-C9jVbePt.js`),__vite__mapDeps([121,36,16,14,17,3,2,4,5,6,7,19,20,21,22,23,18,15,24,25,8,26,27,28,29,30,31,32,33,52,53])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`openai-compatible-audio-transcription`,name:`/settings/providers/transcription/openai-compatible-audio-transcription`,component:()=>I(()=>import(`./openai-compatible-audio-transcription-DQYIeBVK.js`),__vite__mapDeps([122,36,16,14,17,3,2,4,5,6,7,19,20,21,22,23,18,15,24,25,8,26,27,28,29,30,31,32,33,52,53,105])),meta:{layout:`settings`,stageTransition:{name:`slide`}}}]}]},{path:`scene`,children:[{path:``,name:`/settings/scene/`,component:()=>I(()=>import(`./scene-NwOIl7WX.js`),__vite__mapDeps([123,36,16,14,17,3,2,4,5,6,7,19,20,21,22,23,18,15,24,25,8,26,27,28,29,30,31,32,33])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}}]},{path:`system`,children:[{path:``,name:`/settings/system/`,component:()=>I(()=>import(`./system-BRtfNILC.js`),__vite__mapDeps([124,36,16,14,17,3,2,4,5,6,7,18,19,20,21,22,23,15,24,25,8,26,27,28,29,30,31,32,33,74])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}},{path:`color-scheme`,name:`/settings/system/color-scheme`,component:()=>I(()=>import(`./color-scheme-0i0L0wxO.js`),__vite__mapDeps([125,2,36,16,14,17,3,4,5,6,7,18,19,20,21,22,23,15,24,25,8,26,27,28,29,30,31,32,33,126])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`developer`,name:`/settings/system/developer`,component:()=>I(()=>import(`./developer-Da1vuucL.js`),__vite__mapDeps([127,36,16,14,17,3,2,4,5,6,7,18,19,20,21,22,23,15,24,25,8,26,27,28,29,30,31,32,33])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`general`,name:`/settings/system/general`,component:()=>I(()=>import(`./general-Bvs5oF0L.js`),__vite__mapDeps([128,36,3,2,4,5,6,7,18,19,20,17,21])),meta:{layout:`settings`,stageTransition:{name:`slide`}}}]}]}];var ct=!1;function lt(){if(ct)return{dispose:()=>{}};let e=xe(),t=pe(),{post:n,data:r}=de({name:Se}),i=y(r,t=>{t&&e.ingestContextMessage(t)}),a=e.onContextPublish((e,r)=>{r!==`broadcast`&&n(e),r===`local`&&t.sendContextUpdate(e)});t.initialize({possibleEvents:[`context:update`]}).catch(e=>console.error(`Context bridge init error:`,e));let o=t.onContextUpdate(t=>{let r=t.data;e.ingestContextMessage(r),n(r)});return ct=!0,{dispose:()=>{i(),a(),o?.(),ct=!1}}}var ut=L(n({__name:`ArrowTransition`,props:{stageTransition:{default:()=>({primaryColor:`#666`,secondaryColor:`#ccc`})}},setup(e){let t=e,n=b(()=>t.stageTransition),r=b(()=>n.value.primaryColor||`#666`),i=b(()=>n.value.secondaryColor||`#ccc`);return _(()=>{document.documentElement.style.setProperty(`--stage-transition-3-overlay-color-1`,r.value),document.documentElement.style.setProperty(`--stage-transition-3-overlay-color-2`,i.value)}),(e,t)=>(u(),k(`div`,{class:`stage-transition-3`,style:f({zIndex:n.value.zIndex||100})},null,4))}}),[[`__scopeId`,`data-v-17464329`]]),dt=L(n({__name:`BubbleWaveOutTransition`,props:{stageTransition:{}},setup(e){let t=e,n=b(()=>t.stageTransition?.colors||[`#eee`,`#ebcb8b`,`#c56370`,`#3f3b52`]);return _(()=>{document.documentElement.style.setProperty(`--circle-expansion-delay`,`${t.stageTransition?.delay||0}s`),document.documentElement.style.setProperty(`--circle-expansion-duration`,`${t.stageTransition?.duration||.4}s`),n.value.forEach((e,t)=>{document.documentElement.style.setProperty(`--circle-expansion-color-${t+1}`,e)})}),(t,r)=>(u(),k(`div`,{class:`circle-expansion-transition`,style:f({zIndex:e.stageTransition?.zIndex||100})},[(u(!0),k(D,null,l(n.value,(e,t)=>(u(),k(`div`,{key:t}))),128))],4))}}),[[`__scopeId`,`data-v-4624be9e`]]),ft=L(n({__name:`FantasyFallTransition`,props:{stageTransition:{}},setup(e){let t=e,n=b(()=>t.stageTransition?.direction||`up`),r=b(()=>`fantasy-fall-${n.value}`);return _(()=>{document.documentElement.style.setProperty(`--fantasy-fall-color`,t.stageTransition?.primaryColor||`#eee`),document.documentElement.style.setProperty(`--fantasy-fall-duration`,`${t.stageTransition?.duration||.6}s`),document.documentElement.style.setProperty(`--fantasy-fall-delay`,`${t.stageTransition?.delay||0}s`),document.documentElement.style.setProperty(`--fantasy-fall-radius-sm`,`${t.stageTransition?.borderRadius?.sm||`14rem`}`),document.documentElement.style.setProperty(`--fantasy-fall-radius-md`,`${t.stageTransition?.borderRadius?.md||`14rem`}`),document.documentElement.style.setProperty(`--fantasy-fall-radius-lg`,`${t.stageTransition?.borderRadius?.lg||`50%`}`)}),(t,n)=>(u(),k(`div`,{class:C([`fantasy-fall-transition`,r.value]),style:f({zIndex:e.stageTransition?.zIndex??100})},null,6))}}),[[`__scopeId`,`data-v-826171f5`]]),pt=L(n({__name:`MultipleBlocksRevealTransition`,props:{stageTransition:{}},setup(e){let t=e,n=b(()=>t.stageTransition),r=b(()=>n.value?.primaryColor||`#666`),i=b(()=>n.value?.secondaryColor||`#ccc`);return _(()=>{document.documentElement.style.setProperty(`--stage-transition-4-overlay-color-1`,r.value),document.documentElement.style.setProperty(`--stage-transition-4-overlay-color-2`,i.value)}),(e,t)=>(u(),k(`div`,{class:`stage-transition-4`,style:f({zIndex:n.value?.zIndex??100})},[...t[0]||=[a(`
`,5)]],4))}}),[[`__scopeId`,`data-v-4221f976`]]),mt=L(n({__name:`SlideTransition`,props:{stageTransition:{}},setup(e){let t=e,n=b(()=>t.stageTransition),r=b(()=>n.value?.primaryColor||`#666`),i=b(()=>n.value?.secondaryColor||`#ccc`);return y([n,r,i],()=>{document.documentElement.style.setProperty(`--stage-transition-1-overlay-color-1`,r.value),document.documentElement.style.setProperty(`--stage-transition-1-overlay-color-2`,i.value)}),_(()=>{document.documentElement.style.setProperty(`--stage-transition-1-overlay-color-1`,r.value),document.documentElement.style.setProperty(`--stage-transition-1-overlay-color-2`,i.value)}),(e,t)=>(u(),k(`div`,{class:`stage-transition-1`,style:f({zIndex:n.value?.zIndex??100})},null,4))}}),[[`__scopeId`,`data-v-81c0af14`]]),ht=L(n({__name:`SlopeSlideTransition`,props:{stageTransition:{}},setup(e){let t=e,n=b(()=>t.stageTransition),r=b(()=>n.value?.primaryColor??`#666`),i=b(()=>n.value?.secondaryColor??`#ccc`);return _(()=>{document.documentElement.style.setProperty(`--stage-transition-2-overlay-color-1`,r.value),document.documentElement.style.setProperty(`--stage-transition-2-overlay-color-2`,i.value)}),(e,t)=>(u(),k(`div`,{class:`stage-transition-2`,style:f({zIndex:n.value?.zIndex??100})},null,4))}}),[[`__scopeId`,`data-v-9e8b66c8`]]),gt=L(n({__name:`RectanglesRotateTransition`,props:{stageTransition:{}},setup(e){let t=e;return _(()=>{document.documentElement.style.setProperty(`--rectangle-rotate-1-color`,t.stageTransition?.primaryColor||`#ebcb8b`),document.documentElement.style.setProperty(`--rectangle-rotate-2-color`,t.stageTransition?.secondaryColor||`#c56370`),document.documentElement.style.setProperty(`--rectangle-rotate-3-color`,t.stageTransition?.tertiaryColor||`#43445b`),document.documentElement.style.setProperty(`--rectangle-rotate-duration`,`${t.stageTransition?.duration||.6}s`),document.documentElement.style.setProperty(`--rectangle-rotate-delay`,`${t.stageTransition?.delay||0}s`),document.documentElement.style.setProperty(`--rectangle-rotate-stagger`,`${t.stageTransition?.staggerDelay||.1}s`),document.documentElement.style.setProperty(`--rectangle-rotate-rotation`,`${t.stageTransition?.rotation||270}deg`)}),(t,n)=>(u(),k(`div`,{class:`rectangle-rotate-transition`,style:f({zIndex:e.stageTransition?.zIndex??100})},[...n[0]||=[j(`div`,{class:`rectangle rectangle-rotate-1`},[j(`div`)],-1),j(`div`,{class:`rectangle rectangle-rotate-2`},[j(`div`)],-1),j(`div`,{class:`rectangle rectangle-rotate-3`},[j(`div`)],-1)]],4))}}),[[`__scopeId`,`data-v-45ea2f7f`]]),_t=n({__name:`StageTransitionGroup`,props:{primaryColor:{},secondaryColor:{},tertiaryColor:{},colors:{},zIndex:{},disableTransitions:{type:Boolean},usePageSpecificTransitions:{type:Boolean}},setup(e){let t=e,n=le(),r=M(!1),a=M(),o=M(``),s=M(),c=A({slide:{component:mt,duration:2700},"slope-slide":{component:ht,duration:2700},arrow:{component:ut,duration:2700},"multiple-blocks-reveal":{component:pt,duration:2800},"fantasy-fall":{component:ft,duration:2700},"rectangles-rotate":{component:gt,duration:2700},"bubble-wave-out":{component:dt,duration:1e3}}),l=M([]);function d(e){return l.value.push(e),()=>{let t=l.value.indexOf(e);t>=0&&l.value.splice(t,1)}}async function f(e,t={}){a.value=e;for(let n of l.value)try{await Promise.resolve(n(e,t))}catch(t){console.error(`Error in transition hook at stage "${e}":`,t)}}async function p(e,t,n){if(e.name===`none`||!e.name){t(),n();return}let i=c.value[e.name];if(!i){console.error(`Transition ${e.name} not found`),t(),n();return}let a=i.nextDelay===void 0?i.duration/3:i.nextDelay,l=!1,u=d(e=>{e===`navigation`&&!l&&(l=!0,t())});try{await f(`before-enter`,{transitionName:e.name}),r.value&&(await f(`before-leave`,{transitionName:o.value}),o.value=``,s.value=void 0,r.value=!1,await f(`after-leave`,{transitionName:o.value}),await new Promise(e=>setTimeout(e,50))),o.value=e.name,s.value=e,r.value=!0,await f(`enter-active`,{transitionName:name}),setTimeout(async()=>{await f(`navigation`,{transitionName:e.name,config:i}),l||(l=!0,t())},a),setTimeout(async()=>{await f(`after-enter`,{transitionName:e.name})},i.duration),setTimeout(async()=>{await f(`before-leave`,{transitionName:e.name})},i.duration+10),setTimeout(async()=>{await f(`leave-active`,{transitionName:e.name})},i.duration+20);let c=i.exitDuration??0;setTimeout(async()=>{r.value=!1,o.value=``,s.value=void 0,await f(`after-leave`,{transitionName:e.name}),n()},i.duration+c)}catch(e){console.error(e)}finally{u(),setTimeout(()=>{l||(l=!0,t())},i.duration*2)}}function m(e,t){return new Promise(n=>{p(e,t,n)})}return n.beforeEach((e,n,r)=>{if(t.disableTransitions){r();return}if(typeof e.meta.stageTransition!=`object`){r();return}let i=e.meta.stageTransition;if(t.usePageSpecificTransitions&&i.pageSpecificAvailable){r();return}t.primaryColor!==void 0&&(i.primaryColor=t.primaryColor),t.secondaryColor!==void 0&&(i.secondaryColor=t.secondaryColor),t.tertiaryColor!==void 0&&(i.tertiaryColor=t.tertiaryColor),t.colors!==void 0&&(i.colors=t.colors),t.zIndex!==void 0&&(i.zIndex=t.zIndex),m(i,r)}),(e,t)=>(u(),k(D,null,[v(e.$slots,`default`),r.value?(u(),k(D,{key:0},[c.value[o.value]?(u(),g(h(c.value[o.value].component),{key:0,"stage-transition":s.value},null,8,[`stage-transition`])):i(``,!0)],64)):i(``,!0)],64))}}),vt=1,Q=new class{subscribers;toasts;dismissedToasts;constructor(){this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)});publish=e=>{this.subscribers.forEach(t=>t(e))};addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]};create=e=>{let{message:t,...n}=e,r=typeof e.id==`number`||e.id&&e.id?.length>0?e.id:vt++,i=this.toasts.find(e=>e.id===r),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),i?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:a,title:t}):n):this.addToast({title:t,...n,dismissible:a,id:r}),r};dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e);message=(e,t)=>this.create({...t,message:e,type:`default`});error=(e,t)=>this.create({...t,type:`error`,message:e});success=(e,t)=>this.create({...t,type:`success`,message:e});info=(e,t)=>this.create({...t,type:`info`,message:e});warning=(e,t)=>this.create({...t,type:`warning`,message:e});loading=(e,t)=>this.create({...t,type:`loading`,message:e});promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],c(e))i=!1,this.create({id:n,type:`default`,message:e});else if(bt(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!c(r)?r:{message:r||``,id:n||``};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!c(r)?r:{message:r||``,id:n||``};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!c(r)?r:{message:r||``,id:n||``};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!c(r)?r:{message:r||``,id:n||``};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally?.()}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})};custom=(e,t)=>{let n=t?.id||vt++,r=this.toasts.find(e=>e.id===n),i=t?.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(n)&&this.dismissedToasts.delete(n),r?this.toasts=this.toasts.map(r=>r.id===n?(this.publish({...r,component:e,dismissible:i,id:n,...t}),{...r,component:e,dismissible:i,id:n,...t}):r):this.addToast({component:e,dismissible:i,id:n,...t}),n};getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id))};function yt(e,t){let n=t?.id||vt++;return Q.create({message:e,id:n,type:`default`,...t}),n}var bt=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,xt=yt,St=Object.assign(xt,{success:Q.success,info:Q.info,warning:Q.warning,error:Q.error,custom:Q.custom,message:Q.message,promise:Q.promise,dismiss:Q.dismiss,loading:Q.loading},{getHistory:()=>Q.toasts,getToasts:()=>Q.getActiveToasts()});function Ct(e){return e.label!==void 0}var wt=3,Tt=`24px`,Et=`16px`,Dt=4e3,Ot=356,kt=14,At=45,jt=200;function Mt(){let e=M(!1);return O(()=>{let t=()=>{e.value=document.hidden};return document.addEventListener(`visibilitychange`,t),()=>window.removeEventListener(`visibilitychange`,t)}),{isDocumentHidden:e}}function $(...e){return e.filter(Boolean).join(` `)}function Nt(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}function Pt(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?Et:Tt;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var Ft=[`data-rich-colors`,`data-styled`,`data-mounted`,`data-promise`,`data-swiped`,`data-removed`,`data-visible`,`data-y-position`,`data-x-position`,`data-index`,`data-front`,`data-swiping`,`data-dismissible`,`data-type`,`data-invert`,`data-swipe-out`,`data-swipe-direction`,`data-expanded`,`data-testid`],It=[`aria-label`,`data-disabled`,`data-close-button-position`],Lt=n({__name:`Toast`,props:{toast:{},toasts:{},index:{},swipeDirections:{},expanded:{type:Boolean},invert:{type:Boolean},heights:{},gap:{},position:{},closeButtonPosition:{},visibleToasts:{},expandByDefault:{type:Boolean},closeButton:{type:Boolean},interacting:{type:Boolean},style:{},cancelButtonStyle:{},actionButtonStyle:{},duration:{},class:{},unstyled:{type:Boolean},descriptionClass:{},loadingIcon:{},classes:{},icons:{},closeButtonAriaLabel:{},defaultRichColors:{type:Boolean}},emits:[`update:heights`,`update:height`,`removeToast`],setup(e,{emit:t}){let n=e,a=t,o=M(null),c=M(null),l=M(!1),ee=M(!1),x=M(!1),S=M(!1),te=M(!1),w=M(0),E=M(0),A=M(n.toast.duration||n.duration||Dt),re=M(null),N=M(null),ie=b(()=>n.index===0),ae=b(()=>n.index+1<=n.visibleToasts),P=b(()=>n.toast.type),F=b(()=>n.toast.dismissible!==!1),oe=b(()=>n.toast.class||``),I=b(()=>n.descriptionClass||``),se=b(()=>{let e=n.toast.position||n.position,t=n.heights.filter(t=>t.position===e).findIndex(e=>e.toastId===n.toast.id);return t>=0?t:0}),ce=b(()=>{let e=n.toast.position||n.position;return n.heights.filter(t=>t.position===e).reduce((e,t,n)=>n>=se.value?e:e+t.height,0)}),le=b(()=>se.value*n.gap+ce.value||0),ue=b(()=>n.toast.closeButton??n.closeButton),L=b(()=>n.toast.duration||n.duration||Dt),de=M(0),fe=M(0),R=M(null),pe=b(()=>n.position.split(`-`)),me=b(()=>pe.value[0]),he=b(()=>pe.value[1]),ge=b(()=>typeof n.toast.title!=`string`),_e=b(()=>typeof n.toast.description!=`string`),{isDocumentHidden:ve}=Mt(),ye=b(()=>P.value&&P.value===`loading`);_(()=>{l.value=!0,A.value=L.value}),O(async()=>{if(!l.value||!N.value)return;await r();let e=N.value,t=e.style.height;e.style.height=`auto`;let i=e.getBoundingClientRect().height;e.style.height=t,E.value=i,a(`update:height`,{toastId:n.toast.id,height:i,position:n.toast.position||n.position})});function z(){ee.value=!0,w.value=le.value,setTimeout(()=>{a(`removeToast`,n.toast)},jt)}function be(){if(ye.value||!F.value)return{};z(),n.toast.onDismiss?.(n.toast)}function xe(e){e.button!==2&&(ye.value||!F.value||(re.value=new Date,w.value=le.value,e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(x.value=!0,R.value={x:e.clientX,y:e.clientY})))}function Se(){if(S.value||!F.value)return;R.value=null;let e=Number(N.value?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(N.value?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-(re.value?.getTime()||0),i=o.value===`x`?e:t,a=Math.abs(i)/r;if(Math.abs(i)>=At||a>.11){w.value=le.value,n.toast.onDismiss?.(n.toast),o.value===`x`?c.value=e>0?`right`:`left`:c.value=t>0?`down`:`up`,z(),S.value=!0;return}else N.value?.style.setProperty(`--swipe-amount-x`,`0px`),N.value?.style.setProperty(`--swipe-amount-y`,`0px`);te.value=!1,x.value=!1,o.value=null}function Ce(e){if(!R.value||!F.value||(window?.getSelection()?.toString()?.length??!1))return;let t=e.clientY-R.value.y,r=e.clientX-R.value.x,i=n.swipeDirections??Nt(n.position);!o.value&&(Math.abs(r)>1||Math.abs(t)>1)&&(o.value=Math.abs(r)>Math.abs(t)?`x`:`y`);let a={x:0,y:0},s=e=>1/(1.5+Math.abs(e)/20);if(o.value===`y`){if(i.includes(`top`)||i.includes(`bottom`))if(i.includes(`top`)&&t<0||i.includes(`bottom`)&&t>0)a.y=t;else{let e=t*s(t);a.y=Math.abs(e)0)a.x=r;else{let e=r*s(r);a.x=Math.abs(e)0||Math.abs(a.y)>0)&&(te.value=!0),N.value?.style.setProperty(`--swipe-amount-x`,`${a.x}px`),N.value?.style.setProperty(`--swipe-amount-y`,`${a.y}px`)}_(()=>{if(l.value=!0,!N.value)return;let e=N.value.getBoundingClientRect().height;E.value=e,a(`update:heights`,[{toastId:n.toast.id,height:e,position:n.toast.position},...n.heights])}),s(()=>{N.value&&a(`removeToast`,n.toast)}),O(e=>{if(n.toast.promise&&P.value===`loading`||n.toast.duration===1/0||n.toast.type===`loading`)return;let t;n.expanded||n.interacting||ve.value?(()=>{if(fe.value{n.toast.onAutoClose?.(n.toast),z()},A.value)),e(()=>{clearTimeout(t)})}),y(()=>n.toast.delete,e=>{e!==void 0&&e&&(z(),n.toast.onDismiss?.(n.toast))},{deep:!0});function we(){x.value=!1,o.value=null,R.value=null}return(e,t)=>(u(),k(`li`,{tabindex:`0`,ref_key:`toastRef`,ref:N,class:C(T($)(n.class,oe.value,e.classes?.toast,e.toast.classes?.toast,e.classes?.[P.value],e.toast?.classes?.[P.value])),"data-sonner-toast":``,"data-rich-colors":e.toast.richColors??e.defaultRichColors,"data-styled":!(e.toast.component||e.toast?.unstyled||e.unstyled),"data-mounted":l.value,"data-promise":!!e.toast.promise,"data-swiped":te.value,"data-removed":ee.value,"data-visible":ae.value,"data-y-position":me.value,"data-x-position":he.value,"data-index":e.index,"data-front":ie.value,"data-swiping":x.value,"data-dismissible":F.value,"data-type":P.value,"data-invert":e.toast.invert||e.invert,"data-swipe-out":S.value,"data-swipe-direction":c.value,"data-expanded":!!(e.expanded||e.expandByDefault&&l.value),"data-testid":e.toast.testId,style:f({"--index":e.index,"--toasts-before":e.index,"--z-index":e.toasts.length-e.index,"--offset":`${ee.value?w.value:le.value}px`,"--initial-height":e.expandByDefault?`auto`:`${E.value}px`,...e.style,...n.toast.style}),onDragend:we,onPointerdown:xe,onPointerup:Se,onPointermove:Ce},[ue.value&&!e.toast.component&&P.value!==`loading`?(u(),k(`button`,{key:0,"aria-label":e.closeButtonAriaLabel||`Close toast`,"data-disabled":ye.value,"data-close-button":`true`,"data-close-button-position":e.closeButtonPosition,class:C(T($)(e.classes?.closeButton,e.toast?.classes?.closeButton)),onClick:be},[e.icons?.close?(u(),g(h(e.icons?.close),{key:0})):v(e.$slots,`close-icon`,{key:1})],10,It)):i(`v-if`,!0),e.toast.component?(u(),g(h(e.toast.component),ne({key:1},e.toast.componentProps,{onCloseToast:be,isPaused:e.$props.expanded||e.$props.interacting||T(ve)}),null,16,[`isPaused`])):(u(),k(D,{key:2},[P.value!==`default`||e.toast.icon||e.toast.promise?(u(),k(`div`,{key:0,"data-icon":``,class:C(T($)(e.classes?.icon,e.toast?.classes?.icon))},[e.toast.icon?(u(),g(h(e.toast.icon),{key:0})):(u(),k(D,{key:1},[P.value===`loading`?v(e.$slots,`loading-icon`,{key:0}):P.value===`success`?v(e.$slots,`success-icon`,{key:1}):P.value===`error`?v(e.$slots,`error-icon`,{key:2}):P.value===`warning`?v(e.$slots,`warning-icon`,{key:3}):P.value===`info`?v(e.$slots,`info-icon`,{key:4}):i(`v-if`,!0)],64))],2)):i(`v-if`,!0),j(`div`,{"data-content":``,class:C(T($)(e.classes?.content,e.toast?.classes?.content))},[j(`div`,{"data-title":``,class:C(T($)(e.classes?.title,e.toast.classes?.title))},[ge.value?(u(),g(h(e.toast.title),d(ne({key:0},e.toast.componentProps)),null,16)):(u(),k(D,{key:1},[p(m(e.toast.title),1)],64))],2),e.toast.description?(u(),k(`div`,{key:0,"data-description":``,class:C(T($)(e.descriptionClass,I.value,e.classes?.description,e.toast.classes?.description))},[_e.value?(u(),g(h(e.toast.description),d(ne({key:0},e.toast.componentProps)),null,16)):(u(),k(D,{key:1},[p(m(e.toast.description),1)],64))],2)):i(`v-if`,!0)],2),e.toast.cancel?(u(),k(`button`,{key:1,style:f(e.toast.cancelButtonStyle||e.cancelButtonStyle),class:C(T($)(e.classes?.cancelButton,e.toast.classes?.cancelButton)),"data-button":``,"data-cancel":``,onClick:t[0]||=t=>{T(Ct)(e.toast.cancel)&&F.value&&(e.toast.cancel.onClick?.(t),z())}},m(T(Ct)(e.toast.cancel)?e.toast.cancel?.label:e.toast.cancel),7)):i(`v-if`,!0),e.toast.action?(u(),k(`button`,{key:2,style:f(e.toast.actionButtonStyle||e.actionButtonStyle),class:C(T($)(e.classes?.actionButton,e.toast.classes?.actionButton)),"data-button":``,"data-action":``,onClick:t[1]||=t=>{T(Ct)(e.toast.action)&&(e.toast.action.onClick?.(t),!t.defaultPrevented&&z())}},m(T(Ct)(e.toast.action)?e.toast.action?.label:e.toast.action),7)):i(`v-if`,!0)],64))],46,Ft))}}),Rt=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},zt={},Bt={xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stoke-width":`1.5`,"stroke-linecap":`round`,"stroke-linejoin":`round`};function Vt(e,t){return u(),k(`svg`,Bt,t[0]||=[j(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`},null,-1),j(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`},null,-1)])}var Ht=Rt(zt,[[`render`,Vt]]),Ut=[`data-visible`],Wt={class:`sonner-spinner`},Gt=n({__name:`Loader`,props:{visible:{type:Boolean}},setup(e){let t=Array(12).fill(0);return(e,n)=>(u(),k(`div`,{class:`sonner-loading-wrapper`,"data-visible":e.visible},[j(`div`,Wt,[(u(!0),k(D,null,l(T(t),e=>(u(),k(`div`,{key:`spinner-bar-${e}`,class:`sonner-loading-bar`}))),128))])],8,Ut))}}),Kt={},qt={xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`};function Jt(e,t){return u(),k(`svg`,qt,t[0]||=[j(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,"clip-rule":`evenodd`},null,-1)])}var Yt=Rt(Kt,[[`render`,Jt]]),Xt={},Zt={xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`};function Qt(e,t){return u(),k(`svg`,Zt,t[0]||=[j(`path`,{"fill-rule":`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,"clip-rule":`evenodd`},null,-1)])}var $t=Rt(Xt,[[`render`,Qt]]),en={},tn={xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`};function nn(e,t){return u(),k(`svg`,tn,t[0]||=[j(`path`,{"fill-rule":`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,"clip-rule":`evenodd`},null,-1)])}var rn=Rt(en,[[`render`,nn]]),an={},on={xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`};function sn(e,t){return u(),k(`svg`,on,t[0]||=[j(`path`,{"fill-rule":`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,"clip-rule":`evenodd`},null,-1)])}var cn=Rt(an,[[`render`,sn]]),ln=[`aria-label`],un=[`data-sonner-theme`,`dir`,`data-theme`,`data-rich-colors`,`data-y-position`,`data-x-position`],dn=typeof window<`u`&&typeof document<`u`;function fn(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}var pn=n({name:`Toaster`,inheritAttrs:!1,__name:`Toaster`,props:{id:{},invert:{type:Boolean,default:!1},theme:{default:`light`},position:{default:`bottom-right`},closeButtonPosition:{default:`top-left`},hotkey:{default:()=>[`altKey`,`KeyT`]},richColors:{type:Boolean,default:!1},expand:{type:Boolean,default:!1},duration:{},gap:{default:kt},visibleToasts:{default:wt},closeButton:{type:Boolean,default:!1},toastOptions:{default:()=>({})},class:{default:``},style:{},offset:{default:Tt},mobileOffset:{default:Et},dir:{default:`auto`},swipeDirections:{},icons:{},containerAriaLabel:{default:`Notifications`}},setup(e){let t=e,n=ee(),a=M([]),o=b(()=>t.id?a.value.filter(e=>e.toasterId===t.id):a.value.filter(e=>!e.toasterId));function s(e,t){return o.value.filter(n=>!n.position&&t===0||n.position===e)}let c=b(()=>{let e=o.value.filter(e=>e.position).map(e=>e.position);return e.length>0?Array.from(new Set([t.position].concat(e))):[t.position]}),d=b(()=>{let e={};return c.value.forEach(t=>{e[t]=a.value.filter(e=>e.position===t)}),e}),p=M([]),m=M({}),h=M(!1);O(()=>{c.value.forEach(e=>{e in m.value||(m.value[e]=!1)})});let _=M(t.theme===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:t.theme),y=M(null),x=M(null),S=M(!1),te=t.hotkey.join(`+`).replace(/Key/g,``).replace(/Digit/g,``);function A(e){a.value.find(t=>t.id===e.id)?.delete||Q.dismiss(e.id),a.value=a.value.filter(({id:t})=>t!==e.id),setTimeout(()=>{a.value.find(t=>t.id===e.id)||(p.value=p.value.filter(t=>t.toastId!==e.id))},jt+50)}function re(e){S.value&&!e.currentTarget?.contains?.(e.relatedTarget)&&(S.value=!1,x.value&&=(x.value.focus({preventScroll:!0}),null))}function N(e){e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||S.value||(S.value=!0,x.value=e.relatedTarget)}function ie(e){e.target&&e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||(h.value=!0)}O(e=>{e(Q.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{a.value=a.value.map(t=>t.id===e.id?{...t,delete:!0}:t)});return}r(()=>{let t=a.value.findIndex(t=>t.id===e.id);t===-1?a.value=[e,...a.value]:a.value=[...a.value.slice(0,t),{...a.value[t],...e},...a.value.slice(t+1)]})}))}),O(e=>{if(typeof window>`u`)return;if(t.theme!==`system`){_.value=t.theme;return}let n=window.matchMedia(`(prefers-color-scheme: dark)`),r=e=>{_.value=e?`dark`:`light`};r(n.matches);let i=e=>{r(e.matches)};try{n.addEventListener(`change`,i)}catch{n.addListener(i)}e(()=>{try{n.removeEventListener(`change`,i)}catch{n.removeListener(i)}})}),O(()=>{y.value&&x.value&&(x.value.focus({preventScroll:!0}),x.value=null,S.value=!1)}),O(()=>{a.value.length<=1&&Object.keys(m.value).forEach(e=>{m.value[e]=!1})}),O(e=>{function n(e){let n=t.hotkey.every(t=>e[t]||e.code===t),r=Array.isArray(y.value)?y.value[0]:y.value;n&&(c.value.forEach(e=>{m.value[e]=!0}),r?.focus());let i=document.activeElement===y.value||r?.contains(document.activeElement);e.code===`Escape`&&i&&c.value.forEach(e=>{m.value[e]=!1})}dn&&(document.addEventListener(`keydown`,n),e(()=>{document.removeEventListener(`keydown`,n)}))});function ae(e){let t=e.currentTarget,n=t.getAttribute(`data-y-position`)+`-`+t.getAttribute(`data-x-position`);m.value[n]=!0}function P(e){if(!h.value){let t=e.currentTarget,n=t.getAttribute(`data-y-position`)+`-`+t.getAttribute(`data-x-position`);m.value[n]=!1}}function F(){Object.keys(m.value).forEach(e=>{m.value[e]=!1})}function oe(){h.value=!1}function I(e){p.value=e}function se(e){let t=p.value.findIndex(t=>t.toastId===e.toastId);if(t!==-1)p.value[t]=e;else{let t=p.value.findIndex(t=>t.position===e.position);t===-1?p.value.unshift(e):p.value.splice(t,0,e)}}return(e,r)=>(u(),k(D,null,[i(` Remove item from normal navigation flow, only available via hotkey `),j(`section`,{"aria-label":`${e.containerAriaLabel} ${T(te)}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`},[(u(!0),k(D,null,l(c.value,(r,i)=>(u(),k(`ol`,ne({key:r,ref_for:!0,ref_key:`listRef`,ref:y,"data-sonner-toaster":``,"data-sonner-theme":_.value,class:t.class,dir:e.dir===`auto`?fn():e.dir,tabIndex:-1,"data-theme":e.theme,"data-rich-colors":e.richColors,"data-y-position":r.split(`-`)[0],"data-x-position":r.split(`-`)[1],style:{"--front-toast-height":`${p.value[0]?.height||0}px`,"--width":`${T(Ot)}px`,"--gap":`${e.gap}px`,...e.style,...T(n).style,...T(Pt)(e.offset,e.mobileOffset)}},{ref_for:!0},e.$attrs,{onBlur:re,onFocus:N,onMouseenter:ae,onMousemove:ae,onMouseleave:P,onDragend:F,onPointerdown:ie,onPointerup:oe}),[(u(!0),k(D,null,l(s(r,i),(n,i)=>(u(),g(Lt,{key:n.id,heights:p.value,icons:e.icons,index:i,toast:n,defaultRichColors:e.richColors,duration:e.toastOptions?.duration??e.duration,class:C(e.toastOptions?.class??``),descriptionClass:e.toastOptions?.descriptionClass,invert:e.invert,visibleToasts:e.visibleToasts,closeButton:e.toastOptions?.closeButton??e.closeButton,interacting:h.value,position:r,closeButtonPosition:e.toastOptions?.closeButtonPosition??e.closeButtonPosition,style:f(e.toastOptions?.style),unstyled:e.toastOptions?.unstyled,classes:e.toastOptions?.classes,cancelButtonStyle:e.toastOptions?.cancelButtonStyle,actionButtonStyle:e.toastOptions?.actionButtonStyle,"close-button-aria-label":e.toastOptions?.closeButtonAriaLabel,toasts:d.value[r],expandByDefault:e.expand,gap:e.gap,expanded:m.value[r]||!1,swipeDirections:t.swipeDirections,"onUpdate:heights":I,"onUpdate:height":se,onRemoveToast:A},{"close-icon":E(()=>[v(e.$slots,`close-icon`,{},()=>[w(Ht)])]),"loading-icon":E(()=>[v(e.$slots,`loading-icon`,{},()=>[w(Gt,{visible:n.type===`loading`},null,8,[`visible`])])]),"success-icon":E(()=>[v(e.$slots,`success-icon`,{},()=>[w(Yt)])]),"error-icon":E(()=>[v(e.$slots,`error-icon`,{},()=>[w(cn)])]),"warning-icon":E(()=>[v(e.$slots,`warning-icon`,{},()=>[w(rn)])]),"info-icon":E(()=>[v(e.$slots,`info-icon`,{},()=>[w($t)])]),_:2},1032,[`heights`,`icons`,`index`,`toast`,`defaultRichColors`,`duration`,`class`,`descriptionClass`,`invert`,`visibleToasts`,`closeButton`,`interacting`,`position`,`closeButtonPosition`,`style`,`unstyled`,`classes`,`cancelButtonStyle`,`actionButtonStyle`,`close-button-aria-label`,`toasts`,`expandByDefault`,`gap`,`expanded`,`swipeDirections`]))),128))],16,un))),128))],8,ln)],2112))}});const mn=P(`pwa`,()=>{M([]),fe(R).smaller(`md`),_(async()=>{})});var hn=n({__name:`App`,setup(e){mn();let t=ge(),n=ye(),r=z(),i=ae(r),a=be(),{shouldShowSetup:s}=ae(a),{isDark:c}=ie(),l,d=b(()=>c.value?`color-mix(in srgb, oklch(95% var(--chromatic-chroma-900) calc(var(--chromatic-hue) + 0)) 70%, oklch(50% 0 360))`:`color-mix(in srgb, oklch(95% var(--chromatic-chroma-900) calc(var(--chromatic-hue) + 0)) 90%, oklch(90% 0 360))`),f=b(()=>c.value?`color-mix(in srgb, oklch(95% var(--chromatic-chroma-900) calc(var(--chromatic-hue) + 180)) 70%, oklch(50% 0 360))`:`color-mix(in srgb, oklch(95% var(--chromatic-chroma-900) calc(var(--chromatic-hue) + 180)) 90%, oklch(90% 0 360))`),p=b(()=>c.value?`color-mix(in srgb, oklch(95% var(--chromatic-chroma-900) calc(var(--chromatic-hue) + 60)) 70%, oklch(50% 0 360))`:`color-mix(in srgb, oklch(95% var(--chromatic-chroma-900) calc(var(--chromatic-hue) + 60)) 90%, oklch(90% 0 360))`),m=b(()=>[d.value,f.value,p.value,c.value?`#121212`:`#FFFFFF`]);y(i.language,()=>{t.locale.value=i.language.value}),y(i.themeColorsHue,()=>{document.documentElement.style.setProperty(`--chromatic-hue`,i.themeColorsHue.value.toString())},{immediate:!0}),y(i.themeColorsHueDynamic,()=>{document.documentElement.classList.toggle(`dynamic-hue`,i.themeColorsHueDynamic.value)},{immediate:!0}),_(async()=>{a.initializeSetupCheck(),l=lt().dispose,await n.loadDisplayModelsFromIndexedDB(),await r.initializeStageModel()}),o(()=>{l?.()});function v(){a.markSetupCompleted()}function ee(){a.markSetupSkipped()}return(e,t)=>(u(),k(D,null,[w(T(_t),{"primary-color":d.value,"secondary-color":f.value,"tertiary-color":p.value,colors:m.value,"z-index":100,"disable-transitions":T(i).disableTransitions.value,"use-page-specific-transitions":T(i).usePageSpecificTransitions.value},{default:E(()=>[w(T(ce),null,{default:E(({Component:e})=>[(u(),g(S,{include:[`IndexScenePage`,`StageScenePage`]},[(u(),g(h(e)))],1024))]),_:1})]),_:1},8,[`primary-color`,`secondary-color`,`tertiary-color`,`colors`,`disable-transitions`,`use-page-specific-transitions`]),w(T(he),{onClose:t[0]||=e=>T(St).dismiss(e)},{default:E(()=>[w(T(pn))]),_:1}),w(T(me),{modelValue:T(s),"onUpdate:modelValue":t[1]||=e=>x(s)?s.value=e:null,onConfigured:v,onSkipped:ee},null,8,[`modelValue`])],64))}}),gn={"zh-CN":`zh-Hans`,"zh-TW":`zh-Hant`,"zh-HK":`zh-Hans`,"zh-Hant":`zh-Hans`,"en-US":`en`,"en-GB":`en`,"en-AU":`en`,en:`en`,"es-ES":`es`,"es-MX":`es`,"es-AR":`es`,es:`es`,vi:`vi`,"vi-VN":`vi`,ru:`ru`,"ru-RU":`ru`,fr:`fr`,"fr-FR":`fr`};function _n(){let e=localStorage.getItem(`settings/language`);e||=navigator.language||`en`;let t=Object.keys(ve);return gn[e||`en`]!=null&&(e=gn[e||`en`]),e&&t.includes(e)?e:`en`}const vn=_e({legacy:!1,locale:_n(),fallbackLocale:`en`,messages:ve});var yn=F(),bn=ue({routes:ot(st),history:se()});bn.beforeEach((e,t)=>{e.path!==t.path&&Ce.default.start()}),bn.afterEach(()=>{Ce.default.done()}),te(hn).use(N).use(at).use(bn).use(yn).use(vn).use(re).mount(`#app`); \ No newline at end of file +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/default-CTPUQ2Uf.js","assets/HeaderLink-CNK9co0e.js","assets/_plugin-vue_export-helper-DGA9ry_j.js","assets/src-DYQXbDgu.js","assets/vue.runtime.esm-bundler-_ZPRHVd_.js","assets/chunk-B78Zgmat.js","assets/dist-Che88T83.js","assets/src-CO8_9JkB.css","assets/vue-router-Chhv6vZu.js","assets/HeaderLink-CO18o3XU.css","assets/home-BH9GCqHR.js","assets/plain-B9tCnS2r.js","assets/settings-HCl6bqsC.js","assets/theme-color-CCXuu6C1.js","assets/merge-BvxP9iBC.js","assets/sleep-CkgWku9y.js","assets/stream-transcription-_Xuw_VzN.js","assets/index.browser-Dc5HQ32a.js","assets/vue-i18n.runtime-Dah5zGm4.js","assets/settings-73vyHOZs.js","assets/src-C83SCWbW.js","assets/resettable-CbXzRviW.js","assets/components-CeE-UiLT.js","assets/preload-helper-Dn1uWANL.js","assets/widgets-C0YByt49.js","assets/DialogTitle-ytlEE0A-.js","assets/widgets-CeetJ7Oc.css","assets/speech-6W29lyZ_.js","assets/webgpu-C-1YCssS.js","assets/environment-CyZLTg97.js","assets/purify.es-Dld0-TNF.js","assets/output-C8zlODy6.js","assets/__vite-browser-external-BaycPy5b.js","assets/components-DBIH4UgO.css","assets/stage-DZQk1vzw.js","assets/pages-DZRbeQEX.js","assets/route-block-CpjdOEnv.js","assets/scenes-BnArCCLz.js","assets/import-url-browser-DRsAP6zH.js","assets/duckdb-mvp-BP8S3C4a.js","assets/src-mAITpvbv.js","assets/browser-DY5K31Vk.js","assets/tres-Bk8ucvrj.js","assets/beat-sync-GCfX3UHH.js","assets/live2d-DukystQI.js","assets/chat-CxQ_IGrj.js","assets/index-Cx_srAfm-DhadnX4q.js","assets/core-Bb6Rlujp.js","assets/llmmarkerParser-CpinDrSK.js","assets/airi-card-DuhaYjQU.js","assets/transformers.web-DAjDoeaJ.js","assets/composables-eN7drneV.js","assets/hearing-BH9rth_f.js","assets/dist-CB18iuyA.js","assets/process.worklet-Cmmnc6Go.js","assets/Basic-EclD3L6X.js","assets/pages-BHkaRTzj.css","assets/_...all_-fHhcuF9K.js","assets/audio-record-DfNNs2vE.js","assets/background-gradient-blending-DV35Xxp1.js","assets/browser-2lyKKTPE.js","assets/BasicInputFile-C2AMSzxu.js","assets/background-gradient-blending-B88qVe8m.css","assets/background-removal-SpmG5Lvm.js","assets/InputFile-CjPYZ8S-.js","assets/beat-sync-CMy6-y_I.js","assets/gesture-circle-Dz-6GhkK.js","assets/image-CCjIWUuW.js","assets/image-DolN1ewS.css","assets/polaroid-DwT_lq0B.js","assets/providers-transcription-realtime-aliyun-nls-5fvDNN_K.js","assets/use-magic-keys-NMOzQ56z.js","assets/vibrant-DaA7KX3v.js","assets/settings-DinwczH5.js","assets/use-ripple-grid-state-DcESPJAf.js","assets/airi-card-DD-Ao_D4.js","assets/CardCreationDialog-B2njkXhJ.js","assets/CardCreationDialog-BEG0qYyE.css","assets/DeleteCardDialog-Bby7Qwvm.js","assets/CardCreate-CdxiTrqh.js","assets/CardDetailDialog-BFPxHsY4.js","assets/CardListItem-D0jnzgCC.js","assets/CardCreate-CQTxdn4D.js","assets/CardCreationDialog-cN7py1P6.js","assets/CardDetailDialog-CsobWwkt.js","assets/CardListItem-CRpic1C1.js","assets/DeleteCardDialog-DkR1Cc9E.js","assets/data-gBWwTXY5.js","assets/onboarding-DCg6WaMD.js","assets/memory-C9clolgI.js","assets/models-DCzLlqM2.js","assets/modules-QYm9z3UJ.js","assets/beat-sync-BiFnmXe_.js","assets/consciousness-C5rSlsFJ.js","assets/gaming-factorio-l8EQ5MQM.js","assets/gaming-minecraft-DfdBhRo1.js","assets/hearing-D9i_dzhe.js","assets/memory-long-term-CtgFbvBe.js","assets/memory-short-term-Dgai2Btn.js","assets/messaging-discord-8qKSV5dK.js","assets/speech-DYSGLno_.js","assets/vision-CkbueePt.js","assets/x-DOlEMeNX.js","assets/providers-CGUDsN-A.js","assets/_providerId_-DkkPbN-6.js","assets/use-provider-validation-DbXr83wX.js","assets/azure-ai-foundry-J2oDBayK.js","assets/cloudflare-workers-ai-Cx078Khx.js","assets/lm-studio-Dqkjrkzg.js","assets/ollama-CMuzyH-X.js","assets/alibaba-cloud-model-studio-y2JPUG5u.js","assets/comet-api-speech-bC6Lt6Xh.js","assets/elevenlabs-C4xZyC-g.js","assets/index-tts-vllm-CL4142hK.js","assets/microsoft-speech-wTQgkZ27.js","assets/openai-audio-speech-BC1Afz1l.js","assets/openai-compatible-audio-speech-DSAFQ68v.js","assets/player2-speech-Bb53Rejb.js","assets/volcengine-3lrl6sUc.js","assets/aliyun-nls-transcription-BDaEju68.js","assets/comet-api-transcription-B8mNI5J9.js","assets/openai-audio-transcription-DPdPA8Wy.js","assets/openai-compatible-audio-transcription-Dr6AdUfM.js","assets/scene-1FHG2Mso.js","assets/system-DxqKh5f_.js","assets/color-scheme-CBrwAUe-.js","assets/color-scheme-B_nVc7uH.css","assets/developer-DhPQaokR.js","assets/general-BGIB4bwV.js"])))=>i.map(i=>d[i]); +import{o as e,t}from"./chunk-B78Zgmat.js";import{A as n,B as r,C as i,D as a,G as o,H as s,I as c,J as l,K as u,Mt as d,Nt as f,O as p,Pt as m,Q as h,S as g,W as _,Y as v,at as y,b,et as ee,gt as x,h as S,i as te,jt as C,k as w,kt as T,lt as E,m as D,ot as O,w as k,wt as A,x as j,xt as M,z as ne}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import{r as re}from"./tres-Bk8ucvrj.js";import{C as N}from"./widgets-C0YByt49.js";import{t as ie}from"./src-DYQXbDgu.js";import{a as ae,i as P,r as F}from"./resettable-CbXzRviW.js";import{n as oe,t as I}from"./preload-helper-Dn1uWANL.js";import{i as se,n as ce,o as le,r as ue}from"./vue-router-Chhv6vZu.js";import"./environment-CyZLTg97.js";import{t as L}from"./_plugin-vue_export-helper-DGA9ry_j.js";import{a as de,i as fe,t as R}from"./dist-Che88T83.js";import"./src-C83SCWbW.js";import{ct as pe,r as me,t as he}from"./components-CeE-UiLT.js";import"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import{n as ge,t as _e}from"./vue-i18n.runtime-Dah5zGm4.js";import"./stream-transcription-_Xuw_VzN.js";import{E as ve,a as ye,n as z}from"./settings-73vyHOZs.js";import"./__vite-browser-external-BaycPy5b.js";import{t as be}from"./onboarding-DCg6WaMD.js";import{n as xe,t as Se}from"./chat-CxQ_IGrj.js";import"./airi-card-DuhaYjQU.js";import"./hearing-BH9rth_f.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var Ce=e(t(((e,t)=>{(function(n,r){typeof define==`function`&&define.amd?define(r):typeof e==`object`?t.exports=r():n.NProgress=r()})(e,function(){var e={};e.version=`0.2.0`;var t=e.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:`
`};e.configure=function(e){var n,r;for(n in e)r=e[n],r!==void 0&&e.hasOwnProperty(n)&&(t[n]=r);return this},e.status=null,e.set=function(r){var s=e.isStarted();r=n(r,t.minimum,1),e.status=r===1?null:r;var c=e.render(!s),l=c.querySelector(t.barSelector),u=t.speed,d=t.easing;return c.offsetWidth,a(function(n){t.positionUsing===``&&(t.positionUsing=e.getPositioningCSS()),o(l,i(r,u,d)),r===1?(o(c,{transition:`none`,opacity:1}),c.offsetWidth,setTimeout(function(){o(c,{transition:`all `+u+`ms linear`,opacity:0}),setTimeout(function(){e.remove(),n()},u)},u)):setTimeout(n,u)}),this},e.isStarted=function(){return typeof e.status==`number`},e.start=function(){e.status||e.set(0);var n=function(){setTimeout(function(){e.status&&(e.trickle(),n())},t.trickleSpeed)};return t.trickle&&n(),this},e.done=function(t){return!t&&!e.status?this:e.inc(.3+.5*Math.random()).set(1)},e.inc=function(t){var r=e.status;return r?(typeof t!=`number`&&(t=(1-r)*n(Math.random()*r,.1,.95)),r=n(r+t,0,.994),e.set(r)):e.start()},e.trickle=function(){return e.inc(Math.random()*t.trickleRate)},(function(){var t=0,n=0;e.promise=function(r){return!r||r.state()===`resolved`?this:(n===0&&e.start(),t++,n++,r.always(function(){n--,n===0?(t=0,e.done()):e.set((t-n)/t)}),this)}})(),e.render=function(n){if(e.isRendered())return document.getElementById(`nprogress`);c(document.documentElement,`nprogress-busy`);var i=document.createElement(`div`);i.id=`nprogress`,i.innerHTML=t.template;var a=i.querySelector(t.barSelector),s=n?`-100`:r(e.status||0),l=document.querySelector(t.parent),u;return o(a,{transition:`all 0 linear`,transform:`translate3d(`+s+`%,0,0)`}),t.showSpinner||(u=i.querySelector(t.spinnerSelector),u&&d(u)),l!=document.body&&c(l,`nprogress-custom-parent`),l.appendChild(i),i},e.remove=function(){l(document.documentElement,`nprogress-busy`),l(document.querySelector(t.parent),`nprogress-custom-parent`);var e=document.getElementById(`nprogress`);e&&d(e)},e.isRendered=function(){return!!document.getElementById(`nprogress`)},e.getPositioningCSS=function(){var e=document.body.style,t=`WebkitTransform`in e?`Webkit`:`MozTransform`in e?`Moz`:`msTransform`in e?`ms`:`OTransform`in e?`O`:``;return t+`Perspective`in e?`translate3d`:t+`Transform`in e?`translate`:`margin`};function n(e,t,n){return en?n:e}function r(e){return(-1+e)*100}function i(e,n,i){var a=t.positionUsing===`translate3d`?{transform:`translate3d(`+r(e)+`%,0,0)`}:t.positionUsing===`translate`?{transform:`translate(`+r(e)+`%,0)`}:{"margin-left":r(e)+`%`};return a.transition=`all `+n+`ms `+i,a}var a=(function(){var e=[];function t(){var n=e.shift();n&&n(t)}return function(n){e.push(n),e.length==1&&t()}})(),o=(function(){var e=[`Webkit`,`O`,`Moz`,`ms`],t={};function n(e){return e.replace(/^-ms-/,`ms-`).replace(/-([\da-z])/gi,function(e,t){return t.toUpperCase()})}function r(t){var n=document.body.style;if(t in n)return t;for(var r=e.length,i=t.charAt(0).toUpperCase()+t.slice(1),a;r--;)if(a=e[r]+i,a in n)return a;return t}function i(e){return e=n(e),t[e]||(t[e]=r(e))}function a(e,t,n){t=i(t),e.style[t]=n}return function(e,t){var n=arguments,r,i;if(n.length==2)for(r in t)i=t[r],i!==void 0&&t.hasOwnProperty(r)&&a(e,r,i);else a(e,n[1],n[2])}})();function s(e,t){return(typeof e==`string`?e:u(e)).indexOf(` `+t+` `)>=0}function c(e,t){var n=u(e),r=n+t;s(n,t)||(e.className=r.substring(1))}function l(e,t){var n=u(e),r;s(e,t)&&(r=n.replace(` `+t+` `,` `),e.className=r.substring(1,r.length-1))}function u(e){return(` `+(e.className||``)+` `).replace(/\s+/gi,` `)}function d(e){e&&e.parentNode&&e.parentNode.removeChild(e)}return e})}))(),1),we=new Set,B=new WeakMap,V=new WeakMap,H=new WeakMap,Te=new WeakMap,Ee=new WeakMap,De=new WeakMap,U=new WeakMap,W=new WeakMap,G=new WeakSet,K,Oe=0,ke=0,q=`__aa_tgt`,Ae=`__aa_del`,je=`__aa_new`,Me=e=>{let t=Be(e);t&&t.forEach(e=>He(e))},Ne=e=>{e.forEach(e=>{e.target===K&&Ie(),B.has(e.target)&&J(e.target)})};function Pe(e){let t=e.getBoundingClientRect(),n=K?.clientWidth||0,r=K?.clientHeight||0;return t.bottom<0||t.top>r||t.right<0||t.left>n}function Fe(e){Te.get(e)?.disconnect();let t=B.get(e),n=0;t||(t=Z(e),B.set(e,t));let{offsetWidth:r,offsetHeight:i}=K,a=[t.top-5,r-(t.left+5+t.width),i-(t.top+5+t.height),t.left-5].map(e=>`${-1*Math.floor(e)}px`).join(` `),o=new IntersectionObserver(()=>{++n>1&&J(e)},{root:K,threshold:1,rootMargin:a});o.observe(e),Te.set(e,o)}function J(e,t=!0){clearTimeout(W.get(e));let n=Ge(e),r=t?Xe(n)?500:n.duration:0;W.set(e,setTimeout(async()=>{let t=H.get(e);try{await t?.finished,B.set(e,Z(e)),Fe(e)}catch{}},r))}function Ie(){clearTimeout(W.get(K)),W.set(K,setTimeout(()=>{we.forEach(e=>Je(e,e=>Re(()=>J(e))))},100))}function Le(e){setTimeout(()=>{De.set(e,setInterval(()=>Re(J.bind(null,e)),2e3))},Math.round(2e3*Math.random()))}function Re(e){typeof requestIdleCallback==`function`?requestIdleCallback(()=>e()):requestAnimationFrame(()=>e())}var Y,ze=typeof window<`u`&&`ResizeObserver`in window;ze&&(K=document.documentElement,new MutationObserver(Me),Y=new ResizeObserver(Ne),window.addEventListener(`scroll`,()=>{ke=window.scrollY,Oe=window.scrollX}),Y.observe(K));function Be(e){return e.reduce((e,t)=>[...e,...Array.from(t.addedNodes),...Array.from(t.removedNodes)],[]).every(e=>e.nodeName===`#comment`)?!1:e.reduce((e,t)=>{if(e===!1)return!1;if(t.target instanceof Element){if(Ve(t.target),!e.has(t.target)){e.add(t.target);for(let n=0;nt(e,U.has(e)));for(let n=0;ne(r,U.has(r)))}}function Ye(e){return Array.isArray(e)?e:[e]}function Xe(e){return typeof e==`function`}function Ze(e){let t=B.get(e),n=Z(e);if(!qe(e))return B.set(e,n);if(Pe(e)){B.set(e,n),Fe(e);return}let r;if(!t)return;let i=Ge(e);if(typeof i!=`function`){let a=t.left-n.left,o=t.top-n.top,s=t.left+t.width-(n.left+n.width);t.top+t.height-(n.top+n.height)==0&&(o=0),s==0&&(a=0);let[c,l,u,d]=We(e,t,n),f={transform:`translate(${a}px, ${o}px)`},p={transform:`translate(0, 0)`};c!==l&&(f.width=`${c}px`,p.width=`${l}px`),u!==d&&(f.height=`${u}px`,p.height=`${d}px`),r=e.animate([f,p],{duration:i.duration,easing:i.easing})}else{let[a]=Ye(i(e,`remain`,t,n));r=new Animation(a),r.play()}H.set(e,r),B.set(e,n),r.addEventListener(`finish`,J.bind(null,e,!1),{once:!0})}function Qe(e){je in e&&delete e[je];let t=Z(e);B.set(e,t);let n=Ge(e);if(!qe(e))return;if(Pe(e)){Fe(e);return}let r;if(typeof n!=`function`)r=e.animate([{transform:`scale(.98)`,opacity:0},{transform:`scale(0.98)`,opacity:0,offset:.5},{transform:`scale(1)`,opacity:1}],{duration:n.duration*1.5,easing:`ease-in`});else{let[i]=Ye(n(e,`add`,t));r=new Animation(i),r.play()}H.set(e,r),r.addEventListener(`finish`,J.bind(null,e,!1),{once:!0})}function $e(e,t){var n;e.remove(),B.delete(e),V.delete(e),H.delete(e),(n=Te.get(e))==null||n.disconnect(),setTimeout(()=>{if(Ae in e&&delete e[Ae],Object.defineProperty(e,je,{value:!0,configurable:!0}),t&&e instanceof HTMLElement)for(let n in t)e.style[n]=``},0)}function et(e){var t;if(!V.has(e)||!B.has(e))return;let[n,r]=V.get(e);Object.defineProperty(e,Ae,{value:!0,configurable:!0});let i=window.scrollX,a=window.scrollY;if(r&&r.parentNode&&r.parentNode instanceof Element?r.parentNode.insertBefore(e,r):n&&n.parentNode?n.parentNode.appendChild(e):(t=Ke(e))==null||t.appendChild(e),!qe(e))return $e(e);let[o,s,c,l]=nt(e),u=Ge(e),d=B.get(e);(i!==Oe||a!==ke)&&tt(e,i,a,u);let f,p={position:`absolute`,top:`${o}px`,left:`${s}px`,width:`${c}px`,height:`${l}px`,margin:`0`,pointerEvents:`none`,transformOrigin:`center`,zIndex:`100`};if(!Xe(u))Object.assign(e.style,p),f=e.animate([{transform:`scale(1)`,opacity:1},{transform:`scale(.98)`,opacity:0}],{duration:u.duration,easing:`ease-out`});else{let[t,n]=Ye(u(e,`remove`,d));n?.styleReset!==!1&&(p=n?.styleReset||p,Object.assign(e.style,p)),f=new Animation(t),f.play()}H.set(e,f),f.addEventListener(`finish`,()=>$e(e,p),{once:!0})}function tt(e,t,n,r){let i=Oe-t,a=ke-n,o=document.documentElement.style.scrollBehavior;if(getComputedStyle(K).scrollBehavior===`smooth`&&(document.documentElement.style.scrollBehavior=`auto`),window.scrollTo(window.scrollX+i,window.scrollY+a),!e.parentElement)return;let s=e.parentElement,c=s.clientHeight,l=s.clientWidth,u=performance.now();function d(){requestAnimationFrame(()=>{if(!Xe(r)){let e=c-s.clientHeight,t=l-s.clientWidth;u+r.duration>performance.now()?(window.scrollTo({left:window.scrollX-t,top:window.scrollY-e}),c=s.clientHeight,l=s.clientWidth,d()):document.documentElement.style.scrollBehavior=o}})}d()}function nt(e){let t=B.get(e),[n,,r]=We(e,t,Z(e)),i=e.parentElement;for(;i&&(getComputedStyle(i).position===`static`||i instanceof HTMLBodyElement);)i=i.parentElement;i||=document.body;let a=getComputedStyle(i),o=!H.has(e)||H.get(e)?.playState===`finished`?Z(i):B.get(i);return[Math.round(t.top-o.top)-X(a.borderTopWidth),Math.round(t.left-o.left)-X(a.borderLeftWidth),n,r]}function rt(e,t={}){if(ze&&Y&&!(window.matchMedia(`(prefers-reduced-motion: reduce)`).matches&&!Xe(t)&&!t.disrespectUserMotionPreference)){G.add(e),getComputedStyle(e).position===`static`&&Object.assign(e.style,{position:`relative`}),Je(e,J,Le,e=>Y?.observe(e)),Xe(t)?U.set(e,t):U.set(e,{duration:250,easing:`ease-in-out`,...t});let n=new MutationObserver(Me);n.observe(e,{childList:!0}),Ee.set(e,n),we.add(e)}return Object.freeze({parent:e,enable:()=>{G.add(e)},disable:()=>{G.delete(e),Je(e,e=>{let t=H.get(e);try{t?.cancel()}catch{}H.delete(e);let n=W.get(e);n&&clearTimeout(n),W.delete(e);let r=De.get(e);r&&clearInterval(r),De.delete(e)})},isEnabled:()=>G.has(e),destroy:()=>{G.delete(e),we.delete(e),U.delete(e),Ee.get(e)?.disconnect(),Ee.delete(e),Je(e,e=>{Y?.unobserve(e);let t=H.get(e);try{t?.cancel()}catch{}H.delete(e),Te.get(e)?.disconnect(),Te.delete(e);let n=De.get(e);n&&clearInterval(n),De.delete(e);let r=W.get(e);r&&clearTimeout(r),W.delete(e),B.delete(e),V.delete(e)})}})}function it(e){return{mounted(t,n){let r={},i=n.value;r=typeof i==`function`?i:typeof e==`function`?e:{...e||{},...i||{}};let a=rt(t,r);Object.defineProperty(t,`__aa_ctl`,{value:a,configurable:!0})},unmounted(e){var t;let n=e.__aa_ctl;(t=n?.destroy)==null||t.call(n);try{delete e.__aa_ctl}catch{}},getSSRProps:()=>({})}}var at={install(e,t){e.directive(`auto-animate`,it(t))}};oe();const ot=e=>{let t={};Object.entries({"/src/layouts/default.vue":()=>I(()=>import(`./default-CTPUQ2Uf.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9])),"/src/layouts/home.vue":()=>I(()=>import(`./home-BH9GCqHR.js`),__vite__mapDeps([10,4,5,8])),"/src/layouts/plain.vue":()=>I(()=>import(`./plain-B9tCnS2r.js`),__vite__mapDeps([11,2,4,5])),"/src/layouts/settings.vue":()=>I(()=>import(`./settings-HCl6bqsC.js`),__vite__mapDeps([12,1,2,3,4,5,6,7,8,9,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33])),"/src/layouts/stage.vue":()=>I(()=>import(`./stage-DZQk1vzw.js`),__vite__mapDeps([34,4,5,8]))}).forEach(([e,n])=>{let r=e.replace(`/src/layouts/`,``).replace(`.vue`,``);t[r]=n});function n(e,r=!0){return e.map(e=>{if(e.children?.length>0&&(e.children=n(e.children,!1)),r){if(!e.component&&e.children?.find(e=>(e.path===``||e.path===`/`)&&e.meta?.isLayout))return e;if(e.meta?.layout!==!1)return{path:e.path,component:t[e.meta?.layout||`default`],children:e.path===`/`?[e]:[{...e,path:``}],meta:{isLayout:!0}}}return e.meta?.layout?{path:e.path,component:t[e.meta?.layout],children:[{...e,path:``}],meta:{isLayout:!0}}:e})}return n(e)};oe();const st=[{path:`/`,name:`IndexScenePage`,component:()=>I(()=>import(`./pages-DZRbeQEX.js`),__vite__mapDeps([35,2,36,1,3,4,5,6,7,8,9,13,14,15,37,23,16,17,38,39,19,20,21,40,41,29,25,42,24,26,43,44,22,18,27,28,30,31,32,33,45,46,47,48,49,50,51,52,53,54,55,56])),meta:{layout:`stage`,stageTransition:{name:`bubble-wave-out`}}},{path:`/:all(.*)`,name:`/[...all]`,component:()=>I(()=>import(`./_...all_-fHhcuF9K.js`),__vite__mapDeps([57,3,2,4,5,6,7,8]))},{path:`/devtools`,children:[{path:`audio-record`,name:`/devtools/audio-record`,component:()=>I(()=>import(`./audio-record-DfNNs2vE.js`),__vite__mapDeps([58,4,5,6,31,32]))},{path:`background-gradient-blending`,name:`/devtools/background-gradient-blending`,component:()=>I(()=>import(`./background-gradient-blending-DV35Xxp1.js`),__vite__mapDeps([59,2,13,3,4,5,6,7,14,15,60,20,61,62]))},{path:`background-removal`,name:`/devtools/background-removal`,component:()=>I(()=>import(`./background-removal-SpmG5Lvm.js`),__vite__mapDeps([63,3,2,4,5,6,7,50,23,28,64,61]))},{path:`beat-sync`,name:`/devtools/beat-sync`,component:()=>I(()=>import(`./beat-sync-CMy6-y_I.js`),__vite__mapDeps([65,16,14,17,3,2,4,5,6,7,19,20,21,22,23,18,15,24,25,8,26,27,28,29,30,31,32,33,43]))},{path:`gesture-circle`,name:`/devtools/gesture-circle`,component:()=>I(()=>import(`./gesture-circle-Dz-6GhkK.js`),__vite__mapDeps([66,36,4,5,6])),meta:{layout:`plain`}},{path:`image`,name:`/devtools/image`,component:()=>I(()=>import(`./image-CCjIWUuW.js`),__vite__mapDeps([67,2,4,5,6,68]))},{path:`polaroid`,name:`/devtools/polaroid`,component:()=>I(()=>import(`./polaroid-DwT_lq0B.js`),__vite__mapDeps([69,37,23,5,16,14,17,38,39,3,2,4,6,7,19,20,21,40,41,29,25,42,24,8,26,43,44,22,18,15,27,28,30,31,32,33,45,46,47,48,49,52,53]))},{path:`providers-transcription-realtime-aliyun-nls`,name:`/devtools/providers-transcription-realtime-aliyun-nls`,component:()=>I(()=>import(`./providers-transcription-realtime-aliyun-nls-5fvDNN_K.js`),__vite__mapDeps([70,36,16,14,17,3,2,4,5,6,7,53,54])),meta:{layout:`settings`}},{path:`use-magic-keys`,name:`/devtools/use-magic-keys`,component:()=>I(()=>import(`./use-magic-keys-NMOzQ56z.js`),__vite__mapDeps([71,4,5,6]))},{path:`vibrant`,name:`/devtools/vibrant`,component:()=>I(()=>import(`./vibrant-DaA7KX3v.js`),__vite__mapDeps([72,3,2,4,5,6,7,60,64,61]))}]},{path:`/settings`,children:[{path:``,name:`/settings/`,component:()=>I(()=>import(`./settings-DinwczH5.js`),__vite__mapDeps([73,36,16,14,17,3,2,4,5,6,7,18,19,20,21,22,23,15,24,25,8,26,27,28,29,30,31,32,33,74])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`airi-card`,children:[{path:``,name:`/settings/airi-card/`,component:()=>I(()=>import(`./airi-card-DD-Ao_D4.js`),__vite__mapDeps([75,36,16,14,17,3,2,4,5,6,7,18,19,20,21,22,23,15,24,25,8,26,27,28,29,30,31,32,33,76,49,77,78,79,80,81,64,61])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`components`,children:[{path:`CardCreate`,name:`/settings/airi-card/components/CardCreate`,component:()=>I(()=>import(`./CardCreate-CQTxdn4D.js`),__vite__mapDeps([82,79,18,4,5]))},{path:`CardCreationDialog`,name:`/settings/airi-card/components/CardCreationDialog`,component:()=>I(()=>import(`./CardCreationDialog-cN7py1P6.js`),__vite__mapDeps([83,16,14,17,3,2,4,5,6,7,76,18,25,29,49,27,28,21,77]))},{path:`CardDetailDialog`,name:`/settings/airi-card/components/CardDetailDialog`,component:()=>I(()=>import(`./CardDetailDialog-CsobWwkt.js`),__vite__mapDeps([84,16,14,17,3,2,4,5,6,7,27,18,28,21,29,25,30,78,80,49]))},{path:`CardListItem`,name:`/settings/airi-card/components/CardListItem`,component:()=>I(()=>import(`./CardListItem-CRpic1C1.js`),__vite__mapDeps([85,16,14,17,3,2,4,5,6,7,19,20,21,22,23,18,15,24,25,8,26,27,28,29,30,31,32,33,81]))},{path:`DeleteCardDialog`,name:`/settings/airi-card/components/DeleteCardDialog`,component:()=>I(()=>import(`./DeleteCardDialog-DkR1Cc9E.js`),__vite__mapDeps([86,3,2,4,5,6,7,78,18,25]))}]}]},{path:`data`,children:[{path:``,name:`/settings/data/`,component:()=>I(()=>import(`./data-gBWwTXY5.js`),__vite__mapDeps([87,36,16,14,17,3,2,4,5,6,7,18,19,20,21,22,23,15,24,25,8,26,27,28,29,30,31,32,33,45,46,47,48,49,52,53,44,88])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}}]},{path:`memory`,children:[{path:``,name:`/settings/memory/`,component:()=>I(()=>import(`./memory-C9clolgI.js`),__vite__mapDeps([89,36,16,14,17,3,2,4,5,6,7,19,20,21,22,23,18,15,24,25,8,26,27,28,29,30,31,32,33])),meta:{layout:`settings`,stageTransition:{name:`slide`}}}]},{path:`models`,children:[{path:``,name:`/settings/models/`,component:()=>I(()=>import(`./models-DCzLlqM2.js`),__vite__mapDeps([90,36,3,2,4,5,6,7,18,19,20,17,21,41,29,25,40,42,24,8,26,43,44,60])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}}]},{path:`modules`,children:[{path:``,name:`/settings/modules/`,component:()=>I(()=>import(`./modules-QYm9z3UJ.js`),__vite__mapDeps([91,36,16,14,17,3,2,4,5,6,7,18,19,20,21,41,29,25,22,23,15,24,8,26,27,28,30,31,32,33,74])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}},{path:`beat-sync`,name:`/settings/modules/beat-sync`,component:()=>I(()=>import(`./beat-sync-BiFnmXe_.js`),__vite__mapDeps([92,36,16,14,17,3,2,4,5,6,7,18,19,20,21,41,29,25,22,23,15,24,8,26,27,28,30,31,32,33])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`consciousness`,name:`/settings/modules/consciousness`,component:()=>I(()=>import(`./consciousness-C5rSlsFJ.js`),__vite__mapDeps([93,36,16,14,17,3,2,4,5,6,7,18,19,20,21,22,23,15,24,25,8,26,27,28,29,30,31,32,33])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`gaming-factorio`,name:`/settings/modules/gaming-factorio`,component:()=>I(()=>import(`./gaming-factorio-l8EQ5MQM.js`),__vite__mapDeps([94,36,16,14,17,3,2,4,5,6,7,19,20,21,22,23,18,15,24,25,8,26,27,28,29,30,31,32,33])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}},{path:`gaming-minecraft`,name:`/settings/modules/gaming-minecraft`,component:()=>I(()=>import(`./gaming-minecraft-DfdBhRo1.js`),__vite__mapDeps([95,36,16,14,17,3,2,4,5,6,7,19,20,21,22,23,18,15,24,25,8,26,27,28,29,30,31,32,33])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}},{path:`hearing`,name:`/settings/modules/hearing`,component:()=>I(()=>import(`./hearing-D9i_dzhe.js`),__vite__mapDeps([96,36,16,14,17,3,2,4,5,6,7,50,23,18,19,20,21,22,15,24,25,8,26,27,28,29,30,31,32,33,51,52,53,54])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`memory-long-term`,name:`/settings/modules/memory-long-term`,component:()=>I(()=>import(`./memory-long-term-CtgFbvBe.js`),__vite__mapDeps([97,36,4,5])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`memory-short-term`,name:`/settings/modules/memory-short-term`,component:()=>I(()=>import(`./memory-short-term-Dgai2Btn.js`),__vite__mapDeps([98,36,4,5])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`messaging-discord`,name:`/settings/modules/messaging-discord`,component:()=>I(()=>import(`./messaging-discord-8qKSV5dK.js`),__vite__mapDeps([99,36,16,14,17,3,2,4,5,6,7,19,20,21,22,23,18,15,24,25,8,26,27,28,29,30,31,32,33])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}},{path:`speech`,name:`/settings/modules/speech`,component:()=>I(()=>import(`./speech-DYSGLno_.js`),__vite__mapDeps([100,36,16,14,17,3,2,4,5,6,7,18,19,20,21,22,23,15,24,25,8,26,27,28,29,30,31,32,33,55])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`vision`,name:`/settings/modules/vision`,component:()=>I(()=>import(`./vision-CkbueePt.js`),__vite__mapDeps([101,36,16,14,17,3,2,4,5,6,7,19,20,21,22,23,18,15,24,25,8,26,27,28,29,30,31,32,33])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}},{path:`x`,name:`/settings/modules/x`,component:()=>I(()=>import(`./x-DOlEMeNX.js`),__vite__mapDeps([102,36,16,14,17,3,2,4,5,6,7,19,20,21,22,23,18,15,24,25,8,26,27,28,29,30,31,32,33])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}}]},{path:`providers`,children:[{path:``,name:`/settings/providers/`,component:()=>I(()=>import(`./providers-CGUDsN-A.js`),__vite__mapDeps([103,36,16,14,17,3,2,4,5,6,7,19,20,21,22,23,18,15,24,25,8,26,27,28,29,30,31,32,33,74])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}},{path:`chat`,children:[{path:`:providerId`,name:`/settings/providers/chat/[providerId]`,component:()=>I(()=>import(`./_providerId_-DkkPbN-6.js`),__vite__mapDeps([104,36,16,14,17,3,2,4,5,6,7,19,20,21,22,23,18,15,24,25,8,26,27,28,29,30,31,32,33,105])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`azure-ai-foundry`,name:`/settings/providers/chat/azure-ai-foundry`,component:()=>I(()=>import(`./azure-ai-foundry-J2oDBayK.js`),__vite__mapDeps([106,36,16,14,17,3,2,4,5,6,7,19,20,21,22,23,18,15,24,25,8,26,27,28,29,30,31,32,33,105])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`cloudflare-workers-ai`,name:`/settings/providers/chat/cloudflare-workers-ai`,component:()=>I(()=>import(`./cloudflare-workers-ai-Cx078Khx.js`),__vite__mapDeps([107,36,16,14,17,3,2,4,5,6,7,19,20,21,22,23,18,15,24,25,8,26,27,28,29,30,31,32,33,105])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`lm-studio`,name:`/settings/providers/chat/lm-studio`,component:()=>I(()=>import(`./lm-studio-Dqkjrkzg.js`),__vite__mapDeps([108,36,16,14,17,3,2,4,5,6,7,19,20,21,22,23,18,15,24,25,8,26,27,28,29,30,31,32,33,105])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`ollama`,name:`/settings/providers/chat/ollama`,component:()=>I(()=>import(`./ollama-CMuzyH-X.js`),__vite__mapDeps([109,36,16,14,17,3,2,4,5,6,7,19,20,21,22,23,18,15,24,25,8,26,27,28,29,30,31,32,33,105])),meta:{layout:`settings`,stageTransition:{name:`slide`}}}]},{path:`speech`,children:[{path:`alibaba-cloud-model-studio`,name:`/settings/providers/speech/alibaba-cloud-model-studio`,component:()=>I(()=>import(`./alibaba-cloud-model-studio-y2JPUG5u.js`),__vite__mapDeps([110,36,16,14,17,3,2,4,5,6,7,18,19,20,21,22,23,15,24,25,8,26,27,28,29,30,31,32,33])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`comet-api-speech`,name:`/settings/providers/speech/comet-api-speech`,component:()=>I(()=>import(`./comet-api-speech-bC6Lt6Xh.js`),__vite__mapDeps([111,36,16,14,17,3,2,4,5,6,7,18,19,20,21,22,23,15,24,25,8,26,27,28,29,30,31,32,33])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`elevenlabs`,name:`/settings/providers/speech/elevenlabs`,component:()=>I(()=>import(`./elevenlabs-C4xZyC-g.js`),__vite__mapDeps([112,36,16,14,17,3,2,4,5,6,7,18,19,20,21,22,23,15,24,25,8,26,27,28,29,30,31,32,33])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`index-tts-vllm`,name:`/settings/providers/speech/index-tts-vllm`,component:()=>I(()=>import(`./index-tts-vllm-CL4142hK.js`),__vite__mapDeps([113,36,16,14,17,3,2,4,5,6,7,19,20,21,22,23,18,15,24,25,8,26,27,28,29,30,31,32,33])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`microsoft-speech`,name:`/settings/providers/speech/microsoft-speech`,component:()=>I(()=>import(`./microsoft-speech-wTQgkZ27.js`),__vite__mapDeps([114,36,16,14,17,3,2,4,5,6,7,18,19,20,21,22,23,15,24,25,8,26,27,28,29,30,31,32,33])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`openai-audio-speech`,name:`/settings/providers/speech/openai-audio-speech`,component:()=>I(()=>import(`./openai-audio-speech-BC1Afz1l.js`),__vite__mapDeps([115,36,16,14,17,3,2,4,5,6,7,18,19,20,21,22,23,15,24,25,8,26,27,28,29,30,31,32,33])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`openai-compatible-audio-speech`,name:`/settings/providers/speech/openai-compatible-audio-speech`,component:()=>I(()=>import(`./openai-compatible-audio-speech-DSAFQ68v.js`),__vite__mapDeps([116,36,16,14,17,3,2,4,5,6,7,19,20,21,22,23,18,15,24,25,8,26,27,28,29,30,31,32,33,105])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`player2-speech`,name:`/settings/providers/speech/player2-speech`,component:()=>I(()=>import(`./player2-speech-Bb53Rejb.js`),__vite__mapDeps([117,36,16,14,17,3,2,4,5,6,7,18,19,20,21,22,23,15,24,25,8,26,27,28,29,30,31,32,33])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`volcengine`,name:`/settings/providers/speech/volcengine`,component:()=>I(()=>import(`./volcengine-3lrl6sUc.js`),__vite__mapDeps([118,36,16,14,17,3,2,4,5,6,7,18,19,20,21,22,23,15,24,25,8,26,27,28,29,30,31,32,33])),meta:{layout:`settings`,stageTransition:{name:`slide`}}}]},{path:`transcription`,children:[{path:`aliyun-nls-transcription`,name:`/settings/providers/transcription/aliyun-nls-transcription`,component:()=>I(()=>import(`./aliyun-nls-transcription-BDaEju68.js`),__vite__mapDeps([119,36,16,14,17,3,2,4,5,6,7,19,20,21,22,23,18,15,24,25,8,26,27,28,29,30,31,32,33,52,53,105,54])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`comet-api-transcription`,name:`/settings/providers/transcription/comet-api-transcription`,component:()=>I(()=>import(`./comet-api-transcription-B8mNI5J9.js`),__vite__mapDeps([120,36,16,14,17,3,2,4,5,6,7,19,20,21,22,23,18,15,24,25,8,26,27,28,29,30,31,32,33,52,53,105])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`openai-audio-transcription`,name:`/settings/providers/transcription/openai-audio-transcription`,component:()=>I(()=>import(`./openai-audio-transcription-DPdPA8Wy.js`),__vite__mapDeps([121,36,16,14,17,3,2,4,5,6,7,19,20,21,22,23,18,15,24,25,8,26,27,28,29,30,31,32,33,52,53])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`openai-compatible-audio-transcription`,name:`/settings/providers/transcription/openai-compatible-audio-transcription`,component:()=>I(()=>import(`./openai-compatible-audio-transcription-Dr6AdUfM.js`),__vite__mapDeps([122,36,16,14,17,3,2,4,5,6,7,19,20,21,22,23,18,15,24,25,8,26,27,28,29,30,31,32,33,52,53,105])),meta:{layout:`settings`,stageTransition:{name:`slide`}}}]}]},{path:`scene`,children:[{path:``,name:`/settings/scene/`,component:()=>I(()=>import(`./scene-1FHG2Mso.js`),__vite__mapDeps([123,36,16,14,17,3,2,4,5,6,7,19,20,21,22,23,18,15,24,25,8,26,27,28,29,30,31,32,33])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}}]},{path:`system`,children:[{path:``,name:`/settings/system/`,component:()=>I(()=>import(`./system-DxqKh5f_.js`),__vite__mapDeps([124,36,16,14,17,3,2,4,5,6,7,18,19,20,21,22,23,15,24,25,8,26,27,28,29,30,31,32,33,74])),meta:{layout:`settings`,stageTransition:{name:`slide`,pageSpecificAvailable:!0}}},{path:`color-scheme`,name:`/settings/system/color-scheme`,component:()=>I(()=>import(`./color-scheme-CBrwAUe-.js`),__vite__mapDeps([125,2,36,16,14,17,3,4,5,6,7,18,19,20,21,22,23,15,24,25,8,26,27,28,29,30,31,32,33,126])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`developer`,name:`/settings/system/developer`,component:()=>I(()=>import(`./developer-DhPQaokR.js`),__vite__mapDeps([127,36,16,14,17,3,2,4,5,6,7,18,19,20,21,22,23,15,24,25,8,26,27,28,29,30,31,32,33])),meta:{layout:`settings`,stageTransition:{name:`slide`}}},{path:`general`,name:`/settings/system/general`,component:()=>I(()=>import(`./general-BGIB4bwV.js`),__vite__mapDeps([128,36,3,2,4,5,6,7,18,19,20,17,21])),meta:{layout:`settings`,stageTransition:{name:`slide`}}}]}]}];var ct=!1;function lt(){if(ct)return{dispose:()=>{}};let e=xe(),t=pe(),{post:n,data:r}=de({name:Se}),i=y(r,t=>{t&&e.ingestContextMessage(t)}),a=e.onContextPublish((e,r)=>{r!==`broadcast`&&n(e),r===`local`&&t.sendContextUpdate(e)});t.initialize({possibleEvents:[`context:update`]}).catch(e=>console.error(`Context bridge init error:`,e));let o=t.onContextUpdate(t=>{let r=t.data;e.ingestContextMessage(r),n(r)});return ct=!0,{dispose:()=>{i(),a(),o?.(),ct=!1}}}var ut=L(n({__name:`ArrowTransition`,props:{stageTransition:{default:()=>({primaryColor:`#666`,secondaryColor:`#ccc`})}},setup(e){let t=e,n=b(()=>t.stageTransition),r=b(()=>n.value.primaryColor||`#666`),i=b(()=>n.value.secondaryColor||`#ccc`);return _(()=>{document.documentElement.style.setProperty(`--stage-transition-3-overlay-color-1`,r.value),document.documentElement.style.setProperty(`--stage-transition-3-overlay-color-2`,i.value)}),(e,t)=>(u(),k(`div`,{class:`stage-transition-3`,style:f({zIndex:n.value.zIndex||100})},null,4))}}),[[`__scopeId`,`data-v-17464329`]]),dt=L(n({__name:`BubbleWaveOutTransition`,props:{stageTransition:{}},setup(e){let t=e,n=b(()=>t.stageTransition?.colors||[`#eee`,`#ebcb8b`,`#c56370`,`#3f3b52`]);return _(()=>{document.documentElement.style.setProperty(`--circle-expansion-delay`,`${t.stageTransition?.delay||0}s`),document.documentElement.style.setProperty(`--circle-expansion-duration`,`${t.stageTransition?.duration||.4}s`),n.value.forEach((e,t)=>{document.documentElement.style.setProperty(`--circle-expansion-color-${t+1}`,e)})}),(t,r)=>(u(),k(`div`,{class:`circle-expansion-transition`,style:f({zIndex:e.stageTransition?.zIndex||100})},[(u(!0),k(D,null,l(n.value,(e,t)=>(u(),k(`div`,{key:t}))),128))],4))}}),[[`__scopeId`,`data-v-4624be9e`]]),ft=L(n({__name:`FantasyFallTransition`,props:{stageTransition:{}},setup(e){let t=e,n=b(()=>t.stageTransition?.direction||`up`),r=b(()=>`fantasy-fall-${n.value}`);return _(()=>{document.documentElement.style.setProperty(`--fantasy-fall-color`,t.stageTransition?.primaryColor||`#eee`),document.documentElement.style.setProperty(`--fantasy-fall-duration`,`${t.stageTransition?.duration||.6}s`),document.documentElement.style.setProperty(`--fantasy-fall-delay`,`${t.stageTransition?.delay||0}s`),document.documentElement.style.setProperty(`--fantasy-fall-radius-sm`,`${t.stageTransition?.borderRadius?.sm||`14rem`}`),document.documentElement.style.setProperty(`--fantasy-fall-radius-md`,`${t.stageTransition?.borderRadius?.md||`14rem`}`),document.documentElement.style.setProperty(`--fantasy-fall-radius-lg`,`${t.stageTransition?.borderRadius?.lg||`50%`}`)}),(t,n)=>(u(),k(`div`,{class:C([`fantasy-fall-transition`,r.value]),style:f({zIndex:e.stageTransition?.zIndex??100})},null,6))}}),[[`__scopeId`,`data-v-826171f5`]]),pt=L(n({__name:`MultipleBlocksRevealTransition`,props:{stageTransition:{}},setup(e){let t=e,n=b(()=>t.stageTransition),r=b(()=>n.value?.primaryColor||`#666`),i=b(()=>n.value?.secondaryColor||`#ccc`);return _(()=>{document.documentElement.style.setProperty(`--stage-transition-4-overlay-color-1`,r.value),document.documentElement.style.setProperty(`--stage-transition-4-overlay-color-2`,i.value)}),(e,t)=>(u(),k(`div`,{class:`stage-transition-4`,style:f({zIndex:n.value?.zIndex??100})},[...t[0]||=[a(`
`,5)]],4))}}),[[`__scopeId`,`data-v-4221f976`]]),mt=L(n({__name:`SlideTransition`,props:{stageTransition:{}},setup(e){let t=e,n=b(()=>t.stageTransition),r=b(()=>n.value?.primaryColor||`#666`),i=b(()=>n.value?.secondaryColor||`#ccc`);return y([n,r,i],()=>{document.documentElement.style.setProperty(`--stage-transition-1-overlay-color-1`,r.value),document.documentElement.style.setProperty(`--stage-transition-1-overlay-color-2`,i.value)}),_(()=>{document.documentElement.style.setProperty(`--stage-transition-1-overlay-color-1`,r.value),document.documentElement.style.setProperty(`--stage-transition-1-overlay-color-2`,i.value)}),(e,t)=>(u(),k(`div`,{class:`stage-transition-1`,style:f({zIndex:n.value?.zIndex??100})},null,4))}}),[[`__scopeId`,`data-v-81c0af14`]]),ht=L(n({__name:`SlopeSlideTransition`,props:{stageTransition:{}},setup(e){let t=e,n=b(()=>t.stageTransition),r=b(()=>n.value?.primaryColor??`#666`),i=b(()=>n.value?.secondaryColor??`#ccc`);return _(()=>{document.documentElement.style.setProperty(`--stage-transition-2-overlay-color-1`,r.value),document.documentElement.style.setProperty(`--stage-transition-2-overlay-color-2`,i.value)}),(e,t)=>(u(),k(`div`,{class:`stage-transition-2`,style:f({zIndex:n.value?.zIndex??100})},null,4))}}),[[`__scopeId`,`data-v-9e8b66c8`]]),gt=L(n({__name:`RectanglesRotateTransition`,props:{stageTransition:{}},setup(e){let t=e;return _(()=>{document.documentElement.style.setProperty(`--rectangle-rotate-1-color`,t.stageTransition?.primaryColor||`#ebcb8b`),document.documentElement.style.setProperty(`--rectangle-rotate-2-color`,t.stageTransition?.secondaryColor||`#c56370`),document.documentElement.style.setProperty(`--rectangle-rotate-3-color`,t.stageTransition?.tertiaryColor||`#43445b`),document.documentElement.style.setProperty(`--rectangle-rotate-duration`,`${t.stageTransition?.duration||.6}s`),document.documentElement.style.setProperty(`--rectangle-rotate-delay`,`${t.stageTransition?.delay||0}s`),document.documentElement.style.setProperty(`--rectangle-rotate-stagger`,`${t.stageTransition?.staggerDelay||.1}s`),document.documentElement.style.setProperty(`--rectangle-rotate-rotation`,`${t.stageTransition?.rotation||270}deg`)}),(t,n)=>(u(),k(`div`,{class:`rectangle-rotate-transition`,style:f({zIndex:e.stageTransition?.zIndex??100})},[...n[0]||=[j(`div`,{class:`rectangle rectangle-rotate-1`},[j(`div`)],-1),j(`div`,{class:`rectangle rectangle-rotate-2`},[j(`div`)],-1),j(`div`,{class:`rectangle rectangle-rotate-3`},[j(`div`)],-1)]],4))}}),[[`__scopeId`,`data-v-45ea2f7f`]]),_t=n({__name:`StageTransitionGroup`,props:{primaryColor:{},secondaryColor:{},tertiaryColor:{},colors:{},zIndex:{},disableTransitions:{type:Boolean},usePageSpecificTransitions:{type:Boolean}},setup(e){let t=e,n=le(),r=M(!1),a=M(),o=M(``),s=M(),c=A({slide:{component:mt,duration:2700},"slope-slide":{component:ht,duration:2700},arrow:{component:ut,duration:2700},"multiple-blocks-reveal":{component:pt,duration:2800},"fantasy-fall":{component:ft,duration:2700},"rectangles-rotate":{component:gt,duration:2700},"bubble-wave-out":{component:dt,duration:1e3}}),l=M([]);function d(e){return l.value.push(e),()=>{let t=l.value.indexOf(e);t>=0&&l.value.splice(t,1)}}async function f(e,t={}){a.value=e;for(let n of l.value)try{await Promise.resolve(n(e,t))}catch(t){console.error(`Error in transition hook at stage "${e}":`,t)}}async function p(e,t,n){if(e.name===`none`||!e.name){t(),n();return}let i=c.value[e.name];if(!i){console.error(`Transition ${e.name} not found`),t(),n();return}let a=i.nextDelay===void 0?i.duration/3:i.nextDelay,l=!1,u=d(e=>{e===`navigation`&&!l&&(l=!0,t())});try{await f(`before-enter`,{transitionName:e.name}),r.value&&(await f(`before-leave`,{transitionName:o.value}),o.value=``,s.value=void 0,r.value=!1,await f(`after-leave`,{transitionName:o.value}),await new Promise(e=>setTimeout(e,50))),o.value=e.name,s.value=e,r.value=!0,await f(`enter-active`,{transitionName:name}),setTimeout(async()=>{await f(`navigation`,{transitionName:e.name,config:i}),l||(l=!0,t())},a),setTimeout(async()=>{await f(`after-enter`,{transitionName:e.name})},i.duration),setTimeout(async()=>{await f(`before-leave`,{transitionName:e.name})},i.duration+10),setTimeout(async()=>{await f(`leave-active`,{transitionName:e.name})},i.duration+20);let c=i.exitDuration??0;setTimeout(async()=>{r.value=!1,o.value=``,s.value=void 0,await f(`after-leave`,{transitionName:e.name}),n()},i.duration+c)}catch(e){console.error(e)}finally{u(),setTimeout(()=>{l||(l=!0,t())},i.duration*2)}}function m(e,t){return new Promise(n=>{p(e,t,n)})}return n.beforeEach((e,n,r)=>{if(t.disableTransitions){r();return}if(typeof e.meta.stageTransition!=`object`){r();return}let i=e.meta.stageTransition;if(t.usePageSpecificTransitions&&i.pageSpecificAvailable){r();return}t.primaryColor!==void 0&&(i.primaryColor=t.primaryColor),t.secondaryColor!==void 0&&(i.secondaryColor=t.secondaryColor),t.tertiaryColor!==void 0&&(i.tertiaryColor=t.tertiaryColor),t.colors!==void 0&&(i.colors=t.colors),t.zIndex!==void 0&&(i.zIndex=t.zIndex),m(i,r)}),(e,t)=>(u(),k(D,null,[v(e.$slots,`default`),r.value?(u(),k(D,{key:0},[c.value[o.value]?(u(),g(h(c.value[o.value].component),{key:0,"stage-transition":s.value},null,8,[`stage-transition`])):i(``,!0)],64)):i(``,!0)],64))}}),vt=1,Q=new class{subscribers;toasts;dismissedToasts;constructor(){this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)});publish=e=>{this.subscribers.forEach(t=>t(e))};addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]};create=e=>{let{message:t,...n}=e,r=typeof e.id==`number`||e.id&&e.id?.length>0?e.id:vt++,i=this.toasts.find(e=>e.id===r),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),i?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:a,title:t}):n):this.addToast({title:t,...n,dismissible:a,id:r}),r};dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e);message=(e,t)=>this.create({...t,message:e,type:`default`});error=(e,t)=>this.create({...t,type:`error`,message:e});success=(e,t)=>this.create({...t,type:`success`,message:e});info=(e,t)=>this.create({...t,type:`info`,message:e});warning=(e,t)=>this.create({...t,type:`warning`,message:e});loading=(e,t)=>this.create({...t,type:`loading`,message:e});promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],c(e))i=!1,this.create({id:n,type:`default`,message:e});else if(bt(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!c(r)?r:{message:r||``,id:n||``};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!c(r)?r:{message:r||``,id:n||``};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!c(r)?r:{message:r||``,id:n||``};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!c(r)?r:{message:r||``,id:n||``};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally?.()}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})};custom=(e,t)=>{let n=t?.id||vt++,r=this.toasts.find(e=>e.id===n),i=t?.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(n)&&this.dismissedToasts.delete(n),r?this.toasts=this.toasts.map(r=>r.id===n?(this.publish({...r,component:e,dismissible:i,id:n,...t}),{...r,component:e,dismissible:i,id:n,...t}):r):this.addToast({component:e,dismissible:i,id:n,...t}),n};getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id))};function yt(e,t){let n=t?.id||vt++;return Q.create({message:e,id:n,type:`default`,...t}),n}var bt=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,xt=yt,St=Object.assign(xt,{success:Q.success,info:Q.info,warning:Q.warning,error:Q.error,custom:Q.custom,message:Q.message,promise:Q.promise,dismiss:Q.dismiss,loading:Q.loading},{getHistory:()=>Q.toasts,getToasts:()=>Q.getActiveToasts()});function Ct(e){return e.label!==void 0}var wt=3,Tt=`24px`,Et=`16px`,Dt=4e3,Ot=356,kt=14,At=45,jt=200;function Mt(){let e=M(!1);return O(()=>{let t=()=>{e.value=document.hidden};return document.addEventListener(`visibilitychange`,t),()=>window.removeEventListener(`visibilitychange`,t)}),{isDocumentHidden:e}}function $(...e){return e.filter(Boolean).join(` `)}function Nt(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}function Pt(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?Et:Tt;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var Ft=[`data-rich-colors`,`data-styled`,`data-mounted`,`data-promise`,`data-swiped`,`data-removed`,`data-visible`,`data-y-position`,`data-x-position`,`data-index`,`data-front`,`data-swiping`,`data-dismissible`,`data-type`,`data-invert`,`data-swipe-out`,`data-swipe-direction`,`data-expanded`,`data-testid`],It=[`aria-label`,`data-disabled`,`data-close-button-position`],Lt=n({__name:`Toast`,props:{toast:{},toasts:{},index:{},swipeDirections:{},expanded:{type:Boolean},invert:{type:Boolean},heights:{},gap:{},position:{},closeButtonPosition:{},visibleToasts:{},expandByDefault:{type:Boolean},closeButton:{type:Boolean},interacting:{type:Boolean},style:{},cancelButtonStyle:{},actionButtonStyle:{},duration:{},class:{},unstyled:{type:Boolean},descriptionClass:{},loadingIcon:{},classes:{},icons:{},closeButtonAriaLabel:{},defaultRichColors:{type:Boolean}},emits:[`update:heights`,`update:height`,`removeToast`],setup(e,{emit:t}){let n=e,a=t,o=M(null),c=M(null),l=M(!1),ee=M(!1),x=M(!1),S=M(!1),te=M(!1),w=M(0),E=M(0),A=M(n.toast.duration||n.duration||Dt),re=M(null),N=M(null),ie=b(()=>n.index===0),ae=b(()=>n.index+1<=n.visibleToasts),P=b(()=>n.toast.type),F=b(()=>n.toast.dismissible!==!1),oe=b(()=>n.toast.class||``),I=b(()=>n.descriptionClass||``),se=b(()=>{let e=n.toast.position||n.position,t=n.heights.filter(t=>t.position===e).findIndex(e=>e.toastId===n.toast.id);return t>=0?t:0}),ce=b(()=>{let e=n.toast.position||n.position;return n.heights.filter(t=>t.position===e).reduce((e,t,n)=>n>=se.value?e:e+t.height,0)}),le=b(()=>se.value*n.gap+ce.value||0),ue=b(()=>n.toast.closeButton??n.closeButton),L=b(()=>n.toast.duration||n.duration||Dt),de=M(0),fe=M(0),R=M(null),pe=b(()=>n.position.split(`-`)),me=b(()=>pe.value[0]),he=b(()=>pe.value[1]),ge=b(()=>typeof n.toast.title!=`string`),_e=b(()=>typeof n.toast.description!=`string`),{isDocumentHidden:ve}=Mt(),ye=b(()=>P.value&&P.value===`loading`);_(()=>{l.value=!0,A.value=L.value}),O(async()=>{if(!l.value||!N.value)return;await r();let e=N.value,t=e.style.height;e.style.height=`auto`;let i=e.getBoundingClientRect().height;e.style.height=t,E.value=i,a(`update:height`,{toastId:n.toast.id,height:i,position:n.toast.position||n.position})});function z(){ee.value=!0,w.value=le.value,setTimeout(()=>{a(`removeToast`,n.toast)},jt)}function be(){if(ye.value||!F.value)return{};z(),n.toast.onDismiss?.(n.toast)}function xe(e){e.button!==2&&(ye.value||!F.value||(re.value=new Date,w.value=le.value,e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(x.value=!0,R.value={x:e.clientX,y:e.clientY})))}function Se(){if(S.value||!F.value)return;R.value=null;let e=Number(N.value?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(N.value?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-(re.value?.getTime()||0),i=o.value===`x`?e:t,a=Math.abs(i)/r;if(Math.abs(i)>=At||a>.11){w.value=le.value,n.toast.onDismiss?.(n.toast),o.value===`x`?c.value=e>0?`right`:`left`:c.value=t>0?`down`:`up`,z(),S.value=!0;return}else N.value?.style.setProperty(`--swipe-amount-x`,`0px`),N.value?.style.setProperty(`--swipe-amount-y`,`0px`);te.value=!1,x.value=!1,o.value=null}function Ce(e){if(!R.value||!F.value||(window?.getSelection()?.toString()?.length??!1))return;let t=e.clientY-R.value.y,r=e.clientX-R.value.x,i=n.swipeDirections??Nt(n.position);!o.value&&(Math.abs(r)>1||Math.abs(t)>1)&&(o.value=Math.abs(r)>Math.abs(t)?`x`:`y`);let a={x:0,y:0},s=e=>1/(1.5+Math.abs(e)/20);if(o.value===`y`){if(i.includes(`top`)||i.includes(`bottom`))if(i.includes(`top`)&&t<0||i.includes(`bottom`)&&t>0)a.y=t;else{let e=t*s(t);a.y=Math.abs(e)0)a.x=r;else{let e=r*s(r);a.x=Math.abs(e)0||Math.abs(a.y)>0)&&(te.value=!0),N.value?.style.setProperty(`--swipe-amount-x`,`${a.x}px`),N.value?.style.setProperty(`--swipe-amount-y`,`${a.y}px`)}_(()=>{if(l.value=!0,!N.value)return;let e=N.value.getBoundingClientRect().height;E.value=e,a(`update:heights`,[{toastId:n.toast.id,height:e,position:n.toast.position},...n.heights])}),s(()=>{N.value&&a(`removeToast`,n.toast)}),O(e=>{if(n.toast.promise&&P.value===`loading`||n.toast.duration===1/0||n.toast.type===`loading`)return;let t;n.expanded||n.interacting||ve.value?(()=>{if(fe.value{n.toast.onAutoClose?.(n.toast),z()},A.value)),e(()=>{clearTimeout(t)})}),y(()=>n.toast.delete,e=>{e!==void 0&&e&&(z(),n.toast.onDismiss?.(n.toast))},{deep:!0});function we(){x.value=!1,o.value=null,R.value=null}return(e,t)=>(u(),k(`li`,{tabindex:`0`,ref_key:`toastRef`,ref:N,class:C(T($)(n.class,oe.value,e.classes?.toast,e.toast.classes?.toast,e.classes?.[P.value],e.toast?.classes?.[P.value])),"data-sonner-toast":``,"data-rich-colors":e.toast.richColors??e.defaultRichColors,"data-styled":!(e.toast.component||e.toast?.unstyled||e.unstyled),"data-mounted":l.value,"data-promise":!!e.toast.promise,"data-swiped":te.value,"data-removed":ee.value,"data-visible":ae.value,"data-y-position":me.value,"data-x-position":he.value,"data-index":e.index,"data-front":ie.value,"data-swiping":x.value,"data-dismissible":F.value,"data-type":P.value,"data-invert":e.toast.invert||e.invert,"data-swipe-out":S.value,"data-swipe-direction":c.value,"data-expanded":!!(e.expanded||e.expandByDefault&&l.value),"data-testid":e.toast.testId,style:f({"--index":e.index,"--toasts-before":e.index,"--z-index":e.toasts.length-e.index,"--offset":`${ee.value?w.value:le.value}px`,"--initial-height":e.expandByDefault?`auto`:`${E.value}px`,...e.style,...n.toast.style}),onDragend:we,onPointerdown:xe,onPointerup:Se,onPointermove:Ce},[ue.value&&!e.toast.component&&P.value!==`loading`?(u(),k(`button`,{key:0,"aria-label":e.closeButtonAriaLabel||`Close toast`,"data-disabled":ye.value,"data-close-button":`true`,"data-close-button-position":e.closeButtonPosition,class:C(T($)(e.classes?.closeButton,e.toast?.classes?.closeButton)),onClick:be},[e.icons?.close?(u(),g(h(e.icons?.close),{key:0})):v(e.$slots,`close-icon`,{key:1})],10,It)):i(`v-if`,!0),e.toast.component?(u(),g(h(e.toast.component),ne({key:1},e.toast.componentProps,{onCloseToast:be,isPaused:e.$props.expanded||e.$props.interacting||T(ve)}),null,16,[`isPaused`])):(u(),k(D,{key:2},[P.value!==`default`||e.toast.icon||e.toast.promise?(u(),k(`div`,{key:0,"data-icon":``,class:C(T($)(e.classes?.icon,e.toast?.classes?.icon))},[e.toast.icon?(u(),g(h(e.toast.icon),{key:0})):(u(),k(D,{key:1},[P.value===`loading`?v(e.$slots,`loading-icon`,{key:0}):P.value===`success`?v(e.$slots,`success-icon`,{key:1}):P.value===`error`?v(e.$slots,`error-icon`,{key:2}):P.value===`warning`?v(e.$slots,`warning-icon`,{key:3}):P.value===`info`?v(e.$slots,`info-icon`,{key:4}):i(`v-if`,!0)],64))],2)):i(`v-if`,!0),j(`div`,{"data-content":``,class:C(T($)(e.classes?.content,e.toast?.classes?.content))},[j(`div`,{"data-title":``,class:C(T($)(e.classes?.title,e.toast.classes?.title))},[ge.value?(u(),g(h(e.toast.title),d(ne({key:0},e.toast.componentProps)),null,16)):(u(),k(D,{key:1},[p(m(e.toast.title),1)],64))],2),e.toast.description?(u(),k(`div`,{key:0,"data-description":``,class:C(T($)(e.descriptionClass,I.value,e.classes?.description,e.toast.classes?.description))},[_e.value?(u(),g(h(e.toast.description),d(ne({key:0},e.toast.componentProps)),null,16)):(u(),k(D,{key:1},[p(m(e.toast.description),1)],64))],2)):i(`v-if`,!0)],2),e.toast.cancel?(u(),k(`button`,{key:1,style:f(e.toast.cancelButtonStyle||e.cancelButtonStyle),class:C(T($)(e.classes?.cancelButton,e.toast.classes?.cancelButton)),"data-button":``,"data-cancel":``,onClick:t[0]||=t=>{T(Ct)(e.toast.cancel)&&F.value&&(e.toast.cancel.onClick?.(t),z())}},m(T(Ct)(e.toast.cancel)?e.toast.cancel?.label:e.toast.cancel),7)):i(`v-if`,!0),e.toast.action?(u(),k(`button`,{key:2,style:f(e.toast.actionButtonStyle||e.actionButtonStyle),class:C(T($)(e.classes?.actionButton,e.toast.classes?.actionButton)),"data-button":``,"data-action":``,onClick:t[1]||=t=>{T(Ct)(e.toast.action)&&(e.toast.action.onClick?.(t),!t.defaultPrevented&&z())}},m(T(Ct)(e.toast.action)?e.toast.action?.label:e.toast.action),7)):i(`v-if`,!0)],64))],46,Ft))}}),Rt=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},zt={},Bt={xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stoke-width":`1.5`,"stroke-linecap":`round`,"stroke-linejoin":`round`};function Vt(e,t){return u(),k(`svg`,Bt,t[0]||=[j(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`},null,-1),j(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`},null,-1)])}var Ht=Rt(zt,[[`render`,Vt]]),Ut=[`data-visible`],Wt={class:`sonner-spinner`},Gt=n({__name:`Loader`,props:{visible:{type:Boolean}},setup(e){let t=Array(12).fill(0);return(e,n)=>(u(),k(`div`,{class:`sonner-loading-wrapper`,"data-visible":e.visible},[j(`div`,Wt,[(u(!0),k(D,null,l(T(t),e=>(u(),k(`div`,{key:`spinner-bar-${e}`,class:`sonner-loading-bar`}))),128))])],8,Ut))}}),Kt={},qt={xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`};function Jt(e,t){return u(),k(`svg`,qt,t[0]||=[j(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,"clip-rule":`evenodd`},null,-1)])}var Yt=Rt(Kt,[[`render`,Jt]]),Xt={},Zt={xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`};function Qt(e,t){return u(),k(`svg`,Zt,t[0]||=[j(`path`,{"fill-rule":`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,"clip-rule":`evenodd`},null,-1)])}var $t=Rt(Xt,[[`render`,Qt]]),en={},tn={xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`};function nn(e,t){return u(),k(`svg`,tn,t[0]||=[j(`path`,{"fill-rule":`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,"clip-rule":`evenodd`},null,-1)])}var rn=Rt(en,[[`render`,nn]]),an={},on={xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`};function sn(e,t){return u(),k(`svg`,on,t[0]||=[j(`path`,{"fill-rule":`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,"clip-rule":`evenodd`},null,-1)])}var cn=Rt(an,[[`render`,sn]]),ln=[`aria-label`],un=[`data-sonner-theme`,`dir`,`data-theme`,`data-rich-colors`,`data-y-position`,`data-x-position`],dn=typeof window<`u`&&typeof document<`u`;function fn(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}var pn=n({name:`Toaster`,inheritAttrs:!1,__name:`Toaster`,props:{id:{},invert:{type:Boolean,default:!1},theme:{default:`light`},position:{default:`bottom-right`},closeButtonPosition:{default:`top-left`},hotkey:{default:()=>[`altKey`,`KeyT`]},richColors:{type:Boolean,default:!1},expand:{type:Boolean,default:!1},duration:{},gap:{default:kt},visibleToasts:{default:wt},closeButton:{type:Boolean,default:!1},toastOptions:{default:()=>({})},class:{default:``},style:{},offset:{default:Tt},mobileOffset:{default:Et},dir:{default:`auto`},swipeDirections:{},icons:{},containerAriaLabel:{default:`Notifications`}},setup(e){let t=e,n=ee(),a=M([]),o=b(()=>t.id?a.value.filter(e=>e.toasterId===t.id):a.value.filter(e=>!e.toasterId));function s(e,t){return o.value.filter(n=>!n.position&&t===0||n.position===e)}let c=b(()=>{let e=o.value.filter(e=>e.position).map(e=>e.position);return e.length>0?Array.from(new Set([t.position].concat(e))):[t.position]}),d=b(()=>{let e={};return c.value.forEach(t=>{e[t]=a.value.filter(e=>e.position===t)}),e}),p=M([]),m=M({}),h=M(!1);O(()=>{c.value.forEach(e=>{e in m.value||(m.value[e]=!1)})});let _=M(t.theme===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:t.theme),y=M(null),x=M(null),S=M(!1),te=t.hotkey.join(`+`).replace(/Key/g,``).replace(/Digit/g,``);function A(e){a.value.find(t=>t.id===e.id)?.delete||Q.dismiss(e.id),a.value=a.value.filter(({id:t})=>t!==e.id),setTimeout(()=>{a.value.find(t=>t.id===e.id)||(p.value=p.value.filter(t=>t.toastId!==e.id))},jt+50)}function re(e){S.value&&!e.currentTarget?.contains?.(e.relatedTarget)&&(S.value=!1,x.value&&=(x.value.focus({preventScroll:!0}),null))}function N(e){e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||S.value||(S.value=!0,x.value=e.relatedTarget)}function ie(e){e.target&&e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||(h.value=!0)}O(e=>{e(Q.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{a.value=a.value.map(t=>t.id===e.id?{...t,delete:!0}:t)});return}r(()=>{let t=a.value.findIndex(t=>t.id===e.id);t===-1?a.value=[e,...a.value]:a.value=[...a.value.slice(0,t),{...a.value[t],...e},...a.value.slice(t+1)]})}))}),O(e=>{if(typeof window>`u`)return;if(t.theme!==`system`){_.value=t.theme;return}let n=window.matchMedia(`(prefers-color-scheme: dark)`),r=e=>{_.value=e?`dark`:`light`};r(n.matches);let i=e=>{r(e.matches)};try{n.addEventListener(`change`,i)}catch{n.addListener(i)}e(()=>{try{n.removeEventListener(`change`,i)}catch{n.removeListener(i)}})}),O(()=>{y.value&&x.value&&(x.value.focus({preventScroll:!0}),x.value=null,S.value=!1)}),O(()=>{a.value.length<=1&&Object.keys(m.value).forEach(e=>{m.value[e]=!1})}),O(e=>{function n(e){let n=t.hotkey.every(t=>e[t]||e.code===t),r=Array.isArray(y.value)?y.value[0]:y.value;n&&(c.value.forEach(e=>{m.value[e]=!0}),r?.focus());let i=document.activeElement===y.value||r?.contains(document.activeElement);e.code===`Escape`&&i&&c.value.forEach(e=>{m.value[e]=!1})}dn&&(document.addEventListener(`keydown`,n),e(()=>{document.removeEventListener(`keydown`,n)}))});function ae(e){let t=e.currentTarget,n=t.getAttribute(`data-y-position`)+`-`+t.getAttribute(`data-x-position`);m.value[n]=!0}function P(e){if(!h.value){let t=e.currentTarget,n=t.getAttribute(`data-y-position`)+`-`+t.getAttribute(`data-x-position`);m.value[n]=!1}}function F(){Object.keys(m.value).forEach(e=>{m.value[e]=!1})}function oe(){h.value=!1}function I(e){p.value=e}function se(e){let t=p.value.findIndex(t=>t.toastId===e.toastId);if(t!==-1)p.value[t]=e;else{let t=p.value.findIndex(t=>t.position===e.position);t===-1?p.value.unshift(e):p.value.splice(t,0,e)}}return(e,r)=>(u(),k(D,null,[i(` Remove item from normal navigation flow, only available via hotkey `),j(`section`,{"aria-label":`${e.containerAriaLabel} ${T(te)}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`},[(u(!0),k(D,null,l(c.value,(r,i)=>(u(),k(`ol`,ne({key:r,ref_for:!0,ref_key:`listRef`,ref:y,"data-sonner-toaster":``,"data-sonner-theme":_.value,class:t.class,dir:e.dir===`auto`?fn():e.dir,tabIndex:-1,"data-theme":e.theme,"data-rich-colors":e.richColors,"data-y-position":r.split(`-`)[0],"data-x-position":r.split(`-`)[1],style:{"--front-toast-height":`${p.value[0]?.height||0}px`,"--width":`${T(Ot)}px`,"--gap":`${e.gap}px`,...e.style,...T(n).style,...T(Pt)(e.offset,e.mobileOffset)}},{ref_for:!0},e.$attrs,{onBlur:re,onFocus:N,onMouseenter:ae,onMousemove:ae,onMouseleave:P,onDragend:F,onPointerdown:ie,onPointerup:oe}),[(u(!0),k(D,null,l(s(r,i),(n,i)=>(u(),g(Lt,{key:n.id,heights:p.value,icons:e.icons,index:i,toast:n,defaultRichColors:e.richColors,duration:e.toastOptions?.duration??e.duration,class:C(e.toastOptions?.class??``),descriptionClass:e.toastOptions?.descriptionClass,invert:e.invert,visibleToasts:e.visibleToasts,closeButton:e.toastOptions?.closeButton??e.closeButton,interacting:h.value,position:r,closeButtonPosition:e.toastOptions?.closeButtonPosition??e.closeButtonPosition,style:f(e.toastOptions?.style),unstyled:e.toastOptions?.unstyled,classes:e.toastOptions?.classes,cancelButtonStyle:e.toastOptions?.cancelButtonStyle,actionButtonStyle:e.toastOptions?.actionButtonStyle,"close-button-aria-label":e.toastOptions?.closeButtonAriaLabel,toasts:d.value[r],expandByDefault:e.expand,gap:e.gap,expanded:m.value[r]||!1,swipeDirections:t.swipeDirections,"onUpdate:heights":I,"onUpdate:height":se,onRemoveToast:A},{"close-icon":E(()=>[v(e.$slots,`close-icon`,{},()=>[w(Ht)])]),"loading-icon":E(()=>[v(e.$slots,`loading-icon`,{},()=>[w(Gt,{visible:n.type===`loading`},null,8,[`visible`])])]),"success-icon":E(()=>[v(e.$slots,`success-icon`,{},()=>[w(Yt)])]),"error-icon":E(()=>[v(e.$slots,`error-icon`,{},()=>[w(cn)])]),"warning-icon":E(()=>[v(e.$slots,`warning-icon`,{},()=>[w(rn)])]),"info-icon":E(()=>[v(e.$slots,`info-icon`,{},()=>[w($t)])]),_:2},1032,[`heights`,`icons`,`index`,`toast`,`defaultRichColors`,`duration`,`class`,`descriptionClass`,`invert`,`visibleToasts`,`closeButton`,`interacting`,`position`,`closeButtonPosition`,`style`,`unstyled`,`classes`,`cancelButtonStyle`,`actionButtonStyle`,`close-button-aria-label`,`toasts`,`expandByDefault`,`gap`,`expanded`,`swipeDirections`]))),128))],16,un))),128))],8,ln)],2112))}});const mn=P(`pwa`,()=>{M([]),fe(R).smaller(`md`),_(async()=>{})});var hn=n({__name:`App`,setup(e){mn();let t=ge(),n=ye(),r=z(),i=ae(r),a=be(),{shouldShowSetup:s}=ae(a),{isDark:c}=ie(),l,d=b(()=>c.value?`color-mix(in srgb, oklch(95% var(--chromatic-chroma-900) calc(var(--chromatic-hue) + 0)) 70%, oklch(50% 0 360))`:`color-mix(in srgb, oklch(95% var(--chromatic-chroma-900) calc(var(--chromatic-hue) + 0)) 90%, oklch(90% 0 360))`),f=b(()=>c.value?`color-mix(in srgb, oklch(95% var(--chromatic-chroma-900) calc(var(--chromatic-hue) + 180)) 70%, oklch(50% 0 360))`:`color-mix(in srgb, oklch(95% var(--chromatic-chroma-900) calc(var(--chromatic-hue) + 180)) 90%, oklch(90% 0 360))`),p=b(()=>c.value?`color-mix(in srgb, oklch(95% var(--chromatic-chroma-900) calc(var(--chromatic-hue) + 60)) 70%, oklch(50% 0 360))`:`color-mix(in srgb, oklch(95% var(--chromatic-chroma-900) calc(var(--chromatic-hue) + 60)) 90%, oklch(90% 0 360))`),m=b(()=>[d.value,f.value,p.value,c.value?`#121212`:`#FFFFFF`]);y(i.language,()=>{t.locale.value=i.language.value}),y(i.themeColorsHue,()=>{document.documentElement.style.setProperty(`--chromatic-hue`,i.themeColorsHue.value.toString())},{immediate:!0}),y(i.themeColorsHueDynamic,()=>{document.documentElement.classList.toggle(`dynamic-hue`,i.themeColorsHueDynamic.value)},{immediate:!0}),_(async()=>{a.initializeSetupCheck(),l=lt().dispose,await n.loadDisplayModelsFromIndexedDB(),await r.initializeStageModel()}),o(()=>{l?.()});function v(){a.markSetupCompleted()}function ee(){a.markSetupSkipped()}return(e,t)=>(u(),k(D,null,[w(T(_t),{"primary-color":d.value,"secondary-color":f.value,"tertiary-color":p.value,colors:m.value,"z-index":100,"disable-transitions":T(i).disableTransitions.value,"use-page-specific-transitions":T(i).usePageSpecificTransitions.value},{default:E(()=>[w(T(ce),null,{default:E(({Component:e})=>[(u(),g(S,{include:[`IndexScenePage`,`StageScenePage`]},[(u(),g(h(e)))],1024))]),_:1})]),_:1},8,[`primary-color`,`secondary-color`,`tertiary-color`,`colors`,`disable-transitions`,`use-page-specific-transitions`]),w(T(he),{onClose:t[0]||=e=>T(St).dismiss(e)},{default:E(()=>[w(T(pn))]),_:1}),w(T(me),{modelValue:T(s),"onUpdate:modelValue":t[1]||=e=>x(s)?s.value=e:null,onConfigured:v,onSkipped:ee},null,8,[`modelValue`])],64))}}),gn={"zh-CN":`zh-Hans`,"zh-TW":`zh-Hant`,"zh-HK":`zh-Hans`,"zh-Hant":`zh-Hans`,"en-US":`en`,"en-GB":`en`,"en-AU":`en`,en:`en`,"es-ES":`es`,"es-MX":`es`,"es-AR":`es`,es:`es`,vi:`vi`,"vi-VN":`vi`,ru:`ru`,"ru-RU":`ru`,fr:`fr`,"fr-FR":`fr`};function _n(){let e=localStorage.getItem(`settings/language`);e||=navigator.language||`en`;let t=Object.keys(ve);return gn[e||`en`]!=null&&(e=gn[e||`en`]),e&&t.includes(e)?e:`en`}const vn=_e({legacy:!1,locale:_n(),fallbackLocale:`en`,messages:ve});var yn=F(),bn=ue({routes:ot(st),history:se()});bn.beforeEach((e,t)=>{e.path!==t.path&&Ce.default.start()}),bn.afterEach(()=>{Ce.default.done()}),te(hn).use(N).use(at).use(bn).use(yn).use(vn).use(re).mount(`#app`); \ No newline at end of file diff --git a/assets/index-tts-vllm-CnKZjGZI.js b/assets/index-tts-vllm-CL4142hK.js similarity index 85% rename from assets/index-tts-vllm-CnKZjGZI.js rename to assets/index-tts-vllm-CL4142hK.js index e4a05ccff5912c9f5856bad1ebb8cf8a60996098..0eb68d770898f64c221130358adace34f3558464 100644 --- a/assets/index-tts-vllm-CnKZjGZI.js +++ b/assets/index-tts-vllm-CL4142hK.js @@ -1 +1 @@ -import{A as e,K as t,S as n,W as r,at as i,b as a,k as o,kt as s,lt as c}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-CZ9Rvki9.js";import"./src-DYQXbDgu.js";import"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{c as l,u}from"./components-BR_Kqwtu.js";import{i as d,t as f}from"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-D1kLcsvA.js";import"./__vite-browser-external-BaycPy5b.js";import{t as p}from"./route-block-CpjdOEnv.js";var m=`index-tts-vllm`,h=`IndexTTS-1.5`,g=!0,_=e({__name:`index-tts-vllm`,setup(e){let p=f(),_=d(),v=a(()=>p.availableVoices[m]||[]);r(async()=>{await p.loadVoicesForProvider(m)}),i([g],async()=>{await p.loadVoicesForProvider(m)});async function y(e,t){let n=await _.getProviderInstance(m);if(!n)throw Error(`Failed to initialize speech provider`);let r=_.getProviderConfig(m),i=r.model||h,a={...r};return await p.speech(n,i,e,t,a)}return(e,r)=>(t(),n(s(l),{"provider-id":m,"default-model":h},{playground:c(()=>[o(s(u),{"available-voices":v.value,"generate-speech":y,"api-key-configured":g,"use-ssml":!1,"default-text":`Hello! This is a test of the Index TTS Speech synthesis?.`},null,8,[`available-voices`])]),_:1}))}});typeof p==`function`&&p(_);var v=_;export{v as default}; \ No newline at end of file +import{A as e,K as t,S as n,W as r,at as i,b as a,k as o,kt as s,lt as c}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-C0YByt49.js";import"./src-DYQXbDgu.js";import"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{c as l,u}from"./components-CeE-UiLT.js";import{i as d,t as f}from"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-73vyHOZs.js";import"./__vite-browser-external-BaycPy5b.js";import{t as p}from"./route-block-CpjdOEnv.js";var m=`index-tts-vllm`,h=`IndexTTS-1.5`,g=!0,_=e({__name:`index-tts-vllm`,setup(e){let p=f(),_=d(),v=a(()=>p.availableVoices[m]||[]);r(async()=>{await p.loadVoicesForProvider(m)}),i([g],async()=>{await p.loadVoicesForProvider(m)});async function y(e,t){let n=await _.getProviderInstance(m);if(!n)throw Error(`Failed to initialize speech provider`);let r=_.getProviderConfig(m),i=r.model||h,a={...r};return await p.speech(n,i,e,t,a)}return(e,r)=>(t(),n(s(l),{"provider-id":m,"default-model":h},{playground:c(()=>[o(s(u),{"available-voices":v.value,"generate-speech":y,"api-key-configured":g,"use-ssml":!1,"default-text":`Hello! This is a test of the Index TTS Speech synthesis?.`},null,8,[`available-voices`])]),_:1}))}});typeof p==`function`&&p(_);var v=_;export{v as default}; \ No newline at end of file diff --git a/assets/lm-studio-Cu1JvZVB.js b/assets/lm-studio-Dqkjrkzg.js similarity index 87% rename from assets/lm-studio-Cu1JvZVB.js rename to assets/lm-studio-Dqkjrkzg.js index 8c7ab882518db68f3a5f18292a9bf0d80566026b..83bc988209377e704ebf497f2151a27744f2846b 100644 --- a/assets/lm-studio-Cu1JvZVB.js +++ b/assets/lm-studio-Dqkjrkzg.js @@ -1 +1 @@ -import{A as e,C as t,E as n,K as r,O as i,Pt as a,S as o,b as s,k as c,kt as l,lt as u,x as d}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-CZ9Rvki9.js";import"./src-DYQXbDgu.js";import{a as f}from"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{G as p,K as m,U as h,W as g,gt as _}from"./components-BR_Kqwtu.js";import{i as v}from"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-D1kLcsvA.js";import"./__vite-browser-external-BaycPy5b.js";import{t as y}from"./route-block-CpjdOEnv.js";import{t as b}from"./use-provider-validation-DbXr83wX.js";var x={class:`whitespace-pre-wrap break-all`},S=`lm-studio`,C=e({__name:`lm-studio`,setup(e){let{providers:y}=f(v()),C=s({get:()=>y.value[S]?.baseUrl||``,set:e=>{y.value[S]||(y.value[S]={}),y.value[S].baseUrl=e}}),{t:w,router:T,providerMetadata:E,isValidating:D,isValid:O,validationMessage:k,handleResetSettings:A}=b(S);return(e,s)=>(r(),o(l(h),{"provider-name":l(E)?.localizedName,"provider-icon-color":l(E)?.iconColor,"on-back":()=>l(T).back()},{default:u(()=>[c(l(g),null,{default:u(()=>[c(l(p),{title:l(w)(`settings.pages.providers.common.section.basic.title`),description:l(w)(`settings.pages.providers.common.section.basic.description`),"on-reset":l(A)},{default:u(()=>[c(l(m),{modelValue:C.value,"onUpdate:modelValue":s[0]||=e=>C.value=e,placeholder:`http://localhost:1234/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`,`description`,`on-reset`]),!l(O)&&l(D)===0&&l(k)?(r(),o(l(_),{key:0,type:`error`},n({title:u(()=>[i(a(l(w)(`settings.dialogs.onboarding.validationFailed`)),1)]),_:2},[l(k)?{name:`content`,fn:u(()=>[d(`div`,x,a(l(k)),1)]),key:`0`}:void 0]),1024)):t(``,!0),l(O)&&l(D)===0?(r(),o(l(_),{key:1,type:`success`},{title:u(()=>[i(a(l(w)(`settings.dialogs.onboarding.validationSuccess`)),1)]),_:1})):t(``,!0)]),_:1})]),_:1},8,[`provider-name`,`provider-icon-color`,`on-back`]))}});typeof y==`function`&&y(C);var w=C;export{w as default}; \ No newline at end of file +import{A as e,C as t,E as n,K as r,O as i,Pt as a,S as o,b as s,k as c,kt as l,lt as u,x as d}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-C0YByt49.js";import"./src-DYQXbDgu.js";import{a as f}from"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{G as p,K as m,U as h,W as g,gt as _}from"./components-CeE-UiLT.js";import{i as v}from"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-73vyHOZs.js";import"./__vite-browser-external-BaycPy5b.js";import{t as y}from"./route-block-CpjdOEnv.js";import{t as b}from"./use-provider-validation-DbXr83wX.js";var x={class:`whitespace-pre-wrap break-all`},S=`lm-studio`,C=e({__name:`lm-studio`,setup(e){let{providers:y}=f(v()),C=s({get:()=>y.value[S]?.baseUrl||``,set:e=>{y.value[S]||(y.value[S]={}),y.value[S].baseUrl=e}}),{t:w,router:T,providerMetadata:E,isValidating:D,isValid:O,validationMessage:k,handleResetSettings:A}=b(S);return(e,s)=>(r(),o(l(h),{"provider-name":l(E)?.localizedName,"provider-icon-color":l(E)?.iconColor,"on-back":()=>l(T).back()},{default:u(()=>[c(l(g),null,{default:u(()=>[c(l(p),{title:l(w)(`settings.pages.providers.common.section.basic.title`),description:l(w)(`settings.pages.providers.common.section.basic.description`),"on-reset":l(A)},{default:u(()=>[c(l(m),{modelValue:C.value,"onUpdate:modelValue":s[0]||=e=>C.value=e,placeholder:`http://localhost:1234/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`,`description`,`on-reset`]),!l(O)&&l(D)===0&&l(k)?(r(),o(l(_),{key:0,type:`error`},n({title:u(()=>[i(a(l(w)(`settings.dialogs.onboarding.validationFailed`)),1)]),_:2},[l(k)?{name:`content`,fn:u(()=>[d(`div`,x,a(l(k)),1)]),key:`0`}:void 0]),1024)):t(``,!0),l(O)&&l(D)===0?(r(),o(l(_),{key:1,type:`success`},{title:u(()=>[i(a(l(w)(`settings.dialogs.onboarding.validationSuccess`)),1)]),_:1})):t(``,!0)]),_:1})]),_:1},8,[`provider-name`,`provider-icon-color`,`on-back`]))}});typeof y==`function`&&y(C);var w=C;export{w as default}; \ No newline at end of file diff --git a/assets/memory-BtlxAq98.js b/assets/memory-C9clolgI.js similarity index 84% rename from assets/memory-BtlxAq98.js rename to assets/memory-C9clolgI.js index 00a772d778826fbb4f234a04fec0dbb720030fb8..74aa555c86e7516086abd6b87cfb9b74e150ea2e 100644 --- a/assets/memory-BtlxAq98.js +++ b/assets/memory-C9clolgI.js @@ -1 +1 @@ -import{A as e,K as t,O as n,Z as r,k as i,kt as a,lt as o,m as s,ut as c,w as l,x as u}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import{u as d}from"./widgets-CZ9Rvki9.js";import"./src-DYQXbDgu.js";import"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import"./components-BR_Kqwtu.js";import"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-D1kLcsvA.js";import"./__vite-browser-external-BaycPy5b.js";import{t as f}from"./route-block-CpjdOEnv.js";var 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":``},m=e({__name:`index`,setup(e){return(e,f)=>{let m=r(`motion`);return t(),l(s,null,[u(`div`,null,[i(a(d),{label:`In development, needs your help!`,theme:`orange`},{default:o(()=>[...f[0]||=[u(`div`,null,[n(` This functionality is still under development. If you have any suggestions or would like to contribute, please reach out to us on our `),u(`a`,{underline:``,"decoration-dotted":``,href:`https://github.com/moeru-ai/airi/issues`},`GitHub issues page`),n(`. The source code of this page is located at `),u(`a`,{underline:``,"decoration-dotted":``,href:`https://github.com/moeru-ai/airi/tree/main/apps/stage-web/src/pages/settings/memory/index.vue`},`here`),n(`. `)],-1)]]),_:1})]),c((t(),l(`div`,p,[...f[1]||=[u(`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 +import{A as e,K as t,O as n,Z as r,k as i,kt as a,lt as o,m as s,ut as c,w as l,x as u}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import{u as d}from"./widgets-C0YByt49.js";import"./src-DYQXbDgu.js";import"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import"./components-CeE-UiLT.js";import"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-73vyHOZs.js";import"./__vite-browser-external-BaycPy5b.js";import{t as f}from"./route-block-CpjdOEnv.js";var 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":``},m=e({__name:`index`,setup(e){return(e,f)=>{let m=r(`motion`);return t(),l(s,null,[u(`div`,null,[i(a(d),{label:`In development, needs your help!`,theme:`orange`},{default:o(()=>[...f[0]||=[u(`div`,null,[n(` This functionality is still under development. If you have any suggestions or would like to contribute, please reach out to us on our `),u(`a`,{underline:``,"decoration-dotted":``,href:`https://github.com/moeru-ai/airi/issues`},`GitHub issues page`),n(`. The source code of this page is located at `),u(`a`,{underline:``,"decoration-dotted":``,href:`https://github.com/moeru-ai/airi/tree/main/apps/stage-web/src/pages/settings/memory/index.vue`},`here`),n(`. `)],-1)]]),_:1})]),c((t(),l(`div`,p,[...f[1]||=[u(`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/messaging-discord-BMzg_O9F.js b/assets/messaging-discord-8qKSV5dK.js similarity index 69% rename from assets/messaging-discord-BMzg_O9F.js rename to assets/messaging-discord-8qKSV5dK.js index 3e2aea010a57bb4e2d6d27498b9e5462cb42b4e6..8aafc07f49a7ad2dac8ff3232a3b66ec7ac8efad 100644 --- a/assets/messaging-discord-BMzg_O9F.js +++ b/assets/messaging-discord-8qKSV5dK.js @@ -1 +1 @@ -import{A as e,K as t,S as n,kt as r}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-CZ9Rvki9.js";import"./src-DYQXbDgu.js";import"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{nt as i}from"./components-BR_Kqwtu.js";import"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-D1kLcsvA.js";import"./__vite-browser-external-BaycPy5b.js";import{t as a}from"./route-block-CpjdOEnv.js";var o=e({__name:`messaging-discord`,setup(e){return(e,a)=>(t(),n(r(i)))}});typeof a==`function`&&a(o);var s=o;export{s as default}; \ No newline at end of file +import{A as e,K as t,S as n,kt as r}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-C0YByt49.js";import"./src-DYQXbDgu.js";import"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{nt as i}from"./components-CeE-UiLT.js";import"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-73vyHOZs.js";import"./__vite-browser-external-BaycPy5b.js";import{t as a}from"./route-block-CpjdOEnv.js";var o=e({__name:`messaging-discord`,setup(e){return(e,a)=>(t(),n(r(i)))}});typeof a==`function`&&a(o);var s=o;export{s as default}; \ No newline at end of file diff --git a/assets/microsoft-speech-DXFkeIFV.js b/assets/microsoft-speech-wTQgkZ27.js similarity index 94% rename from assets/microsoft-speech-DXFkeIFV.js rename to assets/microsoft-speech-wTQgkZ27.js index bae47a9ce0f270e66deac2f8d8ae39d4ff4d8448..d913024962b5cd797165bfbd32bd355ddc052d8f 100644 --- a/assets/microsoft-speech-DXFkeIFV.js +++ b/assets/microsoft-speech-wTQgkZ27.js @@ -1 +1 @@ -import{A as e,K as t,S as n,W as r,at as i,b as a,k as o,kt as s,lt as c,x as l,xt as u}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-CZ9Rvki9.js";import{d,l as f}from"./src-DYQXbDgu.js";import{a as p}from"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{c as m,u as h}from"./components-BR_Kqwtu.js";import{i as g,t as _}from"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import{n as v}from"./vue-i18n.runtime-Dah5zGm4.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-D1kLcsvA.js";import"./__vite-browser-external-BaycPy5b.js";import{t as y}from"./route-block-CpjdOEnv.js";var b={flex:`~ col gap-4`},x=`microsoft-speech`,S=`v1`,C=e({__name:`microsoft-speech`,setup(e){let{t:y}=v(),C={pitch:0,speed:1,volume:0},w=_(),T=g(),{providers:E}=p(T),D=u(0),O=u(1),k=u(0),A=a({get:()=>E.value[x]?.region||`eastasia`,set:e=>{E.value[x]||(E.value[x]={region:`eastasia`}),E.value[x].region=e}}),j=a(()=>!!E.value[x]?.apiKey),M=a(()=>w.availableVoices[x]||[]);r(async()=>{A.value||=`eastasia`,E.value[x]?.region||(E.value[x]?E.value[x].region=A.value:E.value[x]={region:A.value}),await w.loadVoicesForProvider(x)}),i([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,r)=>(t(),n(s(m),{"provider-id":x,"default-model":S,"additional-settings":C},{"basic-settings":c(()=>[o(s(d),{modelValue:A.value,"onUpdate:modelValue":r[0]||=e=>A.value=e,label:s(y)(`settings.pages.providers.provider.microsoft-speech.fields.field.region.label`),description:s(y)(`settings.pages.providers.provider.microsoft-speech.fields.field.region.description`),placeholder:`eastasia`,required:``,type:`text`},null,8,[`modelValue`,`label`,`description`])]),"voice-settings":c(()=>[l(`div`,b,[o(s(f),{modelValue:D.value,"onUpdate:modelValue":r[1]||=e=>D.value=e,label:s(y)(`settings.pages.providers.provider.common.fields.field.pitch.label`),description:s(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`]),o(s(f),{modelValue:O.value,"onUpdate:modelValue":r[2]||=e=>O.value=e,label:s(y)(`settings.pages.providers.provider.common.fields.field.speed.label`),description:s(y)(`settings.pages.providers.provider.common.fields.field.speed.description`),min:.5,max:2,step:.01},null,8,[`modelValue`,`label`,`description`]),o(s(f),{modelValue:k.value,"onUpdate:modelValue":r[3]||=e=>k.value=e,label:s(y)(`settings.pages.providers.provider.common.fields.field.volume.label`),description:s(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:c(()=>[o(s(h),{"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 +import{A as e,K as t,S as n,W as r,at as i,b as a,k as o,kt as s,lt as c,x as l,xt as u}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-C0YByt49.js";import{d,l as f}from"./src-DYQXbDgu.js";import{a as p}from"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{c as m,u as h}from"./components-CeE-UiLT.js";import{i as g,t as _}from"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import{n as v}from"./vue-i18n.runtime-Dah5zGm4.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-73vyHOZs.js";import"./__vite-browser-external-BaycPy5b.js";import{t as y}from"./route-block-CpjdOEnv.js";var b={flex:`~ col gap-4`},x=`microsoft-speech`,S=`v1`,C=e({__name:`microsoft-speech`,setup(e){let{t:y}=v(),C={pitch:0,speed:1,volume:0},w=_(),T=g(),{providers:E}=p(T),D=u(0),O=u(1),k=u(0),A=a({get:()=>E.value[x]?.region||`eastasia`,set:e=>{E.value[x]||(E.value[x]={region:`eastasia`}),E.value[x].region=e}}),j=a(()=>!!E.value[x]?.apiKey),M=a(()=>w.availableVoices[x]||[]);r(async()=>{A.value||=`eastasia`,E.value[x]?.region||(E.value[x]?E.value[x].region=A.value:E.value[x]={region:A.value}),await w.loadVoicesForProvider(x)}),i([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,r)=>(t(),n(s(m),{"provider-id":x,"default-model":S,"additional-settings":C},{"basic-settings":c(()=>[o(s(d),{modelValue:A.value,"onUpdate:modelValue":r[0]||=e=>A.value=e,label:s(y)(`settings.pages.providers.provider.microsoft-speech.fields.field.region.label`),description:s(y)(`settings.pages.providers.provider.microsoft-speech.fields.field.region.description`),placeholder:`eastasia`,required:``,type:`text`},null,8,[`modelValue`,`label`,`description`])]),"voice-settings":c(()=>[l(`div`,b,[o(s(f),{modelValue:D.value,"onUpdate:modelValue":r[1]||=e=>D.value=e,label:s(y)(`settings.pages.providers.provider.common.fields.field.pitch.label`),description:s(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`]),o(s(f),{modelValue:O.value,"onUpdate:modelValue":r[2]||=e=>O.value=e,label:s(y)(`settings.pages.providers.provider.common.fields.field.speed.label`),description:s(y)(`settings.pages.providers.provider.common.fields.field.speed.description`),min:.5,max:2,step:.01},null,8,[`modelValue`,`label`,`description`]),o(s(f),{modelValue:k.value,"onUpdate:modelValue":r[3]||=e=>k.value=e,label:s(y)(`settings.pages.providers.provider.common.fields.field.volume.label`),description:s(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:c(()=>[o(s(h),{"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/models-CcEJuOe_.js b/assets/models-DCzLlqM2.js similarity index 99% rename from assets/models-CcEJuOe_.js rename to assets/models-DCzLlqM2.js index af06868591ad4e42a6265c67b34e22d59a685a74..f930ddf12091fdc88ca57fb224a5a6d2a2cb36bc 100644 --- a/assets/models-CcEJuOe_.js +++ b/assets/models-DCzLlqM2.js @@ -1 +1 @@ -import{A as e,B as t,C as n,Dt as r,G as i,J as a,K as o,L as s,M as c,Mt as l,Nt as u,O as d,Pt as f,R as p,S as m,W as h,Y as g,Z as _,at as v,b as y,d as b,f as x,gt as S,jt as C,k as w,kt as T,lt as E,m as D,nt as O,ut as k,w as A,x as j,xt as M,z as N}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./tres-B5z5lcdF.js";import{a as P,b as F,c as I,d as L,f as R,i as z,m as B,n as V,p as H,r as U,s as W,t as ee,u as G,x as K}from"./widgets-CZ9Rvki9.js";import{$ as q,A as J,B as te,C as ne,D as re,E as ie,F as ae,G as oe,H as se,I as ce,J as le,M as ue,N as de,O as fe,P as pe,R as Y,S as me,T as he,U as ge,V as _e,b as ve,et as X,g as ye,h as be,j as xe,k as Se,l as Z,m as Ce,r as Q,v as we,w as Te,x as Ee,y as De,z as Oe}from"./src-DYQXbDgu.js";import{a as ke}from"./resettable-CbXzRviW.js";import{a as Ae,c as je,d as Me,f as Ne,i as Pe,l as Fe,m as Ie,n as Le,o as Re,p as ze,r as Be,s as Ve,t as He,u as Ue}from"./DialogTitle-ytlEE0A-.js";import{u as We}from"./environment-CyZLTg97.js";import{b as Ge,d as Ke,h as qe,m as Je,y as Ye}from"./dist-Che88T83.js";import"./src-C83SCWbW.js";import{n as Xe}from"./vue-i18n.runtime-Dah5zGm4.js";import"./browser-DY5K31Vk.js";import{a as Ze,i as $,n as Qe}from"./settings-D1kLcsvA.js";import{t as $e}from"./browser-2lyKKTPE.js";import{t as et}from"./route-block-CpjdOEnv.js";import{n as tt,r as nt,t as rt}from"./src-BccD0BFR.js";import{n as it,t as at}from"./live2d-DukystQI.js";var ot=[`INPUT`,`TEXTAREA`];function st(e,t,n,r={}){if(!t||r.enableIgnoredElement&&ot.includes(t.nodeName))return null;let{arrowKeyOptions:i=`both`,attributeName:a=`[data-reka-collection-item]`,itemsArray:o=[],loop:s=!0,dir:c=`ltr`,preventScroll:l=!0,focus:u=!1}=r,[d,f,p,m,h,g]=[e.key===`ArrowRight`,e.key===`ArrowLeft`,e.key===`ArrowUp`,e.key===`ArrowDown`,e.key===`Home`,e.key===`End`],_=p||m,v=d||f;if(!h&&!g&&(!_&&!v||i===`vertical`&&v||i===`horizontal`&&_))return null;let y=n?Array.from(n.querySelectorAll(a)):o;if(!y.length)return null;l&&e.preventDefault();let b=null;return v||_?b=ct(y,t,{goForward:_?m:c===`ltr`?d:f,loop:s}):h?b=y.at(0)||null:g&&(b=y.at(-1)||null),u&&b?.focus(),b}function ct(e,t,n,r=e.length){if(--r===0)return null;let i=e.indexOf(t),a=n.goForward?i+1:i-1;if(!n.loop&&(a<0||a>=e.length))return null;let o=e[(a+e.length)%e.length];return o?o.hasAttribute(`disabled`)&&o.getAttribute(`disabled`)!==`false`?ct(e,o,n,r):o:null}var[lt,ut]=X(`RovingFocusGroup`),dt=e({__name:`RovingFocusGroup`,props:{orientation:{type:String,required:!1,default:void 0},dir:{type:String,required:!1},loop:{type:Boolean,required:!1,default:!1},currentTabStopId:{type:[String,null],required:!1},defaultCurrentTabStopId:{type:String,required:!1},preventScrollOnEntryFocus:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`entryFocus`,`update:currentTabStopId`],setup(e,{expose:t,emit:n}){let i=e,a=n,{loop:s,orientation:c,dir:l}=r(i),u=_e(l),d=oe(i,`currentTabStopId`,a,{defaultValue:i.defaultCurrentTabStopId,passive:i.currentTabStopId===void 0}),f=M(!1),p=M(!1),h=M(0),{getItems:_,CollectionSlot:v}=he({isProvider:!0});function y(e){let t=!p.value;if(e.currentTarget&&e.target===e.currentTarget&&t&&!f.value){let t=new CustomEvent(me,ne);if(e.currentTarget.dispatchEvent(t),a(`entryFocus`,t),!t.defaultPrevented){let e=_().map(e=>e.ref).filter(e=>e.dataset.disabled!==``);Te([e.find(e=>e.getAttribute(`data-active`)===``),e.find(e=>e.getAttribute(`data-highlighted`)===``),e.find(e=>e.id===d.value),...e].filter(Boolean),i.preventScrollOnEntryFocus)}}p.value=!1}function b(){setTimeout(()=>{p.value=!1},1)}return t({getItems:_}),ut({loop:s,dir:u,orientation:c,currentTabStopId:d,onItemFocus:e=>{d.value=e},onItemShiftTab:()=>{f.value=!0},onFocusableItemAdd:()=>{h.value++},onFocusableItemRemove:()=>{h.value--}}),(e,t)=>(o(),m(T(v),null,{default:E(()=>[w(T(J),{tabindex:f.value||h.value===0?-1:0,"data-orientation":T(c),as:e.as,"as-child":e.asChild,dir:T(u),style:{outline:`none`},onMousedown:t[0]||=e=>p.value=!0,onMouseup:b,onFocus:y,onBlur:t[1]||=e=>f.value=!1},{default:E(()=>[g(e.$slots,`default`)]),_:3},8,[`tabindex`,`data-orientation`,`as`,`as-child`,`dir`])]),_:3}))}}),ft=e({__name:`MenuAnchor`,props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e;return(e,n)=>(o(),m(T(we),l(c(t)),{default:E(()=>[g(e.$slots,`default`)]),_:3},16))}});function pt(){let e=M(!1);return h(()=>{ge(`keydown`,()=>{e.value=!0},{capture:!0,passive:!0}),ge([`pointerdown`,`pointermove`],()=>{e.value=!1},{capture:!0,passive:!0})}),e}var mt=le(pt),[ht,gt]=X([`MenuRoot`,`MenuSub`],`MenuContext`),[_t,vt]=X(`MenuRoot`),yt=e({__name:`MenuRoot`,props:{open:{type:Boolean,required:!1,default:!1},dir:{type:String,required:!1},modal:{type:Boolean,required:!1,default:!0}},emits:[`update:open`],setup(e,{emit:t}){let n=e,i=t,{modal:a,dir:s}=r(n),c=_e(s),l=oe(n,`open`,i),u=M(),d=mt();return gt({open:l,onOpenChange:e=>{l.value=e},content:u,onContentChange:e=>{u.value=e}}),vt({onClose:()=>{l.value=!1},isUsingKeyboardRef:d,dir:c,modal:a}),(e,t)=>(o(),m(T(De),null,{default:E(()=>[g(e.$slots,`default`)]),_:3}))}}),[bt,xt]=X(`MenuContent`),St=e({__name:`MenuContentImpl`,props:s({loop:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},disableOutsideScroll:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},{...be}),emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`entryFocus`,`openAutoFocus`,`closeAutoFocus`,`dismiss`],setup(e,{emit:t}){let n=e,a=t,s=ht(),c=_t(),{trapFocus:l,disableOutsidePointerEvents:u,loop:d}=r(n);K(),se(u.value);let f=M(``),p=M(0),h=M(0),_=M(null),y=M(`right`),b=M(0),x=M(null),S=M(),{forwardRef:C,currentElement:D}=Y(),{handleTypeaheadSearch:O}=ue();v(D,e=>{s.onContentChange(e)}),i(()=>{window.clearTimeout(p.value)});function k(e){return y.value===_.value?.side&&Ne(e,_.value?.area)}async function A(e){a(`openAutoFocus`,e),!e.defaultPrevented&&(e.preventDefault(),D.value?.focus({preventScroll:!0}))}function j(e){if(e.defaultPrevented)return;let t=e.target.closest(`[data-reka-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1,i=st(e,q(),D.value,{loop:d.value,arrowKeyOptions:`vertical`,dir:c?.dir.value,focus:!0,attributeName:`[data-reka-collection-item]:not([data-disabled])`});if(i)return i?.focus();if(e.code===`Space`)return;let a=S.value?.getItems()??[];if(t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&O(e.key,a)),e.target!==D.value||!Ae.includes(e.key))return;e.preventDefault();let o=[...a.map(e=>e.ref)];Ve.includes(e.key)&&o.reverse(),Fe(o)}function N(e){e?.currentTarget?.contains?.(e.target)||(window.clearTimeout(p.value),f.value=``)}function P(e){if(!Me(e))return;let t=e.target,n=b.value!==e.clientX;(e?.currentTarget)?.contains(t)&&n&&(y.value=e.clientX>b.value?`right`:`left`,b.value=e.clientX)}return xt({onItemEnter:e=>!!k(e),onItemLeave:e=>{k(e)||(D.value?.focus(),x.value=null)},onTriggerLeave:e=>!!k(e),searchRef:f,pointerGraceTimerRef:h,onPointerGraceIntentChange:e=>{_.value=e}}),(e,t)=>(o(),m(T(ze),{"as-child":``,trapped:T(l),onMountAutoFocus:A,onUnmountAutoFocus:t[7]||=e=>a(`closeAutoFocus`,e)},{default:E(()=>[w(T(ie),{"as-child":``,"disable-outside-pointer-events":T(u),onEscapeKeyDown:t[2]||=e=>a(`escapeKeyDown`,e),onPointerDownOutside:t[3]||=e=>a(`pointerDownOutside`,e),onFocusOutside:t[4]||=e=>a(`focusOutside`,e),onInteractOutside:t[5]||=e=>a(`interactOutside`,e),onDismiss:t[6]||=e=>a(`dismiss`)},{default:E(()=>[w(T(dt),{ref_key:`rovingFocusGroupRef`,ref:S,"current-tab-stop-id":x.value,"onUpdate:currentTabStopId":t[0]||=e=>x.value=e,"as-child":``,orientation:`vertical`,dir:T(c).dir.value,loop:T(d),onEntryFocus:t[1]||=e=>{a(`entryFocus`,e),T(c).isUsingKeyboardRef.value||e.preventDefault()}},{default:E(()=>[w(T(ye),{ref:T(C),role:`menu`,as:e.as,"as-child":e.asChild,"aria-orientation":`vertical`,"data-reka-menu-content":``,"data-state":T(Ue)(T(s).open.value),dir:T(c).dir.value,side:e.side,"side-offset":e.sideOffset,align:e.align,"align-offset":e.alignOffset,"avoid-collisions":e.avoidCollisions,"collision-boundary":e.collisionBoundary,"collision-padding":e.collisionPadding,"arrow-padding":e.arrowPadding,"prioritize-position":e.prioritizePosition,"position-strategy":e.positionStrategy,"update-position-strategy":e.updatePositionStrategy,sticky:e.sticky,"hide-when-detached":e.hideWhenDetached,reference:e.reference,onKeydown:j,onBlur:N,onPointermove:P},{default:E(()=>[g(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`data-state`,`dir`,`side`,`side-offset`,`align`,`align-offset`,`avoid-collisions`,`collision-boundary`,`collision-padding`,`arrow-padding`,`prioritize-position`,`position-strategy`,`update-position-strategy`,`sticky`,`hide-when-detached`,`reference`])]),_:3},8,[`current-tab-stop-id`,`dir`,`loop`])]),_:3},8,[`disable-outside-pointer-events`])]),_:3},8,[`trapped`]))}}),Ct=e({inheritAttrs:!1,__name:`MenuItemImpl`,props:{disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let n=e,r=bt(),{forwardRef:i}=Y(),{CollectionItem:a}=he(),s=M(!1);async function c(e){e.defaultPrevented||Me(e)&&(n.disabled?r.onItemLeave(e):r.onItemEnter(e)||e.currentTarget?.focus({preventScroll:!0}))}async function l(e){await t(),!e.defaultPrevented&&Me(e)&&r.onItemLeave(e)}return(e,n)=>(o(),m(T(a),{value:{textValue:e.textValue}},{default:E(()=>[w(T(J),N({ref:T(i),role:`menuitem`,tabindex:`-1`},e.$attrs,{as:e.as,"as-child":e.asChild,"aria-disabled":e.disabled||void 0,"data-disabled":e.disabled?``:void 0,"data-highlighted":s.value?``:void 0,onPointermove:c,onPointerleave:l,onFocus:n[0]||=async n=>{await t(),!(n.defaultPrevented||e.disabled)&&(s.value=!0)},onBlur:n[1]||=async e=>{await t(),!e.defaultPrevented&&(s.value=!1)}}),{default:E(()=>[g(e.$slots,`default`)]),_:3},16,[`as`,`as-child`,`aria-disabled`,`data-disabled`,`data-highlighted`])]),_:3},8,[`value`]))}}),wt=e({__name:`MenuItem`,props:{disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`select`],setup(e,{emit:n}){let r=e,i=n,{forwardRef:a,currentElement:s}=Y(),c=_t(),l=bt(),u=M(!1);async function d(){let e=s.value;if(!r.disabled&&e){let e=new CustomEvent(Re,{bubbles:!0,cancelable:!0});i(`select`,e),await t(),e.defaultPrevented?u.value=!1:c.onClose()}}return(e,n)=>(o(),m(Ct,N(r,{ref:T(a),onClick:d,onPointerdown:n[0]||=()=>{u.value=!0},onPointerup:n[1]||=async e=>{await t(),!e.defaultPrevented&&(u.value||e.currentTarget?.click())},onKeydown:n[2]||=async t=>{let n=T(l).searchRef.value!==``;e.disabled||n&&t.key===` `||T(je).includes(t.key)&&(t.currentTarget.click(),t.preventDefault())}}),{default:E(()=>[g(e.$slots,`default`)]),_:3},16))}}),Tt=e({__name:`MenuRootContentModal`,props:{loop:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`entryFocus`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=ce(n,r),a=ht(),{forwardRef:s,currentElement:c}=Y();return ae(c),(e,t)=>(o(),m(St,N(T(i),{ref:T(s),"trap-focus":T(a).open.value,"disable-outside-pointer-events":T(a).open.value,"disable-outside-scroll":!0,onDismiss:t[0]||=e=>T(a).onOpenChange(!1),onFocusOutside:t[1]||=x(e=>r(`focusOutside`,e),[`prevent`])}),{default:E(()=>[g(e.$slots,`default`)]),_:3},16,[`trap-focus`,`disable-outside-pointer-events`]))}}),Et=e({__name:`MenuRootContentNonModal`,props:{loop:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`entryFocus`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=ce(e,t),r=ht();return(e,t)=>(o(),m(St,N(T(n),{"trap-focus":!1,"disable-outside-pointer-events":!1,"disable-outside-scroll":!1,onDismiss:t[0]||=e=>T(r).onOpenChange(!1)}),{default:E(()=>[g(e.$slots,`default`)]),_:3},16))}}),Dt=e({__name:`MenuContent`,props:{forceMount:{type:Boolean,required:!1},loop:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`entryFocus`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=ce(e,t),r=ht(),i=_t();return(e,t)=>(o(),m(T(xe),{present:e.forceMount||T(r).open.value},{default:E(()=>[T(i).modal.value?(o(),m(Tt,l(N({key:0},{...e.$attrs,...T(n)})),{default:E(()=>[g(e.$slots,`default`)]),_:3},16)):(o(),m(Et,l(N({key:1},{...e.$attrs,...T(n)})),{default:E(()=>[g(e.$slots,`default`)]),_:3},16))]),_:3},8,[`present`]))}}),Ot=e({__name:`MenuPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(o(),m(T(Le),l(c(t)),{default:E(()=>[g(e.$slots,`default`)]),_:3},16))}}),[kt,At]=X(`DropdownMenuRoot`),jt=e({__name:`DropdownMenuRoot`,props:{defaultOpen:{type:Boolean,required:!1},open:{type:Boolean,required:!1,default:void 0},dir:{type:String,required:!1},modal:{type:Boolean,required:!1,default:!0}},emits:[`update:open`],setup(e,{emit:t}){let n=e,i=t;Y();let a=oe(n,`open`,i,{defaultValue:n.defaultOpen,passive:n.open===void 0}),s=M(),{modal:c,dir:l}=r(n),u=_e(l);return At({open:a,onOpenChange:e=>{a.value=e},onOpenToggle:()=>{a.value=!a.value},triggerId:``,triggerElement:s,contentId:``,modal:c,dir:u}),(e,t)=>(o(),m(T(yt),{open:T(a),"onUpdate:open":t[0]||=e=>S(a)?a.value=e:null,dir:T(u),modal:T(c)},{default:E(()=>[g(e.$slots,`default`,{open:T(a)})]),_:3},8,[`open`,`dir`,`modal`]))}}),Mt=e({__name:`DropdownMenuContent`,props:{forceMount:{type:Boolean,required:!1},loop:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`closeAutoFocus`],setup(e,{emit:t}){let n=ce(e,t);Y();let r=kt(),i=M(!1);function a(e){e.defaultPrevented||(i.value||setTimeout(()=>{r.triggerElement.value?.focus()},0),i.value=!1,e.preventDefault())}return r.contentId||=pe(void 0,`reka-dropdown-menu-content`),(e,t)=>(o(),m(T(Dt),N(T(n),{id:T(r).contentId,"aria-labelledby":T(r)?.triggerId,style:{"--reka-dropdown-menu-content-transform-origin":`var(--reka-popper-transform-origin)`,"--reka-dropdown-menu-content-available-width":`var(--reka-popper-available-width)`,"--reka-dropdown-menu-content-available-height":`var(--reka-popper-available-height)`,"--reka-dropdown-menu-trigger-width":`var(--reka-popper-anchor-width)`,"--reka-dropdown-menu-trigger-height":`var(--reka-popper-anchor-height)`},onCloseAutoFocus:a,onInteractOutside:t[0]||=e=>{if(e.defaultPrevented)return;let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,a=t.button===2||n;(!T(r).modal.value||a)&&(i.value=!0),T(r).triggerElement.value?.contains(e.target)&&e.preventDefault()}}),{default:E(()=>[g(e.$slots,`default`)]),_:3},16,[`id`,`aria-labelledby`]))}}),Nt=e({__name:`DropdownMenuItem`,props:{disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`select`],setup(e,{emit:t}){let n=e,r=te(t);return Y(),(e,t)=>(o(),m(T(wt),l(c({...n,...T(r)})),{default:E(()=>[g(e.$slots,`default`)]),_:3},16))}}),Pt=e({__name:`DropdownMenuPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(o(),m(T(Ot),l(c(t)),{default:E(()=>[g(e.$slots,`default`)]),_:3},16))}}),Ft=e({__name:`DropdownMenuTrigger`,props:{disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let n=e,r=kt(),{forwardRef:i,currentElement:a}=Y();return h(()=>{r.triggerElement=a}),r.triggerId||=pe(void 0,`reka-dropdown-menu-trigger`),(e,a)=>(o(),m(T(ft),{"as-child":``},{default:E(()=>[w(T(J),{id:T(r).triggerId,ref:T(i),type:e.as===`button`?`button`:void 0,"as-child":n.asChild,as:e.as,"aria-haspopup":`menu`,"aria-expanded":T(r).open.value,"aria-controls":T(r).open.value?T(r).contentId:void 0,"data-disabled":e.disabled?``:void 0,disabled:e.disabled,"data-state":T(r).open.value?`open`:`closed`,onClick:a[0]||=async n=>{!e.disabled&&n.button===0&&n.ctrlKey===!1&&(T(r)?.onOpenToggle(),await t(),T(r).open.value&&n.preventDefault())},onKeydown:a[1]||=b(t=>{e.disabled||([`Enter`,` `].includes(t.key)&&T(r).onOpenToggle(),t.key===`ArrowDown`&&T(r).onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(t.key)&&t.preventDefault())},[`enter`,`space`,`arrow-down`])},{default:E(()=>[g(e.$slots,`default`)]),_:3},8,[`id`,`type`,`as-child`,`as`,`aria-expanded`,`aria-controls`,`data-disabled`,`disabled`,`data-state`])]),_:3}))}}),[It,Lt]=X(`EditableRoot`),Rt=e({inheritAttrs:!1,__name:`EditableRoot`,props:{defaultValue:{type:String,required:!1},modelValue:{type:[String,null],required:!1},placeholder:{type:[String,Object],required:!1,default:`Enter text...`},dir:{type:String,required:!1},disabled:{type:Boolean,required:!1,default:!1},readonly:{type:Boolean,required:!1},activationMode:{type:String,required:!1,default:`focus`},selectOnFocus:{type:Boolean,required:!1,default:!1},submitMode:{type:String,required:!1,default:`blur`},startWithEditMode:{type:Boolean,required:!1},maxLength:{type:Number,required:!1},autoResize:{type:Boolean,required:!1,default:!1},id:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`div`},name:{type:String,required:!1},required:{type:Boolean,required:!1,default:!1}},emits:[`update:modelValue`,`submit`,`update:state`],setup(e,{expose:t,emit:i}){let a=e,s=i,{id:c,name:l,defaultValue:u,startWithEditMode:d,placeholder:f,maxLength:p,disabled:h,dir:_,submitMode:b,activationMode:x,selectOnFocus:S,readonly:C,autoResize:w,required:D}=r(a),O=M(),k=_e(_),A=M(d.value??!1),j=oe(a,`modelValue`,s,{defaultValue:u.value??``,passive:a.modelValue===void 0}),{primitiveElement:P,currentElement:F}=Se(),I=Oe(F),L=y(()=>typeof f.value==`string`?{edit:f.value,preview:f.value}:f.value),R=M(j.value);v(()=>j.value,()=>{R.value=j.value},{immediate:!0,deep:!0});function z(){A.value=!1,s(`update:state`,`cancel`)}function B(){A.value=!0,R.value=j.value,s(`update:state`,`edit`)}function V(){j.value=R.value,A.value=!1,s(`update:state`,`submit`),s(`submit`,R.value)}function H(){A.value&&(b.value===`blur`||b.value===`both`?V():z())}let U=fe(()=>H(),F,A),W=re(()=>H(),F,A),ee=y(()=>j.value===``);return t({submit:V,cancel:z,edit:B}),Lt({id:c,name:l,disabled:h,isEditing:A,maxLength:p,modelValue:j,inputValue:R,placeholder:L,edit:B,cancel:z,submit:V,activationMode:x,submitMode:b,selectOnFocus:S,inputRef:O,startWithEditMode:d,isEmpty:ee,readonly:C,autoResize:w}),(e,t)=>(o(),m(T(J),N(e.$attrs,{ref_key:`primitiveElement`,ref:P,as:e.as,"as-child":e.asChild,dir:T(k),"data-dismissable-layer":``,onFocusCapture:T(W).onFocusCapture,onBlurCapture:T(W).onBlurCapture,onPointerdownCapture:T(U).onPointerDownCapture}),{default:E(()=>[g(e.$slots,`default`,{modelValue:T(j),isEditing:A.value,isEmpty:ee.value,submit:V,cancel:z,edit:B}),T(I)&&T(l)?(o(),m(T(ve),{key:0,type:`text`,value:T(j),name:T(l),disabled:T(h),required:T(D)},null,8,[`value`,`name`,`disabled`,`required`])):n(`v-if`,!0)]),_:3},16,[`as`,`as-child`,`dir`,`onFocusCapture`,`onBlurCapture`,`onPointerdownCapture`]))}}),zt=e({__name:`EditableArea`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`div`}},setup(e){let t=e,n=It();return(e,r)=>(o(),m(T(J),N(t,{"data-placeholder-shown":T(n).isEditing.value?void 0:``,"data-focus":T(n).isEditing.value?``:void 0,"data-focused":T(n).isEditing.value?``:void 0,"data-empty":T(n).isEmpty.value?``:void 0,"data-readonly":T(n).readonly.value?``:void 0,"data-disabled":T(n).disabled.value?``:void 0,style:T(n).autoResize.value?{display:`inline-grid`}:void 0}),{default:E(()=>[g(e.$slots,`default`)]),_:3},16,[`data-placeholder-shown`,`data-focus`,`data-focused`,`data-empty`,`data-readonly`,`data-disabled`,`style`]))}}),Bt=e({__name:`EditableEditTrigger`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=It();return(e,r)=>(o(),m(T(J),N(t,{"aria-label":`edit`,"aria-disabled":T(n).disabled.value?``:void 0,"data-disabled":T(n).disabled.value?``:void 0,disabled:T(n).disabled.value,type:e.as===`button`?`button`:void 0,hidden:T(n).isEditing.value?``:void 0,onClick:T(n).edit}),{default:E(()=>[g(e.$slots,`default`,{},()=>[r[0]||=d(`Edit`)])]),_:3},16,[`aria-disabled`,`data-disabled`,`disabled`,`type`,`hidden`,`onClick`]))}}),Vt=e({__name:`EditableInput`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`input`}},setup(e){let n=e,r=de(),i=It(),a=y(()=>i.disabled.value),s=y(()=>i.placeholder.value?.edit),{primitiveElement:c,currentElement:l}=Se();h(()=>{i.inputRef.value=l.value,i.startWithEditMode.value&&(i.inputRef.value?.focus({preventScroll:!0}),i.selectOnFocus.value&&i.inputRef.value?.select())}),v(i.isEditing,e=>{e&&t(()=>{i.inputRef.value?.focus({preventScroll:!0}),i.selectOnFocus.value&&i.inputRef.value?.select()})});function u(e){(i.submitMode.value===`enter`||i.submitMode.value===`both`)&&e.key===r.ENTER&&!e.shiftKey&&!e.metaKey&&i.submit()}return(e,t)=>(o(),m(T(J),N({ref_key:`primitiveElement`,ref:c},n,{value:T(i).inputValue.value,placeholder:s.value,disabled:a.value,maxlength:T(i).maxLength.value,"data-disabled":a.value?``:void 0,"data-readonly":T(i).readonly.value?``:void 0,readonly:T(i).readonly.value,"aria-label":`editable input`,hidden:T(i).autoResize.value?void 0:!T(i).isEditing.value,style:T(i).autoResize.value?{all:`unset`,gridArea:`1 / 1 / auto / auto`,visibility:T(i).isEditing.value?void 0:`hidden`}:void 0,onInput:t[0]||=e=>T(i).inputValue.value=e.target.value,onKeydown:[b(u,[`enter`,`space`]),b(T(i).cancel,[`esc`])]}),{default:E(()=>[g(e.$slots,`default`)]),_:3},16,[`value`,`placeholder`,`disabled`,`maxlength`,`data-disabled`,`data-readonly`,`readonly`,`hidden`,`style`,`onKeydown`]))}}),Ht=e({__name:`EditablePreview`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let t=e,n=It(),r=y(()=>n.placeholder.value?.preview);function i(){n.activationMode.value===`focus`&&n.edit()}function a(){n.activationMode.value===`dblclick`&&n.edit()}return(e,s)=>(o(),m(T(J),N(t,{tabindex:`0`,"data-placeholder-shown":T(n).isEditing.value?void 0:``,hidden:T(n).autoResize.value?void 0:T(n).isEditing.value,style:T(n).autoResize.value?{whiteSpace:`pre`,userSelect:`none`,gridArea:`1 / 1 / auto / auto`,visibility:T(n).isEditing.value?`hidden`:void 0,overflow:`hidden`,textOverflow:`ellipsis`}:void 0,onFocusin:i,onDblclick:a}),{default:E(()=>[g(e.$slots,`default`,{},()=>[d(f(T(n).modelValue.value||r.value),1)])]),_:3},16,[`data-placeholder-shown`,`hidden`,`style`]))}}),Ut=e({__name:`EditableSubmitTrigger`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=It();return(e,r)=>(o(),m(T(J),N(t,{"aria-label":`submit`,"aria-disabled":T(n).disabled.value?``:void 0,"data-disabled":T(n).disabled.value?``:void 0,disabled:T(n).disabled.value,type:e.as===`button`?`button`:void 0,hidden:T(n).isEditing.value?void 0:``,onClick:T(n).submit}),{default:E(()=>[g(e.$slots,`default`,{},()=>[r[0]||=d(`Submit`)])]),_:3},16,[`aria-disabled`,`data-disabled`,`disabled`,`type`,`hidden`,`onClick`]))}}),Wt={flex:``,"items-center":``},Gt={flex:``,"items-center":``},Kt={flex:``,"items-center":``},qt={flex:``,"items-center":``,"justify-between":``},Jt={"data-motion-selector":``,relative:``,flex:``,"flex-col":``,"items-end":``,"gap-1":``},Yt=[`title`],Xt={"max-w-32":``,truncate:``},Zt={key:0,bg:`white dark:neutral-800`,border:`1 neutral-200 dark:neutral-700`,absolute:``,"right-0":``,"top-10":``,"z-50":``,"max-h-80":``,"min-w-64":``,"overflow-y-auto":``,"rounded-lg":``,"shadow-lg":``},Qt={key:0,"p-4":``,"text-sm":``,"text-neutral-500":``,"dark:text-neutral-400":``},$t=[`onClick`],en={"text-sm":``,"text-neutral-900":``,"font-medium":``,"dark:text-neutral-100":``},tn={truncate:``,"text-xs":``,"text-neutral-500":``,"dark:text-neutral-400":``},nn={"mt-4":``,flex:``,"items-center":``,"justify-between":``},rn={"mt-4":``,flex:``,"items-center":``,"justify-between":``},an={flex:``,"items-center":``},on={flex:``,"items-center":``},sn={flex:``,"items-center":``},cn={flex:``,"items-center":``},ln={flex:``,"items-center":``},un={flex:``,"items-center":``},dn={flex:``,"items-center":``},fn={flex:``,"items-center":``},pn={flex:``,"items-center":``},mn={flex:``,"items-center":``},hn={flex:``,"items-center":``},gn={flex:``,"items-center":``},_n={flex:``,"items-center":``},vn={flex:``,"items-center":``},yn={flex:``,"items-center":``},bn={flex:``,"items-center":``},xn={flex:``,"items-center":``},Sn={flex:``,"items-center":``},Cn={flex:``,"items-center":``},wn={flex:``,"items-center":``},Tn={flex:``,"items-center":``},En={flex:``,"items-center":``},Dn=200,On=200,kn=e({__name:`Live2D`,props:{palette:{}},emits:[`extractColorsFromModel`],setup(e){let{t}=Xe(),{live2dDisableFocus:r,live2dIdleAnimationEnabled:s,live2dAutoBlinkEnabled:c,live2dShadowEnabled:l}=ke(Qe()),u=it(),{scale:p,position:m,modelParameters:g,currentMotion:_}=ke(u),y=M(``),b=M(``),x=M([]),O=M(!1);h(()=>{v(()=>u.availableMotions,e=>{x.value=e.map(e=>({name:e.fileName.split(`/`).pop()||e.fileName,fullPath:e.fileName,displayPath:e.fileName,group:e.motionName,index:e.motionIndex})),console.info(`Available motions:`,x.value)},{immediate:!0});let e=localStorage.getItem(`selected-runtime-motion`),t=localStorage.getItem(`selected-runtime-motion-name`);e&&(y.value=e),t&&(b.value=t),document.addEventListener(`click`,F)});function k(){g.value={...at}}function N(e){y.value=e.displayPath,b.value=e.name,localStorage.setItem(`selected-runtime-motion`,e.displayPath),localStorage.setItem(`selected-runtime-motion-name`,e.name),localStorage.setItem(`selected-runtime-motion-group`,e.group),localStorage.setItem(`selected-runtime-motion-index`,e.index.toString()),s.value=!0,_.value={group:e.group,index:e.index},O.value=!1,console.info(`✅ Selected runtime motion:`,e.name),console.info(`Full path:`,e.displayPath),console.info(`Group:`,e.group,`Index:`,e.index)}function P(){O.value=!O.value}function F(e){e.target.closest(`[data-motion-selector]`)||(O.value=!1)}i(()=>{document.removeEventListener(`click`,F)});let L=null,R=null,z=Dn+On,B=0,V=1,H=1,U=!1,W=!1,G=null;function K(){L!==null&&(cancelAnimationFrame(L),L=null,U=!1),R!==null&&(clearTimeout(R),R=null),G!==null&&(clearTimeout(G),G=null)}function q(){if(U||R!==null||(K(),!c.value))return;U=!0,B=Date.now(),V=g.value.leftEyeOpen,H=g.value.rightEyeOpen;function e(){if(!c.value){K();return}let t=Date.now()-B,n=Math.min(t/z,1),r,i;if(t{W=!1},0),n<1)L=requestAnimationFrame(e);else if(W=!0,g.value.leftEyeOpen=Math.round(V*100)/100,g.value.rightEyeOpen=Math.round(H*100)/100,setTimeout(()=>{W=!1},0),U=!1,L=null,c.value){let e=5e3+Math.random()*5e3;R=setTimeout(()=>{R=null,c.value&&!U&&q()},e)}}L=requestAnimationFrame(e)}return v(c,e=>{e?!U&&R===null&&q():K()}),v(()=>g.value.leftEyeOpen,(e,t)=>{if(!(!c.value||U||W||R!==null)){if(t==null&&e>0){q();return}t!==void 0&&Math.abs(e-t)>.01&&(K(),G!==null&&clearTimeout(G),G=setTimeout(()=>{c.value&&!U&&R===null&&q(),G=null},1e3))}},{immediate:!0}),v(()=>g.value.rightEyeOpen,(e,t)=>{if(!(!c.value||U||W||R!==null)){if(t==null&&e>0){q();return}t!==void 0&&Math.abs(e-t)>.01&&(K(),G!==null&&clearTimeout(G),G=setTimeout(()=>{c.value&&!U&&R===null&&q(),G=null},1e3))}},{immediate:!0}),i(()=>{K()}),(i,s)=>(o(),A(D,null,[w(T(I),{title:T(t)(`settings.live2d.scale-and-position.title`),icon:`i-solar:scale-bold-duotone`,class:C([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`]),size:`sm`,expand:!0},{default:E(()=>[w(T(Z),{modelValue:T(p),"onUpdate:modelValue":s[1]||=e=>S(p)?p.value=e:null,as:`div`,min:.1,max:3,step:.01,label:T(t)(`settings.live2d.scale-and-position.scale`)},{label:E(()=>[j(`div`,Wt,[j(`div`,null,f(T(t)(`settings.live2d.scale-and-position.scale`)),1),j(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:s[0]||=()=>p.value=1},[...s[54]||=[j(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)]])])]),_:1},8,[`modelValue`,`label`]),w(T(Z),{modelValue:T(m).x,"onUpdate:modelValue":s[3]||=e=>T(m).x=e,as:`div`,min:-1e3,max:1e3,step:1,label:T(t)(`settings.live2d.scale-and-position.x`)},{label:E(()=>[j(`div`,Gt,[j(`div`,null,f(T(t)(`settings.live2d.scale-and-position.x`)),1),j(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:s[2]||=()=>T(m).x=0},[...s[55]||=[j(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)]])])]),_:1},8,[`modelValue`,`label`]),w(T(Z),{modelValue:T(m).y,"onUpdate:modelValue":s[5]||=e=>T(m).y=e,as:`div`,min:-1e3,max:1e3,step:1,label:T(t)(`settings.live2d.scale-and-position.y`)},{label:E(()=>[j(`div`,Kt,[j(`div`,null,f(T(t)(`settings.live2d.scale-and-position.y`)),1),j(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:s[4]||=()=>T(m).y=0},[...s[56]||=[j(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)]])])]),_:1},8,[`modelValue`,`label`])]),_:1},8,[`title`]),w(T(I),{title:T(t)(`settings.live2d.theme-color-from-model.title`),icon:`i-solar:magic-stick-3-bold-duotone`,"inner-class":`text-sm`,class:C([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`]),size:`sm`,expand:!1},{default:E(()=>[w(T(ee),{class:`mb-4 mt-2`,colors:e.palette.map(e=>({hex:e,name:e})),"mx-auto":``},null,8,[`colors`]),w(T(Q),{variant:`secondary`,onClick:s[6]||=e=>i.$emit(`extractColorsFromModel`)},{default:E(()=>[d(f(T(t)(`settings.live2d.theme-color-from-model.button-extract.title`)),1)]),_:1})]),_:1},8,[`title`]),w(T(I),{title:T(t)(`settings.live2d.focus.title`),icon:`i-solar:eye-scan-bold-duotone`,class:C([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`]),size:`sm`,expand:!1},{default:E(()=>[w(T(Ce),{modelValue:T(r),"onUpdate:modelValue":s[7]||=e=>S(r)?r.value=e:null,label:T(t)(`settings.live2d.focus.button-disable.title`)},null,8,[`modelValue`,`label`])]),_:1},8,[`title`]),w(T(I),{title:`Parameters`,icon:`i-solar:settings-bold-duotone`,class:C([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`]),size:`sm`,expand:!1},{default:E(()=>[j(`div`,qt,[s[57]||=j(`span`,{"text-sm":``,"text-neutral-600":``,"dark:text-neutral-400":``},`Idle Animation`,-1),j(`div`,Jt,[j(`button`,{title:y.value,flex:``,"items-center":``,"gap-2":``,border:``,rounded:``,"bg-neutral-100":``,"px-4":``,"py-2":``,"text-sm":``,"text-neutral-700":``,"font-medium":``,"transition-colors":``,"dark:border-neutral-700":``,"dark:bg-neutral-800":``,"hover:bg-neutral-200":``,"dark:text-neutral-300":``,"dark:hover:bg-neutral-700":``,onClick:P},[j(`span`,Xt,f(b.value||`Select Motion`),1),j(`div`,{class:C(O.value?`i-solar:alt-arrow-up-line-duotone`:`i-solar:alt-arrow-down-line-duotone`),"text-xs":``,"transition-transform":``},null,2)],8,Yt),O.value?(o(),A(`div`,Zt,[x.value.length===0?(o(),A(`div`,Qt,` No motions available `)):n(``,!0),(o(!0),A(D,null,a(x.value,e=>(o(),A(`button`,{key:e.fullPath,"w-full":``,"px-4":``,"py-2.5":``,"text-left":``,"hover:bg":`neutral-100 dark:neutral-700`,"transition-colors":``,class:C({"bg-neutral-100 dark:bg-neutral-700":y.value===e.displayPath}),onClick:t=>N(e)},[j(`div`,en,f(e.name),1),j(`div`,tn,f(e.displayPath),1)],10,$t))),128))])):n(``,!0)])]),j(`div`,nn,[s[58]||=j(`span`,{"text-sm":``,"text-neutral-600":``,"dark:text-neutral-400":``},`Auto Blink`,-1),w(T(Ce),{modelValue:T(c),"onUpdate:modelValue":s[8]||=e=>S(c)?c.value=e:null},null,8,[`modelValue`])]),j(`div`,rn,[s[59]||=j(`span`,{"text-sm":``,"text-neutral-600":``,"dark:text-neutral-400":``},`Shadow`,-1),w(T(Ce),{modelValue:T(l),"onUpdate:modelValue":s[9]||=e=>S(l)?l.value=e:null},null,8,[`modelValue`])]),j(`button`,{"mt-4":``,"w-full":``,border:``,rounded:``,"bg-neutral-100":``,"px-4":``,"py-2":``,"text-sm":``,"text-neutral-700":``,"font-medium":``,"transition-colors":``,"dark:border-neutral-700":``,"dark:bg-neutral-800":``,"hover:bg-neutral-200":``,"dark:text-neutral-300":``,"dark:hover:bg-neutral-700":``,onClick:k},` Reset To Default Parameters `),s[104]||=j(`div`,{"mb-2":``,"mt-4":``,"text-xs":``,"text-neutral-500":``,"font-semibold":``,"dark:text-neutral-400":``},` Head Rotation `,-1),w(T(Z),{modelValue:T(g).angleX,"onUpdate:modelValue":s[11]||=e=>T(g).angleX=e,as:`div`,min:-30,max:30,step:.1,label:`Angle X`},{label:E(()=>[j(`div`,an,[s[61]||=j(`div`,null,`Angle X`,-1),j(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:s[10]||=()=>T(g).angleX=0},[...s[60]||=[j(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)]])])]),_:1},8,[`modelValue`]),w(T(Z),{modelValue:T(g).angleY,"onUpdate:modelValue":s[13]||=e=>T(g).angleY=e,as:`div`,min:-30,max:30,step:.1,label:`Angle Y`},{label:E(()=>[j(`div`,on,[s[63]||=j(`div`,null,`Angle Y`,-1),j(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:s[12]||=()=>T(g).angleY=0},[...s[62]||=[j(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)]])])]),_:1},8,[`modelValue`]),w(T(Z),{modelValue:T(g).angleZ,"onUpdate:modelValue":s[15]||=e=>T(g).angleZ=e,as:`div`,min:-30,max:30,step:.1,label:`Angle Z`},{label:E(()=>[j(`div`,sn,[s[65]||=j(`div`,null,`Angle Z`,-1),j(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:s[14]||=()=>T(g).angleZ=0},[...s[64]||=[j(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)]])])]),_:1},8,[`modelValue`]),s[105]||=j(`div`,{"mb-2":``,"mt-4":``,"text-xs":``,"text-neutral-500":``,"font-semibold":``,"dark:text-neutral-400":``},` Eyes `,-1),w(T(Z),{modelValue:T(g).leftEyeOpen,"onUpdate:modelValue":s[17]||=e=>T(g).leftEyeOpen=e,as:`div`,min:0,max:1,step:.01,label:`Left Eye Open/Close`},{label:E(()=>[j(`div`,cn,[s[67]||=j(`div`,null,`Left Eye Open/Close`,-1),j(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:s[16]||=()=>T(g).leftEyeOpen=0},[...s[66]||=[j(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)]])])]),_:1},8,[`modelValue`]),w(T(Z),{modelValue:T(g).rightEyeOpen,"onUpdate:modelValue":s[19]||=e=>T(g).rightEyeOpen=e,as:`div`,min:0,max:1,step:.01,label:`Right Eye Open/Close`},{label:E(()=>[j(`div`,ln,[s[69]||=j(`div`,null,`Right Eye Open/Close`,-1),j(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:s[18]||=()=>T(g).rightEyeOpen=0},[...s[68]||=[j(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)]])])]),_:1},8,[`modelValue`]),w(T(Z),{modelValue:T(g).leftEyeSmile,"onUpdate:modelValue":s[21]||=e=>T(g).leftEyeSmile=e,as:`div`,min:0,max:1,step:.01,label:`Left Eye Smiling`},{label:E(()=>[j(`div`,un,[s[71]||=j(`div`,null,`Left Eye Smiling`,-1),j(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:s[20]||=()=>T(g).leftEyeSmile=0},[...s[70]||=[j(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)]])])]),_:1},8,[`modelValue`]),w(T(Z),{modelValue:T(g).rightEyeSmile,"onUpdate:modelValue":s[23]||=e=>T(g).rightEyeSmile=e,as:`div`,min:0,max:1,step:.01,label:`Right Eye Smiling`},{label:E(()=>[j(`div`,dn,[s[73]||=j(`div`,null,`Right Eye Smiling`,-1),j(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:s[22]||=()=>T(g).rightEyeSmile=0},[...s[72]||=[j(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)]])])]),_:1},8,[`modelValue`]),s[106]||=j(`div`,{"mb-2":``,"mt-4":``,"text-xs":``,"text-neutral-500":``,"font-semibold":``,"dark:text-neutral-400":``},` Eyebrows `,-1),w(T(Z),{modelValue:T(g).leftEyebrowLR,"onUpdate:modelValue":s[25]||=e=>T(g).leftEyebrowLR=e,as:`div`,min:-1,max:1,step:.01,label:`Left eyebrow Left/Right`},{label:E(()=>[j(`div`,fn,[s[75]||=j(`div`,null,`Left eyebrow Left/Right`,-1),j(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:s[24]||=()=>T(g).leftEyebrowLR=0},[...s[74]||=[j(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)]])])]),_:1},8,[`modelValue`]),w(T(Z),{modelValue:T(g).rightEyebrowLR,"onUpdate:modelValue":s[27]||=e=>T(g).rightEyebrowLR=e,as:`div`,min:-1,max:1,step:.01,label:`Right eyebrow Left/Right`},{label:E(()=>[j(`div`,pn,[s[77]||=j(`div`,null,`Right eyebrow Left/Right`,-1),j(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:s[26]||=()=>T(g).rightEyebrowLR=0},[...s[76]||=[j(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)]])])]),_:1},8,[`modelValue`]),w(T(Z),{modelValue:T(g).leftEyebrowY,"onUpdate:modelValue":s[29]||=e=>T(g).leftEyebrowY=e,as:`div`,min:-1,max:1,step:.01,label:`Left Eyebrow Y (Up/Down)`},{label:E(()=>[j(`div`,mn,[s[79]||=j(`div`,null,`Left Eyebrow Y`,-1),j(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:s[28]||=()=>T(g).leftEyebrowY=0},[...s[78]||=[j(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)]])])]),_:1},8,[`modelValue`]),w(T(Z),{modelValue:T(g).rightEyebrowY,"onUpdate:modelValue":s[31]||=e=>T(g).rightEyebrowY=e,as:`div`,min:-1,max:1,step:.01,label:`Right Eyebrow Y (Up/Down)`},{label:E(()=>[j(`div`,hn,[s[81]||=j(`div`,null,`Right Eyebrow Y`,-1),j(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:s[30]||=()=>T(g).rightEyebrowY=0},[...s[80]||=[j(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)]])])]),_:1},8,[`modelValue`]),w(T(Z),{modelValue:T(g).leftEyebrowAngle,"onUpdate:modelValue":s[33]||=e=>T(g).leftEyebrowAngle=e,as:`div`,min:-1,max:1,step:.01,label:`Left Eyebrow Angle`},{label:E(()=>[j(`div`,gn,[s[83]||=j(`div`,null,`Left Eyebrow Angle`,-1),j(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:s[32]||=()=>T(g).leftEyebrowAngle=0},[...s[82]||=[j(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)]])])]),_:1},8,[`modelValue`]),w(T(Z),{modelValue:T(g).rightEyebrowAngle,"onUpdate:modelValue":s[35]||=e=>T(g).rightEyebrowAngle=e,as:`div`,min:-1,max:1,step:.01,label:`Right Eyebrow Angle`},{label:E(()=>[j(`div`,_n,[s[85]||=j(`div`,null,`Right Eyebrow Angle`,-1),j(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:s[34]||=()=>T(g).rightEyebrowAngle=0},[...s[84]||=[j(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)]])])]),_:1},8,[`modelValue`]),w(T(Z),{modelValue:T(g).leftEyebrowForm,"onUpdate:modelValue":s[37]||=e=>T(g).leftEyebrowForm=e,as:`div`,min:-1,max:1,step:.01,label:`Left Eyebrow Form (Deformation)`},{label:E(()=>[j(`div`,vn,[s[87]||=j(`div`,null,`Left Eyebrow Form`,-1),j(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:s[36]||=()=>T(g).leftEyebrowForm=0},[...s[86]||=[j(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)]])])]),_:1},8,[`modelValue`]),w(T(Z),{modelValue:T(g).rightEyebrowForm,"onUpdate:modelValue":s[39]||=e=>T(g).rightEyebrowForm=e,as:`div`,min:-1,max:1,step:.01,label:`Right Eyebrow Form (Deformation)`},{label:E(()=>[j(`div`,yn,[s[89]||=j(`div`,null,`Right Eyebrow Form`,-1),j(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:s[38]||=()=>T(g).rightEyebrowForm=0},[...s[88]||=[j(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)]])])]),_:1},8,[`modelValue`]),s[107]||=j(`div`,{"mb-2":``,"mt-4":``,"text-xs":``,"text-neutral-500":``,"font-semibold":``,"dark:text-neutral-400":``},` Mouth `,-1),w(T(Z),{modelValue:T(g).mouthOpen,"onUpdate:modelValue":s[41]||=e=>T(g).mouthOpen=e,as:`div`,min:0,max:1,step:.01,label:`Mouth Open/Close`},{label:E(()=>[j(`div`,bn,[s[91]||=j(`div`,null,`Mouth Open/Close`,-1),j(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:s[40]||=()=>T(g).mouthOpen=0},[...s[90]||=[j(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)]])])]),_:1},8,[`modelValue`]),w(T(Z),{modelValue:T(g).mouthForm,"onUpdate:modelValue":s[43]||=e=>T(g).mouthForm=e,as:`div`,min:-1,max:1,step:.01,label:`Mouth Form (Deformation)`},{label:E(()=>[j(`div`,xn,[s[93]||=j(`div`,null,`Mouth Form`,-1),j(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:s[42]||=()=>T(g).mouthForm=0},[...s[92]||=[j(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)]])])]),_:1},8,[`modelValue`]),s[108]||=j(`div`,{"mb-2":``,"mt-4":``,"text-xs":``,"text-neutral-500":``,"font-semibold":``,"dark:text-neutral-400":``},` Face `,-1),w(T(Z),{modelValue:T(g).cheek,"onUpdate:modelValue":s[45]||=e=>T(g).cheek=e,as:`div`,min:0,max:1,step:.01,label:`Cheek`},{label:E(()=>[j(`div`,Sn,[s[95]||=j(`div`,null,`Cheek`,-1),j(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:s[44]||=()=>T(g).cheek=0},[...s[94]||=[j(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)]])])]),_:1},8,[`modelValue`]),s[109]||=j(`div`,{"mb-2":``,"mt-4":``,"text-xs":``,"text-neutral-500":``,"font-semibold":``,"dark:text-neutral-400":``},` Body `,-1),w(T(Z),{modelValue:T(g).bodyAngleX,"onUpdate:modelValue":s[47]||=e=>T(g).bodyAngleX=e,as:`div`,min:-10,max:10,step:.1,label:`Body rotation X`},{label:E(()=>[j(`div`,Cn,[s[97]||=j(`div`,null,`Body rotation X`,-1),j(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:s[46]||=()=>T(g).bodyAngleX=0},[...s[96]||=[j(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)]])])]),_:1},8,[`modelValue`]),w(T(Z),{modelValue:T(g).bodyAngleY,"onUpdate:modelValue":s[49]||=e=>T(g).bodyAngleY=e,as:`div`,min:-10,max:10,step:.1,label:`Body rotation Y`},{label:E(()=>[j(`div`,wn,[s[99]||=j(`div`,null,`Body rotation Y`,-1),j(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:s[48]||=()=>T(g).bodyAngleY=0},[...s[98]||=[j(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)]])])]),_:1},8,[`modelValue`]),w(T(Z),{modelValue:T(g).bodyAngleZ,"onUpdate:modelValue":s[51]||=e=>T(g).bodyAngleZ=e,as:`div`,min:-10,max:10,step:.1,label:`Body rotation Z`},{label:E(()=>[j(`div`,Tn,[s[101]||=j(`div`,null,`Body rotation Z`,-1),j(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:s[50]||=()=>T(g).bodyAngleZ=0},[...s[100]||=[j(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)]])])]),_:1},8,[`modelValue`]),w(T(Z),{modelValue:T(g).breath,"onUpdate:modelValue":s[53]||=e=>T(g).breath=e,as:`div`,min:0,max:1,step:.01,label:`Breath`},{label:E(()=>[j(`div`,En,[s[103]||=j(`div`,null,`Breath`,-1),j(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:s[52]||=()=>T(g).breath=0},[...s[102]||=[j(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)]])])]),_:1},8,[`modelValue`])]),_:1})],64))}}),An={grid:`~ cols-5 gap-1`,"p-2":``},jn={class:`text-xs`},Mn={key:0},Nn={grid:`~ cols-5 gap-1`,"p-2":``},Pn={key:1},Fn={grid:`~ cols-5 gap-1`,"p-2":``},In={class:`text-sm text-neutral-600 space-y-1 dark:text-neutral-400`},Ln={class:`flex justify-between`},Rn={class:`flex justify-between`},zn={class:`flex justify-between`},Bn={class:`text-sm text-neutral-600 space-y-1 dark:text-neutral-400`},Vn=e({__name:`VRM`,props:{palette:{}},emits:[`extractColorsFromModel`],setup(e){let{t}=Xe(),{modelSize:n,modelOffset:r,cameraFOV:i,modelRotationY:s,cameraDistance:c,trackingMode:l,directionalLightRotation:u,directionalLightIntensity:p,directionalLightColor:h,ambientLightIntensity:g,ambientLightColor:_,hemisphereLightIntensity:v,hemisphereSkyColor:b,hemisphereGroundColor:x,envSelect:O,skyBoxIntensity:k}=ke(tt()),M=y(()=>[{value:`camera`,label:t(`settings.vrm.scale-and-position.eye-tracking-mode.options.option.camera`),class:`col-start-3`},{value:`mouse`,label:t(`settings.vrm.scale-and-position.eye-tracking-mode.options.option.mouse`),class:`col-start-4`},{value:`none`,label:t(`settings.vrm.scale-and-position.eye-tracking-mode.options.option.disabled`),class:`col-start-5`}]),N=[{value:`hemisphere`,label:`Hemisphere`,icon:{idle:`i-solar:forbidden-circle-linear rotate-45`,active:`i-solar:forbidden-circle-bold rotate-45`}},{value:`skyBox`,label:`SkyBox`,icon:{idle:`i-solar:gallery-circle-linear`,active:`i-solar:gallery-circle-bold`}}];return(y,P)=>(o(),A(D,null,[w(T(B),{title:T(t)(`settings.pages.models.sections.section.scene`),icon:`i-solar:people-nearby-bold-duotone`,class:C([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`])},{default:E(()=>[w(T(ee),{class:`mb-4 mt-2`,colors:e.palette.map(e=>({hex:e,name:e})),"mx-auto":``},null,8,[`colors`]),w(T(Q),{variant:`secondary`,onClick:P[0]||=e=>y.$emit(`extractColorsFromModel`)},{default:E(()=>[d(f(T(t)(`settings.vrm.theme-color-from-model.button-extract.title`)),1)]),_:1}),j(`div`,An,[w(T(L),{x:T(r).x,"onUpdate:x":P[1]||=e=>T(r).x=e,y:T(r).y,"onUpdate:y":P[2]||=e=>T(r).y=e,z:T(r).z,"onUpdate:z":P[3]||=e=>T(r).z=e,label:`Model Position`,"x-config":{min:-T(n).x*2,max:T(n).x*2,step:T(n).x/100,label:`X`,formatValue:e=>e?.toFixed(4)},"y-config":{min:-T(n).y*2,max:T(n).y*2,step:T(n).y/100,label:`Y`,formatValue:e=>e?.toFixed(4)},"z-config":{min:-T(n).z*2,max:T(n).z*2,step:T(n).z/100,label:`Z`,formatValue:e=>e?.toFixed(4)}},null,8,[`x`,`y`,`z`,`x-config`,`y-config`,`z-config`]),w(T(R),{modelValue:T(i),"onUpdate:modelValue":P[4]||=e=>S(i)?i.value=e:null,config:{min:1,max:180,step:1,label:T(t)(`settings.vrm.scale-and-position.fov`)},label:T(t)(`settings.vrm.scale-and-position.fov`)},null,8,[`modelValue`,`config`,`label`]),w(T(R),{modelValue:T(c),"onUpdate:modelValue":P[5]||=e=>S(c)?c.value=e:null,config:{min:T(n).z,max:T(n).z*20,step:T(n).z/100,label:T(t)(`settings.vrm.scale-and-position.camera-distance`),formatValue:e=>e?.toFixed(4)},label:T(t)(`settings.vrm.scale-and-position.camera-distance`)},null,8,[`modelValue`,`config`,`label`]),w(T(R),{modelValue:T(s),"onUpdate:modelValue":P[6]||=e=>S(s)?s.value=e:null,config:{min:-180,max:180,step:1,label:T(t)(`settings.vrm.scale-and-position.rotation-y`)},label:T(t)(`settings.vrm.scale-and-position.rotation-y`)},null,8,[`modelValue`,`config`,`label`]),j(`div`,jn,f(T(t)(`settings.vrm.scale-and-position.eye-tracking-mode.title`))+`: `,1),P[18]||=j(`div`,null,null,-1),(o(!0),A(D,null,a(M.value,e=>(o(),m(T(Q),{key:e.value,class:C([e.class,`w-auto`]),size:`sm`,variant:T(l)===e.value?`primary`:`secondary`,label:e.label,onClick:t=>l.value=e.value},null,8,[`class`,`variant`,`label`,`onClick`]))),128)),w(T(R),{modelValue:T(u).x,"onUpdate:modelValue":P[7]||=e=>T(u).x=e,config:{min:-180,max:180,step:1,label:`RotationXDeg`,formatValue:e=>e?.toFixed(0)},label:`Directional Light Rotation - X`},null,8,[`modelValue`,`config`]),w(T(R),{modelValue:T(u).y,"onUpdate:modelValue":P[8]||=e=>T(u).y=e,config:{min:-180,max:180,step:1,label:`RotationYDeg`,formatValue:e=>e?.toFixed(0)},label:`Directional Light Rotation - Y`},null,8,[`modelValue`,`config`]),w(T(H),{modelValue:T(h),"onUpdate:modelValue":P[9]||=e=>S(h)?h.value=e:null,label:`Directional Light Color`},null,8,[`modelValue`]),w(T(R),{modelValue:T(p),"onUpdate:modelValue":P[10]||=e=>S(p)?p.value=e:null,config:{min:0,max:10,step:.01,label:`Intensity`},label:`Directional Light Intensity`},null,8,[`modelValue`]),w(T(R),{modelValue:T(g),"onUpdate:modelValue":P[11]||=e=>S(g)?g.value=e:null,config:{min:0,max:10,step:.01,label:`Intensity`},label:`Ambient Light Intensity`},null,8,[`modelValue`]),w(T(H),{modelValue:T(_),"onUpdate:modelValue":P[12]||=e=>S(_)?_.value=e:null,label:`Ambient Light Color`},null,8,[`modelValue`])]),j(`div`,null,[w(T(W),{modelValue:T(O),"onUpdate:modelValue":P[17]||=e=>S(O)?O.value=e:null,tabs:N,label:`Environment`},{default:E(()=>[T(O)===`hemisphere`?(o(),A(`div`,Mn,[j(`div`,Nn,[w(T(R),{modelValue:T(v),"onUpdate:modelValue":P[13]||=e=>S(v)?v.value=e:null,config:{min:0,max:10,step:.01,label:`Intensity`},label:`Hemisphere Light Intensity`},null,8,[`modelValue`]),w(T(H),{modelValue:T(b),"onUpdate:modelValue":P[14]||=e=>S(b)?b.value=e:null,label:`Hemisphere Sky Color`},null,8,[`modelValue`]),w(T(H),{modelValue:T(x),"onUpdate:modelValue":P[15]||=e=>S(x)?x.value=e:null,label:`Hemisphere Ground Color`},null,8,[`modelValue`])])])):(o(),A(`div`,Pn,[j(`div`,Fn,[w(T(R),{modelValue:T(k),"onUpdate:modelValue":P[16]||=e=>S(k)?k.value=e:null,config:{min:0,max:1,step:.01,label:`Intensity`},label:T(t)(`settings.vrm.skybox.skybox-intensity`)},null,8,[`modelValue`,`label`])])]))]),_:1},8,[`modelValue`])])]),_:1},8,[`title`]),w(T(B),{title:T(t)(`settings.vrm.change-model.title`),icon:`i-solar:magic-stick-3-bold-duotone`,"inner-class":`text-sm`,class:C([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`])},{default:E(()=>[w(T(G),{label:T(t)(`settings.vrm.scale-and-position.model-info-title`)},{default:E(()=>[j(`div`,null,[j(`div`,In,[j(`div`,Ln,[j(`span`,null,f(T(t)(`settings.vrm.scale-and-position.model-info-x`)),1),j(`span`,null,f(T(n).x.toFixed(4)),1)]),j(`div`,Rn,[j(`span`,null,f(T(t)(`settings.vrm.scale-and-position.model-info-y`)),1),j(`span`,null,f(T(n).y.toFixed(4)),1)]),j(`div`,zn,[j(`span`,null,f(T(t)(`settings.vrm.scale-and-position.model-info-z`)),1),j(`span`,null,f(T(n).z.toFixed(4)),1)])])])]),_:1},8,[`label`]),w(T(G),{theme:`lime`,label:`Tips!`},{default:E(()=>[j(`div`,Bn,f(T(t)(`settings.vrm.scale-and-position.tips`)),1)]),_:1})]),_:1},8,[`title`])],64))}}),Hn={pt:`4 sm:0`,gap:`4 sm:6`,"h-full":``,flex:``,"flex-col":``},Un={flex:``,"items-center":``},Wn={key:0},Gn={class:`flex-1 md:flex-none`,"h-full":``,"w-full":``,"overflow-x-hidden":``,"overflow-y-scroll":``},Kn={class:`grid grid-cols-2 gap-2 lg:max-h-80dvh`},qn=[`onClick`],Jn={absolute:``,"left-3":``,"top-4":``,"z-1":``},Yn=[`onClick`],Xn={class:`min-w-60 lg:min-h-60`,aspect:`12/16`,"px-1":``,"py-2":``},Zn=[`src`],Qn={"h-full":``,"w-full":``,flex:``,"flex-col":``},$n={"w-full":``,"flex-1":``,"p-2":``},er={key:1,class:`flex gap-2`},tr={flex:``,"items-center":``,"gap-1":``,text:`neutral-400 dark:neutral-600`},nr=e({__name:`model-selector`,props:{modelValue:{type:Object,required:!1},modelModifiers:{}},emits:p([`close`],[`update:modelValue`]),setup(e,{emit:t}){let r=t,i=O(e,`modelValue`),s=Ze(),{displayModelsFromIndexedDBLoading:c,displayModels:l}=ke(s);function u(e){s.removeDisplayModel(e.id)}let p=M(i.value?.id);function h(e){e===null||e.length===0||e[0].name.endsWith(`.zip`)&&s.addDisplayModel($.Live2dZip,e[0])}function g(e){i.value=e,r(`close`,void 0)}function v(){i.value=l.value.find(e=>e.id===p.value),r(`close`,void 0)}function y(e){e===null||e.length===0||e[0].name.endsWith(`.vrm`)&&s.addDisplayModel($.VRM,e[0])}let b={[$.Live2dZip]:`Live2D`,[$.Live2dDirectory]:`Live2D`,[$.VRM]:`VRM`,[$.PMXDirectory]:`MMD`,[$.PMXZip]:`MMD`,[$.PMD]:`MMD`},x=Ke({accept:`.zip`,multiple:!1,reset:!0}),S=Ke({accept:`.vrm`,multiple:!1,reset:!0});return x.onChange(h),S.onChange(y),(e,t)=>{let r=_(`auto-animate`);return o(),A(`div`,Hn,[j(`div`,Un,[t[6]||=j(`div`,{"w-full":``,"flex-1":``,"text-xl":``},` Model Selector `,-1),j(`div`,null,[w(T(jt),null,{default:E(()=>[w(T(Ft),{bg:`neutral-400/20 hover:neutral-400/45 active:neutral-400/60 dark:neutral-700/50 hover:dark:neutral-700/65 active:dark:neutral-700/90`,flex:``,"items-center":``,"justify-center":``,"gap-1":``,"rounded-lg":``,"px-2":``,"py-1":``,"backdrop-blur-sm":``,transition:`colors duration-200 ease-in-out`,"aria-label":`Options for Display Models`},{default:E(()=>[...t[3]||=[j(`div`,{"i-solar:add-circle-bold":``},null,-1),j(`div`,null,`Add`,-1)]]),_:1}),w(T(Pt),null,{default:E(()=>[w(T(Mt),{class:`will-change-[opacity,transform] z-10000 max-w-45 rounded-lg p-0.5 shadow-md outline-none data-[side=bottom]:animate-slideUpAndFade data-[side=left]:animate-slideRightAndFade data-[side=right]:animate-slideLeftAndFade data-[side=top]:animate-slideDownAndFade`,bg:`neutral-100/50 dark:neutral-950/50`,transition:`colors duration-200 ease-in-out`,"backdrop-blur-sm":``,align:`end`,side:`bottom`,"side-offset":8},{default:E(()=>[w(T(Nt),{class:`data-[disabled]:text-mauve8 relative flex cursor-pointer select-none items-center rounded-md px-3 py-2 text-base leading-none outline-none data-[disabled]:pointer-events-none data-[highlighted]:bg-primary-100/20 sm:text-sm data-[highlighted]:text-primary-200`,transition:`colors duration-200 ease-in-out`,onClick:t[0]||=e=>T(x).open()},{default:E(()=>[...t[4]||=[d(` Live2D `,-1)]]),_:1}),w(T(Nt),{class:`data-[disabled]:text-mauve8 relative flex cursor-pointer select-none items-center rounded-md px-3 py-2 text-base leading-none outline-none data-[disabled]:pointer-events-none data-[highlighted]:bg-primary-100/20 sm:text-sm data-[highlighted]:text-primary-200`,transition:`colors duration-200 ease-in-out`,onClick:t[1]||=e=>T(S).open()},{default:E(()=>[...t[5]||=[d(` VRM `,-1)]]),_:1})]),_:1})]),_:1})]),_:1})])]),T(c)?(o(),A(`div`,Wn,` Loading display models... `)):n(``,!0),j(`div`,Gn,[j(`div`,Kn,[(o(!0),A(D,null,a(T(l),e=>k((o(),A(`div`,{key:e.id,relative:``,"w-full":``,flex:`~ col md:row`,"gap-2":``,onClick:()=>p.value=e.id},[j(`div`,Jn,[w(T(jt),null,{default:E(()=>[w(T(Ft),{bg:`neutral-900/20 hover:neutral-900/45 active:neutral-900/60 dark:neutral-950/50 hover:dark:neutral-900/65 active:dark:neutral-900/90`,text:`white`,"h-7":``,"w-7":``,flex:``,"items-center":``,"justify-center":``,"rounded-lg":``,"backdrop-blur-sm":``,transition:`colors duration-200 ease-in-out`,"aria-label":`Options for Display Models`},{default:E(()=>[...t[7]||=[j(`div`,{"i-solar:menu-dots-bold":``},null,-1)]]),_:1}),w(T(Pt),null,{default:E(()=>[w(T(Mt),{class:`will-change-[opacity,transform] z-10000 max-w-45 rounded-lg p-0.5 text-white shadow-md outline-none data-[side=bottom]:animate-slideUpAndFade data-[side=left]:animate-slideRightAndFade data-[side=right]:animate-slideLeftAndFade data-[side=top]:animate-slideDownAndFade dark:text-black`,bg:`neutral-700/50 dark:neutral-950/50`,transition:`colors duration-200 ease-in-out`,"backdrop-blur-sm":``,align:`start`,side:`bottom`,"side-offset":4},{default:E(()=>[w(T(Nt),{class:`data-[disabled]:text-mauve8 relative flex cursor-pointer select-none items-center rounded-md px-3 py-2 text-base leading-none outline-none data-[disabled]:pointer-events-none data-[highlighted]:bg-red-100/20 sm:text-sm data-[highlighted]:text-red-200`,transition:`colors duration-200 ease-in-out`},{default:E(()=>[j(`button`,{flex:``,"items-center":``,"gap-1":``,"outline-none":``,onClick:t=>u(e)},[...t[8]||=[j(`div`,{"i-solar:trash-bin-minimalistic-bold-duotone":``},null,-1),j(`div`,null,`Remove`,-1)]],8,Yn)]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024)]),j(`div`,Xn,[e.previewImage?(o(),A(`img`,{key:0,src:e.previewImage,"h-full":``,"w-full":``,"rounded-lg":``,"object-cover":``,class:C([p.value&&p.value===e.id?`ring-3 ring-primary-400`:`ring-0 ring-transparent`]),transition:`all duration-200 ease-in-out`},null,10,Zn)):(o(),A(`div`,{key:1,bg:`neutral-100 dark:neutral-900`,relative:``,"h-full":``,"w-full":``,flex:``,"flex-col":``,"items-center":``,"justify-center":``,"gap-2":``,"overflow-hidden":``,"rounded-lg":``,class:C([p.value&&p.value===e.id?`ring-3 ring-primary-400`:`ring-0 ring-transparent`]),transition:`all duration-200 ease-in-out`},[...t[9]||=[j(`div`,{"i-solar:question-square-bold-duotone":``,"text-4xl":``,"opacity-75":``},null,-1),j(`div`,{"translate-y":`100%`,absolute:``,"top-0":``,flex:``,"flex-col":``,"translate-x--7":``,"rotate-45":``,"scale-250":``,"gap-0":``,"opacity-5":``},[j(`div`,{text:`sm sm:sm`,"translate-x-7":``,"translate-y--2":``,"text-nowrap":``},` unavailable Preview unavailable Preview `),j(`div`,{text:`sm sm:sm`,"translate-x-0":``,"translate-y--0":``,"text-nowrap":``},` Preview unavailable Preview unavailable `),j(`div`,{text:`sm sm:sm`,"translate-x--7":``,"translate-y-2":``,"text-nowrap":``},` unavailable Preview unavailable Preview `)],-1)]],2))]),j(`div`,Qn,[j(`div`,$n,[w(T(Rt),{"default-value":e.name,placeholder:`Model Name...`,class:`flex gap-2`,"auto-resize":``},{default:E(({isEditing:e})=>[w(T(zt),{class:`w-[calc(100%-8px-1rem)] dark:text-white`},{default:E(()=>[w(T(Ht),{class:`line-clamp-1 w-[calc(100%-8px)] overflow-hidden text-ellipsis`}),w(T(Vt),{class:`w-[calc(100%-8px)]! placeholder:text-neutral-700 dark:placeholder:text-neutral-600`})]),_:1}),e?(o(),A(`div`,er,[w(T(Ut),null,{default:E(()=>[...t[11]||=[j(`div`,{"i-solar:check-read-line-duotone":``,"opacity-50":``},null,-1)]]),_:1})])):(o(),m(T(Bt),{key:0},{default:E(()=>[...t[10]||=[j(`div`,{"i-solar:pen-2-line-duotone":``,"opacity-50":``},null,-1)]]),_:1}))]),_:1},8,[`default-value`]),j(`div`,tr,[t[12]||=j(`div`,{"i-solar:tag-horizontal-bold":``},null,-1),j(`div`,null,f(b[e.format]),1)])]),w(T(Q),{class:`hidden md:block`,variant:`secondary`,onClick:t=>g(e)},{default:E(()=>[...t[13]||=[d(` Pick `,-1)]]),_:1},8,[`onClick`])])],8,qn)),[[r]])),128))])]),w(T(Q),{class:`block md:hidden`,onClick:t[2]||=e=>v()},{default:E(()=>[...t[14]||=[d(` Confirm `,-1)]]),_:1})])}}}),rr=e({__name:`model-selector-dialog`,props:{show:{type:Boolean,default:!1,required:!1},showModifiers:{},modelValue:{type:Object,required:!1},modelModifiers:{}},emits:[`update:show`,`update:modelValue`],setup(e){let t=O(e,`show`),n=O(e,`modelValue`),r=Je(`(min-width: 768px)`),i=Ge();return Ye(document.documentElement,()=>i.update()),h(()=>i.update()),(e,a)=>T(r)?(o(),m(T(Ie),{key:0,open:t.value,"onUpdate:open":a[2]||=e=>t.value=e},{default:E(()=>[w(T(F),{"as-child":``},{default:E(()=>[g(e.$slots,`default`)]),_:3}),w(T(We),null,{default:E(()=>[w(T(Be),{class:`fixed inset-0 z-[9999] bg-black/50 backdrop-blur-sm data-[state=closed]:animate-fadeOut data-[state=open]:animate-fadeIn`}),w(T(Pe),{class:`fixed left-1/2 top-1/2 z-[9999] max-h-full max-w-5xl w-[92dvw] transform overflow-y-scroll rounded-2xl bg-white p-6 shadow-xl outline-none backdrop-blur-md scrollbar-none -translate-x-1/2 -translate-y-1/2 data-[state=closed]:animate-contentHide data-[state=open]:animate-contentShow dark:bg-neutral-900`},{default:E(()=>[w(T(Ee),null,{default:E(()=>[w(T(He),null,{default:E(()=>[...a[6]||=[d(`Models`,-1)]]),_:1})]),_:1}),w(nr,{modelValue:n.value,"onUpdate:modelValue":a[0]||=e=>n.value=e,onClose:a[1]||=e=>t.value=!1},null,8,[`modelValue`])]),_:1})]),_:1})]),_:3},8,[`open`])):(o(),m(T(P),{key:1,open:t.value,"should-scale-background":``,"onUpdate:open":a[5]||=e=>t.value=e},{default:E(()=>[w(T(F),{"as-child":``},{default:E(()=>[g(e.$slots,`default`)]),_:3}),w(T(We),null,{default:E(()=>[w(T(V),{class:`fixed inset-0`}),w(T(U),{class:`fixed bottom-0 left-0 right-0 z-1000 mt-20 h-full max-h-[96%] flex flex-col rounded-t-2xl bg-neutral-50 px-4 pt-4 outline-none backdrop-blur-md dark:bg-neutral-900/95`,style:u({paddingBottom:`${Math.max(Number.parseFloat(T(i).bottom.value.replace(`px`,``)),24)}px`})},{default:E(()=>[w(T(z)),w(nr,{modelValue:n.value,"onUpdate:modelValue":a[3]||=e=>n.value=e,onClose:a[4]||=e=>t.value=!1},null,8,[`modelValue`])]),_:1},8,[`style`])]),_:1})]),_:3},8,[`open`]))}}),ir=e({__name:`index`,props:{palette:{},settingsClass:{},live2dSceneClass:{},vrmSceneClass:{}},emits:[`extractColorsFromModel`],setup(e){let t=e,r=M(),i=qe(),a=Qe(),{live2dDisableFocus:s,stageModelSelectedUrl:c,stageModelSelected:l,stageModelRenderer:u}=ke(a);return v(r,async()=>{if(l.value=r.value?.id,await a.updateStageModel(),r.value)switch(r.value.format){case $.Live2dZip:it().shouldUpdateView();break;case $.VRM:tt().shouldUpdateView();break}},{deep:!0}),(a,f)=>(o(),A(D,null,[j(`div`,{flex:`~ col gap-2`,"z-10":``,"overflow-y-scroll":``,"p-2":``,class:C([...t.settingsClass?typeof t.settingsClass==`string`?[t.settingsClass]:t.settingsClass:[]])},[w(G,{label:`We support both 2D and 3D models`},{default:E(()=>[...f[3]||=[j(`p`,null,[d(` Click `),j(`strong`,null,`Select Model`),d(` to import different formats of models into catalog, currently, `),j(`code`,null,`.zip`),d(` (Live2D) and `),j(`code`,null,`.vrm`),d(` (VRM) are supported. `)],-1),j(`p`,null,` Neuro-sama uses 2D model driven by Live2D Inc. developed framework. While Grok Ani (first female character announced in Grok Companion) uses 3D model that is driven by VRM / MMD open formats. `,-1)]]),_:1}),w(T(rr),{modelValue:r.value,"onUpdate:modelValue":f[0]||=e=>r.value=e},{default:E(()=>[w(T(Q),{variant:`secondary`},{default:E(()=>[...f[4]||=[d(` Select Model `,-1)]]),_:1})]),_:1},8,[`modelValue`]),T(u)===`live2d`?(o(),m(kn,{key:0,palette:e.palette,onExtractColorsFromModel:f[1]||=e=>a.$emit(`extractColorsFromModel`)},null,8,[`palette`])):n(``,!0),T(u)===`vrm`?(o(),m(Vn,{key:1,palette:e.palette,onExtractColorsFromModel:f[2]||=e=>a.$emit(`extractColorsFromModel`)},null,8,[`palette`])):n(``,!0)],2),T(u)===`live2d`?(o(),A(`div`,{key:0,class:C([...t.live2dSceneClass?typeof t.live2dSceneClass==`string`?[t.live2dSceneClass]:t.live2dSceneClass:[]])},[w(nt,{"focus-at":{x:T(i).x.value,y:T(i).y.value},"model-src":T(c),"model-id":T(l),"disable-focus-at":T(s)},null,8,[`focus-at`,`model-src`,`model-id`,`disable-focus-at`])],2)):n(``,!0),T(u)===`vrm`?(o(),A(`div`,{key:1,class:C([...t.vrmSceneClass?typeof t.vrmSceneClass==`string`?[t.vrmSceneClass]:t.vrmSceneClass:[]])},[w(T(rt),{"model-src":T(c)},null,8,[`model-src`])],2)):n(``,!0)],64))}}),ar={flex:``,class:`relative h-full flex-col-reverse md:flex-row`},or={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":``},sr=e({__name:`index`,setup(e){let t=M(),n=M([]);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=await new $e(r).getPalette();n.value=Object.values(e).map(e=>e?.hex).filter(e=>typeof e==`string`)}finally{URL.revokeObjectURL(r)}}return(e,t)=>{let i=_(`motion`);return o(),A(D,null,[j(`div`,ar,[w(T(ir),{"settings-class":`w-100% md:w-40% lg:w-40% xl:w-25% 2xl:w-30% h-fit sm:max-h-80dvh overflow-y-scroll relative`,"live-2d-scene-class":`absolute max-h-[calc(100dvh-100px-56px)] w-full h-full`,"vrm-scene-class":`absolute max-h-[calc(100dvh-100px-56px)] w-full h-full`,palette:n.value,onExtractColorsFromModel:r},null,8,[`palette`])]),k((o(),A(`div`,or,[...t[0]||=[j(`div`,{text:`60`,"i-solar:people-nearby-bold-duotone":``},null,-1)]])),[[i]])],64)}}});typeof et==`function`&&et(sr);var cr=sr;export{cr as default}; \ No newline at end of file +import{A as e,B as t,C as n,Dt as r,G as i,J as a,K as o,L as s,M as c,Mt as l,Nt as u,O as d,Pt as f,R as p,S as m,W as h,Y as g,Z as _,at as v,b as y,d as b,f as x,gt as S,jt as C,k as w,kt as T,lt as E,m as D,nt as O,ut as k,w as A,x as j,xt as M,z as N}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./tres-Bk8ucvrj.js";import{a as P,b as F,c as I,d as L,f as R,i as z,m as B,n as V,p as H,r as U,s as W,t as ee,u as G,x as K}from"./widgets-C0YByt49.js";import{$ as q,A as J,B as te,C as ne,D as re,E as ie,F as ae,G as oe,H as se,I as ce,J as le,M as ue,N as de,O as fe,P as pe,R as Y,S as me,T as he,U as ge,V as _e,b as ve,et as X,g as ye,h as be,j as xe,k as Se,l as Z,m as Ce,r as Q,v as we,w as Te,x as Ee,y as De,z as Oe}from"./src-DYQXbDgu.js";import{a as ke}from"./resettable-CbXzRviW.js";import{a as Ae,c as je,d as Me,f as Ne,i as Pe,l as Fe,m as Ie,n as Le,o as Re,p as ze,r as Be,s as Ve,t as He,u as Ue}from"./DialogTitle-ytlEE0A-.js";import{u as We}from"./environment-CyZLTg97.js";import{b as Ge,d as Ke,h as qe,m as Je,y as Ye}from"./dist-Che88T83.js";import"./src-C83SCWbW.js";import{n as Xe}from"./vue-i18n.runtime-Dah5zGm4.js";import"./browser-DY5K31Vk.js";import{a as Ze,i as $,n as Qe}from"./settings-73vyHOZs.js";import{t as $e}from"./browser-2lyKKTPE.js";import{t as et}from"./route-block-CpjdOEnv.js";import{n as tt,r as nt,t as rt}from"./src-mAITpvbv.js";import{n as it,t as at}from"./live2d-DukystQI.js";var ot=[`INPUT`,`TEXTAREA`];function st(e,t,n,r={}){if(!t||r.enableIgnoredElement&&ot.includes(t.nodeName))return null;let{arrowKeyOptions:i=`both`,attributeName:a=`[data-reka-collection-item]`,itemsArray:o=[],loop:s=!0,dir:c=`ltr`,preventScroll:l=!0,focus:u=!1}=r,[d,f,p,m,h,g]=[e.key===`ArrowRight`,e.key===`ArrowLeft`,e.key===`ArrowUp`,e.key===`ArrowDown`,e.key===`Home`,e.key===`End`],_=p||m,v=d||f;if(!h&&!g&&(!_&&!v||i===`vertical`&&v||i===`horizontal`&&_))return null;let y=n?Array.from(n.querySelectorAll(a)):o;if(!y.length)return null;l&&e.preventDefault();let b=null;return v||_?b=ct(y,t,{goForward:_?m:c===`ltr`?d:f,loop:s}):h?b=y.at(0)||null:g&&(b=y.at(-1)||null),u&&b?.focus(),b}function ct(e,t,n,r=e.length){if(--r===0)return null;let i=e.indexOf(t),a=n.goForward?i+1:i-1;if(!n.loop&&(a<0||a>=e.length))return null;let o=e[(a+e.length)%e.length];return o?o.hasAttribute(`disabled`)&&o.getAttribute(`disabled`)!==`false`?ct(e,o,n,r):o:null}var[lt,ut]=X(`RovingFocusGroup`),dt=e({__name:`RovingFocusGroup`,props:{orientation:{type:String,required:!1,default:void 0},dir:{type:String,required:!1},loop:{type:Boolean,required:!1,default:!1},currentTabStopId:{type:[String,null],required:!1},defaultCurrentTabStopId:{type:String,required:!1},preventScrollOnEntryFocus:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`entryFocus`,`update:currentTabStopId`],setup(e,{expose:t,emit:n}){let i=e,a=n,{loop:s,orientation:c,dir:l}=r(i),u=_e(l),d=oe(i,`currentTabStopId`,a,{defaultValue:i.defaultCurrentTabStopId,passive:i.currentTabStopId===void 0}),f=M(!1),p=M(!1),h=M(0),{getItems:_,CollectionSlot:v}=he({isProvider:!0});function y(e){let t=!p.value;if(e.currentTarget&&e.target===e.currentTarget&&t&&!f.value){let t=new CustomEvent(me,ne);if(e.currentTarget.dispatchEvent(t),a(`entryFocus`,t),!t.defaultPrevented){let e=_().map(e=>e.ref).filter(e=>e.dataset.disabled!==``);Te([e.find(e=>e.getAttribute(`data-active`)===``),e.find(e=>e.getAttribute(`data-highlighted`)===``),e.find(e=>e.id===d.value),...e].filter(Boolean),i.preventScrollOnEntryFocus)}}p.value=!1}function b(){setTimeout(()=>{p.value=!1},1)}return t({getItems:_}),ut({loop:s,dir:u,orientation:c,currentTabStopId:d,onItemFocus:e=>{d.value=e},onItemShiftTab:()=>{f.value=!0},onFocusableItemAdd:()=>{h.value++},onFocusableItemRemove:()=>{h.value--}}),(e,t)=>(o(),m(T(v),null,{default:E(()=>[w(T(J),{tabindex:f.value||h.value===0?-1:0,"data-orientation":T(c),as:e.as,"as-child":e.asChild,dir:T(u),style:{outline:`none`},onMousedown:t[0]||=e=>p.value=!0,onMouseup:b,onFocus:y,onBlur:t[1]||=e=>f.value=!1},{default:E(()=>[g(e.$slots,`default`)]),_:3},8,[`tabindex`,`data-orientation`,`as`,`as-child`,`dir`])]),_:3}))}}),ft=e({__name:`MenuAnchor`,props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e;return(e,n)=>(o(),m(T(we),l(c(t)),{default:E(()=>[g(e.$slots,`default`)]),_:3},16))}});function pt(){let e=M(!1);return h(()=>{ge(`keydown`,()=>{e.value=!0},{capture:!0,passive:!0}),ge([`pointerdown`,`pointermove`],()=>{e.value=!1},{capture:!0,passive:!0})}),e}var mt=le(pt),[ht,gt]=X([`MenuRoot`,`MenuSub`],`MenuContext`),[_t,vt]=X(`MenuRoot`),yt=e({__name:`MenuRoot`,props:{open:{type:Boolean,required:!1,default:!1},dir:{type:String,required:!1},modal:{type:Boolean,required:!1,default:!0}},emits:[`update:open`],setup(e,{emit:t}){let n=e,i=t,{modal:a,dir:s}=r(n),c=_e(s),l=oe(n,`open`,i),u=M(),d=mt();return gt({open:l,onOpenChange:e=>{l.value=e},content:u,onContentChange:e=>{u.value=e}}),vt({onClose:()=>{l.value=!1},isUsingKeyboardRef:d,dir:c,modal:a}),(e,t)=>(o(),m(T(De),null,{default:E(()=>[g(e.$slots,`default`)]),_:3}))}}),[bt,xt]=X(`MenuContent`),St=e({__name:`MenuContentImpl`,props:s({loop:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},disableOutsideScroll:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},{...be}),emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`entryFocus`,`openAutoFocus`,`closeAutoFocus`,`dismiss`],setup(e,{emit:t}){let n=e,a=t,s=ht(),c=_t(),{trapFocus:l,disableOutsidePointerEvents:u,loop:d}=r(n);K(),se(u.value);let f=M(``),p=M(0),h=M(0),_=M(null),y=M(`right`),b=M(0),x=M(null),S=M(),{forwardRef:C,currentElement:D}=Y(),{handleTypeaheadSearch:O}=ue();v(D,e=>{s.onContentChange(e)}),i(()=>{window.clearTimeout(p.value)});function k(e){return y.value===_.value?.side&&Ne(e,_.value?.area)}async function A(e){a(`openAutoFocus`,e),!e.defaultPrevented&&(e.preventDefault(),D.value?.focus({preventScroll:!0}))}function j(e){if(e.defaultPrevented)return;let t=e.target.closest(`[data-reka-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1,i=st(e,q(),D.value,{loop:d.value,arrowKeyOptions:`vertical`,dir:c?.dir.value,focus:!0,attributeName:`[data-reka-collection-item]:not([data-disabled])`});if(i)return i?.focus();if(e.code===`Space`)return;let a=S.value?.getItems()??[];if(t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&O(e.key,a)),e.target!==D.value||!Ae.includes(e.key))return;e.preventDefault();let o=[...a.map(e=>e.ref)];Ve.includes(e.key)&&o.reverse(),Fe(o)}function N(e){e?.currentTarget?.contains?.(e.target)||(window.clearTimeout(p.value),f.value=``)}function P(e){if(!Me(e))return;let t=e.target,n=b.value!==e.clientX;(e?.currentTarget)?.contains(t)&&n&&(y.value=e.clientX>b.value?`right`:`left`,b.value=e.clientX)}return xt({onItemEnter:e=>!!k(e),onItemLeave:e=>{k(e)||(D.value?.focus(),x.value=null)},onTriggerLeave:e=>!!k(e),searchRef:f,pointerGraceTimerRef:h,onPointerGraceIntentChange:e=>{_.value=e}}),(e,t)=>(o(),m(T(ze),{"as-child":``,trapped:T(l),onMountAutoFocus:A,onUnmountAutoFocus:t[7]||=e=>a(`closeAutoFocus`,e)},{default:E(()=>[w(T(ie),{"as-child":``,"disable-outside-pointer-events":T(u),onEscapeKeyDown:t[2]||=e=>a(`escapeKeyDown`,e),onPointerDownOutside:t[3]||=e=>a(`pointerDownOutside`,e),onFocusOutside:t[4]||=e=>a(`focusOutside`,e),onInteractOutside:t[5]||=e=>a(`interactOutside`,e),onDismiss:t[6]||=e=>a(`dismiss`)},{default:E(()=>[w(T(dt),{ref_key:`rovingFocusGroupRef`,ref:S,"current-tab-stop-id":x.value,"onUpdate:currentTabStopId":t[0]||=e=>x.value=e,"as-child":``,orientation:`vertical`,dir:T(c).dir.value,loop:T(d),onEntryFocus:t[1]||=e=>{a(`entryFocus`,e),T(c).isUsingKeyboardRef.value||e.preventDefault()}},{default:E(()=>[w(T(ye),{ref:T(C),role:`menu`,as:e.as,"as-child":e.asChild,"aria-orientation":`vertical`,"data-reka-menu-content":``,"data-state":T(Ue)(T(s).open.value),dir:T(c).dir.value,side:e.side,"side-offset":e.sideOffset,align:e.align,"align-offset":e.alignOffset,"avoid-collisions":e.avoidCollisions,"collision-boundary":e.collisionBoundary,"collision-padding":e.collisionPadding,"arrow-padding":e.arrowPadding,"prioritize-position":e.prioritizePosition,"position-strategy":e.positionStrategy,"update-position-strategy":e.updatePositionStrategy,sticky:e.sticky,"hide-when-detached":e.hideWhenDetached,reference:e.reference,onKeydown:j,onBlur:N,onPointermove:P},{default:E(()=>[g(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`data-state`,`dir`,`side`,`side-offset`,`align`,`align-offset`,`avoid-collisions`,`collision-boundary`,`collision-padding`,`arrow-padding`,`prioritize-position`,`position-strategy`,`update-position-strategy`,`sticky`,`hide-when-detached`,`reference`])]),_:3},8,[`current-tab-stop-id`,`dir`,`loop`])]),_:3},8,[`disable-outside-pointer-events`])]),_:3},8,[`trapped`]))}}),Ct=e({inheritAttrs:!1,__name:`MenuItemImpl`,props:{disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let n=e,r=bt(),{forwardRef:i}=Y(),{CollectionItem:a}=he(),s=M(!1);async function c(e){e.defaultPrevented||Me(e)&&(n.disabled?r.onItemLeave(e):r.onItemEnter(e)||e.currentTarget?.focus({preventScroll:!0}))}async function l(e){await t(),!e.defaultPrevented&&Me(e)&&r.onItemLeave(e)}return(e,n)=>(o(),m(T(a),{value:{textValue:e.textValue}},{default:E(()=>[w(T(J),N({ref:T(i),role:`menuitem`,tabindex:`-1`},e.$attrs,{as:e.as,"as-child":e.asChild,"aria-disabled":e.disabled||void 0,"data-disabled":e.disabled?``:void 0,"data-highlighted":s.value?``:void 0,onPointermove:c,onPointerleave:l,onFocus:n[0]||=async n=>{await t(),!(n.defaultPrevented||e.disabled)&&(s.value=!0)},onBlur:n[1]||=async e=>{await t(),!e.defaultPrevented&&(s.value=!1)}}),{default:E(()=>[g(e.$slots,`default`)]),_:3},16,[`as`,`as-child`,`aria-disabled`,`data-disabled`,`data-highlighted`])]),_:3},8,[`value`]))}}),wt=e({__name:`MenuItem`,props:{disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`select`],setup(e,{emit:n}){let r=e,i=n,{forwardRef:a,currentElement:s}=Y(),c=_t(),l=bt(),u=M(!1);async function d(){let e=s.value;if(!r.disabled&&e){let e=new CustomEvent(Re,{bubbles:!0,cancelable:!0});i(`select`,e),await t(),e.defaultPrevented?u.value=!1:c.onClose()}}return(e,n)=>(o(),m(Ct,N(r,{ref:T(a),onClick:d,onPointerdown:n[0]||=()=>{u.value=!0},onPointerup:n[1]||=async e=>{await t(),!e.defaultPrevented&&(u.value||e.currentTarget?.click())},onKeydown:n[2]||=async t=>{let n=T(l).searchRef.value!==``;e.disabled||n&&t.key===` `||T(je).includes(t.key)&&(t.currentTarget.click(),t.preventDefault())}}),{default:E(()=>[g(e.$slots,`default`)]),_:3},16))}}),Tt=e({__name:`MenuRootContentModal`,props:{loop:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`entryFocus`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=ce(n,r),a=ht(),{forwardRef:s,currentElement:c}=Y();return ae(c),(e,t)=>(o(),m(St,N(T(i),{ref:T(s),"trap-focus":T(a).open.value,"disable-outside-pointer-events":T(a).open.value,"disable-outside-scroll":!0,onDismiss:t[0]||=e=>T(a).onOpenChange(!1),onFocusOutside:t[1]||=x(e=>r(`focusOutside`,e),[`prevent`])}),{default:E(()=>[g(e.$slots,`default`)]),_:3},16,[`trap-focus`,`disable-outside-pointer-events`]))}}),Et=e({__name:`MenuRootContentNonModal`,props:{loop:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`entryFocus`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=ce(e,t),r=ht();return(e,t)=>(o(),m(St,N(T(n),{"trap-focus":!1,"disable-outside-pointer-events":!1,"disable-outside-scroll":!1,onDismiss:t[0]||=e=>T(r).onOpenChange(!1)}),{default:E(()=>[g(e.$slots,`default`)]),_:3},16))}}),Dt=e({__name:`MenuContent`,props:{forceMount:{type:Boolean,required:!1},loop:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`entryFocus`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=ce(e,t),r=ht(),i=_t();return(e,t)=>(o(),m(T(xe),{present:e.forceMount||T(r).open.value},{default:E(()=>[T(i).modal.value?(o(),m(Tt,l(N({key:0},{...e.$attrs,...T(n)})),{default:E(()=>[g(e.$slots,`default`)]),_:3},16)):(o(),m(Et,l(N({key:1},{...e.$attrs,...T(n)})),{default:E(()=>[g(e.$slots,`default`)]),_:3},16))]),_:3},8,[`present`]))}}),Ot=e({__name:`MenuPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(o(),m(T(Le),l(c(t)),{default:E(()=>[g(e.$slots,`default`)]),_:3},16))}}),[kt,At]=X(`DropdownMenuRoot`),jt=e({__name:`DropdownMenuRoot`,props:{defaultOpen:{type:Boolean,required:!1},open:{type:Boolean,required:!1,default:void 0},dir:{type:String,required:!1},modal:{type:Boolean,required:!1,default:!0}},emits:[`update:open`],setup(e,{emit:t}){let n=e,i=t;Y();let a=oe(n,`open`,i,{defaultValue:n.defaultOpen,passive:n.open===void 0}),s=M(),{modal:c,dir:l}=r(n),u=_e(l);return At({open:a,onOpenChange:e=>{a.value=e},onOpenToggle:()=>{a.value=!a.value},triggerId:``,triggerElement:s,contentId:``,modal:c,dir:u}),(e,t)=>(o(),m(T(yt),{open:T(a),"onUpdate:open":t[0]||=e=>S(a)?a.value=e:null,dir:T(u),modal:T(c)},{default:E(()=>[g(e.$slots,`default`,{open:T(a)})]),_:3},8,[`open`,`dir`,`modal`]))}}),Mt=e({__name:`DropdownMenuContent`,props:{forceMount:{type:Boolean,required:!1},loop:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`closeAutoFocus`],setup(e,{emit:t}){let n=ce(e,t);Y();let r=kt(),i=M(!1);function a(e){e.defaultPrevented||(i.value||setTimeout(()=>{r.triggerElement.value?.focus()},0),i.value=!1,e.preventDefault())}return r.contentId||=pe(void 0,`reka-dropdown-menu-content`),(e,t)=>(o(),m(T(Dt),N(T(n),{id:T(r).contentId,"aria-labelledby":T(r)?.triggerId,style:{"--reka-dropdown-menu-content-transform-origin":`var(--reka-popper-transform-origin)`,"--reka-dropdown-menu-content-available-width":`var(--reka-popper-available-width)`,"--reka-dropdown-menu-content-available-height":`var(--reka-popper-available-height)`,"--reka-dropdown-menu-trigger-width":`var(--reka-popper-anchor-width)`,"--reka-dropdown-menu-trigger-height":`var(--reka-popper-anchor-height)`},onCloseAutoFocus:a,onInteractOutside:t[0]||=e=>{if(e.defaultPrevented)return;let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,a=t.button===2||n;(!T(r).modal.value||a)&&(i.value=!0),T(r).triggerElement.value?.contains(e.target)&&e.preventDefault()}}),{default:E(()=>[g(e.$slots,`default`)]),_:3},16,[`id`,`aria-labelledby`]))}}),Nt=e({__name:`DropdownMenuItem`,props:{disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`select`],setup(e,{emit:t}){let n=e,r=te(t);return Y(),(e,t)=>(o(),m(T(wt),l(c({...n,...T(r)})),{default:E(()=>[g(e.$slots,`default`)]),_:3},16))}}),Pt=e({__name:`DropdownMenuPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(o(),m(T(Ot),l(c(t)),{default:E(()=>[g(e.$slots,`default`)]),_:3},16))}}),Ft=e({__name:`DropdownMenuTrigger`,props:{disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let n=e,r=kt(),{forwardRef:i,currentElement:a}=Y();return h(()=>{r.triggerElement=a}),r.triggerId||=pe(void 0,`reka-dropdown-menu-trigger`),(e,a)=>(o(),m(T(ft),{"as-child":``},{default:E(()=>[w(T(J),{id:T(r).triggerId,ref:T(i),type:e.as===`button`?`button`:void 0,"as-child":n.asChild,as:e.as,"aria-haspopup":`menu`,"aria-expanded":T(r).open.value,"aria-controls":T(r).open.value?T(r).contentId:void 0,"data-disabled":e.disabled?``:void 0,disabled:e.disabled,"data-state":T(r).open.value?`open`:`closed`,onClick:a[0]||=async n=>{!e.disabled&&n.button===0&&n.ctrlKey===!1&&(T(r)?.onOpenToggle(),await t(),T(r).open.value&&n.preventDefault())},onKeydown:a[1]||=b(t=>{e.disabled||([`Enter`,` `].includes(t.key)&&T(r).onOpenToggle(),t.key===`ArrowDown`&&T(r).onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(t.key)&&t.preventDefault())},[`enter`,`space`,`arrow-down`])},{default:E(()=>[g(e.$slots,`default`)]),_:3},8,[`id`,`type`,`as-child`,`as`,`aria-expanded`,`aria-controls`,`data-disabled`,`disabled`,`data-state`])]),_:3}))}}),[It,Lt]=X(`EditableRoot`),Rt=e({inheritAttrs:!1,__name:`EditableRoot`,props:{defaultValue:{type:String,required:!1},modelValue:{type:[String,null],required:!1},placeholder:{type:[String,Object],required:!1,default:`Enter text...`},dir:{type:String,required:!1},disabled:{type:Boolean,required:!1,default:!1},readonly:{type:Boolean,required:!1},activationMode:{type:String,required:!1,default:`focus`},selectOnFocus:{type:Boolean,required:!1,default:!1},submitMode:{type:String,required:!1,default:`blur`},startWithEditMode:{type:Boolean,required:!1},maxLength:{type:Number,required:!1},autoResize:{type:Boolean,required:!1,default:!1},id:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`div`},name:{type:String,required:!1},required:{type:Boolean,required:!1,default:!1}},emits:[`update:modelValue`,`submit`,`update:state`],setup(e,{expose:t,emit:i}){let a=e,s=i,{id:c,name:l,defaultValue:u,startWithEditMode:d,placeholder:f,maxLength:p,disabled:h,dir:_,submitMode:b,activationMode:x,selectOnFocus:S,readonly:C,autoResize:w,required:D}=r(a),O=M(),k=_e(_),A=M(d.value??!1),j=oe(a,`modelValue`,s,{defaultValue:u.value??``,passive:a.modelValue===void 0}),{primitiveElement:P,currentElement:F}=Se(),I=Oe(F),L=y(()=>typeof f.value==`string`?{edit:f.value,preview:f.value}:f.value),R=M(j.value);v(()=>j.value,()=>{R.value=j.value},{immediate:!0,deep:!0});function z(){A.value=!1,s(`update:state`,`cancel`)}function B(){A.value=!0,R.value=j.value,s(`update:state`,`edit`)}function V(){j.value=R.value,A.value=!1,s(`update:state`,`submit`),s(`submit`,R.value)}function H(){A.value&&(b.value===`blur`||b.value===`both`?V():z())}let U=fe(()=>H(),F,A),W=re(()=>H(),F,A),ee=y(()=>j.value===``);return t({submit:V,cancel:z,edit:B}),Lt({id:c,name:l,disabled:h,isEditing:A,maxLength:p,modelValue:j,inputValue:R,placeholder:L,edit:B,cancel:z,submit:V,activationMode:x,submitMode:b,selectOnFocus:S,inputRef:O,startWithEditMode:d,isEmpty:ee,readonly:C,autoResize:w}),(e,t)=>(o(),m(T(J),N(e.$attrs,{ref_key:`primitiveElement`,ref:P,as:e.as,"as-child":e.asChild,dir:T(k),"data-dismissable-layer":``,onFocusCapture:T(W).onFocusCapture,onBlurCapture:T(W).onBlurCapture,onPointerdownCapture:T(U).onPointerDownCapture}),{default:E(()=>[g(e.$slots,`default`,{modelValue:T(j),isEditing:A.value,isEmpty:ee.value,submit:V,cancel:z,edit:B}),T(I)&&T(l)?(o(),m(T(ve),{key:0,type:`text`,value:T(j),name:T(l),disabled:T(h),required:T(D)},null,8,[`value`,`name`,`disabled`,`required`])):n(`v-if`,!0)]),_:3},16,[`as`,`as-child`,`dir`,`onFocusCapture`,`onBlurCapture`,`onPointerdownCapture`]))}}),zt=e({__name:`EditableArea`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`div`}},setup(e){let t=e,n=It();return(e,r)=>(o(),m(T(J),N(t,{"data-placeholder-shown":T(n).isEditing.value?void 0:``,"data-focus":T(n).isEditing.value?``:void 0,"data-focused":T(n).isEditing.value?``:void 0,"data-empty":T(n).isEmpty.value?``:void 0,"data-readonly":T(n).readonly.value?``:void 0,"data-disabled":T(n).disabled.value?``:void 0,style:T(n).autoResize.value?{display:`inline-grid`}:void 0}),{default:E(()=>[g(e.$slots,`default`)]),_:3},16,[`data-placeholder-shown`,`data-focus`,`data-focused`,`data-empty`,`data-readonly`,`data-disabled`,`style`]))}}),Bt=e({__name:`EditableEditTrigger`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=It();return(e,r)=>(o(),m(T(J),N(t,{"aria-label":`edit`,"aria-disabled":T(n).disabled.value?``:void 0,"data-disabled":T(n).disabled.value?``:void 0,disabled:T(n).disabled.value,type:e.as===`button`?`button`:void 0,hidden:T(n).isEditing.value?``:void 0,onClick:T(n).edit}),{default:E(()=>[g(e.$slots,`default`,{},()=>[r[0]||=d(`Edit`)])]),_:3},16,[`aria-disabled`,`data-disabled`,`disabled`,`type`,`hidden`,`onClick`]))}}),Vt=e({__name:`EditableInput`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`input`}},setup(e){let n=e,r=de(),i=It(),a=y(()=>i.disabled.value),s=y(()=>i.placeholder.value?.edit),{primitiveElement:c,currentElement:l}=Se();h(()=>{i.inputRef.value=l.value,i.startWithEditMode.value&&(i.inputRef.value?.focus({preventScroll:!0}),i.selectOnFocus.value&&i.inputRef.value?.select())}),v(i.isEditing,e=>{e&&t(()=>{i.inputRef.value?.focus({preventScroll:!0}),i.selectOnFocus.value&&i.inputRef.value?.select()})});function u(e){(i.submitMode.value===`enter`||i.submitMode.value===`both`)&&e.key===r.ENTER&&!e.shiftKey&&!e.metaKey&&i.submit()}return(e,t)=>(o(),m(T(J),N({ref_key:`primitiveElement`,ref:c},n,{value:T(i).inputValue.value,placeholder:s.value,disabled:a.value,maxlength:T(i).maxLength.value,"data-disabled":a.value?``:void 0,"data-readonly":T(i).readonly.value?``:void 0,readonly:T(i).readonly.value,"aria-label":`editable input`,hidden:T(i).autoResize.value?void 0:!T(i).isEditing.value,style:T(i).autoResize.value?{all:`unset`,gridArea:`1 / 1 / auto / auto`,visibility:T(i).isEditing.value?void 0:`hidden`}:void 0,onInput:t[0]||=e=>T(i).inputValue.value=e.target.value,onKeydown:[b(u,[`enter`,`space`]),b(T(i).cancel,[`esc`])]}),{default:E(()=>[g(e.$slots,`default`)]),_:3},16,[`value`,`placeholder`,`disabled`,`maxlength`,`data-disabled`,`data-readonly`,`readonly`,`hidden`,`style`,`onKeydown`]))}}),Ht=e({__name:`EditablePreview`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let t=e,n=It(),r=y(()=>n.placeholder.value?.preview);function i(){n.activationMode.value===`focus`&&n.edit()}function a(){n.activationMode.value===`dblclick`&&n.edit()}return(e,s)=>(o(),m(T(J),N(t,{tabindex:`0`,"data-placeholder-shown":T(n).isEditing.value?void 0:``,hidden:T(n).autoResize.value?void 0:T(n).isEditing.value,style:T(n).autoResize.value?{whiteSpace:`pre`,userSelect:`none`,gridArea:`1 / 1 / auto / auto`,visibility:T(n).isEditing.value?`hidden`:void 0,overflow:`hidden`,textOverflow:`ellipsis`}:void 0,onFocusin:i,onDblclick:a}),{default:E(()=>[g(e.$slots,`default`,{},()=>[d(f(T(n).modelValue.value||r.value),1)])]),_:3},16,[`data-placeholder-shown`,`hidden`,`style`]))}}),Ut=e({__name:`EditableSubmitTrigger`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=It();return(e,r)=>(o(),m(T(J),N(t,{"aria-label":`submit`,"aria-disabled":T(n).disabled.value?``:void 0,"data-disabled":T(n).disabled.value?``:void 0,disabled:T(n).disabled.value,type:e.as===`button`?`button`:void 0,hidden:T(n).isEditing.value?void 0:``,onClick:T(n).submit}),{default:E(()=>[g(e.$slots,`default`,{},()=>[r[0]||=d(`Submit`)])]),_:3},16,[`aria-disabled`,`data-disabled`,`disabled`,`type`,`hidden`,`onClick`]))}}),Wt={flex:``,"items-center":``},Gt={flex:``,"items-center":``},Kt={flex:``,"items-center":``},qt={flex:``,"items-center":``,"justify-between":``},Jt={"data-motion-selector":``,relative:``,flex:``,"flex-col":``,"items-end":``,"gap-1":``},Yt=[`title`],Xt={"max-w-32":``,truncate:``},Zt={key:0,bg:`white dark:neutral-800`,border:`1 neutral-200 dark:neutral-700`,absolute:``,"right-0":``,"top-10":``,"z-50":``,"max-h-80":``,"min-w-64":``,"overflow-y-auto":``,"rounded-lg":``,"shadow-lg":``},Qt={key:0,"p-4":``,"text-sm":``,"text-neutral-500":``,"dark:text-neutral-400":``},$t=[`onClick`],en={"text-sm":``,"text-neutral-900":``,"font-medium":``,"dark:text-neutral-100":``},tn={truncate:``,"text-xs":``,"text-neutral-500":``,"dark:text-neutral-400":``},nn={"mt-4":``,flex:``,"items-center":``,"justify-between":``},rn={"mt-4":``,flex:``,"items-center":``,"justify-between":``},an={flex:``,"items-center":``},on={flex:``,"items-center":``},sn={flex:``,"items-center":``},cn={flex:``,"items-center":``},ln={flex:``,"items-center":``},un={flex:``,"items-center":``},dn={flex:``,"items-center":``},fn={flex:``,"items-center":``},pn={flex:``,"items-center":``},mn={flex:``,"items-center":``},hn={flex:``,"items-center":``},gn={flex:``,"items-center":``},_n={flex:``,"items-center":``},vn={flex:``,"items-center":``},yn={flex:``,"items-center":``},bn={flex:``,"items-center":``},xn={flex:``,"items-center":``},Sn={flex:``,"items-center":``},Cn={flex:``,"items-center":``},wn={flex:``,"items-center":``},Tn={flex:``,"items-center":``},En={flex:``,"items-center":``},Dn=200,On=200,kn=e({__name:`Live2D`,props:{palette:{}},emits:[`extractColorsFromModel`],setup(e){let{t}=Xe(),{live2dDisableFocus:r,live2dIdleAnimationEnabled:s,live2dAutoBlinkEnabled:c,live2dShadowEnabled:l}=ke(Qe()),u=it(),{scale:p,position:m,modelParameters:g,currentMotion:_}=ke(u),y=M(``),b=M(``),x=M([]),O=M(!1);h(()=>{v(()=>u.availableMotions,e=>{x.value=e.map(e=>({name:e.fileName.split(`/`).pop()||e.fileName,fullPath:e.fileName,displayPath:e.fileName,group:e.motionName,index:e.motionIndex})),console.info(`Available motions:`,x.value)},{immediate:!0});let e=localStorage.getItem(`selected-runtime-motion`),t=localStorage.getItem(`selected-runtime-motion-name`);e&&(y.value=e),t&&(b.value=t),document.addEventListener(`click`,F)});function k(){g.value={...at}}function N(e){y.value=e.displayPath,b.value=e.name,localStorage.setItem(`selected-runtime-motion`,e.displayPath),localStorage.setItem(`selected-runtime-motion-name`,e.name),localStorage.setItem(`selected-runtime-motion-group`,e.group),localStorage.setItem(`selected-runtime-motion-index`,e.index.toString()),s.value=!0,_.value={group:e.group,index:e.index},O.value=!1,console.info(`✅ Selected runtime motion:`,e.name),console.info(`Full path:`,e.displayPath),console.info(`Group:`,e.group,`Index:`,e.index)}function P(){O.value=!O.value}function F(e){e.target.closest(`[data-motion-selector]`)||(O.value=!1)}i(()=>{document.removeEventListener(`click`,F)});let L=null,R=null,z=Dn+On,B=0,V=1,H=1,U=!1,W=!1,G=null;function K(){L!==null&&(cancelAnimationFrame(L),L=null,U=!1),R!==null&&(clearTimeout(R),R=null),G!==null&&(clearTimeout(G),G=null)}function q(){if(U||R!==null||(K(),!c.value))return;U=!0,B=Date.now(),V=g.value.leftEyeOpen,H=g.value.rightEyeOpen;function e(){if(!c.value){K();return}let t=Date.now()-B,n=Math.min(t/z,1),r,i;if(t{W=!1},0),n<1)L=requestAnimationFrame(e);else if(W=!0,g.value.leftEyeOpen=Math.round(V*100)/100,g.value.rightEyeOpen=Math.round(H*100)/100,setTimeout(()=>{W=!1},0),U=!1,L=null,c.value){let e=5e3+Math.random()*5e3;R=setTimeout(()=>{R=null,c.value&&!U&&q()},e)}}L=requestAnimationFrame(e)}return v(c,e=>{e?!U&&R===null&&q():K()}),v(()=>g.value.leftEyeOpen,(e,t)=>{if(!(!c.value||U||W||R!==null)){if(t==null&&e>0){q();return}t!==void 0&&Math.abs(e-t)>.01&&(K(),G!==null&&clearTimeout(G),G=setTimeout(()=>{c.value&&!U&&R===null&&q(),G=null},1e3))}},{immediate:!0}),v(()=>g.value.rightEyeOpen,(e,t)=>{if(!(!c.value||U||W||R!==null)){if(t==null&&e>0){q();return}t!==void 0&&Math.abs(e-t)>.01&&(K(),G!==null&&clearTimeout(G),G=setTimeout(()=>{c.value&&!U&&R===null&&q(),G=null},1e3))}},{immediate:!0}),i(()=>{K()}),(i,s)=>(o(),A(D,null,[w(T(I),{title:T(t)(`settings.live2d.scale-and-position.title`),icon:`i-solar:scale-bold-duotone`,class:C([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`]),size:`sm`,expand:!0},{default:E(()=>[w(T(Z),{modelValue:T(p),"onUpdate:modelValue":s[1]||=e=>S(p)?p.value=e:null,as:`div`,min:.1,max:3,step:.01,label:T(t)(`settings.live2d.scale-and-position.scale`)},{label:E(()=>[j(`div`,Wt,[j(`div`,null,f(T(t)(`settings.live2d.scale-and-position.scale`)),1),j(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:s[0]||=()=>p.value=1},[...s[54]||=[j(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)]])])]),_:1},8,[`modelValue`,`label`]),w(T(Z),{modelValue:T(m).x,"onUpdate:modelValue":s[3]||=e=>T(m).x=e,as:`div`,min:-1e3,max:1e3,step:1,label:T(t)(`settings.live2d.scale-and-position.x`)},{label:E(()=>[j(`div`,Gt,[j(`div`,null,f(T(t)(`settings.live2d.scale-and-position.x`)),1),j(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:s[2]||=()=>T(m).x=0},[...s[55]||=[j(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)]])])]),_:1},8,[`modelValue`,`label`]),w(T(Z),{modelValue:T(m).y,"onUpdate:modelValue":s[5]||=e=>T(m).y=e,as:`div`,min:-1e3,max:1e3,step:1,label:T(t)(`settings.live2d.scale-and-position.y`)},{label:E(()=>[j(`div`,Kt,[j(`div`,null,f(T(t)(`settings.live2d.scale-and-position.y`)),1),j(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:s[4]||=()=>T(m).y=0},[...s[56]||=[j(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)]])])]),_:1},8,[`modelValue`,`label`])]),_:1},8,[`title`]),w(T(I),{title:T(t)(`settings.live2d.theme-color-from-model.title`),icon:`i-solar:magic-stick-3-bold-duotone`,"inner-class":`text-sm`,class:C([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`]),size:`sm`,expand:!1},{default:E(()=>[w(T(ee),{class:`mb-4 mt-2`,colors:e.palette.map(e=>({hex:e,name:e})),"mx-auto":``},null,8,[`colors`]),w(T(Q),{variant:`secondary`,onClick:s[6]||=e=>i.$emit(`extractColorsFromModel`)},{default:E(()=>[d(f(T(t)(`settings.live2d.theme-color-from-model.button-extract.title`)),1)]),_:1})]),_:1},8,[`title`]),w(T(I),{title:T(t)(`settings.live2d.focus.title`),icon:`i-solar:eye-scan-bold-duotone`,class:C([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`]),size:`sm`,expand:!1},{default:E(()=>[w(T(Ce),{modelValue:T(r),"onUpdate:modelValue":s[7]||=e=>S(r)?r.value=e:null,label:T(t)(`settings.live2d.focus.button-disable.title`)},null,8,[`modelValue`,`label`])]),_:1},8,[`title`]),w(T(I),{title:`Parameters`,icon:`i-solar:settings-bold-duotone`,class:C([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`]),size:`sm`,expand:!1},{default:E(()=>[j(`div`,qt,[s[57]||=j(`span`,{"text-sm":``,"text-neutral-600":``,"dark:text-neutral-400":``},`Idle Animation`,-1),j(`div`,Jt,[j(`button`,{title:y.value,flex:``,"items-center":``,"gap-2":``,border:``,rounded:``,"bg-neutral-100":``,"px-4":``,"py-2":``,"text-sm":``,"text-neutral-700":``,"font-medium":``,"transition-colors":``,"dark:border-neutral-700":``,"dark:bg-neutral-800":``,"hover:bg-neutral-200":``,"dark:text-neutral-300":``,"dark:hover:bg-neutral-700":``,onClick:P},[j(`span`,Xt,f(b.value||`Select Motion`),1),j(`div`,{class:C(O.value?`i-solar:alt-arrow-up-line-duotone`:`i-solar:alt-arrow-down-line-duotone`),"text-xs":``,"transition-transform":``},null,2)],8,Yt),O.value?(o(),A(`div`,Zt,[x.value.length===0?(o(),A(`div`,Qt,` No motions available `)):n(``,!0),(o(!0),A(D,null,a(x.value,e=>(o(),A(`button`,{key:e.fullPath,"w-full":``,"px-4":``,"py-2.5":``,"text-left":``,"hover:bg":`neutral-100 dark:neutral-700`,"transition-colors":``,class:C({"bg-neutral-100 dark:bg-neutral-700":y.value===e.displayPath}),onClick:t=>N(e)},[j(`div`,en,f(e.name),1),j(`div`,tn,f(e.displayPath),1)],10,$t))),128))])):n(``,!0)])]),j(`div`,nn,[s[58]||=j(`span`,{"text-sm":``,"text-neutral-600":``,"dark:text-neutral-400":``},`Auto Blink`,-1),w(T(Ce),{modelValue:T(c),"onUpdate:modelValue":s[8]||=e=>S(c)?c.value=e:null},null,8,[`modelValue`])]),j(`div`,rn,[s[59]||=j(`span`,{"text-sm":``,"text-neutral-600":``,"dark:text-neutral-400":``},`Shadow`,-1),w(T(Ce),{modelValue:T(l),"onUpdate:modelValue":s[9]||=e=>S(l)?l.value=e:null},null,8,[`modelValue`])]),j(`button`,{"mt-4":``,"w-full":``,border:``,rounded:``,"bg-neutral-100":``,"px-4":``,"py-2":``,"text-sm":``,"text-neutral-700":``,"font-medium":``,"transition-colors":``,"dark:border-neutral-700":``,"dark:bg-neutral-800":``,"hover:bg-neutral-200":``,"dark:text-neutral-300":``,"dark:hover:bg-neutral-700":``,onClick:k},` Reset To Default Parameters `),s[104]||=j(`div`,{"mb-2":``,"mt-4":``,"text-xs":``,"text-neutral-500":``,"font-semibold":``,"dark:text-neutral-400":``},` Head Rotation `,-1),w(T(Z),{modelValue:T(g).angleX,"onUpdate:modelValue":s[11]||=e=>T(g).angleX=e,as:`div`,min:-30,max:30,step:.1,label:`Angle X`},{label:E(()=>[j(`div`,an,[s[61]||=j(`div`,null,`Angle X`,-1),j(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:s[10]||=()=>T(g).angleX=0},[...s[60]||=[j(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)]])])]),_:1},8,[`modelValue`]),w(T(Z),{modelValue:T(g).angleY,"onUpdate:modelValue":s[13]||=e=>T(g).angleY=e,as:`div`,min:-30,max:30,step:.1,label:`Angle Y`},{label:E(()=>[j(`div`,on,[s[63]||=j(`div`,null,`Angle Y`,-1),j(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:s[12]||=()=>T(g).angleY=0},[...s[62]||=[j(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)]])])]),_:1},8,[`modelValue`]),w(T(Z),{modelValue:T(g).angleZ,"onUpdate:modelValue":s[15]||=e=>T(g).angleZ=e,as:`div`,min:-30,max:30,step:.1,label:`Angle Z`},{label:E(()=>[j(`div`,sn,[s[65]||=j(`div`,null,`Angle Z`,-1),j(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:s[14]||=()=>T(g).angleZ=0},[...s[64]||=[j(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)]])])]),_:1},8,[`modelValue`]),s[105]||=j(`div`,{"mb-2":``,"mt-4":``,"text-xs":``,"text-neutral-500":``,"font-semibold":``,"dark:text-neutral-400":``},` Eyes `,-1),w(T(Z),{modelValue:T(g).leftEyeOpen,"onUpdate:modelValue":s[17]||=e=>T(g).leftEyeOpen=e,as:`div`,min:0,max:1,step:.01,label:`Left Eye Open/Close`},{label:E(()=>[j(`div`,cn,[s[67]||=j(`div`,null,`Left Eye Open/Close`,-1),j(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:s[16]||=()=>T(g).leftEyeOpen=0},[...s[66]||=[j(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)]])])]),_:1},8,[`modelValue`]),w(T(Z),{modelValue:T(g).rightEyeOpen,"onUpdate:modelValue":s[19]||=e=>T(g).rightEyeOpen=e,as:`div`,min:0,max:1,step:.01,label:`Right Eye Open/Close`},{label:E(()=>[j(`div`,ln,[s[69]||=j(`div`,null,`Right Eye Open/Close`,-1),j(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:s[18]||=()=>T(g).rightEyeOpen=0},[...s[68]||=[j(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)]])])]),_:1},8,[`modelValue`]),w(T(Z),{modelValue:T(g).leftEyeSmile,"onUpdate:modelValue":s[21]||=e=>T(g).leftEyeSmile=e,as:`div`,min:0,max:1,step:.01,label:`Left Eye Smiling`},{label:E(()=>[j(`div`,un,[s[71]||=j(`div`,null,`Left Eye Smiling`,-1),j(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:s[20]||=()=>T(g).leftEyeSmile=0},[...s[70]||=[j(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)]])])]),_:1},8,[`modelValue`]),w(T(Z),{modelValue:T(g).rightEyeSmile,"onUpdate:modelValue":s[23]||=e=>T(g).rightEyeSmile=e,as:`div`,min:0,max:1,step:.01,label:`Right Eye Smiling`},{label:E(()=>[j(`div`,dn,[s[73]||=j(`div`,null,`Right Eye Smiling`,-1),j(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:s[22]||=()=>T(g).rightEyeSmile=0},[...s[72]||=[j(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)]])])]),_:1},8,[`modelValue`]),s[106]||=j(`div`,{"mb-2":``,"mt-4":``,"text-xs":``,"text-neutral-500":``,"font-semibold":``,"dark:text-neutral-400":``},` Eyebrows `,-1),w(T(Z),{modelValue:T(g).leftEyebrowLR,"onUpdate:modelValue":s[25]||=e=>T(g).leftEyebrowLR=e,as:`div`,min:-1,max:1,step:.01,label:`Left eyebrow Left/Right`},{label:E(()=>[j(`div`,fn,[s[75]||=j(`div`,null,`Left eyebrow Left/Right`,-1),j(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:s[24]||=()=>T(g).leftEyebrowLR=0},[...s[74]||=[j(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)]])])]),_:1},8,[`modelValue`]),w(T(Z),{modelValue:T(g).rightEyebrowLR,"onUpdate:modelValue":s[27]||=e=>T(g).rightEyebrowLR=e,as:`div`,min:-1,max:1,step:.01,label:`Right eyebrow Left/Right`},{label:E(()=>[j(`div`,pn,[s[77]||=j(`div`,null,`Right eyebrow Left/Right`,-1),j(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:s[26]||=()=>T(g).rightEyebrowLR=0},[...s[76]||=[j(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)]])])]),_:1},8,[`modelValue`]),w(T(Z),{modelValue:T(g).leftEyebrowY,"onUpdate:modelValue":s[29]||=e=>T(g).leftEyebrowY=e,as:`div`,min:-1,max:1,step:.01,label:`Left Eyebrow Y (Up/Down)`},{label:E(()=>[j(`div`,mn,[s[79]||=j(`div`,null,`Left Eyebrow Y`,-1),j(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:s[28]||=()=>T(g).leftEyebrowY=0},[...s[78]||=[j(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)]])])]),_:1},8,[`modelValue`]),w(T(Z),{modelValue:T(g).rightEyebrowY,"onUpdate:modelValue":s[31]||=e=>T(g).rightEyebrowY=e,as:`div`,min:-1,max:1,step:.01,label:`Right Eyebrow Y (Up/Down)`},{label:E(()=>[j(`div`,hn,[s[81]||=j(`div`,null,`Right Eyebrow Y`,-1),j(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:s[30]||=()=>T(g).rightEyebrowY=0},[...s[80]||=[j(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)]])])]),_:1},8,[`modelValue`]),w(T(Z),{modelValue:T(g).leftEyebrowAngle,"onUpdate:modelValue":s[33]||=e=>T(g).leftEyebrowAngle=e,as:`div`,min:-1,max:1,step:.01,label:`Left Eyebrow Angle`},{label:E(()=>[j(`div`,gn,[s[83]||=j(`div`,null,`Left Eyebrow Angle`,-1),j(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:s[32]||=()=>T(g).leftEyebrowAngle=0},[...s[82]||=[j(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)]])])]),_:1},8,[`modelValue`]),w(T(Z),{modelValue:T(g).rightEyebrowAngle,"onUpdate:modelValue":s[35]||=e=>T(g).rightEyebrowAngle=e,as:`div`,min:-1,max:1,step:.01,label:`Right Eyebrow Angle`},{label:E(()=>[j(`div`,_n,[s[85]||=j(`div`,null,`Right Eyebrow Angle`,-1),j(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:s[34]||=()=>T(g).rightEyebrowAngle=0},[...s[84]||=[j(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)]])])]),_:1},8,[`modelValue`]),w(T(Z),{modelValue:T(g).leftEyebrowForm,"onUpdate:modelValue":s[37]||=e=>T(g).leftEyebrowForm=e,as:`div`,min:-1,max:1,step:.01,label:`Left Eyebrow Form (Deformation)`},{label:E(()=>[j(`div`,vn,[s[87]||=j(`div`,null,`Left Eyebrow Form`,-1),j(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:s[36]||=()=>T(g).leftEyebrowForm=0},[...s[86]||=[j(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)]])])]),_:1},8,[`modelValue`]),w(T(Z),{modelValue:T(g).rightEyebrowForm,"onUpdate:modelValue":s[39]||=e=>T(g).rightEyebrowForm=e,as:`div`,min:-1,max:1,step:.01,label:`Right Eyebrow Form (Deformation)`},{label:E(()=>[j(`div`,yn,[s[89]||=j(`div`,null,`Right Eyebrow Form`,-1),j(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:s[38]||=()=>T(g).rightEyebrowForm=0},[...s[88]||=[j(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)]])])]),_:1},8,[`modelValue`]),s[107]||=j(`div`,{"mb-2":``,"mt-4":``,"text-xs":``,"text-neutral-500":``,"font-semibold":``,"dark:text-neutral-400":``},` Mouth `,-1),w(T(Z),{modelValue:T(g).mouthOpen,"onUpdate:modelValue":s[41]||=e=>T(g).mouthOpen=e,as:`div`,min:0,max:1,step:.01,label:`Mouth Open/Close`},{label:E(()=>[j(`div`,bn,[s[91]||=j(`div`,null,`Mouth Open/Close`,-1),j(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:s[40]||=()=>T(g).mouthOpen=0},[...s[90]||=[j(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)]])])]),_:1},8,[`modelValue`]),w(T(Z),{modelValue:T(g).mouthForm,"onUpdate:modelValue":s[43]||=e=>T(g).mouthForm=e,as:`div`,min:-1,max:1,step:.01,label:`Mouth Form (Deformation)`},{label:E(()=>[j(`div`,xn,[s[93]||=j(`div`,null,`Mouth Form`,-1),j(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:s[42]||=()=>T(g).mouthForm=0},[...s[92]||=[j(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)]])])]),_:1},8,[`modelValue`]),s[108]||=j(`div`,{"mb-2":``,"mt-4":``,"text-xs":``,"text-neutral-500":``,"font-semibold":``,"dark:text-neutral-400":``},` Face `,-1),w(T(Z),{modelValue:T(g).cheek,"onUpdate:modelValue":s[45]||=e=>T(g).cheek=e,as:`div`,min:0,max:1,step:.01,label:`Cheek`},{label:E(()=>[j(`div`,Sn,[s[95]||=j(`div`,null,`Cheek`,-1),j(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:s[44]||=()=>T(g).cheek=0},[...s[94]||=[j(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)]])])]),_:1},8,[`modelValue`]),s[109]||=j(`div`,{"mb-2":``,"mt-4":``,"text-xs":``,"text-neutral-500":``,"font-semibold":``,"dark:text-neutral-400":``},` Body `,-1),w(T(Z),{modelValue:T(g).bodyAngleX,"onUpdate:modelValue":s[47]||=e=>T(g).bodyAngleX=e,as:`div`,min:-10,max:10,step:.1,label:`Body rotation X`},{label:E(()=>[j(`div`,Cn,[s[97]||=j(`div`,null,`Body rotation X`,-1),j(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:s[46]||=()=>T(g).bodyAngleX=0},[...s[96]||=[j(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)]])])]),_:1},8,[`modelValue`]),w(T(Z),{modelValue:T(g).bodyAngleY,"onUpdate:modelValue":s[49]||=e=>T(g).bodyAngleY=e,as:`div`,min:-10,max:10,step:.1,label:`Body rotation Y`},{label:E(()=>[j(`div`,wn,[s[99]||=j(`div`,null,`Body rotation Y`,-1),j(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:s[48]||=()=>T(g).bodyAngleY=0},[...s[98]||=[j(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)]])])]),_:1},8,[`modelValue`]),w(T(Z),{modelValue:T(g).bodyAngleZ,"onUpdate:modelValue":s[51]||=e=>T(g).bodyAngleZ=e,as:`div`,min:-10,max:10,step:.1,label:`Body rotation Z`},{label:E(()=>[j(`div`,Tn,[s[101]||=j(`div`,null,`Body rotation Z`,-1),j(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:s[50]||=()=>T(g).bodyAngleZ=0},[...s[100]||=[j(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)]])])]),_:1},8,[`modelValue`]),w(T(Z),{modelValue:T(g).breath,"onUpdate:modelValue":s[53]||=e=>T(g).breath=e,as:`div`,min:0,max:1,step:.01,label:`Breath`},{label:E(()=>[j(`div`,En,[s[103]||=j(`div`,null,`Breath`,-1),j(`button`,{"px-2":``,"text-xs":``,"outline-none":``,title:`Reset value to default`,onClick:s[52]||=()=>T(g).breath=0},[...s[102]||=[j(`div`,{"i-solar:forward-linear":``,"transform-scale-x--100":``,text:`neutral-500 dark:neutral-400`},null,-1)]])])]),_:1},8,[`modelValue`])]),_:1})],64))}}),An={grid:`~ cols-5 gap-1`,"p-2":``},jn={class:`text-xs`},Mn={key:0},Nn={grid:`~ cols-5 gap-1`,"p-2":``},Pn={key:1},Fn={grid:`~ cols-5 gap-1`,"p-2":``},In={class:`text-sm text-neutral-600 space-y-1 dark:text-neutral-400`},Ln={class:`flex justify-between`},Rn={class:`flex justify-between`},zn={class:`flex justify-between`},Bn={class:`text-sm text-neutral-600 space-y-1 dark:text-neutral-400`},Vn=e({__name:`VRM`,props:{palette:{}},emits:[`extractColorsFromModel`],setup(e){let{t}=Xe(),{modelSize:n,modelOffset:r,cameraFOV:i,modelRotationY:s,cameraDistance:c,trackingMode:l,directionalLightRotation:u,directionalLightIntensity:p,directionalLightColor:h,ambientLightIntensity:g,ambientLightColor:_,hemisphereLightIntensity:v,hemisphereSkyColor:b,hemisphereGroundColor:x,envSelect:O,skyBoxIntensity:k}=ke(tt()),M=y(()=>[{value:`camera`,label:t(`settings.vrm.scale-and-position.eye-tracking-mode.options.option.camera`),class:`col-start-3`},{value:`mouse`,label:t(`settings.vrm.scale-and-position.eye-tracking-mode.options.option.mouse`),class:`col-start-4`},{value:`none`,label:t(`settings.vrm.scale-and-position.eye-tracking-mode.options.option.disabled`),class:`col-start-5`}]),N=[{value:`hemisphere`,label:`Hemisphere`,icon:{idle:`i-solar:forbidden-circle-linear rotate-45`,active:`i-solar:forbidden-circle-bold rotate-45`}},{value:`skyBox`,label:`SkyBox`,icon:{idle:`i-solar:gallery-circle-linear`,active:`i-solar:gallery-circle-bold`}}];return(y,P)=>(o(),A(D,null,[w(T(B),{title:T(t)(`settings.pages.models.sections.section.scene`),icon:`i-solar:people-nearby-bold-duotone`,class:C([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`])},{default:E(()=>[w(T(ee),{class:`mb-4 mt-2`,colors:e.palette.map(e=>({hex:e,name:e})),"mx-auto":``},null,8,[`colors`]),w(T(Q),{variant:`secondary`,onClick:P[0]||=e=>y.$emit(`extractColorsFromModel`)},{default:E(()=>[d(f(T(t)(`settings.vrm.theme-color-from-model.button-extract.title`)),1)]),_:1}),j(`div`,An,[w(T(L),{x:T(r).x,"onUpdate:x":P[1]||=e=>T(r).x=e,y:T(r).y,"onUpdate:y":P[2]||=e=>T(r).y=e,z:T(r).z,"onUpdate:z":P[3]||=e=>T(r).z=e,label:`Model Position`,"x-config":{min:-T(n).x*2,max:T(n).x*2,step:T(n).x/100,label:`X`,formatValue:e=>e?.toFixed(4)},"y-config":{min:-T(n).y*2,max:T(n).y*2,step:T(n).y/100,label:`Y`,formatValue:e=>e?.toFixed(4)},"z-config":{min:-T(n).z*2,max:T(n).z*2,step:T(n).z/100,label:`Z`,formatValue:e=>e?.toFixed(4)}},null,8,[`x`,`y`,`z`,`x-config`,`y-config`,`z-config`]),w(T(R),{modelValue:T(i),"onUpdate:modelValue":P[4]||=e=>S(i)?i.value=e:null,config:{min:1,max:180,step:1,label:T(t)(`settings.vrm.scale-and-position.fov`)},label:T(t)(`settings.vrm.scale-and-position.fov`)},null,8,[`modelValue`,`config`,`label`]),w(T(R),{modelValue:T(c),"onUpdate:modelValue":P[5]||=e=>S(c)?c.value=e:null,config:{min:T(n).z,max:T(n).z*20,step:T(n).z/100,label:T(t)(`settings.vrm.scale-and-position.camera-distance`),formatValue:e=>e?.toFixed(4)},label:T(t)(`settings.vrm.scale-and-position.camera-distance`)},null,8,[`modelValue`,`config`,`label`]),w(T(R),{modelValue:T(s),"onUpdate:modelValue":P[6]||=e=>S(s)?s.value=e:null,config:{min:-180,max:180,step:1,label:T(t)(`settings.vrm.scale-and-position.rotation-y`)},label:T(t)(`settings.vrm.scale-and-position.rotation-y`)},null,8,[`modelValue`,`config`,`label`]),j(`div`,jn,f(T(t)(`settings.vrm.scale-and-position.eye-tracking-mode.title`))+`: `,1),P[18]||=j(`div`,null,null,-1),(o(!0),A(D,null,a(M.value,e=>(o(),m(T(Q),{key:e.value,class:C([e.class,`w-auto`]),size:`sm`,variant:T(l)===e.value?`primary`:`secondary`,label:e.label,onClick:t=>l.value=e.value},null,8,[`class`,`variant`,`label`,`onClick`]))),128)),w(T(R),{modelValue:T(u).x,"onUpdate:modelValue":P[7]||=e=>T(u).x=e,config:{min:-180,max:180,step:1,label:`RotationXDeg`,formatValue:e=>e?.toFixed(0)},label:`Directional Light Rotation - X`},null,8,[`modelValue`,`config`]),w(T(R),{modelValue:T(u).y,"onUpdate:modelValue":P[8]||=e=>T(u).y=e,config:{min:-180,max:180,step:1,label:`RotationYDeg`,formatValue:e=>e?.toFixed(0)},label:`Directional Light Rotation - Y`},null,8,[`modelValue`,`config`]),w(T(H),{modelValue:T(h),"onUpdate:modelValue":P[9]||=e=>S(h)?h.value=e:null,label:`Directional Light Color`},null,8,[`modelValue`]),w(T(R),{modelValue:T(p),"onUpdate:modelValue":P[10]||=e=>S(p)?p.value=e:null,config:{min:0,max:10,step:.01,label:`Intensity`},label:`Directional Light Intensity`},null,8,[`modelValue`]),w(T(R),{modelValue:T(g),"onUpdate:modelValue":P[11]||=e=>S(g)?g.value=e:null,config:{min:0,max:10,step:.01,label:`Intensity`},label:`Ambient Light Intensity`},null,8,[`modelValue`]),w(T(H),{modelValue:T(_),"onUpdate:modelValue":P[12]||=e=>S(_)?_.value=e:null,label:`Ambient Light Color`},null,8,[`modelValue`])]),j(`div`,null,[w(T(W),{modelValue:T(O),"onUpdate:modelValue":P[17]||=e=>S(O)?O.value=e:null,tabs:N,label:`Environment`},{default:E(()=>[T(O)===`hemisphere`?(o(),A(`div`,Mn,[j(`div`,Nn,[w(T(R),{modelValue:T(v),"onUpdate:modelValue":P[13]||=e=>S(v)?v.value=e:null,config:{min:0,max:10,step:.01,label:`Intensity`},label:`Hemisphere Light Intensity`},null,8,[`modelValue`]),w(T(H),{modelValue:T(b),"onUpdate:modelValue":P[14]||=e=>S(b)?b.value=e:null,label:`Hemisphere Sky Color`},null,8,[`modelValue`]),w(T(H),{modelValue:T(x),"onUpdate:modelValue":P[15]||=e=>S(x)?x.value=e:null,label:`Hemisphere Ground Color`},null,8,[`modelValue`])])])):(o(),A(`div`,Pn,[j(`div`,Fn,[w(T(R),{modelValue:T(k),"onUpdate:modelValue":P[16]||=e=>S(k)?k.value=e:null,config:{min:0,max:1,step:.01,label:`Intensity`},label:T(t)(`settings.vrm.skybox.skybox-intensity`)},null,8,[`modelValue`,`label`])])]))]),_:1},8,[`modelValue`])])]),_:1},8,[`title`]),w(T(B),{title:T(t)(`settings.vrm.change-model.title`),icon:`i-solar:magic-stick-3-bold-duotone`,"inner-class":`text-sm`,class:C([`rounded-xl`,`bg-white/80 dark:bg-black/75`,`backdrop-blur-lg`])},{default:E(()=>[w(T(G),{label:T(t)(`settings.vrm.scale-and-position.model-info-title`)},{default:E(()=>[j(`div`,null,[j(`div`,In,[j(`div`,Ln,[j(`span`,null,f(T(t)(`settings.vrm.scale-and-position.model-info-x`)),1),j(`span`,null,f(T(n).x.toFixed(4)),1)]),j(`div`,Rn,[j(`span`,null,f(T(t)(`settings.vrm.scale-and-position.model-info-y`)),1),j(`span`,null,f(T(n).y.toFixed(4)),1)]),j(`div`,zn,[j(`span`,null,f(T(t)(`settings.vrm.scale-and-position.model-info-z`)),1),j(`span`,null,f(T(n).z.toFixed(4)),1)])])])]),_:1},8,[`label`]),w(T(G),{theme:`lime`,label:`Tips!`},{default:E(()=>[j(`div`,Bn,f(T(t)(`settings.vrm.scale-and-position.tips`)),1)]),_:1})]),_:1},8,[`title`])],64))}}),Hn={pt:`4 sm:0`,gap:`4 sm:6`,"h-full":``,flex:``,"flex-col":``},Un={flex:``,"items-center":``},Wn={key:0},Gn={class:`flex-1 md:flex-none`,"h-full":``,"w-full":``,"overflow-x-hidden":``,"overflow-y-scroll":``},Kn={class:`grid grid-cols-2 gap-2 lg:max-h-80dvh`},qn=[`onClick`],Jn={absolute:``,"left-3":``,"top-4":``,"z-1":``},Yn=[`onClick`],Xn={class:`min-w-60 lg:min-h-60`,aspect:`12/16`,"px-1":``,"py-2":``},Zn=[`src`],Qn={"h-full":``,"w-full":``,flex:``,"flex-col":``},$n={"w-full":``,"flex-1":``,"p-2":``},er={key:1,class:`flex gap-2`},tr={flex:``,"items-center":``,"gap-1":``,text:`neutral-400 dark:neutral-600`},nr=e({__name:`model-selector`,props:{modelValue:{type:Object,required:!1},modelModifiers:{}},emits:p([`close`],[`update:modelValue`]),setup(e,{emit:t}){let r=t,i=O(e,`modelValue`),s=Ze(),{displayModelsFromIndexedDBLoading:c,displayModels:l}=ke(s);function u(e){s.removeDisplayModel(e.id)}let p=M(i.value?.id);function h(e){e===null||e.length===0||e[0].name.endsWith(`.zip`)&&s.addDisplayModel($.Live2dZip,e[0])}function g(e){i.value=e,r(`close`,void 0)}function v(){i.value=l.value.find(e=>e.id===p.value),r(`close`,void 0)}function y(e){e===null||e.length===0||e[0].name.endsWith(`.vrm`)&&s.addDisplayModel($.VRM,e[0])}let b={[$.Live2dZip]:`Live2D`,[$.Live2dDirectory]:`Live2D`,[$.VRM]:`VRM`,[$.PMXDirectory]:`MMD`,[$.PMXZip]:`MMD`,[$.PMD]:`MMD`},x=Ke({accept:`.zip`,multiple:!1,reset:!0}),S=Ke({accept:`.vrm`,multiple:!1,reset:!0});return x.onChange(h),S.onChange(y),(e,t)=>{let r=_(`auto-animate`);return o(),A(`div`,Hn,[j(`div`,Un,[t[6]||=j(`div`,{"w-full":``,"flex-1":``,"text-xl":``},` Model Selector `,-1),j(`div`,null,[w(T(jt),null,{default:E(()=>[w(T(Ft),{bg:`neutral-400/20 hover:neutral-400/45 active:neutral-400/60 dark:neutral-700/50 hover:dark:neutral-700/65 active:dark:neutral-700/90`,flex:``,"items-center":``,"justify-center":``,"gap-1":``,"rounded-lg":``,"px-2":``,"py-1":``,"backdrop-blur-sm":``,transition:`colors duration-200 ease-in-out`,"aria-label":`Options for Display Models`},{default:E(()=>[...t[3]||=[j(`div`,{"i-solar:add-circle-bold":``},null,-1),j(`div`,null,`Add`,-1)]]),_:1}),w(T(Pt),null,{default:E(()=>[w(T(Mt),{class:`will-change-[opacity,transform] z-10000 max-w-45 rounded-lg p-0.5 shadow-md outline-none data-[side=bottom]:animate-slideUpAndFade data-[side=left]:animate-slideRightAndFade data-[side=right]:animate-slideLeftAndFade data-[side=top]:animate-slideDownAndFade`,bg:`neutral-100/50 dark:neutral-950/50`,transition:`colors duration-200 ease-in-out`,"backdrop-blur-sm":``,align:`end`,side:`bottom`,"side-offset":8},{default:E(()=>[w(T(Nt),{class:`data-[disabled]:text-mauve8 relative flex cursor-pointer select-none items-center rounded-md px-3 py-2 text-base leading-none outline-none data-[disabled]:pointer-events-none data-[highlighted]:bg-primary-100/20 sm:text-sm data-[highlighted]:text-primary-200`,transition:`colors duration-200 ease-in-out`,onClick:t[0]||=e=>T(x).open()},{default:E(()=>[...t[4]||=[d(` Live2D `,-1)]]),_:1}),w(T(Nt),{class:`data-[disabled]:text-mauve8 relative flex cursor-pointer select-none items-center rounded-md px-3 py-2 text-base leading-none outline-none data-[disabled]:pointer-events-none data-[highlighted]:bg-primary-100/20 sm:text-sm data-[highlighted]:text-primary-200`,transition:`colors duration-200 ease-in-out`,onClick:t[1]||=e=>T(S).open()},{default:E(()=>[...t[5]||=[d(` VRM `,-1)]]),_:1})]),_:1})]),_:1})]),_:1})])]),T(c)?(o(),A(`div`,Wn,` Loading display models... `)):n(``,!0),j(`div`,Gn,[j(`div`,Kn,[(o(!0),A(D,null,a(T(l),e=>k((o(),A(`div`,{key:e.id,relative:``,"w-full":``,flex:`~ col md:row`,"gap-2":``,onClick:()=>p.value=e.id},[j(`div`,Jn,[w(T(jt),null,{default:E(()=>[w(T(Ft),{bg:`neutral-900/20 hover:neutral-900/45 active:neutral-900/60 dark:neutral-950/50 hover:dark:neutral-900/65 active:dark:neutral-900/90`,text:`white`,"h-7":``,"w-7":``,flex:``,"items-center":``,"justify-center":``,"rounded-lg":``,"backdrop-blur-sm":``,transition:`colors duration-200 ease-in-out`,"aria-label":`Options for Display Models`},{default:E(()=>[...t[7]||=[j(`div`,{"i-solar:menu-dots-bold":``},null,-1)]]),_:1}),w(T(Pt),null,{default:E(()=>[w(T(Mt),{class:`will-change-[opacity,transform] z-10000 max-w-45 rounded-lg p-0.5 text-white shadow-md outline-none data-[side=bottom]:animate-slideUpAndFade data-[side=left]:animate-slideRightAndFade data-[side=right]:animate-slideLeftAndFade data-[side=top]:animate-slideDownAndFade dark:text-black`,bg:`neutral-700/50 dark:neutral-950/50`,transition:`colors duration-200 ease-in-out`,"backdrop-blur-sm":``,align:`start`,side:`bottom`,"side-offset":4},{default:E(()=>[w(T(Nt),{class:`data-[disabled]:text-mauve8 relative flex cursor-pointer select-none items-center rounded-md px-3 py-2 text-base leading-none outline-none data-[disabled]:pointer-events-none data-[highlighted]:bg-red-100/20 sm:text-sm data-[highlighted]:text-red-200`,transition:`colors duration-200 ease-in-out`},{default:E(()=>[j(`button`,{flex:``,"items-center":``,"gap-1":``,"outline-none":``,onClick:t=>u(e)},[...t[8]||=[j(`div`,{"i-solar:trash-bin-minimalistic-bold-duotone":``},null,-1),j(`div`,null,`Remove`,-1)]],8,Yn)]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024)]),j(`div`,Xn,[e.previewImage?(o(),A(`img`,{key:0,src:e.previewImage,"h-full":``,"w-full":``,"rounded-lg":``,"object-cover":``,class:C([p.value&&p.value===e.id?`ring-3 ring-primary-400`:`ring-0 ring-transparent`]),transition:`all duration-200 ease-in-out`},null,10,Zn)):(o(),A(`div`,{key:1,bg:`neutral-100 dark:neutral-900`,relative:``,"h-full":``,"w-full":``,flex:``,"flex-col":``,"items-center":``,"justify-center":``,"gap-2":``,"overflow-hidden":``,"rounded-lg":``,class:C([p.value&&p.value===e.id?`ring-3 ring-primary-400`:`ring-0 ring-transparent`]),transition:`all duration-200 ease-in-out`},[...t[9]||=[j(`div`,{"i-solar:question-square-bold-duotone":``,"text-4xl":``,"opacity-75":``},null,-1),j(`div`,{"translate-y":`100%`,absolute:``,"top-0":``,flex:``,"flex-col":``,"translate-x--7":``,"rotate-45":``,"scale-250":``,"gap-0":``,"opacity-5":``},[j(`div`,{text:`sm sm:sm`,"translate-x-7":``,"translate-y--2":``,"text-nowrap":``},` unavailable Preview unavailable Preview `),j(`div`,{text:`sm sm:sm`,"translate-x-0":``,"translate-y--0":``,"text-nowrap":``},` Preview unavailable Preview unavailable `),j(`div`,{text:`sm sm:sm`,"translate-x--7":``,"translate-y-2":``,"text-nowrap":``},` unavailable Preview unavailable Preview `)],-1)]],2))]),j(`div`,Qn,[j(`div`,$n,[w(T(Rt),{"default-value":e.name,placeholder:`Model Name...`,class:`flex gap-2`,"auto-resize":``},{default:E(({isEditing:e})=>[w(T(zt),{class:`w-[calc(100%-8px-1rem)] dark:text-white`},{default:E(()=>[w(T(Ht),{class:`line-clamp-1 w-[calc(100%-8px)] overflow-hidden text-ellipsis`}),w(T(Vt),{class:`w-[calc(100%-8px)]! placeholder:text-neutral-700 dark:placeholder:text-neutral-600`})]),_:1}),e?(o(),A(`div`,er,[w(T(Ut),null,{default:E(()=>[...t[11]||=[j(`div`,{"i-solar:check-read-line-duotone":``,"opacity-50":``},null,-1)]]),_:1})])):(o(),m(T(Bt),{key:0},{default:E(()=>[...t[10]||=[j(`div`,{"i-solar:pen-2-line-duotone":``,"opacity-50":``},null,-1)]]),_:1}))]),_:1},8,[`default-value`]),j(`div`,tr,[t[12]||=j(`div`,{"i-solar:tag-horizontal-bold":``},null,-1),j(`div`,null,f(b[e.format]),1)])]),w(T(Q),{class:`hidden md:block`,variant:`secondary`,onClick:t=>g(e)},{default:E(()=>[...t[13]||=[d(` Pick `,-1)]]),_:1},8,[`onClick`])])],8,qn)),[[r]])),128))])]),w(T(Q),{class:`block md:hidden`,onClick:t[2]||=e=>v()},{default:E(()=>[...t[14]||=[d(` Confirm `,-1)]]),_:1})])}}}),rr=e({__name:`model-selector-dialog`,props:{show:{type:Boolean,default:!1,required:!1},showModifiers:{},modelValue:{type:Object,required:!1},modelModifiers:{}},emits:[`update:show`,`update:modelValue`],setup(e){let t=O(e,`show`),n=O(e,`modelValue`),r=Je(`(min-width: 768px)`),i=Ge();return Ye(document.documentElement,()=>i.update()),h(()=>i.update()),(e,a)=>T(r)?(o(),m(T(Ie),{key:0,open:t.value,"onUpdate:open":a[2]||=e=>t.value=e},{default:E(()=>[w(T(F),{"as-child":``},{default:E(()=>[g(e.$slots,`default`)]),_:3}),w(T(We),null,{default:E(()=>[w(T(Be),{class:`fixed inset-0 z-[9999] bg-black/50 backdrop-blur-sm data-[state=closed]:animate-fadeOut data-[state=open]:animate-fadeIn`}),w(T(Pe),{class:`fixed left-1/2 top-1/2 z-[9999] max-h-full max-w-5xl w-[92dvw] transform overflow-y-scroll rounded-2xl bg-white p-6 shadow-xl outline-none backdrop-blur-md scrollbar-none -translate-x-1/2 -translate-y-1/2 data-[state=closed]:animate-contentHide data-[state=open]:animate-contentShow dark:bg-neutral-900`},{default:E(()=>[w(T(Ee),null,{default:E(()=>[w(T(He),null,{default:E(()=>[...a[6]||=[d(`Models`,-1)]]),_:1})]),_:1}),w(nr,{modelValue:n.value,"onUpdate:modelValue":a[0]||=e=>n.value=e,onClose:a[1]||=e=>t.value=!1},null,8,[`modelValue`])]),_:1})]),_:1})]),_:3},8,[`open`])):(o(),m(T(P),{key:1,open:t.value,"should-scale-background":``,"onUpdate:open":a[5]||=e=>t.value=e},{default:E(()=>[w(T(F),{"as-child":``},{default:E(()=>[g(e.$slots,`default`)]),_:3}),w(T(We),null,{default:E(()=>[w(T(V),{class:`fixed inset-0`}),w(T(U),{class:`fixed bottom-0 left-0 right-0 z-1000 mt-20 h-full max-h-[96%] flex flex-col rounded-t-2xl bg-neutral-50 px-4 pt-4 outline-none backdrop-blur-md dark:bg-neutral-900/95`,style:u({paddingBottom:`${Math.max(Number.parseFloat(T(i).bottom.value.replace(`px`,``)),24)}px`})},{default:E(()=>[w(T(z)),w(nr,{modelValue:n.value,"onUpdate:modelValue":a[3]||=e=>n.value=e,onClose:a[4]||=e=>t.value=!1},null,8,[`modelValue`])]),_:1},8,[`style`])]),_:1})]),_:3},8,[`open`]))}}),ir=e({__name:`index`,props:{palette:{},settingsClass:{},live2dSceneClass:{},vrmSceneClass:{}},emits:[`extractColorsFromModel`],setup(e){let t=e,r=M(),i=qe(),a=Qe(),{live2dDisableFocus:s,stageModelSelectedUrl:c,stageModelSelected:l,stageModelRenderer:u}=ke(a);return v(r,async()=>{if(l.value=r.value?.id,await a.updateStageModel(),r.value)switch(r.value.format){case $.Live2dZip:it().shouldUpdateView();break;case $.VRM:tt().shouldUpdateView();break}},{deep:!0}),(a,f)=>(o(),A(D,null,[j(`div`,{flex:`~ col gap-2`,"z-10":``,"overflow-y-scroll":``,"p-2":``,class:C([...t.settingsClass?typeof t.settingsClass==`string`?[t.settingsClass]:t.settingsClass:[]])},[w(G,{label:`We support both 2D and 3D models`},{default:E(()=>[...f[3]||=[j(`p`,null,[d(` Click `),j(`strong`,null,`Select Model`),d(` to import different formats of models into catalog, currently, `),j(`code`,null,`.zip`),d(` (Live2D) and `),j(`code`,null,`.vrm`),d(` (VRM) are supported. `)],-1),j(`p`,null,` Neuro-sama uses 2D model driven by Live2D Inc. developed framework. While Grok Ani (first female character announced in Grok Companion) uses 3D model that is driven by VRM / MMD open formats. `,-1)]]),_:1}),w(T(rr),{modelValue:r.value,"onUpdate:modelValue":f[0]||=e=>r.value=e},{default:E(()=>[w(T(Q),{variant:`secondary`},{default:E(()=>[...f[4]||=[d(` Select Model `,-1)]]),_:1})]),_:1},8,[`modelValue`]),T(u)===`live2d`?(o(),m(kn,{key:0,palette:e.palette,onExtractColorsFromModel:f[1]||=e=>a.$emit(`extractColorsFromModel`)},null,8,[`palette`])):n(``,!0),T(u)===`vrm`?(o(),m(Vn,{key:1,palette:e.palette,onExtractColorsFromModel:f[2]||=e=>a.$emit(`extractColorsFromModel`)},null,8,[`palette`])):n(``,!0)],2),T(u)===`live2d`?(o(),A(`div`,{key:0,class:C([...t.live2dSceneClass?typeof t.live2dSceneClass==`string`?[t.live2dSceneClass]:t.live2dSceneClass:[]])},[w(nt,{"focus-at":{x:T(i).x.value,y:T(i).y.value},"model-src":T(c),"model-id":T(l),"disable-focus-at":T(s)},null,8,[`focus-at`,`model-src`,`model-id`,`disable-focus-at`])],2)):n(``,!0),T(u)===`vrm`?(o(),A(`div`,{key:1,class:C([...t.vrmSceneClass?typeof t.vrmSceneClass==`string`?[t.vrmSceneClass]:t.vrmSceneClass:[]])},[w(T(rt),{"model-src":T(c)},null,8,[`model-src`])],2)):n(``,!0)],64))}}),ar={flex:``,class:`relative h-full flex-col-reverse md:flex-row`},or={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":``},sr=e({__name:`index`,setup(e){let t=M(),n=M([]);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=await new $e(r).getPalette();n.value=Object.values(e).map(e=>e?.hex).filter(e=>typeof e==`string`)}finally{URL.revokeObjectURL(r)}}return(e,t)=>{let i=_(`motion`);return o(),A(D,null,[j(`div`,ar,[w(T(ir),{"settings-class":`w-100% md:w-40% lg:w-40% xl:w-25% 2xl:w-30% h-fit sm:max-h-80dvh overflow-y-scroll relative`,"live-2d-scene-class":`absolute max-h-[calc(100dvh-100px-56px)] w-full h-full`,"vrm-scene-class":`absolute max-h-[calc(100dvh-100px-56px)] w-full h-full`,palette:n.value,onExtractColorsFromModel:r},null,8,[`palette`])]),k((o(),A(`div`,or,[...t[0]||=[j(`div`,{text:`60`,"i-solar:people-nearby-bold-duotone":``},null,-1)]])),[[i]])],64)}}});typeof et==`function`&&et(sr);var cr=sr;export{cr as default}; \ No newline at end of file diff --git a/assets/modules-pq5SkWez.js b/assets/modules-QYm9z3UJ.js similarity index 96% rename from assets/modules-pq5SkWez.js rename to assets/modules-QYm9z3UJ.js index 28b08b43e37c6e59b0dbb47a4636bbcb3f808d08..eeb8b81d513910e64ae8b17f54afea5c393b3c1f 100644 --- a/assets/modules-pq5SkWez.js +++ b/assets/modules-QYm9z3UJ.js @@ -1 +1 @@ -import{A as e,G as t,K as n,W as r,Z as i,b as a,k as o,kt as s,lt as c,m as l,ut as u,w as d,x as f,xt as p}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-CZ9Rvki9.js";import"./src-DYQXbDgu.js";import"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{_t as m,at as h,rt as g,st as _,tt as v,yt as y}from"./components-BR_Kqwtu.js";import{r as b,t as x}from"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import{n as S}from"./vue-i18n.runtime-Dah5zGm4.js";import"./stream-transcription-_Xuw_VzN.js";import{i as C,n as w}from"./browser-DY5K31Vk.js";import"./settings-D1kLcsvA.js";import"./__vite-browser-external-BaycPy5b.js";import{t as T}from"./route-block-CpjdOEnv.js";import{t as E}from"./use-ripple-grid-state-DcESPJAf.js";function D(){let{t:e}=S(),n=b(),i=x(),o=g(),s=v(),c=h(),l=_(),u=p(),d=a(()=>[{id:`consciousness`,name:e(`settings.pages.modules.consciousness.title`),description:e(`settings.pages.modules.consciousness.description`),icon:`i-solar:ghost-bold-duotone`,to:`/settings/modules/consciousness`,configured:n.configured,category:`essential`},{id:`speech`,name:e(`settings.pages.modules.speech.title`),description:e(`settings.pages.modules.speech.description`),icon:`i-solar:user-speak-rounded-bold-duotone`,to:`/settings/modules/speech`,configured:i.configured,category:`essential`},{id:`hearing`,name:e(`settings.pages.modules.hearing.title`),description:e(`settings.pages.modules.hearing.description`),icon:`i-solar:microphone-3-bold-duotone`,to:`/settings/modules/hearing`,configured:!1,category:`essential`},{id:`vision`,name:e(`settings.pages.modules.vision.title`),description:e(`settings.pages.modules.vision.description`),icon:`i-solar:eye-closed-bold-duotone`,to:`/settings/modules/vision`,configured:!1,category:`essential`},{id:`memory-short-term`,name:e(`settings.pages.modules.memory-short-term.title`),description:e(`settings.pages.modules.memory-short-term.description`),icon:`i-solar:bookmark-bold-duotone`,to:`/settings/modules/memory-short-term`,configured:!1,category:`essential`},{id:`memory-long-term`,name:e(`settings.pages.modules.memory-long-term.title`),description:e(`settings.pages.modules.memory-long-term.description`),icon:`i-solar:book-bookmark-bold-duotone`,to:`/settings/modules/memory-long-term`,configured:!1,category:`essential`},{id:`messaging-discord`,name:e(`settings.pages.modules.messaging-discord.title`),description:e(`settings.pages.modules.messaging-discord.description`),icon:`i-simple-icons:discord`,to:`/settings/modules/messaging-discord`,configured:o.configured,category:`messaging`},{id:`x`,name:e(`settings.pages.modules.x.title`),description:e(`settings.pages.modules.x.description`),icon:`i-simple-icons:x`,to:`/settings/modules/x`,configured:s.configured,category:`messaging`},{id:`gaming-minecraft`,name:e(`settings.pages.modules.gaming-minecraft.title`),description:e(`settings.pages.modules.gaming-minecraft.description`),iconColor:`i-vscode-icons:file-type-minecraft`,to:`/settings/modules/gaming-minecraft`,configured:c.configured,category:`gaming`},{id:`gaming-factorio`,name:e(`settings.pages.modules.gaming-factorio.title`),description:e(`settings.pages.modules.gaming-factorio.description`),to:`/settings/modules/gaming-factorio`,configured:l.configured,category:`gaming`},{id:`mcp-server`,name:e(`settings.pages.modules.mcp-server.title`),description:e(`settings.pages.modules.mcp-server.description`),icon:`i-solar:server-bold-duotone`,to:`/settings/modules/mcp`,configured:!1,category:`essential`},{id:`beat-sync`,name:e(`settings.pages.modules.beat_sync.title`),description:e(`settings.pages.modules.beat_sync.description`),icon:`i-solar:music-notes-bold-duotone`,to:`/settings/modules/beat-sync`,configured:u.value?.isActive??!1,category:`essential`}]),f=a(()=>d.value.reduce((e,t)=>{let{category:n}=t;return e[n]||(e[n]=[]),e[n].push(t),e},{})),m=a(()=>({essential:e(`settings.pages.modules.categories.essential`),messaging:e(`settings.pages.modules.categories.messaging`),gaming:e(`settings.pages.modules.categories.gaming`)}));return r(()=>{w().then(e=>u.value=e);let e=C(e=>u.value={...e});t(()=>e())}),{modulesList:d,categorizedModules:f,categoryNames:m}}var O={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":``},k=e({__name:`index`,setup(e){let{modulesList:t}=D(),{lastClickedIndex:r,setLastClickedIndex:a}=E();return(e,p)=>{let h=i(`motion`);return n(),d(l,null,[f(`div`,null,[o(s(y),{items:s(t),columns:{default:1,sm:2},"origin-index":s(r),onItemClick:p[0]||=({globalIndex:e})=>s(a)(e)},{item:c(({item:e})=>[o(s(m),{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,[`title`,`description`,`icon`,`icon-color`,`icon-image`,`to`,`configured`])]),_:1},8,[`items`,`origin-index`])]),u((n(),d(`div`,O,[...p[1]||=[f(`div`,{text:`60`,"i-solar:layers-bold-duotone":``},null,-1)]])),[[h]])],64)}}});typeof T==`function`&&T(k);var A=k;export{A as default}; \ No newline at end of file +import{A as e,G as t,K as n,W as r,Z as i,b as a,k as o,kt as s,lt as c,m as l,ut as u,w as d,x as f,xt as p}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-C0YByt49.js";import"./src-DYQXbDgu.js";import"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{_t as m,at as h,rt as g,st as _,tt as v,yt as y}from"./components-CeE-UiLT.js";import{r as b,t as x}from"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import{n as S}from"./vue-i18n.runtime-Dah5zGm4.js";import"./stream-transcription-_Xuw_VzN.js";import{i as C,n as w}from"./browser-DY5K31Vk.js";import"./settings-73vyHOZs.js";import"./__vite-browser-external-BaycPy5b.js";import{t as T}from"./route-block-CpjdOEnv.js";import{t as E}from"./use-ripple-grid-state-DcESPJAf.js";function D(){let{t:e}=S(),n=b(),i=x(),o=g(),s=v(),c=h(),l=_(),u=p(),d=a(()=>[{id:`consciousness`,name:e(`settings.pages.modules.consciousness.title`),description:e(`settings.pages.modules.consciousness.description`),icon:`i-solar:ghost-bold-duotone`,to:`/settings/modules/consciousness`,configured:n.configured,category:`essential`},{id:`speech`,name:e(`settings.pages.modules.speech.title`),description:e(`settings.pages.modules.speech.description`),icon:`i-solar:user-speak-rounded-bold-duotone`,to:`/settings/modules/speech`,configured:i.configured,category:`essential`},{id:`hearing`,name:e(`settings.pages.modules.hearing.title`),description:e(`settings.pages.modules.hearing.description`),icon:`i-solar:microphone-3-bold-duotone`,to:`/settings/modules/hearing`,configured:!1,category:`essential`},{id:`vision`,name:e(`settings.pages.modules.vision.title`),description:e(`settings.pages.modules.vision.description`),icon:`i-solar:eye-closed-bold-duotone`,to:`/settings/modules/vision`,configured:!1,category:`essential`},{id:`memory-short-term`,name:e(`settings.pages.modules.memory-short-term.title`),description:e(`settings.pages.modules.memory-short-term.description`),icon:`i-solar:bookmark-bold-duotone`,to:`/settings/modules/memory-short-term`,configured:!1,category:`essential`},{id:`memory-long-term`,name:e(`settings.pages.modules.memory-long-term.title`),description:e(`settings.pages.modules.memory-long-term.description`),icon:`i-solar:book-bookmark-bold-duotone`,to:`/settings/modules/memory-long-term`,configured:!1,category:`essential`},{id:`messaging-discord`,name:e(`settings.pages.modules.messaging-discord.title`),description:e(`settings.pages.modules.messaging-discord.description`),icon:`i-simple-icons:discord`,to:`/settings/modules/messaging-discord`,configured:o.configured,category:`messaging`},{id:`x`,name:e(`settings.pages.modules.x.title`),description:e(`settings.pages.modules.x.description`),icon:`i-simple-icons:x`,to:`/settings/modules/x`,configured:s.configured,category:`messaging`},{id:`gaming-minecraft`,name:e(`settings.pages.modules.gaming-minecraft.title`),description:e(`settings.pages.modules.gaming-minecraft.description`),iconColor:`i-vscode-icons:file-type-minecraft`,to:`/settings/modules/gaming-minecraft`,configured:c.configured,category:`gaming`},{id:`gaming-factorio`,name:e(`settings.pages.modules.gaming-factorio.title`),description:e(`settings.pages.modules.gaming-factorio.description`),to:`/settings/modules/gaming-factorio`,configured:l.configured,category:`gaming`},{id:`mcp-server`,name:e(`settings.pages.modules.mcp-server.title`),description:e(`settings.pages.modules.mcp-server.description`),icon:`i-solar:server-bold-duotone`,to:`/settings/modules/mcp`,configured:!1,category:`essential`},{id:`beat-sync`,name:e(`settings.pages.modules.beat_sync.title`),description:e(`settings.pages.modules.beat_sync.description`),icon:`i-solar:music-notes-bold-duotone`,to:`/settings/modules/beat-sync`,configured:u.value?.isActive??!1,category:`essential`}]),f=a(()=>d.value.reduce((e,t)=>{let{category:n}=t;return e[n]||(e[n]=[]),e[n].push(t),e},{})),m=a(()=>({essential:e(`settings.pages.modules.categories.essential`),messaging:e(`settings.pages.modules.categories.messaging`),gaming:e(`settings.pages.modules.categories.gaming`)}));return r(()=>{w().then(e=>u.value=e);let e=C(e=>u.value={...e});t(()=>e())}),{modulesList:d,categorizedModules:f,categoryNames:m}}var O={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":``},k=e({__name:`index`,setup(e){let{modulesList:t}=D(),{lastClickedIndex:r,setLastClickedIndex:a}=E();return(e,p)=>{let h=i(`motion`);return n(),d(l,null,[f(`div`,null,[o(s(y),{items:s(t),columns:{default:1,sm:2},"origin-index":s(r),onItemClick:p[0]||=({globalIndex:e})=>s(a)(e)},{item:c(({item:e})=>[o(s(m),{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,[`title`,`description`,`icon`,`icon-color`,`icon-image`,`to`,`configured`])]),_:1},8,[`items`,`origin-index`])]),u((n(),d(`div`,O,[...p[1]||=[f(`div`,{text:`60`,"i-solar:layers-bold-duotone":``},null,-1)]])),[[h]])],64)}}});typeof T==`function`&&T(k);var A=k;export{A as default}; \ No newline at end of file diff --git a/assets/ollama-B5mymzO5.js b/assets/ollama-CMuzyH-X.js similarity index 95% rename from assets/ollama-B5mymzO5.js rename to assets/ollama-CMuzyH-X.js index bdd28c87eea0416b83af82e99aba81f69c05da0f..b7b1112a655fe2f1aea04cb2221460d029b71762 100644 --- a/assets/ollama-B5mymzO5.js +++ b/assets/ollama-CMuzyH-X.js @@ -1 +1 @@ -import{A as e,C as t,E as n,K as r,O as i,Pt as a,S as o,W as s,at as c,b as l,k as u,kt as d,lt as f,x as p,xt as m}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-CZ9Rvki9.js";import{u as h}from"./src-DYQXbDgu.js";import{a as g}from"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{G as _,J as v,K as y,U as b,W as x,gt as S}from"./components-BR_Kqwtu.js";import{i as C}from"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-D1kLcsvA.js";import"./__vite-browser-external-BaycPy5b.js";import{t as w}from"./route-block-CpjdOEnv.js";import{t as T}from"./use-provider-validation-DbXr83wX.js";var E={class:`whitespace-pre-wrap break-all`},D=`ollama`,O=e({__name:`ollama`,setup(e){let w=C(),{providers:O}=g(w),k=l({get:()=>O.value[D]?.baseUrl||`http://localhost:11434/v1/`,set:e=>{O.value[D]||(O.value[D]={}),O.value[D].baseUrl=e}}),{t:A,router:j,providerMetadata:M,isValidating:N,isValid:P,validationMessage:F,handleResetSettings:I}=T(D),L=m(Object.entries(O.value[D]?.headers||{}).map(([e,t])=>({key:e,value:t}))||[{key:``,value:``}]);function R(e,t,n){e&&e.push({key:t,value:n})}function z(e,t){t&&(t.length===1?(t[0].key=``,t[0].value=``):t.splice(e,1))}c(L,e=>{e.length>0&&(e[e.length-1].key!==``||e[e.length-1].value!==``)&&e.push({key:``,value:``}),O.value[D].headers=e.filter(e=>e.key!==``).reduce((e,t)=>(e[t.key]=t.value,e),{})},{deep:!0,immediate:!0});async function B(){try{let e=await M.value.validators.validateProviderConfig({baseUrl:k.value,headers:L.value.filter(e=>e.key!==``).reduce((e,t)=>(e[t.key]=t.value,e),{})});e.valid||(F.value=A(`settings.dialogs.onboarding.validationError`,{error:e.reason}))}catch(e){F.value=A(`settings.dialogs.onboarding.validationError`,{error:e instanceof Error?e.message:String(e)})}}return c([k,L],B,{immediate:!0}),c(L,B,{deep:!0}),s(()=>{w.initializeProvider(D),k.value=O.value[D]?.baseUrl||M.value?.defaultOptions?.().baseUrl||``,O.value[D]?.headers||(O.value[D].headers={}),L.value.length===0&&(L.value=[{key:``,value:``}])}),(e,s)=>(r(),o(d(b),{"provider-name":d(M)?.localizedName,"provider-icon-color":d(M)?.iconColor,"on-back":()=>d(j).back()},{default:f(()=>[u(d(x),null,{default:f(()=>[u(d(_),{title:d(A)(`settings.pages.providers.common.section.basic.title`),description:d(A)(`settings.pages.providers.common.section.basic.description`),"on-reset":d(I)},{default:f(()=>[u(d(y),{modelValue:k.value,"onUpdate:modelValue":s[0]||=e=>k.value=e,placeholder:`http://localhost:11434/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`,`description`,`on-reset`]),u(d(v),{title:d(A)(`settings.pages.providers.common.section.advanced.title`)},{default:f(()=>[u(d(h),{modelValue:L.value,"onUpdate:modelValue":s[1]||=e=>L.value=e,label:d(A)(`settings.pages.providers.common.section.advanced.fields.field.headers.label`),description:d(A)(`settings.pages.providers.common.section.advanced.fields.field.headers.description`),"key-placeholder":d(A)(`settings.pages.providers.common.section.advanced.fields.field.headers.key.placeholder`),"value-placeholder":d(A)(`settings.pages.providers.common.section.advanced.fields.field.headers.value.placeholder`),onAdd:s[2]||=(e,t)=>R(L.value,e,t),onRemove:s[3]||=e=>z(e,L.value)},null,8,[`modelValue`,`label`,`description`,`key-placeholder`,`value-placeholder`])]),_:1},8,[`title`]),!d(P)&&d(N)===0&&d(F)?(r(),o(d(S),{key:0,type:`error`},n({title:f(()=>[i(a(d(A)(`settings.dialogs.onboarding.validationFailed`)),1)]),_:2},[d(F)?{name:`content`,fn:f(()=>[p(`div`,E,a(d(F)),1)]),key:`0`}:void 0]),1024)):t(``,!0),d(P)&&d(N)===0?(r(),o(d(S),{key:1,type:`success`},{title:f(()=>[i(a(d(A)(`settings.dialogs.onboarding.validationSuccess`)),1)]),_:1})):t(``,!0)]),_:1})]),_:1},8,[`provider-name`,`provider-icon-color`,`on-back`]))}});typeof w==`function`&&w(O);var k=O;export{k as default}; \ No newline at end of file +import{A as e,C as t,E as n,K as r,O as i,Pt as a,S as o,W as s,at as c,b as l,k as u,kt as d,lt as f,x as p,xt as m}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-C0YByt49.js";import{u as h}from"./src-DYQXbDgu.js";import{a as g}from"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{G as _,J as v,K as y,U as b,W as x,gt as S}from"./components-CeE-UiLT.js";import{i as C}from"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-73vyHOZs.js";import"./__vite-browser-external-BaycPy5b.js";import{t as w}from"./route-block-CpjdOEnv.js";import{t as T}from"./use-provider-validation-DbXr83wX.js";var E={class:`whitespace-pre-wrap break-all`},D=`ollama`,O=e({__name:`ollama`,setup(e){let w=C(),{providers:O}=g(w),k=l({get:()=>O.value[D]?.baseUrl||`http://localhost:11434/v1/`,set:e=>{O.value[D]||(O.value[D]={}),O.value[D].baseUrl=e}}),{t:A,router:j,providerMetadata:M,isValidating:N,isValid:P,validationMessage:F,handleResetSettings:I}=T(D),L=m(Object.entries(O.value[D]?.headers||{}).map(([e,t])=>({key:e,value:t}))||[{key:``,value:``}]);function R(e,t,n){e&&e.push({key:t,value:n})}function z(e,t){t&&(t.length===1?(t[0].key=``,t[0].value=``):t.splice(e,1))}c(L,e=>{e.length>0&&(e[e.length-1].key!==``||e[e.length-1].value!==``)&&e.push({key:``,value:``}),O.value[D].headers=e.filter(e=>e.key!==``).reduce((e,t)=>(e[t.key]=t.value,e),{})},{deep:!0,immediate:!0});async function B(){try{let e=await M.value.validators.validateProviderConfig({baseUrl:k.value,headers:L.value.filter(e=>e.key!==``).reduce((e,t)=>(e[t.key]=t.value,e),{})});e.valid||(F.value=A(`settings.dialogs.onboarding.validationError`,{error:e.reason}))}catch(e){F.value=A(`settings.dialogs.onboarding.validationError`,{error:e instanceof Error?e.message:String(e)})}}return c([k,L],B,{immediate:!0}),c(L,B,{deep:!0}),s(()=>{w.initializeProvider(D),k.value=O.value[D]?.baseUrl||M.value?.defaultOptions?.().baseUrl||``,O.value[D]?.headers||(O.value[D].headers={}),L.value.length===0&&(L.value=[{key:``,value:``}])}),(e,s)=>(r(),o(d(b),{"provider-name":d(M)?.localizedName,"provider-icon-color":d(M)?.iconColor,"on-back":()=>d(j).back()},{default:f(()=>[u(d(x),null,{default:f(()=>[u(d(_),{title:d(A)(`settings.pages.providers.common.section.basic.title`),description:d(A)(`settings.pages.providers.common.section.basic.description`),"on-reset":d(I)},{default:f(()=>[u(d(y),{modelValue:k.value,"onUpdate:modelValue":s[0]||=e=>k.value=e,placeholder:`http://localhost:11434/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`,`description`,`on-reset`]),u(d(v),{title:d(A)(`settings.pages.providers.common.section.advanced.title`)},{default:f(()=>[u(d(h),{modelValue:L.value,"onUpdate:modelValue":s[1]||=e=>L.value=e,label:d(A)(`settings.pages.providers.common.section.advanced.fields.field.headers.label`),description:d(A)(`settings.pages.providers.common.section.advanced.fields.field.headers.description`),"key-placeholder":d(A)(`settings.pages.providers.common.section.advanced.fields.field.headers.key.placeholder`),"value-placeholder":d(A)(`settings.pages.providers.common.section.advanced.fields.field.headers.value.placeholder`),onAdd:s[2]||=(e,t)=>R(L.value,e,t),onRemove:s[3]||=e=>z(e,L.value)},null,8,[`modelValue`,`label`,`description`,`key-placeholder`,`value-placeholder`])]),_:1},8,[`title`]),!d(P)&&d(N)===0&&d(F)?(r(),o(d(S),{key:0,type:`error`},n({title:f(()=>[i(a(d(A)(`settings.dialogs.onboarding.validationFailed`)),1)]),_:2},[d(F)?{name:`content`,fn:f(()=>[p(`div`,E,a(d(F)),1)]),key:`0`}:void 0]),1024)):t(``,!0),d(P)&&d(N)===0?(r(),o(d(S),{key:1,type:`success`},{title:f(()=>[i(a(d(A)(`settings.dialogs.onboarding.validationSuccess`)),1)]),_:1})):t(``,!0)]),_:1})]),_:1},8,[`provider-name`,`provider-icon-color`,`on-back`]))}});typeof w==`function`&&w(O);var k=O;export{k as default}; \ No newline at end of file diff --git a/assets/openai-audio-speech-CK11JEyg.js b/assets/openai-audio-speech-BC1Afz1l.js similarity index 89% rename from assets/openai-audio-speech-CK11JEyg.js rename to assets/openai-audio-speech-BC1Afz1l.js index 3a8827724944a3a3be494c91c7dedc55398cb8f4..06d8394eda7ec52c564802c4d9d6ea0d6aad7881 100644 --- a/assets/openai-audio-speech-CK11JEyg.js +++ b/assets/openai-audio-speech-BC1Afz1l.js @@ -1 +1 @@ -import{A as e,K as t,S as n,at as r,b as i,k as a,kt as o,lt as s,xt as c}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-CZ9Rvki9.js";import{l}from"./src-DYQXbDgu.js";import{a as u}from"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{c as d,u as f}from"./components-BR_Kqwtu.js";import{i as p,t as m}from"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import{n as h}from"./vue-i18n.runtime-Dah5zGm4.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-D1kLcsvA.js";import"./__vite-browser-external-BaycPy5b.js";import{t as g}from"./route-block-CpjdOEnv.js";var _=`openai-audio-speech`,v=`gpt-4o-mini-tts`,y=e({__name:`openai-audio-speech`,setup(e){let g=m(),y=p(),{providers:b}=u(y),{t:x}=h(),S={speed:1},C=c(1),w=i(()=>!!b.value[_]?.apiKey),T=i(()=>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 r(C,async()=>{let e=y.getProviderConfig(_);e.speed=C.value}),(e,r)=>(t(),n(o(d),{"provider-id":_,"default-model":v,"additional-settings":S},{"voice-settings":s(()=>[a(o(l),{modelValue:C.value,"onUpdate:modelValue":r[0]||=e=>C.value=e,label:o(x)(`settings.pages.providers.provider.common.fields.field.speed.label`),description:o(x)(`settings.pages.providers.provider.common.fields.field.speed.description`),min:.5,max:2,step:.01},null,8,[`modelValue`,`label`,`description`])]),playground:s(()=>[a(o(f),{"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 +import{A as e,K as t,S as n,at as r,b as i,k as a,kt as o,lt as s,xt as c}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-C0YByt49.js";import{l}from"./src-DYQXbDgu.js";import{a as u}from"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{c as d,u as f}from"./components-CeE-UiLT.js";import{i as p,t as m}from"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import{n as h}from"./vue-i18n.runtime-Dah5zGm4.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-73vyHOZs.js";import"./__vite-browser-external-BaycPy5b.js";import{t as g}from"./route-block-CpjdOEnv.js";var _=`openai-audio-speech`,v=`gpt-4o-mini-tts`,y=e({__name:`openai-audio-speech`,setup(e){let g=m(),y=p(),{providers:b}=u(y),{t:x}=h(),S={speed:1},C=c(1),w=i(()=>!!b.value[_]?.apiKey),T=i(()=>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 r(C,async()=>{let e=y.getProviderConfig(_);e.speed=C.value}),(e,r)=>(t(),n(o(d),{"provider-id":_,"default-model":v,"additional-settings":S},{"voice-settings":s(()=>[a(o(l),{modelValue:C.value,"onUpdate:modelValue":r[0]||=e=>C.value=e,label:o(x)(`settings.pages.providers.provider.common.fields.field.speed.label`),description:o(x)(`settings.pages.providers.provider.common.fields.field.speed.description`),min:.5,max:2,step:.01},null,8,[`modelValue`,`label`,`description`])]),playground:s(()=>[a(o(f),{"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-C9jVbePt.js b/assets/openai-audio-transcription-DPdPA8Wy.js similarity index 84% rename from assets/openai-audio-transcription-C9jVbePt.js rename to assets/openai-audio-transcription-DPdPA8Wy.js index ca42d6fb916f6769f0dc5966d00b89ec22411a8a..fc08d71b24e50b470ee41963512ab1c7abc4422b 100644 --- a/assets/openai-audio-transcription-C9jVbePt.js +++ b/assets/openai-audio-transcription-DPdPA8Wy.js @@ -1 +1 @@ -import{A as e,K as t,S as n,b as r,k as i,kt as a,lt as o}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-CZ9Rvki9.js";import"./src-DYQXbDgu.js";import{a as s}from"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{a as c,i as l}from"./components-BR_Kqwtu.js";import{i as u}from"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-D1kLcsvA.js";import"./__vite-browser-external-BaycPy5b.js";import{n as d}from"./hearing-BH9rth_f.js";import{t as f}from"./route-block-CpjdOEnv.js";var p=`openai-audio-transcription`,m=`whisper-1`,h=e({__name:`openai-audio-transcription`,setup(e){let f=d(),h=u(),{providers:g}=s(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).model||m;return await f.transcription(p,t,n,e,`json`)}return(e,r)=>(t(),n(a(l),{"provider-id":p,"default-model":m},{playground:o(()=>[i(a(c),{"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{A as e,K as t,S as n,b as r,k as i,kt as a,lt as o}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-C0YByt49.js";import"./src-DYQXbDgu.js";import{a as s}from"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{a as c,i as l}from"./components-CeE-UiLT.js";import{i as u}from"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-73vyHOZs.js";import"./__vite-browser-external-BaycPy5b.js";import{n as d}from"./hearing-BH9rth_f.js";import{t as f}from"./route-block-CpjdOEnv.js";var p=`openai-audio-transcription`,m=`whisper-1`,h=e({__name:`openai-audio-transcription`,setup(e){let f=d(),h=u(),{providers:g}=s(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).model||m;return await f.transcription(p,t,n,e,`json`)}return(e,r)=>(t(),n(a(l),{"provider-id":p,"default-model":m},{playground:o(()=>[i(a(c),{"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-compatible-audio-speech-Dg21-D2M.js b/assets/openai-compatible-audio-speech-DSAFQ68v.js similarity index 94% rename from assets/openai-compatible-audio-speech-Dg21-D2M.js rename to assets/openai-compatible-audio-speech-DSAFQ68v.js index 416441c7bca43cb7231b07e9d78a7266ff20db52..9d9438dbe6ef4486e76e4afb26459faf5b79b18e 100644 --- a/assets/openai-compatible-audio-speech-Dg21-D2M.js +++ b/assets/openai-compatible-audio-speech-DSAFQ68v.js @@ -1 +1 @@ -import{A as e,C as t,E as n,K as r,O as i,Pt as a,S as o,b as s,k as c,kt as l,lt as u,x as d,xt as f}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-CZ9Rvki9.js";import{l as p}from"./src-DYQXbDgu.js";import{a as m}from"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{G as h,J as g,K as _,U as v,W as y,gt as b,l as x,q as S}from"./components-BR_Kqwtu.js";import{i as C,t as w}from"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-D1kLcsvA.js";import"./__vite-browser-external-BaycPy5b.js";import{t as T}from"./route-block-CpjdOEnv.js";import{t as E}from"./use-provider-validation-DbXr83wX.js";var D={class:`whitespace-pre-wrap break-all`},O=`openai-compatible-audio-speech`,k=e({__name:`openai-compatible-audio-speech`,setup(e){let T=w(),k=C(),{providers:A}=m(k),j={speed:1},M=s({get:()=>A.value[O]?.apiKey||``,set:e=>{A.value[O]&&(A.value[O].apiKey=e)}}),N=s({get:()=>A.value[O]?.baseUrl||``,set:e=>{A.value[O]&&(A.value[O].baseUrl=e)}}),P=s({get:()=>A.value[O]?.model||`tts-1`,set:e=>{A.value[O]&&(A.value[O].model=e)}}),F=s({get:()=>A.value[O]?.voice||`alloy`,set:e=>{A.value[O]&&(A.value[O].voice=e)}}),I=f(1),L=s(()=>!!A.value[O]?.apiKey);async function R(e,t,n,r){let i=await k.getProviderInstance(O);if(!i)throw Error(`Failed to initialize speech provider`);let a=k.getProviderConfig(O);return await T.speech(i,r||P.value,e,t||F.value,{...a,...j,speed:I.value})}let{t:z,router:B,providerMetadata:V,isValidating:H,isValid:U,validationMessage:W,handleResetSettings:G}=E(O);return(e,s)=>(r(),o(l(v),{"provider-name":l(V)?.localizedName,"provider-icon-color":l(V)?.iconColor,"on-back":()=>l(B).back()},{default:u(()=>[c(l(y),null,{default:u(()=>[c(l(h),{title:l(z)(`settings.pages.providers.common.section.basic.title`),description:l(z)(`settings.pages.providers.common.section.basic.description`),"on-reset":l(G)},{default:u(()=>[c(l(S),{modelValue:M.value,"onUpdate:modelValue":s[0]||=e=>M.value=e,required:!1,"provider-name":l(V)?.localizedName,placeholder:`sk-...`},null,8,[`modelValue`,`provider-name`])]),_:1},8,[`title`,`description`,`on-reset`]),c(l(g),{title:l(z)(`settings.pages.providers.common.section.advanced.title`)},{default:u(()=>[c(l(_),{modelValue:N.value,"onUpdate:modelValue":s[1]||=e=>N.value=e,placeholder:`https://api.openai.com/v1/`},null,8,[`modelValue`]),c(l(p),{modelValue:I.value,"onUpdate:modelValue":s[2]||=e=>I.value=e,label:l(z)(`settings.pages.providers.provider.common.fields.field.speed.label`),description:l(z)(`settings.pages.providers.provider.common.fields.field.speed.description`),min:.5,max:2,step:.01},null,8,[`modelValue`,`label`,`description`])]),_:1},8,[`title`]),!l(U)&&l(H)===0&&l(W)?(r(),o(l(b),{key:0,type:`error`},n({title:u(()=>[i(a(l(z)(`settings.dialogs.onboarding.validationFailed`)),1)]),_:2},[l(W)?{name:`content`,fn:u(()=>[d(`div`,D,a(l(W)),1)]),key:`0`}:void 0]),1024)):t(``,!0),l(U)&&l(H)===0?(r(),o(l(b),{key:1,type:`success`},{title:u(()=>[i(a(l(z)(`settings.dialogs.onboarding.validationSuccess`)),1)]),_:1})):t(``,!0)]),_:1}),c(l(x),{"model-value":P.value,"onUpdate:modelValue":s[3]||=e=>P.value=e,voice:F.value,"onUpdate:voice":s[4]||=e=>F.value=e,"generate-speech":R,"api-key-configured":L.value,"default-text":`Hello! This is a test of the OpenAI Compatible Speech.`},null,8,[`model-value`,`voice`,`api-key-configured`])]),_:1},8,[`provider-name`,`provider-icon-color`,`on-back`]))}});typeof T==`function`&&T(k);var A=k;export{A as default}; \ No newline at end of file +import{A as e,C as t,E as n,K as r,O as i,Pt as a,S as o,b as s,k as c,kt as l,lt as u,x as d,xt as f}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-C0YByt49.js";import{l as p}from"./src-DYQXbDgu.js";import{a as m}from"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{G as h,J as g,K as _,U as v,W as y,gt as b,l as x,q as S}from"./components-CeE-UiLT.js";import{i as C,t as w}from"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-73vyHOZs.js";import"./__vite-browser-external-BaycPy5b.js";import{t as T}from"./route-block-CpjdOEnv.js";import{t as E}from"./use-provider-validation-DbXr83wX.js";var D={class:`whitespace-pre-wrap break-all`},O=`openai-compatible-audio-speech`,k=e({__name:`openai-compatible-audio-speech`,setup(e){let T=w(),k=C(),{providers:A}=m(k),j={speed:1},M=s({get:()=>A.value[O]?.apiKey||``,set:e=>{A.value[O]&&(A.value[O].apiKey=e)}}),N=s({get:()=>A.value[O]?.baseUrl||``,set:e=>{A.value[O]&&(A.value[O].baseUrl=e)}}),P=s({get:()=>A.value[O]?.model||`tts-1`,set:e=>{A.value[O]&&(A.value[O].model=e)}}),F=s({get:()=>A.value[O]?.voice||`alloy`,set:e=>{A.value[O]&&(A.value[O].voice=e)}}),I=f(1),L=s(()=>!!A.value[O]?.apiKey);async function R(e,t,n,r){let i=await k.getProviderInstance(O);if(!i)throw Error(`Failed to initialize speech provider`);let a=k.getProviderConfig(O);return await T.speech(i,r||P.value,e,t||F.value,{...a,...j,speed:I.value})}let{t:z,router:B,providerMetadata:V,isValidating:H,isValid:U,validationMessage:W,handleResetSettings:G}=E(O);return(e,s)=>(r(),o(l(v),{"provider-name":l(V)?.localizedName,"provider-icon-color":l(V)?.iconColor,"on-back":()=>l(B).back()},{default:u(()=>[c(l(y),null,{default:u(()=>[c(l(h),{title:l(z)(`settings.pages.providers.common.section.basic.title`),description:l(z)(`settings.pages.providers.common.section.basic.description`),"on-reset":l(G)},{default:u(()=>[c(l(S),{modelValue:M.value,"onUpdate:modelValue":s[0]||=e=>M.value=e,required:!1,"provider-name":l(V)?.localizedName,placeholder:`sk-...`},null,8,[`modelValue`,`provider-name`])]),_:1},8,[`title`,`description`,`on-reset`]),c(l(g),{title:l(z)(`settings.pages.providers.common.section.advanced.title`)},{default:u(()=>[c(l(_),{modelValue:N.value,"onUpdate:modelValue":s[1]||=e=>N.value=e,placeholder:`https://api.openai.com/v1/`},null,8,[`modelValue`]),c(l(p),{modelValue:I.value,"onUpdate:modelValue":s[2]||=e=>I.value=e,label:l(z)(`settings.pages.providers.provider.common.fields.field.speed.label`),description:l(z)(`settings.pages.providers.provider.common.fields.field.speed.description`),min:.5,max:2,step:.01},null,8,[`modelValue`,`label`,`description`])]),_:1},8,[`title`]),!l(U)&&l(H)===0&&l(W)?(r(),o(l(b),{key:0,type:`error`},n({title:u(()=>[i(a(l(z)(`settings.dialogs.onboarding.validationFailed`)),1)]),_:2},[l(W)?{name:`content`,fn:u(()=>[d(`div`,D,a(l(W)),1)]),key:`0`}:void 0]),1024)):t(``,!0),l(U)&&l(H)===0?(r(),o(l(b),{key:1,type:`success`},{title:u(()=>[i(a(l(z)(`settings.dialogs.onboarding.validationSuccess`)),1)]),_:1})):t(``,!0)]),_:1}),c(l(x),{"model-value":P.value,"onUpdate:modelValue":s[3]||=e=>P.value=e,voice:F.value,"onUpdate:voice":s[4]||=e=>F.value=e,"generate-speech":R,"api-key-configured":L.value,"default-text":`Hello! This is a test of the OpenAI Compatible Speech.`},null,8,[`model-value`,`voice`,`api-key-configured`])]),_:1},8,[`provider-name`,`provider-icon-color`,`on-back`]))}});typeof T==`function`&&T(k);var A=k;export{A as default}; \ No newline at end of file diff --git a/assets/openai-compatible-audio-transcription-DQYIeBVK.js b/assets/openai-compatible-audio-transcription-Dr6AdUfM.js similarity index 94% rename from assets/openai-compatible-audio-transcription-DQYIeBVK.js rename to assets/openai-compatible-audio-transcription-Dr6AdUfM.js index d2e33fef467726fb5ea6ff3859fda10d85ff3a75..759489607e2de9512cc0edd6b0881933ce5ec874 100644 --- a/assets/openai-compatible-audio-transcription-DQYIeBVK.js +++ b/assets/openai-compatible-audio-transcription-Dr6AdUfM.js @@ -1 +1 @@ -import{A as e,C as t,E as n,K as r,O as i,Pt as a,S as o,b as s,k as c,kt as l,lt as u,x as d}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-CZ9Rvki9.js";import{d as f}from"./src-DYQXbDgu.js";import{a as p}from"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{G as m,J as h,K as g,U as _,W as v,a as y,gt as b,q as x}from"./components-BR_Kqwtu.js";import{i as S}from"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-D1kLcsvA.js";import"./__vite-browser-external-BaycPy5b.js";import{n as C}from"./hearing-BH9rth_f.js";import{t as w}from"./route-block-CpjdOEnv.js";import{t as T}from"./use-provider-validation-DbXr83wX.js";var E={class:`whitespace-pre-wrap break-all`},D=`openai-compatible-audio-transcription`,O=e({__name:`openai-compatible-audio-transcription`,setup(e){let w=C(),O=S(),{providers:k}=p(O),A=s({get:()=>k.value[D]?.apiKey||``,set:e=>{k.value[D]||(k.value[D]={}),k.value[D].apiKey=e}}),j=s({get:()=>k.value[D]?.baseUrl||``,set:e=>{k.value[D]||(k.value[D]={}),k.value[D].baseUrl=e}}),M=s({get:()=>k.value[D]?.model||``,set:e=>{k.value[D]||(k.value[D]={}),k.value[D].model=e}}),N=s(()=>!!k.value[D]?.apiKey);async function P(e){let t=await O.getProviderInstance(D);if(!t)throw Error(`Failed to initialize transcription provider`);return await w.transcription(D,t,M.value,e,`json`)}let{t:F,router:I,providerMetadata:L,isValidating:R,isValid:z,validationMessage:B,handleResetSettings:V}=T(D);return(e,s)=>(r(),o(l(_),{"provider-name":l(L)?.localizedName,"provider-icon-color":l(L)?.iconColor,"on-back":()=>l(I).back()},{default:u(()=>[c(l(v),null,{default:u(()=>[c(l(m),{title:l(F)(`settings.pages.providers.common.section.basic.title`),description:l(F)(`settings.pages.providers.common.section.basic.description`),"on-reset":l(V)},{default:u(()=>[c(l(x),{modelValue:A.value,"onUpdate:modelValue":s[0]||=e=>A.value=e,"provider-name":l(L)?.localizedName,placeholder:`sk-...`},null,8,[`modelValue`,`provider-name`]),c(l(f),{modelValue:M.value,"onUpdate:modelValue":s[1]||=e=>M.value=e,label:l(F)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.manual_model_name`),placeholder:l(F)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.manual_model_placeholder`)},null,8,[`modelValue`,`label`,`placeholder`])]),_:1},8,[`title`,`description`,`on-reset`]),c(l(h),{title:l(F)(`settings.pages.providers.common.section.advanced.title`)},{default:u(()=>[c(l(g),{modelValue:j.value,"onUpdate:modelValue":s[2]||=e=>j.value=e,placeholder:`https://api.openai.com/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`]),!l(z)&&l(R)===0&&l(B)?(r(),o(l(b),{key:0,type:`error`},n({title:u(()=>[i(a(l(F)(`settings.dialogs.onboarding.validationFailed`)),1)]),_:2},[l(B)?{name:`content`,fn:u(()=>[d(`div`,E,a(l(B)),1)]),key:`0`}:void 0]),1024)):t(``,!0),l(z)&&l(R)===0?(r(),o(l(b),{key:1,type:`success`},{title:u(()=>[i(a(l(F)(`settings.dialogs.onboarding.validationSuccess`)),1)]),_:1})):t(``,!0)]),_:1}),c(l(y),{"generate-transcription":P,"api-key-configured":N.value},null,8,[`api-key-configured`])]),_:1},8,[`provider-name`,`provider-icon-color`,`on-back`]))}});typeof w==`function`&&w(O);var k=O;export{k as default}; \ No newline at end of file +import{A as e,C as t,E as n,K as r,O as i,Pt as a,S as o,b as s,k as c,kt as l,lt as u,x as d}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-C0YByt49.js";import{d as f}from"./src-DYQXbDgu.js";import{a as p}from"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{G as m,J as h,K as g,U as _,W as v,a as y,gt as b,q as x}from"./components-CeE-UiLT.js";import{i as S}from"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-73vyHOZs.js";import"./__vite-browser-external-BaycPy5b.js";import{n as C}from"./hearing-BH9rth_f.js";import{t as w}from"./route-block-CpjdOEnv.js";import{t as T}from"./use-provider-validation-DbXr83wX.js";var E={class:`whitespace-pre-wrap break-all`},D=`openai-compatible-audio-transcription`,O=e({__name:`openai-compatible-audio-transcription`,setup(e){let w=C(),O=S(),{providers:k}=p(O),A=s({get:()=>k.value[D]?.apiKey||``,set:e=>{k.value[D]||(k.value[D]={}),k.value[D].apiKey=e}}),j=s({get:()=>k.value[D]?.baseUrl||``,set:e=>{k.value[D]||(k.value[D]={}),k.value[D].baseUrl=e}}),M=s({get:()=>k.value[D]?.model||``,set:e=>{k.value[D]||(k.value[D]={}),k.value[D].model=e}}),N=s(()=>!!k.value[D]?.apiKey);async function P(e){let t=await O.getProviderInstance(D);if(!t)throw Error(`Failed to initialize transcription provider`);return await w.transcription(D,t,M.value,e,`json`)}let{t:F,router:I,providerMetadata:L,isValidating:R,isValid:z,validationMessage:B,handleResetSettings:V}=T(D);return(e,s)=>(r(),o(l(_),{"provider-name":l(L)?.localizedName,"provider-icon-color":l(L)?.iconColor,"on-back":()=>l(I).back()},{default:u(()=>[c(l(v),null,{default:u(()=>[c(l(m),{title:l(F)(`settings.pages.providers.common.section.basic.title`),description:l(F)(`settings.pages.providers.common.section.basic.description`),"on-reset":l(V)},{default:u(()=>[c(l(x),{modelValue:A.value,"onUpdate:modelValue":s[0]||=e=>A.value=e,"provider-name":l(L)?.localizedName,placeholder:`sk-...`},null,8,[`modelValue`,`provider-name`]),c(l(f),{modelValue:M.value,"onUpdate:modelValue":s[1]||=e=>M.value=e,label:l(F)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.manual_model_name`),placeholder:l(F)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.manual_model_placeholder`)},null,8,[`modelValue`,`label`,`placeholder`])]),_:1},8,[`title`,`description`,`on-reset`]),c(l(h),{title:l(F)(`settings.pages.providers.common.section.advanced.title`)},{default:u(()=>[c(l(g),{modelValue:j.value,"onUpdate:modelValue":s[2]||=e=>j.value=e,placeholder:`https://api.openai.com/v1/`},null,8,[`modelValue`])]),_:1},8,[`title`]),!l(z)&&l(R)===0&&l(B)?(r(),o(l(b),{key:0,type:`error`},n({title:u(()=>[i(a(l(F)(`settings.dialogs.onboarding.validationFailed`)),1)]),_:2},[l(B)?{name:`content`,fn:u(()=>[d(`div`,E,a(l(B)),1)]),key:`0`}:void 0]),1024)):t(``,!0),l(z)&&l(R)===0?(r(),o(l(b),{key:1,type:`success`},{title:u(()=>[i(a(l(F)(`settings.dialogs.onboarding.validationSuccess`)),1)]),_:1})):t(``,!0)]),_:1}),c(l(y),{"generate-transcription":P,"api-key-configured":N.value},null,8,[`api-key-configured`])]),_:1},8,[`provider-name`,`provider-icon-color`,`on-back`]))}});typeof w==`function`&&w(O);var k=O;export{k as default}; \ No newline at end of file diff --git a/assets/pages-JQnTlB9Y.js b/assets/pages-DZRbeQEX.js similarity index 98% rename from assets/pages-JQnTlB9Y.js rename to assets/pages-DZRbeQEX.js index 6c06d4a5ab98fb66d6fcf0760f35830aa51a341c..5679a698e71395a9a89149093c0b4446cbc517d9 100644 --- a/assets/pages-JQnTlB9Y.js +++ b/assets/pages-DZRbeQEX.js @@ -1,3 +1,3 @@ -import{A as e,C as t,G as n,J as r,K as i,Nt as a,O as o,Pt as s,R as c,S as l,W as u,Y as d,at as f,b as p,gt as m,h,it as g,jt as _,k as v,kt as y,lt as b,m as x,n as S,nt as C,w,x as T,xt as E}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./tres-B5z5lcdF.js";import{_ as D,g as O,v as k,y as A}from"./widgets-CZ9Rvki9.js";import{a as j,c as M,n as N,r as P,t as F}from"./src-DYQXbDgu.js";import{a as I}from"./resettable-CbXzRviW.js";import{t as L}from"./vue-router-Chhv6vZu.js";import"./environment-CyZLTg97.js";import{t as R}from"./_plugin-vue_export-helper-DGA9ry_j.js";import{t as z}from"./Basic-EclD3L6X.js";import{b as B,h as V,i as H,t as U,y as ee}from"./dist-Che88T83.js";import"./src-C83SCWbW.js";import{Q as te,X as W,Z as G,o as K,s as ne}from"./components-BR_Kqwtu.js";import{i as re,r as ie}from"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import{n as ae}from"./vue-i18n.runtime-Dah5zGm4.js";import{r as oe,t as se}from"./theme-color-CCXuu6C1.js";import{a as ce,i as le,r as q,s as ue}from"./stream-transcription-_Xuw_VzN.js";import"./browser-DY5K31Vk.js";import{t as de}from"./scenes-Ct-xUphs.js";import{D as fe,n as J,r as Y}from"./settings-D1kLcsvA.js";import"./__vite-browser-external-BaycPy5b.js";import{n as X}from"./chat-CSFza6dY.js";import"./airi-card-DuhaYjQU.js";import{t as pe}from"./hearing-BH9rth_f.js";import{n as Z,r as me,t as he}from"./HeaderLink-CNK9co0e.js";import"./transformers.web-DAjDoeaJ.js";import{t as Q}from"./route-block-CpjdOEnv.js";import{n as ge}from"./src-BccD0BFR.js";import{n as $}from"./live2d-DukystQI.js";import{t as _e}from"./process.worklet-Cmmnc6Go.js";import{t as ve}from"./composables-eN7drneV.js";var ye={class:_([`max-w-[min(960px,calc(100%-2rem))]`,`mx-auto`,`h-full`,`flex`,`flex-col`,`pt-14`])},be={class:_([`mb-14`,`text-center`,`text-5xl`,`font-sans-rounded`])},xe={class:_([`text-neutral-400 dark:text-neutral-100/65`])},Se={class:_([`text-pink-400 dark:text-pink-300/90`])},Ce={key:0,class:_([`mt-2 text-base`])},we={key:0,class:_([`flex-1`])},Te={class:_([`mt-4`,`grid grid-cols-[120px_1fr]`,`gap-2`,`text-sm`])},Ee={class:_([`font-mono`])},De={class:_([`font-mono`])},Oe={class:_([`font-mono`])},ke={class:_([`font-mono`])},Ae={class:_([`my-10`])},je={class:_([`mt-4 flex flex-col gap-2`])},Me=[`href`],Ne=e({__name:`about-content`,props:{title:{default:`Project`},highlight:{default:`AIRI`},subtitle:{default:``},buildInfo:{},links:{default:()=>[{label:`Home`,href:`https://airi.moeru.ai/docs/`,icon:`i-solar:home-smile-outline`},{label:`Documentations`,href:`https://airi.moeru.ai/docs/en/docs/overview/`,icon:`i-solar:document-add-outline`},{label:`GitHub`,href:`https://github.com/moeru-ai/airi`,icon:`i-simple-icons:github`}]}},setup(e){let n=e,a=p(()=>{let e=n.buildInfo;return e?!!(e.branch||e.commit||e.builtOn||e.version):!1});return(n,o)=>(i(),w(`div`,ye,[T(`div`,be,[T(`span`,xe,s(e.title),1),T(`span`,Se,s(e.highlight),1),e.subtitle?(i(),w(`div`,Ce,s(e.subtitle),1)):t(``,!0)]),a.value?(i(),w(`div`,we,[o[4]||=T(`div`,{class:_([`text-neutral-500 dark:text-neutral-400`])},` Application build information `,-1),T(`div`,Te,[e.buildInfo?.version?(i(),w(x,{key:0},[o[0]||=T(`div`,{class:_([`text-neutral-500 dark:text-neutral-400`])},` Version `,-1),T(`div`,Ee,s(e.buildInfo.version),1)],64)):t(``,!0),e.buildInfo?.branch?(i(),w(x,{key:1},[o[1]||=T(`div`,{class:_([`text-neutral-500 dark:text-neutral-400`])},` Branch `,-1),T(`div`,De,s(e.buildInfo.branch),1)],64)):t(``,!0),e.buildInfo?.commit?(i(),w(x,{key:2},[o[2]||=T(`div`,{class:_([`text-neutral-500 dark:text-neutral-400`])},` Commit `,-1),T(`div`,Oe,s(e.buildInfo.commit),1)],64)):t(``,!0),e.buildInfo?.builtOn?(i(),w(x,{key:3},[o[3]||=T(`div`,{class:_([`text-neutral-500 dark:text-neutral-400`])},` Built on `,-1),T(`div`,ke,s(e.buildInfo.builtOn),1)],64)):t(``,!0)])])):t(``,!0),T(`div`,Ae,[o[5]||=T(`div`,{class:_([`text-neutral-500 dark:text-neutral-400`])},` About `,-1),T(`div`,je,[(i(!0),w(x,null,r(e.links,e=>(i(),w(`a`,{key:e.href,class:_([`block`,`flex items-center gap-2`,`rounded-xl`,`px-3 py-2`,`lg:px-5 lg:py-3`,`outline-none`,`backdrop-blur-md`,`active:scale-95`,`focus:outline-none`,`text-nowrap`,`text-sm md:text-base`,`text-slate-700 dark:text-slate-100`,`bg-black/4`,`transition-colors transition-transform duration-200 ease-in-out`,`hover:bg-black/6`,`dark:bg-black/10 dark:hover:bg-white/20`]),href:e.href,target:`_blank`},[T(`div`,{class:_(e.icon)},null,2),T(`div`,null,s(e.label),1)],8,Me))),128))])])]))}});function Pe(e,t){let n=ce(e,t?.in);if(!le(n))throw RangeError(`Invalid time value`);let r=t?.format??`extended`,i=t?.representation??`complete`,a=``,o=r===`extended`?`-`:``,s=r===`extended`?`:`:``;if(i!==`time`){let e=q(n.getDate(),2),t=q(n.getMonth()+1,2);a=`${q(n.getFullYear(),4)}${o}${t}${o}${e}`}if(i!==`date`){let e=q(n.getHours(),2),t=q(n.getMinutes(),2),r=q(n.getSeconds(),2);a=`${a}${a===``?``:` `}${e}${s}${t}${s}${r}`}return a}var Fe={},Ie={class:`cross-background-container`};function Le(e,t){return i(),w(`div`,Ie,[d(e.$slots,`default`,{},void 0,!0)])}var Re=R(Fe,[[`render`,Le],[`__scopeId`,`data-v-455eb62c`]]),ze=e({__name:`About`,setup(e){let t=E(!1),n=Pe(new ue(`Fri Dec 12 00:00:09 2025 +0800`)),r=p(()=>({branch:`main`,commit:`fa11015`,builtOn:n})),a=[{label:`Home`,href:`https://airi.moeru.ai/docs/`,icon:`i-solar:home-smile-outline`},{label:`Documentations`,href:`https://airi.moeru.ai/docs/en/docs/overview/`,icon:`i-solar:document-add-outline`},{label:`GitHub`,href:`https://github.com/moeru-ai/airi`,icon:`i-simple-icons:github`}];return(e,n)=>(i(),w(x,null,[T(`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`,onClick:n[0]||=e=>t.value=!t.value},[...n[2]||=[T(`div`,{"i-solar:info-circle-outline":``,"size-5":``,text:`neutral-500 dark:neutral-400`},null,-1)]]),v(y(G),{modelValue:t.value,"onUpdate:modelValue":n[1]||=e=>t.value=e},{default:b(()=>[v(y(Ne),{subtitle:`Web ver.`,"build-info":r.value,links:a},null,8,[`build-info`])]),_:1},8,[`modelValue`])],64))}}),Be={"mb-1":``,"w-full":``,flex:``,"items-center":``,"justify-between":``,"gap-2":``},Ve={flex:``,"items-center":``,"gap-2":``},He=e({__name:`Header`,setup(e){return(e,t)=>(i(),w(`header`,Be,[v(he),T(`div`,Ve,[v(ze),v(y(L),{border:`2 solid neutral-100/60 dark:neutral-800/30`,bg:`neutral-50/70 dark:neutral-800/70`,"w-fit":``,flex:``,"items-center":``,"justify-center":``,"rounded-xl":``,"p-2":``,"backdrop-blur-md":``,title:`Settings`,to:`/settings`},{default:b(()=>[...t[0]||=[T(`div`,{"i-solar:settings-minimalistic-bold-duotone":``,"size-5":``,text:`neutral-500 dark:neutral-400`},null,-1)]]),_:1})])]))}}),Ue={absolute:``,"bottom--8":``,"right-0":``,flex:``,"gap-2":``},We={key:0,"i-solar:moon-bold":``},Ge={key:1,"i-solar:sun-2-bold":``},Ke=e({__name:`ChatActionButtons`,setup(e){let{cleanupMessages:t}=X(),{isDark:n,toggleDark:r}=F();return(e,a)=>(i(),w(`div`,Ue,[T(`button`,{class:`max-h-[10lh] min-h-[1lh]`,bg:`neutral-100 dark:neutral-800`,text:`lg neutral-500 dark:neutral-400`,"hover:text":`red-500 dark:red-400`,flex:``,"items-center":``,"justify-center":``,"rounded-md":``,"p-2":``,"outline-none":``,"transition-colors":``,"transition-transform":``,"active:scale-95":``,onClick:a[0]||=e=>y(t)()},[...a[2]||=[T(`div`,{class:`i-solar:trash-bin-2-bold-duotone`},null,-1)]]),T(`button`,{class:`max-h-[10lh] min-h-[1lh]`,bg:`neutral-100 dark:neutral-800`,text:`lg neutral-500 dark:neutral-400`,flex:``,"items-center":``,"justify-center":``,"rounded-md":``,"p-2":``,"outline-none":``,"transition-colors":``,"transition-transform":``,"active:scale-95":``,onClick:a[1]||=()=>y(r)()},[v(S,{name:`fade`,mode:`out-in`},{default:b(()=>[y(n)?(i(),w(`div`,We)):(i(),w(`div`,Ge))]),_:1})])]))}}),qe={width:`24`,height:`24`,viewBox:`0 0 256 256`,"aria-hidden":`true`},Je={id:`micLevel`,x1:`0%`,y1:`0%`,x2:`0%`,y2:`100%`},Ye=[`offset`],Xe=[`offset`],Ze=e({__name:`IndicatorMicVolume`,props:{colorClass:{default:`text-primary-500 dark:text-primary-200`}},setup(e){let t=e,{stream:r,enabled:a}=I(Y()),{audioContext:o}=I(fe()),{startAnalyzer:s,stopAnalyzer:c,volumeLevel:l}=ne(),d,m=p(()=>Math.min(1,(l.value??0)/100));function h(){try{d?.disconnect()}catch{}d=void 0,c()}async function g(){if(h(),!a.value||!r.value)return;let e=o.value;e.state===`suspended`&&await e.resume();let t=s(e);t&&(d=e.createMediaStreamSource(r.value),d.connect(t))}return u(()=>{f([a,r],()=>g(),{immediate:!0})}),n(()=>h()),(e,n)=>(i(),w(`div`,{class:_([`flex items-center justify-center`,t.colorClass])},[(i(),w(`svg`,qe,[T(`defs`,null,[T(`linearGradient`,Je,[n[0]||=T(`stop`,{offset:`0%`,"stop-color":`currentColor`,"stop-opacity":`0`},null,-1),T(`stop`,{offset:`${100-Math.round(m.value*100)}%`,"stop-color":`currentColor`,"stop-opacity":`0`},null,8,Ye),T(`stop`,{offset:`${100-Math.round(m.value*100)}%`,"stop-color":`currentColor`,"stop-opacity":`0.95`},null,8,Xe),n[1]||=T(`stop`,{offset:`100%`,"stop-color":`currentColor`,"stop-opacity":`0.95`},null,-1)])]),n[2]||=T(`path`,{fill:`url(#micLevel)`,d:`M128 176a48.05 48.05 0 0 0 48-48V64a48 48 0 0 0-96 0v64a48.05 48.05 0 0 0 48 48M96 64a32 32 0 0 1 64 0v64a32 32 0 0 1-64 0Zm40 143.6V240a8 8 0 0 1-16 0v-32.4A80.11 80.11 0 0 1 48 128a8 8 0 0 1 16 0a64 64 0 0 0 128 0a8 8 0 0 1 16 0a80.11 80.11 0 0 1-72 79.6`},null,-1),n[3]||=T(`path`,{fill:`none`,stroke:`currentColor`,"stroke-opacity":`1`,"stroke-width":`2`,d:`M128 176a48.05 48.05 0 0 0 48-48V64a48 48 0 0 0-96 0v64a48.05 48.05 0 0 0 48 48M96 64a32 32 0 0 1 64 0v64a32 32 0 0 1-64 0Zm40 143.6V240a8 8 0 0 1-16 0v-32.4A80.11 80.11 0 0 1 48 128a8 8 0 0 1 16 0a64 64 0 0 0 128 0a8 8 0 0 1 16 0a80.11 80.11 0 0 1-72 79.6`},null,-1)]))],2))}}),Qe={h:`{e&&await g()}),f([u,d],async()=>{u.value&&d.value&&await L(d.value,await c.getProviderInstance(u.value),[])}),F(async()=>{t.value=``});let{startAnalyzer:U,stopAnalyzer:ee,volumeLevel:te}=ne(),W=p(()=>Math.min(1,Math.max(0,(te.value??0)/100))),G;function K(){try{G?.disconnect()}catch{}G=void 0,ee()}async function oe(){if(K(),!r.value||!x.value||!j.value)return;B.state===`suspended`&&await B.resume();let e=U(B);e&&(G=B.createMediaStreamSource(j.value),G.connect(e))}return f([r,x,j],()=>{oe()},{immediate:!0}),n(()=>{K()}),(e,n)=>(i(),w(`div`,Qe,[T(`div`,$e,[v(y(z),{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,placeholder:y(V)(`stage.message`),text:`primary-600 dark:primary-100 placeholder:primary-500 dark:placeholder:primary-200`,bg:`transparent`,"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:_({"transition-colors-none placeholder:transition-colors-none":y(h)}),onSubmit:H,onCompositionstart:n[1]||=e=>o.value=!0,onCompositionend:n[2]||=e=>o.value=!1},null,8,[`modelValue`,`placeholder`,`class`]),T(`div`,null,[v(y(A),{"delay-duration":0,"skip-delay-duration":0},{default:b(()=>[v(y(k),{open:r.value,"onUpdate:open":n[5]||=e=>r.value=e},{default:b(()=>[v(y(O),{"as-child":``},{default:b(()=>[T(`button`,{class:`max-h-[10lh] min-h-[1lh]`,text:`lg neutral-500 dark:neutral-400`,flex:``,"items-center":``,"justify-center":``,"rounded-md":``,"p-2":``,"outline-none":``,transition:`colors duration-200, transform duration-100`,"active:scale-95":``,title:y(V)(`settings.hearing.title`)},[v(S,{name:`fade`,mode:`out-in`},{default:b(()=>[y(x)?(i(),l(Ze,{key:0})):(i(),w(`div`,tt))]),_:1})],8,et)]),_:1}),v(S,{name:`fade`},{default:b(()=>[v(y(D),{side:`top`,"side-offset":8,class:_([`w-72 max-w-[18rem] rounded-xl border border-neutral-200/60 bg-neutral-50/90 p-4`,`shadow-lg backdrop-blur-md dark:border-neutral-800/30 dark:bg-neutral-900/80`,`flex flex-col gap-3`])},{default:b(()=>[T(`div`,nt,[T(`div`,rt,[T(`div`,{class:_([`absolute left-1/2 top-1/2 h-20 w-20 rounded-full transition-all duration-150 -translate-x-1/2 -translate-y-1/2`,y(x)?`bg-primary-500/15 dark:bg-primary-600/20`:`bg-neutral-300/20 dark:bg-neutral-700/20`]),style:a({transform:`translate(-50%, -50%) scale(${1+W.value*.35})`,opacity:String(.25+W.value*.25)})},null,6),T(`div`,{class:_([`absolute left-1/2 top-1/2 h-24 w-24 rounded-full transition-all duration-200 -translate-x-1/2 -translate-y-1/2`,y(x)?`bg-primary-500/10 dark:bg-primary-600/15`:`bg-neutral-300/10 dark:bg-neutral-700/10`]),style:a({transform:`translate(-50%, -50%) scale(${1.2+W.value*.55})`,opacity:String(.15+W.value*.2)})},null,6),T(`div`,{class:_([`absolute left-1/2 top-1/2 h-28 w-28 rounded-full transition-all duration-300 -translate-x-1/2 -translate-y-1/2`,y(x)?`bg-primary-500/5 dark:bg-primary-600/10`:`bg-neutral-300/5 dark:bg-neutral-700/5`]),style:a({transform:`translate(-50%, -50%) scale(${1.5+W.value*.8})`,opacity:String(.08+W.value*.15)})},null,6),T(`button`,{class:_([`absolute left-1/2 top-1/2 grid h-16 w-16 place-items-center rounded-full shadow-md outline-none transition-all duration-200 -translate-x-1/2 -translate-y-1/2`,y(x)?`bg-primary-500 text-white hover:bg-primary-600 active:scale-95`:`bg-neutral-200 text-neutral-600 hover:bg-neutral-300 active:scale-95 dark:bg-neutral-700 dark:text-neutral-200`]),onClick:n[3]||=e=>x.value=!y(x)},[T(`div`,{class:_([y(x)?`i-ph:microphone`:`i-ph:microphone-slash`,`h-6 w-6`])},null,2)],2)]),T(`p`,it,s(y(x)?`Microphone enabled`:`Microphone disabled`),1)]),v(y(M),{modelValue:y(C),"onUpdate:modelValue":n[4]||=e=>m(C)?C.value=e:null,label:`Input device`,description:`Select the microphone you want to use.`,options:y(N).map(e=>({label:e.label||`Unknown Device`,value:e.deviceId})),layout:`vertical`,placeholder:`Select microphone`},null,8,[`modelValue`,`options`])]),_:1})]),_:1})]),_:1},8,[`open`])]),_:1})])])]))}}),ot={},st={flex:`~ col`,border:`solid 4 primary-200/20 dark:primary-400/20`,"h-full":``,"w-full":``,"rounded-xl":``,bg:`primary-50/50 dark:primary-950/70`,"backdrop-blur-md":``};function ct(e,t){return i(),w(`div`,st,[d(e.$slots,`default`)])}var lt=R(ot,[[`render`,ct]]),ut={flex:`col`,"items-center":``,"pt-4":``},dt={"h-full":``,"max-h":`[85vh]`,"w-full":``,py:`4`},ft={key:0,absolute:``,"left-0":``,"top-0":``,"h-1":``,"w-full":``,"overflow-hidden":``,"rounded-t-xl":``,class:`bg-primary-500/20`},pt={w:`full`,"max-h":`(i(),w(`div`,ut,[T(`div`,dt,[v(lt,null,{default:b(()=>[s.value?(i(),w(`div`,ft,[...c[1]||=[T(`div`,{"h-full":``,w:`1/3`,"origin-left":``,"bg-primary-500":``,class:`animate-scan`},null,-1)]])):t(``,!0),T(`div`,pt,[y(n)?(i(),l(y(te),{key:0,messages:y(r),sending:y(a),"streaming-message":y(o),"h-full":``,variant:`desktop`,onVnodeMounted:c[0]||=e=>s.value=!1},null,8,[`messages`,`sending`,`streaming-message`])):t(``,!0)]),v(at)]),_:1})]),v(Ke)]))}}),[[`__scopeId`,`data-v-0fcb9cae`]]),ht=[`src`],gt=[`src`],_t=R(e({__name:`MobileHeaderLink`,setup(e){let{isDark:t}=F();return(e,n)=>(i(),l(y(L),{to:`/`,flex:`~`,"items-center":``,"gap-2":``,"px-2":``,"text-nowrap":``,"text-2xl":``,"outline-none":``},{default:b(()=>[y(t)?(i(),w(`img`,{key:0,src:y(me),"h-8":``,"w-8":``,class:`theme-colored`},null,8,ht)):(i(),w(`img`,{key:1,src:y(Z),"h-8":``,"w-8":``,class:`theme-colored`},null,8,gt))]),_:1}))}}),[[`__scopeId`,`data-v-461cb340`]]),vt={"mb-1":``,"w-full":``,"gap-2":``},yt={"w-full":``,flex:``,"justify-center":``},bt=e({__name:`MobileHeader`,setup(e){return(e,t)=>(i(),w(`header`,vt,[T(`div`,yt,[v(_t)])]))}}),xt={"w-full":``,flex:``,"flex-1":``,"items-center":``,"self-end":``,"justify-end":``,"gap-2":``},St={key:0,"w-full":``,flex:``,"justify-between":``,"gap-2":``},Ct={key:0,"i-solar:tuning-outline":``,"size-5":``},wt={key:1,"i-solar:alt-arrow-right-outline":``,"size-5":``},Tt=R(e({__name:`ViewControls`,props:{modelValue:{required:!0},modelModifiers:{}},emits:c([`reset`],[`update:modelValue`]),setup(e,{emit:n}){let r=n,{stageModelRenderer:a,stageViewControlsEnabled:s}=I(J()),c=C(e,`modelValue`);function u(e){if(c.value===e){r(`reset`);return}c.value=e}return(e,n)=>(i(),w(`div`,xt,[v(S,{name:`fade`},{default:b(()=>[y(s)?(i(),w(`div`,St,[v(y(P),{variant:`secondary-muted`,toggled:c.value===`x`,"w-full":``,onClick:n[0]||=e=>u(`x`)},{default:b(()=>[...n[5]||=[o(` X `,-1)]]),_:1},8,[`toggled`]),v(y(P),{variant:`secondary-muted`,toggled:c.value===`y`,"w-full":``,onClick:n[1]||=e=>u(`y`)},{default:b(()=>[...n[6]||=[o(` Y `,-1)]]),_:1},8,[`toggled`]),y(a)===`vrm`?(i(),l(y(P),{key:0,variant:`secondary-muted`,toggled:c.value===`z`,"w-full":``,onClick:n[2]||=e=>u(`z`)},{default:b(()=>[...n[7]||=[o(` Z `,-1)]]),_:1},8,[`toggled`])):t(``,!0),v(y(P),{variant:`secondary-muted`,toggled:c.value===`scale`,"w-full":``,onClick:n[3]||=e=>u(`scale`)},{default:b(()=>[...n[8]||=[o(` Scale `,-1)]]),_:1},8,[`toggled`])])):t(``,!0)]),_:1}),T(`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:n[4]||=e=>s.value=!y(s)},[v(S,{name:`fade`,mode:`out-in`},{default:b(()=>[y(s)?(i(),w(`div`,wt)):(i(),w(`div`,Ct))]),_:1})])]))}}),[[`__scopeId`,`data-v-817f89fd`]]),Et={key:0},Dt={key:0,relative:``,class:`[&_.round-range-tooltip]:hover:opacity-100`},Ot={class:`round-range-tooltip`,top:`50%`,"translate-y":`[-50%]`,absolute:``,"left-10":``,"font-mono":``,"op-0":``,transition:`all duration-200 ease-in-out`},kt={key:1,relative:``,class:`[&_.round-range-tooltip]:hover:opacity-100`},At={class:`round-range-tooltip`,top:`50%`,"translate-y":`[-50%]`,absolute:``,"left-10":``,"font-mono":``,"op-0":``,transition:`all duration-200 ease-in-out`},jt={key:2,relative:``,class:`[&_.round-range-tooltip]:hover:opacity-100`},Mt={class:`round-range-tooltip`,top:`50%`,"translate-y":`[-50%]`,absolute:``,"left-10":``,"font-mono":``,"op-0":``,transition:`all duration-200 ease-in-out`},Nt={key:3,relative:``,class:`[&_.round-range-tooltip]:hover:opacity-100`},Pt={class:`round-range-tooltip`,top:`50%`,"translate-y":`[-50%]`,absolute:``,"left-10":``,"font-mono":``,"op-0":``,transition:`all duration-200 ease-in-out`},Ft=R(e({__name:`Inputs`,props:{mode:{}},setup(e,{expose:n}){let r=e,{stageModelRenderer:a,stageViewControlsEnabled:o}=I(J()),{scale:c,modelOffset:u,modelSize:d}=I(ge()),{scale:f,position:m}=I($()),h=p({get:()=>{switch(a.value){case`live2d`:return m.value.x;case`vrm`:return u.value.x;default:return 0}},set:e=>{switch(a.value){case`live2d`:m.value.x=e;break;case`vrm`:u.value.x=e;break;default:break}}}),g=p(()=>a.value===`live2d`?-500:-d.value.x-10),_=p(()=>a.value===`vrm`?500:d.value.x+10),x=p({get:()=>{switch(a.value){case`live2d`:return m.value.y;case`vrm`:return u.value.y;default:return 0}},set:e=>{switch(a.value){case`live2d`:m.value.y=e;break;case`vrm`:u.value.y=e;break;default:break}}}),C=p(()=>a.value===`live2d`?-500:-d.value.y-10),E=p(()=>a.value===`vrm`?500:d.value.y+10),D=p({get:()=>{switch(a.value){case`live2d`:return 0;case`vrm`:return u.value.z;default:return 0}},set:e=>{switch(a.value){case`live2d`:break;case`vrm`:u.value.z=e;break;default:break}}}),O=p(()=>a.value===`live2d`?-500:-d.value.z-10),k=p(()=>a.value===`live2d`?500:d.value.z+10),A=p({get:()=>a.value===`live2d`?f.value:c.value,set:e=>{a.value===`live2d`?f.value=e:c.value=e}});function M(){switch(r.mode){case`x`:h.value=0;break;case`y`:x.value=0;break;case`z`:D.value=0;break;case`scale`:A.value=1;break}}return n({resetOnMode:M}),(e,n)=>(i(),l(S,{name:`fade-side-pops-in`},{default:b(()=>[y(o)?(i(),w(`div`,Et,[v(S,{name:`fade-side-pops-in`,mode:`out-in`},{default:b(()=>[r.mode===`x`?(i(),w(`div`,Dt,[v(y(j),{modelValue:h.value,"onUpdate:modelValue":n[0]||=e=>h.value=e,min:g.value,max:_.value,step:.01,"data-direction":`vertical`,h:`50%`,"write-vertical-left":``},null,8,[`modelValue`,`min`,`max`]),T(`div`,Ot,s(h.value.toFixed(2)),1)])):r.mode===`y`?(i(),w(`div`,kt,[v(y(j),{modelValue:x.value,"onUpdate:modelValue":n[1]||=e=>x.value=e,min:C.value,max:E.value,step:.01,"write-vertical-left":``,h:`50%`,"data-direction":`vertical`},null,8,[`modelValue`,`min`,`max`]),T(`div`,At,s(x.value.toFixed(2)),1)])):y(a)===`vrm`&&r.mode===`z`?(i(),w(`div`,jt,[v(y(j),{modelValue:D.value,"onUpdate:modelValue":n[2]||=e=>D.value=e,min:O.value,max:k.value,step:.01,"write-vertical-left":``,h:`50%`,"data-direction":`vertical`},null,8,[`modelValue`,`min`,`max`]),T(`div`,Mt,s(D.value.toFixed(2)),1)])):r.mode===`scale`?(i(),w(`div`,Nt,[v(y(j),{modelValue:A.value,"onUpdate:modelValue":n[3]||=e=>A.value=e,min:0,max:3,step:1e-4,"write-vertical-left":``,h:`50%`,"data-direction":`vertical`},null,8,[`modelValue`]),T(`div`,Pt,s(A.value.toFixed(2)),1)])):t(``,!0)]),_:1})])):t(``,!0)]),_:1}))}}),[[`__scopeId`,`data-v-011f6495`]]),It={fixed:``,"bottom-0":``,"w-full":``,flex:``,"flex-col":``},Lt={relative:``,"w-full":``,"self-end":``},Rt={top:`50%`,"translate-y":`[-50%]`,fixed:``,"z-15":``,"px-3":``},zt={"translate-y":`[-100%]`,absolute:``,"right-0":``,"w-full":``,"px-3":``,"pb-3":``,"font-sans":``},Bt={flex:`~ col`,"w-full":``,"gap-1":``},Vt={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:`Hearing`},Ht={key:1,"i-solar:microphone-3-outline":``,"size-5":``,text:`neutral-500 dark:neutral-400`},Ut={key:0,"i-solar:moon-outline":``,"size-5":``,text:`neutral-500 dark:neutral-400`},Wt={key:1,"i-solar:sun-2-outline":``,"size-5":``,text:`neutral-500 dark:neutral-400`},Gt=R(e({__name:`MobileInteractiveArea`,setup(e){let{isDark:r,toggleDark:o}=F(),s=E(!1),{messages:c,sending:d,streamingMessage:p}=I(X()),x=E(`scale`),C=g(`viewControlsInputs`),D=E(``),O=E(!1),k=B(),A=re(),{activeProvider:j,activeModel:M}=I(ie());ee(document.documentElement,()=>k.update());let{themeColorsHueDynamic:N,stageViewControlsEnabled:P}=I(J()),R=Y(),{enabled:V,selectedAudioInput:H,stream:U,audioInputs:G}=I(R),{send:K,onAfterMessageComposed:oe,discoverToolsCompatibility:se,cleanupMessages:ce}=X(),{t:le}=ae(),{audioContext:q}=fe(),{startAnalyzer:ue,stopAnalyzer:de,volumeLevel:pe}=ne(),Z;function me(){return/Mobi|Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}async function he(){me()||await Q()}async function Q(){if(!(!D.value.trim()||O.value))try{let e=A.getProviderConfig(j.value);await K(D.value,{chatProvider:await A.getProviderInstance(j.value),model:M.value,providerConfig:e})}catch(e){c.value.pop(),c.value.push({role:`error`,content:e.message})}}function ge(){try{Z?.disconnect()}catch{}Z=void 0,de()}async function $(){if(ge(),!s.value||!V.value||!U.value)return;q.state===`suspended`&&await q.resume();let e=ue(q);e&&(Z=q.createMediaStreamSource(U.value),Z.connect(e))}return f([s,V,U],()=>{$()},{immediate:!0}),f(s,e=>{e&&R.askPermission()}),oe(async()=>{D.value=``}),f([j,M],async()=>{j.value&&M.value&&await se(M.value,await A.getProviderInstance(j.value),[])}),n(()=>{ge()}),u(()=>{k.update()}),(e,n)=>(i(),w(`div`,It,[(i(),l(h,null,[v(S,{name:`fade`},{default:b(()=>[y(P)?t(``,!0):(i(),l(y(te),{key:0,variant:`mobile`,messages:y(c),sending:y(d),"streaming-message":y(p),"max-w":`[calc(100%-3.5rem)]`,"w-full":``,"self-start":``,"pl-3":``,class:_([`chat-history`,[`relative z-20`]])},null,8,[`messages`,`sending`,`streaming-message`]))]),_:1})],1024)),T(`div`,Lt,[T(`div`,Rt,[v(Ft,{ref:`viewControlsInputs`,mode:x.value},null,8,[`mode`])]),T(`div`,zt,[T(`div`,Bt,[v(ze),v(y(W),{show:s.value,"onUpdate:show":n[0]||=e=>s.value=e,enabled:y(V),"onUpdate:enabled":n[1]||=e=>m(V)?V.value=e:null,"selected-audio-input":y(H),"onUpdate:selectedAudioInput":n[2]||=e=>m(H)?H.value=e:null,"audio-inputs":y(G),"volume-level":y(pe),granted:!0},{default:b(()=>[T(`button`,Vt,[v(S,{name:`fade`,mode:`out-in`},{default:b(()=>[y(V)?(i(),l(Ze,{key:0,"size-5":``,"color-class":`text-neutral-500 dark:text-neutral-400`})):(i(),w(`div`,Ht))]),_:1})])]),_:1},8,[`show`,`enabled`,`selected-audio-input`,`audio-inputs`,`volume-level`]),T(`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[3]||=e=>y(o)()},[v(S,{name:`fade`,mode:`out-in`},{default:b(()=>[y(r)?(i(),w(`div`,Ut)):(i(),w(`div`,Wt))]),_:1})]),v(y(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[10]||=[T(`div`,{"i-solar:settings-outline":``,"size-5":``,text:`neutral-500 dark:neutral-400`},null,-1)]]),_:1}),v(Tt,{modelValue:x.value,"onUpdate:modelValue":n[4]||=e=>x.value=e,onReset:n[5]||=()=>C.value?.resetOnMode()},null,8,[`modelValue`]),T(`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:`Cleanup Messages`,onClick:n[6]||=e=>y(ce)()},[...n[11]||=[T(`div`,{class:`i-solar:trash-bin-2-bold-duotone`},null,-1)]])])]),T(`div`,{bg:`white dark:neutral-800`,"max-h-100dvh":``,"max-w-100dvw":``,"w-full":``,flex:``,"gap-1":``,"overflow-auto":``,"px-3":``,"pt-2":``,style:a({paddingBottom:`${Math.max(Number.parseFloat(y(k).bottom.value.replace(`px`,``)),12)}px`})},[v(y(z),{modelValue:D.value,"onUpdate:modelValue":n[7]||=e=>D.value=e,placeholder:y(le)(`stage.message`),border:`solid 2 neutral-200/60 dark:neutral-700/60`,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:_([y(N)?`transition-colors-none placeholder:transition-colors-none`:``]),"default-height":`1lh`,onSubmit:he,onCompositionstart:n[8]||=e=>O.value=!0,onCompositionend:n[9]||=e=>O.value=!1},null,8,[`modelValue`,`placeholder`,`class`]),D.value.trim()||O.value?(i(),w(`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:Q},[...n[12]||=[T(`div`,{"i-solar:arrow-up-outline":``},null,-1)]])):t(``,!0)],4)])]))}}),[[`__scopeId`,`data-v-4462c9b7`]]),Kt={class:`relative`},qt={absolute:``,"left-0":``,"right-0":``,"top-0":``,"w-full":``,"overflow-hidden":``},Jt=R(e({__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=E(t.height),r=E(t.amplitude),o=E(t.waveLength),s=E(t.fillColor),c=E(t.direction),l=E(t.movementDirection);function u(e,t,n,r,i){let a=[],o=Math.ceil(e/r)*r,s=i===`up`?n:t-n;a.push(`M 0 ${s}`);let c=Math.PI*2/r;for(let e=0;e<=o;e+=1){let t=n*Math.sin(c*e),r=i===`up`?s-t:s+t;a.push(`L ${e} ${r}`)}let l=i===`up`?t:0;return a.push(`L ${o} ${l}`),a.push(`L 0 ${l} Z`),a.join(` `)}let m=p(()=>n.value+r.value*2),h=p(()=>{let e=` +import{A as e,C as t,G as n,J as r,K as i,Nt as a,O as o,Pt as s,R as c,S as l,W as u,Y as d,at as f,b as p,gt as m,h,it as g,jt as _,k as v,kt as y,lt as b,m as x,n as S,nt as C,w,x as T,xt as E}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./tres-Bk8ucvrj.js";import{_ as D,g as O,v as k,y as A}from"./widgets-C0YByt49.js";import{a as j,c as M,n as N,r as P,t as F}from"./src-DYQXbDgu.js";import{a as I}from"./resettable-CbXzRviW.js";import{t as L}from"./vue-router-Chhv6vZu.js";import"./environment-CyZLTg97.js";import{t as R}from"./_plugin-vue_export-helper-DGA9ry_j.js";import{t as z}from"./Basic-EclD3L6X.js";import{b as B,h as V,i as H,t as U,y as ee}from"./dist-Che88T83.js";import"./src-C83SCWbW.js";import{Q as te,X as W,Z as G,o as K,s as ne}from"./components-CeE-UiLT.js";import{i as re,r as ie}from"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import{n as ae}from"./vue-i18n.runtime-Dah5zGm4.js";import{r as oe,t as se}from"./theme-color-CCXuu6C1.js";import{a as ce,i as le,r as q,s as ue}from"./stream-transcription-_Xuw_VzN.js";import"./browser-DY5K31Vk.js";import{t as de}from"./scenes-BnArCCLz.js";import{D as fe,n as J,r as Y}from"./settings-73vyHOZs.js";import"./__vite-browser-external-BaycPy5b.js";import{n as X}from"./chat-CxQ_IGrj.js";import"./airi-card-DuhaYjQU.js";import{t as pe}from"./hearing-BH9rth_f.js";import{n as Z,r as me,t as he}from"./HeaderLink-CNK9co0e.js";import"./transformers.web-DAjDoeaJ.js";import{t as Q}from"./route-block-CpjdOEnv.js";import{n as ge}from"./src-mAITpvbv.js";import{n as $}from"./live2d-DukystQI.js";import{t as _e}from"./process.worklet-Cmmnc6Go.js";import{t as ve}from"./composables-eN7drneV.js";var ye={class:_([`max-w-[min(960px,calc(100%-2rem))]`,`mx-auto`,`h-full`,`flex`,`flex-col`,`pt-14`])},be={class:_([`mb-14`,`text-center`,`text-5xl`,`font-sans-rounded`])},xe={class:_([`text-neutral-400 dark:text-neutral-100/65`])},Se={class:_([`text-pink-400 dark:text-pink-300/90`])},Ce={key:0,class:_([`mt-2 text-base`])},we={key:0,class:_([`flex-1`])},Te={class:_([`mt-4`,`grid grid-cols-[120px_1fr]`,`gap-2`,`text-sm`])},Ee={class:_([`font-mono`])},De={class:_([`font-mono`])},Oe={class:_([`font-mono`])},ke={class:_([`font-mono`])},Ae={class:_([`my-10`])},je={class:_([`mt-4 flex flex-col gap-2`])},Me=[`href`],Ne=e({__name:`about-content`,props:{title:{default:`Project`},highlight:{default:`AIRI`},subtitle:{default:``},buildInfo:{},links:{default:()=>[{label:`Home`,href:`https://airi.moeru.ai/docs/`,icon:`i-solar:home-smile-outline`},{label:`Documentations`,href:`https://airi.moeru.ai/docs/en/docs/overview/`,icon:`i-solar:document-add-outline`},{label:`GitHub`,href:`https://github.com/moeru-ai/airi`,icon:`i-simple-icons:github`}]}},setup(e){let n=e,a=p(()=>{let e=n.buildInfo;return e?!!(e.branch||e.commit||e.builtOn||e.version):!1});return(n,o)=>(i(),w(`div`,ye,[T(`div`,be,[T(`span`,xe,s(e.title),1),T(`span`,Se,s(e.highlight),1),e.subtitle?(i(),w(`div`,Ce,s(e.subtitle),1)):t(``,!0)]),a.value?(i(),w(`div`,we,[o[4]||=T(`div`,{class:_([`text-neutral-500 dark:text-neutral-400`])},` Application build information `,-1),T(`div`,Te,[e.buildInfo?.version?(i(),w(x,{key:0},[o[0]||=T(`div`,{class:_([`text-neutral-500 dark:text-neutral-400`])},` Version `,-1),T(`div`,Ee,s(e.buildInfo.version),1)],64)):t(``,!0),e.buildInfo?.branch?(i(),w(x,{key:1},[o[1]||=T(`div`,{class:_([`text-neutral-500 dark:text-neutral-400`])},` Branch `,-1),T(`div`,De,s(e.buildInfo.branch),1)],64)):t(``,!0),e.buildInfo?.commit?(i(),w(x,{key:2},[o[2]||=T(`div`,{class:_([`text-neutral-500 dark:text-neutral-400`])},` Commit `,-1),T(`div`,Oe,s(e.buildInfo.commit),1)],64)):t(``,!0),e.buildInfo?.builtOn?(i(),w(x,{key:3},[o[3]||=T(`div`,{class:_([`text-neutral-500 dark:text-neutral-400`])},` Built on `,-1),T(`div`,ke,s(e.buildInfo.builtOn),1)],64)):t(``,!0)])])):t(``,!0),T(`div`,Ae,[o[5]||=T(`div`,{class:_([`text-neutral-500 dark:text-neutral-400`])},` About `,-1),T(`div`,je,[(i(!0),w(x,null,r(e.links,e=>(i(),w(`a`,{key:e.href,class:_([`block`,`flex items-center gap-2`,`rounded-xl`,`px-3 py-2`,`lg:px-5 lg:py-3`,`outline-none`,`backdrop-blur-md`,`active:scale-95`,`focus:outline-none`,`text-nowrap`,`text-sm md:text-base`,`text-slate-700 dark:text-slate-100`,`bg-black/4`,`transition-colors transition-transform duration-200 ease-in-out`,`hover:bg-black/6`,`dark:bg-black/10 dark:hover:bg-white/20`]),href:e.href,target:`_blank`},[T(`div`,{class:_(e.icon)},null,2),T(`div`,null,s(e.label),1)],8,Me))),128))])])]))}});function Pe(e,t){let n=ce(e,t?.in);if(!le(n))throw RangeError(`Invalid time value`);let r=t?.format??`extended`,i=t?.representation??`complete`,a=``,o=r===`extended`?`-`:``,s=r===`extended`?`:`:``;if(i!==`time`){let e=q(n.getDate(),2),t=q(n.getMonth()+1,2);a=`${q(n.getFullYear(),4)}${o}${t}${o}${e}`}if(i!==`date`){let e=q(n.getHours(),2),t=q(n.getMinutes(),2),r=q(n.getSeconds(),2);a=`${a}${a===``?``:` `}${e}${s}${t}${s}${r}`}return a}var Fe={},Ie={class:`cross-background-container`};function Le(e,t){return i(),w(`div`,Ie,[d(e.$slots,`default`,{},void 0,!0)])}var Re=R(Fe,[[`render`,Le],[`__scopeId`,`data-v-455eb62c`]]),ze=e({__name:`About`,setup(e){let t=E(!1),n=Pe(new ue(`Fri Dec 12 15:51:18 2025 +0800`)),r=p(()=>({branch:`main`,commit:`6e4b091`,builtOn:n})),a=[{label:`Home`,href:`https://airi.moeru.ai/docs/`,icon:`i-solar:home-smile-outline`},{label:`Documentations`,href:`https://airi.moeru.ai/docs/en/docs/overview/`,icon:`i-solar:document-add-outline`},{label:`GitHub`,href:`https://github.com/moeru-ai/airi`,icon:`i-simple-icons:github`}];return(e,n)=>(i(),w(x,null,[T(`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`,onClick:n[0]||=e=>t.value=!t.value},[...n[2]||=[T(`div`,{"i-solar:info-circle-outline":``,"size-5":``,text:`neutral-500 dark:neutral-400`},null,-1)]]),v(y(G),{modelValue:t.value,"onUpdate:modelValue":n[1]||=e=>t.value=e},{default:b(()=>[v(y(Ne),{subtitle:`Web ver.`,"build-info":r.value,links:a},null,8,[`build-info`])]),_:1},8,[`modelValue`])],64))}}),Be={"mb-1":``,"w-full":``,flex:``,"items-center":``,"justify-between":``,"gap-2":``},Ve={flex:``,"items-center":``,"gap-2":``},He=e({__name:`Header`,setup(e){return(e,t)=>(i(),w(`header`,Be,[v(he),T(`div`,Ve,[v(ze),v(y(L),{border:`2 solid neutral-100/60 dark:neutral-800/30`,bg:`neutral-50/70 dark:neutral-800/70`,"w-fit":``,flex:``,"items-center":``,"justify-center":``,"rounded-xl":``,"p-2":``,"backdrop-blur-md":``,title:`Settings`,to:`/settings`},{default:b(()=>[...t[0]||=[T(`div`,{"i-solar:settings-minimalistic-bold-duotone":``,"size-5":``,text:`neutral-500 dark:neutral-400`},null,-1)]]),_:1})])]))}}),Ue={absolute:``,"bottom--8":``,"right-0":``,flex:``,"gap-2":``},We={key:0,"i-solar:moon-bold":``},Ge={key:1,"i-solar:sun-2-bold":``},Ke=e({__name:`ChatActionButtons`,setup(e){let{cleanupMessages:t}=X(),{isDark:n,toggleDark:r}=F();return(e,a)=>(i(),w(`div`,Ue,[T(`button`,{class:`max-h-[10lh] min-h-[1lh]`,bg:`neutral-100 dark:neutral-800`,text:`lg neutral-500 dark:neutral-400`,"hover:text":`red-500 dark:red-400`,flex:``,"items-center":``,"justify-center":``,"rounded-md":``,"p-2":``,"outline-none":``,"transition-colors":``,"transition-transform":``,"active:scale-95":``,onClick:a[0]||=e=>y(t)()},[...a[2]||=[T(`div`,{class:`i-solar:trash-bin-2-bold-duotone`},null,-1)]]),T(`button`,{class:`max-h-[10lh] min-h-[1lh]`,bg:`neutral-100 dark:neutral-800`,text:`lg neutral-500 dark:neutral-400`,flex:``,"items-center":``,"justify-center":``,"rounded-md":``,"p-2":``,"outline-none":``,"transition-colors":``,"transition-transform":``,"active:scale-95":``,onClick:a[1]||=()=>y(r)()},[v(S,{name:`fade`,mode:`out-in`},{default:b(()=>[y(n)?(i(),w(`div`,We)):(i(),w(`div`,Ge))]),_:1})])]))}}),qe={width:`24`,height:`24`,viewBox:`0 0 256 256`,"aria-hidden":`true`},Je={id:`micLevel`,x1:`0%`,y1:`0%`,x2:`0%`,y2:`100%`},Ye=[`offset`],Xe=[`offset`],Ze=e({__name:`IndicatorMicVolume`,props:{colorClass:{default:`text-primary-500 dark:text-primary-200`}},setup(e){let t=e,{stream:r,enabled:a}=I(Y()),{audioContext:o}=I(fe()),{startAnalyzer:s,stopAnalyzer:c,volumeLevel:l}=ne(),d,m=p(()=>Math.min(1,(l.value??0)/100));function h(){try{d?.disconnect()}catch{}d=void 0,c()}async function g(){if(h(),!a.value||!r.value)return;let e=o.value;e.state===`suspended`&&await e.resume();let t=s(e);t&&(d=e.createMediaStreamSource(r.value),d.connect(t))}return u(()=>{f([a,r],()=>g(),{immediate:!0})}),n(()=>h()),(e,n)=>(i(),w(`div`,{class:_([`flex items-center justify-center`,t.colorClass])},[(i(),w(`svg`,qe,[T(`defs`,null,[T(`linearGradient`,Je,[n[0]||=T(`stop`,{offset:`0%`,"stop-color":`currentColor`,"stop-opacity":`0`},null,-1),T(`stop`,{offset:`${100-Math.round(m.value*100)}%`,"stop-color":`currentColor`,"stop-opacity":`0`},null,8,Ye),T(`stop`,{offset:`${100-Math.round(m.value*100)}%`,"stop-color":`currentColor`,"stop-opacity":`0.95`},null,8,Xe),n[1]||=T(`stop`,{offset:`100%`,"stop-color":`currentColor`,"stop-opacity":`0.95`},null,-1)])]),n[2]||=T(`path`,{fill:`url(#micLevel)`,d:`M128 176a48.05 48.05 0 0 0 48-48V64a48 48 0 0 0-96 0v64a48.05 48.05 0 0 0 48 48M96 64a32 32 0 0 1 64 0v64a32 32 0 0 1-64 0Zm40 143.6V240a8 8 0 0 1-16 0v-32.4A80.11 80.11 0 0 1 48 128a8 8 0 0 1 16 0a64 64 0 0 0 128 0a8 8 0 0 1 16 0a80.11 80.11 0 0 1-72 79.6`},null,-1),n[3]||=T(`path`,{fill:`none`,stroke:`currentColor`,"stroke-opacity":`1`,"stroke-width":`2`,d:`M128 176a48.05 48.05 0 0 0 48-48V64a48 48 0 0 0-96 0v64a48.05 48.05 0 0 0 48 48M96 64a32 32 0 0 1 64 0v64a32 32 0 0 1-64 0Zm40 143.6V240a8 8 0 0 1-16 0v-32.4A80.11 80.11 0 0 1 48 128a8 8 0 0 1 16 0a64 64 0 0 0 128 0a8 8 0 0 1 16 0a80.11 80.11 0 0 1-72 79.6`},null,-1)]))],2))}}),Qe={h:`{e&&await g()}),f([u,d],async()=>{u.value&&d.value&&await L(d.value,await c.getProviderInstance(u.value),[])}),F(async()=>{t.value=``});let{startAnalyzer:U,stopAnalyzer:ee,volumeLevel:te}=ne(),W=p(()=>Math.min(1,Math.max(0,(te.value??0)/100))),G;function K(){try{G?.disconnect()}catch{}G=void 0,ee()}async function oe(){if(K(),!r.value||!x.value||!j.value)return;B.state===`suspended`&&await B.resume();let e=U(B);e&&(G=B.createMediaStreamSource(j.value),G.connect(e))}return f([r,x,j],()=>{oe()},{immediate:!0}),n(()=>{K()}),(e,n)=>(i(),w(`div`,Qe,[T(`div`,$e,[v(y(z),{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,placeholder:y(V)(`stage.message`),text:`primary-600 dark:primary-100 placeholder:primary-500 dark:placeholder:primary-200`,bg:`transparent`,"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:_({"transition-colors-none placeholder:transition-colors-none":y(h)}),onSubmit:H,onCompositionstart:n[1]||=e=>o.value=!0,onCompositionend:n[2]||=e=>o.value=!1},null,8,[`modelValue`,`placeholder`,`class`]),T(`div`,null,[v(y(A),{"delay-duration":0,"skip-delay-duration":0},{default:b(()=>[v(y(k),{open:r.value,"onUpdate:open":n[5]||=e=>r.value=e},{default:b(()=>[v(y(O),{"as-child":``},{default:b(()=>[T(`button`,{class:`max-h-[10lh] min-h-[1lh]`,text:`lg neutral-500 dark:neutral-400`,flex:``,"items-center":``,"justify-center":``,"rounded-md":``,"p-2":``,"outline-none":``,transition:`colors duration-200, transform duration-100`,"active:scale-95":``,title:y(V)(`settings.hearing.title`)},[v(S,{name:`fade`,mode:`out-in`},{default:b(()=>[y(x)?(i(),l(Ze,{key:0})):(i(),w(`div`,tt))]),_:1})],8,et)]),_:1}),v(S,{name:`fade`},{default:b(()=>[v(y(D),{side:`top`,"side-offset":8,class:_([`w-72 max-w-[18rem] rounded-xl border border-neutral-200/60 bg-neutral-50/90 p-4`,`shadow-lg backdrop-blur-md dark:border-neutral-800/30 dark:bg-neutral-900/80`,`flex flex-col gap-3`])},{default:b(()=>[T(`div`,nt,[T(`div`,rt,[T(`div`,{class:_([`absolute left-1/2 top-1/2 h-20 w-20 rounded-full transition-all duration-150 -translate-x-1/2 -translate-y-1/2`,y(x)?`bg-primary-500/15 dark:bg-primary-600/20`:`bg-neutral-300/20 dark:bg-neutral-700/20`]),style:a({transform:`translate(-50%, -50%) scale(${1+W.value*.35})`,opacity:String(.25+W.value*.25)})},null,6),T(`div`,{class:_([`absolute left-1/2 top-1/2 h-24 w-24 rounded-full transition-all duration-200 -translate-x-1/2 -translate-y-1/2`,y(x)?`bg-primary-500/10 dark:bg-primary-600/15`:`bg-neutral-300/10 dark:bg-neutral-700/10`]),style:a({transform:`translate(-50%, -50%) scale(${1.2+W.value*.55})`,opacity:String(.15+W.value*.2)})},null,6),T(`div`,{class:_([`absolute left-1/2 top-1/2 h-28 w-28 rounded-full transition-all duration-300 -translate-x-1/2 -translate-y-1/2`,y(x)?`bg-primary-500/5 dark:bg-primary-600/10`:`bg-neutral-300/5 dark:bg-neutral-700/5`]),style:a({transform:`translate(-50%, -50%) scale(${1.5+W.value*.8})`,opacity:String(.08+W.value*.15)})},null,6),T(`button`,{class:_([`absolute left-1/2 top-1/2 grid h-16 w-16 place-items-center rounded-full shadow-md outline-none transition-all duration-200 -translate-x-1/2 -translate-y-1/2`,y(x)?`bg-primary-500 text-white hover:bg-primary-600 active:scale-95`:`bg-neutral-200 text-neutral-600 hover:bg-neutral-300 active:scale-95 dark:bg-neutral-700 dark:text-neutral-200`]),onClick:n[3]||=e=>x.value=!y(x)},[T(`div`,{class:_([y(x)?`i-ph:microphone`:`i-ph:microphone-slash`,`h-6 w-6`])},null,2)],2)]),T(`p`,it,s(y(x)?`Microphone enabled`:`Microphone disabled`),1)]),v(y(M),{modelValue:y(C),"onUpdate:modelValue":n[4]||=e=>m(C)?C.value=e:null,label:`Input device`,description:`Select the microphone you want to use.`,options:y(N).map(e=>({label:e.label||`Unknown Device`,value:e.deviceId})),layout:`vertical`,placeholder:`Select microphone`},null,8,[`modelValue`,`options`])]),_:1})]),_:1})]),_:1},8,[`open`])]),_:1})])])]))}}),ot={},st={flex:`~ col`,border:`solid 4 primary-200/20 dark:primary-400/20`,"h-full":``,"w-full":``,"rounded-xl":``,bg:`primary-50/50 dark:primary-950/70`,"backdrop-blur-md":``};function ct(e,t){return i(),w(`div`,st,[d(e.$slots,`default`)])}var lt=R(ot,[[`render`,ct]]),ut={flex:`col`,"items-center":``,"pt-4":``},dt={"h-full":``,"max-h":`[85vh]`,"w-full":``,py:`4`},ft={key:0,absolute:``,"left-0":``,"top-0":``,"h-1":``,"w-full":``,"overflow-hidden":``,"rounded-t-xl":``,class:`bg-primary-500/20`},pt={w:`full`,"max-h":`(i(),w(`div`,ut,[T(`div`,dt,[v(lt,null,{default:b(()=>[s.value?(i(),w(`div`,ft,[...c[1]||=[T(`div`,{"h-full":``,w:`1/3`,"origin-left":``,"bg-primary-500":``,class:`animate-scan`},null,-1)]])):t(``,!0),T(`div`,pt,[y(n)?(i(),l(y(te),{key:0,messages:y(r),sending:y(a),"streaming-message":y(o),"h-full":``,variant:`desktop`,onVnodeMounted:c[0]||=e=>s.value=!1},null,8,[`messages`,`sending`,`streaming-message`])):t(``,!0)]),v(at)]),_:1})]),v(Ke)]))}}),[[`__scopeId`,`data-v-0fcb9cae`]]),ht=[`src`],gt=[`src`],_t=R(e({__name:`MobileHeaderLink`,setup(e){let{isDark:t}=F();return(e,n)=>(i(),l(y(L),{to:`/`,flex:`~`,"items-center":``,"gap-2":``,"px-2":``,"text-nowrap":``,"text-2xl":``,"outline-none":``},{default:b(()=>[y(t)?(i(),w(`img`,{key:0,src:y(me),"h-8":``,"w-8":``,class:`theme-colored`},null,8,ht)):(i(),w(`img`,{key:1,src:y(Z),"h-8":``,"w-8":``,class:`theme-colored`},null,8,gt))]),_:1}))}}),[[`__scopeId`,`data-v-461cb340`]]),vt={"mb-1":``,"w-full":``,"gap-2":``},yt={"w-full":``,flex:``,"justify-center":``},bt=e({__name:`MobileHeader`,setup(e){return(e,t)=>(i(),w(`header`,vt,[T(`div`,yt,[v(_t)])]))}}),xt={"w-full":``,flex:``,"flex-1":``,"items-center":``,"self-end":``,"justify-end":``,"gap-2":``},St={key:0,"w-full":``,flex:``,"justify-between":``,"gap-2":``},Ct={key:0,"i-solar:tuning-outline":``,"size-5":``},wt={key:1,"i-solar:alt-arrow-right-outline":``,"size-5":``},Tt=R(e({__name:`ViewControls`,props:{modelValue:{required:!0},modelModifiers:{}},emits:c([`reset`],[`update:modelValue`]),setup(e,{emit:n}){let r=n,{stageModelRenderer:a,stageViewControlsEnabled:s}=I(J()),c=C(e,`modelValue`);function u(e){if(c.value===e){r(`reset`);return}c.value=e}return(e,n)=>(i(),w(`div`,xt,[v(S,{name:`fade`},{default:b(()=>[y(s)?(i(),w(`div`,St,[v(y(P),{variant:`secondary-muted`,toggled:c.value===`x`,"w-full":``,onClick:n[0]||=e=>u(`x`)},{default:b(()=>[...n[5]||=[o(` X `,-1)]]),_:1},8,[`toggled`]),v(y(P),{variant:`secondary-muted`,toggled:c.value===`y`,"w-full":``,onClick:n[1]||=e=>u(`y`)},{default:b(()=>[...n[6]||=[o(` Y `,-1)]]),_:1},8,[`toggled`]),y(a)===`vrm`?(i(),l(y(P),{key:0,variant:`secondary-muted`,toggled:c.value===`z`,"w-full":``,onClick:n[2]||=e=>u(`z`)},{default:b(()=>[...n[7]||=[o(` Z `,-1)]]),_:1},8,[`toggled`])):t(``,!0),v(y(P),{variant:`secondary-muted`,toggled:c.value===`scale`,"w-full":``,onClick:n[3]||=e=>u(`scale`)},{default:b(()=>[...n[8]||=[o(` Scale `,-1)]]),_:1},8,[`toggled`])])):t(``,!0)]),_:1}),T(`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:n[4]||=e=>s.value=!y(s)},[v(S,{name:`fade`,mode:`out-in`},{default:b(()=>[y(s)?(i(),w(`div`,wt)):(i(),w(`div`,Ct))]),_:1})])]))}}),[[`__scopeId`,`data-v-817f89fd`]]),Et={key:0},Dt={key:0,relative:``,class:`[&_.round-range-tooltip]:hover:opacity-100`},Ot={class:`round-range-tooltip`,top:`50%`,"translate-y":`[-50%]`,absolute:``,"left-10":``,"font-mono":``,"op-0":``,transition:`all duration-200 ease-in-out`},kt={key:1,relative:``,class:`[&_.round-range-tooltip]:hover:opacity-100`},At={class:`round-range-tooltip`,top:`50%`,"translate-y":`[-50%]`,absolute:``,"left-10":``,"font-mono":``,"op-0":``,transition:`all duration-200 ease-in-out`},jt={key:2,relative:``,class:`[&_.round-range-tooltip]:hover:opacity-100`},Mt={class:`round-range-tooltip`,top:`50%`,"translate-y":`[-50%]`,absolute:``,"left-10":``,"font-mono":``,"op-0":``,transition:`all duration-200 ease-in-out`},Nt={key:3,relative:``,class:`[&_.round-range-tooltip]:hover:opacity-100`},Pt={class:`round-range-tooltip`,top:`50%`,"translate-y":`[-50%]`,absolute:``,"left-10":``,"font-mono":``,"op-0":``,transition:`all duration-200 ease-in-out`},Ft=R(e({__name:`Inputs`,props:{mode:{}},setup(e,{expose:n}){let r=e,{stageModelRenderer:a,stageViewControlsEnabled:o}=I(J()),{scale:c,modelOffset:u,modelSize:d}=I(ge()),{scale:f,position:m}=I($()),h=p({get:()=>{switch(a.value){case`live2d`:return m.value.x;case`vrm`:return u.value.x;default:return 0}},set:e=>{switch(a.value){case`live2d`:m.value.x=e;break;case`vrm`:u.value.x=e;break;default:break}}}),g=p(()=>a.value===`live2d`?-500:-d.value.x-10),_=p(()=>a.value===`vrm`?500:d.value.x+10),x=p({get:()=>{switch(a.value){case`live2d`:return m.value.y;case`vrm`:return u.value.y;default:return 0}},set:e=>{switch(a.value){case`live2d`:m.value.y=e;break;case`vrm`:u.value.y=e;break;default:break}}}),C=p(()=>a.value===`live2d`?-500:-d.value.y-10),E=p(()=>a.value===`vrm`?500:d.value.y+10),D=p({get:()=>{switch(a.value){case`live2d`:return 0;case`vrm`:return u.value.z;default:return 0}},set:e=>{switch(a.value){case`live2d`:break;case`vrm`:u.value.z=e;break;default:break}}}),O=p(()=>a.value===`live2d`?-500:-d.value.z-10),k=p(()=>a.value===`live2d`?500:d.value.z+10),A=p({get:()=>a.value===`live2d`?f.value:c.value,set:e=>{a.value===`live2d`?f.value=e:c.value=e}});function M(){switch(r.mode){case`x`:h.value=0;break;case`y`:x.value=0;break;case`z`:D.value=0;break;case`scale`:A.value=1;break}}return n({resetOnMode:M}),(e,n)=>(i(),l(S,{name:`fade-side-pops-in`},{default:b(()=>[y(o)?(i(),w(`div`,Et,[v(S,{name:`fade-side-pops-in`,mode:`out-in`},{default:b(()=>[r.mode===`x`?(i(),w(`div`,Dt,[v(y(j),{modelValue:h.value,"onUpdate:modelValue":n[0]||=e=>h.value=e,min:g.value,max:_.value,step:.01,"data-direction":`vertical`,h:`50%`,"write-vertical-left":``},null,8,[`modelValue`,`min`,`max`]),T(`div`,Ot,s(h.value.toFixed(2)),1)])):r.mode===`y`?(i(),w(`div`,kt,[v(y(j),{modelValue:x.value,"onUpdate:modelValue":n[1]||=e=>x.value=e,min:C.value,max:E.value,step:.01,"write-vertical-left":``,h:`50%`,"data-direction":`vertical`},null,8,[`modelValue`,`min`,`max`]),T(`div`,At,s(x.value.toFixed(2)),1)])):y(a)===`vrm`&&r.mode===`z`?(i(),w(`div`,jt,[v(y(j),{modelValue:D.value,"onUpdate:modelValue":n[2]||=e=>D.value=e,min:O.value,max:k.value,step:.01,"write-vertical-left":``,h:`50%`,"data-direction":`vertical`},null,8,[`modelValue`,`min`,`max`]),T(`div`,Mt,s(D.value.toFixed(2)),1)])):r.mode===`scale`?(i(),w(`div`,Nt,[v(y(j),{modelValue:A.value,"onUpdate:modelValue":n[3]||=e=>A.value=e,min:0,max:3,step:1e-4,"write-vertical-left":``,h:`50%`,"data-direction":`vertical`},null,8,[`modelValue`]),T(`div`,Pt,s(A.value.toFixed(2)),1)])):t(``,!0)]),_:1})])):t(``,!0)]),_:1}))}}),[[`__scopeId`,`data-v-011f6495`]]),It={fixed:``,"bottom-0":``,"w-full":``,flex:``,"flex-col":``},Lt={relative:``,"w-full":``,"self-end":``},Rt={top:`50%`,"translate-y":`[-50%]`,fixed:``,"z-15":``,"px-3":``},zt={"translate-y":`[-100%]`,absolute:``,"right-0":``,"w-full":``,"px-3":``,"pb-3":``,"font-sans":``},Bt={flex:`~ col`,"w-full":``,"gap-1":``},Vt={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:`Hearing`},Ht={key:1,"i-solar:microphone-3-outline":``,"size-5":``,text:`neutral-500 dark:neutral-400`},Ut={key:0,"i-solar:moon-outline":``,"size-5":``,text:`neutral-500 dark:neutral-400`},Wt={key:1,"i-solar:sun-2-outline":``,"size-5":``,text:`neutral-500 dark:neutral-400`},Gt=R(e({__name:`MobileInteractiveArea`,setup(e){let{isDark:r,toggleDark:o}=F(),s=E(!1),{messages:c,sending:d,streamingMessage:p}=I(X()),x=E(`scale`),C=g(`viewControlsInputs`),D=E(``),O=E(!1),k=B(),A=re(),{activeProvider:j,activeModel:M}=I(ie());ee(document.documentElement,()=>k.update());let{themeColorsHueDynamic:N,stageViewControlsEnabled:P}=I(J()),R=Y(),{enabled:V,selectedAudioInput:H,stream:U,audioInputs:G}=I(R),{send:K,onAfterMessageComposed:oe,discoverToolsCompatibility:se,cleanupMessages:ce}=X(),{t:le}=ae(),{audioContext:q}=fe(),{startAnalyzer:ue,stopAnalyzer:de,volumeLevel:pe}=ne(),Z;function me(){return/Mobi|Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}async function he(){me()||await Q()}async function Q(){if(!(!D.value.trim()||O.value))try{let e=A.getProviderConfig(j.value);await K(D.value,{chatProvider:await A.getProviderInstance(j.value),model:M.value,providerConfig:e})}catch(e){c.value.pop(),c.value.push({role:`error`,content:e.message})}}function ge(){try{Z?.disconnect()}catch{}Z=void 0,de()}async function $(){if(ge(),!s.value||!V.value||!U.value)return;q.state===`suspended`&&await q.resume();let e=ue(q);e&&(Z=q.createMediaStreamSource(U.value),Z.connect(e))}return f([s,V,U],()=>{$()},{immediate:!0}),f(s,e=>{e&&R.askPermission()}),oe(async()=>{D.value=``}),f([j,M],async()=>{j.value&&M.value&&await se(M.value,await A.getProviderInstance(j.value),[])}),n(()=>{ge()}),u(()=>{k.update()}),(e,n)=>(i(),w(`div`,It,[(i(),l(h,null,[v(S,{name:`fade`},{default:b(()=>[y(P)?t(``,!0):(i(),l(y(te),{key:0,variant:`mobile`,messages:y(c),sending:y(d),"streaming-message":y(p),"max-w":`[calc(100%-3.5rem)]`,"w-full":``,"self-start":``,"pl-3":``,class:_([`chat-history`,[`relative z-20`]])},null,8,[`messages`,`sending`,`streaming-message`]))]),_:1})],1024)),T(`div`,Lt,[T(`div`,Rt,[v(Ft,{ref:`viewControlsInputs`,mode:x.value},null,8,[`mode`])]),T(`div`,zt,[T(`div`,Bt,[v(ze),v(y(W),{show:s.value,"onUpdate:show":n[0]||=e=>s.value=e,enabled:y(V),"onUpdate:enabled":n[1]||=e=>m(V)?V.value=e:null,"selected-audio-input":y(H),"onUpdate:selectedAudioInput":n[2]||=e=>m(H)?H.value=e:null,"audio-inputs":y(G),"volume-level":y(pe),granted:!0},{default:b(()=>[T(`button`,Vt,[v(S,{name:`fade`,mode:`out-in`},{default:b(()=>[y(V)?(i(),l(Ze,{key:0,"size-5":``,"color-class":`text-neutral-500 dark:text-neutral-400`})):(i(),w(`div`,Ht))]),_:1})])]),_:1},8,[`show`,`enabled`,`selected-audio-input`,`audio-inputs`,`volume-level`]),T(`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[3]||=e=>y(o)()},[v(S,{name:`fade`,mode:`out-in`},{default:b(()=>[y(r)?(i(),w(`div`,Ut)):(i(),w(`div`,Wt))]),_:1})]),v(y(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[10]||=[T(`div`,{"i-solar:settings-outline":``,"size-5":``,text:`neutral-500 dark:neutral-400`},null,-1)]]),_:1}),v(Tt,{modelValue:x.value,"onUpdate:modelValue":n[4]||=e=>x.value=e,onReset:n[5]||=()=>C.value?.resetOnMode()},null,8,[`modelValue`]),T(`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:`Cleanup Messages`,onClick:n[6]||=e=>y(ce)()},[...n[11]||=[T(`div`,{class:`i-solar:trash-bin-2-bold-duotone`},null,-1)]])])]),T(`div`,{bg:`white dark:neutral-800`,"max-h-100dvh":``,"max-w-100dvw":``,"w-full":``,flex:``,"gap-1":``,"overflow-auto":``,"px-3":``,"pt-2":``,style:a({paddingBottom:`${Math.max(Number.parseFloat(y(k).bottom.value.replace(`px`,``)),12)}px`})},[v(y(z),{modelValue:D.value,"onUpdate:modelValue":n[7]||=e=>D.value=e,placeholder:y(le)(`stage.message`),border:`solid 2 neutral-200/60 dark:neutral-700/60`,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:_([y(N)?`transition-colors-none placeholder:transition-colors-none`:``]),"default-height":`1lh`,onSubmit:he,onCompositionstart:n[8]||=e=>O.value=!0,onCompositionend:n[9]||=e=>O.value=!1},null,8,[`modelValue`,`placeholder`,`class`]),D.value.trim()||O.value?(i(),w(`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:Q},[...n[12]||=[T(`div`,{"i-solar:arrow-up-outline":``},null,-1)]])):t(``,!0)],4)])]))}}),[[`__scopeId`,`data-v-4462c9b7`]]),Kt={class:`relative`},qt={absolute:``,"left-0":``,"right-0":``,"top-0":``,"w-full":``,"overflow-hidden":``},Jt=R(e({__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=E(t.height),r=E(t.amplitude),o=E(t.waveLength),s=E(t.fillColor),c=E(t.direction),l=E(t.movementDirection);function u(e,t,n,r,i){let a=[],o=Math.ceil(e/r)*r,s=i===`up`?n:t-n;a.push(`M 0 ${s}`);let c=Math.PI*2/r;for(let e=0;e<=o;e+=1){let t=n*Math.sin(c*e),r=i===`up`?s-t:s+t;a.push(`L ${e} ${r}`)}let l=i===`up`?t:0;return a.push(`L ${o} ${l}`),a.push(`L 0 ${l} Z`),a.join(` `)}let m=p(()=>n.value+r.value*2),h=p(()=>{let e=` `;return`url(data:image/svg+xml;base64,${btoa(e)})`});return f(()=>[t.height,t.amplitude,t.waveLength,t.fillColor,t.direction,t.movementDirection],()=>{n.value=t.height,r.value=t.amplitude,o.value=t.waveLength,s.value=t.fillColor,c.value=t.direction,l.value=t.movementDirection},{immediate:!0}),(t,n)=>(i(),w(`div`,Kt,[d(t.$slots,`default`,{},void 0,!0),T(`div`,qt,[T(`div`,{class:`colored-area wave`,style:a({background:s.value,height:`${m.value}px`,maskImage:h.value,WebkitMaskImage:h.value,"--wave-translate":`${-o.value}px`,"--animation-duration":`${o.value/e.animationSpeed}s`,"animation-direction":l.value===`left`?`normal`:`reverse`})},null,4)])]))}}),[[`__scopeId`,`data-v-33a54ad1`]]),Yt={relative:``,flex:`~ col`,"z-2":``,"h-100dvh":``,"w-100vw":``,"of-hidden":``},Xt={class:`px-0 py-1 md:px-3 md:py-3`,"w-full":``,"gap-2":``},Zt={relative:``,flex:`~ 1 row gap-y-0 gap-x-2 h(),{immediate:!0}),u(()=>h());let{stream:g,enabled:_}=I(Y()),{startRecord:x,stopRecord:S,onStopRecord:C}=K(g),{transcribeForRecording:w}=pe(),D=re(),{activeProvider:O,activeModel:k}=I(ie()),A=X(),{init:j,dispose:M,start:N,loaded:P}=ve(_e,{threshold:E(.6),onSpeechStart:()=>x(),onSpeechEnd:()=>S()}),L;async function R(){try{await j(),g.value&&await N(g.value),L=C(async e=>{let t=await w(e);if(!(!t||!t.trim()))try{let e=await D.getProviderInstance(O.value);if(!e||!k.value)return;await A.send(t,{model:k.value,chatProvider:e})}catch(e){console.error(`Failed to send chat from voice:`,e)}})}catch(e){console.error(`Audio interaction init failed:`,e)}}function z(){try{L?.(),L=void 0,M()}catch{}}return f(_,async e=>{e?await R():z()},{immediate:!0}),n(()=>{z()}),f([g,()=>P.value],async([e,t])=>{if(_.value&&t&&e)try{await N(e)}catch(e){console.error(`Failed to start VAD with stream:`,e)}}),(e,n)=>(i(),l(Re,null,{default:b(()=>[v(Jt,{class:`widgets top-widgets`,"fill-color":y(r)?`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:b(()=>[T(`div`,Yt,[T(`div`,Xt,[v(He,{class:`hidden md:flex`}),v(bt,{class:`flex md:hidden`})]),T(`div`,Zt,[v(y(de),{"flex-1":``,"min-w":`1/2`,paused:a.value,"focus-at":{x:y(s).x.value,y:y(s).y.value},"x-offset":`${y(m)?y(d).x:y(d).x-10}%`,"y-offset":y(p).y,scale:y(c)},null,8,[`paused`,`focus-at`,`x-offset`,`y-offset`,`scale`]),y(m)?t(``,!0):(i(),l(mt,{key:0,h:`85dvh`,absolute:``,"right-4":``,flex:``,"flex-1":``,"flex-col":``,"max-w":`500px`,"min-w":`30%`})),y(m)?(i(),l(Gt,{key:1,onSettingsOpen:o})):t(``,!0)])])]),_:1},8,[`fill-color`])]),_:1}))}});typeof Q==`function`&&Q(Qt);var $t=Qt;export{$t as default}; \ No newline at end of file diff --git a/assets/player2-speech-DRfVfleA.js b/assets/player2-speech-Bb53Rejb.js similarity index 93% rename from assets/player2-speech-DRfVfleA.js rename to assets/player2-speech-Bb53Rejb.js index 9e21a865ed874f6fce18d4c04e5326a25fc28c86..118e9074d5bbcad2a8dc9a99d9052f2140d61a02 100644 --- a/assets/player2-speech-DRfVfleA.js +++ b/assets/player2-speech-Bb53Rejb.js @@ -1 +1 @@ -import{A as e,C as t,K as n,O as r,Pt as i,S as a,W as o,at as s,b as c,k as l,kt as u,lt as d,m as f,w as p,x as m,xt as h}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-CZ9Rvki9.js";import{l as g}from"./src-DYQXbDgu.js";import"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{c as _,gt as v,u as y}from"./components-BR_Kqwtu.js";import{i as b,t as x}from"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import{n as S}from"./vue-i18n.runtime-Dah5zGm4.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-D1kLcsvA.js";import"./__vite-browser-external-BaycPy5b.js";import{t as C}from"./route-block-CpjdOEnv.js";var w=`player2-speech`,T=`v1`,E=e({__name:`player2-speech`,setup(e){let C=h(1),E=x(),D=b(),{t:O}=S(),k=c(()=>E.availableVoices[w]||[]);async function A(e,t,n){let r=await D.getProviderInstance(w);if(!r)throw Error(`Failed to initialize speech provider`);let i=D.getProviderConfig(w),a=i.model||T;return await E.speech(r,a,e,t,{...i})}let j=h(!0);return o(async()=>{let e=D.getProviderConfig(w);await D.getProviderMetadata(w).validators.validateProviderConfig(e)?await E.loadVoicesForProvider(w):console.error(`Failed to validate provider config`,e);try{let t=e.baseUrl??``;j.value=(await fetch(`${t.endsWith(`/`)?t.slice(0,-1):t}/health`,{method:`GET`,headers:{"player2-game-key":`airi`}})).status===200}catch(e){console.error(e),j.value=!1}}),s(C,async()=>{let e=D.getProviderConfig(w);e.speed=C.value}),(e,o)=>(n(),p(f,null,[l(u(_),{"provider-id":w,"default-model":T},{"voice-settings":d(()=>[l(u(g),{modelValue:C.value,"onUpdate:modelValue":o[0]||=e=>C.value=e,label:u(O)(`settings.pages.providers.provider.common.fields.field.speed.label`),description:u(O)(`settings.pages.providers.provider.common.fields.field.speed.description`),min:.5,max:5,step:.01},null,8,[`modelValue`,`label`,`description`])]),playground:d(()=>[l(u(y),{"available-voices":k.value,"generate-speech":A,"api-key-configured":!0,"default-text":`Hello! This is a test of the Player 2 voice synthesis.`},null,8,[`available-voices`])]),_:1}),j.value?t(``,!0):(n(),a(u(v),{key:0,type:`error`},{title:d(()=>[r(i(u(O)(`settings.dialogs.onboarding.validationFailed`)),1)]),content:d(()=>[...o[1]||=[m(`div`,{class:`whitespace-pre-wrap break-all`},[m(`div`,null,[r(` Please download and run the Player2 App: `),m(`a`,{href:`https://player2.game`,target:`_blank`,rel:`noopener noreferrer`},` https://player2.game `),m(`div`,null,[r(` After downloading, if you still are having trouble, please reach out to us on Discord: `),m(`a`,{href:`https://player2.game/discord`,target:`_blank`,rel:`noopener noreferrer`},` https://player2.game/discord `),r(`. `)])])],-1)]]),_:1}))],64))}});typeof C==`function`&&C(E);var D=E;export{D as default}; \ No newline at end of file +import{A as e,C as t,K as n,O as r,Pt as i,S as a,W as o,at as s,b as c,k as l,kt as u,lt as d,m as f,w as p,x as m,xt as h}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-C0YByt49.js";import{l as g}from"./src-DYQXbDgu.js";import"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{c as _,gt as v,u as y}from"./components-CeE-UiLT.js";import{i as b,t as x}from"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import{n as S}from"./vue-i18n.runtime-Dah5zGm4.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-73vyHOZs.js";import"./__vite-browser-external-BaycPy5b.js";import{t as C}from"./route-block-CpjdOEnv.js";var w=`player2-speech`,T=`v1`,E=e({__name:`player2-speech`,setup(e){let C=h(1),E=x(),D=b(),{t:O}=S(),k=c(()=>E.availableVoices[w]||[]);async function A(e,t,n){let r=await D.getProviderInstance(w);if(!r)throw Error(`Failed to initialize speech provider`);let i=D.getProviderConfig(w),a=i.model||T;return await E.speech(r,a,e,t,{...i})}let j=h(!0);return o(async()=>{let e=D.getProviderConfig(w);await D.getProviderMetadata(w).validators.validateProviderConfig(e)?await E.loadVoicesForProvider(w):console.error(`Failed to validate provider config`,e);try{let t=e.baseUrl??``;j.value=(await fetch(`${t.endsWith(`/`)?t.slice(0,-1):t}/health`,{method:`GET`,headers:{"player2-game-key":`airi`}})).status===200}catch(e){console.error(e),j.value=!1}}),s(C,async()=>{let e=D.getProviderConfig(w);e.speed=C.value}),(e,o)=>(n(),p(f,null,[l(u(_),{"provider-id":w,"default-model":T},{"voice-settings":d(()=>[l(u(g),{modelValue:C.value,"onUpdate:modelValue":o[0]||=e=>C.value=e,label:u(O)(`settings.pages.providers.provider.common.fields.field.speed.label`),description:u(O)(`settings.pages.providers.provider.common.fields.field.speed.description`),min:.5,max:5,step:.01},null,8,[`modelValue`,`label`,`description`])]),playground:d(()=>[l(u(y),{"available-voices":k.value,"generate-speech":A,"api-key-configured":!0,"default-text":`Hello! This is a test of the Player 2 voice synthesis.`},null,8,[`available-voices`])]),_:1}),j.value?t(``,!0):(n(),a(u(v),{key:0,type:`error`},{title:d(()=>[r(i(u(O)(`settings.dialogs.onboarding.validationFailed`)),1)]),content:d(()=>[...o[1]||=[m(`div`,{class:`whitespace-pre-wrap break-all`},[m(`div`,null,[r(` Please download and run the Player2 App: `),m(`a`,{href:`https://player2.game`,target:`_blank`,rel:`noopener noreferrer`},` https://player2.game `),m(`div`,null,[r(` After downloading, if you still are having trouble, please reach out to us on Discord: `),m(`a`,{href:`https://player2.game/discord`,target:`_blank`,rel:`noopener noreferrer`},` https://player2.game/discord `),r(`. `)])])],-1)]]),_:1}))],64))}});typeof C==`function`&&C(E);var D=E;export{D as default}; \ No newline at end of file diff --git a/assets/polaroid-CqSaE7FQ.js b/assets/polaroid-DwT_lq0B.js similarity index 79% rename from assets/polaroid-CqSaE7FQ.js rename to assets/polaroid-DwT_lq0B.js index f5b6ea00f325e6cdda318c7b4f426c0fc813c537..68902f3e6c95ec9326be5dbc794b15313dcc32cb 100644 --- a/assets/polaroid-CqSaE7FQ.js +++ b/assets/polaroid-DwT_lq0B.js @@ -1 +1 @@ -import{A as e,J as t,K as n,Pt as r,at as i,c as a,k as o,kt as s,lt as c,m as l,ut as u,w as d,x as f,xt as p}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./tres-B5z5lcdF.js";import{o as m}from"./widgets-CZ9Rvki9.js";import"./src-DYQXbDgu.js";import{a as h}from"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import"./components-BR_Kqwtu.js";import"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import"./stream-transcription-_Xuw_VzN.js";import"./browser-DY5K31Vk.js";import"./scenes-Ct-xUphs.js";import{n as g}from"./settings-D1kLcsvA.js";import"./__vite-browser-external-BaycPy5b.js";import"./chat-CSFza6dY.js";import"./airi-card-DuhaYjQU.js";import"./hearing-BH9rth_f.js";import{a as _,i as v}from"./src-BccD0BFR.js";import"./live2d-DukystQI.js";var y={flex:``,"flex-col":``,"items-center":``,"gap-4":``},b={"h-full":``,"w-full":``},x=[`value`],S=e({__name:`polaroid`,setup(e){let S=p(),C=p(),{stageModelSelectedUrl:w}=h(g()),T=p(`idle`),E=p([]);function D(e,t){let n=document.createElement(`a`);n.href=e,n.download=t,document.body.appendChild(n),n.click(),document.body.removeChild(n)}function O(e){C.value?.setMotion(e)}i(C,e=>{E.value=e?.listMotionGroups()||[]},{immediate:!0});function k(){C.value&&(C.value?.setMotion(T.value),E.value=C.value.listMotionGroups())}function A(){!S.value||!C.value||D(S.value.canvasElement().toDataURL(`image/png`),`live2d-screenshot.png`)}return(e,i)=>(n(),d(`div`,y,[f(`div`,b,[o(s(m),{relative:``,"min-h-70dvh":``},{default:c(({width:e,height:t})=>[o(s(_),{ref_key:`live2dCanvasRef`,ref:S,width:e,height:t,resolution:3,"rounded-full":``},{default:c(({app:n})=>[o(s(v),{ref_key:`live2dModelRef`,ref:C,"model-src":s(w),app:n,width:e,height:t,"focus-at":{x:e/2,y:t/2},onModelLoaded:k},null,8,[`model-src`,`app`,`width`,`height`,`focus-at`])]),_:2},1032,[`width`,`height`])]),_:1})]),f(`div`,null,[u(f(`select`,{"onUpdate:modelValue":i[0]||=e=>T.value=e,"rounded-lg":``,"px-3":``,"py-2":``,onChange:i[1]||=e=>O(T.value)},[(n(!0),d(l,null,t(E.value,e=>(n(),d(`option`,{key:e.motionIndex,value:e.motionName},r(e.fileName),9,x))),128))],544),[[a,T.value]])]),f(`div`,{border:`2px solid black dark:white`,flex:``,"items-center":``,"justify-center":``,"rounded-full":``,"p-1":``},[f(`button`,{class:`h-15 w-15 md:h-18 md:w-18`,bg:`black active:neutral-950 dark:white dark:active:neutral-50`,"rounded-full":``,"outline-none":``,"transition-colors":``,"duration-200":``,"ease-in-out":``,onClick:A})])]))}});export{S as default}; \ No newline at end of file +import{A as e,J as t,K as n,Pt as r,at as i,c as a,k as o,kt as s,lt as c,m as l,ut as u,w as d,x as f,xt as p}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./tres-Bk8ucvrj.js";import{o as m}from"./widgets-C0YByt49.js";import"./src-DYQXbDgu.js";import{a as h}from"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import"./components-CeE-UiLT.js";import"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import"./stream-transcription-_Xuw_VzN.js";import"./browser-DY5K31Vk.js";import"./scenes-BnArCCLz.js";import{n as g}from"./settings-73vyHOZs.js";import"./__vite-browser-external-BaycPy5b.js";import"./chat-CxQ_IGrj.js";import"./airi-card-DuhaYjQU.js";import"./hearing-BH9rth_f.js";import{a as _,i as v}from"./src-mAITpvbv.js";import"./live2d-DukystQI.js";var y={flex:``,"flex-col":``,"items-center":``,"gap-4":``},b={"h-full":``,"w-full":``},x=[`value`],S=e({__name:`polaroid`,setup(e){let S=p(),C=p(),{stageModelSelectedUrl:w}=h(g()),T=p(`idle`),E=p([]);function D(e,t){let n=document.createElement(`a`);n.href=e,n.download=t,document.body.appendChild(n),n.click(),document.body.removeChild(n)}function O(e){C.value?.setMotion(e)}i(C,e=>{E.value=e?.listMotionGroups()||[]},{immediate:!0});function k(){C.value&&(C.value?.setMotion(T.value),E.value=C.value.listMotionGroups())}function A(){!S.value||!C.value||D(S.value.canvasElement().toDataURL(`image/png`),`live2d-screenshot.png`)}return(e,i)=>(n(),d(`div`,y,[f(`div`,b,[o(s(m),{relative:``,"min-h-70dvh":``},{default:c(({width:e,height:t})=>[o(s(_),{ref_key:`live2dCanvasRef`,ref:S,width:e,height:t,resolution:3,"rounded-full":``},{default:c(({app:n})=>[o(s(v),{ref_key:`live2dModelRef`,ref:C,"model-src":s(w),app:n,width:e,height:t,"focus-at":{x:e/2,y:t/2},onModelLoaded:k},null,8,[`model-src`,`app`,`width`,`height`,`focus-at`])]),_:2},1032,[`width`,`height`])]),_:1})]),f(`div`,null,[u(f(`select`,{"onUpdate:modelValue":i[0]||=e=>T.value=e,"rounded-lg":``,"px-3":``,"py-2":``,onChange:i[1]||=e=>O(T.value)},[(n(!0),d(l,null,t(E.value,e=>(n(),d(`option`,{key:e.motionIndex,value:e.motionName},r(e.fileName),9,x))),128))],544),[[a,T.value]])]),f(`div`,{border:`2px solid black dark:white`,flex:``,"items-center":``,"justify-center":``,"rounded-full":``,"p-1":``},[f(`button`,{class:`h-15 w-15 md:h-18 md:w-18`,bg:`black active:neutral-950 dark:white dark:active:neutral-50`,"rounded-full":``,"outline-none":``,"transition-colors":``,"duration-200":``,"ease-in-out":``,onClick:A})])]))}});export{S as default}; \ No newline at end of file diff --git a/assets/providers-CP--1bBf.js b/assets/providers-CGUDsN-A.js similarity index 94% rename from assets/providers-CP--1bBf.js rename to assets/providers-CGUDsN-A.js index d611d0a85b998fe1d8f48865adf1a3913090e9d3..678aaf3a3ae18ad01d0578e3babd0ec2c7d3e919 100644 --- a/assets/providers-CP--1bBf.js +++ b/assets/providers-CGUDsN-A.js @@ -1 +1 @@ -import{A as e,H as t,K as n,Pt as r,X as i,Z as a,at as o,b as s,jt as c,k as l,kt as u,lt as d,m as f,ut as p,w as m,x as h}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-CZ9Rvki9.js";import"./src-DYQXbDgu.js";import{a as g}from"./resettable-CbXzRviW.js";import{a as _}from"./vue-router-Chhv6vZu.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{_t as v,yt as y}from"./components-BR_Kqwtu.js";import{i as b}from"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-D1kLcsvA.js";import"./__vite-browser-external-BaycPy5b.js";import{t as x}from"./route-block-CpjdOEnv.js";import{t as S}from"./use-ripple-grid-state-DcESPJAf.js";function C(e,n={}){let{offset:r=16,behavior:i=`smooth`,maxRetries:a=10,retryDelay:s=100,scrollContainer:c=null,auto:l=!1}=n,d,f=()=>{if(!c)return window;if(typeof c==`string`){let e=document.querySelector(c);return e instanceof HTMLElement?e:window}return c},p=(e,t=0)=>{e&&(d&&=(clearTimeout(d),void 0),requestAnimationFrame(()=>{let n=e.length>1?document.getElementById(e.slice(1)):null;if(n){let e=f();if(e instanceof Window){let e=n.getBoundingClientRect().top+window.scrollY-r;window.scrollTo({top:e,behavior:i})}else{let t=e.getBoundingClientRect(),a=n.getBoundingClientRect().top-t.top+e.scrollTop-r;e.scrollTo({top:a,behavior:i})}return}tp(e,t+1),s))}))};return l&&e&&o(()=>typeof e==`function`?e():u(e),e=>{e&&p(e)},{immediate:!0}),t(()=>{d&&clearTimeout(d)}),{scrollToHash:p}}var w={"mb-6":``,flex:``,"flex-col":``,"gap-5":``},T={bg:`primary-500/10 dark:primary-800/25`,"rounded-lg":``,"p-4":``},E={"mb-2":``,"text-xl":``,"font-normal":``,text:`primary-800 dark:primary-100`},D={text:`primary-700 dark:primary-300`},O={flex:`~ row items-center gap-2`},k=[`id`],A={text:`neutral-300 dark:neutral-500 sm sm:base`},j={flex:``,"text-nowrap":``,text:`2xl sm:3xl`,"font-normal":``},M={text:`neutral-500/5 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":``},N=e({__name:`index`,setup(e){let t=_(),o=b(),{lastClickedIndex:x,setLastClickedIndex:N}=S(),{allChatProvidersMetadata:P,allAudioSpeechProvidersMetadata:F,allAudioTranscriptionProvidersMetadata:I}=g(o),L=[{id:`chat`,icon:`i-solar:chat-square-like-bold-duotone`,title:`Chat`,description:`Text generation model providers. e.g. OpenRouter, OpenAI, Ollama.`,providersRef:P},{id:`speech`,icon:`i-solar:user-speak-rounded-bold-duotone`,title:`Speech`,description:`Speech (text-to-speech) model providers. e.g. ElevenLabs, Azure Speech.`,providersRef:F},{id:`transcription`,icon:`i-solar:microphone-3-bold-duotone`,title:`Transcription`,description:`Transcription (speech-to-text) model providers. e.g. Whisper.cpp, OpenAI, Azure Speech`,providersRef:I}],R=s(()=>{let e=0;return L.map(t=>({id:t.id,icon:t.icon,title:t.title,description:t.description,providers:t.providersRef.value.map(t=>({...t,renderIndex:e++}))}))});return C(()=>t.hash,{auto:!0,offset:16,behavior:`smooth`,maxRetries:15,retryDelay:150}),(e,t)=>{let o=i(`i18n-t`),s=a(`motion`);return n(),m(f,null,[h(`div`,w,[h(`div`,T,[h(`div`,E,r(e.$t(`settings.pages.providers.helpinfo.title`)),1),h(`div`,D,[l(o,{keypath:`settings.pages.providers.helpinfo.description`},{chat:d(()=>[...t[1]||=[h(`div`,{bg:`primary-500/10 dark:primary-800/25`,"inline-flex":``,"items-center":``,"gap-1":``,"rounded-lg":``,"px-2":``,"py-0.5":``,"translate-y":`[0.25lh]`},[h(`div`,{"i-solar:chat-square-like-bold-duotone":``}),h(`strong`,{class:`font-normal`},`Chat`)],-1)]]),_:1})])]),l(u(y),{sections:R.value,"get-items":e=>e.providers,columns:{default:1,sm:2,xl:3},"origin-index":u(x),onItemClick:t[0]||=({globalIndex:e})=>u(N)(e)},{header:d(({section:e})=>[h(`div`,O,[h(`div`,{id:e.id,class:c(e.icon),text:`neutral-500 dark:neutral-400 4xl`},null,10,k),h(`div`,null,[h(`div`,null,[h(`span`,A,r(e.description),1)]),h(`div`,j,[h(`div`,null,r(e.title),1)])])])]),item:d(({item:e})=>[l(u(v),{title:e.localizedName||`Unknown`,description:e.localizedDescription,icon:e.icon,"icon-color":e.iconColor,"icon-image":e.iconImage,to:`/settings/providers/${e.category}/${e.id}`,configured:e.configured},null,8,[`title`,`description`,`icon`,`icon-color`,`icon-image`,`to`,`configured`])]),_:1},8,[`sections`,`get-items`,`origin-index`])]),p((n(),m(`div`,M,[...t[2]||=[h(`div`,{text:`60`,"i-solar:box-minimalistic-bold-duotone":``},null,-1)]])),[[s]])],64)}}});typeof x==`function`&&x(N);var P=N;export{P as default}; \ No newline at end of file +import{A as e,H as t,K as n,Pt as r,X as i,Z as a,at as o,b as s,jt as c,k as l,kt as u,lt as d,m as f,ut as p,w as m,x as h}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-C0YByt49.js";import"./src-DYQXbDgu.js";import{a as g}from"./resettable-CbXzRviW.js";import{a as _}from"./vue-router-Chhv6vZu.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{_t as v,yt as y}from"./components-CeE-UiLT.js";import{i as b}from"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-73vyHOZs.js";import"./__vite-browser-external-BaycPy5b.js";import{t as x}from"./route-block-CpjdOEnv.js";import{t as S}from"./use-ripple-grid-state-DcESPJAf.js";function C(e,n={}){let{offset:r=16,behavior:i=`smooth`,maxRetries:a=10,retryDelay:s=100,scrollContainer:c=null,auto:l=!1}=n,d,f=()=>{if(!c)return window;if(typeof c==`string`){let e=document.querySelector(c);return e instanceof HTMLElement?e:window}return c},p=(e,t=0)=>{e&&(d&&=(clearTimeout(d),void 0),requestAnimationFrame(()=>{let n=e.length>1?document.getElementById(e.slice(1)):null;if(n){let e=f();if(e instanceof Window){let e=n.getBoundingClientRect().top+window.scrollY-r;window.scrollTo({top:e,behavior:i})}else{let t=e.getBoundingClientRect(),a=n.getBoundingClientRect().top-t.top+e.scrollTop-r;e.scrollTo({top:a,behavior:i})}return}tp(e,t+1),s))}))};return l&&e&&o(()=>typeof e==`function`?e():u(e),e=>{e&&p(e)},{immediate:!0}),t(()=>{d&&clearTimeout(d)}),{scrollToHash:p}}var w={"mb-6":``,flex:``,"flex-col":``,"gap-5":``},T={bg:`primary-500/10 dark:primary-800/25`,"rounded-lg":``,"p-4":``},E={"mb-2":``,"text-xl":``,"font-normal":``,text:`primary-800 dark:primary-100`},D={text:`primary-700 dark:primary-300`},O={flex:`~ row items-center gap-2`},k=[`id`],A={text:`neutral-300 dark:neutral-500 sm sm:base`},j={flex:``,"text-nowrap":``,text:`2xl sm:3xl`,"font-normal":``},M={text:`neutral-500/5 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":``},N=e({__name:`index`,setup(e){let t=_(),o=b(),{lastClickedIndex:x,setLastClickedIndex:N}=S(),{allChatProvidersMetadata:P,allAudioSpeechProvidersMetadata:F,allAudioTranscriptionProvidersMetadata:I}=g(o),L=[{id:`chat`,icon:`i-solar:chat-square-like-bold-duotone`,title:`Chat`,description:`Text generation model providers. e.g. OpenRouter, OpenAI, Ollama.`,providersRef:P},{id:`speech`,icon:`i-solar:user-speak-rounded-bold-duotone`,title:`Speech`,description:`Speech (text-to-speech) model providers. e.g. ElevenLabs, Azure Speech.`,providersRef:F},{id:`transcription`,icon:`i-solar:microphone-3-bold-duotone`,title:`Transcription`,description:`Transcription (speech-to-text) model providers. e.g. Whisper.cpp, OpenAI, Azure Speech`,providersRef:I}],R=s(()=>{let e=0;return L.map(t=>({id:t.id,icon:t.icon,title:t.title,description:t.description,providers:t.providersRef.value.map(t=>({...t,renderIndex:e++}))}))});return C(()=>t.hash,{auto:!0,offset:16,behavior:`smooth`,maxRetries:15,retryDelay:150}),(e,t)=>{let o=i(`i18n-t`),s=a(`motion`);return n(),m(f,null,[h(`div`,w,[h(`div`,T,[h(`div`,E,r(e.$t(`settings.pages.providers.helpinfo.title`)),1),h(`div`,D,[l(o,{keypath:`settings.pages.providers.helpinfo.description`},{chat:d(()=>[...t[1]||=[h(`div`,{bg:`primary-500/10 dark:primary-800/25`,"inline-flex":``,"items-center":``,"gap-1":``,"rounded-lg":``,"px-2":``,"py-0.5":``,"translate-y":`[0.25lh]`},[h(`div`,{"i-solar:chat-square-like-bold-duotone":``}),h(`strong`,{class:`font-normal`},`Chat`)],-1)]]),_:1})])]),l(u(y),{sections:R.value,"get-items":e=>e.providers,columns:{default:1,sm:2,xl:3},"origin-index":u(x),onItemClick:t[0]||=({globalIndex:e})=>u(N)(e)},{header:d(({section:e})=>[h(`div`,O,[h(`div`,{id:e.id,class:c(e.icon),text:`neutral-500 dark:neutral-400 4xl`},null,10,k),h(`div`,null,[h(`div`,null,[h(`span`,A,r(e.description),1)]),h(`div`,j,[h(`div`,null,r(e.title),1)])])])]),item:d(({item:e})=>[l(u(v),{title:e.localizedName||`Unknown`,description:e.localizedDescription,icon:e.icon,"icon-color":e.iconColor,"icon-image":e.iconImage,to:`/settings/providers/${e.category}/${e.id}`,configured:e.configured},null,8,[`title`,`description`,`icon`,`icon-color`,`icon-image`,`to`,`configured`])]),_:1},8,[`sections`,`get-items`,`origin-index`])]),p((n(),m(`div`,M,[...t[2]||=[h(`div`,{text:`60`,"i-solar:box-minimalistic-bold-duotone":``},null,-1)]])),[[s]])],64)}}});typeof x==`function`&&x(N);var P=N;export{P as default}; \ No newline at end of file diff --git a/assets/scene-NwOIl7WX.js b/assets/scene-1FHG2Mso.js similarity index 84% rename from assets/scene-NwOIl7WX.js rename to assets/scene-1FHG2Mso.js index 3a4054f3467714c24d6eff272ad275e107c79ed2..1d5413fbdf76a1e3e32207321e278cc4702e635e 100644 --- a/assets/scene-NwOIl7WX.js +++ b/assets/scene-1FHG2Mso.js @@ -1 +1 @@ -import{A as e,K as t,O as n,Z as r,k as i,kt as a,lt as o,m as s,ut as c,w as l,x as u}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import{u as d}from"./widgets-CZ9Rvki9.js";import"./src-DYQXbDgu.js";import"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import"./components-BR_Kqwtu.js";import"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-D1kLcsvA.js";import"./__vite-browser-external-BaycPy5b.js";import{t as f}from"./route-block-CpjdOEnv.js";var 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:20},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``},m=e({__name:`index`,setup(e){return(e,f)=>{let m=r(`motion`);return t(),l(s,null,[u(`div`,null,[i(a(d),{label:`In development, needs your help!`,theme:`orange`},{default:o(()=>[...f[0]||=[u(`div`,null,[n(` This functionality is still under development. If you have any suggestions or would like to contribute, please reach out to us on our `),u(`a`,{underline:``,"decoration-dotted":``,href:`https://github.com/moeru-ai/airi/issues`},`GitHub issues page`),n(`. The source code of this page is located at `),u(`a`,{underline:``,"decoration-dotted":``,href:`https://github.com/moeru-ai/airi/tree/main/apps/stage-web/src/pages/settings/scene/index.vue`},`here`),n(`. `)],-1)]]),_:1})]),c((t(),l(`div`,p,[...f[1]||=[u(`div`,{text:`60`,"i-solar:armchair-2-bold-duotone":``},null,-1)]])),[[m]])],64)}}});typeof f==`function`&&f(m);var h=m;export{h as default}; \ No newline at end of file +import{A as e,K as t,O as n,Z as r,k as i,kt as a,lt as o,m as s,ut as c,w as l,x as u}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import{u as d}from"./widgets-C0YByt49.js";import"./src-DYQXbDgu.js";import"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import"./components-CeE-UiLT.js";import"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-73vyHOZs.js";import"./__vite-browser-external-BaycPy5b.js";import{t as f}from"./route-block-CpjdOEnv.js";var 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:20},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":``,flex:``,"items-center":``,"justify-center":``},m=e({__name:`index`,setup(e){return(e,f)=>{let m=r(`motion`);return t(),l(s,null,[u(`div`,null,[i(a(d),{label:`In development, needs your help!`,theme:`orange`},{default:o(()=>[...f[0]||=[u(`div`,null,[n(` This functionality is still under development. If you have any suggestions or would like to contribute, please reach out to us on our `),u(`a`,{underline:``,"decoration-dotted":``,href:`https://github.com/moeru-ai/airi/issues`},`GitHub issues page`),n(`. The source code of this page is located at `),u(`a`,{underline:``,"decoration-dotted":``,href:`https://github.com/moeru-ai/airi/tree/main/apps/stage-web/src/pages/settings/scene/index.vue`},`here`),n(`. `)],-1)]]),_:1})]),c((t(),l(`div`,p,[...f[1]||=[u(`div`,{text:`60`,"i-solar:armchair-2-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/scenes-Ct-xUphs.js b/assets/scenes-BnArCCLz.js similarity index 99% rename from assets/scenes-Ct-xUphs.js rename to assets/scenes-BnArCCLz.js index 94bd1d1c6a3f1c9f087c3b93c02c96f3997fc97f..0d946c1bc9b52885bbffca912a4d7b0968995349 100644 --- a/assets/scenes-Ct-xUphs.js +++ b/assets/scenes-BnArCCLz.js @@ -1,5 +1,5 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/__vite-browser-external-D2g2gZ4Q.js","assets/__vite-browser-external-BaycPy5b.js","assets/chunk-B78Zgmat.js","assets/default-node-BJAWWm9L.js","assets/preload-helper-Dn1uWANL.js","assets/import-url-browser-CzUXxC7A.js","assets/import-url-browser-DRsAP6zH.js","assets/duckdb-mvp-BP8S3C4a.js","assets/import-url-node-BEwwqk0-.js"])))=>i.map(i=>d[i]); -import{a as e,r as t}from"./chunk-B78Zgmat.js";import{A as n,C as r,G as i,K as a,R as o,S as s,W as c,kt as l,nt as u,w as d,x as ee,xt as te}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import{tt as ne}from"./src-DYQXbDgu.js";import{a as re}from"./resettable-CbXzRviW.js";import{n as ie,t as ae}from"./preload-helper-Dn1uWANL.js";import{i as oe,l as se,o as ce}from"./environment-CyZLTg97.js";import{a as le}from"./dist-Che88T83.js";import{d as ue,f as de,g as fe,m as pe,p as me,xt as he}from"./components-BR_Kqwtu.js";import{i as ge,n as _e,t as ve}from"./speech-6W29lyZ_.js";import{a as ye,n as be,o as xe}from"./stream-transcription-_Xuw_VzN.js";import{D as Se,O as Ce,n as we}from"./settings-D1kLcsvA.js";import{n as Te}from"./chat-CSFza6dY.js";import{n as Ee,r as De,t as Oe}from"./src-BccD0BFR.js";import{n as ke}from"./live2d-DukystQI.js";import{t as Ae}from"./import-url-browser-DRsAP6zH.js";function je(e,t){return ye(e*1e3,t?.in)}function Me(e,t){let n=Ne(t)?new t(0):xe(t,0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n}function Ne(e){return typeof e==`function`&&e.prototype?.constructor===e}function f(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 Pe(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 p(e){return this instanceof p?(this.v=e,this):new p(e)}function Fe(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){ee(a[0][3],e)}}function l(e){e.value instanceof p?Promise.resolve(e.value.v).then(u,d):ee(a[0][2],e)}function u(e){c(`next`,e)}function d(e){c(`throw`,e)}function ee(e,t){e(t),a.shift(),a.length&&c(a[0][0],a[0][1])}}function Ie(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:p(e[r](t)),done:!1}:i?i(t):t}:i}}function Le(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof Pe==`function`?Pe(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)}}var Re=new TextDecoder(`utf-8`);const ze=e=>Re.decode(e);var Be=new TextEncoder;const Ve=e=>Be.encode(e);var He=e=>typeof e==`number`,Ue=e=>typeof e==`boolean`,We=e=>typeof e==`function`;const Ge=e=>e!=null&&Object(e)===e,Ke=e=>Ge(e)&&We(e.then),qe=e=>Ge(e)&&We(e[Symbol.iterator]),Je=e=>Ge(e)&&We(e[Symbol.asyncIterator]),Ye=e=>Ge(e)&&Ge(e.schema),Xe=e=>Ge(e)&&`done`in e&&`value`in e,Ze=e=>Ge(e)&&We(e.stat)&&He(e.fd),Qe=e=>Ge(e)&&tt(e.body);var $e=e=>`_getDOMStream`in e&&`_getNodeStream`in e;const et=e=>Ge(e)&&We(e.abort)&&We(e.getWriter)&&!$e(e),tt=e=>Ge(e)&&We(e.cancel)&&We(e.getReader)&&!$e(e),nt=e=>Ge(e)&&We(e.end)&&We(e.write)&&Ue(e.writable)&&!$e(e),rt=e=>Ge(e)&&We(e.read)&&We(e.pipe)&&Ue(e.readable)&&!$e(e),it=e=>Ge(e)&&We(e.clear)&&We(e.bytes)&&We(e.position)&&We(e.setPosition)&&We(e.capacity)&&We(e.getBufferIdentifier)&&We(e.createLong);var at=typeof SharedArrayBuffer<`u`?SharedArrayBuffer:ArrayBuffer;function ot(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;++cm(Int32Array,e),ut=e=>m(BigInt64Array,e),h=e=>m(Uint8Array,e);var dt=e=>(e.next(),e);function*ft(e,t){let n=function*(e){yield e};return yield*dt((function*(t){let n=null;do n=t.next(yield m(e,n));while(!n.done)})((typeof t==`string`||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof at?n(t):qe(t)?t:n(t))[Symbol.iterator]())),new e}const pt=e=>ft(Uint8Array,e);function mt(e,t){return Fe(this,arguments,function*(){if(Ke(t))return yield p(yield p(yield*Ie(Le(mt(e,yield p(t))))));let n=function(e){return Fe(this,arguments,function*(){yield yield p(yield p(e))})};return yield p(yield*Ie(Le(dt((function(t){return Fe(this,arguments,function*(){let n=null;do n=yield p(t.next(yield yield p(m(e,n))));while(!n.done)})})((typeof t==`string`||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof at?n(t):qe(t)?function(e){return Fe(this,arguments,function*(){yield p(yield*Ie(Le(dt((function*(e){let t=null;do t=e.next(yield t?.value);while(!t.done)})(e[Symbol.iterator]())))))})}(t):Je(t)?t:n(t))[Symbol.asyncIterator]()))))),yield p(new e)})}const ht=e=>mt(Uint8Array,e);function gt(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*bt(e){let t,n=!1,r=[],i,a,o,s=0;function c(){return a===`peek`?ct(r,o)[0]:([i,r,s]=ct(r,o),i)}({cmd:a,size:o}=(yield(()=>null)())||{cmd:`read`,size:0});let l=pt(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=ht(e)[Symbol.asyncIterator]();try{do if({done:t,value:i}=Number.isNaN(o-s)?yield p(l.next()):yield p(l.next(o-s)),!t&&i.byteLength>0&&(r.push(i),s+=i.byteLength),t||o<=s)do({cmd:a,size:o}=yield yield p(c()));while(onull)()))||{cmd:`read`,size:0});let l=new Ct(e);try{do if({done:t,value:i}=Number.isNaN(o-s)?yield p(l.read()):yield p(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 p(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 f(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 f(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})}},wt=(e,t)=>{let n=e=>r([t,e]),r;return[t,n,new Promise(i=>(r=i)&&e.once(t,n))]};function Tt(e){return Fe(this,arguments,function*(){let t=[],n=`error`,r=!1,i=null,a,o,s=0,c=[],l;function u(){return a===`peek`?ct(c,o)[0]:([l,c,s]=ct(c,o),l)}if({cmd:a,size:o}=(yield yield p((()=>null)()))||{cmd:`read`,size:0},e.isTTY)return yield yield p(new Uint8Array),yield p(null);try{t[0]=wt(e,`end`),t[1]=wt(e,`error`);do{if(t[2]=wt(e,`readable`),[n,i]=yield p(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 p(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 Et;(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`})(Et||={});var Dt;(function(e){e[e.Sparse=0]=`Sparse`,e[e.Dense=1]=`Dense`})(Dt||={});var Ot;(function(e){e[e.HALF=0]=`HALF`,e[e.SINGLE=1]=`SINGLE`,e[e.DOUBLE=2]=`DOUBLE`})(Ot||={});var kt;(function(e){e[e.DAY=0]=`DAY`,e[e.MILLISECOND=1]=`MILLISECOND`})(kt||={});var g;(function(e){e[e.SECOND=0]=`SECOND`,e[e.MILLISECOND=1]=`MILLISECOND`,e[e.MICROSECOND=2]=`MICROSECOND`,e[e.NANOSECOND=3]=`NANOSECOND`})(g||={});var At;(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`})(At||={});const jt=new Int32Array(2),Mt=new Float32Array(jt.buffer),Nt=new Float64Array(jt.buffer),Pt=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;var Ft;(function(e){e[e.UTF8_BYTES=1]=`UTF8_BYTES`,e[e.UTF16_STRING=2]=`UTF16_STRING`})(Ft||={});var It=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){Mt[0]=t,this.writeInt32(e,jt[0])}writeFloat64(e,t){Nt[0]=t,this.writeInt32(e,jt[Pt?0:1]),this.writeInt32(e+4,jt[Pt?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]);this.addInt16(e-this.object_start);let r=(n+2)*2;this.addInt16(r);let i=0,a=this.space;outer_loop:for(t=0;t=0;t--)this.writeInt8(e.charCodeAt(t))}this.prep(this.minalign,4+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);if(!(t=0;n--)e.addInt32(t[n]);return e.endVector()}static startTypeIdsVector(e,t){e.startVector(4,t,4)}static endUnion(e){return e.endObject()}static createUnion(t,n,r){return e.startUnion(t),e.addMode(t,n),e.addTypeIds(t,r),e.endUnion(t)}},hn=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()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static startUtf8(e){e.startObject(0)}static endUtf8(e){return e.endObject()}static createUtf8(t){return e.startUtf8(t),e.endUtf8(t)}},_;(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`})(_||={});var gn=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()+4),(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):_.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 Jt).__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 Yt).__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,_.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){return e.endObject()}},_n=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()+4),(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):Gt.Little}fields(e,t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new gn).__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 Yt).__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,Gt.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){return e.endObject()}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)}},v;(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`})(v||={});var y;(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`})(y||={});var vn;(function(e){e[e.OFFSET=0]=`OFFSET`,e[e.DATA=1]=`DATA`,e[e.VALIDITY=2]=`VALIDITY`,e[e.TYPE=3]=`TYPE`})(vn||={});var yn=void 0;function bn(e){if(e===null)return`null`;if(e===yn)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=>bn(e))}]`:`[${e}]`:ArrayBuffer.isView(e)?`[${e}]`:JSON.stringify(e,(e,t)=>typeof t==`bigint`?`${t}`:t)}function b(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 xn(e,t){return b(e/t)+b(e%t)/b(t)}const Sn=Symbol.for(`isArrowBigNum`);function Cn(e,...t){return t.length===0?Object.setPrototypeOf(m(this.TypedArray,e),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(e,...t),this.constructor.prototype)}Cn.prototype[Sn]=!0,Cn.prototype.toJSON=function(){return`"${kn(this)}"`},Cn.prototype.valueOf=function(e){return On(this,e)},Cn.prototype.toString=function(){return kn(this)},Cn.prototype[Symbol.toPrimitive]=function(e=`default`){switch(e){case`number`:return On(this);case`string`:return kn(this);case`default`:return An(this)}return kn(this)};function wn(...e){return Cn.apply(this,e)}function Tn(...e){return Cn.apply(this,e)}function En(...e){return Cn.apply(this,e)}Object.setPrototypeOf(wn.prototype,Object.create(Int32Array.prototype)),Object.setPrototypeOf(Tn.prototype,Object.create(Uint32Array.prototype)),Object.setPrototypeOf(En.prototype,Object.create(Uint32Array.prototype)),Object.assign(wn.prototype,Cn.prototype,{constructor:wn,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array}),Object.assign(Tn.prototype,Cn.prototype,{constructor:Tn,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array}),Object.assign(En.prototype,Cn.prototype,{constructor:En,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});var Dn=BigInt(4294967296)*BigInt(4294967296)-BigInt(1);function On(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 jn(e);t=t.slice();let n=1;for(let e=0;e(e.children=null,e.ArrayType=Array,e.OffsetArrayType=Int32Array,e[Symbol.toStringTag]=`DataType`))(x.prototype);var tr=class extends x{constructor(){super(y.Null)}toString(){return`Null`}};Pn=Symbol.toStringTag,tr[Pn]=(e=>e[Symbol.toStringTag]=`Null`)(tr.prototype);var nr=class extends x{constructor(e,t){super(y.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}`}};Fn=Symbol.toStringTag,nr[Fn]=(e=>(e.isSigned=null,e.bitWidth=null,e[Symbol.toStringTag]=`Int`))(nr.prototype);var rr=class extends nr{constructor(){super(!0,8)}get ArrayType(){return Int8Array}},ir=class extends nr{constructor(){super(!0,16)}get ArrayType(){return Int16Array}},ar=class extends nr{constructor(){super(!0,32)}get ArrayType(){return Int32Array}},or=class extends nr{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}},sr=class extends nr{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}},cr=class extends nr{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}},lr=class extends nr{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}},ur=class extends nr{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}};Object.defineProperty(rr.prototype,`ArrayType`,{value:Int8Array}),Object.defineProperty(ir.prototype,`ArrayType`,{value:Int16Array}),Object.defineProperty(ar.prototype,`ArrayType`,{value:Int32Array}),Object.defineProperty(or.prototype,`ArrayType`,{value:BigInt64Array}),Object.defineProperty(sr.prototype,`ArrayType`,{value:Uint8Array}),Object.defineProperty(cr.prototype,`ArrayType`,{value:Uint16Array}),Object.defineProperty(lr.prototype,`ArrayType`,{value:Uint32Array}),Object.defineProperty(ur.prototype,`ArrayType`,{value:BigUint64Array});var dr=class extends x{constructor(e){super(y.Float),this.precision=e}get ArrayType(){switch(this.precision){case Ot.HALF:return Uint16Array;case Ot.SINGLE:return Float32Array;case Ot.DOUBLE:return Float64Array}throw Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};In=Symbol.toStringTag,dr[In]=(e=>(e.precision=null,e[Symbol.toStringTag]=`Float`))(dr.prototype);var fr=class extends dr{constructor(){super(Ot.HALF)}},pr=class extends dr{constructor(){super(Ot.SINGLE)}},mr=class extends dr{constructor(){super(Ot.DOUBLE)}};Object.defineProperty(fr.prototype,`ArrayType`,{value:Uint16Array}),Object.defineProperty(pr.prototype,`ArrayType`,{value:Float32Array}),Object.defineProperty(mr.prototype,`ArrayType`,{value:Float64Array});var hr=class extends x{constructor(){super(y.Binary)}toString(){return`Binary`}};Ln=Symbol.toStringTag,hr[Ln]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`Binary`))(hr.prototype);var gr=class extends x{constructor(){super(y.LargeBinary)}toString(){return`LargeBinary`}};Rn=Symbol.toStringTag,gr[Rn]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]=`LargeBinary`))(gr.prototype);var _r=class extends x{constructor(){super(y.Utf8)}toString(){return`Utf8`}};zn=Symbol.toStringTag,_r[zn]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`Utf8`))(_r.prototype);var vr=class extends x{constructor(){super(y.LargeUtf8)}toString(){return`LargeUtf8`}};Bn=Symbol.toStringTag,vr[Bn]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]=`LargeUtf8`))(vr.prototype);var yr=class extends x{constructor(){super(y.Bool)}toString(){return`Bool`}};Vn=Symbol.toStringTag,yr[Vn]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`Bool`))(yr.prototype);var br=class extends x{constructor(e,t,n=128){super(y.Decimal),this.scale=e,this.precision=t,this.bitWidth=n}toString(){return`Decimal[${this.precision}e${this.scale>0?`+`:``}${this.scale}]`}};Hn=Symbol.toStringTag,br[Hn]=(e=>(e.scale=null,e.precision=null,e.ArrayType=Uint32Array,e[Symbol.toStringTag]=`Decimal`))(br.prototype);var xr=class extends x{constructor(e){super(y.Date),this.unit=e}toString(){return`Date${(this.unit+1)*32}<${kt[this.unit]}>`}get ArrayType(){return this.unit===kt.DAY?Int32Array:BigInt64Array}};Un=Symbol.toStringTag,xr[Un]=(e=>(e.unit=null,e[Symbol.toStringTag]=`Date`))(xr.prototype);var Sr=class extends x{constructor(e,t){super(y.Time),this.unit=e,this.bitWidth=t}toString(){return`Time${this.bitWidth}<${g[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}};Wn=Symbol.toStringTag,Sr[Wn]=(e=>(e.unit=null,e.bitWidth=null,e[Symbol.toStringTag]=`Time`))(Sr.prototype);var Cr=class extends x{constructor(e,t){super(y.Timestamp),this.unit=e,this.timezone=t}toString(){return`Timestamp<${g[this.unit]}${this.timezone?`, ${this.timezone}`:``}>`}};Gn=Symbol.toStringTag,Cr[Gn]=(e=>(e.unit=null,e.timezone=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]=`Timestamp`))(Cr.prototype);var wr=class extends x{constructor(e){super(y.Interval),this.unit=e}toString(){return`Interval<${At[this.unit]}>`}};Kn=Symbol.toStringTag,wr[Kn]=(e=>(e.unit=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]=`Interval`))(wr.prototype);var Tr=class extends x{constructor(e){super(y.Duration),this.unit=e}toString(){return`Duration<${g[this.unit]}>`}};qn=Symbol.toStringTag,Tr[qn]=(e=>(e.unit=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]=`Duration`))(Tr.prototype);var Er=class extends x{constructor(e){super(y.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}};Jn=Symbol.toStringTag,Er[Jn]=(e=>(e.children=null,e[Symbol.toStringTag]=`List`))(Er.prototype);var Dr=class extends x{constructor(e){super(y.Struct),this.children=e}toString(){return`Struct<{${this.children.map(e=>`${e.name}:${e.type}`).join(`, `)}}>`}};Yn=Symbol.toStringTag,Dr[Yn]=(e=>(e.children=null,e[Symbol.toStringTag]=`Struct`))(Dr.prototype);var Or=class extends x{constructor(e,t,n){super(y.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(` | `)}>`}};Xn=Symbol.toStringTag,Or[Xn]=(e=>(e.mode=null,e.typeIds=null,e.children=null,e.typeIdToChildIndex=null,e.ArrayType=Int8Array,e[Symbol.toStringTag]=`Union`))(Or.prototype);var kr=class extends x{constructor(e){super(y.FixedSizeBinary),this.byteWidth=e}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};Zn=Symbol.toStringTag,kr[Zn]=(e=>(e.byteWidth=null,e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`FixedSizeBinary`))(kr.prototype);var Ar=class extends x{constructor(e,t){super(y.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}>`}};Qn=Symbol.toStringTag,Ar[Qn]=(e=>(e.children=null,e.listSize=null,e[Symbol.toStringTag]=`FixedSizeList`))(Ar.prototype);var jr=class extends x{constructor(e,t=!1){if(super(y.Map),this.children=[e],this.keysSorted=t,e&&(e.name=`entries`,e?.type?.children)){let t=(e?.type)?.children[0];t&&(t.name=`key`);let n=(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(`, `)}}>`}};$n=Symbol.toStringTag,jr[$n]=(e=>(e.children=null,e.keysSorted=null,e[Symbol.toStringTag]=`Map_`))(jr.prototype);var Mr=(e=>()=>++e)(-1),Nr=class extends x{constructor(e,t,n,r){super(y.Dictionary),this.indices=t,this.dictionary=e,this.isOrdered=r||!1,this.id=n==null?Mr():b(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}>`}};er=Symbol.toStringTag,Nr[er]=(e=>(e.id=null,e.indices=null,e.isOrdered=null,e.dictionary=null,e[Symbol.toStringTag]=`Dictionary`))(Nr.prototype);function Pr(e){let t=e;switch(e.typeId){case y.Decimal:return e.bitWidth/32;case y.Interval:return 1+t.unit;case y.FixedSizeList:return t.listSize;case y.FixedSizeBinary:return t.byteWidth;default:return 1}}var S=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 Fr(this,e,t)}getVisitFnByTypeId(e,t=!0){return Ir(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 Fr(e,t,n=!0){return typeof t==`number`?Ir(e,t,n):typeof t==`string`&&t in y?Ir(e,y[t],n):t&&t instanceof x?Ir(e,Lr(t),n):t?.type&&t.type instanceof x?Ir(e,Lr(t.type),n):Ir(e,y.NONE,n)}function Ir(e,t,n=!0){let r=null;switch(t){case y.Null:r=e.visitNull;break;case y.Bool:r=e.visitBool;break;case y.Int:r=e.visitInt;break;case y.Int8:r=e.visitInt8||e.visitInt;break;case y.Int16:r=e.visitInt16||e.visitInt;break;case y.Int32:r=e.visitInt32||e.visitInt;break;case y.Int64:r=e.visitInt64||e.visitInt;break;case y.Uint8:r=e.visitUint8||e.visitInt;break;case y.Uint16:r=e.visitUint16||e.visitInt;break;case y.Uint32:r=e.visitUint32||e.visitInt;break;case y.Uint64:r=e.visitUint64||e.visitInt;break;case y.Float:r=e.visitFloat;break;case y.Float16:r=e.visitFloat16||e.visitFloat;break;case y.Float32:r=e.visitFloat32||e.visitFloat;break;case y.Float64:r=e.visitFloat64||e.visitFloat;break;case y.Utf8:r=e.visitUtf8;break;case y.LargeUtf8:r=e.visitLargeUtf8;break;case y.Binary:r=e.visitBinary;break;case y.LargeBinary:r=e.visitLargeBinary;break;case y.FixedSizeBinary:r=e.visitFixedSizeBinary;break;case y.Date:r=e.visitDate;break;case y.DateDay:r=e.visitDateDay||e.visitDate;break;case y.DateMillisecond:r=e.visitDateMillisecond||e.visitDate;break;case y.Timestamp:r=e.visitTimestamp;break;case y.TimestampSecond:r=e.visitTimestampSecond||e.visitTimestamp;break;case y.TimestampMillisecond:r=e.visitTimestampMillisecond||e.visitTimestamp;break;case y.TimestampMicrosecond:r=e.visitTimestampMicrosecond||e.visitTimestamp;break;case y.TimestampNanosecond:r=e.visitTimestampNanosecond||e.visitTimestamp;break;case y.Time:r=e.visitTime;break;case y.TimeSecond:r=e.visitTimeSecond||e.visitTime;break;case y.TimeMillisecond:r=e.visitTimeMillisecond||e.visitTime;break;case y.TimeMicrosecond:r=e.visitTimeMicrosecond||e.visitTime;break;case y.TimeNanosecond:r=e.visitTimeNanosecond||e.visitTime;break;case y.Decimal:r=e.visitDecimal;break;case y.List:r=e.visitList;break;case y.Struct:r=e.visitStruct;break;case y.Union:r=e.visitUnion;break;case y.DenseUnion:r=e.visitDenseUnion||e.visitUnion;break;case y.SparseUnion:r=e.visitSparseUnion||e.visitUnion;break;case y.Dictionary:r=e.visitDictionary;break;case y.Interval:r=e.visitInterval;break;case y.IntervalDayTime:r=e.visitIntervalDayTime||e.visitInterval;break;case y.IntervalYearMonth:r=e.visitIntervalYearMonth||e.visitInterval;break;case y.Duration:r=e.visitDuration;break;case y.DurationSecond:r=e.visitDurationSecond||e.visitDuration;break;case y.DurationMillisecond:r=e.visitDurationMillisecond||e.visitDuration;break;case y.DurationMicrosecond:r=e.visitDurationMicrosecond||e.visitDuration;break;case y.DurationNanosecond:r=e.visitDurationNanosecond||e.visitDuration;break;case y.FixedSizeList:r=e.visitFixedSizeList;break;case y.Map:r=e.visitMap;break}if(typeof r==`function`)return r;if(!n)return()=>null;throw Error(`Unrecognized type '${y[t]}'`)}function Lr(e){switch(e.typeId){case y.Null:return y.Null;case y.Int:{let{bitWidth:t,isSigned:n}=e;switch(t){case 8:return n?y.Int8:y.Uint8;case 16:return n?y.Int16:y.Uint16;case 32:return n?y.Int32:y.Uint32;case 64:return n?y.Int64:y.Uint64}return y.Int}case y.Float:switch(e.precision){case Ot.HALF:return y.Float16;case Ot.SINGLE:return y.Float32;case Ot.DOUBLE:return y.Float64}return y.Float;case y.Binary:return y.Binary;case y.LargeBinary:return y.LargeBinary;case y.Utf8:return y.Utf8;case y.LargeUtf8:return y.LargeUtf8;case y.Bool:return y.Bool;case y.Decimal:return y.Decimal;case y.Time:switch(e.unit){case g.SECOND:return y.TimeSecond;case g.MILLISECOND:return y.TimeMillisecond;case g.MICROSECOND:return y.TimeMicrosecond;case g.NANOSECOND:return y.TimeNanosecond}return y.Time;case y.Timestamp:switch(e.unit){case g.SECOND:return y.TimestampSecond;case g.MILLISECOND:return y.TimestampMillisecond;case g.MICROSECOND:return y.TimestampMicrosecond;case g.NANOSECOND:return y.TimestampNanosecond}return y.Timestamp;case y.Date:switch(e.unit){case kt.DAY:return y.DateDay;case kt.MILLISECOND:return y.DateMillisecond}return y.Date;case y.Interval:switch(e.unit){case At.DAY_TIME:return y.IntervalDayTime;case At.YEAR_MONTH:return y.IntervalYearMonth}return y.Interval;case y.Duration:switch(e.unit){case g.SECOND:return y.DurationSecond;case g.MILLISECOND:return y.DurationMillisecond;case g.MICROSECOND:return y.DurationMicrosecond;case g.NANOSECOND:return y.DurationNanosecond}return y.Duration;case y.Map:return y.Map;case y.List:return y.List;case y.Struct:return y.Struct;case y.Union:switch(e.mode){case Dt.Dense:return y.DenseUnion;case Dt.Sparse:return y.SparseUnion}return y.Union;case y.FixedSizeBinary:return y.FixedSizeBinary;case y.FixedSizeList:return y.FixedSizeList;case y.Dictionary:return y.Dictionary}throw Error(`Unrecognized type '${y[e.typeId]}'`)}S.prototype.visitInt8=null,S.prototype.visitInt16=null,S.prototype.visitInt32=null,S.prototype.visitInt64=null,S.prototype.visitUint8=null,S.prototype.visitUint16=null,S.prototype.visitUint32=null,S.prototype.visitUint64=null,S.prototype.visitFloat16=null,S.prototype.visitFloat32=null,S.prototype.visitFloat64=null,S.prototype.visitDateDay=null,S.prototype.visitDateMillisecond=null,S.prototype.visitTimestampSecond=null,S.prototype.visitTimestampMillisecond=null,S.prototype.visitTimestampMicrosecond=null,S.prototype.visitTimestampNanosecond=null,S.prototype.visitTimeSecond=null,S.prototype.visitTimeMillisecond=null,S.prototype.visitTimeMicrosecond=null,S.prototype.visitTimeNanosecond=null,S.prototype.visitDenseUnion=null,S.prototype.visitSparseUnion=null,S.prototype.visitIntervalDayTime=null,S.prototype.visitIntervalYearMonth=null,S.prototype.visitDuration=null,S.prototype.visitDurationSecond=null,S.prototype.visitDurationMillisecond=null,S.prototype.visitDurationMicrosecond=null,S.prototype.visitDurationNanosecond=null;var Rr=new Float64Array(1),zr=new Uint32Array(Rr.buffer);function Br(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 Vr(e){if(e!==e)return 32256;Rr[0]=e;let t=(zr[1]&2147483648)>>16&65535,n=zr[1]&2146435072,r=0;return n>=1089470464?zr[0]>0?n=31744:(n=(n&2080374784)>>16,r=(zr[1]&1048575)>>10):n<=1056964608?(r=1048576+(zr[1]&1048575),r=1048576+(r<<(n>>20)-998)>>21,n=0):(n=n-1056964608>>10,r=(zr[1]&1048575)+512>>10),t|n|r&65535}var C=class extends S{};function w(e){return(t,n,r)=>{if(t.setValid(n,r!=null))return e(t,n,r)}}const Hr=(e,t,n)=>{e[t]=Math.floor(n/864e5)},Ur=(e,t,n,r)=>{if(n+1{let i=e+n;r?t[i>>3]|=1<>3]&=~(1<{e[t]=n},Kr=({values:e},t,n)=>{e[t]=n},qr=({values:e},t,n)=>{e[t]=Vr(n)},Jr=(e,t,n)=>{switch(e.type.precision){case Ot.HALF:return qr(e,t,n);case Ot.SINGLE:case Ot.DOUBLE:return Kr(e,t,n)}},Yr=({values:e},t,n)=>{Hr(e,t,n.valueOf())},Xr=({values:e},t,n)=>{e[t]=BigInt(n)},Zr=({stride:e,values:t},n,r)=>{t.set(r.subarray(0,e),e*n)};var Qr=({values:e,valueOffsets:t},n,r)=>Ur(e,t,n,r),$r=({values:e,valueOffsets:t},n,r)=>Ur(e,t,n,Ve(r));const ei=(e,t,n)=>{e.type.unit===kt.DAY?Yr(e,t,n):Xr(e,t,n)},ti=({values:e},t,n)=>{e[t]=BigInt(n/1e3)},ni=({values:e},t,n)=>{e[t]=BigInt(n)},ri=({values:e},t,n)=>{e[t]=BigInt(n*1e3)},ii=({values:e},t,n)=>{e[t]=BigInt(n*1e6)},ai=(e,t,n)=>{switch(e.type.unit){case g.SECOND:return ti(e,t,n);case g.MILLISECOND:return ni(e,t,n);case g.MICROSECOND:return ri(e,t,n);case g.NANOSECOND:return ii(e,t,n)}},oi=({values:e},t,n)=>{e[t]=n},si=({values:e},t,n)=>{e[t]=n},ci=({values:e},t,n)=>{e[t]=n},li=({values:e},t,n)=>{e[t]=n},ui=(e,t,n)=>{switch(e.type.unit){case g.SECOND:return oi(e,t,n);case g.MILLISECOND:return si(e,t,n);case g.MICROSECOND:return ci(e,t,n);case g.NANOSECOND:return li(e,t,n)}},di=({values:e,stride:t},n,r)=>{e.set(r.subarray(0,t),t*n)};var fi=(e,t,n)=>{let r=e.children[0],i=e.valueOffsets,a=Mi.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=Mi.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},mi=(e,t)=>(n,r,i,a)=>r&&n(r,e,t[a]),hi=(e,t)=>(n,r,i,a)=>r&&n(r,e,t.get(a)),gi=(e,t)=>(n,r,i,a)=>r&&n(r,e,t.get(i.name)),_i=(e,t)=>(n,r,i,a)=>r&&n(r,e,t[i.name]),vi=(e,t,n)=>{let r=e.type.children.map(e=>Mi.getVisitFn(e.type)),i=n instanceof Map?gi(t,n):n instanceof So?hi(t,n):Array.isArray(n)?mi(t,n):_i(t,n);e.type.children.forEach((t,n)=>i(r[n],e.children[n],t,n))},yi=(e,t,n)=>{e.type.mode===Dt.Dense?bi(e,t,n):xi(e,t,n)},bi=(e,t,n)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[r];Mi.visit(i,e.valueOffsets[t],n)},xi=(e,t,n)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[r];Mi.visit(i,t,n)},Si=(e,t,n)=>{var r;(r=e.dictionary)==null||r.set(e.values[t],n)};const Ci=(e,t,n)=>{e.type.unit===At.DAY_TIME?wi(e,t,n):Ti(e,t,n)},wi=({values:e},t,n)=>{e.set(n.subarray(0,2),2*t)},Ti=({values:e},t,n)=>{e[t]=n[0]*12+n[1]%12},Ei=({values:e},t,n)=>{e[t]=n},Di=({values:e},t,n)=>{e[t]=n},Oi=({values:e},t,n)=>{e[t]=n},ki=({values:e},t,n)=>{e[t]=n},Ai=(e,t,n)=>{switch(e.type.unit){case g.SECOND:return Ei(e,t,n);case g.MILLISECOND:return Di(e,t,n);case g.MICROSECOND:return Oi(e,t,n);case g.NANOSECOND:return ki(e,t,n)}};var ji=(e,t,n)=>{let{stride:r}=e,i=e.children[0],a=Mi.getVisitFn(i);if(Array.isArray(n))for(let e=-1,o=t*r;++e`${bn(e)}: ${bn(t)}`).join(`, `)}}`}[Symbol.for(`nodejs.util.inspect.custom`)](){return this.toString()}[Symbol.iterator](){return new Ii(this[Ni],this[Pi])}},Ii=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[Ni].type.children.findIndex(e=>e.name===t)!==-1}getOwnPropertyDescriptor(e,t){if(e[Ni].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[Ni].type.children.findIndex(e=>e.name===t);if(n!==-1){let r=Ea.visit(e[Ni].children[n],e[Pi]);return Reflect.set(e,t,r),r}}set(e,t,n){let r=e[Ni].type.children.findIndex(e=>e.name===t);return r===-1?Reflect.has(e,t)||typeof t==`symbol`?Reflect.set(e,t,n):!1:(Mi.visit(e[Ni].children[r],e[Pi],n),Reflect.set(e,t,n))}},T=class extends S{};function E(e){return(t,n)=>t.getValid(n)?e(t,n):null}var Ri=(e,t)=>864e5*e[t],zi=(e,t)=>null,Bi=(e,t,n)=>{if(n+1>=t.length)return null;let r=b(t[n]),i=b(t[n+1]);return e.subarray(r,i)},Vi=({offset:e,values:t},n)=>{let r=e+n;return(t[r>>3]&1<Ri(e,t),Ui=({values:e},t)=>b(e[t]),Wi=({stride:e,values:t},n)=>t[e*n],Gi=({stride:e,values:t},n)=>Br(t[e*n]),Ki=({values:e},t)=>e[t],qi=({stride:e,values:t},n)=>t.subarray(e*n,e*(n+1)),Ji=({values:e,valueOffsets:t},n)=>Bi(e,t,n),Yi=({values:e,valueOffsets:t},n)=>{let r=Bi(e,t,n);return r===null?null:ze(r)},Xi=({values:e},t)=>e[t],Zi=({type:e,values:t},n)=>e.precision===Ot.HALF?Br(t[n]):t[n],Qi=(e,t)=>e.type.unit===kt.DAY?Hi(e,t):Ui(e,t),$i=({values:e},t)=>1e3*b(e[t]),ea=({values:e},t)=>b(e[t]),ta=({values:e},t)=>xn(e[t],BigInt(1e3)),na=({values:e},t)=>xn(e[t],BigInt(1e6)),ra=(e,t)=>{switch(e.type.unit){case g.SECOND:return $i(e,t);case g.MILLISECOND:return ea(e,t);case g.MICROSECOND:return ta(e,t);case g.NANOSECOND:return na(e,t)}},ia=({values:e},t)=>e[t],aa=({values:e},t)=>e[t],oa=({values:e},t)=>e[t],sa=({values:e},t)=>e[t],ca=(e,t)=>{switch(e.type.unit){case g.SECOND:return ia(e,t);case g.MILLISECOND:return aa(e,t);case g.MICROSECOND:return oa(e,t);case g.NANOSECOND:return sa(e,t)}},la=({values:e,stride:t},n)=>Mn.decimal(e.subarray(t*n,t*(n+1))),ua=(e,t)=>{let{valueOffsets:n,stride:r,children:i}=e,{[t*r]:a,[t*r+1]:o}=n;return new So([i[0].slice(a,o-a)])},da=(e,t)=>{let{valueOffsets:n,children:r}=e,{[t]:i,[t+1]:a}=n,o=r[0];return new ja(o.slice(i,a-i))},fa=(e,t)=>new Fi(e,t),pa=(e,t)=>e.type.mode===Dt.Dense?ma(e,t):ha(e,t),ma=(e,t)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],r=e.children[n];return Ea.visit(r,e.valueOffsets[t])},ha=(e,t)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],r=e.children[n];return Ea.visit(r,t)},ga=(e,t)=>e.dictionary?.get(e.values[t]),_a=(e,t)=>e.type.unit===At.DAY_TIME?va(e,t):ya(e,t),va=({values:e},t)=>e.subarray(2*t,2*(t+1)),ya=({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},ba=({values:e},t)=>e[t],xa=({values:e},t)=>e[t],Sa=({values:e},t)=>e[t],Ca=({values:e},t)=>e[t],wa=(e,t)=>{switch(e.type.unit){case g.SECOND:return ba(e,t);case g.MILLISECOND:return xa(e,t);case g.MICROSECOND:return Sa(e,t);case g.NANOSECOND:return Ca(e,t)}},Ta=(e,t)=>{let{stride:n,children:r}=e;return new So([r[0].slice(t*n,n)])};T.prototype.visitNull=E(zi),T.prototype.visitBool=E(Vi),T.prototype.visitInt=E(Xi),T.prototype.visitInt8=E(Wi),T.prototype.visitInt16=E(Wi),T.prototype.visitInt32=E(Wi),T.prototype.visitInt64=E(Ki),T.prototype.visitUint8=E(Wi),T.prototype.visitUint16=E(Wi),T.prototype.visitUint32=E(Wi),T.prototype.visitUint64=E(Ki),T.prototype.visitFloat=E(Zi),T.prototype.visitFloat16=E(Gi),T.prototype.visitFloat32=E(Wi),T.prototype.visitFloat64=E(Wi),T.prototype.visitUtf8=E(Yi),T.prototype.visitLargeUtf8=E(Yi),T.prototype.visitBinary=E(Ji),T.prototype.visitLargeBinary=E(Ji),T.prototype.visitFixedSizeBinary=E(qi),T.prototype.visitDate=E(Qi),T.prototype.visitDateDay=E(Hi),T.prototype.visitDateMillisecond=E(Ui),T.prototype.visitTimestamp=E(ra),T.prototype.visitTimestampSecond=E($i),T.prototype.visitTimestampMillisecond=E(ea),T.prototype.visitTimestampMicrosecond=E(ta),T.prototype.visitTimestampNanosecond=E(na),T.prototype.visitTime=E(ca),T.prototype.visitTimeSecond=E(ia),T.prototype.visitTimeMillisecond=E(aa),T.prototype.visitTimeMicrosecond=E(oa),T.prototype.visitTimeNanosecond=E(sa),T.prototype.visitDecimal=E(la),T.prototype.visitList=E(ua),T.prototype.visitStruct=E(fa),T.prototype.visitUnion=E(pa),T.prototype.visitDenseUnion=E(ma),T.prototype.visitSparseUnion=E(ha),T.prototype.visitDictionary=E(ga),T.prototype.visitInterval=E(_a),T.prototype.visitIntervalDayTime=E(va),T.prototype.visitIntervalYearMonth=E(ya),T.prototype.visitDuration=E(wa),T.prototype.visitDurationSecond=E(ba),T.prototype.visitDurationMillisecond=E(xa),T.prototype.visitDurationMicrosecond=E(Sa),T.prototype.visitDurationNanosecond=E(Ca),T.prototype.visitFixedSizeList=E(Ta),T.prototype.visitMap=E(da);const Ea=new T,Da=Symbol.for(`keys`),Oa=Symbol.for(`vals`),ka=Symbol.for(`kKeysAsStrings`),Aa=Symbol.for(`_kKeysAsStrings`);var ja=class{constructor(e){return this[Da]=new So([e.children[0]]).memoize(),this[Oa]=e.children[1],new Proxy(this,new Na)}get[ka](){return this[Aa]||(this[Aa]=Array.from(this[Da].toArray(),String))}[Symbol.iterator](){return new Ma(this[Da],this[Oa])}get size(){return this[Da].length}toArray(){return Object.values(this.toJSON())}toJSON(){let e=this[Da],t=this[Oa],n={};for(let r=-1,i=e.length;++r`${bn(e)}: ${bn(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),Ea.visit(this.vals,e)]})}},Na=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(e){return e[ka]}has(e,t){return e[ka].includes(t)}getOwnPropertyDescriptor(e,t){if(e[ka].indexOf(t)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(e,t){if(Reflect.has(e,t))return e[t];let n=e[ka].indexOf(t);if(n!==-1){let r=Ea.visit(Reflect.get(e,Oa),n);return Reflect.set(e,t,r),r}}set(e,t,n){let r=e[ka].indexOf(t);return r===-1?Reflect.has(e,t)?Reflect.set(e,t,n):!1:(Mi.visit(Reflect.get(e,Oa),r,n),Reflect.set(e,t,n))}};Object.defineProperties(ja.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:`Row`},[Da]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Oa]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Aa]:{writable:!0,enumerable:!1,configurable:!1,value:null}});var Pa;function Fa(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 Ia=(e,t)=>e<0?t+e:e;var La=e=>e!==e;function Ra(e){if(typeof e!=`object`||!e)return La(e)?La: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?_t(e,t):!1:e instanceof Map?Ba(e):Array.isArray(e)?za(e):e instanceof So?Va(e):Ha(e,!0)}function za(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 Wa(e,n);case Map:return Ka(e,n,n.keys());case ja:case Fi:case Object:case void 0:return Ka(e,n,t||Object.keys(n))}return n instanceof So?Ga(e,n):!1}}function Wa(e,t){let n=e.length;if(t.length!==n)return!1;for(let r=-1;++r>r}function Ya(e,t,n){let r=n.byteLength+7&-8;if(e>0||n.byteLength>3):Xa(new Za(n,e,t,null,qa)).subarray(0,r)),i}return n}function Xa(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 Za=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 Qa(e,t,i)+Qa(e,r,n)+$a(e,i>>3,r-i>>3)}function $a(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+=eo(a.getUint32(i)),i+=4;for(;o-i>=2;)r+=eo(a.getUint16(i)),i+=2;for(;o-i>=1;)r+=eo(a.getUint8(i)),i+=1;return r}function eo(e){let t=Math.trunc(e);return t-=t>>>1&1431655765,t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}var D=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 x.isSparseUnion(e)||x.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(x.isUnion(this.type))return this.children.reduce((e,t)=>e+t.nullCount,0);let e=this._nullCount,t;return e<=-1&&(t=this.nullBitmap)&&(this._nullCount=e=t.length===0?0:this.length-Qa(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=Pr(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(x.isUnion(t)){let n=t,r=this.children[n.typeIdToChildIndex[this.typeIds[e]]],i=n.mode===Dt.Dense?this.valueOffsets[e]:e;return r.getValid(i)}if(this.nullable&&this.nullCount>0){let t=this.offset+e;return(this.nullBitmap[t>>3]&1<>3;(!r||r.byteLength<=c)&&(r=new Uint8Array((i+a+63&-64)>>3).fill(255),this.nullCount>0?(r.set(Ya(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===y.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(Ya(this.offset,t,this.nullBitmap),0);let i=this.buffers;return i[vn.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[vn.TYPE])&&(a[vn.TYPE]=i.subarray(e,e+t)),(i=a[vn.OFFSET])&&(a[vn.OFFSET]=i.subarray(e,e+t+1))||(i=a[vn.DATA])&&(a[vn.DATA]=r===6?i:i.subarray(n*e,n*(e+t))),a}_sliceChildren(e,t,n){return e.map(e=>e.slice(t,n))}};D.prototype.children=Object.freeze([]);var to=new class e extends S{visit(e){return this.getVisitFn(e.type).call(this,e)}visitNull(e){let{type:t,offset:n=0,length:r=0}=e;return new D(t,n,r,r)}visitBool(e){let{type:t,offset:n=0}=e,r=h(e.nullBitmap),i=m(t.ArrayType,e.data),{length:a=i.length>>3,nullCount:o=e.nullBitmap?-1:0}=e;return new D(t,n,a,o,[void 0,i,r])}visitInt(e){let{type:t,offset:n=0}=e,r=h(e.nullBitmap),i=m(t.ArrayType,e.data),{length:a=i.length,nullCount:o=e.nullBitmap?-1:0}=e;return new D(t,n,a,o,[void 0,i,r])}visitFloat(e){let{type:t,offset:n=0}=e,r=h(e.nullBitmap),i=m(t.ArrayType,e.data),{length:a=i.length,nullCount:o=e.nullBitmap?-1:0}=e;return new D(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=lt(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new D(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=ut(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new D(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=lt(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new D(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=ut(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new D(t,n,o,s,[a,r,i])}visitFixedSizeBinary(e){let{type:t,offset:n=0}=e,r=h(e.nullBitmap),i=m(t.ArrayType,e.data),{length:a=i.length/Pr(t),nullCount:o=e.nullBitmap?-1:0}=e;return new D(t,n,a,o,[void 0,i,r])}visitDate(e){let{type:t,offset:n=0}=e,r=h(e.nullBitmap),i=m(t.ArrayType,e.data),{length:a=i.length/Pr(t),nullCount:o=e.nullBitmap?-1:0}=e;return new D(t,n,a,o,[void 0,i,r])}visitTimestamp(e){let{type:t,offset:n=0}=e,r=h(e.nullBitmap),i=m(t.ArrayType,e.data),{length:a=i.length/Pr(t),nullCount:o=e.nullBitmap?-1:0}=e;return new D(t,n,a,o,[void 0,i,r])}visitTime(e){let{type:t,offset:n=0}=e,r=h(e.nullBitmap),i=m(t.ArrayType,e.data),{length:a=i.length/Pr(t),nullCount:o=e.nullBitmap?-1:0}=e;return new D(t,n,a,o,[void 0,i,r])}visitDecimal(e){let{type:t,offset:n=0}=e,r=h(e.nullBitmap),i=m(t.ArrayType,e.data),{length:a=i.length/Pr(t),nullCount:o=e.nullBitmap?-1:0}=e;return new D(t,n,a,o,[void 0,i,r])}visitList(e){let{type:t,offset:n=0,child:r}=e,i=h(e.nullBitmap),a=lt(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new D(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 D(t,n,a,o,[void 0,void 0,i],r)}visitUnion(e){let{type:t,offset:n=0,children:r=[]}=e,i=m(t.ArrayType,e.typeIds),{length:a=i.length,nullCount:o=-1}=e;return x.isSparseUnion(t)?new D(t,n,a,o,[void 0,void 0,void 0,i],r):new D(t,n,a,o,[lt(e.valueOffsets),void 0,void 0,i],r)}visitDictionary(t){let{type:n,offset:r=0}=t,i=h(t.nullBitmap),a=m(n.indices.ArrayType,t.data),{dictionary:o=new So([new e().visit({type:n.dictionary})])}=t,{length:s=a.length,nullCount:c=t.nullBitmap?-1:0}=t;return new D(n,r,s,c,[void 0,a,i],[],o)}visitInterval(e){let{type:t,offset:n=0}=e,r=h(e.nullBitmap),i=m(t.ArrayType,e.data),{length:a=i.length/Pr(t),nullCount:o=e.nullBitmap?-1:0}=e;return new D(t,n,a,o,[void 0,i,r])}visitDuration(e){let{type:t,offset:n=0}=e,r=h(e.nullBitmap),i=m(t.ArrayType,e.data),{length:a=i.length,nullCount:o=e.nullBitmap?-1:0}=e;return new D(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/Pr(n),nullCount:s=t.nullBitmap?-1:0}=t;return new D(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=lt(t.valueOffsets),{length:s=o.length-1,nullCount:c=t.nullBitmap?-1:0}=t;return new D(n,r,s,c,[o,void 0,a],[i])}};function O(e){return to.visit(e)}var no=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 io(e){return e.reduce((e,t)=>e+t.nullCount,0)}function ao(e){return e.reduce((e,t,n)=>(e[n+1]=e[n]+t.length,e),new Uint32Array(e.length+1))}function oo(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 so(e,t,n,r){let i=0,a=0,o=t.length-1;do{if(i>=o-1)return n0?0:-1}function mo(e,t){let{nullBitmap:n}=e;if(!n||e.nullCount<=0)return-1;let r=0;for(let i of new Za(n,e.offset+(t||0),e.length,n,qa)){if(!i)return r;++r}return-1}function A(e,t,n){if(t===void 0)return-1;if(t===null)switch(e.typeId){case y.Union:break;case y.Dictionary:break;default:return mo(e,n)}let r=Ea.getVisitFn(e),i=Ra(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 no(e.data.length,t=>{let r=e.data[t].length,i=e.slice(n,n+r);return n+=r,new _o(i)})}var _o=class{constructor(e){this.vector=e,this.index=0}next(){return this.indexe.data):t;if(n.length===0||n.some(e=>!(e instanceof D)))throw TypeError(`Vector constructor expects an Array of Data instances.`);let r=n[0]?.type;switch(n.length){case 0:this._offsets=[0];break;case 1:{let{get:e,set:t,indexOf:i}=bo[r.typeId],a=n[0];this.isValid=e=>co(a,e),this.get=t=>e(a,t),this.set=(e,n)=>t(a,e,n),this.indexOf=e=>i(a,e),this._offsets=[0,a.length];break}default:Object.setPrototypeOf(this,xo[r.typeId]),this._offsets=ao(n);break}this.data=n,this.type=r,this.stride=Pr(r),this.numChildren=r.children?.length??0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((e,t)=>e+t.byteLength,0)}get nullable(){return ro(this.data)}get nullCount(){return io(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${y[this.type.typeId]}Vector`}isValid(e){return!1}get(e){return null}at(e){return this.get(Ia(e,this.length))}set(e,t){}indexOf(e,t){return-1}includes(e,t){return this.indexOf(e,t)>-1}[Symbol.iterator](){return vo.visit(this)}concat(...t){return new e(this.data.concat(t.flatMap(e=>e.data).flat(1/0)))}slice(t,n){return new e(Fa(this,t,n,({data:e,_offsets:t},n,r)=>oo(e,t,n,r)))}toJSON(){return[...this]}toArray(){let{type:e,data:t,length:n,stride:r,ArrayType:i}=this;switch(e.typeId){case y.Int:case y.Float:case y.Decimal:case y.Time:case y.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){return this.getChildAt(this.type.children?.findIndex(t=>t.name===e))}getChildAt(t){return t>-1&&te[t])):null}get isMemoized(){return x.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(x.isDictionary(this.type)){let t=new Co(this.data[0].dictionary);return new e(this.data.map(e=>{let n=e.clone();return n.dictionary=t,n}))}return new Co(this)}unmemoize(){if(x.isDictionary(this.type)&&this.isMemoized){let t=this.data[0].dictionary.unmemoize();return new e(this.data.map(e=>{let n=e.clone();return n.dictionary=t,n}))}return this}};yo=Symbol.toStringTag,So[yo]=(e=>{e.type=x.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(y).map(e=>y[e]).filter(e=>typeof e==`number`&&e!==y.NONE);for(let n of t)bo[n]={get:Ea.getVisitFnByTypeId(n),set:Mi.getVisitFnByTypeId(n),indexOf:go.getVisitFnByTypeId(n)},xo[n]=Object.create(e,{isValid:{value:lo(co)},get:{value:lo(Ea.getVisitFnByTypeId(n))},set:{value:uo(Mi.getVisitFnByTypeId(n))},indexOf:{value:fo(go.getVisitFnByTypeId(n))}});return`Vector`})(So.prototype);var Co=class e extends So{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 So(this.data)}),Object.defineProperty(this,`memoize`,{value:()=>this})}},wo=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()}},To=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()+4),(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):Et.V1}schema(e){let t=this.bb.__offset(this.bb_pos,6);return t?(e||new _n).__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 wo).__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 wo).__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 Yt).__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,Et.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){return e.endObject()}static finishFooterBuffer(e,t){e.finish(t)}static finishSizePrefixedFooterBuffer(e,t){e.finish(t,void 0,!0)}},Eo=class e{constructor(e=[],t,n,r=Et.V5){this.fields=e||[],this.metadata=t||new Map,n||=ko(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);return new e(this.fields.filter(e=>n.has(e.name)),this.metadata)}selectAt(t){return new e(t.map(e=>this.fields[e]).filter(Boolean),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=Oo(Oo(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:Oo(Oo(new Map,r[t].metadata),e.metadata)}))&&!1:!0}),o=ko(a,new Map);return new e([...r,...a],i,new Map([...this.dictionaries,...o]))}};Eo.prototype.fields=null,Eo.prototype.metadata=null,Eo.prototype.dictionaries=null;var Do=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)}};Do.prototype.type=null,Do.prototype.name=null,Do.prototype.nullable=null,Do.prototype.metadata=null;function Oo(e,t){return new Map([...e||new Map,...t||new Map])}function ko(e,t=new Map){for(let n=-1,r=e.length;++n0&&ko(r.children,t)}return t}var Ao=Lt,jo=It,Mo=class{static decode(e){e=new jo(h(e));let t=To.getRootAsFooter(e);return new No(Eo.decode(t.schema(),new Map,t.version()),t)}static encode(e){let t=new Ao,n=Eo.encode(t,e.schema);To.startRecordBatchesVector(t,e.numRecordBatches);for(let n of[...e.recordBatches()].slice().reverse())Po.encode(t,n);let r=t.endVector();To.startDictionariesVector(t,e.numDictionaries);for(let n of[...e.dictionaryBatches()].slice().reverse())Po.encode(t,n);let i=t.endVector();return To.startFooter(t),To.addSchema(t,n),To.addVersion(t,Et.V5),To.addRecordBatches(t,r),To.addDictionaries(t,i),To.finishFooterBuffer(t,To.endFooter(t)),t.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}constructor(e,t=Et.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 f(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(Fo);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(e){return vt.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,e)}toNodeStream(e){return vt.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,e)}throw(e){return f(this,void 0,void 0,function*(){return yield this.abort(e),Fo})}return(e){return f(this,void 0,void 0,function*(){return yield this.close(),Fo})}read(e){return f(this,void 0,void 0,function*(){return(yield this.next(e,`read`)).value})}peek(e){return f(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(Fo)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw Error(`AsyncQueue is closed`)}},zo=class extends Ro{write(e){if((e=h(e)).byteLength>0)return super.write(e)}toString(e=!1){return e?ze(this.toUint8Array(!0)):this.toUint8Array(!1).then(ze)}toUint8Array(e=!1){return e?ct(this._values)[0]:(()=>f(this,void 0,void 0,function*(){var e,t,n,r;let i=[],a=0;try{for(var o=!0,s=Le(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 ct(i,a)[0]}))()}},Bo=class{constructor(e){e&&(this.source=new Ho(vt.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)}},Vo=class e{constructor(t){t instanceof e?this.source=t.source:t instanceof zo?this.source=new Uo(vt.fromAsyncIterable(t)):rt(t)?this.source=new Uo(vt.fromNodeStream(t)):tt(t)?this.source=new Uo(vt.fromDOMStream(t)):Qe(t)?this.source=new Uo(vt.fromDOMStream(t.body)):qe(t)?this.source=new Uo(vt.fromIterable(t)):(Ke(t)||Je(t))&&(this.source=new Uo(vt.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)}},Ho=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)||Fo)}return(e){return Object.create(this.source.return&&this.source.return(e)||Fo)}},Uo=class{constructor(e){this.source=e,this._closedPromise=new Promise(e=>this._closedPromiseResolve=e)}cancel(e){return f(this,void 0,void 0,function*(){yield this.return(e)})}get closed(){return this._closedPromise}read(e){return f(this,void 0,void 0,function*(){return(yield this.next(e,`read`)).value})}peek(e){return f(this,void 0,void 0,function*(){return(yield this.next(e,`peek`)).value})}next(e){return f(this,arguments,void 0,function*(e,t=`read`){return yield this.source.next({cmd:t,size:e})})}throw(e){return f(this,void 0,void 0,function*(){let t=this.source.throw&&(yield this.source.throw(e))||Fo;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(t)})}return(e){return f(this,void 0,void 0,function*(){let t=this.source.return&&(yield this.source.return(e))||Fo;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(t)})}},Wo=class extends Bo{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),ef(this,void 0,void 0,function*(){this.size=(yield e.stat()).size,delete this._pending}))()}readInt32(e){return f(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 f(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`${qo(this.buffer[3])} ${qo(this.buffer[2])} ${qo(this.buffer[1])} ${qo(this.buffer[0])}`}static multiply(t,n){return new e(new Uint32Array(t.buffer)).times(n)}static add(t,n){return new e(new Uint32Array(t.buffer)).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)}},ts=class extends es{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:Xa(this.sources[n])}readOffsets(e,{offset:t}=this.nextBufferRange()){return m(Uint8Array,m(e.OffsetArrayType,this.sources[t]))}readTypeIds(e,{offset:t}=this.nextBufferRange()){return m(Uint8Array,m(e.ArrayType,this.sources[t]))}readData(e,{offset:t}=this.nextBufferRange()){let{sources:n}=this;return x.isTimestamp(e)||(x.isInt(e)||x.isTime(e))&&e.bitWidth===64||x.isDuration(e)||x.isDate(e)&&e.unit===kt.MILLISECOND?m(Uint8Array,Qo.convertArray(n[t])):x.isDecimal(e)?m(Uint8Array,$o.convertArray(n[t])):x.isBinary(e)||x.isLargeBinary(e)||x.isFixedSizeBinary(e)?ns(n[t]):x.isBool(e)?Xa(n[t]):x.isUtf8(e)||x.isLargeUtf8(e)?Ve(n[t].join(``)):m(Uint8Array,m(e.ArrayType,n[t].map(e=>+e)))}};function ns(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 N=class extends S{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 rs(e,t){return t instanceof e.constructor}function is(e,t){return e===t||rs(e,t)}function as(e,t){return e===t||rs(e,t)&&e.bitWidth===t.bitWidth&&e.isSigned===t.isSigned}function os(e,t){return e===t||rs(e,t)&&e.precision===t.precision}function ss(e,t){return e===t||rs(e,t)&&e.byteWidth===t.byteWidth}function cs(e,t){return e===t||rs(e,t)&&e.unit===t.unit}function ls(e,t){return e===t||rs(e,t)&&e.unit===t.unit&&e.timezone===t.timezone}function us(e,t){return e===t||rs(e,t)&&e.unit===t.unit&&e.bitWidth===t.bitWidth}function ds(e,t){return e===t||rs(e,t)&&e.children.length===t.children.length&&ys.compareManyFields(e.children,t.children)}function fs(e,t){return e===t||rs(e,t)&&e.children.length===t.children.length&&ys.compareManyFields(e.children,t.children)}function ps(e,t){return e===t||rs(e,t)&&e.mode===t.mode&&e.typeIds.every((e,n)=>e===t.typeIds[n])&&ys.compareManyFields(e.children,t.children)}function ms(e,t){return e===t||rs(e,t)&&e.id===t.id&&e.isOrdered===t.isOrdered&&ys.visit(e.indices,t.indices)&&ys.visit(e.dictionary,t.dictionary)}function hs(e,t){return e===t||rs(e,t)&&e.unit===t.unit}function gs(e,t){return e===t||rs(e,t)&&e.unit===t.unit}function _s(e,t){return e===t||rs(e,t)&&e.listSize===t.listSize&&e.children.length===t.children.length&&ys.compareManyFields(e.children,t.children)}function vs(e,t){return e===t||rs(e,t)&&e.keysSorted===t.keysSorted&&e.children.length===t.children.length&&ys.compareManyFields(e.children,t.children)}N.prototype.visitNull=is,N.prototype.visitBool=is,N.prototype.visitInt=as,N.prototype.visitInt8=as,N.prototype.visitInt16=as,N.prototype.visitInt32=as,N.prototype.visitInt64=as,N.prototype.visitUint8=as,N.prototype.visitUint16=as,N.prototype.visitUint32=as,N.prototype.visitUint64=as,N.prototype.visitFloat=os,N.prototype.visitFloat16=os,N.prototype.visitFloat32=os,N.prototype.visitFloat64=os,N.prototype.visitUtf8=is,N.prototype.visitLargeUtf8=is,N.prototype.visitBinary=is,N.prototype.visitLargeBinary=is,N.prototype.visitFixedSizeBinary=ss,N.prototype.visitDate=cs,N.prototype.visitDateDay=cs,N.prototype.visitDateMillisecond=cs,N.prototype.visitTimestamp=ls,N.prototype.visitTimestampSecond=ls,N.prototype.visitTimestampMillisecond=ls,N.prototype.visitTimestampMicrosecond=ls,N.prototype.visitTimestampNanosecond=ls,N.prototype.visitTime=us,N.prototype.visitTimeSecond=us,N.prototype.visitTimeMillisecond=us,N.prototype.visitTimeMicrosecond=us,N.prototype.visitTimeNanosecond=us,N.prototype.visitDecimal=is,N.prototype.visitList=ds,N.prototype.visitStruct=fs,N.prototype.visitUnion=ps,N.prototype.visitDenseUnion=ps,N.prototype.visitSparseUnion=ps,N.prototype.visitDictionary=ms,N.prototype.visitInterval=hs,N.prototype.visitIntervalDayTime=hs,N.prototype.visitIntervalYearMonth=hs,N.prototype.visitDuration=gs,N.prototype.visitDurationSecond=gs,N.prototype.visitDurationMillisecond=gs,N.prototype.visitDurationMicrosecond=gs,N.prototype.visitDurationNanosecond=gs,N.prototype.visitFixedSizeList=_s,N.prototype.visitMap=vs;const ys=new N;function bs(e,t){return ys.compareSchemas(e,t)}function xs(e,t){return Ss(e,t.map(e=>e.data.concat()))}function Ss(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++]=O({type:new Dr(n),length:o,nullCount:0,children:u.slice()})))}return[e=e.assign(n),r.map(t=>new Ds(e,t))]}function Cs(e,t,n,r,i){let a=(t+63&-64)>>3;for(let o=-1,s=r.length;++o=t)c===t?n[o]=s:(n[o]=s.slice(0,t),i.numBatches=Math.max(i.numBatches,r[o].unshift(s.slice(t,c-t))));else{let r=e[o];e[o]=r.clone({nullable:!0}),n[o]=s?._changeLengthAndBackfillNullBitmap(t)??O({type:r.type,length:t,nullCount:t,nullBitmap:new Uint8Array(a)})}}return n}var ws,Ts=class e{constructor(...t){if(t.length===0)return this.batches=[],this.schema=new Eo([]),this._offsets=[0],this;let n,r;t[0]instanceof Eo&&(n=t.shift()),t.at(-1)instanceof Uint32Array&&(r=t.pop());let i=t=>{if(t){if(t instanceof Ds)return[t];if(t instanceof e)return t.batches;if(t instanceof D){if(t.type instanceof Dr)return[new Ds(new Eo(t.type.children),t)]}else if(Array.isArray(t))return t.flatMap(e=>i(e));else if(typeof t[Symbol.iterator]==`function`)return[...t].flatMap(e=>i(e));else if(typeof t==`object`){let e=Object.keys(t),r=e.map(e=>new So([t[e]])),[,i]=xs(n??new Eo(e.map((e,t)=>new Do(String(e),r[t].type,r[t].nullable))),r);return i.length===0?[new Ds(t)]:i}}return[]},a=t.flatMap(e=>i(e));if(n=n??a[0]?.schema??new Eo([]),!(n instanceof Eo))throw TypeError(`Table constructor expects a [Schema, RecordBatch[]] pair.`);for(let e of a){if(!(e instanceof Ds))throw TypeError(`Table constructor expects a [Schema, RecordBatch[]] pair.`);if(!bs(n,e.schema))throw TypeError(`Table and inner RecordBatch schemas must be equivalent.`)}this.schema=n,this.batches=a,this._offsets=r??ao(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=io(this.data)),this._nullCount}isValid(e){return!1}get(e){return null}at(e){return this.get(Ia(e,this.numRows))}set(e,t){}indexOf(e,t){return-1}[Symbol.iterator](){return this.batches.length>0?vo.visit(new So(this.data)):[][Symbol.iterator]()}toArray(){return[...this]}toString(){return`[\n ${this.toArray().join(`, +import{a as e,r as t}from"./chunk-B78Zgmat.js";import{A as n,C as r,G as i,K as a,R as o,S as s,W as c,kt as l,nt as u,w as d,x as ee,xt as te}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import{tt as ne}from"./src-DYQXbDgu.js";import{a as re}from"./resettable-CbXzRviW.js";import{n as ie,t as ae}from"./preload-helper-Dn1uWANL.js";import{i as oe,l as se,o as ce}from"./environment-CyZLTg97.js";import{a as le}from"./dist-Che88T83.js";import{d as ue,f as de,g as fe,m as pe,p as me,xt as he}from"./components-CeE-UiLT.js";import{i as ge,n as _e,t as ve}from"./speech-6W29lyZ_.js";import{a as ye,n as be,o as xe}from"./stream-transcription-_Xuw_VzN.js";import{D as Se,O as Ce,n as we}from"./settings-73vyHOZs.js";import{n as Te}from"./chat-CxQ_IGrj.js";import{n as Ee,r as De,t as Oe}from"./src-mAITpvbv.js";import{n as ke}from"./live2d-DukystQI.js";import{t as Ae}from"./import-url-browser-DRsAP6zH.js";function je(e,t){return ye(e*1e3,t?.in)}function Me(e,t){let n=Ne(t)?new t(0):xe(t,0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n}function Ne(e){return typeof e==`function`&&e.prototype?.constructor===e}function f(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 Pe(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 p(e){return this instanceof p?(this.v=e,this):new p(e)}function Fe(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){ee(a[0][3],e)}}function l(e){e.value instanceof p?Promise.resolve(e.value.v).then(u,d):ee(a[0][2],e)}function u(e){c(`next`,e)}function d(e){c(`throw`,e)}function ee(e,t){e(t),a.shift(),a.length&&c(a[0][0],a[0][1])}}function Ie(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:p(e[r](t)),done:!1}:i?i(t):t}:i}}function Le(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof Pe==`function`?Pe(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)}}var Re=new TextDecoder(`utf-8`);const ze=e=>Re.decode(e);var Be=new TextEncoder;const Ve=e=>Be.encode(e);var He=e=>typeof e==`number`,Ue=e=>typeof e==`boolean`,We=e=>typeof e==`function`;const Ge=e=>e!=null&&Object(e)===e,Ke=e=>Ge(e)&&We(e.then),qe=e=>Ge(e)&&We(e[Symbol.iterator]),Je=e=>Ge(e)&&We(e[Symbol.asyncIterator]),Ye=e=>Ge(e)&&Ge(e.schema),Xe=e=>Ge(e)&&`done`in e&&`value`in e,Ze=e=>Ge(e)&&We(e.stat)&&He(e.fd),Qe=e=>Ge(e)&&tt(e.body);var $e=e=>`_getDOMStream`in e&&`_getNodeStream`in e;const et=e=>Ge(e)&&We(e.abort)&&We(e.getWriter)&&!$e(e),tt=e=>Ge(e)&&We(e.cancel)&&We(e.getReader)&&!$e(e),nt=e=>Ge(e)&&We(e.end)&&We(e.write)&&Ue(e.writable)&&!$e(e),rt=e=>Ge(e)&&We(e.read)&&We(e.pipe)&&Ue(e.readable)&&!$e(e),it=e=>Ge(e)&&We(e.clear)&&We(e.bytes)&&We(e.position)&&We(e.setPosition)&&We(e.capacity)&&We(e.getBufferIdentifier)&&We(e.createLong);var at=typeof SharedArrayBuffer<`u`?SharedArrayBuffer:ArrayBuffer;function ot(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;++cm(Int32Array,e),ut=e=>m(BigInt64Array,e),h=e=>m(Uint8Array,e);var dt=e=>(e.next(),e);function*ft(e,t){let n=function*(e){yield e};return yield*dt((function*(t){let n=null;do n=t.next(yield m(e,n));while(!n.done)})((typeof t==`string`||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof at?n(t):qe(t)?t:n(t))[Symbol.iterator]())),new e}const pt=e=>ft(Uint8Array,e);function mt(e,t){return Fe(this,arguments,function*(){if(Ke(t))return yield p(yield p(yield*Ie(Le(mt(e,yield p(t))))));let n=function(e){return Fe(this,arguments,function*(){yield yield p(yield p(e))})};return yield p(yield*Ie(Le(dt((function(t){return Fe(this,arguments,function*(){let n=null;do n=yield p(t.next(yield yield p(m(e,n))));while(!n.done)})})((typeof t==`string`||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof at?n(t):qe(t)?function(e){return Fe(this,arguments,function*(){yield p(yield*Ie(Le(dt((function*(e){let t=null;do t=e.next(yield t?.value);while(!t.done)})(e[Symbol.iterator]())))))})}(t):Je(t)?t:n(t))[Symbol.asyncIterator]()))))),yield p(new e)})}const ht=e=>mt(Uint8Array,e);function gt(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*bt(e){let t,n=!1,r=[],i,a,o,s=0;function c(){return a===`peek`?ct(r,o)[0]:([i,r,s]=ct(r,o),i)}({cmd:a,size:o}=(yield(()=>null)())||{cmd:`read`,size:0});let l=pt(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=ht(e)[Symbol.asyncIterator]();try{do if({done:t,value:i}=Number.isNaN(o-s)?yield p(l.next()):yield p(l.next(o-s)),!t&&i.byteLength>0&&(r.push(i),s+=i.byteLength),t||o<=s)do({cmd:a,size:o}=yield yield p(c()));while(onull)()))||{cmd:`read`,size:0});let l=new Ct(e);try{do if({done:t,value:i}=Number.isNaN(o-s)?yield p(l.read()):yield p(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 p(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 f(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 f(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})}},wt=(e,t)=>{let n=e=>r([t,e]),r;return[t,n,new Promise(i=>(r=i)&&e.once(t,n))]};function Tt(e){return Fe(this,arguments,function*(){let t=[],n=`error`,r=!1,i=null,a,o,s=0,c=[],l;function u(){return a===`peek`?ct(c,o)[0]:([l,c,s]=ct(c,o),l)}if({cmd:a,size:o}=(yield yield p((()=>null)()))||{cmd:`read`,size:0},e.isTTY)return yield yield p(new Uint8Array),yield p(null);try{t[0]=wt(e,`end`),t[1]=wt(e,`error`);do{if(t[2]=wt(e,`readable`),[n,i]=yield p(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 p(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 Et;(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`})(Et||={});var Dt;(function(e){e[e.Sparse=0]=`Sparse`,e[e.Dense=1]=`Dense`})(Dt||={});var Ot;(function(e){e[e.HALF=0]=`HALF`,e[e.SINGLE=1]=`SINGLE`,e[e.DOUBLE=2]=`DOUBLE`})(Ot||={});var kt;(function(e){e[e.DAY=0]=`DAY`,e[e.MILLISECOND=1]=`MILLISECOND`})(kt||={});var g;(function(e){e[e.SECOND=0]=`SECOND`,e[e.MILLISECOND=1]=`MILLISECOND`,e[e.MICROSECOND=2]=`MICROSECOND`,e[e.NANOSECOND=3]=`NANOSECOND`})(g||={});var At;(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`})(At||={});const jt=new Int32Array(2),Mt=new Float32Array(jt.buffer),Nt=new Float64Array(jt.buffer),Pt=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;var Ft;(function(e){e[e.UTF8_BYTES=1]=`UTF8_BYTES`,e[e.UTF16_STRING=2]=`UTF16_STRING`})(Ft||={});var It=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){Mt[0]=t,this.writeInt32(e,jt[0])}writeFloat64(e,t){Nt[0]=t,this.writeInt32(e,jt[Pt?0:1]),this.writeInt32(e+4,jt[Pt?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]);this.addInt16(e-this.object_start);let r=(n+2)*2;this.addInt16(r);let i=0,a=this.space;outer_loop:for(t=0;t=0;t--)this.writeInt8(e.charCodeAt(t))}this.prep(this.minalign,4+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);if(!(t=0;n--)e.addInt32(t[n]);return e.endVector()}static startTypeIdsVector(e,t){e.startVector(4,t,4)}static endUnion(e){return e.endObject()}static createUnion(t,n,r){return e.startUnion(t),e.addMode(t,n),e.addTypeIds(t,r),e.endUnion(t)}},hn=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()+4),(n||new e).__init(t.readInt32(t.position())+t.position(),t)}static startUtf8(e){e.startObject(0)}static endUtf8(e){return e.endObject()}static createUtf8(t){return e.startUtf8(t),e.endUtf8(t)}},_;(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`})(_||={});var gn=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()+4),(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):_.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 Jt).__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 Yt).__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,_.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){return e.endObject()}},_n=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()+4),(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):Gt.Little}fields(e,t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new gn).__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 Yt).__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,Gt.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){return e.endObject()}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)}},v;(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`})(v||={});var y;(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`})(y||={});var vn;(function(e){e[e.OFFSET=0]=`OFFSET`,e[e.DATA=1]=`DATA`,e[e.VALIDITY=2]=`VALIDITY`,e[e.TYPE=3]=`TYPE`})(vn||={});var yn=void 0;function bn(e){if(e===null)return`null`;if(e===yn)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=>bn(e))}]`:`[${e}]`:ArrayBuffer.isView(e)?`[${e}]`:JSON.stringify(e,(e,t)=>typeof t==`bigint`?`${t}`:t)}function b(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 xn(e,t){return b(e/t)+b(e%t)/b(t)}const Sn=Symbol.for(`isArrowBigNum`);function Cn(e,...t){return t.length===0?Object.setPrototypeOf(m(this.TypedArray,e),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(e,...t),this.constructor.prototype)}Cn.prototype[Sn]=!0,Cn.prototype.toJSON=function(){return`"${kn(this)}"`},Cn.prototype.valueOf=function(e){return On(this,e)},Cn.prototype.toString=function(){return kn(this)},Cn.prototype[Symbol.toPrimitive]=function(e=`default`){switch(e){case`number`:return On(this);case`string`:return kn(this);case`default`:return An(this)}return kn(this)};function wn(...e){return Cn.apply(this,e)}function Tn(...e){return Cn.apply(this,e)}function En(...e){return Cn.apply(this,e)}Object.setPrototypeOf(wn.prototype,Object.create(Int32Array.prototype)),Object.setPrototypeOf(Tn.prototype,Object.create(Uint32Array.prototype)),Object.setPrototypeOf(En.prototype,Object.create(Uint32Array.prototype)),Object.assign(wn.prototype,Cn.prototype,{constructor:wn,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array}),Object.assign(Tn.prototype,Cn.prototype,{constructor:Tn,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array}),Object.assign(En.prototype,Cn.prototype,{constructor:En,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});var Dn=BigInt(4294967296)*BigInt(4294967296)-BigInt(1);function On(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 jn(e);t=t.slice();let n=1;for(let e=0;e(e.children=null,e.ArrayType=Array,e.OffsetArrayType=Int32Array,e[Symbol.toStringTag]=`DataType`))(x.prototype);var tr=class extends x{constructor(){super(y.Null)}toString(){return`Null`}};Pn=Symbol.toStringTag,tr[Pn]=(e=>e[Symbol.toStringTag]=`Null`)(tr.prototype);var nr=class extends x{constructor(e,t){super(y.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}`}};Fn=Symbol.toStringTag,nr[Fn]=(e=>(e.isSigned=null,e.bitWidth=null,e[Symbol.toStringTag]=`Int`))(nr.prototype);var rr=class extends nr{constructor(){super(!0,8)}get ArrayType(){return Int8Array}},ir=class extends nr{constructor(){super(!0,16)}get ArrayType(){return Int16Array}},ar=class extends nr{constructor(){super(!0,32)}get ArrayType(){return Int32Array}},or=class extends nr{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}},sr=class extends nr{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}},cr=class extends nr{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}},lr=class extends nr{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}},ur=class extends nr{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}};Object.defineProperty(rr.prototype,`ArrayType`,{value:Int8Array}),Object.defineProperty(ir.prototype,`ArrayType`,{value:Int16Array}),Object.defineProperty(ar.prototype,`ArrayType`,{value:Int32Array}),Object.defineProperty(or.prototype,`ArrayType`,{value:BigInt64Array}),Object.defineProperty(sr.prototype,`ArrayType`,{value:Uint8Array}),Object.defineProperty(cr.prototype,`ArrayType`,{value:Uint16Array}),Object.defineProperty(lr.prototype,`ArrayType`,{value:Uint32Array}),Object.defineProperty(ur.prototype,`ArrayType`,{value:BigUint64Array});var dr=class extends x{constructor(e){super(y.Float),this.precision=e}get ArrayType(){switch(this.precision){case Ot.HALF:return Uint16Array;case Ot.SINGLE:return Float32Array;case Ot.DOUBLE:return Float64Array}throw Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};In=Symbol.toStringTag,dr[In]=(e=>(e.precision=null,e[Symbol.toStringTag]=`Float`))(dr.prototype);var fr=class extends dr{constructor(){super(Ot.HALF)}},pr=class extends dr{constructor(){super(Ot.SINGLE)}},mr=class extends dr{constructor(){super(Ot.DOUBLE)}};Object.defineProperty(fr.prototype,`ArrayType`,{value:Uint16Array}),Object.defineProperty(pr.prototype,`ArrayType`,{value:Float32Array}),Object.defineProperty(mr.prototype,`ArrayType`,{value:Float64Array});var hr=class extends x{constructor(){super(y.Binary)}toString(){return`Binary`}};Ln=Symbol.toStringTag,hr[Ln]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`Binary`))(hr.prototype);var gr=class extends x{constructor(){super(y.LargeBinary)}toString(){return`LargeBinary`}};Rn=Symbol.toStringTag,gr[Rn]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]=`LargeBinary`))(gr.prototype);var _r=class extends x{constructor(){super(y.Utf8)}toString(){return`Utf8`}};zn=Symbol.toStringTag,_r[zn]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`Utf8`))(_r.prototype);var vr=class extends x{constructor(){super(y.LargeUtf8)}toString(){return`LargeUtf8`}};Bn=Symbol.toStringTag,vr[Bn]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]=`LargeUtf8`))(vr.prototype);var yr=class extends x{constructor(){super(y.Bool)}toString(){return`Bool`}};Vn=Symbol.toStringTag,yr[Vn]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`Bool`))(yr.prototype);var br=class extends x{constructor(e,t,n=128){super(y.Decimal),this.scale=e,this.precision=t,this.bitWidth=n}toString(){return`Decimal[${this.precision}e${this.scale>0?`+`:``}${this.scale}]`}};Hn=Symbol.toStringTag,br[Hn]=(e=>(e.scale=null,e.precision=null,e.ArrayType=Uint32Array,e[Symbol.toStringTag]=`Decimal`))(br.prototype);var xr=class extends x{constructor(e){super(y.Date),this.unit=e}toString(){return`Date${(this.unit+1)*32}<${kt[this.unit]}>`}get ArrayType(){return this.unit===kt.DAY?Int32Array:BigInt64Array}};Un=Symbol.toStringTag,xr[Un]=(e=>(e.unit=null,e[Symbol.toStringTag]=`Date`))(xr.prototype);var Sr=class extends x{constructor(e,t){super(y.Time),this.unit=e,this.bitWidth=t}toString(){return`Time${this.bitWidth}<${g[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}};Wn=Symbol.toStringTag,Sr[Wn]=(e=>(e.unit=null,e.bitWidth=null,e[Symbol.toStringTag]=`Time`))(Sr.prototype);var Cr=class extends x{constructor(e,t){super(y.Timestamp),this.unit=e,this.timezone=t}toString(){return`Timestamp<${g[this.unit]}${this.timezone?`, ${this.timezone}`:``}>`}};Gn=Symbol.toStringTag,Cr[Gn]=(e=>(e.unit=null,e.timezone=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]=`Timestamp`))(Cr.prototype);var wr=class extends x{constructor(e){super(y.Interval),this.unit=e}toString(){return`Interval<${At[this.unit]}>`}};Kn=Symbol.toStringTag,wr[Kn]=(e=>(e.unit=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]=`Interval`))(wr.prototype);var Tr=class extends x{constructor(e){super(y.Duration),this.unit=e}toString(){return`Duration<${g[this.unit]}>`}};qn=Symbol.toStringTag,Tr[qn]=(e=>(e.unit=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]=`Duration`))(Tr.prototype);var Er=class extends x{constructor(e){super(y.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}};Jn=Symbol.toStringTag,Er[Jn]=(e=>(e.children=null,e[Symbol.toStringTag]=`List`))(Er.prototype);var Dr=class extends x{constructor(e){super(y.Struct),this.children=e}toString(){return`Struct<{${this.children.map(e=>`${e.name}:${e.type}`).join(`, `)}}>`}};Yn=Symbol.toStringTag,Dr[Yn]=(e=>(e.children=null,e[Symbol.toStringTag]=`Struct`))(Dr.prototype);var Or=class extends x{constructor(e,t,n){super(y.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(` | `)}>`}};Xn=Symbol.toStringTag,Or[Xn]=(e=>(e.mode=null,e.typeIds=null,e.children=null,e.typeIdToChildIndex=null,e.ArrayType=Int8Array,e[Symbol.toStringTag]=`Union`))(Or.prototype);var kr=class extends x{constructor(e){super(y.FixedSizeBinary),this.byteWidth=e}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};Zn=Symbol.toStringTag,kr[Zn]=(e=>(e.byteWidth=null,e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`FixedSizeBinary`))(kr.prototype);var Ar=class extends x{constructor(e,t){super(y.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}>`}};Qn=Symbol.toStringTag,Ar[Qn]=(e=>(e.children=null,e.listSize=null,e[Symbol.toStringTag]=`FixedSizeList`))(Ar.prototype);var jr=class extends x{constructor(e,t=!1){if(super(y.Map),this.children=[e],this.keysSorted=t,e&&(e.name=`entries`,e?.type?.children)){let t=(e?.type)?.children[0];t&&(t.name=`key`);let n=(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(`, `)}}>`}};$n=Symbol.toStringTag,jr[$n]=(e=>(e.children=null,e.keysSorted=null,e[Symbol.toStringTag]=`Map_`))(jr.prototype);var Mr=(e=>()=>++e)(-1),Nr=class extends x{constructor(e,t,n,r){super(y.Dictionary),this.indices=t,this.dictionary=e,this.isOrdered=r||!1,this.id=n==null?Mr():b(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}>`}};er=Symbol.toStringTag,Nr[er]=(e=>(e.id=null,e.indices=null,e.isOrdered=null,e.dictionary=null,e[Symbol.toStringTag]=`Dictionary`))(Nr.prototype);function Pr(e){let t=e;switch(e.typeId){case y.Decimal:return e.bitWidth/32;case y.Interval:return 1+t.unit;case y.FixedSizeList:return t.listSize;case y.FixedSizeBinary:return t.byteWidth;default:return 1}}var S=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 Fr(this,e,t)}getVisitFnByTypeId(e,t=!0){return Ir(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 Fr(e,t,n=!0){return typeof t==`number`?Ir(e,t,n):typeof t==`string`&&t in y?Ir(e,y[t],n):t&&t instanceof x?Ir(e,Lr(t),n):t?.type&&t.type instanceof x?Ir(e,Lr(t.type),n):Ir(e,y.NONE,n)}function Ir(e,t,n=!0){let r=null;switch(t){case y.Null:r=e.visitNull;break;case y.Bool:r=e.visitBool;break;case y.Int:r=e.visitInt;break;case y.Int8:r=e.visitInt8||e.visitInt;break;case y.Int16:r=e.visitInt16||e.visitInt;break;case y.Int32:r=e.visitInt32||e.visitInt;break;case y.Int64:r=e.visitInt64||e.visitInt;break;case y.Uint8:r=e.visitUint8||e.visitInt;break;case y.Uint16:r=e.visitUint16||e.visitInt;break;case y.Uint32:r=e.visitUint32||e.visitInt;break;case y.Uint64:r=e.visitUint64||e.visitInt;break;case y.Float:r=e.visitFloat;break;case y.Float16:r=e.visitFloat16||e.visitFloat;break;case y.Float32:r=e.visitFloat32||e.visitFloat;break;case y.Float64:r=e.visitFloat64||e.visitFloat;break;case y.Utf8:r=e.visitUtf8;break;case y.LargeUtf8:r=e.visitLargeUtf8;break;case y.Binary:r=e.visitBinary;break;case y.LargeBinary:r=e.visitLargeBinary;break;case y.FixedSizeBinary:r=e.visitFixedSizeBinary;break;case y.Date:r=e.visitDate;break;case y.DateDay:r=e.visitDateDay||e.visitDate;break;case y.DateMillisecond:r=e.visitDateMillisecond||e.visitDate;break;case y.Timestamp:r=e.visitTimestamp;break;case y.TimestampSecond:r=e.visitTimestampSecond||e.visitTimestamp;break;case y.TimestampMillisecond:r=e.visitTimestampMillisecond||e.visitTimestamp;break;case y.TimestampMicrosecond:r=e.visitTimestampMicrosecond||e.visitTimestamp;break;case y.TimestampNanosecond:r=e.visitTimestampNanosecond||e.visitTimestamp;break;case y.Time:r=e.visitTime;break;case y.TimeSecond:r=e.visitTimeSecond||e.visitTime;break;case y.TimeMillisecond:r=e.visitTimeMillisecond||e.visitTime;break;case y.TimeMicrosecond:r=e.visitTimeMicrosecond||e.visitTime;break;case y.TimeNanosecond:r=e.visitTimeNanosecond||e.visitTime;break;case y.Decimal:r=e.visitDecimal;break;case y.List:r=e.visitList;break;case y.Struct:r=e.visitStruct;break;case y.Union:r=e.visitUnion;break;case y.DenseUnion:r=e.visitDenseUnion||e.visitUnion;break;case y.SparseUnion:r=e.visitSparseUnion||e.visitUnion;break;case y.Dictionary:r=e.visitDictionary;break;case y.Interval:r=e.visitInterval;break;case y.IntervalDayTime:r=e.visitIntervalDayTime||e.visitInterval;break;case y.IntervalYearMonth:r=e.visitIntervalYearMonth||e.visitInterval;break;case y.Duration:r=e.visitDuration;break;case y.DurationSecond:r=e.visitDurationSecond||e.visitDuration;break;case y.DurationMillisecond:r=e.visitDurationMillisecond||e.visitDuration;break;case y.DurationMicrosecond:r=e.visitDurationMicrosecond||e.visitDuration;break;case y.DurationNanosecond:r=e.visitDurationNanosecond||e.visitDuration;break;case y.FixedSizeList:r=e.visitFixedSizeList;break;case y.Map:r=e.visitMap;break}if(typeof r==`function`)return r;if(!n)return()=>null;throw Error(`Unrecognized type '${y[t]}'`)}function Lr(e){switch(e.typeId){case y.Null:return y.Null;case y.Int:{let{bitWidth:t,isSigned:n}=e;switch(t){case 8:return n?y.Int8:y.Uint8;case 16:return n?y.Int16:y.Uint16;case 32:return n?y.Int32:y.Uint32;case 64:return n?y.Int64:y.Uint64}return y.Int}case y.Float:switch(e.precision){case Ot.HALF:return y.Float16;case Ot.SINGLE:return y.Float32;case Ot.DOUBLE:return y.Float64}return y.Float;case y.Binary:return y.Binary;case y.LargeBinary:return y.LargeBinary;case y.Utf8:return y.Utf8;case y.LargeUtf8:return y.LargeUtf8;case y.Bool:return y.Bool;case y.Decimal:return y.Decimal;case y.Time:switch(e.unit){case g.SECOND:return y.TimeSecond;case g.MILLISECOND:return y.TimeMillisecond;case g.MICROSECOND:return y.TimeMicrosecond;case g.NANOSECOND:return y.TimeNanosecond}return y.Time;case y.Timestamp:switch(e.unit){case g.SECOND:return y.TimestampSecond;case g.MILLISECOND:return y.TimestampMillisecond;case g.MICROSECOND:return y.TimestampMicrosecond;case g.NANOSECOND:return y.TimestampNanosecond}return y.Timestamp;case y.Date:switch(e.unit){case kt.DAY:return y.DateDay;case kt.MILLISECOND:return y.DateMillisecond}return y.Date;case y.Interval:switch(e.unit){case At.DAY_TIME:return y.IntervalDayTime;case At.YEAR_MONTH:return y.IntervalYearMonth}return y.Interval;case y.Duration:switch(e.unit){case g.SECOND:return y.DurationSecond;case g.MILLISECOND:return y.DurationMillisecond;case g.MICROSECOND:return y.DurationMicrosecond;case g.NANOSECOND:return y.DurationNanosecond}return y.Duration;case y.Map:return y.Map;case y.List:return y.List;case y.Struct:return y.Struct;case y.Union:switch(e.mode){case Dt.Dense:return y.DenseUnion;case Dt.Sparse:return y.SparseUnion}return y.Union;case y.FixedSizeBinary:return y.FixedSizeBinary;case y.FixedSizeList:return y.FixedSizeList;case y.Dictionary:return y.Dictionary}throw Error(`Unrecognized type '${y[e.typeId]}'`)}S.prototype.visitInt8=null,S.prototype.visitInt16=null,S.prototype.visitInt32=null,S.prototype.visitInt64=null,S.prototype.visitUint8=null,S.prototype.visitUint16=null,S.prototype.visitUint32=null,S.prototype.visitUint64=null,S.prototype.visitFloat16=null,S.prototype.visitFloat32=null,S.prototype.visitFloat64=null,S.prototype.visitDateDay=null,S.prototype.visitDateMillisecond=null,S.prototype.visitTimestampSecond=null,S.prototype.visitTimestampMillisecond=null,S.prototype.visitTimestampMicrosecond=null,S.prototype.visitTimestampNanosecond=null,S.prototype.visitTimeSecond=null,S.prototype.visitTimeMillisecond=null,S.prototype.visitTimeMicrosecond=null,S.prototype.visitTimeNanosecond=null,S.prototype.visitDenseUnion=null,S.prototype.visitSparseUnion=null,S.prototype.visitIntervalDayTime=null,S.prototype.visitIntervalYearMonth=null,S.prototype.visitDuration=null,S.prototype.visitDurationSecond=null,S.prototype.visitDurationMillisecond=null,S.prototype.visitDurationMicrosecond=null,S.prototype.visitDurationNanosecond=null;var Rr=new Float64Array(1),zr=new Uint32Array(Rr.buffer);function Br(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 Vr(e){if(e!==e)return 32256;Rr[0]=e;let t=(zr[1]&2147483648)>>16&65535,n=zr[1]&2146435072,r=0;return n>=1089470464?zr[0]>0?n=31744:(n=(n&2080374784)>>16,r=(zr[1]&1048575)>>10):n<=1056964608?(r=1048576+(zr[1]&1048575),r=1048576+(r<<(n>>20)-998)>>21,n=0):(n=n-1056964608>>10,r=(zr[1]&1048575)+512>>10),t|n|r&65535}var C=class extends S{};function w(e){return(t,n,r)=>{if(t.setValid(n,r!=null))return e(t,n,r)}}const Hr=(e,t,n)=>{e[t]=Math.floor(n/864e5)},Ur=(e,t,n,r)=>{if(n+1{let i=e+n;r?t[i>>3]|=1<>3]&=~(1<{e[t]=n},Kr=({values:e},t,n)=>{e[t]=n},qr=({values:e},t,n)=>{e[t]=Vr(n)},Jr=(e,t,n)=>{switch(e.type.precision){case Ot.HALF:return qr(e,t,n);case Ot.SINGLE:case Ot.DOUBLE:return Kr(e,t,n)}},Yr=({values:e},t,n)=>{Hr(e,t,n.valueOf())},Xr=({values:e},t,n)=>{e[t]=BigInt(n)},Zr=({stride:e,values:t},n,r)=>{t.set(r.subarray(0,e),e*n)};var Qr=({values:e,valueOffsets:t},n,r)=>Ur(e,t,n,r),$r=({values:e,valueOffsets:t},n,r)=>Ur(e,t,n,Ve(r));const ei=(e,t,n)=>{e.type.unit===kt.DAY?Yr(e,t,n):Xr(e,t,n)},ti=({values:e},t,n)=>{e[t]=BigInt(n/1e3)},ni=({values:e},t,n)=>{e[t]=BigInt(n)},ri=({values:e},t,n)=>{e[t]=BigInt(n*1e3)},ii=({values:e},t,n)=>{e[t]=BigInt(n*1e6)},ai=(e,t,n)=>{switch(e.type.unit){case g.SECOND:return ti(e,t,n);case g.MILLISECOND:return ni(e,t,n);case g.MICROSECOND:return ri(e,t,n);case g.NANOSECOND:return ii(e,t,n)}},oi=({values:e},t,n)=>{e[t]=n},si=({values:e},t,n)=>{e[t]=n},ci=({values:e},t,n)=>{e[t]=n},li=({values:e},t,n)=>{e[t]=n},ui=(e,t,n)=>{switch(e.type.unit){case g.SECOND:return oi(e,t,n);case g.MILLISECOND:return si(e,t,n);case g.MICROSECOND:return ci(e,t,n);case g.NANOSECOND:return li(e,t,n)}},di=({values:e,stride:t},n,r)=>{e.set(r.subarray(0,t),t*n)};var fi=(e,t,n)=>{let r=e.children[0],i=e.valueOffsets,a=Mi.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=Mi.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},mi=(e,t)=>(n,r,i,a)=>r&&n(r,e,t[a]),hi=(e,t)=>(n,r,i,a)=>r&&n(r,e,t.get(a)),gi=(e,t)=>(n,r,i,a)=>r&&n(r,e,t.get(i.name)),_i=(e,t)=>(n,r,i,a)=>r&&n(r,e,t[i.name]),vi=(e,t,n)=>{let r=e.type.children.map(e=>Mi.getVisitFn(e.type)),i=n instanceof Map?gi(t,n):n instanceof So?hi(t,n):Array.isArray(n)?mi(t,n):_i(t,n);e.type.children.forEach((t,n)=>i(r[n],e.children[n],t,n))},yi=(e,t,n)=>{e.type.mode===Dt.Dense?bi(e,t,n):xi(e,t,n)},bi=(e,t,n)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[r];Mi.visit(i,e.valueOffsets[t],n)},xi=(e,t,n)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[r];Mi.visit(i,t,n)},Si=(e,t,n)=>{var r;(r=e.dictionary)==null||r.set(e.values[t],n)};const Ci=(e,t,n)=>{e.type.unit===At.DAY_TIME?wi(e,t,n):Ti(e,t,n)},wi=({values:e},t,n)=>{e.set(n.subarray(0,2),2*t)},Ti=({values:e},t,n)=>{e[t]=n[0]*12+n[1]%12},Ei=({values:e},t,n)=>{e[t]=n},Di=({values:e},t,n)=>{e[t]=n},Oi=({values:e},t,n)=>{e[t]=n},ki=({values:e},t,n)=>{e[t]=n},Ai=(e,t,n)=>{switch(e.type.unit){case g.SECOND:return Ei(e,t,n);case g.MILLISECOND:return Di(e,t,n);case g.MICROSECOND:return Oi(e,t,n);case g.NANOSECOND:return ki(e,t,n)}};var ji=(e,t,n)=>{let{stride:r}=e,i=e.children[0],a=Mi.getVisitFn(i);if(Array.isArray(n))for(let e=-1,o=t*r;++e`${bn(e)}: ${bn(t)}`).join(`, `)}}`}[Symbol.for(`nodejs.util.inspect.custom`)](){return this.toString()}[Symbol.iterator](){return new Ii(this[Ni],this[Pi])}},Ii=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[Ni].type.children.findIndex(e=>e.name===t)!==-1}getOwnPropertyDescriptor(e,t){if(e[Ni].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[Ni].type.children.findIndex(e=>e.name===t);if(n!==-1){let r=Ea.visit(e[Ni].children[n],e[Pi]);return Reflect.set(e,t,r),r}}set(e,t,n){let r=e[Ni].type.children.findIndex(e=>e.name===t);return r===-1?Reflect.has(e,t)||typeof t==`symbol`?Reflect.set(e,t,n):!1:(Mi.visit(e[Ni].children[r],e[Pi],n),Reflect.set(e,t,n))}},T=class extends S{};function E(e){return(t,n)=>t.getValid(n)?e(t,n):null}var Ri=(e,t)=>864e5*e[t],zi=(e,t)=>null,Bi=(e,t,n)=>{if(n+1>=t.length)return null;let r=b(t[n]),i=b(t[n+1]);return e.subarray(r,i)},Vi=({offset:e,values:t},n)=>{let r=e+n;return(t[r>>3]&1<Ri(e,t),Ui=({values:e},t)=>b(e[t]),Wi=({stride:e,values:t},n)=>t[e*n],Gi=({stride:e,values:t},n)=>Br(t[e*n]),Ki=({values:e},t)=>e[t],qi=({stride:e,values:t},n)=>t.subarray(e*n,e*(n+1)),Ji=({values:e,valueOffsets:t},n)=>Bi(e,t,n),Yi=({values:e,valueOffsets:t},n)=>{let r=Bi(e,t,n);return r===null?null:ze(r)},Xi=({values:e},t)=>e[t],Zi=({type:e,values:t},n)=>e.precision===Ot.HALF?Br(t[n]):t[n],Qi=(e,t)=>e.type.unit===kt.DAY?Hi(e,t):Ui(e,t),$i=({values:e},t)=>1e3*b(e[t]),ea=({values:e},t)=>b(e[t]),ta=({values:e},t)=>xn(e[t],BigInt(1e3)),na=({values:e},t)=>xn(e[t],BigInt(1e6)),ra=(e,t)=>{switch(e.type.unit){case g.SECOND:return $i(e,t);case g.MILLISECOND:return ea(e,t);case g.MICROSECOND:return ta(e,t);case g.NANOSECOND:return na(e,t)}},ia=({values:e},t)=>e[t],aa=({values:e},t)=>e[t],oa=({values:e},t)=>e[t],sa=({values:e},t)=>e[t],ca=(e,t)=>{switch(e.type.unit){case g.SECOND:return ia(e,t);case g.MILLISECOND:return aa(e,t);case g.MICROSECOND:return oa(e,t);case g.NANOSECOND:return sa(e,t)}},la=({values:e,stride:t},n)=>Mn.decimal(e.subarray(t*n,t*(n+1))),ua=(e,t)=>{let{valueOffsets:n,stride:r,children:i}=e,{[t*r]:a,[t*r+1]:o}=n;return new So([i[0].slice(a,o-a)])},da=(e,t)=>{let{valueOffsets:n,children:r}=e,{[t]:i,[t+1]:a}=n,o=r[0];return new ja(o.slice(i,a-i))},fa=(e,t)=>new Fi(e,t),pa=(e,t)=>e.type.mode===Dt.Dense?ma(e,t):ha(e,t),ma=(e,t)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],r=e.children[n];return Ea.visit(r,e.valueOffsets[t])},ha=(e,t)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],r=e.children[n];return Ea.visit(r,t)},ga=(e,t)=>e.dictionary?.get(e.values[t]),_a=(e,t)=>e.type.unit===At.DAY_TIME?va(e,t):ya(e,t),va=({values:e},t)=>e.subarray(2*t,2*(t+1)),ya=({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},ba=({values:e},t)=>e[t],xa=({values:e},t)=>e[t],Sa=({values:e},t)=>e[t],Ca=({values:e},t)=>e[t],wa=(e,t)=>{switch(e.type.unit){case g.SECOND:return ba(e,t);case g.MILLISECOND:return xa(e,t);case g.MICROSECOND:return Sa(e,t);case g.NANOSECOND:return Ca(e,t)}},Ta=(e,t)=>{let{stride:n,children:r}=e;return new So([r[0].slice(t*n,n)])};T.prototype.visitNull=E(zi),T.prototype.visitBool=E(Vi),T.prototype.visitInt=E(Xi),T.prototype.visitInt8=E(Wi),T.prototype.visitInt16=E(Wi),T.prototype.visitInt32=E(Wi),T.prototype.visitInt64=E(Ki),T.prototype.visitUint8=E(Wi),T.prototype.visitUint16=E(Wi),T.prototype.visitUint32=E(Wi),T.prototype.visitUint64=E(Ki),T.prototype.visitFloat=E(Zi),T.prototype.visitFloat16=E(Gi),T.prototype.visitFloat32=E(Wi),T.prototype.visitFloat64=E(Wi),T.prototype.visitUtf8=E(Yi),T.prototype.visitLargeUtf8=E(Yi),T.prototype.visitBinary=E(Ji),T.prototype.visitLargeBinary=E(Ji),T.prototype.visitFixedSizeBinary=E(qi),T.prototype.visitDate=E(Qi),T.prototype.visitDateDay=E(Hi),T.prototype.visitDateMillisecond=E(Ui),T.prototype.visitTimestamp=E(ra),T.prototype.visitTimestampSecond=E($i),T.prototype.visitTimestampMillisecond=E(ea),T.prototype.visitTimestampMicrosecond=E(ta),T.prototype.visitTimestampNanosecond=E(na),T.prototype.visitTime=E(ca),T.prototype.visitTimeSecond=E(ia),T.prototype.visitTimeMillisecond=E(aa),T.prototype.visitTimeMicrosecond=E(oa),T.prototype.visitTimeNanosecond=E(sa),T.prototype.visitDecimal=E(la),T.prototype.visitList=E(ua),T.prototype.visitStruct=E(fa),T.prototype.visitUnion=E(pa),T.prototype.visitDenseUnion=E(ma),T.prototype.visitSparseUnion=E(ha),T.prototype.visitDictionary=E(ga),T.prototype.visitInterval=E(_a),T.prototype.visitIntervalDayTime=E(va),T.prototype.visitIntervalYearMonth=E(ya),T.prototype.visitDuration=E(wa),T.prototype.visitDurationSecond=E(ba),T.prototype.visitDurationMillisecond=E(xa),T.prototype.visitDurationMicrosecond=E(Sa),T.prototype.visitDurationNanosecond=E(Ca),T.prototype.visitFixedSizeList=E(Ta),T.prototype.visitMap=E(da);const Ea=new T,Da=Symbol.for(`keys`),Oa=Symbol.for(`vals`),ka=Symbol.for(`kKeysAsStrings`),Aa=Symbol.for(`_kKeysAsStrings`);var ja=class{constructor(e){return this[Da]=new So([e.children[0]]).memoize(),this[Oa]=e.children[1],new Proxy(this,new Na)}get[ka](){return this[Aa]||(this[Aa]=Array.from(this[Da].toArray(),String))}[Symbol.iterator](){return new Ma(this[Da],this[Oa])}get size(){return this[Da].length}toArray(){return Object.values(this.toJSON())}toJSON(){let e=this[Da],t=this[Oa],n={};for(let r=-1,i=e.length;++r`${bn(e)}: ${bn(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),Ea.visit(this.vals,e)]})}},Na=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(e){return e[ka]}has(e,t){return e[ka].includes(t)}getOwnPropertyDescriptor(e,t){if(e[ka].indexOf(t)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(e,t){if(Reflect.has(e,t))return e[t];let n=e[ka].indexOf(t);if(n!==-1){let r=Ea.visit(Reflect.get(e,Oa),n);return Reflect.set(e,t,r),r}}set(e,t,n){let r=e[ka].indexOf(t);return r===-1?Reflect.has(e,t)?Reflect.set(e,t,n):!1:(Mi.visit(Reflect.get(e,Oa),r,n),Reflect.set(e,t,n))}};Object.defineProperties(ja.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:`Row`},[Da]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Oa]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Aa]:{writable:!0,enumerable:!1,configurable:!1,value:null}});var Pa;function Fa(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 Ia=(e,t)=>e<0?t+e:e;var La=e=>e!==e;function Ra(e){if(typeof e!=`object`||!e)return La(e)?La: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?_t(e,t):!1:e instanceof Map?Ba(e):Array.isArray(e)?za(e):e instanceof So?Va(e):Ha(e,!0)}function za(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 Wa(e,n);case Map:return Ka(e,n,n.keys());case ja:case Fi:case Object:case void 0:return Ka(e,n,t||Object.keys(n))}return n instanceof So?Ga(e,n):!1}}function Wa(e,t){let n=e.length;if(t.length!==n)return!1;for(let r=-1;++r>r}function Ya(e,t,n){let r=n.byteLength+7&-8;if(e>0||n.byteLength>3):Xa(new Za(n,e,t,null,qa)).subarray(0,r)),i}return n}function Xa(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 Za=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 Qa(e,t,i)+Qa(e,r,n)+$a(e,i>>3,r-i>>3)}function $a(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+=eo(a.getUint32(i)),i+=4;for(;o-i>=2;)r+=eo(a.getUint16(i)),i+=2;for(;o-i>=1;)r+=eo(a.getUint8(i)),i+=1;return r}function eo(e){let t=Math.trunc(e);return t-=t>>>1&1431655765,t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}var D=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 x.isSparseUnion(e)||x.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(x.isUnion(this.type))return this.children.reduce((e,t)=>e+t.nullCount,0);let e=this._nullCount,t;return e<=-1&&(t=this.nullBitmap)&&(this._nullCount=e=t.length===0?0:this.length-Qa(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=Pr(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(x.isUnion(t)){let n=t,r=this.children[n.typeIdToChildIndex[this.typeIds[e]]],i=n.mode===Dt.Dense?this.valueOffsets[e]:e;return r.getValid(i)}if(this.nullable&&this.nullCount>0){let t=this.offset+e;return(this.nullBitmap[t>>3]&1<>3;(!r||r.byteLength<=c)&&(r=new Uint8Array((i+a+63&-64)>>3).fill(255),this.nullCount>0?(r.set(Ya(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===y.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(Ya(this.offset,t,this.nullBitmap),0);let i=this.buffers;return i[vn.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[vn.TYPE])&&(a[vn.TYPE]=i.subarray(e,e+t)),(i=a[vn.OFFSET])&&(a[vn.OFFSET]=i.subarray(e,e+t+1))||(i=a[vn.DATA])&&(a[vn.DATA]=r===6?i:i.subarray(n*e,n*(e+t))),a}_sliceChildren(e,t,n){return e.map(e=>e.slice(t,n))}};D.prototype.children=Object.freeze([]);var to=new class e extends S{visit(e){return this.getVisitFn(e.type).call(this,e)}visitNull(e){let{type:t,offset:n=0,length:r=0}=e;return new D(t,n,r,r)}visitBool(e){let{type:t,offset:n=0}=e,r=h(e.nullBitmap),i=m(t.ArrayType,e.data),{length:a=i.length>>3,nullCount:o=e.nullBitmap?-1:0}=e;return new D(t,n,a,o,[void 0,i,r])}visitInt(e){let{type:t,offset:n=0}=e,r=h(e.nullBitmap),i=m(t.ArrayType,e.data),{length:a=i.length,nullCount:o=e.nullBitmap?-1:0}=e;return new D(t,n,a,o,[void 0,i,r])}visitFloat(e){let{type:t,offset:n=0}=e,r=h(e.nullBitmap),i=m(t.ArrayType,e.data),{length:a=i.length,nullCount:o=e.nullBitmap?-1:0}=e;return new D(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=lt(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new D(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=ut(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new D(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=lt(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new D(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=ut(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new D(t,n,o,s,[a,r,i])}visitFixedSizeBinary(e){let{type:t,offset:n=0}=e,r=h(e.nullBitmap),i=m(t.ArrayType,e.data),{length:a=i.length/Pr(t),nullCount:o=e.nullBitmap?-1:0}=e;return new D(t,n,a,o,[void 0,i,r])}visitDate(e){let{type:t,offset:n=0}=e,r=h(e.nullBitmap),i=m(t.ArrayType,e.data),{length:a=i.length/Pr(t),nullCount:o=e.nullBitmap?-1:0}=e;return new D(t,n,a,o,[void 0,i,r])}visitTimestamp(e){let{type:t,offset:n=0}=e,r=h(e.nullBitmap),i=m(t.ArrayType,e.data),{length:a=i.length/Pr(t),nullCount:o=e.nullBitmap?-1:0}=e;return new D(t,n,a,o,[void 0,i,r])}visitTime(e){let{type:t,offset:n=0}=e,r=h(e.nullBitmap),i=m(t.ArrayType,e.data),{length:a=i.length/Pr(t),nullCount:o=e.nullBitmap?-1:0}=e;return new D(t,n,a,o,[void 0,i,r])}visitDecimal(e){let{type:t,offset:n=0}=e,r=h(e.nullBitmap),i=m(t.ArrayType,e.data),{length:a=i.length/Pr(t),nullCount:o=e.nullBitmap?-1:0}=e;return new D(t,n,a,o,[void 0,i,r])}visitList(e){let{type:t,offset:n=0,child:r}=e,i=h(e.nullBitmap),a=lt(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new D(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 D(t,n,a,o,[void 0,void 0,i],r)}visitUnion(e){let{type:t,offset:n=0,children:r=[]}=e,i=m(t.ArrayType,e.typeIds),{length:a=i.length,nullCount:o=-1}=e;return x.isSparseUnion(t)?new D(t,n,a,o,[void 0,void 0,void 0,i],r):new D(t,n,a,o,[lt(e.valueOffsets),void 0,void 0,i],r)}visitDictionary(t){let{type:n,offset:r=0}=t,i=h(t.nullBitmap),a=m(n.indices.ArrayType,t.data),{dictionary:o=new So([new e().visit({type:n.dictionary})])}=t,{length:s=a.length,nullCount:c=t.nullBitmap?-1:0}=t;return new D(n,r,s,c,[void 0,a,i],[],o)}visitInterval(e){let{type:t,offset:n=0}=e,r=h(e.nullBitmap),i=m(t.ArrayType,e.data),{length:a=i.length/Pr(t),nullCount:o=e.nullBitmap?-1:0}=e;return new D(t,n,a,o,[void 0,i,r])}visitDuration(e){let{type:t,offset:n=0}=e,r=h(e.nullBitmap),i=m(t.ArrayType,e.data),{length:a=i.length,nullCount:o=e.nullBitmap?-1:0}=e;return new D(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/Pr(n),nullCount:s=t.nullBitmap?-1:0}=t;return new D(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=lt(t.valueOffsets),{length:s=o.length-1,nullCount:c=t.nullBitmap?-1:0}=t;return new D(n,r,s,c,[o,void 0,a],[i])}};function O(e){return to.visit(e)}var no=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 io(e){return e.reduce((e,t)=>e+t.nullCount,0)}function ao(e){return e.reduce((e,t,n)=>(e[n+1]=e[n]+t.length,e),new Uint32Array(e.length+1))}function oo(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 so(e,t,n,r){let i=0,a=0,o=t.length-1;do{if(i>=o-1)return n0?0:-1}function mo(e,t){let{nullBitmap:n}=e;if(!n||e.nullCount<=0)return-1;let r=0;for(let i of new Za(n,e.offset+(t||0),e.length,n,qa)){if(!i)return r;++r}return-1}function A(e,t,n){if(t===void 0)return-1;if(t===null)switch(e.typeId){case y.Union:break;case y.Dictionary:break;default:return mo(e,n)}let r=Ea.getVisitFn(e),i=Ra(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 no(e.data.length,t=>{let r=e.data[t].length,i=e.slice(n,n+r);return n+=r,new _o(i)})}var _o=class{constructor(e){this.vector=e,this.index=0}next(){return this.indexe.data):t;if(n.length===0||n.some(e=>!(e instanceof D)))throw TypeError(`Vector constructor expects an Array of Data instances.`);let r=n[0]?.type;switch(n.length){case 0:this._offsets=[0];break;case 1:{let{get:e,set:t,indexOf:i}=bo[r.typeId],a=n[0];this.isValid=e=>co(a,e),this.get=t=>e(a,t),this.set=(e,n)=>t(a,e,n),this.indexOf=e=>i(a,e),this._offsets=[0,a.length];break}default:Object.setPrototypeOf(this,xo[r.typeId]),this._offsets=ao(n);break}this.data=n,this.type=r,this.stride=Pr(r),this.numChildren=r.children?.length??0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((e,t)=>e+t.byteLength,0)}get nullable(){return ro(this.data)}get nullCount(){return io(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${y[this.type.typeId]}Vector`}isValid(e){return!1}get(e){return null}at(e){return this.get(Ia(e,this.length))}set(e,t){}indexOf(e,t){return-1}includes(e,t){return this.indexOf(e,t)>-1}[Symbol.iterator](){return vo.visit(this)}concat(...t){return new e(this.data.concat(t.flatMap(e=>e.data).flat(1/0)))}slice(t,n){return new e(Fa(this,t,n,({data:e,_offsets:t},n,r)=>oo(e,t,n,r)))}toJSON(){return[...this]}toArray(){let{type:e,data:t,length:n,stride:r,ArrayType:i}=this;switch(e.typeId){case y.Int:case y.Float:case y.Decimal:case y.Time:case y.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){return this.getChildAt(this.type.children?.findIndex(t=>t.name===e))}getChildAt(t){return t>-1&&te[t])):null}get isMemoized(){return x.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(x.isDictionary(this.type)){let t=new Co(this.data[0].dictionary);return new e(this.data.map(e=>{let n=e.clone();return n.dictionary=t,n}))}return new Co(this)}unmemoize(){if(x.isDictionary(this.type)&&this.isMemoized){let t=this.data[0].dictionary.unmemoize();return new e(this.data.map(e=>{let n=e.clone();return n.dictionary=t,n}))}return this}};yo=Symbol.toStringTag,So[yo]=(e=>{e.type=x.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(y).map(e=>y[e]).filter(e=>typeof e==`number`&&e!==y.NONE);for(let n of t)bo[n]={get:Ea.getVisitFnByTypeId(n),set:Mi.getVisitFnByTypeId(n),indexOf:go.getVisitFnByTypeId(n)},xo[n]=Object.create(e,{isValid:{value:lo(co)},get:{value:lo(Ea.getVisitFnByTypeId(n))},set:{value:uo(Mi.getVisitFnByTypeId(n))},indexOf:{value:fo(go.getVisitFnByTypeId(n))}});return`Vector`})(So.prototype);var Co=class e extends So{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 So(this.data)}),Object.defineProperty(this,`memoize`,{value:()=>this})}},wo=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()}},To=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()+4),(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):Et.V1}schema(e){let t=this.bb.__offset(this.bb_pos,6);return t?(e||new _n).__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 wo).__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 wo).__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 Yt).__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,Et.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){return e.endObject()}static finishFooterBuffer(e,t){e.finish(t)}static finishSizePrefixedFooterBuffer(e,t){e.finish(t,void 0,!0)}},Eo=class e{constructor(e=[],t,n,r=Et.V5){this.fields=e||[],this.metadata=t||new Map,n||=ko(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);return new e(this.fields.filter(e=>n.has(e.name)),this.metadata)}selectAt(t){return new e(t.map(e=>this.fields[e]).filter(Boolean),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=Oo(Oo(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:Oo(Oo(new Map,r[t].metadata),e.metadata)}))&&!1:!0}),o=ko(a,new Map);return new e([...r,...a],i,new Map([...this.dictionaries,...o]))}};Eo.prototype.fields=null,Eo.prototype.metadata=null,Eo.prototype.dictionaries=null;var Do=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)}};Do.prototype.type=null,Do.prototype.name=null,Do.prototype.nullable=null,Do.prototype.metadata=null;function Oo(e,t){return new Map([...e||new Map,...t||new Map])}function ko(e,t=new Map){for(let n=-1,r=e.length;++n0&&ko(r.children,t)}return t}var Ao=Lt,jo=It,Mo=class{static decode(e){e=new jo(h(e));let t=To.getRootAsFooter(e);return new No(Eo.decode(t.schema(),new Map,t.version()),t)}static encode(e){let t=new Ao,n=Eo.encode(t,e.schema);To.startRecordBatchesVector(t,e.numRecordBatches);for(let n of[...e.recordBatches()].slice().reverse())Po.encode(t,n);let r=t.endVector();To.startDictionariesVector(t,e.numDictionaries);for(let n of[...e.dictionaryBatches()].slice().reverse())Po.encode(t,n);let i=t.endVector();return To.startFooter(t),To.addSchema(t,n),To.addVersion(t,Et.V5),To.addRecordBatches(t,r),To.addDictionaries(t,i),To.finishFooterBuffer(t,To.endFooter(t)),t.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}constructor(e,t=Et.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 f(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(Fo);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(e){return vt.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,e)}toNodeStream(e){return vt.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,e)}throw(e){return f(this,void 0,void 0,function*(){return yield this.abort(e),Fo})}return(e){return f(this,void 0,void 0,function*(){return yield this.close(),Fo})}read(e){return f(this,void 0,void 0,function*(){return(yield this.next(e,`read`)).value})}peek(e){return f(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(Fo)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw Error(`AsyncQueue is closed`)}},zo=class extends Ro{write(e){if((e=h(e)).byteLength>0)return super.write(e)}toString(e=!1){return e?ze(this.toUint8Array(!0)):this.toUint8Array(!1).then(ze)}toUint8Array(e=!1){return e?ct(this._values)[0]:(()=>f(this,void 0,void 0,function*(){var e,t,n,r;let i=[],a=0;try{for(var o=!0,s=Le(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 ct(i,a)[0]}))()}},Bo=class{constructor(e){e&&(this.source=new Ho(vt.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)}},Vo=class e{constructor(t){t instanceof e?this.source=t.source:t instanceof zo?this.source=new Uo(vt.fromAsyncIterable(t)):rt(t)?this.source=new Uo(vt.fromNodeStream(t)):tt(t)?this.source=new Uo(vt.fromDOMStream(t)):Qe(t)?this.source=new Uo(vt.fromDOMStream(t.body)):qe(t)?this.source=new Uo(vt.fromIterable(t)):(Ke(t)||Je(t))&&(this.source=new Uo(vt.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)}},Ho=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)||Fo)}return(e){return Object.create(this.source.return&&this.source.return(e)||Fo)}},Uo=class{constructor(e){this.source=e,this._closedPromise=new Promise(e=>this._closedPromiseResolve=e)}cancel(e){return f(this,void 0,void 0,function*(){yield this.return(e)})}get closed(){return this._closedPromise}read(e){return f(this,void 0,void 0,function*(){return(yield this.next(e,`read`)).value})}peek(e){return f(this,void 0,void 0,function*(){return(yield this.next(e,`peek`)).value})}next(e){return f(this,arguments,void 0,function*(e,t=`read`){return yield this.source.next({cmd:t,size:e})})}throw(e){return f(this,void 0,void 0,function*(){let t=this.source.throw&&(yield this.source.throw(e))||Fo;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(t)})}return(e){return f(this,void 0,void 0,function*(){let t=this.source.return&&(yield this.source.return(e))||Fo;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(t)})}},Wo=class extends Bo{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),ef(this,void 0,void 0,function*(){this.size=(yield e.stat()).size,delete this._pending}))()}readInt32(e){return f(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 f(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`${qo(this.buffer[3])} ${qo(this.buffer[2])} ${qo(this.buffer[1])} ${qo(this.buffer[0])}`}static multiply(t,n){return new e(new Uint32Array(t.buffer)).times(n)}static add(t,n){return new e(new Uint32Array(t.buffer)).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)}},ts=class extends es{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:Xa(this.sources[n])}readOffsets(e,{offset:t}=this.nextBufferRange()){return m(Uint8Array,m(e.OffsetArrayType,this.sources[t]))}readTypeIds(e,{offset:t}=this.nextBufferRange()){return m(Uint8Array,m(e.ArrayType,this.sources[t]))}readData(e,{offset:t}=this.nextBufferRange()){let{sources:n}=this;return x.isTimestamp(e)||(x.isInt(e)||x.isTime(e))&&e.bitWidth===64||x.isDuration(e)||x.isDate(e)&&e.unit===kt.MILLISECOND?m(Uint8Array,Qo.convertArray(n[t])):x.isDecimal(e)?m(Uint8Array,$o.convertArray(n[t])):x.isBinary(e)||x.isLargeBinary(e)||x.isFixedSizeBinary(e)?ns(n[t]):x.isBool(e)?Xa(n[t]):x.isUtf8(e)||x.isLargeUtf8(e)?Ve(n[t].join(``)):m(Uint8Array,m(e.ArrayType,n[t].map(e=>+e)))}};function ns(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 N=class extends S{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 rs(e,t){return t instanceof e.constructor}function is(e,t){return e===t||rs(e,t)}function as(e,t){return e===t||rs(e,t)&&e.bitWidth===t.bitWidth&&e.isSigned===t.isSigned}function os(e,t){return e===t||rs(e,t)&&e.precision===t.precision}function ss(e,t){return e===t||rs(e,t)&&e.byteWidth===t.byteWidth}function cs(e,t){return e===t||rs(e,t)&&e.unit===t.unit}function ls(e,t){return e===t||rs(e,t)&&e.unit===t.unit&&e.timezone===t.timezone}function us(e,t){return e===t||rs(e,t)&&e.unit===t.unit&&e.bitWidth===t.bitWidth}function ds(e,t){return e===t||rs(e,t)&&e.children.length===t.children.length&&ys.compareManyFields(e.children,t.children)}function fs(e,t){return e===t||rs(e,t)&&e.children.length===t.children.length&&ys.compareManyFields(e.children,t.children)}function ps(e,t){return e===t||rs(e,t)&&e.mode===t.mode&&e.typeIds.every((e,n)=>e===t.typeIds[n])&&ys.compareManyFields(e.children,t.children)}function ms(e,t){return e===t||rs(e,t)&&e.id===t.id&&e.isOrdered===t.isOrdered&&ys.visit(e.indices,t.indices)&&ys.visit(e.dictionary,t.dictionary)}function hs(e,t){return e===t||rs(e,t)&&e.unit===t.unit}function gs(e,t){return e===t||rs(e,t)&&e.unit===t.unit}function _s(e,t){return e===t||rs(e,t)&&e.listSize===t.listSize&&e.children.length===t.children.length&&ys.compareManyFields(e.children,t.children)}function vs(e,t){return e===t||rs(e,t)&&e.keysSorted===t.keysSorted&&e.children.length===t.children.length&&ys.compareManyFields(e.children,t.children)}N.prototype.visitNull=is,N.prototype.visitBool=is,N.prototype.visitInt=as,N.prototype.visitInt8=as,N.prototype.visitInt16=as,N.prototype.visitInt32=as,N.prototype.visitInt64=as,N.prototype.visitUint8=as,N.prototype.visitUint16=as,N.prototype.visitUint32=as,N.prototype.visitUint64=as,N.prototype.visitFloat=os,N.prototype.visitFloat16=os,N.prototype.visitFloat32=os,N.prototype.visitFloat64=os,N.prototype.visitUtf8=is,N.prototype.visitLargeUtf8=is,N.prototype.visitBinary=is,N.prototype.visitLargeBinary=is,N.prototype.visitFixedSizeBinary=ss,N.prototype.visitDate=cs,N.prototype.visitDateDay=cs,N.prototype.visitDateMillisecond=cs,N.prototype.visitTimestamp=ls,N.prototype.visitTimestampSecond=ls,N.prototype.visitTimestampMillisecond=ls,N.prototype.visitTimestampMicrosecond=ls,N.prototype.visitTimestampNanosecond=ls,N.prototype.visitTime=us,N.prototype.visitTimeSecond=us,N.prototype.visitTimeMillisecond=us,N.prototype.visitTimeMicrosecond=us,N.prototype.visitTimeNanosecond=us,N.prototype.visitDecimal=is,N.prototype.visitList=ds,N.prototype.visitStruct=fs,N.prototype.visitUnion=ps,N.prototype.visitDenseUnion=ps,N.prototype.visitSparseUnion=ps,N.prototype.visitDictionary=ms,N.prototype.visitInterval=hs,N.prototype.visitIntervalDayTime=hs,N.prototype.visitIntervalYearMonth=hs,N.prototype.visitDuration=gs,N.prototype.visitDurationSecond=gs,N.prototype.visitDurationMillisecond=gs,N.prototype.visitDurationMicrosecond=gs,N.prototype.visitDurationNanosecond=gs,N.prototype.visitFixedSizeList=_s,N.prototype.visitMap=vs;const ys=new N;function bs(e,t){return ys.compareSchemas(e,t)}function xs(e,t){return Ss(e,t.map(e=>e.data.concat()))}function Ss(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++]=O({type:new Dr(n),length:o,nullCount:0,children:u.slice()})))}return[e=e.assign(n),r.map(t=>new Ds(e,t))]}function Cs(e,t,n,r,i){let a=(t+63&-64)>>3;for(let o=-1,s=r.length;++o=t)c===t?n[o]=s:(n[o]=s.slice(0,t),i.numBatches=Math.max(i.numBatches,r[o].unshift(s.slice(t,c-t))));else{let r=e[o];e[o]=r.clone({nullable:!0}),n[o]=s?._changeLengthAndBackfillNullBitmap(t)??O({type:r.type,length:t,nullCount:t,nullBitmap:new Uint8Array(a)})}}return n}var ws,Ts=class e{constructor(...t){if(t.length===0)return this.batches=[],this.schema=new Eo([]),this._offsets=[0],this;let n,r;t[0]instanceof Eo&&(n=t.shift()),t.at(-1)instanceof Uint32Array&&(r=t.pop());let i=t=>{if(t){if(t instanceof Ds)return[t];if(t instanceof e)return t.batches;if(t instanceof D){if(t.type instanceof Dr)return[new Ds(new Eo(t.type.children),t)]}else if(Array.isArray(t))return t.flatMap(e=>i(e));else if(typeof t[Symbol.iterator]==`function`)return[...t].flatMap(e=>i(e));else if(typeof t==`object`){let e=Object.keys(t),r=e.map(e=>new So([t[e]])),[,i]=xs(n??new Eo(e.map((e,t)=>new Do(String(e),r[t].type,r[t].nullable))),r);return i.length===0?[new Ds(t)]:i}}return[]},a=t.flatMap(e=>i(e));if(n=n??a[0]?.schema??new Eo([]),!(n instanceof Eo))throw TypeError(`Table constructor expects a [Schema, RecordBatch[]] pair.`);for(let e of a){if(!(e instanceof Ds))throw TypeError(`Table constructor expects a [Schema, RecordBatch[]] pair.`);if(!bs(n,e.schema))throw TypeError(`Table and inner RecordBatch schemas must be equivalent.`)}this.schema=n,this.batches=a,this._offsets=r??ao(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=io(this.data)),this._nullCount}isValid(e){return!1}get(e){return null}at(e){return this.get(Ia(e,this.numRows))}set(e,t){}indexOf(e,t){return-1}[Symbol.iterator](){return this.batches.length>0?vo.visit(new So(this.data)):[][Symbol.iterator]()}toArray(){return[...this]}toString(){return`[\n ${this.toArray().join(`, `)}\n]`}concat(...t){let n=this.schema;return new e(n,this.data.concat(t.flatMap(({data:e})=>e)).map(e=>new Ds(n,e)))}slice(t,n){let r=this.schema;return[t,n]=Fa({length:this.numRows},t,n),new e(r,oo(this.data,this._offsets,t,n).map(e=>new Ds(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=O({type:n,length:0,nullCount:0});t.push(r._changeLengthAndBackfillNullBitmap(this.numRows))}return new So(t)}return null}setChild(e,t){return this.setChildAt(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]=xs(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){return new e(this.schema.selectAt(t),this.batches.map(e=>e.selectAt(t)))}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},[[],[]]);return new e(...xs(this.schema.assign(t.schema),[...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)))}};ws=Symbol.toStringTag,Ts[ws]=(e=>(e.schema=null,e.batches=[],e._offsets=new Uint32Array([0]),e._nullCount=-1,e[Symbol.isConcatSpreadable]=!0,e.isValid=lo(co),e.get=lo(Ea.getVisitFn(y.Struct)),e.set=uo(Mi.getVisitFn(y.Struct)),e.indexOf=fo(go.getVisitFn(y.Struct)),`Table`))(Ts.prototype);var Es,Ds=class e{constructor(...e){switch(e.length){case 2:if([this.schema]=e,!(this.schema instanceof Eo)||([,this.data=O({nullCount:0,type:new Dr(this.schema.fields),children:this.schema.fields.map(e=>O({type:e.type,nullCount:0}))})]=e,!(this.data instanceof D)))throw TypeError(`RecordBatch constructor expects a [Schema, Data] pair.`);[this.schema,this.data]=Os(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]=Do.new({name:n,type:t[n].type,nullable:!0}),e),{length:0,fields:[],children:[]}),a=new Eo(n),o=O({type:new Dr(n),length:i,children:r,nullCount:0});[this.schema,this.data]=Os(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||=ks(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 Ea.visit(this.data,e)}at(e){return this.get(Ia(e,this.numRows))}set(e,t){return Mi.visit(this.data,e,t)}indexOf(e,t){return go.visit(this.data,e,t)}[Symbol.iterator](){return vo.visit(new So([this.data]))}toArray(){return[...this]}concat(...e){return new Ts(this.schema,[this,...e])}slice(t,n){let[r]=new So([this.data]).slice(t,n).data;return new e(this.schema,r)}getChild(e){return this.getChildAt(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,O({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);return new e(n,O({type:new Dr(n.fields),length:this.numRows,children:r}))}};Es=Symbol.toStringTag,Ds[Es]=(e=>(e._nullCount=-1,e[Symbol.isConcatSpreadable]=!0,`RecordBatch`))(Ds.prototype);function Os(e,t,n=t.reduce((e,t)=>Math.max(e,t.length),0)){let r=[...e.fields],i=[...t],a=(n+63&-64)>>3;for(let[o,s]of e.fields.entries()){let e=t[o];(!e||e.length!==n)&&(r[o]=s.clone({nullable:!0}),i[o]=e?._changeLengthAndBackfillNullBitmap(n)??O({type:s.type,length:n,nullCount:n,nullBitmap:new Uint8Array(a)}))}return[e.assign(r),O({type:new Dr(r),length:n,children:i})]}function ks(e,t,n=new Map){if((e?.length??0)>0&&e?.length===t?.length)for(let r=-1,i=e.length;++rO({type:e.type})),n=O({type:new Dr(e.fields),nullCount:0,children:t});super(e,n)}},js=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()+4),(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):Et.V1}headerType(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint8(this.bb_pos+e):v.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 Yt).__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,Et.V1)}static addHeaderType(e,t){e.addFieldInt8(1,t,v.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){return e.endObject()}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)}};const Ms=new class extends S{visit(e,t){return e==null||t==null?void 0:super.visit(e,t)}visitNull(e,t){return un.startNull(t),un.endNull(t)}visitInt(e,t){return qt.startInt(t),qt.addBitWidth(t,e.bitWidth),qt.addIsSigned(t,e.isSigned),qt.endInt(t)}visitFloat(e,t){return rn.startFloatingPoint(t),rn.addPrecision(t,e.precision),rn.endFloatingPoint(t)}visitBinary(e,t){return Xt.startBinary(t),Xt.endBinary(t)}visitLargeBinary(e,t){return on.startLargeBinary(t),on.endLargeBinary(t)}visitBool(e,t){return Zt.startBool(t),Zt.endBool(t)}visitUtf8(e,t){return hn.startUtf8(t),hn.endUtf8(t)}visitLargeUtf8(e,t){return sn.startLargeUtf8(t),sn.endLargeUtf8(t)}visitDecimal(e,t){return $t.startDecimal(t),$t.addScale(t,e.scale),$t.addPrecision(t,e.precision),$t.addBitWidth(t,e.bitWidth),$t.endDecimal(t)}visitDate(e,t){return Qt.startDate(t),Qt.addUnit(t,e.unit),Qt.endDate(t)}visitTime(e,t){return fn.startTime(t),fn.addUnit(t,e.unit),fn.addBitWidth(t,e.bitWidth),fn.endTime(t)}visitTimestamp(e,t){let n=e.timezone&&t.createString(e.timezone)||void 0;return pn.startTimestamp(t),pn.addUnit(t,e.unit),n!==void 0&&pn.addTimezone(t,n),pn.endTimestamp(t)}visitInterval(e,t){return an.startInterval(t),an.addUnit(t,e.unit),an.endInterval(t)}visitDuration(e,t){return en.startDuration(t),en.addUnit(t,e.unit),en.endDuration(t)}visitList(e,t){return cn.startList(t),cn.endList(t)}visitStruct(e,t){return dn.startStruct_(t),dn.endStruct_(t)}visitUnion(e,t){mn.startTypeIdsVector(t,e.typeIds.length);let n=mn.createTypeIdsVector(t,e.typeIds);return mn.startUnion(t),mn.addMode(t,e.mode),mn.addTypeIds(t,n),mn.endUnion(t)}visitDictionary(e,t){let n=this.visit(e.indices,t);return Jt.startDictionaryEncoding(t),Jt.addId(t,BigInt(e.id)),Jt.addIsOrdered(t,e.isOrdered),n!==void 0&&Jt.addIndexType(t,n),Jt.endDictionaryEncoding(t)}visitFixedSizeBinary(e,t){return tn.startFixedSizeBinary(t),tn.addByteWidth(t,e.byteWidth),tn.endFixedSizeBinary(t)}visitFixedSizeList(e,t){return nn.startFixedSizeList(t),nn.addListSize(t,e.listSize),nn.endFixedSizeList(t)}visitMap(e,t){return ln.startMap(t),ln.addKeysSorted(t,e.keysSorted),ln.endMap(t)}};function Ns(e,t=new Map){return new Eo(Is(e,t),Hs(e.metadata),t)}function Ps(e){return new Js(e.count,Rs(e.columns),zs(e.columns))}function Fs(e){return new Ys(Ps(e.data),e.id,e.isDelta)}function Is(e,t){return(e.fields||[]).filter(Boolean).map(e=>Do.fromJSON(e,t))}function Ls(e,t){return(e.children||[]).filter(Boolean).map(e=>Do.fromJSON(e,t))}function Rs(e){return(e||[]).reduce((e,t)=>[...e,new Zs(t.count,Bs(t.VALIDITY)),...Rs(t.children)],[])}function zs(e,t=[]){for(let n=-1,r=(e||[]).length;++ne+ +(t===0),0)}function Vs(e,t){let n,r,i,a,o,s;return!t||!(a=e.dictionary)?(o=Ws(e,Ls(e,t)),i=new Do(e.name,o,e.nullable,Hs(e.metadata))):t.has(n=a.id)?(r=(r=a.indexType)?Us(r):new ar,s=new Nr(t.get(n),r,n,a.isOrdered),i=new Do(e.name,s,e.nullable,Hs(e.metadata))):(r=(r=a.indexType)?Us(r):new ar,t.set(n,o=Ws(e,Ls(e,t))),s=new Nr(o,r,n,a.isOrdered),i=new Do(e.name,s,e.nullable,Hs(e.metadata))),i||null}function Hs(e=[]){return new Map(e.map(({key:e,value:t})=>[e,t]))}function Us(e){return new nr(e.isSigned,e.bitWidth)}function Ws(e,t){let n=e.type.name;switch(n){case`NONE`:return new tr;case`null`:return new tr;case`binary`:return new hr;case`largebinary`:return new gr;case`utf8`:return new _r;case`largeutf8`:return new vr;case`bool`:return new yr;case`list`:return new Er((t||[])[0]);case`struct`:return new Dr(t||[]);case`struct_`:return new Dr(t||[])}switch(n){case`int`:{let t=e.type;return new nr(t.isSigned,t.bitWidth)}case`floatingpoint`:{let t=e.type;return new dr(Ot[t.precision])}case`decimal`:{let t=e.type;return new br(t.scale,t.precision,t.bitWidth)}case`date`:{let t=e.type;return new xr(kt[t.unit])}case`time`:{let t=e.type;return new Sr(g[t.unit],t.bitWidth)}case`timestamp`:{let t=e.type;return new Cr(g[t.unit],t.timezone)}case`interval`:{let t=e.type;return new wr(At[t.unit])}case`duration`:{let t=e.type;return new Tr(g[t.unit])}case`union`:{let n=e.type,[r,...i]=(n.mode+``).toLowerCase();return new Or(Dt[r.toUpperCase()+i.join(``)],n.typeIds||[],t||[])}case`fixedsizebinary`:{let t=e.type;return new kr(t.byteWidth)}case`fixedsizelist`:{let n=e.type;return new Ar(n.listSize,(t||[])[0])}case`map`:{let n=e.type;return new jr((t||[])[0],n.keysSorted)}}throw Error(`Unrecognized type: "${n}"`)}var Gs=Lt,Ks=It,qs=class e{static fromJSON(t,n){let r=new e(0,Et.V5,n);return r._createHeader=Qs(t,n),r}static decode(t){t=new Ks(h(t));let n=js.getRootAsMessage(t),r=n.bodyLength(),i=n.version(),a=n.headerType(),o=new e(r,i,a);return o._createHeader=$s(n,a),o}static encode(e){let t=new Gs,n=-1;return e.isSchema()?n=Eo.encode(t,e.header()):e.isRecordBatch()?n=Js.encode(t,e.header()):e.isDictionaryBatch()&&(n=Ys.encode(t,e.header())),js.startMessage(t),js.addVersion(t,Et.V5),js.addHeader(t,n),js.addHeaderType(t,e.headerType),js.addBodyLength(t,BigInt(e.bodyLength)),js.finishMessageBuffer(t,js.endMessage(t)),t.asUint8Array()}static from(t,n=0){if(t instanceof Eo)return new e(0,Et.V5,v.Schema,t);if(t instanceof Js)return new e(n,Et.V5,v.RecordBatch,t);if(t instanceof Ys)return new e(n,Et.V5,v.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===v.Schema}isRecordBatch(){return this.headerType===v.RecordBatch}isDictionaryBatch(){return this.headerType===v.DictionaryBatch}constructor(e,t,n,r){this._version=t,this._headerType=n,this.body=new Uint8Array,r&&(this._createHeader=()=>r),this._bodyLength=b(e)}},Js=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=b(e)}},Ys=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=b(t)}},Xs=class{constructor(e,t){this.offset=b(e),this.length=b(t)}},Zs=class{constructor(e,t){this.length=b(e),this.nullCount=b(t)}};function Qs(e,t){return(()=>{switch(t){case v.Schema:return Eo.fromJSON(e);case v.RecordBatch:return Js.fromJSON(e);case v.DictionaryBatch:return Ys.fromJSON(e)}throw Error(`Unrecognized Message type: { name: ${v[t]}, type: ${t} }`)})}function $s(e,t){return(()=>{switch(t){case v.Schema:return Eo.decode(e.header(new _n),new Map,e.version());case v.RecordBatch:return Js.decode(e.header(new Ut),e.version());case v.DictionaryBatch:return Ys.decode(e.header(new Wt),e.version())}throw Error(`Unrecognized Message type: { name: ${v[t]}, type: ${t} }`)})}Do.encode=mc,Do.decode=lc,Do.fromJSON=Vs,Eo.encode=pc,Eo.decode=ec,Eo.fromJSON=Ns,Js.encode=hc,Js.decode=tc,Js.fromJSON=Ps,Ys.encode=gc,Ys.decode=nc,Ys.fromJSON=Fs,Zs.encode=_c,Zs.decode=ic,Xs.encode=vc,Xs.decode=rc;function ec(e,t=new Map,n=Et.V5){return new Eo(sc(e,t),uc(e),t,n)}function tc(e,t=Et.V5){if(e.compression()!==null)throw Error(`Record batch compression not implemented`);return new Js(e.length(),ac(e),oc(e,t))}function nc(e,t=Et.V5){return new Ys(Js.decode(e.data(),t),e.id(),e.isDelta())}function rc(e){return new Xs(e.offset(),e.length())}function ic(e){return new Zs(e.length(),e.nullCount())}function ac(e){let t=[];for(let n,r=-1,i=-1,a=e.nodesLength();++rDo.encode(e,t));_n.startFieldsVector(e,n.length);let r=_n.createFieldsVector(e,n),i=t.metadata&&t.metadata.size>0?_n.createCustomMetadataVector(e,[...t.metadata].map(([t,n])=>{let r=e.createString(`${t}`),i=e.createString(`${n}`);return Yt.startKeyValue(e),Yt.addKey(e,r),Yt.addValue(e,i),Yt.endKeyValue(e)})):-1;return _n.startSchema(e),_n.addFields(e,r),_n.addEndianness(e,yc?Gt.Little:Gt.Big),i!==-1&&_n.addCustomMetadata(e,i),_n.endSchema(e)}function mc(e,t){let n=-1,r=-1,i=-1,a=t.type,o=t.typeId;x.isDictionary(a)?(o=a.dictionary.typeId,i=Ms.visit(a,e),r=Ms.visit(a.dictionary,e)):r=Ms.visit(a,e);let s=(a.children||[]).map(t=>Do.encode(e,t)),c=gn.createChildrenVector(e,s),l=t.metadata&&t.metadata.size>0?gn.createCustomMetadataVector(e,[...t.metadata].map(([t,n])=>{let r=e.createString(`${t}`),i=e.createString(`${n}`);return Yt.startKeyValue(e),Yt.addKey(e,r),Yt.addValue(e,i),Yt.endKeyValue(e)})):-1;return t.name&&(n=e.createString(t.name)),gn.startField(e),gn.addType(e,r),gn.addTypeType(e,o),gn.addChildren(e,c),gn.addNullable(e,!!t.nullable),n!==-1&&gn.addName(e,n),i!==-1&&gn.addDictionary(e,i),l!==-1&&gn.addCustomMetadata(e,l),gn.endField(e)}function hc(e,t){let n=t.nodes||[],r=t.buffers||[];Ut.startNodesVector(e,n.length);for(let t of n.slice().reverse())Zs.encode(e,t);let i=e.endVector();Ut.startBuffersVector(e,r.length);for(let t of r.slice().reverse())Xs.encode(e,t);let a=e.endVector();return Ut.startRecordBatch(e),Ut.addLength(e,BigInt(t.length)),Ut.addNodes(e,i),Ut.addBuffers(e,a),Ut.endRecordBatch(e)}function gc(e,t){let n=Js.encode(e,t.data);return Wt.startDictionaryBatch(e),Wt.addId(e,BigInt(t.id)),Wt.addIsDelta(e,t.isDelta),Wt.addData(e,n),Wt.endDictionaryBatch(e)}function _c(e,t){return Ht.createFieldNode(e,BigInt(t.length),BigInt(t.nullCount))}function vc(e,t){return Vt.createBuffer(e,BigInt(t.offset),BigInt(t.length))}var yc=(()=>{let e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),new Int16Array(e)[0]===256})(),bc=e=>`Expected ${v[e]} Message in stream, but was null or length 0.`,xc=e=>`Header pointer of flatbuffer-encoded ${v[e]} Message is null or length 0.`,Sc=(e,t)=>`Expected to read ${e} metadata bytes, but only read ${t}.`,Cc=(e,t)=>`Expected to read ${e} bytes for message body, but only read ${t}.`,wc=class{constructor(e){this.source=e instanceof Bo?e:new Bo(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?Fo: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(bc(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(bc(e));return t.value}readSchema(){let e=v.Schema,t=this.readMessage(e),n=t?.header();if(!t||!n)throw Error(xc(e));return n}};const Dc=new Uint8Array(6);for(let e=0;e<6;e+=1)Dc[e]=`ARROW1`.codePointAt(e);function Oc(e,t=0){for(let n=-1,r=Dc.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 vt.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return vt.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:Ye(t)?Kc(t):Ze(t)?Yc(t):Ke(t)?(()=>f(this,void 0,void 0,function*(){return yield e.from(yield t)}))():Qe(t)||tt(t)||rt(t)||Je(t)?Jc(new Vo(t)):qc(new Bo(t))}static readAll(t){return t instanceof e?t.isSync()?Wc(t):Gc(t):Ye(t)||ArrayBuffer.isView(t)||qe(t)||Xe(t)?Wc(t):Gc(t)}},Nc=class extends Mc{constructor(e){super(e),this._impl=e}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return Fe(this,arguments,function*(){yield p(yield*Ie(Le(this[Symbol.iterator]())))})}},Pc=class extends Mc{constructor(e){super(e),this._impl=e}readAll(){return f(this,void 0,void 0,function*(){var e,t,n,r;let i=[];try{for(var a=!0,o=Le(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]()}},Fc=class extends Nc{constructor(e){super(e),this._impl=e}},Ic=class extends Pc{constructor(e){super(e),this._impl=e}},Lc=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=O({type:new Dr(this.schema.fields),length:e.length,children:n});return new Ds(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 So(c)):new So(c)).memoize()}_loadVectors(e,t,n){return new es(t,e.nodes,e.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(n)}},Rc=class extends Lc{constructor(e,t){super(t),this._reader=Ye(e)?new Ec(this._handle=e):new wc(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=Uc(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):Fo}return(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(e):Fo}next(){if(this.closed)return Fo;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);return{done:!1,value:this._loadRecordBatch(n,r)}}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 As(this.schema)}):this.return()}_readNextMessageAndValidate(e){return this._reader.readMessage(e)}},zc=class extends Lc{constructor(e,t){super(t),this._reader=new Tc(this._handle=e)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return f(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 f(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=Uc(this,e),(this.schema||=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(e){return f(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(e):Fo})}return(e){return f(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(e):Fo})}next(){return f(this,void 0,void 0,function*(){if(this.closed)return Fo;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);return{done:!1,value:this._loadRecordBatch(n,r)}}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 As(this.schema)}):yield this.return()})}_readNextMessageAndValidate(e){return f(this,void 0,void 0,function*(){return yield this._reader.readMessage(e)})}},Bc=class extends Rc{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 Wo?e:new Wo(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){if(this.closed)return null;this._footer||this.open();let t=this._footer?.getRecordBatch(e);if(t&&this._handle.seek(t.offset)){let e=this._reader.readMessage(v.RecordBatch);if(e?.isRecordBatch()){let t=e.header(),n=this._reader.readMessageBody(e.bodyLength);return this._loadRecordBatch(t,n)}}return null}_readDictionaryBatch(e){let t=this._footer?.getDictionaryBatch(e);if(t&&this._handle.seek(t.offset)){let e=this._reader.readMessage(v.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-Ac,n=e.readInt32(t),r=e.readAt(t-n,n);return Mo.decode(r)}_readNextMessageAndValidate(e){if(this._footer||this.open(),this._footer&&this._recordBatchIndexsuper.open}});return f(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 f(this,void 0,void 0,function*(){if(this.closed)return null;this._footer||(yield this.open());let t=this._footer?.getRecordBatch(e);if(t&&(yield this._handle.seek(t.offset))){let e=yield this._reader.readMessage(v.RecordBatch);if(e?.isRecordBatch()){let t=e.header(),n=yield this._reader.readMessageBody(e.bodyLength);return this._loadRecordBatch(t,n)}}return null})}_readDictionaryBatch(e){return f(this,void 0,void 0,function*(){let t=this._footer?.getDictionaryBatch(e);if(t&&(yield this._handle.seek(t.offset))){let e=yield this._reader.readMessage(v.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 f(this,void 0,void 0,function*(){let{_handle:e}=this;e._pending&&(yield e._pending);let t=e.size-Ac,n=yield e.readInt32(t),r=yield e.readAt(t-n,n);return Mo.decode(r)})}_readNextMessageAndValidate(e){return f(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex=4?Oc(t)?new Fc(new Bc(e.read())):new Nc(new Rc(e)):new Nc(new Rc(function*(){}()))}function Jc(e){return f(this,void 0,void 0,function*(){let t=yield e.peek(kc+7&-8);return t&&t.byteLength>=4?Oc(t)?new Fc(new Bc(yield e.read())):new Pc(new zc(e)):new Pc(new zc(function(){return Fe(this,arguments,function*(){})}()))})}function Yc(e){return f(this,void 0,void 0,function*(){let{size:t}=yield e.stat(),n=new Go(e,t);return t>=jc&&Oc(yield n.readAt(0,kc+7&-8))?new Ic(new Vc(n)):new Pc(new zc(n))})}var Xc=class e extends S{static assemble(...t){let n=e=>e.flatMap(e=>Array.isArray(e)?n(e):e instanceof Ds?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 So)return this.visitMany(e.data),this;let{type:t}=e;if(!x.isDictionary(t)){let{length:n}=e;if(n>2147483647)throw RangeError(`Cannot write arrays larger than 2^31 - 1 in length`);if(x.isUnion(t))this.nodes.push(new Zs(n,0));else{let{nullCount:r}=e;x.isNull(t)||Zc.call(this,r<=0?new Uint8Array:Ya(e.offset,n,e.nullBitmap)),this.nodes.push(new Zs(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 Zc(e){let t=e.byteLength+7&-8;return this.buffers.push(e),this.bufferRegions.push(new Xs(this._byteLength,t)),this._byteLength+=t,this}function Qc(e){let{type:t,length:n,typeIds:r,valueOffsets:i}=e;if(Zc.call(this,r),t.mode===Dt.Sparse)return rl.call(this,e);if(t.mode===Dt.Dense){if(e.offset<=0)return Zc.call(this,i),rl.call(this,e);{let a=new Int32Array(n),o=Object.create(null),s=Object.create(null);for(let e,t,c=-1;++c{let i=t.typeIds[r],a=o[i],c=s[i];return e.slice(a,Math.min(n,c))}))}}return this}function $c(e){let t;return e.nullCount>=e.length?Zc.call(this,new Uint8Array):(t=e.values)instanceof Uint8Array?Zc.call(this,Ya(e.offset,e.length,t)):Zc.call(this,Xa(e.values))}function el(e){return Zc.call(this,e.values.subarray(0,e.length*e.stride))}function tl(e){let{length:t,values:n,valueOffsets:r}=e,i=b(r[0]),a=b(r[t]),o=Math.min(a-i,n.byteLength-i);return Zc.call(this,gt(-i,t+1,r)),Zc.call(this,n.subarray(i,i+o)),this}function nl(e){let{length:t,valueOffsets:n}=e;if(n){let{0:r,[t]:i}=n;return Zc.call(this,gt(-r,t+1,n)),this.visit(e.children[0].slice(r,i-r))}return this.visit(e.children[0])}function rl(e){return this.visitMany(e.type.children.map((t,n)=>e.children[n]).filter(Boolean))[0]}Xc.prototype.visitBool=$c,Xc.prototype.visitInt=el,Xc.prototype.visitFloat=el,Xc.prototype.visitUtf8=tl,Xc.prototype.visitLargeUtf8=tl,Xc.prototype.visitBinary=tl,Xc.prototype.visitLargeBinary=tl,Xc.prototype.visitFixedSizeBinary=el,Xc.prototype.visitDate=el,Xc.prototype.visitTimestamp=el,Xc.prototype.visitTime=el,Xc.prototype.visitDecimal=el,Xc.prototype.visitList=nl,Xc.prototype.visitStruct=rl,Xc.prototype.visitUnion=Qc,Xc.prototype.visitInterval=el,Xc.prototype.visitDuration=el,Xc.prototype.visitFixedSizeList=nl,Xc.prototype.visitMap=nl;var il=class extends Lo{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 zo,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,Ge(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 Ke(e)?e.then(e=>this.writeAll(e)):Je(e)?cl(this,e):sl(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 zo?this._sink=e:(this._sink=new zo,e&&et(e)?this.toDOMStream({type:`bytes`}).pipeTo(e):e&&nt(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||!bs(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 Ts&&!(t=e.schema)||e instanceof Ds&&!(t=e.schema))return this.finish()&&void 0}else throw Error(`RecordBatchWriter is closed`);if(t&&!bs(t,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,t)}e instanceof Ds?e instanceof As||this._writeRecordBatch(e):e instanceof Ts?this.writeAll(e.batches):qe(e)&&this.writeAll(e)}_writeMessage(e,t=8){let n=t-1,r=qs.encode(e),i=r.byteLength,a=this._writeLegacyIpcFormat?4:8,o=i+a+n&~n,s=o-i-a;return e.headerType===v.RecordBatch?this._recordBatchBlocks.push(new Po(o,e.bodyLength,this._position)):e.headerType===v.DictionaryBatch&&this._dictionaryBlocks.push(new Po(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(qs.from(e))}_writeFooter(e){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(Dc)}_writePadding(e){return e>0?this._write(new Uint8Array(e)):this}_writeRecordBatch(e){let{byteLength:t,nodes:n,bufferRegions:r,buffers:i}=Xc.assemble(e),a=new Js(e.numRows,n,r),o=qs.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}=Xc.assemble(new So([e])),s=new Ys(new Js(e.length,i,a),t,n),c=qs.from(s,r);return this._writeMessage(c)._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){for(let[t,n]of e.dictionaries){let e=n?.data??[],r=this._seenDictionaries.get(t),i=this._dictionaryDeltaOffsets.get(t)??0;if(!r||r.data[0]!==e[0])for(let[n,r]of e.entries())this._writeDictionaryBatch(r,t,n>0);else if(ir.writeAll(e)):Je(t)?cl(r,t):sl(r,t)}},ol=class e extends il{static writeAll(t){let n=new e;return Ke(t)?t.then(e=>n.writeAll(e)):Je(t)?cl(n,t):sl(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=Mo.encode(new Mo(e,Et.V5,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(e)._write(t)._write(Int32Array.of(t.byteLength))._writeMagic()}};function sl(e,t){let n=t;t instanceof Ts&&(n=t.batches,e.reset(void 0,t.schema));for(let t of n)e.write(t);return e.finish()}function cl(e,t){return f(this,void 0,void 0,function*(){var n,r,i,a,o,s,c;try{for(n=!0,r=Le(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 ll(e,t=`stream`){return(t===`stream`?al:ol).writeAll(e).toUint8Array(!0)}var ul=Object.create,dl=Object.defineProperty,fl=Object.getOwnPropertyDescriptor,pl=Object.getOwnPropertyNames,ml=Object.getPrototypeOf,hl=Object.prototype.hasOwnProperty,gl=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),_l=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of pl(t))!hl.call(e,i)&&i!==n&&dl(e,i,{get:()=>t[i],enumerable:!(r=fl(t,i))||r.enumerable});return e},vl=(e,t,n)=>(n=e==null?{}:ul(ml(e)),_l(t||!e||!e.__esModule?dl(n,`default`,{value:e,enumerable:!0}):n,e)),yl=gl((e,t)=>{t.exports=Worker}),bl=(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))(bl||{}),xl=(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))(xl||{}),Sl=(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))(Sl||{}),Cl=(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))(Cl||{}),wl=(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))(wl||{}),Tl=(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))(Tl||{}),El=class{log(e){}},Dl=class{constructor(e=2){this.level=e}log(e){e.level>=this.level&&console.log(e)}},Ol=(e=>(e[e.SUCCESS=0]=`SUCCESS`,e))(Ol||{}),kl=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=Mc.from(t);return console.assert(n.isSync(),`Reader is not sync`),console.assert(n.isFile(),`Reader is not file`),new Ts(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 Al(this._bindings,this._conn,n),i=await Mc.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 jl(this._bindings,this._conn,t)}async insertArrowTable(e,t){let n=ll(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)}},Al=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}},jl=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=Mc.from(t);return console.assert(n.isSync()),console.assert(n.isFile()),new Ts(n)}async send(...e){let t=await this.bindings.sendPrepared(this.connectionId,this.statementId,e),n=new Al(this.bindings,this.connectionId,t),r=await Mc.from(n);return console.assert(r.isAsync()),console.assert(r.isStream()),r}},Ml=(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))(Ml||{}),Nl=(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))(Nl||{}),P=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 Pl(e){switch(e.typeId){case y.Binary:return{sqlType:`binary`};case y.Bool:return{sqlType:`bool`};case y.Date:return{sqlType:`date`};case y.DateDay:return{sqlType:`date32[d]`};case y.DateMillisecond:return{sqlType:`date64[ms]`};case y.Decimal:{let t=e;return{sqlType:`decimal`,precision:t.precision,scale:t.scale}}case y.Float:return{sqlType:`float`};case y.Float16:return{sqlType:`float16`};case y.Float32:return{sqlType:`float32`};case y.Float64:return{sqlType:`float64`};case y.Int:return{sqlType:`int32`};case y.Int16:return{sqlType:`int16`};case y.Int32:return{sqlType:`int32`};case y.Int64:return{sqlType:`int64`};case y.Uint16:return{sqlType:`uint16`};case y.Uint32:return{sqlType:`uint32`};case y.Uint64:return{sqlType:`uint64`};case y.Uint8:return{sqlType:`uint8`};case y.IntervalDayTime:return{sqlType:`interval[dt]`};case y.IntervalYearMonth:return{sqlType:`interval[m]`};case y.List:return{sqlType:`list`,valueType:Pl(e.valueType)};case y.FixedSizeBinary:return{sqlType:`fixedsizebinary`,byteWidth:e.byteWidth};case y.Null:return{sqlType:`null`};case y.Utf8:return{sqlType:`utf8`};case y.Struct:return{sqlType:`struct`,fields:e.children.map(e=>Fl(e.name,e.type))};case y.Map:{let t=e;return{sqlType:`map`,keyType:Pl(t.keyType),valueType:Pl(t.valueType)}}case y.Time:return{sqlType:`time[s]`};case y.TimeMicrosecond:return{sqlType:`time[us]`};case y.TimeMillisecond:return{sqlType:`time[ms]`};case y.TimeNanosecond:return{sqlType:`time[ns]`};case y.TimeSecond:return{sqlType:`time[s]`};case y.Timestamp:return{sqlType:`timestamp`,timezone:e.timezone||void 0};case y.TimestampSecond:return{sqlType:`timestamp[s]`,timezone:e.timezone||void 0};case y.TimestampMicrosecond:return{sqlType:`timestamp[us]`,timezone:e.timezone||void 0};case y.TimestampNanosecond:return{sqlType:`timestamp[ns]`,timezone:e.timezone||void 0};case y.TimestampMillisecond:return{sqlType:`timestamp[ms]`,timezone:e.timezone||void 0}}throw Error(`unsupported arrow type: ${e.toString()}`)}function Fl(e,t){let n=Pl(t);return n.name=e,n}var Il=new TextEncoder,Ll=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 P(`RESET`,null);return await this.postTask(e)}async ping(){let e=new P(`PING`,null);await this.postTask(e)}async dropFile(e){let t=new P(`DROP_FILE`,e);return await this.postTask(t)}async dropFiles(){let e=new P(`DROP_FILES`,null);return await this.postTask(e)}async flushFiles(){let e=new P(`FLUSH_FILES`,null);return await this.postTask(e)}async instantiate(e,t=null,n=e=>{}){this._onInstantiationProgress.push(n);let r=new P(`INSTANTIATE`,[e,t]);return await this.postTask(r)}async getVersion(){let e=new P(`GET_VERSION`,null);return await this.postTask(e)}async getFeatureFlags(){let e=new P(`GET_FEATURE_FLAGS`,null);return await this.postTask(e)}async open(e){let t=new P(`OPEN`,e);await this.postTask(t)}async tokenize(e){let t=new P(`TOKENIZE`,e);return await this.postTask(t)}async connectInternal(){let e=new P(`CONNECT`,null);return await this.postTask(e)}async connect(){let e=await this.connectInternal();return new kl(this,e)}async disconnect(e){let t=new P(`DISCONNECT`,e);await this.postTask(t)}async runQuery(e,t){let n=new P(`RUN_QUERY`,[e,t]);return await this.postTask(n)}async startPendingQuery(e,t,n=!1){let r=new P(`START_PENDING_QUERY`,[e,t,n]);return await this.postTask(r)}async pollPendingQuery(e){let t=new P(`POLL_PENDING_QUERY`,e);return await this.postTask(t)}async cancelPendingQuery(e){let t=new P(`CANCEL_PENDING_QUERY`,e);return await this.postTask(t)}async fetchQueryResults(e){let t=new P(`FETCH_QUERY_RESULTS`,e);return await this.postTask(t)}async getTableNames(e,t){let n=new P(`GET_TABLE_NAMES`,[e,t]);return await this.postTask(n)}async createPrepared(e,t){let n=new P(`CREATE_PREPARED`,[e,t]);return await this.postTask(n)}async closePrepared(e,t){let n=new P(`CLOSE_PREPARED`,[e,t]);await this.postTask(n)}async runPrepared(e,t,n){let r=new P(`RUN_PREPARED`,[e,t,n]);return await this.postTask(r)}async sendPrepared(e,t,n){let r=new P(`SEND_PREPARED`,[e,t,n]);return await this.postTask(r)}async globFiles(e){let t=new P(`GLOB_FILE_INFOS`,e);return await this.postTask(t)}async registerFileText(e,t){let n=Il.encode(t);await this.registerFileBuffer(e,n)}async registerFileURL(e,t,n,r){t===void 0&&(t=e);let i=new P(`REGISTER_FILE_URL`,[e,t,n,r]);await this.postTask(i)}async registerEmptyFileBuffer(e){}async registerFileBuffer(e,t){let n=new P(`REGISTER_FILE_BUFFER`,[e,t]);await this.postTask(n,[t.buffer])}async registerFileHandle(e,t,n,r){let i=new P(`REGISTER_FILE_HANDLE`,[e,t,n,r]);await this.postTask(i,[])}async registerOPFSFileName(e){let t=new P(`REGISTER_OPFS_FILE_NAME`,[e]);await this.postTask(t,[])}async collectFileStatistics(e,t){let n=new P(`COLLECT_FILE_STATISTICS`,[e,t]);await this.postTask(n,[])}async exportFileStatistics(e){let t=new P(`EXPORT_FILE_STATISTICS`,e);return await this.postTask(t,[])}async copyFileToBuffer(e){let t=new P(`COPY_FILE_TO_BUFFER`,e);return await this.postTask(t)}async copyFileToPath(e,t){let n=new P(`COPY_FILE_TO_PATH`,[e,t]);await this.postTask(n)}async insertArrowFromIPCStream(e,t,n){if(t.length==0)return;let r=new P(`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(Fl(t,r))}n.columnsFlat=e,delete n.columns}let r=new P(`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(Fl(t,r))}n.columnsFlat=e,delete n.columns}let r=new P(`IMPORT_JSON_FROM_PATH`,[e,t,n]);await this.postTask(r)}};function Rl(){let e=new TextDecoder;return t=>(typeof SharedArrayBuffer<`u`&&t.buffer instanceof SharedArrayBuffer&&(t=new Uint8Array(t)),e.decode(t))}Rl();var zl=(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))(zl||{}),Bl=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])),Vl=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])),Hl=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])),Ul=()=>(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])),Wl={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`}}};Wl.name,Wl.version;var Gl=Wl.version.split(`.`);Gl[0],Gl[1],Gl[2];var Kl=()=>typeof navigator>`u`,ql=null,Jl=null,Yl=null,Xl=null,Zl=null;async function Ql(){return ql??=typeof BigInt64Array<`u`,Jl??=await Vl(),Yl??=await Ul(),Xl??=await Hl(),Zl??=await Bl(),{bigInt64Array:ql,crossOriginIsolated:Kl()||globalThis.crossOriginIsolated||!1,wasmExceptions:Jl,wasmSIMD:Xl,wasmThreads:Yl,wasmBulkMemory:Zl}}async function $l(e){let t=await Ql();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}}vl(yl());var eu={},tu={};function nu(e,t){try{let n=(eu[e]||=new Intl.DateTimeFormat(`en-US`,{timeZone:e,timeZoneName:`longOffset`}).format)(t).split(`GMT`)[1];return n in tu?tu[n]:iu(n,n.split(`:`))}catch{if(e in tu)return tu[e];let t=e?.match(ru);return t?iu(e,t.slice(1)):NaN}}var ru=/([+-]\d\d):?(\d\d)?/;function iu(e,t){let n=+(t[0]||0),r=+(t[1]||0),i=(t[2]||0)/60;return tu[e]=n*60+r>0?n*60+r+i:n*60-r-i}var au=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(nu(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)),lu(this,NaN),su(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(){let e=-nu(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),su(this),+this}[Symbol.for(`constructDateFrom`)](t){return new e(+new Date(t),this.timeZone)}},ou=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!ou.test(e))return;let t=e.replace(ou,`$1UTC`);au.prototype[t]&&(e.startsWith(`get`)?au.prototype[e]=function(){return this.internal[t]()}:(au.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),cu(this),+this},au.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),su(this),+this}))});function su(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-nu(e.timeZone,e)*60))}function cu(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()),lu(e)}function lu(e){let t=nu(e.timeZone,e),n=t>0?Math.floor(t):Math.ceil(t),r=new Date(+e);r.setUTCHours(r.getUTCHours()-1);let i=-new Date(+e).getTimezoneOffset(),a=i- -new Date(+r).getTimezoneOffset(),o=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();a&&o&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+a);let s=i-n;s&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+s);let c=new Date(+e);c.setUTCSeconds(0);let l=i>0?c.getSeconds():(c.getSeconds()-60)%60,u=Math.round(-(nu(e.timeZone,e)*60))%60;(u||l)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+u),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+u+l));let d=nu(e.timeZone,e),ee=d>0?Math.floor(d):Math.ceil(d),te=-new Date(+e).getTimezoneOffset()-ee,ne=ee!==n,re=te-s;if(ne&&re){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+re);let t=nu(e.timeZone,e),n=ee-(t>0?Math.floor(t):Math.ceil(t));n&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+n),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+n))}}var uu=new TextDecoder(`utf-8`);const du=uu.decode.bind(uu);var fu=new TextEncoder;const pu=e=>fu.encode(e);var mu=e=>typeof e==`function`;const hu=e=>e!=null&&Object(e)===e,gu=e=>hu(e)&&mu(e.then),_u=e=>hu(e)&&mu(e[Symbol.iterator]),vu=e=>hu(e)&&mu(e[Symbol.asyncIterator]),yu=e=>hu(e)&&`done`in e&&`value`in e,bu=e=>hu(e)&&mu(e.clear)&&mu(e.bytes)&&mu(e.position)&&mu(e.setPosition)&&mu(e.capacity)&&mu(e.getBufferIdentifier)&&mu(e.createLong);var xu=t({compareArrayLike:()=>ad,joinUint8Arrays:()=>Tu,memcpy:()=>wu,rebaseValueOffsets:()=>id,toArrayBufferView:()=>F,toArrayBufferViewAsyncIterator:()=>Ju,toArrayBufferViewIterator:()=>Ru,toBigInt64Array:()=>ku,toBigUint64Array:()=>Nu,toFloat32Array:()=>Pu,toFloat32ArrayAsyncIterator:()=>td,toFloat32ArrayIterator:()=>Gu,toFloat64Array:()=>Fu,toFloat64ArrayAsyncIterator:()=>nd,toFloat64ArrayIterator:()=>Ku,toInt16Array:()=>Du,toInt16ArrayAsyncIterator:()=>Xu,toInt16ArrayIterator:()=>Bu,toInt32Array:()=>Ou,toInt32ArrayAsyncIterator:()=>Zu,toInt32ArrayIterator:()=>Vu,toInt8Array:()=>Eu,toInt8ArrayAsyncIterator:()=>Yu,toInt8ArrayIterator:()=>zu,toUint16Array:()=>ju,toUint16ArrayAsyncIterator:()=>$u,toUint16ArrayIterator:()=>Uu,toUint32Array:()=>Mu,toUint32ArrayAsyncIterator:()=>ed,toUint32ArrayIterator:()=>Wu,toUint8Array:()=>Au,toUint8ArrayAsyncIterator:()=>Qu,toUint8ArrayIterator:()=>Hu,toUint8ClampedArray:()=>Iu,toUint8ClampedArrayAsyncIterator:()=>rd,toUint8ClampedArrayIterator:()=>qu},1),Su=typeof SharedArrayBuffer<`u`?SharedArrayBuffer:ArrayBuffer;function Cu(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;++cF(Int8Array,e),Du=e=>F(Int16Array,e),Ou=e=>F(Int32Array,e),ku=e=>F(BigInt64Array,e),Au=e=>F(Uint8Array,e),ju=e=>F(Uint16Array,e),Mu=e=>F(Uint32Array,e),Nu=e=>F(BigUint64Array,e),Pu=e=>F(Float32Array,e),Fu=e=>F(Float64Array,e),Iu=e=>F(Uint8ClampedArray,e);var Lu=e=>(e.next(),e);function*Ru(e,t){let n=function*(e){yield e};return yield*Lu((function*(t){let n=null;do n=t.next(yield F(e,n));while(!n.done)})((typeof t==`string`||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Su?n(t):_u(t)?t:n(t))[Symbol.iterator]())),new e}const zu=e=>Ru(Int8Array,e),Bu=e=>Ru(Int16Array,e),Vu=e=>Ru(Int32Array,e),Hu=e=>Ru(Uint8Array,e),Uu=e=>Ru(Uint16Array,e),Wu=e=>Ru(Uint32Array,e),Gu=e=>Ru(Float32Array,e),Ku=e=>Ru(Float64Array,e),qu=e=>Ru(Uint8ClampedArray,e);function Ju(e,t){return Fe(this,arguments,function*(){if(gu(t))return yield p(yield p(yield*Ie(Le(Ju(e,yield p(t))))));let n=function(e){return Fe(this,arguments,function*(){yield yield p(yield p(e))})};return yield p(yield*Ie(Le(Lu((function(t){return Fe(this,arguments,function*(){let n=null;do n=yield p(t.next(yield yield p(F(e,n))));while(!n.done)})})((typeof t==`string`||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Su?n(t):_u(t)?function(e){return Fe(this,arguments,function*(){yield p(yield*Ie(Le(Lu((function*(e){let t=null;do t=e.next(yield t?.value);while(!t.done)})(e[Symbol.iterator]())))))})}(t):vu(t)?t:n(t))[Symbol.asyncIterator]()))))),yield p(new e)})}const Yu=e=>Ju(Int8Array,e),Xu=e=>Ju(Int16Array,e),Zu=e=>Ju(Int32Array,e),Qu=e=>Ju(Uint8Array,e),$u=e=>Ju(Uint16Array,e),ed=e=>Ju(Uint32Array,e),td=e=>Ju(Float32Array,e),nd=e=>Ju(Float64Array,e),rd=e=>Ju(Uint8ClampedArray,e);function id(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(++npd},1),fd=void 0;function pd(e){if(e===null)return`null`;if(e===fd)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=>pd(e))}]`:`[${e}]`:ArrayBuffer.isView(e)?`[${e}]`:JSON.stringify(e,(e,t)=>typeof t==`bigint`?`${t}`:t)}function md(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 hd(e,t){return md(e/t)+md(e%t)/md(t)}var gd=t({BN:()=>Dd,bigNumToBigInt:()=>Td,bigNumToNumber:()=>Cd,bigNumToString:()=>wd,isArrowBigNumSymbol:()=>_d},1);const _d=Symbol.for(`isArrowBigNum`);function vd(e,...t){return t.length===0?Object.setPrototypeOf(F(this.TypedArray,e),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(e,...t),this.constructor.prototype)}vd.prototype[_d]=!0,vd.prototype.toJSON=function(){return`"${wd(this)}"`},vd.prototype.valueOf=function(e){return Cd(this,e)},vd.prototype.toString=function(){return wd(this)},vd.prototype[Symbol.toPrimitive]=function(e=`default`){switch(e){case`number`:return Cd(this);case`string`:return wd(this);case`default`:return Td(this)}return wd(this)};function yd(...e){return vd.apply(this,e)}function bd(...e){return vd.apply(this,e)}function xd(...e){return vd.apply(this,e)}Object.setPrototypeOf(yd.prototype,Object.create(Int32Array.prototype)),Object.setPrototypeOf(bd.prototype,Object.create(Uint32Array.prototype)),Object.setPrototypeOf(xd.prototype,Object.create(Uint32Array.prototype)),Object.assign(yd.prototype,vd.prototype,{constructor:yd,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array}),Object.assign(bd.prototype,vd.prototype,{constructor:bd,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array}),Object.assign(xd.prototype,vd.prototype,{constructor:xd,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});var Sd=BigInt(4294967296)*BigInt(4294967296)-BigInt(1);function Cd(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=md(n),a=`${r}`.padStart(t,`0`);return+`${s&&i===0?`-`:``}${i}.${a}`}return md(c)}function wd(e){if(e.byteLength===8)return`${new e.BigIntArray(e.buffer,e.byteOffset,1)[0]}`;if(!e.signed)return Ed(e);let t=new Uint16Array(e.buffer,e.byteOffset,e.byteLength/2);if(new Int16Array([t.at(-1)])[0]>=0)return Ed(e);t=t.slice();let n=1;for(let e=0;e(e.children=null,e.ArrayType=Array,e.OffsetArrayType=Int32Array,e[Symbol.toStringTag]=`DataType`))(R.prototype);var Xd=class extends R{constructor(){super(L.Null)}toString(){return`Null`}};kd=Symbol.toStringTag,Xd[kd]=(e=>e[Symbol.toStringTag]=`Null`)(Xd.prototype);var Zd=class extends R{constructor(e,t){super(L.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}`}};Ad=Symbol.toStringTag,Zd[Ad]=(e=>(e.isSigned=null,e.bitWidth=null,e[Symbol.toStringTag]=`Int`))(Zd.prototype);var Qd=class extends Zd{constructor(){super(!0,8)}get ArrayType(){return Int8Array}},$d=class extends Zd{constructor(){super(!0,16)}get ArrayType(){return Int16Array}},ef=class extends Zd{constructor(){super(!0,32)}get ArrayType(){return Int32Array}},tf=class extends Zd{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}},nf=class extends Zd{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}},rf=class extends Zd{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}},af=class extends Zd{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}},of=class extends Zd{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}};Object.defineProperty(Qd.prototype,`ArrayType`,{value:Int8Array}),Object.defineProperty($d.prototype,`ArrayType`,{value:Int16Array}),Object.defineProperty(ef.prototype,`ArrayType`,{value:Int32Array}),Object.defineProperty(tf.prototype,`ArrayType`,{value:BigInt64Array}),Object.defineProperty(nf.prototype,`ArrayType`,{value:Uint8Array}),Object.defineProperty(rf.prototype,`ArrayType`,{value:Uint16Array}),Object.defineProperty(af.prototype,`ArrayType`,{value:Uint32Array}),Object.defineProperty(of.prototype,`ArrayType`,{value:BigUint64Array});var sf=class extends R{constructor(e){super(L.Float),this.precision=e}get ArrayType(){switch(this.precision){case sd.HALF:return Uint16Array;case sd.SINGLE:return Float32Array;case sd.DOUBLE:return Float64Array}throw Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};jd=Symbol.toStringTag,sf[jd]=(e=>(e.precision=null,e[Symbol.toStringTag]=`Float`))(sf.prototype);var cf=class extends sf{constructor(){super(sd.HALF)}},lf=class extends sf{constructor(){super(sd.SINGLE)}},uf=class extends sf{constructor(){super(sd.DOUBLE)}};Object.defineProperty(cf.prototype,`ArrayType`,{value:Uint16Array}),Object.defineProperty(lf.prototype,`ArrayType`,{value:Float32Array}),Object.defineProperty(uf.prototype,`ArrayType`,{value:Float64Array});var df=class extends R{constructor(){super(L.Binary)}toString(){return`Binary`}};Md=Symbol.toStringTag,df[Md]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`Binary`))(df.prototype);var ff=class extends R{constructor(){super(L.LargeBinary)}toString(){return`LargeBinary`}};Nd=Symbol.toStringTag,ff[Nd]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]=`LargeBinary`))(ff.prototype);var pf=class extends R{constructor(){super(L.Utf8)}toString(){return`Utf8`}};Pd=Symbol.toStringTag,pf[Pd]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`Utf8`))(pf.prototype);var mf=class extends R{constructor(){super(L.LargeUtf8)}toString(){return`LargeUtf8`}};Fd=Symbol.toStringTag,mf[Fd]=(e=>(e.ArrayType=Uint8Array,e.OffsetArrayType=BigInt64Array,e[Symbol.toStringTag]=`LargeUtf8`))(mf.prototype);var hf=class extends R{constructor(){super(L.Bool)}toString(){return`Bool`}};Id=Symbol.toStringTag,hf[Id]=(e=>(e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`Bool`))(hf.prototype);var gf=class extends R{constructor(e,t,n=128){super(L.Decimal),this.scale=e,this.precision=t,this.bitWidth=n}toString(){return`Decimal[${this.precision}e${this.scale>0?`+`:``}${this.scale}]`}};Ld=Symbol.toStringTag,gf[Ld]=(e=>(e.scale=null,e.precision=null,e.ArrayType=Uint32Array,e[Symbol.toStringTag]=`Decimal`))(gf.prototype);var _f=class extends R{constructor(e){super(L.Date),this.unit=e}toString(){return`Date${(this.unit+1)*32}<${cd[this.unit]}>`}get ArrayType(){return this.unit===cd.DAY?Int32Array:BigInt64Array}};Rd=Symbol.toStringTag,_f[Rd]=(e=>(e.unit=null,e[Symbol.toStringTag]=`Date`))(_f.prototype);var vf=class extends R{constructor(e,t){super(L.Time),this.unit=e,this.bitWidth=t}toString(){return`Time${this.bitWidth}<${I[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}};zd=Symbol.toStringTag,vf[zd]=(e=>(e.unit=null,e.bitWidth=null,e[Symbol.toStringTag]=`Time`))(vf.prototype);var yf=class extends R{constructor(e,t){super(L.Timestamp),this.unit=e,this.timezone=t}toString(){return`Timestamp<${I[this.unit]}${this.timezone?`, ${this.timezone}`:``}>`}};Bd=Symbol.toStringTag,yf[Bd]=(e=>(e.unit=null,e.timezone=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]=`Timestamp`))(yf.prototype);var bf=class extends R{constructor(e){super(L.Interval),this.unit=e}toString(){return`Interval<${ld[this.unit]}>`}};Vd=Symbol.toStringTag,bf[Vd]=(e=>(e.unit=null,e.ArrayType=Int32Array,e[Symbol.toStringTag]=`Interval`))(bf.prototype);var xf=class extends R{constructor(e){super(L.Duration),this.unit=e}toString(){return`Duration<${I[this.unit]}>`}};Hd=Symbol.toStringTag,xf[Hd]=(e=>(e.unit=null,e.ArrayType=BigInt64Array,e[Symbol.toStringTag]=`Duration`))(xf.prototype);var Sf=class extends R{constructor(e){super(L.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}};Ud=Symbol.toStringTag,Sf[Ud]=(e=>(e.children=null,e[Symbol.toStringTag]=`List`))(Sf.prototype);var Cf=class extends R{constructor(e){super(L.Struct),this.children=e}toString(){return`Struct<{${this.children.map(e=>`${e.name}:${e.type}`).join(`, `)}}>`}};Wd=Symbol.toStringTag,Cf[Wd]=(e=>(e.children=null,e[Symbol.toStringTag]=`Struct`))(Cf.prototype);var wf=class extends R{constructor(e,t,n){super(L.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(` | `)}>`}};Gd=Symbol.toStringTag,wf[Gd]=(e=>(e.mode=null,e.typeIds=null,e.children=null,e.typeIdToChildIndex=null,e.ArrayType=Int8Array,e[Symbol.toStringTag]=`Union`))(wf.prototype);var Tf=class extends R{constructor(e){super(L.FixedSizeBinary),this.byteWidth=e}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};Kd=Symbol.toStringTag,Tf[Kd]=(e=>(e.byteWidth=null,e.ArrayType=Uint8Array,e[Symbol.toStringTag]=`FixedSizeBinary`))(Tf.prototype);var Ef=class extends R{constructor(e,t){super(L.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}>`}};qd=Symbol.toStringTag,Ef[qd]=(e=>(e.children=null,e.listSize=null,e[Symbol.toStringTag]=`FixedSizeList`))(Ef.prototype);var Df=class extends R{constructor(e,t=!1){if(super(L.Map),this.children=[e],this.keysSorted=t,e&&(e.name=`entries`,e?.type?.children)){let t=(e?.type)?.children[0];t&&(t.name=`key`);let n=(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(`, `)}}>`}};Jd=Symbol.toStringTag,Df[Jd]=(e=>(e.children=null,e.keysSorted=null,e[Symbol.toStringTag]=`Map_`))(Df.prototype);var Of=(e=>()=>++e)(-1),kf=class extends R{constructor(e,t,n,r){super(L.Dictionary),this.indices=t,this.dictionary=e,this.isOrdered=r||!1,this.id=n==null?Of():md(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}>`}};Yd=Symbol.toStringTag,kf[Yd]=(e=>(e.id=null,e.indices=null,e.isOrdered=null,e.dictionary=null,e[Symbol.toStringTag]=`Dictionary`))(kf.prototype);function Af(e){let t=e;switch(e.typeId){case L.Decimal:return e.bitWidth/32;case L.Interval:return t.unit===ld.MONTH_DAY_NANO?4:1+t.unit;case L.FixedSizeList:return t.listSize;case L.FixedSizeBinary:return t.byteWidth;default:return 1}}var z=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 jf(this,e,t)}getVisitFnByTypeId(e,t=!0){return Mf(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 jf(e,t,n=!0){return typeof t==`number`?Mf(e,t,n):typeof t==`string`&&t in L?Mf(e,L[t],n):t&&t instanceof R?Mf(e,Nf(t),n):t?.type&&t.type instanceof R?Mf(e,Nf(t.type),n):Mf(e,L.NONE,n)}function Mf(e,t,n=!0){let r=null;switch(t){case L.Null:r=e.visitNull;break;case L.Bool:r=e.visitBool;break;case L.Int:r=e.visitInt;break;case L.Int8:r=e.visitInt8||e.visitInt;break;case L.Int16:r=e.visitInt16||e.visitInt;break;case L.Int32:r=e.visitInt32||e.visitInt;break;case L.Int64:r=e.visitInt64||e.visitInt;break;case L.Uint8:r=e.visitUint8||e.visitInt;break;case L.Uint16:r=e.visitUint16||e.visitInt;break;case L.Uint32:r=e.visitUint32||e.visitInt;break;case L.Uint64:r=e.visitUint64||e.visitInt;break;case L.Float:r=e.visitFloat;break;case L.Float16:r=e.visitFloat16||e.visitFloat;break;case L.Float32:r=e.visitFloat32||e.visitFloat;break;case L.Float64:r=e.visitFloat64||e.visitFloat;break;case L.Utf8:r=e.visitUtf8;break;case L.LargeUtf8:r=e.visitLargeUtf8;break;case L.Binary:r=e.visitBinary;break;case L.LargeBinary:r=e.visitLargeBinary;break;case L.FixedSizeBinary:r=e.visitFixedSizeBinary;break;case L.Date:r=e.visitDate;break;case L.DateDay:r=e.visitDateDay||e.visitDate;break;case L.DateMillisecond:r=e.visitDateMillisecond||e.visitDate;break;case L.Timestamp:r=e.visitTimestamp;break;case L.TimestampSecond:r=e.visitTimestampSecond||e.visitTimestamp;break;case L.TimestampMillisecond:r=e.visitTimestampMillisecond||e.visitTimestamp;break;case L.TimestampMicrosecond:r=e.visitTimestampMicrosecond||e.visitTimestamp;break;case L.TimestampNanosecond:r=e.visitTimestampNanosecond||e.visitTimestamp;break;case L.Time:r=e.visitTime;break;case L.TimeSecond:r=e.visitTimeSecond||e.visitTime;break;case L.TimeMillisecond:r=e.visitTimeMillisecond||e.visitTime;break;case L.TimeMicrosecond:r=e.visitTimeMicrosecond||e.visitTime;break;case L.TimeNanosecond:r=e.visitTimeNanosecond||e.visitTime;break;case L.Decimal:r=e.visitDecimal;break;case L.List:r=e.visitList;break;case L.Struct:r=e.visitStruct;break;case L.Union:r=e.visitUnion;break;case L.DenseUnion:r=e.visitDenseUnion||e.visitUnion;break;case L.SparseUnion:r=e.visitSparseUnion||e.visitUnion;break;case L.Dictionary:r=e.visitDictionary;break;case L.Interval:r=e.visitInterval;break;case L.IntervalDayTime:r=e.visitIntervalDayTime||e.visitInterval;break;case L.IntervalYearMonth:r=e.visitIntervalYearMonth||e.visitInterval;break;case L.IntervalMonthDayNano:r=e.visitIntervalMonthDayNano||e.visitInterval;break;case L.Duration:r=e.visitDuration;break;case L.DurationSecond:r=e.visitDurationSecond||e.visitDuration;break;case L.DurationMillisecond:r=e.visitDurationMillisecond||e.visitDuration;break;case L.DurationMicrosecond:r=e.visitDurationMicrosecond||e.visitDuration;break;case L.DurationNanosecond:r=e.visitDurationNanosecond||e.visitDuration;break;case L.FixedSizeList:r=e.visitFixedSizeList;break;case L.Map:r=e.visitMap;break}if(typeof r==`function`)return r;if(!n)return()=>null;throw Error(`Unrecognized type '${L[t]}'`)}function Nf(e){switch(e.typeId){case L.Null:return L.Null;case L.Int:{let{bitWidth:t,isSigned:n}=e;switch(t){case 8:return n?L.Int8:L.Uint8;case 16:return n?L.Int16:L.Uint16;case 32:return n?L.Int32:L.Uint32;case 64:return n?L.Int64:L.Uint64}return L.Int}case L.Float:switch(e.precision){case sd.HALF:return L.Float16;case sd.SINGLE:return L.Float32;case sd.DOUBLE:return L.Float64}return L.Float;case L.Binary:return L.Binary;case L.LargeBinary:return L.LargeBinary;case L.Utf8:return L.Utf8;case L.LargeUtf8:return L.LargeUtf8;case L.Bool:return L.Bool;case L.Decimal:return L.Decimal;case L.Time:switch(e.unit){case I.SECOND:return L.TimeSecond;case I.MILLISECOND:return L.TimeMillisecond;case I.MICROSECOND:return L.TimeMicrosecond;case I.NANOSECOND:return L.TimeNanosecond}return L.Time;case L.Timestamp:switch(e.unit){case I.SECOND:return L.TimestampSecond;case I.MILLISECOND:return L.TimestampMillisecond;case I.MICROSECOND:return L.TimestampMicrosecond;case I.NANOSECOND:return L.TimestampNanosecond}return L.Timestamp;case L.Date:switch(e.unit){case cd.DAY:return L.DateDay;case cd.MILLISECOND:return L.DateMillisecond}return L.Date;case L.Interval:switch(e.unit){case ld.DAY_TIME:return L.IntervalDayTime;case ld.YEAR_MONTH:return L.IntervalYearMonth;case ld.MONTH_DAY_NANO:return L.IntervalMonthDayNano}return L.Interval;case L.Duration:switch(e.unit){case I.SECOND:return L.DurationSecond;case I.MILLISECOND:return L.DurationMillisecond;case I.MICROSECOND:return L.DurationMicrosecond;case I.NANOSECOND:return L.DurationNanosecond}return L.Duration;case L.Map:return L.Map;case L.List:return L.List;case L.Struct:return L.Struct;case L.Union:switch(e.mode){case od.Dense:return L.DenseUnion;case od.Sparse:return L.SparseUnion}return L.Union;case L.FixedSizeBinary:return L.FixedSizeBinary;case L.FixedSizeList:return L.FixedSizeList;case L.Dictionary:return L.Dictionary}throw Error(`Unrecognized type '${L[e.typeId]}'`)}z.prototype.visitInt8=null,z.prototype.visitInt16=null,z.prototype.visitInt32=null,z.prototype.visitInt64=null,z.prototype.visitUint8=null,z.prototype.visitUint16=null,z.prototype.visitUint32=null,z.prototype.visitUint64=null,z.prototype.visitFloat16=null,z.prototype.visitFloat32=null,z.prototype.visitFloat64=null,z.prototype.visitDateDay=null,z.prototype.visitDateMillisecond=null,z.prototype.visitTimestampSecond=null,z.prototype.visitTimestampMillisecond=null,z.prototype.visitTimestampMicrosecond=null,z.prototype.visitTimestampNanosecond=null,z.prototype.visitTimeSecond=null,z.prototype.visitTimeMillisecond=null,z.prototype.visitTimeMicrosecond=null,z.prototype.visitTimeNanosecond=null,z.prototype.visitDenseUnion=null,z.prototype.visitSparseUnion=null,z.prototype.visitIntervalDayTime=null,z.prototype.visitIntervalYearMonth=null,z.prototype.visitIntervalMonthDayNano=null,z.prototype.visitDuration=null,z.prototype.visitDurationSecond=null,z.prototype.visitDurationMillisecond=null,z.prototype.visitDurationMicrosecond=null,z.prototype.visitDurationNanosecond=null;var Pf=t({float64ToUint16:()=>Rf,uint16ToFloat64:()=>Lf},1),Ff=new Float64Array(1),If=new Uint32Array(Ff.buffer);function Lf(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 Rf(e){if(e!==e)return 32256;Ff[0]=e;let t=(If[1]&2147483648)>>16&65535,n=If[1]&2146435072,r=0;return n>=1089470464?If[0]>0?n=31744:(n=(n&2080374784)>>16,r=(If[1]&1048575)>>10):n<=1056964608?(r=1048576+(If[1]&1048575),r=1048576+(r<<(n>>20)-998)>>21,n=0):(n=n-1056964608>>10,r=(If[1]&1048575)+512>>10),t|n|r&65535}var B=class extends z{};function V(e){return(t,n,r)=>{if(t.setValid(n,r!=null))return e(t,n,r)}}const zf=(e,t,n)=>{e[t]=Math.floor(n/864e5)},Bf=(e,t,n,r)=>{if(n+1{let i=e+n;r?t[i>>3]|=1<>3]&=~(1<{e[t]=n},Uf=({values:e},t,n)=>{e[t]=n},Wf=({values:e},t,n)=>{e[t]=Rf(n)},Gf=(e,t,n)=>{switch(e.type.precision){case sd.HALF:return Wf(e,t,n);case sd.SINGLE:case sd.DOUBLE:return Uf(e,t,n)}},Kf=({values:e},t,n)=>{zf(e,t,n.valueOf())},qf=({values:e},t,n)=>{e[t]=BigInt(n)},Jf=({stride:e,values:t},n,r)=>{t.set(r.subarray(0,e),e*n)};var Yf=({values:e,valueOffsets:t},n,r)=>Bf(e,t,n,r),Xf=({values:e,valueOffsets:t},n,r)=>Bf(e,t,n,pu(r));const Zf=(e,t,n)=>{e.type.unit===cd.DAY?Kf(e,t,n):qf(e,t,n)},Qf=({values:e},t,n)=>{e[t]=BigInt(n/1e3)},$f=({values:e},t,n)=>{e[t]=BigInt(n)},ep=({values:e},t,n)=>{e[t]=BigInt(n*1e3)},tp=({values:e},t,n)=>{e[t]=BigInt(n*1e6)},np=(e,t,n)=>{switch(e.type.unit){case I.SECOND:return Qf(e,t,n);case I.MILLISECOND:return $f(e,t,n);case I.MICROSECOND:return ep(e,t,n);case I.NANOSECOND:return tp(e,t,n)}},rp=({values:e},t,n)=>{e[t]=n},ip=({values:e},t,n)=>{e[t]=n},ap=({values:e},t,n)=>{e[t]=n},op=({values:e},t,n)=>{e[t]=n},sp=(e,t,n)=>{switch(e.type.unit){case I.SECOND:return rp(e,t,n);case I.MILLISECOND:return ip(e,t,n);case I.MICROSECOND:return ap(e,t,n);case I.NANOSECOND:return op(e,t,n)}},cp=({values:e,stride:t},n,r)=>{e.set(r.subarray(0,t),t*n)};var lp=(e,t,n)=>{let r=e.children[0],i=e.valueOffsets,a=Ap.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=Ap.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},dp=(e,t)=>(n,r,i,a)=>r&&n(r,e,t[a]),fp=(e,t)=>(n,r,i,a)=>r&&n(r,e,t.get(a)),pp=(e,t)=>(n,r,i,a)=>r&&n(r,e,t.get(i.name)),mp=(e,t)=>(n,r,i,a)=>r&&n(r,e,t[i.name]),hp=(e,t,n)=>{let r=e.type.children.map(e=>Ap.getVisitFn(e.type)),i=n instanceof Map?pp(t,n):n instanceof Ch?fp(t,n):Array.isArray(n)?dp(t,n):mp(t,n);e.type.children.forEach((t,n)=>i(r[n],e.children[n],t,n))},gp=(e,t,n)=>{e.type.mode===od.Dense?_p(e,t,n):vp(e,t,n)},_p=(e,t,n)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[r];Ap.visit(i,e.valueOffsets[t],n)},vp=(e,t,n)=>{let r=e.type.typeIdToChildIndex[e.typeIds[t]],i=e.children[r];Ap.visit(i,t,n)},yp=(e,t,n)=>{var r;(r=e.dictionary)==null||r.set(e.values[t],n)};const bp=(e,t,n)=>{switch(e.type.unit){case ld.YEAR_MONTH:return Sp(e,t,n);case ld.DAY_TIME:return xp(e,t,n);case ld.MONTH_DAY_NANO:return Cp(e,t,n)}},xp=({values:e},t,n)=>{e.set(n.subarray(0,2),2*t)},Sp=({values:e},t,n)=>{e[t]=n[0]*12+n[1]%12},Cp=({values:e,stride:t},n,r)=>{e.set(r.subarray(0,t),t*n)},wp=({values:e},t,n)=>{e[t]=n},Tp=({values:e},t,n)=>{e[t]=n},Ep=({values:e},t,n)=>{e[t]=n},Dp=({values:e},t,n)=>{e[t]=n},Op=(e,t,n)=>{switch(e.type.unit){case I.SECOND:return wp(e,t,n);case I.MILLISECOND:return Tp(e,t,n);case I.MICROSECOND:return Ep(e,t,n);case I.NANOSECOND:return Dp(e,t,n)}};var kp=(e,t,n)=>{let{stride:r}=e,i=e.children[0],a=Ap.getVisitFn(i);if(Array.isArray(n))for(let e=-1,o=t*r;++e`${pd(e)}: ${pd(t)}`).join(`, `)}}`}[Symbol.for(`nodejs.util.inspect.custom`)](){return this.toString()}[Symbol.iterator](){return new Pp(this[jp],this[Mp])}},Pp=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[jp].type.children.some(e=>e.name===t)}getOwnPropertyDescriptor(e,t){if(e[jp].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[jp].type.children.findIndex(e=>e.name===t);if(n!==-1){let r=Tm.visit(e[jp].children[n],e[Mp]);return Reflect.set(e,t,r),r}}set(e,t,n){let r=e[jp].type.children.findIndex(e=>e.name===t);return r===-1?Reflect.has(e,t)||typeof t==`symbol`?Reflect.set(e,t,n):!1:(Ap.visit(e[jp].children[r],e[Mp],n),Reflect.set(e,t,n))}},H=class extends z{};function U(e){return(t,n)=>t.getValid(n)?e(t,n):null}var Ip=(e,t)=>864e5*e[t],Lp=(e,t)=>null,Rp=(e,t,n)=>{if(n+1>=t.length)return null;let r=md(t[n]),i=md(t[n+1]);return e.subarray(r,i)},zp=({offset:e,values:t},n)=>{let r=e+n;return(t[r>>3]&1<Ip(e,t),Vp=({values:e},t)=>md(e[t]),Hp=({stride:e,values:t},n)=>t[e*n],Up=({stride:e,values:t},n)=>Lf(t[e*n]),Wp=({values:e},t)=>e[t],Gp=({stride:e,values:t},n)=>t.subarray(e*n,e*(n+1)),Kp=({values:e,valueOffsets:t},n)=>Rp(e,t,n),qp=({values:e,valueOffsets:t},n)=>{let r=Rp(e,t,n);return r===null?null:du(r)},Jp=({values:e},t)=>e[t],Yp=({type:e,values:t},n)=>e.precision===sd.HALF?Lf(t[n]):t[n],Xp=(e,t)=>e.type.unit===cd.DAY?Bp(e,t):Vp(e,t),Zp=({values:e},t)=>1e3*md(e[t]),Qp=({values:e},t)=>md(e[t]),$p=({values:e},t)=>hd(e[t],BigInt(1e3)),em=({values:e},t)=>hd(e[t],BigInt(1e6)),tm=(e,t)=>{switch(e.type.unit){case I.SECOND:return Zp(e,t);case I.MILLISECOND:return Qp(e,t);case I.MICROSECOND:return $p(e,t);case I.NANOSECOND:return em(e,t)}},nm=({values:e},t)=>e[t],rm=({values:e},t)=>e[t],im=({values:e},t)=>e[t],am=({values:e},t)=>e[t],om=(e,t)=>{switch(e.type.unit){case I.SECOND:return nm(e,t);case I.MILLISECOND:return rm(e,t);case I.MICROSECOND:return im(e,t);case I.NANOSECOND:return am(e,t)}},sm=({values:e,stride:t},n)=>Dd.decimal(e.subarray(t*n,t*(n+1))),cm=(e,t)=>{let{valueOffsets:n,stride:r,children:i}=e,{[t*r]:a,[t*r+1]:o}=n;return new Ch([i[0].slice(a,o-a)])},lm=(e,t)=>{let{valueOffsets:n,children:r}=e,{[t]:i,[t+1]:a}=n,o=r[0];return new Am(o.slice(i,a-i))},um=(e,t)=>new Np(e,t),dm=(e,t)=>e.type.mode===od.Dense?fm(e,t):pm(e,t),fm=(e,t)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],r=e.children[n];return Tm.visit(r,e.valueOffsets[t])},pm=(e,t)=>{let n=e.type.typeIdToChildIndex[e.typeIds[t]],r=e.children[n];return Tm.visit(r,t)},mm=(e,t)=>e.dictionary?.get(e.values[t]),hm=(e,t)=>e.type.unit===ld.MONTH_DAY_NANO?vm(e,t):e.type.unit===ld.DAY_TIME?gm(e,t):_m(e,t),gm=({values:e},t)=>e.subarray(2*t,2*(t+1)),_m=({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},vm=({values:e},t)=>e.subarray(4*t,4*(t+1)),ym=({values:e},t)=>e[t],bm=({values:e},t)=>e[t],xm=({values:e},t)=>e[t],Sm=({values:e},t)=>e[t],Cm=(e,t)=>{switch(e.type.unit){case I.SECOND:return ym(e,t);case I.MILLISECOND:return bm(e,t);case I.MICROSECOND:return xm(e,t);case I.NANOSECOND:return Sm(e,t)}},wm=(e,t)=>{let{stride:n,children:r}=e;return new Ch([r[0].slice(t*n,n)])};H.prototype.visitNull=U(Lp),H.prototype.visitBool=U(zp),H.prototype.visitInt=U(Jp),H.prototype.visitInt8=U(Hp),H.prototype.visitInt16=U(Hp),H.prototype.visitInt32=U(Hp),H.prototype.visitInt64=U(Wp),H.prototype.visitUint8=U(Hp),H.prototype.visitUint16=U(Hp),H.prototype.visitUint32=U(Hp),H.prototype.visitUint64=U(Wp),H.prototype.visitFloat=U(Yp),H.prototype.visitFloat16=U(Up),H.prototype.visitFloat32=U(Hp),H.prototype.visitFloat64=U(Hp),H.prototype.visitUtf8=U(qp),H.prototype.visitLargeUtf8=U(qp),H.prototype.visitBinary=U(Kp),H.prototype.visitLargeBinary=U(Kp),H.prototype.visitFixedSizeBinary=U(Gp),H.prototype.visitDate=U(Xp),H.prototype.visitDateDay=U(Bp),H.prototype.visitDateMillisecond=U(Vp),H.prototype.visitTimestamp=U(tm),H.prototype.visitTimestampSecond=U(Zp),H.prototype.visitTimestampMillisecond=U(Qp),H.prototype.visitTimestampMicrosecond=U($p),H.prototype.visitTimestampNanosecond=U(em),H.prototype.visitTime=U(om),H.prototype.visitTimeSecond=U(nm),H.prototype.visitTimeMillisecond=U(rm),H.prototype.visitTimeMicrosecond=U(im),H.prototype.visitTimeNanosecond=U(am),H.prototype.visitDecimal=U(sm),H.prototype.visitList=U(cm),H.prototype.visitStruct=U(um),H.prototype.visitUnion=U(dm),H.prototype.visitDenseUnion=U(fm),H.prototype.visitSparseUnion=U(pm),H.prototype.visitDictionary=U(mm),H.prototype.visitInterval=U(hm),H.prototype.visitIntervalDayTime=U(gm),H.prototype.visitIntervalYearMonth=U(_m),H.prototype.visitIntervalMonthDayNano=U(vm),H.prototype.visitDuration=U(Cm),H.prototype.visitDurationSecond=U(ym),H.prototype.visitDurationMillisecond=U(bm),H.prototype.visitDurationMicrosecond=U(xm),H.prototype.visitDurationNanosecond=U(Sm),H.prototype.visitFixedSizeList=U(wm),H.prototype.visitMap=U(lm);const Tm=new H,Em=Symbol.for(`keys`),Dm=Symbol.for(`vals`),Om=Symbol.for(`kKeysAsStrings`),km=Symbol.for(`_kKeysAsStrings`);var Am=class{constructor(e){return this[Em]=new Ch([e.children[0]]).memoize(),this[Dm]=e.children[1],new Proxy(this,new Mm)}get[Om](){return this[km]||(this[km]=Array.from(this[Em].toArray(),String))}[Symbol.iterator](){return new jm(this[Em],this[Dm])}get size(){return this[Em].length}toArray(){return Object.values(this.toJSON())}toJSON(){let e=this[Em],t=this[Dm],n={};for(let r=-1,i=e.length;++r`${pd(e)}: ${pd(t)}`).join(`, `)}}`}[Symbol.for(`nodejs.util.inspect.custom`)](){return this.toString()}},jm=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),Tm.visit(this.vals,e)]})}},Mm=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(e){return e[Om]}has(e,t){return e[Om].includes(t)}getOwnPropertyDescriptor(e,t){if(e[Om].indexOf(t)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(e,t){if(Reflect.has(e,t))return e[t];let n=e[Om].indexOf(t);if(n!==-1){let r=Tm.visit(Reflect.get(e,Dm),n);return Reflect.set(e,t,r),r}}set(e,t,n){let r=e[Om].indexOf(t);return r===-1?Reflect.has(e,t)?Reflect.set(e,t,n):!1:(Ap.visit(Reflect.get(e,Dm),r,n),Reflect.set(e,t,n))}};Object.defineProperties(Am.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:`Row`},[Em]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Dm]:{writable:!0,enumerable:!1,configurable:!1,value:null},[km]:{writable:!0,enumerable:!1,configurable:!1,value:null}});var Nm=t({clampRange:()=>Fm,createElementComparator:()=>Rm,wrapIndex:()=>Im},1),Pm;function Fm(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 Im=(e,t)=>e<0?t+e:e;var Lm=e=>e!==e;function Rm(e){if(typeof e!=`object`||!e)return Lm(e)?Lm: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?ad(e,t):!1:e instanceof Map?Bm(e):Array.isArray(e)?zm(e):e instanceof Ch?Vm(e):Hm(e,!0)}function zm(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 Wm(e,n);case Map:return Km(e,n,n.keys());case Am:case Np:case Object:case void 0:return Km(e,n,t||Object.keys(n))}return n instanceof Ch?Gm(e,n):!1}}function Wm(e,t){let n=e.length;if(t.length!==n)return!1;for(let r=-1;++r$m,getBit:()=>Ym,getBool:()=>Jm,packBools:()=>Qm,popcnt_array:()=>th,popcnt_bit_range:()=>eh,popcnt_uint32:()=>nh,setBool:()=>Xm,truncateBitmap:()=>Zm},1);function Jm(e,t,n,r){return(n&1<>r}function Xm(e,t,n){return n?!!(e[t>>3]|=1<>3]&=~(1<0||n.byteLength>3):Qm(new $m(n,e,t,null,Jm)).subarray(0,r)),i}return n}function Qm(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 $m=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 eh(e,t,i)+eh(e,r,n)+th(e,i>>3,r-i>>3)}function th(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+=nh(a.getUint32(i)),i+=4;for(;o-i>=2;)r+=nh(a.getUint16(i)),i+=2;for(;o-i>=1;)r+=nh(a.getUint8(i)),i+=1;return r}function nh(e){let t=Math.trunc(e);return t-=t>>>1&1431655765,t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}var rh=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 R.isSparseUnion(e)||R.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(R.isUnion(this.type))return this.children.reduce((e,t)=>e+t.nullCount,0);let e=this._nullCount,t;return e<=-1&&(t=this.nullBitmap)&&(this._nullCount=e=t.length===0?0:this.length-eh(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=Af(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(R.isUnion(t)){let n=t,r=this.children[n.typeIdToChildIndex[this.typeIds[e]]],i=n.mode===od.Dense?this.valueOffsets[e]:e;return r.getValid(i)}if(this.nullable&&this.nullCount>0){let t=this.offset+e;return(this.nullBitmap[t>>3]&1<>3;(!r||r.byteLength<=c)&&(r=new Uint8Array((i+a+63&-64)>>3).fill(255),this.nullCount>0?(r.set(Zm(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===L.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(Zm(this.offset,t,this.nullBitmap),0);let i=this.buffers;return i[ud.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[ud.TYPE])&&(a[ud.TYPE]=i.subarray(e,e+t)),(i=a[ud.OFFSET])&&(a[ud.OFFSET]=i.subarray(e,e+t+1))||(i=a[ud.DATA])&&(a[ud.DATA]=r===6?i:i.subarray(n*e,n*(e+t))),a}_sliceChildren(e,t,n){return e.map(e=>e.slice(t,n))}};rh.prototype.children=Object.freeze([]),new class e extends z{visit(e){return this.getVisitFn(e.type).call(this,e)}visitNull(e){let{type:t,offset:n=0,length:r=0}=e;return new rh(t,n,r,r)}visitBool(e){let{type:t,offset:n=0}=e,r=Au(e.nullBitmap),i=F(t.ArrayType,e.data),{length:a=i.length>>3,nullCount:o=e.nullBitmap?-1:0}=e;return new rh(t,n,a,o,[void 0,i,r])}visitInt(e){let{type:t,offset:n=0}=e,r=Au(e.nullBitmap),i=F(t.ArrayType,e.data),{length:a=i.length,nullCount:o=e.nullBitmap?-1:0}=e;return new rh(t,n,a,o,[void 0,i,r])}visitFloat(e){let{type:t,offset:n=0}=e,r=Au(e.nullBitmap),i=F(t.ArrayType,e.data),{length:a=i.length,nullCount:o=e.nullBitmap?-1:0}=e;return new rh(t,n,a,o,[void 0,i,r])}visitUtf8(e){let{type:t,offset:n=0}=e,r=Au(e.data),i=Au(e.nullBitmap),a=Ou(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new rh(t,n,o,s,[a,r,i])}visitLargeUtf8(e){let{type:t,offset:n=0}=e,r=Au(e.data),i=Au(e.nullBitmap),a=ku(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new rh(t,n,o,s,[a,r,i])}visitBinary(e){let{type:t,offset:n=0}=e,r=Au(e.data),i=Au(e.nullBitmap),a=Ou(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new rh(t,n,o,s,[a,r,i])}visitLargeBinary(e){let{type:t,offset:n=0}=e,r=Au(e.data),i=Au(e.nullBitmap),a=ku(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new rh(t,n,o,s,[a,r,i])}visitFixedSizeBinary(e){let{type:t,offset:n=0}=e,r=Au(e.nullBitmap),i=F(t.ArrayType,e.data),{length:a=i.length/Af(t),nullCount:o=e.nullBitmap?-1:0}=e;return new rh(t,n,a,o,[void 0,i,r])}visitDate(e){let{type:t,offset:n=0}=e,r=Au(e.nullBitmap),i=F(t.ArrayType,e.data),{length:a=i.length/Af(t),nullCount:o=e.nullBitmap?-1:0}=e;return new rh(t,n,a,o,[void 0,i,r])}visitTimestamp(e){let{type:t,offset:n=0}=e,r=Au(e.nullBitmap),i=F(t.ArrayType,e.data),{length:a=i.length/Af(t),nullCount:o=e.nullBitmap?-1:0}=e;return new rh(t,n,a,o,[void 0,i,r])}visitTime(e){let{type:t,offset:n=0}=e,r=Au(e.nullBitmap),i=F(t.ArrayType,e.data),{length:a=i.length/Af(t),nullCount:o=e.nullBitmap?-1:0}=e;return new rh(t,n,a,o,[void 0,i,r])}visitDecimal(e){let{type:t,offset:n=0}=e,r=Au(e.nullBitmap),i=F(t.ArrayType,e.data),{length:a=i.length/Af(t),nullCount:o=e.nullBitmap?-1:0}=e;return new rh(t,n,a,o,[void 0,i,r])}visitList(e){let{type:t,offset:n=0,child:r}=e,i=Au(e.nullBitmap),a=Ou(e.valueOffsets),{length:o=a.length-1,nullCount:s=e.nullBitmap?-1:0}=e;return new rh(t,n,o,s,[a,void 0,i],[r])}visitStruct(e){let{type:t,offset:n=0,children:r=[]}=e,i=Au(e.nullBitmap),{length:a=r.reduce((e,{length:t})=>Math.max(e,t),0),nullCount:o=e.nullBitmap?-1:0}=e;return new rh(t,n,a,o,[void 0,void 0,i],r)}visitUnion(e){let{type:t,offset:n=0,children:r=[]}=e,i=F(t.ArrayType,e.typeIds),{length:a=i.length,nullCount:o=-1}=e;return R.isSparseUnion(t)?new rh(t,n,a,o,[void 0,void 0,void 0,i],r):new rh(t,n,a,o,[Ou(e.valueOffsets),void 0,void 0,i],r)}visitDictionary(t){let{type:n,offset:r=0}=t,i=Au(t.nullBitmap),a=F(n.indices.ArrayType,t.data),{dictionary:o=new Ch([new e().visit({type:n.dictionary})])}=t,{length:s=a.length,nullCount:c=t.nullBitmap?-1:0}=t;return new rh(n,r,s,c,[void 0,a,i],[],o)}visitInterval(e){let{type:t,offset:n=0}=e,r=Au(e.nullBitmap),i=F(t.ArrayType,e.data),{length:a=i.length/Af(t),nullCount:o=e.nullBitmap?-1:0}=e;return new rh(t,n,a,o,[void 0,i,r])}visitDuration(e){let{type:t,offset:n=0}=e,r=Au(e.nullBitmap),i=F(t.ArrayType,e.data),{length:a=i.length,nullCount:o=e.nullBitmap?-1:0}=e;return new rh(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=Au(t.nullBitmap),{length:o=i.length/Af(n),nullCount:s=t.nullBitmap?-1:0}=t;return new rh(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=Au(t.nullBitmap),o=Ou(t.valueOffsets),{length:s=o.length-1,nullCount:c=t.nullBitmap?-1:0}=t;return new rh(n,r,s,c,[o,void 0,a],[i])}};var ih=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 oh(e){return e.reduce((e,t)=>e+t.nullCount,0)}function sh(e){return e.reduce((e,t,n)=>(e[n+1]=e[n]+t.length,e),new Uint32Array(e.length+1))}function ch(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 lh(e,t,n,r){let i=0,a=0,o=t.length-1;do{if(i>=o-1)return n0?0:-1}function hh(e,t){let{nullBitmap:n}=e;if(!n||e.nullCount<=0)return-1;let r=0;for(let i of new $m(n,e.offset+(t||0),e.length,n,Jm)){if(!i)return r;++r}return-1}function G(e,t,n){if(t===void 0)return-1;if(t===null)switch(e.typeId){case L.Union:break;case L.Dictionary:break;default:return hh(e,n)}let r=Tm.getVisitFn(e),i=Rm(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 ih(e.data.length,t=>{let r=e.data[t].length,i=e.slice(n,n+r);return n+=r,new vh(i)})}var vh=class{constructor(e){this.vector=e,this.index=0}next(){return this.indexe.data):t;if(n.length===0||n.some(e=>!(e instanceof rh)))throw TypeError(`Vector constructor expects an Array of Data instances.`);let r=n[0]?.type;switch(n.length){case 0:this._offsets=[0];break;case 1:{let{get:e,set:t,indexOf:i}=xh[r.typeId],a=n[0];this.isValid=e=>uh(a,e),this.get=t=>e(a,t),this.set=(e,n)=>t(a,e,n),this.indexOf=e=>i(a,e),this._offsets=[0,a.length];break}default:Object.setPrototypeOf(this,Sh[r.typeId]),this._offsets=sh(n);break}this.data=n,this.type=r,this.stride=Af(r),this.numChildren=r.children?.length??0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((e,t)=>e+t.byteLength,0)}get nullable(){return ah(this.data)}get nullCount(){return oh(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${L[this.type.typeId]}Vector`}isValid(e){return!1}get(e){return null}at(e){return this.get(Im(e,this.length))}set(e,t){}indexOf(e,t){return-1}includes(e,t){return this.indexOf(e,t)>-1}[Symbol.iterator](){return yh.visit(this)}concat(...t){return new e(this.data.concat(t.flatMap(e=>e.data).flat(1/0)))}slice(t,n){return new e(Fm(this,t,n,({data:e,_offsets:t},n,r)=>ch(e,t,n,r)))}toJSON(){return[...this]}toArray(){let{type:e,data:t,length:n,stride:r,ArrayType:i}=this;switch(e.typeId){case L.Int:case L.Float:case L.Decimal:case L.Time:case L.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){return this.getChildAt(this.type.children?.findIndex(t=>t.name===e))}getChildAt(t){return t>-1&&te[t])):null}get isMemoized(){return R.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(R.isDictionary(this.type)){let t=new wh(this.data[0].dictionary);return new e(this.data.map(e=>{let n=e.clone();return n.dictionary=t,n}))}return new wh(this)}unmemoize(){if(R.isDictionary(this.type)&&this.isMemoized){let t=this.data[0].dictionary.unmemoize();return new e(this.data.map(e=>{let n=e.clone();return n.dictionary=t,n}))}return this}};bh=Symbol.toStringTag,Ch[bh]=(e=>{e.type=R.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(L).map(e=>L[e]).filter(e=>typeof e==`number`&&e!==L.NONE);for(let n of t)xh[n]={get:Tm.getVisitFnByTypeId(n),set:Ap.getVisitFnByTypeId(n),indexOf:_h.getVisitFnByTypeId(n)},Sh[n]=Object.create(e,{isValid:{value:dh(uh)},get:{value:dh(Tm.getVisitFnByTypeId(n))},set:{value:fh(Ap.getVisitFnByTypeId(n))},indexOf:{value:ph(_h.getVisitFnByTypeId(n))}});return`Vector`})(Ch.prototype);var wh=class e extends Ch{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 Ch(this.data)}),Object.defineProperty(this,`memoize`,{value:()=>this})}},Th=t({BaseInt64:()=>Ah,Int128:()=>Nh,Int64:()=>Mh,Uint64:()=>jh},1),Eh=65536;function Dh(e){return e<0&&(e=4294967295+e+1),`0x${e.toString(16)}`}var Oh=8,kh=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8],Ah=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`${Dh(this.buffer[3])} ${Dh(this.buffer[2])} ${Dh(this.buffer[1])} ${Dh(this.buffer[0])}`}static multiply(t,n){return new e(new Uint32Array(t.buffer)).times(n)}static add(t,n){return new e(new Uint32Array(t.buffer)).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;nFh,toIntervalDayTimeObjects:()=>Lh,toIntervalMonthDayNanoInt32Array:()=>Ih,toIntervalMonthDayNanoObjects:()=>Rh},1);function Fh(e){let t=e.length,n=new Int32Array(t*2);for(let r=0,i=0;r>BigInt(32))):i+=2}return n}function Lh(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 J=class extends z{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 zh(e,t){return t instanceof e.constructor}function Bh(e,t){return e===t||zh(e,t)}function Vh(e,t){return e===t||zh(e,t)&&e.bitWidth===t.bitWidth&&e.isSigned===t.isSigned}function Hh(e,t){return e===t||zh(e,t)&&e.precision===t.precision}function Uh(e,t){return e===t||zh(e,t)&&e.byteWidth===t.byteWidth}function Wh(e,t){return e===t||zh(e,t)&&e.unit===t.unit}function Gh(e,t){return e===t||zh(e,t)&&e.unit===t.unit&&e.timezone===t.timezone}function Kh(e,t){return e===t||zh(e,t)&&e.unit===t.unit&&e.bitWidth===t.bitWidth}function qh(e,t){return e===t||zh(e,t)&&e.children.length===t.children.length&&tg.compareManyFields(e.children,t.children)}function Jh(e,t){return e===t||zh(e,t)&&e.children.length===t.children.length&&tg.compareManyFields(e.children,t.children)}function Yh(e,t){return e===t||zh(e,t)&&e.mode===t.mode&&e.typeIds.every((e,n)=>e===t.typeIds[n])&&tg.compareManyFields(e.children,t.children)}function Xh(e,t){return e===t||zh(e,t)&&e.id===t.id&&e.isOrdered===t.isOrdered&&tg.visit(e.indices,t.indices)&&tg.visit(e.dictionary,t.dictionary)}function Zh(e,t){return e===t||zh(e,t)&&e.unit===t.unit}function Qh(e,t){return e===t||zh(e,t)&&e.unit===t.unit}function $h(e,t){return e===t||zh(e,t)&&e.listSize===t.listSize&&e.children.length===t.children.length&&tg.compareManyFields(e.children,t.children)}function eg(e,t){return e===t||zh(e,t)&&e.keysSorted===t.keysSorted&&e.children.length===t.children.length&&tg.compareManyFields(e.children,t.children)}J.prototype.visitNull=Bh,J.prototype.visitBool=Bh,J.prototype.visitInt=Vh,J.prototype.visitInt8=Vh,J.prototype.visitInt16=Vh,J.prototype.visitInt32=Vh,J.prototype.visitInt64=Vh,J.prototype.visitUint8=Vh,J.prototype.visitUint16=Vh,J.prototype.visitUint32=Vh,J.prototype.visitUint64=Vh,J.prototype.visitFloat=Hh,J.prototype.visitFloat16=Hh,J.prototype.visitFloat32=Hh,J.prototype.visitFloat64=Hh,J.prototype.visitUtf8=Bh,J.prototype.visitLargeUtf8=Bh,J.prototype.visitBinary=Bh,J.prototype.visitLargeBinary=Bh,J.prototype.visitFixedSizeBinary=Uh,J.prototype.visitDate=Wh,J.prototype.visitDateDay=Wh,J.prototype.visitDateMillisecond=Wh,J.prototype.visitTimestamp=Gh,J.prototype.visitTimestampSecond=Gh,J.prototype.visitTimestampMillisecond=Gh,J.prototype.visitTimestampMicrosecond=Gh,J.prototype.visitTimestampNanosecond=Gh,J.prototype.visitTime=Kh,J.prototype.visitTimeSecond=Kh,J.prototype.visitTimeMillisecond=Kh,J.prototype.visitTimeMicrosecond=Kh,J.prototype.visitTimeNanosecond=Kh,J.prototype.visitDecimal=Bh,J.prototype.visitList=qh,J.prototype.visitStruct=Jh,J.prototype.visitUnion=Yh,J.prototype.visitDenseUnion=Yh,J.prototype.visitSparseUnion=Yh,J.prototype.visitDictionary=Xh,J.prototype.visitInterval=Zh,J.prototype.visitIntervalDayTime=Zh,J.prototype.visitIntervalYearMonth=Zh,J.prototype.visitIntervalMonthDayNano=Zh,J.prototype.visitDuration=Qh,J.prototype.visitDurationSecond=Qh,J.prototype.visitDurationMillisecond=Qh,J.prototype.visitDurationMicrosecond=Qh,J.prototype.visitDurationNanosecond=Qh,J.prototype.visitFixedSizeList=$h,J.prototype.visitMap=eg;const tg=new J;function ng(e,t){return tg.compareSchemas(e,t)}function rg(e,t){return tg.compareFields(e,t)}function ig(e,t){return tg.visit(e,t)}const ag=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},gd),Th),qm),Pf),xu),Nm),dd),Ph),{compareSchemas:ng,compareFields:rg,compareTypes:ig});function og(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)}ie();function sg(e){return e==null}function cg(e){return e!=null}async function lg(){if(typeof window<`u`&&window!==null)return`browser`;try{let t=await ae(()=>import(`./__vite-browser-external-D2g2gZ4Q.js`).then(e(1)),__vite__mapDeps([0,1,2]));return t!==void 0&&t.versions!=null&&t.versions.node!=null?`node`:`unknown`}catch{return`unknown`}}function ug(e){return sg(e)?!1:R.isInt(e.type)&&!gg(e)||dg(e)}function dg(e){return sg(e)?!1:R.isInt(e.type)&&e.type.isSigned===!1}function fg(e){return sg(e)?!1:R.isFloat(e.type)??!1}function pg(e){return sg(e)?!1:R.isDecimal(e.type)}function mg(e){return sg(e)?!1:R.isBool(e.type)}function hg(e){return sg(e)?!1:R.isDuration(e.type)}function gg(e){return sg(e)?!1:R.isInt(e.type)&&e.metadata.get(`ARROW:extension:name`)===`period`}function _g(e){return sg(e)?!1:R.isTimestamp(e.type)}function vg(e){return sg(e)?!1:R.isDate(e.type)}function yg(e){return sg(e)?!1:R.isTime(e.type)}function bg(e){return sg(e)?!1:R.isList(e.type)||R.isFixedSizeList(e.type)}function xg(e){return sg(e)?!1:R.isStruct(e.type)||R.isMap(e.type)}function Sg(e){return sg(e)?!1:R.isStruct(e.type)&&e.metadata.get(`ARROW:extension:name`)===`interval`||R.isInterval(e.type)}function Cg(e,t){let n;if(t===I.MILLISECOND)n=1e3;else if(t===I.MICROSECOND)n=1e3*1e3;else if(t===I.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 wg(e,t){return je(Cg(e,t?.type?.unit??I.SECOND))}function Tg(e,t){let n=wg(e,t);return be(n,n.getMilliseconds()===0?`HH:mm:ss`:`HH:mm:ss.SSS`)}function Eg(e){return e instanceof Date||typeof e==`number`&&Number.isFinite(e)?be(e,`yyyy-MM-dd`):(console.warn(`Unsupported date value: ${e}`),String(e))}function Dg(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 au(e,r):new au(e),Me(n,Date)}function Og(e,t){let n=t?.type?.scale||0,r=ag.bigNumToString(new ag.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=og(r.slice(-n),`0`)||``;return`${i}${a}${o?`.${o}`:``}`}new Intl.NumberFormat(`en-US`,{style:`decimal`,maximumFractionDigits:4,minimumFractionDigits:4,useGrouping:!0});function kg(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 Ag(e,t){if(R.isInterval(t?.type))return kg(e);let n=t&&t.metadata.get(`ARROW:extension:name`);if(n&&n===`pandas.interval`){let{closed:n}=JSON.parse(t.metadata.get(`ARROW:extension:metadata`)),r=e.toJSON(),i=n===`both`||n===`left`?`[`:`(`,a=n===`both`||n===`right`?`]`:`)`,o=Mg(r.left,t.type?.children?.[0]),s=Mg(r.right,t.type?.children?.[1]);return`${i+o}, ${s+a}`}return String(e)}function jg(e,t){return t?.type instanceof Cf?JSON.parse(JSON.stringify(e,(e,t)=>{if(cg(t))return typeof t==`bigint`?Number(t):t})):JSON.parse(JSON.stringify(e,(e,t)=>typeof t==`bigint`?Number(t):t))}function Mg(e,t){if(sg(e))return null;let n=e instanceof Date||Number.isFinite(e);if(n&&vg(t))return Eg(e);if(typeof e==`bigint`&&yg(t))return Tg(Number(e),t);if(n&&_g(t))return Dg(e,t);if(gg(t))throw Error(`Period type is not supported yet`);if(Sg(t))return Ag(e,t);if(hg(t))throw Error(`Duration type is not supported yet`);return pg(t)?Og(e,t):fg(t)&&Number.isFinite(e)||ug(t)?e:xg(t)||bg(t)?jg(e,t):mg(t)?!!e:String(e)}function Ng(e){return((e.toArray()||[]).map(e=>e.toJSON())||[]).map(t=>(e.schema.fields.forEach(e=>t[e.name]=Mg(t[e.name],e)),t))}var Pg=function(e){return e.ORIGIN_PRIVATE_FS=`origin-private-fs`,e.NODE_FS=`node-fs`,e}({});async function Fg(e){let t=ne(e,{logger:!1}),n,r,i=await lg();if(i===`browser`){if(t.bundles===void 0){let{getBundles:e}=await ae(async()=>{let{getBundles:e}=await import(`./default-browser-I0ZU1HCD.js`);return{getBundles:e}},[]);t.bundles=await e()}r=await $l(await t.bundles),n=new Worker(r.mainWorker)}else if(i===`node`){if(t.bundles===void 0){let{getBundles:e}=await ae(async()=>{let{getBundles:e}=await import(`./default-node-BJAWWm9L.js`);return{getBundles:e}},__vite__mapDeps([3,4,2]));t.bundles=await e()}r=await $l(await t.bundles);let e=r.mainWorker;e.startsWith(`/@fs/`)&&(e=e.replace(`/@fs/`,`file://`)),n=new(await(ae(()=>import(`./browser-kTlZS2wy.js`),[]))).default(e,{type:`module`})}else throw Error(`Unsupported environment: ${i}`);let a;a=t.logger===!0?new Dl:t.logger===!1?new El:t.logger;let o=new Ll(a,n);if(await o.instantiate(r.mainModule,r.pthreadWorker),t.storage)switch(t.storage.type){case Pg.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 Pg.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:Ng(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:Ng(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 Ig(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 Lg(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}}var Y=Symbol.for(`drizzle:entityKind`);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 Rg=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`}},zg=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)}},Bg=Symbol.for(`drizzle:Name`),Vg=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 Hg(e,this)}},Hg=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[Bg],...r,n[0].table[Bg],...i];return e??`${a.join(`_`)}_fk`}};function Ug(e,...t){return e(...t)}function Wg(e,t){return`${e[Bg]}_${t.join(`_`)}_unique`}function Gg(e,t,n){for(let r=t;rArray.isArray(e)?Jg(e):typeof e==`string`?`"${e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}"`:`${e}`).join(`,`)}}`}var Yg=class extends zg{foreignKeyConfigs=[];static[Y]=`PgColumnBuilder`;array(e){return new Qg(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})=>Ug((n,r)=>{let i=new Vg(()=>{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 Zg(e,this.config)}},Xg=class extends Rg{constructor(e,t){t.uniqueName||=Wg(e,[t.name]),super(e,t),this.table=e}static[Y]=`PgColumn`},Zg=class extends Xg{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}},Qg=class extends Yg{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 $g(e,this.config,t)}},$g=class e extends Xg{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=qg(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:Jg(r)}},e_=Symbol.for(`drizzle:isPgEnum`);function t_(e){return!!e&&typeof e==`function`&&e_ in e&&e[e_]===!0}var n_=class{static[Y]=`Subquery`;constructor(e,t,n,r=!1,i=[]){this._={brand:`Subquery`,sql:e,selectedFields:t,alias:n,isWith:r,usedTables:i}}},r_=class extends n_{static[Y]=`WithSubquery`},i_={startActiveSpan(e,t){return t()}},a_=Symbol.for(`drizzle:ViewBaseConfig`),o_=Symbol.for(`drizzle:Schema`),s_=Symbol.for(`drizzle:Columns`),c_=Symbol.for(`drizzle:ExtraConfigColumns`),l_=Symbol.for(`drizzle:OriginalName`),u_=Symbol.for(`drizzle:BaseName`),d_=Symbol.for(`drizzle:IsAlias`),f_=Symbol.for(`drizzle:ExtraConfigBuilder`),p_=Symbol.for(`drizzle:IsDrizzleTable`),Z=class{static[Y]=`Table`;static Symbol={Name:Bg,Schema:o_,OriginalName:l_,Columns:s_,ExtraConfigColumns:c_,BaseName:u_,IsAlias:d_,ExtraConfigBuilder:f_};[Bg];[l_];[o_];[s_];[c_];[u_];[d_]=!1;[p_]=!0;[f_]=void 0;constructor(e,t,n){this[Bg]=this[l_]=e,this[o_]=t,this[u_]=n}};function m_(e){return e[Bg]}function h_(e){return`${e[o_]??`public`}.${e[Bg]}`}function g_(e){return e!=null&&typeof e.getSQL==`function`}function __(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 v_=class{static[Y]=`StringChunk`;value;constructor(e){this.value=Array.isArray(e)?e:[e]}getSQL(){return new Q([this])}},Q=class e{constructor(e){this.queryChunks=e;for(let t of e)if(X(t,Z)){let e=t[Z.Symbol.Schema];this.usedTables.push(e===void 0?t[Z.Symbol.Name]:e+`.`+t[Z.Symbol.Name])}}static[Y]=`SQL`;decoder=x_;shouldInlineParams=!1;usedTables=[];append(e){return this.queryChunks.push(...e.queryChunks),this}toQuery(e){return i_.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 __(t.map(t=>{if(X(t,v_))return{sql:t.value.join(``),params:[]};if(X(t,y_))return{sql:a(t.value),params:[]};if(t===void 0)return{sql:``,params:[]};if(Array.isArray(t)){let e=[new v_(`(`)];for(let[n,r]of t.entries())e.push(r),ne},S_={mapToDriverValue:e=>e};({...x_,...S_});var C_=class{constructor(e,t=S_){this.value=e,this.encoder=t}static[Y]=`Param`;brand;getSQL(){return new Q([this])}};function $(e,...t){let n=[];(t.length>0||e.length>0&&e[0]!==``)&&n.push(new v_(e[0]));for(let[r,i]of t.entries())n.push(i,new v_(e[r+1]));return new Q(n)}(e=>{function t(){return new Q([])}e.empty=t;function n(e){return new Q(e)}e.fromList=n;function r(e){return new Q([new v_(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 Q(n)}e.join=i;function a(e){return new y_(e)}e.identifier=a;function o(e){return new w_(e)}e.placeholder=o;function s(e,t){return new C_(e,t)}e.param=s})($||={}),(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})(Q||={});var w_=class{constructor(e){this.name=e}static[Y]=`Placeholder`;getSQL(){return new Q([this])}};function T_(e,t){return e.map(e=>{if(X(e,w_)){if(!(e.name in t))throw Error(`No value for placeholder "${e.name}" was provided`);return t[e.name]}if(X(e,C_)&&X(e.value,w_)){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})}var E_=Symbol.for(`drizzle:IsDrizzleView`),D_=class{static[Y]=`View`;[a_];[E_]=!0;constructor({name:e,schema:t,selectedFields:n,query:r}){this[a_]={name:e,originalName:e,schema:t,selectedFields:n,query:r,isExisting:!r,isAlias:!1}}getSQL(){return new Q([this])}};Rg.prototype.getSQL=function(){return new Q([this])},Z.prototype.getSQL=function(){return new Q([this])},n_.prototype.getSQL=function(){return new Q([this])};var O_=class{constructor(e){this.table=e}static[Y]=`ColumnAliasProxyHandler`;get(e,t){return t===`table`?this.table:e[t]}},k_=class{constructor(e,t){this.alias=e,this.replaceOriginalName=t}static[Y]=`TableAliasProxyHandler`;get(e,t){if(t===Z.Symbol.IsAlias)return!0;if(t===Z.Symbol.Name||this.replaceOriginalName&&t===Z.Symbol.OriginalName)return this.alias;if(t===a_)return{...e[a_],name:this.alias,isAlias:!0};if(t===Z.Symbol.Columns){let t=e[Z.Symbol.Columns];if(!t)return t;let n={};return Object.keys(t).map(r=>{n[r]=new Proxy(t[r],new O_(new Proxy(e,this)))}),n}let n=e[t];return X(n,Rg)?new Proxy(n,new O_(new Proxy(e,this))):n}};function A_(e,t){return new Proxy(e,new k_(t,!1))}function j_(e,t){return new Proxy(e,new O_(new Proxy(e.table,new k_(t,!1))))}function M_(e,t){return new Q.Aliased(N_(e.sql,t),e.fieldAlias)}function N_(e,t){return $.join(e.queryChunks.map(e=>X(e,Rg)?j_(e,t):X(e,Q)?N_(e,t):X(e,Q.Aliased)?M_(e,t):e))}var P_=class extends Error{static[Y]=`DrizzleError`;constructor({message:e,cause:t}){super(e),this.name=`DrizzleError`,this.cause=t}},F_=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)}},I_=class extends P_{static[Y]=`TransactionRollbackError`;constructor(){super({message:`Rollback`})}},L_=class{static[Y]=`ConsoleLogWriter`;write(e){console.log(e)}},R_=class{static[Y]=`DefaultLogger`;writer;constructor(e){this.writer=e?.writer??new L_}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}`)}},z_=class{static[Y]=`NoopLogger`;logQuery(){}},B_=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 V_(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,Rg)||X(r,Q)||X(r,Q.Aliased)||X(r,n_)?e.push({path:i,field:r}):X(r,Z)?e.push(...V_(r[Z.Symbol.Columns],i)):e.push(...V_(r,i)),e},[])}function H_(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 U_(e,t){let n=Object.entries(t).filter(([,e])=>e!==void 0).map(([t,n])=>X(n,Q)||X(n,Rg)?[t,n]:[t,new C_(n,e[Z.Symbol.Columns][t])]);if(n.length===0)throw Error(`No values to set`);return Object.fromEntries(n)}function W_(e,t){for(let n of t)for(let t of Object.getOwnPropertyNames(n.prototype))t!==`constructor`&&Object.defineProperty(e.prototype,t,Object.getOwnPropertyDescriptor(n.prototype,t)||Object.create(null))}function G_(e){return e[Z.Symbol.Columns]}function K_(e){return X(e,n_)?e._.alias:X(e,D_)?e[a_].name:X(e,Q)?void 0:e[Z.Symbol.IsAlias]?e[Z.Symbol.Name]:e[Z.Symbol.BaseName]}function q_(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}typeof TextDecoder>`u`||new TextDecoder;var J_=class extends Xg{static[Y]=`PgDate`;getSQLType(){return`date`}mapFromDriverValue(e){return typeof e==`string`?new Date(e):e}mapToDriverValue(e){return e.toISOString()}},Y_=class extends Xg{static[Y]=`PgDateString`;getSQLType(){return`date`}mapFromDriverValue(e){return typeof e==`string`?e:e.toISOString().slice(0,-14)}},X_=class extends Xg{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}},Z_=class extends Xg{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}},Q_=class extends Xg{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})`}},$_=class extends Xg{static[Y]=`PgTime`;withTimezone;precision;constructor(e,t){super(e,t),this.withTimezone=t.withTimezone,this.precision=t.precision}getSQLType(){return`time${this.precision===void 0?``:`(${this.precision})`}${this.withTimezone?` with time zone`:``}`}},ev=class extends Xg{static[Y]=`PgTimestamp`;withTimezone;precision;constructor(e,t){super(e,t),this.withTimezone=t.withTimezone,this.precision=t.precision}getSQLType(){return`timestamp${this.precision===void 0?``:` (${this.precision})`}${this.withTimezone?` with time zone`:``}`}mapFromDriverValue(e){return typeof e==`string`?new Date(this.withTimezone?e:e+`+0000`):e}mapToDriverValue=e=>e.toISOString()},tv=class extends Xg{static[Y]=`PgTimestampString`;withTimezone;precision;constructor(e,t){super(e,t),this.withTimezone=t.withTimezone,this.precision=t.precision}getSQLType(){return`timestamp${this.precision===void 0?``:`(${this.precision})`}${this.withTimezone?` with time zone`:``}`}mapFromDriverValue(e){if(typeof e==`string`)return e;let t=e.toISOString().slice(0,-1).replace(`T`,` `);if(this.withTimezone){let n=e.getTimezoneOffset();return`${t}${n<=0?`+`:`-`}${Math.floor(Math.abs(n)/60).toString().padStart(2,`0`)}`}return t}},nv=class extends Xg{static[Y]=`PgUUID`;getSQLType(){return`uuid`}},rv=Symbol.for(`drizzle:PgInlineForeignKeys`),iv=Symbol.for(`drizzle:EnableRLS`),av=class extends Z{static[Y]=`PgTable`;static Symbol=Object.assign({},Z.Symbol,{InlineForeignKeys:rv,EnableRLS:iv});[rv]=[];[iv]=!1;[Z.Symbol.ExtraConfigBuilder]=void 0;[Z.Symbol.ExtraConfigColumns]={}},ov=class{static[Y]=`PgPrimaryKeyBuilder`;columns;name;constructor(e,t){this.columns=e,this.name=t}build(e){return new sv(e,this.columns,this.name)}},sv=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[av.Symbol.Name]}_${this.columns.map(e=>e.name).join(`_`)}_pk`}};function cv(e,t){return b_(t)&&!g_(e)&&!X(e,C_)&&!X(e,w_)&&!X(e,Rg)&&!X(e,Z)&&!X(e,D_)?new C_(e,t):e}var lv=(e,t)=>$`${e} = ${cv(t,e)}`,uv=(e,t)=>$`${e} <> ${cv(t,e)}`;function dv(...e){let t=e.filter(e=>e!==void 0);if(t.length!==0)return t.length===1?new Q(t):new Q([new v_(`(`),$.join(t,new v_(` and `)),new v_(`)`)])}function fv(...e){let t=e.filter(e=>e!==void 0);if(t.length!==0)return t.length===1?new Q(t):new Q([new v_(`(`),$.join(t,new v_(` or `)),new v_(`)`)])}function pv(e){return $`not ${e}`}var mv=(e,t)=>$`${e} > ${cv(t,e)}`,hv=(e,t)=>$`${e} >= ${cv(t,e)}`,gv=(e,t)=>$`${e} < ${cv(t,e)}`,_v=(e,t)=>$`${e} <= ${cv(t,e)}`;function vv(e,t){return Array.isArray(t)?t.length===0?$`false`:$`${e} in ${t.map(t=>cv(t,e))}`:$`${e} in ${cv(t,e)}`}function yv(e,t){return Array.isArray(t)?t.length===0?$`true`:$`${e} not in ${t.map(t=>cv(t,e))}`:$`${e} not in ${cv(t,e)}`}function bv(e){return $`${e} is null`}function xv(e){return $`${e} is not null`}function Sv(e){return $`exists ${e}`}function Cv(e){return $`not exists ${e}`}function wv(e,t,n){return $`${e} between ${cv(t,e)} and ${cv(n,e)}`}function Tv(e,t,n){return $`${e} not between ${cv(t,e)} and ${cv(n,e)}`}function Ev(e,t){return $`${e} like ${t}`}function Dv(e,t){return $`${e} not like ${t}`}function Ov(e,t){return $`${e} ilike ${t}`}function kv(e,t){return $`${e} not ilike ${t}`}function Av(e){return $`${e} asc`}function jv(e){return $`${e} desc`}var Mv=class{constructor(e,t,n){this.sourceTable=e,this.referencedTable=t,this.relationName=n,this.referencedTableName=t[Z.Symbol.Name]}static[Y]=`Relation`;referencedTableName;fieldName},Nv=class{constructor(e,t){this.table=e,this.config=t}static[Y]=`Relations`},Pv=class e extends Mv{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}},Fv=class e extends Mv{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 Iv(){return{and:dv,between:wv,eq:lv,exists:Sv,gt:mv,gte:hv,ilike:Ov,inArray:vv,isNull:bv,isNotNull:xv,like:Ev,lt:gv,lte:_v,ne:uv,not:pv,notBetween:Tv,notExists:Cv,notLike:Dv,notIlike:kv,notInArray:yv,or:fv,sql:$}}function Lv(){return{sql:$,asc:Av,desc:jv}}function Rv(e,t){Object.keys(e).length===1&&`default`in e&&!X(e.default,Z)&&(e=e.default);let n={},r={},i={};for(let[a,o]of Object.entries(e))if(X(o,Z)){let e=h_(o),t=r[e];n[e]=a,i[a]={tsName:a,dbName:o[Z.Symbol.Name],schema:o[Z.Symbol.Schema],columns:o[Z.Symbol.Columns],relations:t?.relations??{},primaryKey:t?.primaryKey??[]};for(let e of Object.values(o[Z.Symbol.Columns]))e.primary&&i[a].primaryKey.push(e);let s=o[Z.Symbol.ExtraConfigBuilder]?.(o[Z.Symbol.ExtraConfigColumns]);if(s)for(let e of Object.values(s))X(e,ov)&&i[a].primaryKey.push(...e.columns)}else if(X(o,Nv)){let e=h_(o.table),a=n[e],s=o.config(t(o.table));for(let[t,n]of Object.entries(s))if(a){let e=i[a];e.relations[t]=n}else e in r||(r[e]={relations:{},primaryKey:void 0}),r[e].relations[t]=n}return{tables:i,tableNamesMap:n}}function zv(e){return function(t,n){return new Pv(e,t,n,n?.fields.reduce((e,t)=>e&&t.notNull,!0)??!1)}}function Bv(e){return function(t,n){return new Fv(e,t,n)}}function Vv(e,t,n){if(X(n,Pv)&&n.config)return{fields:n.config.fields,references:n.config.references};let r=t[h_(n.referencedTable)];if(!r)throw Error(`Table "${n.referencedTable[Z.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[h_(a)];if(!o)throw Error(`Table "${a[Z.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[Z.Symbol.Name]}". Please specify relation name`);if(s[0]&&X(s[0],Pv)&&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 Hv(e){return{one:zv(e),many:Bv(e)}}function Uv(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,Pv)?l&&Uv(e,e[s.relationTableTsKey],l,s.selection,i):l.map(t=>Uv(e,e[s.relationTableTsKey],t,s.selection,i))}else{let e=i(n[o]),t=s.field,r;r=X(t,Rg)?t:X(t,Q)?t.decoder:t.sql.decoder,a[s.tsKey]=e===null?null:r.mapFromDriverValue(e)}return a}var Wv=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===a_)return{...t[a_],selectedFields:new Proxy(t[a_].selectedFields,this)};if(typeof n==`symbol`)return t[n];let r=(X(t,n_)?t._.selectedFields:X(t,D_)?t[a_].selectedFields:t)[n];if(X(r,Q.Aliased)){if(this.config.sqlAliasedBehavior===`sql`&&!r.isSelectionField)return r.sql;let e=r.clone();return e.isSelectionField=!0,e}if(X(r,Q)){if(this.config.sqlBehavior===`sql`)return r;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(r,Rg)?this.config.alias?new Proxy(r,new O_(new Proxy(r.table,new k_(this.config.alias,this.config.replaceOriginalName??!1)))):r:typeof r!=`object`||!r?r:new Proxy(r,new e(this.config))}};function Gv(e){return(e.replace(/['\u2019]/g,``).match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).map(e=>e.toLowerCase()).join(`_`)}function Kv(e){return(e.replace(/['\u2019]/g,``).match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).reduce((e,t,n)=>e+(n===0?t.toLowerCase():`${t[0].toUpperCase()}${t.slice(1)}`),``)}function qv(e){return e}var Jv=class{static[Y]=`CasingCache`;cache={};cachedTables={};convert;constructor(e){this.convert=e===`snake_case`?Gv:e===`camelCase`?Kv:qv}getColumnCasing(e){if(!e.keyAsName)return e.name;let t=`${e.table[Z.Symbol.Schema]??`public`}.${e.table[Z.Symbol.OriginalName]}.${e.name}`;return this.cache[t]||this.cacheTable(e.table),this.cache[t]}cacheTable(e){let t=`${e[Z.Symbol.Schema]??`public`}.${e[Z.Symbol.OriginalName]}`;if(!this.cachedTables[t]){for(let n of Object.values(e[Z.Symbol.Columns])){let e=`${t}.${n.name}`;this.cache[e]=this.convert(n.name)}this.cachedTables[t]=!0}}clearCache(){this.cache={},this.cachedTables={}}},Yv=class extends D_{static[Y]=`PgViewBase`},Xv=class{static[Y]=`PgDialect`;casing;constructor(e){this.casing=new Jv(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=$` CREATE TABLE IF NOT EXISTS ${$.identifier(i)}.${$.identifier(r)} ( diff --git a/assets/settings-D1kLcsvA.js b/assets/settings-73vyHOZs.js similarity index 98% rename from assets/settings-D1kLcsvA.js rename to assets/settings-73vyHOZs.js index d3e6d53c6291b8fc7f20ede76752826d770dc163..b0ea8979815b088e2b2a33256cbe1acabf474ef7 100644 --- a/assets/settings-D1kLcsvA.js +++ b/assets/settings-73vyHOZs.js @@ -569,4 +569,4 @@ void main(void){ `,i),r(i)}return Promise.resolve(void 0)}static loadExpression(e,t){let n=n=>e.emit(`expressionLoadError`,t,n);try{let r=e.definitions[t];if(!r)return Promise.resolve(void 0);e.listeners(`destroy`).includes(dc.releaseTasks)||e.once(`destroy`,dc.releaseTasks);let i=dc.expressionTasksMap.get(e);i||(i=[],dc.expressionTasksMap.set(e,i));let a=e.getExpressionFile(r);return i[t]??(i[t]=nc.load({url:a,settings:e.settings,type:`json`,target:e}).then(n=>{let i=dc.expressionTasksMap.get(e);i&&delete i[t];let a=e.createExpression(n,r);return e.emit(`expressionLoaded`,t,a),a}).catch(t=>{Q.warn(e.tag,`Failed to load expression: ${a} `,t),n(t)})),i[t]}catch(r){Q.warn(e.tag,`Failed to load expression at [${t}] `,r),n(r)}return Promise.resolve(void 0)}static releaseTasks(){this instanceof Js?dc.motionTasksMap.delete(this):dc.expressionTasksMap.delete(this)}},$=dc;$.runtimes=[],$.urlToJSON=ac,$.jsonToSettings=oc,$.waitUntilReady=sc,$.setupOptionals=cc,$.setupEssentials=lc,$.createInternalModel=uc,$.live2DModelMiddlewares=[ac,oc,sc,cc,lc,uc],$.motionTasksMap=new WeakMap,$.expressionTasksMap=new WeakMap,Js.prototype._loadMotion=function(e,t){return $.loadMotion(this,e,t)},Ls.prototype._loadExpression=function(e){return $.loadExpression(this,e)};var fc=class{constructor(){this._autoInteract=!1}get autoInteract(){return this._autoInteract}set autoInteract(e){e!==this._autoInteract&&(e?this.on(`pointertap`,pc,this):this.off(`pointertap`,pc,this),this._autoInteract=e)}registerInteraction(e){e!==this.interactionManager&&(this.unregisterInteraction(),this._autoInteract&&e&&(this.interactionManager=e,e.on(`pointermove`,mc,this)))}unregisterInteraction(){var e;this.interactionManager&&=((e=this.interactionManager)==null||e.off(`pointermove`,mc,this),void 0)}};function pc(e){this.tap(e.data.global.x,e.data.global.y)}function mc(e){this.focus(e.data.global.x,e.data.global.y)}var hc=class extends vn{},gc=new on,_c=new ln,vc,yc=class extends xa{constructor(e){super(),this.tag=`Live2DModel(uninitialized)`,this.textures=[],this.transform=new hc,this.anchor=new cn(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 $.setupLive2DModel(n,e,t).then(()=>n)}static fromSync(e,t){let n=new this(t);return $.setupLive2DModel(n,e,t).then(t?.onLoad).catch(t?.onError),n}static registerTicker(e){vc=e}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){vc||=window.PIXI?.Ticker,e?this._destroyed||(vc?(vc.shared.add(this.onTickerUpdate,this),this._autoUpdate=!0):Q.warn(this.tag,`No Ticker registered, please call Live2DModel.registerTicker(Ticker).`)):(vc?.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){gc.x=e,gc.y=t,this.toModelPosition(gc,gc,!0);let r=gc.x/this.internalModel.originalWidth*2-1,i=gc.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&&(Q.log(this.tag,`Hit`,n),this.emit(`hit`,n))}hitTest(e,t){return gc.x=e,gc.y=t,this.toModelPosition(gc,gc),this.internalModel.hitTest(gc.x,gc.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(vc.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)}};Ps(yc,[fc]);var bc=class{static resolveURL(e,t){let n=bc.filesMap[e]?.[t];if(n===void 0)throw Error(`Cannot find this file from uploaded files: `+t);return n}static upload(e,t){return Y(this,null,function*(){let n={};for(let r of t.getDefinedFiles()){let i=decodeURI(yt.resolve(t.url,r)),a=e.find(e=>e.webkitRelativePath===i);a&&(n[r]=URL.createObjectURL(a))}bc.filesMap[t._objectURL]=n})}static createSettings(e){return Y(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 bc.readText(t),r=JSON.parse(n);r.url=t.webkitRelativePath;let i=$.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 Y(this,null,function*(){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(r.result),r.onerror=n,r.readAsText(e,`utf8`)})})}},xc=bc;xc.filesMap={},xc.factory=(e,t)=>Y(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 bc.createSettings(t);else if(!n._objectURL)throw Error(`"_objectURL" must be specified in ModelSettings`);n.validateFiles(t.map(e=>encodeURI(e.webkitRelativePath))),yield bc.upload(t,n),n.resolveURL=function(e){return bc.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),bc.filesMap[e])for(let t of Object.values(bc.filesMap[e]))URL.revokeObjectURL(t);delete bc.filesMap[e]})})}return t()}),$.live2DModelMiddlewares.unshift(xc.factory);var Sc=class{static unzip(e,t){return Y(this,null,function*(){let n=yield Sc.getFilePaths(e),r=[];for(let e of t.getDefinedFiles()){let i=decodeURI(yt.resolve(t.url,e));n.includes(i)&&r.push(i)}let i=yield Sc.getFiles(e,r);for(let e=0;ee.endsWith(`model.json`)||e.endsWith(`model3.json`));if(!t)throw Error(`Settings file not found`);let n=yield Sc.readText(e,t);if(!n)throw Error(`Empty settings file: `+t);let r=JSON.parse(n);r.url=t;let i=$.findRuntime(r);if(!i)throw Error(`Unknown settings JSON`);return i.createModelSettings(r)})}static zipReader(e,t){return Y(this,null,function*(){throw Error(`Not implemented`)})}static getFilePaths(e){return Y(this,null,function*(){throw Error(`Not implemented`)})}static getFiles(e,t){return Y(this,null,function*(){throw Error(`Not implemented`)})}static readText(e,t){return Y(this,null,function*(){throw Error(`Not implemented`)})}static releaseReader(e){}},Cc=Sc;if(Cc.ZIP_PROTOCOL=`zip://`,Cc.uid=0,Cc.factory=(e,t)=>Y(void 0,null,function*(){let n=e.source,r,i,a;if(typeof n==`string`&&(n.endsWith(`.zip`)||n.startsWith(Sc.ZIP_PROTOCOL))?(r=n.startsWith(Sc.ZIP_PROTOCOL)?n.slice(Sc.ZIP_PROTOCOL.length):n,i=yield nc.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 Sc.zipReader(i,r);a||=yield Sc.createSettings(t),a._objectURL=Sc.ZIP_PROTOCOL+Sc.uid+`/`+a.url;let n=yield Sc.unzip(t,a);n.settings=a,e.source=n,r.startsWith(`blob:`)&&e.live2dModel.once(`modelLoaded`,e=>{e.once(`destroy`,function(){URL.revokeObjectURL(r)})}),Sc.releaseReader(t)}return t()}),$.live2DModelMiddlewares.unshift(Cc.factory),!window.Live2DCubismCore)throw Error(`Could not find Cubism 4 runtime. This plugin requires live2dcubismcore.js to be loaded.`);var wc=class extends Ls{constructor(e,t){super(e,t),this.queueManager=new Oo,this.definitions=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 eo.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)}},Tc=class e extends Hs{constructor(t){if(super(t),!e.isValidJSON(t))throw TypeError(`Invalid JSON.`);Object.assign(this,new ws(t))}static isValidJSON(e){return!!e?.FileReferences&&typeof e.FileReferences.Moc==`string`&&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=Eo.create(e),i=new uo(e),a=(t===this.groups.idle?Ms.idleMotionFadingDuration:Ms.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}},Dc=new Fa,Oc=class extends Xs{constructor(e,t,n){super(),this.lipSync=!0,this.breath=Ta.create(),this.renderer=new Cs,this.idParamAngleX=Ts,this.idParamAngleY=Es,this.idParamAngleZ=Ds,this.idParamEyeBallX=Os,this.idParamEyeBallY=ks,this.idParamBodyAngleX=As,this.idParamBreath=js,this.pixelsPerUnit=1,this.centeringTransform=new ln,this.coreModel=e,this.settings=t,this.motionManager=new Ec(t,n),this.init()}init(){super.init(),this.settings.getEyeBlinkParameters()?.length>0&&(this.eyeBlink=Oa.create(this.settings)),this.breath.setParameters([new Ea(this.idParamAngleX,0,15,6.5345,.5),new Ea(this.idParamAngleY,0,8,3.5345,.5),new Ea(this.idParamAngleZ,0,10,5.5345,.5),new Ea(this.idParamBodyAngleX,0,4,15.5345,.5),new Ea(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,ms.getInstance()._shaderSets=[]}bindTexture(e,t){this.renderer.bindTexture(e,t)}getHitAreaDefs(){return 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{Mc(),e()}catch(e){if(Ac--,Ac<0){let n=Error(`Failed to start up Cubism 4 framework.`);n.cause=e,t(n);return}Q.log(`Cubism4`,`Startup failed, retrying 10ms later...`),setTimeout(n,10)}}n()}),kc)}function Mc(e){e=Object.assign({logFunction:console.log,loggingLevel:Wa.LogLevel_Verbose},e),Ua.startUp(e),Ua.initialize()}$.registerRuntime({version:4,ready:jc,test(e){return e instanceof Tc||Tc.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 Tc(e)},createCoreModel(e){let t=Za.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 Oc(e,t,n),i=e;return i.__moc&&(r.__moc=i.__moc,delete i.__moc,r.once(`destroy`,Nc)),r},createPhysics(e,t){return Uo.create(t)},createPose(e,t){return Ma.create(t)}});function Nc(){var e;(e=this.__moc)==null||e.release()}var Pc=t(n(((t,n)=>{(function(e){typeof t==`object`&&n!==void 0?n.exports=e():typeof define==`function`&&define.amd?define([],e):(typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:this).JSZip=e()})(function(){return function t(n,r,i){function a(s,c){if(!r[s]){if(!n[s]){var l=typeof e==`function`&&e;if(!c&&l)return l(s,!0);if(o)return o(s,!0);var u=Error(`Cannot find module '`+s+`'`);throw u.code=`MODULE_NOT_FOUND`,u}var d=r[s]={exports:{}};n[s][0].call(d.exports,function(e){var t=n[s][1][e];return a(t||e)},d,d.exports,t,n,r,i)}return r[s].exports}for(var o=typeof e==`function`&&e,s=0;s>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){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){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){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){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){var r=null;r=typeof Promise<`u`?Promise:e(`lie`),t.exports={Promise:r}},{lie:37}],7:[function(e,t,n){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){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){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){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){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){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){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){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){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){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){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){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){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{n(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){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){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){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){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 I(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,F(e.strm)}function L(e,t){e.pending_buf[e.pending++]=t}function R(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function z(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 B(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(B(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,I(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-T&&(I(e,!1),e.strm.avail_out===0))return O}return e.insert=0,t===u?(I(e,!0),e.strm.avail_out===0?A:j):(e.strstart>e.block_start&&(I(e,!1),e.strm.avail_out),O)}),new ne(4,4,8,4,ee),new ne(4,5,16,8,ee),new ne(4,6,32,32,ee),new ne(4,4,16,16,te),new ne(8,16,32,32,te),new ne(8,16,128,128,te),new ne(8,32,128,256,te),new ne(32,128,258,1024,te),new ne(32,258,258,4096,te)],n.deflateInit=function(e,t){return oe(e,t,g,15,8,0)},n.deflateInit2=oe,n.deflateReset=ae,n.deflateResetKeep=ie,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),L(i,i.gzhead.time>>16&255),L(i,i.gzhead.time>>24&255),L(i,i.level===9?2:2<=i.strategy||i.level<2?4:0),L(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(L(i,255&i.gzhead.extra.length),L(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):(L(i,0),L(i,0),L(i,0),L(i,0),L(i,0),L(i,i.level===9?2:2<=i.strategy||i.level<2?4:0),L(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,R(i,p),i.strstart!==0&&(R(i,e.adler>>>16),R(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)),F(e),o=i.pending,i.pending!==i.pending_buf_size));)L(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)),F(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)),F(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&&F(e),i.pending+2<=i.pending_buf_size&&(L(i,255&e.adler),L(i,e.adler>>8&255),e.adler=0,i.status=D)):i.status=D),i.pending!==0){if(F(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&&(B(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&&(I(e,!1),e.strm.avail_out===0))return O}return e.insert=0,t===u?(I(e,!0),e.strm.avail_out===0?A:j):e.last_lit&&(I(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(B(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&&(I(e,!1),e.strm.avail_out===0))return O}return e.insert=0,t===u?(I(e,!0),e.strm.avail_out===0?A:j):e.last_lit&&(I(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&&(P(i.head),i.lookahead===0&&(i.strstart=0,i.block_start=0,i.insert=0))),F(e),e.avail_out===0))return i.last_flush=-1,d}return t===u?i.wrap<=0?1:(i.wrap===2?(L(i,255&e.adler),L(i,e.adler>>8&255),L(i,e.adler>>16&255),L(i,e.adler>>24&255),L(i,255&e.total_in),L(i,e.total_in>>8&255),L(i,e.total_in>>16&255),L(i,e.total_in>>24&255)):(R(i,e.adler>>>16),R(i,65535&e.adler)),F(e),0=n.w_size&&(s===0&&(P(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,B(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,B,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,F=8+(15&(b>>>=4)),n.wbits===0)n.wbits=F;else if(F>n.wbits){e.msg=`invalid window size`,n.mode=30;break}n.dmax=1<>8&1),512&n.flags&&(B[0]=255&b,B[1]=b>>>8&255,n.check=a(n.check,B,2,0)),x=b=0,n.mode=3;case 3:for(;x<32;){if(v===0)break e;v--,b+=p[g++]<>>8&255,B[2]=b>>>16&255,B[3]=b>>>24&255,n.check=a(n.check,B,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&&(B[0]=255&b,B[1]=b>>>8&255,n.check=a(n.check,B,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,B,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&&(F=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,F)),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;F=p[g+ E++],n.head&&F&&n.length<65536&&(n.head.name+=String.fromCharCode(F)),F&&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[ee[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,L={bits:n.lenbits},I=s(0,n.lens,0,19,n.lencode,0,n.work,L),n.lenbits=L.bits,I){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&z,!((k=z>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>>=k,x-=k,n.lens[n.have++]=j;else{if(j===16){for(R=k+2;x>>=k,x-=k,n.have===0){e.msg=`invalid bit length repeat`,n.mode=30;break}F=n.lens[n.have-1],E=3+(3&b),b>>>=2,x-=2}else if(j===17){for(R=k+3;x>>=k)),b>>>=3,x-=3}else{for(R=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++]=F}}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,L={bits:n.lenbits},I=s(c,n.lens,0,n.nlen,n.lencode,0,n.work,L),n.lenbits=L.bits,I){e.msg=`invalid literal/lengths set`,n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,L={bits:n.distbits},I=s(l,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,L),n.distbits=L.bits,I){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=(z=n.lencode[b&(1<>>16&255,j=65535&z,!((k=z>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>M)])>>>16&255,j=65535&z,!(M+(k=z>>>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(R=n.extra;x>>=n.extra,x-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;A=(z=n.distcode[b&(1<>>16&255,j=65535&z,!((k=z>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>M)])>>>16&255,j=65535&z,!(M+(k=z>>>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(R=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=L[R+d[w]],N[P+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++,--F[C]==0){if(C===E)break;C=t[n+d[w]]}if(D>>7)]}function L(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function R(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 ee(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]=B(a[s]++,s))}}function te(e){var t;for(t=0;t>1;1<=n;n--)ie(e,a,n);for(i=c;n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],ie(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++,ie(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?ue(e,t,n,r):e.strategy===4||s===o?(R(e,2+(r?1:0),3),ae(e,T,E)):(R(e,4+(r?1:0),3),function(e,t,n,r){var i;for(R(e,t-257,5),R(e,n-1,5),R(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*I(t)]++),e.last_lit===e.lit_bufsize-1},n._tr_align=function(e){R(e,2,3),z(e,_,T),function(e){e.bi_valid===16?(L(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){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){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)})}))(),1);Cc.zipReader=(e,t)=>Pc.default.loadAsync(e);var Fc=Cc.createSettings;Cc.createSettings=async e=>{let t=Object.keys(e.files);return t.find(e=>Ic(e))?Fc(e):zc(t)};function Ic(e){return e.endsWith(`model3.json`)}function Lc(e){return e.endsWith(`.moc3`)}function Rc(e){return e.split(/[\\/]/).pop()}function zc(e){let t=e.filter(e=>Lc(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=Rc(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 Tc({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}Cc.readText=(e,t)=>{let n=e.file(t);if(!n)throw Error(`Cannot find file: ${t}`);return n.async(`text`)},Cc.getFilePaths=e=>{let t=[];return e.forEach(e=>t.push(e)),Promise.resolve(t)},Cc.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 Bc=class e{static async readDirectoryRecursive(t,n){let r=[];for await(let i of t.values())if(i.kind===`file`){let e=await i.getFile();Object.defineProperty(e,`webkitRelativePath`,{value:n+e.name}),r.push(e)}else if(i.kind===`directory`){let t=`${n+i.name}/`,a=await e.readDirectoryRecursive(i,t);r.push(...a)}return r}static async resolveDirectory(e,t){let n=e;if(!t||t===`.`||t===`./`)return n;let r=t.split(`/`).filter(e=>e&&e!==`.`);for(let e of r)n=await n.getDirectoryHandle(e,{create:!0});return n}static async writeFile(t,n,r){let i=n.split(`/`),a=i.pop(),o=i.join(`/`),s=await(await(await e.resolveDirectory(t,o)).getFileHandle(a,{create:!0})).createWritable();await s.write(r),await s.close()}static async get(t){try{let n=await(await navigator.storage.getDirectory()).getDirectoryHandle(t,{create:!1});console.debug(`[OPFS] Cache hit for ${t}`);let r=await e.readDirectoryRecursive(n,``);if(r.length>0)return r}catch{}return null}static async save(t,n){console.debug(`[OPFS] Saving ${n.length} files to ${t}`);try{let r=await(await navigator.storage.getDirectory()).getDirectoryHandle(t,{create:!0}),i=[];for(let t of n){let n=t.webkitRelativePath||t.name;i.push(e.writeFile(r,n,t))}if(!n.find(e=>e.name.endsWith(`model.json`)||e.name.endsWith(`model3.json`))){let t=n.settings;if(t){console.debug(`[OPFS] Reconstructing settings file...`);let n=JSON.stringify(t.json),a=t.url||`model.model3.json`;i.push(e.writeFile(r,a,n))}}await Promise.all(i),console.debug(`[OPFS] Saved to cache`)}catch(e){console.error(`[OPFS] Failed to save to cache:`,e)}}static checkMiddleware=async(t,n)=>{let r=t.source,i,a;if(typeof r==`object`&&r&&`id`in r&&`url`in r)i=r.id,a=r.url;else return n();if(!i||!a||!a.startsWith(`blob:`)&&!a.endsWith(`.zip`))return t.source=a,n();let o=await e.get(i);if(o)return t.source=o,n();console.debug(`[OPFS] Cache miss for ${i}`),t.opfsKey=i;try{let e=await(await fetch(a)).blob(),n=`${i}.zip`;t.source=[new File([e],n)]}catch(e){throw console.error(`[OPFS] Failed to fetch blob for ${i}`,e),e}return n()};static saveMiddleware=async(t,n)=>{if(!t.opfsKey||!Array.isArray(t.source))return n();let r=t.source;return r.length===0||!(r[0]instanceof File)||await e.save(t.opfsKey,r),n()}},Vc=$.live2DModelMiddlewares.indexOf(Cc.factory);$.live2DModelMiddlewares.includes(Bc.checkMiddleware)||(Vc===-1?console.warn(`[OPFS] ZipLoader not found in middlewares, caching disabled`):($.live2DModelMiddlewares.splice(Vc,0,Bc.checkMiddleware),$.live2DModelMiddlewares.splice(Vc+2,0,Bc.saveMiddleware)));var Hc=t(Se(),1);let Uc=function(e){return e.Live2dZip=`live2d-zip`,e.Live2dDirectory=`live2d-directory`,e.VRM=`vrm`,e.PMXZip=`pmx-zip`,e.PMXDirectory=`pmx-directory`,e.PMD=`pmd`,e}({});var Wc=new URL(`/assets/hiyori_pro_zh-BOkrWUw6.zip`,``+import.meta.url).href,Gc=new URL(`/assets/hiyori_free_zh-D9UJNK98.zip`,``+import.meta.url).href,Kc=new URL(`/assets/preview-BifEn9T1.png`,``+import.meta.url).href,qc=new URL(`/assets/AvatarSample_A-BNRNjuVT.vrm`,``+import.meta.url).href,Jc=new URL(`/assets/preview-BFkGxoPo.png`,``+import.meta.url).href,Yc=new URL(`/assets/AvatarSample_B-Cgr_Y5fe.vrm`,``+import.meta.url).href,Xc=new URL(`/assets/preview-Bbc27ubS.png`,``+import.meta.url).href,Zc=[{id:`preset-live2d-1`,format:Uc.Live2dZip,type:`url`,url:Wc,name:`Hiyori (Pro)`,previewImage:Kc,importedAt:1733113886840},{id:`preset-live2d-2`,format:Uc.Live2dZip,type:`url`,url:Gc,name:`Hiyori (Free)`,previewImage:Kc,importedAt:1733113886840},{id:`preset-vrm-1`,format:Uc.VRM,type:`url`,url:qc,name:`AvatarSample_A`,previewImage:Jc,importedAt:1733113886840},{id:`preset-vrm-2`,format:Uc.VRM,type:`url`,url:Yc,name:`AvatarSample_B`,previewImage:Xc,importedAt:1733113886840}];const Qc=l(`display-models`,()=>{let e=c([]),t=c(!1);async function n(){await f(t).toBe(!1),t.value=!0;let n=[...Zc];try{await Hc.default.iterate((e,t)=>{t.startsWith(`display-model-`)&&n.push({id:t,format:e.format,type:`file`,file:e.file,name:e.file.name,importedAt:e.importedAt,previewImage:e.previewImage})})}catch(e){console.error(e)}e.value=n.sort((e,t)=>t.importedAt-e.importedAt),t.value=!1}async function r(e){return await f(t).toBe(!1),await Hc.default.getItem(e)||Zc.find(t=>t.id===e)}async function i(e){yc.registerTicker($t),Yt.add(en);let t=document.createElement(`canvas`);t.width=720,t.height=1280,t.style.position=`absolute`,t.style.top=`0`,t.style.left=`0`,t.style.objectFit=`cover`,t.style.display=`block`,t.style.zIndex=`10000000000`,t.style.opacity=`0`,document.body.appendChild(t);let n=new Ca({view:t,preserveDrawingBuffer:!0,backgroundAlpha:0,resizeTo:window}),r=new yc,i=URL.createObjectURL(e),a=await(await fetch(i)).blob();try{await $.setupLive2DModel(r,[new File([a],e.name)],{autoInteract:!1})}catch(e){n.destroy(),document.body.removeChild(t),URL.revokeObjectURL(i),console.error(e);return}n.stage.addChild(r),r.x=275,r.y=450,r.width=t.width,r.height=t.height,r.scale.set(.1,.1),r.anchor.set(.5,.5),await new Promise(e=>setTimeout(e,500)),n.renderer.render(n.stage);let o=xe(t),s=document.createElement(`canvas`);s.width=o.width>o.height/16*12?o.width:o.height/16*12,s.height=s.width/12*16,s.getContext(`2d`).drawImage(o,(s.width-o.width)/2,(s.height-o.height)/2,o.width,o.height);let c=s.toDataURL();return n.destroy(),document.body.removeChild(t),URL.revokeObjectURL(i),c}async function a(n,r){await f(t).toBe(!1);let a={id:`display-model-${_()}`,format:n,type:`file`,file:r,name:r.name,importedAt:Date.now()};if(n===Uc.Live2dZip){let e=await i(r);if(!e)return;a.previewImage=e}e.value.unshift(a),Hc.default.setItem(a.id,a).catch(e=>console.error(e))}async function o(e,n){await f(t).toBe(!1);let r=await Hc.default.getItem(e);r&&(r.name=n)}async function s(n){await f(t).toBe(!1),await Hc.default.removeItem(n),e.value=e.value.filter(e=>e.id!==n)}async function l(){await n();let t=e.value.filter(e=>e.type===`file`).map(e=>e.id);for(let e of t)await s(e);e.value=[...Zc].sort((e,t)=>t.importedAt-e.importedAt)}return{displayModels:e,displayModelsFromIndexedDBLoading:t,loadDisplayModelsFromIndexedDB:n,getDisplayModel:r,addDisplayModel:a,renameDisplayModel:o,removeDisplayModel:s,resetDisplayModels:l}});var $c={"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`,"es-ES":`es`,"es-MX":`es`,"es-AR":`es`,es:`es`,ru:`ru`,"ru-RU":`ru`,fr:`fr`,"fr-FR":`fr`};const el=220.44;var tl=g(`oklch`),nl=e=>e?tl(e)?.h:el;const rl=l(`settings`,()=>{let e=Qc(),[t,n]=d(`settings/language`,``),[r,a]=d(`settings/stage/model`,`preset-live2d-1`),[o,s]=u(void 0),[c,l]=u(void 0),[f,p]=u(void 0);async function h(){if(!r.value){c.value=void 0,o.value=void 0,f.value=`disabled`;return}let t=await e.getDisplayModel(r.value);if(!t){c.value=void 0,o.value=void 0,f.value=`disabled`;return}switch(t.format){case Uc.Live2dZip:f.value=`live2d`;break;case Uc.VRM:f.value=`vrm`;break;default:f.value=`disabled`;break}t.type===`file`?(c.value&&URL.revokeObjectURL(c.value),c.value=URL.createObjectURL(t.file)):c.value=t.url,o.value=t}async function g(){await h()}m(`unload`,()=>{c.value&&URL.revokeObjectURL(c.value)});let[_,v]=u(!1),[y,b]=d(`settings/live2d/disable-focus`,!1),[x,S]=d(`settings/live2d/idle-animation-enabled`,!0),[C,w]=d(`settings/live2d/auto-blink-enabled`,!0),[T,E]=d(`settings/live2d/shadow-enabled`,!0),[D,O]=d(`settings/disable-transitions`,!0),[k,A]=d(`settings/use-page-specific-transitions`,!0),[j,M]=d(`settings/theme/colors/hue`,el),[N,P]=d(`settings/theme/colors/hue-dynamic`,!1),[F,I]=d(`settings/allow-visible-on-all-workspaces`,!0);function L(){let e=localStorage.getItem(`settings/language`);e||=navigator.language||`en`;let t=Object.keys(be);return $c[e||`en`]!=null&&(e=$c[e||`en`]),e&&t.includes(e)?e:`en`}function R(e=el){j.value=e,N.value=!1}function z(e){R(nl(e))}function B(e){if(N.value)return!1;let t=nl(e);if(!t)return!1;let n=Math.abs(t-j.value);return n<.01||n>359.99}async function ee(){c.value&&URL.revokeObjectURL(c.value),n(),a(),s(),l(),p(),v(),b(),S(),w(),E(),O(),A(),M(),P(),I(),await h()}return i(()=>t.value=L()),{disableTransitions:D,usePageSpecificTransitions:k,language:t,stageModelRenderer:f,stageModelSelected:r,stageModelSelectedUrl:c,stageModelSelectedDisplayModel:o,stageViewControlsEnabled:_,live2dDisableFocus:y,live2dIdleAnimationEnabled:x,live2dAutoBlinkEnabled:C,live2dShadowEnabled:T,themeColorsHue:j,themeColorsHueDynamic:N,allowVisibleOnAllWorkspaces:F,setThemeColorsHue:R,applyPrimaryColorFrom:z,isColorSelectedForPrimary:B,initializeStageModel:g,updateStageModel:h,resetState:ee}}),il=l(`settings-audio-devices`,()=>{let{audioInputs:e,deviceConstraints:t,selectedAudioInput:n,startStream:r,stopStream:o,stream:s,askPermission:c}=S(),[l,u]=d(`settings/audio/input`,n.value),[f,p]=d(`settings/audio/input/enabled`,!1);a(l,e=>{n.value=e}),a(f,e=>{e?r():o()}),i(()=>{f.value&&l.value&&r(),n.value&&!f.value&&(l.value=n.value)});function m(){u(),n.value=``,p(),o()}return{audioInputs:e,deviceConstraints:t,selectedAudioInput:l,enabled:f,stream:s,askPermission:c,startStream:r,stopStream:o,resetState:m}});export{Ne as C,x as D,be as E,C as O,V as S,ke as T,en as _,Qc as a,Dt as b,Us as c,Wn as d,ea as f,$t as g,on as h,Uc as i,Ca as l,cn as m,rl as n,$ as o,rn as p,il as r,yc as s,el as t,oi as u,Yt as v,je as w,G as x,Tt as y}; \ No newline at end of file +\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){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){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){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){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){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){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){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){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){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){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){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{n(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){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){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){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){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 I(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,F(e.strm)}function L(e,t){e.pending_buf[e.pending++]=t}function R(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function z(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 B(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(B(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,I(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-T&&(I(e,!1),e.strm.avail_out===0))return O}return e.insert=0,t===u?(I(e,!0),e.strm.avail_out===0?A:j):(e.strstart>e.block_start&&(I(e,!1),e.strm.avail_out),O)}),new ne(4,4,8,4,ee),new ne(4,5,16,8,ee),new ne(4,6,32,32,ee),new ne(4,4,16,16,te),new ne(8,16,32,32,te),new ne(8,16,128,128,te),new ne(8,32,128,256,te),new ne(32,128,258,1024,te),new ne(32,258,258,4096,te)],n.deflateInit=function(e,t){return oe(e,t,g,15,8,0)},n.deflateInit2=oe,n.deflateReset=ae,n.deflateResetKeep=ie,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),L(i,i.gzhead.time>>16&255),L(i,i.gzhead.time>>24&255),L(i,i.level===9?2:2<=i.strategy||i.level<2?4:0),L(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(L(i,255&i.gzhead.extra.length),L(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):(L(i,0),L(i,0),L(i,0),L(i,0),L(i,0),L(i,i.level===9?2:2<=i.strategy||i.level<2?4:0),L(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,R(i,p),i.strstart!==0&&(R(i,e.adler>>>16),R(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)),F(e),o=i.pending,i.pending!==i.pending_buf_size));)L(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)),F(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)),F(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&&F(e),i.pending+2<=i.pending_buf_size&&(L(i,255&e.adler),L(i,e.adler>>8&255),e.adler=0,i.status=D)):i.status=D),i.pending!==0){if(F(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&&(B(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&&(I(e,!1),e.strm.avail_out===0))return O}return e.insert=0,t===u?(I(e,!0),e.strm.avail_out===0?A:j):e.last_lit&&(I(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(B(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&&(I(e,!1),e.strm.avail_out===0))return O}return e.insert=0,t===u?(I(e,!0),e.strm.avail_out===0?A:j):e.last_lit&&(I(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&&(P(i.head),i.lookahead===0&&(i.strstart=0,i.block_start=0,i.insert=0))),F(e),e.avail_out===0))return i.last_flush=-1,d}return t===u?i.wrap<=0?1:(i.wrap===2?(L(i,255&e.adler),L(i,e.adler>>8&255),L(i,e.adler>>16&255),L(i,e.adler>>24&255),L(i,255&e.total_in),L(i,e.total_in>>8&255),L(i,e.total_in>>16&255),L(i,e.total_in>>24&255)):(R(i,e.adler>>>16),R(i,65535&e.adler)),F(e),0=n.w_size&&(s===0&&(P(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,B(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,B,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,F=8+(15&(b>>>=4)),n.wbits===0)n.wbits=F;else if(F>n.wbits){e.msg=`invalid window size`,n.mode=30;break}n.dmax=1<>8&1),512&n.flags&&(B[0]=255&b,B[1]=b>>>8&255,n.check=a(n.check,B,2,0)),x=b=0,n.mode=3;case 3:for(;x<32;){if(v===0)break e;v--,b+=p[g++]<>>8&255,B[2]=b>>>16&255,B[3]=b>>>24&255,n.check=a(n.check,B,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&&(B[0]=255&b,B[1]=b>>>8&255,n.check=a(n.check,B,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,B,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&&(F=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,F)),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;F=p[g+ E++],n.head&&F&&n.length<65536&&(n.head.name+=String.fromCharCode(F)),F&&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[ee[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,L={bits:n.lenbits},I=s(0,n.lens,0,19,n.lencode,0,n.work,L),n.lenbits=L.bits,I){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&z,!((k=z>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>>=k,x-=k,n.lens[n.have++]=j;else{if(j===16){for(R=k+2;x>>=k,x-=k,n.have===0){e.msg=`invalid bit length repeat`,n.mode=30;break}F=n.lens[n.have-1],E=3+(3&b),b>>>=2,x-=2}else if(j===17){for(R=k+3;x>>=k)),b>>>=3,x-=3}else{for(R=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++]=F}}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,L={bits:n.lenbits},I=s(c,n.lens,0,n.nlen,n.lencode,0,n.work,L),n.lenbits=L.bits,I){e.msg=`invalid literal/lengths set`,n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,L={bits:n.distbits},I=s(l,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,L),n.distbits=L.bits,I){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=(z=n.lencode[b&(1<>>16&255,j=65535&z,!((k=z>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>M)])>>>16&255,j=65535&z,!(M+(k=z>>>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(R=n.extra;x>>=n.extra,x-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;A=(z=n.distcode[b&(1<>>16&255,j=65535&z,!((k=z>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<>M)])>>>16&255,j=65535&z,!(M+(k=z>>>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(R=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=L[R+d[w]],N[P+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++,--F[C]==0){if(C===E)break;C=t[n+d[w]]}if(D>>7)]}function L(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function R(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 ee(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]=B(a[s]++,s))}}function te(e){var t;for(t=0;t>1;1<=n;n--)ie(e,a,n);for(i=c;n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],ie(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++,ie(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?ue(e,t,n,r):e.strategy===4||s===o?(R(e,2+(r?1:0),3),ae(e,T,E)):(R(e,4+(r?1:0),3),function(e,t,n,r){var i;for(R(e,t-257,5),R(e,n-1,5),R(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*I(t)]++),e.last_lit===e.lit_bufsize-1},n._tr_align=function(e){R(e,2,3),z(e,_,T),function(e){e.bi_valid===16?(L(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){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){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)})}))(),1);Cc.zipReader=(e,t)=>Pc.default.loadAsync(e);var Fc=Cc.createSettings;Cc.createSettings=async e=>{let t=Object.keys(e.files);return t.find(e=>Ic(e))?Fc(e):zc(t)};function Ic(e){return e.endsWith(`model3.json`)}function Lc(e){return e.endsWith(`.moc3`)}function Rc(e){return e.split(/[\\/]/).pop()}function zc(e){let t=e.filter(e=>Lc(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=Rc(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 Tc({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}Cc.readText=(e,t)=>{let n=e.file(t);if(!n)throw Error(`Cannot find file: ${t}`);return n.async(`text`)},Cc.getFilePaths=e=>{let t=[];return e.forEach(e=>t.push(e)),Promise.resolve(t)},Cc.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 Bc=class e{static async readDirectoryRecursive(t,n){let r=[];for await(let i of t.values())if(i.kind===`file`){let e=await i.getFile();if(e.name===`__meta.json`)continue;Object.defineProperty(e,`webkitRelativePath`,{value:n+e.name}),r.push(e)}else if(i.kind===`directory`){let t=`${n+i.name}/`,a=await e.readDirectoryRecursive(i,t);r.push(...a)}return r}static async resolveDirectory(e,t){let n=e;if(!t||t===`.`||t===`./`)return n;let r=t.split(`/`).filter(e=>e&&e!==`.`);for(let e of r)n=await n.getDirectoryHandle(e,{create:!0});return n}static async writeFile(t,n,r){let i=n.split(`/`),a=i.pop(),o=i.join(`/`),s=await(await(await e.resolveDirectory(t,o)).getFileHandle(a,{create:!0})).createWritable();await s.write(r),await s.close()}static async readMeta(e){try{let t=await(await(await e.getFileHandle(`__meta.json`,{create:!1})).getFile()).text();return JSON.parse(t)}catch{return null}}static async get(t,n){try{let r=await(await navigator.storage.getDirectory()).getDirectoryHandle(t,{create:!1});console.debug(`[OPFS] Cache hit for ${t}`);let i=await e.readMeta(r);if(i?.sourceUrl&&i.sourceUrl!==n)return console.debug(`[OPFS] Cache mismatch for ${t}, source url changed`),null;let a=await e.readDirectoryRecursive(r,``);if(a.length>0)return a}catch{}return null}static async save(t,n,r){console.debug(`[OPFS] Saving ${n.length} files to ${t}`);try{let i=await(await navigator.storage.getDirectory()).getDirectoryHandle(t,{create:!0}),a=[];for(let t of n){let n=t.webkitRelativePath||t.name;a.push(e.writeFile(i,n,t))}if(!n.find(e=>e.name.endsWith(`model.json`)||e.name.endsWith(`model3.json`))){let t=n.settings;if(t){console.debug(`[OPFS] Reconstructing settings file...`);let n=JSON.stringify(t.json),r=t.url||`model.model3.json`;a.push(e.writeFile(i,r,n))}}await Promise.all(a),r&&await e.writeFile(i,`__meta.json`,JSON.stringify({sourceUrl:r})),console.debug(`[OPFS] Saved to cache`)}catch(e){console.error(`[OPFS] Failed to save to cache:`,e)}}static checkMiddleware=async(t,n)=>{let r=t.source,i,a;if(typeof r==`object`&&r&&`id`in r&&`url`in r)i=r.id,a=r.url;else return n();if(!i||!a||!a.startsWith(`blob:`)&&!a.endsWith(`.zip`))return t.source=a,n();let o=await e.get(i,a);if(o)return t.source=o,n();console.debug(`[OPFS] Cache miss for ${i}`),t.opfsKey=i,t.opfsUrl=a;try{let e=await(await fetch(a)).blob(),n=`${i}.zip`;t.source=[new File([e],n)]}catch(e){throw console.error(`[OPFS] Failed to fetch blob for ${i}`,e),e}return n()};static saveMiddleware=async(t,n)=>{if(!t.opfsKey||!Array.isArray(t.source))return n();let r=t.source;return r.length===0||!(r[0]instanceof File)||await e.save(t.opfsKey,r,t.opfsUrl),n()}},Vc=$.live2DModelMiddlewares.indexOf(Cc.factory);$.live2DModelMiddlewares.includes(Bc.checkMiddleware)||(Vc===-1?console.warn(`[OPFS] ZipLoader not found in middlewares, caching disabled`):($.live2DModelMiddlewares.splice(Vc,0,Bc.checkMiddleware),$.live2DModelMiddlewares.splice(Vc+2,0,Bc.saveMiddleware)));var Hc=t(Se(),1);let Uc=function(e){return e.Live2dZip=`live2d-zip`,e.Live2dDirectory=`live2d-directory`,e.VRM=`vrm`,e.PMXZip=`pmx-zip`,e.PMXDirectory=`pmx-directory`,e.PMD=`pmd`,e}({});var Wc=new URL(`/assets/hiyori_pro_zh-BOkrWUw6.zip`,``+import.meta.url).href,Gc=new URL(`/assets/hiyori_free_zh-D9UJNK98.zip`,``+import.meta.url).href,Kc=new URL(`/assets/preview-BifEn9T1.png`,``+import.meta.url).href,qc=new URL(`/assets/AvatarSample_A-BNRNjuVT.vrm`,``+import.meta.url).href,Jc=new URL(`/assets/preview-BFkGxoPo.png`,``+import.meta.url).href,Yc=new URL(`/assets/AvatarSample_B-Cgr_Y5fe.vrm`,``+import.meta.url).href,Xc=new URL(`/assets/preview-Bbc27ubS.png`,``+import.meta.url).href,Zc=[{id:`preset-live2d-1`,format:Uc.Live2dZip,type:`url`,url:Wc,name:`Hiyori (Pro)`,previewImage:Kc,importedAt:1733113886840},{id:`preset-live2d-2`,format:Uc.Live2dZip,type:`url`,url:Gc,name:`Hiyori (Free)`,previewImage:Kc,importedAt:1733113886840},{id:`preset-vrm-1`,format:Uc.VRM,type:`url`,url:qc,name:`AvatarSample_A`,previewImage:Jc,importedAt:1733113886840},{id:`preset-vrm-2`,format:Uc.VRM,type:`url`,url:Yc,name:`AvatarSample_B`,previewImage:Xc,importedAt:1733113886840}];const Qc=l(`display-models`,()=>{let e=c([]),t=c(!1);async function n(){await f(t).toBe(!1),t.value=!0;let n=[...Zc];try{await Hc.default.iterate((e,t)=>{t.startsWith(`display-model-`)&&n.push({id:t,format:e.format,type:`file`,file:e.file,name:e.file.name,importedAt:e.importedAt,previewImage:e.previewImage})})}catch(e){console.error(e)}e.value=n.sort((e,t)=>t.importedAt-e.importedAt),t.value=!1}async function r(e){return await f(t).toBe(!1),await Hc.default.getItem(e)||Zc.find(t=>t.id===e)}async function i(e){yc.registerTicker($t),Yt.add(en);let t=document.createElement(`canvas`);t.width=720,t.height=1280,t.style.position=`absolute`,t.style.top=`0`,t.style.left=`0`,t.style.objectFit=`cover`,t.style.display=`block`,t.style.zIndex=`10000000000`,t.style.opacity=`0`,document.body.appendChild(t);let n=new Ca({view:t,preserveDrawingBuffer:!0,backgroundAlpha:0,resizeTo:window}),r=new yc,i=URL.createObjectURL(e),a=await(await fetch(i)).blob();try{await $.setupLive2DModel(r,[new File([a],e.name)],{autoInteract:!1})}catch(e){n.destroy(),document.body.removeChild(t),URL.revokeObjectURL(i),console.error(e);return}n.stage.addChild(r),r.x=275,r.y=450,r.width=t.width,r.height=t.height,r.scale.set(.1,.1),r.anchor.set(.5,.5),await new Promise(e=>setTimeout(e,500)),n.renderer.render(n.stage);let o=xe(t),s=document.createElement(`canvas`);s.width=o.width>o.height/16*12?o.width:o.height/16*12,s.height=s.width/12*16,s.getContext(`2d`).drawImage(o,(s.width-o.width)/2,(s.height-o.height)/2,o.width,o.height);let c=s.toDataURL();return n.destroy(),document.body.removeChild(t),URL.revokeObjectURL(i),c}async function a(n,r){await f(t).toBe(!1);let a={id:`display-model-${_()}`,format:n,type:`file`,file:r,name:r.name,importedAt:Date.now()};if(n===Uc.Live2dZip){let e=await i(r);if(!e)return;a.previewImage=e}e.value.unshift(a),Hc.default.setItem(a.id,a).catch(e=>console.error(e))}async function o(e,n){await f(t).toBe(!1);let r=await Hc.default.getItem(e);r&&(r.name=n)}async function s(n){await f(t).toBe(!1),await Hc.default.removeItem(n),e.value=e.value.filter(e=>e.id!==n)}async function l(){await n();let t=e.value.filter(e=>e.type===`file`).map(e=>e.id);for(let e of t)await s(e);e.value=[...Zc].sort((e,t)=>t.importedAt-e.importedAt)}return{displayModels:e,displayModelsFromIndexedDBLoading:t,loadDisplayModelsFromIndexedDB:n,getDisplayModel:r,addDisplayModel:a,renameDisplayModel:o,removeDisplayModel:s,resetDisplayModels:l}});var $c={"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`,"es-ES":`es`,"es-MX":`es`,"es-AR":`es`,es:`es`,ru:`ru`,"ru-RU":`ru`,fr:`fr`,"fr-FR":`fr`};const el=220.44;var tl=g(`oklch`),nl=e=>e?tl(e)?.h:el;const rl=l(`settings`,()=>{let e=Qc(),[t,n]=d(`settings/language`,``),[r,a]=d(`settings/stage/model`,`preset-live2d-1`),[o,s]=u(void 0),[c,l]=u(void 0),[f,p]=u(void 0);async function h(){if(!r.value){c.value=void 0,o.value=void 0,f.value=`disabled`;return}let t=await e.getDisplayModel(r.value);if(!t){c.value=void 0,o.value=void 0,f.value=`disabled`;return}switch(t.format){case Uc.Live2dZip:f.value=`live2d`;break;case Uc.VRM:f.value=`vrm`;break;default:f.value=`disabled`;break}t.type===`file`?(c.value&&URL.revokeObjectURL(c.value),c.value=URL.createObjectURL(t.file)):c.value=t.url,o.value=t}async function g(){await h()}m(`unload`,()=>{c.value&&URL.revokeObjectURL(c.value)});let[_,v]=u(!1),[y,b]=d(`settings/live2d/disable-focus`,!1),[x,S]=d(`settings/live2d/idle-animation-enabled`,!0),[C,w]=d(`settings/live2d/auto-blink-enabled`,!0),[T,E]=d(`settings/live2d/shadow-enabled`,!0),[D,O]=d(`settings/disable-transitions`,!0),[k,A]=d(`settings/use-page-specific-transitions`,!0),[j,M]=d(`settings/theme/colors/hue`,el),[N,P]=d(`settings/theme/colors/hue-dynamic`,!1),[F,I]=d(`settings/allow-visible-on-all-workspaces`,!0);function L(){let e=localStorage.getItem(`settings/language`);e||=navigator.language||`en`;let t=Object.keys(be);return $c[e||`en`]!=null&&(e=$c[e||`en`]),e&&t.includes(e)?e:`en`}function R(e=el){j.value=e,N.value=!1}function z(e){R(nl(e))}function B(e){if(N.value)return!1;let t=nl(e);if(!t)return!1;let n=Math.abs(t-j.value);return n<.01||n>359.99}async function ee(){c.value&&URL.revokeObjectURL(c.value),n(),a(),s(),l(),p(),v(),b(),S(),w(),E(),O(),A(),M(),P(),I(),await h()}return i(()=>t.value=L()),{disableTransitions:D,usePageSpecificTransitions:k,language:t,stageModelRenderer:f,stageModelSelected:r,stageModelSelectedUrl:c,stageModelSelectedDisplayModel:o,stageViewControlsEnabled:_,live2dDisableFocus:y,live2dIdleAnimationEnabled:x,live2dAutoBlinkEnabled:C,live2dShadowEnabled:T,themeColorsHue:j,themeColorsHueDynamic:N,allowVisibleOnAllWorkspaces:F,setThemeColorsHue:R,applyPrimaryColorFrom:z,isColorSelectedForPrimary:B,initializeStageModel:g,updateStageModel:h,resetState:ee}}),il=l(`settings-audio-devices`,()=>{let{audioInputs:e,deviceConstraints:t,selectedAudioInput:n,startStream:r,stopStream:o,stream:s,askPermission:c}=S(),[l,u]=d(`settings/audio/input`,n.value),[f,p]=d(`settings/audio/input/enabled`,!1);a(l,e=>{n.value=e}),a(f,e=>{e?r():o()}),i(()=>{f.value&&l.value&&r(),n.value&&!f.value&&(l.value=n.value)});function m(){u(),n.value=``,p(),o()}return{audioInputs:e,deviceConstraints:t,selectedAudioInput:l,enabled:f,stream:s,askPermission:c,startStream:r,stopStream:o,resetState:m}});export{Ne as C,x as D,be as E,C as O,V as S,ke as T,en as _,Qc as a,Dt as b,Us as c,Wn as d,ea as f,$t as g,on as h,Uc as i,Ca as l,cn as m,rl as n,$ as o,rn as p,il as r,yc as s,el as t,oi as u,Yt as v,je as w,G as x,Tt as y}; \ No newline at end of file diff --git a/assets/settings-B7G0W455.js b/assets/settings-DinwczH5.js similarity index 93% rename from assets/settings-B7G0W455.js rename to assets/settings-DinwczH5.js index 78f8298d92c5bff4365711660323fbf59b02a706..671c378a09b86fe160596abc12cbec300aa72828 100644 --- a/assets/settings-B7G0W455.js +++ b/assets/settings-DinwczH5.js @@ -1 +1 @@ -import{A as e,K as t,Z as n,b as r,k as i,kt as a,lt as o,ut as s,w as c,x as l,xt as u}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-CZ9Rvki9.js";import"./src-DYQXbDgu.js";import"./resettable-CbXzRviW.js";import{o as d}from"./vue-router-Chhv6vZu.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{vt as f,yt as p}from"./components-BR_Kqwtu.js";import"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import{n as m}from"./vue-i18n.runtime-Dah5zGm4.js";import"./stream-transcription-_Xuw_VzN.js";import{n as h}from"./settings-D1kLcsvA.js";import"./__vite-browser-external-BaycPy5b.js";import{t as g}from"./route-block-CpjdOEnv.js";import{t as _}from"./use-ripple-grid-state-DcESPJAf.js";var v={flex:`~ col gap-4`,"font-normal":``},y={"pb-12":``},b={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":``},x={text:`60`,"i-solar:settings-bold-duotone":``},S=e({__name:`index`,setup(e){let g=d(),S=u(),{t:C}=m(),{lastClickedIndex:w,setLastClickedIndex:T}=_(),E=h(),D=g.beforeEach(async(e,t,n)=>{if(!E.usePageSpecificTransitions||E.disableTransitions){n();return}await new Promise(e=>{S.value=e}),D(),n()}),O=r(()=>[{title:C(`settings.pages.card.title`),description:C(`settings.pages.card.description`),icon:`i-solar:emoji-funny-square-bold-duotone`,to:`/settings/airi-card`},{title:C(`settings.pages.modules.title`),description:C(`settings.pages.modules.description`),icon:`i-solar:layers-bold-duotone`,to:`/settings/modules`},{title:C(`settings.pages.scene.title`),description:C(`settings.pages.scene.description`),icon:`i-solar:armchair-2-bold-duotone`,to:`/settings/scene`},{title:C(`settings.pages.models.title`),description:C(`settings.pages.models.description`),icon:`i-solar:people-nearby-bold-duotone`,to:`/settings/models`},{title:C(`settings.pages.memory.title`),description:C(`settings.pages.memory.description`),icon:`i-solar:leaf-bold-duotone`,to:`/settings/memory`},{title:C(`settings.pages.providers.title`),description:C(`settings.pages.providers.description`),icon:`i-solar:box-minimalistic-bold-duotone`,to:`/settings/providers`},{title:C(`settings.pages.data.title`),description:C(`settings.pages.data.description`),icon:`i-solar:database-bold-duotone`,to:`/settings/data`},{title:C(`settings.pages.system.title`),description:C(`settings.pages.system.description`),icon:`i-solar:filters-bold-duotone`,to:`/settings/system`}]);return(e,r)=>{let u=n(`motion`);return t(),c(`div`,v,[l(`div`,y,[i(a(p),{items:O.value,"get-key":e=>e.to,columns:1,"origin-index":a(w),onItemClick:r[0]||=({globalIndex:e})=>a(T)(e)},{item:o(({item:e})=>[i(a(f),{title:e.title,description:e.description,icon:e.icon,to:e.to},null,8,[`title`,`description`,`icon`,`to`])]),_:1},8,[`items`,`get-key`,`origin-index`])]),s((t(),c(`div`,b,[s(l(`div`,x,null,512),[[u]])])),[[u]])])}}});typeof g==`function`&&g(S);var C=S;export{C as default}; \ No newline at end of file +import{A as e,K as t,Z as n,b as r,k as i,kt as a,lt as o,ut as s,w as c,x as l,xt as u}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-C0YByt49.js";import"./src-DYQXbDgu.js";import"./resettable-CbXzRviW.js";import{o as d}from"./vue-router-Chhv6vZu.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{vt as f,yt as p}from"./components-CeE-UiLT.js";import"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import{n as m}from"./vue-i18n.runtime-Dah5zGm4.js";import"./stream-transcription-_Xuw_VzN.js";import{n as h}from"./settings-73vyHOZs.js";import"./__vite-browser-external-BaycPy5b.js";import{t as g}from"./route-block-CpjdOEnv.js";import{t as _}from"./use-ripple-grid-state-DcESPJAf.js";var v={flex:`~ col gap-4`,"font-normal":``},y={"pb-12":``},b={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":``},x={text:`60`,"i-solar:settings-bold-duotone":``},S=e({__name:`index`,setup(e){let g=d(),S=u(),{t:C}=m(),{lastClickedIndex:w,setLastClickedIndex:T}=_(),E=h(),D=g.beforeEach(async(e,t,n)=>{if(!E.usePageSpecificTransitions||E.disableTransitions){n();return}await new Promise(e=>{S.value=e}),D(),n()}),O=r(()=>[{title:C(`settings.pages.card.title`),description:C(`settings.pages.card.description`),icon:`i-solar:emoji-funny-square-bold-duotone`,to:`/settings/airi-card`},{title:C(`settings.pages.modules.title`),description:C(`settings.pages.modules.description`),icon:`i-solar:layers-bold-duotone`,to:`/settings/modules`},{title:C(`settings.pages.scene.title`),description:C(`settings.pages.scene.description`),icon:`i-solar:armchair-2-bold-duotone`,to:`/settings/scene`},{title:C(`settings.pages.models.title`),description:C(`settings.pages.models.description`),icon:`i-solar:people-nearby-bold-duotone`,to:`/settings/models`},{title:C(`settings.pages.memory.title`),description:C(`settings.pages.memory.description`),icon:`i-solar:leaf-bold-duotone`,to:`/settings/memory`},{title:C(`settings.pages.providers.title`),description:C(`settings.pages.providers.description`),icon:`i-solar:box-minimalistic-bold-duotone`,to:`/settings/providers`},{title:C(`settings.pages.data.title`),description:C(`settings.pages.data.description`),icon:`i-solar:database-bold-duotone`,to:`/settings/data`},{title:C(`settings.pages.system.title`),description:C(`settings.pages.system.description`),icon:`i-solar:filters-bold-duotone`,to:`/settings/system`}]);return(e,r)=>{let u=n(`motion`);return t(),c(`div`,v,[l(`div`,y,[i(a(p),{items:O.value,"get-key":e=>e.to,columns:1,"origin-index":a(w),onItemClick:r[0]||=({globalIndex:e})=>a(T)(e)},{item:o(({item:e})=>[i(a(f),{title:e.title,description:e.description,icon:e.icon,to:e.to},null,8,[`title`,`description`,`icon`,`to`])]),_:1},8,[`items`,`get-key`,`origin-index`])]),s((t(),c(`div`,b,[s(l(`div`,x,null,512),[[u]])])),[[u]])])}}});typeof g==`function`&&g(S);var C=S;export{C as default}; \ No newline at end of file diff --git a/assets/settings-C2pLQvYa.js b/assets/settings-HCl6bqsC.js similarity index 95% rename from assets/settings-C2pLQvYa.js rename to assets/settings-HCl6bqsC.js index c33846257bbb151f4a9d143f565968ac2f32b10a..6c254801724a5ae01d5652a6da4944dfc577fed6 100644 --- a/assets/settings-C2pLQvYa.js +++ b/assets/settings-HCl6bqsC.js @@ -1 +1 @@ -import{A as e,K as t,W as n,at as r,b as i,k as a,kt as o,w as s,x as c}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import{l}from"./widgets-CZ9Rvki9.js";import{t as u}from"./src-DYQXbDgu.js";import{a as d}from"./resettable-CbXzRviW.js";import{a as f,n as p}from"./vue-router-Chhv6vZu.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import"./components-BR_Kqwtu.js";import{i as m}from"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import{n as h}from"./vue-i18n.runtime-Dah5zGm4.js";import{n as g,r as _}from"./theme-color-CCXuu6C1.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-D1kLcsvA.js";import"./__vite-browser-external-BaycPy5b.js";import{t as v}from"./HeaderLink-CNK9co0e.js";var 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:`max-h-[calc(100%-40px)] px-3 py-0 sm:max-h-[calc(100%-56px)] 2xl:max-w-screen-2xl md:py-0 xl:px-4`,flex:`~ col`,"mx-auto":``},S=e({__name:`settings`,setup(e){let S=f(),{isDark:C}=u(),{t:w}=h(),{allProvidersMetadata:T}=d(m()),E=i(()=>{let e={"/settings/airi-card":{subtitle:w(`settings.title`),title:w(`settings.pages.card.title`)},"/settings/system":{subtitle:w(`settings.title`),title:w(`settings.pages.system.title`)},"/settings/system/general":{subtitle:w(`settings.title`),title:w(`settings.pages.system.general.title`)},"/settings/system/color-scheme":{subtitle:w(`settings.title`),title:w(`settings.pages.system.color-scheme.title`)},"/settings/system/developer":{subtitle:w(`settings.title`),title:w(`settings.pages.system.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/vision":{subtitle:w(`settings.title`),title:w(`settings.pages.modules.vision.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/data":{subtitle:w(`settings.title`),title:w(`settings.pages.data.title`)},"/settings/scene":{subtitle:w(`settings.title`),title:w(`settings.pages.scene.title`)},"/settings":{title:w(`settings.title`)}};for(let t of T.value)e[`/settings/providers/${t.category}/${t.id}`]={subtitle:w(`settings.title`),title:w(t.nameKey)};return e}),D=i(()=>E.value[S.path]),{updateThemeColor:O}=_(g({light:`rgb(255 255 255)`,dark:`rgb(18 18 18)`}));return r(C,()=>O(),{immediate:!0}),r(S,()=>O(),{immediate:!0}),n(()=>O()),(e,n)=>(t(),s(`div`,y,[c(`div`,b,[a(v)]),c(`div`,x,[a(o(l),{title:D.value?.title,subtitle:D.value?.subtitle},null,8,[`title`,`subtitle`]),a(o(p))])]))}});export{S as default}; \ No newline at end of file +import{A as e,K as t,W as n,at as r,b as i,k as a,kt as o,w as s,x as c}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import{l}from"./widgets-C0YByt49.js";import{t as u}from"./src-DYQXbDgu.js";import{a as d}from"./resettable-CbXzRviW.js";import{a as f,n as p}from"./vue-router-Chhv6vZu.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import"./components-CeE-UiLT.js";import{i as m}from"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import{n as h}from"./vue-i18n.runtime-Dah5zGm4.js";import{n as g,r as _}from"./theme-color-CCXuu6C1.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-73vyHOZs.js";import"./__vite-browser-external-BaycPy5b.js";import{t as v}from"./HeaderLink-CNK9co0e.js";var 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:`max-h-[calc(100%-40px)] px-3 py-0 sm:max-h-[calc(100%-56px)] 2xl:max-w-screen-2xl md:py-0 xl:px-4`,flex:`~ col`,"mx-auto":``},S=e({__name:`settings`,setup(e){let S=f(),{isDark:C}=u(),{t:w}=h(),{allProvidersMetadata:T}=d(m()),E=i(()=>{let e={"/settings/airi-card":{subtitle:w(`settings.title`),title:w(`settings.pages.card.title`)},"/settings/system":{subtitle:w(`settings.title`),title:w(`settings.pages.system.title`)},"/settings/system/general":{subtitle:w(`settings.title`),title:w(`settings.pages.system.general.title`)},"/settings/system/color-scheme":{subtitle:w(`settings.title`),title:w(`settings.pages.system.color-scheme.title`)},"/settings/system/developer":{subtitle:w(`settings.title`),title:w(`settings.pages.system.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/vision":{subtitle:w(`settings.title`),title:w(`settings.pages.modules.vision.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/data":{subtitle:w(`settings.title`),title:w(`settings.pages.data.title`)},"/settings/scene":{subtitle:w(`settings.title`),title:w(`settings.pages.scene.title`)},"/settings":{title:w(`settings.title`)}};for(let t of T.value)e[`/settings/providers/${t.category}/${t.id}`]={subtitle:w(`settings.title`),title:w(t.nameKey)};return e}),D=i(()=>E.value[S.path]),{updateThemeColor:O}=_(g({light:`rgb(255 255 255)`,dark:`rgb(18 18 18)`}));return r(C,()=>O(),{immediate:!0}),r(S,()=>O(),{immediate:!0}),n(()=>O()),(e,n)=>(t(),s(`div`,y,[c(`div`,b,[a(v)]),c(`div`,x,[a(o(l),{title:D.value?.title,subtitle:D.value?.subtitle},null,8,[`title`,`subtitle`]),a(o(p))])]))}});export{S as default}; \ No newline at end of file diff --git a/assets/speech-DH-rHMWX.js b/assets/speech-DYSGLno_.js similarity index 98% rename from assets/speech-DH-rHMWX.js rename to assets/speech-DYSGLno_.js index c51e871863525a2c071ed65d925244d806d55122..1496f759a84edd7cf737520896be0053eef6013e 100644 --- a/assets/speech-DH-rHMWX.js +++ b/assets/speech-DYSGLno_.js @@ -1 +1 @@ -import{A as e,C as t,G as n,J as r,K as i,O as a,Pt as o,S as s,W as c,Z as ee,at as te,c as ne,gt as l,jt as u,k as d,kt as f,l as re,lt as p,m,nt as h,ut as g,w as _,x as v,xt as y}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-CZ9Rvki9.js";import{d as ie,l as ae,p as b}from"./src-DYQXbDgu.js";import{a as x}from"./resettable-CbXzRviW.js";import{t as S}from"./vue-router-Chhv6vZu.js";import"./environment-CyZLTg97.js";import{t as C}from"./Basic-EclD3L6X.js";import"./src-C83SCWbW.js";import{Ct as oe,dt as w,gt as T,ht as se,mt as ce,pt as le,ut as E}from"./components-BR_Kqwtu.js";import{i as ue,n as de,t as fe}from"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import{n as pe}from"./vue-i18n.runtime-Dah5zGm4.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-D1kLcsvA.js";import"./__vite-browser-external-BaycPy5b.js";import{t as D}from"./route-block-CpjdOEnv.js";var me=e({__name:`Textarea`,props:{modelValue:{default:``},modelModifiers:{}},emits:[`update:modelValue`],setup(e){let t=h(e,`modelValue`);return(e,n)=>(i(),s(C,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:u([`focus:border-primary-300 dark:focus:border-primary-400/50 border-2 border-solid border-neutral-100 dark:border-neutral-900`,`transition-all duration-200 ease-in-out`,`text-disabled:neutral-400 dark:text-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-50 dark:bg-neutral-950 focus:bg-neutral-50 dark:focus:bg-neutral-900`])},null,8,[`modelValue`]))}}),he={flex:`~ col md:row gap-6`},ge={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%]`},_e={flex:`~ col gap-4`},ve={class:`text-lg text-neutral-500 md:text-2xl dark:text-neutral-400`},ye={text:`neutral-400 dark:neutral-500`},be={"max-w-full":``},xe={key:0,flex:`~ row gap-4`,style:{"scrollbar-width":`none`},"min-w-0":``,"of-x-scroll":``,"scroll-smooth":``,role:`radiogroup`},Se={key:1},Ce={key:0},we={flex:`~ col gap-4`},O={class:`text-lg md:text-2xl`},k={text:`neutral-400 dark:neutral-400`},Te={key:0,class:`flex items-center justify-center py-4`},Ee={key:0},De={flex:`~ col gap-4`},Oe={key:0},ke={class:`flex flex-col gap-4`},Ae={flex:`~ row gap-4`},je={key:1,class:`space-y-6`},Me={flex:`~ col gap-4`},Ne={key:4,class:`mt-2 space-y-6`},Pe={key:0},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":``},A={class:`inline-flex items-center gap-4`},Re={flex:`~ col gap-4`},ze={flex:`~ row`,"gap-4":``},Be=[`disabled`],Ve={flex:`~ row`,"items-center":``,"gap-2":``},He=[`src`],Ue={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":``},j=e({__name:`speech`,setup(e){let{t:h}=pe(),C=ue(),D=fe(),{configuredSpeechProvidersMetadata:j}=x(C),{activeSpeechProvider:M,activeSpeechModel:N,activeSpeechVoice:P,activeSpeechVoiceId:F,pitch:I,isLoadingSpeechProviderVoices:We,supportsModelListing:Ge,providerModels:L,isLoadingActiveProviderModels:R,activeProviderModelError:z,modelSearchQuery:B,speechProviderError:V,ssmlEnabled:H,availableVoices:U}=x(D),W=y(``),G=y(!1),K=y(`Hello, my name is AI Assistant`),q=y(``),J=y(!1),Y=y(``),X=y(null),Z=y(``);c(async()=>{await C.loadModelsForConfiguredProviders(),await D.loadVoicesForProvider(M.value)}),te(M,async()=>{await C.loadModelsForConfiguredProviders(),await D.loadVoicesForProvider(M.value)});async function Ke(){if(!K.value.trim()&&!G.value||G.value&&!q.value.trim())return;if(!N.value){console.error(`No model selected`);return}if(!P.value){console.error(`No voice selected`);return}let e=await C.getProviderInstance(M.value);if(!e){console.error(`Failed to initialize speech provider`);return}let t=C.getProviderConfig(M.value);J.value=!0,Z.value=``;try{Y.value&&Q();let n=G.value?q.value:D.supportsSSML?D.generateSSML(K.value,P.value,{...t,pitch:I.value}):K.value,r=await de({...e.speech(N.value,t),input:n,voice:P.value.id});Y.value=URL.createObjectURL(new Blob([r])),setTimeout(()=>{X.value&&X.value.play()},100)}catch(e){console.error(`Error generating speech:`,e),Z.value=e instanceof Error?e.message:`An unknown error occurred`}finally{J.value=!1}}function Q(){X.value&&(X.value.pause(),X.value.currentTime=0),Y.value&&=(URL.revokeObjectURL(Y.value),``)}n(()=>{Y.value&&URL.revokeObjectURL(Y.value)});function $(e){if(!e){P.value=void 0;return}P.value={id:e,name:e,description:e,previewURL:e,languages:[{code:`en`,title:`English`}],provider:M.value,gender:`male`}}function qe(e){N.value=e}return(e,n)=>{let c=ee(`motion`);return i(),_(m,null,[v(`div`,he,[v(`div`,ge,[v(`div`,null,[v(`div`,_e,[v(`div`,null,[v(`h2`,ve,o(f(h)(`settings.pages.modules.speech.sections.section.provider-voice-selection.title`)),1),v(`div`,ye,[v(`span`,null,o(f(h)(`settings.pages.modules.speech.sections.section.provider-voice-selection.description`)),1)])]),v(`div`,be,[f(j).length>0?(i(),_(`fieldset`,xe,[(i(!0),_(m,null,r(f(j),e=>(i(),s(f(ce),{id:e.id,key:e.id,modelValue:f(M),"onUpdate:modelValue":n[0]||=e=>l(M)?M.value=e:null,name:`speech-provider`,value:e.id,title:e.localizedName||`Unknown`,description:e.localizedDescription},null,8,[`id`,`modelValue`,`value`,`title`,`description`]))),128)),d(f(S),{to:`/settings/providers#speech`,border:`2px solid`,class:`border-neutral-100 bg-white dark:border-neutral-900 hover:border-primary-500/30 dark:bg-neutral-900/20 dark:hover:border-primary-400/30`,flex:`~ col items-center justify-center`,transition:`all duration-200 ease-in-out`,relative:``,"min-w-50":``,"w-fit":``,"rounded-xl":``,"p-4":``},{default:p(()=>[...n[11]||=[v(`div`,{"i-solar:add-circle-line-duotone":``,class:`text-2xl text-neutral-500 dark:text-neutral-500`},null,-1),v(`div`,{class:`bg-dotted-neutral-200/80 dark:bg-dotted-neutral-700/50`,absolute:``,"inset-0":``,"z--1":``,style:{"background-size":`10px 10px`,"mask-image":`linear-gradient(165deg, white 30%, transparent 50%)`}},null,-1)]]),_:1})])):(i(),_(`div`,Se,[d(f(S),{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:p(()=>[...n[12]||=[v(`div`,{"i-solar:warning-circle-line-duotone":``,class:`text-2xl text-amber-500 dark:text-amber-400`},null,-1),v(`div`,{class:`flex flex-col`},[v(`span`,{class:`font-medium`},`No Speech Providers Configured`),v(`span`,{class:`text-sm text-neutral-400 dark:text-neutral-500`},`Click here to set up your speech providers`)],-1),v(`div`,{"i-solar:arrow-right-line-duotone":``,class:`ml-auto text-xl text-neutral-400 dark:text-neutral-500`},null,-1)]]),_:1})]))])]),v(`div`,null,[f(M)&&f(Ge)?(i(),_(`div`,Ce,[v(`div`,we,[v(`div`,null,[v(`h2`,O,o(f(h)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.title`)),1),v(`div`,k,[v(`span`,null,o(f(h)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle`)),1)])]),f(R)?(i(),_(`div`,Te,[n[13]||=v(`div`,{class:`mr-2 animate-spin`},[v(`div`,{"i-solar:spinner-line-duotone":``,"text-xl":``})],-1),v(`span`,null,o(f(h)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.loading`)),1)])):f(z)?(i(),s(f(w),{key:1,title:f(h)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.error`),error:f(z)},null,8,[`title`,`error`])):f(L).length===0&&!f(R)?(i(),s(f(T),{key:2,type:`warning`},{title:p(()=>[a(o(f(h)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models`)),1)]),content:p(()=>[a(o(f(h)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models_description`)),1)]),_:1})):f(L).length>0?(i(),s(f(se),{key:3,modelValue:f(N),"onUpdate:modelValue":n[1]||=e=>l(N)?N.value=e:null,"search-query":f(B),"onUpdate:searchQuery":n[2]||=e=>l(B)?B.value=e:null,items:f(L),searchable:!0,"search-placeholder":f(h)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.search_placeholder`),"search-no-results-title":f(h)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results`),"search-no-results-description":f(h)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results_description`,{query:f(B)}),"search-results-text":f(h)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.search_results`,{count:`{count}`,total:`{total}`}),"custom-input-placeholder":f(h)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.custom_model_placeholder`),"expand-button-text":f(h)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.expand`),"collapse-button-text":f(h)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.collapse`),"onUpdate:customValue":qe},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`])):t(``,!0)])])):t(``,!0)])]),f(M)?(i(),_(`div`,Ee,[v(`div`,De,[n[21]||=v(`div`,null,[v(`h2`,{class:`text-lg text-neutral-500 md:text-2xl dark:text-neutral-400`},` Voice Configuration `),v(`div`,{text:`neutral-400 dark:neutral-500`},[v(`span`,null,`Customize how your AI assistant speaks`)])],-1),f(We)?(i(),_(`div`,Oe,[v(`div`,ke,[d(f(E),{class:`w-full rounded-lg p-2.5 text-sm`},{default:p(()=>[...n[14]||=[v(`div`,{class:`h-1lh`},null,-1)]]),_:1}),v(`div`,Ae,[d(f(E),{class:`w-full rounded-lg p-4 text-sm`},{default:p(()=>[...n[15]||=[v(`div`,{class:`h-1lh`},null,-1)]]),_:1}),d(f(E),{class:`w-full rounded-lg p-4 text-sm`},{default:p(()=>[...n[16]||=[v(`div`,{class:`h-1lh`},null,-1)]]),_:1}),d(f(E),{class:`w-full rounded-lg p-4 text-sm`},{default:p(()=>[...n[17]||=[v(`div`,{class:`h-1lh`},null,-1)]]),_:1})]),d(f(E),{class:`w-full rounded-lg p-3 text-sm`},{default:p(()=>[...n[18]||=[v(`div`,{class:`h-1lh`},null,-1)]]),_:1})])])):f(U)[f(M)]&&f(U)[f(M)].length>0?(i(),_(`div`,je,[d(f(le),{"search-query":W.value,"onUpdate:searchQuery":n[3]||=e=>W.value=e,"voice-id":f(F),"onUpdate:voiceId":n[4]||=e=>l(F)?F.value=e:null,voices:f(U)[f(M)]?.filter(e=>!e.compatibleModels||e.compatibleModels.includes(f(N))).map(e=>({id:e.id,name:e.name,description:e.description,previewURL:e.previewURL,customizable:!1})),searchable:!0,"search-placeholder":f(h)(`settings.pages.modules.speech.sections.section.provider-voice-selection.search_voices_placeholder`),"search-no-results-title":f(h)(`settings.pages.modules.speech.sections.section.provider-voice-selection.no_voices`),"search-no-results-description":f(h)(`settings.pages.modules.speech.sections.section.provider-voice-selection.no_voices_description`),"search-results-text":f(h)(`settings.pages.modules.speech.sections.section.provider-voice-selection.search_voices_results`,{count:`{count}`,total:`{total}`}),"unsupported-voice-warning-title":f(h)(`settings.pages.modules.speech.sections.section.provider-voice-selection.unsupported_voice_warning_title`),"unsupported-voice-warning-content":f(h)(`settings.pages.modules.speech.sections.section.provider-voice-selection.unsupported_voice_warning_content`),"custom-input-placeholder":f(h)(`settings.pages.modules.speech.sections.section.provider-voice-selection.custom_voice_placeholder`),"expand-button-text":f(h)(`settings.pages.modules.speech.sections.section.provider-voice-selection.show_more`),"collapse-button-text":f(h)(`settings.pages.modules.speech.sections.section.provider-voice-selection.show_less`),"play-button-text":f(h)(`settings.pages.modules.speech.sections.section.provider-voice-selection.play_sample`),"pause-button-text":f(h)(`settings.pages.modules.speech.sections.section.provider-voice-selection.pause`),"onUpdate:customValue":$},null,8,[`search-query`,`voice-id`,`voices`,`search-placeholder`,`search-no-results-title`,`search-no-results-description`,`search-results-text`,`unsupported-voice-warning-title`,`unsupported-voice-warning-content`,`custom-input-placeholder`,`expand-button-text`,`collapse-button-text`,`play-button-text`,`pause-button-text`])])):f(V)?(i(),s(f(w),{key:2,class:`mb-2`,title:`Error loading voices`,error:f(V)},null,8,[`error`])):(i(),s(f(T),{key:3,type:`warning`,icon:`i-solar:info-circle-line-duotone`,class:`mb-2`},{title:p(()=>[a(o(f(h)(`settings.pages.modules.speech.sections.section.provider-voice-selection.no_voices`)),1)]),content:p(()=>[a(o(f(h)(`settings.pages.modules.speech.sections.section.provider-voice-selection.no_voices_description`))+`. `+o(f(h)(`settings.pages.modules.speech.sections.section.provider-voice-selection.no_voices_hint`)),1)]),_:1})),v(`div`,Me,[d(f(ae),{modelValue:f(I),"onUpdate:modelValue":n[5]||=e=>l(I)?I.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`]),d(f(b),{modelValue:f(H),"onUpdate:modelValue":n[6]||=e=>l(H)?H.value=e:null,label:`Enable SSML`,description:`Enable Speech Synthesis Markup Language for more control over speech output`},null,8,[`modelValue`])]),!f(U)[f(M)]||f(U)[f(M)].length===0?(i(),_(`div`,Ne,[d(f(ie),{type:`text`,label:`Voice Name`,description:`Enter the voice name for your custom voice`,placeholder:`Enter voice name (e.g., 'Rachel', 'Josh')`,"onUpdate:modelValue":$}),f(M)===`elevenlabs`?(i(),_(`div`,Pe,[n[20]||=v(`label`,{class:`mb-1 block text-sm font-medium`},` Model `,-1),g(v(`select`,{"onUpdate:modelValue":n[7]||=e=>l(N)?N.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[19]||=[v(`option`,{value:`eleven_monolingual_v1`},` Monolingual v1 `,-1),v(`option`,{value:`eleven_multilingual_v1`},` Multilingual v1 `,-1),v(`option`,{value:`eleven_multilingual_v2`},` Multilingual v2 `,-1)]],512),[[ne,f(N)]])])):t(``,!0)])):t(``,!0)])])):t(``,!0)]),v(`div`,Fe,[v(`div`,Ie,[v(`h2`,Le,[v(`div`,A,[d(f(oe)),v(`div`,null,o(f(h)(`settings.pages.providers.provider.elevenlabs.playground.title`)),1)])]),v(`div`,Re,[d(f(b),{modelValue:G.value,"onUpdate:modelValue":n[8]||=e=>G.value=e,label:`Use Custom SSML`,description:`Enable to input raw SSML instead of plain text`},null,8,[`modelValue`]),G.value?g((i(),_(`textarea`,{key:1,"onUpdate:modelValue":n[10]||=e=>q.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)),[[re,q.value]]):(i(),s(f(me),{key:0,modelValue:K.value,"onUpdate:modelValue":n[9]||=e=>K.value=e,"h-24":``,"w-full":``,placeholder:f(h)(`settings.pages.providers.provider.elevenlabs.playground.fields.field.input.placeholder`)},null,8,[`modelValue`,`placeholder`])),v(`div`,ze,[v(`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:J.value||!K.value.trim()&&!G.value||G.value&&!q.value.trim()||!f(P),class:u({"opacity-50 cursor-not-allowed":J.value||!K.value.trim()&&!G.value||G.value&&!q.value.trim()||!f(P)}),bg:`neutral-700 dark:neutral-300`,onClick:Ke},[v(`div`,Ve,[n[22]||=v(`div`,{"i-solar:play-circle-bold-duotone":``},null,-1),v(`span`,null,o(J.value?f(h)(`settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.generating`):f(h)(`settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.label`)),1)])],10,Be),Y.value?(i(),_(`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:Q},[...n[23]||=[v(`div`,{flex:`~ row`,"items-center":``,"gap-2":``},[v(`div`,{"i-solar:stop-circle-bold-duotone":``}),v(`span`,null,`Stop`)],-1)]])):t(``,!0)]),Y.value?(i(),_(`audio`,{key:2,ref_key:`audioPlayer`,ref:X,src:Y.value,controls:``,class:`mt-2 w-full`},null,8,He)):t(``,!0)])])])]),g((i(),_(`div`,Ue,[...n[24]||=[v(`div`,{text:`60`,"i-solar:user-speak-rounded-bold-duotone":``},null,-1)]])),[[c]])],64)}}});typeof D==`function`&&D(j);var M=j;export{M as default}; \ No newline at end of file +import{A as e,C as t,G as n,J as r,K as i,O as a,Pt as o,S as s,W as c,Z as ee,at as te,c as ne,gt as l,jt as u,k as d,kt as f,l as re,lt as p,m,nt as h,ut as g,w as _,x as v,xt as y}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-C0YByt49.js";import{d as ie,l as ae,p as b}from"./src-DYQXbDgu.js";import{a as x}from"./resettable-CbXzRviW.js";import{t as S}from"./vue-router-Chhv6vZu.js";import"./environment-CyZLTg97.js";import{t as C}from"./Basic-EclD3L6X.js";import"./src-C83SCWbW.js";import{Ct as oe,dt as w,gt as T,ht as se,mt as ce,pt as le,ut as E}from"./components-CeE-UiLT.js";import{i as ue,n as de,t as fe}from"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import{n as pe}from"./vue-i18n.runtime-Dah5zGm4.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-73vyHOZs.js";import"./__vite-browser-external-BaycPy5b.js";import{t as D}from"./route-block-CpjdOEnv.js";var me=e({__name:`Textarea`,props:{modelValue:{default:``},modelModifiers:{}},emits:[`update:modelValue`],setup(e){let t=h(e,`modelValue`);return(e,n)=>(i(),s(C,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:u([`focus:border-primary-300 dark:focus:border-primary-400/50 border-2 border-solid border-neutral-100 dark:border-neutral-900`,`transition-all duration-200 ease-in-out`,`text-disabled:neutral-400 dark:text-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-50 dark:bg-neutral-950 focus:bg-neutral-50 dark:focus:bg-neutral-900`])},null,8,[`modelValue`]))}}),he={flex:`~ col md:row gap-6`},ge={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%]`},_e={flex:`~ col gap-4`},ve={class:`text-lg text-neutral-500 md:text-2xl dark:text-neutral-400`},ye={text:`neutral-400 dark:neutral-500`},be={"max-w-full":``},xe={key:0,flex:`~ row gap-4`,style:{"scrollbar-width":`none`},"min-w-0":``,"of-x-scroll":``,"scroll-smooth":``,role:`radiogroup`},Se={key:1},Ce={key:0},we={flex:`~ col gap-4`},O={class:`text-lg md:text-2xl`},k={text:`neutral-400 dark:neutral-400`},Te={key:0,class:`flex items-center justify-center py-4`},Ee={key:0},De={flex:`~ col gap-4`},Oe={key:0},ke={class:`flex flex-col gap-4`},Ae={flex:`~ row gap-4`},je={key:1,class:`space-y-6`},Me={flex:`~ col gap-4`},Ne={key:4,class:`mt-2 space-y-6`},Pe={key:0},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":``},A={class:`inline-flex items-center gap-4`},Re={flex:`~ col gap-4`},ze={flex:`~ row`,"gap-4":``},Be=[`disabled`],Ve={flex:`~ row`,"items-center":``,"gap-2":``},He=[`src`],Ue={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":``},j=e({__name:`speech`,setup(e){let{t:h}=pe(),C=ue(),D=fe(),{configuredSpeechProvidersMetadata:j}=x(C),{activeSpeechProvider:M,activeSpeechModel:N,activeSpeechVoice:P,activeSpeechVoiceId:F,pitch:I,isLoadingSpeechProviderVoices:We,supportsModelListing:Ge,providerModels:L,isLoadingActiveProviderModels:R,activeProviderModelError:z,modelSearchQuery:B,speechProviderError:V,ssmlEnabled:H,availableVoices:U}=x(D),W=y(``),G=y(!1),K=y(`Hello, my name is AI Assistant`),q=y(``),J=y(!1),Y=y(``),X=y(null),Z=y(``);c(async()=>{await C.loadModelsForConfiguredProviders(),await D.loadVoicesForProvider(M.value)}),te(M,async()=>{await C.loadModelsForConfiguredProviders(),await D.loadVoicesForProvider(M.value)});async function Ke(){if(!K.value.trim()&&!G.value||G.value&&!q.value.trim())return;if(!N.value){console.error(`No model selected`);return}if(!P.value){console.error(`No voice selected`);return}let e=await C.getProviderInstance(M.value);if(!e){console.error(`Failed to initialize speech provider`);return}let t=C.getProviderConfig(M.value);J.value=!0,Z.value=``;try{Y.value&&Q();let n=G.value?q.value:D.supportsSSML?D.generateSSML(K.value,P.value,{...t,pitch:I.value}):K.value,r=await de({...e.speech(N.value,t),input:n,voice:P.value.id});Y.value=URL.createObjectURL(new Blob([r])),setTimeout(()=>{X.value&&X.value.play()},100)}catch(e){console.error(`Error generating speech:`,e),Z.value=e instanceof Error?e.message:`An unknown error occurred`}finally{J.value=!1}}function Q(){X.value&&(X.value.pause(),X.value.currentTime=0),Y.value&&=(URL.revokeObjectURL(Y.value),``)}n(()=>{Y.value&&URL.revokeObjectURL(Y.value)});function $(e){if(!e){P.value=void 0;return}P.value={id:e,name:e,description:e,previewURL:e,languages:[{code:`en`,title:`English`}],provider:M.value,gender:`male`}}function qe(e){N.value=e}return(e,n)=>{let c=ee(`motion`);return i(),_(m,null,[v(`div`,he,[v(`div`,ge,[v(`div`,null,[v(`div`,_e,[v(`div`,null,[v(`h2`,ve,o(f(h)(`settings.pages.modules.speech.sections.section.provider-voice-selection.title`)),1),v(`div`,ye,[v(`span`,null,o(f(h)(`settings.pages.modules.speech.sections.section.provider-voice-selection.description`)),1)])]),v(`div`,be,[f(j).length>0?(i(),_(`fieldset`,xe,[(i(!0),_(m,null,r(f(j),e=>(i(),s(f(ce),{id:e.id,key:e.id,modelValue:f(M),"onUpdate:modelValue":n[0]||=e=>l(M)?M.value=e:null,name:`speech-provider`,value:e.id,title:e.localizedName||`Unknown`,description:e.localizedDescription},null,8,[`id`,`modelValue`,`value`,`title`,`description`]))),128)),d(f(S),{to:`/settings/providers#speech`,border:`2px solid`,class:`border-neutral-100 bg-white dark:border-neutral-900 hover:border-primary-500/30 dark:bg-neutral-900/20 dark:hover:border-primary-400/30`,flex:`~ col items-center justify-center`,transition:`all duration-200 ease-in-out`,relative:``,"min-w-50":``,"w-fit":``,"rounded-xl":``,"p-4":``},{default:p(()=>[...n[11]||=[v(`div`,{"i-solar:add-circle-line-duotone":``,class:`text-2xl text-neutral-500 dark:text-neutral-500`},null,-1),v(`div`,{class:`bg-dotted-neutral-200/80 dark:bg-dotted-neutral-700/50`,absolute:``,"inset-0":``,"z--1":``,style:{"background-size":`10px 10px`,"mask-image":`linear-gradient(165deg, white 30%, transparent 50%)`}},null,-1)]]),_:1})])):(i(),_(`div`,Se,[d(f(S),{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:p(()=>[...n[12]||=[v(`div`,{"i-solar:warning-circle-line-duotone":``,class:`text-2xl text-amber-500 dark:text-amber-400`},null,-1),v(`div`,{class:`flex flex-col`},[v(`span`,{class:`font-medium`},`No Speech Providers Configured`),v(`span`,{class:`text-sm text-neutral-400 dark:text-neutral-500`},`Click here to set up your speech providers`)],-1),v(`div`,{"i-solar:arrow-right-line-duotone":``,class:`ml-auto text-xl text-neutral-400 dark:text-neutral-500`},null,-1)]]),_:1})]))])]),v(`div`,null,[f(M)&&f(Ge)?(i(),_(`div`,Ce,[v(`div`,we,[v(`div`,null,[v(`h2`,O,o(f(h)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.title`)),1),v(`div`,k,[v(`span`,null,o(f(h)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle`)),1)])]),f(R)?(i(),_(`div`,Te,[n[13]||=v(`div`,{class:`mr-2 animate-spin`},[v(`div`,{"i-solar:spinner-line-duotone":``,"text-xl":``})],-1),v(`span`,null,o(f(h)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.loading`)),1)])):f(z)?(i(),s(f(w),{key:1,title:f(h)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.error`),error:f(z)},null,8,[`title`,`error`])):f(L).length===0&&!f(R)?(i(),s(f(T),{key:2,type:`warning`},{title:p(()=>[a(o(f(h)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models`)),1)]),content:p(()=>[a(o(f(h)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models_description`)),1)]),_:1})):f(L).length>0?(i(),s(f(se),{key:3,modelValue:f(N),"onUpdate:modelValue":n[1]||=e=>l(N)?N.value=e:null,"search-query":f(B),"onUpdate:searchQuery":n[2]||=e=>l(B)?B.value=e:null,items:f(L),searchable:!0,"search-placeholder":f(h)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.search_placeholder`),"search-no-results-title":f(h)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results`),"search-no-results-description":f(h)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results_description`,{query:f(B)}),"search-results-text":f(h)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.search_results`,{count:`{count}`,total:`{total}`}),"custom-input-placeholder":f(h)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.custom_model_placeholder`),"expand-button-text":f(h)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.expand`),"collapse-button-text":f(h)(`settings.pages.modules.consciousness.sections.section.provider-model-selection.collapse`),"onUpdate:customValue":qe},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`])):t(``,!0)])])):t(``,!0)])]),f(M)?(i(),_(`div`,Ee,[v(`div`,De,[n[21]||=v(`div`,null,[v(`h2`,{class:`text-lg text-neutral-500 md:text-2xl dark:text-neutral-400`},` Voice Configuration `),v(`div`,{text:`neutral-400 dark:neutral-500`},[v(`span`,null,`Customize how your AI assistant speaks`)])],-1),f(We)?(i(),_(`div`,Oe,[v(`div`,ke,[d(f(E),{class:`w-full rounded-lg p-2.5 text-sm`},{default:p(()=>[...n[14]||=[v(`div`,{class:`h-1lh`},null,-1)]]),_:1}),v(`div`,Ae,[d(f(E),{class:`w-full rounded-lg p-4 text-sm`},{default:p(()=>[...n[15]||=[v(`div`,{class:`h-1lh`},null,-1)]]),_:1}),d(f(E),{class:`w-full rounded-lg p-4 text-sm`},{default:p(()=>[...n[16]||=[v(`div`,{class:`h-1lh`},null,-1)]]),_:1}),d(f(E),{class:`w-full rounded-lg p-4 text-sm`},{default:p(()=>[...n[17]||=[v(`div`,{class:`h-1lh`},null,-1)]]),_:1})]),d(f(E),{class:`w-full rounded-lg p-3 text-sm`},{default:p(()=>[...n[18]||=[v(`div`,{class:`h-1lh`},null,-1)]]),_:1})])])):f(U)[f(M)]&&f(U)[f(M)].length>0?(i(),_(`div`,je,[d(f(le),{"search-query":W.value,"onUpdate:searchQuery":n[3]||=e=>W.value=e,"voice-id":f(F),"onUpdate:voiceId":n[4]||=e=>l(F)?F.value=e:null,voices:f(U)[f(M)]?.filter(e=>!e.compatibleModels||e.compatibleModels.includes(f(N))).map(e=>({id:e.id,name:e.name,description:e.description,previewURL:e.previewURL,customizable:!1})),searchable:!0,"search-placeholder":f(h)(`settings.pages.modules.speech.sections.section.provider-voice-selection.search_voices_placeholder`),"search-no-results-title":f(h)(`settings.pages.modules.speech.sections.section.provider-voice-selection.no_voices`),"search-no-results-description":f(h)(`settings.pages.modules.speech.sections.section.provider-voice-selection.no_voices_description`),"search-results-text":f(h)(`settings.pages.modules.speech.sections.section.provider-voice-selection.search_voices_results`,{count:`{count}`,total:`{total}`}),"unsupported-voice-warning-title":f(h)(`settings.pages.modules.speech.sections.section.provider-voice-selection.unsupported_voice_warning_title`),"unsupported-voice-warning-content":f(h)(`settings.pages.modules.speech.sections.section.provider-voice-selection.unsupported_voice_warning_content`),"custom-input-placeholder":f(h)(`settings.pages.modules.speech.sections.section.provider-voice-selection.custom_voice_placeholder`),"expand-button-text":f(h)(`settings.pages.modules.speech.sections.section.provider-voice-selection.show_more`),"collapse-button-text":f(h)(`settings.pages.modules.speech.sections.section.provider-voice-selection.show_less`),"play-button-text":f(h)(`settings.pages.modules.speech.sections.section.provider-voice-selection.play_sample`),"pause-button-text":f(h)(`settings.pages.modules.speech.sections.section.provider-voice-selection.pause`),"onUpdate:customValue":$},null,8,[`search-query`,`voice-id`,`voices`,`search-placeholder`,`search-no-results-title`,`search-no-results-description`,`search-results-text`,`unsupported-voice-warning-title`,`unsupported-voice-warning-content`,`custom-input-placeholder`,`expand-button-text`,`collapse-button-text`,`play-button-text`,`pause-button-text`])])):f(V)?(i(),s(f(w),{key:2,class:`mb-2`,title:`Error loading voices`,error:f(V)},null,8,[`error`])):(i(),s(f(T),{key:3,type:`warning`,icon:`i-solar:info-circle-line-duotone`,class:`mb-2`},{title:p(()=>[a(o(f(h)(`settings.pages.modules.speech.sections.section.provider-voice-selection.no_voices`)),1)]),content:p(()=>[a(o(f(h)(`settings.pages.modules.speech.sections.section.provider-voice-selection.no_voices_description`))+`. `+o(f(h)(`settings.pages.modules.speech.sections.section.provider-voice-selection.no_voices_hint`)),1)]),_:1})),v(`div`,Me,[d(f(ae),{modelValue:f(I),"onUpdate:modelValue":n[5]||=e=>l(I)?I.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`]),d(f(b),{modelValue:f(H),"onUpdate:modelValue":n[6]||=e=>l(H)?H.value=e:null,label:`Enable SSML`,description:`Enable Speech Synthesis Markup Language for more control over speech output`},null,8,[`modelValue`])]),!f(U)[f(M)]||f(U)[f(M)].length===0?(i(),_(`div`,Ne,[d(f(ie),{type:`text`,label:`Voice Name`,description:`Enter the voice name for your custom voice`,placeholder:`Enter voice name (e.g., 'Rachel', 'Josh')`,"onUpdate:modelValue":$}),f(M)===`elevenlabs`?(i(),_(`div`,Pe,[n[20]||=v(`label`,{class:`mb-1 block text-sm font-medium`},` Model `,-1),g(v(`select`,{"onUpdate:modelValue":n[7]||=e=>l(N)?N.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[19]||=[v(`option`,{value:`eleven_monolingual_v1`},` Monolingual v1 `,-1),v(`option`,{value:`eleven_multilingual_v1`},` Multilingual v1 `,-1),v(`option`,{value:`eleven_multilingual_v2`},` Multilingual v2 `,-1)]],512),[[ne,f(N)]])])):t(``,!0)])):t(``,!0)])])):t(``,!0)]),v(`div`,Fe,[v(`div`,Ie,[v(`h2`,Le,[v(`div`,A,[d(f(oe)),v(`div`,null,o(f(h)(`settings.pages.providers.provider.elevenlabs.playground.title`)),1)])]),v(`div`,Re,[d(f(b),{modelValue:G.value,"onUpdate:modelValue":n[8]||=e=>G.value=e,label:`Use Custom SSML`,description:`Enable to input raw SSML instead of plain text`},null,8,[`modelValue`]),G.value?g((i(),_(`textarea`,{key:1,"onUpdate:modelValue":n[10]||=e=>q.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)),[[re,q.value]]):(i(),s(f(me),{key:0,modelValue:K.value,"onUpdate:modelValue":n[9]||=e=>K.value=e,"h-24":``,"w-full":``,placeholder:f(h)(`settings.pages.providers.provider.elevenlabs.playground.fields.field.input.placeholder`)},null,8,[`modelValue`,`placeholder`])),v(`div`,ze,[v(`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:J.value||!K.value.trim()&&!G.value||G.value&&!q.value.trim()||!f(P),class:u({"opacity-50 cursor-not-allowed":J.value||!K.value.trim()&&!G.value||G.value&&!q.value.trim()||!f(P)}),bg:`neutral-700 dark:neutral-300`,onClick:Ke},[v(`div`,Ve,[n[22]||=v(`div`,{"i-solar:play-circle-bold-duotone":``},null,-1),v(`span`,null,o(J.value?f(h)(`settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.generating`):f(h)(`settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.label`)),1)])],10,Be),Y.value?(i(),_(`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:Q},[...n[23]||=[v(`div`,{flex:`~ row`,"items-center":``,"gap-2":``},[v(`div`,{"i-solar:stop-circle-bold-duotone":``}),v(`span`,null,`Stop`)],-1)]])):t(``,!0)]),Y.value?(i(),_(`audio`,{key:2,ref_key:`audioPlayer`,ref:X,src:Y.value,controls:``,class:`mt-2 w-full`},null,8,He)):t(``,!0)])])])]),g((i(),_(`div`,Ue,[...n[24]||=[v(`div`,{text:`60`,"i-solar:user-speak-rounded-bold-duotone":``},null,-1)]])),[[c]])],64)}}});typeof D==`function`&&D(j);var M=j;export{M as default}; \ No newline at end of file diff --git a/assets/src-BccD0BFR.js b/assets/src-mAITpvbv.js similarity index 53% rename from assets/src-BccD0BFR.js rename to assets/src-mAITpvbv.js index 81f76e8cd953e463626a8ada1513b4684a2f2427..83f63e5506076b4afd3805d7175d45e53387da8a 100644 --- a/assets/src-BccD0BFR.js +++ b/assets/src-mAITpvbv.js @@ -1,4 +1,4 @@ -import{A as e,B as t,C as n,Dt as r,Et as i,F as a,G as o,K as s,M as c,Mt as l,R as u,S as d,W as f,Y as p,at as m,b as h,g,k as _,kt as v,lt as y,m as b,nt as x,ot as S,q as ee,u as te,ut as ne,w as re,wt as C,x as ie,xt as w}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import{$ as T,$t as E,A as D,At as ae,B as oe,Bt as O,C as se,Ct as k,D as ce,Dt as le,E as ue,Et as A,F as de,Ft as fe,G as j,Gt as pe,H as me,Ht as he,I as ge,It as _e,J as ve,Jt as ye,K as M,Kt as N,L as be,Lt as P,M as xe,Mt as Se,N as Ce,Nt as we,O as Te,Ot as Ee,P as De,Pt as Oe,Q as ke,Qt as Ae,R as je,Rt as Me,S as Ne,St as Pe,T as Fe,Tt as Ie,U as Le,Ut as Re,V as ze,Vt as Be,W as Ve,Wt as He,X as Ue,Xt as We,Y as Ge,Yt as Ke,Z as qe,Zt as Je,_ as Ye,_t as Xe,a as Ze,an as F,at as Qe,b as $e,bt as et,c as tt,cn as nt,ct as I,d as rt,dt as it,en as at,et as ot,f as st,ft as ct,g as lt,gt as ut,h as dt,ht as ft,i as pt,in as L,it as mt,j as ht,jt as R,k as gt,kt as _t,l as vt,ln as yt,lt as bt,m as xt,mt as St,n as Ct,nn as wt,nt as Tt,o as Et,on as Dt,ot as Ot,p as kt,pt as At,q as jt,qt as Mt,rn as Nt,rt as z,s as Pt,sn as Ft,st as It,t as Lt,tn as Rt,tt as zt,u as Bt,ut as B,v as V,vt as Vt,w as Ht,wt as Ut,x as H,xt as Wt,y as Gt,yt as Kt,z as qt,zt as Jt}from"./tres-B5z5lcdF.js";import{o as Yt}from"./widgets-CZ9Rvki9.js";import{t as Xt}from"./src-DYQXbDgu.js";import{a as Zt,i as Qt}from"./resettable-CbXzRviW.js";import{c as $t,s as en}from"./environment-CyZLTg97.js";import{E as tn,O as nn,a as rn,f as U,h as an,i as on,l as sn,r as cn,t as ln}from"./dist-Che88T83.js";import{r as un}from"./src-C83SCWbW.js";import{r as dn}from"./browser-DY5K31Vk.js";import{C as fn,D as pn,S as mn,T as hn,_ as gn,b as _n,c as vn,d as yn,f as bn,g as xn,h as Sn,l as Cn,m as wn,n as Tn,o as En,p as Dn,s as On,u as W,v as kn,w as An,x as jn,y as Mn}from"./settings-D1kLcsvA.js";import{t as Nn}from"./beat-sync-GCfX3UHH.js";import{n as Pn}from"./live2d-DukystQI.js";var Fn=e({__name:`Canvas`,props:u({width:{},height:{},resolution:{default:2}},{state:{default:`pending`},stateModifiers:{}}),emits:[`update:state`],setup(e,{expose:t}){let r=e,i=x(e,`state`),a=w(),c=w(!1),l=w(),u=w();async function d(e){i.value=`loading`,c.value=!1,On.registerTicker(xn),kn.add(gn),l.value=new Cn({width:r.width*r.resolution,height:r.height*r.resolution,backgroundAlpha:0,preserveDrawingBuffer:!0}),u.value=l.value.view,u.value.style.width=`100%`,u.value.style.height=`100%`,u.value.style.objectFit=`cover`,u.value.style.display=`block`,e.appendChild(l.value.view),c.value=!0,i.value=`mounted`}function h(){l.value&&l.value.renderer.resize(r.width,r.height)}m([()=>r.width,()=>r.height],()=>h()),m(()=>r.resolution,e=>{l.value&&e&&(l.value.renderer.resolution=e,h())}),f(async()=>a.value&&await d(a.value)),o(()=>l.value?.destroy());async function g(){return new Promise(e=>{if(!u.value||!l.value)return e(null);l.value.render(),u.value.toBlob(e)})}function _(){return u.value}return t({captureFrame:g,canvasElement:_}),(void 0)?.dispose(()=>{console.warn(`[Dev] Reload on HMR dispose is active for this component. Performing a full reload.`),window.location.reload()}),(e,t)=>(s(),re(`div`,{ref_key:`containerRef`,ref:a,"h-full":``,"w-full":``},[c.value?p(e.$slots,`default`,{key:0,app:l.value}):n(``,!0)],512))}}),In=function(e,t){return In=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},In(e,t)};function Ln(e,t){In(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Rn=`attribute vec2 aVertexPosition; +import{A as e,B as t,C as n,Dt as r,Et as i,F as a,G as o,K as s,M as c,Mt as l,R as u,S as d,W as f,Y as p,at as m,b as h,g,k as _,kt as v,lt as y,m as b,nt as x,ot as S,q as C,u as ee,ut as te,w as ne,wt as w,x as re,xt as T}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import{$ as E,$t as D,A as O,At as ie,B as ae,Bt as k,C as oe,Ct as A,D as se,Dt as ce,E as le,Et as ue,F as j,Ft as de,G as fe,Gt as pe,H as me,Ht as he,I as ge,It as _e,J as ve,Jt as ye,K as be,Kt as M,L as xe,Lt as N,M as Se,Mt as Ce,N as we,Nt as Te,O as Ee,Ot as De,P as Oe,Pt as ke,Q as Ae,Qt as je,R as P,Rt as Me,S as Ne,St as Pe,T as Fe,Tt as Ie,U as Le,Ut as Re,V as ze,Vt as Be,W as Ve,Wt as He,X as Ue,Xt as We,Y as Ge,Yt as Ke,Z as qe,Zt as Je,_ as Ye,_t as Xe,a as Ze,an as F,at as Qe,b as $e,bt as et,c as tt,cn as nt,ct as I,d as rt,dt as it,en as at,et as ot,f as st,ft as ct,g as lt,gt as ut,h as dt,ht as ft,i as pt,in as L,it as mt,j as ht,jt as R,k as gt,kt as _t,l as vt,ln as yt,lt as bt,m as xt,mt as St,n as Ct,nn as wt,nt as Tt,o as Et,on as Dt,ot as Ot,p as kt,pt as At,q as jt,qt as Mt,rn as Nt,rt as z,s as Pt,sn as Ft,st as It,t as Lt,tn as Rt,tt as zt,u as Bt,ut as B,v as V,vt as Vt,w as Ht,wt as Ut,x as H,xt as Wt,y as Gt,yt as Kt,z as qt,zt as Jt}from"./tres-Bk8ucvrj.js";import{o as Yt}from"./widgets-C0YByt49.js";import{t as Xt}from"./src-DYQXbDgu.js";import{a as Zt,i as Qt}from"./resettable-CbXzRviW.js";import{c as $t,s as en}from"./environment-CyZLTg97.js";import{E as tn,O as nn,a as rn,f as U,h as an,i as on,l as sn,r as cn,t as ln}from"./dist-Che88T83.js";import{r as un}from"./src-C83SCWbW.js";import{r as dn}from"./browser-DY5K31Vk.js";import{C as fn,D as pn,S as mn,T as hn,_ as gn,b as _n,c as vn,d as yn,f as bn,g as xn,h as Sn,l as Cn,m as wn,n as Tn,o as En,p as Dn,s as On,u as W,v as kn,w as An,x as jn,y as Mn}from"./settings-73vyHOZs.js";import{t as Nn}from"./beat-sync-GCfX3UHH.js";import{n as Pn}from"./live2d-DukystQI.js";var Fn=e({__name:`Canvas`,props:u({width:{},height:{},resolution:{default:2}},{state:{default:`pending`},stateModifiers:{}}),emits:[`update:state`],setup(e,{expose:t}){let r=e,i=x(e,`state`),a=T(),c=T(!1),l=T(),u=T();async function d(e){i.value=`loading`,c.value=!1,On.registerTicker(xn),kn.add(gn),l.value=new Cn({width:r.width*r.resolution,height:r.height*r.resolution,backgroundAlpha:0,preserveDrawingBuffer:!0}),u.value=l.value.view,u.value.style.width=`100%`,u.value.style.height=`100%`,u.value.style.objectFit=`cover`,u.value.style.display=`block`,e.appendChild(l.value.view),c.value=!0,i.value=`mounted`}function h(){l.value&&l.value.renderer.resize(r.width,r.height)}m([()=>r.width,()=>r.height],()=>h()),m(()=>r.resolution,e=>{l.value&&e&&(l.value.renderer.resolution=e,h())}),f(async()=>a.value&&await d(a.value)),o(()=>l.value?.destroy());async function g(){return new Promise(e=>{if(!u.value||!l.value)return e(null);l.value.render(),u.value.toBlob(e)})}function _(){return u.value}return t({captureFrame:g,canvasElement:_}),(void 0)?.dispose(()=>{console.warn(`[Dev] Reload on HMR dispose is active for this component. Performing a full reload.`),window.location.reload()}),(e,t)=>(s(),ne(`div`,{ref_key:`containerRef`,ref:a,"h-full":``,"w-full":``},[c.value?p(e.$slots,`default`,{key:0,app:l.value}):n(``,!0)],512))}}),In=function(e,t){return In=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},In(e,t)};function Ln(e,t){In(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Rn=`attribute vec2 aVertexPosition; attribute vec2 aTextureCoord; uniform mat3 projectionMatrix; @@ -1845,7 +1845,7 @@ void main() { gl_FragColor = color; } -`;(function(e){ya(t,e);function t(n){var r=this,i=Object.assign(t.defaults,n),a=i.maxKernelSize,o=ba(i,[`maxKernelSize`]);return r=e.call(this,xa,Sa.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})(W),Math.PI/180,180/Math.PI;function Ca(e,t,n){return(1-n)*e+n*t}function wa(e,t){return e+Math.random()*(t-e)}var Ta=400,Ea=[[.075,800],[.11,0],[.125,0],[.14,0],[.125,0],[.05,0],[.04,0],[.03,0],[.02,0],[1,0]];for(let e=1;e=e||i{p.handled=!0}};return l(o,p),!p.handled&&p.hookedUpdate&&p.hookedUpdate.call(n,e,c)&&(p.handled=!0),l(s,p),a.value=c,p.handled}return{register:c,hookUpdate:u}}function Aa(e){return t=>{e.updateTargets(t.now);let n=t.model.getParameterValueById(`ParamAngleX`),r=t.model.getParameterValueById(`ParamAngleY`),i=t.model.getParameterValueById(`ParamAngleZ`);{let r=e.targetX.value,i=n,a=e.velocityX.value,o=(120*(r-i)-16*a)/1;e.velocityX.value=a+o*t.timeDelta,n=i+e.velocityX.value*t.timeDelta,Math.abs(r-n)<.01&&Math.abs(e.velocityX.value)<.01&&(n=r,e.velocityX.value=0)}{let n=e.targetY.value,i=r,a=e.velocityY.value,o=(120*(n-i)-16*a)/1;e.velocityY.value=a+o*t.timeDelta,r=i+e.velocityY.value*t.timeDelta,Math.abs(n-r)<.01&&Math.abs(e.velocityY.value)<.01&&(r=n,e.velocityY.value=0)}{let n=e.targetZ.value,r=i,a=e.velocityZ.value,o=(120*(n-r)-16*a)/1;e.velocityZ.value=a+o*t.timeDelta,i=r+e.velocityZ.value*t.timeDelta,Math.abs(n-i)<.01&&Math.abs(e.velocityZ.value)<.01&&(i=n,e.velocityZ.value=0)}t.model.setParameterValueById(`ParamAngleX`,n),t.model.setParameterValueById(`ParamAngleY`,r),t.model.setParameterValueById(`ParamAngleZ`,i)}}function ja(e=Oa()){return t=>{t.handled||!t.live2dIdleAnimationEnabled.value&&t.isIdleMotion&&(t.motionManager.stopAllMotions(),e.update(t.internalModel,t.now),t.internalModel.eyeBlink!=null&&t.internalModel.eyeBlink.updateParameters(t.model,t.timeDelta/1e3),t.model.setParameterValueById(`ParamEyeLOpen`,t.modelParameters.value.leftEyeOpen),t.model.setParameterValueById(`ParamEyeROpen`,t.modelParameters.value.rightEyeOpen),t.markHandled())}}function Ma(e=Oa()){return t=>{!t.isIdleMotion||t.handled||e.update(t.internalModel,t.now)}}function Na(){return e=>{!e.isIdleMotion||e.handled||(e.internalModel.eyeBlink!=null&&e.internalModel.eyeBlink.updateParameters(e.model,e.timeDelta/1e3),e.model.setParameterValueById(`ParamEyeLOpen`,e.modelParameters.value.leftEyeOpen),e.model.setParameterValueById(`ParamEyeROpen`,e.modelParameters.value.rightEyeOpen),e.markHandled())}}var Pa=e({__name:`Model`,props:u({modelSrc:{},modelId:{},app:{},mouthOpenSize:{default:0},width:{},height:{},paused:{type:Boolean,default:!1},focusAt:{default:()=>({x:0,y:0})},disableFocusAt:{type:Boolean,default:!1},xOffset:{},yOffset:{},scale:{default:1}},{state:{default:`pending`},stateModifiers:{}}),emits:u([`modelLoaded`],[`update:state`]),setup(e,{expose:t,emit:n}){let r=e,a=n,c=x(e,`state`);function l(){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 u=i(()=>r.modelSrc),d=w(!1),g=h(()=>l()),_=i(()=>r.app),v=i(()=>r.paused),y=i(()=>r.focusAt),S=w(),ee=w(0),te=w(0),ne=h(()=>Math.max(0,Math.min(100,r.mouthOpenSize))),T=w(0),{isDark:E}=Xt(),D=on(ln),ae=h(()=>D.between(`sm`,`md`).value||D.smaller(`sm`).value),oe=C(new ri({alpha:.2,blur:0,distance:20,rotation:45}));function O(){return S.value.internalModel.coreModel}function se(){if(!S.value)return;let e=2.2;ae.value&&(e=2.2);let t=r.height*.95/te.value*e,n=r.width*.95/ee.value*e,i=Math.min(t,n);S.value.scale.set(i*r.scale,i*r.scale),S.value.x=r.width/2+g.value.xOffset,S.value.y=r.height+g.value.yOffset}let k=Pn(),{currentMotion:ce,availableMotions:le,motionMap:ue,modelParameters:A}=Zt(k),{themeColorsHue:de,themeColorsHueDynamic:fe,live2dIdleAnimationEnabled:j,live2dShadowEnabled:pe}=Zt(Tn()),me=w({group:`Idle`,index:0}),he=Nn({baseAngles:()=>({x:A.value.angleX,y:A.value.angleY,z:A.value.angleZ}),initialStyle:`sway-sine`});k.onShouldUpdateView(()=>{ge()});async function ge(){if(await tn(d).not.toBeTruthy(),d.value=!0,c.value=`loading`,!_.value){d.value=!1,c.value=`mounted`;return}if(S.value&&_.value.stage){try{_.value.stage.removeChild(S.value),S.value.destroy()}catch(e){console.warn(`Error removing old model:`,e)}S.value=void 0}if(!u.value){console.warn(`No Live2D model source provided.`),d.value=!1,c.value=`mounted`;return}try{let e=new On;await En.setupLive2DModel(e,{url:u.value,id:r.modelId},{autoInteract:!1}),le.value.forEach(e=>{e.motionName in en?ue.value[e.fileName]=e.motionName:ue.value[e.fileName]=$t}),S.value=e,_.value.stage.addChild(S.value),ee.value=S.value.width,te.value=S.value.height,S.value.anchor.set(.5,.5),se(),S.value.on(`hit`,e=>{S.value&&e.includes(`body`)&&S.value.motion(`tap_body`)});let t=S.value.internalModel,n=t.coreModel,i=t.motionManager;n.setParameterValueById(`ParamMouthOpenY`,ne.value),le.value=Object.entries(i.definitions).flatMap(([e,t])=>t?.map((t,n)=>({motionName:e,motionIndex:n,fileName:t.File}))||[]).filter(Boolean);let o=localStorage.getItem(`selected-runtime-motion-group`),s=localStorage.getItem(`selected-runtime-motion-index`);if(o&&s){let e=i.groups[o];if(e!==void 0&&i.motionGroups[e]){let t=Number.parseInt(s),n=i.motionGroups[e][t];n&&n._looper&&(n._looper.loopDuration=0,console.info(`Configured motion to loop infinitely:`,o,t))}}o&&s&&j.value&&setTimeout(()=>{console.info(`Playing selected runtime motion:`,o,s),ce.value={group:o,index:Number.parseInt(s)}},300),i.groups.idle&&i.motionGroups[i.groups.idle]?.forEach(e=>{e._motionData.curves.forEach(e=>{(e.id===`ParamEyeBallX`||e.id===`ParamEyeBallY`)&&(e.id=`_${e.id}`)})});let c=ka({internalModel:t,motionManager:i,modelParameters:A,live2dIdleAnimationEnabled:j,lastUpdateTime:T});c.register(Aa(he),`pre`),c.register(ja(),`pre`),c.register(Ma(),`post`),c.register(Na(),`post`);let l=i.update;i.update=function(e,t){return c.hookUpdate(e,t,l)},i.on(`motionStart`,(e,t)=>{me.value={group:e,index:t}}),i.on(`motionFinish`,()=>{let e=localStorage.getItem(`selected-runtime-motion-group`),t=localStorage.getItem(`selected-runtime-motion-index`);e&&t&&j.value&&(console.info(`Motion finished, restarting runtime motion:`,e,t),requestAnimationFrame(()=>{ce.value={group:e,index:Number.parseInt(t)}}))}),n.setParameterValueById(`ParamAngleX`,A.value.angleX),n.setParameterValueById(`ParamAngleY`,A.value.angleY),n.setParameterValueById(`ParamAngleZ`,A.value.angleZ),n.setParameterValueById(`ParamEyeLOpen`,A.value.leftEyeOpen),n.setParameterValueById(`ParamEyeROpen`,A.value.rightEyeOpen),n.setParameterValueById(`ParamEyeSmile`,A.value.leftEyeSmile),n.setParameterValueById(`ParamBrowLX`,A.value.leftEyebrowLR),n.setParameterValueById(`ParamBrowRX`,A.value.rightEyebrowLR),n.setParameterValueById(`ParamBrowLY`,A.value.leftEyebrowY),n.setParameterValueById(`ParamBrowRY`,A.value.rightEyebrowY),n.setParameterValueById(`ParamBrowLAngle`,A.value.leftEyebrowAngle),n.setParameterValueById(`ParamBrowRAngle`,A.value.rightEyebrowAngle),n.setParameterValueById(`ParamBrowLForm`,A.value.leftEyebrowForm),n.setParameterValueById(`ParamBrowRForm`,A.value.rightEyebrowForm),n.setParameterValueById(`ParamMouthOpenY`,A.value.mouthOpen),n.setParameterValueById(`ParamMouthForm`,A.value.mouthForm),n.setParameterValueById(`ParamCheek`,A.value.cheek),n.setParameterValueById(`ParamBodyAngleX`,A.value.bodyAngleX),n.setParameterValueById(`ParamBodyAngleY`,A.value.bodyAngleY),n.setParameterValueById(`ParamBodyAngleZ`,A.value.bodyAngleZ),n.setParameterValueById(`ParamBreath`,A.value.breath),a(`modelLoaded`)}finally{d.value=!1,c.value=`mounted`}}async function _e(e,t){if(!S.value){console.warn(`Cannot set motion: model not loaded`);return}console.info(`Setting motion:`,e,`index:`,t);try{await S.value.motion(e,t,vn.FORCE),console.info(`Motion started successfully:`,e)}catch(t){console.error(`Failed to start motion:`,e,t)}}let ve=nn(se,100),ye=w(),M=w(0);function N(){if(!S.value)return;if(!pe.value){S.value.filters=[];return}let e=getComputedStyle(ye.value).backgroundColor;oe.value.color=Number(un(e).replace(`#`,`0x`)),S.value.filters=[oe.value]}m([()=>r.width,()=>r.height],()=>ve()),m(u,async()=>await ge(),{immediate:!0}),m(E,N,{immediate:!0}),m([S,de],N),m(pe,N),m(g,se),m(()=>r.scale,se);function be(){if(N(),!pe.value){M.value=0;return}M.value=requestAnimationFrame(be)}m([fe,pe],([e,t])=>{e&&t?M.value=requestAnimationFrame(be):(cancelAnimationFrame(M.value),M.value=0)},{immediate:!0}),m(ne,e=>O().setParameterValueById(`ParamMouthOpenY`,e)),m(ce,e=>_e(e.group,e.index)),m(v,e=>e?_.value?.stop():_.value?.start()),m(()=>A.value.angleX,e=>{S.value&&S.value.internalModel.coreModel.setParameterValueById(`ParamAngleX`,e)}),m(()=>A.value.angleY,e=>{S.value&&S.value.internalModel.coreModel.setParameterValueById(`ParamAngleY`,e)}),m(()=>A.value.angleZ,e=>{S.value&&S.value.internalModel.coreModel.setParameterValueById(`ParamAngleZ`,e)}),m(()=>A.value.leftEyeOpen,e=>{S.value&&S.value.internalModel.coreModel.setParameterValueById(`ParamEyeLOpen`,e)}),m(()=>A.value.rightEyeOpen,e=>{S.value&&S.value.internalModel.coreModel.setParameterValueById(`ParamEyeROpen`,e)}),m(()=>A.value.mouthOpen,e=>{S.value&&S.value.internalModel.coreModel.setParameterValueById(`ParamMouthOpenY`,e)}),m(()=>A.value.mouthForm,e=>{S.value&&S.value.internalModel.coreModel.setParameterValueById(`ParamMouthForm`,e)}),m(()=>A.value.cheek,e=>{S.value&&S.value.internalModel.coreModel.setParameterValueById(`ParamCheek`,e)}),m(()=>A.value.bodyAngleX,e=>{S.value&&S.value.internalModel.coreModel.setParameterValueById(`ParamBodyAngleX`,e)}),m(()=>A.value.bodyAngleY,e=>{S.value&&S.value.internalModel.coreModel.setParameterValueById(`ParamBodyAngleY`,e)}),m(()=>A.value.bodyAngleZ,e=>{S.value&&S.value.internalModel.coreModel.setParameterValueById(`ParamBodyAngleZ`,e)}),m(()=>A.value.breath,e=>{S.value&&S.value.internalModel.coreModel.setParameterValueById(`ParamBreath`,e)}),m(()=>A.value.leftEyebrowLR,e=>{S.value&&S.value.internalModel.coreModel.setParameterValueById(`ParamBrowLX`,e)}),m(()=>A.value.rightEyebrowLR,e=>{S.value&&S.value.internalModel.coreModel.setParameterValueById(`ParamBrowRX`,e)}),m(()=>A.value.leftEyebrowY,e=>{S.value&&S.value.internalModel.coreModel.setParameterValueById(`ParamBrowLY`,e)}),m(()=>A.value.rightEyebrowY,e=>{S.value&&S.value.internalModel.coreModel.setParameterValueById(`ParamBrowRY`,e)}),m(()=>A.value.leftEyebrowAngle,e=>{S.value&&S.value.internalModel.coreModel.setParameterValueById(`ParamBrowLAngle`,e)}),m(()=>A.value.rightEyebrowAngle,e=>{S.value&&S.value.internalModel.coreModel.setParameterValueById(`ParamBrowRAngle`,e)}),m(()=>A.value.leftEyebrowForm,e=>{S.value&&S.value.internalModel.coreModel.setParameterValueById(`ParamBrowLForm`,e)}),m(()=>A.value.rightEyebrowForm,e=>{S.value&&S.value.internalModel.coreModel.setParameterValueById(`ParamBrowRForm`,e)}),m(j,e=>{if(!e&&S.value){let e=S.value.internalModel;e?.motionManager&&e.motionManager.stopAllMotions()}}),m(y,e=>{S.value&&(r.disableFocusAt||S.value.focus(e.x,e.y))}),f(()=>{let e=dn(()=>he.scheduleBeat());o(()=>e())}),f(async()=>{N()});function P(){return le.value}return t({setMotion:_e,listMotionGroups:P}),(void 0)?.dispose(()=>{console.warn(`[Dev] Reload on HMR dispose is active for this component. Performing a full reload.`),window.location.reload()}),(e,t)=>(s(),re(b,null,[ie(`div`,{ref_key:`dropShadowColorComputer`,ref:ye,hidden:``,bg:`primary-400 dark:primary-500`},null,512),p(e.$slots,`default`)],64))}}),Fa=e({__name:`Live2D`,props:u({modelSrc:{},modelId:{},paused:{type:Boolean,default:!1},mouthOpenSize:{default:0},focusAt:{default:()=>({x:0,y:0})},disableFocusAt:{type:Boolean}},{state:{default:`pending`},stateModifiers:{},canvasState:{default:`pending`},canvasStateModifiers:{},modelState:{default:`pending`},modelStateModifiers:{}}),emits:[`update:state`,`update:canvasState`,`update:modelState`],setup(e,{expose:t}){let n=x(e,`state`),r=x(e,`canvasState`),i=x(e,`modelState`),a=w(),{scale:o,position:c}=Zt(Pn());return m([i,r],()=>{n.value=i.value===`mounted`&&r.value===`mounted`?`mounted`:`loading`}),t({canvasElement:()=>a.value?.canvasElement()}),(t,n)=>(s(),d(Yt,{relative:``},{default:y(({width:t,height:s})=>[_(Fn,{ref_key:`live2dCanvasRef`,ref:a,state:r.value,"onUpdate:state":n[1]||=e=>r.value=e,width:t,height:s,resolution:2,"max-h":`100dvh`},{default:y(({app:r})=>[_(Pa,{state:i.value,"onUpdate:state":n[0]||=e=>i.value=e,"model-src":e.modelSrc,"model-id":e.modelId,app:r,"mouth-open-size":e.mouthOpenSize,width:t,height:s,paused:e.paused,"focus-at":e.focusAt,"x-offset":v(c).x,"y-offset":v(c).y,scale:v(o),"disable-focus-at":e.disableFocusAt},null,8,[`state`,`model-src`,`model-id`,`app`,`mouth-open-size`,`width`,`height`,`paused`,`focus-at`,`x-offset`,`y-offset`,`scale`,`disable-focus-at`])]),_:2},1032,[`state`,`width`,`height`])]),_:1}))}}),Ia=1/1e3,La=1e3,Ra=class{constructor(){this.startTime=performance.now(),this.previousTime=0,this.currentTime=0,this._delta=0,this._elapsed=0,this._fixedDelta=1e3/60,this.timescale=1,this.useFixedDelta=!1,this._autoReset=!1}get autoReset(){return this._autoReset}set autoReset(e){typeof document<`u`&&document.hidden!==void 0&&(e?document.addEventListener(`visibilitychange`,this):document.removeEventListener(`visibilitychange`,this),this._autoReset=e)}get delta(){return this._delta*Ia}get fixedDelta(){return this._fixedDelta*Ia}set fixedDelta(e){this._fixedDelta=e*La}get elapsed(){return this._elapsed*Ia}update(e){this.useFixedDelta?this._delta=this.fixedDelta:(this.previousTime=this.currentTime,this.currentTime=(e===void 0?performance.now():e)-this.startTime,this._delta=this.currentTime-this.previousTime),this._delta*=this.timescale,this._elapsed+=this._delta}reset(){this._delta=0,this._elapsed=0,this.currentTime=performance.now()-this.startTime}getDelta(){return this.delta}getElapsed(){return this.elapsed}handleEvent(e){document.hidden||(this.currentTime=performance.now()-this.startTime)}dispose(){this.autoReset=!1}},za=(()=>{let e=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),t=new Float32Array([0,0,2,0,0,2]),n=new Gt;return n.setAttribute(`position`,new V(e,3)),n.setAttribute(`uv`,new V(t,2)),n})(),Ba=class e{static get fullscreenGeometry(){return za}constructor(e=`Pass`,t=new Me,n=new Ut){this.name=e,this.renderer=null,this.scene=t,this.camera=n,this.screen=null,this.rtt=!0,this.needsSwap=!0,this.needsDepthTexture=!1,this.enabled=!0}get renderToScreen(){return!this.rtt}set renderToScreen(e){if(this.rtt===e){let t=this.fullscreenMaterial;t!==null&&(t.needsUpdate=!0),this.rtt=!e}}set mainScene(e){}set mainCamera(e){}setRenderer(e){this.renderer=e}isEnabled(){return this.enabled}setEnabled(e){this.enabled=e}get fullscreenMaterial(){return this.screen===null?null:this.screen.material}set fullscreenMaterial(t){let n=this.screen;n===null?(n=new it(e.fullscreenGeometry,t),n.frustumCulled=!1,this.scene===null&&(this.scene=new Me),this.scene.add(n),this.screen=n):n.material=t}getFullscreenMaterial(){return this.fullscreenMaterial}setFullscreenMaterial(e){this.fullscreenMaterial=e}getDepthTexture(){return null}setDepthTexture(e,t=dt){}render(e,t,n,r,i){throw Error(`Render method not implemented!`)}setSize(e,t){}initialize(e,t,n){}dispose(){for(let t of Object.keys(this)){let n=this[t];(n instanceof yt||n instanceof It||n instanceof ye||n instanceof e)&&this[t].dispose()}this.fullscreenMaterial!==null&&this.fullscreenMaterial.dispose()}},Va=class extends Ba{constructor(){super(`ClearMaskPass`,null,null),this.needsSwap=!1}render(e,t,n,r,i){let a=e.state.buffers.stencil;a.setLocked(!1),a.setTest(!1)}},Ha=`#ifdef COLOR_WRITE +`;(function(e){ya(t,e);function t(n){var r=this,i=Object.assign(t.defaults,n),a=i.maxKernelSize,o=ba(i,[`maxKernelSize`]);return r=e.call(this,xa,Sa.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})(W),Math.PI/180,180/Math.PI;function Ca(e,t,n){return(1-n)*e+n*t}function wa(e,t){return e+Math.random()*(t-e)}var Ta=400,Ea=[[.075,800],[.11,0],[.125,0],[.14,0],[.125,0],[.05,0],[.04,0],[.03,0],[.02,0],[1,0]];for(let e=1;e=e||i{p.handled=!0}};return l(o,p),!p.handled&&p.hookedUpdate&&p.hookedUpdate.call(n,e,c)&&(p.handled=!0),l(s,p),a.value=c,p.handled}return{register:c,hookUpdate:u}}function Aa(e){return t=>{e.updateTargets(t.now);let n=t.model.getParameterValueById(`ParamAngleX`),r=t.model.getParameterValueById(`ParamAngleY`),i=t.model.getParameterValueById(`ParamAngleZ`);{let r=e.targetX.value,i=n,a=e.velocityX.value,o=(120*(r-i)-16*a)/1;e.velocityX.value=a+o*t.timeDelta,n=i+e.velocityX.value*t.timeDelta,Math.abs(r-n)<.01&&Math.abs(e.velocityX.value)<.01&&(n=r,e.velocityX.value=0)}{let n=e.targetY.value,i=r,a=e.velocityY.value,o=(120*(n-i)-16*a)/1;e.velocityY.value=a+o*t.timeDelta,r=i+e.velocityY.value*t.timeDelta,Math.abs(n-r)<.01&&Math.abs(e.velocityY.value)<.01&&(r=n,e.velocityY.value=0)}{let n=e.targetZ.value,r=i,a=e.velocityZ.value,o=(120*(n-r)-16*a)/1;e.velocityZ.value=a+o*t.timeDelta,i=r+e.velocityZ.value*t.timeDelta,Math.abs(n-i)<.01&&Math.abs(e.velocityZ.value)<.01&&(i=n,e.velocityZ.value=0)}t.model.setParameterValueById(`ParamAngleX`,n),t.model.setParameterValueById(`ParamAngleY`,r),t.model.setParameterValueById(`ParamAngleZ`,i)}}function ja(e=Oa()){return t=>{t.handled||!t.live2dIdleAnimationEnabled.value&&t.isIdleMotion&&(t.motionManager.stopAllMotions(),e.update(t.internalModel,t.now),t.internalModel.eyeBlink!=null&&t.internalModel.eyeBlink.updateParameters(t.model,t.timeDelta/1e3),t.model.setParameterValueById(`ParamEyeLOpen`,t.modelParameters.value.leftEyeOpen),t.model.setParameterValueById(`ParamEyeROpen`,t.modelParameters.value.rightEyeOpen),t.markHandled())}}function Ma(e=Oa()){return t=>{!t.isIdleMotion||t.handled||e.update(t.internalModel,t.now)}}function Na(){return e=>{!e.isIdleMotion||e.handled||(e.internalModel.eyeBlink!=null&&e.internalModel.eyeBlink.updateParameters(e.model,e.timeDelta/1e3),e.model.setParameterValueById(`ParamEyeLOpen`,e.modelParameters.value.leftEyeOpen),e.model.setParameterValueById(`ParamEyeROpen`,e.modelParameters.value.rightEyeOpen),e.markHandled())}}var Pa=e({__name:`Model`,props:u({modelSrc:{},modelId:{},app:{},mouthOpenSize:{default:0},width:{},height:{},paused:{type:Boolean,default:!1},focusAt:{default:()=>({x:0,y:0})},disableFocusAt:{type:Boolean,default:!1},xOffset:{},yOffset:{},scale:{default:1}},{state:{default:`pending`},stateModifiers:{}}),emits:u([`modelLoaded`],[`update:state`]),setup(e,{expose:t,emit:n}){let r=e,a=n,c=x(e,`state`);function l(){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 u=i(()=>r.modelSrc),d=T(!1),g=!1,_=h(()=>l()),v=i(()=>r.app),y=i(()=>r.paused),S=i(()=>r.focusAt),C=T(),ee=T(0),te=T(0),E=h(()=>Math.max(0,Math.min(100,r.mouthOpenSize))),D=T(0),{isDark:O}=Xt(),ie=on(ln),ae=h(()=>ie.between(`sm`,`md`).value||ie.smaller(`sm`).value),k=w(new ri({alpha:.2,blur:0,distance:20,rotation:45}));function oe(){return C.value.internalModel.coreModel}function A(){if(!C.value)return;let e=2.2;ae.value&&(e=2.2);let t=r.height*.95/te.value*e,n=r.width*.95/ee.value*e,i=Math.min(t,n);C.value.scale.set(i*r.scale,i*r.scale),C.value.x=r.width/2+_.value.xOffset,C.value.y=r.height+_.value.yOffset}let se=Pn(),{currentMotion:ce,availableMotions:le,motionMap:ue,modelParameters:j}=Zt(se),{themeColorsHue:de,themeColorsHueDynamic:fe,live2dIdleAnimationEnabled:pe,live2dShadowEnabled:me}=Zt(Tn()),he=T({group:`Idle`,index:0}),ge=Nn({baseAngles:()=>({x:j.value.angleX,y:j.value.angleY,z:j.value.angleZ}),initialStyle:`sway-sine`});se.onShouldUpdateView(()=>{_e()});async function _e(){if(await tn(d).not.toBeTruthy(),d.value=!0,c.value=`loading`,!v.value||!v.value.stage)try{await tn(()=>!!v.value&&!!v.value.stage).toBeTruthy({timeout:1500})}catch{d.value=!1,c.value=`mounted`;return}if(C.value&&v.value?.stage){try{v.value.stage.removeChild(C.value),C.value.destroy()}catch(e){console.warn(`Error removing old model:`,e)}C.value=void 0}if(!u.value){console.warn(`No Live2D model source provided.`),d.value=!1,c.value=`mounted`;return}try{if(g){d.value=!1,c.value=`mounted`;return}let e=new On;await En.setupLive2DModel(e,{url:u.value,id:r.modelId},{autoInteract:!1}),le.value.forEach(e=>{e.motionName in en?ue.value[e.fileName]=e.motionName:ue.value[e.fileName]=$t}),C.value=e,v.value.stage.addChild(C.value),ee.value=C.value.width,te.value=C.value.height,C.value.anchor.set(.5,.5),A(),C.value.on(`hit`,e=>{C.value&&e.includes(`body`)&&C.value.motion(`tap_body`)});let t=C.value.internalModel,n=t.coreModel,i=t.motionManager;n.setParameterValueById(`ParamMouthOpenY`,E.value),le.value=Object.entries(i.definitions).flatMap(([e,t])=>t?.map((t,n)=>({motionName:e,motionIndex:n,fileName:t.File}))||[]).filter(Boolean);let o=localStorage.getItem(`selected-runtime-motion-group`),s=localStorage.getItem(`selected-runtime-motion-index`);if(o&&s){let e=i.groups[o];if(e!==void 0&&i.motionGroups[e]){let t=Number.parseInt(s),n=i.motionGroups[e][t];n&&n._looper&&(n._looper.loopDuration=0,console.info(`Configured motion to loop infinitely:`,o,t))}}o&&s&&pe.value&&setTimeout(()=>{console.info(`Playing selected runtime motion:`,o,s),ce.value={group:o,index:Number.parseInt(s)}},300),i.groups.idle&&i.motionGroups[i.groups.idle]?.forEach(e=>{e._motionData.curves.forEach(e=>{(e.id===`ParamEyeBallX`||e.id===`ParamEyeBallY`)&&(e.id=`_${e.id}`)})});let l=ka({internalModel:t,motionManager:i,modelParameters:j,live2dIdleAnimationEnabled:pe,lastUpdateTime:D});l.register(Aa(ge),`pre`),l.register(ja(),`pre`),l.register(Ma(),`post`),l.register(Na(),`post`);let f=i.update;i.update=function(e,t){return l.hookUpdate(e,t,f)},i.on(`motionStart`,(e,t)=>{he.value={group:e,index:t}}),i.on(`motionFinish`,()=>{let e=localStorage.getItem(`selected-runtime-motion-group`),t=localStorage.getItem(`selected-runtime-motion-index`);e&&t&&pe.value&&(console.info(`Motion finished, restarting runtime motion:`,e,t),requestAnimationFrame(()=>{ce.value={group:e,index:Number.parseInt(t)}}))}),n.setParameterValueById(`ParamAngleX`,j.value.angleX),n.setParameterValueById(`ParamAngleY`,j.value.angleY),n.setParameterValueById(`ParamAngleZ`,j.value.angleZ),n.setParameterValueById(`ParamEyeLOpen`,j.value.leftEyeOpen),n.setParameterValueById(`ParamEyeROpen`,j.value.rightEyeOpen),n.setParameterValueById(`ParamEyeSmile`,j.value.leftEyeSmile),n.setParameterValueById(`ParamBrowLX`,j.value.leftEyebrowLR),n.setParameterValueById(`ParamBrowRX`,j.value.rightEyebrowLR),n.setParameterValueById(`ParamBrowLY`,j.value.leftEyebrowY),n.setParameterValueById(`ParamBrowRY`,j.value.rightEyebrowY),n.setParameterValueById(`ParamBrowLAngle`,j.value.leftEyebrowAngle),n.setParameterValueById(`ParamBrowRAngle`,j.value.rightEyebrowAngle),n.setParameterValueById(`ParamBrowLForm`,j.value.leftEyebrowForm),n.setParameterValueById(`ParamBrowRForm`,j.value.rightEyebrowForm),n.setParameterValueById(`ParamMouthOpenY`,j.value.mouthOpen),n.setParameterValueById(`ParamMouthForm`,j.value.mouthForm),n.setParameterValueById(`ParamCheek`,j.value.cheek),n.setParameterValueById(`ParamBodyAngleX`,j.value.bodyAngleX),n.setParameterValueById(`ParamBodyAngleY`,j.value.bodyAngleY),n.setParameterValueById(`ParamBodyAngleZ`,j.value.bodyAngleZ),n.setParameterValueById(`ParamBreath`,j.value.breath),a(`modelLoaded`)}finally{d.value=!1,c.value=`mounted`}}async function ve(e,t){if(!C.value){console.warn(`Cannot set motion: model not loaded`);return}console.info(`Setting motion:`,e,`index:`,t);try{await C.value.motion(e,t,vn.FORCE),console.info(`Motion started successfully:`,e)}catch(t){console.error(`Failed to start motion:`,e,t)}}let ye=nn(A,100),be=T(),M=T(0);function xe(){if(!C.value)return;if(!me.value){C.value.filters=[];return}let e=getComputedStyle(be.value).backgroundColor;k.value.color=Number(un(e).replace(`#`,`0x`)),C.value.filters=[k.value]}m([()=>r.width,()=>r.height],()=>ye()),m(u,async()=>await _e(),{immediate:!0}),m(O,xe,{immediate:!0}),m([C,de],xe),m(me,xe),m(_,A),m(()=>r.scale,A);function N(){if(xe(),!me.value){M.value=0;return}M.value=requestAnimationFrame(N)}m([fe,me],([e,t])=>{e&&t?M.value=requestAnimationFrame(N):(cancelAnimationFrame(M.value),M.value=0)},{immediate:!0}),m(E,e=>oe().setParameterValueById(`ParamMouthOpenY`,e)),m(ce,e=>ve(e.group,e.index)),m(y,e=>e?v.value?.stop():v.value?.start()),m(()=>j.value.angleX,e=>{C.value&&C.value.internalModel.coreModel.setParameterValueById(`ParamAngleX`,e)}),m(()=>j.value.angleY,e=>{C.value&&C.value.internalModel.coreModel.setParameterValueById(`ParamAngleY`,e)}),m(()=>j.value.angleZ,e=>{C.value&&C.value.internalModel.coreModel.setParameterValueById(`ParamAngleZ`,e)}),m(()=>j.value.leftEyeOpen,e=>{C.value&&C.value.internalModel.coreModel.setParameterValueById(`ParamEyeLOpen`,e)}),m(()=>j.value.rightEyeOpen,e=>{C.value&&C.value.internalModel.coreModel.setParameterValueById(`ParamEyeROpen`,e)}),m(()=>j.value.mouthOpen,e=>{C.value&&C.value.internalModel.coreModel.setParameterValueById(`ParamMouthOpenY`,e)}),m(()=>j.value.mouthForm,e=>{C.value&&C.value.internalModel.coreModel.setParameterValueById(`ParamMouthForm`,e)}),m(()=>j.value.cheek,e=>{C.value&&C.value.internalModel.coreModel.setParameterValueById(`ParamCheek`,e)}),m(()=>j.value.bodyAngleX,e=>{C.value&&C.value.internalModel.coreModel.setParameterValueById(`ParamBodyAngleX`,e)}),m(()=>j.value.bodyAngleY,e=>{C.value&&C.value.internalModel.coreModel.setParameterValueById(`ParamBodyAngleY`,e)}),m(()=>j.value.bodyAngleZ,e=>{C.value&&C.value.internalModel.coreModel.setParameterValueById(`ParamBodyAngleZ`,e)}),m(()=>j.value.breath,e=>{C.value&&C.value.internalModel.coreModel.setParameterValueById(`ParamBreath`,e)}),m(()=>j.value.leftEyebrowLR,e=>{C.value&&C.value.internalModel.coreModel.setParameterValueById(`ParamBrowLX`,e)}),m(()=>j.value.rightEyebrowLR,e=>{C.value&&C.value.internalModel.coreModel.setParameterValueById(`ParamBrowRX`,e)}),m(()=>j.value.leftEyebrowY,e=>{C.value&&C.value.internalModel.coreModel.setParameterValueById(`ParamBrowLY`,e)}),m(()=>j.value.rightEyebrowY,e=>{C.value&&C.value.internalModel.coreModel.setParameterValueById(`ParamBrowRY`,e)}),m(()=>j.value.leftEyebrowAngle,e=>{C.value&&C.value.internalModel.coreModel.setParameterValueById(`ParamBrowLAngle`,e)}),m(()=>j.value.rightEyebrowAngle,e=>{C.value&&C.value.internalModel.coreModel.setParameterValueById(`ParamBrowRAngle`,e)}),m(()=>j.value.leftEyebrowForm,e=>{C.value&&C.value.internalModel.coreModel.setParameterValueById(`ParamBrowLForm`,e)}),m(()=>j.value.rightEyebrowForm,e=>{C.value&&C.value.internalModel.coreModel.setParameterValueById(`ParamBrowRForm`,e)}),m(pe,e=>{if(!e&&C.value){let e=C.value.internalModel;e?.motionManager&&e.motionManager.stopAllMotions()}}),m(S,e=>{C.value&&(r.disableFocusAt||C.value.focus(e.x,e.y))}),f(()=>{let e=dn(()=>ge.scheduleBeat());o(()=>e())}),f(async()=>{xe()}),o(()=>{g=!0});function Se(){return le.value}return t({setMotion:ve,listMotionGroups:Se}),(void 0)?.dispose(()=>{console.warn(`[Dev] Reload on HMR dispose is active for this component. Performing a full reload.`),window.location.reload()}),(e,t)=>(s(),ne(b,null,[re(`div`,{ref_key:`dropShadowColorComputer`,ref:be,hidden:``,bg:`primary-400 dark:primary-500`},null,512),p(e.$slots,`default`)],64))}}),Fa=e({__name:`Live2D`,props:u({modelSrc:{},modelId:{},paused:{type:Boolean,default:!1},mouthOpenSize:{default:0},focusAt:{default:()=>({x:0,y:0})},disableFocusAt:{type:Boolean}},{state:{default:`pending`},stateModifiers:{},canvasState:{default:`pending`},canvasStateModifiers:{},modelState:{default:`pending`},modelStateModifiers:{}}),emits:[`update:state`,`update:canvasState`,`update:modelState`],setup(e,{expose:t}){let n=x(e,`state`),r=x(e,`canvasState`),i=x(e,`modelState`),a=T(),{scale:o,position:c}=Zt(Pn());return m([i,r],()=>{n.value=i.value===`mounted`&&r.value===`mounted`?`mounted`:`loading`}),t({canvasElement:()=>a.value?.canvasElement()}),(t,n)=>(s(),d(Yt,{relative:``},{default:y(({width:t,height:s})=>[_(Fn,{ref_key:`live2dCanvasRef`,ref:a,state:r.value,"onUpdate:state":n[1]||=e=>r.value=e,width:t,height:s,resolution:2,"max-h":`100dvh`},{default:y(({app:r})=>[_(Pa,{state:i.value,"onUpdate:state":n[0]||=e=>i.value=e,"model-src":e.modelSrc,"model-id":e.modelId,app:r,"mouth-open-size":e.mouthOpenSize,width:t,height:s,paused:e.paused,"focus-at":e.focusAt,"x-offset":v(c).x,"y-offset":v(c).y,scale:v(o),"disable-focus-at":e.disableFocusAt},null,8,[`state`,`model-src`,`model-id`,`app`,`mouth-open-size`,`width`,`height`,`paused`,`focus-at`,`x-offset`,`y-offset`,`scale`,`disable-focus-at`])]),_:2},1032,[`state`,`width`,`height`])]),_:1}))}}),Ia=1/1e3,La=1e3,Ra=class{constructor(){this.startTime=performance.now(),this.previousTime=0,this.currentTime=0,this._delta=0,this._elapsed=0,this._fixedDelta=1e3/60,this.timescale=1,this.useFixedDelta=!1,this._autoReset=!1}get autoReset(){return this._autoReset}set autoReset(e){typeof document<`u`&&document.hidden!==void 0&&(e?document.addEventListener(`visibilitychange`,this):document.removeEventListener(`visibilitychange`,this),this._autoReset=e)}get delta(){return this._delta*Ia}get fixedDelta(){return this._fixedDelta*Ia}set fixedDelta(e){this._fixedDelta=e*La}get elapsed(){return this._elapsed*Ia}update(e){this.useFixedDelta?this._delta=this.fixedDelta:(this.previousTime=this.currentTime,this.currentTime=(e===void 0?performance.now():e)-this.startTime,this._delta=this.currentTime-this.previousTime),this._delta*=this.timescale,this._elapsed+=this._delta}reset(){this._delta=0,this._elapsed=0,this.currentTime=performance.now()-this.startTime}getDelta(){return this.delta}getElapsed(){return this.elapsed}handleEvent(e){document.hidden||(this.currentTime=performance.now()-this.startTime)}dispose(){this.autoReset=!1}},za=(()=>{let e=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),t=new Float32Array([0,0,2,0,0,2]),n=new Gt;return n.setAttribute(`position`,new V(e,3)),n.setAttribute(`uv`,new V(t,2)),n})(),Ba=class e{static get fullscreenGeometry(){return za}constructor(e=`Pass`,t=new Me,n=new Ut){this.name=e,this.renderer=null,this.scene=t,this.camera=n,this.screen=null,this.rtt=!0,this.needsSwap=!0,this.needsDepthTexture=!1,this.enabled=!0}get renderToScreen(){return!this.rtt}set renderToScreen(e){if(this.rtt===e){let t=this.fullscreenMaterial;t!==null&&(t.needsUpdate=!0),this.rtt=!e}}set mainScene(e){}set mainCamera(e){}setRenderer(e){this.renderer=e}isEnabled(){return this.enabled}setEnabled(e){this.enabled=e}get fullscreenMaterial(){return this.screen===null?null:this.screen.material}set fullscreenMaterial(t){let n=this.screen;n===null?(n=new it(e.fullscreenGeometry,t),n.frustumCulled=!1,this.scene===null&&(this.scene=new Me),this.scene.add(n),this.screen=n):n.material=t}getFullscreenMaterial(){return this.fullscreenMaterial}setFullscreenMaterial(e){this.fullscreenMaterial=e}getDepthTexture(){return null}setDepthTexture(e,t=dt){}render(e,t,n,r,i){throw Error(`Render method not implemented!`)}setSize(e,t){}initialize(e,t,n){}dispose(){for(let t of Object.keys(this)){let n=this[t];(n instanceof yt||n instanceof It||n instanceof ye||n instanceof e)&&this[t].dispose()}this.fullscreenMaterial!==null&&this.fullscreenMaterial.dispose()}},Va=class extends Ba{constructor(){super(`ClearMaskPass`,null,null),this.needsSwap=!1}render(e,t,n,r,i){let a=e.state.buffers.stencil;a.setLocked(!1),a.setTest(!1)}},Ha=`#ifdef COLOR_WRITE #include #include #ifdef FRAMEBUFFER_PRECISION_HIGH @@ -1889,7 +1889,7 @@ gl_FragColor=vec4(0.0); #ifdef DEPTH_WRITE gl_FragDepth=readDepth(vUv); #endif -}`,Ua=`varying vec2 vUv;void main(){vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}`,Wa=class extends Jt{constructor(){super({name:`CopyMaterial`,defines:{DEPTH_PACKING:`0`,COLOR_WRITE:`1`},uniforms:{inputBuffer:new E(null),depthBuffer:new E(null),channelWeights:new E(null),opacity:new E(1)},blending:0,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:Ha,vertexShader:Ua}),this.depthFunc=1}get inputBuffer(){return this.uniforms.inputBuffer.value}set inputBuffer(e){let t=e!==null;this.colorWrite!==t&&(t?this.defines.COLOR_WRITE=!0:delete this.defines.COLOR_WRITE,this.colorWrite=t,this.needsUpdate=!0),this.uniforms.inputBuffer.value=e}get depthBuffer(){return this.uniforms.depthBuffer.value}set depthBuffer(e){let t=e!==null;this.depthWrite!==t&&(t?this.defines.DEPTH_WRITE=!0:delete this.defines.DEPTH_WRITE,this.depthTest=t,this.depthWrite=t,this.needsUpdate=!0),this.uniforms.depthBuffer.value=e}set depthPacking(e){this.defines.DEPTH_PACKING=e.toFixed(0),this.needsUpdate=!0}get channelWeights(){return this.uniforms.channelWeights.value}set channelWeights(e){e===null?delete this.defines.USE_WEIGHTS:(this.defines.USE_WEIGHTS=`1`,this.uniforms.channelWeights.value=e),this.needsUpdate=!0}setInputBuffer(e){this.uniforms.inputBuffer.value=e}getOpacity(e){return this.uniforms.opacity.value}setOpacity(e){this.uniforms.opacity.value=e}},Ga=class extends Ba{constructor(e,t=!0){super(`CopyPass`),this.fullscreenMaterial=new Wa,this.needsSwap=!1,this.renderTarget=e,e===void 0&&(this.renderTarget=new yt(1,1,{minFilter:ot,magFilter:ot,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name=`CopyPass.Target`),this.autoResize=t}get resize(){return this.autoResize}set resize(e){this.autoResize=e}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}setAutoResizeEnabled(e){this.autoResize=e}render(e,t,n,r,i){this.fullscreenMaterial.inputBuffer=t.texture,e.setRenderTarget(this.renderToScreen?null:this.renderTarget),e.render(this.scene,this.camera)}setSize(e,t){this.autoResize&&this.renderTarget.setSize(e,t)}initialize(e,t,n){n!==void 0&&(this.renderTarget.texture.type=n,n===1009?e!==null&&e.outputColorSpace===`srgb`&&(this.renderTarget.texture.colorSpace=P):this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH=`1`)}},Ka=new H,qa=class extends Ba{constructor(e=!0,t=!0,n=!1){super(`ClearPass`,null,null),this.needsSwap=!1,this.color=e,this.depth=t,this.stencil=n,this.overrideClearColor=null,this.overrideClearAlpha=-1}setClearFlags(e,t,n){this.color=e,this.depth=t,this.stencil=n}getOverrideClearColor(){return this.overrideClearColor}setOverrideClearColor(e){this.overrideClearColor=e}getOverrideClearAlpha(){return this.overrideClearAlpha}setOverrideClearAlpha(e){this.overrideClearAlpha=e}render(e,t,n,r,i){let a=this.overrideClearColor,o=this.overrideClearAlpha,s=e.getClearAlpha(),c=a!==null,l=o>=0;c?(e.getClearColor(Ka),e.setClearColor(a,l?o:s)):l&&e.setClearAlpha(o),e.setRenderTarget(this.renderToScreen?null:t),e.clear(this.color,this.depth,this.stencil),c?e.setClearColor(Ka,s):l&&e.setClearAlpha(s)}},Ja=class extends Ba{constructor(e,t){super(`MaskPass`,e,t),this.needsSwap=!1,this.clearPass=new qa(!1,!1,!0),this.inverse=!1}set mainScene(e){this.scene=e}set mainCamera(e){this.camera=e}get inverted(){return this.inverse}set inverted(e){this.inverse=e}get clear(){return this.clearPass.enabled}set clear(e){this.clearPass.enabled=e}getClearPass(){return this.clearPass}isInverted(){return this.inverted}setInverted(e){this.inverted=e}render(e,t,n,r,i){let a=e.getContext(),o=e.state.buffers,s=this.scene,c=this.camera,l=this.clearPass,u=this.inverted?0:1,d=1-u;o.color.setMask(!1),o.depth.setMask(!1),o.color.setLocked(!0),o.depth.setLocked(!0),o.stencil.setTest(!0),o.stencil.setOp(a.REPLACE,a.REPLACE,a.REPLACE),o.stencil.setFunc(a.ALWAYS,u,4294967295),o.stencil.setClear(d),o.stencil.setLocked(!0),this.clearPass.enabled&&(this.renderToScreen?l.render(e,null):(l.render(e,t),l.render(e,n))),this.renderToScreen?(e.setRenderTarget(null),e.render(s,c)):(e.setRenderTarget(t),e.render(s,c),e.setRenderTarget(n),e.render(s,c)),o.color.setLocked(!1),o.depth.setLocked(!1),o.stencil.setLocked(!1),o.stencil.setFunc(a.EQUAL,1,4294967295),o.stencil.setOp(a.KEEP,a.KEEP,a.KEEP),o.stencil.setLocked(!0)}},Ya=class{constructor(e=null,{depthBuffer:t=!0,stencilBuffer:n=!1,multisampling:r=0,frameBufferType:i}={}){this.renderer=null,this.inputBuffer=this.createBuffer(t,n,i,r),this.outputBuffer=this.inputBuffer.clone(),this.copyPass=new Ga,this.depthTexture=null,this.passes=[],this.timer=new Ra,this.autoRenderToScreen=!0,this.setRenderer(e)}get multisampling(){return this.inputBuffer.samples||0}set multisampling(e){let t=this.inputBuffer,n=this.multisampling;n>0&&e>0?(this.inputBuffer.samples=e,this.outputBuffer.samples=e,this.inputBuffer.dispose(),this.outputBuffer.dispose()):n!==e&&(this.inputBuffer.dispose(),this.outputBuffer.dispose(),this.inputBuffer=this.createBuffer(t.depthBuffer,t.stencilBuffer,t.texture.type,e),this.inputBuffer.depthTexture=this.depthTexture,this.outputBuffer=this.inputBuffer.clone())}getTimer(){return this.timer}getRenderer(){return this.renderer}setRenderer(e){if(this.renderer=e,e!==null){let t=e.getSize(new L),n=e.getContext().getContextAttributes().alpha,r=this.inputBuffer.texture.type;r===1009&&e.outputColorSpace===`srgb`&&(this.inputBuffer.texture.colorSpace=P,this.outputBuffer.texture.colorSpace=P,this.inputBuffer.dispose(),this.outputBuffer.dispose()),e.autoClear=!1,this.setSize(t.width,t.height);for(let t of this.passes)t.initialize(e,n,r)}}replaceRenderer(e,t=!0){let n=this.renderer,r=n.domElement.parentNode;return this.setRenderer(e),t&&r!==null&&(r.removeChild(n.domElement),r.appendChild(e.domElement)),n}createDepthTexture(){let e=this.depthTexture=new ce;return this.inputBuffer.depthTexture=e,this.inputBuffer.dispose(),this.inputBuffer.stencilBuffer?(e.format=ue,e.type=wt):e.type=Nt,e}deleteDepthTexture(){if(this.depthTexture!==null){this.depthTexture.dispose(),this.depthTexture=null,this.inputBuffer.depthTexture=null,this.inputBuffer.dispose();for(let e of this.passes)e.setDepthTexture(null)}}createBuffer(e,t,n,r){let i=this.renderer,a=i===null?new L:i.getDrawingBufferSize(new L),o={minFilter:ot,magFilter:ot,stencilBuffer:t,depthBuffer:e,type:n},s=new yt(a.width,a.height,o);return r>0&&(s.samples=r),n===1009&&i!==null&&i.outputColorSpace===`srgb`&&(s.texture.colorSpace=P),s.texture.name=`EffectComposer.Buffer`,s.texture.generateMipmaps=!1,s}setMainScene(e){for(let t of this.passes)t.mainScene=e}setMainCamera(e){for(let t of this.passes)t.mainCamera=e}addPass(e,t){let n=this.passes,r=this.renderer,i=r.getDrawingBufferSize(new L),a=r.getContext().getContextAttributes().alpha,o=this.inputBuffer.texture.type;if(e.setRenderer(r),e.setSize(i.width,i.height),e.initialize(r,a,o),this.autoRenderToScreen&&(n.length>0&&(n[n.length-1].renderToScreen=!1),e.renderToScreen&&(this.autoRenderToScreen=!1)),t===void 0?n.push(e):n.splice(t,0,e),this.autoRenderToScreen&&(n[n.length-1].renderToScreen=!0),e.needsDepthTexture||this.depthTexture!==null)if(this.depthTexture===null){let t=this.createDepthTexture();for(e of n)e.setDepthTexture(t)}else e.setDepthTexture(this.depthTexture)}removePass(e){let t=this.passes,n=t.indexOf(e);n!==-1&&t.splice(n,1).length>0&&(this.depthTexture!==null&&(t.reduce((e,t)=>e||t.needsDepthTexture,!1)||(e.getDepthTexture()===this.depthTexture&&e.setDepthTexture(null),this.deleteDepthTexture())),this.autoRenderToScreen&&n===t.length&&(e.renderToScreen=!1,t.length>0&&(t[t.length-1].renderToScreen=!0)))}removeAllPasses(){let e=this.passes;this.deleteDepthTexture(),e.length>0&&(this.autoRenderToScreen&&(e[e.length-1].renderToScreen=!1),this.passes=[])}render(e){let t=this.renderer,n=this.copyPass,r=this.inputBuffer,i=this.outputBuffer,a=!1,o,s,c;e===void 0&&(this.timer.update(),e=this.timer.getDelta());for(let l of this.passes)l.enabled&&(l.render(t,r,i,e,a),l.needsSwap&&(a&&(n.renderToScreen=l.renderToScreen,o=t.getContext(),s=t.state.buffers.stencil,s.setFunc(o.NOTEQUAL,1,4294967295),n.render(t,r,i,e,a),s.setFunc(o.EQUAL,1,4294967295)),c=r,r=i,i=c),l instanceof Ja?a=!0:l instanceof Va&&(a=!1))}setSize(e,t,n){let r=this.renderer,i=r.getSize(new L);(e===void 0||t===void 0)&&(e=i.width,t=i.height),(i.width!==e||i.height!==t)&&r.setSize(e,t,n);let a=r.getDrawingBufferSize(new L);this.inputBuffer.setSize(a.width,a.height),this.outputBuffer.setSize(a.width,a.height);for(let e of this.passes)e.setSize(a.width,a.height)}reset(){this.dispose(),this.autoRenderToScreen=!0}dispose(){for(let e of this.passes)e.dispose();this.passes=[],this.inputBuffer!==null&&this.inputBuffer.dispose(),this.outputBuffer!==null&&this.outputBuffer.dispose(),this.deleteDepthTexture(),this.copyPass.dispose(),this.timer.dispose(),Ba.fullscreenGeometry.dispose()}},Xa={NONE:0,DEPTH:1,CONVOLUTION:2},G={FRAGMENT_HEAD:`FRAGMENT_HEAD`,FRAGMENT_MAIN_UV:`FRAGMENT_MAIN_UV`,FRAGMENT_MAIN_IMAGE:`FRAGMENT_MAIN_IMAGE`,VERTEX_HEAD:`VERTEX_HEAD`,VERTEX_MAIN_SUPPORT:`VERTEX_MAIN_SUPPORT`},Za=class{constructor(){this.shaderParts=new Map([[G.FRAGMENT_HEAD,null],[G.FRAGMENT_MAIN_UV,null],[G.FRAGMENT_MAIN_IMAGE,null],[G.VERTEX_HEAD,null],[G.VERTEX_MAIN_SUPPORT,null]]),this.defines=new Map,this.uniforms=new Map,this.blendModes=new Map,this.extensions=new Set,this.attributes=Xa.NONE,this.varyings=new Set,this.uvTransformation=!1,this.readDepth=!1,this.colorSpace=z}},Qa=!1,$a=class{constructor(e=null){this.originalMaterials=new Map,this.material=null,this.materials=null,this.materialsBackSide=null,this.materialsDoubleSide=null,this.materialsFlatShaded=null,this.materialsFlatShadedBackSide=null,this.materialsFlatShadedDoubleSide=null,this.setMaterial(e),this.meshCount=0,this.replaceMaterial=e=>{if(e.isMesh){let t;if(e.material.flatShading)switch(e.material.side){case 2:t=this.materialsFlatShadedDoubleSide;break;case 1:t=this.materialsFlatShadedBackSide;break;default:t=this.materialsFlatShaded;break}else switch(e.material.side){case 2:t=this.materialsDoubleSide;break;case 1:t=this.materialsBackSide;break;default:t=this.materials;break}this.originalMaterials.set(e,e.material),e.isSkinnedMesh?e.material=t[2]:e.isInstancedMesh?e.material=t[1]:e.material=t[0],++this.meshCount}}}cloneMaterial(e){if(!(e instanceof Jt))return e.clone();let t=e.uniforms,n=new Map;for(let e in t){let r=t[e].value;r.isRenderTargetTexture&&(t[e].value=null,n.set(e,r))}let r=e.clone();for(let e of n)t[e[0]].value=e[1],r.uniforms[e[0]].value=e[1];return r}setMaterial(e){if(this.disposeMaterials(),this.material=e,e!==null){let t=this.materials=[this.cloneMaterial(e),this.cloneMaterial(e),this.cloneMaterial(e)];for(let n of t)n.uniforms=Object.assign({},e.uniforms),n.side=0;t[2].skinning=!0,this.materialsBackSide=t.map(t=>{let n=this.cloneMaterial(t);return n.uniforms=Object.assign({},e.uniforms),n.side=1,n}),this.materialsDoubleSide=t.map(t=>{let n=this.cloneMaterial(t);return n.uniforms=Object.assign({},e.uniforms),n.side=2,n}),this.materialsFlatShaded=t.map(t=>{let n=this.cloneMaterial(t);return n.uniforms=Object.assign({},e.uniforms),n.flatShading=!0,n}),this.materialsFlatShadedBackSide=t.map(t=>{let n=this.cloneMaterial(t);return n.uniforms=Object.assign({},e.uniforms),n.flatShading=!0,n.side=1,n}),this.materialsFlatShadedDoubleSide=t.map(t=>{let n=this.cloneMaterial(t);return n.uniforms=Object.assign({},e.uniforms),n.flatShading=!0,n.side=2,n})}}render(e,t,n){let r=e.shadowMap.enabled;if(e.shadowMap.enabled=!1,Qa){let r=this.originalMaterials;this.meshCount=0,t.traverse(this.replaceMaterial),e.render(t,n);for(let e of r)e[0].material=e[1];this.meshCount!==r.size&&r.clear()}else{let r=t.overrideMaterial;t.overrideMaterial=this.material,e.render(t,n),t.overrideMaterial=r}e.shadowMap.enabled=r}disposeMaterials(){if(this.material!==null){let e=this.materials.concat(this.materialsBackSide).concat(this.materialsDoubleSide).concat(this.materialsFlatShaded).concat(this.materialsFlatShadedBackSide).concat(this.materialsFlatShadedDoubleSide);for(let t of e)t.dispose()}}dispose(){this.originalMaterials.clear(),this.disposeMaterials()}static get workaroundEnabled(){return Qa}static set workaroundEnabled(e){Qa=e}},eo=-1,to=class extends Ce{constructor(e,t=eo,n=eo,r=1){super(),this.resizable=e,this.baseSize=new L(1,1),this.preferredSize=new L(t,n),this.target=this.preferredSize,this.s=r,this.effectiveSize=new L,this.addEventListener(`change`,()=>this.updateEffectiveSize()),this.updateEffectiveSize()}updateEffectiveSize(){let e=this.baseSize,t=this.preferredSize,n=this.effectiveSize,r=this.scale;t.width===eo?t.height===eo?n.width=Math.round(e.width*r):n.width=Math.round(t.height*(e.width/Math.max(e.height,1))):n.width=t.width,t.height===eo?t.width===eo?n.height=Math.round(e.height*r):n.height=Math.round(t.width/Math.max(e.width/Math.max(e.height,1),1)):n.height=t.height}get width(){return this.effectiveSize.width}set width(e){this.preferredWidth=e}get height(){return this.effectiveSize.height}set height(e){this.preferredHeight=e}getWidth(){return this.width}getHeight(){return this.height}get scale(){return this.s}set scale(e){this.s!==e&&(this.s=e,this.preferredSize.setScalar(eo),this.dispatchEvent({type:`change`}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getScale(){return this.scale}setScale(e){this.scale=e}get baseWidth(){return this.baseSize.width}set baseWidth(e){this.baseSize.width!==e&&(this.baseSize.width=e,this.dispatchEvent({type:`change`}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getBaseWidth(){return this.baseWidth}setBaseWidth(e){this.baseWidth=e}get baseHeight(){return this.baseSize.height}set baseHeight(e){this.baseSize.height!==e&&(this.baseSize.height=e,this.dispatchEvent({type:`change`}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getBaseHeight(){return this.baseHeight}setBaseHeight(e){this.baseHeight=e}setBaseSize(e,t){(this.baseSize.width!==e||this.baseSize.height!==t)&&(this.baseSize.set(e,t),this.dispatchEvent({type:`change`}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}get preferredWidth(){return this.preferredSize.width}set preferredWidth(e){this.preferredSize.width!==e&&(this.preferredSize.width=e,this.dispatchEvent({type:`change`}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getPreferredWidth(){return this.preferredWidth}setPreferredWidth(e){this.preferredWidth=e}get preferredHeight(){return this.preferredSize.height}set preferredHeight(e){this.preferredSize.height!==e&&(this.preferredSize.height=e,this.dispatchEvent({type:`change`}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getPreferredHeight(){return this.preferredHeight}setPreferredHeight(e){this.preferredHeight=e}setPreferredSize(e,t){(this.preferredSize.width!==e||this.preferredSize.height!==t)&&(this.preferredSize.set(e,t),this.dispatchEvent({type:`change`}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}copy(e){this.s=e.scale,this.baseSize.set(e.baseWidth,e.baseHeight),this.preferredSize.set(e.preferredWidth,e.preferredHeight),this.dispatchEvent({type:`change`}),this.resizable.setSize(this.baseSize.width,this.baseSize.height)}static get AUTO_SIZE(){return eo}},K={SKIP:9,SET:30,ADD:0,ALPHA:23,AVERAGE:2,COLOR:3,COLOR_BURN:4,COLOR_DODGE:5,DARKEN:6,DIFFERENCE:7,DIVIDE:8,DST:9,EXCLUSION:10,HARD_LIGHT:11,HARD_MIX:12,HUE:13,INVERT:14,INVERT_RGB:15,LIGHTEN:16,LINEAR_BURN:17,LINEAR_DODGE:18,LINEAR_LIGHT:19,LUMINOSITY:20,MULTIPLY:21,NEGATION:22,NORMAL:23,OVERLAY:24,PIN_LIGHT:25,REFLECT:26,SATURATION:27,SCREEN:28,SOFT_LIGHT:29,SRC:30,SUBTRACT:31,VIVID_LIGHT:32},no=new Map([[K.ADD,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(x.rgb+y.rgb,y.a),y.a*opacity);}`],[K.AVERAGE,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4((x.rgb+y.rgb)*0.5,y.a),y.a*opacity);}`],[K.COLOR,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(yHSL.xy,xHSL.z));return mix(x,vec4(z,y.a),y.a*opacity);}`],[K.COLOR_BURN,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 a=x.rgb,b=y.rgb;vec3 z=mix(step(0.0,b)*(1.0-min(vec3(1.0),(1.0-a)/b)),vec3(1.0),step(1.0,a));return mix(x,vec4(z,y.a),y.a*opacity);}`],[K.COLOR_DODGE,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 a=x.rgb,b=y.rgb;vec3 z=step(0.0,a)*mix(min(vec3(1.0),a/max(1.0-b,1e-9)),vec3(1.0),step(1.0,b));return mix(x,vec4(z,y.a),y.a*opacity);}`],[K.DARKEN,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(min(x.rgb,y.rgb),y.a),y.a*opacity);}`],[K.DIFFERENCE,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(abs(x.rgb-y.rgb),y.a),y.a*opacity);}`],[K.DIVIDE,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(x.rgb/max(y.rgb,1e-12),y.a),y.a*opacity);}`],[K.DST,null],[K.EXCLUSION,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4((x.rgb+y.rgb-2.0*x.rgb*y.rgb),y.a),y.a*opacity);}`],[K.HARD_LIGHT,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 a=min(x.rgb,1.0);vec3 b=min(y.rgb,1.0);vec3 z=mix(2.0*a*b,1.0-2.0*(1.0-a)*(1.0-b),step(0.5,b));return mix(x,vec4(z,y.a),y.a*opacity);}`],[K.HARD_MIX,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(step(1.0,x.rgb+y.rgb),y.a),y.a*opacity);}`],[K.HUE,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(yHSL.x,xHSL.yz));return mix(x,vec4(z,y.a),y.a*opacity);}`],[K.INVERT,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(1.0-y.rgb,y.a),y.a*opacity);}`],[K.INVERT_RGB,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(y.rgb*(1.0-x.rgb),y.a),y.a*opacity);}`],[K.LIGHTEN,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(max(x.rgb,y.rgb),y.a),y.a*opacity);}`],[K.LINEAR_BURN,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(clamp(y.rgb+x.rgb-1.0,0.0,1.0),y.a),y.a*opacity);}`],[K.LINEAR_DODGE,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(min(x.rgb+y.rgb,1.0),y.a),y.a*opacity);}`],[K.LINEAR_LIGHT,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(clamp(2.0*y.rgb+x.rgb-1.0,0.0,1.0),y.a),y.a*opacity);}`],[K.LUMINOSITY,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(xHSL.xy,yHSL.z));return mix(x,vec4(z,y.a),y.a*opacity);}`],[K.MULTIPLY,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(x.rgb*y.rgb,y.a),y.a*opacity);}`],[K.NEGATION,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(1.0-abs(1.0-x.rgb-y.rgb),y.a),y.a*opacity);}`],[K.NORMAL,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,y,y.a*opacity);}`],[K.OVERLAY,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 z=mix(2.0*y.rgb*x.rgb,1.0-2.0*(1.0-y.rgb)*(1.0-x.rgb),step(0.5,x.rgb));return mix(x,vec4(z,y.a),y.a*opacity);}`],[K.PIN_LIGHT,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 y2=2.0*y.rgb;vec3 z=mix(mix(y2,x.rgb,step(0.5*x.rgb,y.rgb)),max(y2-1.0,vec3(0.0)),step(x.rgb,y2-1.0));return mix(x,vec4(z,y.a),y.a*opacity);}`],[K.REFLECT,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 z=mix(min(x.rgb*x.rgb/max(1.0-y.rgb,1e-12),1.0),y.rgb,step(1.0,y.rgb));return mix(x,vec4(z,y.a),y.a*opacity);}`],[K.SATURATION,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(xHSL.x,yHSL.y,xHSL.z));return mix(x,vec4(z,y.a),y.a*opacity);}`],[K.SCREEN,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(x.rgb+y.rgb-min(x.rgb*y.rgb,1.0),y.a),y.a*opacity);}`],[K.SOFT_LIGHT,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 a=x.rgb;vec3 b=y.rgb;vec3 y2=2.0*b;vec3 w=step(0.5,b);vec3 c=a-(1.0-y2)*a*(1.0-a);vec3 d=mix(a+(y2-1.0)*(sqrt(a)-a),a+(y2-1.0)*a*((16.0*a-12.0)*a+3.0),w*(1.0-step(0.25,a)));vec3 z=mix(c,d,w);return mix(x,vec4(z,y.a),y.a*opacity);}`],[K.SRC,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return y;}`],[K.SUBTRACT,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(max(x.rgb+y.rgb-1.0,0.0),y.a),y.a*opacity);}`],[K.VIVID_LIGHT,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 z=mix(max(1.0-min((1.0-x.rgb)/(2.0*y.rgb),1.0),0.0),min(x.rgb/(2.0*(1.0-y.rgb)),1.0),step(0.5,y.rgb));return mix(x,vec4(z,y.a),y.a*opacity);}`]]),ro=class extends Ce{constructor(e,t=1){super(),this._blendFunction=e,this.opacity=new E(t)}getOpacity(){return this.opacity.value}setOpacity(e){this.opacity.value=e}get blendFunction(){return this._blendFunction}set blendFunction(e){this._blendFunction=e,this.dispatchEvent({type:`change`})}getBlendFunction(){return this.blendFunction}setBlendFunction(e){this.blendFunction=e}getShaderCode(){return no.get(this.blendFunction)}},io=class extends Ce{constructor(e,t,{attributes:n=Xa.NONE,blendFunction:r=K.NORMAL,defines:i=new Map,uniforms:a=new Map,extensions:o=null,vertexShader:s=null}={}){super(),this.name=e,this.renderer=null,this.attributes=n,this.fragmentShader=t,this.vertexShader=s,this.defines=i,this.uniforms=a,this.extensions=o,this.blendMode=new ro(r),this.blendMode.addEventListener(`change`,e=>this.setChanged()),this._inputColorSpace=z,this._outputColorSpace=``}get inputColorSpace(){return this._inputColorSpace}set inputColorSpace(e){this._inputColorSpace=e,this.setChanged()}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e,this.setChanged()}set mainScene(e){}set mainCamera(e){}getName(){return this.name}setRenderer(e){this.renderer=e}getDefines(){return this.defines}getUniforms(){return this.uniforms}getExtensions(){return this.extensions}getBlendMode(){return this.blendMode}getAttributes(){return this.attributes}setAttributes(e){this.attributes=e,this.setChanged()}getFragmentShader(){return this.fragmentShader}setFragmentShader(e){this.fragmentShader=e,this.setChanged()}getVertexShader(){return this.vertexShader}setVertexShader(e){this.vertexShader=e,this.setChanged()}setChanged(){this.dispatchEvent({type:`change`})}setDepthTexture(e,t=dt){}update(e,t,n){}setSize(e,t){}initialize(e,t,n){}dispose(){for(let e of Object.keys(this)){let t=this[e];(t instanceof yt||t instanceof It||t instanceof ye||t instanceof Ba)&&this[e].dispose()}}};new Float32Array([0,0]),new Float32Array([0,1,1]),new Float32Array([0,1,1,2]),new Float32Array([0,1,2,2,3]),new Float32Array([0,1,2,3,4,4,5]),new Float32Array([0,1,2,3,4,5,7,8,9,10]);var ao=class extends Ba{constructor(e,t,n=null){super(`RenderPass`,e,t),this.needsSwap=!1,this.clearPass=new qa,this.overrideMaterialManager=n===null?null:new $a(n),this.ignoreBackground=!1,this.skipShadowMapUpdate=!1,this.selection=null}set mainScene(e){this.scene=e}set mainCamera(e){this.camera=e}get renderToScreen(){return super.renderToScreen}set renderToScreen(e){super.renderToScreen=e,this.clearPass.renderToScreen=e}get overrideMaterial(){let e=this.overrideMaterialManager;return e===null?null:e.material}set overrideMaterial(e){let t=this.overrideMaterialManager;e===null?t!==null&&(t.dispose(),this.overrideMaterialManager=null):t===null?this.overrideMaterialManager=new $a(e):t.setMaterial(e)}getOverrideMaterial(){return this.overrideMaterial}setOverrideMaterial(e){this.overrideMaterial=e}get clear(){return this.clearPass.enabled}set clear(e){this.clearPass.enabled=e}getSelection(){return this.selection}setSelection(e){this.selection=e}isBackgroundDisabled(){return this.ignoreBackground}setBackgroundDisabled(e){this.ignoreBackground=e}isShadowMapDisabled(){return this.skipShadowMapUpdate}setShadowMapDisabled(e){this.skipShadowMapUpdate=e}getClearPass(){return this.clearPass}render(e,t,n,r,i){let a=this.scene,o=this.camera,s=this.selection,c=o.layers.mask,l=a.background,u=e.shadowMap.autoUpdate,d=this.renderToScreen?null:t;s!==null&&o.layers.set(s.getLayer()),this.skipShadowMapUpdate&&(e.shadowMap.autoUpdate=!1),(this.ignoreBackground||this.clearPass.overrideClearColor!==null)&&(a.background=null),this.clearPass.enabled&&this.clearPass.render(e,t),e.setRenderTarget(d),this.overrideMaterialManager===null?e.render(a,o):this.overrideMaterialManager.render(e,a,o),o.layers.mask=c,a.background=l,e.shadowMap.autoUpdate=u}},oo=`uniform vec3 hue;uniform float saturation;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=vec3(dot(inputColor.rgb,hue.xyz),dot(inputColor.rgb,hue.zxy),dot(inputColor.rgb,hue.yzx));float average=(color.r+color.g+color.b)/3.0;vec3 diff=average-color;if(saturation>0.0){color+=diff*(1.0-1.0/(1.001-saturation));}else{color+=diff*-saturation;}outputColor=vec4(min(color,1.0),inputColor.a);}`,so=class extends io{constructor({blendFunction:e=K.SRC,hue:t=0,saturation:n=0}={}){super(`HueSaturationEffect`,oo,{blendFunction:e,uniforms:new Map([[`hue`,new E(new F)],[`saturation`,new E(n)]])}),this.hue=t}get saturation(){return this.uniforms.get(`saturation`).value}set saturation(e){this.uniforms.get(`saturation`).value=e}getSaturation(){return this.saturation}setSaturation(e){this.saturation=e}get hue(){let e=this.uniforms.get(`hue`).value;return Math.acos((e.x*3-1)/2)}set hue(e){let t=Math.sin(e),n=Math.cos(e);this.uniforms.get(`hue`).value.set((2*n+1)/3,(-Math.sqrt(3)*t-n+1)/3,(Math.sqrt(3)*t-n+1)/3)}getHue(){return this.hue}setHue(e){this.hue=e}};Math.PI*.5;var co=`#include +}`,Ua=`varying vec2 vUv;void main(){vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}`,Wa=class extends Jt{constructor(){super({name:`CopyMaterial`,defines:{DEPTH_PACKING:`0`,COLOR_WRITE:`1`},uniforms:{inputBuffer:new D(null),depthBuffer:new D(null),channelWeights:new D(null),opacity:new D(1)},blending:0,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:Ha,vertexShader:Ua}),this.depthFunc=1}get inputBuffer(){return this.uniforms.inputBuffer.value}set inputBuffer(e){let t=e!==null;this.colorWrite!==t&&(t?this.defines.COLOR_WRITE=!0:delete this.defines.COLOR_WRITE,this.colorWrite=t,this.needsUpdate=!0),this.uniforms.inputBuffer.value=e}get depthBuffer(){return this.uniforms.depthBuffer.value}set depthBuffer(e){let t=e!==null;this.depthWrite!==t&&(t?this.defines.DEPTH_WRITE=!0:delete this.defines.DEPTH_WRITE,this.depthTest=t,this.depthWrite=t,this.needsUpdate=!0),this.uniforms.depthBuffer.value=e}set depthPacking(e){this.defines.DEPTH_PACKING=e.toFixed(0),this.needsUpdate=!0}get channelWeights(){return this.uniforms.channelWeights.value}set channelWeights(e){e===null?delete this.defines.USE_WEIGHTS:(this.defines.USE_WEIGHTS=`1`,this.uniforms.channelWeights.value=e),this.needsUpdate=!0}setInputBuffer(e){this.uniforms.inputBuffer.value=e}getOpacity(e){return this.uniforms.opacity.value}setOpacity(e){this.uniforms.opacity.value=e}},Ga=class extends Ba{constructor(e,t=!0){super(`CopyPass`),this.fullscreenMaterial=new Wa,this.needsSwap=!1,this.renderTarget=e,e===void 0&&(this.renderTarget=new yt(1,1,{minFilter:ot,magFilter:ot,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name=`CopyPass.Target`),this.autoResize=t}get resize(){return this.autoResize}set resize(e){this.autoResize=e}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}setAutoResizeEnabled(e){this.autoResize=e}render(e,t,n,r,i){this.fullscreenMaterial.inputBuffer=t.texture,e.setRenderTarget(this.renderToScreen?null:this.renderTarget),e.render(this.scene,this.camera)}setSize(e,t){this.autoResize&&this.renderTarget.setSize(e,t)}initialize(e,t,n){n!==void 0&&(this.renderTarget.texture.type=n,n===1009?e!==null&&e.outputColorSpace===`srgb`&&(this.renderTarget.texture.colorSpace=N):this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH=`1`)}},Ka=new H,qa=class extends Ba{constructor(e=!0,t=!0,n=!1){super(`ClearPass`,null,null),this.needsSwap=!1,this.color=e,this.depth=t,this.stencil=n,this.overrideClearColor=null,this.overrideClearAlpha=-1}setClearFlags(e,t,n){this.color=e,this.depth=t,this.stencil=n}getOverrideClearColor(){return this.overrideClearColor}setOverrideClearColor(e){this.overrideClearColor=e}getOverrideClearAlpha(){return this.overrideClearAlpha}setOverrideClearAlpha(e){this.overrideClearAlpha=e}render(e,t,n,r,i){let a=this.overrideClearColor,o=this.overrideClearAlpha,s=e.getClearAlpha(),c=a!==null,l=o>=0;c?(e.getClearColor(Ka),e.setClearColor(a,l?o:s)):l&&e.setClearAlpha(o),e.setRenderTarget(this.renderToScreen?null:t),e.clear(this.color,this.depth,this.stencil),c?e.setClearColor(Ka,s):l&&e.setClearAlpha(s)}},Ja=class extends Ba{constructor(e,t){super(`MaskPass`,e,t),this.needsSwap=!1,this.clearPass=new qa(!1,!1,!0),this.inverse=!1}set mainScene(e){this.scene=e}set mainCamera(e){this.camera=e}get inverted(){return this.inverse}set inverted(e){this.inverse=e}get clear(){return this.clearPass.enabled}set clear(e){this.clearPass.enabled=e}getClearPass(){return this.clearPass}isInverted(){return this.inverted}setInverted(e){this.inverted=e}render(e,t,n,r,i){let a=e.getContext(),o=e.state.buffers,s=this.scene,c=this.camera,l=this.clearPass,u=this.inverted?0:1,d=1-u;o.color.setMask(!1),o.depth.setMask(!1),o.color.setLocked(!0),o.depth.setLocked(!0),o.stencil.setTest(!0),o.stencil.setOp(a.REPLACE,a.REPLACE,a.REPLACE),o.stencil.setFunc(a.ALWAYS,u,4294967295),o.stencil.setClear(d),o.stencil.setLocked(!0),this.clearPass.enabled&&(this.renderToScreen?l.render(e,null):(l.render(e,t),l.render(e,n))),this.renderToScreen?(e.setRenderTarget(null),e.render(s,c)):(e.setRenderTarget(t),e.render(s,c),e.setRenderTarget(n),e.render(s,c)),o.color.setLocked(!1),o.depth.setLocked(!1),o.stencil.setLocked(!1),o.stencil.setFunc(a.EQUAL,1,4294967295),o.stencil.setOp(a.KEEP,a.KEEP,a.KEEP),o.stencil.setLocked(!0)}},Ya=class{constructor(e=null,{depthBuffer:t=!0,stencilBuffer:n=!1,multisampling:r=0,frameBufferType:i}={}){this.renderer=null,this.inputBuffer=this.createBuffer(t,n,i,r),this.outputBuffer=this.inputBuffer.clone(),this.copyPass=new Ga,this.depthTexture=null,this.passes=[],this.timer=new Ra,this.autoRenderToScreen=!0,this.setRenderer(e)}get multisampling(){return this.inputBuffer.samples||0}set multisampling(e){let t=this.inputBuffer,n=this.multisampling;n>0&&e>0?(this.inputBuffer.samples=e,this.outputBuffer.samples=e,this.inputBuffer.dispose(),this.outputBuffer.dispose()):n!==e&&(this.inputBuffer.dispose(),this.outputBuffer.dispose(),this.inputBuffer=this.createBuffer(t.depthBuffer,t.stencilBuffer,t.texture.type,e),this.inputBuffer.depthTexture=this.depthTexture,this.outputBuffer=this.inputBuffer.clone())}getTimer(){return this.timer}getRenderer(){return this.renderer}setRenderer(e){if(this.renderer=e,e!==null){let t=e.getSize(new L),n=e.getContext().getContextAttributes().alpha,r=this.inputBuffer.texture.type;r===1009&&e.outputColorSpace===`srgb`&&(this.inputBuffer.texture.colorSpace=N,this.outputBuffer.texture.colorSpace=N,this.inputBuffer.dispose(),this.outputBuffer.dispose()),e.autoClear=!1,this.setSize(t.width,t.height);for(let t of this.passes)t.initialize(e,n,r)}}replaceRenderer(e,t=!0){let n=this.renderer,r=n.domElement.parentNode;return this.setRenderer(e),t&&r!==null&&(r.removeChild(n.domElement),r.appendChild(e.domElement)),n}createDepthTexture(){let e=this.depthTexture=new se;return this.inputBuffer.depthTexture=e,this.inputBuffer.dispose(),this.inputBuffer.stencilBuffer?(e.format=le,e.type=wt):e.type=Nt,e}deleteDepthTexture(){if(this.depthTexture!==null){this.depthTexture.dispose(),this.depthTexture=null,this.inputBuffer.depthTexture=null,this.inputBuffer.dispose();for(let e of this.passes)e.setDepthTexture(null)}}createBuffer(e,t,n,r){let i=this.renderer,a=i===null?new L:i.getDrawingBufferSize(new L),o={minFilter:ot,magFilter:ot,stencilBuffer:t,depthBuffer:e,type:n},s=new yt(a.width,a.height,o);return r>0&&(s.samples=r),n===1009&&i!==null&&i.outputColorSpace===`srgb`&&(s.texture.colorSpace=N),s.texture.name=`EffectComposer.Buffer`,s.texture.generateMipmaps=!1,s}setMainScene(e){for(let t of this.passes)t.mainScene=e}setMainCamera(e){for(let t of this.passes)t.mainCamera=e}addPass(e,t){let n=this.passes,r=this.renderer,i=r.getDrawingBufferSize(new L),a=r.getContext().getContextAttributes().alpha,o=this.inputBuffer.texture.type;if(e.setRenderer(r),e.setSize(i.width,i.height),e.initialize(r,a,o),this.autoRenderToScreen&&(n.length>0&&(n[n.length-1].renderToScreen=!1),e.renderToScreen&&(this.autoRenderToScreen=!1)),t===void 0?n.push(e):n.splice(t,0,e),this.autoRenderToScreen&&(n[n.length-1].renderToScreen=!0),e.needsDepthTexture||this.depthTexture!==null)if(this.depthTexture===null){let t=this.createDepthTexture();for(e of n)e.setDepthTexture(t)}else e.setDepthTexture(this.depthTexture)}removePass(e){let t=this.passes,n=t.indexOf(e);n!==-1&&t.splice(n,1).length>0&&(this.depthTexture!==null&&(t.reduce((e,t)=>e||t.needsDepthTexture,!1)||(e.getDepthTexture()===this.depthTexture&&e.setDepthTexture(null),this.deleteDepthTexture())),this.autoRenderToScreen&&n===t.length&&(e.renderToScreen=!1,t.length>0&&(t[t.length-1].renderToScreen=!0)))}removeAllPasses(){let e=this.passes;this.deleteDepthTexture(),e.length>0&&(this.autoRenderToScreen&&(e[e.length-1].renderToScreen=!1),this.passes=[])}render(e){let t=this.renderer,n=this.copyPass,r=this.inputBuffer,i=this.outputBuffer,a=!1,o,s,c;e===void 0&&(this.timer.update(),e=this.timer.getDelta());for(let l of this.passes)l.enabled&&(l.render(t,r,i,e,a),l.needsSwap&&(a&&(n.renderToScreen=l.renderToScreen,o=t.getContext(),s=t.state.buffers.stencil,s.setFunc(o.NOTEQUAL,1,4294967295),n.render(t,r,i,e,a),s.setFunc(o.EQUAL,1,4294967295)),c=r,r=i,i=c),l instanceof Ja?a=!0:l instanceof Va&&(a=!1))}setSize(e,t,n){let r=this.renderer,i=r.getSize(new L);(e===void 0||t===void 0)&&(e=i.width,t=i.height),(i.width!==e||i.height!==t)&&r.setSize(e,t,n);let a=r.getDrawingBufferSize(new L);this.inputBuffer.setSize(a.width,a.height),this.outputBuffer.setSize(a.width,a.height);for(let e of this.passes)e.setSize(a.width,a.height)}reset(){this.dispose(),this.autoRenderToScreen=!0}dispose(){for(let e of this.passes)e.dispose();this.passes=[],this.inputBuffer!==null&&this.inputBuffer.dispose(),this.outputBuffer!==null&&this.outputBuffer.dispose(),this.deleteDepthTexture(),this.copyPass.dispose(),this.timer.dispose(),Ba.fullscreenGeometry.dispose()}},Xa={NONE:0,DEPTH:1,CONVOLUTION:2},G={FRAGMENT_HEAD:`FRAGMENT_HEAD`,FRAGMENT_MAIN_UV:`FRAGMENT_MAIN_UV`,FRAGMENT_MAIN_IMAGE:`FRAGMENT_MAIN_IMAGE`,VERTEX_HEAD:`VERTEX_HEAD`,VERTEX_MAIN_SUPPORT:`VERTEX_MAIN_SUPPORT`},Za=class{constructor(){this.shaderParts=new Map([[G.FRAGMENT_HEAD,null],[G.FRAGMENT_MAIN_UV,null],[G.FRAGMENT_MAIN_IMAGE,null],[G.VERTEX_HEAD,null],[G.VERTEX_MAIN_SUPPORT,null]]),this.defines=new Map,this.uniforms=new Map,this.blendModes=new Map,this.extensions=new Set,this.attributes=Xa.NONE,this.varyings=new Set,this.uvTransformation=!1,this.readDepth=!1,this.colorSpace=z}},Qa=!1,$a=class{constructor(e=null){this.originalMaterials=new Map,this.material=null,this.materials=null,this.materialsBackSide=null,this.materialsDoubleSide=null,this.materialsFlatShaded=null,this.materialsFlatShadedBackSide=null,this.materialsFlatShadedDoubleSide=null,this.setMaterial(e),this.meshCount=0,this.replaceMaterial=e=>{if(e.isMesh){let t;if(e.material.flatShading)switch(e.material.side){case 2:t=this.materialsFlatShadedDoubleSide;break;case 1:t=this.materialsFlatShadedBackSide;break;default:t=this.materialsFlatShaded;break}else switch(e.material.side){case 2:t=this.materialsDoubleSide;break;case 1:t=this.materialsBackSide;break;default:t=this.materials;break}this.originalMaterials.set(e,e.material),e.isSkinnedMesh?e.material=t[2]:e.isInstancedMesh?e.material=t[1]:e.material=t[0],++this.meshCount}}}cloneMaterial(e){if(!(e instanceof Jt))return e.clone();let t=e.uniforms,n=new Map;for(let e in t){let r=t[e].value;r.isRenderTargetTexture&&(t[e].value=null,n.set(e,r))}let r=e.clone();for(let e of n)t[e[0]].value=e[1],r.uniforms[e[0]].value=e[1];return r}setMaterial(e){if(this.disposeMaterials(),this.material=e,e!==null){let t=this.materials=[this.cloneMaterial(e),this.cloneMaterial(e),this.cloneMaterial(e)];for(let n of t)n.uniforms=Object.assign({},e.uniforms),n.side=0;t[2].skinning=!0,this.materialsBackSide=t.map(t=>{let n=this.cloneMaterial(t);return n.uniforms=Object.assign({},e.uniforms),n.side=1,n}),this.materialsDoubleSide=t.map(t=>{let n=this.cloneMaterial(t);return n.uniforms=Object.assign({},e.uniforms),n.side=2,n}),this.materialsFlatShaded=t.map(t=>{let n=this.cloneMaterial(t);return n.uniforms=Object.assign({},e.uniforms),n.flatShading=!0,n}),this.materialsFlatShadedBackSide=t.map(t=>{let n=this.cloneMaterial(t);return n.uniforms=Object.assign({},e.uniforms),n.flatShading=!0,n.side=1,n}),this.materialsFlatShadedDoubleSide=t.map(t=>{let n=this.cloneMaterial(t);return n.uniforms=Object.assign({},e.uniforms),n.flatShading=!0,n.side=2,n})}}render(e,t,n){let r=e.shadowMap.enabled;if(e.shadowMap.enabled=!1,Qa){let r=this.originalMaterials;this.meshCount=0,t.traverse(this.replaceMaterial),e.render(t,n);for(let e of r)e[0].material=e[1];this.meshCount!==r.size&&r.clear()}else{let r=t.overrideMaterial;t.overrideMaterial=this.material,e.render(t,n),t.overrideMaterial=r}e.shadowMap.enabled=r}disposeMaterials(){if(this.material!==null){let e=this.materials.concat(this.materialsBackSide).concat(this.materialsDoubleSide).concat(this.materialsFlatShaded).concat(this.materialsFlatShadedBackSide).concat(this.materialsFlatShadedDoubleSide);for(let t of e)t.dispose()}}dispose(){this.originalMaterials.clear(),this.disposeMaterials()}static get workaroundEnabled(){return Qa}static set workaroundEnabled(e){Qa=e}},eo=-1,to=class extends we{constructor(e,t=eo,n=eo,r=1){super(),this.resizable=e,this.baseSize=new L(1,1),this.preferredSize=new L(t,n),this.target=this.preferredSize,this.s=r,this.effectiveSize=new L,this.addEventListener(`change`,()=>this.updateEffectiveSize()),this.updateEffectiveSize()}updateEffectiveSize(){let e=this.baseSize,t=this.preferredSize,n=this.effectiveSize,r=this.scale;t.width===eo?t.height===eo?n.width=Math.round(e.width*r):n.width=Math.round(t.height*(e.width/Math.max(e.height,1))):n.width=t.width,t.height===eo?t.width===eo?n.height=Math.round(e.height*r):n.height=Math.round(t.width/Math.max(e.width/Math.max(e.height,1),1)):n.height=t.height}get width(){return this.effectiveSize.width}set width(e){this.preferredWidth=e}get height(){return this.effectiveSize.height}set height(e){this.preferredHeight=e}getWidth(){return this.width}getHeight(){return this.height}get scale(){return this.s}set scale(e){this.s!==e&&(this.s=e,this.preferredSize.setScalar(eo),this.dispatchEvent({type:`change`}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getScale(){return this.scale}setScale(e){this.scale=e}get baseWidth(){return this.baseSize.width}set baseWidth(e){this.baseSize.width!==e&&(this.baseSize.width=e,this.dispatchEvent({type:`change`}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getBaseWidth(){return this.baseWidth}setBaseWidth(e){this.baseWidth=e}get baseHeight(){return this.baseSize.height}set baseHeight(e){this.baseSize.height!==e&&(this.baseSize.height=e,this.dispatchEvent({type:`change`}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getBaseHeight(){return this.baseHeight}setBaseHeight(e){this.baseHeight=e}setBaseSize(e,t){(this.baseSize.width!==e||this.baseSize.height!==t)&&(this.baseSize.set(e,t),this.dispatchEvent({type:`change`}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}get preferredWidth(){return this.preferredSize.width}set preferredWidth(e){this.preferredSize.width!==e&&(this.preferredSize.width=e,this.dispatchEvent({type:`change`}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getPreferredWidth(){return this.preferredWidth}setPreferredWidth(e){this.preferredWidth=e}get preferredHeight(){return this.preferredSize.height}set preferredHeight(e){this.preferredSize.height!==e&&(this.preferredSize.height=e,this.dispatchEvent({type:`change`}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getPreferredHeight(){return this.preferredHeight}setPreferredHeight(e){this.preferredHeight=e}setPreferredSize(e,t){(this.preferredSize.width!==e||this.preferredSize.height!==t)&&(this.preferredSize.set(e,t),this.dispatchEvent({type:`change`}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}copy(e){this.s=e.scale,this.baseSize.set(e.baseWidth,e.baseHeight),this.preferredSize.set(e.preferredWidth,e.preferredHeight),this.dispatchEvent({type:`change`}),this.resizable.setSize(this.baseSize.width,this.baseSize.height)}static get AUTO_SIZE(){return eo}},K={SKIP:9,SET:30,ADD:0,ALPHA:23,AVERAGE:2,COLOR:3,COLOR_BURN:4,COLOR_DODGE:5,DARKEN:6,DIFFERENCE:7,DIVIDE:8,DST:9,EXCLUSION:10,HARD_LIGHT:11,HARD_MIX:12,HUE:13,INVERT:14,INVERT_RGB:15,LIGHTEN:16,LINEAR_BURN:17,LINEAR_DODGE:18,LINEAR_LIGHT:19,LUMINOSITY:20,MULTIPLY:21,NEGATION:22,NORMAL:23,OVERLAY:24,PIN_LIGHT:25,REFLECT:26,SATURATION:27,SCREEN:28,SOFT_LIGHT:29,SRC:30,SUBTRACT:31,VIVID_LIGHT:32},no=new Map([[K.ADD,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(x.rgb+y.rgb,y.a),y.a*opacity);}`],[K.AVERAGE,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4((x.rgb+y.rgb)*0.5,y.a),y.a*opacity);}`],[K.COLOR,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(yHSL.xy,xHSL.z));return mix(x,vec4(z,y.a),y.a*opacity);}`],[K.COLOR_BURN,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 a=x.rgb,b=y.rgb;vec3 z=mix(step(0.0,b)*(1.0-min(vec3(1.0),(1.0-a)/b)),vec3(1.0),step(1.0,a));return mix(x,vec4(z,y.a),y.a*opacity);}`],[K.COLOR_DODGE,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 a=x.rgb,b=y.rgb;vec3 z=step(0.0,a)*mix(min(vec3(1.0),a/max(1.0-b,1e-9)),vec3(1.0),step(1.0,b));return mix(x,vec4(z,y.a),y.a*opacity);}`],[K.DARKEN,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(min(x.rgb,y.rgb),y.a),y.a*opacity);}`],[K.DIFFERENCE,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(abs(x.rgb-y.rgb),y.a),y.a*opacity);}`],[K.DIVIDE,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(x.rgb/max(y.rgb,1e-12),y.a),y.a*opacity);}`],[K.DST,null],[K.EXCLUSION,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4((x.rgb+y.rgb-2.0*x.rgb*y.rgb),y.a),y.a*opacity);}`],[K.HARD_LIGHT,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 a=min(x.rgb,1.0);vec3 b=min(y.rgb,1.0);vec3 z=mix(2.0*a*b,1.0-2.0*(1.0-a)*(1.0-b),step(0.5,b));return mix(x,vec4(z,y.a),y.a*opacity);}`],[K.HARD_MIX,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(step(1.0,x.rgb+y.rgb),y.a),y.a*opacity);}`],[K.HUE,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(yHSL.x,xHSL.yz));return mix(x,vec4(z,y.a),y.a*opacity);}`],[K.INVERT,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(1.0-y.rgb,y.a),y.a*opacity);}`],[K.INVERT_RGB,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(y.rgb*(1.0-x.rgb),y.a),y.a*opacity);}`],[K.LIGHTEN,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(max(x.rgb,y.rgb),y.a),y.a*opacity);}`],[K.LINEAR_BURN,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(clamp(y.rgb+x.rgb-1.0,0.0,1.0),y.a),y.a*opacity);}`],[K.LINEAR_DODGE,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(min(x.rgb+y.rgb,1.0),y.a),y.a*opacity);}`],[K.LINEAR_LIGHT,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(clamp(2.0*y.rgb+x.rgb-1.0,0.0,1.0),y.a),y.a*opacity);}`],[K.LUMINOSITY,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(xHSL.xy,yHSL.z));return mix(x,vec4(z,y.a),y.a*opacity);}`],[K.MULTIPLY,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(x.rgb*y.rgb,y.a),y.a*opacity);}`],[K.NEGATION,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(1.0-abs(1.0-x.rgb-y.rgb),y.a),y.a*opacity);}`],[K.NORMAL,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,y,y.a*opacity);}`],[K.OVERLAY,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 z=mix(2.0*y.rgb*x.rgb,1.0-2.0*(1.0-y.rgb)*(1.0-x.rgb),step(0.5,x.rgb));return mix(x,vec4(z,y.a),y.a*opacity);}`],[K.PIN_LIGHT,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 y2=2.0*y.rgb;vec3 z=mix(mix(y2,x.rgb,step(0.5*x.rgb,y.rgb)),max(y2-1.0,vec3(0.0)),step(x.rgb,y2-1.0));return mix(x,vec4(z,y.a),y.a*opacity);}`],[K.REFLECT,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 z=mix(min(x.rgb*x.rgb/max(1.0-y.rgb,1e-12),1.0),y.rgb,step(1.0,y.rgb));return mix(x,vec4(z,y.a),y.a*opacity);}`],[K.SATURATION,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(xHSL.x,yHSL.y,xHSL.z));return mix(x,vec4(z,y.a),y.a*opacity);}`],[K.SCREEN,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(x.rgb+y.rgb-min(x.rgb*y.rgb,1.0),y.a),y.a*opacity);}`],[K.SOFT_LIGHT,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 a=x.rgb;vec3 b=y.rgb;vec3 y2=2.0*b;vec3 w=step(0.5,b);vec3 c=a-(1.0-y2)*a*(1.0-a);vec3 d=mix(a+(y2-1.0)*(sqrt(a)-a),a+(y2-1.0)*a*((16.0*a-12.0)*a+3.0),w*(1.0-step(0.25,a)));vec3 z=mix(c,d,w);return mix(x,vec4(z,y.a),y.a*opacity);}`],[K.SRC,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return y;}`],[K.SUBTRACT,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,vec4(max(x.rgb+y.rgb-1.0,0.0),y.a),y.a*opacity);}`],[K.VIVID_LIGHT,`vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 z=mix(max(1.0-min((1.0-x.rgb)/(2.0*y.rgb),1.0),0.0),min(x.rgb/(2.0*(1.0-y.rgb)),1.0),step(0.5,y.rgb));return mix(x,vec4(z,y.a),y.a*opacity);}`]]),ro=class extends we{constructor(e,t=1){super(),this._blendFunction=e,this.opacity=new D(t)}getOpacity(){return this.opacity.value}setOpacity(e){this.opacity.value=e}get blendFunction(){return this._blendFunction}set blendFunction(e){this._blendFunction=e,this.dispatchEvent({type:`change`})}getBlendFunction(){return this.blendFunction}setBlendFunction(e){this.blendFunction=e}getShaderCode(){return no.get(this.blendFunction)}},io=class extends we{constructor(e,t,{attributes:n=Xa.NONE,blendFunction:r=K.NORMAL,defines:i=new Map,uniforms:a=new Map,extensions:o=null,vertexShader:s=null}={}){super(),this.name=e,this.renderer=null,this.attributes=n,this.fragmentShader=t,this.vertexShader=s,this.defines=i,this.uniforms=a,this.extensions=o,this.blendMode=new ro(r),this.blendMode.addEventListener(`change`,e=>this.setChanged()),this._inputColorSpace=z,this._outputColorSpace=``}get inputColorSpace(){return this._inputColorSpace}set inputColorSpace(e){this._inputColorSpace=e,this.setChanged()}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e,this.setChanged()}set mainScene(e){}set mainCamera(e){}getName(){return this.name}setRenderer(e){this.renderer=e}getDefines(){return this.defines}getUniforms(){return this.uniforms}getExtensions(){return this.extensions}getBlendMode(){return this.blendMode}getAttributes(){return this.attributes}setAttributes(e){this.attributes=e,this.setChanged()}getFragmentShader(){return this.fragmentShader}setFragmentShader(e){this.fragmentShader=e,this.setChanged()}getVertexShader(){return this.vertexShader}setVertexShader(e){this.vertexShader=e,this.setChanged()}setChanged(){this.dispatchEvent({type:`change`})}setDepthTexture(e,t=dt){}update(e,t,n){}setSize(e,t){}initialize(e,t,n){}dispose(){for(let e of Object.keys(this)){let t=this[e];(t instanceof yt||t instanceof It||t instanceof ye||t instanceof Ba)&&this[e].dispose()}}};new Float32Array([0,0]),new Float32Array([0,1,1]),new Float32Array([0,1,1,2]),new Float32Array([0,1,2,2,3]),new Float32Array([0,1,2,3,4,4,5]),new Float32Array([0,1,2,3,4,5,7,8,9,10]);var ao=class extends Ba{constructor(e,t,n=null){super(`RenderPass`,e,t),this.needsSwap=!1,this.clearPass=new qa,this.overrideMaterialManager=n===null?null:new $a(n),this.ignoreBackground=!1,this.skipShadowMapUpdate=!1,this.selection=null}set mainScene(e){this.scene=e}set mainCamera(e){this.camera=e}get renderToScreen(){return super.renderToScreen}set renderToScreen(e){super.renderToScreen=e,this.clearPass.renderToScreen=e}get overrideMaterial(){let e=this.overrideMaterialManager;return e===null?null:e.material}set overrideMaterial(e){let t=this.overrideMaterialManager;e===null?t!==null&&(t.dispose(),this.overrideMaterialManager=null):t===null?this.overrideMaterialManager=new $a(e):t.setMaterial(e)}getOverrideMaterial(){return this.overrideMaterial}setOverrideMaterial(e){this.overrideMaterial=e}get clear(){return this.clearPass.enabled}set clear(e){this.clearPass.enabled=e}getSelection(){return this.selection}setSelection(e){this.selection=e}isBackgroundDisabled(){return this.ignoreBackground}setBackgroundDisabled(e){this.ignoreBackground=e}isShadowMapDisabled(){return this.skipShadowMapUpdate}setShadowMapDisabled(e){this.skipShadowMapUpdate=e}getClearPass(){return this.clearPass}render(e,t,n,r,i){let a=this.scene,o=this.camera,s=this.selection,c=o.layers.mask,l=a.background,u=e.shadowMap.autoUpdate,d=this.renderToScreen?null:t;s!==null&&o.layers.set(s.getLayer()),this.skipShadowMapUpdate&&(e.shadowMap.autoUpdate=!1),(this.ignoreBackground||this.clearPass.overrideClearColor!==null)&&(a.background=null),this.clearPass.enabled&&this.clearPass.render(e,t),e.setRenderTarget(d),this.overrideMaterialManager===null?e.render(a,o):this.overrideMaterialManager.render(e,a,o),o.layers.mask=c,a.background=l,e.shadowMap.autoUpdate=u}},oo=`uniform vec3 hue;uniform float saturation;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=vec3(dot(inputColor.rgb,hue.xyz),dot(inputColor.rgb,hue.zxy),dot(inputColor.rgb,hue.yzx));float average=(color.r+color.g+color.b)/3.0;vec3 diff=average-color;if(saturation>0.0){color+=diff*(1.0-1.0/(1.001-saturation));}else{color+=diff*-saturation;}outputColor=vec4(min(color,1.0),inputColor.a);}`,so=class extends io{constructor({blendFunction:e=K.SRC,hue:t=0,saturation:n=0}={}){super(`HueSaturationEffect`,oo,{blendFunction:e,uniforms:new Map([[`hue`,new D(new F)],[`saturation`,new D(n)]])}),this.hue=t}get saturation(){return this.uniforms.get(`saturation`).value}set saturation(e){this.uniforms.get(`saturation`).value=e}getSaturation(){return this.saturation}setSaturation(e){this.saturation=e}get hue(){let e=this.uniforms.get(`hue`).value;return Math.acos((e.x*3-1)/2)}set hue(e){let t=Math.sin(e),n=Math.cos(e);this.uniforms.get(`hue`).value.set((2*n+1)/3,(-Math.sqrt(3)*t-n+1)/3,(Math.sqrt(3)*t-n+1)/3)}getHue(){return this.hue}setHue(e){this.hue=e}};Math.PI*.5;var co=`#include #ifdef GL_FRAGMENT_PRECISION_HIGH uniform highp sampler2D depthBuffer; #else @@ -1910,7 +1910,7 @@ vec3 n[4];n[0]=texture2D(normalBuffer,vUv0).rgb;n[1]=texture2D(normalBuffer,vUv1 #else vec3 n[4];n[0]=vec3(0.0);n[1]=vec3(0.0);n[2]=vec3(0.0);n[3]=vec3(0.0); #endif -gl_FragColor=vec4(n[index],d[index]);}`,lo=`uniform vec2 texelSize;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vUv0=uv;vUv1=vec2(uv.x,uv.y+texelSize.y);vUv2=vec2(uv.x+texelSize.x,uv.y);vUv3=uv+texelSize;gl_Position=vec4(position.xy,1.0,1.0);}`,uo=class extends Jt{constructor(){super({name:`DepthDownsamplingMaterial`,defines:{DEPTH_PACKING:`0`},uniforms:{depthBuffer:new E(null),normalBuffer:new E(null),texelSize:new E(new L)},blending:0,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:co,vertexShader:lo})}set depthBuffer(e){this.uniforms.depthBuffer.value=e}set depthPacking(e){this.defines.DEPTH_PACKING=e.toFixed(0),this.needsUpdate=!0}setDepthBuffer(e,t=dt){this.depthBuffer=e,this.depthPacking=t}set normalBuffer(e){this.uniforms.normalBuffer.value=e,e===null?delete this.defines.DOWNSAMPLE_NORMALS:this.defines.DOWNSAMPLE_NORMALS=`1`,this.needsUpdate=!0}setNormalBuffer(e){this.normalBuffer=e}setTexelSize(e,t){this.uniforms.texelSize.value.set(e,t)}setSize(e,t){this.uniforms.texelSize.value.set(1/e,1/t)}},fo=class extends Ba{constructor({normalBuffer:e=null,resolutionScale:t=.5,width:n=to.AUTO_SIZE,height:r=to.AUTO_SIZE,resolutionX:i=n,resolutionY:a=r}={}){super(`DepthDownsamplingPass`);let o=new uo;o.normalBuffer=e,this.fullscreenMaterial=o,this.needsDepthTexture=!0,this.needsSwap=!1,this.renderTarget=new yt(1,1,{minFilter:Xe,magFilter:Xe,depthBuffer:!1,type:de}),this.renderTarget.texture.name=`DepthDownsamplingPass.Target`,this.renderTarget.texture.generateMipmaps=!1;let s=this.resolution=new to(this,i,a,t);s.addEventListener(`change`,e=>this.setSize(s.baseWidth,s.baseHeight))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}setDepthTexture(e,t=dt){this.fullscreenMaterial.depthBuffer=e,this.fullscreenMaterial.depthPacking=t}render(e,t,n,r,i){e.setRenderTarget(this.renderToScreen?null:this.renderTarget),e.render(this.scene,this.camera)}setSize(e,t){let n=this.resolution;n.setBaseSize(e,t),this.renderTarget.setSize(n.width,n.height),this.fullscreenMaterial.setSize(e,t)}initialize(e,t,n){let r=e.getContext();if(!(r.getExtension(`EXT_color_buffer_float`)||r.getExtension(`EXT_color_buffer_half_float`)))throw Error(`Rendering to float texture is not supported.`)}},po=`#include +gl_FragColor=vec4(n[index],d[index]);}`,lo=`uniform vec2 texelSize;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vUv0=uv;vUv1=vec2(uv.x,uv.y+texelSize.y);vUv2=vec2(uv.x+texelSize.x,uv.y);vUv3=uv+texelSize;gl_Position=vec4(position.xy,1.0,1.0);}`,uo=class extends Jt{constructor(){super({name:`DepthDownsamplingMaterial`,defines:{DEPTH_PACKING:`0`},uniforms:{depthBuffer:new D(null),normalBuffer:new D(null),texelSize:new D(new L)},blending:0,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:co,vertexShader:lo})}set depthBuffer(e){this.uniforms.depthBuffer.value=e}set depthPacking(e){this.defines.DEPTH_PACKING=e.toFixed(0),this.needsUpdate=!0}setDepthBuffer(e,t=dt){this.depthBuffer=e,this.depthPacking=t}set normalBuffer(e){this.uniforms.normalBuffer.value=e,e===null?delete this.defines.DOWNSAMPLE_NORMALS:this.defines.DOWNSAMPLE_NORMALS=`1`,this.needsUpdate=!0}setNormalBuffer(e){this.normalBuffer=e}setTexelSize(e,t){this.uniforms.texelSize.value.set(e,t)}setSize(e,t){this.uniforms.texelSize.value.set(1/e,1/t)}},fo=class extends Ba{constructor({normalBuffer:e=null,resolutionScale:t=.5,width:n=to.AUTO_SIZE,height:r=to.AUTO_SIZE,resolutionX:i=n,resolutionY:a=r}={}){super(`DepthDownsamplingPass`);let o=new uo;o.normalBuffer=e,this.fullscreenMaterial=o,this.needsDepthTexture=!0,this.needsSwap=!1,this.renderTarget=new yt(1,1,{minFilter:Xe,magFilter:Xe,depthBuffer:!1,type:j}),this.renderTarget.texture.name=`DepthDownsamplingPass.Target`,this.renderTarget.texture.generateMipmaps=!1;let s=this.resolution=new to(this,i,a,t);s.addEventListener(`change`,e=>this.setSize(s.baseWidth,s.baseHeight))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}setDepthTexture(e,t=dt){this.fullscreenMaterial.depthBuffer=e,this.fullscreenMaterial.depthPacking=t}render(e,t,n,r,i){e.setRenderTarget(this.renderToScreen?null:this.renderTarget),e.render(this.scene,this.camera)}setSize(e,t){let n=this.resolution;n.setBaseSize(e,t),this.renderTarget.setSize(n.width,n.height),this.fullscreenMaterial.setSize(e,t)}initialize(e,t,n){let r=e.getContext();if(!(r.getExtension(`EXT_color_buffer_float`)||r.getExtension(`EXT_color_buffer_half_float`)))throw Error(`Rendering to float texture is not supported.`)}},po=`#include #include #include #define packFloatToRGBA(v) packDepthToRGBA(v) @@ -1949,7 +1949,7 @@ return orthographicDepthToViewZ(depth,cameraNear,cameraFar); #include #endif #include -}`,mo=`uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;VERTEX_HEAD void main(){vUv=position.xy*0.5+0.5;VERTEX_MAIN_SUPPORT gl_Position=vec4(position.xy,1.0,1.0);}`,ho=class extends Jt{constructor(e,t,n,r,i=!1){super({name:`EffectMaterial`,defines:{THREE_REVISION:`181`.replace(/\D+/g,``),DEPTH_PACKING:`0`,ENCODE_OUTPUT:`1`},uniforms:{inputBuffer:new E(null),depthBuffer:new E(null),resolution:new E(new L),texelSize:new E(new L),cameraNear:new E(.3),cameraFar:new E(1e3),aspect:new E(1),time:new E(0)},blending:0,toneMapped:!1,depthWrite:!1,depthTest:!1,dithering:i}),e&&this.setShaderParts(e),t&&this.setDefines(t),n&&this.setUniforms(n),this.copyCameraSettings(r)}set inputBuffer(e){this.uniforms.inputBuffer.value=e}setInputBuffer(e){this.uniforms.inputBuffer.value=e}get depthBuffer(){return this.uniforms.depthBuffer.value}set depthBuffer(e){this.uniforms.depthBuffer.value=e}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(e){this.defines.DEPTH_PACKING=e.toFixed(0),this.needsUpdate=!0}setDepthBuffer(e,t=dt){this.depthBuffer=e,this.depthPacking=t}setShaderData(e){this.setShaderParts(e.shaderParts),this.setDefines(e.defines),this.setUniforms(e.uniforms),this.setExtensions(e.extensions)}setShaderParts(e){return this.fragmentShader=po.replace(G.FRAGMENT_HEAD,e.get(G.FRAGMENT_HEAD)||``).replace(G.FRAGMENT_MAIN_UV,e.get(G.FRAGMENT_MAIN_UV)||``).replace(G.FRAGMENT_MAIN_IMAGE,e.get(G.FRAGMENT_MAIN_IMAGE)||``),this.vertexShader=mo.replace(G.VERTEX_HEAD,e.get(G.VERTEX_HEAD)||``).replace(G.VERTEX_MAIN_SUPPORT,e.get(G.VERTEX_MAIN_SUPPORT)||``),this.needsUpdate=!0,this}setDefines(e){for(let t of e.entries())this.defines[t[0]]=t[1];return this.needsUpdate=!0,this}setUniforms(e){for(let t of e.entries())this.uniforms[t[0]]=t[1];return this}setExtensions(e){this.extensions={};for(let t of e)this.extensions[t]=!0;return this}get encodeOutput(){return this.defines.ENCODE_OUTPUT!==void 0}set encodeOutput(e){this.encodeOutput!==e&&(e?this.defines.ENCODE_OUTPUT=`1`:delete this.defines.ENCODE_OUTPUT,this.needsUpdate=!0)}isOutputEncodingEnabled(e){return this.encodeOutput}setOutputEncodingEnabled(e){this.encodeOutput=e}get time(){return this.uniforms.time.value}set time(e){this.uniforms.time.value=e}setDeltaTime(e){this.uniforms.time.value+=e}adoptCameraSettings(e){this.copyCameraSettings(e)}copyCameraSettings(e){e&&(this.uniforms.cameraNear.value=e.near,this.uniforms.cameraFar.value=e.far,e instanceof Ie?this.defines.PERSPECTIVE_CAMERA=`1`:delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}setSize(e,t){let n=this.uniforms;n.resolution.value.set(e,t),n.texelSize.value.set(1/e,1/t),n.aspect.value=e/t}static get Section(){return G}};Number(`181`.replace(/\D+/g,``));var go=255/256;new Float32Array([go/256**3,go/256**2,go/256,go]),new Float32Array([go,go/256,go/256**2,1/256**3]);function _o(e,t,n){for(let r of t){let t=`$1`+e+r.charAt(0).toUpperCase()+r.slice(1),i=RegExp(`([^\\.])(\\b`+r+`\\b)`,`g`);for(let e of n.entries())e[1]!==null&&n.set(e[0],e[1].replace(i,t))}}function vo(e,t,n){let r=t.getFragmentShader(),i=t.getVertexShader(),a=r!==void 0&&/mainImage/.test(r),o=r!==void 0&&/mainUv/.test(r);if(n.attributes|=t.getAttributes(),r===void 0)throw Error(`Missing fragment shader (${t.name})`);if(o&&(n.attributes&Xa.CONVOLUTION)!==0)throw Error(`Effects that transform UVs are incompatible with convolution effects (${t.name})`);if(!a&&!o)throw Error(`Could not find mainImage or mainUv function (${t.name})`);{let s=/\w+\s+(\w+)\([\w\s,]*\)\s*{/g,c=n.shaderParts,l=c.get(G.FRAGMENT_HEAD)||``,u=c.get(G.FRAGMENT_MAIN_UV)||``,d=c.get(G.FRAGMENT_MAIN_IMAGE)||``,f=c.get(G.VERTEX_HEAD)||``,p=c.get(G.VERTEX_MAIN_SUPPORT)||``,m=new Set,h=new Set;if(o&&(u+=` ${e}MainUv(UV); +}`,mo=`uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;VERTEX_HEAD void main(){vUv=position.xy*0.5+0.5;VERTEX_MAIN_SUPPORT gl_Position=vec4(position.xy,1.0,1.0);}`,ho=class extends Jt{constructor(e,t,n,r,i=!1){super({name:`EffectMaterial`,defines:{THREE_REVISION:`181`.replace(/\D+/g,``),DEPTH_PACKING:`0`,ENCODE_OUTPUT:`1`},uniforms:{inputBuffer:new D(null),depthBuffer:new D(null),resolution:new D(new L),texelSize:new D(new L),cameraNear:new D(.3),cameraFar:new D(1e3),aspect:new D(1),time:new D(0)},blending:0,toneMapped:!1,depthWrite:!1,depthTest:!1,dithering:i}),e&&this.setShaderParts(e),t&&this.setDefines(t),n&&this.setUniforms(n),this.copyCameraSettings(r)}set inputBuffer(e){this.uniforms.inputBuffer.value=e}setInputBuffer(e){this.uniforms.inputBuffer.value=e}get depthBuffer(){return this.uniforms.depthBuffer.value}set depthBuffer(e){this.uniforms.depthBuffer.value=e}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(e){this.defines.DEPTH_PACKING=e.toFixed(0),this.needsUpdate=!0}setDepthBuffer(e,t=dt){this.depthBuffer=e,this.depthPacking=t}setShaderData(e){this.setShaderParts(e.shaderParts),this.setDefines(e.defines),this.setUniforms(e.uniforms),this.setExtensions(e.extensions)}setShaderParts(e){return this.fragmentShader=po.replace(G.FRAGMENT_HEAD,e.get(G.FRAGMENT_HEAD)||``).replace(G.FRAGMENT_MAIN_UV,e.get(G.FRAGMENT_MAIN_UV)||``).replace(G.FRAGMENT_MAIN_IMAGE,e.get(G.FRAGMENT_MAIN_IMAGE)||``),this.vertexShader=mo.replace(G.VERTEX_HEAD,e.get(G.VERTEX_HEAD)||``).replace(G.VERTEX_MAIN_SUPPORT,e.get(G.VERTEX_MAIN_SUPPORT)||``),this.needsUpdate=!0,this}setDefines(e){for(let t of e.entries())this.defines[t[0]]=t[1];return this.needsUpdate=!0,this}setUniforms(e){for(let t of e.entries())this.uniforms[t[0]]=t[1];return this}setExtensions(e){this.extensions={};for(let t of e)this.extensions[t]=!0;return this}get encodeOutput(){return this.defines.ENCODE_OUTPUT!==void 0}set encodeOutput(e){this.encodeOutput!==e&&(e?this.defines.ENCODE_OUTPUT=`1`:delete this.defines.ENCODE_OUTPUT,this.needsUpdate=!0)}isOutputEncodingEnabled(e){return this.encodeOutput}setOutputEncodingEnabled(e){this.encodeOutput=e}get time(){return this.uniforms.time.value}set time(e){this.uniforms.time.value=e}setDeltaTime(e){this.uniforms.time.value+=e}adoptCameraSettings(e){this.copyCameraSettings(e)}copyCameraSettings(e){e&&(this.uniforms.cameraNear.value=e.near,this.uniforms.cameraFar.value=e.far,e instanceof Ie?this.defines.PERSPECTIVE_CAMERA=`1`:delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}setSize(e,t){let n=this.uniforms;n.resolution.value.set(e,t),n.texelSize.value.set(1/e,1/t),n.aspect.value=e/t}static get Section(){return G}};Number(`181`.replace(/\D+/g,``));var go=255/256;new Float32Array([go/256**3,go/256**2,go/256,go]),new Float32Array([go,go/256,go/256**2,1/256**3]);function _o(e,t,n){for(let r of t){let t=`$1`+e+r.charAt(0).toUpperCase()+r.slice(1),i=RegExp(`([^\\.])(\\b`+r+`\\b)`,`g`);for(let e of n.entries())e[1]!==null&&n.set(e[0],e[1].replace(i,t))}}function vo(e,t,n){let r=t.getFragmentShader(),i=t.getVertexShader(),a=r!==void 0&&/mainImage/.test(r),o=r!==void 0&&/mainUv/.test(r);if(n.attributes|=t.getAttributes(),r===void 0)throw Error(`Missing fragment shader (${t.name})`);if(o&&(n.attributes&Xa.CONVOLUTION)!==0)throw Error(`Effects that transform UVs are incompatible with convolution effects (${t.name})`);if(!a&&!o)throw Error(`Could not find mainImage or mainUv function (${t.name})`);{let s=/\w+\s+(\w+)\([\w\s,]*\)\s*{/g,c=n.shaderParts,l=c.get(G.FRAGMENT_HEAD)||``,u=c.get(G.FRAGMENT_MAIN_UV)||``,d=c.get(G.FRAGMENT_MAIN_IMAGE)||``,f=c.get(G.VERTEX_HEAD)||``,p=c.get(G.VERTEX_MAIN_SUPPORT)||``,m=new Set,h=new Set;if(o&&(u+=` ${e}MainUv(UV); `,n.uvTransformation=!0),i!==null&&/mainSupport/.test(i)){let t=/mainSupport *\([\w\s]*?uv\s*?\)/.test(i);p+=` ${e}MainSupport(`,p+=t?`vUv); `:`); `;for(let e of i.matchAll(/(?:varying\s+\w+\s+([\S\s]*?);)/g))for(let t of e[1].split(/\s*,\s*/))n.varyings.add(t),m.add(t),h.add(t);for(let e of i.matchAll(s))h.add(e[1])}for(let e of r.matchAll(s))h.add(e[1]);for(let e of t.defines.keys())h.add(e.replace(/\([\w\s,]*\)/g,``));for(let e of t.uniforms.keys())h.add(e);h.delete(`while`),h.delete(`for`),h.delete(`if`),t.uniforms.forEach((t,r)=>n.uniforms.set(e+r.charAt(0).toUpperCase()+r.slice(1),t)),t.defines.forEach((t,r)=>n.defines.set(e+r.charAt(0).toUpperCase()+r.slice(1),t));let g=new Map([[`fragment`,r],[`vertex`,i]]);_o(e,h,n.defines),_o(e,h,g),r=g.get(`fragment`),i=g.get(`vertex`);let _=t.blendMode;if(n.blendModes.set(_.blendFunction,_),a){t.inputColorSpace!==null&&t.inputColorSpace!==n.colorSpace&&(d+=t.inputColorSpace===`srgb`?`color0 = sRGBTransferOETF(color0); @@ -1967,11 +1967,11 @@ return orthographicDepthToViewZ(depth,cameraNear,cameraFar); `+r),this.needsDepthTexture=this.getDepthTexture()===null),e.colorSpace===`srgb`&&(r+=`color0 = sRGBToLinear(color0); `),e.uvTransformation?(i=`vec2 transformedUv = vUv; `+i,e.defines.set(`UV`,`transformedUv`)):e.defines.set(`UV`,`vUv`),e.shaderParts.set(G.FRAGMENT_HEAD,n),e.shaderParts.set(G.FRAGMENT_MAIN_IMAGE,r),e.shaderParts.set(G.FRAGMENT_MAIN_UV,i);for(let[t,n]of e.shaderParts)n!==null&&e.shaderParts.set(t,n.trim().replace(/^#/,` -#`));this.skipRendering=t===0,this.needsSwap=!this.skipRendering,this.fullscreenMaterial.setShaderData(e)}recompile(){this.updateMaterial()}getDepthTexture(){return this.fullscreenMaterial.depthBuffer}setDepthTexture(e,t=dt){this.fullscreenMaterial.depthBuffer=e,this.fullscreenMaterial.depthPacking=t;for(let n of this.effects)n.setDepthTexture(e,t)}render(e,t,n,r,i){for(let n of this.effects)n.update(e,t,r);if(!this.skipRendering||this.renderToScreen){let i=this.fullscreenMaterial;i.inputBuffer=t.texture,i.time+=r*this.timeScale,e.setRenderTarget(this.renderToScreen?null:n),e.render(this.scene,this.camera)}}setSize(e,t){this.fullscreenMaterial.setSize(e,t);for(let n of this.effects)n.setSize(e,t)}initialize(e,t,n){this.renderer=e;for(let r of this.effects)r.initialize(e,t,n);this.updateMaterial(),n!==void 0&&n!==1009&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH=`1`)}dispose(){super.dispose();for(let e of this.effects)e.removeEventListener(`change`,this.listener),e.dispose()}handleEvent(e){switch(e.type){case`change`:this.recompile();break}}},bo=class extends Ba{constructor(e,t,{renderTarget:n,resolutionScale:r=1,width:i=to.AUTO_SIZE,height:a=to.AUTO_SIZE,resolutionX:o=i,resolutionY:s=a}={}){super(`NormalPass`),this.needsSwap=!1,this.renderPass=new ao(e,t,new At);let c=this.renderPass;c.ignoreBackground=!0,c.skipShadowMapUpdate=!0;let l=c.getClearPass();l.overrideClearColor=new H(7829503),l.overrideClearAlpha=1,this.renderTarget=n,this.renderTarget===void 0&&(this.renderTarget=new yt(1,1,{minFilter:Xe,magFilter:Xe}),this.renderTarget.texture.name=`NormalPass.Target`);let u=this.resolution=new to(this,o,s,r);u.addEventListener(`change`,e=>this.setSize(u.baseWidth,u.baseHeight))}set mainScene(e){this.renderPass.mainScene=e}set mainCamera(e){this.renderPass.mainCamera=e}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}getResolutionScale(){return this.resolution.scale}setResolutionScale(e){this.resolution.scale=e}render(e,t,n,r,i){let a=this.renderToScreen?null:this.renderTarget;this.renderPass.render(e,a,a)}setSize(e,t){let n=this.resolution;n.setBaseSize(e,t),this.renderTarget.setSize(n.width,n.height)}};new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,0,1]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([1,0,1]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([0,1,1]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([0,1,1]),new Float32Array([1,1,1]),new Float32Array(2),new Float32Array(2),new Float32Array([0,-.25,.25,-.125,.125,-.375,.375]),new Float32Array([0,0]),new Float32Array([.25,-.25]),new Float32Array([-.25,.25]),new Float32Array([.125,-.125]),new Float32Array([-.125,.125]),new Uint8Array([0,0]),new Uint8Array([3,0]),new Uint8Array([0,3]),new Uint8Array([3,3]),new Uint8Array([1,0]),new Uint8Array([4,0]),new Uint8Array([1,3]),new Uint8Array([4,3]),new Uint8Array([0,1]),new Uint8Array([3,1]),new Uint8Array([0,4]),new Uint8Array([3,4]),new Uint8Array([1,1]),new Uint8Array([4,1]),new Uint8Array([1,4]),new Uint8Array([4,4]),new Uint8Array([0,0]),new Uint8Array([1,0]),new Uint8Array([0,2]),new Uint8Array([1,2]),new Uint8Array([2,0]),new Uint8Array([3,0]),new Uint8Array([2,2]),new Uint8Array([3,2]),new Uint8Array([0,1]),new Uint8Array([1,1]),new Uint8Array([0,3]),new Uint8Array([1,3]),new Uint8Array([2,1]),new Uint8Array([3,1]),new Uint8Array([2,3]),new Uint8Array([3,3]),q(0,0,0,0),new Float32Array([0,0,0,0]),q(0,0,0,1),new Float32Array([0,0,0,1]),q(0,0,1,0),new Float32Array([0,0,1,0]),q(0,0,1,1),new Float32Array([0,0,1,1]),q(0,1,0,0),new Float32Array([0,1,0,0]),q(0,1,0,1),new Float32Array([0,1,0,1]),q(0,1,1,0),new Float32Array([0,1,1,0]),q(0,1,1,1),new Float32Array([0,1,1,1]),q(1,0,0,0),new Float32Array([1,0,0,0]),q(1,0,0,1),new Float32Array([1,0,0,1]),q(1,0,1,0),new Float32Array([1,0,1,0]),q(1,0,1,1),new Float32Array([1,0,1,1]),q(1,1,0,0),new Float32Array([1,1,0,0]),q(1,1,0,1),new Float32Array([1,1,0,1]),q(1,1,1,0),new Float32Array([1,1,1,0]),q(1,1,1,1),new Float32Array([1,1,1,1]);function xo(e,t,n){return e+(t-e)*n}function q(e,t,n,r){return xo(xo(e,t,.75),xo(n,r,.75),.875)}var So=class{static isWebGL2Available(){try{let e=document.createElement(`canvas`);return!!(window.WebGL2RenderingContext&&e.getContext(`webgl2`))}catch{return!1}}static isColorSpaceAvailable(e){try{let t=document.createElement(`canvas`),n=window.WebGL2RenderingContext&&t.getContext(`webgl2`);return n.drawingBufferColorSpace=e,n.drawingBufferColorSpace===e}catch{return!1}}static getWebGL2ErrorMessage(){return this._getErrorMessage(2)}static _getErrorMessage(e){let t={1:`WebGL`,2:`WebGL 2`},n={1:window.WebGLRenderingContext,2:window.WebGL2RenderingContext},r=`Your $0 does not seem to support $1`,i=document.createElement(`div`);return i.id=`webglmessage`,i.style.fontFamily=`monospace`,i.style.fontSize=`13px`,i.style.fontWeight=`normal`,i.style.textAlign=`center`,i.style.background=`#fff`,i.style.color=`#000`,i.style.padding=`1.5em`,i.style.width=`400px`,i.style.margin=`5em auto 0`,r=n[e]?r.replace(`$0`,`graphics card`):r.replace(`$0`,`browser`),r=r.replace(`$1`,t[e]),i.innerHTML=r,i}},Co=Symbol(`effectComposerPmndrs`),wo=e({__name:`EffectComposerPmndrs`,props:{enabled:{type:Boolean,required:!1,default:!0},depthBuffer:{type:Boolean,required:!1,default:void 0},disableNormalPass:{type:Boolean,required:!1,default:!1},stencilBuffer:{type:Boolean,required:!1,default:void 0},resolutionScale:{type:Number,required:!1},autoClear:{type:Boolean,required:!1,default:!0},multisampling:{type:Number,required:!1,default:0},frameBufferType:{type:Number,required:!1,default:qt}},emits:[`render`],setup(e,{expose:t,emit:n}){let r=e,i=n,{scene:a,camera:s,renderer:c,sizes:l}=Et(),u=C(null),d=null,f=null;ee(Co,u),t({composer:u});let g=()=>{u.value&&(f=new bo(a.value,s.activeCamera.value),f.enabled=!1,u.value.addPass(f),r.resolutionScale!==void 0&&So.isWebGL2Available()&&(d=new fo({normalBuffer:f.texture,resolutionScale:r.resolutionScale}),d.enabled=!1,u.value.addPass(d)))},_=h(()=>{let e=new Ya,t={depthBuffer:r.depthBuffer===void 0?e.inputBuffer.depthBuffer:r.depthBuffer,stencilBuffer:r.stencilBuffer===void 0?e.inputBuffer.stencilBuffer:r.stencilBuffer,multisampling:So.isWebGL2Available()?r.multisampling===void 0?e.multisampling:r.multisampling:0,frameBufferType:r.frameBufferType===void 0?qt:r.frameBufferType};return e.dispose(),t}),v=()=>{!c.instance&&!a.value&&!s.activeCamera.value||(u.value?.dispose(),u.value=new Ya(c.instance,_.value),u.value.addPass(new ao(a.value,s.activeCamera.value)),r.disableNormalPass||g())};return m([a,s.activeCamera,()=>r.disableNormalPass],()=>{!l.width.value||!l.height.value||v()}),m(()=>[l.width.value,l.height.value],([e,t])=>{!e&&!t||(u.value?u.value.setSize(e,t):v())},{immediate:!0}),c.replaceRenderFunction(e=>{if(r.enabled&&c.instance&&u.value&&l.width.value&&l.height.value){let t=c.instance.autoClear;c.instance.autoClear=r.autoClear,r.stencilBuffer&&!r.autoClear&&c.instance.clearStencil(),u.value.render(),i(`render`,u.value),c.instance.autoClear=t,e()}}),o(()=>{u.value?.dispose()}),(e,t)=>p(e.$slots,`default`)}}),To=(e,n,r)=>{let i=a(Co),s=C(null),c=C(null),{scene:l,camera:u,invalidate:d}=Ze();m(n,()=>d());let f=()=>{s.value&&i?.value?.removePass(s.value),c.value?.dispose(),s.value?.dispose()},p=t=>{!u.value||!i?.value||!l.value||(c.value=e(),s.value=new yo(u.value,c.value),i.value.addPass(s.value,t))};r&&m(()=>r.map(e=>n[e]),()=>{if(!i?.value)return;let e=i.value?.passes.findIndex(e=>e===s.value);~e&&(f(),p(e))}),S(()=>{!u.value||!c?.value||(c.value.mainCamera=u.value)});let h=S(()=>{!u.value||!i?.value||!l.value||(t(()=>h()),!c.value&&p())});return o(()=>{f()}),{pass:s,effect:c}},Eo=/([^[.\]])+/g,Do=(e,t)=>{if(t)return(Array.isArray(t)?t:t.match(Eo))?.reduce((e,t)=>e&&e[t],e)},Oo=(e,t,n)=>{let r=Array.isArray(t)?t:t.match(Eo);r&&r.reduce((e,t,i)=>(e[t]===void 0&&(e[t]={}),i===r.length-1&&(e[t]=n),e[t]),e)},ko=(e,t,n,r,i={})=>m(e,i=>{if(t.value)if(i===void 0){let e=r();Oo(t.value,n,Do(e,n)),e.dispose?.()}else Oo(t.value,n,e())},i),Ao=(e,t,n)=>e.map(([e,r])=>ko(e,t,r,n)),jo=e({__name:`HueSaturationPmndrs`,props:{saturation:{type:Number,required:!1},hue:{type:Number,required:!1},blendFunction:{type:null,required:!1}},setup(e,{expose:t}){let n=e,{pass:r,effect:i}=To(()=>new so(n),n);return t({pass:r,effect:i}),Ao([[()=>n.blendFunction,`blendMode.blendFunction`],[()=>n.hue,`hue`],[()=>n.saturation,`saturation`]],i,()=>new so),()=>{}}}),Mo=`/assets/sky_linekotsi_23_HDRI-CDfEmkGI.hdr`;const No=Qt(`modelStore`,()=>{let{post:e,data:t}=rn({name:`airi-stores-live2d`}),n=w([]),r=e=>{n.value.push(e)};function i(){e({type:`should-update-view`}),n.value.forEach(e=>e())}m(t,e=>{e.type===`should-update-view`&&n.value.forEach(e=>e())});let a=U(`settings/stage-ui-three/scale`,1),o=U(`settings/stage-ui-three/lastModelSrc`,``),s=U(`settings/stage-ui-three/modelSize`,{x:0,y:0,z:0}),c=U(`settings/stage-ui-three/modelOrigin`,{x:0,y:0,z:0}),l=U(`settings/stage-ui-three/modelOffset`,{x:0,y:0,z:0}),u=U(`settings/stage-ui-three/modelRotationY`,0),d=U(`settings/stage-ui-three/cameraFOV`,40),f=U(`settings/stage-ui-three/camera-position`,{x:0,y:0,z:-1}),p=U(`settings/stage-ui-three/cameraDistance`,0),h=U(`settings/stage-ui-three/lookAtTarget`,{x:0,y:0,z:0}),g=U(`settings/stage-ui-three/trackingMode`,`none`),_=U(`settings/stage-ui-three/eyeHeight`,0);function v(){s.value={x:0,y:0,z:0},c.value={x:0,y:0,z:0},l.value={x:0,y:0,z:0},u.value=0,d.value=40,f.value={x:0,y:0,z:0},p.value=0,h.value={x:0,y:0,z:0},g.value=`none`,_.value=0}let y=U(`settings/stage-ui-three/scenes/scene/directional-light/position`,{x:0,y:0,z:-1}),b=U(`settings/stage-ui-three/scenes/scene/directional-light/target`,{x:0,y:0,z:0}),x=U(`settings/stage-ui-three/scenes/scene/directional-light/rotation`,{x:0,y:0,z:0}),S=U(`settings/stage-ui-three/scenes/scene/directional-light/intensity`,2.02),ee=U(`settings/stage-ui-three/scenes/scene/directional-light/color`,`#fffbf5`),te=U(`settings/stage-ui-three/scenes/scene/hemisphere-light/sky-color`,`#FFFFFF`),ne=U(`settings/stage-ui-three/scenes/scene/hemisphere-light/ground-color`,`#222222`),re=U(`settings/stage-ui-three/scenes/scene/hemisphere-light/intensity`,.4),C=U(`settings/stage-ui-three/scenes/scene/ambient-light/color`,`#FFFFFF`);return{scale:a,lastModelSrc:o,modelSize:s,modelOrigin:c,modelOffset:l,modelRotationY:u,cameraFOV:d,cameraPosition:f,cameraDistance:p,directionalLightPosition:y,directionalLightTarget:b,directionalLightRotation:x,directionalLightIntensity:S,directionalLightColor:ee,ambientLightIntensity:U(`settings/stage-ui-three/scenes/scene/ambient-light/intensity`,.6),ambientLightColor:C,hemisphereSkyColor:te,hemisphereGroundColor:ne,hemisphereLightIntensity:re,lookAtTarget:h,trackingMode:g,eyeHeight:_,envSelect:U(`settings/stage-ui-three/envEnabled`,`skyBox`),skyBoxSrc:U(`settings/stage-ui-three/skyBoxUrl`,Mo),skyBoxIntensity:U(`settings/stage-ui-three/skyBoxIntensity`,.1),onShouldUpdateView:r,shouldUpdateView:i,resetModelStore:v}});var Po={type:`change`},Fo={type:`start`},Io={type:`end`},Lo=new Oe,Ro=new A,zo=Math.cos(70*I.DEG2RAD),J=new F,Y=2*Math.PI,X={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},Bo=1e-6,Vo=class extends se{constructor(e,t=null){super(e,t),this.state=X.NONE,this.target=new F,this.cursor=new F,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.keyRotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:`ArrowLeft`,UP:`ArrowUp`,RIGHT:`ArrowRight`,BOTTOM:`ArrowDown`},this.mouseButtons={LEFT:Ot.ROTATE,MIDDLE:Ot.DOLLY,RIGHT:Ot.PAN},this.touches={ONE:N.ROTATE,TWO:N.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this._lastPosition=new F,this._lastQuaternion=new R,this._lastTargetPosition=new F,this._quat=new R().setFromUnitVectors(e.up,new F(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new Re,this._sphericalDelta=new Re,this._scale=1,this._panOffset=new F,this._rotateStart=new L,this._rotateEnd=new L,this._rotateDelta=new L,this._panStart=new L,this._panEnd=new L,this._panDelta=new L,this._dollyStart=new L,this._dollyEnd=new L,this._dollyDelta=new L,this._dollyDirection=new F,this._mouse=new L,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=Uo.bind(this),this._onPointerDown=Ho.bind(this),this._onPointerUp=Wo.bind(this),this._onContextMenu=Zo.bind(this),this._onMouseWheel=qo.bind(this),this._onKeyDown=Jo.bind(this),this._onTouchStart=Yo.bind(this),this._onTouchMove=Xo.bind(this),this._onMouseDown=Go.bind(this),this._onMouseMove=Ko.bind(this),this._interceptControlDown=Qo.bind(this),this._interceptControlUp=$o.bind(this),this.domElement!==null&&this.connect(this.domElement),this.update()}connect(e){super.connect(e),this.domElement.addEventListener(`pointerdown`,this._onPointerDown),this.domElement.addEventListener(`pointercancel`,this._onPointerUp),this.domElement.addEventListener(`contextmenu`,this._onContextMenu),this.domElement.addEventListener(`wheel`,this._onMouseWheel,{passive:!1}),this.domElement.getRootNode().addEventListener(`keydown`,this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction=`none`}disconnect(){this.domElement.removeEventListener(`pointerdown`,this._onPointerDown),this.domElement.removeEventListener(`pointermove`,this._onPointerMove),this.domElement.removeEventListener(`pointerup`,this._onPointerUp),this.domElement.removeEventListener(`pointercancel`,this._onPointerUp),this.domElement.removeEventListener(`wheel`,this._onMouseWheel),this.domElement.removeEventListener(`contextmenu`,this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.getRootNode().removeEventListener(`keydown`,this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction=`auto`}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(e){e.addEventListener(`keydown`,this._onKeyDown),this._domElementKeyEvents=e}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener(`keydown`,this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(Po),this.update(),this.state=X.NONE}update(e=null){let t=this.object.position;J.copy(t).sub(this.target),J.applyQuaternion(this._quat),this._spherical.setFromVector3(J),this.autoRotate&&this.state===X.NONE&&this._rotateLeft(this._getAutoRotationAngle(e)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let n=this.minAzimuthAngle,r=this.maxAzimuthAngle;isFinite(n)&&isFinite(r)&&(n<-Math.PI?n+=Y:n>Math.PI&&(n-=Y),r<-Math.PI?r+=Y:r>Math.PI&&(r-=Y),n<=r?this._spherical.theta=Math.max(n,Math.min(r,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(n+r)/2?Math.max(n,this._spherical.theta):Math.min(r,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let i=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{let e=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),i=e!=this._spherical.radius}if(J.setFromSpherical(this._spherical),J.applyQuaternion(this._quatInverse),t.copy(this.target).add(J),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let e=null;if(this.object.isPerspectiveCamera){let t=J.length();e=this._clampDistance(t*this._scale);let n=t-e;this.object.position.addScaledVector(this._dollyDirection,n),this.object.updateMatrixWorld(),i=!!n}else if(this.object.isOrthographicCamera){let t=new F(this._mouse.x,this._mouse.y,0);t.unproject(this.object);let n=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),i=n!==this.object.zoom;let r=new F(this._mouse.x,this._mouse.y,0);r.unproject(this.object),this.object.position.sub(r).add(t),this.object.updateMatrixWorld(),e=J.length()}else console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled.`),this.zoomToCursor=!1;e!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(e).add(this.object.position):(Lo.origin.copy(this.object.position),Lo.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(Lo.direction))Bo||8*(1-this._lastQuaternion.dot(this.object.quaternion))>Bo||this._lastTargetPosition.distanceToSquared(this.target)>Bo?(this.dispatchEvent(Po),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(e){return e===null?Y/60/60*this.autoRotateSpeed:Y/60*this.autoRotateSpeed*e}_getZoomScale(e){let t=Math.abs(e*.01);return .95**(this.zoomSpeed*t)}_rotateLeft(e){this._sphericalDelta.theta-=e}_rotateUp(e){this._sphericalDelta.phi-=e}_panLeft(e,t){J.setFromMatrixColumn(t,0),J.multiplyScalar(-e),this._panOffset.add(J)}_panUp(e,t){this.screenSpacePanning===!0?J.setFromMatrixColumn(t,1):(J.setFromMatrixColumn(t,0),J.crossVectors(this.object.up,J)),J.multiplyScalar(e),this._panOffset.add(J)}_pan(e,t){let n=this.domElement;if(this.object.isPerspectiveCamera){let r=this.object.position;J.copy(r).sub(this.target);let i=J.length();i*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*e*i/n.clientHeight,this.object.matrix),this._panUp(2*t*i/n.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(e*(this.object.right-this.object.left)/this.object.zoom/n.clientWidth,this.object.matrix),this._panUp(t*(this.object.top-this.object.bottom)/this.object.zoom/n.clientHeight,this.object.matrix)):(console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.`),this.enablePan=!1)}_dollyOut(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=e:(console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.`),this.enableZoom=!1)}_dollyIn(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=e:(console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.`),this.enableZoom=!1)}_updateZoomParameters(e,t){if(!this.zoomToCursor)return;this._performCursorZoom=!0;let n=this.domElement.getBoundingClientRect(),r=e-n.left,i=t-n.top,a=n.width,o=n.height;this._mouse.x=r/a*2-1,this._mouse.y=-(i/o)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(e){return Math.max(this.minDistance,Math.min(this.maxDistance,e))}_handleMouseDownRotate(e){this._rotateStart.set(e.clientX,e.clientY)}_handleMouseDownDolly(e){this._updateZoomParameters(e.clientX,e.clientX),this._dollyStart.set(e.clientX,e.clientY)}_handleMouseDownPan(e){this._panStart.set(e.clientX,e.clientY)}_handleMouseMoveRotate(e){this._rotateEnd.set(e.clientX,e.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);let t=this.domElement;this._rotateLeft(Y*this._rotateDelta.x/t.clientHeight),this._rotateUp(Y*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(e){this._dollyEnd.set(e.clientX,e.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(e){this._panEnd.set(e.clientX,e.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(e){this._updateZoomParameters(e.clientX,e.clientY),e.deltaY<0?this._dollyIn(this._getZoomScale(e.deltaY)):e.deltaY>0&&this._dollyOut(this._getZoomScale(e.deltaY)),this.update()}_handleKeyDown(e){let t=!1;switch(e.code){case this.keys.UP:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(Y*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),t=!0;break;case this.keys.BOTTOM:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(-Y*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),t=!0;break;case this.keys.LEFT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(Y*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),t=!0;break;case this.keys.RIGHT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(-Y*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),t=!0;break}t&&(e.preventDefault(),this.update())}_handleTouchStartRotate(e){if(this._pointers.length===1)this._rotateStart.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._rotateStart.set(n,r)}}_handleTouchStartPan(e){if(this._pointers.length===1)this._panStart.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._panStart.set(n,r)}}_handleTouchStartDolly(e){let t=this._getSecondPointerPosition(e),n=e.pageX-t.x,r=e.pageY-t.y,i=Math.sqrt(n*n+r*r);this._dollyStart.set(0,i)}_handleTouchStartDollyPan(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enablePan&&this._handleTouchStartPan(e)}_handleTouchStartDollyRotate(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enableRotate&&this._handleTouchStartRotate(e)}_handleTouchMoveRotate(e){if(this._pointers.length==1)this._rotateEnd.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._rotateEnd.set(n,r)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);let t=this.domElement;this._rotateLeft(Y*this._rotateDelta.x/t.clientHeight),this._rotateUp(Y*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(e){if(this._pointers.length===1)this._panEnd.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._panEnd.set(n,r)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(e){let t=this._getSecondPointerPosition(e),n=e.pageX-t.x,r=e.pageY-t.y,i=Math.sqrt(n*n+r*r);this._dollyEnd.set(0,i),this._dollyDelta.set(0,(this._dollyEnd.y/this._dollyStart.y)**+this.zoomSpeed),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);let a=(e.pageX+t.x)*.5,o=(e.pageY+t.y)*.5;this._updateZoomParameters(a,o)}_handleTouchMoveDollyPan(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enablePan&&this._handleTouchMovePan(e)}_handleTouchMoveDollyRotate(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enableRotate&&this._handleTouchMoveRotate(e)}_addPointer(e){this._pointers.push(e.pointerId)}_removePointer(e){delete this._pointerPositions[e.pointerId];for(let t=0;t{y.value&&(y.value.minDistance=e.z,y.value.maxDistance=e.z*20,y.value.update())},{immediate:!0,deep:!0}),m(u,e=>{!b.value||!y.value||(b.value.position.set(e.x,e.y,e.z),b.value.updateProjectionMatrix(),y.value.update())},{immediate:!0,deep:!0}),m(d,e=>{y.value&&(y.value.target.set(e.x,e.y,e.z),y.value.update())},{immediate:!0,deep:!0}),m(h,e=>{!b.value||!y.value||(b.value.fov=e,b.value.updateProjectionMatrix(),y.value.update())},{immediate:!0}),m(g,e=>{if(!b.value||!y.value)return;let t=new F,n=y.value.target,r=new F().subVectors(b.value.position,n).normalize();t.copy(n).addScaledVector(r,e),b.value.position.set(t.x,t.y,t.z),b.value.updateProjectionMatrix(),y.value.update()}),m(s,e=>{!b.value||!y.value||(y.value.enableRotate=e,y.value.enableZoom=e)},{immediate:!0}),y.value?.addEventListener(`change`,()=>{c.value&&a(`orbitControlsCameraChanged`,{newCameraPosition:{x:b.value.position.x,y:b.value.position.y,z:b.value.position.z},newCameraDistance:y.value.getDistance()})})}return f(async()=>{if(await tn(()=>_.value&&v.domElement).toBeTruthy(),await tn(()=>i.modelLoaded).toBeTruthy(),!_.value||!v.domElement){console.warn(`Camera or Renderer initialisation failure!`);return}if(!(_.value instanceof Ie)){console.warn(`Camera is not perspective camera, type error!`);return}b.value=_.value,y.value=new Vo(b.value,v.domElement),y.value.enablePan=!1,y.value.enableZoom=!1,y.value.enableRotate=!1,y.value.mouseButtons={LEFT:Ot.ROTATE,MIDDLE:Ot.DOLLY,RIGHT:Ot.PAN},y.value.touches={ONE:N.ROTATE,TWO:N.DOLLY_PAN},x(),y.value.update(),a(`orbitControlsReady`)}),o(()=>{}),t({controls:y,getDistance:()=>y.value?.getDistance(),update:()=>y.value?.update(),setTarget:e=>{y.value&&(y.value.target.set(e.x,e.y,e.z),y.value.update())}}),(e,t)=>p(e.$slots,`default`)}}),ts=class{static fromCubeTexture(e){let t=0,n=new F,r=new F,i=new H,a=[0,0,0,0,0,0,0,0,0],o=new He,s=o.coefficients;for(let o=0;o<6;o++){let c=e.image[o],l=c.width,u=c.height,d=document.createElement(`canvas`);d.width=l,d.height=u;let f=d.getContext(`2d`);f.drawImage(c,0,0,l,u);let p=f.getImageData(0,0,l,u),m=p.data,h=p.width,g=2/h;for(let c=0,l=m.length;c(i=s.indexOf(` +#`));this.skipRendering=t===0,this.needsSwap=!this.skipRendering,this.fullscreenMaterial.setShaderData(e)}recompile(){this.updateMaterial()}getDepthTexture(){return this.fullscreenMaterial.depthBuffer}setDepthTexture(e,t=dt){this.fullscreenMaterial.depthBuffer=e,this.fullscreenMaterial.depthPacking=t;for(let n of this.effects)n.setDepthTexture(e,t)}render(e,t,n,r,i){for(let n of this.effects)n.update(e,t,r);if(!this.skipRendering||this.renderToScreen){let i=this.fullscreenMaterial;i.inputBuffer=t.texture,i.time+=r*this.timeScale,e.setRenderTarget(this.renderToScreen?null:n),e.render(this.scene,this.camera)}}setSize(e,t){this.fullscreenMaterial.setSize(e,t);for(let n of this.effects)n.setSize(e,t)}initialize(e,t,n){this.renderer=e;for(let r of this.effects)r.initialize(e,t,n);this.updateMaterial(),n!==void 0&&n!==1009&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH=`1`)}dispose(){super.dispose();for(let e of this.effects)e.removeEventListener(`change`,this.listener),e.dispose()}handleEvent(e){switch(e.type){case`change`:this.recompile();break}}},bo=class extends Ba{constructor(e,t,{renderTarget:n,resolutionScale:r=1,width:i=to.AUTO_SIZE,height:a=to.AUTO_SIZE,resolutionX:o=i,resolutionY:s=a}={}){super(`NormalPass`),this.needsSwap=!1,this.renderPass=new ao(e,t,new At);let c=this.renderPass;c.ignoreBackground=!0,c.skipShadowMapUpdate=!0;let l=c.getClearPass();l.overrideClearColor=new H(7829503),l.overrideClearAlpha=1,this.renderTarget=n,this.renderTarget===void 0&&(this.renderTarget=new yt(1,1,{minFilter:Xe,magFilter:Xe}),this.renderTarget.texture.name=`NormalPass.Target`);let u=this.resolution=new to(this,o,s,r);u.addEventListener(`change`,e=>this.setSize(u.baseWidth,u.baseHeight))}set mainScene(e){this.renderPass.mainScene=e}set mainCamera(e){this.renderPass.mainCamera=e}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}getResolutionScale(){return this.resolution.scale}setResolutionScale(e){this.resolution.scale=e}render(e,t,n,r,i){let a=this.renderToScreen?null:this.renderTarget;this.renderPass.render(e,a,a)}setSize(e,t){let n=this.resolution;n.setBaseSize(e,t),this.renderTarget.setSize(n.width,n.height)}};new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,0,1]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([1,0,1]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([0,1,1]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([0,1,1]),new Float32Array([1,1,1]),new Float32Array(2),new Float32Array(2),new Float32Array([0,-.25,.25,-.125,.125,-.375,.375]),new Float32Array([0,0]),new Float32Array([.25,-.25]),new Float32Array([-.25,.25]),new Float32Array([.125,-.125]),new Float32Array([-.125,.125]),new Uint8Array([0,0]),new Uint8Array([3,0]),new Uint8Array([0,3]),new Uint8Array([3,3]),new Uint8Array([1,0]),new Uint8Array([4,0]),new Uint8Array([1,3]),new Uint8Array([4,3]),new Uint8Array([0,1]),new Uint8Array([3,1]),new Uint8Array([0,4]),new Uint8Array([3,4]),new Uint8Array([1,1]),new Uint8Array([4,1]),new Uint8Array([1,4]),new Uint8Array([4,4]),new Uint8Array([0,0]),new Uint8Array([1,0]),new Uint8Array([0,2]),new Uint8Array([1,2]),new Uint8Array([2,0]),new Uint8Array([3,0]),new Uint8Array([2,2]),new Uint8Array([3,2]),new Uint8Array([0,1]),new Uint8Array([1,1]),new Uint8Array([0,3]),new Uint8Array([1,3]),new Uint8Array([2,1]),new Uint8Array([3,1]),new Uint8Array([2,3]),new Uint8Array([3,3]),q(0,0,0,0),new Float32Array([0,0,0,0]),q(0,0,0,1),new Float32Array([0,0,0,1]),q(0,0,1,0),new Float32Array([0,0,1,0]),q(0,0,1,1),new Float32Array([0,0,1,1]),q(0,1,0,0),new Float32Array([0,1,0,0]),q(0,1,0,1),new Float32Array([0,1,0,1]),q(0,1,1,0),new Float32Array([0,1,1,0]),q(0,1,1,1),new Float32Array([0,1,1,1]),q(1,0,0,0),new Float32Array([1,0,0,0]),q(1,0,0,1),new Float32Array([1,0,0,1]),q(1,0,1,0),new Float32Array([1,0,1,0]),q(1,0,1,1),new Float32Array([1,0,1,1]),q(1,1,0,0),new Float32Array([1,1,0,0]),q(1,1,0,1),new Float32Array([1,1,0,1]),q(1,1,1,0),new Float32Array([1,1,1,0]),q(1,1,1,1),new Float32Array([1,1,1,1]);function xo(e,t,n){return e+(t-e)*n}function q(e,t,n,r){return xo(xo(e,t,.75),xo(n,r,.75),.875)}var So=class{static isWebGL2Available(){try{let e=document.createElement(`canvas`);return!!(window.WebGL2RenderingContext&&e.getContext(`webgl2`))}catch{return!1}}static isColorSpaceAvailable(e){try{let t=document.createElement(`canvas`),n=window.WebGL2RenderingContext&&t.getContext(`webgl2`);return n.drawingBufferColorSpace=e,n.drawingBufferColorSpace===e}catch{return!1}}static getWebGL2ErrorMessage(){return this._getErrorMessage(2)}static _getErrorMessage(e){let t={1:`WebGL`,2:`WebGL 2`},n={1:window.WebGLRenderingContext,2:window.WebGL2RenderingContext},r=`Your $0 does not seem to support $1`,i=document.createElement(`div`);return i.id=`webglmessage`,i.style.fontFamily=`monospace`,i.style.fontSize=`13px`,i.style.fontWeight=`normal`,i.style.textAlign=`center`,i.style.background=`#fff`,i.style.color=`#000`,i.style.padding=`1.5em`,i.style.width=`400px`,i.style.margin=`5em auto 0`,r=n[e]?r.replace(`$0`,`graphics card`):r.replace(`$0`,`browser`),r=r.replace(`$1`,t[e]),i.innerHTML=r,i}},Co=Symbol(`effectComposerPmndrs`),wo=e({__name:`EffectComposerPmndrs`,props:{enabled:{type:Boolean,required:!1,default:!0},depthBuffer:{type:Boolean,required:!1,default:void 0},disableNormalPass:{type:Boolean,required:!1,default:!1},stencilBuffer:{type:Boolean,required:!1,default:void 0},resolutionScale:{type:Number,required:!1},autoClear:{type:Boolean,required:!1,default:!0},multisampling:{type:Number,required:!1,default:0},frameBufferType:{type:Number,required:!1,default:qt}},emits:[`render`],setup(e,{expose:t,emit:n}){let r=e,i=n,{scene:a,camera:s,renderer:c,sizes:l}=Et(),u=w(null),d=null,f=null;C(Co,u),t({composer:u});let g=()=>{u.value&&(f=new bo(a.value,s.activeCamera.value),f.enabled=!1,u.value.addPass(f),r.resolutionScale!==void 0&&So.isWebGL2Available()&&(d=new fo({normalBuffer:f.texture,resolutionScale:r.resolutionScale}),d.enabled=!1,u.value.addPass(d)))},_=h(()=>{let e=new Ya,t={depthBuffer:r.depthBuffer===void 0?e.inputBuffer.depthBuffer:r.depthBuffer,stencilBuffer:r.stencilBuffer===void 0?e.inputBuffer.stencilBuffer:r.stencilBuffer,multisampling:So.isWebGL2Available()?r.multisampling===void 0?e.multisampling:r.multisampling:0,frameBufferType:r.frameBufferType===void 0?qt:r.frameBufferType};return e.dispose(),t}),v=()=>{!c.instance&&!a.value&&!s.activeCamera.value||(u.value?.dispose(),u.value=new Ya(c.instance,_.value),u.value.addPass(new ao(a.value,s.activeCamera.value)),r.disableNormalPass||g())};return m([a,s.activeCamera,()=>r.disableNormalPass],()=>{!l.width.value||!l.height.value||v()}),m(()=>[l.width.value,l.height.value],([e,t])=>{!e&&!t||(u.value?u.value.setSize(e,t):v())},{immediate:!0}),c.replaceRenderFunction(e=>{if(r.enabled&&c.instance&&u.value&&l.width.value&&l.height.value){let t=c.instance.autoClear;c.instance.autoClear=r.autoClear,r.stencilBuffer&&!r.autoClear&&c.instance.clearStencil(),u.value.render(),i(`render`,u.value),c.instance.autoClear=t,e()}}),o(()=>{u.value?.dispose()}),(e,t)=>p(e.$slots,`default`)}}),To=(e,n,r)=>{let i=a(Co),s=w(null),c=w(null),{scene:l,camera:u,invalidate:d}=Ze();m(n,()=>d());let f=()=>{s.value&&i?.value?.removePass(s.value),c.value?.dispose(),s.value?.dispose()},p=t=>{!u.value||!i?.value||!l.value||(c.value=e(),s.value=new yo(u.value,c.value),i.value.addPass(s.value,t))};r&&m(()=>r.map(e=>n[e]),()=>{if(!i?.value)return;let e=i.value?.passes.findIndex(e=>e===s.value);~e&&(f(),p(e))}),S(()=>{!u.value||!c?.value||(c.value.mainCamera=u.value)});let h=S(()=>{!u.value||!i?.value||!l.value||(t(()=>h()),!c.value&&p())});return o(()=>{f()}),{pass:s,effect:c}},Eo=/([^[.\]])+/g,Do=(e,t)=>{if(t)return(Array.isArray(t)?t:t.match(Eo))?.reduce((e,t)=>e&&e[t],e)},Oo=(e,t,n)=>{let r=Array.isArray(t)?t:t.match(Eo);r&&r.reduce((e,t,i)=>(e[t]===void 0&&(e[t]={}),i===r.length-1&&(e[t]=n),e[t]),e)},ko=(e,t,n,r,i={})=>m(e,i=>{if(t.value)if(i===void 0){let e=r();Oo(t.value,n,Do(e,n)),e.dispose?.()}else Oo(t.value,n,e())},i),Ao=(e,t,n)=>e.map(([e,r])=>ko(e,t,r,n)),jo=e({__name:`HueSaturationPmndrs`,props:{saturation:{type:Number,required:!1},hue:{type:Number,required:!1},blendFunction:{type:null,required:!1}},setup(e,{expose:t}){let n=e,{pass:r,effect:i}=To(()=>new so(n),n);return t({pass:r,effect:i}),Ao([[()=>n.blendFunction,`blendMode.blendFunction`],[()=>n.hue,`hue`],[()=>n.saturation,`saturation`]],i,()=>new so),()=>{}}}),Mo=`/assets/sky_linekotsi_23_HDRI-CDfEmkGI.hdr`;const No=Qt(`modelStore`,()=>{let{post:e,data:t}=rn({name:`airi-stores-live2d`}),n=T([]),r=e=>{n.value.push(e)};function i(){e({type:`should-update-view`}),n.value.forEach(e=>e())}m(t,e=>{e.type===`should-update-view`&&n.value.forEach(e=>e())});let a=U(`settings/stage-ui-three/scale`,1),o=U(`settings/stage-ui-three/lastModelSrc`,``),s=U(`settings/stage-ui-three/modelSize`,{x:0,y:0,z:0}),c=U(`settings/stage-ui-three/modelOrigin`,{x:0,y:0,z:0}),l=U(`settings/stage-ui-three/modelOffset`,{x:0,y:0,z:0}),u=U(`settings/stage-ui-three/modelRotationY`,0),d=U(`settings/stage-ui-three/cameraFOV`,40),f=U(`settings/stage-ui-three/camera-position`,{x:0,y:0,z:-1}),p=U(`settings/stage-ui-three/cameraDistance`,0),h=U(`settings/stage-ui-three/lookAtTarget`,{x:0,y:0,z:0}),g=U(`settings/stage-ui-three/trackingMode`,`none`),_=U(`settings/stage-ui-three/eyeHeight`,0);function v(){s.value={x:0,y:0,z:0},c.value={x:0,y:0,z:0},l.value={x:0,y:0,z:0},u.value=0,d.value=40,f.value={x:0,y:0,z:0},p.value=0,h.value={x:0,y:0,z:0},g.value=`none`,_.value=0}let y=U(`settings/stage-ui-three/scenes/scene/directional-light/position`,{x:0,y:0,z:-1}),b=U(`settings/stage-ui-three/scenes/scene/directional-light/target`,{x:0,y:0,z:0}),x=U(`settings/stage-ui-three/scenes/scene/directional-light/rotation`,{x:0,y:0,z:0}),S=U(`settings/stage-ui-three/scenes/scene/directional-light/intensity`,2.02),C=U(`settings/stage-ui-three/scenes/scene/directional-light/color`,`#fffbf5`),ee=U(`settings/stage-ui-three/scenes/scene/hemisphere-light/sky-color`,`#FFFFFF`),te=U(`settings/stage-ui-three/scenes/scene/hemisphere-light/ground-color`,`#222222`),ne=U(`settings/stage-ui-three/scenes/scene/hemisphere-light/intensity`,.4),w=U(`settings/stage-ui-three/scenes/scene/ambient-light/color`,`#FFFFFF`);return{scale:a,lastModelSrc:o,modelSize:s,modelOrigin:c,modelOffset:l,modelRotationY:u,cameraFOV:d,cameraPosition:f,cameraDistance:p,directionalLightPosition:y,directionalLightTarget:b,directionalLightRotation:x,directionalLightIntensity:S,directionalLightColor:C,ambientLightIntensity:U(`settings/stage-ui-three/scenes/scene/ambient-light/intensity`,.6),ambientLightColor:w,hemisphereSkyColor:ee,hemisphereGroundColor:te,hemisphereLightIntensity:ne,lookAtTarget:h,trackingMode:g,eyeHeight:_,envSelect:U(`settings/stage-ui-three/envEnabled`,`skyBox`),skyBoxSrc:U(`settings/stage-ui-three/skyBoxUrl`,Mo),skyBoxIntensity:U(`settings/stage-ui-three/skyBoxIntensity`,.1),onShouldUpdateView:r,shouldUpdateView:i,resetModelStore:v}});var Po={type:`change`},Fo={type:`start`},Io={type:`end`},Lo=new ke,Ro=new ue,zo=Math.cos(70*I.DEG2RAD),J=new F,Y=2*Math.PI,X={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},Bo=1e-6,Vo=class extends oe{constructor(e,t=null){super(e,t),this.state=X.NONE,this.target=new F,this.cursor=new F,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.keyRotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:`ArrowLeft`,UP:`ArrowUp`,RIGHT:`ArrowRight`,BOTTOM:`ArrowDown`},this.mouseButtons={LEFT:Ot.ROTATE,MIDDLE:Ot.DOLLY,RIGHT:Ot.PAN},this.touches={ONE:M.ROTATE,TWO:M.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this._lastPosition=new F,this._lastQuaternion=new R,this._lastTargetPosition=new F,this._quat=new R().setFromUnitVectors(e.up,new F(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new Re,this._sphericalDelta=new Re,this._scale=1,this._panOffset=new F,this._rotateStart=new L,this._rotateEnd=new L,this._rotateDelta=new L,this._panStart=new L,this._panEnd=new L,this._panDelta=new L,this._dollyStart=new L,this._dollyEnd=new L,this._dollyDelta=new L,this._dollyDirection=new F,this._mouse=new L,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=Uo.bind(this),this._onPointerDown=Ho.bind(this),this._onPointerUp=Wo.bind(this),this._onContextMenu=Zo.bind(this),this._onMouseWheel=qo.bind(this),this._onKeyDown=Jo.bind(this),this._onTouchStart=Yo.bind(this),this._onTouchMove=Xo.bind(this),this._onMouseDown=Go.bind(this),this._onMouseMove=Ko.bind(this),this._interceptControlDown=Qo.bind(this),this._interceptControlUp=$o.bind(this),this.domElement!==null&&this.connect(this.domElement),this.update()}connect(e){super.connect(e),this.domElement.addEventListener(`pointerdown`,this._onPointerDown),this.domElement.addEventListener(`pointercancel`,this._onPointerUp),this.domElement.addEventListener(`contextmenu`,this._onContextMenu),this.domElement.addEventListener(`wheel`,this._onMouseWheel,{passive:!1}),this.domElement.getRootNode().addEventListener(`keydown`,this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction=`none`}disconnect(){this.domElement.removeEventListener(`pointerdown`,this._onPointerDown),this.domElement.removeEventListener(`pointermove`,this._onPointerMove),this.domElement.removeEventListener(`pointerup`,this._onPointerUp),this.domElement.removeEventListener(`pointercancel`,this._onPointerUp),this.domElement.removeEventListener(`wheel`,this._onMouseWheel),this.domElement.removeEventListener(`contextmenu`,this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.getRootNode().removeEventListener(`keydown`,this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction=`auto`}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(e){e.addEventListener(`keydown`,this._onKeyDown),this._domElementKeyEvents=e}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener(`keydown`,this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(Po),this.update(),this.state=X.NONE}update(e=null){let t=this.object.position;J.copy(t).sub(this.target),J.applyQuaternion(this._quat),this._spherical.setFromVector3(J),this.autoRotate&&this.state===X.NONE&&this._rotateLeft(this._getAutoRotationAngle(e)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let n=this.minAzimuthAngle,r=this.maxAzimuthAngle;isFinite(n)&&isFinite(r)&&(n<-Math.PI?n+=Y:n>Math.PI&&(n-=Y),r<-Math.PI?r+=Y:r>Math.PI&&(r-=Y),n<=r?this._spherical.theta=Math.max(n,Math.min(r,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(n+r)/2?Math.max(n,this._spherical.theta):Math.min(r,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let i=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{let e=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),i=e!=this._spherical.radius}if(J.setFromSpherical(this._spherical),J.applyQuaternion(this._quatInverse),t.copy(this.target).add(J),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let e=null;if(this.object.isPerspectiveCamera){let t=J.length();e=this._clampDistance(t*this._scale);let n=t-e;this.object.position.addScaledVector(this._dollyDirection,n),this.object.updateMatrixWorld(),i=!!n}else if(this.object.isOrthographicCamera){let t=new F(this._mouse.x,this._mouse.y,0);t.unproject(this.object);let n=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),i=n!==this.object.zoom;let r=new F(this._mouse.x,this._mouse.y,0);r.unproject(this.object),this.object.position.sub(r).add(t),this.object.updateMatrixWorld(),e=J.length()}else console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled.`),this.zoomToCursor=!1;e!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(e).add(this.object.position):(Lo.origin.copy(this.object.position),Lo.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(Lo.direction))Bo||8*(1-this._lastQuaternion.dot(this.object.quaternion))>Bo||this._lastTargetPosition.distanceToSquared(this.target)>Bo?(this.dispatchEvent(Po),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(e){return e===null?Y/60/60*this.autoRotateSpeed:Y/60*this.autoRotateSpeed*e}_getZoomScale(e){let t=Math.abs(e*.01);return .95**(this.zoomSpeed*t)}_rotateLeft(e){this._sphericalDelta.theta-=e}_rotateUp(e){this._sphericalDelta.phi-=e}_panLeft(e,t){J.setFromMatrixColumn(t,0),J.multiplyScalar(-e),this._panOffset.add(J)}_panUp(e,t){this.screenSpacePanning===!0?J.setFromMatrixColumn(t,1):(J.setFromMatrixColumn(t,0),J.crossVectors(this.object.up,J)),J.multiplyScalar(e),this._panOffset.add(J)}_pan(e,t){let n=this.domElement;if(this.object.isPerspectiveCamera){let r=this.object.position;J.copy(r).sub(this.target);let i=J.length();i*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*e*i/n.clientHeight,this.object.matrix),this._panUp(2*t*i/n.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(e*(this.object.right-this.object.left)/this.object.zoom/n.clientWidth,this.object.matrix),this._panUp(t*(this.object.top-this.object.bottom)/this.object.zoom/n.clientHeight,this.object.matrix)):(console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.`),this.enablePan=!1)}_dollyOut(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=e:(console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.`),this.enableZoom=!1)}_dollyIn(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=e:(console.warn(`WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.`),this.enableZoom=!1)}_updateZoomParameters(e,t){if(!this.zoomToCursor)return;this._performCursorZoom=!0;let n=this.domElement.getBoundingClientRect(),r=e-n.left,i=t-n.top,a=n.width,o=n.height;this._mouse.x=r/a*2-1,this._mouse.y=-(i/o)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(e){return Math.max(this.minDistance,Math.min(this.maxDistance,e))}_handleMouseDownRotate(e){this._rotateStart.set(e.clientX,e.clientY)}_handleMouseDownDolly(e){this._updateZoomParameters(e.clientX,e.clientX),this._dollyStart.set(e.clientX,e.clientY)}_handleMouseDownPan(e){this._panStart.set(e.clientX,e.clientY)}_handleMouseMoveRotate(e){this._rotateEnd.set(e.clientX,e.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);let t=this.domElement;this._rotateLeft(Y*this._rotateDelta.x/t.clientHeight),this._rotateUp(Y*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(e){this._dollyEnd.set(e.clientX,e.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(e){this._panEnd.set(e.clientX,e.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(e){this._updateZoomParameters(e.clientX,e.clientY),e.deltaY<0?this._dollyIn(this._getZoomScale(e.deltaY)):e.deltaY>0&&this._dollyOut(this._getZoomScale(e.deltaY)),this.update()}_handleKeyDown(e){let t=!1;switch(e.code){case this.keys.UP:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(Y*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),t=!0;break;case this.keys.BOTTOM:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(-Y*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),t=!0;break;case this.keys.LEFT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(Y*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),t=!0;break;case this.keys.RIGHT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(-Y*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),t=!0;break}t&&(e.preventDefault(),this.update())}_handleTouchStartRotate(e){if(this._pointers.length===1)this._rotateStart.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._rotateStart.set(n,r)}}_handleTouchStartPan(e){if(this._pointers.length===1)this._panStart.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._panStart.set(n,r)}}_handleTouchStartDolly(e){let t=this._getSecondPointerPosition(e),n=e.pageX-t.x,r=e.pageY-t.y,i=Math.sqrt(n*n+r*r);this._dollyStart.set(0,i)}_handleTouchStartDollyPan(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enablePan&&this._handleTouchStartPan(e)}_handleTouchStartDollyRotate(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enableRotate&&this._handleTouchStartRotate(e)}_handleTouchMoveRotate(e){if(this._pointers.length==1)this._rotateEnd.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._rotateEnd.set(n,r)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);let t=this.domElement;this._rotateLeft(Y*this._rotateDelta.x/t.clientHeight),this._rotateUp(Y*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(e){if(this._pointers.length===1)this._panEnd.set(e.pageX,e.pageY);else{let t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._panEnd.set(n,r)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(e){let t=this._getSecondPointerPosition(e),n=e.pageX-t.x,r=e.pageY-t.y,i=Math.sqrt(n*n+r*r);this._dollyEnd.set(0,i),this._dollyDelta.set(0,(this._dollyEnd.y/this._dollyStart.y)**+this.zoomSpeed),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);let a=(e.pageX+t.x)*.5,o=(e.pageY+t.y)*.5;this._updateZoomParameters(a,o)}_handleTouchMoveDollyPan(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enablePan&&this._handleTouchMovePan(e)}_handleTouchMoveDollyRotate(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enableRotate&&this._handleTouchMoveRotate(e)}_addPointer(e){this._pointers.push(e.pointerId)}_removePointer(e){delete this._pointerPositions[e.pointerId];for(let t=0;t{y.value&&(y.value.minDistance=e.z,y.value.maxDistance=e.z*20,y.value.update())},{immediate:!0,deep:!0}),m(u,e=>{!b.value||!y.value||(b.value.position.set(e.x,e.y,e.z),b.value.updateProjectionMatrix(),y.value.update())},{immediate:!0,deep:!0}),m(d,e=>{y.value&&(y.value.target.set(e.x,e.y,e.z),y.value.update())},{immediate:!0,deep:!0}),m(h,e=>{!b.value||!y.value||(b.value.fov=e,b.value.updateProjectionMatrix(),y.value.update())},{immediate:!0}),m(g,e=>{if(!b.value||!y.value)return;let t=new F,n=y.value.target,r=new F().subVectors(b.value.position,n).normalize();t.copy(n).addScaledVector(r,e),b.value.position.set(t.x,t.y,t.z),b.value.updateProjectionMatrix(),y.value.update()}),m(s,e=>{!b.value||!y.value||(y.value.enableRotate=e,y.value.enableZoom=e)},{immediate:!0}),y.value?.addEventListener(`change`,()=>{c.value&&a(`orbitControlsCameraChanged`,{newCameraPosition:{x:b.value.position.x,y:b.value.position.y,z:b.value.position.z},newCameraDistance:y.value.getDistance()})})}return f(async()=>{if(await tn(()=>_.value&&v.domElement).toBeTruthy(),await tn(()=>i.modelLoaded).toBeTruthy(),!_.value||!v.domElement){console.warn(`Camera or Renderer initialisation failure!`);return}if(!(_.value instanceof Ie)){console.warn(`Camera is not perspective camera, type error!`);return}b.value=_.value,y.value=new Vo(b.value,v.domElement),y.value.enablePan=!1,y.value.enableZoom=!1,y.value.enableRotate=!1,y.value.mouseButtons={LEFT:Ot.ROTATE,MIDDLE:Ot.DOLLY,RIGHT:Ot.PAN},y.value.touches={ONE:M.ROTATE,TWO:M.DOLLY_PAN},x(),y.value.update(),a(`orbitControlsReady`)}),o(()=>{}),t({controls:y,getDistance:()=>y.value?.getDistance(),update:()=>y.value?.update(),setTarget:e=>{y.value&&(y.value.target.set(e.x,e.y,e.z),y.value.update())}}),(e,t)=>p(e.$slots,`default`)}}),ts=class{static fromCubeTexture(e){let t=0,n=new F,r=new F,i=new H,a=[0,0,0,0,0,0,0,0,0],o=new He,s=o.coefficients;for(let o=0;o<6;o++){let c=e.image[o],l=c.width,u=c.height,d=document.createElement(`canvas`);d.width=l,d.height=u;let f=d.getContext(`2d`);f.drawImage(c,0,0,l,u);let p=f.getImageData(0,0,l,u),m=p.data,h=p.width,g=2/h;for(let c=0,l=m.length;c(i=s.indexOf(` `))&&a=e.byteLength||!(l=n(e)))&&t(1,`no header found`),(u=l.match(r))||t(3,`bad initial token`),c.valid|=1,c.programtype=u[1],c.string+=l+` `;l=n(e),!1!==l;){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},i=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;e!!u&&!!u.domElement).toBeTruthy(),d(),u.outputColorSpace=P,u.toneMapping=4;try{let t=await new is().loadAsync(e);t.mapping=303,t.generateMipmaps=!0,t.minFilter=zt,t.magFilter=ot,t.colorSpace=z,s=new Pt(u);let n=s.fromEquirectangular(t);c=n;let o=new nt(256);o.fromEquirectangularTexture(u,t);let d=await ts.fromCubeRenderTarget(u,o);a.value=t;let f=l.value;f.environment=n.texture,r.asBackground&&(f.background=n.texture),f.backgroundBlurriness=r.backgroundBlurriness,f.backgroundIntensity=r.backgroundIntensity,i(`skyBoxReady`,{irrSH:d.sh})}catch(e){console.warn(`Failed to load HDRI environment:`,e)}}return f(async()=>{await h(r.skyBoxSrc),m(()=>[r.skyBoxSrc],([e])=>{h(e)},{deep:!1})}),t({reload:async e=>await h(e)}),o(async()=>{await d()}),(e,t)=>p(e.$slots,`default`)}}),os=(e,t,n)=>new Promise((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())}),Z=(e,t,n)=>new Promise((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())}),ss=class extends k{constructor(e){super(),this.weight=0,this.isBinary=!1,this.overrideBlink=`none`,this.overrideLookAt=`none`,this.overrideMouth=`none`,this._binds=[],this.name=`VRMExpression_${e}`,this.expressionName=e,this.type=`VRMExpression`,this.visible=!1}get binds(){return this._binds}get overrideBlinkAmount(){return this.overrideBlink===`block`?0.5?1:0:this.weight}addBind(e){this._binds.push(e)}deleteBind(e){let t=this._binds.indexOf(e);t>=0&&this._binds.splice(t,1)}applyWeight(e){let t=this.outputWeight;t*=e?.multiplier??1,this.isBinary&&t<1&&(t=0),this._binds.forEach(e=>e.applyWeight(t))}clearAppliedWeight(){this._binds.forEach(e=>e.clearAppliedWeight())}};function cs(e,t,n){let r=e.parser.json,i=r.nodes?.[t];if(i==null)return console.warn(`extractPrimitivesInternal: Attempt to use nodes[${t}] of glTF but the node doesn't exist`),null;let a=i.mesh;if(a==null)return null;let o=r.meshes?.[a];if(o==null)return console.warn(`extractPrimitivesInternal: Attempt to use meshes[${a}] of glTF but the mesh doesn't exist`),null;let s=o.primitives.length,c=[];return n.traverse(e=>{c.length{let i=cs(e,r,t);i!=null&&n.set(r,i)}),n})}var ds={Aa:`aa`,Ih:`ih`,Ou:`ou`,Ee:`ee`,Oh:`oh`,Blink:`blink`,Happy:`happy`,Angry:`angry`,Sad:`sad`,Relaxed:`relaxed`,LookUp:`lookUp`,Surprised:`surprised`,LookDown:`lookDown`,LookLeft:`lookLeft`,LookRight:`lookRight`,BlinkLeft:`blinkLeft`,BlinkRight:`blinkRight`,Neutral:`neutral`};function fs(e){return Math.max(Math.min(e,1),0)}var ps=class e{constructor(){this.blinkExpressionNames=[`blink`,`blinkLeft`,`blinkRight`],this.lookAtExpressionNames=[`lookLeft`,`lookRight`,`lookUp`,`lookDown`],this.mouthExpressionNames=[`aa`,`ee`,`ih`,`oh`,`ou`],this._expressions=[],this._expressionMap={}}get expressions(){return this._expressions.concat()}get expressionMap(){return Object.assign({},this._expressionMap)}get presetExpressionMap(){let e={},t=new Set(Object.values(ds));return Object.entries(this._expressionMap).forEach(([n,r])=>{t.has(n)&&(e[n]=r)}),e}get customExpressionMap(){let e={},t=new Set(Object.values(ds));return Object.entries(this._expressionMap).forEach(([n,r])=>{t.has(n)||(e[n]=r)}),e}copy(e){return this._expressions.concat().forEach(e=>{this.unregisterExpression(e)}),e._expressions.forEach(e=>{this.registerExpression(e)}),this.blinkExpressionNames=e.blinkExpressionNames.concat(),this.lookAtExpressionNames=e.lookAtExpressionNames.concat(),this.mouthExpressionNames=e.mouthExpressionNames.concat(),this}clone(){return new e().copy(this)}getExpression(e){return this._expressionMap[e]??null}registerExpression(e){this._expressions.push(e),this._expressionMap[e.expressionName]=e}unregisterExpression(e){let t=this._expressions.indexOf(e);t===-1&&console.warn(`VRMExpressionManager: The specified expressions is not registered`),this._expressions.splice(t,1),delete this._expressionMap[e.expressionName]}getValue(e){return this.getExpression(e)?.weight??null}setValue(e,t){let n=this.getExpression(e);n&&(n.weight=fs(t))}resetValues(){this._expressions.forEach(e=>{e.weight=0})}getExpressionTrackName(e){let t=this.getExpression(e);return t?`${t.name}.weight`:null}update(){let e=this._calculateWeightMultipliers();this._expressions.forEach(e=>{e.clearAppliedWeight()}),this._expressions.forEach(t=>{let n=1,r=t.expressionName;this.blinkExpressionNames.indexOf(r)!==-1&&(n*=e.blink),this.lookAtExpressionNames.indexOf(r)!==-1&&(n*=e.lookAt),this.mouthExpressionNames.indexOf(r)!==-1&&(n*=e.mouth),t.applyWeight({multiplier:n})})}_calculateWeightMultipliers(){let e=1,t=1,n=1;return this._expressions.forEach(r=>{e-=r.overrideBlinkAmount,t-=r.overrideLookAtAmount,n-=r.overrideMouthAmount}),e=Math.max(0,e),t=Math.max(0,t),n=Math.max(0,n),{blink:e,lookAt:t,mouth:n}}},ms={Color:`color`,EmissionColor:`emissionColor`,ShadeColor:`shadeColor`,MatcapColor:`matcapColor`,RimColor:`rimColor`,OutlineColor:`outlineColor`},hs={_Color:ms.Color,_EmissionColor:ms.EmissionColor,_ShadeColor:ms.ShadeColor,_RimColor:ms.RimColor,_OutlineColor:ms.OutlineColor},gs=new H,_s=class e{constructor({material:e,type:t,targetValue:n,targetAlpha:r}){this.material=e,this.type=t,this.targetValue=n,this.targetAlpha=r??1,this._state={color:this._initColorBindState(),alpha:this._initAlphaBindState()}}applyWeight(e){let{color:t,alpha:n}=this._state;if(t!=null){let{propertyName:n,deltaValue:r}=t;this.material[n]?.add(gs.copy(r).multiplyScalar(e))}if(n!=null){let{propertyName:t,deltaValue:r}=n;this.material[t]!=null&&(this.material[t]+=r*e)}}clearAppliedWeight(){let{color:e,alpha:t}=this._state;if(e!=null){let{propertyName:t,initialValue:n}=e;this.material[t]?.copy(n)}if(t!=null){let{propertyName:e,initialValue:n}=t;this.material[e]!=null&&(this.material[e]=n)}}_initColorBindState(){let{material:e,type:t,targetValue:n}=this,r=this._getPropertyNameMap()?.[t]?.[0]??null;if(r==null)return console.warn(`Tried to add a material color bind to the material ${e.name??`(no name)`}, the type ${t} but the material or the type is not supported.`),null;let i=e[r].clone();return{propertyName:r,initialValue:i,deltaValue:new H(n.r-i.r,n.g-i.g,n.b-i.b)}}_initAlphaBindState(){let{material:e,type:t,targetAlpha:n}=this,r=this._getPropertyNameMap()?.[t]?.[1]??null;if(r==null&&n!==1)return console.warn(`Tried to add a material alpha bind to the material ${e.name??`(no name)`}, the type ${t} but the material or the type does not support alpha.`),null;if(r==null)return null;let i=e[r];return{propertyName:r,initialValue:i,deltaValue:n-i}}_getPropertyNameMap(){return Object.entries(e._propertyNameMapMap).find(([e])=>this.material[e]===!0)?.[1]??null}};_s._propertyNameMapMap={isMeshStandardMaterial:{color:[`color`,`opacity`],emissionColor:[`emissive`,null]},isMeshBasicMaterial:{color:[`color`,`opacity`]},isMToonMaterial:{color:[`color`,`opacity`],emissionColor:[`emissive`,null],outlineColor:[`outlineColorFactor`,null],matcapColor:[`matcapFactor`,null],rimColor:[`parametricRimColorFactor`,null],shadeColor:[`shadeColorFactor`,null]}};var vs=_s,ys=class{constructor({primitives:e,index:t,weight:n}){this.primitives=e,this.index=t,this.weight=n}applyWeight(e){this.primitives.forEach(t=>{t.morphTargetInfluences?.[this.index]!=null&&(t.morphTargetInfluences[this.index]+=this.weight*e)})}clearAppliedWeight(){this.primitives.forEach(e=>{e.morphTargetInfluences?.[this.index]!=null&&(e.morphTargetInfluences[this.index]=0)})}},bs=new L,xs=class e{constructor({material:t,scale:n,offset:r}){this.material=t,this.scale=n,this.offset=r;let i=Object.entries(e._propertyNamesMap).find(([e])=>t[e]===!0)?.[1];i==null?(console.warn(`Tried to add a texture transform bind to the material ${t.name??`(no name)`} but the material is not supported.`),this._properties=[]):(this._properties=[],i.forEach(e=>{let i=t[e]?.clone();if(!i)return null;t[e]=i;let a=i.offset.clone(),o=i.repeat.clone(),s=r.clone().sub(a),c=n.clone().sub(o);this._properties.push({name:e,initialOffset:a,deltaOffset:s,initialScale:o,deltaScale:c})}))}applyWeight(e){this._properties.forEach(t=>{let n=this.material[t.name];n!==void 0&&(n.offset.add(bs.copy(t.deltaOffset).multiplyScalar(e)),n.repeat.add(bs.copy(t.deltaScale).multiplyScalar(e)))})}clearAppliedWeight(){this._properties.forEach(e=>{let t=this.material[e.name];t!==void 0&&(t.offset.copy(e.initialOffset),t.repeat.copy(e.initialScale))})}};xs._propertyNamesMap={isMeshStandardMaterial:[`map`,`emissiveMap`,`bumpMap`,`normalMap`,`displacementMap`,`roughnessMap`,`metalnessMap`,`alphaMap`],isMeshBasicMaterial:[`map`,`specularMap`,`alphaMap`],isMToonMaterial:[`map`,`normalMap`,`emissiveMap`,`shadeMultiplyTexture`,`rimMultiplyTexture`,`outlineWidthMultiplyTexture`,`uvAnimationMaskTexture`]};var Ss=xs,Cs=new Set([`1.0`,`1.0-beta`]),ws=class e{get name(){return`VRMExpressionLoaderPlugin`}constructor(e){this.parser=e}afterRoot(e){return Z(this,null,function*(){e.userData.vrmExpressionManager=yield this._import(e)})}_import(e){return Z(this,null,function*(){return(yield this._v1Import(e))||(yield this._v0Import(e))||null})}_v1Import(e){return Z(this,null,function*(){let t=this.parser.json;if(t.extensionsUsed?.indexOf(`VRMC_vrm`)===-1)return null;let n=t.extensions?.VRMC_vrm;if(!n)return null;let r=n.specVersion;if(!Cs.has(r))return console.warn(`VRMExpressionLoaderPlugin: Unknown VRMC_vrm specVersion "${r}"`),null;let i=n.expressions;if(!i)return null;let a=new Set(Object.values(ds)),o=new Map;i.preset!=null&&Object.entries(i.preset).forEach(([e,t])=>{if(t!=null){if(!a.has(e)){console.warn(`VRMExpressionLoaderPlugin: Unknown preset name "${e}" detected. Ignoring the expression`);return}o.set(e,t)}}),i.custom!=null&&Object.entries(i.custom).forEach(([e,t])=>{if(a.has(e)){console.warn(`VRMExpressionLoaderPlugin: Custom expression cannot have preset name "${e}". Ignoring the expression`);return}o.set(e,t)});let s=new ps;return yield Promise.all(Array.from(o.entries()).map(t=>Z(this,[t],function*([t,n]){var r,i,a;let o=new ss(t);if(e.scene.add(o),o.isBinary=n.isBinary??!1,o.overrideBlink=n.overrideBlink??`none`,o.overrideLookAt=n.overrideLookAt??`none`,o.overrideMouth=n.overrideMouth??`none`,(r=n.morphTargetBinds)==null||r.forEach(t=>Z(this,null,function*(){if(t.node===void 0||t.index===void 0)return;let r=yield ls(e,t.node),i=t.index;if(!r.every(e=>Array.isArray(e.morphTargetInfluences)&&i{let n=e.material;n&&(Array.isArray(n)?t.push(...n):t.push(n))}),(i=n.materialColorBinds)==null||i.forEach(e=>Z(this,null,function*(){t.filter(t=>{let n=this.parser.associations.get(t)?.materials;return e.material===n}).forEach(t=>{o.addBind(new vs({material:t,type:e.type,targetValue:new H().fromArray(e.targetValue),targetAlpha:e.targetValue[3]}))})})),(a=n.textureTransformBinds)==null||a.forEach(e=>Z(this,null,function*(){t.filter(t=>{let n=this.parser.associations.get(t)?.materials;return e.material===n}).forEach(t=>{o.addBind(new Ss({material:t,offset:new L().fromArray(e.offset??[0,0]),scale:new L().fromArray(e.scale??[1,1])}))})}))}s.registerExpression(o)}))),s})}_v0Import(t){return Z(this,null,function*(){let n=this.parser.json,r=n.extensions?.VRM;if(!r)return null;let i=r.blendShapeMaster;if(!i)return null;let a=new ps,o=i.blendShapeGroups;if(!o)return a;let s=new Set;return yield Promise.all(o.map(r=>Z(this,null,function*(){let i=r.presetName,o=(i!=null&&e.v0v1PresetNameMap[i]||null)??r.name;if(o==null){console.warn(`VRMExpressionLoaderPlugin: One of custom expressions has no name. Ignoring the expression`);return}if(s.has(o)){console.warn(`VRMExpressionLoaderPlugin: An expression preset ${i} has duplicated entries. Ignoring the expression`);return}s.add(o);let c=new ss(o);t.scene.add(c),c.isBinary=r.isBinary??!1,r.binds&&r.binds.forEach(e=>Z(this,null,function*(){var i;if(e.mesh===void 0||e.index===void 0)return;let a=[];(i=n.nodes)==null||i.forEach((t,n)=>{t.mesh===e.mesh&&a.push(n)});let o=e.index;yield Promise.all(a.map(n=>Z(this,null,function*(){let i=yield ls(t,n);if(!i.every(e=>Array.isArray(e.morphTargetInfluences)&&o{if(e.materialName===void 0||e.propertyName===void 0||e.targetValue===void 0)return;let n=[];t.scene.traverse(t=>{if(t.material){let r=t.material;Array.isArray(r)?n.push(...r.filter(t=>(t.name===e.materialName||t.name===e.materialName+` (Outline)`)&&n.indexOf(t)===-1)):r.name===e.materialName&&n.indexOf(r)===-1&&n.push(r)}});let r=e.propertyName;n.forEach(t=>{if(r===`_MainTex_ST`){let n=new L(e.targetValue[0],e.targetValue[1]),r=new L(e.targetValue[2],e.targetValue[3]);r.y=1-r.y-n.y,c.addBind(new Ss({material:t,scale:n,offset:r}));return}let n=hs[r];if(n){c.addBind(new vs({material:t,type:n,targetValue:new H().fromArray(e.targetValue),targetAlpha:e.targetValue[3]}));return}console.warn(r+` is not supported`)})}),a.registerExpression(c)}))),a})}};ws.v0v1PresetNameMap={a:`aa`,e:`ee`,i:`ih`,o:`oh`,u:`ou`,blink:`blink`,joy:`happy`,angry:`angry`,sorrow:`sad`,fun:`relaxed`,lookup:`lookUp`,lookdown:`lookDown`,lookleft:`lookLeft`,lookright:`lookRight`,blink_l:`blinkLeft`,blink_r:`blinkRight`,neutral:`neutral`};var Ts=ws,Es=class e{constructor(t,n){this._firstPersonOnlyLayer=e.DEFAULT_FIRSTPERSON_ONLY_LAYER,this._thirdPersonOnlyLayer=e.DEFAULT_THIRDPERSON_ONLY_LAYER,this._initializedLayers=!1,this.humanoid=t,this.meshAnnotations=n}copy(e){if(this.humanoid!==e.humanoid)throw Error(`VRMFirstPerson: humanoid must be same in order to copy`);return this.meshAnnotations=e.meshAnnotations.map(e=>({meshes:e.meshes.concat(),type:e.type})),this}clone(){return new e(this.humanoid,this.meshAnnotations).copy(this)}get firstPersonOnlyLayer(){return this._firstPersonOnlyLayer}get thirdPersonOnlyLayer(){return this._thirdPersonOnlyLayer}setup({firstPersonOnlyLayer:t=e.DEFAULT_FIRSTPERSON_ONLY_LAYER,thirdPersonOnlyLayer:n=e.DEFAULT_THIRDPERSON_ONLY_LAYER}={}){this._initializedLayers||=(this._firstPersonOnlyLayer=t,this._thirdPersonOnlyLayer=n,this.meshAnnotations.forEach(e=>{e.meshes.forEach(t=>{e.type===`firstPersonOnly`?(t.layers.set(this._firstPersonOnlyLayer),t.traverse(e=>e.layers.set(this._firstPersonOnlyLayer))):e.type===`thirdPersonOnly`?(t.layers.set(this._thirdPersonOnlyLayer),t.traverse(e=>e.layers.set(this._thirdPersonOnlyLayer))):e.type===`auto`&&this._createHeadlessModel(t)})}),!0)}_excludeTriangles(e,t,n,r){let i=0;if(t!=null&&t.length>0)for(let a=0;a0&&r.includes(u[0])||l[1]>0&&r.includes(u[1])||l[2]>0&&r.includes(u[2])||l[3]>0&&r.includes(u[3]))continue;let d=t[s],f=n[s];if(d[0]>0&&r.includes(f[0])||d[1]>0&&r.includes(f[1])||d[2]>0&&r.includes(f[2])||d[3]>0&&r.includes(f[3]))continue;let p=t[c],m=n[c];p[0]>0&&r.includes(m[0])||p[1]>0&&r.includes(m[1])||p[2]>0&&r.includes(m[2])||p[3]>0&&r.includes(m[3])||(e[i++]=o,e[i++]=s,e[i++]=c)}return i}_createErasedMesh(e,t){let n=new Be(e.geometry.clone(),e.material);n.name=`${e.name}(erase)`,n.frustumCulled=e.frustumCulled,n.layers.set(this._firstPersonOnlyLayer);let r=n.geometry,i=r.getAttribute(`skinIndex`),a=i instanceof be?[]:i.array,o=[];for(let e=0;e{this._isEraseTarget(e)&&n.push(t)}),!n.length){t.layers.enable(this._thirdPersonOnlyLayer),t.layers.enable(this._firstPersonOnlyLayer);return}t.layers.set(this._thirdPersonOnlyLayer);let r=this._createErasedMesh(t,n);e.add(r)}_createHeadlessModel(e){if(e.type===`Group`)if(e.layers.set(this._thirdPersonOnlyLayer),this._isEraseTarget(e))e.traverse(e=>e.layers.set(this._thirdPersonOnlyLayer));else{let t=new je;t.name=`_headless_${e.name}`,t.layers.set(this._firstPersonOnlyLayer),e.parent.add(t),e.children.filter(e=>e.type===`SkinnedMesh`).forEach(e=>{let n=e;this._createHeadlessModelForSkinnedMesh(t,n)})}else if(e.type===`SkinnedMesh`){let t=e;this._createHeadlessModelForSkinnedMesh(e.parent,t)}else this._isEraseTarget(e)&&(e.layers.set(this._thirdPersonOnlyLayer),e.traverse(e=>e.layers.set(this._thirdPersonOnlyLayer)))}_isEraseTarget(e){return e===this.humanoid.getRawBoneNode(`head`)?!0:e.parent?this._isEraseTarget(e.parent):!1}};Es.DEFAULT_FIRSTPERSON_ONLY_LAYER=9,Es.DEFAULT_THIRDPERSON_ONLY_LAYER=10;var Ds=Es,Os=new Set([`1.0`,`1.0-beta`]),ks=class{get name(){return`VRMFirstPersonLoaderPlugin`}constructor(e){this.parser=e}afterRoot(e){return Z(this,null,function*(){let t=e.userData.vrmHumanoid;if(t!==null){if(t===void 0)throw Error(`VRMFirstPersonLoaderPlugin: vrmHumanoid is undefined. VRMHumanoidLoaderPlugin have to be used first`);e.userData.vrmFirstPerson=yield this._import(e,t)}})}_import(e,t){return Z(this,null,function*(){return t==null?null:(yield this._v1Import(e,t))||(yield this._v0Import(e,t))||null})}_v1Import(e,t){return Z(this,null,function*(){let n=this.parser.json;if(n.extensionsUsed?.indexOf(`VRMC_vrm`)===-1)return null;let r=n.extensions?.VRMC_vrm;if(!r)return null;let i=r.specVersion;if(!Os.has(i))return console.warn(`VRMFirstPersonLoaderPlugin: Unknown VRMC_vrm specVersion "${i}"`),null;let a=r.firstPerson,o=[],s=yield us(e);return Array.from(s.entries()).forEach(([e,t])=>{let n=(a?.meshAnnotations)?.find(t=>t.node===e);o.push({meshes:t,type:n?.type??`auto`})}),new Ds(t,o)})}_v0Import(e,t){return Z(this,null,function*(){let n=this.parser.json,r=n.extensions?.VRM;if(!r)return null;let i=r.firstPerson;if(!i)return null;let a=[],o=yield us(e);return Array.from(o.entries()).forEach(([e,t])=>{let r=n.nodes[e],o=i.meshAnnotations?i.meshAnnotations.find(e=>e.mesh===r.mesh):void 0;a.push({meshes:t,type:this._convertV0FlagToV1Type(o?.firstPersonFlag)})}),new Ds(t,a)})}_convertV0FlagToV1Type(e){return e===`FirstPersonOnly`?`firstPersonOnly`:e===`ThirdPersonOnly`?`thirdPersonOnly`:e===`Both`?`both`:`auto`}},As=new F,js=new F,Ms=new R,Ns=class extends je{constructor(e){super(),this.vrmHumanoid=e,this._boneAxesMap=new Map,Object.values(e.humanBones).forEach(e=>{let t=new kt(1);t.matrixAutoUpdate=!1,t.material.depthTest=!1,t.material.depthWrite=!1,this.add(t),this._boneAxesMap.set(e,t)})}dispose(){Array.from(this._boneAxesMap.values()).forEach(e=>{e.geometry.dispose(),e.material.dispose()})}updateMatrixWorld(e){Array.from(this._boneAxesMap.entries()).forEach(([e,t])=>{e.node.updateWorldMatrix(!0,!1),e.node.matrixWorld.decompose(As,Ms,js);let n=As.set(.1,.1,.1).divide(js);t.matrix.copy(e.node.matrixWorld).scale(n)}),super.updateMatrixWorld(e)}},Ps=`hips.spine.chest.upperChest.neck.head.leftEye.rightEye.jaw.leftUpperLeg.leftLowerLeg.leftFoot.leftToes.rightUpperLeg.rightLowerLeg.rightFoot.rightToes.leftShoulder.leftUpperArm.leftLowerArm.leftHand.rightShoulder.rightUpperArm.rightLowerArm.rightHand.leftThumbMetacarpal.leftThumbProximal.leftThumbDistal.leftIndexProximal.leftIndexIntermediate.leftIndexDistal.leftMiddleProximal.leftMiddleIntermediate.leftMiddleDistal.leftRingProximal.leftRingIntermediate.leftRingDistal.leftLittleProximal.leftLittleIntermediate.leftLittleDistal.rightThumbMetacarpal.rightThumbProximal.rightThumbDistal.rightIndexProximal.rightIndexIntermediate.rightIndexDistal.rightMiddleProximal.rightMiddleIntermediate.rightMiddleDistal.rightRingProximal.rightRingIntermediate.rightRingDistal.rightLittleProximal.rightLittleIntermediate.rightLittleDistal`.split(`.`),Fs={hips:null,spine:`hips`,chest:`spine`,upperChest:`chest`,neck:`upperChest`,head:`neck`,leftEye:`head`,rightEye:`head`,jaw:`head`,leftUpperLeg:`hips`,leftLowerLeg:`leftUpperLeg`,leftFoot:`leftLowerLeg`,leftToes:`leftFoot`,rightUpperLeg:`hips`,rightLowerLeg:`rightUpperLeg`,rightFoot:`rightLowerLeg`,rightToes:`rightFoot`,leftShoulder:`upperChest`,leftUpperArm:`leftShoulder`,leftLowerArm:`leftUpperArm`,leftHand:`leftLowerArm`,rightShoulder:`upperChest`,rightUpperArm:`rightShoulder`,rightLowerArm:`rightUpperArm`,rightHand:`rightLowerArm`,leftThumbMetacarpal:`leftHand`,leftThumbProximal:`leftThumbMetacarpal`,leftThumbDistal:`leftThumbProximal`,leftIndexProximal:`leftHand`,leftIndexIntermediate:`leftIndexProximal`,leftIndexDistal:`leftIndexIntermediate`,leftMiddleProximal:`leftHand`,leftMiddleIntermediate:`leftMiddleProximal`,leftMiddleDistal:`leftMiddleIntermediate`,leftRingProximal:`leftHand`,leftRingIntermediate:`leftRingProximal`,leftRingDistal:`leftRingIntermediate`,leftLittleProximal:`leftHand`,leftLittleIntermediate:`leftLittleProximal`,leftLittleDistal:`leftLittleIntermediate`,rightThumbMetacarpal:`rightHand`,rightThumbProximal:`rightThumbMetacarpal`,rightThumbDistal:`rightThumbProximal`,rightIndexProximal:`rightHand`,rightIndexIntermediate:`rightIndexProximal`,rightIndexDistal:`rightIndexIntermediate`,rightMiddleProximal:`rightHand`,rightMiddleIntermediate:`rightMiddleProximal`,rightMiddleDistal:`rightMiddleIntermediate`,rightRingProximal:`rightHand`,rightRingIntermediate:`rightRingProximal`,rightRingDistal:`rightRingIntermediate`,rightLittleProximal:`rightHand`,rightLittleIntermediate:`rightLittleProximal`,rightLittleDistal:`rightLittleIntermediate`};function Is(e){return e.invert?e.invert():e.inverse(),e}var Ls=new F,Rs=new R,zs=class{constructor(e){this.humanBones=e,this.restPose=this.getAbsolutePose()}getAbsolutePose(){let e={};return Object.keys(this.humanBones).forEach(t=>{let n=t,r=this.getBoneNode(n);r&&(Ls.copy(r.position),Rs.copy(r.quaternion),e[n]={position:Ls.toArray(),rotation:Rs.toArray()})}),e}getPose(){let e={};return Object.keys(this.humanBones).forEach(t=>{let n=t,r=this.getBoneNode(n);if(!r)return;Ls.set(0,0,0),Rs.identity();let i=this.restPose[n];i?.position&&Ls.fromArray(i.position).negate(),i?.rotation&&Is(Rs.fromArray(i.rotation)),Ls.add(r.position),Rs.premultiply(r.quaternion),e[n]={position:Ls.toArray(),rotation:Rs.toArray()}}),e}setPose(e){Object.entries(e).forEach(([e,t])=>{let n=e,r=this.getBoneNode(n);if(!r)return;let i=this.restPose[n];i&&(t?.position&&(r.position.fromArray(t.position),i.position&&r.position.add(Ls.fromArray(i.position))),t?.rotation&&(r.quaternion.fromArray(t.rotation),i.rotation&&r.quaternion.multiply(Rs.fromArray(i.rotation))))})}resetPose(){Object.entries(this.restPose).forEach(([e,t])=>{let n=this.getBoneNode(e);n&&(t?.position&&n.position.fromArray(t.position),t?.rotation&&n.quaternion.fromArray(t.rotation))})}getBone(e){return this.humanBones[e]??void 0}getBoneNode(e){return this.humanBones[e]?.node??null}},Bs=new F,Vs=new R,Hs=new F,Us=class e extends zs{static _setupTransforms(e){let t=new k;t.name=`VRMHumanoidRig`;let n={},r={},i={},a={};Ps.forEach(t=>{var o;let s=e.getBoneNode(t);if(s){let e=new F,c=new R;s.updateWorldMatrix(!0,!1),s.matrixWorld.decompose(e,c,Bs),n[t]=e,r[t]=c,i[t]=s.quaternion.clone();let l=new R;(o=s.parent)==null||o.matrixWorld.decompose(Bs,l,Bs),a[t]=l}});let o={};return Ps.forEach(r=>{let i=e.getBoneNode(r);if(i){let e=n[r],a=r,s;for(;s==null&&(a=Fs[a],a!=null);)s=n[a];let c=new k;c.name=`Normalized_`+i.name,(a?o[a]?.node:t).add(c),c.position.copy(e),s&&c.position.sub(s),o[r]={node:c}}}),{rigBones:o,root:t,parentWorldRotations:a,boneRotations:i}}constructor(t){let{rigBones:n,root:r,parentWorldRotations:i,boneRotations:a}=e._setupTransforms(t);super(n),this.original=t,this.root=r,this._parentWorldRotations=i,this._boneRotations=a}update(){Ps.forEach(e=>{let t=this.original.getBoneNode(e);if(t!=null){let n=this.getBoneNode(e),r=this._parentWorldRotations[e],i=Vs.copy(r).invert(),a=this._boneRotations[e];if(t.quaternion.copy(n.quaternion).multiply(r).premultiply(i).multiply(a),e===`hips`){let e=n.getWorldPosition(Hs);t.parent.updateWorldMatrix(!0,!1);let r=t.parent.matrixWorld,i=e.applyMatrix4(r.invert());t.position.copy(i)}}})}},Ws=class e{get restPose(){return console.warn(`VRMHumanoid: restPose is deprecated. Use either rawRestPose or normalizedRestPose instead.`),this.rawRestPose}get rawRestPose(){return this._rawHumanBones.restPose}get normalizedRestPose(){return this._normalizedHumanBones.restPose}get humanBones(){return this._rawHumanBones.humanBones}get rawHumanBones(){return this._rawHumanBones.humanBones}get normalizedHumanBones(){return this._normalizedHumanBones.humanBones}get normalizedHumanBonesRoot(){return this._normalizedHumanBones.root}constructor(e,t){this.autoUpdateHumanBones=t?.autoUpdateHumanBones??!0,this._rawHumanBones=new zs(e),this._normalizedHumanBones=new Us(this._rawHumanBones)}copy(e){return this.autoUpdateHumanBones=e.autoUpdateHumanBones,this._rawHumanBones=new zs(e.humanBones),this._normalizedHumanBones=new Us(this._rawHumanBones),this}clone(){return new e(this.humanBones,{autoUpdateHumanBones:this.autoUpdateHumanBones}).copy(this)}getAbsolutePose(){return console.warn(`VRMHumanoid: getAbsolutePose() is deprecated. Use either getRawAbsolutePose() or getNormalizedAbsolutePose() instead.`),this.getRawAbsolutePose()}getRawAbsolutePose(){return this._rawHumanBones.getAbsolutePose()}getNormalizedAbsolutePose(){return this._normalizedHumanBones.getAbsolutePose()}getPose(){return console.warn(`VRMHumanoid: getPose() is deprecated. Use either getRawPose() or getNormalizedPose() instead.`),this.getRawPose()}getRawPose(){return this._rawHumanBones.getPose()}getNormalizedPose(){return this._normalizedHumanBones.getPose()}setPose(e){return console.warn(`VRMHumanoid: setPose() is deprecated. Use either setRawPose() or setNormalizedPose() instead.`),this.setRawPose(e)}setRawPose(e){return this._rawHumanBones.setPose(e)}setNormalizedPose(e){return this._normalizedHumanBones.setPose(e)}resetPose(){return console.warn(`VRMHumanoid: resetPose() is deprecated. Use either resetRawPose() or resetNormalizedPose() instead.`),this.resetRawPose()}resetRawPose(){return this._rawHumanBones.resetPose()}resetNormalizedPose(){return this._normalizedHumanBones.resetPose()}getBone(e){return console.warn(`VRMHumanoid: getBone() is deprecated. Use either getRawBone() or getNormalizedBone() instead.`),this.getRawBone(e)}getRawBone(e){return this._rawHumanBones.getBone(e)}getNormalizedBone(e){return this._normalizedHumanBones.getBone(e)}getBoneNode(e){return console.warn(`VRMHumanoid: getBoneNode() is deprecated. Use either getRawBoneNode() or getNormalizedBoneNode() instead.`),this.getRawBoneNode(e)}getRawBoneNode(e){return this._rawHumanBones.getBoneNode(e)}getNormalizedBoneNode(e){return this._normalizedHumanBones.getBoneNode(e)}update(){this.autoUpdateHumanBones&&this._normalizedHumanBones.update()}},Gs={Hips:`hips`,Spine:`spine`,Head:`head`,LeftUpperLeg:`leftUpperLeg`,LeftLowerLeg:`leftLowerLeg`,LeftFoot:`leftFoot`,RightUpperLeg:`rightUpperLeg`,RightLowerLeg:`rightLowerLeg`,RightFoot:`rightFoot`,LeftUpperArm:`leftUpperArm`,LeftLowerArm:`leftLowerArm`,LeftHand:`leftHand`,RightUpperArm:`rightUpperArm`,RightLowerArm:`rightLowerArm`,RightHand:`rightHand`},Ks=new Set([`1.0`,`1.0-beta`]),qs={leftThumbProximal:`leftThumbMetacarpal`,leftThumbIntermediate:`leftThumbProximal`,rightThumbProximal:`rightThumbMetacarpal`,rightThumbIntermediate:`rightThumbProximal`},Js=class{get name(){return`VRMHumanoidLoaderPlugin`}constructor(e,t){this.parser=e,this.helperRoot=t?.helperRoot,this.autoUpdateHumanBones=t?.autoUpdateHumanBones}afterRoot(e){return Z(this,null,function*(){e.userData.vrmHumanoid=yield this._import(e)})}_import(e){return Z(this,null,function*(){return(yield this._v1Import(e))||(yield this._v0Import(e))||null})}_v1Import(e){return Z(this,null,function*(){let t=this.parser.json;if(t.extensionsUsed?.indexOf(`VRMC_vrm`)===-1)return null;let n=t.extensions?.VRMC_vrm;if(!n)return null;let r=n.specVersion;if(!Ks.has(r))return console.warn(`VRMHumanoidLoaderPlugin: Unknown VRMC_vrm specVersion "${r}"`),null;let i=n.humanoid;if(!i)return null;let a=i.humanBones.leftThumbIntermediate!=null||i.humanBones.rightThumbIntermediate!=null,o={};i.humanBones!=null&&(yield Promise.all(Object.entries(i.humanBones).map(e=>Z(this,[e],function*([e,t]){let n=e,r=t.node;if(a){let e=qs[n];e!=null&&(n=e)}let i=yield this.parser.getDependency(`node`,r);if(i==null){console.warn(`A glTF node bound to the humanoid bone ${n} (index = ${r}) does not exist`);return}o[n]={node:i}}))));let s=new Ws(this._ensureRequiredBonesExist(o),{autoUpdateHumanBones:this.autoUpdateHumanBones});if(e.scene.add(s.normalizedHumanBonesRoot),this.helperRoot){let e=new Ns(s);this.helperRoot.add(e),e.renderOrder=this.helperRoot.renderOrder}return s})}_v0Import(e){return Z(this,null,function*(){let t=this.parser.json.extensions?.VRM;if(!t)return null;let n=t.humanoid;if(!n)return null;let r={};n.humanBones!=null&&(yield Promise.all(n.humanBones.map(e=>Z(this,null,function*(){let t=e.bone,n=e.node;if(t==null||n==null)return;let i=yield this.parser.getDependency(`node`,n);if(i==null){console.warn(`A glTF node bound to the humanoid bone ${t} (index = ${n}) does not exist`);return}let a=qs[t]??t;if(r[a]!=null){console.warn(`Multiple bone entries for ${a} detected (index = ${n}), ignoring duplicated entries.`);return}r[a]={node:i}}))));let i=new Ws(this._ensureRequiredBonesExist(r),{autoUpdateHumanBones:this.autoUpdateHumanBones});if(e.scene.add(i.normalizedHumanBonesRoot),this.helperRoot){let e=new Ns(i);this.helperRoot.add(e),e.renderOrder=this.helperRoot.renderOrder}return i})}_ensureRequiredBonesExist(e){let t=Object.values(Gs).filter(t=>e[t]==null);if(t.length>0)throw Error(`VRMHumanoidLoaderPlugin: These humanoid bones are required but not exist: ${t.join(`, `)}`);return e}},Ys=class extends Gt{constructor(){super(),this._currentTheta=0,this._currentRadius=0,this.theta=0,this.radius=0,this._currentTheta=0,this._currentRadius=0,this._attrPos=new V(new Float32Array(195),3),this.setAttribute(`position`,this._attrPos),this._attrIndex=new V(new Uint16Array(189),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let e=!1;this._currentTheta!==this.theta&&(this._currentTheta=this.theta,e=!0),this._currentRadius!==this.radius&&(this._currentRadius=this.radius,e=!0),e&&this._buildPosition()}_buildPosition(){this._attrPos.setXYZ(0,0,0,0);for(let e=0;e<64;e++){let t=e/63*this._currentTheta;this._attrPos.setXYZ(e+1,this._currentRadius*Math.sin(t),0,this._currentRadius*Math.cos(t))}this._attrPos.needsUpdate=!0}_buildIndex(){for(let e=0;e<63;e++)this._attrIndex.setXYZ(e*3,0,e+1,e+2);this._attrIndex.needsUpdate=!0}},Xs=class extends Gt{constructor(){super(),this.radius=0,this._currentRadius=0,this.tail=new F,this._currentTail=new F,this._attrPos=new V(new Float32Array(294),3),this.setAttribute(`position`,this._attrPos),this._attrIndex=new V(new Uint16Array(194),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let e=!1;this._currentRadius!==this.radius&&(this._currentRadius=this.radius,e=!0),this._currentTail.equals(this.tail)||(this._currentTail.copy(this.tail),e=!0),e&&this._buildPosition()}_buildPosition(){for(let e=0;e<32;e++){let t=e/16*Math.PI;this._attrPos.setXYZ(e,Math.cos(t),Math.sin(t),0),this._attrPos.setXYZ(32+e,0,Math.cos(t),Math.sin(t)),this._attrPos.setXYZ(64+e,Math.sin(t),0,Math.cos(t))}this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.setXYZ(96,0,0,0),this._attrPos.setXYZ(97,this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let e=0;e<32;e++){let t=(e+1)%32;this._attrIndex.setXY(e*2,e,t),this._attrIndex.setXY(64+e*2,32+e,32+t),this._attrIndex.setXY(128+e*2,64+e,64+t)}this._attrIndex.setXY(192,96,97),this._attrIndex.needsUpdate=!0}},Zs=new R,Qs=new R,$s=new F,ec=new F,tc=Math.sqrt(2)/2,nc=new R(0,0,-tc,tc),rc=new F(0,1,0),ic=class extends je{constructor(e){super(),this.matrixAutoUpdate=!1,this.vrmLookAt=e;{let e=new Ys;e.radius=.5,this._meshPitch=new it(e,new ct({color:65280,transparent:!0,opacity:.5,side:2,depthTest:!1,depthWrite:!1})),this.add(this._meshPitch)}{let e=new Ys;e.radius=.5,this._meshYaw=new it(e,new ct({color:16711680,transparent:!0,opacity:.5,side:2,depthTest:!1,depthWrite:!1})),this.add(this._meshYaw)}{let e=new Xs;e.radius=.1,this._lineTarget=new T(e,new qe({color:16777215,depthTest:!1,depthWrite:!1})),this._lineTarget.frustumCulled=!1,this.add(this._lineTarget)}}dispose(){this._meshYaw.geometry.dispose(),this._meshYaw.material.dispose(),this._meshPitch.geometry.dispose(),this._meshPitch.material.dispose(),this._lineTarget.geometry.dispose(),this._lineTarget.material.dispose()}updateMatrixWorld(e){let t=I.DEG2RAD*this.vrmLookAt.yaw;this._meshYaw.geometry.theta=t,this._meshYaw.geometry.update();let n=I.DEG2RAD*this.vrmLookAt.pitch;this._meshPitch.geometry.theta=n,this._meshPitch.geometry.update(),this.vrmLookAt.getLookAtWorldPosition($s),this.vrmLookAt.getLookAtWorldQuaternion(Zs),Zs.multiply(this.vrmLookAt.getFaceFrontQuaternion(Qs)),this._meshYaw.position.copy($s),this._meshYaw.quaternion.copy(Zs),this._meshPitch.position.copy($s),this._meshPitch.quaternion.copy(Zs),this._meshPitch.quaternion.multiply(Qs.setFromAxisAngle(rc,t)),this._meshPitch.quaternion.multiply(nc);let{target:r,autoUpdate:i}=this.vrmLookAt;r!=null&&i&&(r.getWorldPosition(ec).sub($s),this._lineTarget.geometry.tail.copy(ec),this._lineTarget.geometry.update(),this._lineTarget.position.copy($s)),super.updateMatrixWorld(e)}},ac=new F,oc=new F;function sc(e,t){return e.matrixWorld.decompose(ac,t,oc),t}function cc(e){return[Math.atan2(-e.z,e.x),Math.atan2(e.y,Math.sqrt(e.x*e.x+e.z*e.z))]}function lc(e){let t=Math.round(e/2/Math.PI);return e-2*Math.PI*t}var uc=new F(0,0,1),dc=new F,fc=new F,pc=new F,mc=new R,hc=new R,gc=new R,_c=new R,vc=new xe,yc=class e{constructor(e,t){this.offsetFromHeadBone=new F,this.autoUpdate=!0,this.faceFront=new F(0,0,1),this.humanoid=e,this.applier=t,this._yaw=0,this._pitch=0,this._needsUpdate=!0,this._restHeadWorldQuaternion=this.getLookAtWorldQuaternion(new R)}get yaw(){return this._yaw}set yaw(e){this._yaw=e,this._needsUpdate=!0}get pitch(){return this._pitch}set pitch(e){this._pitch=e,this._needsUpdate=!0}get euler(){return console.warn(`VRMLookAt: euler is deprecated. use getEuler() instead.`),this.getEuler(new xe)}getEuler(e){return e.set(I.DEG2RAD*this._pitch,I.DEG2RAD*this._yaw,0,`YXZ`)}copy(e){if(this.humanoid!==e.humanoid)throw Error(`VRMLookAt: humanoid must be same in order to copy`);return this.offsetFromHeadBone.copy(e.offsetFromHeadBone),this.applier=e.applier,this.autoUpdate=e.autoUpdate,this.target=e.target,this.faceFront.copy(e.faceFront),this}clone(){return new e(this.humanoid,this.applier).copy(this)}reset(){this._yaw=0,this._pitch=0,this._needsUpdate=!0}getLookAtWorldPosition(e){let t=this.humanoid.getRawBoneNode(`head`);return e.copy(this.offsetFromHeadBone).applyMatrix4(t.matrixWorld)}getLookAtWorldQuaternion(e){return sc(this.humanoid.getRawBoneNode(`head`),e)}getFaceFrontQuaternion(e){if(this.faceFront.distanceToSquared(uc)<.01)return e.copy(this._restHeadWorldQuaternion).invert();let[t,n]=cc(this.faceFront);return vc.set(0,.5*Math.PI+t,n,`YZX`),e.setFromEuler(vc).premultiply(_c.copy(this._restHeadWorldQuaternion).invert())}getLookAtWorldDirection(e){return this.getLookAtWorldQuaternion(hc),this.getFaceFrontQuaternion(gc),e.copy(uc).applyQuaternion(hc).applyQuaternion(gc).applyEuler(this.getEuler(vc))}lookAt(e){let t=mc.copy(this._restHeadWorldQuaternion).multiply(Is(this.getLookAtWorldQuaternion(hc))),n=this.getLookAtWorldPosition(fc),r=pc.copy(e).sub(n).applyQuaternion(t).normalize(),[i,a]=cc(this.faceFront),[o,s]=cc(r),c=lc(o-i),l=lc(a-s);this._yaw=I.RAD2DEG*c,this._pitch=I.RAD2DEG*l,this._needsUpdate=!0}update(e){this.target!=null&&this.autoUpdate&&this.lookAt(this.target.getWorldPosition(dc)),this._needsUpdate&&(this._needsUpdate=!1,this.applier.applyYawPitch(this._yaw,this._pitch))}};yc.EULER_ORDER=`YXZ`;var bc=yc,xc=new F(0,0,1),Sc=new R,Cc=new R,wc=new xe(0,0,0,`YXZ`),Tc=class{constructor(e,t,n,r,i){this.humanoid=e,this.rangeMapHorizontalInner=t,this.rangeMapHorizontalOuter=n,this.rangeMapVerticalDown=r,this.rangeMapVerticalUp=i,this.faceFront=new F(0,0,1),this._restQuatLeftEye=new R,this._restQuatRightEye=new R,this._restLeftEyeParentWorldQuat=new R,this._restRightEyeParentWorldQuat=new R;let a=this.humanoid.getRawBoneNode(`leftEye`),o=this.humanoid.getRawBoneNode(`rightEye`);a&&(this._restQuatLeftEye.copy(a.quaternion),sc(a.parent,this._restLeftEyeParentWorldQuat)),o&&(this._restQuatRightEye.copy(o.quaternion),sc(o.parent,this._restRightEyeParentWorldQuat))}applyYawPitch(e,t){let n=this.humanoid.getRawBoneNode(`leftEye`),r=this.humanoid.getRawBoneNode(`rightEye`),i=this.humanoid.getNormalizedBoneNode(`leftEye`),a=this.humanoid.getNormalizedBoneNode(`rightEye`);n&&(t<0?wc.x=-I.DEG2RAD*this.rangeMapVerticalDown.map(-t):wc.x=I.DEG2RAD*this.rangeMapVerticalUp.map(t),e<0?wc.y=-I.DEG2RAD*this.rangeMapHorizontalInner.map(-e):wc.y=I.DEG2RAD*this.rangeMapHorizontalOuter.map(e),Sc.setFromEuler(wc),this._getWorldFaceFrontQuat(Cc),i.quaternion.copy(Cc).multiply(Sc).multiply(Cc.invert()),Sc.copy(this._restLeftEyeParentWorldQuat),n.quaternion.copy(i.quaternion).multiply(Sc).premultiply(Sc.invert()).multiply(this._restQuatLeftEye)),r&&(t<0?wc.x=-I.DEG2RAD*this.rangeMapVerticalDown.map(-t):wc.x=I.DEG2RAD*this.rangeMapVerticalUp.map(t),e<0?wc.y=-I.DEG2RAD*this.rangeMapHorizontalOuter.map(-e):wc.y=I.DEG2RAD*this.rangeMapHorizontalInner.map(e),Sc.setFromEuler(wc),this._getWorldFaceFrontQuat(Cc),a.quaternion.copy(Cc).multiply(Sc).multiply(Cc.invert()),Sc.copy(this._restRightEyeParentWorldQuat),r.quaternion.copy(a.quaternion).multiply(Sc).premultiply(Sc.invert()).multiply(this._restQuatRightEye))}lookAt(e){console.warn(`VRMLookAtBoneApplier: lookAt() is deprecated. use apply() instead.`);let t=I.RAD2DEG*e.y,n=I.RAD2DEG*e.x;this.applyYawPitch(t,n)}_getWorldFaceFrontQuat(e){if(this.faceFront.distanceToSquared(xc)<.01)return e.identity();let[t,n]=cc(this.faceFront);return wc.set(0,.5*Math.PI+t,n,`YZX`),e.setFromEuler(wc)}};Tc.type=`bone`;var Ec=class{constructor(e,t,n,r,i){this.expressions=e,this.rangeMapHorizontalInner=t,this.rangeMapHorizontalOuter=n,this.rangeMapVerticalDown=r,this.rangeMapVerticalUp=i}applyYawPitch(e,t){t<0?(this.expressions.setValue(`lookDown`,0),this.expressions.setValue(`lookUp`,this.rangeMapVerticalUp.map(-t))):(this.expressions.setValue(`lookUp`,0),this.expressions.setValue(`lookDown`,this.rangeMapVerticalDown.map(t))),e<0?(this.expressions.setValue(`lookLeft`,0),this.expressions.setValue(`lookRight`,this.rangeMapHorizontalOuter.map(-e))):(this.expressions.setValue(`lookRight`,0),this.expressions.setValue(`lookLeft`,this.rangeMapHorizontalOuter.map(e)))}lookAt(e){console.warn(`VRMLookAtBoneApplier: lookAt() is deprecated. use apply() instead.`);let t=I.RAD2DEG*e.y,n=I.RAD2DEG*e.x;this.applyYawPitch(t,n)}};Ec.type=`expression`;var Dc=class{constructor(e,t){this.inputMaxValue=e,this.outputScale=t}map(e){return this.outputScale*fs(e/this.inputMaxValue)}},Oc=new Set([`1.0`,`1.0-beta`]),kc=.01,Ac=class{get name(){return`VRMLookAtLoaderPlugin`}constructor(e,t){this.parser=e,this.helperRoot=t?.helperRoot}afterRoot(e){return Z(this,null,function*(){let t=e.userData.vrmHumanoid;if(t===null)return;if(t===void 0)throw Error(`VRMLookAtLoaderPlugin: vrmHumanoid is undefined. VRMHumanoidLoaderPlugin have to be used first`);let n=e.userData.vrmExpressionManager;if(n!==null){if(n===void 0)throw Error(`VRMLookAtLoaderPlugin: vrmExpressionManager is undefined. VRMExpressionLoaderPlugin have to be used first`);e.userData.vrmLookAt=yield this._import(e,t,n)}})}_import(e,t,n){return Z(this,null,function*(){return t==null||n==null?null:(yield this._v1Import(e,t,n))||(yield this._v0Import(e,t,n))||null})}_v1Import(e,t,n){return Z(this,null,function*(){let e=this.parser.json;if(e.extensionsUsed?.indexOf(`VRMC_vrm`)===-1)return null;let r=e.extensions?.VRMC_vrm;if(!r)return null;let i=r.specVersion;if(!Oc.has(i))return console.warn(`VRMLookAtLoaderPlugin: Unknown VRMC_vrm specVersion "${i}"`),null;let a=r.lookAt;if(!a)return null;let o=a.type===`expression`?1:10,s=this._v1ImportRangeMap(a.rangeMapHorizontalInner,o),c=this._v1ImportRangeMap(a.rangeMapHorizontalOuter,o),l=this._v1ImportRangeMap(a.rangeMapVerticalDown,o),u=this._v1ImportRangeMap(a.rangeMapVerticalUp,o),d;d=a.type===`expression`?new Ec(n,s,c,l,u):new Tc(t,s,c,l,u);let f=this._importLookAt(t,d);return f.offsetFromHeadBone.fromArray(a.offsetFromHeadBone??[0,.06,0]),f})}_v1ImportRangeMap(e,t){let n=e?.inputMaxValue??90,r=e?.outputScale??t;return n(console.error(e),console.warn(`VRMMetaLoaderPlugin: Failed to load a thumbnail image`),null))})}},Pc=class{constructor(e){this.scene=e.scene,this.meta=e.meta,this.humanoid=e.humanoid,this.expressionManager=e.expressionManager,this.firstPerson=e.firstPerson,this.lookAt=e.lookAt}update(e){this.humanoid.update(),this.lookAt&&this.lookAt.update(e),this.expressionManager&&this.expressionManager.update()}},Fc=class extends Pc{constructor(e){super(e),this.materials=e.materials,this.springBoneManager=e.springBoneManager,this.nodeConstraintManager=e.nodeConstraintManager}update(e){super.update(e),this.nodeConstraintManager&&this.nodeConstraintManager.update(),this.springBoneManager&&this.springBoneManager.update(e),this.materials&&this.materials.forEach(t=>{t.update&&t.update(e)})}},Ic=Object.defineProperty,Lc=Object.getOwnPropertySymbols,Rc=Object.prototype.hasOwnProperty,zc=Object.prototype.propertyIsEnumerable,Bc=(e,t,n)=>t in e?Ic(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Vc=(e,t)=>{for(var n in t||={})Rc.call(t,n)&&Bc(e,n,t[n]);if(Lc)for(var n of Lc(t))zc.call(t,n)&&Bc(e,n,t[n]);return e},Hc=(e,t,n)=>new Promise((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())});function Uc(e,t){e.colorSpace=t}var Wc=class{get pending(){return Promise.all(this._pendings)}constructor(e,t){this._parser=e,this._materialParams=t,this._pendings=[]}assignPrimitive(e,t){t!=null&&(this._materialParams[e]=t)}assignColor(e,t,n){if(t!=null){let r=new H().fromArray(t);n&&r.convertSRGBToLinear(),this._materialParams[e]=r}}assignTexture(e,t,n){return Hc(this,null,function*(){let r=(()=>Hc(this,null,function*(){t!=null&&(yield this._parser.assignTexture(this._materialParams,e,t),n&&Uc(this._materialParams[e],`srgb`))}))();return this._pendings.push(r),r})}assignTextureByIndex(e,t,n){return Hc(this,null,function*(){return this.assignTexture(e,t==null?void 0:{index:t},n)})}},Gc=`// #define PHONG +`;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},i=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;e!!u&&!!u.domElement).toBeTruthy(),d(),u.outputColorSpace=N,u.toneMapping=4;try{let t=await new is().loadAsync(e);t.mapping=303,t.generateMipmaps=!0,t.minFilter=zt,t.magFilter=ot,t.colorSpace=z,s=new Pt(u);let n=s.fromEquirectangular(t);c=n;let o=new nt(256);o.fromEquirectangularTexture(u,t);let d=await ts.fromCubeRenderTarget(u,o);a.value=t;let f=l.value;f.environment=n.texture,r.asBackground&&(f.background=n.texture),f.backgroundBlurriness=r.backgroundBlurriness,f.backgroundIntensity=r.backgroundIntensity,i(`skyBoxReady`,{irrSH:d.sh})}catch(e){console.warn(`Failed to load HDRI environment:`,e)}}return f(async()=>{await h(r.skyBoxSrc),m(()=>[r.skyBoxSrc],([e])=>{h(e)},{deep:!1})}),t({reload:async e=>await h(e)}),o(async()=>{await d()}),(e,t)=>p(e.$slots,`default`)}}),os=(e,t,n)=>new Promise((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())}),Z=(e,t,n)=>new Promise((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())}),ss=class extends A{constructor(e){super(),this.weight=0,this.isBinary=!1,this.overrideBlink=`none`,this.overrideLookAt=`none`,this.overrideMouth=`none`,this._binds=[],this.name=`VRMExpression_${e}`,this.expressionName=e,this.type=`VRMExpression`,this.visible=!1}get binds(){return this._binds}get overrideBlinkAmount(){return this.overrideBlink===`block`?0.5?1:0:this.weight}addBind(e){this._binds.push(e)}deleteBind(e){let t=this._binds.indexOf(e);t>=0&&this._binds.splice(t,1)}applyWeight(e){let t=this.outputWeight;t*=e?.multiplier??1,this.isBinary&&t<1&&(t=0),this._binds.forEach(e=>e.applyWeight(t))}clearAppliedWeight(){this._binds.forEach(e=>e.clearAppliedWeight())}};function cs(e,t,n){let r=e.parser.json,i=r.nodes?.[t];if(i==null)return console.warn(`extractPrimitivesInternal: Attempt to use nodes[${t}] of glTF but the node doesn't exist`),null;let a=i.mesh;if(a==null)return null;let o=r.meshes?.[a];if(o==null)return console.warn(`extractPrimitivesInternal: Attempt to use meshes[${a}] of glTF but the mesh doesn't exist`),null;let s=o.primitives.length,c=[];return n.traverse(e=>{c.length{let i=cs(e,r,t);i!=null&&n.set(r,i)}),n})}var ds={Aa:`aa`,Ih:`ih`,Ou:`ou`,Ee:`ee`,Oh:`oh`,Blink:`blink`,Happy:`happy`,Angry:`angry`,Sad:`sad`,Relaxed:`relaxed`,LookUp:`lookUp`,Surprised:`surprised`,LookDown:`lookDown`,LookLeft:`lookLeft`,LookRight:`lookRight`,BlinkLeft:`blinkLeft`,BlinkRight:`blinkRight`,Neutral:`neutral`};function fs(e){return Math.max(Math.min(e,1),0)}var ps=class e{constructor(){this.blinkExpressionNames=[`blink`,`blinkLeft`,`blinkRight`],this.lookAtExpressionNames=[`lookLeft`,`lookRight`,`lookUp`,`lookDown`],this.mouthExpressionNames=[`aa`,`ee`,`ih`,`oh`,`ou`],this._expressions=[],this._expressionMap={}}get expressions(){return this._expressions.concat()}get expressionMap(){return Object.assign({},this._expressionMap)}get presetExpressionMap(){let e={},t=new Set(Object.values(ds));return Object.entries(this._expressionMap).forEach(([n,r])=>{t.has(n)&&(e[n]=r)}),e}get customExpressionMap(){let e={},t=new Set(Object.values(ds));return Object.entries(this._expressionMap).forEach(([n,r])=>{t.has(n)||(e[n]=r)}),e}copy(e){return this._expressions.concat().forEach(e=>{this.unregisterExpression(e)}),e._expressions.forEach(e=>{this.registerExpression(e)}),this.blinkExpressionNames=e.blinkExpressionNames.concat(),this.lookAtExpressionNames=e.lookAtExpressionNames.concat(),this.mouthExpressionNames=e.mouthExpressionNames.concat(),this}clone(){return new e().copy(this)}getExpression(e){return this._expressionMap[e]??null}registerExpression(e){this._expressions.push(e),this._expressionMap[e.expressionName]=e}unregisterExpression(e){let t=this._expressions.indexOf(e);t===-1&&console.warn(`VRMExpressionManager: The specified expressions is not registered`),this._expressions.splice(t,1),delete this._expressionMap[e.expressionName]}getValue(e){return this.getExpression(e)?.weight??null}setValue(e,t){let n=this.getExpression(e);n&&(n.weight=fs(t))}resetValues(){this._expressions.forEach(e=>{e.weight=0})}getExpressionTrackName(e){let t=this.getExpression(e);return t?`${t.name}.weight`:null}update(){let e=this._calculateWeightMultipliers();this._expressions.forEach(e=>{e.clearAppliedWeight()}),this._expressions.forEach(t=>{let n=1,r=t.expressionName;this.blinkExpressionNames.indexOf(r)!==-1&&(n*=e.blink),this.lookAtExpressionNames.indexOf(r)!==-1&&(n*=e.lookAt),this.mouthExpressionNames.indexOf(r)!==-1&&(n*=e.mouth),t.applyWeight({multiplier:n})})}_calculateWeightMultipliers(){let e=1,t=1,n=1;return this._expressions.forEach(r=>{e-=r.overrideBlinkAmount,t-=r.overrideLookAtAmount,n-=r.overrideMouthAmount}),e=Math.max(0,e),t=Math.max(0,t),n=Math.max(0,n),{blink:e,lookAt:t,mouth:n}}},ms={Color:`color`,EmissionColor:`emissionColor`,ShadeColor:`shadeColor`,MatcapColor:`matcapColor`,RimColor:`rimColor`,OutlineColor:`outlineColor`},hs={_Color:ms.Color,_EmissionColor:ms.EmissionColor,_ShadeColor:ms.ShadeColor,_RimColor:ms.RimColor,_OutlineColor:ms.OutlineColor},gs=new H,_s=class e{constructor({material:e,type:t,targetValue:n,targetAlpha:r}){this.material=e,this.type=t,this.targetValue=n,this.targetAlpha=r??1,this._state={color:this._initColorBindState(),alpha:this._initAlphaBindState()}}applyWeight(e){let{color:t,alpha:n}=this._state;if(t!=null){let{propertyName:n,deltaValue:r}=t;this.material[n]?.add(gs.copy(r).multiplyScalar(e))}if(n!=null){let{propertyName:t,deltaValue:r}=n;this.material[t]!=null&&(this.material[t]+=r*e)}}clearAppliedWeight(){let{color:e,alpha:t}=this._state;if(e!=null){let{propertyName:t,initialValue:n}=e;this.material[t]?.copy(n)}if(t!=null){let{propertyName:e,initialValue:n}=t;this.material[e]!=null&&(this.material[e]=n)}}_initColorBindState(){let{material:e,type:t,targetValue:n}=this,r=this._getPropertyNameMap()?.[t]?.[0]??null;if(r==null)return console.warn(`Tried to add a material color bind to the material ${e.name??`(no name)`}, the type ${t} but the material or the type is not supported.`),null;let i=e[r].clone();return{propertyName:r,initialValue:i,deltaValue:new H(n.r-i.r,n.g-i.g,n.b-i.b)}}_initAlphaBindState(){let{material:e,type:t,targetAlpha:n}=this,r=this._getPropertyNameMap()?.[t]?.[1]??null;if(r==null&&n!==1)return console.warn(`Tried to add a material alpha bind to the material ${e.name??`(no name)`}, the type ${t} but the material or the type does not support alpha.`),null;if(r==null)return null;let i=e[r];return{propertyName:r,initialValue:i,deltaValue:n-i}}_getPropertyNameMap(){return Object.entries(e._propertyNameMapMap).find(([e])=>this.material[e]===!0)?.[1]??null}};_s._propertyNameMapMap={isMeshStandardMaterial:{color:[`color`,`opacity`],emissionColor:[`emissive`,null]},isMeshBasicMaterial:{color:[`color`,`opacity`]},isMToonMaterial:{color:[`color`,`opacity`],emissionColor:[`emissive`,null],outlineColor:[`outlineColorFactor`,null],matcapColor:[`matcapFactor`,null],rimColor:[`parametricRimColorFactor`,null],shadeColor:[`shadeColorFactor`,null]}};var vs=_s,ys=class{constructor({primitives:e,index:t,weight:n}){this.primitives=e,this.index=t,this.weight=n}applyWeight(e){this.primitives.forEach(t=>{t.morphTargetInfluences?.[this.index]!=null&&(t.morphTargetInfluences[this.index]+=this.weight*e)})}clearAppliedWeight(){this.primitives.forEach(e=>{e.morphTargetInfluences?.[this.index]!=null&&(e.morphTargetInfluences[this.index]=0)})}},bs=new L,xs=class e{constructor({material:t,scale:n,offset:r}){this.material=t,this.scale=n,this.offset=r;let i=Object.entries(e._propertyNamesMap).find(([e])=>t[e]===!0)?.[1];i==null?(console.warn(`Tried to add a texture transform bind to the material ${t.name??`(no name)`} but the material is not supported.`),this._properties=[]):(this._properties=[],i.forEach(e=>{let i=t[e]?.clone();if(!i)return null;t[e]=i;let a=i.offset.clone(),o=i.repeat.clone(),s=r.clone().sub(a),c=n.clone().sub(o);this._properties.push({name:e,initialOffset:a,deltaOffset:s,initialScale:o,deltaScale:c})}))}applyWeight(e){this._properties.forEach(t=>{let n=this.material[t.name];n!==void 0&&(n.offset.add(bs.copy(t.deltaOffset).multiplyScalar(e)),n.repeat.add(bs.copy(t.deltaScale).multiplyScalar(e)))})}clearAppliedWeight(){this._properties.forEach(e=>{let t=this.material[e.name];t!==void 0&&(t.offset.copy(e.initialOffset),t.repeat.copy(e.initialScale))})}};xs._propertyNamesMap={isMeshStandardMaterial:[`map`,`emissiveMap`,`bumpMap`,`normalMap`,`displacementMap`,`roughnessMap`,`metalnessMap`,`alphaMap`],isMeshBasicMaterial:[`map`,`specularMap`,`alphaMap`],isMToonMaterial:[`map`,`normalMap`,`emissiveMap`,`shadeMultiplyTexture`,`rimMultiplyTexture`,`outlineWidthMultiplyTexture`,`uvAnimationMaskTexture`]};var Ss=xs,Cs=new Set([`1.0`,`1.0-beta`]),ws=class e{get name(){return`VRMExpressionLoaderPlugin`}constructor(e){this.parser=e}afterRoot(e){return Z(this,null,function*(){e.userData.vrmExpressionManager=yield this._import(e)})}_import(e){return Z(this,null,function*(){return(yield this._v1Import(e))||(yield this._v0Import(e))||null})}_v1Import(e){return Z(this,null,function*(){let t=this.parser.json;if(t.extensionsUsed?.indexOf(`VRMC_vrm`)===-1)return null;let n=t.extensions?.VRMC_vrm;if(!n)return null;let r=n.specVersion;if(!Cs.has(r))return console.warn(`VRMExpressionLoaderPlugin: Unknown VRMC_vrm specVersion "${r}"`),null;let i=n.expressions;if(!i)return null;let a=new Set(Object.values(ds)),o=new Map;i.preset!=null&&Object.entries(i.preset).forEach(([e,t])=>{if(t!=null){if(!a.has(e)){console.warn(`VRMExpressionLoaderPlugin: Unknown preset name "${e}" detected. Ignoring the expression`);return}o.set(e,t)}}),i.custom!=null&&Object.entries(i.custom).forEach(([e,t])=>{if(a.has(e)){console.warn(`VRMExpressionLoaderPlugin: Custom expression cannot have preset name "${e}". Ignoring the expression`);return}o.set(e,t)});let s=new ps;return yield Promise.all(Array.from(o.entries()).map(t=>Z(this,[t],function*([t,n]){var r,i,a;let o=new ss(t);if(e.scene.add(o),o.isBinary=n.isBinary??!1,o.overrideBlink=n.overrideBlink??`none`,o.overrideLookAt=n.overrideLookAt??`none`,o.overrideMouth=n.overrideMouth??`none`,(r=n.morphTargetBinds)==null||r.forEach(t=>Z(this,null,function*(){if(t.node===void 0||t.index===void 0)return;let r=yield ls(e,t.node),i=t.index;if(!r.every(e=>Array.isArray(e.morphTargetInfluences)&&i{let n=e.material;n&&(Array.isArray(n)?t.push(...n):t.push(n))}),(i=n.materialColorBinds)==null||i.forEach(e=>Z(this,null,function*(){t.filter(t=>{let n=this.parser.associations.get(t)?.materials;return e.material===n}).forEach(t=>{o.addBind(new vs({material:t,type:e.type,targetValue:new H().fromArray(e.targetValue),targetAlpha:e.targetValue[3]}))})})),(a=n.textureTransformBinds)==null||a.forEach(e=>Z(this,null,function*(){t.filter(t=>{let n=this.parser.associations.get(t)?.materials;return e.material===n}).forEach(t=>{o.addBind(new Ss({material:t,offset:new L().fromArray(e.offset??[0,0]),scale:new L().fromArray(e.scale??[1,1])}))})}))}s.registerExpression(o)}))),s})}_v0Import(t){return Z(this,null,function*(){let n=this.parser.json,r=n.extensions?.VRM;if(!r)return null;let i=r.blendShapeMaster;if(!i)return null;let a=new ps,o=i.blendShapeGroups;if(!o)return a;let s=new Set;return yield Promise.all(o.map(r=>Z(this,null,function*(){let i=r.presetName,o=(i!=null&&e.v0v1PresetNameMap[i]||null)??r.name;if(o==null){console.warn(`VRMExpressionLoaderPlugin: One of custom expressions has no name. Ignoring the expression`);return}if(s.has(o)){console.warn(`VRMExpressionLoaderPlugin: An expression preset ${i} has duplicated entries. Ignoring the expression`);return}s.add(o);let c=new ss(o);t.scene.add(c),c.isBinary=r.isBinary??!1,r.binds&&r.binds.forEach(e=>Z(this,null,function*(){var i;if(e.mesh===void 0||e.index===void 0)return;let a=[];(i=n.nodes)==null||i.forEach((t,n)=>{t.mesh===e.mesh&&a.push(n)});let o=e.index;yield Promise.all(a.map(n=>Z(this,null,function*(){let i=yield ls(t,n);if(!i.every(e=>Array.isArray(e.morphTargetInfluences)&&o{if(e.materialName===void 0||e.propertyName===void 0||e.targetValue===void 0)return;let n=[];t.scene.traverse(t=>{if(t.material){let r=t.material;Array.isArray(r)?n.push(...r.filter(t=>(t.name===e.materialName||t.name===e.materialName+` (Outline)`)&&n.indexOf(t)===-1)):r.name===e.materialName&&n.indexOf(r)===-1&&n.push(r)}});let r=e.propertyName;n.forEach(t=>{if(r===`_MainTex_ST`){let n=new L(e.targetValue[0],e.targetValue[1]),r=new L(e.targetValue[2],e.targetValue[3]);r.y=1-r.y-n.y,c.addBind(new Ss({material:t,scale:n,offset:r}));return}let n=hs[r];if(n){c.addBind(new vs({material:t,type:n,targetValue:new H().fromArray(e.targetValue),targetAlpha:e.targetValue[3]}));return}console.warn(r+` is not supported`)})}),a.registerExpression(c)}))),a})}};ws.v0v1PresetNameMap={a:`aa`,e:`ee`,i:`ih`,o:`oh`,u:`ou`,blink:`blink`,joy:`happy`,angry:`angry`,sorrow:`sad`,fun:`relaxed`,lookup:`lookUp`,lookdown:`lookDown`,lookleft:`lookLeft`,lookright:`lookRight`,blink_l:`blinkLeft`,blink_r:`blinkRight`,neutral:`neutral`};var Ts=ws,Es=class e{constructor(t,n){this._firstPersonOnlyLayer=e.DEFAULT_FIRSTPERSON_ONLY_LAYER,this._thirdPersonOnlyLayer=e.DEFAULT_THIRDPERSON_ONLY_LAYER,this._initializedLayers=!1,this.humanoid=t,this.meshAnnotations=n}copy(e){if(this.humanoid!==e.humanoid)throw Error(`VRMFirstPerson: humanoid must be same in order to copy`);return this.meshAnnotations=e.meshAnnotations.map(e=>({meshes:e.meshes.concat(),type:e.type})),this}clone(){return new e(this.humanoid,this.meshAnnotations).copy(this)}get firstPersonOnlyLayer(){return this._firstPersonOnlyLayer}get thirdPersonOnlyLayer(){return this._thirdPersonOnlyLayer}setup({firstPersonOnlyLayer:t=e.DEFAULT_FIRSTPERSON_ONLY_LAYER,thirdPersonOnlyLayer:n=e.DEFAULT_THIRDPERSON_ONLY_LAYER}={}){this._initializedLayers||=(this._firstPersonOnlyLayer=t,this._thirdPersonOnlyLayer=n,this.meshAnnotations.forEach(e=>{e.meshes.forEach(t=>{e.type===`firstPersonOnly`?(t.layers.set(this._firstPersonOnlyLayer),t.traverse(e=>e.layers.set(this._firstPersonOnlyLayer))):e.type===`thirdPersonOnly`?(t.layers.set(this._thirdPersonOnlyLayer),t.traverse(e=>e.layers.set(this._thirdPersonOnlyLayer))):e.type===`auto`&&this._createHeadlessModel(t)})}),!0)}_excludeTriangles(e,t,n,r){let i=0;if(t!=null&&t.length>0)for(let a=0;a0&&r.includes(u[0])||l[1]>0&&r.includes(u[1])||l[2]>0&&r.includes(u[2])||l[3]>0&&r.includes(u[3]))continue;let d=t[s],f=n[s];if(d[0]>0&&r.includes(f[0])||d[1]>0&&r.includes(f[1])||d[2]>0&&r.includes(f[2])||d[3]>0&&r.includes(f[3]))continue;let p=t[c],m=n[c];p[0]>0&&r.includes(m[0])||p[1]>0&&r.includes(m[1])||p[2]>0&&r.includes(m[2])||p[3]>0&&r.includes(m[3])||(e[i++]=o,e[i++]=s,e[i++]=c)}return i}_createErasedMesh(e,t){let n=new Be(e.geometry.clone(),e.material);n.name=`${e.name}(erase)`,n.frustumCulled=e.frustumCulled,n.layers.set(this._firstPersonOnlyLayer);let r=n.geometry,i=r.getAttribute(`skinIndex`),a=i instanceof xe?[]:i.array,o=[];for(let e=0;e{this._isEraseTarget(e)&&n.push(t)}),!n.length){t.layers.enable(this._thirdPersonOnlyLayer),t.layers.enable(this._firstPersonOnlyLayer);return}t.layers.set(this._thirdPersonOnlyLayer);let r=this._createErasedMesh(t,n);e.add(r)}_createHeadlessModel(e){if(e.type===`Group`)if(e.layers.set(this._thirdPersonOnlyLayer),this._isEraseTarget(e))e.traverse(e=>e.layers.set(this._thirdPersonOnlyLayer));else{let t=new P;t.name=`_headless_${e.name}`,t.layers.set(this._firstPersonOnlyLayer),e.parent.add(t),e.children.filter(e=>e.type===`SkinnedMesh`).forEach(e=>{let n=e;this._createHeadlessModelForSkinnedMesh(t,n)})}else if(e.type===`SkinnedMesh`){let t=e;this._createHeadlessModelForSkinnedMesh(e.parent,t)}else this._isEraseTarget(e)&&(e.layers.set(this._thirdPersonOnlyLayer),e.traverse(e=>e.layers.set(this._thirdPersonOnlyLayer)))}_isEraseTarget(e){return e===this.humanoid.getRawBoneNode(`head`)?!0:e.parent?this._isEraseTarget(e.parent):!1}};Es.DEFAULT_FIRSTPERSON_ONLY_LAYER=9,Es.DEFAULT_THIRDPERSON_ONLY_LAYER=10;var Ds=Es,Os=new Set([`1.0`,`1.0-beta`]),ks=class{get name(){return`VRMFirstPersonLoaderPlugin`}constructor(e){this.parser=e}afterRoot(e){return Z(this,null,function*(){let t=e.userData.vrmHumanoid;if(t!==null){if(t===void 0)throw Error(`VRMFirstPersonLoaderPlugin: vrmHumanoid is undefined. VRMHumanoidLoaderPlugin have to be used first`);e.userData.vrmFirstPerson=yield this._import(e,t)}})}_import(e,t){return Z(this,null,function*(){return t==null?null:(yield this._v1Import(e,t))||(yield this._v0Import(e,t))||null})}_v1Import(e,t){return Z(this,null,function*(){let n=this.parser.json;if(n.extensionsUsed?.indexOf(`VRMC_vrm`)===-1)return null;let r=n.extensions?.VRMC_vrm;if(!r)return null;let i=r.specVersion;if(!Os.has(i))return console.warn(`VRMFirstPersonLoaderPlugin: Unknown VRMC_vrm specVersion "${i}"`),null;let a=r.firstPerson,o=[],s=yield us(e);return Array.from(s.entries()).forEach(([e,t])=>{let n=(a?.meshAnnotations)?.find(t=>t.node===e);o.push({meshes:t,type:n?.type??`auto`})}),new Ds(t,o)})}_v0Import(e,t){return Z(this,null,function*(){let n=this.parser.json,r=n.extensions?.VRM;if(!r)return null;let i=r.firstPerson;if(!i)return null;let a=[],o=yield us(e);return Array.from(o.entries()).forEach(([e,t])=>{let r=n.nodes[e],o=i.meshAnnotations?i.meshAnnotations.find(e=>e.mesh===r.mesh):void 0;a.push({meshes:t,type:this._convertV0FlagToV1Type(o?.firstPersonFlag)})}),new Ds(t,a)})}_convertV0FlagToV1Type(e){return e===`FirstPersonOnly`?`firstPersonOnly`:e===`ThirdPersonOnly`?`thirdPersonOnly`:e===`Both`?`both`:`auto`}},As=new F,js=new F,Ms=new R,Ns=class extends P{constructor(e){super(),this.vrmHumanoid=e,this._boneAxesMap=new Map,Object.values(e.humanBones).forEach(e=>{let t=new kt(1);t.matrixAutoUpdate=!1,t.material.depthTest=!1,t.material.depthWrite=!1,this.add(t),this._boneAxesMap.set(e,t)})}dispose(){Array.from(this._boneAxesMap.values()).forEach(e=>{e.geometry.dispose(),e.material.dispose()})}updateMatrixWorld(e){Array.from(this._boneAxesMap.entries()).forEach(([e,t])=>{e.node.updateWorldMatrix(!0,!1),e.node.matrixWorld.decompose(As,Ms,js);let n=As.set(.1,.1,.1).divide(js);t.matrix.copy(e.node.matrixWorld).scale(n)}),super.updateMatrixWorld(e)}},Ps=`hips.spine.chest.upperChest.neck.head.leftEye.rightEye.jaw.leftUpperLeg.leftLowerLeg.leftFoot.leftToes.rightUpperLeg.rightLowerLeg.rightFoot.rightToes.leftShoulder.leftUpperArm.leftLowerArm.leftHand.rightShoulder.rightUpperArm.rightLowerArm.rightHand.leftThumbMetacarpal.leftThumbProximal.leftThumbDistal.leftIndexProximal.leftIndexIntermediate.leftIndexDistal.leftMiddleProximal.leftMiddleIntermediate.leftMiddleDistal.leftRingProximal.leftRingIntermediate.leftRingDistal.leftLittleProximal.leftLittleIntermediate.leftLittleDistal.rightThumbMetacarpal.rightThumbProximal.rightThumbDistal.rightIndexProximal.rightIndexIntermediate.rightIndexDistal.rightMiddleProximal.rightMiddleIntermediate.rightMiddleDistal.rightRingProximal.rightRingIntermediate.rightRingDistal.rightLittleProximal.rightLittleIntermediate.rightLittleDistal`.split(`.`),Fs={hips:null,spine:`hips`,chest:`spine`,upperChest:`chest`,neck:`upperChest`,head:`neck`,leftEye:`head`,rightEye:`head`,jaw:`head`,leftUpperLeg:`hips`,leftLowerLeg:`leftUpperLeg`,leftFoot:`leftLowerLeg`,leftToes:`leftFoot`,rightUpperLeg:`hips`,rightLowerLeg:`rightUpperLeg`,rightFoot:`rightLowerLeg`,rightToes:`rightFoot`,leftShoulder:`upperChest`,leftUpperArm:`leftShoulder`,leftLowerArm:`leftUpperArm`,leftHand:`leftLowerArm`,rightShoulder:`upperChest`,rightUpperArm:`rightShoulder`,rightLowerArm:`rightUpperArm`,rightHand:`rightLowerArm`,leftThumbMetacarpal:`leftHand`,leftThumbProximal:`leftThumbMetacarpal`,leftThumbDistal:`leftThumbProximal`,leftIndexProximal:`leftHand`,leftIndexIntermediate:`leftIndexProximal`,leftIndexDistal:`leftIndexIntermediate`,leftMiddleProximal:`leftHand`,leftMiddleIntermediate:`leftMiddleProximal`,leftMiddleDistal:`leftMiddleIntermediate`,leftRingProximal:`leftHand`,leftRingIntermediate:`leftRingProximal`,leftRingDistal:`leftRingIntermediate`,leftLittleProximal:`leftHand`,leftLittleIntermediate:`leftLittleProximal`,leftLittleDistal:`leftLittleIntermediate`,rightThumbMetacarpal:`rightHand`,rightThumbProximal:`rightThumbMetacarpal`,rightThumbDistal:`rightThumbProximal`,rightIndexProximal:`rightHand`,rightIndexIntermediate:`rightIndexProximal`,rightIndexDistal:`rightIndexIntermediate`,rightMiddleProximal:`rightHand`,rightMiddleIntermediate:`rightMiddleProximal`,rightMiddleDistal:`rightMiddleIntermediate`,rightRingProximal:`rightHand`,rightRingIntermediate:`rightRingProximal`,rightRingDistal:`rightRingIntermediate`,rightLittleProximal:`rightHand`,rightLittleIntermediate:`rightLittleProximal`,rightLittleDistal:`rightLittleIntermediate`};function Is(e){return e.invert?e.invert():e.inverse(),e}var Ls=new F,Rs=new R,zs=class{constructor(e){this.humanBones=e,this.restPose=this.getAbsolutePose()}getAbsolutePose(){let e={};return Object.keys(this.humanBones).forEach(t=>{let n=t,r=this.getBoneNode(n);r&&(Ls.copy(r.position),Rs.copy(r.quaternion),e[n]={position:Ls.toArray(),rotation:Rs.toArray()})}),e}getPose(){let e={};return Object.keys(this.humanBones).forEach(t=>{let n=t,r=this.getBoneNode(n);if(!r)return;Ls.set(0,0,0),Rs.identity();let i=this.restPose[n];i?.position&&Ls.fromArray(i.position).negate(),i?.rotation&&Is(Rs.fromArray(i.rotation)),Ls.add(r.position),Rs.premultiply(r.quaternion),e[n]={position:Ls.toArray(),rotation:Rs.toArray()}}),e}setPose(e){Object.entries(e).forEach(([e,t])=>{let n=e,r=this.getBoneNode(n);if(!r)return;let i=this.restPose[n];i&&(t?.position&&(r.position.fromArray(t.position),i.position&&r.position.add(Ls.fromArray(i.position))),t?.rotation&&(r.quaternion.fromArray(t.rotation),i.rotation&&r.quaternion.multiply(Rs.fromArray(i.rotation))))})}resetPose(){Object.entries(this.restPose).forEach(([e,t])=>{let n=this.getBoneNode(e);n&&(t?.position&&n.position.fromArray(t.position),t?.rotation&&n.quaternion.fromArray(t.rotation))})}getBone(e){return this.humanBones[e]??void 0}getBoneNode(e){return this.humanBones[e]?.node??null}},Bs=new F,Vs=new R,Hs=new F,Us=class e extends zs{static _setupTransforms(e){let t=new A;t.name=`VRMHumanoidRig`;let n={},r={},i={},a={};Ps.forEach(t=>{var o;let s=e.getBoneNode(t);if(s){let e=new F,c=new R;s.updateWorldMatrix(!0,!1),s.matrixWorld.decompose(e,c,Bs),n[t]=e,r[t]=c,i[t]=s.quaternion.clone();let l=new R;(o=s.parent)==null||o.matrixWorld.decompose(Bs,l,Bs),a[t]=l}});let o={};return Ps.forEach(r=>{let i=e.getBoneNode(r);if(i){let e=n[r],a=r,s;for(;s==null&&(a=Fs[a],a!=null);)s=n[a];let c=new A;c.name=`Normalized_`+i.name,(a?o[a]?.node:t).add(c),c.position.copy(e),s&&c.position.sub(s),o[r]={node:c}}}),{rigBones:o,root:t,parentWorldRotations:a,boneRotations:i}}constructor(t){let{rigBones:n,root:r,parentWorldRotations:i,boneRotations:a}=e._setupTransforms(t);super(n),this.original=t,this.root=r,this._parentWorldRotations=i,this._boneRotations=a}update(){Ps.forEach(e=>{let t=this.original.getBoneNode(e);if(t!=null){let n=this.getBoneNode(e),r=this._parentWorldRotations[e],i=Vs.copy(r).invert(),a=this._boneRotations[e];if(t.quaternion.copy(n.quaternion).multiply(r).premultiply(i).multiply(a),e===`hips`){let e=n.getWorldPosition(Hs);t.parent.updateWorldMatrix(!0,!1);let r=t.parent.matrixWorld,i=e.applyMatrix4(r.invert());t.position.copy(i)}}})}},Ws=class e{get restPose(){return console.warn(`VRMHumanoid: restPose is deprecated. Use either rawRestPose or normalizedRestPose instead.`),this.rawRestPose}get rawRestPose(){return this._rawHumanBones.restPose}get normalizedRestPose(){return this._normalizedHumanBones.restPose}get humanBones(){return this._rawHumanBones.humanBones}get rawHumanBones(){return this._rawHumanBones.humanBones}get normalizedHumanBones(){return this._normalizedHumanBones.humanBones}get normalizedHumanBonesRoot(){return this._normalizedHumanBones.root}constructor(e,t){this.autoUpdateHumanBones=t?.autoUpdateHumanBones??!0,this._rawHumanBones=new zs(e),this._normalizedHumanBones=new Us(this._rawHumanBones)}copy(e){return this.autoUpdateHumanBones=e.autoUpdateHumanBones,this._rawHumanBones=new zs(e.humanBones),this._normalizedHumanBones=new Us(this._rawHumanBones),this}clone(){return new e(this.humanBones,{autoUpdateHumanBones:this.autoUpdateHumanBones}).copy(this)}getAbsolutePose(){return console.warn(`VRMHumanoid: getAbsolutePose() is deprecated. Use either getRawAbsolutePose() or getNormalizedAbsolutePose() instead.`),this.getRawAbsolutePose()}getRawAbsolutePose(){return this._rawHumanBones.getAbsolutePose()}getNormalizedAbsolutePose(){return this._normalizedHumanBones.getAbsolutePose()}getPose(){return console.warn(`VRMHumanoid: getPose() is deprecated. Use either getRawPose() or getNormalizedPose() instead.`),this.getRawPose()}getRawPose(){return this._rawHumanBones.getPose()}getNormalizedPose(){return this._normalizedHumanBones.getPose()}setPose(e){return console.warn(`VRMHumanoid: setPose() is deprecated. Use either setRawPose() or setNormalizedPose() instead.`),this.setRawPose(e)}setRawPose(e){return this._rawHumanBones.setPose(e)}setNormalizedPose(e){return this._normalizedHumanBones.setPose(e)}resetPose(){return console.warn(`VRMHumanoid: resetPose() is deprecated. Use either resetRawPose() or resetNormalizedPose() instead.`),this.resetRawPose()}resetRawPose(){return this._rawHumanBones.resetPose()}resetNormalizedPose(){return this._normalizedHumanBones.resetPose()}getBone(e){return console.warn(`VRMHumanoid: getBone() is deprecated. Use either getRawBone() or getNormalizedBone() instead.`),this.getRawBone(e)}getRawBone(e){return this._rawHumanBones.getBone(e)}getNormalizedBone(e){return this._normalizedHumanBones.getBone(e)}getBoneNode(e){return console.warn(`VRMHumanoid: getBoneNode() is deprecated. Use either getRawBoneNode() or getNormalizedBoneNode() instead.`),this.getRawBoneNode(e)}getRawBoneNode(e){return this._rawHumanBones.getBoneNode(e)}getNormalizedBoneNode(e){return this._normalizedHumanBones.getBoneNode(e)}update(){this.autoUpdateHumanBones&&this._normalizedHumanBones.update()}},Gs={Hips:`hips`,Spine:`spine`,Head:`head`,LeftUpperLeg:`leftUpperLeg`,LeftLowerLeg:`leftLowerLeg`,LeftFoot:`leftFoot`,RightUpperLeg:`rightUpperLeg`,RightLowerLeg:`rightLowerLeg`,RightFoot:`rightFoot`,LeftUpperArm:`leftUpperArm`,LeftLowerArm:`leftLowerArm`,LeftHand:`leftHand`,RightUpperArm:`rightUpperArm`,RightLowerArm:`rightLowerArm`,RightHand:`rightHand`},Ks=new Set([`1.0`,`1.0-beta`]),qs={leftThumbProximal:`leftThumbMetacarpal`,leftThumbIntermediate:`leftThumbProximal`,rightThumbProximal:`rightThumbMetacarpal`,rightThumbIntermediate:`rightThumbProximal`},Js=class{get name(){return`VRMHumanoidLoaderPlugin`}constructor(e,t){this.parser=e,this.helperRoot=t?.helperRoot,this.autoUpdateHumanBones=t?.autoUpdateHumanBones}afterRoot(e){return Z(this,null,function*(){e.userData.vrmHumanoid=yield this._import(e)})}_import(e){return Z(this,null,function*(){return(yield this._v1Import(e))||(yield this._v0Import(e))||null})}_v1Import(e){return Z(this,null,function*(){let t=this.parser.json;if(t.extensionsUsed?.indexOf(`VRMC_vrm`)===-1)return null;let n=t.extensions?.VRMC_vrm;if(!n)return null;let r=n.specVersion;if(!Ks.has(r))return console.warn(`VRMHumanoidLoaderPlugin: Unknown VRMC_vrm specVersion "${r}"`),null;let i=n.humanoid;if(!i)return null;let a=i.humanBones.leftThumbIntermediate!=null||i.humanBones.rightThumbIntermediate!=null,o={};i.humanBones!=null&&(yield Promise.all(Object.entries(i.humanBones).map(e=>Z(this,[e],function*([e,t]){let n=e,r=t.node;if(a){let e=qs[n];e!=null&&(n=e)}let i=yield this.parser.getDependency(`node`,r);if(i==null){console.warn(`A glTF node bound to the humanoid bone ${n} (index = ${r}) does not exist`);return}o[n]={node:i}}))));let s=new Ws(this._ensureRequiredBonesExist(o),{autoUpdateHumanBones:this.autoUpdateHumanBones});if(e.scene.add(s.normalizedHumanBonesRoot),this.helperRoot){let e=new Ns(s);this.helperRoot.add(e),e.renderOrder=this.helperRoot.renderOrder}return s})}_v0Import(e){return Z(this,null,function*(){let t=this.parser.json.extensions?.VRM;if(!t)return null;let n=t.humanoid;if(!n)return null;let r={};n.humanBones!=null&&(yield Promise.all(n.humanBones.map(e=>Z(this,null,function*(){let t=e.bone,n=e.node;if(t==null||n==null)return;let i=yield this.parser.getDependency(`node`,n);if(i==null){console.warn(`A glTF node bound to the humanoid bone ${t} (index = ${n}) does not exist`);return}let a=qs[t]??t;if(r[a]!=null){console.warn(`Multiple bone entries for ${a} detected (index = ${n}), ignoring duplicated entries.`);return}r[a]={node:i}}))));let i=new Ws(this._ensureRequiredBonesExist(r),{autoUpdateHumanBones:this.autoUpdateHumanBones});if(e.scene.add(i.normalizedHumanBonesRoot),this.helperRoot){let e=new Ns(i);this.helperRoot.add(e),e.renderOrder=this.helperRoot.renderOrder}return i})}_ensureRequiredBonesExist(e){let t=Object.values(Gs).filter(t=>e[t]==null);if(t.length>0)throw Error(`VRMHumanoidLoaderPlugin: These humanoid bones are required but not exist: ${t.join(`, `)}`);return e}},Ys=class extends Gt{constructor(){super(),this._currentTheta=0,this._currentRadius=0,this.theta=0,this.radius=0,this._currentTheta=0,this._currentRadius=0,this._attrPos=new V(new Float32Array(195),3),this.setAttribute(`position`,this._attrPos),this._attrIndex=new V(new Uint16Array(189),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let e=!1;this._currentTheta!==this.theta&&(this._currentTheta=this.theta,e=!0),this._currentRadius!==this.radius&&(this._currentRadius=this.radius,e=!0),e&&this._buildPosition()}_buildPosition(){this._attrPos.setXYZ(0,0,0,0);for(let e=0;e<64;e++){let t=e/63*this._currentTheta;this._attrPos.setXYZ(e+1,this._currentRadius*Math.sin(t),0,this._currentRadius*Math.cos(t))}this._attrPos.needsUpdate=!0}_buildIndex(){for(let e=0;e<63;e++)this._attrIndex.setXYZ(e*3,0,e+1,e+2);this._attrIndex.needsUpdate=!0}},Xs=class extends Gt{constructor(){super(),this.radius=0,this._currentRadius=0,this.tail=new F,this._currentTail=new F,this._attrPos=new V(new Float32Array(294),3),this.setAttribute(`position`,this._attrPos),this._attrIndex=new V(new Uint16Array(194),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let e=!1;this._currentRadius!==this.radius&&(this._currentRadius=this.radius,e=!0),this._currentTail.equals(this.tail)||(this._currentTail.copy(this.tail),e=!0),e&&this._buildPosition()}_buildPosition(){for(let e=0;e<32;e++){let t=e/16*Math.PI;this._attrPos.setXYZ(e,Math.cos(t),Math.sin(t),0),this._attrPos.setXYZ(32+e,0,Math.cos(t),Math.sin(t)),this._attrPos.setXYZ(64+e,Math.sin(t),0,Math.cos(t))}this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.setXYZ(96,0,0,0),this._attrPos.setXYZ(97,this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let e=0;e<32;e++){let t=(e+1)%32;this._attrIndex.setXY(e*2,e,t),this._attrIndex.setXY(64+e*2,32+e,32+t),this._attrIndex.setXY(128+e*2,64+e,64+t)}this._attrIndex.setXY(192,96,97),this._attrIndex.needsUpdate=!0}},Zs=new R,Qs=new R,$s=new F,ec=new F,tc=Math.sqrt(2)/2,nc=new R(0,0,-tc,tc),rc=new F(0,1,0),ic=class extends P{constructor(e){super(),this.matrixAutoUpdate=!1,this.vrmLookAt=e;{let e=new Ys;e.radius=.5,this._meshPitch=new it(e,new ct({color:65280,transparent:!0,opacity:.5,side:2,depthTest:!1,depthWrite:!1})),this.add(this._meshPitch)}{let e=new Ys;e.radius=.5,this._meshYaw=new it(e,new ct({color:16711680,transparent:!0,opacity:.5,side:2,depthTest:!1,depthWrite:!1})),this.add(this._meshYaw)}{let e=new Xs;e.radius=.1,this._lineTarget=new E(e,new qe({color:16777215,depthTest:!1,depthWrite:!1})),this._lineTarget.frustumCulled=!1,this.add(this._lineTarget)}}dispose(){this._meshYaw.geometry.dispose(),this._meshYaw.material.dispose(),this._meshPitch.geometry.dispose(),this._meshPitch.material.dispose(),this._lineTarget.geometry.dispose(),this._lineTarget.material.dispose()}updateMatrixWorld(e){let t=I.DEG2RAD*this.vrmLookAt.yaw;this._meshYaw.geometry.theta=t,this._meshYaw.geometry.update();let n=I.DEG2RAD*this.vrmLookAt.pitch;this._meshPitch.geometry.theta=n,this._meshPitch.geometry.update(),this.vrmLookAt.getLookAtWorldPosition($s),this.vrmLookAt.getLookAtWorldQuaternion(Zs),Zs.multiply(this.vrmLookAt.getFaceFrontQuaternion(Qs)),this._meshYaw.position.copy($s),this._meshYaw.quaternion.copy(Zs),this._meshPitch.position.copy($s),this._meshPitch.quaternion.copy(Zs),this._meshPitch.quaternion.multiply(Qs.setFromAxisAngle(rc,t)),this._meshPitch.quaternion.multiply(nc);let{target:r,autoUpdate:i}=this.vrmLookAt;r!=null&&i&&(r.getWorldPosition(ec).sub($s),this._lineTarget.geometry.tail.copy(ec),this._lineTarget.geometry.update(),this._lineTarget.position.copy($s)),super.updateMatrixWorld(e)}},ac=new F,oc=new F;function sc(e,t){return e.matrixWorld.decompose(ac,t,oc),t}function cc(e){return[Math.atan2(-e.z,e.x),Math.atan2(e.y,Math.sqrt(e.x*e.x+e.z*e.z))]}function lc(e){let t=Math.round(e/2/Math.PI);return e-2*Math.PI*t}var uc=new F(0,0,1),dc=new F,fc=new F,pc=new F,mc=new R,hc=new R,gc=new R,_c=new R,vc=new Se,yc=class e{constructor(e,t){this.offsetFromHeadBone=new F,this.autoUpdate=!0,this.faceFront=new F(0,0,1),this.humanoid=e,this.applier=t,this._yaw=0,this._pitch=0,this._needsUpdate=!0,this._restHeadWorldQuaternion=this.getLookAtWorldQuaternion(new R)}get yaw(){return this._yaw}set yaw(e){this._yaw=e,this._needsUpdate=!0}get pitch(){return this._pitch}set pitch(e){this._pitch=e,this._needsUpdate=!0}get euler(){return console.warn(`VRMLookAt: euler is deprecated. use getEuler() instead.`),this.getEuler(new Se)}getEuler(e){return e.set(I.DEG2RAD*this._pitch,I.DEG2RAD*this._yaw,0,`YXZ`)}copy(e){if(this.humanoid!==e.humanoid)throw Error(`VRMLookAt: humanoid must be same in order to copy`);return this.offsetFromHeadBone.copy(e.offsetFromHeadBone),this.applier=e.applier,this.autoUpdate=e.autoUpdate,this.target=e.target,this.faceFront.copy(e.faceFront),this}clone(){return new e(this.humanoid,this.applier).copy(this)}reset(){this._yaw=0,this._pitch=0,this._needsUpdate=!0}getLookAtWorldPosition(e){let t=this.humanoid.getRawBoneNode(`head`);return e.copy(this.offsetFromHeadBone).applyMatrix4(t.matrixWorld)}getLookAtWorldQuaternion(e){return sc(this.humanoid.getRawBoneNode(`head`),e)}getFaceFrontQuaternion(e){if(this.faceFront.distanceToSquared(uc)<.01)return e.copy(this._restHeadWorldQuaternion).invert();let[t,n]=cc(this.faceFront);return vc.set(0,.5*Math.PI+t,n,`YZX`),e.setFromEuler(vc).premultiply(_c.copy(this._restHeadWorldQuaternion).invert())}getLookAtWorldDirection(e){return this.getLookAtWorldQuaternion(hc),this.getFaceFrontQuaternion(gc),e.copy(uc).applyQuaternion(hc).applyQuaternion(gc).applyEuler(this.getEuler(vc))}lookAt(e){let t=mc.copy(this._restHeadWorldQuaternion).multiply(Is(this.getLookAtWorldQuaternion(hc))),n=this.getLookAtWorldPosition(fc),r=pc.copy(e).sub(n).applyQuaternion(t).normalize(),[i,a]=cc(this.faceFront),[o,s]=cc(r),c=lc(o-i),l=lc(a-s);this._yaw=I.RAD2DEG*c,this._pitch=I.RAD2DEG*l,this._needsUpdate=!0}update(e){this.target!=null&&this.autoUpdate&&this.lookAt(this.target.getWorldPosition(dc)),this._needsUpdate&&(this._needsUpdate=!1,this.applier.applyYawPitch(this._yaw,this._pitch))}};yc.EULER_ORDER=`YXZ`;var bc=yc,xc=new F(0,0,1),Sc=new R,Cc=new R,wc=new Se(0,0,0,`YXZ`),Tc=class{constructor(e,t,n,r,i){this.humanoid=e,this.rangeMapHorizontalInner=t,this.rangeMapHorizontalOuter=n,this.rangeMapVerticalDown=r,this.rangeMapVerticalUp=i,this.faceFront=new F(0,0,1),this._restQuatLeftEye=new R,this._restQuatRightEye=new R,this._restLeftEyeParentWorldQuat=new R,this._restRightEyeParentWorldQuat=new R;let a=this.humanoid.getRawBoneNode(`leftEye`),o=this.humanoid.getRawBoneNode(`rightEye`);a&&(this._restQuatLeftEye.copy(a.quaternion),sc(a.parent,this._restLeftEyeParentWorldQuat)),o&&(this._restQuatRightEye.copy(o.quaternion),sc(o.parent,this._restRightEyeParentWorldQuat))}applyYawPitch(e,t){let n=this.humanoid.getRawBoneNode(`leftEye`),r=this.humanoid.getRawBoneNode(`rightEye`),i=this.humanoid.getNormalizedBoneNode(`leftEye`),a=this.humanoid.getNormalizedBoneNode(`rightEye`);n&&(t<0?wc.x=-I.DEG2RAD*this.rangeMapVerticalDown.map(-t):wc.x=I.DEG2RAD*this.rangeMapVerticalUp.map(t),e<0?wc.y=-I.DEG2RAD*this.rangeMapHorizontalInner.map(-e):wc.y=I.DEG2RAD*this.rangeMapHorizontalOuter.map(e),Sc.setFromEuler(wc),this._getWorldFaceFrontQuat(Cc),i.quaternion.copy(Cc).multiply(Sc).multiply(Cc.invert()),Sc.copy(this._restLeftEyeParentWorldQuat),n.quaternion.copy(i.quaternion).multiply(Sc).premultiply(Sc.invert()).multiply(this._restQuatLeftEye)),r&&(t<0?wc.x=-I.DEG2RAD*this.rangeMapVerticalDown.map(-t):wc.x=I.DEG2RAD*this.rangeMapVerticalUp.map(t),e<0?wc.y=-I.DEG2RAD*this.rangeMapHorizontalOuter.map(-e):wc.y=I.DEG2RAD*this.rangeMapHorizontalInner.map(e),Sc.setFromEuler(wc),this._getWorldFaceFrontQuat(Cc),a.quaternion.copy(Cc).multiply(Sc).multiply(Cc.invert()),Sc.copy(this._restRightEyeParentWorldQuat),r.quaternion.copy(a.quaternion).multiply(Sc).premultiply(Sc.invert()).multiply(this._restQuatRightEye))}lookAt(e){console.warn(`VRMLookAtBoneApplier: lookAt() is deprecated. use apply() instead.`);let t=I.RAD2DEG*e.y,n=I.RAD2DEG*e.x;this.applyYawPitch(t,n)}_getWorldFaceFrontQuat(e){if(this.faceFront.distanceToSquared(xc)<.01)return e.identity();let[t,n]=cc(this.faceFront);return wc.set(0,.5*Math.PI+t,n,`YZX`),e.setFromEuler(wc)}};Tc.type=`bone`;var Ec=class{constructor(e,t,n,r,i){this.expressions=e,this.rangeMapHorizontalInner=t,this.rangeMapHorizontalOuter=n,this.rangeMapVerticalDown=r,this.rangeMapVerticalUp=i}applyYawPitch(e,t){t<0?(this.expressions.setValue(`lookDown`,0),this.expressions.setValue(`lookUp`,this.rangeMapVerticalUp.map(-t))):(this.expressions.setValue(`lookUp`,0),this.expressions.setValue(`lookDown`,this.rangeMapVerticalDown.map(t))),e<0?(this.expressions.setValue(`lookLeft`,0),this.expressions.setValue(`lookRight`,this.rangeMapHorizontalOuter.map(-e))):(this.expressions.setValue(`lookRight`,0),this.expressions.setValue(`lookLeft`,this.rangeMapHorizontalOuter.map(e)))}lookAt(e){console.warn(`VRMLookAtBoneApplier: lookAt() is deprecated. use apply() instead.`);let t=I.RAD2DEG*e.y,n=I.RAD2DEG*e.x;this.applyYawPitch(t,n)}};Ec.type=`expression`;var Dc=class{constructor(e,t){this.inputMaxValue=e,this.outputScale=t}map(e){return this.outputScale*fs(e/this.inputMaxValue)}},Oc=new Set([`1.0`,`1.0-beta`]),kc=.01,Ac=class{get name(){return`VRMLookAtLoaderPlugin`}constructor(e,t){this.parser=e,this.helperRoot=t?.helperRoot}afterRoot(e){return Z(this,null,function*(){let t=e.userData.vrmHumanoid;if(t===null)return;if(t===void 0)throw Error(`VRMLookAtLoaderPlugin: vrmHumanoid is undefined. VRMHumanoidLoaderPlugin have to be used first`);let n=e.userData.vrmExpressionManager;if(n!==null){if(n===void 0)throw Error(`VRMLookAtLoaderPlugin: vrmExpressionManager is undefined. VRMExpressionLoaderPlugin have to be used first`);e.userData.vrmLookAt=yield this._import(e,t,n)}})}_import(e,t,n){return Z(this,null,function*(){return t==null||n==null?null:(yield this._v1Import(e,t,n))||(yield this._v0Import(e,t,n))||null})}_v1Import(e,t,n){return Z(this,null,function*(){let e=this.parser.json;if(e.extensionsUsed?.indexOf(`VRMC_vrm`)===-1)return null;let r=e.extensions?.VRMC_vrm;if(!r)return null;let i=r.specVersion;if(!Oc.has(i))return console.warn(`VRMLookAtLoaderPlugin: Unknown VRMC_vrm specVersion "${i}"`),null;let a=r.lookAt;if(!a)return null;let o=a.type===`expression`?1:10,s=this._v1ImportRangeMap(a.rangeMapHorizontalInner,o),c=this._v1ImportRangeMap(a.rangeMapHorizontalOuter,o),l=this._v1ImportRangeMap(a.rangeMapVerticalDown,o),u=this._v1ImportRangeMap(a.rangeMapVerticalUp,o),d;d=a.type===`expression`?new Ec(n,s,c,l,u):new Tc(t,s,c,l,u);let f=this._importLookAt(t,d);return f.offsetFromHeadBone.fromArray(a.offsetFromHeadBone??[0,.06,0]),f})}_v1ImportRangeMap(e,t){let n=e?.inputMaxValue??90,r=e?.outputScale??t;return n(console.error(e),console.warn(`VRMMetaLoaderPlugin: Failed to load a thumbnail image`),null))})}},Pc=class{constructor(e){this.scene=e.scene,this.meta=e.meta,this.humanoid=e.humanoid,this.expressionManager=e.expressionManager,this.firstPerson=e.firstPerson,this.lookAt=e.lookAt}update(e){this.humanoid.update(),this.lookAt&&this.lookAt.update(e),this.expressionManager&&this.expressionManager.update()}},Fc=class extends Pc{constructor(e){super(e),this.materials=e.materials,this.springBoneManager=e.springBoneManager,this.nodeConstraintManager=e.nodeConstraintManager}update(e){super.update(e),this.nodeConstraintManager&&this.nodeConstraintManager.update(),this.springBoneManager&&this.springBoneManager.update(e),this.materials&&this.materials.forEach(t=>{t.update&&t.update(e)})}},Ic=Object.defineProperty,Lc=Object.getOwnPropertySymbols,Rc=Object.prototype.hasOwnProperty,zc=Object.prototype.propertyIsEnumerable,Bc=(e,t,n)=>t in e?Ic(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Vc=(e,t)=>{for(var n in t||={})Rc.call(t,n)&&Bc(e,n,t[n]);if(Lc)for(var n of Lc(t))zc.call(t,n)&&Bc(e,n,t[n]);return e},Hc=(e,t,n)=>new Promise((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())});function Uc(e,t){e.colorSpace=t}var Wc=class{get pending(){return Promise.all(this._pendings)}constructor(e,t){this._parser=e,this._materialParams=t,this._pendings=[]}assignPrimitive(e,t){t!=null&&(this._materialParams[e]=t)}assignColor(e,t,n){if(t!=null){let r=new H().fromArray(t);n&&r.convertSRGBToLinear(),this._materialParams[e]=r}}assignTexture(e,t,n){return Hc(this,null,function*(){let r=(()=>Hc(this,null,function*(){t!=null&&(yield this._parser.assignTexture(this._materialParams,e,t),n&&Uc(this._materialParams[e],`srgb`))}))();return this._pendings.push(r),r})}assignTextureByIndex(e,t,n){return Hc(this,null,function*(){return this.assignTexture(e,t==null?void 0:{index:t},n)})}},Gc=`// #define PHONG varying vec3 vViewPosition; @@ -2893,7 +2893,7 @@ void main() { } `,qc={None:`none`,Normal:`normal`,LitShadeRate:`litShadeRate`,UV:`uv`},Jc={None:`none`,WorldCoordinates:`worldCoordinates`,ScreenCoordinates:`screenCoordinates`};function Yc(e){return e.colorSpace}var Xc=class extends Jt{constructor(e={}){super({vertexShader:Gc,fragmentShader:Kc}),this.uvAnimationScrollXSpeedFactor=0,this.uvAnimationScrollYSpeedFactor=0,this.uvAnimationRotationSpeedFactor=0,this.fog=!0,this.normalMapType=0,this._ignoreVertexColor=!0,this._v0CompatShade=!1,this._debugMode=qc.None,this._outlineWidthMode=Jc.None,this._isOutline=!1,e.transparentWithZWrite&&(e.depthWrite=!0),delete e.transparentWithZWrite,e.fog=!0,e.lights=!0,e.clipping=!0,this.uniforms=at.merge([tt.common,tt.normalmap,tt.emissivemap,tt.fog,tt.lights,{litFactor:{value:new H(1,1,1)},mapUvTransform:{value:new bt},colorAlpha:{value:1},normalMapUvTransform:{value:new bt},shadeColorFactor:{value:new H(0,0,0)},shadeMultiplyTexture:{value:null},shadeMultiplyTextureUvTransform:{value:new bt},shadingShiftFactor:{value:0},shadingShiftTexture:{value:null},shadingShiftTextureUvTransform:{value:new bt},shadingShiftTextureScale:{value:1},shadingToonyFactor:{value:.9},giEqualizationFactor:{value:.9},matcapFactor:{value:new H(1,1,1)},matcapTexture:{value:null},matcapTextureUvTransform:{value:new bt},parametricRimColorFactor:{value:new H(0,0,0)},rimMultiplyTexture:{value:null},rimMultiplyTextureUvTransform:{value:new bt},rimLightingMixFactor:{value:1},parametricRimFresnelPowerFactor:{value:5},parametricRimLiftFactor:{value:0},emissive:{value:new H(0,0,0)},emissiveIntensity:{value:1},emissiveMapUvTransform:{value:new bt},outlineWidthMultiplyTexture:{value:null},outlineWidthMultiplyTextureUvTransform:{value:new bt},outlineWidthFactor:{value:0},outlineColorFactor:{value:new H(0,0,0)},outlineLightingMixFactor:{value:1},uvAnimationMaskTexture:{value:null},uvAnimationMaskTextureUvTransform:{value:new bt},uvAnimationScrollXOffset:{value:0},uvAnimationScrollYOffset:{value:0},uvAnimationRotationPhase:{value:0}},e.uniforms??{}]),this.setValues(e),this._uploadUniformsWorkaround(),this.customProgramCacheKey=()=>[...Object.entries(this._generateDefines()).map(([e,t])=>`${e}:${t}`),this.matcapTexture?`matcapTextureColorSpace:${Yc(this.matcapTexture)}`:``,this.shadeMultiplyTexture?`shadeMultiplyTextureColorSpace:${Yc(this.shadeMultiplyTexture)}`:``,this.rimMultiplyTexture?`rimMultiplyTextureColorSpace:${Yc(this.rimMultiplyTexture)}`:``].join(`,`),this.onBeforeCompile=e=>{let t=Object.entries(Vc(Vc({},this._generateDefines()),this.defines)).filter(([e,t])=>!!t).map(([e,t])=>`#define ${e} ${t}`).join(` `)+` -`;e.vertexShader=t+e.vertexShader,e.fragmentShader=t+e.fragmentShader}}get color(){return this.uniforms.litFactor.value}set color(e){this.uniforms.litFactor.value=e}get map(){return this.uniforms.map.value}set map(e){this.uniforms.map.value=e}get normalMap(){return this.uniforms.normalMap.value}set normalMap(e){this.uniforms.normalMap.value=e}get normalScale(){return this.uniforms.normalScale.value}set normalScale(e){this.uniforms.normalScale.value=e}get emissive(){return this.uniforms.emissive.value}set emissive(e){this.uniforms.emissive.value=e}get emissiveIntensity(){return this.uniforms.emissiveIntensity.value}set emissiveIntensity(e){this.uniforms.emissiveIntensity.value=e}get emissiveMap(){return this.uniforms.emissiveMap.value}set emissiveMap(e){this.uniforms.emissiveMap.value=e}get shadeColorFactor(){return this.uniforms.shadeColorFactor.value}set shadeColorFactor(e){this.uniforms.shadeColorFactor.value=e}get shadeMultiplyTexture(){return this.uniforms.shadeMultiplyTexture.value}set shadeMultiplyTexture(e){this.uniforms.shadeMultiplyTexture.value=e}get shadingShiftFactor(){return this.uniforms.shadingShiftFactor.value}set shadingShiftFactor(e){this.uniforms.shadingShiftFactor.value=e}get shadingShiftTexture(){return this.uniforms.shadingShiftTexture.value}set shadingShiftTexture(e){this.uniforms.shadingShiftTexture.value=e}get shadingShiftTextureScale(){return this.uniforms.shadingShiftTextureScale.value}set shadingShiftTextureScale(e){this.uniforms.shadingShiftTextureScale.value=e}get shadingToonyFactor(){return this.uniforms.shadingToonyFactor.value}set shadingToonyFactor(e){this.uniforms.shadingToonyFactor.value=e}get giEqualizationFactor(){return this.uniforms.giEqualizationFactor.value}set giEqualizationFactor(e){this.uniforms.giEqualizationFactor.value=e}get matcapFactor(){return this.uniforms.matcapFactor.value}set matcapFactor(e){this.uniforms.matcapFactor.value=e}get matcapTexture(){return this.uniforms.matcapTexture.value}set matcapTexture(e){this.uniforms.matcapTexture.value=e}get parametricRimColorFactor(){return this.uniforms.parametricRimColorFactor.value}set parametricRimColorFactor(e){this.uniforms.parametricRimColorFactor.value=e}get rimMultiplyTexture(){return this.uniforms.rimMultiplyTexture.value}set rimMultiplyTexture(e){this.uniforms.rimMultiplyTexture.value=e}get rimLightingMixFactor(){return this.uniforms.rimLightingMixFactor.value}set rimLightingMixFactor(e){this.uniforms.rimLightingMixFactor.value=e}get parametricRimFresnelPowerFactor(){return this.uniforms.parametricRimFresnelPowerFactor.value}set parametricRimFresnelPowerFactor(e){this.uniforms.parametricRimFresnelPowerFactor.value=e}get parametricRimLiftFactor(){return this.uniforms.parametricRimLiftFactor.value}set parametricRimLiftFactor(e){this.uniforms.parametricRimLiftFactor.value=e}get outlineWidthMultiplyTexture(){return this.uniforms.outlineWidthMultiplyTexture.value}set outlineWidthMultiplyTexture(e){this.uniforms.outlineWidthMultiplyTexture.value=e}get outlineWidthFactor(){return this.uniforms.outlineWidthFactor.value}set outlineWidthFactor(e){this.uniforms.outlineWidthFactor.value=e}get outlineColorFactor(){return this.uniforms.outlineColorFactor.value}set outlineColorFactor(e){this.uniforms.outlineColorFactor.value=e}get outlineLightingMixFactor(){return this.uniforms.outlineLightingMixFactor.value}set outlineLightingMixFactor(e){this.uniforms.outlineLightingMixFactor.value=e}get uvAnimationMaskTexture(){return this.uniforms.uvAnimationMaskTexture.value}set uvAnimationMaskTexture(e){this.uniforms.uvAnimationMaskTexture.value=e}get uvAnimationScrollXOffset(){return this.uniforms.uvAnimationScrollXOffset.value}set uvAnimationScrollXOffset(e){this.uniforms.uvAnimationScrollXOffset.value=e}get uvAnimationScrollYOffset(){return this.uniforms.uvAnimationScrollYOffset.value}set uvAnimationScrollYOffset(e){this.uniforms.uvAnimationScrollYOffset.value=e}get uvAnimationRotationPhase(){return this.uniforms.uvAnimationRotationPhase.value}set uvAnimationRotationPhase(e){this.uniforms.uvAnimationRotationPhase.value=e}get ignoreVertexColor(){return this._ignoreVertexColor}set ignoreVertexColor(e){this._ignoreVertexColor=e,this.needsUpdate=!0}get v0CompatShade(){return this._v0CompatShade}set v0CompatShade(e){this._v0CompatShade=e,this.needsUpdate=!0}get debugMode(){return this._debugMode}set debugMode(e){this._debugMode=e,this.needsUpdate=!0}get outlineWidthMode(){return this._outlineWidthMode}set outlineWidthMode(e){this._outlineWidthMode=e,this.needsUpdate=!0}get isOutline(){return this._isOutline}set isOutline(e){this._isOutline=e,this.needsUpdate=!0}get isMToonMaterial(){return!0}update(e){this._uploadUniformsWorkaround(),this._updateUVAnimation(e)}copy(e){return super.copy(e),this.map=e.map,this.normalMap=e.normalMap,this.emissiveMap=e.emissiveMap,this.shadeMultiplyTexture=e.shadeMultiplyTexture,this.shadingShiftTexture=e.shadingShiftTexture,this.matcapTexture=e.matcapTexture,this.rimMultiplyTexture=e.rimMultiplyTexture,this.outlineWidthMultiplyTexture=e.outlineWidthMultiplyTexture,this.uvAnimationMaskTexture=e.uvAnimationMaskTexture,this.normalMapType=e.normalMapType,this.uvAnimationScrollXSpeedFactor=e.uvAnimationScrollXSpeedFactor,this.uvAnimationScrollYSpeedFactor=e.uvAnimationScrollYSpeedFactor,this.uvAnimationRotationSpeedFactor=e.uvAnimationRotationSpeedFactor,this.ignoreVertexColor=e.ignoreVertexColor,this.v0CompatShade=e.v0CompatShade,this.debugMode=e.debugMode,this.outlineWidthMode=e.outlineWidthMode,this.isOutline=e.isOutline,this.needsUpdate=!0,this}_updateUVAnimation(e){this.uniforms.uvAnimationScrollXOffset.value+=e*this.uvAnimationScrollXSpeedFactor,this.uniforms.uvAnimationScrollYOffset.value+=e*this.uvAnimationScrollYSpeedFactor,this.uniforms.uvAnimationRotationPhase.value+=e*this.uvAnimationRotationSpeedFactor,this.uniforms.alphaTest.value=this.alphaTest,this.uniformsNeedUpdate=!0}_uploadUniformsWorkaround(){this.uniforms.opacity.value=this.opacity,this._updateTextureMatrix(this.uniforms.map,this.uniforms.mapUvTransform),this._updateTextureMatrix(this.uniforms.normalMap,this.uniforms.normalMapUvTransform),this._updateTextureMatrix(this.uniforms.emissiveMap,this.uniforms.emissiveMapUvTransform),this._updateTextureMatrix(this.uniforms.shadeMultiplyTexture,this.uniforms.shadeMultiplyTextureUvTransform),this._updateTextureMatrix(this.uniforms.shadingShiftTexture,this.uniforms.shadingShiftTextureUvTransform),this._updateTextureMatrix(this.uniforms.matcapTexture,this.uniforms.matcapTextureUvTransform),this._updateTextureMatrix(this.uniforms.rimMultiplyTexture,this.uniforms.rimMultiplyTextureUvTransform),this._updateTextureMatrix(this.uniforms.outlineWidthMultiplyTexture,this.uniforms.outlineWidthMultiplyTextureUvTransform),this._updateTextureMatrix(this.uniforms.uvAnimationMaskTexture,this.uniforms.uvAnimationMaskTextureUvTransform),this.uniformsNeedUpdate=!0}_generateDefines(){let e=this.outlineWidthMultiplyTexture!==null,t=this.map!==null||this.normalMap!==null||this.emissiveMap!==null||this.shadeMultiplyTexture!==null||this.shadingShiftTexture!==null||this.rimMultiplyTexture!==null||this.uvAnimationMaskTexture!==null;return{THREE_VRM_THREE_REVISION:181,OUTLINE:this._isOutline,MTOON_USE_UV:e||t,MTOON_UVS_VERTEX_ONLY:e&&!t,V0_COMPAT_SHADE:this._v0CompatShade,USE_SHADEMULTIPLYTEXTURE:this.shadeMultiplyTexture!==null,USE_SHADINGSHIFTTEXTURE:this.shadingShiftTexture!==null,USE_MATCAPTEXTURE:this.matcapTexture!==null,USE_RIMMULTIPLYTEXTURE:this.rimMultiplyTexture!==null,USE_OUTLINEWIDTHMULTIPLYTEXTURE:this._isOutline&&this.outlineWidthMultiplyTexture!==null,USE_UVANIMATIONMASKTEXTURE:this.uvAnimationMaskTexture!==null,IGNORE_VERTEX_COLOR:this._ignoreVertexColor===!0,DEBUG_NORMAL:this._debugMode===`normal`,DEBUG_LITSHADERATE:this._debugMode===`litShadeRate`,DEBUG_UV:this._debugMode===`uv`,OUTLINE_WIDTH_SCREEN:this._isOutline&&this._outlineWidthMode===Jc.ScreenCoordinates}}_updateTextureMatrix(e,t){e.value&&(e.value.matrixAutoUpdate&&e.value.updateMatrix(),t.value.copy(e.value.matrix))}},Zc=new Set([`1.0`,`1.0-beta`]),Qc=class e{get name(){return e.EXTENSION_NAME}constructor(e,t={}){this.parser=e,this.materialType=t.materialType??Xc,this.renderOrderOffset=t.renderOrderOffset??0,this.v0CompatShade=t.v0CompatShade??!1,this.debugMode=t.debugMode??`none`,this._mToonMaterialSet=new Set}beforeRoot(){return Hc(this,null,function*(){this._removeUnlitExtensionIfMToonExists()})}afterRoot(e){return Hc(this,null,function*(){e.userData.vrmMToonMaterials=Array.from(this._mToonMaterialSet)})}getMaterialType(e){return this._getMToonExtension(e)?this.materialType:null}extendMaterialParams(e,t){let n=this._getMToonExtension(e);return n?this._extendMaterialParams(n,t):null}loadMesh(e){return Hc(this,null,function*(){let t=this.parser,n=t.json.meshes?.[e];if(n==null)throw Error(`MToonMaterialLoaderPlugin: Attempt to use meshes[${e}] of glTF but the mesh doesn't exist`);let r=n.primitives,i=yield t.loadMesh(e);if(r.length===1){let e=i,t=r[0].material;t!=null&&this._setupPrimitive(e,t)}else{let e=i;for(let t=0;t{this._getMToonExtension(t)&&e.extensions?.KHR_materials_unlit&&delete e.extensions.KHR_materials_unlit})}_getMToonExtension(t){let n=this.parser.json.materials?.[t];if(n==null){console.warn(`MToonMaterialLoaderPlugin: Attempt to use materials[${t}] of glTF but the material doesn't exist`);return}let r=n.extensions?.[e.EXTENSION_NAME];if(r==null)return;let i=r.specVersion;if(!Zc.has(i)){console.warn(`MToonMaterialLoaderPlugin: Unknown ${e.EXTENSION_NAME} specVersion "${i}"`);return}return r}_extendMaterialParams(e,t){return Hc(this,null,function*(){delete t.metalness,delete t.roughness;let n=new Wc(this.parser,t);n.assignPrimitive(`transparentWithZWrite`,e.transparentWithZWrite),n.assignColor(`shadeColorFactor`,e.shadeColorFactor),n.assignTexture(`shadeMultiplyTexture`,e.shadeMultiplyTexture,!0),n.assignPrimitive(`shadingShiftFactor`,e.shadingShiftFactor),n.assignTexture(`shadingShiftTexture`,e.shadingShiftTexture,!0),n.assignPrimitive(`shadingShiftTextureScale`,e.shadingShiftTexture?.scale),n.assignPrimitive(`shadingToonyFactor`,e.shadingToonyFactor),n.assignPrimitive(`giEqualizationFactor`,e.giEqualizationFactor),n.assignColor(`matcapFactor`,e.matcapFactor),n.assignTexture(`matcapTexture`,e.matcapTexture,!0),n.assignColor(`parametricRimColorFactor`,e.parametricRimColorFactor),n.assignTexture(`rimMultiplyTexture`,e.rimMultiplyTexture,!0),n.assignPrimitive(`rimLightingMixFactor`,e.rimLightingMixFactor),n.assignPrimitive(`parametricRimFresnelPowerFactor`,e.parametricRimFresnelPowerFactor),n.assignPrimitive(`parametricRimLiftFactor`,e.parametricRimLiftFactor),n.assignPrimitive(`outlineWidthMode`,e.outlineWidthMode),n.assignPrimitive(`outlineWidthFactor`,e.outlineWidthFactor),n.assignTexture(`outlineWidthMultiplyTexture`,e.outlineWidthMultiplyTexture,!1),n.assignColor(`outlineColorFactor`,e.outlineColorFactor),n.assignPrimitive(`outlineLightingMixFactor`,e.outlineLightingMixFactor),n.assignTexture(`uvAnimationMaskTexture`,e.uvAnimationMaskTexture,!1),n.assignPrimitive(`uvAnimationScrollXSpeedFactor`,e.uvAnimationScrollXSpeedFactor),n.assignPrimitive(`uvAnimationScrollYSpeedFactor`,e.uvAnimationScrollYSpeedFactor),n.assignPrimitive(`uvAnimationRotationSpeedFactor`,e.uvAnimationRotationSpeedFactor),n.assignPrimitive(`v0CompatShade`,this.v0CompatShade),n.assignPrimitive(`debugMode`,this.debugMode),yield n.pending})}_setupPrimitive(e,t){let n=this._getMToonExtension(t);if(n){e.renderOrder=this._parseRenderOrder(n)+this.renderOrderOffset,this._generateOutline(e),this._addToMaterialSet(e);return}}_shouldGenerateOutline(e){return typeof e.outlineWidthMode==`string`&&e.outlineWidthMode!==`none`&&typeof e.outlineWidthFactor==`number`&&e.outlineWidthFactor>0}_generateOutline(e){let t=e.material;if(!(t instanceof It)||!this._shouldGenerateOutline(t))return;e.material=[t];let n=t.clone();n.name+=` (Outline)`,n.isOutline=!0,n.side=1,e.material.push(n);let r=e.geometry,i=r.index?r.index.count:r.attributes.position.count/3;r.addGroup(0,i,0),r.addGroup(0,i,1)}_addToMaterialSet(e){let t=e.material,n=new Set;Array.isArray(t)?t.forEach(e=>n.add(e)):n.add(t);for(let e of n)this._mToonMaterialSet.add(e)}_parseRenderOrder(e){return(e.transparentWithZWrite?0:19)+(e.renderQueueOffsetNumber??0)}};Qc.EXTENSION_NAME=`VRMC_materials_mtoon`;var $c=Qc,el=(e,t,n)=>new Promise((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())}),tl=class e{get name(){return e.EXTENSION_NAME}constructor(e){this.parser=e}extendMaterialParams(e,t){return el(this,null,function*(){let n=this._getHDREmissiveMultiplierExtension(e);n!=null&&(console.warn("VRMMaterialsHDREmissiveMultiplierLoaderPlugin: `VRMC_materials_hdr_emissiveMultiplier` is archived. Use `KHR_materials_emissive_strength` instead."),t.emissiveIntensity=n.emissiveMultiplier)})}_getHDREmissiveMultiplierExtension(t){let n=this.parser.json.materials?.[t];if(n==null){console.warn(`VRMMaterialsHDREmissiveMultiplierLoaderPlugin: Attempt to use materials[${t}] of glTF but the material doesn't exist`);return}let r=n.extensions?.[e.EXTENSION_NAME];if(r!=null)return r}};tl.EXTENSION_NAME=`VRMC_materials_hdr_emissiveMultiplier`;var nl=tl,rl=Object.defineProperty,il=Object.defineProperties,al=Object.getOwnPropertyDescriptors,ol=Object.getOwnPropertySymbols,sl=Object.prototype.hasOwnProperty,cl=Object.prototype.propertyIsEnumerable,ll=(e,t,n)=>t in e?rl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ul=(e,t)=>{for(var n in t||={})sl.call(t,n)&&ll(e,n,t[n]);if(ol)for(var n of ol(t))cl.call(t,n)&&ll(e,n,t[n]);return e},dl=(e,t)=>il(e,al(t)),fl=(e,t,n)=>new Promise((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())});function pl(e){return e**2.2}var ml=class{get name(){return`VRMMaterialsV0CompatPlugin`}constructor(e){this.parser=e,this._renderQueueMapTransparent=new Map,this._renderQueueMapTransparentZWrite=new Map;let t=this.parser.json;t.extensionsUsed=t.extensionsUsed??[],t.extensionsUsed.indexOf(`KHR_texture_transform`)===-1&&t.extensionsUsed.push(`KHR_texture_transform`)}beforeRoot(){return fl(this,null,function*(){let e=this.parser.json,t=e.extensions?.VRM?.materialProperties;t&&(this._populateRenderQueueMap(t),t.forEach((t,n)=>{let r=e.materials?.[n];if(r==null){console.warn(`VRMMaterialsV0CompatPlugin: Attempt to use materials[${n}] of glTF but the material doesn't exist`);return}if(t.shader===`VRM/MToon`){let i=this._parseV0MToonProperties(t,r);e.materials[n]=i}else if(t.shader?.startsWith(`VRM/Unlit`)){let i=this._parseV0UnlitProperties(t,r);e.materials[n]=i}else t.shader===`VRM_USE_GLTFSHADER`||console.warn(`VRMMaterialsV0CompatPlugin: Unknown shader: ${t.shader}`)}))})}_parseV0MToonProperties(e,t){let n=e.keywordMap?._ALPHABLEND_ON??!1,r=e.floatProperties?._ZWrite===1&&n,i=this._v0ParseRenderQueue(e),a=e.keywordMap?._ALPHATEST_ON??!1,o=n?`BLEND`:a?`MASK`:`OPAQUE`,s=a?e.floatProperties?._Cutoff??.5:void 0,c=(e.floatProperties?._CullMode??2)===0,l=this._portTextureTransform(e),u=(e.vectorProperties?._Color??[1,1,1,1]).map((e,t)=>t===3?e:pl(e)),d=e.textureProperties?._MainTex,f=d==null?void 0:{index:d,extensions:ul({},l)},p=e.floatProperties?._BumpScale??1,m=e.textureProperties?._BumpMap,h=m==null?void 0:{index:m,scale:p,extensions:ul({},l)},g=(e.vectorProperties?._EmissionColor??[0,0,0,1]).map(pl),_=e.textureProperties?._EmissionMap,v=_==null?void 0:{index:_,extensions:ul({},l)},y=(e.vectorProperties?._ShadeColor??[.97,.81,.86,1]).map(pl),b=e.textureProperties?._ShadeTexture,x=b==null?void 0:{index:b,extensions:ul({},l)},S=e.floatProperties?._ShadeShift??0,ee=e.floatProperties?._ShadeToony??.9;ee=I.lerp(ee,1,.5+.5*S),S=-S-(1-ee);let te=e.floatProperties?._IndirectLightIntensity??.1,ne=te?1-te:void 0,re=e.textureProperties?._SphereAdd,C=re==null?void 0:[1,1,1],ie=re==null?void 0:{index:re},w=e.floatProperties?._RimLightingMix??0,T=e.textureProperties?._RimTexture,E=T==null?void 0:{index:T,extensions:ul({},l)},D=(e.vectorProperties?._RimColor??[0,0,0,1]).map(pl),ae=e.floatProperties?._RimFresnelPower??1,oe=e.floatProperties?._RimLift??0,O=[`none`,`worldCoordinates`,`screenCoordinates`][e.floatProperties?._OutlineWidthMode??0],se=e.floatProperties?._OutlineWidth??0;se=.01*se;let k=e.textureProperties?._OutlineWidthTexture,ce=k==null?void 0:{index:k,extensions:ul({},l)},le=(e.vectorProperties?._OutlineColor??[0,0,0]).map(pl),ue=(e.floatProperties?._OutlineColorMode??0)===1?e.floatProperties?._OutlineLightingMix??1:0,A=e.textureProperties?._UvAnimMaskTexture,de=A==null?void 0:{index:A,extensions:ul({},l)},fe=e.floatProperties?._UvAnimScrollX??0,j=e.floatProperties?._UvAnimScrollY??0;j!=null&&(j=-j);let pe=e.floatProperties?._UvAnimRotation??0,me={specVersion:`1.0`,transparentWithZWrite:r,renderQueueOffsetNumber:i,shadeColorFactor:y,shadeMultiplyTexture:x,shadingShiftFactor:S,shadingToonyFactor:ee,giEqualizationFactor:ne,matcapFactor:C,matcapTexture:ie,rimLightingMixFactor:w,rimMultiplyTexture:E,parametricRimColorFactor:D,parametricRimFresnelPowerFactor:ae,parametricRimLiftFactor:oe,outlineWidthMode:O,outlineWidthFactor:se,outlineWidthMultiplyTexture:ce,outlineColorFactor:le,outlineLightingMixFactor:ue,uvAnimationMaskTexture:de,uvAnimationScrollXSpeedFactor:fe,uvAnimationScrollYSpeedFactor:j,uvAnimationRotationSpeedFactor:pe};return dl(ul({},t),{pbrMetallicRoughness:{baseColorFactor:u,baseColorTexture:f},normalTexture:h,emissiveTexture:v,emissiveFactor:g,alphaMode:o,alphaCutoff:s,doubleSided:c,extensions:{VRMC_materials_mtoon:me}})}_parseV0UnlitProperties(e,t){let n=e.shader===`VRM/UnlitTransparentZWrite`,r=e.shader===`VRM/UnlitTransparent`||n,i=this._v0ParseRenderQueue(e),a=e.shader===`VRM/UnlitCutout`,o=r?`BLEND`:a?`MASK`:`OPAQUE`,s=a?e.floatProperties?._Cutoff??.5:void 0,c=this._portTextureTransform(e),l=(e.vectorProperties?._Color??[1,1,1,1]).map(pl),u=e.textureProperties?._MainTex,d=u==null?void 0:{index:u,extensions:ul({},c)},f={specVersion:`1.0`,transparentWithZWrite:n,renderQueueOffsetNumber:i,shadeColorFactor:l,shadeMultiplyTexture:d};return dl(ul({},t),{pbrMetallicRoughness:{baseColorFactor:l,baseColorTexture:d},alphaMode:o,alphaCutoff:s,extensions:{VRMC_materials_mtoon:f}})}_portTextureTransform(e){let t=e.vectorProperties?._MainTex;if(t==null)return{};let n=[t?.[0]??0,t?.[1]??0],r=[t?.[2]??1,t?.[3]??1];return n[1]=1-r[1]-n[1],{KHR_texture_transform:{offset:n,scale:r}}}_v0ParseRenderQueue(e){let t=e.shader===`VRM/UnlitTransparentZWrite`,n=e.keywordMap?._ALPHABLEND_ON!=null||e.shader===`VRM/UnlitTransparent`||t,r=e.floatProperties?._ZWrite===1||t,i=0;if(n){let t=e.renderQueue;t!=null&&(i=r?this._renderQueueMapTransparentZWrite.get(t):this._renderQueueMapTransparent.get(t))}return i}_populateRenderQueueMap(e){let t=new Set,n=new Set;e.forEach(e=>{let r=e.shader===`VRM/UnlitTransparentZWrite`,i=e.keywordMap?._ALPHABLEND_ON!=null||e.shader===`VRM/UnlitTransparent`||r,a=e.floatProperties?._ZWrite===1||r;if(i){let r=e.renderQueue;r!=null&&(a?n.add(r):t.add(r))}}),t.size>10&&console.warn(`VRMMaterialsV0CompatPlugin: This VRM uses ${t.size} render queues for Transparent materials while VRM 1.0 only supports up to 10 render queues. The model might not be rendered correctly.`),n.size>10&&console.warn(`VRMMaterialsV0CompatPlugin: This VRM uses ${n.size} render queues for TransparentZWrite materials while VRM 1.0 only supports up to 10 render queues. The model might not be rendered correctly.`),Array.from(t).sort().forEach((e,n)=>{let r=Math.min(Math.max(n-t.size+1,-9),0);this._renderQueueMapTransparent.set(e,r)}),Array.from(n).sort().forEach((e,t)=>{let n=Math.min(Math.max(t,0),9);this._renderQueueMapTransparentZWrite.set(e,n)})}},hl=(e,t,n)=>new Promise((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())}),gl=new F,_l=class extends je{constructor(e){super(),this._attrPosition=new V(new Float32Array([0,0,0,0,0,0]),3),this._attrPosition.setUsage(D);let t=new Gt;t.setAttribute(`position`,this._attrPosition),this._line=new Ue(t,new qe({color:16711935,depthTest:!1,depthWrite:!1})),this.add(this._line),this.constraint=e}updateMatrixWorld(e){gl.setFromMatrixPosition(this.constraint.destination.matrixWorld),this._attrPosition.setXYZ(0,gl.x,gl.y,gl.z),this.constraint.source&&gl.setFromMatrixPosition(this.constraint.source.matrixWorld),this._attrPosition.setXYZ(1,gl.x,gl.y,gl.z),this._attrPosition.needsUpdate=!0,super.updateMatrixWorld(e)}};function vl(e,t){return t.set(e.elements[12],e.elements[13],e.elements[14])}var yl=new F,bl=new F;function xl(e,t){return e.decompose(yl,t,bl),t}function Sl(e){return e.invert?e.invert():e.inverse(),e}var Cl=class{constructor(e,t){this.destination=e,this.source=t,this.weight=1}},wl=new F,Tl=new F,El=new F,Dl=new R,Ol=new R,kl=new R,Al=class extends Cl{get aimAxis(){return this._aimAxis}set aimAxis(e){this._aimAxis=e,this._v3AimAxis.set(e===`PositiveX`?1:e===`NegativeX`?-1:0,e===`PositiveY`?1:e===`NegativeY`?-1:0,e===`PositiveZ`?1:e===`NegativeZ`?-1:0)}get dependencies(){let e=new Set([this.source]);return this.destination.parent&&e.add(this.destination.parent),e}constructor(e,t){super(e,t),this._aimAxis=`PositiveX`,this._v3AimAxis=new F(1,0,0),this._dstRestQuat=new R}setInitState(){this._dstRestQuat.copy(this.destination.quaternion)}update(){this.destination.updateWorldMatrix(!0,!1),this.source.updateWorldMatrix(!0,!1);let e=Dl.identity(),t=Ol.identity();this.destination.parent&&(xl(this.destination.parent.matrixWorld,e),Sl(t.copy(e)));let n=wl.copy(this._v3AimAxis).applyQuaternion(this._dstRestQuat).applyQuaternion(e),r=vl(this.source.matrixWorld,Tl).sub(vl(this.destination.matrixWorld,El)).normalize(),i=kl.setFromUnitVectors(n,r).premultiply(t).multiply(e).multiply(this._dstRestQuat);this.destination.quaternion.copy(this._dstRestQuat).slerp(i,this.weight)}};function jl(e,t){let n=[e],r=e.parent;for(;r!==null;)n.unshift(r),r=r.parent;n.forEach(e=>{t(e)})}var Ml=class{constructor(){this._constraints=new Set,this._objectConstraintsMap=new Map}get constraints(){return this._constraints}addConstraint(e){this._constraints.add(e);let t=this._objectConstraintsMap.get(e.destination);t??(t=new Set,this._objectConstraintsMap.set(e.destination,t)),t.add(e)}deleteConstraint(e){this._constraints.delete(e),this._objectConstraintsMap.get(e.destination).delete(e)}setInitState(){let e=new Set,t=new Set;for(let n of this._constraints)this._processConstraint(n,e,t,e=>e.setInitState())}update(){let e=new Set,t=new Set;for(let n of this._constraints)this._processConstraint(n,e,t,e=>e.update())}_processConstraint(e,t,n,r){if(n.has(e))return;if(t.has(e))throw Error(`VRMNodeConstraintManager: Circular dependency detected while updating constraints`);t.add(e);let i=e.dependencies;for(let e of i)jl(e,e=>{let i=this._objectConstraintsMap.get(e);if(i)for(let e of i)this._processConstraint(e,t,n,r)});r(e),n.add(e)}},Nl=new R,Pl=new R,Fl=class extends Cl{get dependencies(){return new Set([this.source])}constructor(e,t){super(e,t),this._dstRestQuat=new R,this._invSrcRestQuat=new R}setInitState(){this._dstRestQuat.copy(this.destination.quaternion),Sl(this._invSrcRestQuat.copy(this.source.quaternion))}update(){let e=Nl.copy(this._invSrcRestQuat).multiply(this.source.quaternion),t=Pl.copy(this._dstRestQuat).multiply(e);this.destination.quaternion.copy(this._dstRestQuat).slerp(t,this.weight)}},Il=new F,Ll=new R,Rl=new R,zl=class extends Cl{get rollAxis(){return this._rollAxis}set rollAxis(e){this._rollAxis=e,this._v3RollAxis.set(e===`X`?1:0,e===`Y`?1:0,e===`Z`?1:0)}get dependencies(){return new Set([this.source])}constructor(e,t){super(e,t),this._rollAxis=`X`,this._v3RollAxis=new F(1,0,0),this._dstRestQuat=new R,this._invDstRestQuat=new R,this._invSrcRestQuatMulDstRestQuat=new R}setInitState(){this._dstRestQuat.copy(this.destination.quaternion),Sl(this._invDstRestQuat.copy(this._dstRestQuat)),Sl(this._invSrcRestQuatMulDstRestQuat.copy(this.source.quaternion)).multiply(this._dstRestQuat)}update(){let e=Ll.copy(this._invDstRestQuat).multiply(this.source.quaternion).multiply(this._invSrcRestQuatMulDstRestQuat),t=Il.copy(this._v3RollAxis).applyQuaternion(e),n=Rl.setFromUnitVectors(t,this._v3RollAxis).premultiply(this._dstRestQuat).multiply(e);this.destination.quaternion.copy(this._dstRestQuat).slerp(n,this.weight)}},Bl=new Set([`1.0`,`1.0-beta`]),Vl=class e{get name(){return e.EXTENSION_NAME}constructor(e,t){this.parser=e,this.helperRoot=t?.helperRoot}afterRoot(e){return hl(this,null,function*(){e.userData.vrmNodeConstraintManager=yield this._import(e)})}_import(t){return hl(this,null,function*(){let n=this.parser.json;if(n.extensionsUsed?.indexOf(e.EXTENSION_NAME)===-1)return null;let r=new Ml,i=yield this.parser.getDependencies(`node`);return i.forEach((t,a)=>{let o=n.nodes[a]?.extensions?.[e.EXTENSION_NAME];if(o==null)return;let s=o.specVersion;if(!Bl.has(s)){console.warn(`VRMNodeConstraintLoaderPlugin: Unknown ${e.EXTENSION_NAME} specVersion "${s}"`);return}let c=o.constraint;if(c.roll!=null){let e=this._importRollConstraint(t,i,c.roll);r.addConstraint(e)}else if(c.aim!=null){let e=this._importAimConstraint(t,i,c.aim);r.addConstraint(e)}else if(c.rotation!=null){let e=this._importRotationConstraint(t,i,c.rotation);r.addConstraint(e)}}),t.scene.updateMatrixWorld(),r.setInitState(),r})}_importRollConstraint(e,t,n){let{source:r,rollAxis:i,weight:a}=n,o=t[r],s=new zl(e,o);if(i!=null&&(s.rollAxis=i),a!=null&&(s.weight=a),this.helperRoot){let e=new _l(s);this.helperRoot.add(e)}return s}_importAimConstraint(e,t,n){let{source:r,aimAxis:i,weight:a}=n,o=t[r],s=new Al(e,o);if(i!=null&&(s.aimAxis=i),a!=null&&(s.weight=a),this.helperRoot){let e=new _l(s);this.helperRoot.add(e)}return s}_importRotationConstraint(e,t,n){let{source:r,weight:i}=n,a=t[r],o=new Fl(e,a);if(i!=null&&(o.weight=i),this.helperRoot){let e=new _l(o);this.helperRoot.add(e)}return o}};Vl.EXTENSION_NAME=`VRMC_node_constraint`;var Hl=Vl,Ul=(e,t,n)=>new Promise((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())}),Wl=class{},Gl=new F,Kl=new F,ql=class extends Wl{get type(){return`capsule`}constructor(e){super(),this.offset=e?.offset??new F(0,0,0),this.tail=e?.tail??new F(0,0,0),this.radius=e?.radius??0,this.inside=e?.inside??!1}calculateCollision(e,t,n,r){Gl.setFromMatrixPosition(e),Kl.subVectors(this.tail,this.offset).applyMatrix4(e),Kl.sub(Gl);let i=Kl.lengthSq();r.copy(t).sub(Gl);let a=Kl.dot(r);a<=0||(i<=a||Kl.multiplyScalar(a/i),r.sub(Kl));let o=r.length(),s=this.inside?this.radius-n-o:o-n-this.radius;return s<0&&(r.multiplyScalar(1/o),this.inside&&r.negate()),s}},Jl=new F,Yl=new bt,Xl=class extends Wl{get type(){return`plane`}constructor(e){super(),this.offset=e?.offset??new F(0,0,0),this.normal=e?.normal??new F(0,0,1)}calculateCollision(e,t,n,r){r.setFromMatrixPosition(e),r.negate().add(t),Yl.getNormalMatrix(e),Jl.copy(this.normal).applyNormalMatrix(Yl).normalize();let i=r.dot(Jl)-n;return r.copy(Jl),i}},Zl=new F,Ql=class extends Wl{get type(){return`sphere`}constructor(e){super(),this.offset=e?.offset??new F(0,0,0),this.radius=e?.radius??0,this.inside=e?.inside??!1}calculateCollision(e,t,n,r){r.subVectors(t,Zl.setFromMatrixPosition(e));let i=r.length(),a=this.inside?this.radius-n-i:i-n-this.radius;return a<0&&(r.multiplyScalar(1/i),this.inside&&r.negate()),a}},$l=new F,eu=class extends Gt{constructor(e){super(),this.worldScale=1,this._currentRadius=0,this._currentOffset=new F,this._currentTail=new F,this._shape=e,this._attrPos=new V(new Float32Array(396),3),this.setAttribute(`position`,this._attrPos),this._attrIndex=new V(new Uint16Array(264),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let e=!1,t=this._shape.radius/this.worldScale;this._currentRadius!==t&&(this._currentRadius=t,e=!0),this._currentOffset.equals(this._shape.offset)||(this._currentOffset.copy(this._shape.offset),e=!0);let n=$l.copy(this._shape.tail).divideScalar(this.worldScale);this._currentTail.distanceToSquared(n)>1e-10&&(this._currentTail.copy(n),e=!0),e&&this._buildPosition()}_buildPosition(){$l.copy(this._currentTail).sub(this._currentOffset);let e=$l.length()/this._currentRadius;for(let t=0;t<=16;t++){let n=t/16*Math.PI;this._attrPos.setXYZ(t,-Math.sin(n),-Math.cos(n),0),this._attrPos.setXYZ(17+t,e+Math.sin(n),Math.cos(n),0),this._attrPos.setXYZ(34+t,-Math.sin(n),0,-Math.cos(n)),this._attrPos.setXYZ(51+t,e+Math.sin(n),0,Math.cos(n))}for(let t=0;t<32;t++){let n=t/16*Math.PI;this._attrPos.setXYZ(68+t,0,Math.sin(n),Math.cos(n)),this._attrPos.setXYZ(100+t,e,Math.sin(n),Math.cos(n))}let t=Math.atan2($l.y,Math.sqrt($l.x*$l.x+$l.z*$l.z)),n=-Math.atan2($l.z,$l.x);this.rotateZ(t),this.rotateY(n),this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentOffset.x,this._currentOffset.y,this._currentOffset.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let e=0;e<34;e++){let t=(e+1)%34;this._attrIndex.setXY(e*2,e,t),this._attrIndex.setXY(68+e*2,34+e,34+t)}for(let e=0;e<32;e++){let t=(e+1)%32;this._attrIndex.setXY(136+e*2,68+e,68+t),this._attrIndex.setXY(200+e*2,100+e,100+t)}this._attrIndex.needsUpdate=!0}},tu=class extends Gt{constructor(e){super(),this.worldScale=1,this._currentOffset=new F,this._currentNormal=new F,this._shape=e,this._attrPos=new V(new Float32Array(18),3),this.setAttribute(`position`,this._attrPos),this._attrIndex=new V(new Uint16Array(10),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let e=!1;this._currentOffset.equals(this._shape.offset)||(this._currentOffset.copy(this._shape.offset),e=!0),this._currentNormal.equals(this._shape.normal)||(this._currentNormal.copy(this._shape.normal),e=!0),e&&this._buildPosition()}_buildPosition(){this._attrPos.setXYZ(0,-.5,-.5,0),this._attrPos.setXYZ(1,.5,-.5,0),this._attrPos.setXYZ(2,.5,.5,0),this._attrPos.setXYZ(3,-.5,.5,0),this._attrPos.setXYZ(4,0,0,0),this._attrPos.setXYZ(5,0,0,.25),this.translate(this._currentOffset.x,this._currentOffset.y,this._currentOffset.z),this.lookAt(this._currentNormal),this._attrPos.needsUpdate=!0}_buildIndex(){this._attrIndex.setXY(0,0,1),this._attrIndex.setXY(2,1,2),this._attrIndex.setXY(4,2,3),this._attrIndex.setXY(6,3,0),this._attrIndex.setXY(8,4,5),this._attrIndex.needsUpdate=!0}},nu=class extends Gt{constructor(e){super(),this.worldScale=1,this._currentRadius=0,this._currentOffset=new F,this._shape=e,this._attrPos=new V(new Float32Array(288),3),this.setAttribute(`position`,this._attrPos),this._attrIndex=new V(new Uint16Array(192),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let e=!1,t=this._shape.radius/this.worldScale;this._currentRadius!==t&&(this._currentRadius=t,e=!0),this._currentOffset.equals(this._shape.offset)||(this._currentOffset.copy(this._shape.offset),e=!0),e&&this._buildPosition()}_buildPosition(){for(let e=0;e<32;e++){let t=e/16*Math.PI;this._attrPos.setXYZ(e,Math.cos(t),Math.sin(t),0),this._attrPos.setXYZ(32+e,0,Math.cos(t),Math.sin(t)),this._attrPos.setXYZ(64+e,Math.sin(t),0,Math.cos(t))}this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentOffset.x,this._currentOffset.y,this._currentOffset.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let e=0;e<32;e++){let t=(e+1)%32;this._attrIndex.setXY(e*2,e,t),this._attrIndex.setXY(64+e*2,32+e,32+t),this._attrIndex.setXY(128+e*2,64+e,64+t)}this._attrIndex.needsUpdate=!0}},ru=new F,iu=class extends je{constructor(e){if(super(),this.matrixAutoUpdate=!1,this.collider=e,this.collider.shape instanceof Ql)this._geometry=new nu(this.collider.shape);else if(this.collider.shape instanceof ql)this._geometry=new eu(this.collider.shape);else if(this.collider.shape instanceof Xl)this._geometry=new tu(this.collider.shape);else throw Error(`VRMSpringBoneColliderHelper: Unknown collider shape type detected`);let t=new qe({color:16711935,depthTest:!1,depthWrite:!1});this._line=new T(this._geometry,t),this.add(this._line)}dispose(){this._geometry.dispose()}updateMatrixWorld(e){this.collider.updateWorldMatrix(!0,!1),this.matrix.copy(this.collider.matrixWorld);let t=this.matrix.elements;this._geometry.worldScale=ru.set(t[0],t[1],t[2]).length(),this._geometry.update(),super.updateMatrixWorld(e)}},au=class extends Gt{constructor(e){super(),this.worldScale=1,this._currentRadius=0,this._currentTail=new F,this._springBone=e,this._attrPos=new V(new Float32Array(294),3),this.setAttribute(`position`,this._attrPos),this._attrIndex=new V(new Uint16Array(194),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let e=!1,t=this._springBone.settings.hitRadius/this.worldScale;this._currentRadius!==t&&(this._currentRadius=t,e=!0),this._currentTail.equals(this._springBone.initialLocalChildPosition)||(this._currentTail.copy(this._springBone.initialLocalChildPosition),e=!0),e&&this._buildPosition()}_buildPosition(){for(let e=0;e<32;e++){let t=e/16*Math.PI;this._attrPos.setXYZ(e,Math.cos(t),Math.sin(t),0),this._attrPos.setXYZ(32+e,0,Math.cos(t),Math.sin(t)),this._attrPos.setXYZ(64+e,Math.sin(t),0,Math.cos(t))}this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.setXYZ(96,0,0,0),this._attrPos.setXYZ(97,this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let e=0;e<32;e++){let t=(e+1)%32;this._attrIndex.setXY(e*2,e,t),this._attrIndex.setXY(64+e*2,32+e,32+t),this._attrIndex.setXY(128+e*2,64+e,64+t)}this._attrIndex.setXY(192,96,97),this._attrIndex.needsUpdate=!0}},ou=new F,su=class extends je{constructor(e){super(),this.matrixAutoUpdate=!1,this.springBone=e,this._geometry=new au(this.springBone);let t=new qe({color:16776960,depthTest:!1,depthWrite:!1});this._line=new T(this._geometry,t),this.add(this._line)}dispose(){this._geometry.dispose()}updateMatrixWorld(e){this.springBone.bone.updateWorldMatrix(!0,!1),this.matrix.copy(this.springBone.bone.matrixWorld);let t=this.matrix.elements;this._geometry.worldScale=ou.set(t[0],t[1],t[2]).length(),this._geometry.update(),super.updateMatrixWorld(e)}},cu=class extends k{constructor(e){super(),this.colliderMatrix=new B,this.shape=e}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),lu(this.colliderMatrix,this.matrixWorld,this.shape.offset)}};function lu(e,t,n){let r=t.elements;e.copy(t),n&&(e.elements[12]=r[0]*n.x+r[4]*n.y+r[8]*n.z+r[12],e.elements[13]=r[1]*n.x+r[5]*n.y+r[9]*n.z+r[13],e.elements[14]=r[2]*n.x+r[6]*n.y+r[10]*n.z+r[14])}var uu=new B;function du(e){return e.invert?e.invert():e.getInverse(uu.copy(e)),e}var fu=class{constructor(e){this._inverseCache=new B,this._shouldUpdateInverse=!0,this.matrix=e,this._originalElements=e.elements,e.elements=new Proxy(e.elements,{set:(e,t,n)=>(this._shouldUpdateInverse=!0,e[t]=n,!0)})}get inverse(){return this._shouldUpdateInverse&&=(du(this._inverseCache.copy(this.matrix)),!1),this._inverseCache}revert(){this.matrix.elements=this._originalElements}},pu=new B,mu=new F,hu=new F,gu=new F,_u=new F,vu=new B,yu=class{constructor(e,t,n={},r=[]){this._currentTail=new F,this._prevTail=new F,this._boneAxis=new F,this._worldSpaceBoneLength=0,this._center=null,this._initialLocalMatrix=new B,this._initialLocalRotation=new R,this._initialLocalChildPosition=new F,this.bone=e,this.bone.matrixAutoUpdate=!1,this.child=t,this.settings={hitRadius:n.hitRadius??0,stiffness:n.stiffness??1,gravityPower:n.gravityPower??0,gravityDir:n.gravityDir?.clone()??new F(0,-1,0),dragForce:n.dragForce??.4},this.colliderGroups=r}get dependencies(){let e=new Set,t=this.bone.parent;t&&e.add(t);for(let t=0;t{t(e)})}function xu(e,t){e.children.forEach(e=>{t(e)||xu(e,t)})}function Su(e){let t=new Map;for(let n of e){let r=n;do{let n=(t.get(r)??0)+1;if(n===e.size)return r;t.set(r,n),r=r.parent}while(r!==null)}return null}var Cu=class{constructor(){this._joints=new Set,this._sortedJoints=[],this._hasWarnedCircularDependency=!1,this._ancestors=[],this._objectSpringBonesMap=new Map,this._isSortedJointsDirty=!1,this._relevantChildrenUpdated=this._relevantChildrenUpdated.bind(this)}get joints(){return this._joints}get springBones(){return console.warn(`VRMSpringBoneManager: springBones is deprecated. use joints instead.`),this._joints}get colliderGroups(){let e=new Set;return this._joints.forEach(t=>{t.colliderGroups.forEach(t=>{e.add(t)})}),Array.from(e)}get colliders(){let e=new Set;return this.colliderGroups.forEach(t=>{t.colliders.forEach(t=>{e.add(t)})}),Array.from(e)}addJoint(e){this._joints.add(e);let t=this._objectSpringBonesMap.get(e.bone);t??(t=new Set,this._objectSpringBonesMap.set(e.bone,t)),t.add(e),this._isSortedJointsDirty=!0}addSpringBone(e){console.warn(`VRMSpringBoneManager: addSpringBone() is deprecated. use addJoint() instead.`),this.addJoint(e)}deleteJoint(e){this._joints.delete(e),this._objectSpringBonesMap.get(e.bone).delete(e),this._isSortedJointsDirty=!0}deleteSpringBone(e){console.warn(`VRMSpringBoneManager: deleteSpringBone() is deprecated. use deleteJoint() instead.`),this.deleteJoint(e)}setInitState(){this._sortJoints();for(let e=0;e(this._objectSpringBonesMap.get(e)?.size??0)>0?!0:(this._ancestors.push(e),!1))),this._isSortedJointsDirty=!1}_insertJointSort(e,t,n,r,i){if(n.has(e))return;if(t.has(e)){this._hasWarnedCircularDependency||=(console.warn(`VRMSpringBoneManager: Circular dependency detected`),!0);return}t.add(e);let a=e.dependencies;for(let e of a){let a=!1,o=null;bu(e,e=>{let s=this._objectSpringBonesMap.get(e);if(s)for(let e of s)a=!0,this._insertJointSort(e,t,n,r,i);else a||(o=e)}),o&&i.add(o)}r.push(e),n.add(e)}_relevantChildrenUpdated(e){return(this._objectSpringBonesMap.get(e)?.size??0)>0?!0:(e.updateWorldMatrix(!1,!1),!1)}},wu=`VRMC_springBone_extended_collider`,Tu=new Set([`1.0`,`1.0-beta`]),Eu=new Set([`1.0`]),Du=class e{get name(){return e.EXTENSION_NAME}constructor(e,t){this.parser=e,this.jointHelperRoot=t?.jointHelperRoot,this.colliderHelperRoot=t?.colliderHelperRoot,this.useExtendedColliders=t?.useExtendedColliders??!0}afterRoot(e){return Ul(this,null,function*(){e.userData.vrmSpringBoneManager=yield this._import(e)})}_import(e){return Ul(this,null,function*(){return(yield this._v1Import(e))??(yield this._v0Import(e))??null})}_v1Import(t){return Ul(this,null,function*(){var n;let r=t.parser.json;if(r.extensionsUsed?.indexOf(e.EXTENSION_NAME)===-1)return null;let i=new Cu,a=yield t.parser.getDependencies(`node`),o=r.extensions?.[e.EXTENSION_NAME];if(!o)return null;let s=o.specVersion;if(!Tu.has(s))return console.warn(`VRMSpringBoneLoaderPlugin: Unknown ${e.EXTENSION_NAME} specVersion "${s}"`),null;let c=o.colliders?.map((t,n)=>{let r=a[t.node];if(r==null)return console.warn(`VRMSpringBoneLoaderPlugin: The collider #${n} attempted to use the node #${t.node} but not found`),null;let i=t.shape,o=t.extensions?.[wu];if(this.useExtendedColliders&&o!=null){let t=o.specVersion;if(!Eu.has(t))console.warn(`VRMSpringBoneLoaderPlugin: Unknown ${wu} specVersion "${t}". Fallbacking to the ${e.EXTENSION_NAME} definition`);else{let e=o.shape;if(e.sphere)return this._importSphereCollider(r,{offset:new F().fromArray(e.sphere.offset??[0,0,0]),radius:e.sphere.radius??0,inside:e.sphere.inside??!1});if(e.capsule)return this._importCapsuleCollider(r,{offset:new F().fromArray(e.capsule.offset??[0,0,0]),radius:e.capsule.radius??0,tail:new F().fromArray(e.capsule.tail??[0,0,0]),inside:e.capsule.inside??!1});if(e.plane)return this._importPlaneCollider(r,{offset:new F().fromArray(e.plane.offset??[0,0,0]),normal:new F().fromArray(e.plane.normal??[0,0,1])})}}if(i.sphere)return this._importSphereCollider(r,{offset:new F().fromArray(i.sphere.offset??[0,0,0]),radius:i.sphere.radius??0,inside:!1});if(i.capsule)return this._importCapsuleCollider(r,{offset:new F().fromArray(i.capsule.offset??[0,0,0]),radius:i.capsule.radius??0,tail:new F().fromArray(i.capsule.tail??[0,0,0]),inside:!1});throw Error(`VRMSpringBoneLoaderPlugin: The collider #${n} has no valid shape`)}),l=o.colliderGroups?.map((e,t)=>({colliders:(e.colliders??[]).flatMap(e=>c?.[e]??(console.warn(`VRMSpringBoneLoaderPlugin: The colliderGroup #${t} attempted to use a collider #${e} but not found`),[])),name:e.name}));return(n=o.springs)==null||n.forEach((e,t)=>{let n=e.joints,r=e.colliderGroups?.map(e=>{let n=l?.[e];if(n==null)throw Error(`VRMSpringBoneLoaderPlugin: The spring #${t} attempted to use a colliderGroup ${e} but not found`);return n}),o=e.center==null?void 0:a[e.center],s;n.forEach(e=>{if(s){let t=a[s.node],n=a[e.node],c={hitRadius:s.hitRadius,dragForce:s.dragForce,gravityPower:s.gravityPower,stiffness:s.stiffness,gravityDir:s.gravityDir==null?void 0:new F().fromArray(s.gravityDir)},l=this._importJoint(t,n,c,r);o&&(l.center=o),i.addJoint(l)}s=e})}),i.setInitState(),i})}_v0Import(e){return Ul(this,null,function*(){let t=e.parser.json;if(t.extensionsUsed?.indexOf(`VRM`)===-1)return null;let n=t.extensions?.VRM?.secondaryAnimation;if(!n)return null;let r=n?.boneGroups;if(!r)return null;let i=new Cu,a=yield e.parser.getDependencies(`node`),o=n.colliderGroups?.map(e=>{let t=a[e.node];return{colliders:(e.colliders??[]).map((e,n)=>{let r=new F(0,0,0);return e.offset&&r.set(e.offset.x??0,e.offset.y??0,e.offset.z?-e.offset.z:0),this._importSphereCollider(t,{offset:r,radius:e.radius??0,inside:!1})})}});return r?.forEach((e,t)=>{let n=e.bones;n&&n.forEach(n=>{let r=a[n],s=new F;e.gravityDir?s.set(e.gravityDir.x??0,e.gravityDir.y??0,e.gravityDir.z??0):s.set(0,-1,0);let c=e.center==null?void 0:a[e.center],l={hitRadius:e.hitRadius,dragForce:e.dragForce,gravityPower:e.gravityPower,stiffness:e.stiffiness,gravityDir:s},u=e.colliderGroups?.map(e=>{let n=o?.[e];if(n==null)throw Error(`VRMSpringBoneLoaderPlugin: The spring #${t} attempted to use a colliderGroup ${e} but not found`);return n});r.traverse(e=>{let t=e.children[0]??null,n=this._importJoint(e,t,l,u);c&&(n.center=c),i.addJoint(n)})})}),e.scene.updateMatrixWorld(),i.setInitState(),i})}_importJoint(e,t,n,r){let i=new yu(e,t,n,r);if(this.jointHelperRoot){let e=new su(i);this.jointHelperRoot.add(e),e.renderOrder=this.jointHelperRoot.renderOrder}return i}_importSphereCollider(e,t){let n=new cu(new Ql(t));if(e.add(n),this.colliderHelperRoot){let e=new iu(n);this.colliderHelperRoot.add(e),e.renderOrder=this.colliderHelperRoot.renderOrder}return n}_importCapsuleCollider(e,t){let n=new cu(new ql(t));if(e.add(n),this.colliderHelperRoot){let e=new iu(n);this.colliderHelperRoot.add(e),e.renderOrder=this.colliderHelperRoot.renderOrder}return n}_importPlaneCollider(e,t){let n=new cu(new Xl(t));if(e.add(n),this.colliderHelperRoot){let e=new iu(n);this.colliderHelperRoot.add(e),e.renderOrder=this.colliderHelperRoot.renderOrder}return n}};Du.EXTENSION_NAME=`VRMC_springBone`;var Ou=Du,ku=class{get name(){return`VRMLoaderPlugin`}constructor(e,t){this.parser=e;let n=t?.helperRoot,r=t?.autoUpdateHumanBones;this.expressionPlugin=t?.expressionPlugin??new Ts(e),this.firstPersonPlugin=t?.firstPersonPlugin??new ks(e),this.humanoidPlugin=t?.humanoidPlugin??new Js(e,{helperRoot:n,autoUpdateHumanBones:r}),this.lookAtPlugin=t?.lookAtPlugin??new Ac(e,{helperRoot:n}),this.metaPlugin=t?.metaPlugin??new Nc(e),this.mtoonMaterialPlugin=t?.mtoonMaterialPlugin??new $c(e),this.materialsHDREmissiveMultiplierPlugin=t?.materialsHDREmissiveMultiplierPlugin??new nl(e),this.materialsV0CompatPlugin=t?.materialsV0CompatPlugin??new ml(e),this.springBonePlugin=t?.springBonePlugin??new Ou(e,{colliderHelperRoot:n,jointHelperRoot:n}),this.nodeConstraintPlugin=t?.nodeConstraintPlugin??new Hl(e,{helperRoot:n})}beforeRoot(){return os(this,null,function*(){yield this.materialsV0CompatPlugin.beforeRoot(),yield this.mtoonMaterialPlugin.beforeRoot()})}loadMesh(e){return os(this,null,function*(){return yield this.mtoonMaterialPlugin.loadMesh(e)})}getMaterialType(e){return this.mtoonMaterialPlugin.getMaterialType(e)??null}extendMaterialParams(e,t){return os(this,null,function*(){yield this.materialsHDREmissiveMultiplierPlugin.extendMaterialParams(e,t),yield this.mtoonMaterialPlugin.extendMaterialParams(e,t)})}afterRoot(e){return os(this,null,function*(){yield this.metaPlugin.afterRoot(e),yield this.humanoidPlugin.afterRoot(e),yield this.expressionPlugin.afterRoot(e),yield this.lookAtPlugin.afterRoot(e),yield this.firstPersonPlugin.afterRoot(e),yield this.springBonePlugin.afterRoot(e),yield this.nodeConstraintPlugin.afterRoot(e),yield this.mtoonMaterialPlugin.afterRoot(e);let t=e.userData.vrmMeta,n=e.userData.vrmHumanoid;if(t&&n){let r=new Fc({scene:e.scene,expressionManager:e.userData.vrmExpressionManager,firstPerson:e.userData.vrmFirstPerson,humanoid:n,lookAt:e.userData.vrmLookAt,meta:t,materials:e.userData.vrmMToonMaterials,springBoneManager:e.userData.vrmSpringBoneManager,nodeConstraintManager:e.userData.vrmNodeConstraintManager});e.userData.vrm=r}})}};function Au(e){let t=new Set;return e.traverse(e=>{if(!e.isMesh)return;let n=e;t.add(n)}),t}function ju(e,t,n){if(t.size===1){let n=t.values().next().value;if(n.weight===1)return e[n.index]}let r=new Float32Array(e[0].count*3),i=0;if(n)i=1;else for(let e of t)i+=e.weight;for(let n of t){let t=e[n.index],a=n.weight/i;for(let e=0;el.getOrCreate(e)).join(`,`)}`,u=o.get(c);u??(u=t.clone(),Bu(u,i,r),o.set(c,u)),e.geometry.setAttribute(`skinIndex`,u)}for(let e of n)e.bind(i,new B)}}function Iu(e){let t=new Set;return e.traverse(e=>{if(!e.isSkinnedMesh)return;let n=e;t.add(n)}),t}function Lu(e,t){let n=new Set;for(let r=0;rn)return!1;return!0}var Hu=class{constructor(){this._objectIndexMap=new Map,this._index=0}get(e){return this._objectIndexMap.get(e)}getOrCreate(e){let t=this._objectIndexMap.get(e);return t??(t=this._index,this._objectIndexMap.set(e,t),this._index++),t}};function Uu(e){let t=new Gt;t.name=e.name,t.setIndex(e.index);for(let[n,r]of Object.entries(e.attributes))t.setAttribute(n,r);for(let[n,r]of Object.entries(e.morphAttributes)){let e=n;t.morphAttributes[e]=r.concat()}t.morphTargetsRelative=e.morphTargetsRelative,t.groups=[];for(let n of e.groups)t.addGroup(n.start,n.count,n.materialIndex);return t.boundingSphere=e.boundingSphere?.clone()??null,t.boundingBox=e.boundingBox?.clone()??null,t.drawRange.start=e.drawRange.start,t.drawRange.count=e.drawRange.count,t.userData=e.userData,t}function Wu(e){if(Object.values(e).forEach(e=>{e?.isTexture&&e.dispose()}),e.isShaderMaterial){let t=e.uniforms;t&&Object.values(t).forEach(e=>{let t=e.value;t?.isTexture&&t.dispose()})}e.dispose()}function Gu(e){let t=e.geometry;t&&t.dispose();let n=e.skeleton;n&&n.dispose();let r=e.material;r&&(Array.isArray(r)?r.forEach(e=>Wu(e)):r&&Wu(r))}function Ku(e){e.traverse(Gu)}function qu(e,t){console.warn(`VRMUtils.removeUnnecessaryJoints: removeUnnecessaryJoints is deprecated. Use combineSkeletons instead. combineSkeletons contributes more to the performance improvement. This function will be removed in the next major version.`);let n=t?.experimentalSameBoneCounts??!1,r=[];e.traverse(e=>{e.type===`SkinnedMesh`&&r.push(e)});let i=new Map,a=0;for(let e of r){let t=e.geometry.getAttribute(`skinIndex`);if(i.has(t))continue;let n=new Map,r=new Map;for(let e=0;e{if(!e.isMesh)return;let n=e,r=n.geometry,i=r.index;if(i==null)return;let a=t.get(r);if(a!=null){n.geometry=a;return}let o=Object.values(r.attributes)[0].count,s=Array(o),c=0,l=i.array;for(let e=0;e{p.addGroup(e.start,e.count,e.materialIndex)}),p.boundingBox=r.boundingBox?.clone()??null,p.boundingSphere=r.boundingSphere?.clone()??null,p.setDrawRange(r.drawRange.start,r.drawRange.count),p.userData=r.userData,t.set(r,p);{let e=i.array,t=new e.constructor(e.length);for(let n=0;n{let t=r.attributes[e];if(t.isInterleavedBufferAttribute)throw Error(`removeUnnecessaryVertices: InterleavedBufferAttribute is not supported`);let n=t.array,{itemSize:i,normalized:a}=t,o=new n.constructor(d.length*i);d.forEach((e,t)=>{for(let r=0;r{for(let n=0;ne===0),p.morphAttributes[n][e]=new V(s,a,o)}}m&&(p.morphAttributes={}),n.geometry=p}),Array.from(t.keys()).forEach(e=>{e.dispose()})}function Yu(e){e.meta?.metaVersion===`0`&&(e.scene.rotation.y=Math.PI)}var Xu=class{constructor(){}};Xu.combineMorphs=Mu,Xu.combineSkeletons=Fu,Xu.deepDispose=Ku,Xu.removeUnnecessaryJoints=qu,Xu.removeUnnecessaryVertices=Ju,Xu.rotateVRM0=Yu;var Zu=` +`;e.vertexShader=t+e.vertexShader,e.fragmentShader=t+e.fragmentShader}}get color(){return this.uniforms.litFactor.value}set color(e){this.uniforms.litFactor.value=e}get map(){return this.uniforms.map.value}set map(e){this.uniforms.map.value=e}get normalMap(){return this.uniforms.normalMap.value}set normalMap(e){this.uniforms.normalMap.value=e}get normalScale(){return this.uniforms.normalScale.value}set normalScale(e){this.uniforms.normalScale.value=e}get emissive(){return this.uniforms.emissive.value}set emissive(e){this.uniforms.emissive.value=e}get emissiveIntensity(){return this.uniforms.emissiveIntensity.value}set emissiveIntensity(e){this.uniforms.emissiveIntensity.value=e}get emissiveMap(){return this.uniforms.emissiveMap.value}set emissiveMap(e){this.uniforms.emissiveMap.value=e}get shadeColorFactor(){return this.uniforms.shadeColorFactor.value}set shadeColorFactor(e){this.uniforms.shadeColorFactor.value=e}get shadeMultiplyTexture(){return this.uniforms.shadeMultiplyTexture.value}set shadeMultiplyTexture(e){this.uniforms.shadeMultiplyTexture.value=e}get shadingShiftFactor(){return this.uniforms.shadingShiftFactor.value}set shadingShiftFactor(e){this.uniforms.shadingShiftFactor.value=e}get shadingShiftTexture(){return this.uniforms.shadingShiftTexture.value}set shadingShiftTexture(e){this.uniforms.shadingShiftTexture.value=e}get shadingShiftTextureScale(){return this.uniforms.shadingShiftTextureScale.value}set shadingShiftTextureScale(e){this.uniforms.shadingShiftTextureScale.value=e}get shadingToonyFactor(){return this.uniforms.shadingToonyFactor.value}set shadingToonyFactor(e){this.uniforms.shadingToonyFactor.value=e}get giEqualizationFactor(){return this.uniforms.giEqualizationFactor.value}set giEqualizationFactor(e){this.uniforms.giEqualizationFactor.value=e}get matcapFactor(){return this.uniforms.matcapFactor.value}set matcapFactor(e){this.uniforms.matcapFactor.value=e}get matcapTexture(){return this.uniforms.matcapTexture.value}set matcapTexture(e){this.uniforms.matcapTexture.value=e}get parametricRimColorFactor(){return this.uniforms.parametricRimColorFactor.value}set parametricRimColorFactor(e){this.uniforms.parametricRimColorFactor.value=e}get rimMultiplyTexture(){return this.uniforms.rimMultiplyTexture.value}set rimMultiplyTexture(e){this.uniforms.rimMultiplyTexture.value=e}get rimLightingMixFactor(){return this.uniforms.rimLightingMixFactor.value}set rimLightingMixFactor(e){this.uniforms.rimLightingMixFactor.value=e}get parametricRimFresnelPowerFactor(){return this.uniforms.parametricRimFresnelPowerFactor.value}set parametricRimFresnelPowerFactor(e){this.uniforms.parametricRimFresnelPowerFactor.value=e}get parametricRimLiftFactor(){return this.uniforms.parametricRimLiftFactor.value}set parametricRimLiftFactor(e){this.uniforms.parametricRimLiftFactor.value=e}get outlineWidthMultiplyTexture(){return this.uniforms.outlineWidthMultiplyTexture.value}set outlineWidthMultiplyTexture(e){this.uniforms.outlineWidthMultiplyTexture.value=e}get outlineWidthFactor(){return this.uniforms.outlineWidthFactor.value}set outlineWidthFactor(e){this.uniforms.outlineWidthFactor.value=e}get outlineColorFactor(){return this.uniforms.outlineColorFactor.value}set outlineColorFactor(e){this.uniforms.outlineColorFactor.value=e}get outlineLightingMixFactor(){return this.uniforms.outlineLightingMixFactor.value}set outlineLightingMixFactor(e){this.uniforms.outlineLightingMixFactor.value=e}get uvAnimationMaskTexture(){return this.uniforms.uvAnimationMaskTexture.value}set uvAnimationMaskTexture(e){this.uniforms.uvAnimationMaskTexture.value=e}get uvAnimationScrollXOffset(){return this.uniforms.uvAnimationScrollXOffset.value}set uvAnimationScrollXOffset(e){this.uniforms.uvAnimationScrollXOffset.value=e}get uvAnimationScrollYOffset(){return this.uniforms.uvAnimationScrollYOffset.value}set uvAnimationScrollYOffset(e){this.uniforms.uvAnimationScrollYOffset.value=e}get uvAnimationRotationPhase(){return this.uniforms.uvAnimationRotationPhase.value}set uvAnimationRotationPhase(e){this.uniforms.uvAnimationRotationPhase.value=e}get ignoreVertexColor(){return this._ignoreVertexColor}set ignoreVertexColor(e){this._ignoreVertexColor=e,this.needsUpdate=!0}get v0CompatShade(){return this._v0CompatShade}set v0CompatShade(e){this._v0CompatShade=e,this.needsUpdate=!0}get debugMode(){return this._debugMode}set debugMode(e){this._debugMode=e,this.needsUpdate=!0}get outlineWidthMode(){return this._outlineWidthMode}set outlineWidthMode(e){this._outlineWidthMode=e,this.needsUpdate=!0}get isOutline(){return this._isOutline}set isOutline(e){this._isOutline=e,this.needsUpdate=!0}get isMToonMaterial(){return!0}update(e){this._uploadUniformsWorkaround(),this._updateUVAnimation(e)}copy(e){return super.copy(e),this.map=e.map,this.normalMap=e.normalMap,this.emissiveMap=e.emissiveMap,this.shadeMultiplyTexture=e.shadeMultiplyTexture,this.shadingShiftTexture=e.shadingShiftTexture,this.matcapTexture=e.matcapTexture,this.rimMultiplyTexture=e.rimMultiplyTexture,this.outlineWidthMultiplyTexture=e.outlineWidthMultiplyTexture,this.uvAnimationMaskTexture=e.uvAnimationMaskTexture,this.normalMapType=e.normalMapType,this.uvAnimationScrollXSpeedFactor=e.uvAnimationScrollXSpeedFactor,this.uvAnimationScrollYSpeedFactor=e.uvAnimationScrollYSpeedFactor,this.uvAnimationRotationSpeedFactor=e.uvAnimationRotationSpeedFactor,this.ignoreVertexColor=e.ignoreVertexColor,this.v0CompatShade=e.v0CompatShade,this.debugMode=e.debugMode,this.outlineWidthMode=e.outlineWidthMode,this.isOutline=e.isOutline,this.needsUpdate=!0,this}_updateUVAnimation(e){this.uniforms.uvAnimationScrollXOffset.value+=e*this.uvAnimationScrollXSpeedFactor,this.uniforms.uvAnimationScrollYOffset.value+=e*this.uvAnimationScrollYSpeedFactor,this.uniforms.uvAnimationRotationPhase.value+=e*this.uvAnimationRotationSpeedFactor,this.uniforms.alphaTest.value=this.alphaTest,this.uniformsNeedUpdate=!0}_uploadUniformsWorkaround(){this.uniforms.opacity.value=this.opacity,this._updateTextureMatrix(this.uniforms.map,this.uniforms.mapUvTransform),this._updateTextureMatrix(this.uniforms.normalMap,this.uniforms.normalMapUvTransform),this._updateTextureMatrix(this.uniforms.emissiveMap,this.uniforms.emissiveMapUvTransform),this._updateTextureMatrix(this.uniforms.shadeMultiplyTexture,this.uniforms.shadeMultiplyTextureUvTransform),this._updateTextureMatrix(this.uniforms.shadingShiftTexture,this.uniforms.shadingShiftTextureUvTransform),this._updateTextureMatrix(this.uniforms.matcapTexture,this.uniforms.matcapTextureUvTransform),this._updateTextureMatrix(this.uniforms.rimMultiplyTexture,this.uniforms.rimMultiplyTextureUvTransform),this._updateTextureMatrix(this.uniforms.outlineWidthMultiplyTexture,this.uniforms.outlineWidthMultiplyTextureUvTransform),this._updateTextureMatrix(this.uniforms.uvAnimationMaskTexture,this.uniforms.uvAnimationMaskTextureUvTransform),this.uniformsNeedUpdate=!0}_generateDefines(){let e=this.outlineWidthMultiplyTexture!==null,t=this.map!==null||this.normalMap!==null||this.emissiveMap!==null||this.shadeMultiplyTexture!==null||this.shadingShiftTexture!==null||this.rimMultiplyTexture!==null||this.uvAnimationMaskTexture!==null;return{THREE_VRM_THREE_REVISION:181,OUTLINE:this._isOutline,MTOON_USE_UV:e||t,MTOON_UVS_VERTEX_ONLY:e&&!t,V0_COMPAT_SHADE:this._v0CompatShade,USE_SHADEMULTIPLYTEXTURE:this.shadeMultiplyTexture!==null,USE_SHADINGSHIFTTEXTURE:this.shadingShiftTexture!==null,USE_MATCAPTEXTURE:this.matcapTexture!==null,USE_RIMMULTIPLYTEXTURE:this.rimMultiplyTexture!==null,USE_OUTLINEWIDTHMULTIPLYTEXTURE:this._isOutline&&this.outlineWidthMultiplyTexture!==null,USE_UVANIMATIONMASKTEXTURE:this.uvAnimationMaskTexture!==null,IGNORE_VERTEX_COLOR:this._ignoreVertexColor===!0,DEBUG_NORMAL:this._debugMode===`normal`,DEBUG_LITSHADERATE:this._debugMode===`litShadeRate`,DEBUG_UV:this._debugMode===`uv`,OUTLINE_WIDTH_SCREEN:this._isOutline&&this._outlineWidthMode===Jc.ScreenCoordinates}}_updateTextureMatrix(e,t){e.value&&(e.value.matrixAutoUpdate&&e.value.updateMatrix(),t.value.copy(e.value.matrix))}},Zc=new Set([`1.0`,`1.0-beta`]),Qc=class e{get name(){return e.EXTENSION_NAME}constructor(e,t={}){this.parser=e,this.materialType=t.materialType??Xc,this.renderOrderOffset=t.renderOrderOffset??0,this.v0CompatShade=t.v0CompatShade??!1,this.debugMode=t.debugMode??`none`,this._mToonMaterialSet=new Set}beforeRoot(){return Hc(this,null,function*(){this._removeUnlitExtensionIfMToonExists()})}afterRoot(e){return Hc(this,null,function*(){e.userData.vrmMToonMaterials=Array.from(this._mToonMaterialSet)})}getMaterialType(e){return this._getMToonExtension(e)?this.materialType:null}extendMaterialParams(e,t){let n=this._getMToonExtension(e);return n?this._extendMaterialParams(n,t):null}loadMesh(e){return Hc(this,null,function*(){let t=this.parser,n=t.json.meshes?.[e];if(n==null)throw Error(`MToonMaterialLoaderPlugin: Attempt to use meshes[${e}] of glTF but the mesh doesn't exist`);let r=n.primitives,i=yield t.loadMesh(e);if(r.length===1){let e=i,t=r[0].material;t!=null&&this._setupPrimitive(e,t)}else{let e=i;for(let t=0;t{this._getMToonExtension(t)&&e.extensions?.KHR_materials_unlit&&delete e.extensions.KHR_materials_unlit})}_getMToonExtension(t){let n=this.parser.json.materials?.[t];if(n==null){console.warn(`MToonMaterialLoaderPlugin: Attempt to use materials[${t}] of glTF but the material doesn't exist`);return}let r=n.extensions?.[e.EXTENSION_NAME];if(r==null)return;let i=r.specVersion;if(!Zc.has(i)){console.warn(`MToonMaterialLoaderPlugin: Unknown ${e.EXTENSION_NAME} specVersion "${i}"`);return}return r}_extendMaterialParams(e,t){return Hc(this,null,function*(){delete t.metalness,delete t.roughness;let n=new Wc(this.parser,t);n.assignPrimitive(`transparentWithZWrite`,e.transparentWithZWrite),n.assignColor(`shadeColorFactor`,e.shadeColorFactor),n.assignTexture(`shadeMultiplyTexture`,e.shadeMultiplyTexture,!0),n.assignPrimitive(`shadingShiftFactor`,e.shadingShiftFactor),n.assignTexture(`shadingShiftTexture`,e.shadingShiftTexture,!0),n.assignPrimitive(`shadingShiftTextureScale`,e.shadingShiftTexture?.scale),n.assignPrimitive(`shadingToonyFactor`,e.shadingToonyFactor),n.assignPrimitive(`giEqualizationFactor`,e.giEqualizationFactor),n.assignColor(`matcapFactor`,e.matcapFactor),n.assignTexture(`matcapTexture`,e.matcapTexture,!0),n.assignColor(`parametricRimColorFactor`,e.parametricRimColorFactor),n.assignTexture(`rimMultiplyTexture`,e.rimMultiplyTexture,!0),n.assignPrimitive(`rimLightingMixFactor`,e.rimLightingMixFactor),n.assignPrimitive(`parametricRimFresnelPowerFactor`,e.parametricRimFresnelPowerFactor),n.assignPrimitive(`parametricRimLiftFactor`,e.parametricRimLiftFactor),n.assignPrimitive(`outlineWidthMode`,e.outlineWidthMode),n.assignPrimitive(`outlineWidthFactor`,e.outlineWidthFactor),n.assignTexture(`outlineWidthMultiplyTexture`,e.outlineWidthMultiplyTexture,!1),n.assignColor(`outlineColorFactor`,e.outlineColorFactor),n.assignPrimitive(`outlineLightingMixFactor`,e.outlineLightingMixFactor),n.assignTexture(`uvAnimationMaskTexture`,e.uvAnimationMaskTexture,!1),n.assignPrimitive(`uvAnimationScrollXSpeedFactor`,e.uvAnimationScrollXSpeedFactor),n.assignPrimitive(`uvAnimationScrollYSpeedFactor`,e.uvAnimationScrollYSpeedFactor),n.assignPrimitive(`uvAnimationRotationSpeedFactor`,e.uvAnimationRotationSpeedFactor),n.assignPrimitive(`v0CompatShade`,this.v0CompatShade),n.assignPrimitive(`debugMode`,this.debugMode),yield n.pending})}_setupPrimitive(e,t){let n=this._getMToonExtension(t);if(n){e.renderOrder=this._parseRenderOrder(n)+this.renderOrderOffset,this._generateOutline(e),this._addToMaterialSet(e);return}}_shouldGenerateOutline(e){return typeof e.outlineWidthMode==`string`&&e.outlineWidthMode!==`none`&&typeof e.outlineWidthFactor==`number`&&e.outlineWidthFactor>0}_generateOutline(e){let t=e.material;if(!(t instanceof It)||!this._shouldGenerateOutline(t))return;e.material=[t];let n=t.clone();n.name+=` (Outline)`,n.isOutline=!0,n.side=1,e.material.push(n);let r=e.geometry,i=r.index?r.index.count:r.attributes.position.count/3;r.addGroup(0,i,0),r.addGroup(0,i,1)}_addToMaterialSet(e){let t=e.material,n=new Set;Array.isArray(t)?t.forEach(e=>n.add(e)):n.add(t);for(let e of n)this._mToonMaterialSet.add(e)}_parseRenderOrder(e){return(e.transparentWithZWrite?0:19)+(e.renderQueueOffsetNumber??0)}};Qc.EXTENSION_NAME=`VRMC_materials_mtoon`;var $c=Qc,el=(e,t,n)=>new Promise((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())}),tl=class e{get name(){return e.EXTENSION_NAME}constructor(e){this.parser=e}extendMaterialParams(e,t){return el(this,null,function*(){let n=this._getHDREmissiveMultiplierExtension(e);n!=null&&(console.warn("VRMMaterialsHDREmissiveMultiplierLoaderPlugin: `VRMC_materials_hdr_emissiveMultiplier` is archived. Use `KHR_materials_emissive_strength` instead."),t.emissiveIntensity=n.emissiveMultiplier)})}_getHDREmissiveMultiplierExtension(t){let n=this.parser.json.materials?.[t];if(n==null){console.warn(`VRMMaterialsHDREmissiveMultiplierLoaderPlugin: Attempt to use materials[${t}] of glTF but the material doesn't exist`);return}let r=n.extensions?.[e.EXTENSION_NAME];if(r!=null)return r}};tl.EXTENSION_NAME=`VRMC_materials_hdr_emissiveMultiplier`;var nl=tl,rl=Object.defineProperty,il=Object.defineProperties,al=Object.getOwnPropertyDescriptors,ol=Object.getOwnPropertySymbols,sl=Object.prototype.hasOwnProperty,cl=Object.prototype.propertyIsEnumerable,ll=(e,t,n)=>t in e?rl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ul=(e,t)=>{for(var n in t||={})sl.call(t,n)&&ll(e,n,t[n]);if(ol)for(var n of ol(t))cl.call(t,n)&&ll(e,n,t[n]);return e},dl=(e,t)=>il(e,al(t)),fl=(e,t,n)=>new Promise((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())});function pl(e){return e**2.2}var ml=class{get name(){return`VRMMaterialsV0CompatPlugin`}constructor(e){this.parser=e,this._renderQueueMapTransparent=new Map,this._renderQueueMapTransparentZWrite=new Map;let t=this.parser.json;t.extensionsUsed=t.extensionsUsed??[],t.extensionsUsed.indexOf(`KHR_texture_transform`)===-1&&t.extensionsUsed.push(`KHR_texture_transform`)}beforeRoot(){return fl(this,null,function*(){let e=this.parser.json,t=e.extensions?.VRM?.materialProperties;t&&(this._populateRenderQueueMap(t),t.forEach((t,n)=>{let r=e.materials?.[n];if(r==null){console.warn(`VRMMaterialsV0CompatPlugin: Attempt to use materials[${n}] of glTF but the material doesn't exist`);return}if(t.shader===`VRM/MToon`){let i=this._parseV0MToonProperties(t,r);e.materials[n]=i}else if(t.shader?.startsWith(`VRM/Unlit`)){let i=this._parseV0UnlitProperties(t,r);e.materials[n]=i}else t.shader===`VRM_USE_GLTFSHADER`||console.warn(`VRMMaterialsV0CompatPlugin: Unknown shader: ${t.shader}`)}))})}_parseV0MToonProperties(e,t){let n=e.keywordMap?._ALPHABLEND_ON??!1,r=e.floatProperties?._ZWrite===1&&n,i=this._v0ParseRenderQueue(e),a=e.keywordMap?._ALPHATEST_ON??!1,o=n?`BLEND`:a?`MASK`:`OPAQUE`,s=a?e.floatProperties?._Cutoff??.5:void 0,c=(e.floatProperties?._CullMode??2)===0,l=this._portTextureTransform(e),u=(e.vectorProperties?._Color??[1,1,1,1]).map((e,t)=>t===3?e:pl(e)),d=e.textureProperties?._MainTex,f=d==null?void 0:{index:d,extensions:ul({},l)},p=e.floatProperties?._BumpScale??1,m=e.textureProperties?._BumpMap,h=m==null?void 0:{index:m,scale:p,extensions:ul({},l)},g=(e.vectorProperties?._EmissionColor??[0,0,0,1]).map(pl),_=e.textureProperties?._EmissionMap,v=_==null?void 0:{index:_,extensions:ul({},l)},y=(e.vectorProperties?._ShadeColor??[.97,.81,.86,1]).map(pl),b=e.textureProperties?._ShadeTexture,x=b==null?void 0:{index:b,extensions:ul({},l)},S=e.floatProperties?._ShadeShift??0,C=e.floatProperties?._ShadeToony??.9;C=I.lerp(C,1,.5+.5*S),S=-S-(1-C);let ee=e.floatProperties?._IndirectLightIntensity??.1,te=ee?1-ee:void 0,ne=e.textureProperties?._SphereAdd,w=ne==null?void 0:[1,1,1],re=ne==null?void 0:{index:ne},T=e.floatProperties?._RimLightingMix??0,E=e.textureProperties?._RimTexture,D=E==null?void 0:{index:E,extensions:ul({},l)},O=(e.vectorProperties?._RimColor??[0,0,0,1]).map(pl),ie=e.floatProperties?._RimFresnelPower??1,ae=e.floatProperties?._RimLift??0,k=[`none`,`worldCoordinates`,`screenCoordinates`][e.floatProperties?._OutlineWidthMode??0],oe=e.floatProperties?._OutlineWidth??0;oe=.01*oe;let A=e.textureProperties?._OutlineWidthTexture,se=A==null?void 0:{index:A,extensions:ul({},l)},ce=(e.vectorProperties?._OutlineColor??[0,0,0]).map(pl),le=(e.floatProperties?._OutlineColorMode??0)===1?e.floatProperties?._OutlineLightingMix??1:0,ue=e.textureProperties?._UvAnimMaskTexture,j=ue==null?void 0:{index:ue,extensions:ul({},l)},de=e.floatProperties?._UvAnimScrollX??0,fe=e.floatProperties?._UvAnimScrollY??0;fe!=null&&(fe=-fe);let pe=e.floatProperties?._UvAnimRotation??0,me={specVersion:`1.0`,transparentWithZWrite:r,renderQueueOffsetNumber:i,shadeColorFactor:y,shadeMultiplyTexture:x,shadingShiftFactor:S,shadingToonyFactor:C,giEqualizationFactor:te,matcapFactor:w,matcapTexture:re,rimLightingMixFactor:T,rimMultiplyTexture:D,parametricRimColorFactor:O,parametricRimFresnelPowerFactor:ie,parametricRimLiftFactor:ae,outlineWidthMode:k,outlineWidthFactor:oe,outlineWidthMultiplyTexture:se,outlineColorFactor:ce,outlineLightingMixFactor:le,uvAnimationMaskTexture:j,uvAnimationScrollXSpeedFactor:de,uvAnimationScrollYSpeedFactor:fe,uvAnimationRotationSpeedFactor:pe};return dl(ul({},t),{pbrMetallicRoughness:{baseColorFactor:u,baseColorTexture:f},normalTexture:h,emissiveTexture:v,emissiveFactor:g,alphaMode:o,alphaCutoff:s,doubleSided:c,extensions:{VRMC_materials_mtoon:me}})}_parseV0UnlitProperties(e,t){let n=e.shader===`VRM/UnlitTransparentZWrite`,r=e.shader===`VRM/UnlitTransparent`||n,i=this._v0ParseRenderQueue(e),a=e.shader===`VRM/UnlitCutout`,o=r?`BLEND`:a?`MASK`:`OPAQUE`,s=a?e.floatProperties?._Cutoff??.5:void 0,c=this._portTextureTransform(e),l=(e.vectorProperties?._Color??[1,1,1,1]).map(pl),u=e.textureProperties?._MainTex,d=u==null?void 0:{index:u,extensions:ul({},c)},f={specVersion:`1.0`,transparentWithZWrite:n,renderQueueOffsetNumber:i,shadeColorFactor:l,shadeMultiplyTexture:d};return dl(ul({},t),{pbrMetallicRoughness:{baseColorFactor:l,baseColorTexture:d},alphaMode:o,alphaCutoff:s,extensions:{VRMC_materials_mtoon:f}})}_portTextureTransform(e){let t=e.vectorProperties?._MainTex;if(t==null)return{};let n=[t?.[0]??0,t?.[1]??0],r=[t?.[2]??1,t?.[3]??1];return n[1]=1-r[1]-n[1],{KHR_texture_transform:{offset:n,scale:r}}}_v0ParseRenderQueue(e){let t=e.shader===`VRM/UnlitTransparentZWrite`,n=e.keywordMap?._ALPHABLEND_ON!=null||e.shader===`VRM/UnlitTransparent`||t,r=e.floatProperties?._ZWrite===1||t,i=0;if(n){let t=e.renderQueue;t!=null&&(i=r?this._renderQueueMapTransparentZWrite.get(t):this._renderQueueMapTransparent.get(t))}return i}_populateRenderQueueMap(e){let t=new Set,n=new Set;e.forEach(e=>{let r=e.shader===`VRM/UnlitTransparentZWrite`,i=e.keywordMap?._ALPHABLEND_ON!=null||e.shader===`VRM/UnlitTransparent`||r,a=e.floatProperties?._ZWrite===1||r;if(i){let r=e.renderQueue;r!=null&&(a?n.add(r):t.add(r))}}),t.size>10&&console.warn(`VRMMaterialsV0CompatPlugin: This VRM uses ${t.size} render queues for Transparent materials while VRM 1.0 only supports up to 10 render queues. The model might not be rendered correctly.`),n.size>10&&console.warn(`VRMMaterialsV0CompatPlugin: This VRM uses ${n.size} render queues for TransparentZWrite materials while VRM 1.0 only supports up to 10 render queues. The model might not be rendered correctly.`),Array.from(t).sort().forEach((e,n)=>{let r=Math.min(Math.max(n-t.size+1,-9),0);this._renderQueueMapTransparent.set(e,r)}),Array.from(n).sort().forEach((e,t)=>{let n=Math.min(Math.max(t,0),9);this._renderQueueMapTransparentZWrite.set(e,n)})}},hl=(e,t,n)=>new Promise((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())}),gl=new F,_l=class extends P{constructor(e){super(),this._attrPosition=new V(new Float32Array([0,0,0,0,0,0]),3),this._attrPosition.setUsage(O);let t=new Gt;t.setAttribute(`position`,this._attrPosition),this._line=new Ue(t,new qe({color:16711935,depthTest:!1,depthWrite:!1})),this.add(this._line),this.constraint=e}updateMatrixWorld(e){gl.setFromMatrixPosition(this.constraint.destination.matrixWorld),this._attrPosition.setXYZ(0,gl.x,gl.y,gl.z),this.constraint.source&&gl.setFromMatrixPosition(this.constraint.source.matrixWorld),this._attrPosition.setXYZ(1,gl.x,gl.y,gl.z),this._attrPosition.needsUpdate=!0,super.updateMatrixWorld(e)}};function vl(e,t){return t.set(e.elements[12],e.elements[13],e.elements[14])}var yl=new F,bl=new F;function xl(e,t){return e.decompose(yl,t,bl),t}function Sl(e){return e.invert?e.invert():e.inverse(),e}var Cl=class{constructor(e,t){this.destination=e,this.source=t,this.weight=1}},wl=new F,Tl=new F,El=new F,Dl=new R,Ol=new R,kl=new R,Al=class extends Cl{get aimAxis(){return this._aimAxis}set aimAxis(e){this._aimAxis=e,this._v3AimAxis.set(e===`PositiveX`?1:e===`NegativeX`?-1:0,e===`PositiveY`?1:e===`NegativeY`?-1:0,e===`PositiveZ`?1:e===`NegativeZ`?-1:0)}get dependencies(){let e=new Set([this.source]);return this.destination.parent&&e.add(this.destination.parent),e}constructor(e,t){super(e,t),this._aimAxis=`PositiveX`,this._v3AimAxis=new F(1,0,0),this._dstRestQuat=new R}setInitState(){this._dstRestQuat.copy(this.destination.quaternion)}update(){this.destination.updateWorldMatrix(!0,!1),this.source.updateWorldMatrix(!0,!1);let e=Dl.identity(),t=Ol.identity();this.destination.parent&&(xl(this.destination.parent.matrixWorld,e),Sl(t.copy(e)));let n=wl.copy(this._v3AimAxis).applyQuaternion(this._dstRestQuat).applyQuaternion(e),r=vl(this.source.matrixWorld,Tl).sub(vl(this.destination.matrixWorld,El)).normalize(),i=kl.setFromUnitVectors(n,r).premultiply(t).multiply(e).multiply(this._dstRestQuat);this.destination.quaternion.copy(this._dstRestQuat).slerp(i,this.weight)}};function jl(e,t){let n=[e],r=e.parent;for(;r!==null;)n.unshift(r),r=r.parent;n.forEach(e=>{t(e)})}var Ml=class{constructor(){this._constraints=new Set,this._objectConstraintsMap=new Map}get constraints(){return this._constraints}addConstraint(e){this._constraints.add(e);let t=this._objectConstraintsMap.get(e.destination);t??(t=new Set,this._objectConstraintsMap.set(e.destination,t)),t.add(e)}deleteConstraint(e){this._constraints.delete(e),this._objectConstraintsMap.get(e.destination).delete(e)}setInitState(){let e=new Set,t=new Set;for(let n of this._constraints)this._processConstraint(n,e,t,e=>e.setInitState())}update(){let e=new Set,t=new Set;for(let n of this._constraints)this._processConstraint(n,e,t,e=>e.update())}_processConstraint(e,t,n,r){if(n.has(e))return;if(t.has(e))throw Error(`VRMNodeConstraintManager: Circular dependency detected while updating constraints`);t.add(e);let i=e.dependencies;for(let e of i)jl(e,e=>{let i=this._objectConstraintsMap.get(e);if(i)for(let e of i)this._processConstraint(e,t,n,r)});r(e),n.add(e)}},Nl=new R,Pl=new R,Fl=class extends Cl{get dependencies(){return new Set([this.source])}constructor(e,t){super(e,t),this._dstRestQuat=new R,this._invSrcRestQuat=new R}setInitState(){this._dstRestQuat.copy(this.destination.quaternion),Sl(this._invSrcRestQuat.copy(this.source.quaternion))}update(){let e=Nl.copy(this._invSrcRestQuat).multiply(this.source.quaternion),t=Pl.copy(this._dstRestQuat).multiply(e);this.destination.quaternion.copy(this._dstRestQuat).slerp(t,this.weight)}},Il=new F,Ll=new R,Rl=new R,zl=class extends Cl{get rollAxis(){return this._rollAxis}set rollAxis(e){this._rollAxis=e,this._v3RollAxis.set(e===`X`?1:0,e===`Y`?1:0,e===`Z`?1:0)}get dependencies(){return new Set([this.source])}constructor(e,t){super(e,t),this._rollAxis=`X`,this._v3RollAxis=new F(1,0,0),this._dstRestQuat=new R,this._invDstRestQuat=new R,this._invSrcRestQuatMulDstRestQuat=new R}setInitState(){this._dstRestQuat.copy(this.destination.quaternion),Sl(this._invDstRestQuat.copy(this._dstRestQuat)),Sl(this._invSrcRestQuatMulDstRestQuat.copy(this.source.quaternion)).multiply(this._dstRestQuat)}update(){let e=Ll.copy(this._invDstRestQuat).multiply(this.source.quaternion).multiply(this._invSrcRestQuatMulDstRestQuat),t=Il.copy(this._v3RollAxis).applyQuaternion(e),n=Rl.setFromUnitVectors(t,this._v3RollAxis).premultiply(this._dstRestQuat).multiply(e);this.destination.quaternion.copy(this._dstRestQuat).slerp(n,this.weight)}},Bl=new Set([`1.0`,`1.0-beta`]),Vl=class e{get name(){return e.EXTENSION_NAME}constructor(e,t){this.parser=e,this.helperRoot=t?.helperRoot}afterRoot(e){return hl(this,null,function*(){e.userData.vrmNodeConstraintManager=yield this._import(e)})}_import(t){return hl(this,null,function*(){let n=this.parser.json;if(n.extensionsUsed?.indexOf(e.EXTENSION_NAME)===-1)return null;let r=new Ml,i=yield this.parser.getDependencies(`node`);return i.forEach((t,a)=>{let o=n.nodes[a]?.extensions?.[e.EXTENSION_NAME];if(o==null)return;let s=o.specVersion;if(!Bl.has(s)){console.warn(`VRMNodeConstraintLoaderPlugin: Unknown ${e.EXTENSION_NAME} specVersion "${s}"`);return}let c=o.constraint;if(c.roll!=null){let e=this._importRollConstraint(t,i,c.roll);r.addConstraint(e)}else if(c.aim!=null){let e=this._importAimConstraint(t,i,c.aim);r.addConstraint(e)}else if(c.rotation!=null){let e=this._importRotationConstraint(t,i,c.rotation);r.addConstraint(e)}}),t.scene.updateMatrixWorld(),r.setInitState(),r})}_importRollConstraint(e,t,n){let{source:r,rollAxis:i,weight:a}=n,o=t[r],s=new zl(e,o);if(i!=null&&(s.rollAxis=i),a!=null&&(s.weight=a),this.helperRoot){let e=new _l(s);this.helperRoot.add(e)}return s}_importAimConstraint(e,t,n){let{source:r,aimAxis:i,weight:a}=n,o=t[r],s=new Al(e,o);if(i!=null&&(s.aimAxis=i),a!=null&&(s.weight=a),this.helperRoot){let e=new _l(s);this.helperRoot.add(e)}return s}_importRotationConstraint(e,t,n){let{source:r,weight:i}=n,a=t[r],o=new Fl(e,a);if(i!=null&&(o.weight=i),this.helperRoot){let e=new _l(o);this.helperRoot.add(e)}return o}};Vl.EXTENSION_NAME=`VRMC_node_constraint`;var Hl=Vl,Ul=(e,t,n)=>new Promise((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())}),Wl=class{},Gl=new F,Kl=new F,ql=class extends Wl{get type(){return`capsule`}constructor(e){super(),this.offset=e?.offset??new F(0,0,0),this.tail=e?.tail??new F(0,0,0),this.radius=e?.radius??0,this.inside=e?.inside??!1}calculateCollision(e,t,n,r){Gl.setFromMatrixPosition(e),Kl.subVectors(this.tail,this.offset).applyMatrix4(e),Kl.sub(Gl);let i=Kl.lengthSq();r.copy(t).sub(Gl);let a=Kl.dot(r);a<=0||(i<=a||Kl.multiplyScalar(a/i),r.sub(Kl));let o=r.length(),s=this.inside?this.radius-n-o:o-n-this.radius;return s<0&&(r.multiplyScalar(1/o),this.inside&&r.negate()),s}},Jl=new F,Yl=new bt,Xl=class extends Wl{get type(){return`plane`}constructor(e){super(),this.offset=e?.offset??new F(0,0,0),this.normal=e?.normal??new F(0,0,1)}calculateCollision(e,t,n,r){r.setFromMatrixPosition(e),r.negate().add(t),Yl.getNormalMatrix(e),Jl.copy(this.normal).applyNormalMatrix(Yl).normalize();let i=r.dot(Jl)-n;return r.copy(Jl),i}},Zl=new F,Ql=class extends Wl{get type(){return`sphere`}constructor(e){super(),this.offset=e?.offset??new F(0,0,0),this.radius=e?.radius??0,this.inside=e?.inside??!1}calculateCollision(e,t,n,r){r.subVectors(t,Zl.setFromMatrixPosition(e));let i=r.length(),a=this.inside?this.radius-n-i:i-n-this.radius;return a<0&&(r.multiplyScalar(1/i),this.inside&&r.negate()),a}},$l=new F,eu=class extends Gt{constructor(e){super(),this.worldScale=1,this._currentRadius=0,this._currentOffset=new F,this._currentTail=new F,this._shape=e,this._attrPos=new V(new Float32Array(396),3),this.setAttribute(`position`,this._attrPos),this._attrIndex=new V(new Uint16Array(264),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let e=!1,t=this._shape.radius/this.worldScale;this._currentRadius!==t&&(this._currentRadius=t,e=!0),this._currentOffset.equals(this._shape.offset)||(this._currentOffset.copy(this._shape.offset),e=!0);let n=$l.copy(this._shape.tail).divideScalar(this.worldScale);this._currentTail.distanceToSquared(n)>1e-10&&(this._currentTail.copy(n),e=!0),e&&this._buildPosition()}_buildPosition(){$l.copy(this._currentTail).sub(this._currentOffset);let e=$l.length()/this._currentRadius;for(let t=0;t<=16;t++){let n=t/16*Math.PI;this._attrPos.setXYZ(t,-Math.sin(n),-Math.cos(n),0),this._attrPos.setXYZ(17+t,e+Math.sin(n),Math.cos(n),0),this._attrPos.setXYZ(34+t,-Math.sin(n),0,-Math.cos(n)),this._attrPos.setXYZ(51+t,e+Math.sin(n),0,Math.cos(n))}for(let t=0;t<32;t++){let n=t/16*Math.PI;this._attrPos.setXYZ(68+t,0,Math.sin(n),Math.cos(n)),this._attrPos.setXYZ(100+t,e,Math.sin(n),Math.cos(n))}let t=Math.atan2($l.y,Math.sqrt($l.x*$l.x+$l.z*$l.z)),n=-Math.atan2($l.z,$l.x);this.rotateZ(t),this.rotateY(n),this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentOffset.x,this._currentOffset.y,this._currentOffset.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let e=0;e<34;e++){let t=(e+1)%34;this._attrIndex.setXY(e*2,e,t),this._attrIndex.setXY(68+e*2,34+e,34+t)}for(let e=0;e<32;e++){let t=(e+1)%32;this._attrIndex.setXY(136+e*2,68+e,68+t),this._attrIndex.setXY(200+e*2,100+e,100+t)}this._attrIndex.needsUpdate=!0}},tu=class extends Gt{constructor(e){super(),this.worldScale=1,this._currentOffset=new F,this._currentNormal=new F,this._shape=e,this._attrPos=new V(new Float32Array(18),3),this.setAttribute(`position`,this._attrPos),this._attrIndex=new V(new Uint16Array(10),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let e=!1;this._currentOffset.equals(this._shape.offset)||(this._currentOffset.copy(this._shape.offset),e=!0),this._currentNormal.equals(this._shape.normal)||(this._currentNormal.copy(this._shape.normal),e=!0),e&&this._buildPosition()}_buildPosition(){this._attrPos.setXYZ(0,-.5,-.5,0),this._attrPos.setXYZ(1,.5,-.5,0),this._attrPos.setXYZ(2,.5,.5,0),this._attrPos.setXYZ(3,-.5,.5,0),this._attrPos.setXYZ(4,0,0,0),this._attrPos.setXYZ(5,0,0,.25),this.translate(this._currentOffset.x,this._currentOffset.y,this._currentOffset.z),this.lookAt(this._currentNormal),this._attrPos.needsUpdate=!0}_buildIndex(){this._attrIndex.setXY(0,0,1),this._attrIndex.setXY(2,1,2),this._attrIndex.setXY(4,2,3),this._attrIndex.setXY(6,3,0),this._attrIndex.setXY(8,4,5),this._attrIndex.needsUpdate=!0}},nu=class extends Gt{constructor(e){super(),this.worldScale=1,this._currentRadius=0,this._currentOffset=new F,this._shape=e,this._attrPos=new V(new Float32Array(288),3),this.setAttribute(`position`,this._attrPos),this._attrIndex=new V(new Uint16Array(192),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let e=!1,t=this._shape.radius/this.worldScale;this._currentRadius!==t&&(this._currentRadius=t,e=!0),this._currentOffset.equals(this._shape.offset)||(this._currentOffset.copy(this._shape.offset),e=!0),e&&this._buildPosition()}_buildPosition(){for(let e=0;e<32;e++){let t=e/16*Math.PI;this._attrPos.setXYZ(e,Math.cos(t),Math.sin(t),0),this._attrPos.setXYZ(32+e,0,Math.cos(t),Math.sin(t)),this._attrPos.setXYZ(64+e,Math.sin(t),0,Math.cos(t))}this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentOffset.x,this._currentOffset.y,this._currentOffset.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let e=0;e<32;e++){let t=(e+1)%32;this._attrIndex.setXY(e*2,e,t),this._attrIndex.setXY(64+e*2,32+e,32+t),this._attrIndex.setXY(128+e*2,64+e,64+t)}this._attrIndex.needsUpdate=!0}},ru=new F,iu=class extends P{constructor(e){if(super(),this.matrixAutoUpdate=!1,this.collider=e,this.collider.shape instanceof Ql)this._geometry=new nu(this.collider.shape);else if(this.collider.shape instanceof ql)this._geometry=new eu(this.collider.shape);else if(this.collider.shape instanceof Xl)this._geometry=new tu(this.collider.shape);else throw Error(`VRMSpringBoneColliderHelper: Unknown collider shape type detected`);let t=new qe({color:16711935,depthTest:!1,depthWrite:!1});this._line=new E(this._geometry,t),this.add(this._line)}dispose(){this._geometry.dispose()}updateMatrixWorld(e){this.collider.updateWorldMatrix(!0,!1),this.matrix.copy(this.collider.matrixWorld);let t=this.matrix.elements;this._geometry.worldScale=ru.set(t[0],t[1],t[2]).length(),this._geometry.update(),super.updateMatrixWorld(e)}},au=class extends Gt{constructor(e){super(),this.worldScale=1,this._currentRadius=0,this._currentTail=new F,this._springBone=e,this._attrPos=new V(new Float32Array(294),3),this.setAttribute(`position`,this._attrPos),this._attrIndex=new V(new Uint16Array(194),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let e=!1,t=this._springBone.settings.hitRadius/this.worldScale;this._currentRadius!==t&&(this._currentRadius=t,e=!0),this._currentTail.equals(this._springBone.initialLocalChildPosition)||(this._currentTail.copy(this._springBone.initialLocalChildPosition),e=!0),e&&this._buildPosition()}_buildPosition(){for(let e=0;e<32;e++){let t=e/16*Math.PI;this._attrPos.setXYZ(e,Math.cos(t),Math.sin(t),0),this._attrPos.setXYZ(32+e,0,Math.cos(t),Math.sin(t)),this._attrPos.setXYZ(64+e,Math.sin(t),0,Math.cos(t))}this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.setXYZ(96,0,0,0),this._attrPos.setXYZ(97,this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let e=0;e<32;e++){let t=(e+1)%32;this._attrIndex.setXY(e*2,e,t),this._attrIndex.setXY(64+e*2,32+e,32+t),this._attrIndex.setXY(128+e*2,64+e,64+t)}this._attrIndex.setXY(192,96,97),this._attrIndex.needsUpdate=!0}},ou=new F,su=class extends P{constructor(e){super(),this.matrixAutoUpdate=!1,this.springBone=e,this._geometry=new au(this.springBone);let t=new qe({color:16776960,depthTest:!1,depthWrite:!1});this._line=new E(this._geometry,t),this.add(this._line)}dispose(){this._geometry.dispose()}updateMatrixWorld(e){this.springBone.bone.updateWorldMatrix(!0,!1),this.matrix.copy(this.springBone.bone.matrixWorld);let t=this.matrix.elements;this._geometry.worldScale=ou.set(t[0],t[1],t[2]).length(),this._geometry.update(),super.updateMatrixWorld(e)}},cu=class extends A{constructor(e){super(),this.colliderMatrix=new B,this.shape=e}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),lu(this.colliderMatrix,this.matrixWorld,this.shape.offset)}};function lu(e,t,n){let r=t.elements;e.copy(t),n&&(e.elements[12]=r[0]*n.x+r[4]*n.y+r[8]*n.z+r[12],e.elements[13]=r[1]*n.x+r[5]*n.y+r[9]*n.z+r[13],e.elements[14]=r[2]*n.x+r[6]*n.y+r[10]*n.z+r[14])}var uu=new B;function du(e){return e.invert?e.invert():e.getInverse(uu.copy(e)),e}var fu=class{constructor(e){this._inverseCache=new B,this._shouldUpdateInverse=!0,this.matrix=e,this._originalElements=e.elements,e.elements=new Proxy(e.elements,{set:(e,t,n)=>(this._shouldUpdateInverse=!0,e[t]=n,!0)})}get inverse(){return this._shouldUpdateInverse&&=(du(this._inverseCache.copy(this.matrix)),!1),this._inverseCache}revert(){this.matrix.elements=this._originalElements}},pu=new B,mu=new F,hu=new F,gu=new F,_u=new F,vu=new B,yu=class{constructor(e,t,n={},r=[]){this._currentTail=new F,this._prevTail=new F,this._boneAxis=new F,this._worldSpaceBoneLength=0,this._center=null,this._initialLocalMatrix=new B,this._initialLocalRotation=new R,this._initialLocalChildPosition=new F,this.bone=e,this.bone.matrixAutoUpdate=!1,this.child=t,this.settings={hitRadius:n.hitRadius??0,stiffness:n.stiffness??1,gravityPower:n.gravityPower??0,gravityDir:n.gravityDir?.clone()??new F(0,-1,0),dragForce:n.dragForce??.4},this.colliderGroups=r}get dependencies(){let e=new Set,t=this.bone.parent;t&&e.add(t);for(let t=0;t{t(e)})}function xu(e,t){e.children.forEach(e=>{t(e)||xu(e,t)})}function Su(e){let t=new Map;for(let n of e){let r=n;do{let n=(t.get(r)??0)+1;if(n===e.size)return r;t.set(r,n),r=r.parent}while(r!==null)}return null}var Cu=class{constructor(){this._joints=new Set,this._sortedJoints=[],this._hasWarnedCircularDependency=!1,this._ancestors=[],this._objectSpringBonesMap=new Map,this._isSortedJointsDirty=!1,this._relevantChildrenUpdated=this._relevantChildrenUpdated.bind(this)}get joints(){return this._joints}get springBones(){return console.warn(`VRMSpringBoneManager: springBones is deprecated. use joints instead.`),this._joints}get colliderGroups(){let e=new Set;return this._joints.forEach(t=>{t.colliderGroups.forEach(t=>{e.add(t)})}),Array.from(e)}get colliders(){let e=new Set;return this.colliderGroups.forEach(t=>{t.colliders.forEach(t=>{e.add(t)})}),Array.from(e)}addJoint(e){this._joints.add(e);let t=this._objectSpringBonesMap.get(e.bone);t??(t=new Set,this._objectSpringBonesMap.set(e.bone,t)),t.add(e),this._isSortedJointsDirty=!0}addSpringBone(e){console.warn(`VRMSpringBoneManager: addSpringBone() is deprecated. use addJoint() instead.`),this.addJoint(e)}deleteJoint(e){this._joints.delete(e),this._objectSpringBonesMap.get(e.bone).delete(e),this._isSortedJointsDirty=!0}deleteSpringBone(e){console.warn(`VRMSpringBoneManager: deleteSpringBone() is deprecated. use deleteJoint() instead.`),this.deleteJoint(e)}setInitState(){this._sortJoints();for(let e=0;e(this._objectSpringBonesMap.get(e)?.size??0)>0?!0:(this._ancestors.push(e),!1))),this._isSortedJointsDirty=!1}_insertJointSort(e,t,n,r,i){if(n.has(e))return;if(t.has(e)){this._hasWarnedCircularDependency||=(console.warn(`VRMSpringBoneManager: Circular dependency detected`),!0);return}t.add(e);let a=e.dependencies;for(let e of a){let a=!1,o=null;bu(e,e=>{let s=this._objectSpringBonesMap.get(e);if(s)for(let e of s)a=!0,this._insertJointSort(e,t,n,r,i);else a||(o=e)}),o&&i.add(o)}r.push(e),n.add(e)}_relevantChildrenUpdated(e){return(this._objectSpringBonesMap.get(e)?.size??0)>0?!0:(e.updateWorldMatrix(!1,!1),!1)}},wu=`VRMC_springBone_extended_collider`,Tu=new Set([`1.0`,`1.0-beta`]),Eu=new Set([`1.0`]),Du=class e{get name(){return e.EXTENSION_NAME}constructor(e,t){this.parser=e,this.jointHelperRoot=t?.jointHelperRoot,this.colliderHelperRoot=t?.colliderHelperRoot,this.useExtendedColliders=t?.useExtendedColliders??!0}afterRoot(e){return Ul(this,null,function*(){e.userData.vrmSpringBoneManager=yield this._import(e)})}_import(e){return Ul(this,null,function*(){return(yield this._v1Import(e))??(yield this._v0Import(e))??null})}_v1Import(t){return Ul(this,null,function*(){var n;let r=t.parser.json;if(r.extensionsUsed?.indexOf(e.EXTENSION_NAME)===-1)return null;let i=new Cu,a=yield t.parser.getDependencies(`node`),o=r.extensions?.[e.EXTENSION_NAME];if(!o)return null;let s=o.specVersion;if(!Tu.has(s))return console.warn(`VRMSpringBoneLoaderPlugin: Unknown ${e.EXTENSION_NAME} specVersion "${s}"`),null;let c=o.colliders?.map((t,n)=>{let r=a[t.node];if(r==null)return console.warn(`VRMSpringBoneLoaderPlugin: The collider #${n} attempted to use the node #${t.node} but not found`),null;let i=t.shape,o=t.extensions?.[wu];if(this.useExtendedColliders&&o!=null){let t=o.specVersion;if(!Eu.has(t))console.warn(`VRMSpringBoneLoaderPlugin: Unknown ${wu} specVersion "${t}". Fallbacking to the ${e.EXTENSION_NAME} definition`);else{let e=o.shape;if(e.sphere)return this._importSphereCollider(r,{offset:new F().fromArray(e.sphere.offset??[0,0,0]),radius:e.sphere.radius??0,inside:e.sphere.inside??!1});if(e.capsule)return this._importCapsuleCollider(r,{offset:new F().fromArray(e.capsule.offset??[0,0,0]),radius:e.capsule.radius??0,tail:new F().fromArray(e.capsule.tail??[0,0,0]),inside:e.capsule.inside??!1});if(e.plane)return this._importPlaneCollider(r,{offset:new F().fromArray(e.plane.offset??[0,0,0]),normal:new F().fromArray(e.plane.normal??[0,0,1])})}}if(i.sphere)return this._importSphereCollider(r,{offset:new F().fromArray(i.sphere.offset??[0,0,0]),radius:i.sphere.radius??0,inside:!1});if(i.capsule)return this._importCapsuleCollider(r,{offset:new F().fromArray(i.capsule.offset??[0,0,0]),radius:i.capsule.radius??0,tail:new F().fromArray(i.capsule.tail??[0,0,0]),inside:!1});throw Error(`VRMSpringBoneLoaderPlugin: The collider #${n} has no valid shape`)}),l=o.colliderGroups?.map((e,t)=>({colliders:(e.colliders??[]).flatMap(e=>c?.[e]??(console.warn(`VRMSpringBoneLoaderPlugin: The colliderGroup #${t} attempted to use a collider #${e} but not found`),[])),name:e.name}));return(n=o.springs)==null||n.forEach((e,t)=>{let n=e.joints,r=e.colliderGroups?.map(e=>{let n=l?.[e];if(n==null)throw Error(`VRMSpringBoneLoaderPlugin: The spring #${t} attempted to use a colliderGroup ${e} but not found`);return n}),o=e.center==null?void 0:a[e.center],s;n.forEach(e=>{if(s){let t=a[s.node],n=a[e.node],c={hitRadius:s.hitRadius,dragForce:s.dragForce,gravityPower:s.gravityPower,stiffness:s.stiffness,gravityDir:s.gravityDir==null?void 0:new F().fromArray(s.gravityDir)},l=this._importJoint(t,n,c,r);o&&(l.center=o),i.addJoint(l)}s=e})}),i.setInitState(),i})}_v0Import(e){return Ul(this,null,function*(){let t=e.parser.json;if(t.extensionsUsed?.indexOf(`VRM`)===-1)return null;let n=t.extensions?.VRM?.secondaryAnimation;if(!n)return null;let r=n?.boneGroups;if(!r)return null;let i=new Cu,a=yield e.parser.getDependencies(`node`),o=n.colliderGroups?.map(e=>{let t=a[e.node];return{colliders:(e.colliders??[]).map((e,n)=>{let r=new F(0,0,0);return e.offset&&r.set(e.offset.x??0,e.offset.y??0,e.offset.z?-e.offset.z:0),this._importSphereCollider(t,{offset:r,radius:e.radius??0,inside:!1})})}});return r?.forEach((e,t)=>{let n=e.bones;n&&n.forEach(n=>{let r=a[n],s=new F;e.gravityDir?s.set(e.gravityDir.x??0,e.gravityDir.y??0,e.gravityDir.z??0):s.set(0,-1,0);let c=e.center==null?void 0:a[e.center],l={hitRadius:e.hitRadius,dragForce:e.dragForce,gravityPower:e.gravityPower,stiffness:e.stiffiness,gravityDir:s},u=e.colliderGroups?.map(e=>{let n=o?.[e];if(n==null)throw Error(`VRMSpringBoneLoaderPlugin: The spring #${t} attempted to use a colliderGroup ${e} but not found`);return n});r.traverse(e=>{let t=e.children[0]??null,n=this._importJoint(e,t,l,u);c&&(n.center=c),i.addJoint(n)})})}),e.scene.updateMatrixWorld(),i.setInitState(),i})}_importJoint(e,t,n,r){let i=new yu(e,t,n,r);if(this.jointHelperRoot){let e=new su(i);this.jointHelperRoot.add(e),e.renderOrder=this.jointHelperRoot.renderOrder}return i}_importSphereCollider(e,t){let n=new cu(new Ql(t));if(e.add(n),this.colliderHelperRoot){let e=new iu(n);this.colliderHelperRoot.add(e),e.renderOrder=this.colliderHelperRoot.renderOrder}return n}_importCapsuleCollider(e,t){let n=new cu(new ql(t));if(e.add(n),this.colliderHelperRoot){let e=new iu(n);this.colliderHelperRoot.add(e),e.renderOrder=this.colliderHelperRoot.renderOrder}return n}_importPlaneCollider(e,t){let n=new cu(new Xl(t));if(e.add(n),this.colliderHelperRoot){let e=new iu(n);this.colliderHelperRoot.add(e),e.renderOrder=this.colliderHelperRoot.renderOrder}return n}};Du.EXTENSION_NAME=`VRMC_springBone`;var Ou=Du,ku=class{get name(){return`VRMLoaderPlugin`}constructor(e,t){this.parser=e;let n=t?.helperRoot,r=t?.autoUpdateHumanBones;this.expressionPlugin=t?.expressionPlugin??new Ts(e),this.firstPersonPlugin=t?.firstPersonPlugin??new ks(e),this.humanoidPlugin=t?.humanoidPlugin??new Js(e,{helperRoot:n,autoUpdateHumanBones:r}),this.lookAtPlugin=t?.lookAtPlugin??new Ac(e,{helperRoot:n}),this.metaPlugin=t?.metaPlugin??new Nc(e),this.mtoonMaterialPlugin=t?.mtoonMaterialPlugin??new $c(e),this.materialsHDREmissiveMultiplierPlugin=t?.materialsHDREmissiveMultiplierPlugin??new nl(e),this.materialsV0CompatPlugin=t?.materialsV0CompatPlugin??new ml(e),this.springBonePlugin=t?.springBonePlugin??new Ou(e,{colliderHelperRoot:n,jointHelperRoot:n}),this.nodeConstraintPlugin=t?.nodeConstraintPlugin??new Hl(e,{helperRoot:n})}beforeRoot(){return os(this,null,function*(){yield this.materialsV0CompatPlugin.beforeRoot(),yield this.mtoonMaterialPlugin.beforeRoot()})}loadMesh(e){return os(this,null,function*(){return yield this.mtoonMaterialPlugin.loadMesh(e)})}getMaterialType(e){return this.mtoonMaterialPlugin.getMaterialType(e)??null}extendMaterialParams(e,t){return os(this,null,function*(){yield this.materialsHDREmissiveMultiplierPlugin.extendMaterialParams(e,t),yield this.mtoonMaterialPlugin.extendMaterialParams(e,t)})}afterRoot(e){return os(this,null,function*(){yield this.metaPlugin.afterRoot(e),yield this.humanoidPlugin.afterRoot(e),yield this.expressionPlugin.afterRoot(e),yield this.lookAtPlugin.afterRoot(e),yield this.firstPersonPlugin.afterRoot(e),yield this.springBonePlugin.afterRoot(e),yield this.nodeConstraintPlugin.afterRoot(e),yield this.mtoonMaterialPlugin.afterRoot(e);let t=e.userData.vrmMeta,n=e.userData.vrmHumanoid;if(t&&n){let r=new Fc({scene:e.scene,expressionManager:e.userData.vrmExpressionManager,firstPerson:e.userData.vrmFirstPerson,humanoid:n,lookAt:e.userData.vrmLookAt,meta:t,materials:e.userData.vrmMToonMaterials,springBoneManager:e.userData.vrmSpringBoneManager,nodeConstraintManager:e.userData.vrmNodeConstraintManager});e.userData.vrm=r}})}};function Au(e){let t=new Set;return e.traverse(e=>{if(!e.isMesh)return;let n=e;t.add(n)}),t}function ju(e,t,n){if(t.size===1){let n=t.values().next().value;if(n.weight===1)return e[n.index]}let r=new Float32Array(e[0].count*3),i=0;if(n)i=1;else for(let e of t)i+=e.weight;for(let n of t){let t=e[n.index],a=n.weight/i;for(let e=0;el.getOrCreate(e)).join(`,`)}`,u=o.get(c);u??(u=t.clone(),Bu(u,i,r),o.set(c,u)),e.geometry.setAttribute(`skinIndex`,u)}for(let e of n)e.bind(i,new B)}}function Iu(e){let t=new Set;return e.traverse(e=>{if(!e.isSkinnedMesh)return;let n=e;t.add(n)}),t}function Lu(e,t){let n=new Set;for(let r=0;rn)return!1;return!0}var Hu=class{constructor(){this._objectIndexMap=new Map,this._index=0}get(e){return this._objectIndexMap.get(e)}getOrCreate(e){let t=this._objectIndexMap.get(e);return t??(t=this._index,this._objectIndexMap.set(e,t),this._index++),t}};function Uu(e){let t=new Gt;t.name=e.name,t.setIndex(e.index);for(let[n,r]of Object.entries(e.attributes))t.setAttribute(n,r);for(let[n,r]of Object.entries(e.morphAttributes)){let e=n;t.morphAttributes[e]=r.concat()}t.morphTargetsRelative=e.morphTargetsRelative,t.groups=[];for(let n of e.groups)t.addGroup(n.start,n.count,n.materialIndex);return t.boundingSphere=e.boundingSphere?.clone()??null,t.boundingBox=e.boundingBox?.clone()??null,t.drawRange.start=e.drawRange.start,t.drawRange.count=e.drawRange.count,t.userData=e.userData,t}function Wu(e){if(Object.values(e).forEach(e=>{e?.isTexture&&e.dispose()}),e.isShaderMaterial){let t=e.uniforms;t&&Object.values(t).forEach(e=>{let t=e.value;t?.isTexture&&t.dispose()})}e.dispose()}function Gu(e){let t=e.geometry;t&&t.dispose();let n=e.skeleton;n&&n.dispose();let r=e.material;r&&(Array.isArray(r)?r.forEach(e=>Wu(e)):r&&Wu(r))}function Ku(e){e.traverse(Gu)}function qu(e,t){console.warn(`VRMUtils.removeUnnecessaryJoints: removeUnnecessaryJoints is deprecated. Use combineSkeletons instead. combineSkeletons contributes more to the performance improvement. This function will be removed in the next major version.`);let n=t?.experimentalSameBoneCounts??!1,r=[];e.traverse(e=>{e.type===`SkinnedMesh`&&r.push(e)});let i=new Map,a=0;for(let e of r){let t=e.geometry.getAttribute(`skinIndex`);if(i.has(t))continue;let n=new Map,r=new Map;for(let e=0;e{if(!e.isMesh)return;let n=e,r=n.geometry,i=r.index;if(i==null)return;let a=t.get(r);if(a!=null){n.geometry=a;return}let o=Object.values(r.attributes)[0].count,s=Array(o),c=0,l=i.array;for(let e=0;e{p.addGroup(e.start,e.count,e.materialIndex)}),p.boundingBox=r.boundingBox?.clone()??null,p.boundingSphere=r.boundingSphere?.clone()??null,p.setDrawRange(r.drawRange.start,r.drawRange.count),p.userData=r.userData,t.set(r,p);{let e=i.array,t=new e.constructor(e.length);for(let n=0;n{let t=r.attributes[e];if(t.isInterleavedBufferAttribute)throw Error(`removeUnnecessaryVertices: InterleavedBufferAttribute is not supported`);let n=t.array,{itemSize:i,normalized:a}=t,o=new n.constructor(d.length*i);d.forEach((e,t)=>{for(let r=0;r{for(let n=0;ne===0),p.morphAttributes[n][e]=new V(s,a,o)}}m&&(p.morphAttributes={}),n.geometry=p}),Array.from(t.keys()).forEach(e=>{e.dispose()})}function Yu(e){e.meta?.metaVersion===`0`&&(e.scene.rotation.y=Math.PI)}var Xu=class{constructor(){}};Xu.combineMorphs=Mu,Xu.combineSkeletons=Fu,Xu.deepDispose=Ku,Xu.removeUnnecessaryJoints=qu,Xu.removeUnnecessaryVertices=Ju,Xu.rotateVRM0=Yu;var Zu=` #ifndef AIRI_DIFFUSE_VS_DECL #define AIRI_DIFFUSE_VS_DECL varying vec3 vWorldNormal; @@ -2940,4 +2940,4 @@ if (uNprEnvMode == 2) { gl_FragColor.rgb += (gl_FragColor.rgb / PI) * I * uEnvIntensity; } #endif -`;function td(e){return e===`skyBox`?`skyBox`:e===`hemisphere`?`hemisphere`:`off`}function nd(e,t){if(!(!e?.uSHCoeffs||!e.uSHCoeffs.value||!Array.isArray(e.uSHCoeffs.value))&&t)for(let n=0;n<9;n++)e.uSHCoeffs.value[n]||=new F,e.uSHCoeffs.value[n].copy(t.coefficients[n])}function rd(e){let t=e.customProgramCacheKey?.()??``;e.customProgramCacheKey=()=>`${t}|airi-diffuse-ibl`;let n=e.onBeforeCompile;e.onBeforeCompile=(t,r)=>{n?.(t,r),t.vertexShader.includes(`AIRI_DIFFUSE_VS_DECL`)||(t.vertexShader=`${Zu}\n${t.vertexShader}`),t.vertexShader.includes(`#include `)&&!t.vertexShader.includes(`AIRI_DIFFUSE_VS_APPLY`)&&(t.vertexShader=t.vertexShader.replace(`#include `,`#include \n${Qu}`)),t.fragmentShader.includes(`AIRI_DIFFUSE_COMMON`)||(t.fragmentShader=t.fragmentShader.replace(`#include `,`#include \n${$u}`)),t.fragmentShader.includes(`AIRI_DIFFUSE_APPLY`)||(t.fragmentShader=t.fragmentShader.replace(`#include `,`${ed}\n#include `));let i=Array.from({length:9},()=>new F);t.uniforms.uNprEnvMode||={value:0},t.uniforms.uEnvIntensity||={value:0},t.uniforms.uSHCoeffs||={value:i},(e.userData||={}).__airiIbl=t.uniforms},`toneMapped`in e&&(e.toneMapped=!1),e.needsUpdate=!0}function id(e,t){let n=t.mode===`skyBox`?2:0;e.traverse(e=>{let r=e.material;(r?Array.isArray(r)?r:[r]:[]).forEach(e=>{let r=e?.userData?.__airiIbl;r&&(r.uNprEnvMode.value=n,r.uEnvIntensity.value=t.intensity,nd(r,t.sh??null))})})}function ad(e){let t=new Ge;t.name=`AIRI_IBL_Probe`,e.add(t);function n(e,n,r){t.intensity=e===`skyBox`?n:0,r&&t.sh.copy(r)}function r(){t.parent?.remove(t)}return{update:n,dispose:r}}var od=(e,t,n)=>new Promise((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())}),Q=(e,t,n)=>new Promise((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())}),sd=class extends k{constructor(e){super(),this.weight=0,this.isBinary=!1,this.overrideBlink=`none`,this.overrideLookAt=`none`,this.overrideMouth=`none`,this._binds=[],this.name=`VRMExpression_${e}`,this.expressionName=e,this.type=`VRMExpression`,this.visible=!1}get binds(){return this._binds}get overrideBlinkAmount(){return this.overrideBlink===`block`?0.5?1:0:this.weight}addBind(e){this._binds.push(e)}deleteBind(e){let t=this._binds.indexOf(e);t>=0&&this._binds.splice(t,1)}applyWeight(e){let t=this.outputWeight;t*=e?.multiplier??1,this.isBinary&&t<1&&(t=0),this._binds.forEach(e=>e.applyWeight(t))}clearAppliedWeight(){this._binds.forEach(e=>e.clearAppliedWeight())}};function cd(e,t,n){let r=e.parser.json,i=r.nodes?.[t];if(i==null)return console.warn(`extractPrimitivesInternal: Attempt to use nodes[${t}] of glTF but the node doesn't exist`),null;let a=i.mesh;if(a==null)return null;let o=r.meshes?.[a];if(o==null)return console.warn(`extractPrimitivesInternal: Attempt to use meshes[${a}] of glTF but the mesh doesn't exist`),null;let s=o.primitives.length,c=[];return n.traverse(e=>{c.length{t.has(n)&&(e[n]=r)}),e}get customExpressionMap(){let e={},t=new Set(Object.values(ud));return Object.entries(this._expressionMap).forEach(([n,r])=>{t.has(n)||(e[n]=r)}),e}copy(e){return this._expressions.concat().forEach(e=>{this.unregisterExpression(e)}),e._expressions.forEach(e=>{this.registerExpression(e)}),this.blinkExpressionNames=e.blinkExpressionNames.concat(),this.lookAtExpressionNames=e.lookAtExpressionNames.concat(),this.mouthExpressionNames=e.mouthExpressionNames.concat(),this}clone(){return new e().copy(this)}getExpression(e){return this._expressionMap[e]??null}registerExpression(e){this._expressions.push(e),this._expressionMap[e.expressionName]=e}unregisterExpression(e){let t=this._expressions.indexOf(e);t===-1&&console.warn(`VRMExpressionManager: The specified expressions is not registered`),this._expressions.splice(t,1),delete this._expressionMap[e.expressionName]}getValue(e){return this.getExpression(e)?.weight??null}setValue(e,t){let n=this.getExpression(e);n&&(n.weight=dd(t))}resetValues(){this._expressions.forEach(e=>{e.weight=0})}getExpressionTrackName(e){let t=this.getExpression(e);return t?`${t.name}.weight`:null}update(){let e=this._calculateWeightMultipliers();this._expressions.forEach(e=>{e.clearAppliedWeight()}),this._expressions.forEach(t=>{let n=1,r=t.expressionName;this.blinkExpressionNames.indexOf(r)!==-1&&(n*=e.blink),this.lookAtExpressionNames.indexOf(r)!==-1&&(n*=e.lookAt),this.mouthExpressionNames.indexOf(r)!==-1&&(n*=e.mouth),t.applyWeight({multiplier:n})})}_calculateWeightMultipliers(){let e=1,t=1,n=1;return this._expressions.forEach(r=>{e-=r.overrideBlinkAmount,t-=r.overrideLookAtAmount,n-=r.overrideMouthAmount}),e=Math.max(0,e),t=Math.max(0,t),n=Math.max(0,n),{blink:e,lookAt:t,mouth:n}}},pd={Color:`color`,EmissionColor:`emissionColor`,ShadeColor:`shadeColor`,MatcapColor:`matcapColor`,RimColor:`rimColor`,OutlineColor:`outlineColor`},md={_Color:pd.Color,_EmissionColor:pd.EmissionColor,_ShadeColor:pd.ShadeColor,_RimColor:pd.RimColor,_OutlineColor:pd.OutlineColor},hd=new H,gd=class e{constructor({material:e,type:t,targetValue:n,targetAlpha:r}){this.material=e,this.type=t,this.targetValue=n,this.targetAlpha=r??1,this._state={color:this._initColorBindState(),alpha:this._initAlphaBindState()}}applyWeight(e){let{color:t,alpha:n}=this._state;if(t!=null){let{propertyName:n,deltaValue:r}=t;this.material[n]?.add(hd.copy(r).multiplyScalar(e))}if(n!=null){let{propertyName:t,deltaValue:r}=n;this.material[t]!=null&&(this.material[t]+=r*e)}}clearAppliedWeight(){let{color:e,alpha:t}=this._state;if(e!=null){let{propertyName:t,initialValue:n}=e;this.material[t]?.copy(n)}if(t!=null){let{propertyName:e,initialValue:n}=t;this.material[e]!=null&&(this.material[e]=n)}}_initColorBindState(){let{material:e,type:t,targetValue:n}=this,r=this._getPropertyNameMap()?.[t]?.[0]??null;if(r==null)return console.warn(`Tried to add a material color bind to the material ${e.name??`(no name)`}, the type ${t} but the material or the type is not supported.`),null;let i=e[r].clone();return{propertyName:r,initialValue:i,deltaValue:new H(n.r-i.r,n.g-i.g,n.b-i.b)}}_initAlphaBindState(){let{material:e,type:t,targetAlpha:n}=this,r=this._getPropertyNameMap()?.[t]?.[1]??null;if(r==null&&n!==1)return console.warn(`Tried to add a material alpha bind to the material ${e.name??`(no name)`}, the type ${t} but the material or the type does not support alpha.`),null;if(r==null)return null;let i=e[r];return{propertyName:r,initialValue:i,deltaValue:n-i}}_getPropertyNameMap(){return Object.entries(e._propertyNameMapMap).find(([e])=>this.material[e]===!0)?.[1]??null}};gd._propertyNameMapMap={isMeshStandardMaterial:{color:[`color`,`opacity`],emissionColor:[`emissive`,null]},isMeshBasicMaterial:{color:[`color`,`opacity`]},isMToonMaterial:{color:[`color`,`opacity`],emissionColor:[`emissive`,null],outlineColor:[`outlineColorFactor`,null],matcapColor:[`matcapFactor`,null],rimColor:[`parametricRimColorFactor`,null],shadeColor:[`shadeColorFactor`,null]}};var _d=gd,vd=class{constructor({primitives:e,index:t,weight:n}){this.primitives=e,this.index=t,this.weight=n}applyWeight(e){this.primitives.forEach(t=>{t.morphTargetInfluences?.[this.index]!=null&&(t.morphTargetInfluences[this.index]+=this.weight*e)})}clearAppliedWeight(){this.primitives.forEach(e=>{e.morphTargetInfluences?.[this.index]!=null&&(e.morphTargetInfluences[this.index]=0)})}},yd=new L,bd=class e{constructor({material:t,scale:n,offset:r}){this.material=t,this.scale=n,this.offset=r;let i=Object.entries(e._propertyNamesMap).find(([e])=>t[e]===!0)?.[1];i==null?(console.warn(`Tried to add a texture transform bind to the material ${t.name??`(no name)`} but the material is not supported.`),this._properties=[]):(this._properties=[],i.forEach(e=>{let i=t[e]?.clone();if(!i)return null;t[e]=i;let a=i.offset.clone(),o=i.repeat.clone(),s=r.clone().sub(a),c=n.clone().sub(o);this._properties.push({name:e,initialOffset:a,deltaOffset:s,initialScale:o,deltaScale:c})}))}applyWeight(e){this._properties.forEach(t=>{let n=this.material[t.name];n!==void 0&&(n.offset.add(yd.copy(t.deltaOffset).multiplyScalar(e)),n.repeat.add(yd.copy(t.deltaScale).multiplyScalar(e)))})}clearAppliedWeight(){this._properties.forEach(e=>{let t=this.material[e.name];t!==void 0&&(t.offset.copy(e.initialOffset),t.repeat.copy(e.initialScale))})}};bd._propertyNamesMap={isMeshStandardMaterial:[`map`,`emissiveMap`,`bumpMap`,`normalMap`,`displacementMap`,`roughnessMap`,`metalnessMap`,`alphaMap`],isMeshBasicMaterial:[`map`,`specularMap`,`alphaMap`],isMToonMaterial:[`map`,`normalMap`,`emissiveMap`,`shadeMultiplyTexture`,`rimMultiplyTexture`,`outlineWidthMultiplyTexture`,`uvAnimationMaskTexture`]};var xd=bd,Sd=new Set([`1.0`,`1.0-beta`]),Cd=class e{get name(){return`VRMExpressionLoaderPlugin`}constructor(e){this.parser=e}afterRoot(e){return Q(this,null,function*(){e.userData.vrmExpressionManager=yield this._import(e)})}_import(e){return Q(this,null,function*(){return(yield this._v1Import(e))||(yield this._v0Import(e))||null})}_v1Import(e){return Q(this,null,function*(){let t=this.parser.json;if(t.extensionsUsed?.indexOf(`VRMC_vrm`)===-1)return null;let n=t.extensions?.VRMC_vrm;if(!n)return null;let r=n.specVersion;if(!Sd.has(r))return console.warn(`VRMExpressionLoaderPlugin: Unknown VRMC_vrm specVersion "${r}"`),null;let i=n.expressions;if(!i)return null;let a=new Set(Object.values(ud)),o=new Map;i.preset!=null&&Object.entries(i.preset).forEach(([e,t])=>{if(t!=null){if(!a.has(e)){console.warn(`VRMExpressionLoaderPlugin: Unknown preset name "${e}" detected. Ignoring the expression`);return}o.set(e,t)}}),i.custom!=null&&Object.entries(i.custom).forEach(([e,t])=>{if(a.has(e)){console.warn(`VRMExpressionLoaderPlugin: Custom expression cannot have preset name "${e}". Ignoring the expression`);return}o.set(e,t)});let s=new fd;return yield Promise.all(Array.from(o.entries()).map(t=>Q(this,[t],function*([t,n]){var r,i,a;let o=new sd(t);if(e.scene.add(o),o.isBinary=n.isBinary??!1,o.overrideBlink=n.overrideBlink??`none`,o.overrideLookAt=n.overrideLookAt??`none`,o.overrideMouth=n.overrideMouth??`none`,(r=n.morphTargetBinds)==null||r.forEach(t=>Q(this,null,function*(){if(t.node===void 0||t.index===void 0)return;let r=yield ld(e,t.node),i=t.index;if(!r.every(e=>Array.isArray(e.morphTargetInfluences)&&i{let n=e.material;n&&(Array.isArray(n)?t.push(...n):t.push(n))}),(i=n.materialColorBinds)==null||i.forEach(e=>Q(this,null,function*(){t.filter(t=>{let n=this.parser.associations.get(t)?.materials;return e.material===n}).forEach(t=>{o.addBind(new _d({material:t,type:e.type,targetValue:new H().fromArray(e.targetValue),targetAlpha:e.targetValue[3]}))})})),(a=n.textureTransformBinds)==null||a.forEach(e=>Q(this,null,function*(){t.filter(t=>{let n=this.parser.associations.get(t)?.materials;return e.material===n}).forEach(t=>{o.addBind(new xd({material:t,offset:new L().fromArray(e.offset??[0,0]),scale:new L().fromArray(e.scale??[1,1])}))})}))}s.registerExpression(o)}))),s})}_v0Import(t){return Q(this,null,function*(){let n=this.parser.json,r=n.extensions?.VRM;if(!r)return null;let i=r.blendShapeMaster;if(!i)return null;let a=new fd,o=i.blendShapeGroups;if(!o)return a;let s=new Set;return yield Promise.all(o.map(r=>Q(this,null,function*(){let i=r.presetName,o=(i!=null&&e.v0v1PresetNameMap[i]||null)??r.name;if(o==null){console.warn(`VRMExpressionLoaderPlugin: One of custom expressions has no name. Ignoring the expression`);return}if(s.has(o)){console.warn(`VRMExpressionLoaderPlugin: An expression preset ${i} has duplicated entries. Ignoring the expression`);return}s.add(o);let c=new sd(o);t.scene.add(c),c.isBinary=r.isBinary??!1,r.binds&&r.binds.forEach(e=>Q(this,null,function*(){var i;if(e.mesh===void 0||e.index===void 0)return;let a=[];(i=n.nodes)==null||i.forEach((t,n)=>{t.mesh===e.mesh&&a.push(n)});let o=e.index;yield Promise.all(a.map(n=>Q(this,null,function*(){let i=yield ld(t,n);if(!i.every(e=>Array.isArray(e.morphTargetInfluences)&&o{if(e.materialName===void 0||e.propertyName===void 0||e.targetValue===void 0)return;let n=[];t.scene.traverse(t=>{if(t.material){let r=t.material;Array.isArray(r)?n.push(...r.filter(t=>(t.name===e.materialName||t.name===e.materialName+` (Outline)`)&&n.indexOf(t)===-1)):r.name===e.materialName&&n.indexOf(r)===-1&&n.push(r)}});let r=e.propertyName;n.forEach(t=>{if(r===`_MainTex_ST`){let n=new L(e.targetValue[0],e.targetValue[1]),r=new L(e.targetValue[2],e.targetValue[3]);r.y=1-r.y-n.y,c.addBind(new xd({material:t,scale:n,offset:r}));return}let n=md[r];if(n){c.addBind(new _d({material:t,type:n,targetValue:new H().fromArray(e.targetValue),targetAlpha:e.targetValue[3]}));return}console.warn(r+` is not supported`)})}),a.registerExpression(c)}))),a})}};Cd.v0v1PresetNameMap={a:`aa`,e:`ee`,i:`ih`,o:`oh`,u:`ou`,blink:`blink`,joy:`happy`,angry:`angry`,sorrow:`sad`,fun:`relaxed`,lookup:`lookUp`,lookdown:`lookDown`,lookleft:`lookLeft`,lookright:`lookRight`,blink_l:`blinkLeft`,blink_r:`blinkRight`,neutral:`neutral`};var wd=class e{constructor(t,n){this._firstPersonOnlyLayer=e.DEFAULT_FIRSTPERSON_ONLY_LAYER,this._thirdPersonOnlyLayer=e.DEFAULT_THIRDPERSON_ONLY_LAYER,this._initializedLayers=!1,this.humanoid=t,this.meshAnnotations=n}copy(e){if(this.humanoid!==e.humanoid)throw Error(`VRMFirstPerson: humanoid must be same in order to copy`);return this.meshAnnotations=e.meshAnnotations.map(e=>({meshes:e.meshes.concat(),type:e.type})),this}clone(){return new e(this.humanoid,this.meshAnnotations).copy(this)}get firstPersonOnlyLayer(){return this._firstPersonOnlyLayer}get thirdPersonOnlyLayer(){return this._thirdPersonOnlyLayer}setup({firstPersonOnlyLayer:t=e.DEFAULT_FIRSTPERSON_ONLY_LAYER,thirdPersonOnlyLayer:n=e.DEFAULT_THIRDPERSON_ONLY_LAYER}={}){this._initializedLayers||=(this._firstPersonOnlyLayer=t,this._thirdPersonOnlyLayer=n,this.meshAnnotations.forEach(e=>{e.meshes.forEach(t=>{e.type===`firstPersonOnly`?(t.layers.set(this._firstPersonOnlyLayer),t.traverse(e=>e.layers.set(this._firstPersonOnlyLayer))):e.type===`thirdPersonOnly`?(t.layers.set(this._thirdPersonOnlyLayer),t.traverse(e=>e.layers.set(this._thirdPersonOnlyLayer))):e.type===`auto`&&this._createHeadlessModel(t)})}),!0)}_excludeTriangles(e,t,n,r){let i=0;if(t!=null&&t.length>0)for(let a=0;a0&&r.includes(u[0])||l[1]>0&&r.includes(u[1])||l[2]>0&&r.includes(u[2])||l[3]>0&&r.includes(u[3]))continue;let d=t[s],f=n[s];if(d[0]>0&&r.includes(f[0])||d[1]>0&&r.includes(f[1])||d[2]>0&&r.includes(f[2])||d[3]>0&&r.includes(f[3]))continue;let p=t[c],m=n[c];p[0]>0&&r.includes(m[0])||p[1]>0&&r.includes(m[1])||p[2]>0&&r.includes(m[2])||p[3]>0&&r.includes(m[3])||(e[i++]=o,e[i++]=s,e[i++]=c)}return i}_createErasedMesh(e,t){let n=new Be(e.geometry.clone(),e.material);n.name=`${e.name}(erase)`,n.frustumCulled=e.frustumCulled,n.layers.set(this._firstPersonOnlyLayer);let r=n.geometry,i=r.getAttribute(`skinIndex`),a=i instanceof be?[]:i.array,o=[];for(let e=0;e{this._isEraseTarget(e)&&n.push(t)}),!n.length){t.layers.enable(this._thirdPersonOnlyLayer),t.layers.enable(this._firstPersonOnlyLayer);return}t.layers.set(this._thirdPersonOnlyLayer);let r=this._createErasedMesh(t,n);e.add(r)}_createHeadlessModel(e){if(e.type===`Group`)if(e.layers.set(this._thirdPersonOnlyLayer),this._isEraseTarget(e))e.traverse(e=>e.layers.set(this._thirdPersonOnlyLayer));else{let t=new je;t.name=`_headless_${e.name}`,t.layers.set(this._firstPersonOnlyLayer),e.parent.add(t),e.children.filter(e=>e.type===`SkinnedMesh`).forEach(e=>{let n=e;this._createHeadlessModelForSkinnedMesh(t,n)})}else if(e.type===`SkinnedMesh`){let t=e;this._createHeadlessModelForSkinnedMesh(e.parent,t)}else this._isEraseTarget(e)&&(e.layers.set(this._thirdPersonOnlyLayer),e.traverse(e=>e.layers.set(this._thirdPersonOnlyLayer)))}_isEraseTarget(e){return e===this.humanoid.getRawBoneNode(`head`)?!0:e.parent?this._isEraseTarget(e.parent):!1}};wd.DEFAULT_FIRSTPERSON_ONLY_LAYER=9,wd.DEFAULT_THIRDPERSON_ONLY_LAYER=10,new F,new F,new R;var Td={hips:null,spine:`hips`,chest:`spine`,upperChest:`chest`,neck:`upperChest`,head:`neck`,leftEye:`head`,rightEye:`head`,jaw:`head`,leftUpperLeg:`hips`,leftLowerLeg:`leftUpperLeg`,leftFoot:`leftLowerLeg`,leftToes:`leftFoot`,rightUpperLeg:`hips`,rightLowerLeg:`rightUpperLeg`,rightFoot:`rightLowerLeg`,rightToes:`rightFoot`,leftShoulder:`upperChest`,leftUpperArm:`leftShoulder`,leftLowerArm:`leftUpperArm`,leftHand:`leftLowerArm`,rightShoulder:`upperChest`,rightUpperArm:`rightShoulder`,rightLowerArm:`rightUpperArm`,rightHand:`rightLowerArm`,leftThumbMetacarpal:`leftHand`,leftThumbProximal:`leftThumbMetacarpal`,leftThumbDistal:`leftThumbProximal`,leftIndexProximal:`leftHand`,leftIndexIntermediate:`leftIndexProximal`,leftIndexDistal:`leftIndexIntermediate`,leftMiddleProximal:`leftHand`,leftMiddleIntermediate:`leftMiddleProximal`,leftMiddleDistal:`leftMiddleIntermediate`,leftRingProximal:`leftHand`,leftRingIntermediate:`leftRingProximal`,leftRingDistal:`leftRingIntermediate`,leftLittleProximal:`leftHand`,leftLittleIntermediate:`leftLittleProximal`,leftLittleDistal:`leftLittleIntermediate`,rightThumbMetacarpal:`rightHand`,rightThumbProximal:`rightThumbMetacarpal`,rightThumbDistal:`rightThumbProximal`,rightIndexProximal:`rightHand`,rightIndexIntermediate:`rightIndexProximal`,rightIndexDistal:`rightIndexIntermediate`,rightMiddleProximal:`rightHand`,rightMiddleIntermediate:`rightMiddleProximal`,rightMiddleDistal:`rightMiddleIntermediate`,rightRingProximal:`rightHand`,rightRingIntermediate:`rightRingProximal`,rightRingDistal:`rightRingIntermediate`,rightLittleProximal:`rightHand`,rightLittleIntermediate:`rightLittleProximal`,rightLittleDistal:`rightLittleIntermediate`};function Ed(e){return e.invert?e.invert():e.inverse(),e}new F,new R,new F,new R,new F,new R,new R,new F,new F;var Dd=Math.sqrt(2)/2;new R(0,0,-Dd,Dd),new F(0,1,0);var Od=new F,kd=new F;function Ad(e,t){return e.matrixWorld.decompose(Od,t,kd),t}function jd(e){return[Math.atan2(-e.z,e.x),Math.atan2(e.y,Math.sqrt(e.x*e.x+e.z*e.z))]}function Md(e){let t=Math.round(e/2/Math.PI);return e-2*Math.PI*t}var Nd=new F(0,0,1),Pd=new F,Fd=new F,Id=new F,Ld=new R,Rd=new R,zd=new R,Bd=new R,Vd=new xe,Hd=class e{constructor(e,t){this.offsetFromHeadBone=new F,this.autoUpdate=!0,this.faceFront=new F(0,0,1),this.humanoid=e,this.applier=t,this._yaw=0,this._pitch=0,this._needsUpdate=!0,this._restHeadWorldQuaternion=this.getLookAtWorldQuaternion(new R)}get yaw(){return this._yaw}set yaw(e){this._yaw=e,this._needsUpdate=!0}get pitch(){return this._pitch}set pitch(e){this._pitch=e,this._needsUpdate=!0}get euler(){return console.warn(`VRMLookAt: euler is deprecated. use getEuler() instead.`),this.getEuler(new xe)}getEuler(e){return e.set(I.DEG2RAD*this._pitch,I.DEG2RAD*this._yaw,0,`YXZ`)}copy(e){if(this.humanoid!==e.humanoid)throw Error(`VRMLookAt: humanoid must be same in order to copy`);return this.offsetFromHeadBone.copy(e.offsetFromHeadBone),this.applier=e.applier,this.autoUpdate=e.autoUpdate,this.target=e.target,this.faceFront.copy(e.faceFront),this}clone(){return new e(this.humanoid,this.applier).copy(this)}reset(){this._yaw=0,this._pitch=0,this._needsUpdate=!0}getLookAtWorldPosition(e){let t=this.humanoid.getRawBoneNode(`head`);return e.copy(this.offsetFromHeadBone).applyMatrix4(t.matrixWorld)}getLookAtWorldQuaternion(e){return Ad(this.humanoid.getRawBoneNode(`head`),e)}getFaceFrontQuaternion(e){if(this.faceFront.distanceToSquared(Nd)<.01)return e.copy(this._restHeadWorldQuaternion).invert();let[t,n]=jd(this.faceFront);return Vd.set(0,.5*Math.PI+t,n,`YZX`),e.setFromEuler(Vd).premultiply(Bd.copy(this._restHeadWorldQuaternion).invert())}getLookAtWorldDirection(e){return this.getLookAtWorldQuaternion(Rd),this.getFaceFrontQuaternion(zd),e.copy(Nd).applyQuaternion(Rd).applyQuaternion(zd).applyEuler(this.getEuler(Vd))}lookAt(e){let t=Ld.copy(this._restHeadWorldQuaternion).multiply(Ed(this.getLookAtWorldQuaternion(Rd))),n=this.getLookAtWorldPosition(Fd),r=Id.copy(e).sub(n).applyQuaternion(t).normalize(),[i,a]=jd(this.faceFront),[o,s]=jd(r),c=Md(o-i),l=Md(a-s);this._yaw=I.RAD2DEG*c,this._pitch=I.RAD2DEG*l,this._needsUpdate=!0}update(e){this.target!=null&&this.autoUpdate&&this.lookAt(this.target.getWorldPosition(Pd)),this._needsUpdate&&(this._needsUpdate=!1,this.applier.applyYawPitch(this._yaw,this._pitch))}};Hd.EULER_ORDER=`YXZ`;var Ud=Hd,Wd=new F(0,0,1),Gd=new R,Kd=new R,qd=new xe(0,0,0,`YXZ`),Jd=class{constructor(e,t,n,r,i){this.humanoid=e,this.rangeMapHorizontalInner=t,this.rangeMapHorizontalOuter=n,this.rangeMapVerticalDown=r,this.rangeMapVerticalUp=i,this.faceFront=new F(0,0,1),this._restQuatLeftEye=new R,this._restQuatRightEye=new R,this._restLeftEyeParentWorldQuat=new R,this._restRightEyeParentWorldQuat=new R;let a=this.humanoid.getRawBoneNode(`leftEye`),o=this.humanoid.getRawBoneNode(`rightEye`);a&&(this._restQuatLeftEye.copy(a.quaternion),Ad(a.parent,this._restLeftEyeParentWorldQuat)),o&&(this._restQuatRightEye.copy(o.quaternion),Ad(o.parent,this._restRightEyeParentWorldQuat))}applyYawPitch(e,t){let n=this.humanoid.getRawBoneNode(`leftEye`),r=this.humanoid.getRawBoneNode(`rightEye`),i=this.humanoid.getNormalizedBoneNode(`leftEye`),a=this.humanoid.getNormalizedBoneNode(`rightEye`);n&&(t<0?qd.x=-I.DEG2RAD*this.rangeMapVerticalDown.map(-t):qd.x=I.DEG2RAD*this.rangeMapVerticalUp.map(t),e<0?qd.y=-I.DEG2RAD*this.rangeMapHorizontalInner.map(-e):qd.y=I.DEG2RAD*this.rangeMapHorizontalOuter.map(e),Gd.setFromEuler(qd),this._getWorldFaceFrontQuat(Kd),i.quaternion.copy(Kd).multiply(Gd).multiply(Kd.invert()),Gd.copy(this._restLeftEyeParentWorldQuat),n.quaternion.copy(i.quaternion).multiply(Gd).premultiply(Gd.invert()).multiply(this._restQuatLeftEye)),r&&(t<0?qd.x=-I.DEG2RAD*this.rangeMapVerticalDown.map(-t):qd.x=I.DEG2RAD*this.rangeMapVerticalUp.map(t),e<0?qd.y=-I.DEG2RAD*this.rangeMapHorizontalOuter.map(-e):qd.y=I.DEG2RAD*this.rangeMapHorizontalInner.map(e),Gd.setFromEuler(qd),this._getWorldFaceFrontQuat(Kd),a.quaternion.copy(Kd).multiply(Gd).multiply(Kd.invert()),Gd.copy(this._restRightEyeParentWorldQuat),r.quaternion.copy(a.quaternion).multiply(Gd).premultiply(Gd.invert()).multiply(this._restQuatRightEye))}lookAt(e){console.warn(`VRMLookAtBoneApplier: lookAt() is deprecated. use apply() instead.`);let t=I.RAD2DEG*e.y,n=I.RAD2DEG*e.x;this.applyYawPitch(t,n)}_getWorldFaceFrontQuat(e){if(this.faceFront.distanceToSquared(Wd)<.01)return e.identity();let[t,n]=jd(this.faceFront);return qd.set(0,.5*Math.PI+t,n,`YZX`),e.setFromEuler(qd)}};Jd.type=`bone`;var Yd=class{constructor(e,t,n,r,i){this.expressions=e,this.rangeMapHorizontalInner=t,this.rangeMapHorizontalOuter=n,this.rangeMapVerticalDown=r,this.rangeMapVerticalUp=i}applyYawPitch(e,t){t<0?(this.expressions.setValue(`lookDown`,0),this.expressions.setValue(`lookUp`,this.rangeMapVerticalUp.map(-t))):(this.expressions.setValue(`lookUp`,0),this.expressions.setValue(`lookDown`,this.rangeMapVerticalDown.map(t))),e<0?(this.expressions.setValue(`lookLeft`,0),this.expressions.setValue(`lookRight`,this.rangeMapHorizontalOuter.map(-e))):(this.expressions.setValue(`lookRight`,0),this.expressions.setValue(`lookLeft`,this.rangeMapHorizontalOuter.map(e)))}lookAt(e){console.warn(`VRMLookAtBoneApplier: lookAt() is deprecated. use apply() instead.`);let t=I.RAD2DEG*e.y,n=I.RAD2DEG*e.x;this.applyYawPitch(t,n)}};Yd.type=`expression`;var Xd=180/Math.PI,Zd=new xe,Qd=class extends k{constructor(e){super(),this.vrmLookAt=e,this.type=`VRMLookAtQuaternionProxy`;let t=this.rotation._onChangeCallback;this.rotation._onChange(()=>{t(),this._applyToLookAt()});let n=this.quaternion._onChangeCallback;this.quaternion._onChange(()=>{n(),this._applyToLookAt()})}_applyToLookAt(){Zd.setFromQuaternion(this.quaternion,Ud.EULER_ORDER),this.vrmLookAt.yaw=Xd*Zd.y,this.vrmLookAt.pitch=Xd*Zd.x}};function $d(e,t,n){let r=new Map,i=new Map;for(let[r,a]of e.humanoidTracks.rotation.entries()){let e=t.getNormalizedBoneNode(r)?.name;if(e!=null){let t=new Se(`${e}.quaternion`,a.times,a.values.map((e,t)=>n===`0`&&t%2==0?-e:e));i.set(r,t)}}for(let[i,a]of e.humanoidTracks.translation.entries()){let o=t.getNormalizedBoneNode(i)?.name;if(o!=null){let s=e.restHipsPosition.y,c=t.normalizedRestPose.hips.position[1]/s,l=a.clone();l.values=l.values.map((e,t)=>(n===`0`&&t%3!=1?-e:e)*c),l.name=`${o}.position`,r.set(i,l)}}return{translation:r,rotation:i}}function ef(e,t){let n=new Map,r=new Map;for(let[r,i]of e.expressionTracks.preset.entries()){let e=t.getExpressionTrackName(r);if(e!=null){let t=i.clone();t.name=e,n.set(r,t)}}for(let[n,i]of e.expressionTracks.custom.entries()){let e=t.getExpressionTrackName(n);if(e!=null){let t=i.clone();t.name=e,r.set(n,t)}}return{preset:n,custom:r}}function tf(e,t){if(e.lookAtTrack==null)return null;let n=e.lookAtTrack.clone();return n.name=t,n}function nf(e,t){let n=[],r=$d(e,t.humanoid,t.meta.metaVersion);if(n.push(...r.translation.values()),n.push(...r.rotation.values()),t.expressionManager!=null){let r=ef(e,t.expressionManager);n.push(...r.preset.values()),n.push(...r.custom.values())}if(t.lookAt!=null){let r=t.scene.children.find(e=>e instanceof Qd);r==null?(console.warn(`createVRMAnimationClip: VRMLookAtQuaternionProxy is not found. Creating a new one automatically. To suppress this warning, create a VRMLookAtQuaternionProxy manually`),r=new Qd(t.lookAt),r.name=`VRMLookAtQuaternionProxy`,t.scene.add(r)):r.name===``&&(console.warn(`createVRMAnimationClip: VRMLookAtQuaternionProxy is found but its name is not set. Setting the name automatically. To suppress this warning, set the name manually`),r.name=`VRMLookAtQuaternionProxy`);let i=tf(e,`${r.name}.quaternion`);i!=null&&n.push(i)}return new rt(`Clip`,e.duration,n)}var rf=class{constructor(){this.duration=0,this.restHipsPosition=new F,this.humanoidTracks={translation:new Map,rotation:new Map},this.expressionTracks={preset:new Map,custom:new Map},this.lookAtTrack=null}};function af(e,t){let n=e.length,r=[],i=[],a=0;for(let o=0;o{let r=t.animations[n],i=this._parseAnimation(e,r,a,o);return i.restHipsPosition=l,i});e.userData.vrmAnimations=u})}_createNodeMap(e){let t=new Map,n=new Map,r=e.humanoid?.humanBones;r&&Object.entries(r).forEach(([e,n])=>{let r=n?.node;r!=null&&t.set(r,e)});let i=e.expressions?.preset;i&&Object.entries(i).forEach(([e,t])=>{let r=t?.node;r!=null&&n.set(r,e)});let a=e.expressions?.custom;return a&&Object.entries(a).forEach(([e,t])=>{let{node:r}=t;n.set(r,e)}),{humanoidIndexToName:t,expressionsIndexToName:n,lookAtIndex:e.lookAt?.node??null}}_createBoneWorldMatrixMap(e,t){return od(this,null,function*(){e.scene.updateWorldMatrix(!1,!0);let n=yield e.parser.getDependencies(`node`),r=new Map;if(t.humanoid==null)return r;for(let[e,i]of Object.entries(t.humanoid.humanBones)){let t=i?.node;if(t!=null){let i=n[t];r.set(e,i.matrixWorld),e===`hips`&&r.set(`hipsParent`,i.parent?.matrixWorld??of)}}return r})}_parseAnimation(e,t,n,r){let i=e.tracks,a=t.channels,o=new rf;return o.duration=e.duration,a.forEach((e,t)=>{let{node:a,path:s}=e.target,c=i[t];if(a==null)return;let l=n.humanoidIndexToName.get(a);if(l!=null){let e=Td[l];for(;e!=null&&r.get(e)==null;)e=Td[e];if(e??=`hipsParent`,s===`translation`)if(l!==`hips`)console.warn(`The loading animation contains a translation track for ${l}, which is not permitted in the VRMC_vrm_animation spec. ignoring the track`);else{let e=r.get(`hipsParent`),t=af(c.values,3).flatMap(t=>sf.fromArray(t).applyMatrix4(e).toArray()),n=c.clone();n.values=new Float32Array(t),o.humanoidTracks.translation.set(l,n)}else if(s===`rotation`){let t=r.get(l),n=r.get(e);t.decompose(sf,cf,sf),cf.invert(),n.decompose(sf,lf,sf);let i=af(c.values,4).flatMap(e=>uf.fromArray(e).premultiply(lf).multiply(cf).toArray()),a=c.clone();a.values=new Float32Array(i),o.humanoidTracks.rotation.set(l,a)}else throw Error(`Invalid path "${s}"`);return}let u=n.expressionsIndexToName.get(a);if(u!=null){if(s===`translation`){let e=c.times,t=new Float32Array(c.values.length/3);for(let e=0;e=2.0 are supported.`));return}let c=new up(i,{path:t||this.resourcePath||``,crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let e=0;e=0&&o[t]===void 0&&console.warn(`THREE.GLTFLoader: Unknown extension "`+t+`".`)}}c.setExtensions(a),c.setPlugins(o),c.parse(n,r)}parseAsync(e,t){let n=this;return new Promise(function(r,i){n.parse(e,t,r,i)})}};function gf(){let e={};return{get:function(t){return e[t]},add:function(t,n){e[t]=n},remove:function(t){delete e[t]},removeAll:function(){e={}}}}var $={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`},_f=class{constructor(e){this.parser=e,this.name=$.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){let e=this.parser,t=this.parser.json.nodes||[];for(let n=0,r=t.length;n=0)throw Error(`THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures`);return null}return t.loadTextureImage(e,i.source,a)}},jf=class{constructor(e){this.parser=e,this.name=$.EXT_TEXTURE_WEBP}loadTexture(e){let t=this.name,n=this.parser,r=n.json,i=r.textures[e];if(!i.extensions||!i.extensions[t])return null;let a=i.extensions[t],o=r.images[a.source],s=n.textureLoader;if(o.uri){let e=n.options.manager.getHandler(o.uri);e!==null&&(s=e)}return n.loadTextureImage(e,a.source,s)}},Mf=class{constructor(e){this.parser=e,this.name=$.EXT_TEXTURE_AVIF}loadTexture(e){let t=this.name,n=this.parser,r=n.json,i=r.textures[e];if(!i.extensions||!i.extensions[t])return null;let a=i.extensions[t],o=r.images[a.source],s=n.textureLoader;if(o.uri){let e=n.options.manager.getHandler(o.uri);e!==null&&(s=e)}return n.loadTextureImage(e,a.source,s)}},Nf=class{constructor(e){this.name=$.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){let t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){let e=n.extensions[this.name],r=this.parser.getDependency(`buffer`,e.buffer),i=this.parser.options.meshoptDecoder;if(!i||!i.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw Error(`THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files`);return null}return r.then(function(t){let n=e.byteOffset||0,r=e.byteLength||0,a=e.count,o=e.byteStride,s=new Uint8Array(t,n,r);return i.decodeGltfBufferAsync?i.decodeGltfBufferAsync(a,o,s,e.mode,e.filter).then(function(e){return e.buffer}):i.ready.then(function(){let t=new ArrayBuffer(a*o);return i.decodeGltfBuffer(new Uint8Array(t),a,o,s,e.mode,e.filter),t})})}else return null}},Pf=class{constructor(e){this.name=$.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){let t=this.parser.json,n=t.nodes[e];if(!n.extensions||!n.extensions[this.name]||n.mesh===void 0)return null;let r=t.meshes[n.mesh];for(let e of r.primitives)if(e.mode!==Gf.TRIANGLES&&e.mode!==Gf.TRIANGLE_STRIP&&e.mode!==Gf.TRIANGLE_FAN&&e.mode!==void 0)return null;let i=n.extensions[this.name].attributes,a=[],o={};for(let e in i)a.push(this.parser.getDependency(`accessor`,i[e]).then(t=>(o[e]=t,o[e])));return a.length<1?null:(a.push(this.parser.createNodeMesh(e)),Promise.all(a).then(e=>{let t=e.pop(),n=t.isGroup?t.children:[t],r=e[0].count,i=[];for(let e of n){let t=new B,n=new F,a=new R,s=new F(1,1,1),c=new Le(e.geometry,e.material,r);for(let e=0;e0||e.search(/^data\:image\/jpeg/)===0?`image/jpeg`:e.search(/\.webp($|\?)/i)>0||e.search(/^data\:image\/webp/)===0?`image/webp`:e.search(/\.ktx2($|\?)/i)>0||e.search(/^data\:image\/ktx2/)===0?`image/ktx2`:`image/png`}var lp=new B,up=class{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new gf,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 n=!1,r=-1,i=!1,a=-1;if(typeof navigator<`u`){let e=navigator.userAgent;n=/^((?!chrome|android).)*safari/i.test(e)===!0;let t=e.match(/Version\/(\d+)/);r=n&&t?parseInt(t[1],10):-1,i=e.indexOf(`Firefox`)>-1,a=i?e.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>`u`||n&&r<17||i&&a<98?this.textureLoader=new Ke(this.options.manager):this.textureLoader=new oe(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new De(this.options.manager),this.fileLoader.setResponseType(`arraybuffer`),this.options.crossOrigin===`use-credentials`&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){let n=this,r=this.json,i=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(e){return e._markDefs&&e._markDefs()}),Promise.all(this._invokeAll(function(e){return e.beforeRoot&&e.beforeRoot()})).then(function(){return Promise.all([n.getDependencies(`scene`),n.getDependencies(`animation`),n.getDependencies(`camera`)])}).then(function(t){let a={scene:t[0][r.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:r.asset,parser:n,userData:{}};return tp(i,a,r),np(a,r),Promise.all(n._invokeAll(function(e){return e.afterRoot&&e.afterRoot(a)})).then(function(){for(let e of a.scenes)e.updateMatrixWorld();e(a)})}).catch(t)}_markDefs(){let e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[];for(let n=0,r=t.length;n{let n=this.associations.get(e);n!=null&&this.associations.set(t,n);for(let[n,r]of e.children.entries())i(r,t.children[n])};return i(n,r),r.name+=`_instance_`+ e.uses[t]++,r}_invokeOne(e){let t=Object.values(this.plugins);t.push(this);for(let n=0;n=2&&p.setY(t,u[e*a+1]),a>=3&&p.setZ(t,u[e*a+2]),a>=4&&p.setW(t,u[e*a+3]),a>=5)throw Error(`THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.`)}p.normalized=d}return p})}loadTexture(e){let t=this.json,n=this.options,r=t.textures[e].source,i=t.images[r],a=this.textureLoader;if(i.uri){let e=n.manager.getHandler(i.uri);e!==null&&(a=e)}return this.loadTextureImage(e,r,a)}loadTextureImage(e,t,n){let r=this,i=this.json,a=i.textures[e],o=i.images[t],s=(o.uri||o.bufferView)+`:`+a.sampler;if(this.textureCache[s])return this.textureCache[s];let c=this.loadImageSource(t,n).then(function(t){t.flipY=!1,t.name=a.name||o.name||``,t.name===``&&typeof o.uri==`string`&&o.uri.startsWith(`data:image/`)===!1&&(t.name=o.uri);let n=(i.samplers||{})[a.sampler]||{};return t.magFilter=qf[n.magFilter]||1006,t.minFilter=qf[n.minFilter]||1008,t.wrapS=Jf[n.wrapS]||1e3,t.wrapT=Jf[n.wrapT]||1e3,t.generateMipmaps=!t.isCompressedTexture&&t.minFilter!==1003&&t.minFilter!==1006,r.associations.set(t,{textures:e}),t}).catch(function(){return null});return this.textureCache[s]=c,c}loadImageSource(e,t){let n=this,r=this.json,i=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(e=>e.clone());let a=r.images[e],o=self.URL||self.webkitURL,s=a.uri||``,c=!1;if(a.bufferView!==void 0)s=n.getDependency(`bufferView`,a.bufferView).then(function(e){c=!0;let t=new Blob([e],{type:a.mimeType});return s=o.createObjectURL(t),s});else if(a.uri===void 0)throw Error(`THREE.GLTFLoader: Image `+e+` is missing URI and bufferView`);let l=Promise.resolve(s).then(function(e){return new Promise(function(n,r){let a=n;t.isImageBitmapLoader===!0&&(a=function(e){let t=new ye(e);t.needsUpdate=!0,n(t)}),t.load(Qe.resolveURL(e,i.path),a,void 0,r)})}).then(function(e){return c===!0&&o.revokeObjectURL(s),np(e,a),e.userData.mimeType=a.mimeType||cp(a.uri),e}).catch(function(e){throw console.error(`THREE.GLTFLoader: Couldn't load texture`,s),e});return this.sourceCache[e]=l,l}assignTexture(e,t,n,r){let i=this;return this.getDependency(`texture`,n.index).then(function(a){if(!a)return null;if(n.texCoord!==void 0&&n.texCoord>0&&(a=a.clone(),a.channel=n.texCoord),i.extensions[$.KHR_TEXTURE_TRANSFORM]){let e=n.extensions===void 0?void 0:n.extensions[$.KHR_TEXTURE_TRANSFORM];if(e){let t=i.associations.get(a);a=i.extensions[$.KHR_TEXTURE_TRANSFORM].extendTexture(a,e),i.associations.set(a,t)}}return r!==void 0&&(a.colorSpace=r),e[t]=a,a})}assignFinalMaterial(e){let t=e.geometry,n=e.material,r=t.attributes.tangent===void 0,i=t.attributes.color!==void 0,a=t.attributes.normal===void 0;if(e.isPoints){let e=`PointsMaterial:`+n.uuid,t=this.cache.get(e);t||(t=new _t,It.prototype.copy.call(t,n),t.color.copy(n.color),t.map=n.map,t.sizeAttenuation=!1,this.cache.add(e,t)),n=t}else if(e.isLine){let e=`LineBasicMaterial:`+n.uuid,t=this.cache.get(e);t||(t=new qe,It.prototype.copy.call(t,n),t.color.copy(n.color),t.map=n.map,this.cache.add(e,t)),n=t}if(r||i||a){let e=`ClonedMaterial:`+n.uuid+`:`;r&&(e+=`derivative-tangents:`),i&&(e+=`vertex-colors:`),a&&(e+=`flat-shading:`);let t=this.cache.get(e);t||(t=n.clone(),i&&(t.vertexColors=!0),a&&(t.flatShading=!0),r&&(t.normalScale&&(t.normalScale.y*=-1),t.clearcoatNormalScale&&(t.clearcoatNormalScale.y*=-1)),this.cache.add(e,t),this.associations.set(t,this.associations.get(n))),n=t}e.material=n}getMaterialType(){return ft}loadMaterial(e){let t=this,n=this.json,r=this.extensions,i=n.materials[e],a,o={},s=i.extensions||{},c=[];if(s[$.KHR_MATERIALS_UNLIT]){let e=r[$.KHR_MATERIALS_UNLIT];a=e.getMaterialType(),c.push(e.extendParams(o,i,t))}else{let n=i.pbrMetallicRoughness||{};if(o.color=new H(1,1,1),o.opacity=1,Array.isArray(n.baseColorFactor)){let e=n.baseColorFactor;o.color.setRGB(e[0],e[1],e[2],z),o.opacity=e[3]}n.baseColorTexture!==void 0&&c.push(t.assignTexture(o,`map`,n.baseColorTexture,P)),o.metalness=n.metallicFactor===void 0?1:n.metallicFactor,o.roughness=n.roughnessFactor===void 0?1:n.roughnessFactor,n.metallicRoughnessTexture!==void 0&&(c.push(t.assignTexture(o,`metalnessMap`,n.metallicRoughnessTexture)),c.push(t.assignTexture(o,`roughnessMap`,n.metallicRoughnessTexture))),a=this._invokeOne(function(t){return t.getMaterialType&&t.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,o)})))}i.doubleSided===!0&&(o.side=2);let l=i.alphaMode||$f.OPAQUE;if(l===$f.BLEND?(o.transparent=!0,o.depthWrite=!1):(o.transparent=!1,l===$f.MASK&&(o.alphaTest=i.alphaCutoff===void 0?.5:i.alphaCutoff)),i.normalTexture!==void 0&&a!==ct&&(c.push(t.assignTexture(o,`normalMap`,i.normalTexture)),o.normalScale=new L(1,1),i.normalTexture.scale!==void 0)){let e=i.normalTexture.scale;o.normalScale.set(e,e)}if(i.occlusionTexture!==void 0&&a!==ct&&(c.push(t.assignTexture(o,`aoMap`,i.occlusionTexture)),i.occlusionTexture.strength!==void 0&&(o.aoMapIntensity=i.occlusionTexture.strength)),i.emissiveFactor!==void 0&&a!==ct){let e=i.emissiveFactor;o.emissive=new H().setRGB(e[0],e[1],e[2],z)}return i.emissiveTexture!==void 0&&a!==ct&&c.push(t.assignTexture(o,`emissiveMap`,i.emissiveTexture,P)),Promise.all(c).then(function(){let n=new a(o);return i.name&&(n.name=i.name),np(n,i),t.associations.set(n,{materials:e}),i.extensions&&tp(r,n,i),n})}createUniqueName(e){let t=ae.sanitizeNodeName(e||``);return t in this.nodeNamesUsed?t+`_`+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){let t=this,n=this.extensions,r=this.primitiveCache;function i(e){return n[$.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then(function(n){return fp(n,e,t)})}let a=[];for(let n=0,o=e.length;n0&&ip(d,i),d.name=t.createUniqueName(i.name||`mesh_`+e),np(d,i),u.extensions&&tp(r,d,u),t.assignFinalMaterial(d),c.push(d)}for(let n=0,r=c.length;n1?new je:t.length===1?t[0]:new k,o!==t[0])for(let e=0,n=t.length;e1){let e=r.associations.get(o);r.associations.set(o,{...e})}return r.associations.get(o).nodes=e,o}),this.nodeCache[e]}loadScene(e){let t=this.extensions,n=this.json.scenes[e],r=this,i=new je;n.name&&(i.name=r.createUniqueName(n.name)),np(i,n),n.extensions&&tp(t,i,n);let a=n.nodes||[],o=[];for(let e=0,t=a.length;e{let t=new Map;for(let[e,n]of r.associations)(e instanceof It||e instanceof ye)&&t.set(e,n);return e.traverse(e=>{let n=r.associations.get(e);n!=null&&t.set(e,n)}),t})(i),i})}_createAnimationTracks(e,t,n,r,i){let a=[],o=e.name?e.name:e.uuid,s=[];Zf[i.path]===Zf.weights?e.traverse(function(e){e.morphTargetInfluences&&s.push(e.name?e.name:e.uuid)}):s.push(o);let c;switch(Zf[i.path]){case Zf.weights:c=Pe;break;case Zf.rotation:c=Se;break;case Zf.translation:case Zf.scale:c=Dt;break;default:switch(n.itemSize){case 1:c=Pe;break;case 2:case 3:default:c=Dt;break}break}let l=r.interpolation===void 0?ve:Qf[r.interpolation],u=this._getArrayFromAccessor(n);for(let e=0,n=s.length;enew ku(e)),pp.register(e=>new pf(e)),pp)}var hp=400,gp=[[.075,800],[.11,0],[.125,0],[.14,0],[.125,0],[.05,0],[.04,0],[.03,0],[.02,0],[1,0]];for(let e=1;ee instanceof Dt&&e.name===`${n.name}.position`);if(!(i instanceof Dt)){console.warn(`No Hips.position track of type VectorKeyframeTrack found in animation.`);return}let a=new F(i.values[0],i.values[1],i.values[2]),o=new F().subVectors(a,r);e.tracks.forEach(e=>{if(e.name.endsWith(`.position`)&&e instanceof Dt)for(let t=0;t=r.value&&(e.value=!0,t.value=0),e.value)){t.value+=a/.2;let o=Math.sin(Math.PI*t.value);i.expressionManager.setValue(`blink`,o),t.value>=1&&(e.value=!1,n.value=0,i.expressionManager.setValue(`blink`,0),r.value=Math.random()*5+1)}}return{update:i}}function Sp(){let e=-1,t=new F,n=0;function r(e){t.set(e.value.x+wa(-.25,.25),e.value.y+wa(-.25,.25),e.value.z)}function i(i,a,o){!i?.expressionManager||!i.lookAt||(n>=e?(r(a),n=0,e=_p()/1e3):t||r(a),i.lookAt.target||(i.lookAt.target=new k),i.lookAt.target?.position.lerp(t,1),i.lookAt?.update(o),n+=o)}function a(e,n){t.set(n.x,n.y,n.z),!(!e?.expressionManager||!e.lookAt)&&(e.lookAt.target||(e.lookAt.target=new k),e.lookAt.target?.position.lerp(t,1),e.lookAt?.update(.016))}return{update:i,instantUpdate:a}}async function Cp(e,t){let n=(await mp().loadAsync(e,e=>t?.onProgress?.(e))).userData;if(!n.vrm)return;let r=n.vrm;if(Xu.removeUnnecessaryVertices(r.scene),Xu.combineSkeletons(r.scene),r.scene.traverse(e=>{e.frustumCulled=!1}),t?.lookAt&&r.lookAt){let e=new Qd(r.lookAt);e.name=`lookAtQuaternionProxy`,r.scene.add(e)}let i=new je;i.add(r.scene),t?.scene&&t.scene.add(i);let a=new F(0,0,-1),o=r.lookAt,s=new R;if(o){let e=o.faceFront;s.setFromUnitVectors(e.normalize(),a.normalize()),i.quaternion.premultiply(s),i.updateMatrixWorld(!0)}else console.warn(`No look-at target found in VRM model`);r.springBoneManager?.reset(),i.updateMatrixWorld(!0);function c(e){let t=new Ye,n=new Ye;return e.updateMatrixWorld(!0),e.traverse(e=>{if(!e.visible)return;let r=e;if(!r.isMesh||!r.geometry||r.name.startsWith(`VRMC_springBone_collider`))return;let i=r.geometry;i.boundingBox||i.computeBoundingBox(),n.copy(i.boundingBox),n.applyMatrix4(r.matrixWorld),t.union(n)}),t}let l=c(r.scene),u=new F,d=new F;l.getSize(u),l.getCenter(d),d.y+=u.y/5;let f=40/2*Math.PI/180;return{_vrm:r,_vrmGroup:i,modelCenter:d,modelSize:u,initialCameraOffset:new F(u.x/16,u.y/8,-(u.y/3)/Math.tan(f))}}function wp(e){let t=w(null),n=w(!1),r=w(0),i=w(new Map),a=w(new Map),o=w(),s=(e,t,n)=>e+(t-e)*n,c=e=>e<.5?4*e*e*e:1-(-2*e+2)**3/2,l=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}]]),u=()=>{o.value&&=(clearTimeout(o.value),void 0)},d=o=>{if(u(),!l.has(o)){console.warn(`Emotion ${o} not found`);return}let s=l.get(o);if(t.value=o,n.value=!0,r.value=0,e.expressionManager){let t=Object.keys(e.expressionManager.expressionMap);for(let n of t)e.expressionManager.setValue(n,0)}i.value.clear(),a.value.clear();for(let t of s.expression||[]){let n=e.expressionManager?.getValue(t.name)||0;i.value.set(t.name,n),a.value.set(t.name,t.value)}};return{currentEmotion:t,isTransitioning:n,setEmotion:d,setEmotionWithResetAfter:(e,t)=>{u(),d(e),o.value=setTimeout(()=>{d(`neutral`),o.value=void 0},t)},update:o=>{if(!n.value||!t.value)return;let u=l.get(t.value).blendDuration||.3;r.value+=o/u,r.value>=1&&(r.value=1,n.value=!1);for(let[t,n]of a.value){let a=s(i.value.get(t)||0,n,c(r.value));e.expressionManager?.setValue(t,a)}},addEmotionState:(e,t)=>{l.set(e,t)},removeEmotionState:e=>{l.delete(e)},dispose:()=>{u()}}}var Tp=`data:application/wasm;base64,AGFzbQEAAAABbRBgAAF/YAAAYAJ/fwBgBn9/f39/fwBgA39/fwBgAn9/AX1gA39/fQBgB39/f39/f38Bf2ABfwBgAX8Bf2AFf39/f38AYAR/f39/AGAFf39/f30AYAZ/f31/f38AYAZ/f319fX8AYAV/f399fwACDwEDZW52Bm1lbW9yeQIABAMdHAEBBwEACAAAAAkKBAsMBAINDg8FBgIGBQMDAwIGlgEXfwFB0L0OC38AQfi4BAt/AEGguQQLfwBBkDgLfwBBwDgLfwBBkAgLfwBBgAgLfwBBjAgLfwBB9LgEC38AQfA4C38AQfC4BAt/AEGguQoLfwBB0LkKC38AQYAIC38AQdC9Cgt/AEHQvQoLfwBB0L0OC38AQYAIC38AQdC9Dgt/AEGAgBALfwBBAAt/AEEBC38AQYCABAsHpAYyEV9fd2FzbV9jYWxsX2N0b3JzAAAMbG9hZF9wcm9maWxlAAIHcHJvZmlsZQMBDnByb2ZpbGVNZmNjUmF3AwIScHJlY29tcHV0ZV9wcm9maWxlAAMMcHJvZmlsZU1lYW5zAwMNcHJvZmlsZVN0ZERldgMEC3Byb2ZpbGVNZmNjAwUQZ2V0X3Byb2ZpbGVfcHRycwAEC3Byb2ZpbGVQdHJzAwYJc2V0X2lucHV0AAUQb3V0cHV0U2FtcGxlUmF0ZQMHEGlucHV0U2FtcGxlQ291bnQDCBBnZXRfaW5wdXRfYnVmZmVyAAYLaW5wdXRCdWZmZXIDCRVnZXRfaW5wdXRfYnVmZmVyX3NpemUABw5nZXRfdm9sdW1lX3B0cgAIBnZvbHVtZQMKB2V4ZWN1dGUACRBjb3B5X3JpbmdfYnVmZmVyAAoKcm1zX3ZvbHVtZQAXD2xvd19wYXNzX2ZpbHRlcgAREWRvd25fc2FtcGxlX2V4YWN0AAwLZG93bl9zYW1wbGUADQxwcmVfZW1waGFzaXMAFg5oYW1taW5nX3dpbmRvdwAPCW5vcm1hbGl6ZQAUA2ZmdAAOD21lbF9maWx0ZXJfYmFuawASC3Bvd2VyX3RvX2RiABUDZGN0AAsHbWZjY091dAMLBnNjb3JlcwMMEmNhbGNfbDFub3JtX3Njb3JlcwAZEmNhbGNfbDJub3JtX3Njb3JlcwAaHWNhbGNfY29zaW5lX3NpbWlsYXJpdHlfc2NvcmVzABgQbm9ybWFsaXplX3Njb3JlcwAbFGxvd19wYXNzX2ZpbHRlcl9pbXBsABANZ2V0X21heF92YWx1ZQATDF9fZHNvX2hhbmRsZQMNCl9fZGF0YV9lbmQDDgtfX3N0YWNrX2xvdwMPDF9fc3RhY2tfaGlnaAMQDV9fZ2xvYmFsX2Jhc2UDEQtfX2hlYXBfYmFzZQMSCl9faGVhcF9lbmQDEw1fX21lbW9yeV9iYXNlAxQMX190YWJsZV9iYXNlAxUVX193YXNtX2ZpcnN0X3BhZ2VfZW5kAxYSX193YXNtX2luaXRfbWVtb3J5AAEIAQEMAQEK7FccAgALDgBBkAhBAEHAtQr8CwALRQBBkLkEIAY2AgBBjLkEIAU2AgBBiLkEIAQ2AgBBhLkEIAM2AgBBgLkEIAI2AgBB/LgEIAE2AgBB+LgEIAA2AgBBoLkEC8QgAil/H30CQAJAQYi5BCgCACIEQQBKBEBBuDhCADcDAEGwOEIANwMAQag4QgA3AwBBoDhCADcDAEGYOEIANwMAQZA4QgA3AwBBwDhCADcDAEHIOEIANwMAQdA4QgA3AwBB2DhCADcDAEHgOEIANwMAQeg4QgA3AwAgBEEDcSECIARBAWsiBUEDTwRAIARB/P///wdxIQNBkAghAANAIABBADYCACAAQZABakEANgIAIABB4ABqQQA2AgAgAEEwakEANgIAIABBwAFqIQAgAyABQQRqIgFHDQALCyACBEAgAUEwbEGQCGohAANAIABBADYCACAAQTBqIQAgAkEBayICDQALCyAEQQNxIQJBACEBIAVBA08EQCAEQfz///8HcSEDQaQJIQADQCAAQQA2AgAgAEEwa0EANgIAIABB4ABrQQA2AgAgAEGQAWtBADYCACAAQcABaiEAIAMgAUEEaiIBRw0ACwsgAgRAIAFBMGxBlAhqIQADQCAAQQA2AgAgAEEwaiEAIAJBAWsiAg0ACwsgBEEDcSECQQAhASAFQQNPBEAgBEH8////B3EhA0GoCSEAA0AgAEEANgIAIABBMGtBADYCACAAQeAAa0EANgIAIABBkAFrQQA2AgAgAEHAAWohACADIAFBBGoiAUcNAAsLIAIEQCABQTBsQZgIaiEAA0AgAEEANgIAIABBMGohACACQQFrIgINAAsLIARBA3EhAkEAIQEgBUEDTwRAIARB/P///wdxIQNBrAkhAANAIABBADYCACAAQTBrQQA2AgAgAEHgAGtBADYCACAAQZABa0EANgIAIABBwAFqIQAgAyABQQRqIgFHDQALCyACBEAgAUEwbEGcCGohAANAIABBADYCACAAQTBqIQAgAkEBayICDQALCyAEQQNxIQJBACEBIAVBA08EQCAEQfz///8HcSEDQbAJIQADQCAAQQA2AgAgAEEwa0EANgIAIABB4ABrQQA2AgAgAEGQAWtBADYCACAAQcABaiEAIAMgAUEEaiIBRw0ACwsgAgRAIAFBMGxBoAhqIQADQCAAQQA2AgAgAEEwaiEAIAJBAWsiAg0ACwsgBEEDcSECQQAhASAFQQNPBEAgBEH8////B3EhA0G0CSEAA0AgAEEANgIAIABBMGtBADYCACAAQeAAa0EANgIAIABBkAFrQQA2AgAgAEHAAWohACADIAFBBGoiAUcNAAsLIAIEQCABQTBsQaQIaiEAA0AgAEEANgIAIABBMGohACACQQFrIgINAAsLIARBA3EhAkEAIQEgBUEDTwRAIARB/P///wdxIQNBuAkhAANAIABBADYCACAAQTBrQQA2AgAgAEHgAGtBADYCACAAQZABa0EANgIAIABBwAFqIQAgAyABQQRqIgFHDQALCyACBEAgAUEwbEGoCGohAANAIABBADYCACAAQTBqIQAgAkEBayICDQALCyAEQQNxIQJBACEBIAVBA08EQCAEQfz///8HcSEDQbwJIQADQCAAQQA2AgAgAEEwa0EANgIAIABB4ABrQQA2AgAgAEGQAWtBADYCACAAQcABaiEAIAMgAUEEaiIBRw0ACwsgAgRAIAFBMGxBrAhqIQADQCAAQQA2AgAgAEEwaiEAIAJBAWsiAg0ACwsgBEEDcSECQQAhASAFQQNPBEAgBEH8////B3EhA0HACSEAA0AgAEEANgIAIABBMGtBADYCACAAQeAAa0EANgIAIABBkAFrQQA2AgAgAEHAAWohACADIAFBBGoiAUcNAAsLIAIEQCABQTBsQbAIaiEAA0AgAEEANgIAIABBMGohACACQQFrIgINAAsLIARBA3EhAkEAIQEgBUEDTwRAIARB/P///wdxIQNBxAkhAANAIABBADYCACAAQTBrQQA2AgAgAEHgAGtBADYCACAAQZABa0EANgIAIABBwAFqIQAgAyABQQRqIgFHDQALCyACBEAgAUEwbEG0CGohAANAIABBADYCACAAQTBqIQAgAkEBayICDQALCyAEQQNxIQJBACEBIAVBA08EQCAEQfz///8HcSEDQcgJIQADQCAAQQA2AgAgAEEwa0EANgIAIABB4ABrQQA2AgAgAEGQAWtBADYCACAAQcABaiEAIAMgAUEEaiIBRw0ACwsgAgRAIAFBMGxBuAhqIQADQCAAQQA2AgAgAEEwaiEAIAJBAWsiAg0ACwsgBEEDcSECQQAhASAFQQNPBEAgBEH8////B3EhA0HMCSEAA0AgAEEANgIAIABBMGtBADYCACAAQeAAa0EANgIAIABBkAFrQQA2AgAgAEHAAWohACADIAFBBGoiAUcNAAsLIAIEQCABQTBsQbwIaiEAA0AgAEEANgIAIABBMGohACACQQFrIgINAAsLQYy5BCgCACIFQTBsIRJDAACAPyAFspUhK0G8OCoCACE8Qbg4KgIAIT1BtDgqAgAhPkGwOCoCACE/Qaw4KgIAIUBBqDgqAgAhQUGkOCoCACE4QaA4KgIAITlBnDgqAgAhOkGYOCoCACE7QZQ4KgIAISxBkDgqAgAhKUGguQQhAwNAAkAgBUEATARAIAZBDGwiAUELaiEHIAFBCmohCCABQQlqIQkgAUEIaiEKIAFBB2ohCyABQQZqIQwgAUEFaiENIAFBBGohDiABQQNyIQ8gAUECciEQIAFBAXIhEQwBCyAGQQxsIgFBAnQiE0GQCGogAUELaiIHQQJ0IhVBkAhqIRYgAUEKaiIIQQJ0IhdBkAhqIRggAUEJaiIJQQJ0IhlBkAhqIRogAUEIaiIKQQJ0IhtBkAhqIRwgAUEHaiILQQJ0Ih1BkAhqIR4gAUEGaiIMQQJ0Ih9BkAhqISAgAUEFaiINQQJ0IiFBkAhqISIgAUEEaiIOQQJ0IiNBkAhqISQgAUEDciIPQQJ0IiVBkAhqISYgAUECciIQQQJ0IgBBkAhqIScgAUEBciIRQQJ0IgJBkAhqIBMqApAIISogFSoCkAghLSAXKgKQCCEuIBkqApAIIS8gGyoCkAghMCAdKgKQCCExIB8qApAIITIgISoCkAghMyAjKgKQCCE0ICUqApAIITUgACoCkAghNiACKgKQCCE3IAMhACAFIQIDQCAqIAAqAgCSISogLSAAQSxqKgIAkiEtIC4gAEEoaioCAJIhLiAvIABBJGoqAgCSIS8gMCAAQSBqKgIAkiEwIDEgAEEcaioCAJIhMSAyIABBGGoqAgCSITIgMyAAQRRqKgIAkiEzIDQgAEEQaioCAJIhNCA1IABBDGoqAgCSITUgNiAAQQhqKgIAkiE2IDcgAEEEaioCAJIhNyAAQTBqIQAgAkEBayICDQALIDc4AgAgKjgCACAnIDY4AgAgJiA1OAIAICQgNDgCACAiIDM4AgAgICAyOAIAIB4gMTgCACAcIDA4AgAgGiAvOAIAIBggLjgCACAWIC04AgAgPCEtID0hLiA+IS8gPyEwIEAhMSBBITIgOCEzIDkhNCA6ITUgOyE2ICwhNyApISoLIBFBAnQiAiACKgKQCCArlCJDOAKQCCAQQQJ0IgIgAioCkAggK5QiRDgCkAggAUECdCICIAIqApAIICuUIkU4ApAIIA9BAnQiAiACKgKQCCArlCJGOAKQCCAOQQJ0IgIgAioCkAggK5QiRzgCkAggDUECdCICIAIqApAIICuUIkI4ApAIIAxBAnQiAiACKgKQCCArlCI4OAKQCCALQQJ0IgIgAioCkAggK5QiOTgCkAggCkECdCICIAIqApAIICuUIjo4ApAIIAlBAnQiAiACKgKQCCArlCI7OAKQCCAIQQJ0IgIgAioCkAggK5QiLDgCkAggB0ECdCICIAIqApAIICuUIik4ApAIIAMgEmohAyAtICmSIjwhLSAuICySIj0hLiAvIDuSIj4hLyAwIDqSIj8hMCAxIDmSIkAhMSAyIDiSIkEhMiAzIEKSIjghMyA0IEeSIjkhNCA1IEaSIjohNSA2IESSIjshNiA3IEOSIiwhNyAqIEWSIikhKiAEIAZBAWoiBkcNAAsMAQtBqDhCADcDAEGgOEIANwMAQZg4QgA3AwBBkDhCADcDAEHAOEIANwMAQcg4QgA3AwBB0DhCADcDAEHYOEIANwMAQeA4QgA3AwBB6DhCADcDAAwBC0G8OCA8OAIAQbg4ID04AgBBtDggPjgCAEGwOCA/OAIAQaw4IEA4AgBBqDggQTgCAEGkOCA4OAIAQaA4IDk4AgBBnDggOjgCAEGYOCA7OAIAQZQ4ICw4AgBBkDggKTgCAAtBkLkEKAIARQRAQbg4QgA3AwBBsDhCADcDAEGoOEIANwMAQaA4QgA3AwBBmDhCADcDAEGQOEIANwMAQeg4QoCAgPyDgIDAPzcDAEHgOEKAgID8g4CAwD83AwBB2DhCgICA/IOAgMA/NwMAQdA4QoCAgPyDgIDAPzcDAEHIOEKAgID8g4CAwD83AwBBwDhCgICA/IOAgMA/NwMADwtBvDggPCAEsiIqlSJCOAIAQbg4ID0gKpUiPDgCAEG0OCA+ICqVIj04AgBBsDggPyAqlSI+OAIAQaw4IEAgKpUiPzgCAEGoOCBBICqVIkA4AgBBpDggOCAqlSJBOAIAQaA4IDkgKpUiODgCAEGcOCA6ICqVIjk4AgBBmDggOyAqlSI6OAIAQZQ4ICwgKpUiOzgCAEGQOCApICqVOAIAQYy5BCgCACEDAkAgBEEATA0AQQAhBiADQQBMDQAgA0EwbCEFQcA4KgIAIS1BkDgqAgAhLEHsOCoCACEuQeg4KgIAIS9B5DgqAgAhMEHgOCoCACExQdw4KgIAITJB2DgqAgAhM0HUOCoCACE0QdA4KgIAITVBzDgqAgAhNkHIOCoCACE3QcQ4KgIAISpBoLkEIQEDQCADIQIgASEAA0AgACoCACAskyIpICmUIC2SIS0gAEEsaioCACBCkyIpICmUIC6SIS4gAEEoaioCACA8kyIpICmUIC+SIS8gAEEkaioCACA9kyIpICmUIDCSITAgAEEgaioCACA+kyIpICmUIDGSITEgAEEcaioCACA/kyIpICmUIDKSITIgAEEYaioCACBAkyIpICmUIDOSITMgAEEUaioCACBBkyIpICmUIDSSITQgAEEQaioCACA4kyIpICmUIDWSITUgAEEMaioCACA5kyIpICmUIDaSITYgAEEIaioCACA6kyIpICmUIDeSITcgAEEEaioCACA7kyIpICmUICqSISogAEEwaiEAIAJBAWsiAg0ACyABIAVqIQEgBkEBaiIGIARHDQALQew4IC44AgBB6DggLzgCAEHkOCAwOAIAQeA4IDE4AgBB3DggMjgCAEHYOCAzOAIAQdQ4IDQ4AgBB0DggNTgCAEHMOCA2OAIAQcg4IDc4AgBBxDggKjgCAEHAOCAtOAIAQYy5BCgCACEDC0MAAIA/IAMgBGyylSEsQVAhAANAIABB8DhqIgMgAyoCACAslCIpICkgKbxBgICABGtBAXVBgICAgAJqviIplSApkkMAAAA/lCIplSApkkMAAAA/lDgCACAAQQRqIgANAAsLBQBBgAgLOgBBjAggADYCAEH0uARB/LgEKAIAsiAAspRB+LgEKAIAspVDAAAAP5JDAABAS5JDAABAy5L8ADYCAAsFAEHwOAsGAEGAgAELBgBB8LgEC70GAgl/BX0jACIBIQggAUH0uAQoAgAiAUECdEEPakFwcSIDayICJABBgLkEKAIAIQVB+LgEKAIAIQQgAkHwOCAAIAFrQYCAAWpBgIABIAEQCkHwuAQgAiABEBc4AgAgBEECbSEGIAIgA2siACQAAkAgBEGMCCgCACIDTgRAIAIgASADsiAGskMAAPpDQQEQESACIAAgAUEBEAwMAQsgAyADIARtIgcgBGxGBEAgAiABIAOyIAayQwAA+kMgBxARIAIgACABIAdtIgEgBxAMDAELIAIgASADsiIKIAayQwAA+kNBARARIAIgASAAIAGyIAogBLKVIgqVu0QAAAAAAAA4Q6BEAAAAAAAAOMOg/AIiASAKEA0LIAAgAUPsUXg/EBYgACABEA8gACABQwAAgD8QFCAAIAFBAnRBD2pBcHFrIgIkACAAIAIgARAOIAIgBUECdEEPakFwcSIDayIAJAAgAiABIAAgBLIgBRASIAAgBRAVIAAgA2siASQAIAAgASAFEAsCQEGIuQQoAgAiAEEATA0AIABBAnQiAkUNAEGguQogAUEEaiAC/AoAAAsCQAJAAkACQEGEuQQoAgAOAgABAgtBoLkKQZAIQZA4QcA4QdC5CiAAEBkMAgtBoLkKQZAIQZA4QcA4QdC5CiAAEBoMAQtBoLkKQZAIQZA4QcA4QdC5CiAAEBgLQQAhAUHQuQpBiLkEKAIAEBtBiLkEKAIAIgBBAEwEQCAIJABBfw8LIABBA3EhBAJAIABBBEkEQEF/IQJDAACAvyEKDAELIABB/P///wdxIQNBfyECQwAAgL8hCkHQuQohAANAIABBDGoqAgAiCyAAQQhqKgIAIgwgAEEEaioCACINIAAqAgAiDiAKIAogDl0iBRsiCiAKIA1dIgYbIgogCiAMXSIHGyIKIAogC10iCRshCiABQQNqIAFBAmogAUEBaiABIAIgBRsgBhsgBxsgCRshAiAAQRBqIQAgAUEEaiIBIANHDQALCyAEBEAgAUECdEHQuQpqIQADQCAAKgIAIgsgCiAKIAtdIgMbIQogASACIAMbIQIgAEEEaiEAIAFBAWohASAEQQFrIgQNAAsLIAgkACACC0wBAX8gAyACIANwIgNrIgIgBCACIARIGyIFQQJ0IgIEQCAAIAEgA0ECdGogAvwKAAALIAQgBWtBAnQiAwRAIAAgAmogASAD/AoAAAsLtgECBH0DfyACBEBEGC1EVPshCUAgArijtkOD+SI+lCEFA0AgBSAHs5QhBkMAAAAAIQQgACEIQQAhCQNAQwAAAD8gBiAJs0MAAAA/kpRDAACAPpIiA0MAAEDLIAOTQwAAQEuSkiIDi5MgA5QiA4tDZWJlQpRDZ6dGQZIgA5QgCCoCAJQgBJIhBCAIQQRqIQggAiAJQQFqIglHDQALIAEgB0ECdGogBDgCACAHQQFqIgcgAkcNAAsLC+QBAQh/AkAgAkUNACACQQNxIQYgAkEETwRAIANBAnQhByADQQN0IQggA0EEdCEJIANBDGwhCiACQXxxIQsgASECIAAhBANAIAIgBCoCADgCACACQQRqIAQgB2oqAgA4AgAgAkEIaiAEIAhqKgIAOAIAIAJBDGogBCAKaioCADgCACACQRBqIQIgBCAJaiEEIAsgBUEEaiIFRw0ACwsgBkUNACADQQJ0IQcgASAFQQJ0aiECIAAgAyAFbEECdGohBANAIAIgBCoCADgCACAEIAdqIQQgAkEEaiECIAZBAWsiBg0ACwsLhQECAn8CfSADBEAgAUEBayEGQQAhAQNAIAIgACAEIAGzlCIHu0QAAAAAAADgv6BEAAAAAAAAOEOgRAAAAAAAADjDoPwCIgUgBiAFIAZIG0ECdGoqAgAgACAFQQJ0aioCACIIkyAHIAWyk5QgCJI4AgAgAkEEaiECIAMgAUEBaiIBRw0ACwsLoAgDEX8GfQJ8IwAgAkECdCIGQQ9qQXBxIgNrIgcgA2siCSELIAIEQAJAIAJnIgNBH0cEQCAGBEAgCUEAIAb8CwALQR8gA2siBkF8cSEIIAZBA3EhCiADQRxrQQNJIQwDQEEAIQVBACEDIAxFBEADQCAEIANBA2p2QQFxIAQgA0ECanZBAXRBAnEgBCADQQFqdkEBcSAEIAN2QQF0QQJxIAVBAnRyckECdHJyIQUgA0EEaiIDIAhHDQALCyAKBEAgCiEGA0AgBCADdkEBcSAFQQF0ciEFIANBAWohAyAGQQFrIgYNAAsLIAcgBEECdGogACAFQQJ0aioCADgCACAEQQFqIgQgAkcNAAsMAQsgACoCACEUIAJBAnQiAARAIAlBACAA/AsACyACQQdxIQQgAkEITwRAIAJBeHEhACAHIQMDQCADIBQ4AgAgA0EcaiAUOAIAIANBGGogFDgCACADQRRqIBQ4AgAgA0EQaiAUOAIAIANBDGogFDgCACADQQhqIBQ4AgAgA0EEaiAUOAIAIANBIGohAyAAIAVBCGoiBUcNAAsLIARFDQAgByAFQQJ0aiEDA0AgAyAUOAIAIANBBGohAyAEQQFrIgQNAAsLIAsgAkEBdiIFQQJ0QQ9qQXBxIgBrIgwgAGshDSACQQFHBEBEAAAAAAAA8D8gArijIRsgDCEDIA0hBANAIARDAAAAPyAaRBgtRFT7IRnAoiAborZDg/kiPpQiFEMAAEDLIBSTQwAAQEuSkiIVi5MgFZQiFYtDZWJlQpRDZ6dGQZIgFZQ4AgAgA0MAAAA/IBRDAACAPpIiFEMAAEDLIBSTQwAAQEuSkiIUi5MgFJQiFItDZWJlQpRDZ6dGQZIgFJQ4AgAgA0EEaiEDIARBBGohBCAaRAAAAAAAAPA/oCEaIAVBAWsiBQ0AC0EBIQgDQCAIIgBBAXQhCCAAQQBKBEAgAEEDdCEOIABBAnQhDyACIAhodkECdCERQQAhECAHIQogCSELA0AgCiEDIAshBEEAIQUgACEGA0AgBCAFIA1qKgIAIhQgAyAPaiISKgIAIhWUIAUgDGoqAgAiFiAEIA9qIhMqAgAiF5SSIhggBCoCACIZkjgCACADIBYgFZQgFCAXlJMiFCADKgIAIhWSOAIAIBMgGSAYkzgCACASIBUgFJM4AgAgA0EEaiEDIARBBGohBCAFIBFqIQUgBkEBayIGDQALIAogDmohCiALIA5qIQsgCCAQaiIQIAJJDQALCyACIAhLDQALCwNAIAEgCSoCACIUIBSUIAcqAgAiFCAUlJIiFCAUIBS8QYCAgARrQQF1QYCAgIACar4iFJUgFJJDAAAAP5QiFJUgFJJDAAAAP5Q4AgAgB0EEaiEHIAlBBGohCSABQQRqIQEgAkEBayICDQALCwuWAQICfQF/IAFBAEoEQEMAAIA/IAFBAWuzlSEDA0AgACAAKgIAQwAAAD8gBLMgA5S7RBgtRFT7IRlAorZDg/kiPpRDAACAPpIiAkMAAEDLIAKTQwAAQEuSkiICi5MgApQiAkMfheu+lCACi0NlYmVClENnp0ZBkpRDcT0KP5KUOAIAIABBBGohACABIARBAWoiBEcNAAsLC5sCAwN9Bn8BfCAEQQJOBEAgBEECbSELIANBBGohCiAFQQJ0IQwgAyAEQQJ0aiENIAK7RBgtRFT7IRlAoiEPIARBAWuzQwAAAD+UIQgDQCABIAUgCSAFb2sgBW8iBCAJaiIDSgRAIAJDAAAAPyAPIAmzIAiTu6K2IgdDg/kiPpQiBkMAAEDLIAaTQwAAQEuSkiIGi5MgBpQiBpQgBotDZWJlQpRDZ6dGQZKUIgYgBpIhBiAEQQJ0IQRDAACAPyAHlSEHA0AgACAEaiIOIAYgBCAKaioCACAEIA1qKgIAkpQgB5QgDioCAJI4AgAgBCAMaiEEIAMgBWoiAyABSA0ACwsgCkEIaiEKIABBBGohACAJQQFqIgkgC0cNAAsLC48DAwh/AX0BfCMAIAJDZmZGQJQgBJVDAABAS5JDAABAy5L8ACIIQQFxIgogCGoiByABakECdEEPakFwcWshBiAHQQJ0IgkEQCAGQQAgCfwLAAsgAUECdCILBEAgBiAJaiAAIAv8CgAACyAHQQJOBEAgB0ECbSELIAYgCEECdCAKQQJ0amohCiAGQQRqIQggBUECdCEMIAdBAWuzQwAAAD+UIQ4gAyAEkyAClSICu0QYLURU+yEZQKIhDyACIAKSIQJBACEHA0AgASAFIAcgBW9rIAVvIgYgB2oiCUoEQCACQwAAAD8gDyAHsyAOk7uitiIDQ4P5Ij6UIgRDAABAyyAEk0MAAEBLkpIiBIuTIASUIgSUIASLQ2ViZUKUQ2enRkGSlCEEIAZBAnQhBkMAAIA/IAOVIQMDQCAAIAZqIg0gBCAGIAhqKgIAIAYgCmoqAgCSlCADlCANKgIAkjgCACAGIAxqIQYgBSAJaiIJIAFIDQALCyAIQQhqIQggAEEEaiEAIAdBAWoiByALRw0ACwsLuAQCCX0FfyAEQQBKBEAgA0PnPjs6lEMAAIA/krwiD0EXdbJDq6oAw5IgD0H///8DcUGAgID8A3K+IgVDq6qqvpRDAAAAQJIgBZSSIARBAWqzlSEHIABBBGohEEMAAIA/IANDAAAAP5QgAUEBdrOVIgqVIQgDQCAOQQFqIQ9DAAAAACEDIAcgDrOUIgVDAAD+QpL8ACIAQRd0vkMAAC9ElCAFQf8AIABrspIiBUPQ9a0+lEMYBSk/kiAFlEMAAIA/kpQiBkMAAC/EkiILIAiUQwAAAD+SQwAAQEuSQwAAQMuS/AAiASAHIA5BAmqzlCIFQwAA/kKS/AAiAEEXdL5DAAAvRJQgBUH/ACAAa7KSIgVD0PWtPpRDGAUpP5IgBZRDAACAP5KUIgVDAAAvxJIiDCAIlEMAAAC/kkMAAEBLkkMAAEDLkvwAIhFIBEAgByAPs5QiA0MAAP5CkvwAIgBBF3S+QwAAL0SUIANB/wAgAGuykiIDQ9D1rT6UQxgFKT+SIAOUQwAAgD+SlCIDQwAAL8SSIAiUQwAAQEuSQwAAQMuS/AAhEiAQIAFBAnRqIQBDAACAPyAFIAaTlSEJQwAAgD8gBSADk5UhDUMAAIA/IAMgBpOVIQZDAAAAACEDA0AgACoCACAKIAFBAWoiAbKUIgUgC5MgBpQgDCAFkyANlCABIBJIG5QgCSAJkpQgA5IhAyAAQQRqIQAgASARRw0ACwsgAiAOQQJ0aiADOAIAIA8iDiAERw0ACwsLpQECAX0DfyABQQBMBEBDAAAAAA8LIAFBA3EhBAJAIAFBBEkEQAwBCyABQfz///8HcSEFIAAhAQNAIAFBDGoqAgCLIAFBCGoqAgCLIAFBBGoqAgCLIAIgASoCAIuXl5eXIQIgAUEQaiEBIAUgA0EEaiIDRw0ACwsgBARAIAAgA0ECdGohAQNAIAIgASoCAIuXIQIgAUEEaiEBIARBAWsiBA0ACwsgAgupAgIEfwJ9AkAgAUEATA0AIAFBA3EhBAJAIAFBBEkEQAwBCyABQfz///8HcSEGIAAhAwNAIANBDGoqAgCLIANBCGoqAgCLIANBBGoqAgCLIAcgAyoCAIuXl5eXIQcgA0EQaiEDIAYgBUEEaiIFRw0ACwsgBARAIAAgBUECdGohAwNAIAcgAyoCAIuXIQcgA0EEaiEDIARBAWsiBA0ACwsgB0OVv9YzXQ0AQQAhBCABQQFHBEBDAACAPyAHlSEIIAFB/v///wdxIQUgACEDA0AgAyACIAMqAgCUIAiUOAIAIANBBGoiBiACIAYqAgCUIAiUOAIAIANBCGohAyAFIARBAmoiBEcNAAsLIAFBAXFFDQAgACAEQQJ0aiIAIAIgACoCAJQgB5U4AgALC1wCAX8BfSABBEADQCAAIAAoAgAiAkEXdbJDq6oAw5IgAkH///8DcUGAgID8A3K+IgNDq6qqvpRDAAAAQJIgA5SSQ8KoQECUOAIAIABBBGohACABQQFrIgENAAsLC6EBAgJ/AX0CQCABQQBMDQAgASEDIAFBAXEEQCAAIAFBAnRqIgMgAyoCACADQQRrKgIAIAKUkzgCACABQQFrIQMLIAFBAUYNACADQQFqIQQgA0ECdCAAakEIayEBA0AgAUEEaiIAIAAqAgAiBSABKgIAIAKUkzgCACABQQhqIgAgACoCACAFIAKUkzgCACABQQhrIQEgBEECayIEQQFLDQALCwvmAQICfQR/AkAgAUUEQAwBCyABQQNxIQYCQCABQQRJBEAMAQsgAUF8cSEHIAAhBANAIARBDGoqAgAiAyADlCAEQQhqKgIAIgMgA5QgBEEEaioCACIDIAOUIAQqAgAiAyADlCACkpKSkiECIARBEGohBCAHIAVBBGoiBUcNAAsLIAZFDQAgACAFQQJ0aiEEA0AgBCoCACIDIAOUIAKSIQIgBEEEaiEEIAZBAWsiBg0ACwsgAiABs5UiAiACIAK8QYCAgARrQQF1QYCAgIACar4iApUgApJDAAAAP5QiApUgApJDAAAAP5QLrwICBn0DfyAFBEADQCAEIA1BAnRqIg5BADYCAEEAIQxDAAAAACEGQwAAAAAhCUMAAAAAIQcDQCABIAxqKgIAIAIgDGoqAgAiCJMgAyAMaioCACILlSIKIAAgDGoqAgAgCJMgC5UiCJQgCZIhCSAKIAqUIAeSIQcgCCAIlCAGkiEGIAxBBGoiDEEwRw0ACyAOIAkgByAHIAe8QYCAgARrQQF1QYCAgIACar4iB5UgB5JDAAAAP5QiB5UgB5JDAACAPpQgBiAGIAa8QYCAgARrQQF1QYCAgIACar4iBpUgBpJDAAAAP5QiBpUgBpKUlUMAAAAAlyIGIAaUIgYgBpQiBiAGIAaUIgYgBpQiBiAGlCIGlCAGIAaUlDgCACABQTBqIQEgDUEBaiINIAVHDQALCwuWBQICfQN/IAUEQANAIAQgCUECdGoiAkEANgIAIAIgACoCACABIAlBMGxqIggqAgCTIAMqAgCViyIGOAIAIAIgACoCBCAIKgIEkyADKgIElYsgBpIiBjgCACACIAAqAgggCCoCCJMgAyoCCJWLIAaSIgY4AgAgAiAAKgIMIAgqAgyTIAMqAgyViyAGkiIGOAIAIAIgACoCECAIKgIQkyADKgIQlYsgBpIiBjgCACACIAAqAhQgCCoCFJMgAyoCFJWLIAaSIgY4AgAgAiAAKgIYIAgqAhiTIAMqAhiViyAGkiIGOAIAIAIgACoCHCAIKgIckyADKgIclYsgBpIiBjgCACACIAAqAiAgCCoCIJMgAyoCIJWLIAaSIgY4AgAgAiAAKgIkIAgqAiSTIAMqAiSViyAGkiIGOAIAIAIgACoCKCAIKgIokyADKgIolYsgBpIiBjgCAAJAIAAqAiwgCCoCLJMgAyoCLJWLIAaSQ6uqqj2UIgZDAAAAAF9FBEAgBiAGj5ND6v9TQJQiB0H/ACAHQwAA/kKS/AAiCGuykiIHQ9D1rT6UQxgFKT+SIAeUQwAAgD+SIAhBF3S+lCEHIAb8ASIIBEBDAAAgQSEGA0AgByAGQwAAgD8gCEEBcRuUIQcgCEEBSyAGIAaUIQYgCEEBdiEIDQALC0MAAIA/IAeVIQcMAQsgBowiBiAGj5ND6v9TQJQiB0H/ACAHQwAA/kKS/AAiCGuykiIHQ9D1rT6UQxgFKT+SIAeUQwAAgD+SIAhBF3S+lCEHIAb8ASIIRQ0AQwAAIEEhBgNAIAcgBkMAAIA/IAhBAXEblCEHIAhBAUsgBiAGlCEGIAhBAXYhCA0ACwsgAiAHOAIAIAlBAWoiCSAFRw0ACwsL9gUCAn0DfyAFBEADQCAEIAlBAnRqIgJBADYCACACIAAqAgAgASAJQTBsaiIIKgIAkyADKgIAlSIGIAaUIgY4AgAgAiAGIAAqAgQgCCoCBJMgAyoCBJUiBiAGlJIiBjgCACACIAYgACoCCCAIKgIIkyADKgIIlSIGIAaUkiIGOAIAIAIgBiAAKgIMIAgqAgyTIAMqAgyVIgYgBpSSIgY4AgAgAiAGIAAqAhAgCCoCEJMgAyoCEJUiBiAGlJIiBjgCACACIAYgACoCFCAIKgIUkyADKgIUlSIGIAaUkiIGOAIAIAIgBiAAKgIYIAgqAhiTIAMqAhiVIgYgBpSSIgY4AgAgAiAGIAAqAhwgCCoCHJMgAyoCHJUiBiAGlJIiBjgCACACIAYgACoCICAIKgIgkyADKgIglSIGIAaUkiIGOAIAIAIgBiAAKgIkIAgqAiSTIAMqAiSVIgYgBpSSIgY4AgAgAiAGIAAqAiggCCoCKJMgAyoCKJUiBiAGlJIiBjgCAAJAIAYgACoCLCAIKgIskyADKgIslSIGIAaUkkOrqqo9lCIGIAYgBrxBgICABGtBAXVBgICAgAJqviIGlSAGkkMAAAA/lCIGlSAGkkMAAAA/lCIGQwAAAABfRQRAIAYgBo+TQ+r/U0CUIgdB/wAgB0MAAP5CkvwAIghrspIiB0PQ9a0+lEMYBSk/kiAHlEMAAIA/kiAIQRd0vpQhByAG/AEiCARAQwAAIEEhBgNAIAcgBkMAAIA/IAhBAXEblCEHIAhBAUsgBiAGlCEGIAhBAXYhCA0ACwtDAACAPyAHlSEHDAELIAaMIgYgBo+TQ+r/U0CUIgdB/wAgB0MAAP5CkvwAIghrspIiB0PQ9a0+lEMYBSk/kiAHlEMAAIA/kiAIQRd0vpQhByAG/AEiCEUNAEMAACBBIQYDQCAHIAZDAACAPyAIQQFxG5QhByAIQQFLIAYgBpQhBiAIQQF2IQgNAAsLIAIgBzgCACAJQQFqIgkgBUcNAAsLC6gCAgR/An0CQCABRQ0AIAFBA3EhAwJAIAFBBEkEQAwBCyABQXxxIQUgACECA0AgAkEMaioCACACQQhqKgIAIAJBBGoqAgAgAioCACAGkpKSkiEGIAJBEGohAiAFIARBBGoiBEcNAAsLIAMEQCAAIARBAnRqIQIDQCACKgIAIAaSIQYgAkEEaiECIANBAWsiAw0ACwsgBkMAAAAAX0UEQEEAIQMgAUEBRwRAQwAAgD8gBpUhByABQX5xIQQgACECA0AgAiACKgIAIAeUOAIAIAJBBGoiBSAFKgIAIAeUOAIAIAJBCGohAiAEIANBAmoiA0cNAAsLIAFBAXFFDQEgACADQQJ0aiIAIAAqAgAgBpU4AgAMAQsgAUECdCIBRQ0AIABBACAB/AsACwsLFwEAQYAICxAQBAAAEBwAAEAcAACAuwAAACYJcHJvZHVjZXJzAQxwcm9jZXNzZWQtYnkBBWNsYW5nBjIxLjEuMQB8D3RhcmdldF9mZWF0dXJlcwcrD211dGFibGUtZ2xvYmFscysTbm9udHJhcHBpbmctZnB0b2ludCsLYnVsay1tZW1vcnkrCHNpZ24tZXh0Kw9yZWZlcmVuY2UtdHlwZXMrCm11bHRpdmFsdWUrD2J1bGstbWVtb3J5LW9wdA==`;function Ep(e,t,n,r,i){let a=2/r,o=a*i,s=1/(1+o+.48*o*o+.235*o*o*o),c=e-t,l=(n+a*c)*i;return n=(n-a*l)*s,[t+(c+l)*s,n]}var Dp={wasmModule:void 0},Op=class extends AudioWorkletNode{openCloseVelocity=0;lastTimestamp=0;weightVelocities={};minVolume=-2.5;maxVolume=-1.5;smoothness=.05;volume=0;weights={};constructor(e,t,n=Dp.wasmModule){super(e,`wlipsync-processor`,{processorOptions:{wasmModule:n,profile:t}});for(let e of t.mfccs)this.weights[e.name]=0,this.weightVelocities[e.name]=0;this.port.onmessage=this.onMessage.bind(this)}onMessage(e){let t=e.data.timestamp-this.lastTimestamp;this.lastTimestamp=e.data.timestamp;let n=Number.isNaN(e.data.volume)?0:e.data.volume,r=Math.log10(n);for(let n in r=(r-this.minVolume)/(this.maxVolume-this.minVolume),r=Math.max(Math.min(r,1),0),[this.volume,this.openCloseVelocity]=Ep(this.volume,r,this.openCloseVelocity,this.smoothness,t),this.weights){let r=n===e.data.name?1:0,i=this.weightVelocities[n];[this.weights[n],i]=Ep(this.weights[n],r,i,this.smoothness,t),this.weightVelocities[n]=i}}get blockSize(){return this.parameters.get(`blockSize`).value}set blockSize(e){this.parameters.get(`blockSize`).setValueAtTime(e,this.context.currentTime)}};new TextDecoder,Dp.wasmModule=await WebAssembly.compileStreaming(fetch(Tp));async function kp(e,t){try{return new Op(e,t)}catch{return await e.audioWorklet.addModule(new URL(`data:text/javascript;base64,dmFyIEI9bmV3IFdlYkFzc2VtYmx5Lk1lbW9yeSh7aW5pdGlhbDo0fSksWD17ZW52OnttZW1vcnk6Qn19O2NsYXNzIFUgZXh0ZW5kcyBBdWRpb1dvcmtsZXRQcm9jZXNzb3J7aW5wdXRCdWZmZXJJbmRleD0tMTtpbnB1dEJ1ZmZlclB0cj0tMTtpbnB1dEJ1ZmZlclNpemU9LTE7aW5wdXRCdWZmZXI9bnVsbDtsYXN0SW5kZXg9MDt2b2x1bWVQdHI9LTE7dm9sdW1lVmlldz1udWxsO21mY2NzPVtdO2V4cG9ydHM9bnVsbDtjb25zdHJ1Y3RvcihKKXtzdXBlcigpO2NvbnN0e3dhc21Nb2R1bGU6Uyxwcm9maWxlOmt9PUoucHJvY2Vzc29yT3B0aW9ucztXZWJBc3NlbWJseS5pbnN0YW50aWF0ZShTLFgpLnRoZW4oKEcpPT57Y29uc3Qgej10aGlzLmV4cG9ydHM9Ry5leHBvcnRzLEU9ay5tZmNjcy5sZW5ndGgsVz16LmxvYWRfcHJvZmlsZShrLnRhcmdldFNhbXBsZVJhdGUsay5zYW1wbGVDb3VudCxrLm1lbEZpbHRlckJhbmtDaGFubmVscyxrLmNvbXBhcmVNZXRob2QsRSxrLm1mY2NEYXRhQ291bnQsay51c2VTdGFuZGFyZGl6YXRpb24/MTowKSxUPXRoaXMubWZjY3M9ay5tZmNjcztpZighay5tZWFucyl7Y29uc3QgSz1uZXcgRGF0YVZpZXcoQi5idWZmZXIsVyxFKmsubWZjY0RhdGFDb3VudCoxMio0KTtsZXQgRj0wO2ZvcihsZXQgTiBvZiBUKWZvcihsZXQgUSBvZiBOLm1mY2NDYWxpYnJhdGlvbkRhdGFMaXN0KWZvcihsZXQgUiBvZiBRLmFycmF5KUsuc2V0RmxvYXQzMihGLFIsITApLEYrPTQ7ei5wcmVjb21wdXRlX3Byb2ZpbGUoKX1lbHNle2NvbnN0IEs9ei5nZXRfcHJvZmlsZV9wdHJzKCksRj1uZXcgRGF0YVZpZXcoQi5idWZmZXIsSywxMiksTj1uZXcgRGF0YVZpZXcoQi5idWZmZXIsRi5nZXRJbnQzMigwLCEwKSxFKjEyKjQpO2ZvcihsZXQgQT0wO0E8RTtBKyspZm9yKGxldCBIPTA7SDwxMjtIKyspTi5zZXRGbG9hdDMyKChBKjEyK0gpKjQsVFtBXS52YWx1ZXNbSF0sITApO2NvbnN0IFE9bmV3IERhdGFWaWV3KEIuYnVmZmVyLEYuZ2V0SW50MzIoNCwhMCksNDgpLFI9bmV3IERhdGFWaWV3KEIuYnVmZmVyLEYuZ2V0SW50MzIoOCwhMCksNDgpO2ZvcihsZXQgQT0wO0E8MTI7QSsrKVEuc2V0RmxvYXQzMihBKjQsay5tZWFuc1tBXSwhMCksUi5zZXRGbG9hdDMyKEEqNCxrLnN0ZERldnNbQV0sITApfXouc2V0X2lucHV0KHNhbXBsZVJhdGUpLHRoaXMuaW5wdXRCdWZmZXJQdHI9ei5nZXRfaW5wdXRfYnVmZmVyKCksdGhpcy5pbnB1dEJ1ZmZlclNpemU9ei5nZXRfaW5wdXRfYnVmZmVyX3NpemUoKSx0aGlzLmlucHV0QnVmZmVyPW5ldyBGbG9hdDMyQXJyYXkoQi5idWZmZXIsdGhpcy5pbnB1dEJ1ZmZlclB0cix0aGlzLmlucHV0QnVmZmVyU2l6ZSksdGhpcy5pbnB1dEJ1ZmZlckluZGV4PTAsdGhpcy5sYXN0SW5kZXg9MCx0aGlzLnZvbHVtZVB0cj16LmdldF92b2x1bWVfcHRyKCksdGhpcy52b2x1bWVWaWV3PW5ldyBEYXRhVmlldyhCLmJ1ZmZlcix0aGlzLnZvbHVtZVB0ciw0KX0pfXN0YXRpYyBnZXQgcGFyYW1ldGVyRGVzY3JpcHRvcnMoKXtyZXR1cm5be25hbWU6ImJsb2NrU2l6ZSIsZGVmYXVsdFZhbHVlOjUxMixtaW5WYWx1ZToxMjgsYXV0b21hdGlvblJhdGU6ImstcmF0ZSJ9XX1wcm9jZXNzKEosUyxrKXtjb25zdCBHPUpbMF1bMF07aWYoIUcpcmV0dXJuITA7aWYodGhpcy5pbnB1dEJ1ZmZlckluZGV4PT09LTEpcmV0dXJuITA7Zm9yKGxldCB6PTA7ejxHLmxlbmd0aDt6KyspdGhpcy5pbnB1dEJ1ZmZlclt0aGlzLmlucHV0QnVmZmVySW5kZXhdPUdbel0sdGhpcy5pbnB1dEJ1ZmZlckluZGV4PSh0aGlzLmlucHV0QnVmZmVySW5kZXgrMSkldGhpcy5pbnB1dEJ1ZmZlclNpemU7aWYoKHRoaXMuaW5wdXRCdWZmZXJJbmRleCt0aGlzLmlucHV0QnVmZmVyU2l6ZS10aGlzLmxhc3RJbmRleCkldGhpcy5pbnB1dEJ1ZmZlclNpemU9PT1rLmJsb2NrU2l6ZVswXSl7Y29uc3Qgej10aGlzLmV4cG9ydHMuZXhlY3V0ZSh0aGlzLmlucHV0QnVmZmVySW5kZXgpLEU9dGhpcy52b2x1bWVWaWV3LmdldEZsb2F0MzIoMCwhMCk7dGhpcy5wb3J0LnBvc3RNZXNzYWdlKHt0aW1lc3RhbXA6Y3VycmVudFRpbWUsaW5kZXg6eixuYW1lOnRoaXMubWZjY3Nbel0ubmFtZSx2b2x1bWU6RX0pLHRoaXMubGFzdEluZGV4PXRoaXMuaW5wdXRCdWZmZXJJbmRleH1yZXR1cm4hMH19cmVnaXN0ZXJQcm9jZXNzb3IoIndsaXBzeW5jLXByb2Nlc3NvciIsVSk7Cg==`,import.meta.url)),new Op(e,t)}}var Ap={jsonPath:`/home/steamvr/projects/wLipSync/www/profile.json`,mfccNum:12,mfccDataCount:12,melFilterBankChannels:30,targetSampleRate:16e3,sampleCount:1024,useStandardization:!1,compareMethod:2,mfccs:[{name:`A`,mfccCalibrationDataList:[{array:[94.40318298339844,.32245922088623047,-65.5116195678711,-29.537851333618164,4.888294219970703,14.523965835571287,-32.6411247253418,1.6505765914916992,-9.960077285766602,-5.7025322914123535,-11.886154174804688,-24.35236358642578]},{array:[94.40318298339844,.32245922088623047,-65.5116195678711,-29.537851333618164,4.888294219970703,14.523965835571287,-32.6411247253418,1.6505765914916992,-9.960077285766602,-5.7025322914123535,-11.886154174804688,-24.35236358642578]},{array:[102.16287231445312,-3.3587560653686523,-65.58428192138672,-25.24440574645996,3.224522590637207,12.005892753601076,-29.293079376220703,.6378564834594727,-10.817683219909668,-1.3263540267944336,-14.543159484863281,-24.169780731201172]},{array:[99.35592651367188,-3.681424140930176,-65.20439910888672,-23.45950698852539,6.205645561218262,14.96288013458252,-29.882709503173828,.6733551025390625,-7.077619552612305,-3.5570802688598637,-14.42734718322754,-23.34000396728516]},{array:[99.35592651367188,-3.681424140930176,-65.20439910888672,-23.45950698852539,6.205645561218262,14.96288013458252,-29.882709503173828,.6733551025390625,-7.077619552612305,-3.5570802688598637,-14.42734718322754,-23.34000396728516]},{array:[104.24951171875,-2.832884788513184,-66.59016418457031,-22.962886810302734,5.519782066345215,16.50394058227539,-32.338768005371094,5.820473670959473,-10.59586238861084,-2.7398462295532227,-12.5281400680542,-24.459365844726562]},{array:[104.24951171875,-2.832884788513184,-66.59016418457031,-22.962886810302734,5.519782066345215,16.50394058227539,-32.338768005371094,5.820473670959473,-10.59586238861084,-2.7398462295532227,-12.5281400680542,-24.459365844726562]},{array:[95.58644104003906,-5.775191307067871,-61.220008850097656,-24.658382415771488,4.411270141601563,13.673284530639648,-25.223039627075195,-2.0546646118164062,-6.887641906738281,-5.683987617492676,-11.20918083190918,-23.215322494506836]},{array:[98.24864196777344,-3.8367862701416016,-62.34006118774414,-24.563793182373047,4.608433723449707,16.228965759277344,-28.992279052734375,2.1237001419067383,-9.07174015045166,-4.581008434295654,-10.662440299987791,-26.19581413269043]},{array:[102.7921142578125,-4.580304145812988,-62.53183746337891,-26.292770385742188,7.911410331726074,17.13638496398926,-31.118263244628906,5.196089744567871,-10.01039695739746,-.8527965545654297,-12.346561431884766,-23.580944061279297]},{array:[102.12345123291016,-1.5254135131835938,-62.21220397949219,-26.728734970092777,10.62057876586914,16.918357849121097,-28.815664291381836,3.6714258193969727,-9.67378616333008,-.7385025024414062,-9.717185020446777,-27.09702491760254]},{array:[102.12345123291016,-1.5254135131835938,-62.21220397949219,-26.728734970092777,10.62057876586914,16.918357849121097,-28.815664291381836,3.6714258193969727,-9.67378616333008,-.7385025024414062,-9.717185020446777,-27.09702491760254]}]},{name:`I`,mfccCalibrationDataList:[{array:[14.441835403442385,52.40011596679688,57.37783813476563,-33.70046615600586,-12.751934051513672,-15.709930419921877,-41.381065368652344,-12.190519332885744,-2.863154411315918,-8.727733612060547,2.6656012535095215,1.4855976104736328]},{array:[14.441835403442385,52.40011596679688,57.37783813476563,-33.70046615600586,-12.751934051513672,-15.709930419921877,-41.381065368652344,-12.190519332885744,-2.863154411315918,-8.727733612060547,2.6656012535095215,1.4855976104736328]},{array:[15.294279098510744,50.07628631591797,57.262847900390625,-31.748844146728516,-13.642471313476564,-13.48408031463623,-41.53501129150391,-16.863862991333008,-1.739903450012207,-9.32723331451416,8.31618881225586,-1.779850959777832]},{array:[15.685098648071287,49.68647766113281,58.447113037109375,-32.513519287109375,-16.664287567138672,-13.78364372253418,-40.48309326171875,-16.04582405090332,-3.5356569290161137,-8.654275894165039,10.645575523376465,-2.556441307067871]},{array:[15.685098648071287,49.68647766113281,58.447113037109375,-32.513519287109375,-16.664287567138672,-13.78364372253418,-40.48309326171875,-16.04582405090332,-3.5356569290161137,-8.654275894165039,10.645575523376465,-2.556441307067871]},{array:[15.685098648071287,49.68647766113281,58.447113037109375,-32.513519287109375,-16.664287567138672,-13.78364372253418,-40.48309326171875,-16.04582405090332,-3.5356569290161137,-8.654275894165039,10.645575523376465,-2.556441307067871]},{array:[15.225826263427736,43.872196197509766,52.844512939453125,-32.51786804199219,-17.806241989135746,-10.609650611877441,-40.13084411621094,-11.58648681640625,-5.082568168640137,-14.396997451782228,6.896979331970215,-.785430908203125]},{array:[15.571629524230955,48.63488388061524,59.5339469909668,-34.59955596923828,-21.95987129211426,-10.298498153686523,-39.11286926269531,-11.998537063598633,-8.433327674865723,-10.80599594116211,8.789299011230469,-1.884697437286377]},{array:[15.571629524230955,48.63488388061524,59.5339469909668,-34.59955596923828,-21.95987129211426,-10.298498153686523,-39.11286926269531,-11.998537063598633,-8.433327674865723,-10.80599594116211,8.789299011230469,-1.884697437286377]},{array:[15.571629524230955,48.63488388061524,59.5339469909668,-34.59955596923828,-21.95987129211426,-10.298498153686523,-39.11286926269531,-11.998537063598633,-8.433327674865723,-10.80599594116211,8.789299011230469,-1.884697437286377]},{array:[19.23290252685547,47.43399810791016,54.90937423706055,-33.7783203125,-13.836353302001953,-5.141571044921875,-39.34584045410156,-13.409493446350098,-4.945652008056641,-12.96050262451172,12.210061073303224,.5807018280029297]},{array:[19.124774932861328,46.46723937988281,53.41281509399414,-34.65093994140625,-18.181049346923828,-7.733134746551514,-45.67931365966797,-10.64135456085205,-2.624391555786133,-15.708955764770508,7.36491870880127,-5.627689361572266]}]},{name:`U`,mfccCalibrationDataList:[{array:[83.38372802734375,42.39790725708008,27.812450408935547,10.69615077972412,-13.612553596496582,-32.487091064453125,-35.2574348449707,-6.425739288330078,-4.214997291564941,-6.896385669708252,-3.49631404876709,4.997060775756836]},{array:[103.65653228759766,38.661563873291016,30.985050201416016,17.43245124816895,-14.383820533752441,-39.810001373291016,-39.63761901855469,1.2333955764770508,-4.217883110046387,-3.005303382873535,-6.272947311401367,4.751875877380371]},{array:[103.44242095947266,45.23821640014649,27.622669219970703,18.682138442993164,-16.854982376098633,-39.85029602050781,-34.15940856933594,-2.7482595443725586,-3.741057395935059,-1.0625238418579102,-4.215768814086914,6.514510154724121]},{array:[103.44242095947266,45.23821640014649,27.622669219970703,18.682138442993164,-16.854982376098633,-39.85029602050781,-34.15940856933594,-2.7482595443725586,-3.741057395935059,-1.0625238418579102,-4.215768814086914,6.514510154724121]},{array:[99.99739837646484,39.48998260498047,26.0573844909668,23.26814079284668,-16.25522804260254,-38.15496063232422,-35.70051574707031,-1.2821111679077148,-2.3941946029663086,-.15543842315673828,-4.757769584655762,2.198577880859375]},{array:[99.99739837646484,39.48998260498047,26.0573844909668,23.26814079284668,-16.25522804260254,-38.15496063232422,-35.70051574707031,-1.2821111679077148,-2.3941946029663086,-.15543842315673828,-4.757769584655762,2.198577880859375]},{array:[107.09538269042967,37.70401000976563,17.795482635498047,21.882326126098633,-14.739266395568848,-36.407527923583984,-37.95854949951172,-1.4393510818481445,-1.9593324661254885,-.7294750213623047,-7.93386173248291,3.9560585021972656]},{array:[103.5069351196289,35.08988952636719,23.21630859375,23.947580337524418,-14.157055854797363,-38.546836853027344,-39.75208282470703,.516876220703125,-2.715259552001953,-4.076820850372315,-4.716378211975098,4.662134170532227]},{array:[103.5069351196289,35.08988952636719,23.21630859375,23.947580337524418,-14.157055854797363,-38.546836853027344,-39.75208282470703,.516876220703125,-2.715259552001953,-4.076820850372315,-4.716378211975098,4.662134170532227]},{array:[103.5069351196289,35.08988952636719,23.21630859375,23.947580337524418,-14.157055854797363,-38.546836853027344,-39.75208282470703,.516876220703125,-2.715259552001953,-4.076820850372315,-4.716378211975098,4.662134170532227]},{array:[98.43344116210938,35.42580032348633,29.2958984375,24.73729133605957,-15.485936164855955,-44.67648315429688,-39.97885894775391,.5548343658447266,-2.2034664154052734,-3.485844612121582,-7.421210289001465,6.30616569519043]},{array:[94.0390625,36.81925582885742,24.73573875427246,22.579418182373047,-14.354126930236816,-37.92849349975586,-44.69046401977539,.7474861145019531,-3.3195743560791016,-3.9850082397460938,-5.991059303283691,6.134122848510742]}]},{name:`E`,mfccCalibrationDataList:[{array:[60.52040481567383,14.444153785705568,50.91899108886719,6.730878829956055,-58.12107467651367,-16.403745651245117,-25.244909286499023,5.399906158447266,-7.63681697845459,-2.496482849121094,7.271292209625244,1.732271194458008]},{array:[59.32724761962891,14.82846450805664,51.402244567871094,5.413976669311523,-55.60324096679688,-15.348665237426758,-25.923606872558597,3.0006580352783203,-4.183259963989258,-3.4587841033935547,7.941498756408691,3.449912071228028]},{array:[59.32724761962891,14.82846450805664,51.402244567871094,5.413976669311523,-55.60324096679688,-15.348665237426758,-25.923606872558597,3.0006580352783203,-4.183259963989258,-3.4587841033935547,7.941498756408691,3.449912071228028]},{array:[64.61061096191406,7.8438310623168945,54.75372695922852,11.154451370239258,-62.99680709838867,-10.397377967834473,-36.124359130859375,12.57413387298584,-6.086113452911377,-3.032306671142578,10.453157424926758,-.00012826919555664065]},{array:[59.8906135559082,13.646936416625977,53.14240646362305,11.346290588378908,-60.17724609375,-15.942718505859377,-29.547088623046875,8.241331100463867,-6.890452384948731,-3.6554131507873535,14.714229583740236,-2.811859607696533]},{array:[53.77520751953125,6.071747779846191,47.87072372436524,5.943275451660156,-51.11442184448242,-16.62527656555176,-24.84233665466309,4.076478004455566,-8.835965156555176,-4.306196689605713,13.907751083374023,-.6555676460266113]},{array:[53.77520751953125,6.071747779846191,47.87072372436524,5.943275451660156,-51.11442184448242,-16.62527656555176,-24.84233665466309,4.076478004455566,-8.835965156555176,-4.306196689605713,13.907751083374023,-.6555676460266113]},{array:[53.77520751953125,6.071747779846191,47.87072372436524,5.943275451660156,-51.11442184448242,-16.62527656555176,-24.84233665466309,4.076478004455566,-8.835965156555176,-4.306196689605713,13.907751083374023,-.6555676460266113]},{array:[62.81553649902344,6.203365325927734,48.45057678222656,8.571174621582031,-53.907508850097656,-16.376169204711918,-25.989578247070312,5.736949920654297,-8.150140762329102,-5.895424842834473,13.745902061462404,-4.22935676574707]},{array:[53.43303680419922,7.019550323486328,43.32084655761719,7.639513969421387,-49.81471633911133,-18.70837783813477,-21.690540313720703,.34458446502685547,-8.689970970153809,-3.96992826461792,11.29841423034668,-4.165286540985107]},{array:[56.29218673706055,7.115049362182617,47.741546630859375,4.102975845336914,-50.46143341064453,-18.23562622070313,-22.557659149169925,6.925202369689941,-13.170380592346191,-1.0300326347351076,8.813325881958008,-3.2347850799560547]},{array:[56.29218673706055,7.115049362182617,47.741546630859375,4.102975845336914,-50.46143341064453,-18.23562622070313,-22.557659149169925,6.925202369689941,-13.170380592346191,-1.0300326347351076,8.813325881958008,-3.2347850799560547]}]},{name:`O`,mfccCalibrationDataList:[{array:[108.1234893798828,57.48288345336914,.23154354095458984,-31.144771575927734,-38.093109130859375,-18.33026885986328,-11.25010108947754,-.7636222839355469,-1.371236801147461,-9.181392669677736,-1.6202507019042969,-7.501105308532715]},{array:[108.1234893798828,57.48288345336914,.23154354095458984,-31.144771575927734,-38.093109130859375,-18.33026885986328,-11.25010108947754,-.7636222839355469,-1.371236801147461,-9.181392669677736,-1.6202507019042969,-7.501105308532715]},{array:[120.48326873779295,61.38327026367188,-2.67855453491211,-32.3900146484375,-40.94635772705078,-12.681024551391602,-10.979912757873535,-.7160100936889648,-2.9078426361083984,-12.30073928833008,1.8719825744628908,-6.2853875160217285]},{array:[109.58128356933594,58.46321105957031,.1479501724243164,-31.080230712890625,-34.73053741455078,-17.423336029052734,-10.221624374389648,.3863086700439453,-1.2579708099365237,-7.037452220916748,-2.894855499267578,-7.0971550941467285]},{array:[109.58128356933594,58.46321105957031,.1479501724243164,-31.080230712890625,-34.73053741455078,-17.423336029052734,-10.221624374389648,.3863086700439453,-1.2579708099365237,-7.037452220916748,-2.894855499267578,-7.0971550941467285]},{array:[116.19681549072266,60.3573112487793,.07350921630859375,-32.38472747802735,-34.47290802001953,-16.37361526489258,-14.695085525512695,.3102083206176758,.28844451904296875,-8.948881149291992,-3.104994773864746,-9.900266647338867]},{array:[116.19681549072266,60.3573112487793,.07350921630859375,-32.38472747802735,-34.47290802001953,-16.37361526489258,-14.695085525512695,.3102083206176758,.28844451904296875,-8.948881149291992,-3.104994773864746,-9.900266647338867]},{array:[98.63448333740236,48.66178131103516,2.394181251525879,-28.785797119140625,-31.54886054992676,-18.37759017944336,-14.998208999633787,-1.8050260543823244,-2.018402099609375,-4.584748268127441,-5.160560607910156,-7.968695163726807]},{array:[124.25032043457033,59.27610397338867,2.7454710006713867,-36.72577667236328,-38.65552520751953,-3.116687774658203,-24.24558448791504,.5085678100585938,2.3633852005004883,-10.51361083984375,1.7447805404663088,-13.22685432434082]},{array:[87.89213562011719,45.08750534057617,4.292821884155273,-26.482845306396488,-30.386096954345703,-20.410654067993164,-11.817208290100098,-3.12704086303711,-1.1370172500610352,-6.159217357635498,-3.454045295715332,-5.7265400886535645]},{array:[87.89213562011719,45.08750534057617,4.292821884155273,-26.482845306396488,-30.386096954345703,-20.410654067993164,-11.817208290100098,-3.12704086303711,-1.1370172500610352,-6.159217357635498,-3.454045295715332,-5.7265400886535645]},{array:[87.89213562011719,45.08750534057617,4.292821884155273,-26.482845306396488,-30.386096954345703,-20.410654067993164,-11.817208290100098,-3.12704086303711,-1.1370172500610352,-6.159217357635498,-3.454045295715332,-5.7265400886535645]}]},{name:`S`,mfccCalibrationDataList:[{array:[-94.29214477539064,9.299236297607422,-21.6169376373291,4.123956203460693,1.3645498752593996,-2.339733839035034,12.92388916015625,-7.490560531616211,10.520170211791992,-5.4832611083984375,2.162111043930054,2.696177482604981]},{array:[-94.29214477539064,9.299236297607422,-21.6169376373291,4.123956203460693,1.3645498752593996,-2.339733839035034,12.92388916015625,-7.490560531616211,10.520170211791992,-5.4832611083984375,2.162111043930054,2.696177482604981]},{array:[-92.13811492919922,8.712703704833984,-17.194181442260746,4.387561798095703,2.288078784942627,-9.562786102294922,9.854814529418945,-7.843216896057129,8.969221115112305,-7.96703052520752,.38271141052246094,2.731431007385254]},{array:[-92.13811492919922,8.712703704833984,-17.194181442260746,4.387561798095703,2.288078784942627,-9.562786102294922,9.854814529418945,-7.843216896057129,8.969221115112305,-7.96703052520752,.38271141052246094,2.731431007385254]},{array:[-90.87933349609376,12.622742652893068,-12.25172233581543,6.775156497955322,6.892632007598877,-4.708589553833008,10.558273315429688,-10.19419288635254,10.907587051391602,.7259445190429688,6.631969451904297,1.2803831100463867]},{array:[-90.87933349609376,12.622742652893068,-12.25172233581543,6.775156497955322,6.892632007598877,-4.708589553833008,10.558273315429688,-10.19419288635254,10.907587051391602,.7259445190429688,6.631969451904297,1.2803831100463867]},{array:[-94.86066436767578,18.40726089477539,-5.981902599334717,7.446142196655273,11.998884201049805,1.1316719055175781,5.726372718811035,-9.411809921264648,9.966836929321287,.6692547798156738,3.0949947834014897,-.5439543724060059]},{array:[-94.86066436767578,18.40726089477539,-5.981902599334717,7.446142196655273,11.998884201049805,1.1316719055175781,5.726372718811035,-9.411809921264648,9.966836929321287,.6692547798156738,3.0949947834014897,-.5439543724060059]},{array:[-94.86066436767578,18.40726089477539,-5.981902599334717,7.446142196655273,11.998884201049805,1.1316719055175781,5.726372718811035,-9.411809921264648,9.966836929321287,.6692547798156738,3.0949947834014897,-.5439543724060059]},{array:[-100.9681396484375,15.002283096313477,-4.994745254516602,.22259855270385745,-.15606117248535156,-1.8661277294158936,1.5652005672454836,-13.30648422241211,12.554527282714844,-2.990779399871826,3.5510034561157227,5.119507312774658]},{array:[-100.9681396484375,15.002283096313477,-4.994745254516602,.22259855270385745,-.15606117248535156,-1.8661277294158936,1.5652005672454836,-13.30648422241211,12.554527282714844,-2.990779399871826,3.5510034561157227,5.119507312774658]},{array:[-101.28047943115236,14.962509155273438,-10.988410949707031,3.6384878158569336,-1.4698257446289065,-4.758091449737549,-1.3547701835632324,-12.941855430603027,3.351996183395386,-5.5131611824035645,9.386914253234863,3.8310816287994385]}]},{name:`A`,mfccCalibrationDataList:[{array:[4.20286750793457,-73.493896484375,-24.746726989746097,-41.51460266113281,36.48657989501953,-18.2531795501709,-42.99116516113281,25.61282348632813,-18.3366813659668,-15.366691589355469,-4.867555618286133,-8.545194625854492]},{array:[6.645953178405762,-70.99688720703125,-23.49920082092285,-40.70307922363281,35.09113311767578,-19.63579750061035,-41.851219177246094,26.54837036132813,-20.36124420166016,-15.091900825500488,-5.332237243652344,-7.199653625488281]},{array:[6.645953178405762,-70.99688720703125,-23.49920082092285,-40.70307922363281,35.09113311767578,-19.63579750061035,-41.851219177246094,26.54837036132813,-20.36124420166016,-15.091900825500488,-5.332237243652344,-7.199653625488281]},{array:[3.48603630065918,-73.30689239501953,-21.244325637817383,-38.72576522827149,41.22803497314453,-15.975458145141602,-42.09079360961914,27.367385864257816,-19.52243995666504,-16.397735595703125,-3.779520988464355,-4.958502292633057]},{array:[.09921550750732422,-70.22235107421875,-20.888980865478516,-33.53620910644531,48.01523208618164,-13.365336418151855,-42.88488006591797,26.45193481445313,-13.952343940734863,-16.65743064880371,-1.894343376159668,-1.8812918663024905]},{array:[.09921550750732422,-70.22235107421875,-20.888980865478516,-33.53620910644531,48.01523208618164,-13.365336418151855,-42.88488006591797,26.45193481445313,-13.952343940734863,-16.65743064880371,-1.894343376159668,-1.8812918663024905]},{array:[.09921550750732422,-70.22235107421875,-20.888980865478516,-33.53620910644531,48.01523208618164,-13.365336418151855,-42.88488006591797,26.45193481445313,-13.952343940734863,-16.65743064880371,-1.894343376159668,-1.8812918663024905]},{array:[-4.117016792297363,-72.00682830810547,-19.490331649780277,-34.48163986206055,51.383995056152344,-9.989368438720703,-41.8690185546875,23.82486724853516,-11.14547061920166,-14.500547409057617,-2.504335403442383,1.0616645812988281]},{array:[-3.077279090881348,-77.95940399169922,-21.169992446899418,-43.19057846069336,47.594181060791016,-14.239681243896484,-43.05297088623047,23.796558380126953,-16.033828735351562,-14.308491706848145,-4.90071964263916,-.6597251892089844]},{array:[-3.077279090881348,-77.95940399169922,-21.169992446899418,-43.19057846069336,47.594181060791016,-14.239681243896484,-43.05297088623047,23.796558380126953,-16.033828735351562,-14.308491706848145,-4.90071964263916,-.6597251892089844]},{array:[.27674388885498047,-74.16876220703125,-19.241043090820312,-43.69765853881836,45.94886779785156,-15.777923583984377,-40.226318359375,25.209468841552734,-19.91909408569336,-14.123311042785645,-6.749327659606934,-2.186051368713379]},{array:[1.313084602355957,-70.17343139648438,-20.149150848388672,-40.1507568359375,43.281288146972656,-17.598236083984375,-39.989742279052734,19.475574493408203,-18.73434066772461,-15.377893447875977,-3.6761083602905273,-2.372090339660645]}]},{name:`I`,mfccCalibrationDataList:[{array:[-43.23860549926758,15.659211158752441,48.96119689941406,-84.8009033203125,-2.832998275756836,-25.101383209228516,-19.283388137817383,-1.3310365676879885,-3.906793594360352,-5.55475664138794,-24.20616149902344,19.690078735351562]},{array:[-43.23860549926758,15.659211158752441,48.96119689941406,-84.8009033203125,-2.832998275756836,-25.101383209228516,-19.283388137817383,-1.3310365676879885,-3.906793594360352,-5.55475664138794,-24.20616149902344,19.690078735351562]},{array:[-43.23860549926758,15.659211158752441,48.96119689941406,-84.8009033203125,-2.832998275756836,-25.101383209228516,-19.283388137817383,-1.3310365676879885,-3.906793594360352,-5.55475664138794,-24.20616149902344,19.690078735351562]},{array:[-35.28649139404297,11.94938850402832,46.56689453125,-80.19161987304688,-5.332358360290527,-16.747013092041016,-17.014617919921875,-6.106320381164551,-3.5759763717651367,-11.297148704528809,-19.73563575744629,19.95285415649414]},{array:[-35.28649139404297,11.94938850402832,46.56689453125,-80.19161987304688,-5.332358360290527,-16.747013092041016,-17.014617919921875,-6.106320381164551,-3.5759763717651367,-11.297148704528809,-19.73563575744629,19.95285415649414]},{array:[-33.85117721557617,12.74870014190674,48.14194488525391,-75.80270385742188,-.9702749252319336,-14.077031135559082,-15.91115379333496,-4.433165073394775,-4.00740909576416,-9.756240844726564,-20.910476684570312,18.42697525024414]},{array:[-29.72378921508789,13.039468765258787,47.7448616027832,-74.11089324951172,.8275318145751953,-16.012189865112305,-17.36796760559082,-1.0376081466674805,-4.8292741775512695,-6.667880058288574,-23.82168960571289,16.03271865844727]},{array:[-29.259418487548828,11.963765144348145,41.54622268676758,-75.67298889160156,-2.0329294204711914,-20.586360931396488,-21.125045776367188,.5504961013793945,-5.419882774353027,-6.314876556396484,-25.0130615234375,14.262750625610352]},{array:[-29.259418487548828,11.963765144348145,41.54622268676758,-75.67298889160156,-2.0329294204711914,-20.586360931396488,-21.125045776367188,.5504961013793945,-5.419882774353027,-6.314876556396484,-25.0130615234375,14.262750625610352]},{array:[-28.383831024169925,13.10340976715088,39.94292449951172,-81.08953857421875,-4.134577751159668,-21.59007263183594,-23.217021942138672,-.3798789978027344,-5.072433471679688,-5.94474983215332,-26.63843536376953,16.777332305908203]},{array:[-30.04895401000977,16.33201599121094,44.49327850341797,-81.91828155517578,-4.171995162963867,-19.618621826171875,-20.534595489501953,-.9673957824707032,-3.2188777923583984,-6.572293758392334,-26.59181785583496,18.48187255859375]},{array:[-30.987979888916016,14.425168991088867,48.951114654541016,-82.33119201660156,-4.302616119384766,-17.64216995239258,-19.92198181152344,-1.7414522171020508,-1.731914520263672,-6.870545387268066,-22.85688591003418,19.475980758666992]}]},{name:`U`,mfccCalibrationDataList:[{array:[35.53300476074219,-11.371288299560549,16.69929885864258,-39.32943344116211,2.8931827545166016,-39.35669708251953,-22.81580924987793,-8.255973815917969,-7.3601884841918945,3.866161346435547,-36.18340301513672,.44779300689697266]},{array:[34.92810821533203,-12.66100025177002,19.55118560791016,-38.58994293212891,1.5609407424926758,-42.781375885009766,-22.405025482177734,-4.380008220672607,-9.27183723449707,5.952349662780762,-38.181243896484375,1.4162702560424805]},{array:[34.508079528808594,-10.0599946975708,18.88445281982422,-34.42189407348633,-.8881950378417969,-42.52379608154297,-20.37147331237793,-.6865062713623047,-8.89057731628418,6.381434440612793,-34.81671524047852,3.530543327331543]},{array:[34.508079528808594,-10.0599946975708,18.88445281982422,-34.42189407348633,-.8881950378417969,-42.52379608154297,-20.37147331237793,-.6865062713623047,-8.89057731628418,6.381434440612793,-34.81671524047852,3.530543327331543]},{array:[37.63418579101563,-14.223724365234377,21.262420654296875,-39.50825119018555,.31142520904541016,-43.201324462890625,-19.136680603027344,-.7461652755737305,-8.253379821777344,9.12716293334961,-33.483253479003906,9.34031105041504]},{array:[38.28554916381836,-15.814170837402344,19.503570556640625,-40.19694900512695,-.7106151580810547,-45.37378311157227,-20.631587982177734,-2.233296394348145,-6.609874725341797,8.43967342376709,-33.560943603515625,8.549976348876953]},{array:[38.28554916381836,-15.814170837402344,19.503570556640625,-40.19694900512695,-.7106151580810547,-45.37378311157227,-20.631587982177734,-2.233296394348145,-6.609874725341797,8.43967342376709,-33.560943603515625,8.549976348876953]},{array:[36.15192413330078,-19.43944549560547,19.22710609436035,-40.229862213134766,-1.7119722366333008,-44.58899688720703,-22.39651870727539,-4.687357902526856,-5.184035301208496,5.601207733154297,-35.31377792358399,6.856324195861816]},{array:[33.697601318359375,-19.53946304321289,18.151920318603516,-38.29360580444336,-1.9536991119384768,-39.18521881103516,-21.181903839111328,-8.092260360717773,-6.441320419311523,3.8472461700439458,-32.4590950012207,8.79825210571289]},{array:[31.76858520507813,-17.137840270996097,15.726847648620605,-36.897605895996094,-3.8221397399902344,-35.492652893066406,-19.920631408691406,-10.421395301818848,-7.471479415893555,1.7216854095458984,-25.7265739440918,12.090950965881348]},{array:[31.76858520507813,-17.137840270996097,15.726847648620605,-36.897605895996094,-3.8221397399902344,-35.492652893066406,-19.920631408691406,-10.421395301818848,-7.471479415893555,1.7216854095458984,-25.7265739440918,12.090950965881348]},{array:[32.6759033203125,-15.928326606750488,16.0853271484375,-34.126686096191406,-6.689325332641602,-33.79350662231445,-19.242847442626953,-10.59890079498291,-10.992877006530762,-2.9957642555236816,-23.329811096191406,14.23158359527588]}]},{name:`U`,mfccCalibrationDataList:[{array:[50.45172882080078,-7.723395347595215,32.29489135742188,-11.293773651123049,-22.777332305908203,-36.17817687988281,-17.044910430908203,-3.767278671264649,-14.233147621154785,-17.250513076782227,-19.240345001220703,-6.971443176269531]},{array:[53.59954071044922,-9.874463081359863,35.237457275390625,-11.929043769836426,-23.915904998779297,-38.07780838012695,-15.71041202545166,-6.737283706665039,-12.06786060333252,-14.436643600463867,-20.401880264282227,-7.594654560089111]},{array:[57.36424255371094,-14.57245922088623,35.10681915283203,-13.044787406921388,-24.196090698242188,-36.5896110534668,-16.161855697631836,-10.228910446166992,-10.43470287322998,-10.997936248779297,-20.92641830444336,-7.631929397583008]},{array:[57.65166473388672,-16.92430305480957,33.02215194702149,-12.667181968688965,-21.69562530517578,-32.90369415283203,-14.275350570678713,-10.332601547241213,-10.544659614562988,-6.801647186279297,-22.47809410095215,-8.94782543182373]},{array:[49.60702133178711,-9.94367504119873,25.04156494140625,-9.98995304107666,-21.814006805419925,-28.99759292602539,-16.792327880859375,-9.5930814743042,-11.523345947265623,-7.568509578704834,-20.688356399536136,-10.5545015335083]},{array:[53.43399047851563,-10.947863578796388,30.42605590820313,-10.506410598754885,-22.997278213500977,-31.270254135131836,-16.90880584716797,-9.606002807617188,-10.785472869873049,-9.04238510131836,-22.82281494140625,-12.42250919342041]},{array:[57.11727523803711,-14.77857780456543,33.16322326660156,-13.437588691711426,-25.450626373291016,-33.84945297241211,-17.6593017578125,-11.152002334594728,-12.203851699829102,-9.72322940826416,-26.653217315673828,-12.098143577575684]},{array:[58.65357208251953,-15.040183067321777,32.92494583129883,-12.598053932189941,-24.03311538696289,-33.4146728515625,-15.565327644348145,-11.081777572631836,-10.47522258758545,-9.327695846557617,-28.43020248413086,-11.224303245544434]},{array:[53.888484954833984,-13.592279434204102,31.6711368560791,-9.440587043762209,-23.316177368164062,-35.3663444519043,-19.26239776611328,-13.472862243652344,-11.312352180480955,-7.2335309982299805,-25.466888427734375,-8.924440383911133]},{array:[54.30769348144531,-13.31528663635254,26.960655212402344,-11.682543754577637,-23.105655670166016,-32.50704956054688,-17.88333320617676,-10.961587905883787,-11.377249717712404,-7.610130786895752,-24.95154190063477,-9.38066577911377]},{array:[57.15829849243164,-13.77165985107422,31.29568099975586,-9.493865966796877,-23.708837509155277,-33.85169982910156,-19.99985122680664,-12.555244445800781,-14.447962760925291,-7.608822822570801,-23.899951934814457,-6.755941867828369]},{array:[47.781307220458984,-14.279045104980469,23.228328704833984,-14.190330505371094,-23.399112701416016,-34.95072555541992,-21.406070709228516,-10.15461254119873,-14.686234474182127,-9.932022094726564,-22.141719818115234,-8.354757308959961]}]},{name:`E`,mfccCalibrationDataList:[{array:[7.131360054016113,-36.049346923828125,45.31159210205078,-45.00178527832031,-15.53347110748291,1.3071203231811523,2.57974910736084,-1.8762083053588867,-25.02313995361328,-22.275257110595703,-16.383546829223633,-17.868574142456055]},{array:[7.131360054016113,-36.049346923828125,45.31159210205078,-45.00178527832031,-15.53347110748291,1.3071203231811523,2.57974910736084,-1.8762083053588867,-25.02313995361328,-22.275257110595703,-16.383546829223633,-17.868574142456055]},{array:[11.067873001098633,-36.16781234741211,45.893943786621094,-43.60368347167969,-15.017866134643556,-1.2796411514282229,2.090773582458496,-2.00726318359375,-22.139572143554688,-22.111957550048828,-16.975831985473633,-17.187711715698246]},{array:[9.000146865844727,-36.58183288574219,46.39983367919922,-45.5433349609375,-15.245804786682127,-2.223395347595215,4.547385215759277,-1.7552833557128908,-24.691539764404297,-22.836109161376953,-15.247169494628908,-15.090204238891602]},{array:[6.99749755859375,-37.912235260009766,46.3832893371582,-47.18668365478516,-13.492773056030273,-2.466267585754395,5.109303951263428,-1.4368247985839844,-25.965919494628906,-23.327587127685547,-14.712173461914064,-15.369802474975586]},{array:[8.53531551361084,-38.04619598388672,47.71860885620117,-47.188323974609375,-12.696022987365724,.9119815826416016,5.812184810638428,1.9683570861816408,-28.441104888916016,-21.203857421875,-16.284610748291016,-15.28965950012207]},{array:[8.53531551361084,-38.04619598388672,47.71860885620117,-47.188323974609375,-12.696022987365724,.9119815826416016,5.812184810638428,1.9683570861816408,-28.441104888916016,-21.203857421875,-16.284610748291016,-15.28965950012207]},{array:[10.728363037109377,-37.86867141723633,48.31739044189453,-47.47754669189453,-12.409613609313965,-.4410533905029297,5.663397789001465,3.449146270751953,-27.80557632446289,-20.967662811279297,-15.19067096710205,-14.877350807189941]},{array:[10.065123558044434,-36.66007232666016,44.76460266113281,-47.56492233276367,-12.32224941253662,-2.301477432250977,3.445328712463379,3.1899805068969727,-25.73431205749512,-21.715232849121097,-13.482653617858888,-17.041053771972656]},{array:[8.782588958740234,-36.92534255981445,44.4034309387207,-46.98899841308594,-8.84085464477539,-3.2711610794067383,2.835450172424317,3.1592531204223637,-24.939672470092777,-21.54747772216797,-15.242938041687012,-17.53165054321289]},{array:[6.508709907531738,-36.80110168457031,42.792266845703125,-46.29795837402344,-6.919498443603516,-3.788252830505371,2.5329980850219727,4.23353385925293,-24.539836883544925,-21.791210174560547,-16.75529670715332,-18.159324645996097]},{array:[6.508709907531738,-36.80110168457031,42.792266845703125,-46.29795837402344,-6.919498443603516,-3.788252830505371,2.5329980850219727,4.23353385925293,-24.539836883544925,-21.791210174560547,-16.75529670715332,-18.159324645996097]}]},{name:`O`,mfccCalibrationDataList:[{array:[53.443660736083984,-12.53360652923584,-26.871780395507816,-71.98885345458984,-5.861575126647949,-1.712080001831055,-32.90825653076172,23.514209747314457,-10.125606536865236,-11.977684020996094,9.883563041687012,-5.261895179748535]},{array:[55.69048309326172,-10.316678047180176,-26.289718627929688,-74.05561828613281,-4.348355293273926,-1.1102313995361328,-32.498268127441406,22.016807556152344,-11.227481842041016,-11.753466606140137,10.583023071289064,-3.583785057067871]},{array:[55.69048309326172,-10.316678047180176,-26.289718627929688,-74.05561828613281,-4.348355293273926,-1.1102313995361328,-32.498268127441406,22.016807556152344,-11.227481842041016,-11.753466606140137,10.583023071289064,-3.583785057067871]},{array:[56.3330307006836,-9.761429786682127,-24.52502822875977,-75.67504119873047,-2.94111442565918,-1.0509262084960938,-32.58983612060547,20.397789001464844,-13.52730941772461,-10.221673965454102,8.806441307067871,-6.1672868728637695]},{array:[58.4255599975586,-13.048576354980469,-26.326568603515625,-77.33265686035156,.8971290588378906,-.13758087158203125,-34.79779052734375,22.524978637695312,-15.138383865356445,-9.027335166931152,10.94324779510498,-6.867808818817139]},{array:[57.16611099243164,-17.380069732666016,-26.70465087890625,-76.53448486328125,3.203751564025879,1.6217775344848633,-36.67759323120117,24.14405059814453,-12.52278518676758,-8.60572338104248,13.969680786132812,-4.909186840057373]},{array:[55.17543029785156,-22.491680145263672,-25.568838119506836,-74.10460662841797,2.1666202545166016,4.1397705078125,-37.21670913696289,21.99705505371094,-11.680967330932617,-8.396781921386719,13.454421997070312,-3.452665328979492]},{array:[55.18680953979492,-23.176528930664062,-23.64011573791504,-69.64533233642578,1.9893865585327148,7.129931449890137,-35.871803283691406,19.41016006469727,-13.193324089050291,-8.643393516540527,10.173726081848145,-3.2846717834472656]},{array:[55.18680953979492,-23.176528930664062,-23.64011573791504,-69.64533233642578,1.9893865585327148,7.129931449890137,-35.871803283691406,19.41016006469727,-13.193324089050291,-8.643393516540527,10.173726081848145,-3.2846717834472656]},{array:[52.92599105834961,-22.9690055847168,-25.62136459350586,-65.79485321044922,.01132965087890625,5.457650184631348,-33.96955871582031,16.389381408691406,-14.026248931884766,-7.287093162536621,11.159339904785156,-3.7541093826293945]},{array:[51.816688537597656,-22.891870498657227,-29.80591201782227,-68.66901397705078,-1.94846248626709,1.63895320892334,-33.593971252441406,17.095460891723633,-13.046170234680176,-8.923750877380371,13.052698135375977,-5.068996429443359]},{array:[54.392459869384766,-23.71658706665039,-31.424976348876953,-75.520263671875,-4.738470077514648,-.12287521362304688,-36.41456604003906,18.125713348388672,-14.02833366394043,-11.63118839263916,12.234237670898438,-4.546117782592773]}]}]};function jp(e){let{audioContext:t}=pn(),{state:n,isReady:r}=cn(kp(t,Ap),void 0),i=[`A`,`E`,`I`,`O`,`U`,`S`],a=[`A`,`E`,`I`,`O`,`U`],s={A:`aa`,E:`ee`,I:`ih`,O:`oh`,U:`ou`},c={A:`A`,E:`E`,I:`I`,O:`O`,U:`U`,S:`I`},l={A:0,E:0,I:0,O:0,U:0},u=.7,d=0;m([r,e],([e,t],[,r])=>{if(r&&r!==t)try{r.disconnect()}catch{}if(!(!e||!t||!n.value))try{t.connect(n.value)}catch{}},{immediate:!0}),o(()=>e.value?.disconnect());function f(e,t=.016){let r=n.value;if(!e?.expressionManager||!r)return;let o=r.volume??0,f=Math.min(o*.9,1)**.7,p={A:0,E:0,I:0,O:0,U:0};for(let e of i){let t=c[e],n=r.weights[e]??0;p[t]=Math.max(p[t],n*f)}let m=`I`,h=`E`,g=-1/0,_=-1/0;for(let e of a){let t=p[e];t>g?(_=g,h=m,g=t,m=e):t>_&&(_=t,h=e)}let v=performance.now(),y=f<.04||g<.05;y||(d=v),v-d>160&&(y=!0);let b={A:0,E:0,I:0,O:0,U:0};y||(b[m]=Math.min(u,g),b[h]=Math.min(u*.5,_*.6));for(let n of a){let r=l[n],i=b[n],a=1-Math.exp(-(i>r?50:30)*t);l[n]=r+(i-r)*a;let o=(l[n]<=.01?0:l[n])*.7;e.expressionManager.setValue(s[n],o)}}return{update:f}}var Mp=e({__name:`VRMModel`,props:{currentAudioSource:{},modelSrc:{},lastModelSrc:{},idleAnimation:{},paused:{type:Boolean,default:!1},envSelect:{},skyBoxIntensity:{},nprIrrSH:{},modelOffset:{},modelRotationY:{},lookAtTarget:{},trackingMode:{},eyeHeight:{},cameraPosition:{},camera:{}},emits:[`loadingProgress`,`loadStart`,`cameraPosition`,`modelOrigin`,`modelSize`,`modelRotationY`,`eyeHeight`,`lookAtTarget`,`error`,`loaded`],setup(e,{expose:t,emit:i}){let a=e,s=i,{currentAudioSource:c,modelSrc:l,lastModelSrc:u,idleAnimation:d,paused:g,envSelect:_,skyBoxIntensity:v,nprIrrSH:y,modelOffset:b,modelRotationY:x,lookAtTarget:S,trackingMode:ee,eyeHeight:te,cameraPosition:ne,camera:re}=r(a),{scene:ie}=Et(),T=C(),E=C(),D=w(!1),{x:ae,y:oe}=an(),O=new fe,se=new L,k=C(),ce,le,ue=w(),{onBeforeRender:de,stop:j,start:pe}=pt(),me,he=xp(),ge=Sp(),_e=w(),ve=jp(c),ye=w(0),M=null;function N(){me?.(),E.value&&E.value.removeFromParent(),T.value&&Xu.deepDispose(T.value.scene),M?.dispose(),M=null}function be(e,t,n){se.x=e/window.innerWidth*2-1,se.y=-(t/window.innerHeight)*2+1,O.setFromCamera(se,n.value);let r=new F;n.value.getWorldDirection(r);let i=new A;i.setFromNormalAndCoplanarPoint(r,n.value.position.clone().add(r.multiplyScalar(1)));let a=new F;return O.ray.intersectPlane(i,a),{x:a.x,y:a.y,z:a.z}}function xe(e){return{x:0,y:e,z:-100}}async function Se(){try{if(!ie.value){console.warn(`Scene is not ready, cannot load VRM model.`);return}if(E.value&&N(),!l.value){console.warn(`NO model src, cannot load VRM model.`);return}let e=l.value!==u.value;try{s(`loadStart`),D.value=!1;let t=await Cp(l.value,{scene:ie.value,lookAt:!0,onProgress:e=>s(`loadingProgress`,Number((100*e.loaded/e.total).toFixed(2)))});if(!t||!t._vrm||!t?._vrmGroup){console.warn(`VRM model loading failure!`);return}let{_vrm:n,_vrmGroup:r,modelCenter:i,modelSize:a,initialCameraOffset:o}=t;T.value=n,E.value=r,e&&(s(`cameraPosition`,{x:i.x+o.x,y:i.y+o.y,z:i.z+o.z}),s(`modelOrigin`,{x:i.x,y:i.y,z:i.z}),s(`modelSize`,{x:a.x,y:a.y,z:a.z})),e&&s(`modelRotationY`,0);let c=await yp(n,await vp(d.value));if(!c){console.warn(`No VRM animation loaded`);return}bp(c,n),ue.value=new st(n.scene),ue.value.clipAction(c).play(),_e.value=wp(n);function u(e){return!!(e?.isShaderMaterial&&e.userData?.vrmMaterialType===`MToon`)}let f=e=>!!e?.isShaderMaterial;!M&&ie.value&&(M=ad(ie.value)),n.scene.traverse(e=>{e instanceof it&&e.material&&(Array.isArray(e.material)?e.material:[e.material]).forEach(e=>{if(e instanceof ft||e instanceof St)e.envMapIntensity=1,e.needsUpdate=!0;else if(u(e))`toneMapped`in e&&(e.toneMapped=!1);else if(f(e)){`toneMapped`in e&&(e.toneMapped=!1),`envMap`in e&&e.envMap&&(e.envMap=null);let t=e.map;if(t&&t.colorSpace!==void 0)try{t.colorSpace=P}catch(e){console.warn(`Failed to set colorSpace on texture:`,e)}rd(e)}})});function p(){let e=T.value?.humanoid?.getNormalizedBoneNode(`head`);if(!e)return null;let t=new F;return e.getWorldPosition(t),t.y}if(e){let e=p();e&&(s(`eyeHeight`,e),s(`lookAtTarget`,xe(e)))}me=de(({delta:e})=>{ue.value?.update(e),T.value?.update(e),T.value?.lookAt?.update?.(e),he.update(T.value,e),ge.update(T.value,S,e),_e.value?.update(e),ve.update(T.value,e),T.value?.springBoneManager?.update(e)}).off,s(`loaded`,l.value),D.value=!0}catch(e){console.error(e),s(`error`,e)}}catch(e){console.error(e),s(`error`,e)}}return f(async()=>{await tn(()=>ie.value).toBeTruthy(),await Se(),m(l,(e,t)=>{e!==t&&Se()}),m(g,e=>{e?j():pe()},{immediate:!0}),m(b,()=>{E.value&&E.value.position.set(b.value.x,b.value.y,b.value.z)},{immediate:!0,deep:!0}),m(x,e=>{E.value&&(E.value.rotation.y=I.degToRad(e))},{immediate:!0}),m([_,v,y],async()=>{if(!T.value)return;ye.value+=1;let e=td(_.value);id(T.value?.scene,{mode:e,intensity:v.value,sh:y.value??null}),M?.update(e,v.value,y.value??null)},{immediate:!0}),m(ee,e=>{le?.(),le=void 0,ce?.(),ce=void 0,e===`camera`?le=m(ne,e=>{s(`lookAtTarget`,e)},{immediate:!0,deep:!0}):e===`mouse`?ce=m([ae,oe],([e,t])=>{k.value=be(e,t,re),s(`lookAtTarget`,k.value)},{immediate:!0,deep:!0}):s(`lookAtTarget`,xe(te.value))},{immediate:!0}),m(S,e=>{ge.instantUpdate(T.value,e)},{deep:!0})}),o(()=>N()),t({setExpression(e){_e.value?.setEmotionWithResetAfter(e,1e3)},scene:h(()=>T.value?.scene),lookAtUpdate(e){ge.instantUpdate(T.value,e)}}),(e,t)=>D.value?p(e.$slots,`default`,{key:0}):n(``,!0)}}),Np=[`color`,`ground-color`,`intensity`],Pp=[`color`,`intensity`],Fp=[`color`,`position`,`intensity`],Ip={key:2,size:1},Lp=e({__name:`ThreeScene`,props:{currentAudioSource:{},modelSrc:{},skyBoxSrc:{},showAxes:{type:Boolean,default:!1},idleAnimation:{default:new URL(`/assets/idle_loop-Cs1QaHgK.vrma`,``+import.meta.url).href},paused:{type:Boolean,default:!1}},emits:[`loadModelProgress`,`error`],setup(e,{expose:t,emit:r}){let i=e,a=r,u=w(),{width:p,height:h}=sn(u),{lastModelSrc:b,modelSize:x,modelOrigin:S,modelOffset:ee,modelRotationY:T,cameraFOV:E,cameraPosition:D,cameraDistance:ae,directionalLightPosition:oe,directionalLightTarget:O,directionalLightRotation:se,directionalLightIntensity:k,directionalLightColor:ce,ambientLightIntensity:le,ambientLightColor:ue,hemisphereSkyColor:A,hemisphereGroundColor:de,hemisphereLightIntensity:fe,lookAtTarget:j,trackingMode:pe,eyeHeight:me,envSelect:he,skyBoxSrc:ge,skyBoxIntensity:_e}=Zt(No()),ve=w(),ye=C(new Ie),M=C(),N=C(),be=w(),P=w();function Se(e){(Math.abs(D.value.x-e.newCameraPosition.x)>1e-6||Math.abs(D.value.y-e.newCameraPosition.y)>1e-6||Math.abs(D.value.z-e.newCameraPosition.z)>1e-6)&&(D.value=e.newCameraPosition),Math.abs(ae.value-e.newCameraDistance)>1e-6&&(ae.value=e.newCameraDistance)}let Ce=w(!1);function we(){Ce.value=!0}let Te=w(!1),Ee=w(!1);function De(){Te.value=!1,Ee.value=!1}function Oe(e){D.value.x=e.x,D.value.y=e.y,D.value.z=e.z}function ke(e){S.value.x=e.x,S.value.y=e.y,S.value.z=e.z}function Ae(e){x.value.x=e.x,x.value.y=e.y,x.value.z=e.z}function je(e){T.value=e}function Me(e){me.value=e}function Ne(e){j.value.x=e.x,j.value.y=e.y,j.value.z=e.z}function Pe(e){b.value=e,Te.value=!0,Ee.value=!0}let Fe=w(null);function Le(e){Fe.value=e.irrSH||null}function Re(e){N.value=e}f(()=>{he.value===`skyBox`&&be.value?.reload(ge.value)}),o(()=>{});let ze={saturation:.3,hue:0,blendFunction:K.SRC},Be=w(!1),Ve=w(!1);function He(){Ve.value=!0}m([Ce,Ve],([e,t])=>{if(e&&t&&ye.value&&M.value&&M.value.controls&&P.value)try{P.value.parent?.add(P.value.target),P.value.target.position.set(O.value.x,O.value.y,O.value.z),P.value.target.updateMatrixWorld()}finally{Be.value=!0}});function Ue(e){let t=P.value;if(!t)return;let{x:n,y:r,z:i}=e,a=new F(oe.value.x,oe.value.y,oe.value.z),o=new F(0,0,0),s=new xe(I.degToRad(n),I.degToRad(r),I.degToRad(i),`XYZ`),c=o.clone().sub(a).normalize().applyEuler(s).normalize(),l=a.distanceTo(o),u=a.clone().addScaledVector(c,l);t.target.position.copy(u),t.target.updateMatrixWorld(),O.value={x:u.x,y:u.y,z:u.z}}return m(se,e=>{Ue(e)},{deep:!0}),t({setExpression:e=>{ve.value?.setExpression(e)},canvasElement:()=>N.value?.renderer.instance.domElement}),(e,t)=>(s(),re(`div`,{ref_key:`sceneContainerRef`,ref:u,w:`100%`,h:`100%`},[ne(_(v(Lt),{camera:ye.value,antialias:!0,width:v(p),height:v(h),"tone-mapping":v(4),"tone-mapping-exposure":1,"clear-alpha":0,onReady:Re},{default:y(()=>[_(v(es),{ref_key:`controlsRef`,ref:M,"control-enable":Ee.value,"model-loaded":Te.value,"model-size":v(x),"camera-position":v(D),"camera-target":v(S),"camera-f-o-v":v(E),"camera-distance":v(ae),onOrbitControlsCameraChanged:Se,onOrbitControlsReady:we},null,8,[`control-enable`,`model-loaded`,`model-size`,`camera-position`,`camera-target`,`camera-f-o-v`,`camera-distance`]),v(he)===`skyBox`?(s(),d(v(as),{key:0,ref_key:`skyBoxEnvRef`,ref:be,"sky-box-src":v(ge),"as-background":!0,onSkyBoxReady:Le},null,8,[`sky-box-src`])):(s(),re(`TresHemisphereLight`,{key:1,color:v(un)(v(A)),"ground-color":v(un)(v(de)),position:[0,1,0],intensity:v(fe),"cast-shadow":``},null,8,Np)),ie(`TresAmbientLight`,{color:v(un)(v(ue)),intensity:v(le),"cast-shadow":``},null,8,Pp),ie(`TresDirectionalLight`,{ref_key:`dirLightRef`,ref:P,color:v(un)(v(ce)),position:[v(oe).x,v(oe).y,v(oe).z],intensity:v(k),"cast-shadow":``,onReady:He},null,40,Fp),(s(),d(g,null,{default:y(()=>[_(v(wo),null,{default:y(()=>[_(v(jo),l(c(ze)),null,16)]),_:1})]),_:1})),_(v(Mp),{ref_key:`modelRef`,ref:ve,"current-audio-source":i.currentAudioSource,"model-src":i.modelSrc,"last-model-src":v(b),"idle-animation":i.idleAnimation,paused:i.paused,"env-select":v(he),"sky-box-intensity":v(_e),"npr-irr-s-h":Fe.value,"model-offset":v(ee),"model-rotation-y":v(T),"look-at-target":v(j),"tracking-mode":v(pe),"eye-height":v(me),"camera-position":v(D),camera:ye.value,onLoadingProgress:t[0]||=e=>a(`loadModelProgress`,e),onLoadStart:De,onCameraPosition:Oe,onModelOrigin:ke,onModelSize:Ae,onModelRotationY:je,onEyeHeight:Me,onLookAtTarget:Ne,onError:t[1]||=e=>a(`error`,e),onLoaded:Pe},null,8,[`current-audio-source`,`model-src`,`last-model-src`,`idle-animation`,`paused`,`env-select`,`sky-box-intensity`,`npr-irr-s-h`,`model-offset`,`model-rotation-y`,`look-at-target`,`tracking-mode`,`eye-height`,`camera-position`,`camera`]),i.showAxes?(s(),re(`TresAxesHelper`,Ip)):n(``,!0)]),_:1},8,[`camera`,`width`,`height`,`tone-mapping`]),[[te,!0]])],512))}});export{Fn as a,Pa as i,No as n,Fa as r,Lp as t}; \ No newline at end of file +`;function td(e){return e===`skyBox`?`skyBox`:e===`hemisphere`?`hemisphere`:`off`}function nd(e,t){if(!(!e?.uSHCoeffs||!e.uSHCoeffs.value||!Array.isArray(e.uSHCoeffs.value))&&t)for(let n=0;n<9;n++)e.uSHCoeffs.value[n]||=new F,e.uSHCoeffs.value[n].copy(t.coefficients[n])}function rd(e){let t=e.customProgramCacheKey?.()??``;e.customProgramCacheKey=()=>`${t}|airi-diffuse-ibl`;let n=e.onBeforeCompile;e.onBeforeCompile=(t,r)=>{n?.(t,r),t.vertexShader.includes(`AIRI_DIFFUSE_VS_DECL`)||(t.vertexShader=`${Zu}\n${t.vertexShader}`),t.vertexShader.includes(`#include `)&&!t.vertexShader.includes(`AIRI_DIFFUSE_VS_APPLY`)&&(t.vertexShader=t.vertexShader.replace(`#include `,`#include \n${Qu}`)),t.fragmentShader.includes(`AIRI_DIFFUSE_COMMON`)||(t.fragmentShader=t.fragmentShader.replace(`#include `,`#include \n${$u}`)),t.fragmentShader.includes(`AIRI_DIFFUSE_APPLY`)||(t.fragmentShader=t.fragmentShader.replace(`#include `,`${ed}\n#include `));let i=Array.from({length:9},()=>new F);t.uniforms.uNprEnvMode||={value:0},t.uniforms.uEnvIntensity||={value:0},t.uniforms.uSHCoeffs||={value:i},(e.userData||={}).__airiIbl=t.uniforms},`toneMapped`in e&&(e.toneMapped=!1),e.needsUpdate=!0}function id(e,t){let n=t.mode===`skyBox`?2:0;e.traverse(e=>{let r=e.material;(r?Array.isArray(r)?r:[r]:[]).forEach(e=>{let r=e?.userData?.__airiIbl;r&&(r.uNprEnvMode.value=n,r.uEnvIntensity.value=t.intensity,nd(r,t.sh??null))})})}function ad(e){let t=new Ge;t.name=`AIRI_IBL_Probe`,e.add(t);function n(e,n,r){t.intensity=e===`skyBox`?n:0,r&&t.sh.copy(r)}function r(){t.parent?.remove(t)}return{update:n,dispose:r}}var od=(e,t,n)=>new Promise((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())}),Q=(e,t,n)=>new Promise((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())}),sd=class extends A{constructor(e){super(),this.weight=0,this.isBinary=!1,this.overrideBlink=`none`,this.overrideLookAt=`none`,this.overrideMouth=`none`,this._binds=[],this.name=`VRMExpression_${e}`,this.expressionName=e,this.type=`VRMExpression`,this.visible=!1}get binds(){return this._binds}get overrideBlinkAmount(){return this.overrideBlink===`block`?0.5?1:0:this.weight}addBind(e){this._binds.push(e)}deleteBind(e){let t=this._binds.indexOf(e);t>=0&&this._binds.splice(t,1)}applyWeight(e){let t=this.outputWeight;t*=e?.multiplier??1,this.isBinary&&t<1&&(t=0),this._binds.forEach(e=>e.applyWeight(t))}clearAppliedWeight(){this._binds.forEach(e=>e.clearAppliedWeight())}};function cd(e,t,n){let r=e.parser.json,i=r.nodes?.[t];if(i==null)return console.warn(`extractPrimitivesInternal: Attempt to use nodes[${t}] of glTF but the node doesn't exist`),null;let a=i.mesh;if(a==null)return null;let o=r.meshes?.[a];if(o==null)return console.warn(`extractPrimitivesInternal: Attempt to use meshes[${a}] of glTF but the mesh doesn't exist`),null;let s=o.primitives.length,c=[];return n.traverse(e=>{c.length{t.has(n)&&(e[n]=r)}),e}get customExpressionMap(){let e={},t=new Set(Object.values(ud));return Object.entries(this._expressionMap).forEach(([n,r])=>{t.has(n)||(e[n]=r)}),e}copy(e){return this._expressions.concat().forEach(e=>{this.unregisterExpression(e)}),e._expressions.forEach(e=>{this.registerExpression(e)}),this.blinkExpressionNames=e.blinkExpressionNames.concat(),this.lookAtExpressionNames=e.lookAtExpressionNames.concat(),this.mouthExpressionNames=e.mouthExpressionNames.concat(),this}clone(){return new e().copy(this)}getExpression(e){return this._expressionMap[e]??null}registerExpression(e){this._expressions.push(e),this._expressionMap[e.expressionName]=e}unregisterExpression(e){let t=this._expressions.indexOf(e);t===-1&&console.warn(`VRMExpressionManager: The specified expressions is not registered`),this._expressions.splice(t,1),delete this._expressionMap[e.expressionName]}getValue(e){return this.getExpression(e)?.weight??null}setValue(e,t){let n=this.getExpression(e);n&&(n.weight=dd(t))}resetValues(){this._expressions.forEach(e=>{e.weight=0})}getExpressionTrackName(e){let t=this.getExpression(e);return t?`${t.name}.weight`:null}update(){let e=this._calculateWeightMultipliers();this._expressions.forEach(e=>{e.clearAppliedWeight()}),this._expressions.forEach(t=>{let n=1,r=t.expressionName;this.blinkExpressionNames.indexOf(r)!==-1&&(n*=e.blink),this.lookAtExpressionNames.indexOf(r)!==-1&&(n*=e.lookAt),this.mouthExpressionNames.indexOf(r)!==-1&&(n*=e.mouth),t.applyWeight({multiplier:n})})}_calculateWeightMultipliers(){let e=1,t=1,n=1;return this._expressions.forEach(r=>{e-=r.overrideBlinkAmount,t-=r.overrideLookAtAmount,n-=r.overrideMouthAmount}),e=Math.max(0,e),t=Math.max(0,t),n=Math.max(0,n),{blink:e,lookAt:t,mouth:n}}},pd={Color:`color`,EmissionColor:`emissionColor`,ShadeColor:`shadeColor`,MatcapColor:`matcapColor`,RimColor:`rimColor`,OutlineColor:`outlineColor`},md={_Color:pd.Color,_EmissionColor:pd.EmissionColor,_ShadeColor:pd.ShadeColor,_RimColor:pd.RimColor,_OutlineColor:pd.OutlineColor},hd=new H,gd=class e{constructor({material:e,type:t,targetValue:n,targetAlpha:r}){this.material=e,this.type=t,this.targetValue=n,this.targetAlpha=r??1,this._state={color:this._initColorBindState(),alpha:this._initAlphaBindState()}}applyWeight(e){let{color:t,alpha:n}=this._state;if(t!=null){let{propertyName:n,deltaValue:r}=t;this.material[n]?.add(hd.copy(r).multiplyScalar(e))}if(n!=null){let{propertyName:t,deltaValue:r}=n;this.material[t]!=null&&(this.material[t]+=r*e)}}clearAppliedWeight(){let{color:e,alpha:t}=this._state;if(e!=null){let{propertyName:t,initialValue:n}=e;this.material[t]?.copy(n)}if(t!=null){let{propertyName:e,initialValue:n}=t;this.material[e]!=null&&(this.material[e]=n)}}_initColorBindState(){let{material:e,type:t,targetValue:n}=this,r=this._getPropertyNameMap()?.[t]?.[0]??null;if(r==null)return console.warn(`Tried to add a material color bind to the material ${e.name??`(no name)`}, the type ${t} but the material or the type is not supported.`),null;let i=e[r].clone();return{propertyName:r,initialValue:i,deltaValue:new H(n.r-i.r,n.g-i.g,n.b-i.b)}}_initAlphaBindState(){let{material:e,type:t,targetAlpha:n}=this,r=this._getPropertyNameMap()?.[t]?.[1]??null;if(r==null&&n!==1)return console.warn(`Tried to add a material alpha bind to the material ${e.name??`(no name)`}, the type ${t} but the material or the type does not support alpha.`),null;if(r==null)return null;let i=e[r];return{propertyName:r,initialValue:i,deltaValue:n-i}}_getPropertyNameMap(){return Object.entries(e._propertyNameMapMap).find(([e])=>this.material[e]===!0)?.[1]??null}};gd._propertyNameMapMap={isMeshStandardMaterial:{color:[`color`,`opacity`],emissionColor:[`emissive`,null]},isMeshBasicMaterial:{color:[`color`,`opacity`]},isMToonMaterial:{color:[`color`,`opacity`],emissionColor:[`emissive`,null],outlineColor:[`outlineColorFactor`,null],matcapColor:[`matcapFactor`,null],rimColor:[`parametricRimColorFactor`,null],shadeColor:[`shadeColorFactor`,null]}};var _d=gd,vd=class{constructor({primitives:e,index:t,weight:n}){this.primitives=e,this.index=t,this.weight=n}applyWeight(e){this.primitives.forEach(t=>{t.morphTargetInfluences?.[this.index]!=null&&(t.morphTargetInfluences[this.index]+=this.weight*e)})}clearAppliedWeight(){this.primitives.forEach(e=>{e.morphTargetInfluences?.[this.index]!=null&&(e.morphTargetInfluences[this.index]=0)})}},yd=new L,bd=class e{constructor({material:t,scale:n,offset:r}){this.material=t,this.scale=n,this.offset=r;let i=Object.entries(e._propertyNamesMap).find(([e])=>t[e]===!0)?.[1];i==null?(console.warn(`Tried to add a texture transform bind to the material ${t.name??`(no name)`} but the material is not supported.`),this._properties=[]):(this._properties=[],i.forEach(e=>{let i=t[e]?.clone();if(!i)return null;t[e]=i;let a=i.offset.clone(),o=i.repeat.clone(),s=r.clone().sub(a),c=n.clone().sub(o);this._properties.push({name:e,initialOffset:a,deltaOffset:s,initialScale:o,deltaScale:c})}))}applyWeight(e){this._properties.forEach(t=>{let n=this.material[t.name];n!==void 0&&(n.offset.add(yd.copy(t.deltaOffset).multiplyScalar(e)),n.repeat.add(yd.copy(t.deltaScale).multiplyScalar(e)))})}clearAppliedWeight(){this._properties.forEach(e=>{let t=this.material[e.name];t!==void 0&&(t.offset.copy(e.initialOffset),t.repeat.copy(e.initialScale))})}};bd._propertyNamesMap={isMeshStandardMaterial:[`map`,`emissiveMap`,`bumpMap`,`normalMap`,`displacementMap`,`roughnessMap`,`metalnessMap`,`alphaMap`],isMeshBasicMaterial:[`map`,`specularMap`,`alphaMap`],isMToonMaterial:[`map`,`normalMap`,`emissiveMap`,`shadeMultiplyTexture`,`rimMultiplyTexture`,`outlineWidthMultiplyTexture`,`uvAnimationMaskTexture`]};var xd=bd,Sd=new Set([`1.0`,`1.0-beta`]),Cd=class e{get name(){return`VRMExpressionLoaderPlugin`}constructor(e){this.parser=e}afterRoot(e){return Q(this,null,function*(){e.userData.vrmExpressionManager=yield this._import(e)})}_import(e){return Q(this,null,function*(){return(yield this._v1Import(e))||(yield this._v0Import(e))||null})}_v1Import(e){return Q(this,null,function*(){let t=this.parser.json;if(t.extensionsUsed?.indexOf(`VRMC_vrm`)===-1)return null;let n=t.extensions?.VRMC_vrm;if(!n)return null;let r=n.specVersion;if(!Sd.has(r))return console.warn(`VRMExpressionLoaderPlugin: Unknown VRMC_vrm specVersion "${r}"`),null;let i=n.expressions;if(!i)return null;let a=new Set(Object.values(ud)),o=new Map;i.preset!=null&&Object.entries(i.preset).forEach(([e,t])=>{if(t!=null){if(!a.has(e)){console.warn(`VRMExpressionLoaderPlugin: Unknown preset name "${e}" detected. Ignoring the expression`);return}o.set(e,t)}}),i.custom!=null&&Object.entries(i.custom).forEach(([e,t])=>{if(a.has(e)){console.warn(`VRMExpressionLoaderPlugin: Custom expression cannot have preset name "${e}". Ignoring the expression`);return}o.set(e,t)});let s=new fd;return yield Promise.all(Array.from(o.entries()).map(t=>Q(this,[t],function*([t,n]){var r,i,a;let o=new sd(t);if(e.scene.add(o),o.isBinary=n.isBinary??!1,o.overrideBlink=n.overrideBlink??`none`,o.overrideLookAt=n.overrideLookAt??`none`,o.overrideMouth=n.overrideMouth??`none`,(r=n.morphTargetBinds)==null||r.forEach(t=>Q(this,null,function*(){if(t.node===void 0||t.index===void 0)return;let r=yield ld(e,t.node),i=t.index;if(!r.every(e=>Array.isArray(e.morphTargetInfluences)&&i{let n=e.material;n&&(Array.isArray(n)?t.push(...n):t.push(n))}),(i=n.materialColorBinds)==null||i.forEach(e=>Q(this,null,function*(){t.filter(t=>{let n=this.parser.associations.get(t)?.materials;return e.material===n}).forEach(t=>{o.addBind(new _d({material:t,type:e.type,targetValue:new H().fromArray(e.targetValue),targetAlpha:e.targetValue[3]}))})})),(a=n.textureTransformBinds)==null||a.forEach(e=>Q(this,null,function*(){t.filter(t=>{let n=this.parser.associations.get(t)?.materials;return e.material===n}).forEach(t=>{o.addBind(new xd({material:t,offset:new L().fromArray(e.offset??[0,0]),scale:new L().fromArray(e.scale??[1,1])}))})}))}s.registerExpression(o)}))),s})}_v0Import(t){return Q(this,null,function*(){let n=this.parser.json,r=n.extensions?.VRM;if(!r)return null;let i=r.blendShapeMaster;if(!i)return null;let a=new fd,o=i.blendShapeGroups;if(!o)return a;let s=new Set;return yield Promise.all(o.map(r=>Q(this,null,function*(){let i=r.presetName,o=(i!=null&&e.v0v1PresetNameMap[i]||null)??r.name;if(o==null){console.warn(`VRMExpressionLoaderPlugin: One of custom expressions has no name. Ignoring the expression`);return}if(s.has(o)){console.warn(`VRMExpressionLoaderPlugin: An expression preset ${i} has duplicated entries. Ignoring the expression`);return}s.add(o);let c=new sd(o);t.scene.add(c),c.isBinary=r.isBinary??!1,r.binds&&r.binds.forEach(e=>Q(this,null,function*(){var i;if(e.mesh===void 0||e.index===void 0)return;let a=[];(i=n.nodes)==null||i.forEach((t,n)=>{t.mesh===e.mesh&&a.push(n)});let o=e.index;yield Promise.all(a.map(n=>Q(this,null,function*(){let i=yield ld(t,n);if(!i.every(e=>Array.isArray(e.morphTargetInfluences)&&o{if(e.materialName===void 0||e.propertyName===void 0||e.targetValue===void 0)return;let n=[];t.scene.traverse(t=>{if(t.material){let r=t.material;Array.isArray(r)?n.push(...r.filter(t=>(t.name===e.materialName||t.name===e.materialName+` (Outline)`)&&n.indexOf(t)===-1)):r.name===e.materialName&&n.indexOf(r)===-1&&n.push(r)}});let r=e.propertyName;n.forEach(t=>{if(r===`_MainTex_ST`){let n=new L(e.targetValue[0],e.targetValue[1]),r=new L(e.targetValue[2],e.targetValue[3]);r.y=1-r.y-n.y,c.addBind(new xd({material:t,scale:n,offset:r}));return}let n=md[r];if(n){c.addBind(new _d({material:t,type:n,targetValue:new H().fromArray(e.targetValue),targetAlpha:e.targetValue[3]}));return}console.warn(r+` is not supported`)})}),a.registerExpression(c)}))),a})}};Cd.v0v1PresetNameMap={a:`aa`,e:`ee`,i:`ih`,o:`oh`,u:`ou`,blink:`blink`,joy:`happy`,angry:`angry`,sorrow:`sad`,fun:`relaxed`,lookup:`lookUp`,lookdown:`lookDown`,lookleft:`lookLeft`,lookright:`lookRight`,blink_l:`blinkLeft`,blink_r:`blinkRight`,neutral:`neutral`};var wd=class e{constructor(t,n){this._firstPersonOnlyLayer=e.DEFAULT_FIRSTPERSON_ONLY_LAYER,this._thirdPersonOnlyLayer=e.DEFAULT_THIRDPERSON_ONLY_LAYER,this._initializedLayers=!1,this.humanoid=t,this.meshAnnotations=n}copy(e){if(this.humanoid!==e.humanoid)throw Error(`VRMFirstPerson: humanoid must be same in order to copy`);return this.meshAnnotations=e.meshAnnotations.map(e=>({meshes:e.meshes.concat(),type:e.type})),this}clone(){return new e(this.humanoid,this.meshAnnotations).copy(this)}get firstPersonOnlyLayer(){return this._firstPersonOnlyLayer}get thirdPersonOnlyLayer(){return this._thirdPersonOnlyLayer}setup({firstPersonOnlyLayer:t=e.DEFAULT_FIRSTPERSON_ONLY_LAYER,thirdPersonOnlyLayer:n=e.DEFAULT_THIRDPERSON_ONLY_LAYER}={}){this._initializedLayers||=(this._firstPersonOnlyLayer=t,this._thirdPersonOnlyLayer=n,this.meshAnnotations.forEach(e=>{e.meshes.forEach(t=>{e.type===`firstPersonOnly`?(t.layers.set(this._firstPersonOnlyLayer),t.traverse(e=>e.layers.set(this._firstPersonOnlyLayer))):e.type===`thirdPersonOnly`?(t.layers.set(this._thirdPersonOnlyLayer),t.traverse(e=>e.layers.set(this._thirdPersonOnlyLayer))):e.type===`auto`&&this._createHeadlessModel(t)})}),!0)}_excludeTriangles(e,t,n,r){let i=0;if(t!=null&&t.length>0)for(let a=0;a0&&r.includes(u[0])||l[1]>0&&r.includes(u[1])||l[2]>0&&r.includes(u[2])||l[3]>0&&r.includes(u[3]))continue;let d=t[s],f=n[s];if(d[0]>0&&r.includes(f[0])||d[1]>0&&r.includes(f[1])||d[2]>0&&r.includes(f[2])||d[3]>0&&r.includes(f[3]))continue;let p=t[c],m=n[c];p[0]>0&&r.includes(m[0])||p[1]>0&&r.includes(m[1])||p[2]>0&&r.includes(m[2])||p[3]>0&&r.includes(m[3])||(e[i++]=o,e[i++]=s,e[i++]=c)}return i}_createErasedMesh(e,t){let n=new Be(e.geometry.clone(),e.material);n.name=`${e.name}(erase)`,n.frustumCulled=e.frustumCulled,n.layers.set(this._firstPersonOnlyLayer);let r=n.geometry,i=r.getAttribute(`skinIndex`),a=i instanceof xe?[]:i.array,o=[];for(let e=0;e{this._isEraseTarget(e)&&n.push(t)}),!n.length){t.layers.enable(this._thirdPersonOnlyLayer),t.layers.enable(this._firstPersonOnlyLayer);return}t.layers.set(this._thirdPersonOnlyLayer);let r=this._createErasedMesh(t,n);e.add(r)}_createHeadlessModel(e){if(e.type===`Group`)if(e.layers.set(this._thirdPersonOnlyLayer),this._isEraseTarget(e))e.traverse(e=>e.layers.set(this._thirdPersonOnlyLayer));else{let t=new P;t.name=`_headless_${e.name}`,t.layers.set(this._firstPersonOnlyLayer),e.parent.add(t),e.children.filter(e=>e.type===`SkinnedMesh`).forEach(e=>{let n=e;this._createHeadlessModelForSkinnedMesh(t,n)})}else if(e.type===`SkinnedMesh`){let t=e;this._createHeadlessModelForSkinnedMesh(e.parent,t)}else this._isEraseTarget(e)&&(e.layers.set(this._thirdPersonOnlyLayer),e.traverse(e=>e.layers.set(this._thirdPersonOnlyLayer)))}_isEraseTarget(e){return e===this.humanoid.getRawBoneNode(`head`)?!0:e.parent?this._isEraseTarget(e.parent):!1}};wd.DEFAULT_FIRSTPERSON_ONLY_LAYER=9,wd.DEFAULT_THIRDPERSON_ONLY_LAYER=10,new F,new F,new R;var Td={hips:null,spine:`hips`,chest:`spine`,upperChest:`chest`,neck:`upperChest`,head:`neck`,leftEye:`head`,rightEye:`head`,jaw:`head`,leftUpperLeg:`hips`,leftLowerLeg:`leftUpperLeg`,leftFoot:`leftLowerLeg`,leftToes:`leftFoot`,rightUpperLeg:`hips`,rightLowerLeg:`rightUpperLeg`,rightFoot:`rightLowerLeg`,rightToes:`rightFoot`,leftShoulder:`upperChest`,leftUpperArm:`leftShoulder`,leftLowerArm:`leftUpperArm`,leftHand:`leftLowerArm`,rightShoulder:`upperChest`,rightUpperArm:`rightShoulder`,rightLowerArm:`rightUpperArm`,rightHand:`rightLowerArm`,leftThumbMetacarpal:`leftHand`,leftThumbProximal:`leftThumbMetacarpal`,leftThumbDistal:`leftThumbProximal`,leftIndexProximal:`leftHand`,leftIndexIntermediate:`leftIndexProximal`,leftIndexDistal:`leftIndexIntermediate`,leftMiddleProximal:`leftHand`,leftMiddleIntermediate:`leftMiddleProximal`,leftMiddleDistal:`leftMiddleIntermediate`,leftRingProximal:`leftHand`,leftRingIntermediate:`leftRingProximal`,leftRingDistal:`leftRingIntermediate`,leftLittleProximal:`leftHand`,leftLittleIntermediate:`leftLittleProximal`,leftLittleDistal:`leftLittleIntermediate`,rightThumbMetacarpal:`rightHand`,rightThumbProximal:`rightThumbMetacarpal`,rightThumbDistal:`rightThumbProximal`,rightIndexProximal:`rightHand`,rightIndexIntermediate:`rightIndexProximal`,rightIndexDistal:`rightIndexIntermediate`,rightMiddleProximal:`rightHand`,rightMiddleIntermediate:`rightMiddleProximal`,rightMiddleDistal:`rightMiddleIntermediate`,rightRingProximal:`rightHand`,rightRingIntermediate:`rightRingProximal`,rightRingDistal:`rightRingIntermediate`,rightLittleProximal:`rightHand`,rightLittleIntermediate:`rightLittleProximal`,rightLittleDistal:`rightLittleIntermediate`};function Ed(e){return e.invert?e.invert():e.inverse(),e}new F,new R,new F,new R,new F,new R,new R,new F,new F;var Dd=Math.sqrt(2)/2;new R(0,0,-Dd,Dd),new F(0,1,0);var Od=new F,kd=new F;function Ad(e,t){return e.matrixWorld.decompose(Od,t,kd),t}function jd(e){return[Math.atan2(-e.z,e.x),Math.atan2(e.y,Math.sqrt(e.x*e.x+e.z*e.z))]}function Md(e){let t=Math.round(e/2/Math.PI);return e-2*Math.PI*t}var Nd=new F(0,0,1),Pd=new F,Fd=new F,Id=new F,Ld=new R,Rd=new R,zd=new R,Bd=new R,Vd=new Se,Hd=class e{constructor(e,t){this.offsetFromHeadBone=new F,this.autoUpdate=!0,this.faceFront=new F(0,0,1),this.humanoid=e,this.applier=t,this._yaw=0,this._pitch=0,this._needsUpdate=!0,this._restHeadWorldQuaternion=this.getLookAtWorldQuaternion(new R)}get yaw(){return this._yaw}set yaw(e){this._yaw=e,this._needsUpdate=!0}get pitch(){return this._pitch}set pitch(e){this._pitch=e,this._needsUpdate=!0}get euler(){return console.warn(`VRMLookAt: euler is deprecated. use getEuler() instead.`),this.getEuler(new Se)}getEuler(e){return e.set(I.DEG2RAD*this._pitch,I.DEG2RAD*this._yaw,0,`YXZ`)}copy(e){if(this.humanoid!==e.humanoid)throw Error(`VRMLookAt: humanoid must be same in order to copy`);return this.offsetFromHeadBone.copy(e.offsetFromHeadBone),this.applier=e.applier,this.autoUpdate=e.autoUpdate,this.target=e.target,this.faceFront.copy(e.faceFront),this}clone(){return new e(this.humanoid,this.applier).copy(this)}reset(){this._yaw=0,this._pitch=0,this._needsUpdate=!0}getLookAtWorldPosition(e){let t=this.humanoid.getRawBoneNode(`head`);return e.copy(this.offsetFromHeadBone).applyMatrix4(t.matrixWorld)}getLookAtWorldQuaternion(e){return Ad(this.humanoid.getRawBoneNode(`head`),e)}getFaceFrontQuaternion(e){if(this.faceFront.distanceToSquared(Nd)<.01)return e.copy(this._restHeadWorldQuaternion).invert();let[t,n]=jd(this.faceFront);return Vd.set(0,.5*Math.PI+t,n,`YZX`),e.setFromEuler(Vd).premultiply(Bd.copy(this._restHeadWorldQuaternion).invert())}getLookAtWorldDirection(e){return this.getLookAtWorldQuaternion(Rd),this.getFaceFrontQuaternion(zd),e.copy(Nd).applyQuaternion(Rd).applyQuaternion(zd).applyEuler(this.getEuler(Vd))}lookAt(e){let t=Ld.copy(this._restHeadWorldQuaternion).multiply(Ed(this.getLookAtWorldQuaternion(Rd))),n=this.getLookAtWorldPosition(Fd),r=Id.copy(e).sub(n).applyQuaternion(t).normalize(),[i,a]=jd(this.faceFront),[o,s]=jd(r),c=Md(o-i),l=Md(a-s);this._yaw=I.RAD2DEG*c,this._pitch=I.RAD2DEG*l,this._needsUpdate=!0}update(e){this.target!=null&&this.autoUpdate&&this.lookAt(this.target.getWorldPosition(Pd)),this._needsUpdate&&(this._needsUpdate=!1,this.applier.applyYawPitch(this._yaw,this._pitch))}};Hd.EULER_ORDER=`YXZ`;var Ud=Hd,Wd=new F(0,0,1),Gd=new R,Kd=new R,qd=new Se(0,0,0,`YXZ`),Jd=class{constructor(e,t,n,r,i){this.humanoid=e,this.rangeMapHorizontalInner=t,this.rangeMapHorizontalOuter=n,this.rangeMapVerticalDown=r,this.rangeMapVerticalUp=i,this.faceFront=new F(0,0,1),this._restQuatLeftEye=new R,this._restQuatRightEye=new R,this._restLeftEyeParentWorldQuat=new R,this._restRightEyeParentWorldQuat=new R;let a=this.humanoid.getRawBoneNode(`leftEye`),o=this.humanoid.getRawBoneNode(`rightEye`);a&&(this._restQuatLeftEye.copy(a.quaternion),Ad(a.parent,this._restLeftEyeParentWorldQuat)),o&&(this._restQuatRightEye.copy(o.quaternion),Ad(o.parent,this._restRightEyeParentWorldQuat))}applyYawPitch(e,t){let n=this.humanoid.getRawBoneNode(`leftEye`),r=this.humanoid.getRawBoneNode(`rightEye`),i=this.humanoid.getNormalizedBoneNode(`leftEye`),a=this.humanoid.getNormalizedBoneNode(`rightEye`);n&&(t<0?qd.x=-I.DEG2RAD*this.rangeMapVerticalDown.map(-t):qd.x=I.DEG2RAD*this.rangeMapVerticalUp.map(t),e<0?qd.y=-I.DEG2RAD*this.rangeMapHorizontalInner.map(-e):qd.y=I.DEG2RAD*this.rangeMapHorizontalOuter.map(e),Gd.setFromEuler(qd),this._getWorldFaceFrontQuat(Kd),i.quaternion.copy(Kd).multiply(Gd).multiply(Kd.invert()),Gd.copy(this._restLeftEyeParentWorldQuat),n.quaternion.copy(i.quaternion).multiply(Gd).premultiply(Gd.invert()).multiply(this._restQuatLeftEye)),r&&(t<0?qd.x=-I.DEG2RAD*this.rangeMapVerticalDown.map(-t):qd.x=I.DEG2RAD*this.rangeMapVerticalUp.map(t),e<0?qd.y=-I.DEG2RAD*this.rangeMapHorizontalOuter.map(-e):qd.y=I.DEG2RAD*this.rangeMapHorizontalInner.map(e),Gd.setFromEuler(qd),this._getWorldFaceFrontQuat(Kd),a.quaternion.copy(Kd).multiply(Gd).multiply(Kd.invert()),Gd.copy(this._restRightEyeParentWorldQuat),r.quaternion.copy(a.quaternion).multiply(Gd).premultiply(Gd.invert()).multiply(this._restQuatRightEye))}lookAt(e){console.warn(`VRMLookAtBoneApplier: lookAt() is deprecated. use apply() instead.`);let t=I.RAD2DEG*e.y,n=I.RAD2DEG*e.x;this.applyYawPitch(t,n)}_getWorldFaceFrontQuat(e){if(this.faceFront.distanceToSquared(Wd)<.01)return e.identity();let[t,n]=jd(this.faceFront);return qd.set(0,.5*Math.PI+t,n,`YZX`),e.setFromEuler(qd)}};Jd.type=`bone`;var Yd=class{constructor(e,t,n,r,i){this.expressions=e,this.rangeMapHorizontalInner=t,this.rangeMapHorizontalOuter=n,this.rangeMapVerticalDown=r,this.rangeMapVerticalUp=i}applyYawPitch(e,t){t<0?(this.expressions.setValue(`lookDown`,0),this.expressions.setValue(`lookUp`,this.rangeMapVerticalUp.map(-t))):(this.expressions.setValue(`lookUp`,0),this.expressions.setValue(`lookDown`,this.rangeMapVerticalDown.map(t))),e<0?(this.expressions.setValue(`lookLeft`,0),this.expressions.setValue(`lookRight`,this.rangeMapHorizontalOuter.map(-e))):(this.expressions.setValue(`lookRight`,0),this.expressions.setValue(`lookLeft`,this.rangeMapHorizontalOuter.map(e)))}lookAt(e){console.warn(`VRMLookAtBoneApplier: lookAt() is deprecated. use apply() instead.`);let t=I.RAD2DEG*e.y,n=I.RAD2DEG*e.x;this.applyYawPitch(t,n)}};Yd.type=`expression`;var Xd=180/Math.PI,Zd=new Se,Qd=class extends A{constructor(e){super(),this.vrmLookAt=e,this.type=`VRMLookAtQuaternionProxy`;let t=this.rotation._onChangeCallback;this.rotation._onChange(()=>{t(),this._applyToLookAt()});let n=this.quaternion._onChangeCallback;this.quaternion._onChange(()=>{n(),this._applyToLookAt()})}_applyToLookAt(){Zd.setFromQuaternion(this.quaternion,Ud.EULER_ORDER),this.vrmLookAt.yaw=Xd*Zd.y,this.vrmLookAt.pitch=Xd*Zd.x}};function $d(e,t,n){let r=new Map,i=new Map;for(let[r,a]of e.humanoidTracks.rotation.entries()){let e=t.getNormalizedBoneNode(r)?.name;if(e!=null){let t=new Ce(`${e}.quaternion`,a.times,a.values.map((e,t)=>n===`0`&&t%2==0?-e:e));i.set(r,t)}}for(let[i,a]of e.humanoidTracks.translation.entries()){let o=t.getNormalizedBoneNode(i)?.name;if(o!=null){let s=e.restHipsPosition.y,c=t.normalizedRestPose.hips.position[1]/s,l=a.clone();l.values=l.values.map((e,t)=>(n===`0`&&t%3!=1?-e:e)*c),l.name=`${o}.position`,r.set(i,l)}}return{translation:r,rotation:i}}function ef(e,t){let n=new Map,r=new Map;for(let[r,i]of e.expressionTracks.preset.entries()){let e=t.getExpressionTrackName(r);if(e!=null){let t=i.clone();t.name=e,n.set(r,t)}}for(let[n,i]of e.expressionTracks.custom.entries()){let e=t.getExpressionTrackName(n);if(e!=null){let t=i.clone();t.name=e,r.set(n,t)}}return{preset:n,custom:r}}function tf(e,t){if(e.lookAtTrack==null)return null;let n=e.lookAtTrack.clone();return n.name=t,n}function nf(e,t){let n=[],r=$d(e,t.humanoid,t.meta.metaVersion);if(n.push(...r.translation.values()),n.push(...r.rotation.values()),t.expressionManager!=null){let r=ef(e,t.expressionManager);n.push(...r.preset.values()),n.push(...r.custom.values())}if(t.lookAt!=null){let r=t.scene.children.find(e=>e instanceof Qd);r==null?(console.warn(`createVRMAnimationClip: VRMLookAtQuaternionProxy is not found. Creating a new one automatically. To suppress this warning, create a VRMLookAtQuaternionProxy manually`),r=new Qd(t.lookAt),r.name=`VRMLookAtQuaternionProxy`,t.scene.add(r)):r.name===``&&(console.warn(`createVRMAnimationClip: VRMLookAtQuaternionProxy is found but its name is not set. Setting the name automatically. To suppress this warning, set the name manually`),r.name=`VRMLookAtQuaternionProxy`);let i=tf(e,`${r.name}.quaternion`);i!=null&&n.push(i)}return new rt(`Clip`,e.duration,n)}var rf=class{constructor(){this.duration=0,this.restHipsPosition=new F,this.humanoidTracks={translation:new Map,rotation:new Map},this.expressionTracks={preset:new Map,custom:new Map},this.lookAtTrack=null}};function af(e,t){let n=e.length,r=[],i=[],a=0;for(let o=0;o{let r=t.animations[n],i=this._parseAnimation(e,r,a,o);return i.restHipsPosition=l,i});e.userData.vrmAnimations=u})}_createNodeMap(e){let t=new Map,n=new Map,r=e.humanoid?.humanBones;r&&Object.entries(r).forEach(([e,n])=>{let r=n?.node;r!=null&&t.set(r,e)});let i=e.expressions?.preset;i&&Object.entries(i).forEach(([e,t])=>{let r=t?.node;r!=null&&n.set(r,e)});let a=e.expressions?.custom;return a&&Object.entries(a).forEach(([e,t])=>{let{node:r}=t;n.set(r,e)}),{humanoidIndexToName:t,expressionsIndexToName:n,lookAtIndex:e.lookAt?.node??null}}_createBoneWorldMatrixMap(e,t){return od(this,null,function*(){e.scene.updateWorldMatrix(!1,!0);let n=yield e.parser.getDependencies(`node`),r=new Map;if(t.humanoid==null)return r;for(let[e,i]of Object.entries(t.humanoid.humanBones)){let t=i?.node;if(t!=null){let i=n[t];r.set(e,i.matrixWorld),e===`hips`&&r.set(`hipsParent`,i.parent?.matrixWorld??of)}}return r})}_parseAnimation(e,t,n,r){let i=e.tracks,a=t.channels,o=new rf;return o.duration=e.duration,a.forEach((e,t)=>{let{node:a,path:s}=e.target,c=i[t];if(a==null)return;let l=n.humanoidIndexToName.get(a);if(l!=null){let e=Td[l];for(;e!=null&&r.get(e)==null;)e=Td[e];if(e??=`hipsParent`,s===`translation`)if(l!==`hips`)console.warn(`The loading animation contains a translation track for ${l}, which is not permitted in the VRMC_vrm_animation spec. ignoring the track`);else{let e=r.get(`hipsParent`),t=af(c.values,3).flatMap(t=>sf.fromArray(t).applyMatrix4(e).toArray()),n=c.clone();n.values=new Float32Array(t),o.humanoidTracks.translation.set(l,n)}else if(s===`rotation`){let t=r.get(l),n=r.get(e);t.decompose(sf,cf,sf),cf.invert(),n.decompose(sf,lf,sf);let i=af(c.values,4).flatMap(e=>uf.fromArray(e).premultiply(lf).multiply(cf).toArray()),a=c.clone();a.values=new Float32Array(i),o.humanoidTracks.rotation.set(l,a)}else throw Error(`Invalid path "${s}"`);return}let u=n.expressionsIndexToName.get(a);if(u!=null){if(s===`translation`){let e=c.times,t=new Float32Array(c.values.length/3);for(let e=0;e=2.0 are supported.`));return}let c=new up(i,{path:t||this.resourcePath||``,crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let e=0;e=0&&o[t]===void 0&&console.warn(`THREE.GLTFLoader: Unknown extension "`+t+`".`)}}c.setExtensions(a),c.setPlugins(o),c.parse(n,r)}parseAsync(e,t){let n=this;return new Promise(function(r,i){n.parse(e,t,r,i)})}};function gf(){let e={};return{get:function(t){return e[t]},add:function(t,n){e[t]=n},remove:function(t){delete e[t]},removeAll:function(){e={}}}}var $={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`},_f=class{constructor(e){this.parser=e,this.name=$.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){let e=this.parser,t=this.parser.json.nodes||[];for(let n=0,r=t.length;n=0)throw Error(`THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures`);return null}return t.loadTextureImage(e,i.source,a)}},jf=class{constructor(e){this.parser=e,this.name=$.EXT_TEXTURE_WEBP}loadTexture(e){let t=this.name,n=this.parser,r=n.json,i=r.textures[e];if(!i.extensions||!i.extensions[t])return null;let a=i.extensions[t],o=r.images[a.source],s=n.textureLoader;if(o.uri){let e=n.options.manager.getHandler(o.uri);e!==null&&(s=e)}return n.loadTextureImage(e,a.source,s)}},Mf=class{constructor(e){this.parser=e,this.name=$.EXT_TEXTURE_AVIF}loadTexture(e){let t=this.name,n=this.parser,r=n.json,i=r.textures[e];if(!i.extensions||!i.extensions[t])return null;let a=i.extensions[t],o=r.images[a.source],s=n.textureLoader;if(o.uri){let e=n.options.manager.getHandler(o.uri);e!==null&&(s=e)}return n.loadTextureImage(e,a.source,s)}},Nf=class{constructor(e){this.name=$.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){let t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){let e=n.extensions[this.name],r=this.parser.getDependency(`buffer`,e.buffer),i=this.parser.options.meshoptDecoder;if(!i||!i.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw Error(`THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files`);return null}return r.then(function(t){let n=e.byteOffset||0,r=e.byteLength||0,a=e.count,o=e.byteStride,s=new Uint8Array(t,n,r);return i.decodeGltfBufferAsync?i.decodeGltfBufferAsync(a,o,s,e.mode,e.filter).then(function(e){return e.buffer}):i.ready.then(function(){let t=new ArrayBuffer(a*o);return i.decodeGltfBuffer(new Uint8Array(t),a,o,s,e.mode,e.filter),t})})}else return null}},Pf=class{constructor(e){this.name=$.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){let t=this.parser.json,n=t.nodes[e];if(!n.extensions||!n.extensions[this.name]||n.mesh===void 0)return null;let r=t.meshes[n.mesh];for(let e of r.primitives)if(e.mode!==Gf.TRIANGLES&&e.mode!==Gf.TRIANGLE_STRIP&&e.mode!==Gf.TRIANGLE_FAN&&e.mode!==void 0)return null;let i=n.extensions[this.name].attributes,a=[],o={};for(let e in i)a.push(this.parser.getDependency(`accessor`,i[e]).then(t=>(o[e]=t,o[e])));return a.length<1?null:(a.push(this.parser.createNodeMesh(e)),Promise.all(a).then(e=>{let t=e.pop(),n=t.isGroup?t.children:[t],r=e[0].count,i=[];for(let e of n){let t=new B,n=new F,a=new R,s=new F(1,1,1),c=new Le(e.geometry,e.material,r);for(let e=0;e0||e.search(/^data\:image\/jpeg/)===0?`image/jpeg`:e.search(/\.webp($|\?)/i)>0||e.search(/^data\:image\/webp/)===0?`image/webp`:e.search(/\.ktx2($|\?)/i)>0||e.search(/^data\:image\/ktx2/)===0?`image/ktx2`:`image/png`}var lp=new B,up=class{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new gf,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 n=!1,r=-1,i=!1,a=-1;if(typeof navigator<`u`){let e=navigator.userAgent;n=/^((?!chrome|android).)*safari/i.test(e)===!0;let t=e.match(/Version\/(\d+)/);r=n&&t?parseInt(t[1],10):-1,i=e.indexOf(`Firefox`)>-1,a=i?e.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>`u`||n&&r<17||i&&a<98?this.textureLoader=new Ke(this.options.manager):this.textureLoader=new ae(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new Oe(this.options.manager),this.fileLoader.setResponseType(`arraybuffer`),this.options.crossOrigin===`use-credentials`&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){let n=this,r=this.json,i=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(e){return e._markDefs&&e._markDefs()}),Promise.all(this._invokeAll(function(e){return e.beforeRoot&&e.beforeRoot()})).then(function(){return Promise.all([n.getDependencies(`scene`),n.getDependencies(`animation`),n.getDependencies(`camera`)])}).then(function(t){let a={scene:t[0][r.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:r.asset,parser:n,userData:{}};return tp(i,a,r),np(a,r),Promise.all(n._invokeAll(function(e){return e.afterRoot&&e.afterRoot(a)})).then(function(){for(let e of a.scenes)e.updateMatrixWorld();e(a)})}).catch(t)}_markDefs(){let e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[];for(let n=0,r=t.length;n{let n=this.associations.get(e);n!=null&&this.associations.set(t,n);for(let[n,r]of e.children.entries())i(r,t.children[n])};return i(n,r),r.name+=`_instance_`+ e.uses[t]++,r}_invokeOne(e){let t=Object.values(this.plugins);t.push(this);for(let n=0;n=2&&p.setY(t,u[e*a+1]),a>=3&&p.setZ(t,u[e*a+2]),a>=4&&p.setW(t,u[e*a+3]),a>=5)throw Error(`THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.`)}p.normalized=d}return p})}loadTexture(e){let t=this.json,n=this.options,r=t.textures[e].source,i=t.images[r],a=this.textureLoader;if(i.uri){let e=n.manager.getHandler(i.uri);e!==null&&(a=e)}return this.loadTextureImage(e,r,a)}loadTextureImage(e,t,n){let r=this,i=this.json,a=i.textures[e],o=i.images[t],s=(o.uri||o.bufferView)+`:`+a.sampler;if(this.textureCache[s])return this.textureCache[s];let c=this.loadImageSource(t,n).then(function(t){t.flipY=!1,t.name=a.name||o.name||``,t.name===``&&typeof o.uri==`string`&&o.uri.startsWith(`data:image/`)===!1&&(t.name=o.uri);let n=(i.samplers||{})[a.sampler]||{};return t.magFilter=qf[n.magFilter]||1006,t.minFilter=qf[n.minFilter]||1008,t.wrapS=Jf[n.wrapS]||1e3,t.wrapT=Jf[n.wrapT]||1e3,t.generateMipmaps=!t.isCompressedTexture&&t.minFilter!==1003&&t.minFilter!==1006,r.associations.set(t,{textures:e}),t}).catch(function(){return null});return this.textureCache[s]=c,c}loadImageSource(e,t){let n=this,r=this.json,i=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(e=>e.clone());let a=r.images[e],o=self.URL||self.webkitURL,s=a.uri||``,c=!1;if(a.bufferView!==void 0)s=n.getDependency(`bufferView`,a.bufferView).then(function(e){c=!0;let t=new Blob([e],{type:a.mimeType});return s=o.createObjectURL(t),s});else if(a.uri===void 0)throw Error(`THREE.GLTFLoader: Image `+e+` is missing URI and bufferView`);let l=Promise.resolve(s).then(function(e){return new Promise(function(n,r){let a=n;t.isImageBitmapLoader===!0&&(a=function(e){let t=new ye(e);t.needsUpdate=!0,n(t)}),t.load(Qe.resolveURL(e,i.path),a,void 0,r)})}).then(function(e){return c===!0&&o.revokeObjectURL(s),np(e,a),e.userData.mimeType=a.mimeType||cp(a.uri),e}).catch(function(e){throw console.error(`THREE.GLTFLoader: Couldn't load texture`,s),e});return this.sourceCache[e]=l,l}assignTexture(e,t,n,r){let i=this;return this.getDependency(`texture`,n.index).then(function(a){if(!a)return null;if(n.texCoord!==void 0&&n.texCoord>0&&(a=a.clone(),a.channel=n.texCoord),i.extensions[$.KHR_TEXTURE_TRANSFORM]){let e=n.extensions===void 0?void 0:n.extensions[$.KHR_TEXTURE_TRANSFORM];if(e){let t=i.associations.get(a);a=i.extensions[$.KHR_TEXTURE_TRANSFORM].extendTexture(a,e),i.associations.set(a,t)}}return r!==void 0&&(a.colorSpace=r),e[t]=a,a})}assignFinalMaterial(e){let t=e.geometry,n=e.material,r=t.attributes.tangent===void 0,i=t.attributes.color!==void 0,a=t.attributes.normal===void 0;if(e.isPoints){let e=`PointsMaterial:`+n.uuid,t=this.cache.get(e);t||(t=new _t,It.prototype.copy.call(t,n),t.color.copy(n.color),t.map=n.map,t.sizeAttenuation=!1,this.cache.add(e,t)),n=t}else if(e.isLine){let e=`LineBasicMaterial:`+n.uuid,t=this.cache.get(e);t||(t=new qe,It.prototype.copy.call(t,n),t.color.copy(n.color),t.map=n.map,this.cache.add(e,t)),n=t}if(r||i||a){let e=`ClonedMaterial:`+n.uuid+`:`;r&&(e+=`derivative-tangents:`),i&&(e+=`vertex-colors:`),a&&(e+=`flat-shading:`);let t=this.cache.get(e);t||(t=n.clone(),i&&(t.vertexColors=!0),a&&(t.flatShading=!0),r&&(t.normalScale&&(t.normalScale.y*=-1),t.clearcoatNormalScale&&(t.clearcoatNormalScale.y*=-1)),this.cache.add(e,t),this.associations.set(t,this.associations.get(n))),n=t}e.material=n}getMaterialType(){return ft}loadMaterial(e){let t=this,n=this.json,r=this.extensions,i=n.materials[e],a,o={},s=i.extensions||{},c=[];if(s[$.KHR_MATERIALS_UNLIT]){let e=r[$.KHR_MATERIALS_UNLIT];a=e.getMaterialType(),c.push(e.extendParams(o,i,t))}else{let n=i.pbrMetallicRoughness||{};if(o.color=new H(1,1,1),o.opacity=1,Array.isArray(n.baseColorFactor)){let e=n.baseColorFactor;o.color.setRGB(e[0],e[1],e[2],z),o.opacity=e[3]}n.baseColorTexture!==void 0&&c.push(t.assignTexture(o,`map`,n.baseColorTexture,N)),o.metalness=n.metallicFactor===void 0?1:n.metallicFactor,o.roughness=n.roughnessFactor===void 0?1:n.roughnessFactor,n.metallicRoughnessTexture!==void 0&&(c.push(t.assignTexture(o,`metalnessMap`,n.metallicRoughnessTexture)),c.push(t.assignTexture(o,`roughnessMap`,n.metallicRoughnessTexture))),a=this._invokeOne(function(t){return t.getMaterialType&&t.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,o)})))}i.doubleSided===!0&&(o.side=2);let l=i.alphaMode||$f.OPAQUE;if(l===$f.BLEND?(o.transparent=!0,o.depthWrite=!1):(o.transparent=!1,l===$f.MASK&&(o.alphaTest=i.alphaCutoff===void 0?.5:i.alphaCutoff)),i.normalTexture!==void 0&&a!==ct&&(c.push(t.assignTexture(o,`normalMap`,i.normalTexture)),o.normalScale=new L(1,1),i.normalTexture.scale!==void 0)){let e=i.normalTexture.scale;o.normalScale.set(e,e)}if(i.occlusionTexture!==void 0&&a!==ct&&(c.push(t.assignTexture(o,`aoMap`,i.occlusionTexture)),i.occlusionTexture.strength!==void 0&&(o.aoMapIntensity=i.occlusionTexture.strength)),i.emissiveFactor!==void 0&&a!==ct){let e=i.emissiveFactor;o.emissive=new H().setRGB(e[0],e[1],e[2],z)}return i.emissiveTexture!==void 0&&a!==ct&&c.push(t.assignTexture(o,`emissiveMap`,i.emissiveTexture,N)),Promise.all(c).then(function(){let n=new a(o);return i.name&&(n.name=i.name),np(n,i),t.associations.set(n,{materials:e}),i.extensions&&tp(r,n,i),n})}createUniqueName(e){let t=ie.sanitizeNodeName(e||``);return t in this.nodeNamesUsed?t+`_`+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){let t=this,n=this.extensions,r=this.primitiveCache;function i(e){return n[$.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then(function(n){return fp(n,e,t)})}let a=[];for(let n=0,o=e.length;n0&&ip(d,i),d.name=t.createUniqueName(i.name||`mesh_`+e),np(d,i),u.extensions&&tp(r,d,u),t.assignFinalMaterial(d),c.push(d)}for(let n=0,r=c.length;n1?new P:t.length===1?t[0]:new A,o!==t[0])for(let e=0,n=t.length;e1){let e=r.associations.get(o);r.associations.set(o,{...e})}return r.associations.get(o).nodes=e,o}),this.nodeCache[e]}loadScene(e){let t=this.extensions,n=this.json.scenes[e],r=this,i=new P;n.name&&(i.name=r.createUniqueName(n.name)),np(i,n),n.extensions&&tp(t,i,n);let a=n.nodes||[],o=[];for(let e=0,t=a.length;e{let t=new Map;for(let[e,n]of r.associations)(e instanceof It||e instanceof ye)&&t.set(e,n);return e.traverse(e=>{let n=r.associations.get(e);n!=null&&t.set(e,n)}),t})(i),i})}_createAnimationTracks(e,t,n,r,i){let a=[],o=e.name?e.name:e.uuid,s=[];Zf[i.path]===Zf.weights?e.traverse(function(e){e.morphTargetInfluences&&s.push(e.name?e.name:e.uuid)}):s.push(o);let c;switch(Zf[i.path]){case Zf.weights:c=Pe;break;case Zf.rotation:c=Ce;break;case Zf.translation:case Zf.scale:c=Dt;break;default:switch(n.itemSize){case 1:c=Pe;break;case 2:case 3:default:c=Dt;break}break}let l=r.interpolation===void 0?ve:Qf[r.interpolation],u=this._getArrayFromAccessor(n);for(let e=0,n=s.length;enew ku(e)),pp.register(e=>new pf(e)),pp)}var hp=400,gp=[[.075,800],[.11,0],[.125,0],[.14,0],[.125,0],[.05,0],[.04,0],[.03,0],[.02,0],[1,0]];for(let e=1;ee instanceof Dt&&e.name===`${n.name}.position`);if(!(i instanceof Dt)){console.warn(`No Hips.position track of type VectorKeyframeTrack found in animation.`);return}let a=new F(i.values[0],i.values[1],i.values[2]),o=new F().subVectors(a,r);e.tracks.forEach(e=>{if(e.name.endsWith(`.position`)&&e instanceof Dt)for(let t=0;t=r.value&&(e.value=!0,t.value=0),e.value)){t.value+=a/.2;let o=Math.sin(Math.PI*t.value);i.expressionManager.setValue(`blink`,o),t.value>=1&&(e.value=!1,n.value=0,i.expressionManager.setValue(`blink`,0),r.value=Math.random()*5+1)}}return{update:i}}function Sp(){let e=-1,t=new F,n=0;function r(e){t.set(e.value.x+wa(-.25,.25),e.value.y+wa(-.25,.25),e.value.z)}function i(i,a,o){!i?.expressionManager||!i.lookAt||(n>=e?(r(a),n=0,e=_p()/1e3):t||r(a),i.lookAt.target||(i.lookAt.target=new A),i.lookAt.target?.position.lerp(t,1),i.lookAt?.update(o),n+=o)}function a(e,n){t.set(n.x,n.y,n.z),!(!e?.expressionManager||!e.lookAt)&&(e.lookAt.target||(e.lookAt.target=new A),e.lookAt.target?.position.lerp(t,1),e.lookAt?.update(.016))}return{update:i,instantUpdate:a}}async function Cp(e,t){let n=(await mp().loadAsync(e,e=>t?.onProgress?.(e))).userData;if(!n.vrm)return;let r=n.vrm;if(Xu.removeUnnecessaryVertices(r.scene),Xu.combineSkeletons(r.scene),r.scene.traverse(e=>{e.frustumCulled=!1}),t?.lookAt&&r.lookAt){let e=new Qd(r.lookAt);e.name=`lookAtQuaternionProxy`,r.scene.add(e)}let i=new P;i.add(r.scene),t?.scene&&t.scene.add(i);let a=new F(0,0,-1),o=r.lookAt,s=new R;if(o){let e=o.faceFront;s.setFromUnitVectors(e.normalize(),a.normalize()),i.quaternion.premultiply(s),i.updateMatrixWorld(!0)}else console.warn(`No look-at target found in VRM model`);r.springBoneManager?.reset(),i.updateMatrixWorld(!0);function c(e){let t=new Ye,n=new Ye;return e.updateMatrixWorld(!0),e.traverse(e=>{if(!e.visible)return;let r=e;if(!r.isMesh||!r.geometry||r.name.startsWith(`VRMC_springBone_collider`))return;let i=r.geometry;i.boundingBox||i.computeBoundingBox(),n.copy(i.boundingBox),n.applyMatrix4(r.matrixWorld),t.union(n)}),t}let l=c(r.scene),u=new F,d=new F;l.getSize(u),l.getCenter(d),d.y+=u.y/5;let f=40/2*Math.PI/180;return{_vrm:r,_vrmGroup:i,modelCenter:d,modelSize:u,initialCameraOffset:new F(u.x/16,u.y/8,-(u.y/3)/Math.tan(f))}}function wp(e){let t=T(null),n=T(!1),r=T(0),i=T(new Map),a=T(new Map),o=T(),s=(e,t,n)=>e+(t-e)*n,c=e=>e<.5?4*e*e*e:1-(-2*e+2)**3/2,l=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}]]),u=()=>{o.value&&=(clearTimeout(o.value),void 0)},d=o=>{if(u(),!l.has(o)){console.warn(`Emotion ${o} not found`);return}let s=l.get(o);if(t.value=o,n.value=!0,r.value=0,e.expressionManager){let t=Object.keys(e.expressionManager.expressionMap);for(let n of t)e.expressionManager.setValue(n,0)}i.value.clear(),a.value.clear();for(let t of s.expression||[]){let n=e.expressionManager?.getValue(t.name)||0;i.value.set(t.name,n),a.value.set(t.name,t.value)}};return{currentEmotion:t,isTransitioning:n,setEmotion:d,setEmotionWithResetAfter:(e,t)=>{u(),d(e),o.value=setTimeout(()=>{d(`neutral`),o.value=void 0},t)},update:o=>{if(!n.value||!t.value)return;let u=l.get(t.value).blendDuration||.3;r.value+=o/u,r.value>=1&&(r.value=1,n.value=!1);for(let[t,n]of a.value){let a=s(i.value.get(t)||0,n,c(r.value));e.expressionManager?.setValue(t,a)}},addEmotionState:(e,t)=>{l.set(e,t)},removeEmotionState:e=>{l.delete(e)},dispose:()=>{u()}}}var Tp=`data:application/wasm;base64,AGFzbQEAAAABbRBgAAF/YAAAYAJ/fwBgBn9/f39/fwBgA39/fwBgAn9/AX1gA39/fQBgB39/f39/f38Bf2ABfwBgAX8Bf2AFf39/f38AYAR/f39/AGAFf39/f30AYAZ/f31/f38AYAZ/f319fX8AYAV/f399fwACDwEDZW52Bm1lbW9yeQIABAMdHAEBBwEACAAAAAkKBAsMBAINDg8FBgIGBQMDAwIGlgEXfwFB0L0OC38AQfi4BAt/AEGguQQLfwBBkDgLfwBBwDgLfwBBkAgLfwBBgAgLfwBBjAgLfwBB9LgEC38AQfA4C38AQfC4BAt/AEGguQoLfwBB0LkKC38AQYAIC38AQdC9Cgt/AEHQvQoLfwBB0L0OC38AQYAIC38AQdC9Dgt/AEGAgBALfwBBAAt/AEEBC38AQYCABAsHpAYyEV9fd2FzbV9jYWxsX2N0b3JzAAAMbG9hZF9wcm9maWxlAAIHcHJvZmlsZQMBDnByb2ZpbGVNZmNjUmF3AwIScHJlY29tcHV0ZV9wcm9maWxlAAMMcHJvZmlsZU1lYW5zAwMNcHJvZmlsZVN0ZERldgMEC3Byb2ZpbGVNZmNjAwUQZ2V0X3Byb2ZpbGVfcHRycwAEC3Byb2ZpbGVQdHJzAwYJc2V0X2lucHV0AAUQb3V0cHV0U2FtcGxlUmF0ZQMHEGlucHV0U2FtcGxlQ291bnQDCBBnZXRfaW5wdXRfYnVmZmVyAAYLaW5wdXRCdWZmZXIDCRVnZXRfaW5wdXRfYnVmZmVyX3NpemUABw5nZXRfdm9sdW1lX3B0cgAIBnZvbHVtZQMKB2V4ZWN1dGUACRBjb3B5X3JpbmdfYnVmZmVyAAoKcm1zX3ZvbHVtZQAXD2xvd19wYXNzX2ZpbHRlcgAREWRvd25fc2FtcGxlX2V4YWN0AAwLZG93bl9zYW1wbGUADQxwcmVfZW1waGFzaXMAFg5oYW1taW5nX3dpbmRvdwAPCW5vcm1hbGl6ZQAUA2ZmdAAOD21lbF9maWx0ZXJfYmFuawASC3Bvd2VyX3RvX2RiABUDZGN0AAsHbWZjY091dAMLBnNjb3JlcwMMEmNhbGNfbDFub3JtX3Njb3JlcwAZEmNhbGNfbDJub3JtX3Njb3JlcwAaHWNhbGNfY29zaW5lX3NpbWlsYXJpdHlfc2NvcmVzABgQbm9ybWFsaXplX3Njb3JlcwAbFGxvd19wYXNzX2ZpbHRlcl9pbXBsABANZ2V0X21heF92YWx1ZQATDF9fZHNvX2hhbmRsZQMNCl9fZGF0YV9lbmQDDgtfX3N0YWNrX2xvdwMPDF9fc3RhY2tfaGlnaAMQDV9fZ2xvYmFsX2Jhc2UDEQtfX2hlYXBfYmFzZQMSCl9faGVhcF9lbmQDEw1fX21lbW9yeV9iYXNlAxQMX190YWJsZV9iYXNlAxUVX193YXNtX2ZpcnN0X3BhZ2VfZW5kAxYSX193YXNtX2luaXRfbWVtb3J5AAEIAQEMAQEK7FccAgALDgBBkAhBAEHAtQr8CwALRQBBkLkEIAY2AgBBjLkEIAU2AgBBiLkEIAQ2AgBBhLkEIAM2AgBBgLkEIAI2AgBB/LgEIAE2AgBB+LgEIAA2AgBBoLkEC8QgAil/H30CQAJAQYi5BCgCACIEQQBKBEBBuDhCADcDAEGwOEIANwMAQag4QgA3AwBBoDhCADcDAEGYOEIANwMAQZA4QgA3AwBBwDhCADcDAEHIOEIANwMAQdA4QgA3AwBB2DhCADcDAEHgOEIANwMAQeg4QgA3AwAgBEEDcSECIARBAWsiBUEDTwRAIARB/P///wdxIQNBkAghAANAIABBADYCACAAQZABakEANgIAIABB4ABqQQA2AgAgAEEwakEANgIAIABBwAFqIQAgAyABQQRqIgFHDQALCyACBEAgAUEwbEGQCGohAANAIABBADYCACAAQTBqIQAgAkEBayICDQALCyAEQQNxIQJBACEBIAVBA08EQCAEQfz///8HcSEDQaQJIQADQCAAQQA2AgAgAEEwa0EANgIAIABB4ABrQQA2AgAgAEGQAWtBADYCACAAQcABaiEAIAMgAUEEaiIBRw0ACwsgAgRAIAFBMGxBlAhqIQADQCAAQQA2AgAgAEEwaiEAIAJBAWsiAg0ACwsgBEEDcSECQQAhASAFQQNPBEAgBEH8////B3EhA0GoCSEAA0AgAEEANgIAIABBMGtBADYCACAAQeAAa0EANgIAIABBkAFrQQA2AgAgAEHAAWohACADIAFBBGoiAUcNAAsLIAIEQCABQTBsQZgIaiEAA0AgAEEANgIAIABBMGohACACQQFrIgINAAsLIARBA3EhAkEAIQEgBUEDTwRAIARB/P///wdxIQNBrAkhAANAIABBADYCACAAQTBrQQA2AgAgAEHgAGtBADYCACAAQZABa0EANgIAIABBwAFqIQAgAyABQQRqIgFHDQALCyACBEAgAUEwbEGcCGohAANAIABBADYCACAAQTBqIQAgAkEBayICDQALCyAEQQNxIQJBACEBIAVBA08EQCAEQfz///8HcSEDQbAJIQADQCAAQQA2AgAgAEEwa0EANgIAIABB4ABrQQA2AgAgAEGQAWtBADYCACAAQcABaiEAIAMgAUEEaiIBRw0ACwsgAgRAIAFBMGxBoAhqIQADQCAAQQA2AgAgAEEwaiEAIAJBAWsiAg0ACwsgBEEDcSECQQAhASAFQQNPBEAgBEH8////B3EhA0G0CSEAA0AgAEEANgIAIABBMGtBADYCACAAQeAAa0EANgIAIABBkAFrQQA2AgAgAEHAAWohACADIAFBBGoiAUcNAAsLIAIEQCABQTBsQaQIaiEAA0AgAEEANgIAIABBMGohACACQQFrIgINAAsLIARBA3EhAkEAIQEgBUEDTwRAIARB/P///wdxIQNBuAkhAANAIABBADYCACAAQTBrQQA2AgAgAEHgAGtBADYCACAAQZABa0EANgIAIABBwAFqIQAgAyABQQRqIgFHDQALCyACBEAgAUEwbEGoCGohAANAIABBADYCACAAQTBqIQAgAkEBayICDQALCyAEQQNxIQJBACEBIAVBA08EQCAEQfz///8HcSEDQbwJIQADQCAAQQA2AgAgAEEwa0EANgIAIABB4ABrQQA2AgAgAEGQAWtBADYCACAAQcABaiEAIAMgAUEEaiIBRw0ACwsgAgRAIAFBMGxBrAhqIQADQCAAQQA2AgAgAEEwaiEAIAJBAWsiAg0ACwsgBEEDcSECQQAhASAFQQNPBEAgBEH8////B3EhA0HACSEAA0AgAEEANgIAIABBMGtBADYCACAAQeAAa0EANgIAIABBkAFrQQA2AgAgAEHAAWohACADIAFBBGoiAUcNAAsLIAIEQCABQTBsQbAIaiEAA0AgAEEANgIAIABBMGohACACQQFrIgINAAsLIARBA3EhAkEAIQEgBUEDTwRAIARB/P///wdxIQNBxAkhAANAIABBADYCACAAQTBrQQA2AgAgAEHgAGtBADYCACAAQZABa0EANgIAIABBwAFqIQAgAyABQQRqIgFHDQALCyACBEAgAUEwbEG0CGohAANAIABBADYCACAAQTBqIQAgAkEBayICDQALCyAEQQNxIQJBACEBIAVBA08EQCAEQfz///8HcSEDQcgJIQADQCAAQQA2AgAgAEEwa0EANgIAIABB4ABrQQA2AgAgAEGQAWtBADYCACAAQcABaiEAIAMgAUEEaiIBRw0ACwsgAgRAIAFBMGxBuAhqIQADQCAAQQA2AgAgAEEwaiEAIAJBAWsiAg0ACwsgBEEDcSECQQAhASAFQQNPBEAgBEH8////B3EhA0HMCSEAA0AgAEEANgIAIABBMGtBADYCACAAQeAAa0EANgIAIABBkAFrQQA2AgAgAEHAAWohACADIAFBBGoiAUcNAAsLIAIEQCABQTBsQbwIaiEAA0AgAEEANgIAIABBMGohACACQQFrIgINAAsLQYy5BCgCACIFQTBsIRJDAACAPyAFspUhK0G8OCoCACE8Qbg4KgIAIT1BtDgqAgAhPkGwOCoCACE/Qaw4KgIAIUBBqDgqAgAhQUGkOCoCACE4QaA4KgIAITlBnDgqAgAhOkGYOCoCACE7QZQ4KgIAISxBkDgqAgAhKUGguQQhAwNAAkAgBUEATARAIAZBDGwiAUELaiEHIAFBCmohCCABQQlqIQkgAUEIaiEKIAFBB2ohCyABQQZqIQwgAUEFaiENIAFBBGohDiABQQNyIQ8gAUECciEQIAFBAXIhEQwBCyAGQQxsIgFBAnQiE0GQCGogAUELaiIHQQJ0IhVBkAhqIRYgAUEKaiIIQQJ0IhdBkAhqIRggAUEJaiIJQQJ0IhlBkAhqIRogAUEIaiIKQQJ0IhtBkAhqIRwgAUEHaiILQQJ0Ih1BkAhqIR4gAUEGaiIMQQJ0Ih9BkAhqISAgAUEFaiINQQJ0IiFBkAhqISIgAUEEaiIOQQJ0IiNBkAhqISQgAUEDciIPQQJ0IiVBkAhqISYgAUECciIQQQJ0IgBBkAhqIScgAUEBciIRQQJ0IgJBkAhqIBMqApAIISogFSoCkAghLSAXKgKQCCEuIBkqApAIIS8gGyoCkAghMCAdKgKQCCExIB8qApAIITIgISoCkAghMyAjKgKQCCE0ICUqApAIITUgACoCkAghNiACKgKQCCE3IAMhACAFIQIDQCAqIAAqAgCSISogLSAAQSxqKgIAkiEtIC4gAEEoaioCAJIhLiAvIABBJGoqAgCSIS8gMCAAQSBqKgIAkiEwIDEgAEEcaioCAJIhMSAyIABBGGoqAgCSITIgMyAAQRRqKgIAkiEzIDQgAEEQaioCAJIhNCA1IABBDGoqAgCSITUgNiAAQQhqKgIAkiE2IDcgAEEEaioCAJIhNyAAQTBqIQAgAkEBayICDQALIDc4AgAgKjgCACAnIDY4AgAgJiA1OAIAICQgNDgCACAiIDM4AgAgICAyOAIAIB4gMTgCACAcIDA4AgAgGiAvOAIAIBggLjgCACAWIC04AgAgPCEtID0hLiA+IS8gPyEwIEAhMSBBITIgOCEzIDkhNCA6ITUgOyE2ICwhNyApISoLIBFBAnQiAiACKgKQCCArlCJDOAKQCCAQQQJ0IgIgAioCkAggK5QiRDgCkAggAUECdCICIAIqApAIICuUIkU4ApAIIA9BAnQiAiACKgKQCCArlCJGOAKQCCAOQQJ0IgIgAioCkAggK5QiRzgCkAggDUECdCICIAIqApAIICuUIkI4ApAIIAxBAnQiAiACKgKQCCArlCI4OAKQCCALQQJ0IgIgAioCkAggK5QiOTgCkAggCkECdCICIAIqApAIICuUIjo4ApAIIAlBAnQiAiACKgKQCCArlCI7OAKQCCAIQQJ0IgIgAioCkAggK5QiLDgCkAggB0ECdCICIAIqApAIICuUIik4ApAIIAMgEmohAyAtICmSIjwhLSAuICySIj0hLiAvIDuSIj4hLyAwIDqSIj8hMCAxIDmSIkAhMSAyIDiSIkEhMiAzIEKSIjghMyA0IEeSIjkhNCA1IEaSIjohNSA2IESSIjshNiA3IEOSIiwhNyAqIEWSIikhKiAEIAZBAWoiBkcNAAsMAQtBqDhCADcDAEGgOEIANwMAQZg4QgA3AwBBkDhCADcDAEHAOEIANwMAQcg4QgA3AwBB0DhCADcDAEHYOEIANwMAQeA4QgA3AwBB6DhCADcDAAwBC0G8OCA8OAIAQbg4ID04AgBBtDggPjgCAEGwOCA/OAIAQaw4IEA4AgBBqDggQTgCAEGkOCA4OAIAQaA4IDk4AgBBnDggOjgCAEGYOCA7OAIAQZQ4ICw4AgBBkDggKTgCAAtBkLkEKAIARQRAQbg4QgA3AwBBsDhCADcDAEGoOEIANwMAQaA4QgA3AwBBmDhCADcDAEGQOEIANwMAQeg4QoCAgPyDgIDAPzcDAEHgOEKAgID8g4CAwD83AwBB2DhCgICA/IOAgMA/NwMAQdA4QoCAgPyDgIDAPzcDAEHIOEKAgID8g4CAwD83AwBBwDhCgICA/IOAgMA/NwMADwtBvDggPCAEsiIqlSJCOAIAQbg4ID0gKpUiPDgCAEG0OCA+ICqVIj04AgBBsDggPyAqlSI+OAIAQaw4IEAgKpUiPzgCAEGoOCBBICqVIkA4AgBBpDggOCAqlSJBOAIAQaA4IDkgKpUiODgCAEGcOCA6ICqVIjk4AgBBmDggOyAqlSI6OAIAQZQ4ICwgKpUiOzgCAEGQOCApICqVOAIAQYy5BCgCACEDAkAgBEEATA0AQQAhBiADQQBMDQAgA0EwbCEFQcA4KgIAIS1BkDgqAgAhLEHsOCoCACEuQeg4KgIAIS9B5DgqAgAhMEHgOCoCACExQdw4KgIAITJB2DgqAgAhM0HUOCoCACE0QdA4KgIAITVBzDgqAgAhNkHIOCoCACE3QcQ4KgIAISpBoLkEIQEDQCADIQIgASEAA0AgACoCACAskyIpICmUIC2SIS0gAEEsaioCACBCkyIpICmUIC6SIS4gAEEoaioCACA8kyIpICmUIC+SIS8gAEEkaioCACA9kyIpICmUIDCSITAgAEEgaioCACA+kyIpICmUIDGSITEgAEEcaioCACA/kyIpICmUIDKSITIgAEEYaioCACBAkyIpICmUIDOSITMgAEEUaioCACBBkyIpICmUIDSSITQgAEEQaioCACA4kyIpICmUIDWSITUgAEEMaioCACA5kyIpICmUIDaSITYgAEEIaioCACA6kyIpICmUIDeSITcgAEEEaioCACA7kyIpICmUICqSISogAEEwaiEAIAJBAWsiAg0ACyABIAVqIQEgBkEBaiIGIARHDQALQew4IC44AgBB6DggLzgCAEHkOCAwOAIAQeA4IDE4AgBB3DggMjgCAEHYOCAzOAIAQdQ4IDQ4AgBB0DggNTgCAEHMOCA2OAIAQcg4IDc4AgBBxDggKjgCAEHAOCAtOAIAQYy5BCgCACEDC0MAAIA/IAMgBGyylSEsQVAhAANAIABB8DhqIgMgAyoCACAslCIpICkgKbxBgICABGtBAXVBgICAgAJqviIplSApkkMAAAA/lCIplSApkkMAAAA/lDgCACAAQQRqIgANAAsLBQBBgAgLOgBBjAggADYCAEH0uARB/LgEKAIAsiAAspRB+LgEKAIAspVDAAAAP5JDAABAS5JDAABAy5L8ADYCAAsFAEHwOAsGAEGAgAELBgBB8LgEC70GAgl/BX0jACIBIQggAUH0uAQoAgAiAUECdEEPakFwcSIDayICJABBgLkEKAIAIQVB+LgEKAIAIQQgAkHwOCAAIAFrQYCAAWpBgIABIAEQCkHwuAQgAiABEBc4AgAgBEECbSEGIAIgA2siACQAAkAgBEGMCCgCACIDTgRAIAIgASADsiAGskMAAPpDQQEQESACIAAgAUEBEAwMAQsgAyADIARtIgcgBGxGBEAgAiABIAOyIAayQwAA+kMgBxARIAIgACABIAdtIgEgBxAMDAELIAIgASADsiIKIAayQwAA+kNBARARIAIgASAAIAGyIAogBLKVIgqVu0QAAAAAAAA4Q6BEAAAAAAAAOMOg/AIiASAKEA0LIAAgAUPsUXg/EBYgACABEA8gACABQwAAgD8QFCAAIAFBAnRBD2pBcHFrIgIkACAAIAIgARAOIAIgBUECdEEPakFwcSIDayIAJAAgAiABIAAgBLIgBRASIAAgBRAVIAAgA2siASQAIAAgASAFEAsCQEGIuQQoAgAiAEEATA0AIABBAnQiAkUNAEGguQogAUEEaiAC/AoAAAsCQAJAAkACQEGEuQQoAgAOAgABAgtBoLkKQZAIQZA4QcA4QdC5CiAAEBkMAgtBoLkKQZAIQZA4QcA4QdC5CiAAEBoMAQtBoLkKQZAIQZA4QcA4QdC5CiAAEBgLQQAhAUHQuQpBiLkEKAIAEBtBiLkEKAIAIgBBAEwEQCAIJABBfw8LIABBA3EhBAJAIABBBEkEQEF/IQJDAACAvyEKDAELIABB/P///wdxIQNBfyECQwAAgL8hCkHQuQohAANAIABBDGoqAgAiCyAAQQhqKgIAIgwgAEEEaioCACINIAAqAgAiDiAKIAogDl0iBRsiCiAKIA1dIgYbIgogCiAMXSIHGyIKIAogC10iCRshCiABQQNqIAFBAmogAUEBaiABIAIgBRsgBhsgBxsgCRshAiAAQRBqIQAgAUEEaiIBIANHDQALCyAEBEAgAUECdEHQuQpqIQADQCAAKgIAIgsgCiAKIAtdIgMbIQogASACIAMbIQIgAEEEaiEAIAFBAWohASAEQQFrIgQNAAsLIAgkACACC0wBAX8gAyACIANwIgNrIgIgBCACIARIGyIFQQJ0IgIEQCAAIAEgA0ECdGogAvwKAAALIAQgBWtBAnQiAwRAIAAgAmogASAD/AoAAAsLtgECBH0DfyACBEBEGC1EVPshCUAgArijtkOD+SI+lCEFA0AgBSAHs5QhBkMAAAAAIQQgACEIQQAhCQNAQwAAAD8gBiAJs0MAAAA/kpRDAACAPpIiA0MAAEDLIAOTQwAAQEuSkiIDi5MgA5QiA4tDZWJlQpRDZ6dGQZIgA5QgCCoCAJQgBJIhBCAIQQRqIQggAiAJQQFqIglHDQALIAEgB0ECdGogBDgCACAHQQFqIgcgAkcNAAsLC+QBAQh/AkAgAkUNACACQQNxIQYgAkEETwRAIANBAnQhByADQQN0IQggA0EEdCEJIANBDGwhCiACQXxxIQsgASECIAAhBANAIAIgBCoCADgCACACQQRqIAQgB2oqAgA4AgAgAkEIaiAEIAhqKgIAOAIAIAJBDGogBCAKaioCADgCACACQRBqIQIgBCAJaiEEIAsgBUEEaiIFRw0ACwsgBkUNACADQQJ0IQcgASAFQQJ0aiECIAAgAyAFbEECdGohBANAIAIgBCoCADgCACAEIAdqIQQgAkEEaiECIAZBAWsiBg0ACwsLhQECAn8CfSADBEAgAUEBayEGQQAhAQNAIAIgACAEIAGzlCIHu0QAAAAAAADgv6BEAAAAAAAAOEOgRAAAAAAAADjDoPwCIgUgBiAFIAZIG0ECdGoqAgAgACAFQQJ0aioCACIIkyAHIAWyk5QgCJI4AgAgAkEEaiECIAMgAUEBaiIBRw0ACwsLoAgDEX8GfQJ8IwAgAkECdCIGQQ9qQXBxIgNrIgcgA2siCSELIAIEQAJAIAJnIgNBH0cEQCAGBEAgCUEAIAb8CwALQR8gA2siBkF8cSEIIAZBA3EhCiADQRxrQQNJIQwDQEEAIQVBACEDIAxFBEADQCAEIANBA2p2QQFxIAQgA0ECanZBAXRBAnEgBCADQQFqdkEBcSAEIAN2QQF0QQJxIAVBAnRyckECdHJyIQUgA0EEaiIDIAhHDQALCyAKBEAgCiEGA0AgBCADdkEBcSAFQQF0ciEFIANBAWohAyAGQQFrIgYNAAsLIAcgBEECdGogACAFQQJ0aioCADgCACAEQQFqIgQgAkcNAAsMAQsgACoCACEUIAJBAnQiAARAIAlBACAA/AsACyACQQdxIQQgAkEITwRAIAJBeHEhACAHIQMDQCADIBQ4AgAgA0EcaiAUOAIAIANBGGogFDgCACADQRRqIBQ4AgAgA0EQaiAUOAIAIANBDGogFDgCACADQQhqIBQ4AgAgA0EEaiAUOAIAIANBIGohAyAAIAVBCGoiBUcNAAsLIARFDQAgByAFQQJ0aiEDA0AgAyAUOAIAIANBBGohAyAEQQFrIgQNAAsLIAsgAkEBdiIFQQJ0QQ9qQXBxIgBrIgwgAGshDSACQQFHBEBEAAAAAAAA8D8gArijIRsgDCEDIA0hBANAIARDAAAAPyAaRBgtRFT7IRnAoiAborZDg/kiPpQiFEMAAEDLIBSTQwAAQEuSkiIVi5MgFZQiFYtDZWJlQpRDZ6dGQZIgFZQ4AgAgA0MAAAA/IBRDAACAPpIiFEMAAEDLIBSTQwAAQEuSkiIUi5MgFJQiFItDZWJlQpRDZ6dGQZIgFJQ4AgAgA0EEaiEDIARBBGohBCAaRAAAAAAAAPA/oCEaIAVBAWsiBQ0AC0EBIQgDQCAIIgBBAXQhCCAAQQBKBEAgAEEDdCEOIABBAnQhDyACIAhodkECdCERQQAhECAHIQogCSELA0AgCiEDIAshBEEAIQUgACEGA0AgBCAFIA1qKgIAIhQgAyAPaiISKgIAIhWUIAUgDGoqAgAiFiAEIA9qIhMqAgAiF5SSIhggBCoCACIZkjgCACADIBYgFZQgFCAXlJMiFCADKgIAIhWSOAIAIBMgGSAYkzgCACASIBUgFJM4AgAgA0EEaiEDIARBBGohBCAFIBFqIQUgBkEBayIGDQALIAogDmohCiALIA5qIQsgCCAQaiIQIAJJDQALCyACIAhLDQALCwNAIAEgCSoCACIUIBSUIAcqAgAiFCAUlJIiFCAUIBS8QYCAgARrQQF1QYCAgIACar4iFJUgFJJDAAAAP5QiFJUgFJJDAAAAP5Q4AgAgB0EEaiEHIAlBBGohCSABQQRqIQEgAkEBayICDQALCwuWAQICfQF/IAFBAEoEQEMAAIA/IAFBAWuzlSEDA0AgACAAKgIAQwAAAD8gBLMgA5S7RBgtRFT7IRlAorZDg/kiPpRDAACAPpIiAkMAAEDLIAKTQwAAQEuSkiICi5MgApQiAkMfheu+lCACi0NlYmVClENnp0ZBkpRDcT0KP5KUOAIAIABBBGohACABIARBAWoiBEcNAAsLC5sCAwN9Bn8BfCAEQQJOBEAgBEECbSELIANBBGohCiAFQQJ0IQwgAyAEQQJ0aiENIAK7RBgtRFT7IRlAoiEPIARBAWuzQwAAAD+UIQgDQCABIAUgCSAFb2sgBW8iBCAJaiIDSgRAIAJDAAAAPyAPIAmzIAiTu6K2IgdDg/kiPpQiBkMAAEDLIAaTQwAAQEuSkiIGi5MgBpQiBpQgBotDZWJlQpRDZ6dGQZKUIgYgBpIhBiAEQQJ0IQRDAACAPyAHlSEHA0AgACAEaiIOIAYgBCAKaioCACAEIA1qKgIAkpQgB5QgDioCAJI4AgAgBCAMaiEEIAMgBWoiAyABSA0ACwsgCkEIaiEKIABBBGohACAJQQFqIgkgC0cNAAsLC48DAwh/AX0BfCMAIAJDZmZGQJQgBJVDAABAS5JDAABAy5L8ACIIQQFxIgogCGoiByABakECdEEPakFwcWshBiAHQQJ0IgkEQCAGQQAgCfwLAAsgAUECdCILBEAgBiAJaiAAIAv8CgAACyAHQQJOBEAgB0ECbSELIAYgCEECdCAKQQJ0amohCiAGQQRqIQggBUECdCEMIAdBAWuzQwAAAD+UIQ4gAyAEkyAClSICu0QYLURU+yEZQKIhDyACIAKSIQJBACEHA0AgASAFIAcgBW9rIAVvIgYgB2oiCUoEQCACQwAAAD8gDyAHsyAOk7uitiIDQ4P5Ij6UIgRDAABAyyAEk0MAAEBLkpIiBIuTIASUIgSUIASLQ2ViZUKUQ2enRkGSlCEEIAZBAnQhBkMAAIA/IAOVIQMDQCAAIAZqIg0gBCAGIAhqKgIAIAYgCmoqAgCSlCADlCANKgIAkjgCACAGIAxqIQYgBSAJaiIJIAFIDQALCyAIQQhqIQggAEEEaiEAIAdBAWoiByALRw0ACwsLuAQCCX0FfyAEQQBKBEAgA0PnPjs6lEMAAIA/krwiD0EXdbJDq6oAw5IgD0H///8DcUGAgID8A3K+IgVDq6qqvpRDAAAAQJIgBZSSIARBAWqzlSEHIABBBGohEEMAAIA/IANDAAAAP5QgAUEBdrOVIgqVIQgDQCAOQQFqIQ9DAAAAACEDIAcgDrOUIgVDAAD+QpL8ACIAQRd0vkMAAC9ElCAFQf8AIABrspIiBUPQ9a0+lEMYBSk/kiAFlEMAAIA/kpQiBkMAAC/EkiILIAiUQwAAAD+SQwAAQEuSQwAAQMuS/AAiASAHIA5BAmqzlCIFQwAA/kKS/AAiAEEXdL5DAAAvRJQgBUH/ACAAa7KSIgVD0PWtPpRDGAUpP5IgBZRDAACAP5KUIgVDAAAvxJIiDCAIlEMAAAC/kkMAAEBLkkMAAEDLkvwAIhFIBEAgByAPs5QiA0MAAP5CkvwAIgBBF3S+QwAAL0SUIANB/wAgAGuykiIDQ9D1rT6UQxgFKT+SIAOUQwAAgD+SlCIDQwAAL8SSIAiUQwAAQEuSQwAAQMuS/AAhEiAQIAFBAnRqIQBDAACAPyAFIAaTlSEJQwAAgD8gBSADk5UhDUMAAIA/IAMgBpOVIQZDAAAAACEDA0AgACoCACAKIAFBAWoiAbKUIgUgC5MgBpQgDCAFkyANlCABIBJIG5QgCSAJkpQgA5IhAyAAQQRqIQAgASARRw0ACwsgAiAOQQJ0aiADOAIAIA8iDiAERw0ACwsLpQECAX0DfyABQQBMBEBDAAAAAA8LIAFBA3EhBAJAIAFBBEkEQAwBCyABQfz///8HcSEFIAAhAQNAIAFBDGoqAgCLIAFBCGoqAgCLIAFBBGoqAgCLIAIgASoCAIuXl5eXIQIgAUEQaiEBIAUgA0EEaiIDRw0ACwsgBARAIAAgA0ECdGohAQNAIAIgASoCAIuXIQIgAUEEaiEBIARBAWsiBA0ACwsgAgupAgIEfwJ9AkAgAUEATA0AIAFBA3EhBAJAIAFBBEkEQAwBCyABQfz///8HcSEGIAAhAwNAIANBDGoqAgCLIANBCGoqAgCLIANBBGoqAgCLIAcgAyoCAIuXl5eXIQcgA0EQaiEDIAYgBUEEaiIFRw0ACwsgBARAIAAgBUECdGohAwNAIAcgAyoCAIuXIQcgA0EEaiEDIARBAWsiBA0ACwsgB0OVv9YzXQ0AQQAhBCABQQFHBEBDAACAPyAHlSEIIAFB/v///wdxIQUgACEDA0AgAyACIAMqAgCUIAiUOAIAIANBBGoiBiACIAYqAgCUIAiUOAIAIANBCGohAyAFIARBAmoiBEcNAAsLIAFBAXFFDQAgACAEQQJ0aiIAIAIgACoCAJQgB5U4AgALC1wCAX8BfSABBEADQCAAIAAoAgAiAkEXdbJDq6oAw5IgAkH///8DcUGAgID8A3K+IgNDq6qqvpRDAAAAQJIgA5SSQ8KoQECUOAIAIABBBGohACABQQFrIgENAAsLC6EBAgJ/AX0CQCABQQBMDQAgASEDIAFBAXEEQCAAIAFBAnRqIgMgAyoCACADQQRrKgIAIAKUkzgCACABQQFrIQMLIAFBAUYNACADQQFqIQQgA0ECdCAAakEIayEBA0AgAUEEaiIAIAAqAgAiBSABKgIAIAKUkzgCACABQQhqIgAgACoCACAFIAKUkzgCACABQQhrIQEgBEECayIEQQFLDQALCwvmAQICfQR/AkAgAUUEQAwBCyABQQNxIQYCQCABQQRJBEAMAQsgAUF8cSEHIAAhBANAIARBDGoqAgAiAyADlCAEQQhqKgIAIgMgA5QgBEEEaioCACIDIAOUIAQqAgAiAyADlCACkpKSkiECIARBEGohBCAHIAVBBGoiBUcNAAsLIAZFDQAgACAFQQJ0aiEEA0AgBCoCACIDIAOUIAKSIQIgBEEEaiEEIAZBAWsiBg0ACwsgAiABs5UiAiACIAK8QYCAgARrQQF1QYCAgIACar4iApUgApJDAAAAP5QiApUgApJDAAAAP5QLrwICBn0DfyAFBEADQCAEIA1BAnRqIg5BADYCAEEAIQxDAAAAACEGQwAAAAAhCUMAAAAAIQcDQCABIAxqKgIAIAIgDGoqAgAiCJMgAyAMaioCACILlSIKIAAgDGoqAgAgCJMgC5UiCJQgCZIhCSAKIAqUIAeSIQcgCCAIlCAGkiEGIAxBBGoiDEEwRw0ACyAOIAkgByAHIAe8QYCAgARrQQF1QYCAgIACar4iB5UgB5JDAAAAP5QiB5UgB5JDAACAPpQgBiAGIAa8QYCAgARrQQF1QYCAgIACar4iBpUgBpJDAAAAP5QiBpUgBpKUlUMAAAAAlyIGIAaUIgYgBpQiBiAGIAaUIgYgBpQiBiAGlCIGlCAGIAaUlDgCACABQTBqIQEgDUEBaiINIAVHDQALCwuWBQICfQN/IAUEQANAIAQgCUECdGoiAkEANgIAIAIgACoCACABIAlBMGxqIggqAgCTIAMqAgCViyIGOAIAIAIgACoCBCAIKgIEkyADKgIElYsgBpIiBjgCACACIAAqAgggCCoCCJMgAyoCCJWLIAaSIgY4AgAgAiAAKgIMIAgqAgyTIAMqAgyViyAGkiIGOAIAIAIgACoCECAIKgIQkyADKgIQlYsgBpIiBjgCACACIAAqAhQgCCoCFJMgAyoCFJWLIAaSIgY4AgAgAiAAKgIYIAgqAhiTIAMqAhiViyAGkiIGOAIAIAIgACoCHCAIKgIckyADKgIclYsgBpIiBjgCACACIAAqAiAgCCoCIJMgAyoCIJWLIAaSIgY4AgAgAiAAKgIkIAgqAiSTIAMqAiSViyAGkiIGOAIAIAIgACoCKCAIKgIokyADKgIolYsgBpIiBjgCAAJAIAAqAiwgCCoCLJMgAyoCLJWLIAaSQ6uqqj2UIgZDAAAAAF9FBEAgBiAGj5ND6v9TQJQiB0H/ACAHQwAA/kKS/AAiCGuykiIHQ9D1rT6UQxgFKT+SIAeUQwAAgD+SIAhBF3S+lCEHIAb8ASIIBEBDAAAgQSEGA0AgByAGQwAAgD8gCEEBcRuUIQcgCEEBSyAGIAaUIQYgCEEBdiEIDQALC0MAAIA/IAeVIQcMAQsgBowiBiAGj5ND6v9TQJQiB0H/ACAHQwAA/kKS/AAiCGuykiIHQ9D1rT6UQxgFKT+SIAeUQwAAgD+SIAhBF3S+lCEHIAb8ASIIRQ0AQwAAIEEhBgNAIAcgBkMAAIA/IAhBAXEblCEHIAhBAUsgBiAGlCEGIAhBAXYhCA0ACwsgAiAHOAIAIAlBAWoiCSAFRw0ACwsL9gUCAn0DfyAFBEADQCAEIAlBAnRqIgJBADYCACACIAAqAgAgASAJQTBsaiIIKgIAkyADKgIAlSIGIAaUIgY4AgAgAiAGIAAqAgQgCCoCBJMgAyoCBJUiBiAGlJIiBjgCACACIAYgACoCCCAIKgIIkyADKgIIlSIGIAaUkiIGOAIAIAIgBiAAKgIMIAgqAgyTIAMqAgyVIgYgBpSSIgY4AgAgAiAGIAAqAhAgCCoCEJMgAyoCEJUiBiAGlJIiBjgCACACIAYgACoCFCAIKgIUkyADKgIUlSIGIAaUkiIGOAIAIAIgBiAAKgIYIAgqAhiTIAMqAhiVIgYgBpSSIgY4AgAgAiAGIAAqAhwgCCoCHJMgAyoCHJUiBiAGlJIiBjgCACACIAYgACoCICAIKgIgkyADKgIglSIGIAaUkiIGOAIAIAIgBiAAKgIkIAgqAiSTIAMqAiSVIgYgBpSSIgY4AgAgAiAGIAAqAiggCCoCKJMgAyoCKJUiBiAGlJIiBjgCAAJAIAYgACoCLCAIKgIskyADKgIslSIGIAaUkkOrqqo9lCIGIAYgBrxBgICABGtBAXVBgICAgAJqviIGlSAGkkMAAAA/lCIGlSAGkkMAAAA/lCIGQwAAAABfRQRAIAYgBo+TQ+r/U0CUIgdB/wAgB0MAAP5CkvwAIghrspIiB0PQ9a0+lEMYBSk/kiAHlEMAAIA/kiAIQRd0vpQhByAG/AEiCARAQwAAIEEhBgNAIAcgBkMAAIA/IAhBAXEblCEHIAhBAUsgBiAGlCEGIAhBAXYhCA0ACwtDAACAPyAHlSEHDAELIAaMIgYgBo+TQ+r/U0CUIgdB/wAgB0MAAP5CkvwAIghrspIiB0PQ9a0+lEMYBSk/kiAHlEMAAIA/kiAIQRd0vpQhByAG/AEiCEUNAEMAACBBIQYDQCAHIAZDAACAPyAIQQFxG5QhByAIQQFLIAYgBpQhBiAIQQF2IQgNAAsLIAIgBzgCACAJQQFqIgkgBUcNAAsLC6gCAgR/An0CQCABRQ0AIAFBA3EhAwJAIAFBBEkEQAwBCyABQXxxIQUgACECA0AgAkEMaioCACACQQhqKgIAIAJBBGoqAgAgAioCACAGkpKSkiEGIAJBEGohAiAFIARBBGoiBEcNAAsLIAMEQCAAIARBAnRqIQIDQCACKgIAIAaSIQYgAkEEaiECIANBAWsiAw0ACwsgBkMAAAAAX0UEQEEAIQMgAUEBRwRAQwAAgD8gBpUhByABQX5xIQQgACECA0AgAiACKgIAIAeUOAIAIAJBBGoiBSAFKgIAIAeUOAIAIAJBCGohAiAEIANBAmoiA0cNAAsLIAFBAXFFDQEgACADQQJ0aiIAIAAqAgAgBpU4AgAMAQsgAUECdCIBRQ0AIABBACAB/AsACwsLFwEAQYAICxAQBAAAEBwAAEAcAACAuwAAACYJcHJvZHVjZXJzAQxwcm9jZXNzZWQtYnkBBWNsYW5nBjIxLjEuMQB8D3RhcmdldF9mZWF0dXJlcwcrD211dGFibGUtZ2xvYmFscysTbm9udHJhcHBpbmctZnB0b2ludCsLYnVsay1tZW1vcnkrCHNpZ24tZXh0Kw9yZWZlcmVuY2UtdHlwZXMrCm11bHRpdmFsdWUrD2J1bGstbWVtb3J5LW9wdA==`;function Ep(e,t,n,r,i){let a=2/r,o=a*i,s=1/(1+o+.48*o*o+.235*o*o*o),c=e-t,l=(n+a*c)*i;return n=(n-a*l)*s,[t+(c+l)*s,n]}var Dp={wasmModule:void 0},Op=class extends AudioWorkletNode{openCloseVelocity=0;lastTimestamp=0;weightVelocities={};minVolume=-2.5;maxVolume=-1.5;smoothness=.05;volume=0;weights={};constructor(e,t,n=Dp.wasmModule){super(e,`wlipsync-processor`,{processorOptions:{wasmModule:n,profile:t}});for(let e of t.mfccs)this.weights[e.name]=0,this.weightVelocities[e.name]=0;this.port.onmessage=this.onMessage.bind(this)}onMessage(e){let t=e.data.timestamp-this.lastTimestamp;this.lastTimestamp=e.data.timestamp;let n=Number.isNaN(e.data.volume)?0:e.data.volume,r=Math.log10(n);for(let n in r=(r-this.minVolume)/(this.maxVolume-this.minVolume),r=Math.max(Math.min(r,1),0),[this.volume,this.openCloseVelocity]=Ep(this.volume,r,this.openCloseVelocity,this.smoothness,t),this.weights){let r=n===e.data.name?1:0,i=this.weightVelocities[n];[this.weights[n],i]=Ep(this.weights[n],r,i,this.smoothness,t),this.weightVelocities[n]=i}}get blockSize(){return this.parameters.get(`blockSize`).value}set blockSize(e){this.parameters.get(`blockSize`).setValueAtTime(e,this.context.currentTime)}};new TextDecoder,Dp.wasmModule=await WebAssembly.compileStreaming(fetch(Tp));async function kp(e,t){try{return new Op(e,t)}catch{return await e.audioWorklet.addModule(new URL(`data:text/javascript;base64,dmFyIEI9bmV3IFdlYkFzc2VtYmx5Lk1lbW9yeSh7aW5pdGlhbDo0fSksWD17ZW52OnttZW1vcnk6Qn19O2NsYXNzIFUgZXh0ZW5kcyBBdWRpb1dvcmtsZXRQcm9jZXNzb3J7aW5wdXRCdWZmZXJJbmRleD0tMTtpbnB1dEJ1ZmZlclB0cj0tMTtpbnB1dEJ1ZmZlclNpemU9LTE7aW5wdXRCdWZmZXI9bnVsbDtsYXN0SW5kZXg9MDt2b2x1bWVQdHI9LTE7dm9sdW1lVmlldz1udWxsO21mY2NzPVtdO2V4cG9ydHM9bnVsbDtjb25zdHJ1Y3RvcihKKXtzdXBlcigpO2NvbnN0e3dhc21Nb2R1bGU6Uyxwcm9maWxlOmt9PUoucHJvY2Vzc29yT3B0aW9ucztXZWJBc3NlbWJseS5pbnN0YW50aWF0ZShTLFgpLnRoZW4oKEcpPT57Y29uc3Qgej10aGlzLmV4cG9ydHM9Ry5leHBvcnRzLEU9ay5tZmNjcy5sZW5ndGgsVz16LmxvYWRfcHJvZmlsZShrLnRhcmdldFNhbXBsZVJhdGUsay5zYW1wbGVDb3VudCxrLm1lbEZpbHRlckJhbmtDaGFubmVscyxrLmNvbXBhcmVNZXRob2QsRSxrLm1mY2NEYXRhQ291bnQsay51c2VTdGFuZGFyZGl6YXRpb24/MTowKSxUPXRoaXMubWZjY3M9ay5tZmNjcztpZighay5tZWFucyl7Y29uc3QgSz1uZXcgRGF0YVZpZXcoQi5idWZmZXIsVyxFKmsubWZjY0RhdGFDb3VudCoxMio0KTtsZXQgRj0wO2ZvcihsZXQgTiBvZiBUKWZvcihsZXQgUSBvZiBOLm1mY2NDYWxpYnJhdGlvbkRhdGFMaXN0KWZvcihsZXQgUiBvZiBRLmFycmF5KUsuc2V0RmxvYXQzMihGLFIsITApLEYrPTQ7ei5wcmVjb21wdXRlX3Byb2ZpbGUoKX1lbHNle2NvbnN0IEs9ei5nZXRfcHJvZmlsZV9wdHJzKCksRj1uZXcgRGF0YVZpZXcoQi5idWZmZXIsSywxMiksTj1uZXcgRGF0YVZpZXcoQi5idWZmZXIsRi5nZXRJbnQzMigwLCEwKSxFKjEyKjQpO2ZvcihsZXQgQT0wO0E8RTtBKyspZm9yKGxldCBIPTA7SDwxMjtIKyspTi5zZXRGbG9hdDMyKChBKjEyK0gpKjQsVFtBXS52YWx1ZXNbSF0sITApO2NvbnN0IFE9bmV3IERhdGFWaWV3KEIuYnVmZmVyLEYuZ2V0SW50MzIoNCwhMCksNDgpLFI9bmV3IERhdGFWaWV3KEIuYnVmZmVyLEYuZ2V0SW50MzIoOCwhMCksNDgpO2ZvcihsZXQgQT0wO0E8MTI7QSsrKVEuc2V0RmxvYXQzMihBKjQsay5tZWFuc1tBXSwhMCksUi5zZXRGbG9hdDMyKEEqNCxrLnN0ZERldnNbQV0sITApfXouc2V0X2lucHV0KHNhbXBsZVJhdGUpLHRoaXMuaW5wdXRCdWZmZXJQdHI9ei5nZXRfaW5wdXRfYnVmZmVyKCksdGhpcy5pbnB1dEJ1ZmZlclNpemU9ei5nZXRfaW5wdXRfYnVmZmVyX3NpemUoKSx0aGlzLmlucHV0QnVmZmVyPW5ldyBGbG9hdDMyQXJyYXkoQi5idWZmZXIsdGhpcy5pbnB1dEJ1ZmZlclB0cix0aGlzLmlucHV0QnVmZmVyU2l6ZSksdGhpcy5pbnB1dEJ1ZmZlckluZGV4PTAsdGhpcy5sYXN0SW5kZXg9MCx0aGlzLnZvbHVtZVB0cj16LmdldF92b2x1bWVfcHRyKCksdGhpcy52b2x1bWVWaWV3PW5ldyBEYXRhVmlldyhCLmJ1ZmZlcix0aGlzLnZvbHVtZVB0ciw0KX0pfXN0YXRpYyBnZXQgcGFyYW1ldGVyRGVzY3JpcHRvcnMoKXtyZXR1cm5be25hbWU6ImJsb2NrU2l6ZSIsZGVmYXVsdFZhbHVlOjUxMixtaW5WYWx1ZToxMjgsYXV0b21hdGlvblJhdGU6ImstcmF0ZSJ9XX1wcm9jZXNzKEosUyxrKXtjb25zdCBHPUpbMF1bMF07aWYoIUcpcmV0dXJuITA7aWYodGhpcy5pbnB1dEJ1ZmZlckluZGV4PT09LTEpcmV0dXJuITA7Zm9yKGxldCB6PTA7ejxHLmxlbmd0aDt6KyspdGhpcy5pbnB1dEJ1ZmZlclt0aGlzLmlucHV0QnVmZmVySW5kZXhdPUdbel0sdGhpcy5pbnB1dEJ1ZmZlckluZGV4PSh0aGlzLmlucHV0QnVmZmVySW5kZXgrMSkldGhpcy5pbnB1dEJ1ZmZlclNpemU7aWYoKHRoaXMuaW5wdXRCdWZmZXJJbmRleCt0aGlzLmlucHV0QnVmZmVyU2l6ZS10aGlzLmxhc3RJbmRleCkldGhpcy5pbnB1dEJ1ZmZlclNpemU9PT1rLmJsb2NrU2l6ZVswXSl7Y29uc3Qgej10aGlzLmV4cG9ydHMuZXhlY3V0ZSh0aGlzLmlucHV0QnVmZmVySW5kZXgpLEU9dGhpcy52b2x1bWVWaWV3LmdldEZsb2F0MzIoMCwhMCk7dGhpcy5wb3J0LnBvc3RNZXNzYWdlKHt0aW1lc3RhbXA6Y3VycmVudFRpbWUsaW5kZXg6eixuYW1lOnRoaXMubWZjY3Nbel0ubmFtZSx2b2x1bWU6RX0pLHRoaXMubGFzdEluZGV4PXRoaXMuaW5wdXRCdWZmZXJJbmRleH1yZXR1cm4hMH19cmVnaXN0ZXJQcm9jZXNzb3IoIndsaXBzeW5jLXByb2Nlc3NvciIsVSk7Cg==`,import.meta.url)),new Op(e,t)}}var Ap={jsonPath:`/home/steamvr/projects/wLipSync/www/profile.json`,mfccNum:12,mfccDataCount:12,melFilterBankChannels:30,targetSampleRate:16e3,sampleCount:1024,useStandardization:!1,compareMethod:2,mfccs:[{name:`A`,mfccCalibrationDataList:[{array:[94.40318298339844,.32245922088623047,-65.5116195678711,-29.537851333618164,4.888294219970703,14.523965835571287,-32.6411247253418,1.6505765914916992,-9.960077285766602,-5.7025322914123535,-11.886154174804688,-24.35236358642578]},{array:[94.40318298339844,.32245922088623047,-65.5116195678711,-29.537851333618164,4.888294219970703,14.523965835571287,-32.6411247253418,1.6505765914916992,-9.960077285766602,-5.7025322914123535,-11.886154174804688,-24.35236358642578]},{array:[102.16287231445312,-3.3587560653686523,-65.58428192138672,-25.24440574645996,3.224522590637207,12.005892753601076,-29.293079376220703,.6378564834594727,-10.817683219909668,-1.3263540267944336,-14.543159484863281,-24.169780731201172]},{array:[99.35592651367188,-3.681424140930176,-65.20439910888672,-23.45950698852539,6.205645561218262,14.96288013458252,-29.882709503173828,.6733551025390625,-7.077619552612305,-3.5570802688598637,-14.42734718322754,-23.34000396728516]},{array:[99.35592651367188,-3.681424140930176,-65.20439910888672,-23.45950698852539,6.205645561218262,14.96288013458252,-29.882709503173828,.6733551025390625,-7.077619552612305,-3.5570802688598637,-14.42734718322754,-23.34000396728516]},{array:[104.24951171875,-2.832884788513184,-66.59016418457031,-22.962886810302734,5.519782066345215,16.50394058227539,-32.338768005371094,5.820473670959473,-10.59586238861084,-2.7398462295532227,-12.5281400680542,-24.459365844726562]},{array:[104.24951171875,-2.832884788513184,-66.59016418457031,-22.962886810302734,5.519782066345215,16.50394058227539,-32.338768005371094,5.820473670959473,-10.59586238861084,-2.7398462295532227,-12.5281400680542,-24.459365844726562]},{array:[95.58644104003906,-5.775191307067871,-61.220008850097656,-24.658382415771488,4.411270141601563,13.673284530639648,-25.223039627075195,-2.0546646118164062,-6.887641906738281,-5.683987617492676,-11.20918083190918,-23.215322494506836]},{array:[98.24864196777344,-3.8367862701416016,-62.34006118774414,-24.563793182373047,4.608433723449707,16.228965759277344,-28.992279052734375,2.1237001419067383,-9.07174015045166,-4.581008434295654,-10.662440299987791,-26.19581413269043]},{array:[102.7921142578125,-4.580304145812988,-62.53183746337891,-26.292770385742188,7.911410331726074,17.13638496398926,-31.118263244628906,5.196089744567871,-10.01039695739746,-.8527965545654297,-12.346561431884766,-23.580944061279297]},{array:[102.12345123291016,-1.5254135131835938,-62.21220397949219,-26.728734970092777,10.62057876586914,16.918357849121097,-28.815664291381836,3.6714258193969727,-9.67378616333008,-.7385025024414062,-9.717185020446777,-27.09702491760254]},{array:[102.12345123291016,-1.5254135131835938,-62.21220397949219,-26.728734970092777,10.62057876586914,16.918357849121097,-28.815664291381836,3.6714258193969727,-9.67378616333008,-.7385025024414062,-9.717185020446777,-27.09702491760254]}]},{name:`I`,mfccCalibrationDataList:[{array:[14.441835403442385,52.40011596679688,57.37783813476563,-33.70046615600586,-12.751934051513672,-15.709930419921877,-41.381065368652344,-12.190519332885744,-2.863154411315918,-8.727733612060547,2.6656012535095215,1.4855976104736328]},{array:[14.441835403442385,52.40011596679688,57.37783813476563,-33.70046615600586,-12.751934051513672,-15.709930419921877,-41.381065368652344,-12.190519332885744,-2.863154411315918,-8.727733612060547,2.6656012535095215,1.4855976104736328]},{array:[15.294279098510744,50.07628631591797,57.262847900390625,-31.748844146728516,-13.642471313476564,-13.48408031463623,-41.53501129150391,-16.863862991333008,-1.739903450012207,-9.32723331451416,8.31618881225586,-1.779850959777832]},{array:[15.685098648071287,49.68647766113281,58.447113037109375,-32.513519287109375,-16.664287567138672,-13.78364372253418,-40.48309326171875,-16.04582405090332,-3.5356569290161137,-8.654275894165039,10.645575523376465,-2.556441307067871]},{array:[15.685098648071287,49.68647766113281,58.447113037109375,-32.513519287109375,-16.664287567138672,-13.78364372253418,-40.48309326171875,-16.04582405090332,-3.5356569290161137,-8.654275894165039,10.645575523376465,-2.556441307067871]},{array:[15.685098648071287,49.68647766113281,58.447113037109375,-32.513519287109375,-16.664287567138672,-13.78364372253418,-40.48309326171875,-16.04582405090332,-3.5356569290161137,-8.654275894165039,10.645575523376465,-2.556441307067871]},{array:[15.225826263427736,43.872196197509766,52.844512939453125,-32.51786804199219,-17.806241989135746,-10.609650611877441,-40.13084411621094,-11.58648681640625,-5.082568168640137,-14.396997451782228,6.896979331970215,-.785430908203125]},{array:[15.571629524230955,48.63488388061524,59.5339469909668,-34.59955596923828,-21.95987129211426,-10.298498153686523,-39.11286926269531,-11.998537063598633,-8.433327674865723,-10.80599594116211,8.789299011230469,-1.884697437286377]},{array:[15.571629524230955,48.63488388061524,59.5339469909668,-34.59955596923828,-21.95987129211426,-10.298498153686523,-39.11286926269531,-11.998537063598633,-8.433327674865723,-10.80599594116211,8.789299011230469,-1.884697437286377]},{array:[15.571629524230955,48.63488388061524,59.5339469909668,-34.59955596923828,-21.95987129211426,-10.298498153686523,-39.11286926269531,-11.998537063598633,-8.433327674865723,-10.80599594116211,8.789299011230469,-1.884697437286377]},{array:[19.23290252685547,47.43399810791016,54.90937423706055,-33.7783203125,-13.836353302001953,-5.141571044921875,-39.34584045410156,-13.409493446350098,-4.945652008056641,-12.96050262451172,12.210061073303224,.5807018280029297]},{array:[19.124774932861328,46.46723937988281,53.41281509399414,-34.65093994140625,-18.181049346923828,-7.733134746551514,-45.67931365966797,-10.64135456085205,-2.624391555786133,-15.708955764770508,7.36491870880127,-5.627689361572266]}]},{name:`U`,mfccCalibrationDataList:[{array:[83.38372802734375,42.39790725708008,27.812450408935547,10.69615077972412,-13.612553596496582,-32.487091064453125,-35.2574348449707,-6.425739288330078,-4.214997291564941,-6.896385669708252,-3.49631404876709,4.997060775756836]},{array:[103.65653228759766,38.661563873291016,30.985050201416016,17.43245124816895,-14.383820533752441,-39.810001373291016,-39.63761901855469,1.2333955764770508,-4.217883110046387,-3.005303382873535,-6.272947311401367,4.751875877380371]},{array:[103.44242095947266,45.23821640014649,27.622669219970703,18.682138442993164,-16.854982376098633,-39.85029602050781,-34.15940856933594,-2.7482595443725586,-3.741057395935059,-1.0625238418579102,-4.215768814086914,6.514510154724121]},{array:[103.44242095947266,45.23821640014649,27.622669219970703,18.682138442993164,-16.854982376098633,-39.85029602050781,-34.15940856933594,-2.7482595443725586,-3.741057395935059,-1.0625238418579102,-4.215768814086914,6.514510154724121]},{array:[99.99739837646484,39.48998260498047,26.0573844909668,23.26814079284668,-16.25522804260254,-38.15496063232422,-35.70051574707031,-1.2821111679077148,-2.3941946029663086,-.15543842315673828,-4.757769584655762,2.198577880859375]},{array:[99.99739837646484,39.48998260498047,26.0573844909668,23.26814079284668,-16.25522804260254,-38.15496063232422,-35.70051574707031,-1.2821111679077148,-2.3941946029663086,-.15543842315673828,-4.757769584655762,2.198577880859375]},{array:[107.09538269042967,37.70401000976563,17.795482635498047,21.882326126098633,-14.739266395568848,-36.407527923583984,-37.95854949951172,-1.4393510818481445,-1.9593324661254885,-.7294750213623047,-7.93386173248291,3.9560585021972656]},{array:[103.5069351196289,35.08988952636719,23.21630859375,23.947580337524418,-14.157055854797363,-38.546836853027344,-39.75208282470703,.516876220703125,-2.715259552001953,-4.076820850372315,-4.716378211975098,4.662134170532227]},{array:[103.5069351196289,35.08988952636719,23.21630859375,23.947580337524418,-14.157055854797363,-38.546836853027344,-39.75208282470703,.516876220703125,-2.715259552001953,-4.076820850372315,-4.716378211975098,4.662134170532227]},{array:[103.5069351196289,35.08988952636719,23.21630859375,23.947580337524418,-14.157055854797363,-38.546836853027344,-39.75208282470703,.516876220703125,-2.715259552001953,-4.076820850372315,-4.716378211975098,4.662134170532227]},{array:[98.43344116210938,35.42580032348633,29.2958984375,24.73729133605957,-15.485936164855955,-44.67648315429688,-39.97885894775391,.5548343658447266,-2.2034664154052734,-3.485844612121582,-7.421210289001465,6.30616569519043]},{array:[94.0390625,36.81925582885742,24.73573875427246,22.579418182373047,-14.354126930236816,-37.92849349975586,-44.69046401977539,.7474861145019531,-3.3195743560791016,-3.9850082397460938,-5.991059303283691,6.134122848510742]}]},{name:`E`,mfccCalibrationDataList:[{array:[60.52040481567383,14.444153785705568,50.91899108886719,6.730878829956055,-58.12107467651367,-16.403745651245117,-25.244909286499023,5.399906158447266,-7.63681697845459,-2.496482849121094,7.271292209625244,1.732271194458008]},{array:[59.32724761962891,14.82846450805664,51.402244567871094,5.413976669311523,-55.60324096679688,-15.348665237426758,-25.923606872558597,3.0006580352783203,-4.183259963989258,-3.4587841033935547,7.941498756408691,3.449912071228028]},{array:[59.32724761962891,14.82846450805664,51.402244567871094,5.413976669311523,-55.60324096679688,-15.348665237426758,-25.923606872558597,3.0006580352783203,-4.183259963989258,-3.4587841033935547,7.941498756408691,3.449912071228028]},{array:[64.61061096191406,7.8438310623168945,54.75372695922852,11.154451370239258,-62.99680709838867,-10.397377967834473,-36.124359130859375,12.57413387298584,-6.086113452911377,-3.032306671142578,10.453157424926758,-.00012826919555664065]},{array:[59.8906135559082,13.646936416625977,53.14240646362305,11.346290588378908,-60.17724609375,-15.942718505859377,-29.547088623046875,8.241331100463867,-6.890452384948731,-3.6554131507873535,14.714229583740236,-2.811859607696533]},{array:[53.77520751953125,6.071747779846191,47.87072372436524,5.943275451660156,-51.11442184448242,-16.62527656555176,-24.84233665466309,4.076478004455566,-8.835965156555176,-4.306196689605713,13.907751083374023,-.6555676460266113]},{array:[53.77520751953125,6.071747779846191,47.87072372436524,5.943275451660156,-51.11442184448242,-16.62527656555176,-24.84233665466309,4.076478004455566,-8.835965156555176,-4.306196689605713,13.907751083374023,-.6555676460266113]},{array:[53.77520751953125,6.071747779846191,47.87072372436524,5.943275451660156,-51.11442184448242,-16.62527656555176,-24.84233665466309,4.076478004455566,-8.835965156555176,-4.306196689605713,13.907751083374023,-.6555676460266113]},{array:[62.81553649902344,6.203365325927734,48.45057678222656,8.571174621582031,-53.907508850097656,-16.376169204711918,-25.989578247070312,5.736949920654297,-8.150140762329102,-5.895424842834473,13.745902061462404,-4.22935676574707]},{array:[53.43303680419922,7.019550323486328,43.32084655761719,7.639513969421387,-49.81471633911133,-18.70837783813477,-21.690540313720703,.34458446502685547,-8.689970970153809,-3.96992826461792,11.29841423034668,-4.165286540985107]},{array:[56.29218673706055,7.115049362182617,47.741546630859375,4.102975845336914,-50.46143341064453,-18.23562622070313,-22.557659149169925,6.925202369689941,-13.170380592346191,-1.0300326347351076,8.813325881958008,-3.2347850799560547]},{array:[56.29218673706055,7.115049362182617,47.741546630859375,4.102975845336914,-50.46143341064453,-18.23562622070313,-22.557659149169925,6.925202369689941,-13.170380592346191,-1.0300326347351076,8.813325881958008,-3.2347850799560547]}]},{name:`O`,mfccCalibrationDataList:[{array:[108.1234893798828,57.48288345336914,.23154354095458984,-31.144771575927734,-38.093109130859375,-18.33026885986328,-11.25010108947754,-.7636222839355469,-1.371236801147461,-9.181392669677736,-1.6202507019042969,-7.501105308532715]},{array:[108.1234893798828,57.48288345336914,.23154354095458984,-31.144771575927734,-38.093109130859375,-18.33026885986328,-11.25010108947754,-.7636222839355469,-1.371236801147461,-9.181392669677736,-1.6202507019042969,-7.501105308532715]},{array:[120.48326873779295,61.38327026367188,-2.67855453491211,-32.3900146484375,-40.94635772705078,-12.681024551391602,-10.979912757873535,-.7160100936889648,-2.9078426361083984,-12.30073928833008,1.8719825744628908,-6.2853875160217285]},{array:[109.58128356933594,58.46321105957031,.1479501724243164,-31.080230712890625,-34.73053741455078,-17.423336029052734,-10.221624374389648,.3863086700439453,-1.2579708099365237,-7.037452220916748,-2.894855499267578,-7.0971550941467285]},{array:[109.58128356933594,58.46321105957031,.1479501724243164,-31.080230712890625,-34.73053741455078,-17.423336029052734,-10.221624374389648,.3863086700439453,-1.2579708099365237,-7.037452220916748,-2.894855499267578,-7.0971550941467285]},{array:[116.19681549072266,60.3573112487793,.07350921630859375,-32.38472747802735,-34.47290802001953,-16.37361526489258,-14.695085525512695,.3102083206176758,.28844451904296875,-8.948881149291992,-3.104994773864746,-9.900266647338867]},{array:[116.19681549072266,60.3573112487793,.07350921630859375,-32.38472747802735,-34.47290802001953,-16.37361526489258,-14.695085525512695,.3102083206176758,.28844451904296875,-8.948881149291992,-3.104994773864746,-9.900266647338867]},{array:[98.63448333740236,48.66178131103516,2.394181251525879,-28.785797119140625,-31.54886054992676,-18.37759017944336,-14.998208999633787,-1.8050260543823244,-2.018402099609375,-4.584748268127441,-5.160560607910156,-7.968695163726807]},{array:[124.25032043457033,59.27610397338867,2.7454710006713867,-36.72577667236328,-38.65552520751953,-3.116687774658203,-24.24558448791504,.5085678100585938,2.3633852005004883,-10.51361083984375,1.7447805404663088,-13.22685432434082]},{array:[87.89213562011719,45.08750534057617,4.292821884155273,-26.482845306396488,-30.386096954345703,-20.410654067993164,-11.817208290100098,-3.12704086303711,-1.1370172500610352,-6.159217357635498,-3.454045295715332,-5.7265400886535645]},{array:[87.89213562011719,45.08750534057617,4.292821884155273,-26.482845306396488,-30.386096954345703,-20.410654067993164,-11.817208290100098,-3.12704086303711,-1.1370172500610352,-6.159217357635498,-3.454045295715332,-5.7265400886535645]},{array:[87.89213562011719,45.08750534057617,4.292821884155273,-26.482845306396488,-30.386096954345703,-20.410654067993164,-11.817208290100098,-3.12704086303711,-1.1370172500610352,-6.159217357635498,-3.454045295715332,-5.7265400886535645]}]},{name:`S`,mfccCalibrationDataList:[{array:[-94.29214477539064,9.299236297607422,-21.6169376373291,4.123956203460693,1.3645498752593996,-2.339733839035034,12.92388916015625,-7.490560531616211,10.520170211791992,-5.4832611083984375,2.162111043930054,2.696177482604981]},{array:[-94.29214477539064,9.299236297607422,-21.6169376373291,4.123956203460693,1.3645498752593996,-2.339733839035034,12.92388916015625,-7.490560531616211,10.520170211791992,-5.4832611083984375,2.162111043930054,2.696177482604981]},{array:[-92.13811492919922,8.712703704833984,-17.194181442260746,4.387561798095703,2.288078784942627,-9.562786102294922,9.854814529418945,-7.843216896057129,8.969221115112305,-7.96703052520752,.38271141052246094,2.731431007385254]},{array:[-92.13811492919922,8.712703704833984,-17.194181442260746,4.387561798095703,2.288078784942627,-9.562786102294922,9.854814529418945,-7.843216896057129,8.969221115112305,-7.96703052520752,.38271141052246094,2.731431007385254]},{array:[-90.87933349609376,12.622742652893068,-12.25172233581543,6.775156497955322,6.892632007598877,-4.708589553833008,10.558273315429688,-10.19419288635254,10.907587051391602,.7259445190429688,6.631969451904297,1.2803831100463867]},{array:[-90.87933349609376,12.622742652893068,-12.25172233581543,6.775156497955322,6.892632007598877,-4.708589553833008,10.558273315429688,-10.19419288635254,10.907587051391602,.7259445190429688,6.631969451904297,1.2803831100463867]},{array:[-94.86066436767578,18.40726089477539,-5.981902599334717,7.446142196655273,11.998884201049805,1.1316719055175781,5.726372718811035,-9.411809921264648,9.966836929321287,.6692547798156738,3.0949947834014897,-.5439543724060059]},{array:[-94.86066436767578,18.40726089477539,-5.981902599334717,7.446142196655273,11.998884201049805,1.1316719055175781,5.726372718811035,-9.411809921264648,9.966836929321287,.6692547798156738,3.0949947834014897,-.5439543724060059]},{array:[-94.86066436767578,18.40726089477539,-5.981902599334717,7.446142196655273,11.998884201049805,1.1316719055175781,5.726372718811035,-9.411809921264648,9.966836929321287,.6692547798156738,3.0949947834014897,-.5439543724060059]},{array:[-100.9681396484375,15.002283096313477,-4.994745254516602,.22259855270385745,-.15606117248535156,-1.8661277294158936,1.5652005672454836,-13.30648422241211,12.554527282714844,-2.990779399871826,3.5510034561157227,5.119507312774658]},{array:[-100.9681396484375,15.002283096313477,-4.994745254516602,.22259855270385745,-.15606117248535156,-1.8661277294158936,1.5652005672454836,-13.30648422241211,12.554527282714844,-2.990779399871826,3.5510034561157227,5.119507312774658]},{array:[-101.28047943115236,14.962509155273438,-10.988410949707031,3.6384878158569336,-1.4698257446289065,-4.758091449737549,-1.3547701835632324,-12.941855430603027,3.351996183395386,-5.5131611824035645,9.386914253234863,3.8310816287994385]}]},{name:`A`,mfccCalibrationDataList:[{array:[4.20286750793457,-73.493896484375,-24.746726989746097,-41.51460266113281,36.48657989501953,-18.2531795501709,-42.99116516113281,25.61282348632813,-18.3366813659668,-15.366691589355469,-4.867555618286133,-8.545194625854492]},{array:[6.645953178405762,-70.99688720703125,-23.49920082092285,-40.70307922363281,35.09113311767578,-19.63579750061035,-41.851219177246094,26.54837036132813,-20.36124420166016,-15.091900825500488,-5.332237243652344,-7.199653625488281]},{array:[6.645953178405762,-70.99688720703125,-23.49920082092285,-40.70307922363281,35.09113311767578,-19.63579750061035,-41.851219177246094,26.54837036132813,-20.36124420166016,-15.091900825500488,-5.332237243652344,-7.199653625488281]},{array:[3.48603630065918,-73.30689239501953,-21.244325637817383,-38.72576522827149,41.22803497314453,-15.975458145141602,-42.09079360961914,27.367385864257816,-19.52243995666504,-16.397735595703125,-3.779520988464355,-4.958502292633057]},{array:[.09921550750732422,-70.22235107421875,-20.888980865478516,-33.53620910644531,48.01523208618164,-13.365336418151855,-42.88488006591797,26.45193481445313,-13.952343940734863,-16.65743064880371,-1.894343376159668,-1.8812918663024905]},{array:[.09921550750732422,-70.22235107421875,-20.888980865478516,-33.53620910644531,48.01523208618164,-13.365336418151855,-42.88488006591797,26.45193481445313,-13.952343940734863,-16.65743064880371,-1.894343376159668,-1.8812918663024905]},{array:[.09921550750732422,-70.22235107421875,-20.888980865478516,-33.53620910644531,48.01523208618164,-13.365336418151855,-42.88488006591797,26.45193481445313,-13.952343940734863,-16.65743064880371,-1.894343376159668,-1.8812918663024905]},{array:[-4.117016792297363,-72.00682830810547,-19.490331649780277,-34.48163986206055,51.383995056152344,-9.989368438720703,-41.8690185546875,23.82486724853516,-11.14547061920166,-14.500547409057617,-2.504335403442383,1.0616645812988281]},{array:[-3.077279090881348,-77.95940399169922,-21.169992446899418,-43.19057846069336,47.594181060791016,-14.239681243896484,-43.05297088623047,23.796558380126953,-16.033828735351562,-14.308491706848145,-4.90071964263916,-.6597251892089844]},{array:[-3.077279090881348,-77.95940399169922,-21.169992446899418,-43.19057846069336,47.594181060791016,-14.239681243896484,-43.05297088623047,23.796558380126953,-16.033828735351562,-14.308491706848145,-4.90071964263916,-.6597251892089844]},{array:[.27674388885498047,-74.16876220703125,-19.241043090820312,-43.69765853881836,45.94886779785156,-15.777923583984377,-40.226318359375,25.209468841552734,-19.91909408569336,-14.123311042785645,-6.749327659606934,-2.186051368713379]},{array:[1.313084602355957,-70.17343139648438,-20.149150848388672,-40.1507568359375,43.281288146972656,-17.598236083984375,-39.989742279052734,19.475574493408203,-18.73434066772461,-15.377893447875977,-3.6761083602905273,-2.372090339660645]}]},{name:`I`,mfccCalibrationDataList:[{array:[-43.23860549926758,15.659211158752441,48.96119689941406,-84.8009033203125,-2.832998275756836,-25.101383209228516,-19.283388137817383,-1.3310365676879885,-3.906793594360352,-5.55475664138794,-24.20616149902344,19.690078735351562]},{array:[-43.23860549926758,15.659211158752441,48.96119689941406,-84.8009033203125,-2.832998275756836,-25.101383209228516,-19.283388137817383,-1.3310365676879885,-3.906793594360352,-5.55475664138794,-24.20616149902344,19.690078735351562]},{array:[-43.23860549926758,15.659211158752441,48.96119689941406,-84.8009033203125,-2.832998275756836,-25.101383209228516,-19.283388137817383,-1.3310365676879885,-3.906793594360352,-5.55475664138794,-24.20616149902344,19.690078735351562]},{array:[-35.28649139404297,11.94938850402832,46.56689453125,-80.19161987304688,-5.332358360290527,-16.747013092041016,-17.014617919921875,-6.106320381164551,-3.5759763717651367,-11.297148704528809,-19.73563575744629,19.95285415649414]},{array:[-35.28649139404297,11.94938850402832,46.56689453125,-80.19161987304688,-5.332358360290527,-16.747013092041016,-17.014617919921875,-6.106320381164551,-3.5759763717651367,-11.297148704528809,-19.73563575744629,19.95285415649414]},{array:[-33.85117721557617,12.74870014190674,48.14194488525391,-75.80270385742188,-.9702749252319336,-14.077031135559082,-15.91115379333496,-4.433165073394775,-4.00740909576416,-9.756240844726564,-20.910476684570312,18.42697525024414]},{array:[-29.72378921508789,13.039468765258787,47.7448616027832,-74.11089324951172,.8275318145751953,-16.012189865112305,-17.36796760559082,-1.0376081466674805,-4.8292741775512695,-6.667880058288574,-23.82168960571289,16.03271865844727]},{array:[-29.259418487548828,11.963765144348145,41.54622268676758,-75.67298889160156,-2.0329294204711914,-20.586360931396488,-21.125045776367188,.5504961013793945,-5.419882774353027,-6.314876556396484,-25.0130615234375,14.262750625610352]},{array:[-29.259418487548828,11.963765144348145,41.54622268676758,-75.67298889160156,-2.0329294204711914,-20.586360931396488,-21.125045776367188,.5504961013793945,-5.419882774353027,-6.314876556396484,-25.0130615234375,14.262750625610352]},{array:[-28.383831024169925,13.10340976715088,39.94292449951172,-81.08953857421875,-4.134577751159668,-21.59007263183594,-23.217021942138672,-.3798789978027344,-5.072433471679688,-5.94474983215332,-26.63843536376953,16.777332305908203]},{array:[-30.04895401000977,16.33201599121094,44.49327850341797,-81.91828155517578,-4.171995162963867,-19.618621826171875,-20.534595489501953,-.9673957824707032,-3.2188777923583984,-6.572293758392334,-26.59181785583496,18.48187255859375]},{array:[-30.987979888916016,14.425168991088867,48.951114654541016,-82.33119201660156,-4.302616119384766,-17.64216995239258,-19.92198181152344,-1.7414522171020508,-1.731914520263672,-6.870545387268066,-22.85688591003418,19.475980758666992]}]},{name:`U`,mfccCalibrationDataList:[{array:[35.53300476074219,-11.371288299560549,16.69929885864258,-39.32943344116211,2.8931827545166016,-39.35669708251953,-22.81580924987793,-8.255973815917969,-7.3601884841918945,3.866161346435547,-36.18340301513672,.44779300689697266]},{array:[34.92810821533203,-12.66100025177002,19.55118560791016,-38.58994293212891,1.5609407424926758,-42.781375885009766,-22.405025482177734,-4.380008220672607,-9.27183723449707,5.952349662780762,-38.181243896484375,1.4162702560424805]},{array:[34.508079528808594,-10.0599946975708,18.88445281982422,-34.42189407348633,-.8881950378417969,-42.52379608154297,-20.37147331237793,-.6865062713623047,-8.89057731628418,6.381434440612793,-34.81671524047852,3.530543327331543]},{array:[34.508079528808594,-10.0599946975708,18.88445281982422,-34.42189407348633,-.8881950378417969,-42.52379608154297,-20.37147331237793,-.6865062713623047,-8.89057731628418,6.381434440612793,-34.81671524047852,3.530543327331543]},{array:[37.63418579101563,-14.223724365234377,21.262420654296875,-39.50825119018555,.31142520904541016,-43.201324462890625,-19.136680603027344,-.7461652755737305,-8.253379821777344,9.12716293334961,-33.483253479003906,9.34031105041504]},{array:[38.28554916381836,-15.814170837402344,19.503570556640625,-40.19694900512695,-.7106151580810547,-45.37378311157227,-20.631587982177734,-2.233296394348145,-6.609874725341797,8.43967342376709,-33.560943603515625,8.549976348876953]},{array:[38.28554916381836,-15.814170837402344,19.503570556640625,-40.19694900512695,-.7106151580810547,-45.37378311157227,-20.631587982177734,-2.233296394348145,-6.609874725341797,8.43967342376709,-33.560943603515625,8.549976348876953]},{array:[36.15192413330078,-19.43944549560547,19.22710609436035,-40.229862213134766,-1.7119722366333008,-44.58899688720703,-22.39651870727539,-4.687357902526856,-5.184035301208496,5.601207733154297,-35.31377792358399,6.856324195861816]},{array:[33.697601318359375,-19.53946304321289,18.151920318603516,-38.29360580444336,-1.9536991119384768,-39.18521881103516,-21.181903839111328,-8.092260360717773,-6.441320419311523,3.8472461700439458,-32.4590950012207,8.79825210571289]},{array:[31.76858520507813,-17.137840270996097,15.726847648620605,-36.897605895996094,-3.8221397399902344,-35.492652893066406,-19.920631408691406,-10.421395301818848,-7.471479415893555,1.7216854095458984,-25.7265739440918,12.090950965881348]},{array:[31.76858520507813,-17.137840270996097,15.726847648620605,-36.897605895996094,-3.8221397399902344,-35.492652893066406,-19.920631408691406,-10.421395301818848,-7.471479415893555,1.7216854095458984,-25.7265739440918,12.090950965881348]},{array:[32.6759033203125,-15.928326606750488,16.0853271484375,-34.126686096191406,-6.689325332641602,-33.79350662231445,-19.242847442626953,-10.59890079498291,-10.992877006530762,-2.9957642555236816,-23.329811096191406,14.23158359527588]}]},{name:`U`,mfccCalibrationDataList:[{array:[50.45172882080078,-7.723395347595215,32.29489135742188,-11.293773651123049,-22.777332305908203,-36.17817687988281,-17.044910430908203,-3.767278671264649,-14.233147621154785,-17.250513076782227,-19.240345001220703,-6.971443176269531]},{array:[53.59954071044922,-9.874463081359863,35.237457275390625,-11.929043769836426,-23.915904998779297,-38.07780838012695,-15.71041202545166,-6.737283706665039,-12.06786060333252,-14.436643600463867,-20.401880264282227,-7.594654560089111]},{array:[57.36424255371094,-14.57245922088623,35.10681915283203,-13.044787406921388,-24.196090698242188,-36.5896110534668,-16.161855697631836,-10.228910446166992,-10.43470287322998,-10.997936248779297,-20.92641830444336,-7.631929397583008]},{array:[57.65166473388672,-16.92430305480957,33.02215194702149,-12.667181968688965,-21.69562530517578,-32.90369415283203,-14.275350570678713,-10.332601547241213,-10.544659614562988,-6.801647186279297,-22.47809410095215,-8.94782543182373]},{array:[49.60702133178711,-9.94367504119873,25.04156494140625,-9.98995304107666,-21.814006805419925,-28.99759292602539,-16.792327880859375,-9.5930814743042,-11.523345947265623,-7.568509578704834,-20.688356399536136,-10.5545015335083]},{array:[53.43399047851563,-10.947863578796388,30.42605590820313,-10.506410598754885,-22.997278213500977,-31.270254135131836,-16.90880584716797,-9.606002807617188,-10.785472869873049,-9.04238510131836,-22.82281494140625,-12.42250919342041]},{array:[57.11727523803711,-14.77857780456543,33.16322326660156,-13.437588691711426,-25.450626373291016,-33.84945297241211,-17.6593017578125,-11.152002334594728,-12.203851699829102,-9.72322940826416,-26.653217315673828,-12.098143577575684]},{array:[58.65357208251953,-15.040183067321777,32.92494583129883,-12.598053932189941,-24.03311538696289,-33.4146728515625,-15.565327644348145,-11.081777572631836,-10.47522258758545,-9.327695846557617,-28.43020248413086,-11.224303245544434]},{array:[53.888484954833984,-13.592279434204102,31.6711368560791,-9.440587043762209,-23.316177368164062,-35.3663444519043,-19.26239776611328,-13.472862243652344,-11.312352180480955,-7.2335309982299805,-25.466888427734375,-8.924440383911133]},{array:[54.30769348144531,-13.31528663635254,26.960655212402344,-11.682543754577637,-23.105655670166016,-32.50704956054688,-17.88333320617676,-10.961587905883787,-11.377249717712404,-7.610130786895752,-24.95154190063477,-9.38066577911377]},{array:[57.15829849243164,-13.77165985107422,31.29568099975586,-9.493865966796877,-23.708837509155277,-33.85169982910156,-19.99985122680664,-12.555244445800781,-14.447962760925291,-7.608822822570801,-23.899951934814457,-6.755941867828369]},{array:[47.781307220458984,-14.279045104980469,23.228328704833984,-14.190330505371094,-23.399112701416016,-34.95072555541992,-21.406070709228516,-10.15461254119873,-14.686234474182127,-9.932022094726564,-22.141719818115234,-8.354757308959961]}]},{name:`E`,mfccCalibrationDataList:[{array:[7.131360054016113,-36.049346923828125,45.31159210205078,-45.00178527832031,-15.53347110748291,1.3071203231811523,2.57974910736084,-1.8762083053588867,-25.02313995361328,-22.275257110595703,-16.383546829223633,-17.868574142456055]},{array:[7.131360054016113,-36.049346923828125,45.31159210205078,-45.00178527832031,-15.53347110748291,1.3071203231811523,2.57974910736084,-1.8762083053588867,-25.02313995361328,-22.275257110595703,-16.383546829223633,-17.868574142456055]},{array:[11.067873001098633,-36.16781234741211,45.893943786621094,-43.60368347167969,-15.017866134643556,-1.2796411514282229,2.090773582458496,-2.00726318359375,-22.139572143554688,-22.111957550048828,-16.975831985473633,-17.187711715698246]},{array:[9.000146865844727,-36.58183288574219,46.39983367919922,-45.5433349609375,-15.245804786682127,-2.223395347595215,4.547385215759277,-1.7552833557128908,-24.691539764404297,-22.836109161376953,-15.247169494628908,-15.090204238891602]},{array:[6.99749755859375,-37.912235260009766,46.3832893371582,-47.18668365478516,-13.492773056030273,-2.466267585754395,5.109303951263428,-1.4368247985839844,-25.965919494628906,-23.327587127685547,-14.712173461914064,-15.369802474975586]},{array:[8.53531551361084,-38.04619598388672,47.71860885620117,-47.188323974609375,-12.696022987365724,.9119815826416016,5.812184810638428,1.9683570861816408,-28.441104888916016,-21.203857421875,-16.284610748291016,-15.28965950012207]},{array:[8.53531551361084,-38.04619598388672,47.71860885620117,-47.188323974609375,-12.696022987365724,.9119815826416016,5.812184810638428,1.9683570861816408,-28.441104888916016,-21.203857421875,-16.284610748291016,-15.28965950012207]},{array:[10.728363037109377,-37.86867141723633,48.31739044189453,-47.47754669189453,-12.409613609313965,-.4410533905029297,5.663397789001465,3.449146270751953,-27.80557632446289,-20.967662811279297,-15.19067096710205,-14.877350807189941]},{array:[10.065123558044434,-36.66007232666016,44.76460266113281,-47.56492233276367,-12.32224941253662,-2.301477432250977,3.445328712463379,3.1899805068969727,-25.73431205749512,-21.715232849121097,-13.482653617858888,-17.041053771972656]},{array:[8.782588958740234,-36.92534255981445,44.4034309387207,-46.98899841308594,-8.84085464477539,-3.2711610794067383,2.835450172424317,3.1592531204223637,-24.939672470092777,-21.54747772216797,-15.242938041687012,-17.53165054321289]},{array:[6.508709907531738,-36.80110168457031,42.792266845703125,-46.29795837402344,-6.919498443603516,-3.788252830505371,2.5329980850219727,4.23353385925293,-24.539836883544925,-21.791210174560547,-16.75529670715332,-18.159324645996097]},{array:[6.508709907531738,-36.80110168457031,42.792266845703125,-46.29795837402344,-6.919498443603516,-3.788252830505371,2.5329980850219727,4.23353385925293,-24.539836883544925,-21.791210174560547,-16.75529670715332,-18.159324645996097]}]},{name:`O`,mfccCalibrationDataList:[{array:[53.443660736083984,-12.53360652923584,-26.871780395507816,-71.98885345458984,-5.861575126647949,-1.712080001831055,-32.90825653076172,23.514209747314457,-10.125606536865236,-11.977684020996094,9.883563041687012,-5.261895179748535]},{array:[55.69048309326172,-10.316678047180176,-26.289718627929688,-74.05561828613281,-4.348355293273926,-1.1102313995361328,-32.498268127441406,22.016807556152344,-11.227481842041016,-11.753466606140137,10.583023071289064,-3.583785057067871]},{array:[55.69048309326172,-10.316678047180176,-26.289718627929688,-74.05561828613281,-4.348355293273926,-1.1102313995361328,-32.498268127441406,22.016807556152344,-11.227481842041016,-11.753466606140137,10.583023071289064,-3.583785057067871]},{array:[56.3330307006836,-9.761429786682127,-24.52502822875977,-75.67504119873047,-2.94111442565918,-1.0509262084960938,-32.58983612060547,20.397789001464844,-13.52730941772461,-10.221673965454102,8.806441307067871,-6.1672868728637695]},{array:[58.4255599975586,-13.048576354980469,-26.326568603515625,-77.33265686035156,.8971290588378906,-.13758087158203125,-34.79779052734375,22.524978637695312,-15.138383865356445,-9.027335166931152,10.94324779510498,-6.867808818817139]},{array:[57.16611099243164,-17.380069732666016,-26.70465087890625,-76.53448486328125,3.203751564025879,1.6217775344848633,-36.67759323120117,24.14405059814453,-12.52278518676758,-8.60572338104248,13.969680786132812,-4.909186840057373]},{array:[55.17543029785156,-22.491680145263672,-25.568838119506836,-74.10460662841797,2.1666202545166016,4.1397705078125,-37.21670913696289,21.99705505371094,-11.680967330932617,-8.396781921386719,13.454421997070312,-3.452665328979492]},{array:[55.18680953979492,-23.176528930664062,-23.64011573791504,-69.64533233642578,1.9893865585327148,7.129931449890137,-35.871803283691406,19.41016006469727,-13.193324089050291,-8.643393516540527,10.173726081848145,-3.2846717834472656]},{array:[55.18680953979492,-23.176528930664062,-23.64011573791504,-69.64533233642578,1.9893865585327148,7.129931449890137,-35.871803283691406,19.41016006469727,-13.193324089050291,-8.643393516540527,10.173726081848145,-3.2846717834472656]},{array:[52.92599105834961,-22.9690055847168,-25.62136459350586,-65.79485321044922,.01132965087890625,5.457650184631348,-33.96955871582031,16.389381408691406,-14.026248931884766,-7.287093162536621,11.159339904785156,-3.7541093826293945]},{array:[51.816688537597656,-22.891870498657227,-29.80591201782227,-68.66901397705078,-1.94846248626709,1.63895320892334,-33.593971252441406,17.095460891723633,-13.046170234680176,-8.923750877380371,13.052698135375977,-5.068996429443359]},{array:[54.392459869384766,-23.71658706665039,-31.424976348876953,-75.520263671875,-4.738470077514648,-.12287521362304688,-36.41456604003906,18.125713348388672,-14.02833366394043,-11.63118839263916,12.234237670898438,-4.546117782592773]}]}]};function jp(e){let{audioContext:t}=pn(),{state:n,isReady:r}=cn(kp(t,Ap),void 0),i=[`A`,`E`,`I`,`O`,`U`,`S`],a=[`A`,`E`,`I`,`O`,`U`],s={A:`aa`,E:`ee`,I:`ih`,O:`oh`,U:`ou`},c={A:`A`,E:`E`,I:`I`,O:`O`,U:`U`,S:`I`},l={A:0,E:0,I:0,O:0,U:0},u=.7,d=0;m([r,e],([e,t],[,r])=>{if(r&&r!==t)try{r.disconnect()}catch{}if(!(!e||!t||!n.value))try{t.connect(n.value)}catch{}},{immediate:!0}),o(()=>e.value?.disconnect());function f(e,t=.016){let r=n.value;if(!e?.expressionManager||!r)return;let o=r.volume??0,f=Math.min(o*.9,1)**.7,p={A:0,E:0,I:0,O:0,U:0};for(let e of i){let t=c[e],n=r.weights[e]??0;p[t]=Math.max(p[t],n*f)}let m=`I`,h=`E`,g=-1/0,_=-1/0;for(let e of a){let t=p[e];t>g?(_=g,h=m,g=t,m=e):t>_&&(_=t,h=e)}let v=performance.now(),y=f<.04||g<.05;y||(d=v),v-d>160&&(y=!0);let b={A:0,E:0,I:0,O:0,U:0};y||(b[m]=Math.min(u,g),b[h]=Math.min(u*.5,_*.6));for(let n of a){let r=l[n],i=b[n],a=1-Math.exp(-(i>r?50:30)*t);l[n]=r+(i-r)*a;let o=(l[n]<=.01?0:l[n])*.7;e.expressionManager.setValue(s[n],o)}}return{update:f}}var Mp=e({__name:`VRMModel`,props:{currentAudioSource:{},modelSrc:{},lastModelSrc:{},idleAnimation:{},paused:{type:Boolean,default:!1},envSelect:{},skyBoxIntensity:{},nprIrrSH:{},modelOffset:{},modelRotationY:{},lookAtTarget:{},trackingMode:{},eyeHeight:{},cameraPosition:{},camera:{}},emits:[`loadingProgress`,`loadStart`,`cameraPosition`,`modelOrigin`,`modelSize`,`modelRotationY`,`eyeHeight`,`lookAtTarget`,`error`,`loaded`],setup(e,{expose:t,emit:i}){let a=e,s=i,{currentAudioSource:c,modelSrc:l,lastModelSrc:u,idleAnimation:d,paused:g,envSelect:_,skyBoxIntensity:v,nprIrrSH:y,modelOffset:b,modelRotationY:x,lookAtTarget:S,trackingMode:C,eyeHeight:ee,cameraPosition:te,camera:ne}=r(a),{scene:re}=Et(),E=w(),D=w(),O=T(!1),{x:ie,y:ae}=an(),k=new de,oe=new L,A=w(),se,ce,le=T(),{onBeforeRender:j,stop:fe,start:pe}=pt(),me,he=xp(),ge=Sp(),_e=T(),ve=jp(c),ye=T(0),be=null;function M(){me?.(),D.value&&D.value.removeFromParent(),E.value&&Xu.deepDispose(E.value.scene),be?.dispose(),be=null}function xe(e,t,n){oe.x=e/window.innerWidth*2-1,oe.y=-(t/window.innerHeight)*2+1,k.setFromCamera(oe,n.value);let r=new F;n.value.getWorldDirection(r);let i=new ue;i.setFromNormalAndCoplanarPoint(r,n.value.position.clone().add(r.multiplyScalar(1)));let a=new F;return k.ray.intersectPlane(i,a),{x:a.x,y:a.y,z:a.z}}function Se(e){return{x:0,y:e,z:-100}}async function Ce(){try{if(!re.value){console.warn(`Scene is not ready, cannot load VRM model.`);return}if(D.value&&M(),!l.value){console.warn(`NO model src, cannot load VRM model.`);return}let e=l.value!==u.value;try{s(`loadStart`),O.value=!1;let t=await Cp(l.value,{scene:re.value,lookAt:!0,onProgress:e=>s(`loadingProgress`,Number((100*e.loaded/e.total).toFixed(2)))});if(!t||!t._vrm||!t?._vrmGroup){console.warn(`VRM model loading failure!`);return}let{_vrm:n,_vrmGroup:r,modelCenter:i,modelSize:a,initialCameraOffset:o}=t;E.value=n,D.value=r,e&&(s(`cameraPosition`,{x:i.x+o.x,y:i.y+o.y,z:i.z+o.z}),s(`modelOrigin`,{x:i.x,y:i.y,z:i.z}),s(`modelSize`,{x:a.x,y:a.y,z:a.z})),e&&s(`modelRotationY`,0);let c=await yp(n,await vp(d.value));if(!c){console.warn(`No VRM animation loaded`);return}bp(c,n),le.value=new st(n.scene),le.value.clipAction(c).play(),_e.value=wp(n);function u(e){return!!(e?.isShaderMaterial&&e.userData?.vrmMaterialType===`MToon`)}let f=e=>!!e?.isShaderMaterial;!be&&re.value&&(be=ad(re.value)),n.scene.traverse(e=>{e instanceof it&&e.material&&(Array.isArray(e.material)?e.material:[e.material]).forEach(e=>{if(e instanceof ft||e instanceof St)e.envMapIntensity=1,e.needsUpdate=!0;else if(u(e))`toneMapped`in e&&(e.toneMapped=!1);else if(f(e)){`toneMapped`in e&&(e.toneMapped=!1),`envMap`in e&&e.envMap&&(e.envMap=null);let t=e.map;if(t&&t.colorSpace!==void 0)try{t.colorSpace=N}catch(e){console.warn(`Failed to set colorSpace on texture:`,e)}rd(e)}})});function p(){let e=E.value?.humanoid?.getNormalizedBoneNode(`head`);if(!e)return null;let t=new F;return e.getWorldPosition(t),t.y}if(e){let e=p();e&&(s(`eyeHeight`,e),s(`lookAtTarget`,Se(e)))}me=j(({delta:e})=>{le.value?.update(e),E.value?.update(e),E.value?.lookAt?.update?.(e),he.update(E.value,e),ge.update(E.value,S,e),_e.value?.update(e),ve.update(E.value,e),E.value?.springBoneManager?.update(e)}).off,s(`loaded`,l.value),O.value=!0}catch(e){console.error(e),s(`error`,e)}}catch(e){console.error(e),s(`error`,e)}}return f(async()=>{await tn(()=>re.value).toBeTruthy(),await Ce(),m(l,(e,t)=>{e!==t&&Ce()}),m(g,e=>{e?fe():pe()},{immediate:!0}),m(b,()=>{D.value&&D.value.position.set(b.value.x,b.value.y,b.value.z)},{immediate:!0,deep:!0}),m(x,e=>{D.value&&(D.value.rotation.y=I.degToRad(e))},{immediate:!0}),m([_,v,y],async()=>{if(!E.value)return;ye.value+=1;let e=td(_.value);id(E.value?.scene,{mode:e,intensity:v.value,sh:y.value??null}),be?.update(e,v.value,y.value??null)},{immediate:!0}),m(C,e=>{ce?.(),ce=void 0,se?.(),se=void 0,e===`camera`?ce=m(te,e=>{s(`lookAtTarget`,e)},{immediate:!0,deep:!0}):e===`mouse`?se=m([ie,ae],([e,t])=>{A.value=xe(e,t,ne),s(`lookAtTarget`,A.value)},{immediate:!0,deep:!0}):s(`lookAtTarget`,Se(ee.value))},{immediate:!0}),m(S,e=>{ge.instantUpdate(E.value,e)},{deep:!0})}),o(()=>M()),t({setExpression(e){_e.value?.setEmotionWithResetAfter(e,1e3)},scene:h(()=>E.value?.scene),lookAtUpdate(e){ge.instantUpdate(E.value,e)}}),(e,t)=>O.value?p(e.$slots,`default`,{key:0}):n(``,!0)}}),Np=[`color`,`ground-color`,`intensity`],Pp=[`color`,`intensity`],Fp=[`color`,`position`,`intensity`],Ip={key:2,size:1},Lp=e({__name:`ThreeScene`,props:{currentAudioSource:{},modelSrc:{},skyBoxSrc:{},showAxes:{type:Boolean,default:!1},idleAnimation:{default:new URL(`/assets/idle_loop-Cs1QaHgK.vrma`,``+import.meta.url).href},paused:{type:Boolean,default:!1}},emits:[`loadModelProgress`,`error`],setup(e,{expose:t,emit:r}){let i=e,a=r,u=T(),{width:p,height:h}=sn(u),{lastModelSrc:b,modelSize:x,modelOrigin:S,modelOffset:C,modelRotationY:E,cameraFOV:D,cameraPosition:O,cameraDistance:ie,directionalLightPosition:ae,directionalLightTarget:k,directionalLightRotation:oe,directionalLightIntensity:A,directionalLightColor:se,ambientLightIntensity:ce,ambientLightColor:le,hemisphereSkyColor:ue,hemisphereGroundColor:j,hemisphereLightIntensity:de,lookAtTarget:fe,trackingMode:pe,eyeHeight:me,envSelect:he,skyBoxSrc:ge,skyBoxIntensity:_e}=Zt(No()),ve=T(),ye=w(new Ie),be=w(),M=w(),xe=T(),N=T();function Ce(e){(Math.abs(O.value.x-e.newCameraPosition.x)>1e-6||Math.abs(O.value.y-e.newCameraPosition.y)>1e-6||Math.abs(O.value.z-e.newCameraPosition.z)>1e-6)&&(O.value=e.newCameraPosition),Math.abs(ie.value-e.newCameraDistance)>1e-6&&(ie.value=e.newCameraDistance)}let we=T(!1);function Te(){we.value=!0}let Ee=T(!1),De=T(!1);function Oe(){Ee.value=!1,De.value=!1}function ke(e){O.value.x=e.x,O.value.y=e.y,O.value.z=e.z}function Ae(e){S.value.x=e.x,S.value.y=e.y,S.value.z=e.z}function je(e){x.value.x=e.x,x.value.y=e.y,x.value.z=e.z}function P(e){E.value=e}function Me(e){me.value=e}function Ne(e){fe.value.x=e.x,fe.value.y=e.y,fe.value.z=e.z}function Pe(e){b.value=e,Ee.value=!0,De.value=!0}let Fe=T(null);function Le(e){Fe.value=e.irrSH||null}function Re(e){M.value=e}f(()=>{he.value===`skyBox`&&xe.value?.reload(ge.value)}),o(()=>{});let ze={saturation:.3,hue:0,blendFunction:K.SRC},Be=T(!1),Ve=T(!1);function He(){Ve.value=!0}m([we,Ve],([e,t])=>{if(e&&t&&ye.value&&be.value&&be.value.controls&&N.value)try{N.value.parent?.add(N.value.target),N.value.target.position.set(k.value.x,k.value.y,k.value.z),N.value.target.updateMatrixWorld()}finally{Be.value=!0}});function Ue(e){let t=N.value;if(!t)return;let{x:n,y:r,z:i}=e,a=new F(ae.value.x,ae.value.y,ae.value.z),o=new F(0,0,0),s=new Se(I.degToRad(n),I.degToRad(r),I.degToRad(i),`XYZ`),c=o.clone().sub(a).normalize().applyEuler(s).normalize(),l=a.distanceTo(o),u=a.clone().addScaledVector(c,l);t.target.position.copy(u),t.target.updateMatrixWorld(),k.value={x:u.x,y:u.y,z:u.z}}return m(oe,e=>{Ue(e)},{deep:!0}),t({setExpression:e=>{ve.value?.setExpression(e)},canvasElement:()=>M.value?.renderer.instance.domElement}),(e,t)=>(s(),ne(`div`,{ref_key:`sceneContainerRef`,ref:u,w:`100%`,h:`100%`},[te(_(v(Lt),{camera:ye.value,antialias:!0,width:v(p),height:v(h),"tone-mapping":v(4),"tone-mapping-exposure":1,"clear-alpha":0,onReady:Re},{default:y(()=>[_(v(es),{ref_key:`controlsRef`,ref:be,"control-enable":De.value,"model-loaded":Ee.value,"model-size":v(x),"camera-position":v(O),"camera-target":v(S),"camera-f-o-v":v(D),"camera-distance":v(ie),onOrbitControlsCameraChanged:Ce,onOrbitControlsReady:Te},null,8,[`control-enable`,`model-loaded`,`model-size`,`camera-position`,`camera-target`,`camera-f-o-v`,`camera-distance`]),v(he)===`skyBox`?(s(),d(v(as),{key:0,ref_key:`skyBoxEnvRef`,ref:xe,"sky-box-src":v(ge),"as-background":!0,onSkyBoxReady:Le},null,8,[`sky-box-src`])):(s(),ne(`TresHemisphereLight`,{key:1,color:v(un)(v(ue)),"ground-color":v(un)(v(j)),position:[0,1,0],intensity:v(de),"cast-shadow":``},null,8,Np)),re(`TresAmbientLight`,{color:v(un)(v(le)),intensity:v(ce),"cast-shadow":``},null,8,Pp),re(`TresDirectionalLight`,{ref_key:`dirLightRef`,ref:N,color:v(un)(v(se)),position:[v(ae).x,v(ae).y,v(ae).z],intensity:v(A),"cast-shadow":``,onReady:He},null,40,Fp),(s(),d(g,null,{default:y(()=>[_(v(wo),null,{default:y(()=>[_(v(jo),l(c(ze)),null,16)]),_:1})]),_:1})),_(v(Mp),{ref_key:`modelRef`,ref:ve,"current-audio-source":i.currentAudioSource,"model-src":i.modelSrc,"last-model-src":v(b),"idle-animation":i.idleAnimation,paused:i.paused,"env-select":v(he),"sky-box-intensity":v(_e),"npr-irr-s-h":Fe.value,"model-offset":v(C),"model-rotation-y":v(E),"look-at-target":v(fe),"tracking-mode":v(pe),"eye-height":v(me),"camera-position":v(O),camera:ye.value,onLoadingProgress:t[0]||=e=>a(`loadModelProgress`,e),onLoadStart:Oe,onCameraPosition:ke,onModelOrigin:Ae,onModelSize:je,onModelRotationY:P,onEyeHeight:Me,onLookAtTarget:Ne,onError:t[1]||=e=>a(`error`,e),onLoaded:Pe},null,8,[`current-audio-source`,`model-src`,`last-model-src`,`idle-animation`,`paused`,`env-select`,`sky-box-intensity`,`npr-irr-s-h`,`model-offset`,`model-rotation-y`,`look-at-target`,`tracking-mode`,`eye-height`,`camera-position`,`camera`]),i.showAxes?(s(),ne(`TresAxesHelper`,Ip)):n(``,!0)]),_:1},8,[`camera`,`width`,`height`,`tone-mapping`]),[[ee,!0]])],512))}});export{Fn as a,Pa as i,No as n,Fa as r,Lp as t}; \ No newline at end of file diff --git a/assets/system-BRtfNILC.js b/assets/system-DxqKh5f_.js similarity index 88% rename from assets/system-BRtfNILC.js rename to assets/system-DxqKh5f_.js index 2d3b912d87fde1dd453ff334e010e7516e232e74..312abd3348032862f9d02506660d4838601d6f93 100644 --- a/assets/system-BRtfNILC.js +++ b/assets/system-DxqKh5f_.js @@ -1 +1 @@ -import{A as e,K as t,Z as n,b as r,k as i,kt as a,lt as o,ut as s,w as c,x as l}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-CZ9Rvki9.js";import"./src-DYQXbDgu.js";import"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{vt as u,yt as d}from"./components-BR_Kqwtu.js";import"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import{n as f}from"./vue-i18n.runtime-Dah5zGm4.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-D1kLcsvA.js";import"./__vite-browser-external-BaycPy5b.js";import{t as p}from"./route-block-CpjdOEnv.js";import{t as m}from"./use-ripple-grid-state-DcESPJAf.js";var 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":``},y=e({__name:`index`,setup(e){let{t:p}=f(),{lastClickedIndex:y,setLastClickedIndex:b}=m(),x=r(()=>[{title:p(`settings.pages.system.general.title`),description:p(`settings.pages.system.general.description`),icon:`i-solar:emoji-funny-square-bold-duotone`,to:`/settings/system/general`},{title:p(`settings.pages.system.color-scheme.title`),description:p(`settings.pages.system.color-scheme.description`),icon:`i-solar:pallete-2-bold-duotone`,to:`/settings/system/color-scheme`},{title:p(`settings.pages.system.developer.title`),description:p(`settings.pages.system.developer.description`),icon:`i-solar:code-bold-duotone`,to:`/settings/system/developer`}]);return(e,r)=>{let f=n(`motion`);return t(),c(`div`,h,[r[1]||=l(`div`,null,null,-1),l(`div`,g,[i(a(d),{items:x.value,"get-key":e=>e.to,columns:1,"origin-index":a(y),onItemClick:r[0]||=({globalIndex:e})=>a(b)(e)},{item:o(({item:e})=>[i(a(u),{title:e.title,description:e.description,icon:e.icon,to:e.to},null,8,[`title`,`description`,`icon`,`to`])]),_:1},8,[`items`,`get-key`,`origin-index`])]),s((t(),c(`div`,_,[s(l(`div`,v,null,512),[[f]])])),[[f]])])}}});typeof p==`function`&&p(y);var b=y;export{b as default}; \ No newline at end of file +import{A as e,K as t,Z as n,b as r,k as i,kt as a,lt as o,ut as s,w as c,x as l}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-C0YByt49.js";import"./src-DYQXbDgu.js";import"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{vt as u,yt as d}from"./components-CeE-UiLT.js";import"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import{n as f}from"./vue-i18n.runtime-Dah5zGm4.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-73vyHOZs.js";import"./__vite-browser-external-BaycPy5b.js";import{t as p}from"./route-block-CpjdOEnv.js";import{t as m}from"./use-ripple-grid-state-DcESPJAf.js";var 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":``},y=e({__name:`index`,setup(e){let{t:p}=f(),{lastClickedIndex:y,setLastClickedIndex:b}=m(),x=r(()=>[{title:p(`settings.pages.system.general.title`),description:p(`settings.pages.system.general.description`),icon:`i-solar:emoji-funny-square-bold-duotone`,to:`/settings/system/general`},{title:p(`settings.pages.system.color-scheme.title`),description:p(`settings.pages.system.color-scheme.description`),icon:`i-solar:pallete-2-bold-duotone`,to:`/settings/system/color-scheme`},{title:p(`settings.pages.system.developer.title`),description:p(`settings.pages.system.developer.description`),icon:`i-solar:code-bold-duotone`,to:`/settings/system/developer`}]);return(e,r)=>{let f=n(`motion`);return t(),c(`div`,h,[r[1]||=l(`div`,null,null,-1),l(`div`,g,[i(a(d),{items:x.value,"get-key":e=>e.to,columns:1,"origin-index":a(y),onItemClick:r[0]||=({globalIndex:e})=>a(b)(e)},{item:o(({item:e})=>[i(a(u),{title:e.title,description:e.description,icon:e.icon,to:e.to},null,8,[`title`,`description`,`icon`,`to`])]),_:1},8,[`items`,`get-key`,`origin-index`])]),s((t(),c(`div`,_,[s(l(`div`,v,null,512),[[f]])])),[[f]])])}}});typeof p==`function`&&p(y);var b=y;export{b as default}; \ No newline at end of file diff --git a/assets/tres-B5z5lcdF.js b/assets/tres-Bk8ucvrj.js similarity index 99% rename from assets/tres-B5z5lcdF.js rename to assets/tres-Bk8ucvrj.js index 238fd6952545263347aa7141cf62a4648aafd985..1f67633d05626182555eddd4fa66312f0e361810 100644 --- a/assets/tres-B5z5lcdF.js +++ b/assets/tres-Bk8ucvrj.js @@ -1,4 +1,4 @@ -import{r as e}from"./chunk-B78Zgmat.js";import{A as t,G as n,K as r,N as i,Nt as a,Ot as o,T as s,W as c,at as l,b as u,bt as d,gt as f,j as p,jt as m,kt as h,m as g,ot as _,q as v,rt as y,w as b,wt as x,xt as S}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import{A as C,D as w,E as T,F as E,I as D,M as O,N as k,O as A,P as j,T as M,j as ee,k as te,w as N}from"./widgets-CZ9Rvki9.js";var ne=`181`,re={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},ie={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},ae=0,oe=1,se=2,ce=0,le=1,ue=4,de=`attached`,fe=`detached`,pe=303,me=1e3,he=1001,P=1002,ge=1003,_e=1004,ve=1004,F=1005,ye=1005,I=1006,L=1007,be=1007,xe=1008,Se=1008,Ce=1009,we=1010,Te=1011,Ee=1012,De=1013,Oe=1014,ke=1015,Ae=1016,je=1017,Me=1018,Ne=1020,Pe=35902,Fe=35899,Ie=1021,Le=1022,Re=1023,ze=1026,Be=1027,Ve=1028,He=1029,Ue=1030,We=1031,Ge=1032,Ke=1033,qe=33776,Je=33777,Ye=33778,Xe=33779,Ze=35840,Qe=35841,$e=35842,et=35843,tt=36196,nt=37492,rt=37496,it=37808,at=37809,ot=37810,st=37811,ct=37812,lt=37813,ut=37814,dt=37815,ft=37816,pt=37817,mt=37818,ht=37819,gt=37820,_t=37821,vt=36492,yt=36494,bt=36495,xt=36283,St=36284,Ct=36285,wt=36286,Tt=2200,Et=2201,Dt=2202,Ot=2300,kt=2301,At=2302,jt=2400,Mt=2401,Nt=2402,Pt=2500,Ft=2501,It=0,Lt=1,Rt=2,zt=3200,Bt=3201,Vt=3202,Ht=3203,Ut=0,Wt=``,Gt=`srgb`,Kt=`srgb-linear`,qt=`linear`,Jt=`srgb`,Yt=7680,Xt=7681,Zt=7682,Qt=7683,$t=34055,en=34056,tn=5386,nn=35044,rn=35048,an=35040,on=35045,sn=35049,cn=35041,ln=35046,un=35050,dn=35042,fn=`300 es`,pn=2e3,mn=2001,hn={COMPUTE:`compute`,RENDER:`render`},gn={PERSPECTIVE:`perspective`,LINEAR:`linear`,FLAT:`flat`},_n={NORMAL:`normal`,CENTROID:`centroid`,SAMPLE:`sample`,FIRST:`first`,EITHER:`either`};function vn(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}var yn={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function bn(e,t){return new yn[e](t)}function xn(e){return document.createElementNS(`http://www.w3.org/1999/xhtml`,e)}function Sn(){let e=xn(`canvas`);return e.style.display=`block`,e}var Cn={},wn=null;function Tn(e){wn=e}function En(){return wn}function Dn(...e){let t=`THREE.`+e.shift();wn?wn(`log`,t,...e):console.log(t,...e)}function R(...e){let t=`THREE.`+e.shift();wn?wn(`warn`,t,...e):console.warn(t,...e)}function z(...e){let t=`THREE.`+e.shift();wn?wn(`error`,t,...e):console.error(t,...e)}function On(...e){let t=e.join(` `);t in Cn||(Cn[t]=!0,R(...e))}function kn(e,t,n){return new Promise(function(r,i){function a(){switch(e.clientWaitSync(t,e.SYNC_FLUSH_COMMANDS_BIT,0)){case e.WAIT_FAILED:i();break;case e.TIMEOUT_EXPIRED:setTimeout(a,n);break;default:r()}}setTimeout(a,n)})}var An=class{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});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===void 0?!1:n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){let n=this._listeners;if(n===void 0)return;let r=n[e];if(r!==void 0){let e=r.indexOf(t);e!==-1&&r.splice(e,1)}}dispatchEvent(e){let t=this._listeners;if(t===void 0)return;let n=t[e.type];if(n!==void 0){e.target=this;let t=n.slice(0);for(let n=0,r=t.length;n>8&255]+jn[e>>16&255]+jn[e>>24&255]+`-`+jn[t&255]+jn[t>>8&255]+`-`+jn[t>>16&15|64]+jn[t>>24&255]+`-`+jn[n&63|128]+jn[n>>8&255]+`-`+jn[n>>16&255]+jn[n>>24&255]+jn[r&255]+jn[r>>8&255]+jn[r>>16&255]+jn[r>>24&255]).toLowerCase()}function B(e,t,n){return Math.max(t,Math.min(n,e))}function In(e,t){return(e%t+t)%t}function Ln(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)}function Rn(e,t,n){return e===t?0:(n-e)/(t-e)}function zn(e,t,n){return(1-n)*e+n*t}function Bn(e,t,n,r){return zn(e,t,1-Math.exp(-n*r))}function Vn(e,t=1){return t-Math.abs(In(e,t*2)-t)}function Hn(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t),e*e*(3-2*e))}function Un(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t),e*e*e*(e*(e*6-15)+10))}function Wn(e,t){return e+Math.floor(Math.random()*(t-e+1))}function Gn(e,t){return e+Math.random()*(t-e)}function Kn(e){return e*(.5-Math.random())}function qn(e){e!==void 0&&(Mn=e);let t=Mn+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function Jn(e){return e*Nn}function Yn(e){return e*Pn}function Xn(e){return(e&e-1)==0&&e!==0}function Zn(e){return 2**Math.ceil(Math.log(e)/Math.LN2)}function Qn(e){return 2**Math.floor(Math.log(e)/Math.LN2)}function $n(e,t,n,r,i){let a=Math.cos,o=Math.sin,s=a(n/2),c=o(n/2),l=a((t+r)/2),u=o((t+r)/2),d=a((t-r)/2),f=o((t-r)/2),p=a((r-t)/2),m=o((r-t)/2);switch(i){case`XYX`:e.set(s*u,c*d,c*f,s*l);break;case`YZY`:e.set(c*f,s*u,c*d,s*l);break;case`ZXZ`:e.set(c*d,c*f,s*u,s*l);break;case`XZX`:e.set(s*u,c*m,c*p,s*l);break;case`YXY`:e.set(c*p,s*u,c*m,s*l);break;case`ZYZ`:e.set(c*m,c*p,s*u,s*l);break;default:R(`MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: `+i)}}function er(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return e/4294967295;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int32Array:return Math.max(e/2147483647,-1);case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw Error(`Invalid component type.`)}}function V(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return Math.round(e*4294967295);case Uint16Array:return Math.round(e*65535);case Uint8Array:return Math.round(e*255);case Int32Array:return Math.round(e*2147483647);case Int16Array:return Math.round(e*32767);case Int8Array:return Math.round(e*127);default:throw Error(`Invalid component type.`)}}var tr={DEG2RAD:Nn,RAD2DEG:Pn,generateUUID:Fn,clamp:B,euclideanModulo:In,mapLinear:Ln,inverseLerp:Rn,lerp:zn,damp:Bn,pingpong:Vn,smoothstep:Hn,smootherstep:Un,randInt:Wn,randFloat:Gn,randFloatSpread:Kn,seededRandom:qn,degToRad:Jn,radToDeg:Yn,isPowerOfTwo:Xn,ceilPowerOfTwo:Zn,floorPowerOfTwo:Qn,setQuaternionFromProperEuler:$n,normalize:V,denormalize:er},H=class e{constructor(t=0,n=0){e.prototype.isVector2=!0,this.x=t,this.y=n}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw Error(`index is out of range: `+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw Error(`index is out of range: `+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=B(this.x,e.x,t.x),this.y=B(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=B(this.x,e,t),this.y=B(this.y,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(B(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(B(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){let n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,a=this.y-e.y;return this.x=i*n-a*r+e.x,this.y=i*r+a*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},nr=class{constructor(e=0,t=0,n=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=r}static slerpFlat(e,t,n,r,i,a,o){let s=n[r+0],c=n[r+1],l=n[r+2],u=n[r+3],d=i[a+0],f=i[a+1],p=i[a+2],m=i[a+3];if(o<=0){e[t+0]=s,e[t+1]=c,e[t+2]=l,e[t+3]=u;return}if(o>=1){e[t+0]=d,e[t+1]=f,e[t+2]=p,e[t+3]=m;return}if(u!==m||s!==d||c!==f||l!==p){let e=s*d+c*f+l*p+u*m;e<0&&(d=-d,f=-f,p=-p,m=-m,e=-e);let t=1-o;if(e<.9995){let n=Math.acos(e),r=Math.sin(n);t=Math.sin(t*n)/r,o=Math.sin(o*n)/r,s=s*t+d*o,c=c*t+f*o,l=l*t+p*o,u=u*t+m*o}else{s=s*t+d*o,c=c*t+f*o,l=l*t+p*o,u=u*t+m*o;let e=1/Math.sqrt(s*s+c*c+l*l+u*u);s*=e,c*=e,l*=e,u*=e}}e[t]=s,e[t+1]=c,e[t+2]=l,e[t+3]=u}static multiplyQuaternionsFlat(e,t,n,r,i,a){let o=n[r],s=n[r+1],c=n[r+2],l=n[r+3],u=i[a],d=i[a+1],f=i[a+2],p=i[a+3];return e[t]=o*p+l*u+s*f-c*d,e[t+1]=s*p+l*d+c*u-o*f,e[t+2]=c*p+l*f+o*d-s*u,e[t+3]=l*p-o*u-s*d-c*f,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){let n=e._x,r=e._y,i=e._z,a=e._order,o=Math.cos,s=Math.sin,c=o(n/2),l=o(r/2),u=o(i/2),d=s(n/2),f=s(r/2),p=s(i/2);switch(a){case`XYZ`:this._x=d*l*u+c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u-d*f*p;break;case`YXZ`:this._x=d*l*u+c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u+d*f*p;break;case`ZXY`:this._x=d*l*u-c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u-d*f*p;break;case`ZYX`:this._x=d*l*u-c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u+d*f*p;break;case`YZX`:this._x=d*l*u+c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u-d*f*p;break;case`XZY`:this._x=d*l*u-c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u+d*f*p;break;default:R(`Quaternion: .setFromEuler() encountered an unknown order: `+a)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,n=t[0],r=t[4],i=t[8],a=t[1],o=t[5],s=t[9],c=t[2],l=t[6],u=t[10],d=n+o+u;if(d>0){let e=.5/Math.sqrt(d+1);this._w=.25/e,this._x=(l-s)*e,this._y=(i-c)*e,this._z=(a-r)*e}else if(n>o&&n>u){let e=2*Math.sqrt(1+n-o-u);this._w=(l-s)/e,this._x=.25*e,this._y=(r+a)/e,this._z=(i+c)/e}else if(o>u){let e=2*Math.sqrt(1+o-n-u);this._w=(i-c)/e,this._x=(r+a)/e,this._y=.25*e,this._z=(s+l)/e}else{let e=2*Math.sqrt(1+u-n-o);this._w=(a-r)/e,this._x=(i+c)/e,this._y=(s+l)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<1e-8?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(B(this.dot(e),-1,1)))}rotateTowards(e,t){let n=this.angleTo(e);if(n===0)return this;let r=Math.min(1,t/n);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x*=e,this._y*=e,this._z*=e,this._w*=e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let n=e._x,r=e._y,i=e._z,a=e._w,o=t._x,s=t._y,c=t._z,l=t._w;return this._x=n*l+a*o+r*c-i*s,this._y=r*l+a*s+i*o-n*c,this._z=i*l+a*c+n*s-r*o,this._w=a*l-n*o-r*s-i*c,this._onChangeCallback(),this}slerp(e,t){if(t<=0)return this;if(t>=1)return this.copy(e);let n=e._x,r=e._y,i=e._z,a=e._w,o=this.dot(e);o<0&&(n=-n,r=-r,i=-i,a=-a,o=-o);let s=1-t;if(o<.9995){let e=Math.acos(o),c=Math.sin(e);s=Math.sin(s*e)/c,t=Math.sin(t*e)/c,this._x=this._x*s+n*t,this._y=this._y*s+r*t,this._z=this._z*s+i*t,this._w=this._w*s+a*t,this._onChangeCallback()}else this._x=this._x*s+n*t,this._y=this._y*s+r*t,this._z=this._z*s+i*t,this._w=this._w*s+a*t,this.normalize();return this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){let e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),r=Math.sqrt(1-n),i=Math.sqrt(n);return this.set(r*Math.sin(e),r*Math.cos(e),i*Math.sin(t),i*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}},U=class e{constructor(t=0,n=0,r=0){e.prototype.isVector3=!0,this.x=t,this.y=n,this.z=r}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw Error(`index is out of range: `+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error(`index is out of range: `+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(ir.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(ir.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,n=this.y,r=this.z,i=e.elements,a=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*a,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*a,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*a,this}applyQuaternion(e){let t=this.x,n=this.y,r=this.z,i=e.x,a=e.y,o=e.z,s=e.w,c=2*(a*r-o*n),l=2*(o*t-i*r),u=2*(i*n-a*t);return this.x=t+s*c+a*u-o*l,this.y=n+s*l+o*c-i*u,this.z=r+s*u+i*l-a*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=B(this.x,e.x,t.x),this.y=B(this.y,e.y,t.y),this.z=B(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=B(this.x,e,t),this.y=B(this.y,e,t),this.z=B(this.z,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(B(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){let n=e.x,r=e.y,i=e.z,a=t.x,o=t.y,s=t.z;return this.x=r*s-i*o,this.y=i*a-n*s,this.z=n*o-r*a,this}projectOnVector(e){let t=e.lengthSq();if(t===0)return this.set(0,0,0);let n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return rr.copy(this).projectOnVector(e),this.sub(rr)}reflect(e){return this.sub(rr.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(B(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){let r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let e=Math.random()*Math.PI*2,t=Math.random()*2-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}},rr=new U,ir=new nr,W=class e{constructor(t,n,r,i,a,o,s,c,l){e.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,n,r,i,a,o,s,c,l)}set(e,t,n,r,i,a,o,s,c){let l=this.elements;return l[0]=e,l[1]=r,l[2]=o,l[3]=t,l[4]=i,l[5]=s,l[6]=n,l[7]=a,l[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[3],s=n[6],c=n[1],l=n[4],u=n[7],d=n[2],f=n[5],p=n[8],m=r[0],h=r[3],g=r[6],_=r[1],v=r[4],y=r[7],b=r[2],x=r[5],S=r[8];return i[0]=a*m+o*_+s*b,i[3]=a*h+o*v+s*x,i[6]=a*g+o*y+s*S,i[1]=c*m+l*_+u*b,i[4]=c*h+l*v+u*x,i[7]=c*g+l*y+u*S,i[2]=d*m+f*_+p*b,i[5]=d*h+f*v+p*x,i[8]=d*g+f*y+p*S,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8];return t*a*l-t*o*c-n*i*l+n*o*s+r*i*c-r*a*s}invert(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8],u=l*a-o*c,d=o*s-l*i,f=c*i-a*s,p=t*u+n*d+r*f;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);let m=1/p;return e[0]=u*m,e[1]=(r*c-l*n)*m,e[2]=(o*n-r*a)*m,e[3]=d*m,e[4]=(l*t-r*s)*m,e[5]=(r*i-o*t)*m,e[6]=f*m,e[7]=(n*s-c*t)*m,e[8]=(a*t-n*i)*m,this}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,r,i,a,o){let s=Math.cos(i),c=Math.sin(i);return this.set(n*s,n*c,-n*(s*a+c*o)+a+e,-r*c,r*s,-r*(-c*a+s*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(ar.makeScale(e,t)),this}rotate(e){return this.premultiply(ar.makeRotation(-e)),this}translate(e,t){return this.premultiply(ar.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){let t=this.elements,n=e.elements;for(let e=0;e<9;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}},ar=new W,or=new W().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),sr=new W().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function cr(){let e={enabled:!0,workingColorSpace:Kt,spaces:{},convert:function(e,t,n){return this.enabled===!1||t===n||!t||!n?e:(this.spaces[t].transfer===`srgb`&&(e.r=lr(e.r),e.g=lr(e.g),e.b=lr(e.b)),this.spaces[t].primaries!==this.spaces[n].primaries&&(e.applyMatrix3(this.spaces[t].toXYZ),e.applyMatrix3(this.spaces[n].fromXYZ)),this.spaces[n].transfer===`srgb`&&(e.r=ur(e.r),e.g=ur(e.g),e.b=ur(e.b)),e)},workingToColorSpace:function(e,t){return this.convert(e,this.workingColorSpace,t)},colorSpaceToWorking:function(e,t){return this.convert(e,t,this.workingColorSpace)},getPrimaries:function(e){return this.spaces[e].primaries},getTransfer:function(e){return e===``?qt:this.spaces[e].transfer},getToneMappingMode:function(e){return this.spaces[e].outputColorSpaceConfig.toneMappingMode||`standard`},getLuminanceCoefficients:function(e,t=this.workingColorSpace){return e.fromArray(this.spaces[t].luminanceCoefficients)},define:function(e){Object.assign(this.spaces,e)},_getMatrix:function(e,t,n){return e.copy(this.spaces[t].toXYZ).multiply(this.spaces[n].fromXYZ)},_getDrawingBufferColorSpace:function(e){return this.spaces[e].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(e=this.workingColorSpace){return this.spaces[e].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(t,n){return On(`ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace().`),e.workingToColorSpace(t,n)},toWorkingColorSpace:function(t,n){return On(`ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking().`),e.colorSpaceToWorking(t,n)}},t=[.64,.33,.3,.6,.15,.06],n=[.2126,.7152,.0722],r=[.3127,.329];return e.define({[Kt]:{primaries:t,whitePoint:r,transfer:qt,toXYZ:or,fromXYZ:sr,luminanceCoefficients:n,workingColorSpaceConfig:{unpackColorSpace:Gt},outputColorSpaceConfig:{drawingBufferColorSpace:Gt}},[Gt]:{primaries:t,whitePoint:r,transfer:Jt,toXYZ:or,fromXYZ:sr,luminanceCoefficients:n,outputColorSpaceConfig:{drawingBufferColorSpace:Gt}}}),e}var G=cr();function lr(e){return e<.04045?e*.0773993808:(e*.9478672986+.0521327014)**2.4}function ur(e){return e<.0031308?e*12.92:1.055*e**.41666-.055}var dr,fr=class{static getDataURL(e,t=`image/png`){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>`u`)return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{dr===void 0&&(dr=xn(`canvas`)),dr.width=e.width,dr.height=e.height;let t=dr.getContext(`2d`);e instanceof ImageData?t.putImageData(e,0,0):t.drawImage(e,0,0,e.width,e.height),n=dr}return n.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||typeof ImageBitmap<`u`&&e instanceof ImageBitmap){let t=xn(`canvas`);t.width=e.width,t.height=e.height;let n=t.getContext(`2d`);n.drawImage(e,0,0,e.width,e.height);let r=n.getImageData(0,0,e.width,e.height),i=r.data;for(let e=0;e1),this.pmremVersion=0}get width(){return this.source.getSize(_r).x}get height(){return this.source.getSize(_r).y}get depth(){return this.source.getSize(_r).z}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(let t in e){let n=e[t];if(n===void 0){R(`Texture.setValues(): parameter '${t}' has value of undefined.`);continue}let r=this[t];if(r===void 0){R(`Texture.setValues(): property '${t}' does not exist.`);continue}r&&n&&r.isVector2&&n.isVector2||r&&n&&r.isVector3&&n.isVector3||r&&n&&r.isMatrix3&&n.isMatrix3?r.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e==`string`;if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];let n={metadata:{version:4.7,type:`Texture`,generator:`Texture.toJSON`},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:`dispose`})}transformUv(e){if(this.mapping!==300)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case me:e.x-=Math.floor(e.x);break;case he:e.x=e.x<0?0:1;break;case P:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x-=Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case me:e.y-=Math.floor(e.y);break;case he:e.y=e.y<0?0:1;break;case P:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y-=Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}};vr.DEFAULT_IMAGE=null,vr.DEFAULT_MAPPING=300,vr.DEFAULT_ANISOTROPY=1;var yr=class e{constructor(t=0,n=0,r=0,i=1){e.prototype.isVector4=!0,this.x=t,this.y=n,this.z=r,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw Error(`index is out of range: `+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error(`index is out of range: `+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w===void 0?1:e.w,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){let t=this.x,n=this.y,r=this.z,i=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*r+a[12]*i,this.y=a[1]*t+a[5]*n+a[9]*r+a[13]*i,this.z=a[2]*t+a[6]*n+a[10]*r+a[14]*i,this.w=a[3]*t+a[7]*n+a[11]*r+a[15]*i,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,r,i,a=.01,o=.1,s=e.elements,c=s[0],l=s[4],u=s[8],d=s[1],f=s[5],p=s[9],m=s[2],h=s[6],g=s[10];if(Math.abs(l-d)s&&e>_?e_?s1);this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,n=e.textures.length;t=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,Or),Or.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Ir),Lr.subVectors(this.max,Ir),Ar.subVectors(e.a,Ir),jr.subVectors(e.b,Ir),Mr.subVectors(e.c,Ir),Nr.subVectors(jr,Ar),Pr.subVectors(Mr,jr),Fr.subVectors(Ar,Mr);let t=[0,-Nr.z,Nr.y,0,-Pr.z,Pr.y,0,-Fr.z,Fr.y,Nr.z,0,-Nr.x,Pr.z,0,-Pr.x,Fr.z,0,-Fr.x,-Nr.y,Nr.x,0,-Pr.y,Pr.x,0,-Fr.y,Fr.x,0];return!Br(t,Ar,jr,Mr,Lr)||(t=[1,0,0,0,1,0,0,0,1],!Br(t,Ar,jr,Mr,Lr))?!1:(Rr.crossVectors(Nr,Pr),t=[Rr.x,Rr.y,Rr.z],Br(t,Ar,jr,Mr,Lr))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Or).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Or).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(Dr[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Dr[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Dr[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Dr[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Dr[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Dr[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Dr[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Dr[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Dr),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}},Dr=[new U,new U,new U,new U,new U,new U,new U,new U],Or=new U,kr=new Er,Ar=new U,jr=new U,Mr=new U,Nr=new U,Pr=new U,Fr=new U,Ir=new U,Lr=new U,Rr=new U,zr=new U;function Br(e,t,n,r,i){for(let a=0,o=e.length-3;a<=o;a+=3){zr.fromArray(e,a);let o=i.x*Math.abs(zr.x)+i.y*Math.abs(zr.y)+i.z*Math.abs(zr.z),s=t.dot(zr),c=n.dot(zr),l=r.dot(zr);if(Math.max(-Math.max(s,c,l),Math.min(s,c,l))>o)return!1}return!0}var Vr=new Er,Hr=new U,Ur=new U,Wr=class{constructor(e=new U,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){let n=this.center;t===void 0?Vr.setFromPoints(e).getCenter(n):n.copy(t);let r=0;for(let t=0,i=e.length;tthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius*=e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;Hr.subVectors(e,this.center);let t=Hr.lengthSq();if(t>this.radius*this.radius){let e=Math.sqrt(t),n=(e-this.radius)*.5;this.center.addScaledVector(Hr,n/e),this.radius+=n}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(Ur.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Hr.copy(e.center).add(Ur)),this.expandByPoint(Hr.copy(e.center).sub(Ur))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}},Gr=new U,Kr=new U,qr=new U,Jr=new U,Yr=new U,Xr=new U,Zr=new U,Qr=class{constructor(e=new U,t=new U(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Gr)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=Gr.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Gr.copy(this.origin).addScaledVector(this.direction,t),Gr.distanceToSquared(e))}distanceSqToSegment(e,t,n,r){Kr.copy(e).add(t).multiplyScalar(.5),qr.copy(t).sub(e).normalize(),Jr.copy(this.origin).sub(Kr);let i=e.distanceTo(t)*.5,a=-this.direction.dot(qr),o=Jr.dot(this.direction),s=-Jr.dot(qr),c=Jr.lengthSq(),l=Math.abs(1-a*a),u,d,f,p;if(l>0)if(u=a*s-o,d=a*o-s,p=i*l,u>=0)if(d>=-p)if(d<=p){let e=1/l;u*=e,d*=e,f=u*(u+a*d+2*o)+d*(a*u+d+2*s)+c}else d=i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c;else d=-i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c;else d<=-p?(u=Math.max(0,-(-a*i+o)),d=u>0?-i:Math.min(Math.max(-i,-s),i),f=-u*u+d*(d+2*s)+c):d<=p?(u=0,d=Math.min(Math.max(-i,-s),i),f=d*(d+2*s)+c):(u=Math.max(0,-(a*i+o)),d=u>0?i:Math.min(Math.max(-i,-s),i),f=-u*u+d*(d+2*s)+c);else d=a>0?-i:i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,u),r&&r.copy(Kr).addScaledVector(qr,d),f}intersectSphere(e,t){Gr.subVectors(e.center,this.origin);let n=Gr.dot(this.direction),r=Gr.dot(Gr)-n*n,i=e.radius*e.radius;if(r>i)return null;let a=Math.sqrt(i-r),o=n-a,s=n+a;return s<0?null:o<0?this.at(s,t):this.at(o,t)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;let n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){let n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,r,i,a,o,s,c=1/this.direction.x,l=1/this.direction.y,u=1/this.direction.z,d=this.origin;return c>=0?(n=(e.min.x-d.x)*c,r=(e.max.x-d.x)*c):(n=(e.max.x-d.x)*c,r=(e.min.x-d.x)*c),l>=0?(i=(e.min.y-d.y)*l,a=(e.max.y-d.y)*l):(i=(e.max.y-d.y)*l,a=(e.min.y-d.y)*l),n>a||i>r||((i>n||isNaN(n))&&(n=i),(a=0?(o=(e.min.z-d.z)*u,s=(e.max.z-d.z)*u):(o=(e.max.z-d.z)*u,s=(e.min.z-d.z)*u),n>s||o>r)||((o>n||n!==n)&&(n=o),(s=0?n:r,t)}intersectsBox(e){return this.intersectBox(e,Gr)!==null}intersectTriangle(e,t,n,r,i){Yr.subVectors(t,e),Xr.subVectors(n,e),Zr.crossVectors(Yr,Xr);let a=this.direction.dot(Zr),o;if(a>0){if(r)return null;o=1}else if(a<0)o=-1,a=-a;else return null;Jr.subVectors(this.origin,e);let s=o*this.direction.dot(Xr.crossVectors(Jr,Xr));if(s<0)return null;let c=o*this.direction.dot(Yr.cross(Jr));if(c<0||s+c>a)return null;let l=-o*Jr.dot(Zr);return l<0?null:this.at(l/a,i)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}},K=class e{constructor(t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g){e.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!==void 0&&this.set(t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g)}set(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){let g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=r,g[1]=i,g[5]=a,g[9]=o,g[13]=s,g[2]=c,g[6]=l,g[10]=u,g[14]=d,g[3]=f,g[7]=p,g[11]=m,g[15]=h,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new e().fromArray(this.elements)}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){let t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){let t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){let t=this.elements,n=e.elements,r=1/$r.setFromMatrixColumn(e,0).length(),i=1/$r.setFromMatrixColumn(e,1).length(),a=1/$r.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*i,t[5]=n[5]*i,t[6]=n[6]*i,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){let t=this.elements,n=e.x,r=e.y,i=e.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(r),c=Math.sin(r),l=Math.cos(i),u=Math.sin(i);if(e.order===`XYZ`){let e=a*l,n=a*u,r=o*l,i=o*u;t[0]=s*l,t[4]=-s*u,t[8]=c,t[1]=n+r*c,t[5]=e-i*c,t[9]=-o*s,t[2]=i-e*c,t[6]=r+n*c,t[10]=a*s}else if(e.order===`YXZ`){let e=s*l,n=s*u,r=c*l,i=c*u;t[0]=e+i*o,t[4]=r*o-n,t[8]=a*c,t[1]=a*u,t[5]=a*l,t[9]=-o,t[2]=n*o-r,t[6]=i+e*o,t[10]=a*s}else if(e.order===`ZXY`){let e=s*l,n=s*u,r=c*l,i=c*u;t[0]=e-i*o,t[4]=-a*u,t[8]=r+n*o,t[1]=n+r*o,t[5]=a*l,t[9]=i-e*o,t[2]=-a*c,t[6]=o,t[10]=a*s}else if(e.order===`ZYX`){let e=a*l,n=a*u,r=o*l,i=o*u;t[0]=s*l,t[4]=r*c-n,t[8]=e*c+i,t[1]=s*u,t[5]=i*c+e,t[9]=n*c-r,t[2]=-c,t[6]=o*s,t[10]=a*s}else if(e.order===`YZX`){let e=a*s,n=a*c,r=o*s,i=o*c;t[0]=s*l,t[4]=i-e*u,t[8]=r*u+n,t[1]=u,t[5]=a*l,t[9]=-o*l,t[2]=-c*l,t[6]=n*u+r,t[10]=e-i*u}else if(e.order===`XZY`){let e=a*s,n=a*c,r=o*s,i=o*c;t[0]=s*l,t[4]=-u,t[8]=c*l,t[1]=e*u+i,t[5]=a*l,t[9]=n*u-r,t[2]=r*u-n,t[6]=o*l,t[10]=i*u+e}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(ti,e,ni)}lookAt(e,t,n){let r=this.elements;return ai.subVectors(e,t),ai.lengthSq()===0&&(ai.z=1),ai.normalize(),ri.crossVectors(n,ai),ri.lengthSq()===0&&(Math.abs(n.z)===1?ai.x+=1e-4:ai.z+=1e-4,ai.normalize(),ri.crossVectors(n,ai)),ri.normalize(),ii.crossVectors(ai,ri),r[0]=ri.x,r[4]=ii.x,r[8]=ai.x,r[1]=ri.y,r[5]=ii.y,r[9]=ai.y,r[2]=ri.z,r[6]=ii.z,r[10]=ai.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[4],s=n[8],c=n[12],l=n[1],u=n[5],d=n[9],f=n[13],p=n[2],m=n[6],h=n[10],g=n[14],_=n[3],v=n[7],y=n[11],b=n[15],x=r[0],S=r[4],C=r[8],w=r[12],T=r[1],E=r[5],D=r[9],O=r[13],k=r[2],A=r[6],j=r[10],M=r[14],ee=r[3],te=r[7],N=r[11],ne=r[15];return i[0]=a*x+o*T+s*k+c*ee,i[4]=a*S+o*E+s*A+c*te,i[8]=a*C+o*D+s*j+c*N,i[12]=a*w+o*O+s*M+c*ne,i[1]=l*x+u*T+d*k+f*ee,i[5]=l*S+u*E+d*A+f*te,i[9]=l*C+u*D+d*j+f*N,i[13]=l*w+u*O+d*M+f*ne,i[2]=p*x+m*T+h*k+g*ee,i[6]=p*S+m*E+h*A+g*te,i[10]=p*C+m*D+h*j+g*N,i[14]=p*w+m*O+h*M+g*ne,i[3]=_*x+v*T+y*k+b*ee,i[7]=_*S+v*E+y*A+b*te,i[11]=_*C+v*D+y*j+b*N,i[15]=_*w+v*O+y*M+b*ne,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],a=e[1],o=e[5],s=e[9],c=e[13],l=e[2],u=e[6],d=e[10],f=e[14],p=e[3],m=e[7],h=e[11],g=e[15];return p*(+i*s*u-r*c*u-i*o*d+n*c*d+r*o*f-n*s*f)+m*(+t*s*f-t*c*d+i*a*d-r*a*f+r*c*l-i*s*l)+h*(+t*c*u-t*o*f-i*a*u+n*a*f+i*o*l-n*c*l)+g*(-r*o*l-t*s*u+t*o*d+r*a*u-n*a*d+n*s*l)}transpose(){let e=this.elements,t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){let r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this}invert(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8],u=e[9],d=e[10],f=e[11],p=e[12],m=e[13],h=e[14],g=e[15],_=u*h*c-m*d*c+m*s*f-o*h*f-u*s*g+o*d*g,v=p*d*c-l*h*c-p*s*f+a*h*f+l*s*g-a*d*g,y=l*m*c-p*u*c+p*o*f-a*m*f-l*o*g+a*u*g,b=p*u*s-l*m*s-p*o*d+a*m*d+l*o*h-a*u*h,x=t*_+n*v+r*y+i*b;if(x===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let S=1/x;return e[0]=_*S,e[1]=(m*d*i-u*h*i-m*r*f+n*h*f+u*r*g-n*d*g)*S,e[2]=(o*h*i-m*s*i+m*r*c-n*h*c-o*r*g+n*s*g)*S,e[3]=(u*s*i-o*d*i-u*r*c+n*d*c+o*r*f-n*s*f)*S,e[4]=v*S,e[5]=(l*h*i-p*d*i+p*r*f-t*h*f-l*r*g+t*d*g)*S,e[6]=(p*s*i-a*h*i-p*r*c+t*h*c+a*r*g-t*s*g)*S,e[7]=(a*d*i-l*s*i+l*r*c-t*d*c-a*r*f+t*s*f)*S,e[8]=y*S,e[9]=(p*u*i-l*m*i-p*n*f+t*m*f+l*n*g-t*u*g)*S,e[10]=(a*m*i-p*o*i+p*n*c-t*m*c-a*n*g+t*o*g)*S,e[11]=(l*o*i-a*u*i-l*n*c+t*u*c+a*n*f-t*o*f)*S,e[12]=b*S,e[13]=(l*m*r-p*u*r+p*n*d-t*m*d-l*n*h+t*u*h)*S,e[14]=(p*o*r-a*m*r-p*n*s+t*m*s+a*n*h-t*o*h)*S,e[15]=(a*u*r-l*o*r+l*n*s-t*u*s-a*n*d+t*o*d)*S,this}scale(e){let t=this.elements,n=e.x,r=e.y,i=e.z;return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,this}getMaxScaleOnAxis(){let e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let n=Math.cos(t),r=Math.sin(t),i=1-n,a=e.x,o=e.y,s=e.z,c=i*a,l=i*o;return this.set(c*a+n,c*o-r*s,c*s+r*o,0,c*o+r*s,l*o+n,l*s-r*a,0,c*s-r*o,l*s+r*a,i*s*s+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,r,i,a){return this.set(1,n,i,0,e,1,a,0,t,r,1,0,0,0,0,1),this}compose(e,t,n){let r=this.elements,i=t._x,a=t._y,o=t._z,s=t._w,c=i+i,l=a+a,u=o+o,d=i*c,f=i*l,p=i*u,m=a*l,h=a*u,g=o*u,_=s*c,v=s*l,y=s*u,b=n.x,x=n.y,S=n.z;return r[0]=(1-(m+g))*b,r[1]=(f+y)*b,r[2]=(p-v)*b,r[3]=0,r[4]=(f-y)*x,r[5]=(1-(d+g))*x,r[6]=(h+_)*x,r[7]=0,r[8]=(p+v)*S,r[9]=(h-_)*S,r[10]=(1-(d+m))*S,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,n){let r=this.elements,i=$r.set(r[0],r[1],r[2]).length(),a=$r.set(r[4],r[5],r[6]).length(),o=$r.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),e.x=r[12],e.y=r[13],e.z=r[14],ei.copy(this);let s=1/i,c=1/a,l=1/o;return ei.elements[0]*=s,ei.elements[1]*=s,ei.elements[2]*=s,ei.elements[4]*=c,ei.elements[5]*=c,ei.elements[6]*=c,ei.elements[8]*=l,ei.elements[9]*=l,ei.elements[10]*=l,t.setFromRotationMatrix(ei),n.x=i,n.y=a,n.z=o,this}makePerspective(e,t,n,r,i,a,o=pn,s=!1){let c=this.elements,l=2*i/(t-e),u=2*i/(n-r),d=(t+e)/(t-e),f=(n+r)/(n-r),p,m;if(s)p=i/(a-i),m=a*i/(a-i);else if(o===2e3)p=-(a+i)/(a-i),m=-2*a*i/(a-i);else if(o===2001)p=-a/(a-i),m=-a*i/(a-i);else throw Error(`THREE.Matrix4.makePerspective(): Invalid coordinate system: `+o);return c[0]=l,c[4]=0,c[8]=d,c[12]=0,c[1]=0,c[5]=u,c[9]=f,c[13]=0,c[2]=0,c[6]=0,c[10]=p,c[14]=m,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(e,t,n,r,i,a,o=pn,s=!1){let c=this.elements,l=2/(t-e),u=2/(n-r),d=-(t+e)/(t-e),f=-(n+r)/(n-r),p,m;if(s)p=1/(a-i),m=a/(a-i);else if(o===2e3)p=-2/(a-i),m=-(a+i)/(a-i);else if(o===2001)p=-1/(a-i),m=-i/(a-i);else throw Error(`THREE.Matrix4.makeOrthographic(): Invalid coordinate system: `+o);return c[0]=l,c[4]=0,c[8]=0,c[12]=d,c[1]=0,c[5]=u,c[9]=0,c[13]=f,c[2]=0,c[6]=0,c[10]=p,c[14]=m,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(e){let t=this.elements,n=e.elements;for(let e=0;e<16;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}},$r=new U,ei=new K,ti=new U(0,0,0),ni=new U(1,1,1),ri=new U,ii=new U,ai=new U,oi=new K,si=new nr,ci=class e{constructor(t=0,n=0,r=0,i=e.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=n,this._z=r,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,r=this._order){return this._x=e,this._y=t,this._z=n,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){let r=e.elements,i=r[0],a=r[4],o=r[8],s=r[1],c=r[5],l=r[9],u=r[2],d=r[6],f=r[10];switch(t){case`XYZ`:this._y=Math.asin(B(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-l,f),this._z=Math.atan2(-a,i)):(this._x=Math.atan2(d,c),this._z=0);break;case`YXZ`:this._x=Math.asin(-B(l,-1,1)),Math.abs(l)<.9999999?(this._y=Math.atan2(o,f),this._z=Math.atan2(s,c)):(this._y=Math.atan2(-u,i),this._z=0);break;case`ZXY`:this._x=Math.asin(B(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-u,f),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(s,i));break;case`ZYX`:this._y=Math.asin(-B(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(d,f),this._z=Math.atan2(s,i)):(this._x=0,this._z=Math.atan2(-a,c));break;case`YZX`:this._z=Math.asin(B(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-l,c),this._y=Math.atan2(-u,i)):(this._x=0,this._y=Math.atan2(o,f));break;case`XZY`:this._z=Math.asin(-B(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(o,i)):(this._x=Math.atan2(-l,f),this._y=0);break;default:R(`Euler: .setFromRotationMatrix() encountered an unknown order: `+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return oi.makeRotationFromQuaternion(e),this.setFromRotationMatrix(oi,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return si.setFromEuler(this),this.setFromQuaternion(si,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}};ci.DEFAULT_ORDER=`XYZ`;var li=class{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let e=0;e1){for(let e=0;e0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type=`InstancedMesh`,r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type=`BatchedMesh`,r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.geometryInfo=this._geometryInfo.map(e=>({...e,boundingBox:e.boundingBox?e.boundingBox.toJSON():void 0,boundingSphere:e.boundingSphere?e.boundingSphere.toJSON():void 0})),r.instanceInfo=this._instanceInfo.map(e=>({...e})),r.availableInstanceIds=this._availableInstanceIds.slice(),r.availableGeometryIds=this._availableGeometryIds.slice(),r.nextIndexStart=this._nextIndexStart,r.nextVertexStart=this._nextVertexStart,r.geometryCount=this._geometryCount,r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.matricesTexture=this._matricesTexture.toJSON(e),r.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(r.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(r.boundingBox=this.boundingBox.toJSON()));function i(t,n){return t[n.uuid]===void 0&&(t[n.uuid]=n.toJSON(e)),n.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=i(e.geometries,this.geometry);let t=this.geometry.parameters;if(t!==void 0&&t.shapes!==void 0){let n=t.shapes;if(Array.isArray(n))for(let t=0,r=n.length;t0){r.children=[];for(let t=0;t0){r.animations=[];for(let t=0;t0&&(n.geometries=t),r.length>0&&(n.materials=r),i.length>0&&(n.textures=i),o.length>0&&(n.images=o),s.length>0&&(n.shapes=s),c.length>0&&(n.skeletons=c),l.length>0&&(n.animations=l),u.length>0&&(n.nodes=u)}return n.object=r,n;function a(e){let t=[];for(let n in e){let r=e[n];delete r.metadata,t.push(r)}return t}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let t=0;t0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}static getBarycoord(e,t,n,r,i){Ei.subVectors(r,t),Di.subVectors(n,t),Oi.subVectors(e,t);let a=Ei.dot(Ei),o=Ei.dot(Di),s=Ei.dot(Oi),c=Di.dot(Di),l=Di.dot(Oi),u=a*c-o*o;if(u===0)return i.set(0,0,0),null;let d=1/u,f=(c*s-o*l)*d,p=(a*l-o*s)*d;return i.set(1-f-p,p,f)}static containsPoint(e,t,n,r){return this.getBarycoord(e,t,n,r,ki)===null?!1:ki.x>=0&&ki.y>=0&&ki.x+ki.y<=1}static getInterpolation(e,t,n,r,i,a,o,s){return this.getBarycoord(e,t,n,r,ki)===null?(s.x=0,s.y=0,`z`in s&&(s.z=0),`w`in s&&(s.w=0),null):(s.setScalar(0),s.addScaledVector(i,ki.x),s.addScaledVector(a,ki.y),s.addScaledVector(o,ki.z),s)}static getInterpolatedAttribute(e,t,n,r,i,a){return Ii.setScalar(0),Li.setScalar(0),Ri.setScalar(0),Ii.fromBufferAttribute(e,t),Li.fromBufferAttribute(e,n),Ri.fromBufferAttribute(e,r),a.setScalar(0),a.addScaledVector(Ii,i.x),a.addScaledVector(Li,i.y),a.addScaledVector(Ri,i.z),a}static isFrontFacing(e,t,n,r){return Ei.subVectors(n,t),Di.subVectors(e,t),Ei.cross(Di).dot(r)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,n,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Ei.subVectors(this.c,this.b),Di.subVectors(this.a,this.b),Ei.cross(Di).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return e.getNormal(this.a,this.b,this.c,t)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,n){return e.getBarycoord(t,this.a,this.b,this.c,n)}getInterpolation(t,n,r,i,a){return e.getInterpolation(t,this.a,this.b,this.c,n,r,i,a)}containsPoint(t){return e.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return e.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let n=this.a,r=this.b,i=this.c,a,o;Ai.subVectors(r,n),ji.subVectors(i,n),Ni.subVectors(e,n);let s=Ai.dot(Ni),c=ji.dot(Ni);if(s<=0&&c<=0)return t.copy(n);Pi.subVectors(e,r);let l=Ai.dot(Pi),u=ji.dot(Pi);if(l>=0&&u<=l)return t.copy(r);let d=s*u-l*c;if(d<=0&&s>=0&&l<=0)return a=s/(s-l),t.copy(n).addScaledVector(Ai,a);Fi.subVectors(e,i);let f=Ai.dot(Fi),p=ji.dot(Fi);if(p>=0&&f<=p)return t.copy(i);let m=f*c-s*p;if(m<=0&&c>=0&&p<=0)return o=c/(c-p),t.copy(n).addScaledVector(ji,o);let h=l*p-f*u;if(h<=0&&u-l>=0&&f-p>=0)return Mi.subVectors(i,r),o=(u-l)/(u-l+(f-p)),t.copy(r).addScaledVector(Mi,o);let g=1/(h+m+d);return a=m*g,o=d*g,t.copy(n).addScaledVector(Ai,a).addScaledVector(ji,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}},Bi={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},Vi={h:0,s:0,l:0},Hi={h:0,s:0,l:0};function Ui(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*6*(2/3-n):e}var q=class{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(t===void 0&&n===void 0){let t=e;t&&t.isColor?this.copy(t):typeof t==`number`?this.setHex(t):typeof t==`string`&&this.setStyle(t)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Gt){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,G.colorSpaceToWorking(this,t),this}setRGB(e,t,n,r=G.workingColorSpace){return this.r=e,this.g=t,this.b=n,G.colorSpaceToWorking(this,r),this}setHSL(e,t,n,r=G.workingColorSpace){if(e=In(e,1),t=B(t,0,1),n=B(n,0,1),t===0)this.r=this.g=this.b=n;else{let r=n<=.5?n*(1+t):n+t-n*t,i=2*n-r;this.r=Ui(i,r,e+1/3),this.g=Ui(i,r,e),this.b=Ui(i,r,e-1/3)}return G.colorSpaceToWorking(this,r),this}setStyle(e,t=Gt){function n(t){t!==void 0&&parseFloat(t)<1&&R(`Color: Alpha component of `+e+` will be ignored.`)}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let i,a=r[1],o=r[2];switch(a){case`rgb`:case`rgba`:if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(i[4]),this.setRGB(Math.min(255,parseInt(i[1],10))/255,Math.min(255,parseInt(i[2],10))/255,Math.min(255,parseInt(i[3],10))/255,t);if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(i[4]),this.setRGB(Math.min(100,parseInt(i[1],10))/100,Math.min(100,parseInt(i[2],10))/100,Math.min(100,parseInt(i[3],10))/100,t);break;case`hsl`:case`hsla`:if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(i[4]),this.setHSL(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,t);break;default:R(`Color: Unknown color model `+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){let n=r[1],i=n.length;if(i===3)return this.setRGB(parseInt(n.charAt(0),16)/15,parseInt(n.charAt(1),16)/15,parseInt(n.charAt(2),16)/15,t);if(i===6)return this.setHex(parseInt(n,16),t);R(`Color: Invalid hex color `+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Gt){let n=Bi[e.toLowerCase()];return n===void 0?R(`Color: Unknown color `+e):this.setHex(n,t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=lr(e.r),this.g=lr(e.g),this.b=lr(e.b),this}copyLinearToSRGB(e){return this.r=ur(e.r),this.g=ur(e.g),this.b=ur(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Gt){return G.workingToColorSpace(Wi.copy(this),e),Math.round(B(Wi.r*255,0,255))*65536+Math.round(B(Wi.g*255,0,255))*256+Math.round(B(Wi.b*255,0,255))}getHexString(e=Gt){return(`000000`+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=G.workingColorSpace){G.workingToColorSpace(Wi.copy(this),t);let n=Wi.r,r=Wi.g,i=Wi.b,a=Math.max(n,r,i),o=Math.min(n,r,i),s,c,l=(o+a)/2;if(o===a)s=0,c=0;else{let e=a-o;switch(c=l<=.5?e/(a+o):e/(2-a-o),a){case n:s=(r-i)/e+(r0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(let t in e){let n=e[t];if(n===void 0){R(`Material: parameter '${t}' has value of undefined.`);continue}let r=this[t];if(r===void 0){R(`Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e==`string`;t&&(e={textures:{},images:{}});let n={metadata:{version:4.7,type:`Material`,generator:`Material.toJSON`}};n.uuid=this.uuid,n.type=this.type,this.name!==``&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(n.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(n.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==1&&(n.blending=this.blending),this.side!==0&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==204&&(n.blendSrc=this.blendSrc),this.blendDst!==205&&(n.blendDst=this.blendDst),this.blendEquation!==100&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==3&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==519&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==7680&&(n.stencilFail=this.stencilFail),this.stencilZFail!==7680&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==7680&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!==`round`&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!==`round`&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function r(e){let t=[];for(let n in e){let r=e[n];delete r.metadata,t.push(r)}return t}if(t){let t=r(e.textures),i=r(e.images);t.length>0&&(n.textures=t),i.length>0&&(n.images=i)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;let t=e.clippingPlanes,n=null;if(t!==null){let e=t.length;n=Array(e);for(let r=0;r!==e;++r)n[r]=t[r].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:`dispose`})}set needsUpdate(e){e===!0&&this.version++}},qi=class extends Ki{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type=`MeshBasicMaterial`,this.color=new q(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ci,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap=`round`,this.wireframeLinejoin=`round`,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}},Ji=Yi();function Yi(){let e=new ArrayBuffer(4),t=new Float32Array(e),n=new Uint32Array(e),r=new Uint32Array(512),i=new Uint32Array(512);for(let e=0;e<256;++e){let t=e-127;t<-27?(r[e]=0,r[e|256]=32768,i[e]=24,i[e|256]=24):t<-14?(r[e]=1024>>-t-14,r[e|256]=1024>>-t-14|32768,i[e]=-t-1,i[e|256]=-t-1):t<=15?(r[e]=t+15<<10,r[e|256]=t+15<<10|32768,i[e]=13,i[e|256]=13):t<128?(r[e]=31744,r[e|256]=64512,i[e]=24,i[e|256]=24):(r[e]=31744,r[e|256]=64512,i[e]=13,i[e|256]=13)}let a=new Uint32Array(2048),o=new Uint32Array(64),s=new Uint32Array(64);for(let e=1;e<1024;++e){let t=e<<13,n=0;for(;!(t&8388608);)t<<=1,n-=8388608;t&=-8388609,n+=947912704,a[e]=t|n}for(let e=1024;e<2048;++e)a[e]=939524096+(e-1024<<13);for(let e=1;e<31;++e)o[e]=e<<23;o[31]=1199570944,o[32]=2147483648;for(let e=33;e<63;++e)o[e]=2147483648+(e-32<<23);o[63]=3347054592;for(let e=1;e<64;++e)e!==32&&(s[e]=1024);return{floatView:t,uint32View:n,baseTable:r,shiftTable:i,mantissaTable:a,exponentTable:o,offsetTable:s}}function Xi(e){Math.abs(e)>65504&&R(`DataUtils.toHalfFloat(): Value out of range.`),e=B(e,-65504,65504),Ji.floatView[0]=e;let t=Ji.uint32View[0],n=t>>23&511;return Ji.baseTable[n]+((t&8388607)>>Ji.shiftTable[n])}function Zi(e){let t=e>>10;return Ji.uint32View[0]=Ji.mantissaTable[Ji.offsetTable[t]+(e&1023)]+Ji.exponentTable[t],Ji.floatView[0]}var Qi=class{static toHalfFloat(e){return Xi(e)}static fromHalfFloat(e){return Zi(e)}},$i=new U,ea=new H,ta=0,na=class{constructor(e,t,n=!1){if(Array.isArray(e))throw TypeError(`THREE.BufferAttribute: array should be a Typed Array.`);this.isBufferAttribute=!0,Object.defineProperty(this,`id`,{value:ta++}),this.name=``,this.array=e,this.itemSize=t,this.count=e===void 0?0:e.length/t,this.normalized=n,this.usage=nn,this.updateRanges=[],this.gpuType=ke,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let r=0,i=this.itemSize;rt.count&&R(`BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry.`),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Er);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){z(`BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.`,this),this.boundingBox.set(new U(-1/0,-1/0,-1/0),new U(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e0&&(e.userData=this.userData),this.parameters!==void 0){let t=this.parameters;for(let n in t)t[n]!==void 0&&(e[n]=t[n]);return e}e.data={attributes:{}};let t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let n=this.attributes;for(let t in n){let r=n[t];e.data.attributes[t]=r.toJSON(e.data)}let r={},i=!1;for(let t in this.morphAttributes){let n=this.morphAttributes[t],a=[];for(let t=0,r=n.length;t0&&(r[t]=a,i=!0)}i&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);let a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));let o=this.boundingSphere;return o!==null&&(e.data.boundingSphere=o.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let t={};this.name=e.name;let n=e.index;n!==null&&this.setIndex(n.clone());let r=e.attributes;for(let e in r){let n=r[e];this.setAttribute(e,n.clone(t))}let i=e.morphAttributes;for(let e in i){let n=[],r=i[e];for(let e=0,i=r.length;e0){let n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e(e.far-e.near)**2))&&(va.copy(i).invert(),ya.copy(e.ray).applyMatrix4(va),!(n.boundingBox!==null&&ya.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(e,t,ya)))}_computeIntersections(e,t,n){let r,i=this.geometry,a=this.material,o=i.index,s=i.attributes.position,c=i.attributes.uv,l=i.attributes.uv1,u=i.attributes.normal,d=i.groups,f=i.drawRange;if(o!==null)if(Array.isArray(a))for(let i=0,s=d.length;in.far?null:{distance:l,point:Oa.clone(),object:e}}function ja(e,t,n,r,i,a,o,s,c,l){e.getVertexPosition(s,Sa),e.getVertexPosition(c,Ca),e.getVertexPosition(l,wa);let u=Aa(e,t,n,r,Sa,Ca,wa,Da);if(u){let e=new U;zi.getBarycoord(Da,Sa,Ca,wa,e),i&&(u.uv=zi.getInterpolatedAttribute(i,s,c,l,e,new H)),a&&(u.uv1=zi.getInterpolatedAttribute(a,s,c,l,e,new H)),o&&(u.normal=zi.getInterpolatedAttribute(o,s,c,l,e,new U),u.normal.dot(r.direction)>0&&u.normal.multiplyScalar(-1));let t={a:s,b:c,c:l,normal:new U,materialIndex:0};zi.getNormal(Sa,Ca,wa,t.normal),u.face=t,u.barycoord=e}return u}var Ma=class e extends Y{constructor(e=1,t=1,n=1,r=1,i=1,a=1){super(),this.type=`BoxGeometry`,this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:i,depthSegments:a};let o=this;r=Math.floor(r),i=Math.floor(i),a=Math.floor(a);let s=[],c=[],l=[],u=[],d=0,f=0;p(`z`,`y`,`x`,-1,-1,n,t,e,a,i,0),p(`z`,`y`,`x`,1,-1,n,t,-e,a,i,1),p(`x`,`z`,`y`,1,1,e,n,t,r,a,2),p(`x`,`z`,`y`,1,-1,e,n,-t,r,a,3),p(`x`,`y`,`z`,1,-1,e,t,n,r,i,4),p(`x`,`y`,`z`,-1,-1,e,t,-n,r,i,5),this.setIndex(s),this.setAttribute(`position`,new J(c,3)),this.setAttribute(`normal`,new J(l,3)),this.setAttribute(`uv`,new J(u,2));function p(e,t,n,r,i,a,p,m,h,g,_){let v=a/h,y=p/g,b=a/2,x=p/2,S=m/2,C=h+1,w=g+1,T=0,E=0,D=new U;for(let a=0;a0?1:-1,l.push(D.x,D.y,D.z),u.push(s/h),u.push(1-a/g),T+=1}for(let e=0;e=0;--t)if(e[t]>=65535)return!0;return!1}var yn={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function bn(e,t){return new yn[e](t)}function xn(e){return document.createElementNS(`http://www.w3.org/1999/xhtml`,e)}function Sn(){let e=xn(`canvas`);return e.style.display=`block`,e}var Cn={},wn=null;function Tn(e){wn=e}function En(){return wn}function Dn(...e){let t=`THREE.`+e.shift();wn?wn(`log`,t,...e):console.log(t,...e)}function R(...e){let t=`THREE.`+e.shift();wn?wn(`warn`,t,...e):console.warn(t,...e)}function z(...e){let t=`THREE.`+e.shift();wn?wn(`error`,t,...e):console.error(t,...e)}function On(...e){let t=e.join(` `);t in Cn||(Cn[t]=!0,R(...e))}function kn(e,t,n){return new Promise(function(r,i){function a(){switch(e.clientWaitSync(t,e.SYNC_FLUSH_COMMANDS_BIT,0)){case e.WAIT_FAILED:i();break;case e.TIMEOUT_EXPIRED:setTimeout(a,n);break;default:r()}}setTimeout(a,n)})}var An=class{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});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===void 0?!1:n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){let n=this._listeners;if(n===void 0)return;let r=n[e];if(r!==void 0){let e=r.indexOf(t);e!==-1&&r.splice(e,1)}}dispatchEvent(e){let t=this._listeners;if(t===void 0)return;let n=t[e.type];if(n!==void 0){e.target=this;let t=n.slice(0);for(let n=0,r=t.length;n>8&255]+jn[e>>16&255]+jn[e>>24&255]+`-`+jn[t&255]+jn[t>>8&255]+`-`+jn[t>>16&15|64]+jn[t>>24&255]+`-`+jn[n&63|128]+jn[n>>8&255]+`-`+jn[n>>16&255]+jn[n>>24&255]+jn[r&255]+jn[r>>8&255]+jn[r>>16&255]+jn[r>>24&255]).toLowerCase()}function B(e,t,n){return Math.max(t,Math.min(n,e))}function In(e,t){return(e%t+t)%t}function Ln(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)}function Rn(e,t,n){return e===t?0:(n-e)/(t-e)}function zn(e,t,n){return(1-n)*e+n*t}function Bn(e,t,n,r){return zn(e,t,1-Math.exp(-n*r))}function Vn(e,t=1){return t-Math.abs(In(e,t*2)-t)}function Hn(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t),e*e*(3-2*e))}function Un(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t),e*e*e*(e*(e*6-15)+10))}function Wn(e,t){return e+Math.floor(Math.random()*(t-e+1))}function Gn(e,t){return e+Math.random()*(t-e)}function Kn(e){return e*(.5-Math.random())}function qn(e){e!==void 0&&(Mn=e);let t=Mn+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function Jn(e){return e*Nn}function Yn(e){return e*Pn}function Xn(e){return(e&e-1)==0&&e!==0}function Zn(e){return 2**Math.ceil(Math.log(e)/Math.LN2)}function Qn(e){return 2**Math.floor(Math.log(e)/Math.LN2)}function $n(e,t,n,r,i){let a=Math.cos,o=Math.sin,s=a(n/2),c=o(n/2),l=a((t+r)/2),u=o((t+r)/2),d=a((t-r)/2),f=o((t-r)/2),p=a((r-t)/2),m=o((r-t)/2);switch(i){case`XYX`:e.set(s*u,c*d,c*f,s*l);break;case`YZY`:e.set(c*f,s*u,c*d,s*l);break;case`ZXZ`:e.set(c*d,c*f,s*u,s*l);break;case`XZX`:e.set(s*u,c*m,c*p,s*l);break;case`YXY`:e.set(c*p,s*u,c*m,s*l);break;case`ZYZ`:e.set(c*m,c*p,s*u,s*l);break;default:R(`MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: `+i)}}function er(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return e/4294967295;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int32Array:return Math.max(e/2147483647,-1);case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw Error(`Invalid component type.`)}}function V(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return Math.round(e*4294967295);case Uint16Array:return Math.round(e*65535);case Uint8Array:return Math.round(e*255);case Int32Array:return Math.round(e*2147483647);case Int16Array:return Math.round(e*32767);case Int8Array:return Math.round(e*127);default:throw Error(`Invalid component type.`)}}var tr={DEG2RAD:Nn,RAD2DEG:Pn,generateUUID:Fn,clamp:B,euclideanModulo:In,mapLinear:Ln,inverseLerp:Rn,lerp:zn,damp:Bn,pingpong:Vn,smoothstep:Hn,smootherstep:Un,randInt:Wn,randFloat:Gn,randFloatSpread:Kn,seededRandom:qn,degToRad:Jn,radToDeg:Yn,isPowerOfTwo:Xn,ceilPowerOfTwo:Zn,floorPowerOfTwo:Qn,setQuaternionFromProperEuler:$n,normalize:V,denormalize:er},H=class e{constructor(t=0,n=0){e.prototype.isVector2=!0,this.x=t,this.y=n}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw Error(`index is out of range: `+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw Error(`index is out of range: `+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=B(this.x,e.x,t.x),this.y=B(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=B(this.x,e,t),this.y=B(this.y,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(B(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(B(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){let n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,a=this.y-e.y;return this.x=i*n-a*r+e.x,this.y=i*r+a*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},nr=class{constructor(e=0,t=0,n=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=r}static slerpFlat(e,t,n,r,i,a,o){let s=n[r+0],c=n[r+1],l=n[r+2],u=n[r+3],d=i[a+0],f=i[a+1],p=i[a+2],m=i[a+3];if(o<=0){e[t+0]=s,e[t+1]=c,e[t+2]=l,e[t+3]=u;return}if(o>=1){e[t+0]=d,e[t+1]=f,e[t+2]=p,e[t+3]=m;return}if(u!==m||s!==d||c!==f||l!==p){let e=s*d+c*f+l*p+u*m;e<0&&(d=-d,f=-f,p=-p,m=-m,e=-e);let t=1-o;if(e<.9995){let n=Math.acos(e),r=Math.sin(n);t=Math.sin(t*n)/r,o=Math.sin(o*n)/r,s=s*t+d*o,c=c*t+f*o,l=l*t+p*o,u=u*t+m*o}else{s=s*t+d*o,c=c*t+f*o,l=l*t+p*o,u=u*t+m*o;let e=1/Math.sqrt(s*s+c*c+l*l+u*u);s*=e,c*=e,l*=e,u*=e}}e[t]=s,e[t+1]=c,e[t+2]=l,e[t+3]=u}static multiplyQuaternionsFlat(e,t,n,r,i,a){let o=n[r],s=n[r+1],c=n[r+2],l=n[r+3],u=i[a],d=i[a+1],f=i[a+2],p=i[a+3];return e[t]=o*p+l*u+s*f-c*d,e[t+1]=s*p+l*d+c*u-o*f,e[t+2]=c*p+l*f+o*d-s*u,e[t+3]=l*p-o*u-s*d-c*f,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){let n=e._x,r=e._y,i=e._z,a=e._order,o=Math.cos,s=Math.sin,c=o(n/2),l=o(r/2),u=o(i/2),d=s(n/2),f=s(r/2),p=s(i/2);switch(a){case`XYZ`:this._x=d*l*u+c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u-d*f*p;break;case`YXZ`:this._x=d*l*u+c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u+d*f*p;break;case`ZXY`:this._x=d*l*u-c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u-d*f*p;break;case`ZYX`:this._x=d*l*u-c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u+d*f*p;break;case`YZX`:this._x=d*l*u+c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u-d*f*p;break;case`XZY`:this._x=d*l*u-c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u+d*f*p;break;default:R(`Quaternion: .setFromEuler() encountered an unknown order: `+a)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,n=t[0],r=t[4],i=t[8],a=t[1],o=t[5],s=t[9],c=t[2],l=t[6],u=t[10],d=n+o+u;if(d>0){let e=.5/Math.sqrt(d+1);this._w=.25/e,this._x=(l-s)*e,this._y=(i-c)*e,this._z=(a-r)*e}else if(n>o&&n>u){let e=2*Math.sqrt(1+n-o-u);this._w=(l-s)/e,this._x=.25*e,this._y=(r+a)/e,this._z=(i+c)/e}else if(o>u){let e=2*Math.sqrt(1+o-n-u);this._w=(i-c)/e,this._x=(r+a)/e,this._y=.25*e,this._z=(s+l)/e}else{let e=2*Math.sqrt(1+u-n-o);this._w=(a-r)/e,this._x=(i+c)/e,this._y=(s+l)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<1e-8?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(B(this.dot(e),-1,1)))}rotateTowards(e,t){let n=this.angleTo(e);if(n===0)return this;let r=Math.min(1,t/n);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x*=e,this._y*=e,this._z*=e,this._w*=e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let n=e._x,r=e._y,i=e._z,a=e._w,o=t._x,s=t._y,c=t._z,l=t._w;return this._x=n*l+a*o+r*c-i*s,this._y=r*l+a*s+i*o-n*c,this._z=i*l+a*c+n*s-r*o,this._w=a*l-n*o-r*s-i*c,this._onChangeCallback(),this}slerp(e,t){if(t<=0)return this;if(t>=1)return this.copy(e);let n=e._x,r=e._y,i=e._z,a=e._w,o=this.dot(e);o<0&&(n=-n,r=-r,i=-i,a=-a,o=-o);let s=1-t;if(o<.9995){let e=Math.acos(o),c=Math.sin(e);s=Math.sin(s*e)/c,t=Math.sin(t*e)/c,this._x=this._x*s+n*t,this._y=this._y*s+r*t,this._z=this._z*s+i*t,this._w=this._w*s+a*t,this._onChangeCallback()}else this._x=this._x*s+n*t,this._y=this._y*s+r*t,this._z=this._z*s+i*t,this._w=this._w*s+a*t,this.normalize();return this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){let e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),r=Math.sqrt(1-n),i=Math.sqrt(n);return this.set(r*Math.sin(e),r*Math.cos(e),i*Math.sin(t),i*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}},U=class e{constructor(t=0,n=0,r=0){e.prototype.isVector3=!0,this.x=t,this.y=n,this.z=r}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw Error(`index is out of range: `+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error(`index is out of range: `+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(ir.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(ir.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,n=this.y,r=this.z,i=e.elements,a=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*a,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*a,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*a,this}applyQuaternion(e){let t=this.x,n=this.y,r=this.z,i=e.x,a=e.y,o=e.z,s=e.w,c=2*(a*r-o*n),l=2*(o*t-i*r),u=2*(i*n-a*t);return this.x=t+s*c+a*u-o*l,this.y=n+s*l+o*c-i*u,this.z=r+s*u+i*l-a*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=B(this.x,e.x,t.x),this.y=B(this.y,e.y,t.y),this.z=B(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=B(this.x,e,t),this.y=B(this.y,e,t),this.z=B(this.z,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(B(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){let n=e.x,r=e.y,i=e.z,a=t.x,o=t.y,s=t.z;return this.x=r*s-i*o,this.y=i*a-n*s,this.z=n*o-r*a,this}projectOnVector(e){let t=e.lengthSq();if(t===0)return this.set(0,0,0);let n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return rr.copy(this).projectOnVector(e),this.sub(rr)}reflect(e){return this.sub(rr.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(B(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){let r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let e=Math.random()*Math.PI*2,t=Math.random()*2-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}},rr=new U,ir=new nr,W=class e{constructor(t,n,r,i,a,o,s,c,l){e.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,n,r,i,a,o,s,c,l)}set(e,t,n,r,i,a,o,s,c){let l=this.elements;return l[0]=e,l[1]=r,l[2]=o,l[3]=t,l[4]=i,l[5]=s,l[6]=n,l[7]=a,l[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[3],s=n[6],c=n[1],l=n[4],u=n[7],d=n[2],f=n[5],p=n[8],m=r[0],h=r[3],g=r[6],_=r[1],v=r[4],y=r[7],b=r[2],x=r[5],S=r[8];return i[0]=a*m+o*_+s*b,i[3]=a*h+o*v+s*x,i[6]=a*g+o*y+s*S,i[1]=c*m+l*_+u*b,i[4]=c*h+l*v+u*x,i[7]=c*g+l*y+u*S,i[2]=d*m+f*_+p*b,i[5]=d*h+f*v+p*x,i[8]=d*g+f*y+p*S,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8];return t*a*l-t*o*c-n*i*l+n*o*s+r*i*c-r*a*s}invert(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8],u=l*a-o*c,d=o*s-l*i,f=c*i-a*s,p=t*u+n*d+r*f;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);let m=1/p;return e[0]=u*m,e[1]=(r*c-l*n)*m,e[2]=(o*n-r*a)*m,e[3]=d*m,e[4]=(l*t-r*s)*m,e[5]=(r*i-o*t)*m,e[6]=f*m,e[7]=(n*s-c*t)*m,e[8]=(a*t-n*i)*m,this}transpose(){let e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,r,i,a,o){let s=Math.cos(i),c=Math.sin(i);return this.set(n*s,n*c,-n*(s*a+c*o)+a+e,-r*c,r*s,-r*(-c*a+s*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(ar.makeScale(e,t)),this}rotate(e){return this.premultiply(ar.makeRotation(-e)),this}translate(e,t){return this.premultiply(ar.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){let t=this.elements,n=e.elements;for(let e=0;e<9;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}},ar=new W,or=new W().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),sr=new W().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function cr(){let e={enabled:!0,workingColorSpace:Kt,spaces:{},convert:function(e,t,n){return this.enabled===!1||t===n||!t||!n?e:(this.spaces[t].transfer===`srgb`&&(e.r=lr(e.r),e.g=lr(e.g),e.b=lr(e.b)),this.spaces[t].primaries!==this.spaces[n].primaries&&(e.applyMatrix3(this.spaces[t].toXYZ),e.applyMatrix3(this.spaces[n].fromXYZ)),this.spaces[n].transfer===`srgb`&&(e.r=ur(e.r),e.g=ur(e.g),e.b=ur(e.b)),e)},workingToColorSpace:function(e,t){return this.convert(e,this.workingColorSpace,t)},colorSpaceToWorking:function(e,t){return this.convert(e,t,this.workingColorSpace)},getPrimaries:function(e){return this.spaces[e].primaries},getTransfer:function(e){return e===``?qt:this.spaces[e].transfer},getToneMappingMode:function(e){return this.spaces[e].outputColorSpaceConfig.toneMappingMode||`standard`},getLuminanceCoefficients:function(e,t=this.workingColorSpace){return e.fromArray(this.spaces[t].luminanceCoefficients)},define:function(e){Object.assign(this.spaces,e)},_getMatrix:function(e,t,n){return e.copy(this.spaces[t].toXYZ).multiply(this.spaces[n].fromXYZ)},_getDrawingBufferColorSpace:function(e){return this.spaces[e].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(e=this.workingColorSpace){return this.spaces[e].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(t,n){return On(`ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace().`),e.workingToColorSpace(t,n)},toWorkingColorSpace:function(t,n){return On(`ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking().`),e.colorSpaceToWorking(t,n)}},t=[.64,.33,.3,.6,.15,.06],n=[.2126,.7152,.0722],r=[.3127,.329];return e.define({[Kt]:{primaries:t,whitePoint:r,transfer:qt,toXYZ:or,fromXYZ:sr,luminanceCoefficients:n,workingColorSpaceConfig:{unpackColorSpace:Gt},outputColorSpaceConfig:{drawingBufferColorSpace:Gt}},[Gt]:{primaries:t,whitePoint:r,transfer:Jt,toXYZ:or,fromXYZ:sr,luminanceCoefficients:n,outputColorSpaceConfig:{drawingBufferColorSpace:Gt}}}),e}var G=cr();function lr(e){return e<.04045?e*.0773993808:(e*.9478672986+.0521327014)**2.4}function ur(e){return e<.0031308?e*12.92:1.055*e**.41666-.055}var dr,fr=class{static getDataURL(e,t=`image/png`){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>`u`)return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{dr===void 0&&(dr=xn(`canvas`)),dr.width=e.width,dr.height=e.height;let t=dr.getContext(`2d`);e instanceof ImageData?t.putImageData(e,0,0):t.drawImage(e,0,0,e.width,e.height),n=dr}return n.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<`u`&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||typeof ImageBitmap<`u`&&e instanceof ImageBitmap){let t=xn(`canvas`);t.width=e.width,t.height=e.height;let n=t.getContext(`2d`);n.drawImage(e,0,0,e.width,e.height);let r=n.getImageData(0,0,e.width,e.height),i=r.data;for(let e=0;e1),this.pmremVersion=0}get width(){return this.source.getSize(_r).x}get height(){return this.source.getSize(_r).y}get depth(){return this.source.getSize(_r).z}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(let t in e){let n=e[t];if(n===void 0){R(`Texture.setValues(): parameter '${t}' has value of undefined.`);continue}let r=this[t];if(r===void 0){R(`Texture.setValues(): property '${t}' does not exist.`);continue}r&&n&&r.isVector2&&n.isVector2||r&&n&&r.isVector3&&n.isVector3||r&&n&&r.isMatrix3&&n.isMatrix3?r.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e==`string`;if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];let n={metadata:{version:4.7,type:`Texture`,generator:`Texture.toJSON`},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:`dispose`})}transformUv(e){if(this.mapping!==300)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case me:e.x-=Math.floor(e.x);break;case he:e.x=e.x<0?0:1;break;case P:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x-=Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case me:e.y-=Math.floor(e.y);break;case he:e.y=e.y<0?0:1;break;case P:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y-=Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}};vr.DEFAULT_IMAGE=null,vr.DEFAULT_MAPPING=300,vr.DEFAULT_ANISOTROPY=1;var yr=class e{constructor(t=0,n=0,r=0,i=1){e.prototype.isVector4=!0,this.x=t,this.y=n,this.z=r,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw Error(`index is out of range: `+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error(`index is out of range: `+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w===void 0?1:e.w,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){let t=this.x,n=this.y,r=this.z,i=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*r+a[12]*i,this.y=a[1]*t+a[5]*n+a[9]*r+a[13]*i,this.z=a[2]*t+a[6]*n+a[10]*r+a[14]*i,this.w=a[3]*t+a[7]*n+a[11]*r+a[15]*i,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,r,i,a=.01,o=.1,s=e.elements,c=s[0],l=s[4],u=s[8],d=s[1],f=s[5],p=s[9],m=s[2],h=s[6],g=s[10];if(Math.abs(l-d)s&&e>_?e_?s1);this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,n=e.textures.length;t=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,Or),Or.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Ir),Lr.subVectors(this.max,Ir),Ar.subVectors(e.a,Ir),jr.subVectors(e.b,Ir),Mr.subVectors(e.c,Ir),Nr.subVectors(jr,Ar),Pr.subVectors(Mr,jr),Fr.subVectors(Ar,Mr);let t=[0,-Nr.z,Nr.y,0,-Pr.z,Pr.y,0,-Fr.z,Fr.y,Nr.z,0,-Nr.x,Pr.z,0,-Pr.x,Fr.z,0,-Fr.x,-Nr.y,Nr.x,0,-Pr.y,Pr.x,0,-Fr.y,Fr.x,0];return!Br(t,Ar,jr,Mr,Lr)||(t=[1,0,0,0,1,0,0,0,1],!Br(t,Ar,jr,Mr,Lr))?!1:(Rr.crossVectors(Nr,Pr),t=[Rr.x,Rr.y,Rr.z],Br(t,Ar,jr,Mr,Lr))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Or).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Or).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(Dr[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Dr[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Dr[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Dr[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Dr[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Dr[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Dr[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Dr[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Dr),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}},Dr=[new U,new U,new U,new U,new U,new U,new U,new U],Or=new U,kr=new Er,Ar=new U,jr=new U,Mr=new U,Nr=new U,Pr=new U,Fr=new U,Ir=new U,Lr=new U,Rr=new U,zr=new U;function Br(e,t,n,r,i){for(let a=0,o=e.length-3;a<=o;a+=3){zr.fromArray(e,a);let o=i.x*Math.abs(zr.x)+i.y*Math.abs(zr.y)+i.z*Math.abs(zr.z),s=t.dot(zr),c=n.dot(zr),l=r.dot(zr);if(Math.max(-Math.max(s,c,l),Math.min(s,c,l))>o)return!1}return!0}var Vr=new Er,Hr=new U,Ur=new U,Wr=class{constructor(e=new U,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){let n=this.center;t===void 0?Vr.setFromPoints(e).getCenter(n):n.copy(t);let r=0;for(let t=0,i=e.length;tthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius*=e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;Hr.subVectors(e,this.center);let t=Hr.lengthSq();if(t>this.radius*this.radius){let e=Math.sqrt(t),n=(e-this.radius)*.5;this.center.addScaledVector(Hr,n/e),this.radius+=n}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(Ur.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Hr.copy(e.center).add(Ur)),this.expandByPoint(Hr.copy(e.center).sub(Ur))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}},Gr=new U,Kr=new U,qr=new U,Jr=new U,Yr=new U,Xr=new U,Zr=new U,Qr=class{constructor(e=new U,t=new U(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Gr)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);let n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){let t=Gr.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Gr.copy(this.origin).addScaledVector(this.direction,t),Gr.distanceToSquared(e))}distanceSqToSegment(e,t,n,r){Kr.copy(e).add(t).multiplyScalar(.5),qr.copy(t).sub(e).normalize(),Jr.copy(this.origin).sub(Kr);let i=e.distanceTo(t)*.5,a=-this.direction.dot(qr),o=Jr.dot(this.direction),s=-Jr.dot(qr),c=Jr.lengthSq(),l=Math.abs(1-a*a),u,d,f,p;if(l>0)if(u=a*s-o,d=a*o-s,p=i*l,u>=0)if(d>=-p)if(d<=p){let e=1/l;u*=e,d*=e,f=u*(u+a*d+2*o)+d*(a*u+d+2*s)+c}else d=i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c;else d=-i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c;else d<=-p?(u=Math.max(0,-(-a*i+o)),d=u>0?-i:Math.min(Math.max(-i,-s),i),f=-u*u+d*(d+2*s)+c):d<=p?(u=0,d=Math.min(Math.max(-i,-s),i),f=d*(d+2*s)+c):(u=Math.max(0,-(a*i+o)),d=u>0?i:Math.min(Math.max(-i,-s),i),f=-u*u+d*(d+2*s)+c);else d=a>0?-i:i,u=Math.max(0,-(a*d+o)),f=-u*u+d*(d+2*s)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,u),r&&r.copy(Kr).addScaledVector(qr,d),f}intersectSphere(e,t){Gr.subVectors(e.center,this.origin);let n=Gr.dot(this.direction),r=Gr.dot(Gr)-n*n,i=e.radius*e.radius;if(r>i)return null;let a=Math.sqrt(i-r),o=n-a,s=n+a;return s<0?null:o<0?this.at(s,t):this.at(o,t)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){let t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;let n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){let n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){let t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,r,i,a,o,s,c=1/this.direction.x,l=1/this.direction.y,u=1/this.direction.z,d=this.origin;return c>=0?(n=(e.min.x-d.x)*c,r=(e.max.x-d.x)*c):(n=(e.max.x-d.x)*c,r=(e.min.x-d.x)*c),l>=0?(i=(e.min.y-d.y)*l,a=(e.max.y-d.y)*l):(i=(e.max.y-d.y)*l,a=(e.min.y-d.y)*l),n>a||i>r||((i>n||isNaN(n))&&(n=i),(a=0?(o=(e.min.z-d.z)*u,s=(e.max.z-d.z)*u):(o=(e.max.z-d.z)*u,s=(e.min.z-d.z)*u),n>s||o>r)||((o>n||n!==n)&&(n=o),(s=0?n:r,t)}intersectsBox(e){return this.intersectBox(e,Gr)!==null}intersectTriangle(e,t,n,r,i){Yr.subVectors(t,e),Xr.subVectors(n,e),Zr.crossVectors(Yr,Xr);let a=this.direction.dot(Zr),o;if(a>0){if(r)return null;o=1}else if(a<0)o=-1,a=-a;else return null;Jr.subVectors(this.origin,e);let s=o*this.direction.dot(Xr.crossVectors(Jr,Xr));if(s<0)return null;let c=o*this.direction.dot(Yr.cross(Jr));if(c<0||s+c>a)return null;let l=-o*Jr.dot(Zr);return l<0?null:this.at(l/a,i)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}},K=class e{constructor(t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g){e.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!==void 0&&this.set(t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g)}set(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){let g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=r,g[1]=i,g[5]=a,g[9]=o,g[13]=s,g[2]=c,g[6]=l,g[10]=u,g[14]=d,g[3]=f,g[7]=p,g[11]=m,g[15]=h,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new e().fromArray(this.elements)}copy(e){let t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){let t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){let t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){let t=this.elements,n=e.elements,r=1/$r.setFromMatrixColumn(e,0).length(),i=1/$r.setFromMatrixColumn(e,1).length(),a=1/$r.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*i,t[5]=n[5]*i,t[6]=n[6]*i,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){let t=this.elements,n=e.x,r=e.y,i=e.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(r),c=Math.sin(r),l=Math.cos(i),u=Math.sin(i);if(e.order===`XYZ`){let e=a*l,n=a*u,r=o*l,i=o*u;t[0]=s*l,t[4]=-s*u,t[8]=c,t[1]=n+r*c,t[5]=e-i*c,t[9]=-o*s,t[2]=i-e*c,t[6]=r+n*c,t[10]=a*s}else if(e.order===`YXZ`){let e=s*l,n=s*u,r=c*l,i=c*u;t[0]=e+i*o,t[4]=r*o-n,t[8]=a*c,t[1]=a*u,t[5]=a*l,t[9]=-o,t[2]=n*o-r,t[6]=i+e*o,t[10]=a*s}else if(e.order===`ZXY`){let e=s*l,n=s*u,r=c*l,i=c*u;t[0]=e-i*o,t[4]=-a*u,t[8]=r+n*o,t[1]=n+r*o,t[5]=a*l,t[9]=i-e*o,t[2]=-a*c,t[6]=o,t[10]=a*s}else if(e.order===`ZYX`){let e=a*l,n=a*u,r=o*l,i=o*u;t[0]=s*l,t[4]=r*c-n,t[8]=e*c+i,t[1]=s*u,t[5]=i*c+e,t[9]=n*c-r,t[2]=-c,t[6]=o*s,t[10]=a*s}else if(e.order===`YZX`){let e=a*s,n=a*c,r=o*s,i=o*c;t[0]=s*l,t[4]=i-e*u,t[8]=r*u+n,t[1]=u,t[5]=a*l,t[9]=-o*l,t[2]=-c*l,t[6]=n*u+r,t[10]=e-i*u}else if(e.order===`XZY`){let e=a*s,n=a*c,r=o*s,i=o*c;t[0]=s*l,t[4]=-u,t[8]=c*l,t[1]=e*u+i,t[5]=a*l,t[9]=n*u-r,t[2]=r*u-n,t[6]=o*l,t[10]=i*u+e}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(ti,e,ni)}lookAt(e,t,n){let r=this.elements;return ai.subVectors(e,t),ai.lengthSq()===0&&(ai.z=1),ai.normalize(),ri.crossVectors(n,ai),ri.lengthSq()===0&&(Math.abs(n.z)===1?ai.x+=1e-4:ai.z+=1e-4,ai.normalize(),ri.crossVectors(n,ai)),ri.normalize(),ii.crossVectors(ai,ri),r[0]=ri.x,r[4]=ii.x,r[8]=ai.x,r[1]=ri.y,r[5]=ii.y,r[9]=ai.y,r[2]=ri.z,r[6]=ii.z,r[10]=ai.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){let n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[4],s=n[8],c=n[12],l=n[1],u=n[5],d=n[9],f=n[13],p=n[2],m=n[6],h=n[10],g=n[14],_=n[3],v=n[7],y=n[11],b=n[15],x=r[0],S=r[4],C=r[8],w=r[12],T=r[1],E=r[5],D=r[9],O=r[13],k=r[2],A=r[6],j=r[10],M=r[14],ee=r[3],te=r[7],N=r[11],ne=r[15];return i[0]=a*x+o*T+s*k+c*ee,i[4]=a*S+o*E+s*A+c*te,i[8]=a*C+o*D+s*j+c*N,i[12]=a*w+o*O+s*M+c*ne,i[1]=l*x+u*T+d*k+f*ee,i[5]=l*S+u*E+d*A+f*te,i[9]=l*C+u*D+d*j+f*N,i[13]=l*w+u*O+d*M+f*ne,i[2]=p*x+m*T+h*k+g*ee,i[6]=p*S+m*E+h*A+g*te,i[10]=p*C+m*D+h*j+g*N,i[14]=p*w+m*O+h*M+g*ne,i[3]=_*x+v*T+y*k+b*ee,i[7]=_*S+v*E+y*A+b*te,i[11]=_*C+v*D+y*j+b*N,i[15]=_*w+v*O+y*M+b*ne,this}multiplyScalar(e){let t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){let e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],a=e[1],o=e[5],s=e[9],c=e[13],l=e[2],u=e[6],d=e[10],f=e[14],p=e[3],m=e[7],h=e[11],g=e[15];return p*(+i*s*u-r*c*u-i*o*d+n*c*d+r*o*f-n*s*f)+m*(+t*s*f-t*c*d+i*a*d-r*a*f+r*c*l-i*s*l)+h*(+t*c*u-t*o*f-i*a*u+n*a*f+i*o*l-n*c*l)+g*(-r*o*l-t*s*u+t*o*d+r*a*u-n*a*d+n*s*l)}transpose(){let e=this.elements,t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){let r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this}invert(){let e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8],u=e[9],d=e[10],f=e[11],p=e[12],m=e[13],h=e[14],g=e[15],_=u*h*c-m*d*c+m*s*f-o*h*f-u*s*g+o*d*g,v=p*d*c-l*h*c-p*s*f+a*h*f+l*s*g-a*d*g,y=l*m*c-p*u*c+p*o*f-a*m*f-l*o*g+a*u*g,b=p*u*s-l*m*s-p*o*d+a*m*d+l*o*h-a*u*h,x=t*_+n*v+r*y+i*b;if(x===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let S=1/x;return e[0]=_*S,e[1]=(m*d*i-u*h*i-m*r*f+n*h*f+u*r*g-n*d*g)*S,e[2]=(o*h*i-m*s*i+m*r*c-n*h*c-o*r*g+n*s*g)*S,e[3]=(u*s*i-o*d*i-u*r*c+n*d*c+o*r*f-n*s*f)*S,e[4]=v*S,e[5]=(l*h*i-p*d*i+p*r*f-t*h*f-l*r*g+t*d*g)*S,e[6]=(p*s*i-a*h*i-p*r*c+t*h*c+a*r*g-t*s*g)*S,e[7]=(a*d*i-l*s*i+l*r*c-t*d*c-a*r*f+t*s*f)*S,e[8]=y*S,e[9]=(p*u*i-l*m*i-p*n*f+t*m*f+l*n*g-t*u*g)*S,e[10]=(a*m*i-p*o*i+p*n*c-t*m*c-a*n*g+t*o*g)*S,e[11]=(l*o*i-a*u*i-l*n*c+t*u*c+a*n*f-t*o*f)*S,e[12]=b*S,e[13]=(l*m*r-p*u*r+p*n*d-t*m*d-l*n*h+t*u*h)*S,e[14]=(p*o*r-a*m*r-p*n*s+t*m*s+a*n*h-t*o*h)*S,e[15]=(a*u*r-l*o*r+l*n*s-t*u*s-a*n*d+t*o*d)*S,this}scale(e){let t=this.elements,n=e.x,r=e.y,i=e.z;return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,this}getMaxScaleOnAxis(){let e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){let t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){let t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){let n=Math.cos(t),r=Math.sin(t),i=1-n,a=e.x,o=e.y,s=e.z,c=i*a,l=i*o;return this.set(c*a+n,c*o-r*s,c*s+r*o,0,c*o+r*s,l*o+n,l*s-r*a,0,c*s-r*o,l*s+r*a,i*s*s+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,r,i,a){return this.set(1,n,i,0,e,1,a,0,t,r,1,0,0,0,0,1),this}compose(e,t,n){let r=this.elements,i=t._x,a=t._y,o=t._z,s=t._w,c=i+i,l=a+a,u=o+o,d=i*c,f=i*l,p=i*u,m=a*l,h=a*u,g=o*u,_=s*c,v=s*l,y=s*u,b=n.x,x=n.y,S=n.z;return r[0]=(1-(m+g))*b,r[1]=(f+y)*b,r[2]=(p-v)*b,r[3]=0,r[4]=(f-y)*x,r[5]=(1-(d+g))*x,r[6]=(h+_)*x,r[7]=0,r[8]=(p+v)*S,r[9]=(h-_)*S,r[10]=(1-(d+m))*S,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,n){let r=this.elements,i=$r.set(r[0],r[1],r[2]).length(),a=$r.set(r[4],r[5],r[6]).length(),o=$r.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),e.x=r[12],e.y=r[13],e.z=r[14],ei.copy(this);let s=1/i,c=1/a,l=1/o;return ei.elements[0]*=s,ei.elements[1]*=s,ei.elements[2]*=s,ei.elements[4]*=c,ei.elements[5]*=c,ei.elements[6]*=c,ei.elements[8]*=l,ei.elements[9]*=l,ei.elements[10]*=l,t.setFromRotationMatrix(ei),n.x=i,n.y=a,n.z=o,this}makePerspective(e,t,n,r,i,a,o=pn,s=!1){let c=this.elements,l=2*i/(t-e),u=2*i/(n-r),d=(t+e)/(t-e),f=(n+r)/(n-r),p,m;if(s)p=i/(a-i),m=a*i/(a-i);else if(o===2e3)p=-(a+i)/(a-i),m=-2*a*i/(a-i);else if(o===2001)p=-a/(a-i),m=-a*i/(a-i);else throw Error(`THREE.Matrix4.makePerspective(): Invalid coordinate system: `+o);return c[0]=l,c[4]=0,c[8]=d,c[12]=0,c[1]=0,c[5]=u,c[9]=f,c[13]=0,c[2]=0,c[6]=0,c[10]=p,c[14]=m,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(e,t,n,r,i,a,o=pn,s=!1){let c=this.elements,l=2/(t-e),u=2/(n-r),d=-(t+e)/(t-e),f=-(n+r)/(n-r),p,m;if(s)p=1/(a-i),m=a/(a-i);else if(o===2e3)p=-2/(a-i),m=-(a+i)/(a-i);else if(o===2001)p=-1/(a-i),m=-i/(a-i);else throw Error(`THREE.Matrix4.makeOrthographic(): Invalid coordinate system: `+o);return c[0]=l,c[4]=0,c[8]=0,c[12]=d,c[1]=0,c[5]=u,c[9]=0,c[13]=f,c[2]=0,c[6]=0,c[10]=p,c[14]=m,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(e){let t=this.elements,n=e.elements;for(let e=0;e<16;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){let n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}},$r=new U,ei=new K,ti=new U(0,0,0),ni=new U(1,1,1),ri=new U,ii=new U,ai=new U,oi=new K,si=new nr,ci=class e{constructor(t=0,n=0,r=0,i=e.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=n,this._z=r,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,r=this._order){return this._x=e,this._y=t,this._z=n,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){let r=e.elements,i=r[0],a=r[4],o=r[8],s=r[1],c=r[5],l=r[9],u=r[2],d=r[6],f=r[10];switch(t){case`XYZ`:this._y=Math.asin(B(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-l,f),this._z=Math.atan2(-a,i)):(this._x=Math.atan2(d,c),this._z=0);break;case`YXZ`:this._x=Math.asin(-B(l,-1,1)),Math.abs(l)<.9999999?(this._y=Math.atan2(o,f),this._z=Math.atan2(s,c)):(this._y=Math.atan2(-u,i),this._z=0);break;case`ZXY`:this._x=Math.asin(B(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-u,f),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(s,i));break;case`ZYX`:this._y=Math.asin(-B(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(d,f),this._z=Math.atan2(s,i)):(this._x=0,this._z=Math.atan2(-a,c));break;case`YZX`:this._z=Math.asin(B(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-l,c),this._y=Math.atan2(-u,i)):(this._x=0,this._y=Math.atan2(o,f));break;case`XZY`:this._z=Math.asin(-B(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(o,i)):(this._x=Math.atan2(-l,f),this._y=0);break;default:R(`Euler: .setFromRotationMatrix() encountered an unknown order: `+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return oi.makeRotationFromQuaternion(e),this.setFromRotationMatrix(oi,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return si.setFromEuler(this),this.setFromQuaternion(si,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}};ci.DEFAULT_ORDER=`XYZ`;var li=class{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let e=0;e1){for(let e=0;e0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type=`InstancedMesh`,r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type=`BatchedMesh`,r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.geometryInfo=this._geometryInfo.map(e=>({...e,boundingBox:e.boundingBox?e.boundingBox.toJSON():void 0,boundingSphere:e.boundingSphere?e.boundingSphere.toJSON():void 0})),r.instanceInfo=this._instanceInfo.map(e=>({...e})),r.availableInstanceIds=this._availableInstanceIds.slice(),r.availableGeometryIds=this._availableGeometryIds.slice(),r.nextIndexStart=this._nextIndexStart,r.nextVertexStart=this._nextVertexStart,r.geometryCount=this._geometryCount,r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.matricesTexture=this._matricesTexture.toJSON(e),r.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(r.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(r.boundingBox=this.boundingBox.toJSON()));function i(t,n){return t[n.uuid]===void 0&&(t[n.uuid]=n.toJSON(e)),n.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=i(e.geometries,this.geometry);let t=this.geometry.parameters;if(t!==void 0&&t.shapes!==void 0){let n=t.shapes;if(Array.isArray(n))for(let t=0,r=n.length;t0){r.children=[];for(let t=0;t0){r.animations=[];for(let t=0;t0&&(n.geometries=t),r.length>0&&(n.materials=r),i.length>0&&(n.textures=i),o.length>0&&(n.images=o),s.length>0&&(n.shapes=s),c.length>0&&(n.skeletons=c),l.length>0&&(n.animations=l),u.length>0&&(n.nodes=u)}return n.object=r,n;function a(e){let t=[];for(let n in e){let r=e[n];delete r.metadata,t.push(r)}return t}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let t=0;t0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}static getBarycoord(e,t,n,r,i){Ei.subVectors(r,t),Di.subVectors(n,t),Oi.subVectors(e,t);let a=Ei.dot(Ei),o=Ei.dot(Di),s=Ei.dot(Oi),c=Di.dot(Di),l=Di.dot(Oi),u=a*c-o*o;if(u===0)return i.set(0,0,0),null;let d=1/u,f=(c*s-o*l)*d,p=(a*l-o*s)*d;return i.set(1-f-p,p,f)}static containsPoint(e,t,n,r){return this.getBarycoord(e,t,n,r,ki)===null?!1:ki.x>=0&&ki.y>=0&&ki.x+ki.y<=1}static getInterpolation(e,t,n,r,i,a,o,s){return this.getBarycoord(e,t,n,r,ki)===null?(s.x=0,s.y=0,`z`in s&&(s.z=0),`w`in s&&(s.w=0),null):(s.setScalar(0),s.addScaledVector(i,ki.x),s.addScaledVector(a,ki.y),s.addScaledVector(o,ki.z),s)}static getInterpolatedAttribute(e,t,n,r,i,a){return Ii.setScalar(0),Li.setScalar(0),Ri.setScalar(0),Ii.fromBufferAttribute(e,t),Li.fromBufferAttribute(e,n),Ri.fromBufferAttribute(e,r),a.setScalar(0),a.addScaledVector(Ii,i.x),a.addScaledVector(Li,i.y),a.addScaledVector(Ri,i.z),a}static isFrontFacing(e,t,n,r){return Ei.subVectors(n,t),Di.subVectors(e,t),Ei.cross(Di).dot(r)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,n,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Ei.subVectors(this.c,this.b),Di.subVectors(this.a,this.b),Ei.cross(Di).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return e.getNormal(this.a,this.b,this.c,t)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,n){return e.getBarycoord(t,this.a,this.b,this.c,n)}getInterpolation(t,n,r,i,a){return e.getInterpolation(t,this.a,this.b,this.c,n,r,i,a)}containsPoint(t){return e.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return e.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){let n=this.a,r=this.b,i=this.c,a,o;Ai.subVectors(r,n),ji.subVectors(i,n),Ni.subVectors(e,n);let s=Ai.dot(Ni),c=ji.dot(Ni);if(s<=0&&c<=0)return t.copy(n);Pi.subVectors(e,r);let l=Ai.dot(Pi),u=ji.dot(Pi);if(l>=0&&u<=l)return t.copy(r);let d=s*u-l*c;if(d<=0&&s>=0&&l<=0)return a=s/(s-l),t.copy(n).addScaledVector(Ai,a);Fi.subVectors(e,i);let f=Ai.dot(Fi),p=ji.dot(Fi);if(p>=0&&f<=p)return t.copy(i);let m=f*c-s*p;if(m<=0&&c>=0&&p<=0)return o=c/(c-p),t.copy(n).addScaledVector(ji,o);let h=l*p-f*u;if(h<=0&&u-l>=0&&f-p>=0)return Mi.subVectors(i,r),o=(u-l)/(u-l+(f-p)),t.copy(r).addScaledVector(Mi,o);let g=1/(h+m+d);return a=m*g,o=d*g,t.copy(n).addScaledVector(Ai,a).addScaledVector(ji,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}},Bi={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},Vi={h:0,s:0,l:0},Hi={h:0,s:0,l:0};function Ui(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*6*(2/3-n):e}var q=class{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(t===void 0&&n===void 0){let t=e;t&&t.isColor?this.copy(t):typeof t==`number`?this.setHex(t):typeof t==`string`&&this.setStyle(t)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Gt){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,G.colorSpaceToWorking(this,t),this}setRGB(e,t,n,r=G.workingColorSpace){return this.r=e,this.g=t,this.b=n,G.colorSpaceToWorking(this,r),this}setHSL(e,t,n,r=G.workingColorSpace){if(e=In(e,1),t=B(t,0,1),n=B(n,0,1),t===0)this.r=this.g=this.b=n;else{let r=n<=.5?n*(1+t):n+t-n*t,i=2*n-r;this.r=Ui(i,r,e+1/3),this.g=Ui(i,r,e),this.b=Ui(i,r,e-1/3)}return G.colorSpaceToWorking(this,r),this}setStyle(e,t=Gt){function n(t){t!==void 0&&parseFloat(t)<1&&R(`Color: Alpha component of `+e+` will be ignored.`)}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let i,a=r[1],o=r[2];switch(a){case`rgb`:case`rgba`:if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(i[4]),this.setRGB(Math.min(255,parseInt(i[1],10))/255,Math.min(255,parseInt(i[2],10))/255,Math.min(255,parseInt(i[3],10))/255,t);if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(i[4]),this.setRGB(Math.min(100,parseInt(i[1],10))/100,Math.min(100,parseInt(i[2],10))/100,Math.min(100,parseInt(i[3],10))/100,t);break;case`hsl`:case`hsla`:if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(i[4]),this.setHSL(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,t);break;default:R(`Color: Unknown color model `+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){let n=r[1],i=n.length;if(i===3)return this.setRGB(parseInt(n.charAt(0),16)/15,parseInt(n.charAt(1),16)/15,parseInt(n.charAt(2),16)/15,t);if(i===6)return this.setHex(parseInt(n,16),t);R(`Color: Invalid hex color `+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Gt){let n=Bi[e.toLowerCase()];return n===void 0?R(`Color: Unknown color `+e):this.setHex(n,t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=lr(e.r),this.g=lr(e.g),this.b=lr(e.b),this}copyLinearToSRGB(e){return this.r=ur(e.r),this.g=ur(e.g),this.b=ur(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Gt){return G.workingToColorSpace(Wi.copy(this),e),Math.round(B(Wi.r*255,0,255))*65536+Math.round(B(Wi.g*255,0,255))*256+Math.round(B(Wi.b*255,0,255))}getHexString(e=Gt){return(`000000`+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=G.workingColorSpace){G.workingToColorSpace(Wi.copy(this),t);let n=Wi.r,r=Wi.g,i=Wi.b,a=Math.max(n,r,i),o=Math.min(n,r,i),s,c,l=(o+a)/2;if(o===a)s=0,c=0;else{let e=a-o;switch(c=l<=.5?e/(a+o):e/(2-a-o),a){case n:s=(r-i)/e+(r0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(let t in e){let n=e[t];if(n===void 0){R(`Material: parameter '${t}' has value of undefined.`);continue}let r=this[t];if(r===void 0){R(`Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]=n}}toJSON(e){let t=e===void 0||typeof e==`string`;t&&(e={textures:{},images:{}});let n={metadata:{version:4.7,type:`Material`,generator:`Material.toJSON`}};n.uuid=this.uuid,n.type=this.type,this.name!==``&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(n.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(n.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==1&&(n.blending=this.blending),this.side!==0&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==204&&(n.blendSrc=this.blendSrc),this.blendDst!==205&&(n.blendDst=this.blendDst),this.blendEquation!==100&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==3&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==519&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==7680&&(n.stencilFail=this.stencilFail),this.stencilZFail!==7680&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==7680&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!==`round`&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!==`round`&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function r(e){let t=[];for(let n in e){let r=e[n];delete r.metadata,t.push(r)}return t}if(t){let t=r(e.textures),i=r(e.images);t.length>0&&(n.textures=t),i.length>0&&(n.images=i)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;let t=e.clippingPlanes,n=null;if(t!==null){let e=t.length;n=Array(e);for(let r=0;r!==e;++r)n[r]=t[r].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:`dispose`})}set needsUpdate(e){e===!0&&this.version++}},qi=class extends Ki{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type=`MeshBasicMaterial`,this.color=new q(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ci,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap=`round`,this.wireframeLinejoin=`round`,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}},Ji=Yi();function Yi(){let e=new ArrayBuffer(4),t=new Float32Array(e),n=new Uint32Array(e),r=new Uint32Array(512),i=new Uint32Array(512);for(let e=0;e<256;++e){let t=e-127;t<-27?(r[e]=0,r[e|256]=32768,i[e]=24,i[e|256]=24):t<-14?(r[e]=1024>>-t-14,r[e|256]=1024>>-t-14|32768,i[e]=-t-1,i[e|256]=-t-1):t<=15?(r[e]=t+15<<10,r[e|256]=t+15<<10|32768,i[e]=13,i[e|256]=13):t<128?(r[e]=31744,r[e|256]=64512,i[e]=24,i[e|256]=24):(r[e]=31744,r[e|256]=64512,i[e]=13,i[e|256]=13)}let a=new Uint32Array(2048),o=new Uint32Array(64),s=new Uint32Array(64);for(let e=1;e<1024;++e){let t=e<<13,n=0;for(;!(t&8388608);)t<<=1,n-=8388608;t&=-8388609,n+=947912704,a[e]=t|n}for(let e=1024;e<2048;++e)a[e]=939524096+(e-1024<<13);for(let e=1;e<31;++e)o[e]=e<<23;o[31]=1199570944,o[32]=2147483648;for(let e=33;e<63;++e)o[e]=2147483648+(e-32<<23);o[63]=3347054592;for(let e=1;e<64;++e)e!==32&&(s[e]=1024);return{floatView:t,uint32View:n,baseTable:r,shiftTable:i,mantissaTable:a,exponentTable:o,offsetTable:s}}function Xi(e){Math.abs(e)>65504&&R(`DataUtils.toHalfFloat(): Value out of range.`),e=B(e,-65504,65504),Ji.floatView[0]=e;let t=Ji.uint32View[0],n=t>>23&511;return Ji.baseTable[n]+((t&8388607)>>Ji.shiftTable[n])}function Zi(e){let t=e>>10;return Ji.uint32View[0]=Ji.mantissaTable[Ji.offsetTable[t]+(e&1023)]+Ji.exponentTable[t],Ji.floatView[0]}var Qi=class{static toHalfFloat(e){return Xi(e)}static fromHalfFloat(e){return Zi(e)}},$i=new U,ea=new H,ta=0,na=class{constructor(e,t,n=!1){if(Array.isArray(e))throw TypeError(`THREE.BufferAttribute: array should be a Typed Array.`);this.isBufferAttribute=!0,Object.defineProperty(this,`id`,{value:ta++}),this.name=``,this.array=e,this.itemSize=t,this.count=e===void 0?0:e.length/t,this.normalized=n,this.usage=nn,this.updateRanges=[],this.gpuType=ke,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let r=0,i=this.itemSize;rt.count&&R(`BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry.`),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Er);let e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){z(`BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.`,this),this.boundingBox.set(new U(-1/0,-1/0,-1/0),new U(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e0&&(e.userData=this.userData),this.parameters!==void 0){let t=this.parameters;for(let n in t)t[n]!==void 0&&(e[n]=t[n]);return e}e.data={attributes:{}};let t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});let n=this.attributes;for(let t in n){let r=n[t];e.data.attributes[t]=r.toJSON(e.data)}let r={},i=!1;for(let t in this.morphAttributes){let n=this.morphAttributes[t],a=[];for(let t=0,r=n.length;t0&&(r[t]=a,i=!0)}i&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);let a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));let o=this.boundingSphere;return o!==null&&(e.data.boundingSphere=o.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let t={};this.name=e.name;let n=e.index;n!==null&&this.setIndex(n.clone());let r=e.attributes;for(let e in r){let n=r[e];this.setAttribute(e,n.clone(t))}let i=e.morphAttributes;for(let e in i){let n=[],r=i[e];for(let e=0,i=r.length;e0){let n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e(e.far-e.near)**2))&&(va.copy(i).invert(),ya.copy(e.ray).applyMatrix4(va),!(n.boundingBox!==null&&ya.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(e,t,ya)))}_computeIntersections(e,t,n){let r,i=this.geometry,a=this.material,o=i.index,s=i.attributes.position,c=i.attributes.uv,l=i.attributes.uv1,u=i.attributes.normal,d=i.groups,f=i.drawRange;if(o!==null)if(Array.isArray(a))for(let i=0,s=d.length;in.far?null:{distance:l,point:Oa.clone(),object:e}}function ja(e,t,n,r,i,a,o,s,c,l){e.getVertexPosition(s,Sa),e.getVertexPosition(c,Ca),e.getVertexPosition(l,wa);let u=Aa(e,t,n,r,Sa,Ca,wa,Da);if(u){let e=new U;zi.getBarycoord(Da,Sa,Ca,wa,e),i&&(u.uv=zi.getInterpolatedAttribute(i,s,c,l,e,new H)),a&&(u.uv1=zi.getInterpolatedAttribute(a,s,c,l,e,new H)),o&&(u.normal=zi.getInterpolatedAttribute(o,s,c,l,e,new U),u.normal.dot(r.direction)>0&&u.normal.multiplyScalar(-1));let t={a:s,b:c,c:l,normal:new U,materialIndex:0};zi.getNormal(Sa,Ca,wa,t.normal),u.face=t,u.barycoord=e}return u}var Ma=class e extends Y{constructor(e=1,t=1,n=1,r=1,i=1,a=1){super(),this.type=`BoxGeometry`,this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:i,depthSegments:a};let o=this;r=Math.floor(r),i=Math.floor(i),a=Math.floor(a);let s=[],c=[],l=[],u=[],d=0,f=0;p(`z`,`y`,`x`,-1,-1,n,t,e,a,i,0),p(`z`,`y`,`x`,1,-1,n,t,-e,a,i,1),p(`x`,`z`,`y`,1,1,e,n,t,r,a,2),p(`x`,`z`,`y`,1,-1,e,n,-t,r,a,3),p(`x`,`y`,`z`,1,-1,e,t,n,r,i,4),p(`x`,`y`,`z`,-1,-1,e,t,-n,r,i,5),this.setIndex(s),this.setAttribute(`position`,new J(c,3)),this.setAttribute(`normal`,new J(l,3)),this.setAttribute(`uv`,new J(u,2));function p(e,t,n,r,i,a,p,m,h,g,_){let v=a/h,y=p/g,b=a/2,x=p/2,S=m/2,C=h+1,w=g+1,T=0,E=0,D=new U;for(let a=0;a0?1:-1,l.push(D.x,D.y,D.z),u.push(s/h),u.push(1-a/g),T+=1}for(let e=0;e(t(),n(r(i)))}});typeof a==`function`&&a(o);var s=o;export{s as default}; \ No newline at end of file +import{A as e,K as t,S as n,kt as r}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-C0YByt49.js";import"./src-DYQXbDgu.js";import"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{lt as i}from"./components-CeE-UiLT.js";import"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-73vyHOZs.js";import"./__vite-browser-external-BaycPy5b.js";import{t as a}from"./route-block-CpjdOEnv.js";var o=e({__name:`vision`,setup(e){return(e,a)=>(t(),n(r(i)))}});typeof a==`function`&&a(o);var s=o;export{s as default}; \ No newline at end of file diff --git a/assets/volcengine-CwHpcYQ0.js b/assets/volcengine-3lrl6sUc.js similarity index 92% rename from assets/volcengine-CwHpcYQ0.js rename to assets/volcengine-3lrl6sUc.js index 1ad37736c2527df550291888854a2e421a46e602..1070121bbdb7b3339367628954cccd30d9679788 100644 --- a/assets/volcengine-CwHpcYQ0.js +++ b/assets/volcengine-3lrl6sUc.js @@ -1 +1 @@ -import{A as e,K as t,S as n,W as r,at as i,b as a,k as o,kt as s,lt as c,x as l,xt as u}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-CZ9Rvki9.js";import{d,l as f}from"./src-DYQXbDgu.js";import{a as p}from"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{c as m,u as h}from"./components-BR_Kqwtu.js";import{i as g,t as _}from"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import{n as v}from"./vue-i18n.runtime-Dah5zGm4.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-D1kLcsvA.js";import"./__vite-browser-external-BaycPy5b.js";import{t as y}from"./route-block-CpjdOEnv.js";var b={flex:`~ col gap-4`},x=`volcengine`,S=`v1`,C=e({__name:`volcengine`,setup(e){let y=u(1),C=_(),w=g(),{providers:T}=p(w),{t:E}=v(),D=a({get:()=>T.value[x]?.app?.appId||``,set:e=>{T.value[x]||(T.value[x]={}),T.value[x].app={appId:e}}}),O=a(()=>!!T.value[x]?.apiKey),k=a(()=>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 r(async()=>{let e=w.getProviderConfig(x);await w.getProviderMetadata(x).validators.validateProviderConfig(e)?await C.loadVoicesForProvider(x):console.error(`Failed to validate provider config`,e)}),i(y,async()=>{let e=w.getProviderConfig(x);e.audio||={},e.audio.speedRatio=y.value}),i([T,D],async()=>{let e=w.getProviderConfig(x);await w.getProviderMetadata(x).validators.validateProviderConfig(e)?await C.loadVoicesForProvider(x):console.error(`Failed to validate provider config`,e)},{immediate:!0}),(e,r)=>(t(),n(s(m),{"provider-id":x,"default-model":S},{"basic-settings":c(()=>[l(`div`,b,[o(s(d),{modelValue:D.value,"onUpdate:modelValue":r[0]||=e=>D.value=e,label:s(E)(`settings.pages.providers.provider.volcengine.fields.field.appId.label`),description:s(E)(`settings.pages.providers.provider.volcengine.fields.field.appId.description`),required:``},null,8,[`modelValue`,`label`,`description`])])]),"voice-settings":c(()=>[o(s(f),{modelValue:y.value,"onUpdate:modelValue":r[1]||=e=>y.value=e,label:s(E)(`settings.pages.providers.provider.common.fields.field.speed.label`),description:s(E)(`settings.pages.providers.provider.common.fields.field.speed.description`),min:.5,max:2,step:.01},null,8,[`modelValue`,`label`,`description`])]),playground:c(()=>[o(s(h),{"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 +import{A as e,K as t,S as n,W as r,at as i,b as a,k as o,kt as s,lt as c,x as l,xt as u}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-C0YByt49.js";import{d,l as f}from"./src-DYQXbDgu.js";import{a as p}from"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{c as m,u as h}from"./components-CeE-UiLT.js";import{i as g,t as _}from"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import{n as v}from"./vue-i18n.runtime-Dah5zGm4.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-73vyHOZs.js";import"./__vite-browser-external-BaycPy5b.js";import{t as y}from"./route-block-CpjdOEnv.js";var b={flex:`~ col gap-4`},x=`volcengine`,S=`v1`,C=e({__name:`volcengine`,setup(e){let y=u(1),C=_(),w=g(),{providers:T}=p(w),{t:E}=v(),D=a({get:()=>T.value[x]?.app?.appId||``,set:e=>{T.value[x]||(T.value[x]={}),T.value[x].app={appId:e}}}),O=a(()=>!!T.value[x]?.apiKey),k=a(()=>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 r(async()=>{let e=w.getProviderConfig(x);await w.getProviderMetadata(x).validators.validateProviderConfig(e)?await C.loadVoicesForProvider(x):console.error(`Failed to validate provider config`,e)}),i(y,async()=>{let e=w.getProviderConfig(x);e.audio||={},e.audio.speedRatio=y.value}),i([T,D],async()=>{let e=w.getProviderConfig(x);await w.getProviderMetadata(x).validators.validateProviderConfig(e)?await C.loadVoicesForProvider(x):console.error(`Failed to validate provider config`,e)},{immediate:!0}),(e,r)=>(t(),n(s(m),{"provider-id":x,"default-model":S},{"basic-settings":c(()=>[l(`div`,b,[o(s(d),{modelValue:D.value,"onUpdate:modelValue":r[0]||=e=>D.value=e,label:s(E)(`settings.pages.providers.provider.volcengine.fields.field.appId.label`),description:s(E)(`settings.pages.providers.provider.volcengine.fields.field.appId.description`),required:``},null,8,[`modelValue`,`label`,`description`])])]),"voice-settings":c(()=>[o(s(f),{modelValue:y.value,"onUpdate:modelValue":r[1]||=e=>y.value=e,label:s(E)(`settings.pages.providers.provider.common.fields.field.speed.label`),description:s(E)(`settings.pages.providers.provider.common.fields.field.speed.description`),min:.5,max:2,step:.01},null,8,[`modelValue`,`label`,`description`])]),playground:c(()=>[o(s(h),{"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/widgets-CZ9Rvki9.js b/assets/widgets-C0YByt49.js similarity index 99% rename from assets/widgets-CZ9Rvki9.js rename to assets/widgets-C0YByt49.js index e07fc4909cc44a0c75381c3c13f347e8f267b3a3..165ddbaa3cae99a7fecf1aa4b64ca75e90c51199 100644 --- a/assets/widgets-CZ9Rvki9.js +++ b/assets/widgets-C0YByt49.js @@ -1,4 +1,4 @@ -import{$ as e,A as t,B as n,C as r,Ct as i,Dt as a,F as o,G as s,H as c,J as l,K as u,M as d,Mt as f,N as p,Nt as m,O as h,Ot as g,P as _,Pt as v,Q as y,R as b,S as x,Tt as S,W as C,Y as w,at as T,b as E,bt as D,c as ee,f as O,gt as te,j as k,jt as A,k as j,kt as M,lt as N,m as P,mt as ne,n as re,nt as F,ot as I,p as ie,q as ae,rt as oe,ut as se,vt as ce,w as L,wt as R,x as z,xt as B,yt as le,z as V}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import{A as H,E as U,F as ue,G as de,H as fe,I as pe,K as me,L as he,P as ge,Q as _e,R as W,U as ve,X as ye,Y as be,Z as xe,_ as Se,et as Ce,g as we,j as Te,tt as Ee,v as De,x as Oe,y as ke}from"./src-DYQXbDgu.js";import{a as Ae,o as je}from"./vue-router-Chhv6vZu.js";import{h as Me,i as Ne,m as Pe,n as Fe,p as Ie,r as Le}from"./DialogTitle-ytlEE0A-.js";import{t as Re}from"./_plugin-vue_export-helper-DGA9ry_j.js";import{S as ze,i as Be,l as Ve,t as He,u as Ue}from"./dist-Che88T83.js";import{a as We,i as Ge,o as Ke}from"./src-C83SCWbW.js";import{n as qe,t as Je}from"./settings-D1kLcsvA.js";function G(e){return ne()?(ce(e),!0):!1}function Ye(){let e=new Set,t=t=>{e.delete(t)};return{on:n=>{e.add(n);let r=()=>t(n);return G(r),{off:r}},off:t,trigger:(...t)=>Promise.all(Array.from(e).map(e=>e(...t))),clear:()=>{e.clear()}}}var Xe=new WeakMap,Ze=(...e)=>{let t=e[0],n=k()?.proxy;if(n==null&&!_())throw Error(`injectLocal must be called in setup`);return n&&Xe.has(n)&&t in Xe.get(n)?Xe.get(n)[t]:o(...e)};function Qe(e,t){let n=k()?.proxy;if(n==null)throw Error(`provideLocal must be called in setup`);Xe.has(n)||Xe.set(n,Object.create(null));let r=Xe.get(n);return r[e]=t,ae(e,t)}function $e(e,t){let n=t?.injectionKey||Symbol(e.name||`InjectionState`),r=t?.defaultValue;return[(...t)=>{let r=e(...t);return Qe(n,r),r},()=>Ze(n,r)]}var et=typeof window<`u`&&typeof document<`u`;typeof WorkerGlobalScope<`u`&&globalThis instanceof WorkerGlobalScope;var tt=e=>e!=null,nt=Object.prototype.toString,rt=e=>nt.call(e)===`[object Object]`,it=()=>{};function at(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 ot(e,t={}){let n,r,i=it,a=e=>{clearTimeout(e),i(),i=it},o;return s=>{let c=g(e),l=g(t.maxWait);return n&&a(n),c<=0||l!==void 0&&l<=0?(r&&=(a(r),void 0),Promise.resolve(s())):new Promise((e,u)=>{i=t.rejectOnCancel?u:e,o=s,l&&!r&&(r=setTimeout(()=>{n&&a(n),r=void 0,e(o())},l)),n=setTimeout(()=>{r&&a(r),r=void 0,e(s())},c)})}}function st(e,t=!1,n=`Timeout`){return new Promise((r,i)=>{t?setTimeout(()=>i(n),e):setTimeout(r,e)})}function ct(e){return e.endsWith(`rem`)?Number.parseFloat(e)*16:Number.parseFloat(e)}function lt(e){return Array.isArray(e)?e:[e]}function ut(e){return e||k()}function dt(e,t=200,n={}){return at(ot(t,n),e)}function ft(e,t=200,n={}){let r=B(g(e)),a=dt(()=>{r.value=e.value},t,n);return T(e,()=>a()),i(r)}function pt(e,t=!0,r){ut(r)?C(e,r):t?e():n(e)}function mt(e,t){ut(t)&&s(e,t)}function ht(e,t=1e3,n={}){let{immediate:r=!0,immediateCallback:a=!1}=n,o=null,s=R(!1);function c(){o&&=(clearInterval(o),null)}function l(){s.value=!1,c()}function u(){let n=g(t);n<=0||(s.value=!0,a&&e(),c(),s.value&&(o=setInterval(e,n)))}return r&&et&&u(),(te(t)||typeof t==`function`)&&G(T(t,()=>{s.value&&et&&u()})),G(l),{isActive:i(s),pause:l,resume:u}}function gt(e,t,n={}){let{immediate:r=!0,immediateCallback:a=!1}=n,o=R(!1),s;function c(){s&&=(clearTimeout(s),void 0)}function l(){o.value=!1,c()}function u(...n){a&&e(),c(),o.value=!0,s=setTimeout(()=>{o.value=!1,s=void 0,e(...n)},g(t))}return r&&(o.value=!0,et&&u()),G(l),{isPending:i(o),start:u,stop:l}}function _t(e=1e3,t={}){let{controls:n=!1,callback:r}=t,i=gt(r??it,e,t),a=E(()=>!i.isPending.value);return n?{ready:a,...i}:a}function vt(e,t,n){return T(e,t,{...n,immediate:!0})}var yt=et?window:void 0;et&&window.document,et&&window.navigator,et&&window.location;function K(e){let t=g(e);return t?.$el??t}function q(...e){let t=[],n=()=>{t.forEach(e=>e()),t.length=0},r=(e,t,n,r)=>(e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)),i=E(()=>{let t=lt(g(e[0])).filter(e=>e!=null);return t.every(e=>typeof e!=`string`)?t:void 0}),a=vt(()=>[i.value?.map(e=>K(e))??[yt].filter(e=>e!=null),lt(g(i.value?e[1]:e[0])),lt(M(i.value?e[2]:e[1])),g(i.value?e[3]:e[2])],([e,i,a,o])=>{if(n(),!e?.length||!i?.length||!a?.length)return;let s=rt(o)?{...o}:o;t.push(...e.flatMap(e=>i.flatMap(t=>a.map(n=>r(e,t,n,s)))))},{flush:`post`});return G(n),()=>{a(),n()}}function bt(){let e=R(!1),t=k();return t&&C(()=>{e.value=!0},t),e}function xt(e){let t=bt();return E(()=>(t.value,!!e()))}function St(e,t={}){let{immediate:n=!0,fpsLimit:r=void 0,window:i=yt,once:a=!1}=t,o=R(!1),s=E(()=>r?1e3/g(r):null),c=0,l=null;function u(t){if(!o.value||!i)return;c||=t;let n=t-c;if(s.value&&nn&&`matchMedia`in n&&typeof n.matchMedia==`function`),a=R(typeof r==`number`),o=R(),s=R(!1);return I(()=>{if(a.value){a.value=!i.value,s.value=g(e).split(`,`).some(e=>{let t=e.includes(`not all`),n=e.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),i=e.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),a=!!(n||i);return n&&a&&(a=r>=ct(n[1])),i&&a&&(a=r<=ct(i[1])),t?!a:a});return}i.value&&(o.value=n.matchMedia(g(e)),s.value=o.value.matches)}),q(o,`change`,e=>{s.value=e.matches},{passive:!0}),E(()=>s.value)}function Et(e={}){let{window:t=yt}=e,n=R(1),r=Tt(()=>`(resolution: ${n.value}dppx)`,e),i=it;return t&&(i=vt(r,()=>n.value=t.devicePixelRatio)),{pixelRatio:D(n),stop:i}}function Dt(e,t,n={}){let{window:r=yt,...i}=n,a,o=xt(()=>r&&`ResizeObserver`in r),s=()=>{a&&=(a.disconnect(),void 0)},c=T(E(()=>{let t=g(e);return Array.isArray(t)?t.map(e=>K(e)):[K(t)]}),e=>{if(s(),o.value&&r){a=new ResizeObserver(t);for(let t of e)t&&a.observe(t,i)}},{immediate:!0,flush:`post`}),l=()=>{s(),c()};return G(l),{isSupported:o,stop:l}}function Ot(e,t={width:0,height:0},n={}){let{window:r=yt,box:i=`content-box`}=n,a=E(()=>(K(e)?.namespaceURI)?.includes(`svg`)),o=R(t.width),s=R(t.height),{stop:c}=Dt(e,([t])=>{let n=i===`border-box`?t.borderBoxSize:i===`content-box`?t.contentBoxSize:t.devicePixelContentBoxSize;if(r&&a.value){let t=K(e);if(t){let e=t.getBoundingClientRect();o.value=e.width,s.value=e.height}}else if(n){let e=lt(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);pt(()=>{let n=K(e);n&&(o.value=`offsetWidth`in n?n.offsetWidth:t.width,s.value=`offsetHeight`in n?n.offsetHeight:t.height)});let l=T(()=>K(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}}function kt(e,t,n={}){let{root:r,rootMargin:i=`0px`,threshold:a=0,window:o=yt,immediate:s=!0}=n,c=xt(()=>o&&`IntersectionObserver`in o),l=E(()=>lt(g(e)).map(K).filter(tt)),u=it,d=R(s),f=c.value?T(()=>[l.value,K(r),d.value],([e,n])=>{if(u(),!d.value||!e.length)return;let r=new IntersectionObserver(t,{root:K(n),rootMargin:i,threshold:a});e.forEach(e=>e&&r.observe(e)),u=()=>{r.disconnect(),u=it}},{immediate:s,flush:`post`}):it,p=()=>{u(),f(),d.value=!1};return G(p),{isSupported:c,isActive:d,pause(){u(),d.value=!1},resume(){d.value=!0},stop:p}}function At(e){let t=R(0);if(typeof performance>`u`)return t;let n=e?.every??10,r=performance.now(),i=0;return St(()=>{if(i+=1,i>=n){let e=performance.now(),n=e-r;t.value=Math.round(1e3/(n/i)),r=e,i=0}}),t}function jt(e={}){let t=B(),n=xt(()=>typeof performance<`u`&&`memory`in performance);if(n.value){let{interval:n=1e3}=e;ht(()=>{t.value=performance.memory},n,{immediate:e.immediate,immediateCallback:e.immediateCallback})}return{isSupported:n,memory:t}}function Mt(e={}){let{window:t=yt,initialWidth:n=1/0,initialHeight:r=1/0,listenOrientation:i=!0,includeScrollbar:a=!0,type:o=`inner`}=e,s=R(n),c=R(r),l=()=>{if(t)if(o===`outer`)s.value=t.outerWidth,c.value=t.outerHeight;else if(o===`visual`&&t.visualViewport){let{width:e,height:n,scale:r}=t.visualViewport;s.value=Math.round(e*r),c.value=Math.round(n*r)}else a?(s.value=t.innerWidth,c.value=t.innerHeight):(s.value=t.document.documentElement.clientWidth,c.value=t.document.documentElement.clientHeight)};l(),pt(l);let u={passive:!0};return q(`resize`,l,u),t&&o===`visual`&&t.visualViewport&&q(t.visualViewport,`resize`,l,u),i&&T(Tt(`(orientation: portrait)`),()=>l()),{width:s,height:c}}var Nt=1/60*1e3,Pt=typeof performance<`u`?()=>performance.now():()=>Date.now(),Ft=typeof window<`u`?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(Pt()),Nt);function It(e){let t=[],n=[],r=0,i=!1,a=!1,o=new WeakSet,s={schedule:(e,a=!1,s=!1)=>{let c=s&&i,l=c?t:n;return a&&o.add(e),l.indexOf(e)===-1&&(l.push(e),c&&i&&(r=t.length)),e},cancel:e=>{let t=n.indexOf(e);t!==-1&&n.splice(t,1),o.delete(e)},process:c=>{if(i){a=!0;return}if(i=!0,[t,n]=[n,t],n.length=0,r=t.length,r)for(let n=0;n(e[t]=It(()=>zt=!0),e),{}),Wt=Ht.reduce((e,t)=>{let n=Ut[t];return e[t]=(e,t=!1,r=!1)=>(zt||Jt(),n.schedule(e,t,r)),e},{}),Gt=Ht.reduce((e,t)=>(e[t]=Ut[t].cancel,e),{});Ht.reduce((e,t)=>(e[t]=()=>Ut[t].process(Vt),e),{});var Kt=e=>Ut[e].process(Vt),qt=e=>{zt=!1,Vt.delta=Rt?Nt:Math.max(Math.min(e-Vt.timestamp,Lt),1),Vt.timestamp=e,Bt=!0,Ht.forEach(Kt),Bt=!1,zt&&(Rt=!1,Ft(qt))},Jt=()=>{zt=!0,Rt=!0,Bt||Ft(qt)},Yt=()=>Vt,Xt=Wt;function Zt(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);iMath.min(Math.max(n,e),t),$t=.001,en=.01,tn=.05;function nn({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let i,a,o=1-t;o=Qt(tn,1,o),e=Qt(en,10,e/1e3),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=on(t,o),c=Math.exp(-i);return $t-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o**2*t**2*e,c=Math.exp(-r),l=on(t**2,o);return(-i(t)+$t>0?-1:1)*((a-s)*c)/l}):(i=t=>{let r=Math.exp(-t*e),i=(t-n)*e+1;return-$t+r*i},a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=an(i,a,s);if(e*=1e3,isNaN(c))return{stiffness:100,damping:10,duration:e};{let t=c**2*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}var rn=12;function an(e,t,n){let r=n;for(let n=1;ne[t]!==void 0)}function un(e){let t=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},e);if(!ln(e,cn)&&ln(e,sn)){let n=nn(e);t=Object.assign(Object.assign(Object.assign({},t),n),{velocity:0,mass:1}),t.isResolvedFromDuration=!0}return t}function dn(e){var{from:t=0,to:n=1,restSpeed:r=2,restDelta:i}=e,a=Zt(e,[`from`,`to`,`restSpeed`,`restDelta`]);let o={done:!1,value:t},{stiffness:s,damping:c,mass:l,velocity:u,duration:d,isResolvedFromDuration:f}=un(a),p=fn,m=fn;function h(){let e=u?-(u/1e3):0,r=n-t,a=c/(2*Math.sqrt(s*l)),o=Math.sqrt(s/l)/1e3;if(i===void 0&&(i=Math.min(Math.abs(n-t)/100,.4)),a<1){let t=on(o,a);p=i=>{let s=Math.exp(-a*o*i);return n-s*((e+a*o*r)/t*Math.sin(t*i)+r*Math.cos(t*i))},m=n=>{let i=Math.exp(-a*o*n);return a*o*i*(Math.sin(t*n)*(e+a*o*r)/t+r*Math.cos(t*n))-i*(Math.cos(t*n)*(e+a*o*r)-t*r*Math.sin(t*n))}}else if(a===1)p=t=>n-Math.exp(-o*t)*(r+(e+o*r)*t);else{let t=o*Math.sqrt(a*a-1);p=i=>{let s=Math.exp(-a*o*i),c=Math.min(t*i,300);return n-s*((e+a*o*r)*Math.sinh(c)+t*r*Math.cosh(c))/t}}}return h(),{next:e=>{let t=p(e);if(f)o.done=e>=d;else{let a=m(e)*1e3,s=Math.abs(a)<=r,c=Math.abs(n-t)<=i;o.done=s&&c}return o.value=o.done?n:t,o},flipTarget:()=>{u=-u,[t,n]=[n,t],h()}}}dn.needsInterpolation=(e,t)=>typeof e==`string`||typeof t==`string`;var fn=e=>0,pn=(e,t,n)=>{let r=t-e;return r===0?1:(n-e)/r},mn=(e,t,n)=>-n*e+n*t+e,hn=(e,t)=>n=>Math.max(Math.min(n,t),e),gn=e=>e%1?Number(e.toFixed(5)):e,_n=/(-)?([\d]*\.?[\d])+/g,vn=/(#[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,yn=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function bn(e){return typeof e==`string`}var xn={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},Sn=Object.assign(Object.assign({},xn),{transform:hn(0,1)}),Cn=Object.assign(Object.assign({},xn),{default:1}),wn=e=>({test:t=>bn(t)&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Tn=wn(`deg`),En=wn(`%`),J=wn(`px`);wn(`vh`),wn(`vw`);var Dn=Object.assign(Object.assign({},En),{parse:e=>En.parse(e)/100,transform:e=>En.transform(e*100)}),On=(e,t)=>n=>!!(bn(n)&&yn.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),kn=(e,t,n)=>r=>{if(!bn(r))return r;let[i,a,o,s]=r.match(_n);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},An={test:On(`hsl`,`hue`),parse:kn(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+En.transform(gn(t))+`, `+En.transform(gn(n))+`, `+gn(Sn.transform(r))+`)`},jn=hn(0,255),Mn=Object.assign(Object.assign({},xn),{transform:e=>Math.round(jn(e))}),Nn={test:On(`rgb`,`red`),parse:kn(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+Mn.transform(e)+`, `+Mn.transform(t)+`, `+Mn.transform(n)+`, `+gn(Sn.transform(r))+`)`};function Pn(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substr(1,2),n=e.substr(3,2),r=e.substr(5,2),i=e.substr(7,2)):(t=e.substr(1,1),n=e.substr(2,1),r=e.substr(3,1),i=e.substr(4,1),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var Fn={test:On(`#`),parse:Pn,transform:Nn.transform},Y={test:e=>Nn.test(e)||Fn.test(e)||An.test(e),parse:e=>Nn.test(e)?Nn.parse(e):An.test(e)?An.parse(e):Fn.parse(e),transform:e=>bn(e)?e:e.hasOwnProperty(`red`)?Nn.transform(e):An.transform(e)},In="${c}",Ln="${n}";function Rn(e){return isNaN(e)&&bn(e)&&(e.match(_n)?.length??0)+(e.match(vn)?.length??0)>0}function zn(e){typeof e==`number`&&(e=`${e}`);let t=[],n=0,r=e.match(vn);r&&(n=r.length,e=e.replace(vn,In),t.push(...r.map(Y.parse)));let i=e.match(_n);return i&&(e=e.replace(_n,Ln),t.push(...i.map(xn.parse))),{values:t,numColors:n,tokenised:e}}function Bn(e){return zn(e).values}function Vn(e){let{values:t,numColors:n,tokenised:r}=zn(e),i=t.length;return e=>{let t=r;for(let r=0;rtypeof e==`number`?0:e;function Un(e){let t=Bn(e);return Vn(e)(t.map(Hn))}var Wn={test:Rn,parse:Bn,createTransformer:Vn,getAnimatableNone:Un},Gn=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function Kn(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(_n)||[];if(!r)return e;let i=n.replace(r,``),a=Gn.has(t)?1:0;return r!==n&&(a*=100),t+`(`+a+i+`)`}var qn=/([a-z-]*)\(.*?\)/g,Jn=Object.assign(Object.assign({},Wn),{getAnimatableNone:e=>{let t=e.match(qn);return t?t.map(Kn).join(` `):e}});function Yn(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Xn({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=Yn(s,r,e+1/3),a=Yn(s,r,e),o=Yn(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}var Zn=(e,t,n)=>{let r=e*e,i=t*t;return Math.sqrt(Math.max(0,n*(i-r)+r))},Qn=[Fn,Nn,An],$n=e=>Qn.find(t=>t.test(e)),er=e=>`'${e}' is not an animatable color. Use the equivalent color code instead.`,tr=(e,t)=>{let n=$n(e),r=$n(t);er(e),er(t);let i=n.parse(e),a=r.parse(t);n===An&&(i=Xn(i),n=Nn),r===An&&(a=Xn(a),r=Nn);let o=Object.assign({},i);return e=>{for(let t in o)t!==`alpha`&&(o[t]=Zn(i[t],a[t],e));return o.alpha=mn(i.alpha,a.alpha,e),n.transform(o)}},nr=e=>typeof e==`number`,rr=(e,t)=>n=>t(e(n)),ir=(...e)=>e.reduce(rr);function ar(e,t){return nr(e)?n=>mn(e,t,n):Y.test(e)?tr(e,t):lr(e,t)}var or=(e,t)=>{let n=[...e],r=n.length,i=e.map((e,n)=>ar(e,t[n]));return e=>{for(let t=0;t{let n=Object.assign(Object.assign({},e),t),r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=ar(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}};function cr(e){let t=Wn.parse(e),n=t.length,r=0,i=0,a=0;for(let e=0;e{let n=Wn.createTransformer(t),r=cr(e),i=cr(t);return r.numHSL===i.numHSL&&r.numRGB===i.numRGB&&r.numNumbers>=i.numNumbers?ir(or(r.parsed,i.parsed),n):(`${e}${t}`,n=>`${n>0?t:e}`)},ur=(e,t)=>n=>mn(e,t,n);function dr(e){if(typeof e==`number`)return ur;if(typeof e==`string`)return Y.test(e)?tr:lr;if(Array.isArray(e))return or;if(typeof e==`object`)return sr}function fr(e,t,n){let r=[],i=n||dr(e[0]),a=e.length-1;for(let n=0;nn(pn(e,t,r))}function mr(e,t){let n=e.length,r=n-1;return i=>{let a=0,o=!1;if(i<=e[0]?o=!0:i>=e[r]&&(a=r-1,o=!0),!o){let t=1;for(;ti||t===r);t++);a=t-1}let s=pn(e[a],e[a+1],i);return t[a](s)}}function hr(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;t.length,!r||!Array.isArray(r)||(r.length,a-1),e[0]>e[a-1]&&(e=[].concat(e),t=[].concat(t),e.reverse(),t.reverse());let o=fr(t,r,i),s=a===2?pr(e,o):mr(e,o);return n?t=>s(Qt(e[0],e[a-1],t)):s}var gr=e=>t=>1-e(1-t),_r=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,vr=e=>t=>t**+e,yr=e=>t=>t*t*((e+1)*t-e),br=e=>{let t=yr(e);return e=>(e*=2)<1?.5*t(e):.5*(2-2**(-10*(e-1)))},xr=1.525,Sr=4/11,Cr=8/11,wr=9/10,Tr=e=>e,Er=vr(2),Dr=gr(Er),Or=_r(Er),kr=e=>1-Math.sin(Math.acos(e)),Ar=gr(kr),jr=_r(Ar),Mr=yr(xr),Nr=gr(Mr),Pr=_r(Mr),Fr=br(xr),Ir=4356/361,Lr=35442/1805,Rr=16061/1805,zr=e=>{if(e===1||e===0)return e;let t=e*e;return ee<.5?.5*(1-zr(1-e*2)):.5*zr(e*2-1)+.5;function Hr(e,t){return e.map(()=>t||Or).splice(0,e.length-1)}function Ur(e){let t=e.length;return e.map((e,n)=>n===0?0:n/(t-1))}function Wr(e,t){return e.map(e=>e*t)}function Gr({from:e=0,to:t=1,ease:n,offset:r,duration:i=300}){let a={done:!1,value:e},o=Array.isArray(t)?t:[e,t],s=Wr(r&&r.length===o.length?r:Ur(o),i);function c(){return hr(s,o,{ease:Array.isArray(n)?n:Hr(o,n)})}let l=c();return{next:e=>(a.value=l(e),a.done=e>=i,a),flipTarget:()=>{o.reverse(),l=c()}}}function Kr({velocity:e=0,from:t=0,power:n=.8,timeConstant:r=350,restDelta:i=.5,modifyTarget:a}){let o={done:!1,value:t},s=n*e,c=t+s,l=a===void 0?c:a(c);return l!==c&&(s=l-t),{next:e=>{let t=-s*Math.exp(-e/r);return o.done=!(t>i||t<-i),o.value=o.done?l:l+t,o},flipTarget:()=>{}}}var qr={keyframes:Gr,spring:dn,decay:Kr};function Jr(e){if(Array.isArray(e.to))return Gr;if(qr[e.type])return qr[e.type];let t=new Set(Object.keys(e));return t.has(`ease`)||t.has(`duration`)&&!t.has(`dampingRatio`)?Gr:t.has(`dampingRatio`)||t.has(`stiffness`)||t.has(`mass`)||t.has(`damping`)||t.has(`restSpeed`)||t.has(`restDelta`)?dn:Gr}function Yr(e,t,n=0){return e-t-n}function Xr(e,t,n=0,r=!0){return r?Yr(t+-e,t,n):t-(e-t)+n}function Zr(e,t,n,r){return r?e>=t+n:e<=-n}var Qr=e=>{let t=({delta:t})=>e(t);return{start:()=>Xt.update(t,!0),stop:()=>Gt.update(t)}};function $r(e){var t,{from:n,autoplay:r=!0,driver:i=Qr,elapsed:a=0,repeat:o=0,repeatType:s=`loop`,repeatDelay:c=0,onPlay:l,onStop:u,onComplete:d,onRepeat:f,onUpdate:p}=e,m=Zt(e,[`from`,`autoplay`,`driver`,`elapsed`,`repeat`,`repeatType`,`repeatDelay`,`onPlay`,`onStop`,`onComplete`,`onRepeat`,`onUpdate`]);let{to:h}=m,g,_=0,v=m.duration,y,b=!1,x=!0,S,C=Jr(m);(t=C).needsInterpolation?.call(t,n,h)&&(S=hr([0,100],[n,h],{clamp:!1}),n=0,h=100);let w=C(Object.assign(Object.assign({},m),{from:n,to:h}));function T(){_++,s===`reverse`?(x=_%2==0,a=Xr(a,v,c,x)):(a=Yr(a,v,c),s===`mirror`&&w.flipTarget()),b=!1,f&&f()}function E(){g.stop(),d&&d()}function D(e){if(x||(e=-e),a+=e,!b){let e=w.next(Math.max(0,a));y=e.value,S&&(y=S(y)),b=x?e.done:a<=0}p?.(y),b&&(_===0&&(v??=a),_{u?.(),g.stop()}}}function ei(e,t){return t?1e3/t*e:0}function ti({from:e=0,velocity:t=0,min:n,max:r,power:i=.8,timeConstant:a=750,bounceStiffness:o=500,bounceDamping:s=10,restDelta:c=1,modifyTarget:l,driver:u,onUpdate:d,onComplete:f,onStop:p}){let m;function h(e){return n!==void 0&&er}function g(e){return n===void 0?r:r===void 0||Math.abs(n-e){var n;d?.(t),(n=e.onUpdate)==null||n.call(e,t)},onComplete:f,onStop:p}))}function v(e){_(Object.assign({type:`spring`,stiffness:o,damping:s,restDelta:c},e))}if(h(e))v({from:e,velocity:t,to:g(e)});else{let r=i*t+e;l!==void 0&&(r=l(r));let o=g(r),s=o===n?-1:1,u,d;_({type:`decay`,from:e,velocity:t,timeConstant:a,power:i,restDelta:c,modifyTarget:l,onUpdate:h(r)?e=>{u=d,d=e,t=ei(e-u,Yt().delta),(s===1&&e>o||s===-1&&em?.stop()}}var ni=(e,t)=>1-3*t+3*e,ri=(e,t)=>3*t-6*e,ii=e=>3*e,ai=(e,t,n)=>((ni(t,n)*e+ri(t,n))*e+ii(t))*e,oi=(e,t,n)=>3*ni(t,n)*e*e+2*ri(t,n)*e+ii(t),si=1e-7,ci=10;function li(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=ai(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>si&&++s=di?fi(t,c,e,n):l===0?c:li(t,r,r+mi,e,n)}return e=>e===0||e===1?e:ai(a(e),t,r)}var gi={},_i=class{subscriptions=new Set;add(e){return this.subscriptions.add(e),()=>this.subscriptions.delete(e)}notify(e,t,n){if(this.subscriptions.size)for(let r of this.subscriptions)r(e,t,n)}clear(){this.subscriptions.clear()}};function vi(e){return!Number.isNaN(Number.parseFloat(e))}var yi=class{current;prev;timeDelta=0;lastUpdated=0;updateSubscribers=new _i;stopAnimation;canTrackVelocity=!1;constructor(e){this.prev=this.current=e,this.canTrackVelocity=vi(this.current)}onChange(e){return this.updateSubscribers.add(e)}clearListeners(){this.updateSubscribers.clear()}set(e){this.updateAndNotify(e)}updateAndNotify=e=>{this.prev=this.current,this.current=e;let{delta:t,timestamp:n}=Yt();this.lastUpdated!==n&&(this.timeDelta=t,this.lastUpdated=n),Xt.postRender(this.scheduleVelocityCheck),this.updateSubscribers.notify(this.current)};get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?ei(Number.parseFloat(this.current)-Number.parseFloat(this.prev),this.timeDelta):0}scheduleVelocityCheck=()=>Xt.postRender(this.velocityCheck);velocityCheck=({timestamp:e})=>{this.canTrackVelocity||=vi(this.current),e!==this.lastUpdated&&(this.prev=this.current)};start(e){return this.stop(),new Promise(t=>{let{stop:n}=e(t);this.stopAnimation=n}).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 bi(e){return new yi(e)}var{isArray:xi}=Array;function Si(){let e=B({}),t=t=>{let n=t=>{e.value[t]&&(e.value[t].stop(),e.value[t].destroy(),delete e.value[t])};t?xi(t)?t.forEach(n):n(t):Object.keys(e.value).forEach(n)};return mt(t),{motionValues:e,get:(t,n,r)=>{if(e.value[t])return e.value[t];let i=bi(n);return i.onChange(e=>r[t]=e),e.value[t]=i,i},stop:t}}function Ci(e){return Array.isArray(e)}function wi(){return{type:`spring`,stiffness:500,damping:25,restDelta:.5,restSpeed:10}}function Ti(e){return{type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restDelta:.01,restSpeed:10}}function Ei(e){return{type:`spring`,stiffness:550,damping:e===0?100:30,restDelta:.01,restSpeed:10}}function Di(){return{type:`keyframes`,ease:`linear`,duration:300}}function Oi(e){return{type:`keyframes`,duration:800,values:e}}var ki={default:Ei,x:wi,y:wi,z:wi,rotate:wi,rotateX:wi,rotateY:wi,rotateZ:wi,scaleX:Ti,scaleY:Ti,scale:Ti,backgroundColor:Di,color:Di,opacity:Di};function Ai(e,t){let n;return n=Ci(t)?Oi:ki[e]||ki.default,{to:t,...n(t)}}var ji={...xn,transform:Math.round},Mi={color:Y,backgroundColor:Y,outlineColor:Y,fill:Y,stroke:Y,borderColor:Y,borderTopColor:Y,borderRightColor:Y,borderBottomColor:Y,borderLeftColor:Y,borderWidth:J,borderTopWidth:J,borderRightWidth:J,borderBottomWidth:J,borderLeftWidth:J,borderRadius:J,radius:J,borderTopLeftRadius:J,borderTopRightRadius:J,borderBottomRightRadius:J,borderBottomLeftRadius:J,width:J,maxWidth:J,height:J,maxHeight:J,size:J,top:J,right:J,bottom:J,left:J,padding:J,paddingTop:J,paddingRight:J,paddingBottom:J,paddingLeft:J,margin:J,marginTop:J,marginRight:J,marginBottom:J,marginLeft:J,rotate:Tn,rotateX:Tn,rotateY:Tn,rotateZ:Tn,scale:Cn,scaleX:Cn,scaleY:Cn,scaleZ:Cn,skew:Tn,skewX:Tn,skewY:Tn,distance:J,translateX:J,translateY:J,translateZ:J,x:J,y:J,z:J,perspective:J,transformPerspective:J,opacity:Sn,originX:Dn,originY:Dn,originZ:J,zIndex:ji,filter:Jn,WebkitFilter:Jn,fillOpacity:Sn,strokeOpacity:Sn,numOctaves:ji},Ni=e=>Mi[e];function Pi(e,t){return t&&typeof e==`number`&&t.transform?t.transform(e):e}function Fi(e,t){let n=Ni(e);return n!==Jn&&(n=Wn),n.getAnimatableNone?n.getAnimatableNone(t):void 0}var Ii={linear:Tr,easeIn:Er,easeInOut:Or,easeOut:Dr,circIn:kr,circInOut:jr,circOut:Ar,backIn:Mr,backInOut:Pr,backOut:Nr,anticipate:Fr,bounceIn:Br,bounceInOut:Vr,bounceOut:zr};function Li(e){if(Array.isArray(e)){let[t,n,r,i]=e;return hi(t,n,r,i)}else if(typeof e==`string`)return Ii[e];return e}function Ri(e){return Array.isArray(e)&&typeof e[0]!=`number`}function zi(e,t){return e===`zIndex`?!1:!!(typeof t==`number`||Array.isArray(t)||typeof t==`string`&&Wn.test(t)&&!t.startsWith(`url(`))}function Bi(e){return Array.isArray(e.to)&&e.to[0]===null&&(e.to=[...e.to],e.to[0]=e.from),e}function Vi({ease:e,times:t,delay:n,...r}){let i={...r};return t&&(i.offset=t),e&&(i.ease=Ri(e)?e.map(Li):Li(e)),n&&(i.elapsed=-n),i}function Hi(e,t,n){return Array.isArray(t.to)&&(e.duration||=800),Bi(t),Ui(e)||(e={...e,...Ai(n,t.to)}),{...t,...Vi(e)}}function Ui({delay:e,repeat:t,repeatType:n,repeatDelay:r,from:i,...a}){return!!Object.keys(a).length}function Wi(e,t){return e[t]||e.default||e}function Gi(e,t,n,r,i){let a=Wi(r,e),o=a.from===null||a.from===void 0?t.get():a.from,s=zi(e,n);o===`none`&&s&&typeof n==`string`&&(o=Fi(e,n));let c=zi(e,o);function l(s){let c={from:o,to:n,velocity:r.velocity?r.velocity:t.getVelocity(),onUpdate:e=>t.set(e)};return a.type===`inertia`||a.type===`decay`?ti({...c,...a}):$r({...Hi(a,c,e),onUpdate:e=>{c.onUpdate(e),a.onUpdate&&a.onUpdate(e)},onComplete:()=>{i&&i(),s&&s()}})}function u(e){return t.set(n),i&&i(),e&&e(),{stop:()=>{}}}return!c||!s||a.type===!1?u:l}function Ki(){let{motionValues:e,stop:t,get:n}=Si();return{motionValues:e,stop:t,push:(e,t,r,i={},a)=>{let o=r[e],s=n(e,o,r);if(i&&i.immediate){s.set(t);return}let c=Gi(e,s,t,i,a);s.start(c)}}}function qi(e,t={},{motionValues:n,push:r,stop:i}=Ki()){let a=M(t),o=B(!1);T(n,e=>{o.value=Object.values(e).filter(e=>e.isAnimating()).length>0},{immediate:!0,deep:!0});let s=e=>{if(!a||!a[e])throw Error(`The variant ${e} does not exist.`);return a[e]},c=t=>{typeof t==`string`&&(t=s(t));let n=Object.entries(t).map(([n,i])=>{if(n!==`transition`)return new Promise(a=>r(n,i,e,t.transition||Ai(n,t[n]),a))}).filter(Boolean);async function i(){await Promise.all(n),t.transition?.onComplete?.()}return Promise.all([i()])};return{isAnimating:o,apply:c,set:t=>{let n=rt(t)?t:s(t);Object.entries(n).forEach(([t,n])=>{t!==`transition`&&r(t,n,e,{immediate:!0})})},leave:async e=>{let t;if(a&&(a.leave&&(t=a.leave),!a.leave&&a.initial&&(t=a.initial)),!t){e();return}await c(t),e()},stop:i}}var Ji=typeof window<`u`,Yi=()=>Ji&&(window.onpointerdown===null||void 0),Xi=()=>Ji&&(window.ontouchstart===null||void 0),Zi=()=>Ji&&(window.onmousedown===null||void 0);function Qi({target:e,state:t,variants:n,apply:r}){let i=M(n),a=B(!1),o=B(!1),s=B(!1),c=E(()=>{let e=[...Object.keys(t.value||{})];return i?(i.hovered&&(e=[...e,...Object.keys(i.hovered)]),i.tapped&&(e=[...e,...Object.keys(i.tapped)]),i.focused&&(e=[...e,...Object.keys(i.focused)]),e):e}),l=E(()=>{let e={};for(let n in Object.assign(e,t.value),a.value&&i.hovered&&Object.assign(e,i.hovered),o.value&&i.tapped&&Object.assign(e,i.tapped),s.value&&i.focused&&Object.assign(e,i.focused),e)c.value.includes(n)||delete e[n];return e});i.hovered&&(q(e,`mouseenter`,()=>a.value=!0),q(e,`mouseleave`,()=>{a.value=!1,o.value=!1})),i.tapped&&(Zi()&&(q(e,`mousedown`,()=>o.value=!0),q(e,`mouseup`,()=>o.value=!1)),Yi()&&(q(e,`pointerdown`,()=>o.value=!0),q(e,`pointerup`,()=>o.value=!1)),Xi()&&(q(e,`touchstart`,()=>o.value=!0),q(e,`touchend`,()=>o.value=!1))),i.focused&&(q(e,`focus`,()=>s.value=!0),q(e,`blur`,()=>s.value=!1)),T([a,o,s],()=>{r(l.value)})}function $i({set:e,target:t,variants:n,variant:r}){let i=M(n);T(()=>t,()=>{i&&(i.initial&&(e(`initial`),r.value=`initial`),i.enter&&(r.value=`enter`))},{immediate:!0,flush:`pre`})}function ea({state:e,apply:t}){T(e,e=>{e&&t(e)},{immediate:!0})}function ta({target:e,variants:t,variant:n}){let r=M(t);r&&(r.visible||r.visibleOnce)&&kt(e,([{isIntersecting:e}])=>{r.visible?e?n.value=`visible`:n.value=`initial`:r.visibleOnce&&(e&&n.value!==`visibleOnce`?n.value=`visibleOnce`:n.value||=`initial`)})}function na(e,t={syncVariants:!0,lifeCycleHooks:!0,visibilityHooks:!0,eventListeners:!0}){t.lifeCycleHooks&&$i(e),t.syncVariants&&ea(e),t.visibilityHooks&&ta(e),t.eventListeners&&Qi(e)}function ra(e={}){let t=le({...e}),n=B({});return T(t,()=>{let e={};for(let[n,r]of Object.entries(t))e[n]=Pi(r,Ni(n));n.value=e},{immediate:!0,deep:!0}),{state:t,style:n}}function ia(e,t){T(()=>K(e),e=>{e&&t(e)},{immediate:!0})}var aa={x:`translateX`,y:`translateY`,z:`translateZ`};function oa(e={},t=!0){let n=le({...e}),r=B(``);return T(n,e=>{let n=``,i=!1;if(t&&(e.x||e.y||e.z)){let t=[e.x||0,e.y||0,e.z||0].map(e=>Pi(e,J)).join(`,`);n+=`translate3d(${t}) `,i=!0}for(let[r,i]of Object.entries(e)){if(t&&(r===`x`||r===`y`||r===`z`))continue;let e=Pi(i,Ni(r));n+=`${aa[r]||r}(${e}) `}t&&!i&&(n+=`translateZ(0px) `),r.value=n.trim()},{immediate:!0,deep:!0}),{state:n,transform:r}}var sa=[``,`X`,`Y`,`Z`],ca=[`perspective`,`translate`,`scale`,`rotate`,`skew`],la=[`transformPerspective`,`x`,`y`,`z`];ca.forEach(e=>{sa.forEach(t=>{let n=e+t;la.push(n)})});var ua=new Set(la);function da(e){return ua.has(e)}var fa=new Set([`originX`,`originY`,`originZ`]);function pa(e){return fa.has(e)}function ma(e){let t={},n={};return Object.entries(e).forEach(([e,r])=>{da(e)||pa(e)?t[e]=r:n[e]=r}),{transform:t,style:n}}function ha(e){let{transform:t,style:n}=ma(e),{transform:r}=oa(t),{style:i}=ra(n);return r.value&&(i.value.transform=r.value),i.value}function ga(e,t){let n,r,{state:i,style:a}=ra();return ia(e,e=>{r=e;for(let t of Object.keys(Mi))e.style[t]===null||e.style[t]===``||da(t)||pa(t)||(i[t]=e.style[t]);n&&Object.entries(n).forEach(([t,n])=>e.style[t]=n),t&&t(i)}),T(a,e=>{if(!r){n=e;return}for(let t in e)r.style[t]=e[t]},{immediate:!0}),{style:i}}function _a(e){let t=e.trim().split(/\) |\)/);if(t.length===1)return{};let n=e=>e.endsWith(`px`)||e.endsWith(`deg`)?Number.parseFloat(e):Number.isNaN(Number(e))?Number(e):e;return t.reduce((e,t)=>{if(!t)return e;let[r,i]=t.split(`(`),a=i.split(`,`).map(e=>n(e.endsWith(`)`)?e.replace(`)`,``):e.trim())),o=a.length===1?a[0]:a;return{...e,[r]:o}},{})}function va(e,t){Object.entries(_a(t)).forEach(([t,n])=>{let r=[`x`,`y`,`z`];if(t===`translate3d`){if(n===0){r.forEach(t=>e[t]=0);return}n.forEach((t,n)=>e[r[n]]=t);return}if(n=Number.parseFloat(`${n}`),t===`translateX`){e.x=n;return}if(t===`translateY`){e.y=n;return}if(t===`translateZ`){e.z=n;return}e[t]=n})}function ya(e,t){let n,r,{state:i,transform:a}=oa();return ia(e,e=>{r=e,e.style.transform&&va(i,e.style.transform),n&&(e.style.transform=n),t&&t(i)}),T(a,e=>{if(!r){n=e;return}r.style.transform=e},{immediate:!0}),{transform:i}}function ba(e){return Object.entries(e)}function xa(e,t){let n=le({}),r=e=>Object.entries(e).forEach(([e,t])=>n[e]=t),{style:i}=ga(e,r),{transform:a}=ya(e,r);return T(n,e=>{ba(e).forEach(([e,t])=>{let n=da(e)?a:i;n[e]&&n[e]===t||(n[e]=t)})},{immediate:!0,deep:!0}),ia(e,()=>t&&r(t)),{motionProperties:n,style:i,transform:a}}function Sa(e={}){let t=M(e),n=B();return{state:E(()=>{if(n.value)return t[n.value]}),variant:n}}function Ca(e,t={},n){let{motionProperties:r}=xa(e),{variant:i,state:a}=Sa(t),o={target:e,variant:i,variants:t,state:a,motionProperties:r,...qi(r,t)};return na(o,n),o}var wa=[`delay`,`duration`],Ta=[`initial`,`enter`,`leave`,`visible`,`visible-once`,`visibleOnce`,`hovered`,`tapped`,`focused`,...wa];function Ea(e){return wa.includes(e)}function Da(e,t){let n=e.props?e.props:e.data&&e.data.attrs?e.data.attrs:{};if(n){n.variants&&rt(n.variants)&&(t.value={...t.value,...n.variants});for(let e of Ta)if(!(!n||!n[e])){if(Ea(e)&&typeof n[e]==`number`){for(let r of[`enter`,`visible`,`visibleOnce`]){let i=t.value[r];i!=null&&(i.transition??={},i.transition[e]=n[e])}continue}if(rt(n[e])){let r=n[e];e===`visible-once`&&(e=`visibleOnce`),t.value[e]=r}}}}function Oa(e,t=!1){return{created:(n,r,i)=>{let a=r.value&&typeof r.value==`string`?r.value:i.key;a&&gi[a]&&gi[a].stop();let o=B(t?structuredClone(S(e)||{}):e||{});typeof r.value==`object`&&(o.value=r.value),Da(i,o);let s=Ca(n,o,{eventListeners:!0,lifeCycleHooks:!0,syncVariants:!0,visibilityHooks:!1});n.motionInstance=s,a&&(gi[a]=s)},mounted:(e,t,n)=>{e.motionInstance&&ta(e.motionInstance)},getSSRProps(t,n){let{initial:r}=t.value||n&&n?.props||{};r=M(r);let i=Ee({},e?.initial||{},r||{});if(!(!i||Object.keys(i).length===0))return{style:ha(i)}}}}var ka={__proto__:null,fade:{initial:{opacity:0},enter:{opacity:1}},fadeVisible:{initial:{opacity:0},visible:{opacity:1}},fadeVisibleOnce:{initial:{opacity:0},visibleOnce:{opacity:1}},pop:{initial:{scale:0,opacity:0},enter:{scale:1,opacity:1}},popVisible:{initial:{scale:0,opacity:0},visible:{scale:1,opacity:1}},popVisibleOnce:{initial:{scale:0,opacity:0},visibleOnce:{scale:1,opacity:1}},rollBottom:{initial:{y:100,rotate:90,opacity:0},enter:{y:0,rotate:0,opacity:1}},rollLeft:{initial:{x:-100,rotate:90,opacity:0},enter:{x:0,rotate:0,opacity:1}},rollRight:{initial:{x:100,rotate:-90,opacity:0},enter:{x:0,rotate:0,opacity:1}},rollTop:{initial:{y:-100,rotate:-90,opacity:0},enter:{y:0,rotate:0,opacity:1}},rollVisibleBottom:{initial:{y:100,rotate:90,opacity:0},visible:{y:0,rotate:0,opacity:1}},rollVisibleLeft:{initial:{x:-100,rotate:90,opacity:0},visible:{x:0,rotate:0,opacity:1}},rollVisibleOnceBottom:{initial:{y:100,rotate:90,opacity:0},visibleOnce:{y:0,rotate:0,opacity:1}},rollVisibleOnceLeft:{initial:{x:-100,rotate:90,opacity:0},visibleOnce:{x:0,rotate:0,opacity:1}},rollVisibleOnceRight:{initial:{x:100,rotate:-90,opacity:0},visibleOnce:{x:0,rotate:0,opacity:1}},rollVisibleOnceTop:{initial:{y:-100,rotate:-90,opacity:0},visibleOnce:{y:0,rotate:0,opacity:1}},rollVisibleRight:{initial:{x:100,rotate:-90,opacity:0},visible:{x:0,rotate:0,opacity:1}},rollVisibleTop:{initial:{y:-100,rotate:-90,opacity:0},visible:{y:0,rotate:0,opacity:1}},slideBottom:{initial:{y:100,opacity:0},enter:{y:0,opacity:1}},slideLeft:{initial:{x:-100,opacity:0},enter:{x:0,opacity:1}},slideRight:{initial:{x:100,opacity:0},enter:{x:0,opacity:1}},slideTop:{initial:{y:-100,opacity:0},enter:{y:0,opacity:1}},slideVisibleBottom:{initial:{y:100,opacity:0},visible:{y:0,opacity:1}},slideVisibleLeft:{initial:{x:-100,opacity:0},visible:{x:0,opacity:1}},slideVisibleOnceBottom:{initial:{y:100,opacity:0},visibleOnce:{y:0,opacity:1}},slideVisibleOnceLeft:{initial:{x:-100,opacity:0},visibleOnce:{x:0,opacity:1}},slideVisibleOnceRight:{initial:{x:100,opacity:0},visibleOnce:{x:0,opacity:1}},slideVisibleOnceTop:{initial:{y:-100,opacity:0},visibleOnce:{y:0,opacity:1}},slideVisibleRight:{initial:{x:100,opacity:0},visible:{x:0,opacity:1}},slideVisibleTop:{initial:{y:-100,opacity:0},visible:{y:0,opacity:1}}};function Aa(e){let t=`àáâäæãåāăąçćčđďèéêëēėęěğǵḧîïíīįìłḿñńǹňôöòóœøōõőṕŕřßśšşșťțûüùúūǘůűųẃẍÿýžźż·/_,:;`,n=new RegExp(t.split(``).join(`|`),`g`);return e.toString().replace(/[A-Z]/g,e=>`-${e}`).toLowerCase().replace(/\s+/g,`-`).replace(n,e=>`aaaaaaaaaacccddeeeeeeeegghiiiiiilmnnnnoooooooooprrsssssttuuuuuuuuuwxyyzzz------`.charAt(t.indexOf(e))).replace(/&/g,`-and-`).replace(/[^\w\-]+/g,``).replace(/-{2,}/g,`-`).replace(/^-+/,``).replace(/-+$/,``)}var ja=Symbol(``),Ma={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 Na(e){return Object.prototype.toString.call(e)===`[object Object]`}function Pa(e){if(Array.isArray(e))return e.map(Pa);if(Na(e)){let t={};for(let n in e)t[n]=Pa(e[n]);return t}return e}function Fa(e){let t=le({}),n=o(ja,{}),r=E(()=>e.preset==null?{}:n!=null&&e.preset in n?structuredClone(S(n)[e.preset]):e.preset in ka?structuredClone(ka[e.preset]):{}),i=E(()=>({initial:e.initial,enter:e.enter,leave:e.leave,visible:e.visible,visibleOnce:e.visibleOnce,hovered:e.hovered,tapped:e.tapped,focused:e.focused}));function a(e,t){for(let n of[`delay`,`duration`]){if(t[n]==null)continue;let r=Number.parseInt(t[n]);for(let t of[`enter`,`visible`,`visibleOnce`]){let i=e[t];i!=null&&(i.transition??={},i.transition[n]=r)}}return e}let s=E(()=>a({...Ee({},i.value,r.value,e.variants||{})},e));function c(e,n,r){e.props??={},e.props.style??={},e.props.style={...e.props.style,...r};let i=a(Pa(s.value),e.props);return e.props.onVnodeMounted=({el:e})=>{t[n]=Ca(e,i)},e.props.onVnodeUpdated=({el:e})=>{let r=ha(t[n].state);for(let[t,n]of Object.entries(r))e.style[t]=n},e}return{motionConfig:s,setNodeInstance:c}}var Ia=t({name:`Motion`,props:{...Ma,is:{type:[String,Object],default:`div`}},setup(e){let t=oe(),{motionConfig:n,setNodeInstance:r}=Fa(e);return()=>{let i=ha(n.value.initial||{}),a=p(e.is,void 0,t);return r(a,0,i),a}}}),La=t({name:`MotionGroup`,props:{...Ma,is:{type:[String,Object],required:!1}},setup(e){let t=oe(),{motionConfig:n,setNodeInstance:r}=Fa(e);return()=>{let i=ha(n.value.initial||{}),a=t.default?.()||[];for(let e=0;e{e.style.overflow=t.overflow,n()}}function s(e,n){return[{height:X,opacity:t.opacityClosed,paddingTop:X,paddingBottom:X,borderTopWidth:X,borderBottomWidth:X,marginTop:X,marginBottom:X},{height:e,opacity:t.opacityOpened,paddingTop:n.paddingTop,paddingBottom:n.paddingBottom,borderTopWidth:n.borderTopWidth,borderBottomWidth:n.borderBottomWidth,marginTop:n.marginTop,marginBottom:n.marginBottom}]}function c(e,t,n){return e!==i||!r||r.playState!==`running`?!1:(r.onfinish=()=>{e.style.overflow=t,n()},r.reverse(),!0)}function l(e,r){let i=e,l=n(i);c(i,l.overflow,r)||o(i,l,r,s(a(i,l),l),{duration:t.duration,easing:t.easingEnter})}function d(e,r){let i=e,a=n(i);if(c(i,a.overflow,r))return;let{height:l}=getComputedStyle(i);i.style.height=l,i.style.overflow=`hidden`,o(i,a,r,s(l,a).reverse(),{duration:t.duration,easing:t.easingLeave})}return(e,t)=>(u(),x(re,{css:!1,onEnter:l,onLeave:d},{default:N(()=>[w(e.$slots,`default`)]),_:3}))}}),Ba=0;function Va(){I(e=>{if(!be)return;let t=document.querySelectorAll(`[data-reka-focus-guard]`);document.body.insertAdjacentElement(`afterbegin`,t[0]??Ha()),document.body.insertAdjacentElement(`beforeend`,t[1]??Ha()),Ba++,e(()=>{Ba===1&&document.querySelectorAll(`[data-reka-focus-guard]`).forEach(e=>e.remove()),Ba--})})}function Ha(){let e=document.createElement(`span`);return e.setAttribute(`data-reka-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}function Ua(e,t){let n=xe(!1,300),r=B(null),i=me();function a(){r.value=null,n.value=!1}function o(e,t){let i=e.currentTarget,a={x:e.clientX,y:e.clientY},o=Ga(a,Wa(a,i.getBoundingClientRect())),s=Ka(t.getBoundingClientRect());r.value=Ja([...o,...s]),n.value=!0}return I(n=>{if(e.value&&t.value){let r=e=>o(e,t.value),i=t=>o(t,e.value);e.value.addEventListener(`pointerleave`,r),t.value.addEventListener(`pointerleave`,i),n(()=>{e.value?.removeEventListener(`pointerleave`,r),t.value?.removeEventListener(`pointerleave`,i)})}}),I(n=>{if(r.value){let o=n=>{if(!r.value||!(n.target instanceof Element))return;let o=n.target,s={x:n.clientX,y:n.clientY},c=e.value?.contains(o)||t.value?.contains(o),l=!qa(s,r.value),u=!!o.closest(`[data-grace-area-trigger]`);c?a():(l||u)&&(a(),i.trigger())};e.value?.ownerDocument.addEventListener(`pointermove`,o),n(()=>e.value?.ownerDocument.removeEventListener(`pointermove`,o))}}),{isPointerInTransit:n,onPointerExit:i.on}}function Wa(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function Ga(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Ka(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function qa(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;er!=l>r&&n<(c-o)*(r-s)/(l-s)+o&&(i=!i)}return i}function Ja(e){let t=e.slice();return t.sort((e,t)=>e.xt.x?1:e.yt.y?1:0),Ya(t)}function Ya(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Xa=t({__name:`DialogTrigger`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=Me(),{forwardRef:r,currentElement:i}=W();return n.contentId||=ge(void 0,`reka-dialog-content`),C(()=>{n.triggerElement.value=i.value}),(e,i)=>(u(),x(M(H),V(t,{ref:M(r),type:e.as===`button`?`button`:void 0,"aria-haspopup":`dialog`,"aria-expanded":M(n).open.value||!1,"aria-controls":M(n).open.value?M(n).contentId:void 0,"data-state":M(n).open.value?`open`:`closed`,onClick:M(n).onOpenToggle}),{default:N(()=>[w(e.$slots,`default`)]),_:3},16,[`type`,`aria-expanded`,`aria-controls`,`data-state`,`onClick`]))}}),Za={key:0,d:`M0 0L6 6L12 0`},Qa={key:1,d:`M0 0L4.58579 4.58579C5.36683 5.36683 6.63316 5.36684 7.41421 4.58579L12 0`},$a=t({__name:`Arrow`,props:{width:{type:Number,required:!1,default:10},height:{type:Number,required:!1,default:5},rounded:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`svg`}},setup(e){let t=e;return W(),(e,n)=>(u(),x(M(H),V(t,{width:e.width,height:e.height,viewBox:e.asChild?void 0:`0 0 12 6`,preserveAspectRatio:e.asChild?void 0:`none`}),{default:N(()=>[w(e.$slots,`default`,{},()=>[e.rounded?(u(),L(`path`,Qa)):(u(),L(`path`,Za))])]),_:3},16,[`width`,`height`,`viewBox`,`preserveAspectRatio`]))}}),eo={top:`bottom`,right:`left`,bottom:`top`,left:`right`},to=t({inheritAttrs:!1,__name:`PopperArrow`,props:{width:{type:Number,required:!1},height:{type:Number,required:!1},rounded:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`svg`}},setup(e){let{forwardRef:t}=W(),n=Se(),r=E(()=>eo[n.placedSide.value]);return(e,i)=>(u(),L(`span`,{ref:e=>{M(n).onArrowChange(e)},style:m({position:`absolute`,left:M(n).arrowX?.value?`${M(n).arrowX?.value}px`:void 0,top:M(n).arrowY?.value?`${M(n).arrowY?.value}px`:void 0,[r.value]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[M(n).placedSide.value],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[M(n).placedSide.value],visibility:M(n).shouldHideArrow.value?`hidden`:void 0})},[j($a,V(e.$attrs,{ref:M(t),style:{display:`block`},as:e.as,"as-child":e.asChild,rounded:e.rounded,width:e.width,height:e.height}),{default:N(()=>[w(e.$slots,`default`)]),_:3},16,[`as`,`as-child`,`rounded`,`width`,`height`])],4))}}),[no,ro]=Ce(`PopoverRoot`),io=t({__name:`PopoverRoot`,props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},modal:{type:Boolean,required:!1,default:!1}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=t,{modal:i}=a(n),o=de(n,`open`,r,{defaultValue:n.defaultOpen,passive:n.open===void 0});return ro({contentId:``,triggerId:``,modal:i,open:o,onOpenChange:e=>{o.value=e},onOpenToggle:()=>{o.value=!o.value},triggerElement:B(),hasCustomAnchor:B(!1)}),(e,t)=>(u(),x(M(ke),null,{default:N(()=>[w(e.$slots,`default`,{open:M(o),close:()=>o.value=!1})]),_:3}))}}),ao=t({__name:`PopoverContentImpl`,props:{trapFocus:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=he(ye(n,`trapFocus`,`disableOutsidePointerEvents`)),{forwardRef:a}=W(),o=no();return Va(),(e,t)=>(u(),x(M(Ie),{"as-child":``,loop:``,trapped:e.trapFocus,onMountAutoFocus:t[5]||=e=>r(`openAutoFocus`,e),onUnmountAutoFocus:t[6]||=e=>r(`closeAutoFocus`,e)},{default:N(()=>[j(M(U),{"as-child":``,"disable-outside-pointer-events":e.disableOutsidePointerEvents,onPointerDownOutside:t[0]||=e=>r(`pointerDownOutside`,e),onInteractOutside:t[1]||=e=>r(`interactOutside`,e),onEscapeKeyDown:t[2]||=e=>r(`escapeKeyDown`,e),onFocusOutside:t[3]||=e=>r(`focusOutside`,e),onDismiss:t[4]||=e=>M(o).onOpenChange(!1)},{default:N(()=>[j(M(we),V(M(i),{id:M(o).contentId,ref:M(a),"data-state":M(o).open.value?`open`:`closed`,"aria-labelledby":M(o).triggerId,style:{"--reka-popover-content-transform-origin":`var(--reka-popper-transform-origin)`,"--reka-popover-content-available-width":`var(--reka-popper-available-width)`,"--reka-popover-content-available-height":`var(--reka-popper-available-height)`,"--reka-popover-trigger-width":`var(--reka-popper-anchor-width)`,"--reka-popover-trigger-height":`var(--reka-popper-anchor-height)`},role:`dialog`}),{default:N(()=>[w(e.$slots,`default`)]),_:3},16,[`id`,`data-state`,`aria-labelledby`])]),_:3},8,[`disable-outside-pointer-events`])]),_:3},8,[`trapped`]))}}),oo=t({__name:`PopoverContentModal`,props:{side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=no(),a=B(!1);fe(!0);let o=pe(n,r),{forwardRef:s,currentElement:c}=W();return ue(c),(e,t)=>(u(),x(ao,V(M(o),{ref:M(s),"trap-focus":M(i).open.value,"disable-outside-pointer-events":``,onCloseAutoFocus:t[0]||=O(e=>{r(`closeAutoFocus`,e),a.value||M(i).triggerElement.value?.focus()},[`prevent`]),onPointerDownOutside:t[1]||=e=>{r(`pointerDownOutside`,e);let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;a.value=t.button===2||n},onFocusOutside:t[2]||=O(()=>{},[`prevent`])}),{default:N(()=>[w(e.$slots,`default`)]),_:3},16,[`trap-focus`]))}}),so=t({__name:`PopoverContentNonModal`,props:{side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=no(),a=B(!1),o=B(!1),s=pe(n,r);return(e,t)=>(u(),x(ao,V(M(s),{"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:t[0]||=e=>{r(`closeAutoFocus`,e),e.defaultPrevented||(a.value||M(i).triggerElement.value?.focus(),e.preventDefault()),a.value=!1,o.value=!1},onInteractOutside:t[1]||=async e=>{r(`interactOutside`,e),e.defaultPrevented||(a.value=!0,e.detail.originalEvent.type===`pointerdown`&&(o.value=!0));let t=e.target;M(i).triggerElement.value?.contains(t)&&e.preventDefault(),e.detail.originalEvent.type===`focusin`&&o.value&&e.preventDefault()}}),{default:N(()=>[w(e.$slots,`default`)]),_:3},16))}}),co=t({__name:`PopoverContent`,props:{forceMount:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=no(),a=pe(n,r),{forwardRef:o}=W();return i.contentId||=ge(void 0,`reka-popover-content`),(e,t)=>(u(),x(M(Te),{present:e.forceMount||M(i).open.value},{default:N(()=>[M(i).modal.value?(u(),x(oo,V({key:0},M(a),{ref:M(o)}),{default:N(()=>[w(e.$slots,`default`)]),_:3},16)):(u(),x(so,V({key:1},M(a),{ref:M(o)}),{default:N(()=>[w(e.$slots,`default`)]),_:3},16))]),_:3},8,[`present`]))}}),lo=t({__name:`PopoverPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(u(),x(M(Fe),f(d(t)),{default:N(()=>[w(e.$slots,`default`)]),_:3},16))}}),uo=t({__name:`PopoverTrigger`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=no(),{forwardRef:r,currentElement:i}=W();return n.triggerId||=ge(void 0,`reka-popover-trigger`),C(()=>{n.triggerElement.value=i.value}),(e,i)=>(u(),x(y(M(n).hasCustomAnchor.value?M(H):M(De)),{"as-child":``},{default:N(()=>[j(M(H),{id:M(n).triggerId,ref:M(r),type:e.as===`button`?`button`:void 0,"aria-haspopup":`dialog`,"aria-expanded":M(n).open.value,"aria-controls":M(n).contentId,"data-state":M(n).open.value?`open`:`closed`,as:e.as,"as-child":t.asChild,onClick:M(n).onOpenToggle},{default:N(()=>[w(e.$slots,`default`)]),_:3},8,[`id`,`type`,`aria-expanded`,`aria-controls`,`data-state`,`as`,`as-child`,`onClick`])]),_:3}))}}),fo=t({__name:`TooltipArrow`,props:{width:{type:Number,required:!1,default:10},height:{type:Number,required:!1,default:5},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`svg`}},setup(e){let t=e;return W(),(e,n)=>(u(),x(M(to),f(d(t)),{default:N(()=>[w(e.$slots,`default`)]),_:3},16))}}),[po,mo]=Ce(`TooltipProvider`),ho=t({inheritAttrs:!1,__name:`TooltipProvider`,props:{delayDuration:{type:Number,required:!1,default:700},skipDelayDuration:{type:Number,required:!1,default:300},disableHoverableContent:{type:Boolean,required:!1,default:!1},disableClosingTrigger:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},ignoreNonKeyboardFocus:{type:Boolean,required:!1,default:!1}},setup(e){let{delayDuration:t,skipDelayDuration:n,disableHoverableContent:r,disableClosingTrigger:i,ignoreNonKeyboardFocus:o,disabled:s}=a(e);W();let c=B(!0),l=B(!1),{start:u,stop:d}=_e(()=>{c.value=!0},n,{immediate:!1});return mo({isOpenDelayed:c,delayDuration:t,onOpen(){d(),c.value=!1},onClose(){u()},isPointerInTransitRef:l,disableHoverableContent:r,disableClosingTrigger:i,disabled:s,ignoreNonKeyboardFocus:o}),(e,t)=>w(e.$slots,`default`)}}),go=`tooltip.open`,[_o,vo]=Ce(`TooltipRoot`),yo=t({__name:`TooltipRoot`,props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},delayDuration:{type:Number,required:!1,default:void 0},disableHoverableContent:{type:Boolean,required:!1,default:void 0},disableClosingTrigger:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1,default:void 0},ignoreNonKeyboardFocus:{type:Boolean,required:!1,default:void 0}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=t;W();let i=po(),a=E(()=>n.disableHoverableContent??i.disableHoverableContent.value),o=E(()=>n.disableClosingTrigger??i.disableClosingTrigger.value),s=E(()=>n.disabled??i.disabled.value),c=E(()=>n.delayDuration??i.delayDuration.value),l=E(()=>n.ignoreNonKeyboardFocus??i.ignoreNonKeyboardFocus.value),d=de(n,`open`,r,{defaultValue:n.defaultOpen,passive:n.open===void 0});T(d,e=>{i.onClose&&(e?(i.onOpen(),document.dispatchEvent(new CustomEvent(go))):i.onClose())});let f=B(!1),p=B(),m=E(()=>d.value?f.value?`delayed-open`:`instant-open`:`closed`),{start:h,stop:g}=_e(()=>{f.value=!0,d.value=!0},c,{immediate:!1});function _(){g(),f.value=!1,d.value=!0}function v(){g(),d.value=!1}function y(){h()}return vo({contentId:``,open:d,stateAttribute:m,trigger:p,onTriggerChange(e){p.value=e},onTriggerEnter(){i.isOpenDelayed.value?y():_()},onTriggerLeave(){a.value?v():g()},onOpen:_,onClose:v,disableHoverableContent:a,disableClosingTrigger:o,disabled:s,ignoreNonKeyboardFocus:l}),(e,t)=>(u(),x(M(ke),null,{default:N(()=>[w(e.$slots,`default`,{open:M(d)})]),_:3}))}}),bo=t({__name:`TooltipContentImpl`,props:{ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1,default:`top`},sideOffset:{type:Number,required:!1,default:0},align:{type:null,required:!1,default:`center`},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1,default:!0},collisionBoundary:{type:null,required:!1,default:()=>[]},collisionPadding:{type:[Number,Object],required:!1,default:0},arrowPadding:{type:Number,required:!1,default:0},sticky:{type:String,required:!1,default:`partial`},hideWhenDetached:{type:Boolean,required:!1,default:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=t,i=_o(),{forwardRef:a}=W(),o=oe(),s=E(()=>o.default?.({})),c=E(()=>{if(n.ariaLabel)return n.ariaLabel;let e=``;function t(n){typeof n.children==`string`&&n.type!==ie?e+=n.children:Array.isArray(n.children)&&n.children.forEach(e=>t(e))}return s.value?.forEach(e=>t(e)),e}),l=E(()=>{let{ariaLabel:e,...t}=n;return t});return C(()=>{ve(window,`scroll`,e=>{e.target?.contains(i.trigger.value)&&i.onClose()}),ve(window,go,i.onClose)}),(e,t)=>(u(),x(M(U),{"as-child":``,"disable-outside-pointer-events":!1,onEscapeKeyDown:t[0]||=e=>r(`escapeKeyDown`,e),onPointerDownOutside:t[1]||=e=>{M(i).disableClosingTrigger.value&&M(i).trigger.value?.contains(e.target)&&e.preventDefault(),r(`pointerDownOutside`,e)},onFocusOutside:t[2]||=O(()=>{},[`prevent`]),onDismiss:t[3]||=e=>M(i).onClose()},{default:N(()=>[j(M(we),V({ref:M(a),"data-state":M(i).stateAttribute.value},{...e.$attrs,...l.value},{style:{"--reka-tooltip-content-transform-origin":`var(--reka-popper-transform-origin)`,"--reka-tooltip-content-available-width":`var(--reka-popper-available-width)`,"--reka-tooltip-content-available-height":`var(--reka-popper-available-height)`,"--reka-tooltip-trigger-width":`var(--reka-popper-anchor-width)`,"--reka-tooltip-trigger-height":`var(--reka-popper-anchor-height)`}}),{default:N(()=>[w(e.$slots,`default`),j(M(Oe),{id:M(i).contentId,role:`tooltip`},{default:N(()=>[h(v(c.value),1)]),_:1},8,[`id`])]),_:3},16,[`data-state`])]),_:3}))}}),xo=t({__name:`TooltipContentHoverable`,props:{ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},setup(e){let t=he(e),{forwardRef:n,currentElement:r}=W(),{trigger:i,onClose:a}=_o(),o=po(),{isPointerInTransit:s,onPointerExit:c}=Ua(i,r);return o.isPointerInTransitRef=s,c(()=>{a()}),(e,r)=>(u(),x(bo,V({ref:M(n)},M(t)),{default:N(()=>[w(e.$slots,`default`)]),_:3},16))}}),So=t({__name:`TooltipContent`,props:{forceMount:{type:Boolean,required:!1},ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1,default:`top`},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=t,i=_o(),a=pe(n,r),{forwardRef:o}=W();return(e,t)=>(u(),x(M(Te),{present:e.forceMount||M(i).open.value},{default:N(()=>[(u(),x(y(M(i).disableHoverableContent.value?bo:xo),V({ref:M(o)},M(a)),{default:N(()=>[w(e.$slots,`default`)]),_:3},16))]),_:3},8,[`present`]))}}),Co=t({__name:`TooltipPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(u(),x(M(Fe),f(d(t)),{default:N(()=>[w(e.$slots,`default`)]),_:3},16))}}),wo=t({__name:`TooltipTrigger`,props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(t){let n=t,r=_o(),i=po();r.contentId||=ge(void 0,`reka-tooltip-content`);let{forwardRef:a,currentElement:o}=W(),s=B(!1),c=B(!1),l=E(()=>r.disabled.value?{}:{click:_,focus:h,pointermove:p,pointerleave:m,pointerdown:f,blur:g});C(()=>{r.onTriggerChange(o.value)});function d(){setTimeout(()=>{s.value=!1},1)}function f(){r.open&&!r.disableClosingTrigger.value&&r.onClose(),s.value=!0,document.addEventListener(`pointerup`,d,{once:!0})}function p(e){e.pointerType!==`touch`&&!c.value&&!i.isPointerInTransitRef.value&&(r.onTriggerEnter(),c.value=!0)}function m(){r.onTriggerLeave(),c.value=!1}function h(e){s.value||r.ignoreNonKeyboardFocus.value&&!e.target.matches?.(`:focus-visible`)||r.onOpen()}function g(){r.onClose()}function _(){r.disableClosingTrigger.value||r.onClose()}return(t,i)=>(u(),x(M(De),{"as-child":``,reference:t.reference},{default:N(()=>[j(M(H),V({ref:M(a),"aria-describedby":M(r).open.value?M(r).contentId:void 0,"data-state":M(r).stateAttribute.value,as:t.as,"as-child":n.asChild,"data-grace-area-trigger":``},e(l.value)),{default:N(()=>[w(t.$slots,`default`)]),_:3},16,[`aria-describedby`,`data-state`,`as`,`as-child`])]),_:3},8,[`reference`]))}}),To={op50:``},Eo=t({__name:`Collapsable`,props:b({default:{type:Boolean},label:{}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=e,n=F(e,`modelValue`);I(()=>{t.default!=null&&(n.value=!!t.default)});function i(e){return n.value=e,e}return(e,a)=>(u(),L(`div`,null,[w(e.$slots,`trigger`,f(d({visible:n.value,setVisible:i})),()=>[z(`button`,{sticky:``,"top-0":``,"z-10":``,flex:``,"items-center":``,"justify-between":``,px2:``,py1:``,"text-sm":``,"backdrop-blur-xl":``,onClick:a[0]||=e=>n.value=!n.value},[z(`span`,null,v(t.label??`Collapsable`),1),a[1]||=h(),z(`span`,To,v(n.value?`▲`:`▼`),1)])]),j(M(za),null,{default:N(()=>[n.value?w(e.$slots,`default`,f(V({key:0},{visible:n.value,setVisible:i}))):r(``,!0)]),_:3})]))}}),Do=[`onClick`],Oo={flex:``,"items-center":``,"gap-1.5":``,text:`xs 2xl:sm`},ko=t({__name:`Container`,props:{title:{},icon:{},innerClass:{},expand:{type:Boolean,default:!0}},setup(e){return(t,n)=>(u(),x(Eo,{default:e.expand},{trigger:N(n=>[z(`button`,{class:`w-full flex items-center justify-between rounded-lg px-2 py-1 outline-none transition-all duration-250 ease-in-out`,text:`neutral-600 dark:neutral-400 sm sm:base`,bg:`neutral-100 dark:neutral-800`,hover:`bg-neutral-200 dark:bg-neutral-700`,onClick:e=>n.setVisible(!n.visible)},[w(t.$slots,`title`,{},()=>[z(`div`,Oo,[e.icon?(u(),L(`div`,{key:0,class:A(e.icon),"size-4":``},null,2)):r(``,!0),h(` `+v(e.title),1)])]),z(`div`,{"i-solar:alt-arrow-down-linear":``,transition:`transform duration-250`,class:A({"rotate-180":n.visible})},null,2)],8,Do)]),default:N(()=>[z(`div`,{gap:`1`,grid:``,"items-center":``,"p-1":``,class:A(e.innerClass)},[w(t.$slots,`default`)],2)]),_:3},8,[`default`]))}}),Ao={"grid-col-span-1":``,"font-mono":``,text:`[10px] right`},jo={class:`z-20 mt-2 space-y-2`,bg:`white/90 dark:neutral-900/90`,"rounded-xl":``,"p-1":``},Mo={class:`relative h-48 w-full select-none overflow-hidden rounded-lg`},No={class:`relative h-6 w-full select-none overflow-hidden rounded-lg`},Po={key:0,class:`relative h-6 w-full select-none overflow-hidden rounded-lg`},Fo={class:`flex justify-center gap-2`},Io={class:`flex gap-2`},Lo={key:0,class:`flex gap-2`},Ro=[`value`],zo=[`value`],Bo=[`value`],Vo=[`value`],Ho=[`value`],Uo=[`value`],Wo=[`value`],Go=[`value`],Ko=[`value`],qo=[`value`],Jo=Re(t({__name:`ColorPicker`,props:b({alpha:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1}},{modelValue:{required:!1,default:`#000000`},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=e,n=F(e,`modelValue`),i=B(),a=B(),o=B(),s=B(),c=B(!1),l=B(!1),d=B(null),f=B(`hex`),p=B(0),h=B(100),g=B(50),_=B(1);function y(e){let t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?{r:Number.parseInt(t[1],16)/255,g:Number.parseInt(t[2],16)/255,b:Number.parseInt(t[3],16)/255}:null}function b(e){if(!e)return{h:0,s:0,v:0,a:1};let t=document.createElement(`div`);t.style.color=e,document.body.appendChild(t);let n=getComputedStyle(t).color;document.body.removeChild(t);let r=n.match(/rgba?\(([^)]+)\)/);if(r){let e=r[1].split(`,`).map(e=>Number.parseFloat(e.trim())),t=We({r:e[0]/255,g:e[1]/255,b:e[2]/255});return{h:t.h||0,s:(t.s||0)*100,v:(t.v||0)*100,a:e[3]===void 0?1:e[3]}}let i=y(e);if(i){let e=We(i);return{h:e.h||0,s:(e.s||0)*100,v:(e.v||0)*100,a:1}}return{h:0,s:0,v:0,a:1}}let S=E(()=>({h:p.value,s:h.value/100,v:g.value/100})),w=E(()=>{let e=Ke(S.value);return{r:Math.round(e.r*255),g:Math.round(e.g*255),b:Math.round(e.b*255)}}),D=E(()=>{let{r:e,g:t,b:n}=w.value;return`#${((1<<24)+(e<<16)+(t<<8)+n).toString(16).slice(1)}`}),O=E(()=>({left:`${h.value/100*100}%`,top:`${100-g.value/100*100}%`})),te=E(()=>({left:`${p.value/360*100}%`})),k=E(()=>({left:`${_.value*100}%`})),P=E(()=>({background:`linear-gradient(to right, white, hsl(${p.value}, 100%, 50%))`})),ne=E(()=>{let{r:e,g:t,b:n}=w.value;return{background:`linear-gradient(to right, transparent, rgb(${e}, ${t}, ${n}))`}});function re(e,t){if(!i.value)return;let n=i.value.getBoundingClientRect(),r=Math.max(0,Math.min(100,e/n.width*100)),a=Math.max(0,Math.min(100,(n.height-t)/n.height*100));h.value=r,g.value=a}function I(e){if(!a.value)return;let t=a.value.getBoundingClientRect();p.value=Math.max(0,Math.min(360,e/t.width*360))}function ie(e){if(!o.value)return;let t=o.value.getBoundingClientRect();_.value=Math.max(0,Math.min(1,e/t.width))}function ae(e){if(t.disabled)return;l.value=!0,d.value=`map`;let n=`touches`in e?e.touches[0].clientX:e.clientX,r=`touches`in e?e.touches[0].clientY:e.clientY,a=i.value.getBoundingClientRect();re(n-a.left,r-a.top),e.preventDefault()}function oe(e){t.disabled||(l.value=!0,d.value=`hue`,I((`touches`in e?e.touches[0].clientX:e.clientX)-a.value.getBoundingClientRect().left),e.preventDefault())}function ce(e){t.disabled||(l.value=!0,d.value=`alpha`,ie((`touches`in e?e.touches[0].clientX:e.clientX)-o.value.getBoundingClientRect().left),e.preventDefault())}function R(e){if(!l.value)return;e.preventDefault();let t=`touches`in e?e.touches[0].clientX:e.clientX,n=`touches`in e?e.touches[0].clientY:e.clientY;switch(d.value){case`map`:{let e=i.value.getBoundingClientRect();re(t-e.left,n-e.top);break}case`hue`:I(t-a.value.getBoundingClientRect().left);break;case`alpha`:ie(t-o.value.getBoundingClientRect().left);break}}function le(){l.value&&(l.value=!1,d.value=null,document.body.style.cursor=``)}T(n,e=>{if(e&&!l.value){let t=b(e);p.value=t.h,h.value=t.s,g.value=t.v,_.value=t.a}},{immediate:!0}),T(l,e=>{e?document.body.style.cursor=`none`:document.body.style.cursor=``}),C(()=>{Ue(`mousemove`,R,{passive:!1}),Ue(`mouseup`,le),Ue(`touchmove`,R,{passive:!1}),Ue(`touchend`,le),Ue(`click`,e=>{c.value&&s.value&&!s.value.contains(e.target)&&(c.value=!1)})});function V(e){let t=b(e);p.value=t.h,h.value=t.s,g.value=t.v,_.value=t.a,n.value=e}function H(e,t){let n={...w.value};n[e]=Math.max(0,Math.min(255,t));let r=We({r:n.r/255,g:n.g/255,b:n.b/255});p.value=r.h||0,h.value=(r.s||0)*100,g.value=(r.v||0)*100}function U(e,t){switch(e){case`h`:p.value=Math.max(0,Math.min(360,t));break;case`s`:h.value=Math.max(0,Math.min(100,t));break;case`v`:g.value=Math.max(0,Math.min(100,t));break}}function ue(e){_.value=Math.max(0,Math.min(1,e/100))}return T([p,h,g,_],()=>{n.value=Ge(Ke({h:p.value,s:h.value/100,v:g.value/100,alpha:_.value}))},{immediate:!0}),(t,s)=>(u(),x(M(io),null,{default:N(()=>[j(M(uo),{class:`grid grid-col-span-3 grid-cols-3 h-fit items-center`},{default:N(()=>[z(`div`,{style:m({backgroundColor:n.value}),"grid-col-span-2":``,"min-h-5":``,"rounded-md":``},null,4),z(`div`,Ao,v(n.value),1)]),_:1}),j(M(lo),null,{default:N(()=>[j(M(co),{align:`start`,class:`relative z-20`},{default:N(()=>[z(`div`,jo,[z(`div`,Mo,[z(`div`,{ref_key:`colorMapRef`,ref:i,class:`relative h-full w-full cursor-crosshair`,style:m([P.value,{cursor:l.value&&d.value===`map`?`none`:`crosshair`}]),onMousedown:ae,onTouchstart:ae},[s[11]||=z(`div`,{class:`absolute inset-0`,style:{background:`linear-gradient(to bottom, transparent, black)`}},null,-1),z(`div`,{class:`pointer-events-none absolute h-4 w-4 border-2 border-white rounded-full shadow-lg transition-transform`,style:m([O.value,{transform:`translate(-50%, -50%) ${l.value&&d.value===`map`?`scale(1.2)`:`scale(1)`}`,backgroundColor:n.value}])},null,4)],36)]),z(`div`,No,[z(`div`,{ref_key:`hueSliderRef`,ref:a,class:`hue-slider h-full w-full cursor-pointer`,style:m([{background:`linear-gradient(to right, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000)`},{cursor:l.value&&d.value===`hue`?`none`:`pointer`}]),onMousedown:oe,onTouchstart:oe},[z(`div`,{class:`pointer-events-none absolute top-0 h-14 w-1 cursor-pointer cursor-col-resize appearance-none bg-white shadow-lg transition-colors,transform,width,height duration-200 hover:h-13 hover:w-2 hover:bg-neutral-800`,style:m([te.value,{transform:`translateX(-50%) ${l.value&&d.value===`hue`?`scaleY(1.2)`:`scaleY(1)`}`}])},null,4)],36)]),e.alpha?(u(),L(`div`,Po,[s[12]||=z(`div`,{class:`alpha-slider absolute inset-0 opacity-50`,style:{"background-image":`linear-gradient(45deg, #ccc 25%, transparent 25%), +import{$ as e,A as t,B as n,C as r,Ct as i,Dt as a,F as o,G as s,H as c,J as l,K as u,M as d,Mt as f,N as p,Nt as m,O as h,Ot as g,P as _,Pt as v,Q as y,R as b,S as x,Tt as S,W as C,Y as w,at as T,b as E,bt as D,c as ee,f as O,gt as te,j as k,jt as A,k as j,kt as M,lt as N,m as P,mt as ne,n as re,nt as F,ot as I,p as ie,q as ae,rt as oe,ut as se,vt as ce,w as L,wt as R,x as z,xt as B,yt as le,z as V}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import{A as H,E as U,F as ue,G as de,H as fe,I as pe,K as me,L as he,P as ge,Q as _e,R as W,U as ve,X as ye,Y as be,Z as xe,_ as Se,et as Ce,g as we,j as Te,tt as Ee,v as De,x as Oe,y as ke}from"./src-DYQXbDgu.js";import{a as Ae,o as je}from"./vue-router-Chhv6vZu.js";import{h as Me,i as Ne,m as Pe,n as Fe,p as Ie,r as Le}from"./DialogTitle-ytlEE0A-.js";import{t as Re}from"./_plugin-vue_export-helper-DGA9ry_j.js";import{S as ze,i as Be,l as Ve,t as He,u as Ue}from"./dist-Che88T83.js";import{a as We,i as Ge,o as Ke}from"./src-C83SCWbW.js";import{n as qe,t as Je}from"./settings-73vyHOZs.js";function G(e){return ne()?(ce(e),!0):!1}function Ye(){let e=new Set,t=t=>{e.delete(t)};return{on:n=>{e.add(n);let r=()=>t(n);return G(r),{off:r}},off:t,trigger:(...t)=>Promise.all(Array.from(e).map(e=>e(...t))),clear:()=>{e.clear()}}}var Xe=new WeakMap,Ze=(...e)=>{let t=e[0],n=k()?.proxy;if(n==null&&!_())throw Error(`injectLocal must be called in setup`);return n&&Xe.has(n)&&t in Xe.get(n)?Xe.get(n)[t]:o(...e)};function Qe(e,t){let n=k()?.proxy;if(n==null)throw Error(`provideLocal must be called in setup`);Xe.has(n)||Xe.set(n,Object.create(null));let r=Xe.get(n);return r[e]=t,ae(e,t)}function $e(e,t){let n=t?.injectionKey||Symbol(e.name||`InjectionState`),r=t?.defaultValue;return[(...t)=>{let r=e(...t);return Qe(n,r),r},()=>Ze(n,r)]}var et=typeof window<`u`&&typeof document<`u`;typeof WorkerGlobalScope<`u`&&globalThis instanceof WorkerGlobalScope;var tt=e=>e!=null,nt=Object.prototype.toString,rt=e=>nt.call(e)===`[object Object]`,it=()=>{};function at(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 ot(e,t={}){let n,r,i=it,a=e=>{clearTimeout(e),i(),i=it},o;return s=>{let c=g(e),l=g(t.maxWait);return n&&a(n),c<=0||l!==void 0&&l<=0?(r&&=(a(r),void 0),Promise.resolve(s())):new Promise((e,u)=>{i=t.rejectOnCancel?u:e,o=s,l&&!r&&(r=setTimeout(()=>{n&&a(n),r=void 0,e(o())},l)),n=setTimeout(()=>{r&&a(r),r=void 0,e(s())},c)})}}function st(e,t=!1,n=`Timeout`){return new Promise((r,i)=>{t?setTimeout(()=>i(n),e):setTimeout(r,e)})}function ct(e){return e.endsWith(`rem`)?Number.parseFloat(e)*16:Number.parseFloat(e)}function lt(e){return Array.isArray(e)?e:[e]}function ut(e){return e||k()}function dt(e,t=200,n={}){return at(ot(t,n),e)}function ft(e,t=200,n={}){let r=B(g(e)),a=dt(()=>{r.value=e.value},t,n);return T(e,()=>a()),i(r)}function pt(e,t=!0,r){ut(r)?C(e,r):t?e():n(e)}function mt(e,t){ut(t)&&s(e,t)}function ht(e,t=1e3,n={}){let{immediate:r=!0,immediateCallback:a=!1}=n,o=null,s=R(!1);function c(){o&&=(clearInterval(o),null)}function l(){s.value=!1,c()}function u(){let n=g(t);n<=0||(s.value=!0,a&&e(),c(),s.value&&(o=setInterval(e,n)))}return r&&et&&u(),(te(t)||typeof t==`function`)&&G(T(t,()=>{s.value&&et&&u()})),G(l),{isActive:i(s),pause:l,resume:u}}function gt(e,t,n={}){let{immediate:r=!0,immediateCallback:a=!1}=n,o=R(!1),s;function c(){s&&=(clearTimeout(s),void 0)}function l(){o.value=!1,c()}function u(...n){a&&e(),c(),o.value=!0,s=setTimeout(()=>{o.value=!1,s=void 0,e(...n)},g(t))}return r&&(o.value=!0,et&&u()),G(l),{isPending:i(o),start:u,stop:l}}function _t(e=1e3,t={}){let{controls:n=!1,callback:r}=t,i=gt(r??it,e,t),a=E(()=>!i.isPending.value);return n?{ready:a,...i}:a}function vt(e,t,n){return T(e,t,{...n,immediate:!0})}var yt=et?window:void 0;et&&window.document,et&&window.navigator,et&&window.location;function K(e){let t=g(e);return t?.$el??t}function q(...e){let t=[],n=()=>{t.forEach(e=>e()),t.length=0},r=(e,t,n,r)=>(e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)),i=E(()=>{let t=lt(g(e[0])).filter(e=>e!=null);return t.every(e=>typeof e!=`string`)?t:void 0}),a=vt(()=>[i.value?.map(e=>K(e))??[yt].filter(e=>e!=null),lt(g(i.value?e[1]:e[0])),lt(M(i.value?e[2]:e[1])),g(i.value?e[3]:e[2])],([e,i,a,o])=>{if(n(),!e?.length||!i?.length||!a?.length)return;let s=rt(o)?{...o}:o;t.push(...e.flatMap(e=>i.flatMap(t=>a.map(n=>r(e,t,n,s)))))},{flush:`post`});return G(n),()=>{a(),n()}}function bt(){let e=R(!1),t=k();return t&&C(()=>{e.value=!0},t),e}function xt(e){let t=bt();return E(()=>(t.value,!!e()))}function St(e,t={}){let{immediate:n=!0,fpsLimit:r=void 0,window:i=yt,once:a=!1}=t,o=R(!1),s=E(()=>r?1e3/g(r):null),c=0,l=null;function u(t){if(!o.value||!i)return;c||=t;let n=t-c;if(s.value&&nn&&`matchMedia`in n&&typeof n.matchMedia==`function`),a=R(typeof r==`number`),o=R(),s=R(!1);return I(()=>{if(a.value){a.value=!i.value,s.value=g(e).split(`,`).some(e=>{let t=e.includes(`not all`),n=e.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),i=e.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),a=!!(n||i);return n&&a&&(a=r>=ct(n[1])),i&&a&&(a=r<=ct(i[1])),t?!a:a});return}i.value&&(o.value=n.matchMedia(g(e)),s.value=o.value.matches)}),q(o,`change`,e=>{s.value=e.matches},{passive:!0}),E(()=>s.value)}function Et(e={}){let{window:t=yt}=e,n=R(1),r=Tt(()=>`(resolution: ${n.value}dppx)`,e),i=it;return t&&(i=vt(r,()=>n.value=t.devicePixelRatio)),{pixelRatio:D(n),stop:i}}function Dt(e,t,n={}){let{window:r=yt,...i}=n,a,o=xt(()=>r&&`ResizeObserver`in r),s=()=>{a&&=(a.disconnect(),void 0)},c=T(E(()=>{let t=g(e);return Array.isArray(t)?t.map(e=>K(e)):[K(t)]}),e=>{if(s(),o.value&&r){a=new ResizeObserver(t);for(let t of e)t&&a.observe(t,i)}},{immediate:!0,flush:`post`}),l=()=>{s(),c()};return G(l),{isSupported:o,stop:l}}function Ot(e,t={width:0,height:0},n={}){let{window:r=yt,box:i=`content-box`}=n,a=E(()=>(K(e)?.namespaceURI)?.includes(`svg`)),o=R(t.width),s=R(t.height),{stop:c}=Dt(e,([t])=>{let n=i===`border-box`?t.borderBoxSize:i===`content-box`?t.contentBoxSize:t.devicePixelContentBoxSize;if(r&&a.value){let t=K(e);if(t){let e=t.getBoundingClientRect();o.value=e.width,s.value=e.height}}else if(n){let e=lt(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);pt(()=>{let n=K(e);n&&(o.value=`offsetWidth`in n?n.offsetWidth:t.width,s.value=`offsetHeight`in n?n.offsetHeight:t.height)});let l=T(()=>K(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}}function kt(e,t,n={}){let{root:r,rootMargin:i=`0px`,threshold:a=0,window:o=yt,immediate:s=!0}=n,c=xt(()=>o&&`IntersectionObserver`in o),l=E(()=>lt(g(e)).map(K).filter(tt)),u=it,d=R(s),f=c.value?T(()=>[l.value,K(r),d.value],([e,n])=>{if(u(),!d.value||!e.length)return;let r=new IntersectionObserver(t,{root:K(n),rootMargin:i,threshold:a});e.forEach(e=>e&&r.observe(e)),u=()=>{r.disconnect(),u=it}},{immediate:s,flush:`post`}):it,p=()=>{u(),f(),d.value=!1};return G(p),{isSupported:c,isActive:d,pause(){u(),d.value=!1},resume(){d.value=!0},stop:p}}function At(e){let t=R(0);if(typeof performance>`u`)return t;let n=e?.every??10,r=performance.now(),i=0;return St(()=>{if(i+=1,i>=n){let e=performance.now(),n=e-r;t.value=Math.round(1e3/(n/i)),r=e,i=0}}),t}function jt(e={}){let t=B(),n=xt(()=>typeof performance<`u`&&`memory`in performance);if(n.value){let{interval:n=1e3}=e;ht(()=>{t.value=performance.memory},n,{immediate:e.immediate,immediateCallback:e.immediateCallback})}return{isSupported:n,memory:t}}function Mt(e={}){let{window:t=yt,initialWidth:n=1/0,initialHeight:r=1/0,listenOrientation:i=!0,includeScrollbar:a=!0,type:o=`inner`}=e,s=R(n),c=R(r),l=()=>{if(t)if(o===`outer`)s.value=t.outerWidth,c.value=t.outerHeight;else if(o===`visual`&&t.visualViewport){let{width:e,height:n,scale:r}=t.visualViewport;s.value=Math.round(e*r),c.value=Math.round(n*r)}else a?(s.value=t.innerWidth,c.value=t.innerHeight):(s.value=t.document.documentElement.clientWidth,c.value=t.document.documentElement.clientHeight)};l(),pt(l);let u={passive:!0};return q(`resize`,l,u),t&&o===`visual`&&t.visualViewport&&q(t.visualViewport,`resize`,l,u),i&&T(Tt(`(orientation: portrait)`),()=>l()),{width:s,height:c}}var Nt=1/60*1e3,Pt=typeof performance<`u`?()=>performance.now():()=>Date.now(),Ft=typeof window<`u`?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(Pt()),Nt);function It(e){let t=[],n=[],r=0,i=!1,a=!1,o=new WeakSet,s={schedule:(e,a=!1,s=!1)=>{let c=s&&i,l=c?t:n;return a&&o.add(e),l.indexOf(e)===-1&&(l.push(e),c&&i&&(r=t.length)),e},cancel:e=>{let t=n.indexOf(e);t!==-1&&n.splice(t,1),o.delete(e)},process:c=>{if(i){a=!0;return}if(i=!0,[t,n]=[n,t],n.length=0,r=t.length,r)for(let n=0;n(e[t]=It(()=>zt=!0),e),{}),Wt=Ht.reduce((e,t)=>{let n=Ut[t];return e[t]=(e,t=!1,r=!1)=>(zt||Jt(),n.schedule(e,t,r)),e},{}),Gt=Ht.reduce((e,t)=>(e[t]=Ut[t].cancel,e),{});Ht.reduce((e,t)=>(e[t]=()=>Ut[t].process(Vt),e),{});var Kt=e=>Ut[e].process(Vt),qt=e=>{zt=!1,Vt.delta=Rt?Nt:Math.max(Math.min(e-Vt.timestamp,Lt),1),Vt.timestamp=e,Bt=!0,Ht.forEach(Kt),Bt=!1,zt&&(Rt=!1,Ft(qt))},Jt=()=>{zt=!0,Rt=!0,Bt||Ft(qt)},Yt=()=>Vt,Xt=Wt;function Zt(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);iMath.min(Math.max(n,e),t),$t=.001,en=.01,tn=.05;function nn({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let i,a,o=1-t;o=Qt(tn,1,o),e=Qt(en,10,e/1e3),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=on(t,o),c=Math.exp(-i);return $t-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o**2*t**2*e,c=Math.exp(-r),l=on(t**2,o);return(-i(t)+$t>0?-1:1)*((a-s)*c)/l}):(i=t=>{let r=Math.exp(-t*e),i=(t-n)*e+1;return-$t+r*i},a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=an(i,a,s);if(e*=1e3,isNaN(c))return{stiffness:100,damping:10,duration:e};{let t=c**2*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}var rn=12;function an(e,t,n){let r=n;for(let n=1;ne[t]!==void 0)}function un(e){let t=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},e);if(!ln(e,cn)&&ln(e,sn)){let n=nn(e);t=Object.assign(Object.assign(Object.assign({},t),n),{velocity:0,mass:1}),t.isResolvedFromDuration=!0}return t}function dn(e){var{from:t=0,to:n=1,restSpeed:r=2,restDelta:i}=e,a=Zt(e,[`from`,`to`,`restSpeed`,`restDelta`]);let o={done:!1,value:t},{stiffness:s,damping:c,mass:l,velocity:u,duration:d,isResolvedFromDuration:f}=un(a),p=fn,m=fn;function h(){let e=u?-(u/1e3):0,r=n-t,a=c/(2*Math.sqrt(s*l)),o=Math.sqrt(s/l)/1e3;if(i===void 0&&(i=Math.min(Math.abs(n-t)/100,.4)),a<1){let t=on(o,a);p=i=>{let s=Math.exp(-a*o*i);return n-s*((e+a*o*r)/t*Math.sin(t*i)+r*Math.cos(t*i))},m=n=>{let i=Math.exp(-a*o*n);return a*o*i*(Math.sin(t*n)*(e+a*o*r)/t+r*Math.cos(t*n))-i*(Math.cos(t*n)*(e+a*o*r)-t*r*Math.sin(t*n))}}else if(a===1)p=t=>n-Math.exp(-o*t)*(r+(e+o*r)*t);else{let t=o*Math.sqrt(a*a-1);p=i=>{let s=Math.exp(-a*o*i),c=Math.min(t*i,300);return n-s*((e+a*o*r)*Math.sinh(c)+t*r*Math.cosh(c))/t}}}return h(),{next:e=>{let t=p(e);if(f)o.done=e>=d;else{let a=m(e)*1e3,s=Math.abs(a)<=r,c=Math.abs(n-t)<=i;o.done=s&&c}return o.value=o.done?n:t,o},flipTarget:()=>{u=-u,[t,n]=[n,t],h()}}}dn.needsInterpolation=(e,t)=>typeof e==`string`||typeof t==`string`;var fn=e=>0,pn=(e,t,n)=>{let r=t-e;return r===0?1:(n-e)/r},mn=(e,t,n)=>-n*e+n*t+e,hn=(e,t)=>n=>Math.max(Math.min(n,t),e),gn=e=>e%1?Number(e.toFixed(5)):e,_n=/(-)?([\d]*\.?[\d])+/g,vn=/(#[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,yn=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function bn(e){return typeof e==`string`}var xn={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},Sn=Object.assign(Object.assign({},xn),{transform:hn(0,1)}),Cn=Object.assign(Object.assign({},xn),{default:1}),wn=e=>({test:t=>bn(t)&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Tn=wn(`deg`),En=wn(`%`),J=wn(`px`);wn(`vh`),wn(`vw`);var Dn=Object.assign(Object.assign({},En),{parse:e=>En.parse(e)/100,transform:e=>En.transform(e*100)}),On=(e,t)=>n=>!!(bn(n)&&yn.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),kn=(e,t,n)=>r=>{if(!bn(r))return r;let[i,a,o,s]=r.match(_n);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},An={test:On(`hsl`,`hue`),parse:kn(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+En.transform(gn(t))+`, `+En.transform(gn(n))+`, `+gn(Sn.transform(r))+`)`},jn=hn(0,255),Mn=Object.assign(Object.assign({},xn),{transform:e=>Math.round(jn(e))}),Nn={test:On(`rgb`,`red`),parse:kn(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+Mn.transform(e)+`, `+Mn.transform(t)+`, `+Mn.transform(n)+`, `+gn(Sn.transform(r))+`)`};function Pn(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substr(1,2),n=e.substr(3,2),r=e.substr(5,2),i=e.substr(7,2)):(t=e.substr(1,1),n=e.substr(2,1),r=e.substr(3,1),i=e.substr(4,1),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var Fn={test:On(`#`),parse:Pn,transform:Nn.transform},Y={test:e=>Nn.test(e)||Fn.test(e)||An.test(e),parse:e=>Nn.test(e)?Nn.parse(e):An.test(e)?An.parse(e):Fn.parse(e),transform:e=>bn(e)?e:e.hasOwnProperty(`red`)?Nn.transform(e):An.transform(e)},In="${c}",Ln="${n}";function Rn(e){return isNaN(e)&&bn(e)&&(e.match(_n)?.length??0)+(e.match(vn)?.length??0)>0}function zn(e){typeof e==`number`&&(e=`${e}`);let t=[],n=0,r=e.match(vn);r&&(n=r.length,e=e.replace(vn,In),t.push(...r.map(Y.parse)));let i=e.match(_n);return i&&(e=e.replace(_n,Ln),t.push(...i.map(xn.parse))),{values:t,numColors:n,tokenised:e}}function Bn(e){return zn(e).values}function Vn(e){let{values:t,numColors:n,tokenised:r}=zn(e),i=t.length;return e=>{let t=r;for(let r=0;rtypeof e==`number`?0:e;function Un(e){let t=Bn(e);return Vn(e)(t.map(Hn))}var Wn={test:Rn,parse:Bn,createTransformer:Vn,getAnimatableNone:Un},Gn=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function Kn(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(_n)||[];if(!r)return e;let i=n.replace(r,``),a=Gn.has(t)?1:0;return r!==n&&(a*=100),t+`(`+a+i+`)`}var qn=/([a-z-]*)\(.*?\)/g,Jn=Object.assign(Object.assign({},Wn),{getAnimatableNone:e=>{let t=e.match(qn);return t?t.map(Kn).join(` `):e}});function Yn(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Xn({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=Yn(s,r,e+1/3),a=Yn(s,r,e),o=Yn(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}var Zn=(e,t,n)=>{let r=e*e,i=t*t;return Math.sqrt(Math.max(0,n*(i-r)+r))},Qn=[Fn,Nn,An],$n=e=>Qn.find(t=>t.test(e)),er=e=>`'${e}' is not an animatable color. Use the equivalent color code instead.`,tr=(e,t)=>{let n=$n(e),r=$n(t);er(e),er(t);let i=n.parse(e),a=r.parse(t);n===An&&(i=Xn(i),n=Nn),r===An&&(a=Xn(a),r=Nn);let o=Object.assign({},i);return e=>{for(let t in o)t!==`alpha`&&(o[t]=Zn(i[t],a[t],e));return o.alpha=mn(i.alpha,a.alpha,e),n.transform(o)}},nr=e=>typeof e==`number`,rr=(e,t)=>n=>t(e(n)),ir=(...e)=>e.reduce(rr);function ar(e,t){return nr(e)?n=>mn(e,t,n):Y.test(e)?tr(e,t):lr(e,t)}var or=(e,t)=>{let n=[...e],r=n.length,i=e.map((e,n)=>ar(e,t[n]));return e=>{for(let t=0;t{let n=Object.assign(Object.assign({},e),t),r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=ar(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}};function cr(e){let t=Wn.parse(e),n=t.length,r=0,i=0,a=0;for(let e=0;e{let n=Wn.createTransformer(t),r=cr(e),i=cr(t);return r.numHSL===i.numHSL&&r.numRGB===i.numRGB&&r.numNumbers>=i.numNumbers?ir(or(r.parsed,i.parsed),n):(`${e}${t}`,n=>`${n>0?t:e}`)},ur=(e,t)=>n=>mn(e,t,n);function dr(e){if(typeof e==`number`)return ur;if(typeof e==`string`)return Y.test(e)?tr:lr;if(Array.isArray(e))return or;if(typeof e==`object`)return sr}function fr(e,t,n){let r=[],i=n||dr(e[0]),a=e.length-1;for(let n=0;nn(pn(e,t,r))}function mr(e,t){let n=e.length,r=n-1;return i=>{let a=0,o=!1;if(i<=e[0]?o=!0:i>=e[r]&&(a=r-1,o=!0),!o){let t=1;for(;ti||t===r);t++);a=t-1}let s=pn(e[a],e[a+1],i);return t[a](s)}}function hr(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;t.length,!r||!Array.isArray(r)||(r.length,a-1),e[0]>e[a-1]&&(e=[].concat(e),t=[].concat(t),e.reverse(),t.reverse());let o=fr(t,r,i),s=a===2?pr(e,o):mr(e,o);return n?t=>s(Qt(e[0],e[a-1],t)):s}var gr=e=>t=>1-e(1-t),_r=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,vr=e=>t=>t**+e,yr=e=>t=>t*t*((e+1)*t-e),br=e=>{let t=yr(e);return e=>(e*=2)<1?.5*t(e):.5*(2-2**(-10*(e-1)))},xr=1.525,Sr=4/11,Cr=8/11,wr=9/10,Tr=e=>e,Er=vr(2),Dr=gr(Er),Or=_r(Er),kr=e=>1-Math.sin(Math.acos(e)),Ar=gr(kr),jr=_r(Ar),Mr=yr(xr),Nr=gr(Mr),Pr=_r(Mr),Fr=br(xr),Ir=4356/361,Lr=35442/1805,Rr=16061/1805,zr=e=>{if(e===1||e===0)return e;let t=e*e;return ee<.5?.5*(1-zr(1-e*2)):.5*zr(e*2-1)+.5;function Hr(e,t){return e.map(()=>t||Or).splice(0,e.length-1)}function Ur(e){let t=e.length;return e.map((e,n)=>n===0?0:n/(t-1))}function Wr(e,t){return e.map(e=>e*t)}function Gr({from:e=0,to:t=1,ease:n,offset:r,duration:i=300}){let a={done:!1,value:e},o=Array.isArray(t)?t:[e,t],s=Wr(r&&r.length===o.length?r:Ur(o),i);function c(){return hr(s,o,{ease:Array.isArray(n)?n:Hr(o,n)})}let l=c();return{next:e=>(a.value=l(e),a.done=e>=i,a),flipTarget:()=>{o.reverse(),l=c()}}}function Kr({velocity:e=0,from:t=0,power:n=.8,timeConstant:r=350,restDelta:i=.5,modifyTarget:a}){let o={done:!1,value:t},s=n*e,c=t+s,l=a===void 0?c:a(c);return l!==c&&(s=l-t),{next:e=>{let t=-s*Math.exp(-e/r);return o.done=!(t>i||t<-i),o.value=o.done?l:l+t,o},flipTarget:()=>{}}}var qr={keyframes:Gr,spring:dn,decay:Kr};function Jr(e){if(Array.isArray(e.to))return Gr;if(qr[e.type])return qr[e.type];let t=new Set(Object.keys(e));return t.has(`ease`)||t.has(`duration`)&&!t.has(`dampingRatio`)?Gr:t.has(`dampingRatio`)||t.has(`stiffness`)||t.has(`mass`)||t.has(`damping`)||t.has(`restSpeed`)||t.has(`restDelta`)?dn:Gr}function Yr(e,t,n=0){return e-t-n}function Xr(e,t,n=0,r=!0){return r?Yr(t+-e,t,n):t-(e-t)+n}function Zr(e,t,n,r){return r?e>=t+n:e<=-n}var Qr=e=>{let t=({delta:t})=>e(t);return{start:()=>Xt.update(t,!0),stop:()=>Gt.update(t)}};function $r(e){var t,{from:n,autoplay:r=!0,driver:i=Qr,elapsed:a=0,repeat:o=0,repeatType:s=`loop`,repeatDelay:c=0,onPlay:l,onStop:u,onComplete:d,onRepeat:f,onUpdate:p}=e,m=Zt(e,[`from`,`autoplay`,`driver`,`elapsed`,`repeat`,`repeatType`,`repeatDelay`,`onPlay`,`onStop`,`onComplete`,`onRepeat`,`onUpdate`]);let{to:h}=m,g,_=0,v=m.duration,y,b=!1,x=!0,S,C=Jr(m);(t=C).needsInterpolation?.call(t,n,h)&&(S=hr([0,100],[n,h],{clamp:!1}),n=0,h=100);let w=C(Object.assign(Object.assign({},m),{from:n,to:h}));function T(){_++,s===`reverse`?(x=_%2==0,a=Xr(a,v,c,x)):(a=Yr(a,v,c),s===`mirror`&&w.flipTarget()),b=!1,f&&f()}function E(){g.stop(),d&&d()}function D(e){if(x||(e=-e),a+=e,!b){let e=w.next(Math.max(0,a));y=e.value,S&&(y=S(y)),b=x?e.done:a<=0}p?.(y),b&&(_===0&&(v??=a),_{u?.(),g.stop()}}}function ei(e,t){return t?1e3/t*e:0}function ti({from:e=0,velocity:t=0,min:n,max:r,power:i=.8,timeConstant:a=750,bounceStiffness:o=500,bounceDamping:s=10,restDelta:c=1,modifyTarget:l,driver:u,onUpdate:d,onComplete:f,onStop:p}){let m;function h(e){return n!==void 0&&er}function g(e){return n===void 0?r:r===void 0||Math.abs(n-e){var n;d?.(t),(n=e.onUpdate)==null||n.call(e,t)},onComplete:f,onStop:p}))}function v(e){_(Object.assign({type:`spring`,stiffness:o,damping:s,restDelta:c},e))}if(h(e))v({from:e,velocity:t,to:g(e)});else{let r=i*t+e;l!==void 0&&(r=l(r));let o=g(r),s=o===n?-1:1,u,d;_({type:`decay`,from:e,velocity:t,timeConstant:a,power:i,restDelta:c,modifyTarget:l,onUpdate:h(r)?e=>{u=d,d=e,t=ei(e-u,Yt().delta),(s===1&&e>o||s===-1&&em?.stop()}}var ni=(e,t)=>1-3*t+3*e,ri=(e,t)=>3*t-6*e,ii=e=>3*e,ai=(e,t,n)=>((ni(t,n)*e+ri(t,n))*e+ii(t))*e,oi=(e,t,n)=>3*ni(t,n)*e*e+2*ri(t,n)*e+ii(t),si=1e-7,ci=10;function li(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=ai(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>si&&++s=di?fi(t,c,e,n):l===0?c:li(t,r,r+mi,e,n)}return e=>e===0||e===1?e:ai(a(e),t,r)}var gi={},_i=class{subscriptions=new Set;add(e){return this.subscriptions.add(e),()=>this.subscriptions.delete(e)}notify(e,t,n){if(this.subscriptions.size)for(let r of this.subscriptions)r(e,t,n)}clear(){this.subscriptions.clear()}};function vi(e){return!Number.isNaN(Number.parseFloat(e))}var yi=class{current;prev;timeDelta=0;lastUpdated=0;updateSubscribers=new _i;stopAnimation;canTrackVelocity=!1;constructor(e){this.prev=this.current=e,this.canTrackVelocity=vi(this.current)}onChange(e){return this.updateSubscribers.add(e)}clearListeners(){this.updateSubscribers.clear()}set(e){this.updateAndNotify(e)}updateAndNotify=e=>{this.prev=this.current,this.current=e;let{delta:t,timestamp:n}=Yt();this.lastUpdated!==n&&(this.timeDelta=t,this.lastUpdated=n),Xt.postRender(this.scheduleVelocityCheck),this.updateSubscribers.notify(this.current)};get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?ei(Number.parseFloat(this.current)-Number.parseFloat(this.prev),this.timeDelta):0}scheduleVelocityCheck=()=>Xt.postRender(this.velocityCheck);velocityCheck=({timestamp:e})=>{this.canTrackVelocity||=vi(this.current),e!==this.lastUpdated&&(this.prev=this.current)};start(e){return this.stop(),new Promise(t=>{let{stop:n}=e(t);this.stopAnimation=n}).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 bi(e){return new yi(e)}var{isArray:xi}=Array;function Si(){let e=B({}),t=t=>{let n=t=>{e.value[t]&&(e.value[t].stop(),e.value[t].destroy(),delete e.value[t])};t?xi(t)?t.forEach(n):n(t):Object.keys(e.value).forEach(n)};return mt(t),{motionValues:e,get:(t,n,r)=>{if(e.value[t])return e.value[t];let i=bi(n);return i.onChange(e=>r[t]=e),e.value[t]=i,i},stop:t}}function Ci(e){return Array.isArray(e)}function wi(){return{type:`spring`,stiffness:500,damping:25,restDelta:.5,restSpeed:10}}function Ti(e){return{type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restDelta:.01,restSpeed:10}}function Ei(e){return{type:`spring`,stiffness:550,damping:e===0?100:30,restDelta:.01,restSpeed:10}}function Di(){return{type:`keyframes`,ease:`linear`,duration:300}}function Oi(e){return{type:`keyframes`,duration:800,values:e}}var ki={default:Ei,x:wi,y:wi,z:wi,rotate:wi,rotateX:wi,rotateY:wi,rotateZ:wi,scaleX:Ti,scaleY:Ti,scale:Ti,backgroundColor:Di,color:Di,opacity:Di};function Ai(e,t){let n;return n=Ci(t)?Oi:ki[e]||ki.default,{to:t,...n(t)}}var ji={...xn,transform:Math.round},Mi={color:Y,backgroundColor:Y,outlineColor:Y,fill:Y,stroke:Y,borderColor:Y,borderTopColor:Y,borderRightColor:Y,borderBottomColor:Y,borderLeftColor:Y,borderWidth:J,borderTopWidth:J,borderRightWidth:J,borderBottomWidth:J,borderLeftWidth:J,borderRadius:J,radius:J,borderTopLeftRadius:J,borderTopRightRadius:J,borderBottomRightRadius:J,borderBottomLeftRadius:J,width:J,maxWidth:J,height:J,maxHeight:J,size:J,top:J,right:J,bottom:J,left:J,padding:J,paddingTop:J,paddingRight:J,paddingBottom:J,paddingLeft:J,margin:J,marginTop:J,marginRight:J,marginBottom:J,marginLeft:J,rotate:Tn,rotateX:Tn,rotateY:Tn,rotateZ:Tn,scale:Cn,scaleX:Cn,scaleY:Cn,scaleZ:Cn,skew:Tn,skewX:Tn,skewY:Tn,distance:J,translateX:J,translateY:J,translateZ:J,x:J,y:J,z:J,perspective:J,transformPerspective:J,opacity:Sn,originX:Dn,originY:Dn,originZ:J,zIndex:ji,filter:Jn,WebkitFilter:Jn,fillOpacity:Sn,strokeOpacity:Sn,numOctaves:ji},Ni=e=>Mi[e];function Pi(e,t){return t&&typeof e==`number`&&t.transform?t.transform(e):e}function Fi(e,t){let n=Ni(e);return n!==Jn&&(n=Wn),n.getAnimatableNone?n.getAnimatableNone(t):void 0}var Ii={linear:Tr,easeIn:Er,easeInOut:Or,easeOut:Dr,circIn:kr,circInOut:jr,circOut:Ar,backIn:Mr,backInOut:Pr,backOut:Nr,anticipate:Fr,bounceIn:Br,bounceInOut:Vr,bounceOut:zr};function Li(e){if(Array.isArray(e)){let[t,n,r,i]=e;return hi(t,n,r,i)}else if(typeof e==`string`)return Ii[e];return e}function Ri(e){return Array.isArray(e)&&typeof e[0]!=`number`}function zi(e,t){return e===`zIndex`?!1:!!(typeof t==`number`||Array.isArray(t)||typeof t==`string`&&Wn.test(t)&&!t.startsWith(`url(`))}function Bi(e){return Array.isArray(e.to)&&e.to[0]===null&&(e.to=[...e.to],e.to[0]=e.from),e}function Vi({ease:e,times:t,delay:n,...r}){let i={...r};return t&&(i.offset=t),e&&(i.ease=Ri(e)?e.map(Li):Li(e)),n&&(i.elapsed=-n),i}function Hi(e,t,n){return Array.isArray(t.to)&&(e.duration||=800),Bi(t),Ui(e)||(e={...e,...Ai(n,t.to)}),{...t,...Vi(e)}}function Ui({delay:e,repeat:t,repeatType:n,repeatDelay:r,from:i,...a}){return!!Object.keys(a).length}function Wi(e,t){return e[t]||e.default||e}function Gi(e,t,n,r,i){let a=Wi(r,e),o=a.from===null||a.from===void 0?t.get():a.from,s=zi(e,n);o===`none`&&s&&typeof n==`string`&&(o=Fi(e,n));let c=zi(e,o);function l(s){let c={from:o,to:n,velocity:r.velocity?r.velocity:t.getVelocity(),onUpdate:e=>t.set(e)};return a.type===`inertia`||a.type===`decay`?ti({...c,...a}):$r({...Hi(a,c,e),onUpdate:e=>{c.onUpdate(e),a.onUpdate&&a.onUpdate(e)},onComplete:()=>{i&&i(),s&&s()}})}function u(e){return t.set(n),i&&i(),e&&e(),{stop:()=>{}}}return!c||!s||a.type===!1?u:l}function Ki(){let{motionValues:e,stop:t,get:n}=Si();return{motionValues:e,stop:t,push:(e,t,r,i={},a)=>{let o=r[e],s=n(e,o,r);if(i&&i.immediate){s.set(t);return}let c=Gi(e,s,t,i,a);s.start(c)}}}function qi(e,t={},{motionValues:n,push:r,stop:i}=Ki()){let a=M(t),o=B(!1);T(n,e=>{o.value=Object.values(e).filter(e=>e.isAnimating()).length>0},{immediate:!0,deep:!0});let s=e=>{if(!a||!a[e])throw Error(`The variant ${e} does not exist.`);return a[e]},c=t=>{typeof t==`string`&&(t=s(t));let n=Object.entries(t).map(([n,i])=>{if(n!==`transition`)return new Promise(a=>r(n,i,e,t.transition||Ai(n,t[n]),a))}).filter(Boolean);async function i(){await Promise.all(n),t.transition?.onComplete?.()}return Promise.all([i()])};return{isAnimating:o,apply:c,set:t=>{let n=rt(t)?t:s(t);Object.entries(n).forEach(([t,n])=>{t!==`transition`&&r(t,n,e,{immediate:!0})})},leave:async e=>{let t;if(a&&(a.leave&&(t=a.leave),!a.leave&&a.initial&&(t=a.initial)),!t){e();return}await c(t),e()},stop:i}}var Ji=typeof window<`u`,Yi=()=>Ji&&(window.onpointerdown===null||void 0),Xi=()=>Ji&&(window.ontouchstart===null||void 0),Zi=()=>Ji&&(window.onmousedown===null||void 0);function Qi({target:e,state:t,variants:n,apply:r}){let i=M(n),a=B(!1),o=B(!1),s=B(!1),c=E(()=>{let e=[...Object.keys(t.value||{})];return i?(i.hovered&&(e=[...e,...Object.keys(i.hovered)]),i.tapped&&(e=[...e,...Object.keys(i.tapped)]),i.focused&&(e=[...e,...Object.keys(i.focused)]),e):e}),l=E(()=>{let e={};for(let n in Object.assign(e,t.value),a.value&&i.hovered&&Object.assign(e,i.hovered),o.value&&i.tapped&&Object.assign(e,i.tapped),s.value&&i.focused&&Object.assign(e,i.focused),e)c.value.includes(n)||delete e[n];return e});i.hovered&&(q(e,`mouseenter`,()=>a.value=!0),q(e,`mouseleave`,()=>{a.value=!1,o.value=!1})),i.tapped&&(Zi()&&(q(e,`mousedown`,()=>o.value=!0),q(e,`mouseup`,()=>o.value=!1)),Yi()&&(q(e,`pointerdown`,()=>o.value=!0),q(e,`pointerup`,()=>o.value=!1)),Xi()&&(q(e,`touchstart`,()=>o.value=!0),q(e,`touchend`,()=>o.value=!1))),i.focused&&(q(e,`focus`,()=>s.value=!0),q(e,`blur`,()=>s.value=!1)),T([a,o,s],()=>{r(l.value)})}function $i({set:e,target:t,variants:n,variant:r}){let i=M(n);T(()=>t,()=>{i&&(i.initial&&(e(`initial`),r.value=`initial`),i.enter&&(r.value=`enter`))},{immediate:!0,flush:`pre`})}function ea({state:e,apply:t}){T(e,e=>{e&&t(e)},{immediate:!0})}function ta({target:e,variants:t,variant:n}){let r=M(t);r&&(r.visible||r.visibleOnce)&&kt(e,([{isIntersecting:e}])=>{r.visible?e?n.value=`visible`:n.value=`initial`:r.visibleOnce&&(e&&n.value!==`visibleOnce`?n.value=`visibleOnce`:n.value||=`initial`)})}function na(e,t={syncVariants:!0,lifeCycleHooks:!0,visibilityHooks:!0,eventListeners:!0}){t.lifeCycleHooks&&$i(e),t.syncVariants&&ea(e),t.visibilityHooks&&ta(e),t.eventListeners&&Qi(e)}function ra(e={}){let t=le({...e}),n=B({});return T(t,()=>{let e={};for(let[n,r]of Object.entries(t))e[n]=Pi(r,Ni(n));n.value=e},{immediate:!0,deep:!0}),{state:t,style:n}}function ia(e,t){T(()=>K(e),e=>{e&&t(e)},{immediate:!0})}var aa={x:`translateX`,y:`translateY`,z:`translateZ`};function oa(e={},t=!0){let n=le({...e}),r=B(``);return T(n,e=>{let n=``,i=!1;if(t&&(e.x||e.y||e.z)){let t=[e.x||0,e.y||0,e.z||0].map(e=>Pi(e,J)).join(`,`);n+=`translate3d(${t}) `,i=!0}for(let[r,i]of Object.entries(e)){if(t&&(r===`x`||r===`y`||r===`z`))continue;let e=Pi(i,Ni(r));n+=`${aa[r]||r}(${e}) `}t&&!i&&(n+=`translateZ(0px) `),r.value=n.trim()},{immediate:!0,deep:!0}),{state:n,transform:r}}var sa=[``,`X`,`Y`,`Z`],ca=[`perspective`,`translate`,`scale`,`rotate`,`skew`],la=[`transformPerspective`,`x`,`y`,`z`];ca.forEach(e=>{sa.forEach(t=>{let n=e+t;la.push(n)})});var ua=new Set(la);function da(e){return ua.has(e)}var fa=new Set([`originX`,`originY`,`originZ`]);function pa(e){return fa.has(e)}function ma(e){let t={},n={};return Object.entries(e).forEach(([e,r])=>{da(e)||pa(e)?t[e]=r:n[e]=r}),{transform:t,style:n}}function ha(e){let{transform:t,style:n}=ma(e),{transform:r}=oa(t),{style:i}=ra(n);return r.value&&(i.value.transform=r.value),i.value}function ga(e,t){let n,r,{state:i,style:a}=ra();return ia(e,e=>{r=e;for(let t of Object.keys(Mi))e.style[t]===null||e.style[t]===``||da(t)||pa(t)||(i[t]=e.style[t]);n&&Object.entries(n).forEach(([t,n])=>e.style[t]=n),t&&t(i)}),T(a,e=>{if(!r){n=e;return}for(let t in e)r.style[t]=e[t]},{immediate:!0}),{style:i}}function _a(e){let t=e.trim().split(/\) |\)/);if(t.length===1)return{};let n=e=>e.endsWith(`px`)||e.endsWith(`deg`)?Number.parseFloat(e):Number.isNaN(Number(e))?Number(e):e;return t.reduce((e,t)=>{if(!t)return e;let[r,i]=t.split(`(`),a=i.split(`,`).map(e=>n(e.endsWith(`)`)?e.replace(`)`,``):e.trim())),o=a.length===1?a[0]:a;return{...e,[r]:o}},{})}function va(e,t){Object.entries(_a(t)).forEach(([t,n])=>{let r=[`x`,`y`,`z`];if(t===`translate3d`){if(n===0){r.forEach(t=>e[t]=0);return}n.forEach((t,n)=>e[r[n]]=t);return}if(n=Number.parseFloat(`${n}`),t===`translateX`){e.x=n;return}if(t===`translateY`){e.y=n;return}if(t===`translateZ`){e.z=n;return}e[t]=n})}function ya(e,t){let n,r,{state:i,transform:a}=oa();return ia(e,e=>{r=e,e.style.transform&&va(i,e.style.transform),n&&(e.style.transform=n),t&&t(i)}),T(a,e=>{if(!r){n=e;return}r.style.transform=e},{immediate:!0}),{transform:i}}function ba(e){return Object.entries(e)}function xa(e,t){let n=le({}),r=e=>Object.entries(e).forEach(([e,t])=>n[e]=t),{style:i}=ga(e,r),{transform:a}=ya(e,r);return T(n,e=>{ba(e).forEach(([e,t])=>{let n=da(e)?a:i;n[e]&&n[e]===t||(n[e]=t)})},{immediate:!0,deep:!0}),ia(e,()=>t&&r(t)),{motionProperties:n,style:i,transform:a}}function Sa(e={}){let t=M(e),n=B();return{state:E(()=>{if(n.value)return t[n.value]}),variant:n}}function Ca(e,t={},n){let{motionProperties:r}=xa(e),{variant:i,state:a}=Sa(t),o={target:e,variant:i,variants:t,state:a,motionProperties:r,...qi(r,t)};return na(o,n),o}var wa=[`delay`,`duration`],Ta=[`initial`,`enter`,`leave`,`visible`,`visible-once`,`visibleOnce`,`hovered`,`tapped`,`focused`,...wa];function Ea(e){return wa.includes(e)}function Da(e,t){let n=e.props?e.props:e.data&&e.data.attrs?e.data.attrs:{};if(n){n.variants&&rt(n.variants)&&(t.value={...t.value,...n.variants});for(let e of Ta)if(!(!n||!n[e])){if(Ea(e)&&typeof n[e]==`number`){for(let r of[`enter`,`visible`,`visibleOnce`]){let i=t.value[r];i!=null&&(i.transition??={},i.transition[e]=n[e])}continue}if(rt(n[e])){let r=n[e];e===`visible-once`&&(e=`visibleOnce`),t.value[e]=r}}}}function Oa(e,t=!1){return{created:(n,r,i)=>{let a=r.value&&typeof r.value==`string`?r.value:i.key;a&&gi[a]&&gi[a].stop();let o=B(t?structuredClone(S(e)||{}):e||{});typeof r.value==`object`&&(o.value=r.value),Da(i,o);let s=Ca(n,o,{eventListeners:!0,lifeCycleHooks:!0,syncVariants:!0,visibilityHooks:!1});n.motionInstance=s,a&&(gi[a]=s)},mounted:(e,t,n)=>{e.motionInstance&&ta(e.motionInstance)},getSSRProps(t,n){let{initial:r}=t.value||n&&n?.props||{};r=M(r);let i=Ee({},e?.initial||{},r||{});if(!(!i||Object.keys(i).length===0))return{style:ha(i)}}}}var ka={__proto__:null,fade:{initial:{opacity:0},enter:{opacity:1}},fadeVisible:{initial:{opacity:0},visible:{opacity:1}},fadeVisibleOnce:{initial:{opacity:0},visibleOnce:{opacity:1}},pop:{initial:{scale:0,opacity:0},enter:{scale:1,opacity:1}},popVisible:{initial:{scale:0,opacity:0},visible:{scale:1,opacity:1}},popVisibleOnce:{initial:{scale:0,opacity:0},visibleOnce:{scale:1,opacity:1}},rollBottom:{initial:{y:100,rotate:90,opacity:0},enter:{y:0,rotate:0,opacity:1}},rollLeft:{initial:{x:-100,rotate:90,opacity:0},enter:{x:0,rotate:0,opacity:1}},rollRight:{initial:{x:100,rotate:-90,opacity:0},enter:{x:0,rotate:0,opacity:1}},rollTop:{initial:{y:-100,rotate:-90,opacity:0},enter:{y:0,rotate:0,opacity:1}},rollVisibleBottom:{initial:{y:100,rotate:90,opacity:0},visible:{y:0,rotate:0,opacity:1}},rollVisibleLeft:{initial:{x:-100,rotate:90,opacity:0},visible:{x:0,rotate:0,opacity:1}},rollVisibleOnceBottom:{initial:{y:100,rotate:90,opacity:0},visibleOnce:{y:0,rotate:0,opacity:1}},rollVisibleOnceLeft:{initial:{x:-100,rotate:90,opacity:0},visibleOnce:{x:0,rotate:0,opacity:1}},rollVisibleOnceRight:{initial:{x:100,rotate:-90,opacity:0},visibleOnce:{x:0,rotate:0,opacity:1}},rollVisibleOnceTop:{initial:{y:-100,rotate:-90,opacity:0},visibleOnce:{y:0,rotate:0,opacity:1}},rollVisibleRight:{initial:{x:100,rotate:-90,opacity:0},visible:{x:0,rotate:0,opacity:1}},rollVisibleTop:{initial:{y:-100,rotate:-90,opacity:0},visible:{y:0,rotate:0,opacity:1}},slideBottom:{initial:{y:100,opacity:0},enter:{y:0,opacity:1}},slideLeft:{initial:{x:-100,opacity:0},enter:{x:0,opacity:1}},slideRight:{initial:{x:100,opacity:0},enter:{x:0,opacity:1}},slideTop:{initial:{y:-100,opacity:0},enter:{y:0,opacity:1}},slideVisibleBottom:{initial:{y:100,opacity:0},visible:{y:0,opacity:1}},slideVisibleLeft:{initial:{x:-100,opacity:0},visible:{x:0,opacity:1}},slideVisibleOnceBottom:{initial:{y:100,opacity:0},visibleOnce:{y:0,opacity:1}},slideVisibleOnceLeft:{initial:{x:-100,opacity:0},visibleOnce:{x:0,opacity:1}},slideVisibleOnceRight:{initial:{x:100,opacity:0},visibleOnce:{x:0,opacity:1}},slideVisibleOnceTop:{initial:{y:-100,opacity:0},visibleOnce:{y:0,opacity:1}},slideVisibleRight:{initial:{x:100,opacity:0},visible:{x:0,opacity:1}},slideVisibleTop:{initial:{y:-100,opacity:0},visible:{y:0,opacity:1}}};function Aa(e){let t=`àáâäæãåāăąçćčđďèéêëēėęěğǵḧîïíīįìłḿñńǹňôöòóœøōõőṕŕřßśšşșťțûüùúūǘůűųẃẍÿýžźż·/_,:;`,n=new RegExp(t.split(``).join(`|`),`g`);return e.toString().replace(/[A-Z]/g,e=>`-${e}`).toLowerCase().replace(/\s+/g,`-`).replace(n,e=>`aaaaaaaaaacccddeeeeeeeegghiiiiiilmnnnnoooooooooprrsssssttuuuuuuuuuwxyyzzz------`.charAt(t.indexOf(e))).replace(/&/g,`-and-`).replace(/[^\w\-]+/g,``).replace(/-{2,}/g,`-`).replace(/^-+/,``).replace(/-+$/,``)}var ja=Symbol(``),Ma={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 Na(e){return Object.prototype.toString.call(e)===`[object Object]`}function Pa(e){if(Array.isArray(e))return e.map(Pa);if(Na(e)){let t={};for(let n in e)t[n]=Pa(e[n]);return t}return e}function Fa(e){let t=le({}),n=o(ja,{}),r=E(()=>e.preset==null?{}:n!=null&&e.preset in n?structuredClone(S(n)[e.preset]):e.preset in ka?structuredClone(ka[e.preset]):{}),i=E(()=>({initial:e.initial,enter:e.enter,leave:e.leave,visible:e.visible,visibleOnce:e.visibleOnce,hovered:e.hovered,tapped:e.tapped,focused:e.focused}));function a(e,t){for(let n of[`delay`,`duration`]){if(t[n]==null)continue;let r=Number.parseInt(t[n]);for(let t of[`enter`,`visible`,`visibleOnce`]){let i=e[t];i!=null&&(i.transition??={},i.transition[n]=r)}}return e}let s=E(()=>a({...Ee({},i.value,r.value,e.variants||{})},e));function c(e,n,r){e.props??={},e.props.style??={},e.props.style={...e.props.style,...r};let i=a(Pa(s.value),e.props);return e.props.onVnodeMounted=({el:e})=>{t[n]=Ca(e,i)},e.props.onVnodeUpdated=({el:e})=>{let r=ha(t[n].state);for(let[t,n]of Object.entries(r))e.style[t]=n},e}return{motionConfig:s,setNodeInstance:c}}var Ia=t({name:`Motion`,props:{...Ma,is:{type:[String,Object],default:`div`}},setup(e){let t=oe(),{motionConfig:n,setNodeInstance:r}=Fa(e);return()=>{let i=ha(n.value.initial||{}),a=p(e.is,void 0,t);return r(a,0,i),a}}}),La=t({name:`MotionGroup`,props:{...Ma,is:{type:[String,Object],required:!1}},setup(e){let t=oe(),{motionConfig:n,setNodeInstance:r}=Fa(e);return()=>{let i=ha(n.value.initial||{}),a=t.default?.()||[];for(let e=0;e{e.style.overflow=t.overflow,n()}}function s(e,n){return[{height:X,opacity:t.opacityClosed,paddingTop:X,paddingBottom:X,borderTopWidth:X,borderBottomWidth:X,marginTop:X,marginBottom:X},{height:e,opacity:t.opacityOpened,paddingTop:n.paddingTop,paddingBottom:n.paddingBottom,borderTopWidth:n.borderTopWidth,borderBottomWidth:n.borderBottomWidth,marginTop:n.marginTop,marginBottom:n.marginBottom}]}function c(e,t,n){return e!==i||!r||r.playState!==`running`?!1:(r.onfinish=()=>{e.style.overflow=t,n()},r.reverse(),!0)}function l(e,r){let i=e,l=n(i);c(i,l.overflow,r)||o(i,l,r,s(a(i,l),l),{duration:t.duration,easing:t.easingEnter})}function d(e,r){let i=e,a=n(i);if(c(i,a.overflow,r))return;let{height:l}=getComputedStyle(i);i.style.height=l,i.style.overflow=`hidden`,o(i,a,r,s(l,a).reverse(),{duration:t.duration,easing:t.easingLeave})}return(e,t)=>(u(),x(re,{css:!1,onEnter:l,onLeave:d},{default:N(()=>[w(e.$slots,`default`)]),_:3}))}}),Ba=0;function Va(){I(e=>{if(!be)return;let t=document.querySelectorAll(`[data-reka-focus-guard]`);document.body.insertAdjacentElement(`afterbegin`,t[0]??Ha()),document.body.insertAdjacentElement(`beforeend`,t[1]??Ha()),Ba++,e(()=>{Ba===1&&document.querySelectorAll(`[data-reka-focus-guard]`).forEach(e=>e.remove()),Ba--})})}function Ha(){let e=document.createElement(`span`);return e.setAttribute(`data-reka-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}function Ua(e,t){let n=xe(!1,300),r=B(null),i=me();function a(){r.value=null,n.value=!1}function o(e,t){let i=e.currentTarget,a={x:e.clientX,y:e.clientY},o=Ga(a,Wa(a,i.getBoundingClientRect())),s=Ka(t.getBoundingClientRect());r.value=Ja([...o,...s]),n.value=!0}return I(n=>{if(e.value&&t.value){let r=e=>o(e,t.value),i=t=>o(t,e.value);e.value.addEventListener(`pointerleave`,r),t.value.addEventListener(`pointerleave`,i),n(()=>{e.value?.removeEventListener(`pointerleave`,r),t.value?.removeEventListener(`pointerleave`,i)})}}),I(n=>{if(r.value){let o=n=>{if(!r.value||!(n.target instanceof Element))return;let o=n.target,s={x:n.clientX,y:n.clientY},c=e.value?.contains(o)||t.value?.contains(o),l=!qa(s,r.value),u=!!o.closest(`[data-grace-area-trigger]`);c?a():(l||u)&&(a(),i.trigger())};e.value?.ownerDocument.addEventListener(`pointermove`,o),n(()=>e.value?.ownerDocument.removeEventListener(`pointermove`,o))}}),{isPointerInTransit:n,onPointerExit:i.on}}function Wa(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function Ga(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Ka(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function qa(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;er!=l>r&&n<(c-o)*(r-s)/(l-s)+o&&(i=!i)}return i}function Ja(e){let t=e.slice();return t.sort((e,t)=>e.xt.x?1:e.yt.y?1:0),Ya(t)}function Ya(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Xa=t({__name:`DialogTrigger`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=Me(),{forwardRef:r,currentElement:i}=W();return n.contentId||=ge(void 0,`reka-dialog-content`),C(()=>{n.triggerElement.value=i.value}),(e,i)=>(u(),x(M(H),V(t,{ref:M(r),type:e.as===`button`?`button`:void 0,"aria-haspopup":`dialog`,"aria-expanded":M(n).open.value||!1,"aria-controls":M(n).open.value?M(n).contentId:void 0,"data-state":M(n).open.value?`open`:`closed`,onClick:M(n).onOpenToggle}),{default:N(()=>[w(e.$slots,`default`)]),_:3},16,[`type`,`aria-expanded`,`aria-controls`,`data-state`,`onClick`]))}}),Za={key:0,d:`M0 0L6 6L12 0`},Qa={key:1,d:`M0 0L4.58579 4.58579C5.36683 5.36683 6.63316 5.36684 7.41421 4.58579L12 0`},$a=t({__name:`Arrow`,props:{width:{type:Number,required:!1,default:10},height:{type:Number,required:!1,default:5},rounded:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`svg`}},setup(e){let t=e;return W(),(e,n)=>(u(),x(M(H),V(t,{width:e.width,height:e.height,viewBox:e.asChild?void 0:`0 0 12 6`,preserveAspectRatio:e.asChild?void 0:`none`}),{default:N(()=>[w(e.$slots,`default`,{},()=>[e.rounded?(u(),L(`path`,Qa)):(u(),L(`path`,Za))])]),_:3},16,[`width`,`height`,`viewBox`,`preserveAspectRatio`]))}}),eo={top:`bottom`,right:`left`,bottom:`top`,left:`right`},to=t({inheritAttrs:!1,__name:`PopperArrow`,props:{width:{type:Number,required:!1},height:{type:Number,required:!1},rounded:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`svg`}},setup(e){let{forwardRef:t}=W(),n=Se(),r=E(()=>eo[n.placedSide.value]);return(e,i)=>(u(),L(`span`,{ref:e=>{M(n).onArrowChange(e)},style:m({position:`absolute`,left:M(n).arrowX?.value?`${M(n).arrowX?.value}px`:void 0,top:M(n).arrowY?.value?`${M(n).arrowY?.value}px`:void 0,[r.value]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[M(n).placedSide.value],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[M(n).placedSide.value],visibility:M(n).shouldHideArrow.value?`hidden`:void 0})},[j($a,V(e.$attrs,{ref:M(t),style:{display:`block`},as:e.as,"as-child":e.asChild,rounded:e.rounded,width:e.width,height:e.height}),{default:N(()=>[w(e.$slots,`default`)]),_:3},16,[`as`,`as-child`,`rounded`,`width`,`height`])],4))}}),[no,ro]=Ce(`PopoverRoot`),io=t({__name:`PopoverRoot`,props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},modal:{type:Boolean,required:!1,default:!1}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=t,{modal:i}=a(n),o=de(n,`open`,r,{defaultValue:n.defaultOpen,passive:n.open===void 0});return ro({contentId:``,triggerId:``,modal:i,open:o,onOpenChange:e=>{o.value=e},onOpenToggle:()=>{o.value=!o.value},triggerElement:B(),hasCustomAnchor:B(!1)}),(e,t)=>(u(),x(M(ke),null,{default:N(()=>[w(e.$slots,`default`,{open:M(o),close:()=>o.value=!1})]),_:3}))}}),ao=t({__name:`PopoverContentImpl`,props:{trapFocus:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=he(ye(n,`trapFocus`,`disableOutsidePointerEvents`)),{forwardRef:a}=W(),o=no();return Va(),(e,t)=>(u(),x(M(Ie),{"as-child":``,loop:``,trapped:e.trapFocus,onMountAutoFocus:t[5]||=e=>r(`openAutoFocus`,e),onUnmountAutoFocus:t[6]||=e=>r(`closeAutoFocus`,e)},{default:N(()=>[j(M(U),{"as-child":``,"disable-outside-pointer-events":e.disableOutsidePointerEvents,onPointerDownOutside:t[0]||=e=>r(`pointerDownOutside`,e),onInteractOutside:t[1]||=e=>r(`interactOutside`,e),onEscapeKeyDown:t[2]||=e=>r(`escapeKeyDown`,e),onFocusOutside:t[3]||=e=>r(`focusOutside`,e),onDismiss:t[4]||=e=>M(o).onOpenChange(!1)},{default:N(()=>[j(M(we),V(M(i),{id:M(o).contentId,ref:M(a),"data-state":M(o).open.value?`open`:`closed`,"aria-labelledby":M(o).triggerId,style:{"--reka-popover-content-transform-origin":`var(--reka-popper-transform-origin)`,"--reka-popover-content-available-width":`var(--reka-popper-available-width)`,"--reka-popover-content-available-height":`var(--reka-popper-available-height)`,"--reka-popover-trigger-width":`var(--reka-popper-anchor-width)`,"--reka-popover-trigger-height":`var(--reka-popper-anchor-height)`},role:`dialog`}),{default:N(()=>[w(e.$slots,`default`)]),_:3},16,[`id`,`data-state`,`aria-labelledby`])]),_:3},8,[`disable-outside-pointer-events`])]),_:3},8,[`trapped`]))}}),oo=t({__name:`PopoverContentModal`,props:{side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=no(),a=B(!1);fe(!0);let o=pe(n,r),{forwardRef:s,currentElement:c}=W();return ue(c),(e,t)=>(u(),x(ao,V(M(o),{ref:M(s),"trap-focus":M(i).open.value,"disable-outside-pointer-events":``,onCloseAutoFocus:t[0]||=O(e=>{r(`closeAutoFocus`,e),a.value||M(i).triggerElement.value?.focus()},[`prevent`]),onPointerDownOutside:t[1]||=e=>{r(`pointerDownOutside`,e);let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;a.value=t.button===2||n},onFocusOutside:t[2]||=O(()=>{},[`prevent`])}),{default:N(()=>[w(e.$slots,`default`)]),_:3},16,[`trap-focus`]))}}),so=t({__name:`PopoverContentNonModal`,props:{side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=no(),a=B(!1),o=B(!1),s=pe(n,r);return(e,t)=>(u(),x(ao,V(M(s),{"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:t[0]||=e=>{r(`closeAutoFocus`,e),e.defaultPrevented||(a.value||M(i).triggerElement.value?.focus(),e.preventDefault()),a.value=!1,o.value=!1},onInteractOutside:t[1]||=async e=>{r(`interactOutside`,e),e.defaultPrevented||(a.value=!0,e.detail.originalEvent.type===`pointerdown`&&(o.value=!0));let t=e.target;M(i).triggerElement.value?.contains(t)&&e.preventDefault(),e.detail.originalEvent.type===`focusin`&&o.value&&e.preventDefault()}}),{default:N(()=>[w(e.$slots,`default`)]),_:3},16))}}),co=t({__name:`PopoverContent`,props:{forceMount:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=no(),a=pe(n,r),{forwardRef:o}=W();return i.contentId||=ge(void 0,`reka-popover-content`),(e,t)=>(u(),x(M(Te),{present:e.forceMount||M(i).open.value},{default:N(()=>[M(i).modal.value?(u(),x(oo,V({key:0},M(a),{ref:M(o)}),{default:N(()=>[w(e.$slots,`default`)]),_:3},16)):(u(),x(so,V({key:1},M(a),{ref:M(o)}),{default:N(()=>[w(e.$slots,`default`)]),_:3},16))]),_:3},8,[`present`]))}}),lo=t({__name:`PopoverPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(u(),x(M(Fe),f(d(t)),{default:N(()=>[w(e.$slots,`default`)]),_:3},16))}}),uo=t({__name:`PopoverTrigger`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=no(),{forwardRef:r,currentElement:i}=W();return n.triggerId||=ge(void 0,`reka-popover-trigger`),C(()=>{n.triggerElement.value=i.value}),(e,i)=>(u(),x(y(M(n).hasCustomAnchor.value?M(H):M(De)),{"as-child":``},{default:N(()=>[j(M(H),{id:M(n).triggerId,ref:M(r),type:e.as===`button`?`button`:void 0,"aria-haspopup":`dialog`,"aria-expanded":M(n).open.value,"aria-controls":M(n).contentId,"data-state":M(n).open.value?`open`:`closed`,as:e.as,"as-child":t.asChild,onClick:M(n).onOpenToggle},{default:N(()=>[w(e.$slots,`default`)]),_:3},8,[`id`,`type`,`aria-expanded`,`aria-controls`,`data-state`,`as`,`as-child`,`onClick`])]),_:3}))}}),fo=t({__name:`TooltipArrow`,props:{width:{type:Number,required:!1,default:10},height:{type:Number,required:!1,default:5},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`svg`}},setup(e){let t=e;return W(),(e,n)=>(u(),x(M(to),f(d(t)),{default:N(()=>[w(e.$slots,`default`)]),_:3},16))}}),[po,mo]=Ce(`TooltipProvider`),ho=t({inheritAttrs:!1,__name:`TooltipProvider`,props:{delayDuration:{type:Number,required:!1,default:700},skipDelayDuration:{type:Number,required:!1,default:300},disableHoverableContent:{type:Boolean,required:!1,default:!1},disableClosingTrigger:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},ignoreNonKeyboardFocus:{type:Boolean,required:!1,default:!1}},setup(e){let{delayDuration:t,skipDelayDuration:n,disableHoverableContent:r,disableClosingTrigger:i,ignoreNonKeyboardFocus:o,disabled:s}=a(e);W();let c=B(!0),l=B(!1),{start:u,stop:d}=_e(()=>{c.value=!0},n,{immediate:!1});return mo({isOpenDelayed:c,delayDuration:t,onOpen(){d(),c.value=!1},onClose(){u()},isPointerInTransitRef:l,disableHoverableContent:r,disableClosingTrigger:i,disabled:s,ignoreNonKeyboardFocus:o}),(e,t)=>w(e.$slots,`default`)}}),go=`tooltip.open`,[_o,vo]=Ce(`TooltipRoot`),yo=t({__name:`TooltipRoot`,props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},delayDuration:{type:Number,required:!1,default:void 0},disableHoverableContent:{type:Boolean,required:!1,default:void 0},disableClosingTrigger:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1,default:void 0},ignoreNonKeyboardFocus:{type:Boolean,required:!1,default:void 0}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=t;W();let i=po(),a=E(()=>n.disableHoverableContent??i.disableHoverableContent.value),o=E(()=>n.disableClosingTrigger??i.disableClosingTrigger.value),s=E(()=>n.disabled??i.disabled.value),c=E(()=>n.delayDuration??i.delayDuration.value),l=E(()=>n.ignoreNonKeyboardFocus??i.ignoreNonKeyboardFocus.value),d=de(n,`open`,r,{defaultValue:n.defaultOpen,passive:n.open===void 0});T(d,e=>{i.onClose&&(e?(i.onOpen(),document.dispatchEvent(new CustomEvent(go))):i.onClose())});let f=B(!1),p=B(),m=E(()=>d.value?f.value?`delayed-open`:`instant-open`:`closed`),{start:h,stop:g}=_e(()=>{f.value=!0,d.value=!0},c,{immediate:!1});function _(){g(),f.value=!1,d.value=!0}function v(){g(),d.value=!1}function y(){h()}return vo({contentId:``,open:d,stateAttribute:m,trigger:p,onTriggerChange(e){p.value=e},onTriggerEnter(){i.isOpenDelayed.value?y():_()},onTriggerLeave(){a.value?v():g()},onOpen:_,onClose:v,disableHoverableContent:a,disableClosingTrigger:o,disabled:s,ignoreNonKeyboardFocus:l}),(e,t)=>(u(),x(M(ke),null,{default:N(()=>[w(e.$slots,`default`,{open:M(d)})]),_:3}))}}),bo=t({__name:`TooltipContentImpl`,props:{ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1,default:`top`},sideOffset:{type:Number,required:!1,default:0},align:{type:null,required:!1,default:`center`},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1,default:!0},collisionBoundary:{type:null,required:!1,default:()=>[]},collisionPadding:{type:[Number,Object],required:!1,default:0},arrowPadding:{type:Number,required:!1,default:0},sticky:{type:String,required:!1,default:`partial`},hideWhenDetached:{type:Boolean,required:!1,default:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=t,i=_o(),{forwardRef:a}=W(),o=oe(),s=E(()=>o.default?.({})),c=E(()=>{if(n.ariaLabel)return n.ariaLabel;let e=``;function t(n){typeof n.children==`string`&&n.type!==ie?e+=n.children:Array.isArray(n.children)&&n.children.forEach(e=>t(e))}return s.value?.forEach(e=>t(e)),e}),l=E(()=>{let{ariaLabel:e,...t}=n;return t});return C(()=>{ve(window,`scroll`,e=>{e.target?.contains(i.trigger.value)&&i.onClose()}),ve(window,go,i.onClose)}),(e,t)=>(u(),x(M(U),{"as-child":``,"disable-outside-pointer-events":!1,onEscapeKeyDown:t[0]||=e=>r(`escapeKeyDown`,e),onPointerDownOutside:t[1]||=e=>{M(i).disableClosingTrigger.value&&M(i).trigger.value?.contains(e.target)&&e.preventDefault(),r(`pointerDownOutside`,e)},onFocusOutside:t[2]||=O(()=>{},[`prevent`]),onDismiss:t[3]||=e=>M(i).onClose()},{default:N(()=>[j(M(we),V({ref:M(a),"data-state":M(i).stateAttribute.value},{...e.$attrs,...l.value},{style:{"--reka-tooltip-content-transform-origin":`var(--reka-popper-transform-origin)`,"--reka-tooltip-content-available-width":`var(--reka-popper-available-width)`,"--reka-tooltip-content-available-height":`var(--reka-popper-available-height)`,"--reka-tooltip-trigger-width":`var(--reka-popper-anchor-width)`,"--reka-tooltip-trigger-height":`var(--reka-popper-anchor-height)`}}),{default:N(()=>[w(e.$slots,`default`),j(M(Oe),{id:M(i).contentId,role:`tooltip`},{default:N(()=>[h(v(c.value),1)]),_:1},8,[`id`])]),_:3},16,[`data-state`])]),_:3}))}}),xo=t({__name:`TooltipContentHoverable`,props:{ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},setup(e){let t=he(e),{forwardRef:n,currentElement:r}=W(),{trigger:i,onClose:a}=_o(),o=po(),{isPointerInTransit:s,onPointerExit:c}=Ua(i,r);return o.isPointerInTransitRef=s,c(()=>{a()}),(e,r)=>(u(),x(bo,V({ref:M(n)},M(t)),{default:N(()=>[w(e.$slots,`default`)]),_:3},16))}}),So=t({__name:`TooltipContent`,props:{forceMount:{type:Boolean,required:!1},ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1,default:`top`},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=t,i=_o(),a=pe(n,r),{forwardRef:o}=W();return(e,t)=>(u(),x(M(Te),{present:e.forceMount||M(i).open.value},{default:N(()=>[(u(),x(y(M(i).disableHoverableContent.value?bo:xo),V({ref:M(o)},M(a)),{default:N(()=>[w(e.$slots,`default`)]),_:3},16))]),_:3},8,[`present`]))}}),Co=t({__name:`TooltipPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(u(),x(M(Fe),f(d(t)),{default:N(()=>[w(e.$slots,`default`)]),_:3},16))}}),wo=t({__name:`TooltipTrigger`,props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(t){let n=t,r=_o(),i=po();r.contentId||=ge(void 0,`reka-tooltip-content`);let{forwardRef:a,currentElement:o}=W(),s=B(!1),c=B(!1),l=E(()=>r.disabled.value?{}:{click:_,focus:h,pointermove:p,pointerleave:m,pointerdown:f,blur:g});C(()=>{r.onTriggerChange(o.value)});function d(){setTimeout(()=>{s.value=!1},1)}function f(){r.open&&!r.disableClosingTrigger.value&&r.onClose(),s.value=!0,document.addEventListener(`pointerup`,d,{once:!0})}function p(e){e.pointerType!==`touch`&&!c.value&&!i.isPointerInTransitRef.value&&(r.onTriggerEnter(),c.value=!0)}function m(){r.onTriggerLeave(),c.value=!1}function h(e){s.value||r.ignoreNonKeyboardFocus.value&&!e.target.matches?.(`:focus-visible`)||r.onOpen()}function g(){r.onClose()}function _(){r.disableClosingTrigger.value||r.onClose()}return(t,i)=>(u(),x(M(De),{"as-child":``,reference:t.reference},{default:N(()=>[j(M(H),V({ref:M(a),"aria-describedby":M(r).open.value?M(r).contentId:void 0,"data-state":M(r).stateAttribute.value,as:t.as,"as-child":n.asChild,"data-grace-area-trigger":``},e(l.value)),{default:N(()=>[w(t.$slots,`default`)]),_:3},16,[`aria-describedby`,`data-state`,`as`,`as-child`])]),_:3},8,[`reference`]))}}),To={op50:``},Eo=t({__name:`Collapsable`,props:b({default:{type:Boolean},label:{}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=e,n=F(e,`modelValue`);I(()=>{t.default!=null&&(n.value=!!t.default)});function i(e){return n.value=e,e}return(e,a)=>(u(),L(`div`,null,[w(e.$slots,`trigger`,f(d({visible:n.value,setVisible:i})),()=>[z(`button`,{sticky:``,"top-0":``,"z-10":``,flex:``,"items-center":``,"justify-between":``,px2:``,py1:``,"text-sm":``,"backdrop-blur-xl":``,onClick:a[0]||=e=>n.value=!n.value},[z(`span`,null,v(t.label??`Collapsable`),1),a[1]||=h(),z(`span`,To,v(n.value?`▲`:`▼`),1)])]),j(M(za),null,{default:N(()=>[n.value?w(e.$slots,`default`,f(V({key:0},{visible:n.value,setVisible:i}))):r(``,!0)]),_:3})]))}}),Do=[`onClick`],Oo={flex:``,"items-center":``,"gap-1.5":``,text:`xs 2xl:sm`},ko=t({__name:`Container`,props:{title:{},icon:{},innerClass:{},expand:{type:Boolean,default:!0}},setup(e){return(t,n)=>(u(),x(Eo,{default:e.expand},{trigger:N(n=>[z(`button`,{class:`w-full flex items-center justify-between rounded-lg px-2 py-1 outline-none transition-all duration-250 ease-in-out`,text:`neutral-600 dark:neutral-400 sm sm:base`,bg:`neutral-100 dark:neutral-800`,hover:`bg-neutral-200 dark:bg-neutral-700`,onClick:e=>n.setVisible(!n.visible)},[w(t.$slots,`title`,{},()=>[z(`div`,Oo,[e.icon?(u(),L(`div`,{key:0,class:A(e.icon),"size-4":``},null,2)):r(``,!0),h(` `+v(e.title),1)])]),z(`div`,{"i-solar:alt-arrow-down-linear":``,transition:`transform duration-250`,class:A({"rotate-180":n.visible})},null,2)],8,Do)]),default:N(()=>[z(`div`,{gap:`1`,grid:``,"items-center":``,"p-1":``,class:A(e.innerClass)},[w(t.$slots,`default`)],2)]),_:3},8,[`default`]))}}),Ao={"grid-col-span-1":``,"font-mono":``,text:`[10px] right`},jo={class:`z-20 mt-2 space-y-2`,bg:`white/90 dark:neutral-900/90`,"rounded-xl":``,"p-1":``},Mo={class:`relative h-48 w-full select-none overflow-hidden rounded-lg`},No={class:`relative h-6 w-full select-none overflow-hidden rounded-lg`},Po={key:0,class:`relative h-6 w-full select-none overflow-hidden rounded-lg`},Fo={class:`flex justify-center gap-2`},Io={class:`flex gap-2`},Lo={key:0,class:`flex gap-2`},Ro=[`value`],zo=[`value`],Bo=[`value`],Vo=[`value`],Ho=[`value`],Uo=[`value`],Wo=[`value`],Go=[`value`],Ko=[`value`],qo=[`value`],Jo=Re(t({__name:`ColorPicker`,props:b({alpha:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1}},{modelValue:{required:!1,default:`#000000`},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=e,n=F(e,`modelValue`),i=B(),a=B(),o=B(),s=B(),c=B(!1),l=B(!1),d=B(null),f=B(`hex`),p=B(0),h=B(100),g=B(50),_=B(1);function y(e){let t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?{r:Number.parseInt(t[1],16)/255,g:Number.parseInt(t[2],16)/255,b:Number.parseInt(t[3],16)/255}:null}function b(e){if(!e)return{h:0,s:0,v:0,a:1};let t=document.createElement(`div`);t.style.color=e,document.body.appendChild(t);let n=getComputedStyle(t).color;document.body.removeChild(t);let r=n.match(/rgba?\(([^)]+)\)/);if(r){let e=r[1].split(`,`).map(e=>Number.parseFloat(e.trim())),t=We({r:e[0]/255,g:e[1]/255,b:e[2]/255});return{h:t.h||0,s:(t.s||0)*100,v:(t.v||0)*100,a:e[3]===void 0?1:e[3]}}let i=y(e);if(i){let e=We(i);return{h:e.h||0,s:(e.s||0)*100,v:(e.v||0)*100,a:1}}return{h:0,s:0,v:0,a:1}}let S=E(()=>({h:p.value,s:h.value/100,v:g.value/100})),w=E(()=>{let e=Ke(S.value);return{r:Math.round(e.r*255),g:Math.round(e.g*255),b:Math.round(e.b*255)}}),D=E(()=>{let{r:e,g:t,b:n}=w.value;return`#${((1<<24)+(e<<16)+(t<<8)+n).toString(16).slice(1)}`}),O=E(()=>({left:`${h.value/100*100}%`,top:`${100-g.value/100*100}%`})),te=E(()=>({left:`${p.value/360*100}%`})),k=E(()=>({left:`${_.value*100}%`})),P=E(()=>({background:`linear-gradient(to right, white, hsl(${p.value}, 100%, 50%))`})),ne=E(()=>{let{r:e,g:t,b:n}=w.value;return{background:`linear-gradient(to right, transparent, rgb(${e}, ${t}, ${n}))`}});function re(e,t){if(!i.value)return;let n=i.value.getBoundingClientRect(),r=Math.max(0,Math.min(100,e/n.width*100)),a=Math.max(0,Math.min(100,(n.height-t)/n.height*100));h.value=r,g.value=a}function I(e){if(!a.value)return;let t=a.value.getBoundingClientRect();p.value=Math.max(0,Math.min(360,e/t.width*360))}function ie(e){if(!o.value)return;let t=o.value.getBoundingClientRect();_.value=Math.max(0,Math.min(1,e/t.width))}function ae(e){if(t.disabled)return;l.value=!0,d.value=`map`;let n=`touches`in e?e.touches[0].clientX:e.clientX,r=`touches`in e?e.touches[0].clientY:e.clientY,a=i.value.getBoundingClientRect();re(n-a.left,r-a.top),e.preventDefault()}function oe(e){t.disabled||(l.value=!0,d.value=`hue`,I((`touches`in e?e.touches[0].clientX:e.clientX)-a.value.getBoundingClientRect().left),e.preventDefault())}function ce(e){t.disabled||(l.value=!0,d.value=`alpha`,ie((`touches`in e?e.touches[0].clientX:e.clientX)-o.value.getBoundingClientRect().left),e.preventDefault())}function R(e){if(!l.value)return;e.preventDefault();let t=`touches`in e?e.touches[0].clientX:e.clientX,n=`touches`in e?e.touches[0].clientY:e.clientY;switch(d.value){case`map`:{let e=i.value.getBoundingClientRect();re(t-e.left,n-e.top);break}case`hue`:I(t-a.value.getBoundingClientRect().left);break;case`alpha`:ie(t-o.value.getBoundingClientRect().left);break}}function le(){l.value&&(l.value=!1,d.value=null,document.body.style.cursor=``)}T(n,e=>{if(e&&!l.value){let t=b(e);p.value=t.h,h.value=t.s,g.value=t.v,_.value=t.a}},{immediate:!0}),T(l,e=>{e?document.body.style.cursor=`none`:document.body.style.cursor=``}),C(()=>{Ue(`mousemove`,R,{passive:!1}),Ue(`mouseup`,le),Ue(`touchmove`,R,{passive:!1}),Ue(`touchend`,le),Ue(`click`,e=>{c.value&&s.value&&!s.value.contains(e.target)&&(c.value=!1)})});function V(e){let t=b(e);p.value=t.h,h.value=t.s,g.value=t.v,_.value=t.a,n.value=e}function H(e,t){let n={...w.value};n[e]=Math.max(0,Math.min(255,t));let r=We({r:n.r/255,g:n.g/255,b:n.b/255});p.value=r.h||0,h.value=(r.s||0)*100,g.value=(r.v||0)*100}function U(e,t){switch(e){case`h`:p.value=Math.max(0,Math.min(360,t));break;case`s`:h.value=Math.max(0,Math.min(100,t));break;case`v`:g.value=Math.max(0,Math.min(100,t));break}}function ue(e){_.value=Math.max(0,Math.min(1,e/100))}return T([p,h,g,_],()=>{n.value=Ge(Ke({h:p.value,s:h.value/100,v:g.value/100,alpha:_.value}))},{immediate:!0}),(t,s)=>(u(),x(M(io),null,{default:N(()=>[j(M(uo),{class:`grid grid-col-span-3 grid-cols-3 h-fit items-center`},{default:N(()=>[z(`div`,{style:m({backgroundColor:n.value}),"grid-col-span-2":``,"min-h-5":``,"rounded-md":``},null,4),z(`div`,Ao,v(n.value),1)]),_:1}),j(M(lo),null,{default:N(()=>[j(M(co),{align:`start`,class:`relative z-20`},{default:N(()=>[z(`div`,jo,[z(`div`,Mo,[z(`div`,{ref_key:`colorMapRef`,ref:i,class:`relative h-full w-full cursor-crosshair`,style:m([P.value,{cursor:l.value&&d.value===`map`?`none`:`crosshair`}]),onMousedown:ae,onTouchstart:ae},[s[11]||=z(`div`,{class:`absolute inset-0`,style:{background:`linear-gradient(to bottom, transparent, black)`}},null,-1),z(`div`,{class:`pointer-events-none absolute h-4 w-4 border-2 border-white rounded-full shadow-lg transition-transform`,style:m([O.value,{transform:`translate(-50%, -50%) ${l.value&&d.value===`map`?`scale(1.2)`:`scale(1)`}`,backgroundColor:n.value}])},null,4)],36)]),z(`div`,No,[z(`div`,{ref_key:`hueSliderRef`,ref:a,class:`hue-slider h-full w-full cursor-pointer`,style:m([{background:`linear-gradient(to right, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000)`},{cursor:l.value&&d.value===`hue`?`none`:`pointer`}]),onMousedown:oe,onTouchstart:oe},[z(`div`,{class:`pointer-events-none absolute top-0 h-14 w-1 cursor-pointer cursor-col-resize appearance-none bg-white shadow-lg transition-colors,transform,width,height duration-200 hover:h-13 hover:w-2 hover:bg-neutral-800`,style:m([te.value,{transform:`translateX(-50%) ${l.value&&d.value===`hue`?`scaleY(1.2)`:`scaleY(1)`}`}])},null,4)],36)]),e.alpha?(u(),L(`div`,Po,[s[12]||=z(`div`,{class:`alpha-slider absolute inset-0 opacity-50`,style:{"background-image":`linear-gradient(45deg, #ccc 25%, transparent 25%), linear-gradient(-45deg, #ccc 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #ccc 75%), linear-gradient(-45deg, transparent 75%, #ccc 75%)`,"background-size":`8px 8px`,"background-position":`0 0, 0 4px, 4px -4px, -4px 0px`}},null,-1),z(`div`,{ref_key:`alphaSliderRef`,ref:o,class:`relative h-full w-full cursor-pointer`,style:m([ne.value,{cursor:l.value&&d.value===`alpha`?`none`:`pointer`}]),onMousedown:ce,onTouchstart:ce},[z(`div`,{class:`pointer-events-none absolute top-0 h-14 w-1 cursor-pointer cursor-col-resize appearance-none bg-white shadow-lg transition-colors,transform,width,height duration-200 hover:h-13 hover:w-2 hover:bg-neutral-800`,style:m([k.value,{transform:`translateX(-50%) ${l.value&&d.value===`alpha`?`scaleY(1.2)`:`scaleY(1)`}`}])},null,4)],36)])):r(``,!0),z(`div`,Fo,[z(`div`,Io,[se(z(`select`,{"onUpdate:modelValue":s[0]||=e=>f.value=e,class:`flex-shrink-0 border rounded-lg px-2 py-1 text-sm`},[...s[13]||=[z(`option`,{value:`hex`},` HEX `,-1),z(`option`,{value:`rgb`},` RGB `,-1),z(`option`,{value:`hsv`},` HSV `,-1)]],512),[[ee,f.value]])]),f.value===`hex`?(u(),L(`div`,Lo,[z(`input`,{value:D.value,class:`flex-1 border rounded-lg px-2 py-1 text-sm font-mono`,placeholder:`#000000`,onInput:s[1]||=e=>V((e?.target).value)},null,40,Ro),e.alpha?(u(),L(`input`,{key:0,type:`number`,value:Math.round(_.value*100),min:`0`,max:`100`,class:`w-16 border border-neutral-200 rounded-lg px-2 py-1 text-sm dark:border-neutral-700`,placeholder:`A%`,onInput:s[2]||=e=>ue(Number((e?.target).value))},null,40,zo)):r(``,!0)])):f.value===`rgb`?(u(),L(`div`,{key:1,class:A([`grid gap-2`,e.alpha?`grid-cols-4`:`grid-cols-3`])},[z(`input`,{type:`number`,value:w.value.r,min:`0`,max:`255`,class:`border border-neutral-200 rounded-lg px-2 py-1 text-sm dark:border-neutral-700`,placeholder:`R`,onInput:s[3]||=e=>H(`r`,Number((e?.target).value))},null,40,Bo),z(`input`,{type:`number`,value:w.value.g,min:`0`,max:`255`,class:`border border-neutral-200 rounded-lg px-2 py-1 text-sm dark:border-neutral-700`,placeholder:`G`,onInput:s[4]||=e=>H(`g`,Number((e?.target).value))},null,40,Vo),z(`input`,{type:`number`,value:w.value.b,min:`0`,max:`255`,class:`border border-neutral-200 rounded-lg px-2 py-1 text-sm dark:border-neutral-700`,placeholder:`B`,onInput:s[5]||=e=>H(`b`,Number((e?.target).value))},null,40,Ho),e.alpha?(u(),L(`input`,{key:0,type:`number`,value:Math.round(_.value*100),min:`0`,max:`100`,class:`border border-neutral-200 rounded-lg px-2 py-1 text-sm dark:border-neutral-700`,placeholder:`A%`,onInput:s[6]||=e=>ue(Number((e?.target).value))},null,40,Uo)):r(``,!0)],2)):f.value===`hsv`?(u(),L(`div`,{key:2,class:A([`grid gap-2`,e.alpha?`grid-cols-4`:`grid-cols-3`])},[z(`input`,{type:`number`,value:Math.round(p.value),min:`0`,max:`360`,class:`border border-neutral-200 rounded-lg px-2 py-1 text-sm dark:border-neutral-700`,placeholder:`H°`,onInput:s[7]||=e=>U(`h`,Number((e?.target).value))},null,40,Wo),z(`input`,{type:`number`,value:Math.round(h.value),min:`0`,max:`100`,class:`border border-neutral-200 rounded-lg px-2 py-1 text-sm dark:border-neutral-700`,placeholder:`S%`,onInput:s[8]||=e=>U(`s`,Number((e?.target).value))},null,40,Go),z(`input`,{type:`number`,value:Math.round(g.value),min:`0`,max:`100`,class:`border border-neutral-200 rounded-lg px-2 py-1 text-sm dark:border-neutral-700`,placeholder:`V%`,onInput:s[9]||=e=>U(`v`,Number((e?.target).value))},null,40,Ko),e.alpha?(u(),L(`input`,{key:0,type:`number`,value:Math.round(_.value*100),min:`0`,max:`100`,class:`border border-neutral-200 rounded-lg px-2 py-1 text-sm dark:border-neutral-700`,placeholder:`A%`,onInput:s[10]||=e=>ue(Number((e?.target).value))},null,40,qo)):r(``,!0)],2)):r(``,!0)])])]),_:1})]),_:1})]),_:1}))}}),[[`__scopeId`,`data-v-41bd3b42`]]),Yo={"text-nowrap":``,"text-xs":``},Xo=t({__name:`PropertyColor`,props:b({label:{default:`Color Picker`}},{modelValue:{required:!1},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=e,n=F(e,`modelValue`);return(e,r)=>(u(),L(P,null,[z(`div`,null,[w(e.$slots,`label`,{},()=>[z(`span`,Yo,v(t.label),1)])]),r[1]||=z(`div`,null,null,-1),j(Jo,{modelValue:n.value,"onUpdate:modelValue":r[0]||=e=>n.value=e},null,8,[`modelValue`])],64))}}),Zo={"text-nowrap":``,"text-xs":``},Qo={h:`5`,"grid-col-span-2":``,"w-full":``},$o=[`value`,`min`,`max`,`step`,`disabled`],es={bg:`neutral-100 dark:neutral-900`,"h-fit":``,"min-w-12":``,"inline-flex":``,"items-center":``,"rounded-md":``,px:`1.5`,py:`0.5`},ts={"h-fit":``,"w-full":``,"inline-flex":``,"items-center":``,"gap-2":``,"text-xs":``},ns=[`value`,`min`,`max`,`step`,`disabled`],rs=Re(t({__name:`PropertyNumber`,props:b({label:{default:`Range`},config:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=e,n=F(e,`modelValue`),r=B(!1),i=B(0),a=B(0),o=B();function s(e,t){return t?.formatValue?t.formatValue(e):t?.precision===void 0?e.toString():e.toFixed(t.precision)}let c=B(s(n.value,t.config));T(n,()=>{c.value=s(n.value,t.config),l()},{immediate:!0});function l(){if(!o.value)return;let e=t.config?.min??0,r=t.config?.max??100,i=n.value;o.value.style.setProperty(`--value`,i.toString()),o.value.style.setProperty(`--min`,e.toString()),o.value.style.setProperty(`--max`,r.toString())}C(()=>{l()});function d(e){let t=e.target,n=Number.parseFloat(t.value);Number.isNaN(n)||p(n)}function f(e){let t=e.target,n=Number.parseFloat(t.value);Number.isNaN(n)||p(n)}function p(e){let r=t.config,i=r?.min??0,a=r?.max??100;e=Math.max(i,Math.min(a,e)),n.value=e,c.value=s(e,r)}function m(e){t.config?.disabled||(e.preventDefault(),r.value=!0,i.value=e.clientX,a.value=n.value,document.addEventListener(`mousemove`,h),document.addEventListener(`mouseup`,g),document.body.style.cursor=`ew-resize`)}function h(e){if(!r.value)return;let n=e.clientX-i.value,o=t.config?.step||.01;p(a.value+n*o)}function g(){r.value=!1,document.removeEventListener(`mousemove`,h),document.removeEventListener(`mouseup`,g),document.body.style.cursor=``}return(e,i)=>(u(),L(P,null,[z(`div`,null,[w(e.$slots,`label`,{},()=>[z(`span`,Zo,v(t.label),1)],!0)]),i[0]||=z(`div`,null,null,-1),z(`div`,Qo,[z(`input`,{ref_key:`sliderRef`,ref:o,value:n.value,type:`range`,min:t.config?.min??0,max:t.config?.max??100,step:t.config?.step??1,disabled:t.config?.disabled,class:`range-slider`,"h-full":``,"w-full":``,"appearance-none":``,"bg-transparent":``,"outline-none":``,onInput:d},null,40,$o)]),z(`label`,es,[z(`span`,ts,[z(`span`,{"cursor-col-resize":``,"select-none":``,class:A({"text-blue-500":r.value}),onMousedown:m},`|`,34),z(`input`,{value:c.value,type:`number`,min:t.config?.min,max:t.config?.max,step:t.config?.step||1e-4,disabled:t.config?.disabled,"max-w-4lh":``,"w-full":``,"flex-1":``,"appearance-none":``,"bg-transparent":``,"text-right":``,"font-mono":``,"outline-none":``,transition:`all duration-200 ease-in-out`,class:`[&::-webkit-inner-spin-button]:m-0 [&::-webkit-inner-spin-button]:appearance-none`,onChange:f},null,40,ns)])])],64))}}),[[`__scopeId`,`data-v-6ceb09ea`]]),is={"text-nowrap":``,"text-xs":``},as={"h-fit":``,"inline-flex":``,"items-center":``,text:`[12px]`,"gap-1":``},os=[`value`,`min`,`max`],ss={"h-fit":``,"inline-flex":``,"items-center":``,text:`[12px]`,"gap-1":``},cs=[`value`,`min`,`max`],ls={"h-fit":``,"inline-flex":``,"items-center":``,text:`[12px]`,"gap-1":``},us=[`value`,`min`,`max`],ds=t({__name:`PropertyPoint`,props:b({label:{},xConfig:{},yConfig:{},zConfig:{}},{x:{required:!1,default:0},xModifiers:{},y:{required:!1,default:0},yModifiers:{},z:{required:!1,default:0},zModifiers:{}}),emits:[`update:x`,`update:y`,`update:z`],setup(e){let t=e,n=F(e,`x`),r=F(e,`y`),i=F(e,`z`),a=B(),o=B(0),s=B(0);function c(e,t){return t?.formatValue?t.formatValue(e):t?.precision?e.toFixed(t.precision):e.toString()}let l=B(c(n.value,t.xConfig)),d=B(c(r.value,t.yConfig)),f=B(c(i.value,t.zConfig));T(n,()=>l.value=c(n.value,t.xConfig)),T(r,()=>d.value=c(r.value,t.yConfig)),T(i,()=>f.value=c(i.value,t.zConfig));function p(e,t){let n=t.target,r=Number.parseFloat(n.value);Number.isNaN(r)||m(e,r)}function m(e,a){let o=e===`x`?t.xConfig:e===`y`?t.yConfig:t.zConfig;switch(o?.min!==void 0&&(a=Math.max(o.min,a)),o?.max!==void 0&&(a=Math.min(o.max,a)),e){case`x`:n.value=a,l.value=c(a,t.xConfig)||String(a);break;case`y`:r.value=a,d.value=c(a,t.yConfig)||String(a);break;case`z`:i.value=a,f.value=c(a,t.zConfig)||String(a);break}}function h(e,t){t.preventDefault(),a.value=e,o.value=t.clientX,s.value=e===`x`?n.value:e===`y`?r.value:i.value,document.addEventListener(`mousemove`,g),document.addEventListener(`mouseup`,_)}function g(e){if(!a.value)return;let n=e.clientX-o.value,r=(a.value===`x`?t.xConfig:a.value===`y`?t.yConfig:t.zConfig)?.step||.01,i=s.value+n*r;m(a.value,i)}function _(){a.value=void 0,document.removeEventListener(`mousemove`,g),document.removeEventListener(`mouseup`,_)}return(e,n)=>(u(),L(P,null,[z(`div`,null,[w(e.$slots,`label`,{},()=>[z(`span`,is,v(t.label||`Point`),1)])]),n[6]||=z(`div`,null,null,-1),z(`label`,{"h-fit":``,"w-full":``,"inline-flex":``,"items-center":``,"rounded-md":``,px:`1.5`,py:`0.5`,class:A([a.value===`x`?`bg-red-100/50 dark:bg-red-900/50`:`bg-neutral-100 dark:bg-neutral-900`]),transition:`colors duration-200 ease-in-out`},[z(`span`,as,[z(`span`,{"cursor-col-resize":``,"select-none":``,"text-red-500":``,onMousedown:n[0]||=e=>h(`x`,e)},`|`,32),z(`input`,{value:l.value,type:`number`,min:t.xConfig?.min,max:t.xConfig?.max,step:1e-4,"max-w-4lh":``,"w-full":``,"appearance-none":``,"bg-transparent":``,"text-right":``,"font-mono":``,"outline-none":``,class:`[&::-webkit-inner-spin-button]:m-0 [&::-webkit-inner-spin-button]:appearance-none`,onChange:n[1]||=e=>p(`x`,e)},null,40,os)])],2),z(`label`,{"h-fit":``,"inline-flex":``,"items-center":``,"rounded-md":``,px:`1.5`,py:`0.5`,class:A([a.value===`y`?`bg-blue-100/50 dark:bg-blue-900/50`:`bg-neutral-100 dark:bg-neutral-900`]),transition:`colors duration-200 ease-in-out`},[z(`span`,ss,[z(`span`,{"cursor-col-resize":``,"select-none":``,"text-blue-500":``,onMousedown:n[2]||=e=>h(`y`,e)},`|`,32),z(`input`,{value:d.value,type:`number`,min:t.yConfig?.min,max:t.yConfig?.max,step:1e-4,"max-w-4lh":``,"w-full":``,"appearance-none":``,"bg-transparent":``,"text-right":``,"font-mono":``,"outline-none":``,class:`[&::-webkit-inner-spin-button]:m-0 [&::-webkit-inner-spin-button]:appearance-none`,onChange:n[3]||=e=>p(`y`,e)},null,40,cs)])],2),z(`label`,{"h-fit":``,"inline-flex":``,"items-center":``,"rounded-md":``,px:`1.5`,py:`0.5`,class:A([a.value===`z`?`bg-green-100/50 dark:bg-green-900/50`:`bg-neutral-100 dark:bg-neutral-900`]),transition:`colors duration-200 ease-in-out`},[z(`span`,ls,[z(`span`,{"cursor-col-resize":``,"select-none":``,"text-green-500":``,onMousedown:n[4]||=e=>h(`z`,e)},`|`,32),z(`input`,{value:f.value,type:`number`,min:t.zConfig?.min,max:t.zConfig?.max,step:1e-4,"max-w-4lh":``,"w-full":``,"appearance-none":``,"bg-transparent":``,"text-right":``,"font-mono":``,"outline-none":``,class:`[&::-webkit-inner-spin-button]:m-0 [&::-webkit-inner-spin-button]:appearance-none`,onChange:n[5]||=e=>p(`z`,e)},null,40,us)])],2)],64))}}),fs=t({__name:`Callout`,props:{theme:{default:`primary`},label:{}},setup(e){let t=e,n={primary:{container:[`text-neutral-900/80 dark:text-neutral-100/80`,`bg-primary-50/80 dark:bg-primary-900/50 backdrop-blur-md`,`before:bg-primary-500/30 before:content-[''] before:dark:bg-primary-200/20`],label:[`text-primary-500 dark:text-primary-200 font-semibold`]},lime:{container:[`text-neutral-900/80 dark:text-neutral-100/80`,`bg-lime-50/80 dark:bg-lime-900/50 backdrop-blur-md`,`before:bg-lime-500/30 before:content-[''] before:dark:bg-lime-200/20`],label:[`text-lime-500 dark:text-lime-200 font-semibold`]},violet:{container:[`text-neutral-900/80 dark:text-neutral-100/80`,`bg-violet-50/80 dark:bg-violet-900/50 backdrop-blur-md`,`before:bg-violet-500/30 before:content-[''] before:dark:bg-violet-200/20`],label:[`text-violet-500 dark:text-violet-200 font-semibold`]},orange:{container:[`text-neutral-900/80 dark:text-neutral-100/80`,`bg-orange-100/60 dark:bg-orange-900/50 backdrop-blur-md`,`before:bg-orange-500/30 before:content-[''] before:dark:bg-orange-200/20`],label:[`text-orange-500 dark:text-orange-200 font-semibold`]}};return(e,r)=>(u(),L(`div`,{relative:``,flex:``,"flex-col":``,"gap-1":``,"rounded-lg":``,py:`2.5`,pl:`5`,"pr-3":``,class:A([...n[t.theme||`violet`].container,`before-position-absolute before:left-2 before:right-0 before:h-[calc(100%-1rem)] before:top-50% before:translate-y--50% before:w-1 before:rounded-full`])},[z(`div`,{text:`font-semibold`,class:A([...n[t.theme||`violet`].label||[]])},[w(e.$slots,`label`,{},()=>[h(v(t.label||`Callout`),1)])],2),w(e.$slots,`default`)],2))}}),ps={relative:``},ms={key:0,absolute:``,"left-0":``,"top-0":``,"translate-y":`[-80%]`},hs={text:`neutral-300 dark:neutral-500`,"text-nowrap":``},gs={"text-nowrap":``,"text-3xl":``,"font-normal":``},_s=t({__name:`PageHeader`,props:{title:{},subtitle:{},showBackButton:{type:Boolean,default:!0},disableBackButton:{type:Boolean,default:!1}},setup(e){let t=e,i=je(),a=Ae(),o=B(),c=B(t.title),l=B(t.subtitle),d=B(t.disableBackButton),{apply:f}=Ca(o,{initial:{opacity:0,x:10,transition:{duration:50}},enter:{opacity:1,x:0,transition:{duration:250}},leave:{opacity:0,x:-5,transition:{duration:25}}});return C(async()=>{await f(`initial`),await f(`enter`)}),s(async()=>{await f(`leave`),d.value=!0}),T([()=>t.title,()=>t.subtitle,a],async()=>{await f(`leave`),await n(),d.value=t.disableBackButton,c.value=t.title,l.value=t.subtitle,await n(),await f(`initial`),await f(`enter`)}),(t,n)=>(u(),L(`div`,{ref_key:`pageHeaderRef`,ref:o,style:{top:`env(safe-area-inset-top, 0px)`,right:`env(safe-area-inset-right, 0px)`,left:`env(safe-area-inset-left, 0px)`},sticky:``,"inset-x-0":``,"top-0":``,"z-99":``,"w-full":``,"pb-6":``,"pt-10":``,flex:`~ row items-center gap-2`,bg:`$bg-color`},[z(`button`,{onClick:n[0]||=e=>M(i).back()},[d.value?r(``,!0):(u(),L(`div`,{key:0,"i-solar:alt-arrow-left-line-duotone":``,"text-2xl":``,class:A({"pointer-events-none op-0":!e.showBackButton})},null,2))]),z(`h1`,ps,[l.value?(u(),L(`div`,ms,[z(`span`,hs,v(l.value),1)])):r(``,!0),z(`div`,gs,v(c.value),1)])],512))}}),vs=[`onClick`],ys=t({__name:`Section`,props:{title:{},icon:{},innerClass:{},expand:{type:Boolean,default:!0},size:{}},setup(e){return(t,n)=>(u(),x(Eo,{default:e.expand},{trigger:N(t=>[z(`button`,{class:`w-full flex items-center justify-between rounded-lg px-3 py-2 outline-none transition-all duration-250 ease-in-out sm:px-4 sm:py-3`,text:`neutral-600 dark:neutral-400 sm sm:base`,bg:`neutral-100 dark:neutral-800`,hover:`bg-neutral-200 dark:bg-neutral-700`,onClick:e=>t.setVisible(!t.visible)},[z(`div`,{flex:``,"items-center":``,"gap-1.5":``,class:A([e.size===`sm`?`text-xs 2xl:text-sm`:``])},[z(`div`,{class:A([e.icon,e.size===`sm`?`size-4`:`size-6`])},null,2),h(` `+v(e.title),1)],2),z(`div`,{"i-solar:alt-arrow-down-linear":``,transition:`transform duration-250`,class:A({"rotate-180":t.visible})},null,2)],8,vs)]),default:N(()=>[z(`div`,{grid:``,"gap-2":``,class:A([e.innerClass,e.size===`sm`?`p-2`:`p-4`])},[w(t.$slots,`default`)],2)]),_:3},8,[`default`]))}}),bs={class:`flex select-none items-center gap-1`,role:`tablist`},xs=[`aria-selected`,`disabled`,`onClick`],Ss={class:`whitespace-nowrap`},Cs={class:`mt-2`},ws=t({__name:`Tabs`,props:{modelValue:{},tabs:{},theme:{default:`primary`},size:{default:`sm`},label:{}},emits:[`update:modelValue`,`change`],setup(e,{emit:t}){let n=e,i=t,a={tabActive:[`bg-white shadow-sm font-bold text-primary-600 dark:text-primary-400 text-xs`,`ring-2 ring-primary-500`,`dark:bg-neutral-700`,`ring-1 ring-black/5 dark:ring-white/10`],tabIdle:[`text-neutral-600 hover:bg-white/70`,`dark:text-neutral-300 dark:hover:bg-white/10`,`text-xs`]},o={primary:{container:[`bg-primary-50/60 dark:bg-primary-900/25 backdrop-blur-md`,`text-neutral-700/80 dark:text-neutral-300/80`],label:[`text-primary-500 dark:text-primary-400 font-semibold`],...a},violet:{container:[`bg-violet-50/60 dark:bg-violet-900/25 backdrop-blur-md`,`text-neutral-700/80 dark:text-neutral-300/80`],label:[`text-violet-500 dark:text-violet-400 font-semibold`],...a},lime:{container:[`bg-lime-50/60 dark:bg-lime-900/25 backdrop-blur-md`,`text-neutral-700/80 dark:text-neutral-300/80`],label:[`text-lime-500 dark:text-lime-400 font-semibold`],...a},orange:{container:[`bg-orange-50/70 dark:bg-orange-900/25 backdrop-blur-md`,`text-neutral-700/80 dark:text-neutral-300/80`],label:[`text-orange-500 dark:text-orange-400 font-semibold`],...a}},s=E(()=>({xs:`px-2 py-1 text-xs`,sm:`px-3 py-1.5 text-sm`,md:`px-4 py-2 text-sm`})[n.size]);function c(e,t){t||e!==n.modelValue&&(i(`update:modelValue`,e),i(`change`,e))}return(t,n)=>(u(),L(`div`,{class:A([`relative overflow-hidden rounded-lg p-2`,o[e.theme].container])},[e.label?(u(),L(`div`,{key:0,class:A([`mb-1 text-sm`,o[e.theme].label])},v(e.label),3)):r(``,!0),z(`div`,bs,[(u(!0),L(P,null,l(e.tabs,t=>(u(),L(`button`,{key:t.value,type:`button`,role:`tab`,"aria-selected":e.modelValue===t.value,disabled:t.disabled,class:A([`inline-flex items-center gap-1 rounded-md transition-all`,s.value,t.disabled?`opacity-40 cursor-not-allowed`:``,e.modelValue===t.value?o[e.theme].tabActive:o[e.theme].tabIdle,`focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-primary-200 focus-visible:outline-offset-2`]),onClick:e=>c(t.value,t.disabled)},[t.icon?(u(),L(`span`,{key:0,class:A([typeof t.icon==`string`?t.icon:t.value===e.modelValue?t.icon.active:t.icon.idle,`text-base`])},null,2)):r(``,!0),z(`span`,Ss,v(t.label),1)],10,xs))),128))]),z(`div`,Cs,[w(t.$slots,`default`,{active:e.modelValue})])],2))}}),Ts=t({__name:`Screen`,setup(e){let t=B(),n=Be(He),{width:r,height:i}=ze(),a=Ve(t,{immediate:!0,windowResize:!0,reset:!0}),o=E(()=>n.between(`sm`,`md`).value||n.smaller(`sm`).value),s=E(()=>n.between(`md`,`lg`).value),c=E(()=>n.greaterOrEqual(`lg`).value),l=E(()=>c.value?a.width.value:o.value||s.value?r.value-16:a.width.value),d=B(0);return T([r,i,t],()=>{let e=t.value?.parentElement?.getBoundingClientRect();c.value||o.value||s.value?d.value=e?.height||0:d.value=600}),T([a.width,a.height],()=>{c.value||o.value||s.value?d.value=a.height.value:d.value=600}),C(async()=>{t.value&&a.update()}),(e,n)=>(u(),L(`div`,{ref_key:`containerRef`,ref:t,"h-full":``,"w-full":``},[w(e.$slots,`default`,{width:l.value,height:d.value})],512))}});(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.nonce=document.head.querySelector(`meta[property=csp-nonce]`)?.content,e.appendChild(document.createTextNode(`[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32,.72,0,1);animation-duration:.5s;animation-timing-function:cubic-bezier(.32,.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform, 100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform, 100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform, 100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform, 100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top],[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height, 0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left],[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height, 0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(.32,.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32,.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true]):after{content:"";position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]:after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]:after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]:after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]:after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not([data-state=closed]){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:hover,[data-vaul-handle]:active{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover: hover) and (pointer: fine){[data-vaul-drawer]{-webkit-user-select:none;user-select:none}}@media (pointer: fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{0%{transform:translate3d(0,var(--initial-transform, 100%),0)}to{transform:translateZ(0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform, 100%),0)}}@keyframes slideFromTop{0%{transform:translate3d(0,calc(var(--initial-transform, 100%) * -1),0)}to{transform:translateZ(0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform, 100%) * -1),0)}}@keyframes slideFromLeft{0%{transform:translate3d(calc(var(--initial-transform, 100%) * -1),0,0)}to{transform:translateZ(0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform, 100%) * -1),0,0)}}@keyframes slideFromRight{0%{transform:translate3d(var(--initial-transform, 100%),0,0)}to{transform:translateZ(0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform, 100%),0,0)}}`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();var Es=typeof window<`u`&&typeof document<`u`;typeof WorkerGlobalScope<`u`&&globalThis instanceof WorkerGlobalScope;var Ds=e=>typeof e<`u`;function Os(e){return JSON.parse(JSON.stringify(e))}function ks(e,t,r,i={}){let{clone:a=!1,passive:o=!1,eventName:s,deep:c=!1,defaultValue:l,shouldEmit:u}=i,d=k(),f=r||d?.emit||(d?.$emit)?.bind(d)||(d?.proxy?.$emit)?.bind(d?.proxy),p=s;t||=`modelValue`,p||=`update:${t.toString()}`;let m=e=>a?typeof a==`function`?a(e):Os(e):e,h=()=>Ds(e[t])?m(e[t]):l,g=e=>{u?u(e)&&f(p,e):f(p,e)};if(o){let r=B(h()),i=!1;return T(()=>e[t],e=>{i||(i=!0,r.value=m(e),n(()=>i=!1))}),T(r,n=>{!i&&(n!==e[t]||c)&&g(n)},{deep:c}),r}else return E({get(){return h()},set(e){g(e)}})}var[As,js]=Ce(`DrawerRoot`),Ms=new WeakMap;function Z(e,t,n=!1){if(!e||!(e instanceof HTMLElement)||!t)return;let r={};Object.entries(t).forEach(([t,n])=>{if(t.startsWith(`--`)){e.style.setProperty(t,n);return}r[t]=e.style[t],e.style[t]=n}),!n&&Ms.set(e,r)}function Ns(e,t){if(!e||!(e instanceof HTMLElement))return;let n=Ms.get(e);n&&Object.entries(n).forEach(([t,n])=>{e.style[t]=n})}function Ps(e,t){let n=window.getComputedStyle(e),r=n.transform||n.webkitTransform||n.mozTransform,i=r.match(/^matrix3d\((.+)\)$/);return i?Number.parseFloat(i[1].split(`, `)[Q(t)?13:12]):(i=r.match(/^matrix\((.+)\)$/),i?Number.parseFloat(i[1].split(`, `)[Q(t)?5:4]):null)}function Fs(e){return 8*(Math.log(e+1)-2)}function Q(e){switch(e){case`top`:case`bottom`:return!0;case`left`:case`right`:return!1;default:return e}}function Is(e,t){if(!e)return()=>{};let n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}var $={DURATION:.5,EASE:[.32,.72,0,1]},Ls=.4,Rs=.25,zs=100,Bs=8,Vs=16,Hs=26,Us=`vaul-dragging`;function Ws({activeSnapPoint:e,snapPoints:t,drawerRef:r,overlayRef:i,fadeFromIndex:a,onSnapPointChange:o,direction:s}){let l=B(typeof window<`u`?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);function u(){l.value={innerWidth:window.innerWidth,innerHeight:window.innerHeight}}C(()=>{typeof window<`u`&&window.addEventListener(`resize`,u)}),c(()=>{typeof window<`u`&&window.removeEventListener(`resize`,u)});let d=E(()=>(t.value&&e.value===t.value[t.value.length-1])??null),f=E(()=>t.value&&t.value.length>0&&(a?.value||a?.value===0)&&!Number.isNaN(a?.value)&&t.value[a?.value??-1]===e.value||!t.value),p=E(()=>t.value?.findIndex(t=>t===e.value)??null),m=E(()=>t.value?.map(e=>{let t=typeof e==`string`,n=0;if(t&&(n=Number.parseInt(e,10)),Q(s.value)){let r=t?n:l.value?e*l.value.innerHeight:0;return l.value?s.value===`bottom`?l.value.innerHeight-r:-l.value.innerHeight+r:r}let r=t?n:l.value?e*l.value.innerWidth:0;return l.value?s.value===`right`?l.value.innerWidth-r:-l.value.innerWidth+r:r})??[]),h=E(()=>p.value===null?null:m.value?.[p.value]),g=c=>{let l=m.value?.findIndex(e=>e===c)??null;n(()=>{o(l,m.value),Z(r.value?.$el,{transition:`transform ${$.DURATION}s cubic-bezier(${$.EASE.join(`,`)})`,transform:Q(s.value)?`translate3d(0, ${c}px, 0)`:`translate3d(${c}px, 0, 0)`})}),m.value&&l!==m.value.length-1&&l!==a?.value?Z(i.value?.$el,{transition:`opacity ${$.DURATION}s cubic-bezier(${$.EASE.join(`,`)})`,opacity:`0`}):Z(i.value?.$el,{transition:`opacity ${$.DURATION}s cubic-bezier(${$.EASE.join(`,`)})`,opacity:`1`}),e.value=l===null?null:t.value?.[l]??null};T([e,m,t],()=>{if(e.value){let n=t.value?.findIndex(t=>t===e.value)??-1;m.value&&n!==-1&&typeof m.value[n]==`number`&&g(m.value[n])}},{immediate:!0});function _({draggedDistance:e,closeDrawer:n,velocity:r,dismissible:o}){if(a.value===void 0)return;let c=s.value===`bottom`||s.value===`right`?(h.value??0)-e:(h.value??0)+e,l=p.value===a.value-1,u=p.value===0,f=e>0;if(l&&Z(i.value?.$el,{transition:`opacity ${$.DURATION}s cubic-bezier(${$.EASE.join(`,`)})`}),r>2&&!f){o?n():g(m.value[0]);return}if(r>2&&f&&m&&t.value){g(m.value[t.value.length-1]);return}let _=m.value?.reduce((e,t)=>typeof e!=`number`||typeof t!=`number`?e:Math.abs(t-c)Ls&&Math.abs(e)0&&d){g(m.value[(t.value?.length??0)-1]);return}if(u&&e<0&&o&&n(),p.value===null)return;g(m.value[p.value+e]);return}g(_)}function v({draggedDistance:e}){if(h.value===null)return;let t=s.value===`bottom`||s.value===`right`?h.value-e:h.value+e;(s.value===`bottom`||s.value===`right`)&&tm.value[m.value.length-1]||Z(r.value?.$el,{transform:Q(s.value)?`translate3d(0, ${t}px, 0)`:`translate3d(${t}px, 0, 0)`})}function y(e,n){if(!t.value||typeof p.value!=`number`||!m.value||a.value===void 0)return null;let r=p.value===a.value-1;if(p.value>=a.value&&n)return 0;if(r&&!n)return 1;if(!f.value&&!r)return null;let i=r?p.value+1:p.value-1,o=r?m.value[i]-m.value[i-1]:m.value[i+1]-m.value[i],s=e/Math.abs(o);return r?1-s:s}return{isLastSnapPoint:d,shouldFade:f,getPercentageDragged:y,activeSnapPointIndex:p,onRelease:_,onDrag:v,snapPointsOffset:m}}function Gs(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}var Ks=null;function qs(e){let{isOpen:t,modal:n,nested:r,hasBeenOpened:i,preventScrollRestoration:a,noBodyStyles:o}=e,c=B(typeof window<`u`?window.location.href:``),l=B(0);function u(){if(Gs()&&Ks===null&&t.value&&!o.value){Ks={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height};let{scrollX:e,innerHeight:t}=window;document.body.style.setProperty(`position`,`fixed`,`important`),Object.assign(document.body.style,{top:`${-l.value}px`,left:`${-e}px`,right:`0px`,height:`auto`}),setTimeout(()=>{requestAnimationFrame(()=>{let e=t-window.innerHeight;e&&l.value>=t&&(document.body.style.top=`-${l.value+e}px`)})},300)}}function d(){if(Gs()&&Ks!==null&&!o.value){let e=-Number.parseInt(document.body.style.top,10),t=-Number.parseInt(document.body.style.left,10);Object.assign(document.body.style,Ks),window.requestAnimationFrame(()=>{if(a.value&&c.value!==window.location.href){c.value=window.location.href;return}window.scrollTo(t,e)}),Ks=null}}return C(()=>{function e(){l.value=window.scrollY}e(),window.addEventListener(`scroll`,e),s(()=>{window.removeEventListener(`scroll`,e)})}),T([t,i,c],()=>{r.value||!i.value||(t.value?(window.matchMedia(`(display-mode: standalone)`).matches||u(),n.value||setTimeout(()=>{d()},500)):d())}),{restorePositionSetting:d}}function Js(e,t){return e&&e.value?e:t}function Ys(e){let{emitDrag:t,emitRelease:n,emitClose:r,emitOpenChange:i,open:a,dismissible:o,nested:s,modal:c,shouldScaleBackground:l,setBackgroundColorOnScale:u,scrollLockTimeout:d,closeThreshold:f,activeSnapPoint:p,fadeFromIndex:m,direction:h,noBodyStyles:g,handleOnly:_,preventScrollRestoration:v}=e,y=B(a.value??!1),b=B(!1),x=B(!1),S=B(!1),C=B(null),w=B(null),D=B(null),ee=B(null),O=B(null),te=B(!1),k=B(null),A=B(0),j=B(!1);B(0);let M=B(null);B(0);let N=E(()=>M.value?.$el.getBoundingClientRect().height||0),P=Js(e.snapPoints,B(void 0)),ne=E(()=>P&&(P.value?.length??0)>0),re=B(null),{activeSnapPointIndex:F,onRelease:ie,snapPointsOffset:ae,onDrag:oe,shouldFade:se,getPercentageDragged:ce}=Ws({snapPoints:P,activeSnapPoint:p,drawerRef:M,fadeFromIndex:m,overlayRef:C,onSnapPointChange:L,direction:h});function L(e,t){P.value&&e===t.length-1&&(w.value=new Date)}qs({isOpen:y,modal:c,nested:s,hasBeenOpened:b,noBodyStyles:g,preventScrollRestoration:v});function R(){return(window.innerWidth-Hs)/window.innerWidth}function z(e,t){if(!e)return!1;let n=e,r=window.getSelection()?.toString(),i=M.value?Ps(M.value.$el,h.value):null,a=new Date;if(n.hasAttribute(`data-vaul-no-drag`)||n.closest(`[data-vaul-no-drag]`))return!1;if(h.value===`right`||h.value===`left`)return!0;if(w.value&&a.getTime()-w.value.getTime()<500)return!1;if(i!==null&&(h.value===`bottom`?i>0:i<0))return!0;if(r&&r.length>0)return!1;if(O.value&&a.getTime()-O.value.getTime()n.clientHeight){if(n.scrollTop!==0)return O.value=new Date,!1;if(n.getAttribute(`role`)===`dialog`)return!0}n=n.parentNode}return!0}function le(e){!o.value&&!P.value||M.value&&!M.value.$el.contains(e.target)||(x.value=!0,D.value=new Date,e.target.setPointerCapture(e.pointerId),A.value=Q(h.value)?e.clientY:e.clientX)}function V(e){var n;if(M.value&&x.value){let r=h.value===`bottom`||h.value===`right`?1:-1,i=(A.value-(Q(h.value)?e.clientY:e.clientX))*r,a=i>0,s=P.value&&!o.value&&!a;if(s&&F.value===0)return;let c=Math.abs(i),u=document.querySelector(`[data-vaul-drawer-wrapper]`)||document.querySelector(`[vaul-drawer-wrapper]`),d=c/N.value,f=ce(c,a);if(f!==null&&(d=f),s&&d>=1||!te.value&&!z(e.target,a))return;if((n=M?.value)==null||n.$el.classList.add(Us),te.value=!0,Z(M.value?.$el,{transition:`none`}),Z(C.value?.$el,{transition:`none`}),P.value&&oe({draggedDistance:i}),a&&!P.value){let e=Fs(i),t=Math.min(e*-1,0)*r;Z(M.value?.$el,{transform:Q(h.value)?`translate3d(0, ${t}px, 0)`:`translate3d(${t}px, 0, 0)`});return}let p=1-d;if((se.value||m.value&&F.value===m.value-1)&&(t(d),Z(C.value?.$el,{opacity:`${p}`,transition:`none`},!0)),u&&C.value&&l.value){let e=Math.min(R()+d*(1-R()),1),t=8-d*8,n=Math.max(0,14-d*14);Z(u,{borderRadius:`${t}px`,transform:Q(h.value)?`scale(${e}) translate3d(0, ${n}px, 0)`:`scale(${e}) translate3d(${n}px, 0, 0)`,transition:`none`},!0)}if(!P.value){let e=c*r;Z(M.value?.$el,{transform:Q(h.value)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})}}}function H(){if(!M.value)return;let e=document.querySelector(`[data-vaul-drawer-wrapper]`)||document.querySelector(`[vaul-drawer-wrapper]`),t=Ps(M.value.$el,h.value);Z(M.value.$el,{transform:`translate3d(0, 0, 0)`,transition:`transform ${$.DURATION}s cubic-bezier(${$.EASE.join(`,`)})`}),Z(C.value?.$el,{transition:`opacity ${$.DURATION}s cubic-bezier(${$.EASE.join(`,`)})`,opacity:`1`}),l.value&&t&&t>0&&y.value&&Z(e,{borderRadius:`${Bs}px`,overflow:`hidden`,...Q(h.value)?{transform:`scale(${R()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:`top`}:{transform:`scale(${R()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:`left`},transitionProperty:`transform, border-radius`,transitionDuration:`${$.DURATION}s`,transitionTimingFunction:`cubic-bezier(${$.EASE.join(`,`)})`},!0)}function U(e){M.value&&(r(),e||(y.value=!1),window.setTimeout(()=>{P.value&&(p.value=P.value[0])},$.DURATION*1e3))}I(()=>{if(!y.value&&l.value&&Es){let e=setTimeout(()=>{Ns(document.body)},200);return()=>clearTimeout(e)}}),T(a,()=>{y.value=a.value,a.value||U()});function ue(e){if(!x.value||!M.value)return;M.value.$el.classList.remove(Us),te.value=!1,x.value=!1,ee.value=new Date;let t=Ps(M.value.$el,h.value);if(!z(e.target,!1)||!t||Number.isNaN(t)||D.value===null)return;let r=ee.value.getTime()-D.value.getTime(),i=A.value-(Q(h.value)?e.clientY:e.clientX),a=Math.abs(i)/r;if(a>.05&&(S.value=!0,window.setTimeout(()=>{S.value=!1},200)),P.value){ie({draggedDistance:i*(h.value===`bottom`||h.value===`right`?1:-1),closeDrawer:U,velocity:a,dismissible:o.value}),n(!0);return}if(h.value===`bottom`||h.value===`right`?i>0:i<0){H(),n(!0);return}if(a>Ls){U(),n(!1);return}if(t>=Math.min(M.value.$el.getBoundingClientRect().height??0,window.innerHeight)*f.value){U(),n(!1);return}n(!0),H()}T(y,e=>{e&&(w.value=new Date),i(e)},{immediate:!0});function de(e){var t;let n=e?(window.innerWidth-Vs)/window.innerWidth:1,r=e?-16:0;k.value&&window.clearTimeout(k.value),Z(M.value?.$el,{transition:`transform ${$.DURATION}s cubic-bezier(${$.EASE.join(`,`)})`,transform:`scale(${n}) translate3d(0, ${r}px, 0)`}),!e&&(t=M.value)!=null&&t.$el&&(k.value=window.setTimeout(()=>{let e=Ps(M.value?.$el,h.value);Z(M.value?.$el,{transition:`none`,transform:Q(h.value)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})},500))}function fe(e){if(e<0)return;let t=Q(h.value)?window.innerHeight:window.innerWidth,n=(t-Vs)/t,r=n+e*(1-n),i=-16+e*Vs;Z(M.value?.$el,{transform:Q(h.value)?`scale(${r}) translate3d(0, ${i}px, 0)`:`scale(${r}) translate3d(${i}px, 0, 0)`,transition:`none`})}function pe(e){let t=Q(h.value)?window.innerHeight:window.innerWidth,n=e?(t-Vs)/t:1,r=e?-16:0;e&&Z(M.value?.$el,{transition:`transform ${$.DURATION}s cubic-bezier(${$.EASE.join(`,`)})`,transform:Q(h.value)?`scale(${n}) translate3d(0, ${r}px, 0)`:`scale(${n}) translate3d(${r}px, 0, 0)`})}return{open:a,isOpen:y,modal:c,keyboardIsOpen:j,hasBeenOpened:b,drawerRef:M,drawerHeightRef:N,overlayRef:C,handleRef:re,isDragging:x,dragStartTime:D,isAllowedToDrag:te,snapPoints:P,activeSnapPoint:p,hasSnapPoints:ne,pointerStart:A,dismissible:o,snapPointsOffset:ae,direction:h,shouldFade:se,fadeFromIndex:m,shouldScaleBackground:l,setBackgroundColorOnScale:u,onPress:le,onDrag:V,onRelease:ue,closeDrawer:U,onNestedDrag:fe,onNestedRelease:pe,onNestedOpenChange:de,emitClose:r,emitDrag:t,emitRelease:n,emitOpenChange:i,nested:s,handleOnly:_,noBodyStyles:g}}var Xs=t({__name:`DrawerRoot`,props:{activeSnapPoint:{default:void 0},closeThreshold:{default:Rs},shouldScaleBackground:{type:Boolean,default:void 0},setBackgroundColorOnScale:{type:Boolean,default:!0},scrollLockTimeout:{default:zs},fixed:{type:Boolean,default:void 0},dismissible:{type:Boolean,default:!0},modal:{type:Boolean,default:!0},open:{type:Boolean,default:void 0},defaultOpen:{type:Boolean,default:void 0},nested:{type:Boolean,default:!1},direction:{default:`bottom`},noBodyStyles:{type:Boolean},handleOnly:{type:Boolean,default:!1},preventScrollRestoration:{type:Boolean},snapPoints:{default:void 0},fadeFromIndex:{default:void 0}},emits:[`drag`,`release`,`close`,`update:open`,`update:activeSnapPoint`,`animationEnd`],setup(e,{expose:t,emit:n}){let r=e,i=n;oe();let o=E(()=>r.fadeFromIndex??(r.snapPoints&&r.snapPoints.length-1)),s=ks(r,`open`,i,{defaultValue:r.defaultOpen,passive:r.open===void 0}),c=ks(r,`activeSnapPoint`,i,{passive:r.activeSnapPoint===void 0}),l={emitDrag:e=>i(`drag`,e),emitRelease:e=>i(`release`,e),emitClose:()=>i(`close`),emitOpenChange:e=>{i(`update:open`,e),setTimeout(()=>{i(`animationEnd`,e)},$.DURATION*1e3)}},{closeDrawer:d,hasBeenOpened:f,modal:p,isOpen:m}=js(Ys({...l,...a(r),activeSnapPoint:c,fadeFromIndex:o,open:s}));function h(e){if(s.value!==void 0){l.emitOpenChange(e);return}m.value=e,e?f.value=!0:d()}return t({open:m}),(e,t)=>(u(),x(M(Pe),{open:M(m),modal:M(p),"onUpdate:open":h},{default:N(()=>[w(e.$slots,`default`,{open:M(m)})]),_:3},8,[`open`,`modal`]))}});Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;var Zs=t({__name:`DrawerOverlay`,setup(e){let{overlayRef:t,hasSnapPoints:n,isOpen:r,shouldFade:i}=As();return(e,a)=>(u(),x(M(Le),{ref_key:`overlayRef`,ref:t,"data-vaul-overlay":``,"data-vaul-snap-points":M(r)&&M(n)?`true`:`false`,"data-vaul-snap-points-overlay":M(r)&&M(i)?`true`:`false`},null,8,[`data-vaul-snap-points`,`data-vaul-snap-points-overlay`]))}});function Qs(){let{direction:e,isOpen:t,shouldScaleBackground:n,setBackgroundColorOnScale:r,noBodyStyles:i}=As(),a=B(null),o=B(document.body.style.backgroundColor);function s(){return(window.innerWidth-Hs)/window.innerWidth}I(c=>{if(t.value&&n.value){a.value&&clearTimeout(a.value);let t=document.querySelector(`[data-vaul-drawer-wrapper]`)||document.querySelector(`[vaul-drawer-wrapper]`);if(!t)return;r.value&&!i.value&&Is(document.body,{background:`black`}),Is(t,{transformOrigin:Q(e.value)?`top`:`left`,transitionProperty:`transform, border-radius`,transitionDuration:`${$.DURATION}s`,transitionTimingFunction:`cubic-bezier(${$.EASE.join(`,`)})`});let n=Is(t,{borderRadius:`${Bs}px`,overflow:`hidden`,...Q(e.value)?{transform:`scale(${s()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${s()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});c(()=>{n(),a.value=window.setTimeout(()=>{o.value?document.body.style.background=o.value:document.body.style.removeProperty(`background`)},$.DURATION*1e3)})}},{flush:`pre`})}var $s=t({__name:`DrawerContent`,setup(e){let{open:t,isOpen:n,snapPointsOffset:r,hasSnapPoints:i,drawerRef:a,onPress:o,onDrag:s,onRelease:c,modal:l,emitOpenChange:d,dismissible:f,keyboardIsOpen:p,closeDrawer:h,direction:g,handleOnly:_}=As();Qs();let v=B(!1),y=E(()=>r.value&&r.value.length>0?`${r.value[0]}px`:`0`);function b(e){if(!l.value||e.defaultPrevented){e.preventDefault();return}p.value&&=!1,f.value?d(!1):e.preventDefault()}function S(e){_.value||o(e)}function C(e){_.value||s(e)}return I(()=>{i.value&&window.requestAnimationFrame(()=>{v.value=!0})}),(e,t)=>(u(),x(M(Ne),{ref_key:`drawerRef`,ref:a,"data-vaul-drawer":``,"data-vaul-drawer-direction":M(g),"data-vaul-delayed-snap-points":v.value?`true`:`false`,"data-vaul-snap-points":M(n)&&M(i)?`true`:`false`,style:m({"--snap-point-height":y.value}),onPointerdown:S,onPointermove:C,onPointerup:M(c),onPointerDownOutside:b,onOpenAutoFocus:t[0]||=O(()=>{},[`prevent`]),onEscapeKeyDown:t[1]||=e=>{M(f)||e.preventDefault()}},{default:N(()=>[w(e.$slots,`default`)]),_:3},8,[`data-vaul-drawer-direction`,`data-vaul-delayed-snap-points`,`data-vaul-snap-points`,`style`,`onPointerup`]))}}),ec=[`data-vaul-drawer-visible`],tc={"data-vaul-handle-hitarea":``,"aria-hidden":`true`},nc=250,rc=120,ic=t({__name:`DrawerHandle`,props:{preventCycle:{type:Boolean,default:!1}},setup(e){let t=e,{onPress:n,onDrag:r,handleRef:i,handleOnly:a,isOpen:o,snapPoints:s,activeSnapPoint:c,isDragging:l,dismissible:d,closeDrawer:f}=As(),p=B(null),m=B(!1);function h(){if(m.value){v();return}window.setTimeout(()=>{g()},rc)}function g(){if(l.value||t.preventCycle||m.value){v();return}if(v(),!s.value||s.value.length===0){d.value||f();return}let e=c.value===s.value[s.value.length-1];if(e&&d.value){f();return}let n=s.value.findIndex(e=>e===c.value);if(n===-1)return;let r=e?0:n+1;c.value=s.value[r]}function _(){p.value=window.setTimeout(()=>{m.value=!0},nc)}function v(){p.value&&window.clearTimeout(p.value),m.value=!1}function y(e){a.value&&n(e),_()}function b(e){a.value&&r(e)}return(e,t)=>(u(),L(`div`,{ref_key:`handleRef`,ref:i,"data-vaul-drawer-visible":M(o)?`true`:`false`,"data-vaul-handle":``,"aria-hidden":`true`,onClick:h,onPointercancel:v,onPointerdown:y,onPointermove:b},[z(`span`,tc,[w(e.$slots,`default`)])],40,ec))}}),ac={key:0,flex:``,"gap-2":``},oc=t({__name:`ColorPalette`,props:{colors:{}},setup(e){let t=qe();return(n,i)=>e.colors.length?(u(),L(`div`,ac,[(u(!0),L(P,null,l(e.colors,({hex:e,name:n})=>(u(),x(M(ho),{key:e||`default`},{default:N(()=>[j(M(yo),null,{default:N(()=>[j(M(wo),{transition:`all ease-in-out duration-250`,"size-8":``,"cursor-pointer":``,"rounded-full":``,"bg-primary-500":``,style:m(e?{background:e}:{"--chromatic-hue":M(Je)}),class:A(M(t).isColorSelectedForPrimary(e)?`scale-120 md:scale-150 mx-1`:`hover:scale-110`),onClick:n=>M(t).applyPrimaryColorFrom(e)},null,8,[`style`,`class`,`onClick`]),j(M(Co),null,{default:N(()=>[j(M(So),{bg:`white dark:neutral-800`,"rounded-lg":``,"px-3":``,"py-1.5":``,"text-sm":``,"shadow-md":``},{default:N(()=>[h(v(n)+` `,1),j(M(fo),{"fill-white":``,"dark:fill-neutral-800":``})]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024))),128))])):r(``,!0)}});export{Mt as A,Ra as C,At as D,Ot as E,G as F,_t as I,$e as M,st as N,jt as O,ft as P,za as S,Et as T,So as _,Xs as a,Xa as b,ys as c,ds as d,rs as f,wo as g,Eo as h,ic as i,Ye as j,St as k,_s as l,ko as m,Zs as n,Ts as o,Xo as p,$s as r,ws as s,oc as t,fs as u,yo as v,K as w,Va as x,ho as y}; \ No newline at end of file diff --git a/assets/x-CfzkhX9_.js b/assets/x-DOlEMeNX.js similarity index 68% rename from assets/x-CfzkhX9_.js rename to assets/x-DOlEMeNX.js index 9688377fa6042c76096e11096b2f54dd7dea90a8..ca633f9b49af7d0eb99428356d98df58c9ab7313 100644 --- a/assets/x-CfzkhX9_.js +++ b/assets/x-DOlEMeNX.js @@ -1 +1 @@ -import{A as e,K as t,S as n,kt as r}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-CZ9Rvki9.js";import"./src-DYQXbDgu.js";import"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{et as i}from"./components-BR_Kqwtu.js";import"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-D1kLcsvA.js";import"./__vite-browser-external-BaycPy5b.js";import{t as a}from"./route-block-CpjdOEnv.js";var o=e({__name:`x`,setup(e){return(e,a)=>(t(),n(r(i)))}});typeof a==`function`&&a(o);var s=o;export{s as default}; \ No newline at end of file +import{A as e,K as t,S as n,kt as r}from"./vue.runtime.esm-bundler-_ZPRHVd_.js";import"./widgets-C0YByt49.js";import"./src-DYQXbDgu.js";import"./resettable-CbXzRviW.js";import"./environment-CyZLTg97.js";import"./src-C83SCWbW.js";import{et as i}from"./components-CeE-UiLT.js";import"./speech-6W29lyZ_.js";import"./purify.es-Dld0-TNF.js";import"./stream-transcription-_Xuw_VzN.js";import"./settings-73vyHOZs.js";import"./__vite-browser-external-BaycPy5b.js";import{t as a}from"./route-block-CpjdOEnv.js";var o=e({__name:`x`,setup(e){return(e,a)=>(t(),n(r(i)))}});typeof a==`function`&&a(o);var s=o;export{s as default}; \ No newline at end of file diff --git a/index.html b/index.html index 5a3a88cfe8d4bb81d9d0bec90a1bbe6f3394a952..1bd0d43b9a714be3e27b4f1bdfd018b7ac7936bb 100644 --- a/index.html +++ b/index.html @@ -46,7 +46,7 @@ src="/remote-assets/page-external-data/js/script.js" > - + @@ -59,11 +59,11 @@ - + - - + + @@ -71,12 +71,12 @@ - + - + diff --git a/sw.js b/sw.js index 4553a1b65c4431b4581556c85e2d2a7eb79edb17..f7a2bab847453570a43aa746bc100403f4861e93 100644 --- a/sw.js +++ b/sw.js @@ -1 +1 @@ -if(!self.define){let s,l={};const e=(e,r)=>(e=new URL(e+".js",r).href,l[e]||new Promise(l=>{if("document"in self){const s=document.createElement("script");s.src=e,s.onload=l,document.head.appendChild(s)}else s=e,importScripts(e),l()}).then(()=>{let s=l[e];if(!s)throw new Error(`Module ${e} didn’t register its module`);return s}));self.define=(r,i)=>{const n=s||("document"in self?document.currentScript.src:"")||location.href;if(l[n])return;let u={};const a=s=>e(s,n),t={module:{uri:n},exports:u,require:a};l[n]=Promise.all(r.map(s=>t[s]||a(s))).then(s=>(i(...s),u))}}define(["./workbox-3aa584b4"],function(s){"use strict";self.skipWaiting(),s.clientsClaim(),s.precacheAndRoute([{url:"assets/__vite-browser-external-BaycPy5b.js",revision:null},{url:"assets/__vite-browser-external-D2g2gZ4Q.js",revision:null},{url:"assets/__vite-optional-peer-dep_effect_xsschema-CHaPnELX.js",revision:null},{url:"assets/__vite-optional-peer-dep_sury_xsschema-COo5msSl.js",revision:null},{url:"assets/_...all_-fHhcuF9K.js",revision:null},{url:"assets/_plugin-vue_export-helper-DGA9ry_j.js",revision:null},{url:"assets/_providerId_-CIYsM20M.js",revision:null},{url:"assets/abap-DNEQqHTI.js",revision:null},{url:"assets/actionscript-3-jr2Q1tgz.js",revision:null},{url:"assets/ada-D44zNlqf.js",revision:null},{url:"assets/airi-card-BeLYaKHl.js",revision:null},{url:"assets/airi-card-DuhaYjQU.js",revision:null},{url:"assets/alibaba-cloud-model-studio-Bs3uT3_h.js",revision:null},{url:"assets/aliyun-nls-transcription-ThiG_Ak6.js",revision:null},{url:"assets/andromeeda-Dm_JRRO6.js",revision:null},{url:"assets/angular-html-BsVOYn8U.js",revision:null},{url:"assets/angular-html-Dluh5dHB.js",revision:null},{url:"assets/angular-ts-DENmNPbC.js",revision:null},{url:"assets/apache-C8U1VYoB.js",revision:null},{url:"assets/apex-TFyYES6i.js",revision:null},{url:"assets/apl-VtBj-tPm.js",revision:null},{url:"assets/applescript-D16bIlPF.js",revision:null},{url:"assets/ara-CYxDLRKk.js",revision:null},{url:"assets/arktype-C-GObzDh-ClCHvlPE.js",revision:null},{url:"assets/asciidoc-CsauW8bX.js",revision:null},{url:"assets/asm-7XjRSjeI.js",revision:null},{url:"assets/astro-gQZvG91z.js",revision:null},{url:"assets/audio-record-DfNNs2vE.js",revision:null},{url:"assets/aurora-x-DYZJqKGn.js",revision:null},{url:"assets/awk-D9p0YUDr.js",revision:null},{url:"assets/ayu-dark-DxF0TxdA.js",revision:null},{url:"assets/azure-ai-foundry-DEqvloeQ.js",revision:null},{url:"assets/background-gradient-blending-B88qVe8m.css",revision:null},{url:"assets/background-gradient-blending-DV35Xxp1.js",revision:null},{url:"assets/background-removal-SpmG5Lvm.js",revision:null},{url:"assets/ballerina-DKGX9qsb.js",revision:null},{url:"assets/Basic-EclD3L6X.js",revision:null},{url:"assets/BasicInputFile-C2AMSzxu.js",revision:null},{url:"assets/bat-BlE6u8qd.js",revision:null},{url:"assets/beancount-DRLwIUdY.js",revision:null},{url:"assets/beat-sync-DNJSgBlH.js",revision:null},{url:"assets/beat-sync-GCfX3UHH.js",revision:null},{url:"assets/beat-sync-HWqNDh-f.js",revision:null},{url:"assets/berry-DruSnAin.js",revision:null},{url:"assets/bibtex-Czt5baZX.js",revision:null},{url:"assets/bicep-CUSf3d_c.js",revision:null},{url:"assets/blade-BEEM-9q_.js",revision:null},{url:"assets/browser-2lyKKTPE.js",revision:null},{url:"assets/browser-DY5K31Vk.js",revision:null},{url:"assets/browser-kTlZS2wy.js",revision:null},{url:"assets/bsl-BV-OxT7W.js",revision:null},{url:"assets/c-Db_j_sRr.js",revision:null},{url:"assets/c-jsZCKY_j.js",revision:null},{url:"assets/cadence-Cudh-o45.js",revision:null},{url:"assets/cairo-BfHIMykh.js",revision:null},{url:"assets/CardCreate-CdxiTrqh.js",revision:null},{url:"assets/CardCreate-CQTxdn4D.js",revision:null},{url:"assets/CardCreationDialog-B2njkXhJ.js",revision:null},{url:"assets/CardCreationDialog-BEG0qYyE.css",revision:null},{url:"assets/CardCreationDialog-cN7py1P6.js",revision:null},{url:"assets/CardDetailDialog-BFPxHsY4.js",revision:null},{url:"assets/CardDetailDialog-CsobWwkt.js",revision:null},{url:"assets/CardListItem-CbOMiA5T.js",revision:null},{url:"assets/CardListItem-CyBP3HUt.js",revision:null},{url:"assets/catppuccin-frappe-DKts5Yn4.js",revision:null},{url:"assets/catppuccin-latte-qXTdWSZc.js",revision:null},{url:"assets/catppuccin-macchiato-CsngxuSi.js",revision:null},{url:"assets/catppuccin-mocha-ercpYTsj.js",revision:null},{url:"assets/chat-CSFza6dY.js",revision:null},{url:"assets/chunk-B78Zgmat.js",revision:null},{url:"assets/clarity-D2i4pxTJ.js",revision:null},{url:"assets/clojure-CGWXBQrJ.js",revision:null},{url:"assets/cloudflare-workers-ai-BgN6F-61.js",revision:null},{url:"assets/cmake-B4HUKzrc.js",revision:null},{url:"assets/cmake-DHYimkbZ.js",revision:null},{url:"assets/cobol-BnpJdJAJ.js",revision:null},{url:"assets/codeowners-BGDgDa0r.js",revision:null},{url:"assets/codeql-gbYbs8C5.js",revision:null},{url:"assets/coffee-C3vE_C0-.js",revision:null},{url:"assets/color-scheme-0i0L0wxO.js",revision:null},{url:"assets/color-scheme-B_nVc7uH.css",revision:null},{url:"assets/comet-api-speech-Dfu-r2Ac.js",revision:null},{url:"assets/comet-api-transcription-BxkdP1WS.js",revision:null},{url:"assets/common-lisp-BYInJj3g.js",revision:null},{url:"assets/components-BR_Kqwtu.js",revision:null},{url:"assets/components-DBIH4UgO.css",revision:null},{url:"assets/composables-eN7drneV.js",revision:null},{url:"assets/consciousness-OW8mu5uI.js",revision:null},{url:"assets/coq-CHFw-dch.js",revision:null},{url:"assets/core-Bb6Rlujp.js",revision:null},{url:"assets/core-DzkbPWey.js",revision:null},{url:"assets/cpp-DWHzviHr.js",revision:null},{url:"assets/cpp-QskMk08h.js",revision:null},{url:"assets/crystal-ODocUc7k.js",revision:null},{url:"assets/csharp-C0f2l-Yr.js",revision:null},{url:"assets/csharp-CBbPrYij.js",revision:null},{url:"assets/css-0NmOwaIy.js",revision:null},{url:"assets/css-D-dnNlYl.js",revision:null},{url:"assets/csv-CXNsSmCZ.js",revision:null},{url:"assets/csv-D09rDnp3.js",revision:null},{url:"assets/cue-H2GowkIg.js",revision:null},{url:"assets/cypher-0hlBAt-6.js",revision:null},{url:"assets/d-CrPA3hg-.js",revision:null},{url:"assets/dark-plus-D6Fl1Lx6.js",revision:null},{url:"assets/dart-ZcB4Pz59.js",revision:null},{url:"assets/data-CBvyhmZq.js",revision:null},{url:"assets/dax-BFLZg8Xz.js",revision:null},{url:"assets/default-browser-I0ZU1HCD.js",revision:null},{url:"assets/default-CTPUQ2Uf.js",revision:null},{url:"assets/default-node-BJAWWm9L.js",revision:null},{url:"assets/DeleteCardDialog-Bby7Qwvm.js",revision:null},{url:"assets/DeleteCardDialog-DkR1Cc9E.js",revision:null},{url:"assets/desktop-DNRAqRwo.js",revision:null},{url:"assets/developer-Da1vuucL.js",revision:null},{url:"assets/DialogTitle-ytlEE0A-.js",revision:null},{url:"assets/diff-DF-bn-p5.js",revision:null},{url:"assets/diff-LBCBSdFv.js",revision:null},{url:"assets/dist-CB18iuyA.js",revision:null},{url:"assets/dist-Che88T83.js",revision:null},{url:"assets/dist-D8jfttal.js",revision:null},{url:"assets/docker-DWslceEV.js",revision:null},{url:"assets/dotenv-DmJB2num.js",revision:null},{url:"assets/dracula-D6lo-CaK.js",revision:null},{url:"assets/dracula-soft-C5i2H3nJ.js",revision:null},{url:"assets/dream-maker-Dqp7x8Cg.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-8HYqhb4i.wasm",revision:null},{url:"assets/duckdb-mvp-BP8S3C4a.js",revision:null},{url:"assets/edge-DGGGOGiX.js",revision:null},{url:"assets/effect-D2vKoLgT-DFr0kiYz.js",revision:null},{url:"assets/elevenlabs-DdLCiM18.js",revision:null},{url:"assets/elixir-DdmtoNcn.js",revision:null},{url:"assets/elm-C87e-l4N.js",revision:null},{url:"assets/emacs-lisp-BkrGQZgR.js",revision:null},{url:"assets/environment-CyZLTg97.js",revision:null},{url:"assets/erb-Cf-BYXiS.js",revision:null},{url:"assets/erlang-CIu3zK3d.js",revision:null},{url:"assets/esm-PIKjlpnV.js",revision:null},{url:"assets/everforest-dark-Bv0KzsdB.js",revision:null},{url:"assets/everforest-light-DrANOxth.js",revision:null},{url:"assets/fennel-BXVdpdAw.js",revision:null},{url:"assets/fish-CNStBh9X.js",revision:null},{url:"assets/fluent-D1IO-_sn.js",revision:null},{url:"assets/fortran-fixed-form-CXwy3AN3.js",revision:null},{url:"assets/fortran-free-form-D272xYfW.js",revision:null},{url:"assets/fortran-free-form-Dnk4Dl5P.js",revision:null},{url:"assets/fsharp-BqHhZ4Us.js",revision:null},{url:"assets/gaming-factorio-SBqYhlLF.js",revision:null},{url:"assets/gaming-minecraft-DqVnVTyA.js",revision:null},{url:"assets/gdresource-B-8GQb7C.js",revision:null},{url:"assets/gdscript-D1a8fDKt.js",revision:null},{url:"assets/gdscript-DZ-vcsgQ.js",revision:null},{url:"assets/gdshader-BOC-sw7F.js",revision:null},{url:"assets/gdshader-CUDFl6z8.js",revision:null},{url:"assets/general-Bvs5oF0L.js",revision:null},{url:"assets/genie-YHUp_Oud.js",revision:null},{url:"assets/gesture-circle-Dz-6GhkK.js",revision:null},{url:"assets/gherkin-Dcb9bMGm.js",revision:null},{url:"assets/git-commit-CNjwX6_5.js",revision:null},{url:"assets/git-rebase-CmHNvJSJ.js",revision:null},{url:"assets/github-dark-default-PLAWyEwZ.js",revision:null},{url:"assets/github-dark-dimmed-B82G7wK0.js",revision:null},{url:"assets/github-dark-DvgxXLYG.js",revision:null},{url:"assets/github-dark-high-contrast-DkIp9DNm.js",revision:null},{url:"assets/github-light-default-D5BxSrQ8.js",revision:null},{url:"assets/github-light-high-contrast-ChHCej2r.js",revision:null},{url:"assets/github-light-zVOc2YnV.js",revision:null},{url:"assets/gleam-D9GXSYhG.js",revision:null},{url:"assets/glimmer-js-FOvWOlAr.js",revision:null},{url:"assets/glimmer-ts-DN_oCYdM.js",revision:null},{url:"assets/glsl-Br38NFbK.js",revision:null},{url:"assets/glsl-DdAWLLg-.js",revision:null},{url:"assets/gnuplot-DyoVpAbZ.js",revision:null},{url:"assets/go-B6mD6ydg.js",revision:null},{url:"assets/go-DiF8FLLy.js",revision:null},{url:"assets/graphql-9u5LjVmy.js",revision:null},{url:"assets/graphql-DMjFSnc1.js",revision:null},{url:"assets/groovy-ChCZwCXr.js",revision:null},{url:"assets/gruvbox-dark-hard-CFOMcT1o.js",revision:null},{url:"assets/gruvbox-dark-medium-CYs2SaLC.js",revision:null},{url:"assets/gruvbox-dark-soft-D5TcfUwQ.js",revision:null},{url:"assets/gruvbox-light-hard-DL8g_c8w.js",revision:null},{url:"assets/gruvbox-light-medium-Bh48gTRE.js",revision:null},{url:"assets/gruvbox-light-soft-Cp67CA_R.js",revision:null},{url:"assets/hack-BUnBSK8E.js",revision:null},{url:"assets/haml-Cu_s5oUC.js",revision:null},{url:"assets/haml-rbnFKDKe.js",revision:null},{url:"assets/handlebars-Bit6i92P.js",revision:null},{url:"assets/haskell-C20M97UH.js",revision:null},{url:"assets/haxe-BRLPuKN2.js",revision:null},{url:"assets/haxe-DyFF3WBQ.js",revision:null},{url:"assets/hcl-CaTIleE-.js",revision:null},{url:"assets/HeaderLink-CNK9co0e.js",revision:null},{url:"assets/HeaderLink-CO18o3XU.css",revision:null},{url:"assets/hearing-BH9rth_f.js",revision:null},{url:"assets/hearing-CzJ5MFBH.js",revision:null},{url:"assets/hjson-BgpHRAB4.js",revision:null},{url:"assets/hlsl-D_WlsJ5R.js",revision:null},{url:"assets/hlsl-DO1yDaS5.js",revision:null},{url:"assets/home-BH9GCqHR.js",revision:null},{url:"assets/houston-C8UOwQd6.js",revision:null},{url:"assets/html-CttVmCOa.js",revision:null},{url:"assets/html-derivative-D-UoP5du.js",revision:null},{url:"assets/html-derivative-Def2Eh7H.js",revision:null},{url:"assets/html-HW8A3Dcn.js",revision:null},{url:"assets/http-BPUd0Zxi.js",revision:null},{url:"assets/hurl-ArZMoDH7.js",revision:null},{url:"assets/hxml-iqbx3G6B.js",revision:null},{url:"assets/hy-DAOwJ7Zx.js",revision:null},{url:"assets/image-CCjIWUuW.js",revision:null},{url:"assets/image-DolN1ewS.css",revision:null},{url:"assets/imba-CFLGnQn4.js",revision:null},{url:"assets/import-url-browser-CzUXxC7A.js",revision:null},{url:"assets/import-url-browser-DRsAP6zH.js",revision:null},{url:"assets/import-url-node-BEwwqk0-.js",revision:null},{url:"assets/index-BTKouhQt.css",revision:null},{url:"assets/index-Cx_srAfm-DhadnX4q.js",revision:null},{url:"assets/index-L0ZWxoOt.js",revision:null},{url:"assets/index-tts-vllm-CnKZjGZI.js",revision:null},{url:"assets/index.browser-Dc5HQ32a.js",revision:null},{url:"assets/ini-BmrSiBML.js",revision:null},{url:"assets/InputFile-CjPYZ8S-.js",revision:null},{url:"assets/java-BxPaqRPc.js",revision:null},{url:"assets/java-DNbb1Epk.js",revision:null},{url:"assets/javascript-Cwo-aX3E.js",revision:null},{url:"assets/javascript-DGYr-y5f.js",revision:null},{url:"assets/jinja-DCr5FxIa.js",revision:null},{url:"assets/jison-oyMrken4.js",revision:null},{url:"assets/js/CubismSdkForWeb-5-r.3/Core/live2dcubismcore.min.js",revision:null},{url:"assets/json-BatLJ8q8.js",revision:null},{url:"assets/json-BybUBpwp.js",revision:null},{url:"assets/json5-CiXRzD2p.js",revision:null},{url:"assets/jsonc-BBrgrlwa.js",revision:null},{url:"assets/jsonl-C_pAhQDa.js",revision:null},{url:"assets/jsonnet-CXes_Bkh.js",revision:null},{url:"assets/jssm-DprmdNEX.js",revision:null},{url:"assets/jsx-3S_5mzm5.js",revision:null},{url:"assets/jsx-B4JCk6gF.js",revision:null},{url:"assets/julia-BCLgBE7O.js",revision:null},{url:"assets/kanagawa-dragon-CnX8KX7Q.js",revision:null},{url:"assets/kanagawa-lotus-BMZ_tYmB.js",revision:null},{url:"assets/kanagawa-wave-DM6e6ph6.js",revision:null},{url:"assets/kdl-CY_VG9V1.js",revision:null},{url:"assets/kotlin-B4CrsQC3.js",revision:null},{url:"assets/kusto-hb_-cOWk.js",revision:null},{url:"assets/laserwave-BMNWe_jE.js",revision:null},{url:"assets/latex-CTNmyalJ.js",revision:null},{url:"assets/lean-Cj2O-JaK.js",revision:null},{url:"assets/less-82bUNl9Z.js",revision:null},{url:"assets/less-DdxGSI8R.js",revision:null},{url:"assets/light-plus-CnzmuHbE.js",revision:null},{url:"assets/liquid-Ctt3EYNO.js",revision:null},{url:"assets/live2d-DukystQI.js",revision:null},{url:"assets/llmmarkerParser-CpinDrSK.js",revision:null},{url:"assets/llvm-C78PpEc2.js",revision:null},{url:"assets/lm-studio-Cu1JvZVB.js",revision:null},{url:"assets/log-Bm1YVe0C.js",revision:null},{url:"assets/logo-BsNoYTpI.js",revision:null},{url:"assets/lua-CZfvyPhi.js",revision:null},{url:"assets/lua-DTYqVhuF.js",revision:null},{url:"assets/luau-BxiReOnZ.js",revision:null},{url:"assets/make-CQ5AWO_I.js",revision:null},{url:"assets/markdown-CxX2QUo5.js",revision:null},{url:"assets/markdown-Dxe2aSDX.js",revision:null},{url:"assets/marko-B1C6HK5k.js",revision:null},{url:"assets/material-theme-CMk9K9QH.js",revision:null},{url:"assets/material-theme-darker-BrIWGZFh.js",revision:null},{url:"assets/material-theme-lighter-BlsDFn0M.js",revision:null},{url:"assets/material-theme-ocean-Ck9s-pC4.js",revision:null},{url:"assets/material-theme-palenight-vYiy848M.js",revision:null},{url:"assets/matlab-myXh3E11.js",revision:null},{url:"assets/mdc-BiFfzJRB.js",revision:null},{url:"assets/mdx-6Z9l8GrU.js",revision:null},{url:"assets/memory-BtlxAq98.js",revision:null},{url:"assets/memory-long-term-CtgFbvBe.js",revision:null},{url:"assets/memory-short-term-Dgai2Btn.js",revision:null},{url:"assets/merge-BvxP9iBC.js",revision:null},{url:"assets/mermaid-DrdcjxCo.js",revision:null},{url:"assets/messaging-discord-BMzg_O9F.js",revision:null},{url:"assets/microsoft-speech-DXFkeIFV.js",revision:null},{url:"assets/min-dark-CWWlrldf.js",revision:null},{url:"assets/min-light-BKrEQtDo.js",revision:null},{url:"assets/mipsasm-fwDkgGny.js",revision:null},{url:"assets/models-CcEJuOe_.js",revision:null},{url:"assets/modules-pq5SkWez.js",revision:null},{url:"assets/mojo-XIlWlG2E.js",revision:null},{url:"assets/monokai-LbR4YGSl.js",revision:null},{url:"assets/move-BVIc_AEk.js",revision:null},{url:"assets/narrat-BE4ZwDw8.js",revision:null},{url:"assets/nextflow-COztCr2T.js",revision:null},{url:"assets/nginx-DDvT-Ioe.js",revision:null},{url:"assets/night-owl-j6fuvZL9.js",revision:null},{url:"assets/nim-CYFIfJqN.js",revision:null},{url:"assets/nix-Cc8CtVhp.js",revision:null},{url:"assets/nord-WeWn5l3P.js",revision:null},{url:"assets/nushell-VwMnLzAV.js",revision:null},{url:"assets/objective-c-CX6rgGQW.js",revision:null},{url:"assets/objective-cpp-CibqCln4.js",revision:null},{url:"assets/ocaml-B-_49PKI.js",revision:null},{url:"assets/ollama-B5mymzO5.js",revision:null},{url:"assets/onboarding-DCg6WaMD.js",revision:null},{url:"assets/one-dark-pro-D3PAYJmy.js",revision:null},{url:"assets/one-light-BJ0S8wlu.js",revision:null},{url:"assets/openai-audio-speech-CK11JEyg.js",revision:null},{url:"assets/openai-audio-transcription-C9jVbePt.js",revision:null},{url:"assets/openai-compatible-audio-speech-Dg21-D2M.js",revision:null},{url:"assets/openai-compatible-audio-transcription-DQYIeBVK.js",revision:null},{url:"assets/openscad-B03CWcpV.js",revision:null},{url:"assets/ort-wasm-simd-threaded.jsep-B0T3yYHD.wasm",revision:null},{url:"assets/output-C8zlODy6.js",revision:null},{url:"assets/pages-BHkaRTzj.css",revision:null},{url:"assets/pages-JQnTlB9Y.js",revision:null},{url:"assets/pascal-D6PNl1GR.js",revision:null},{url:"assets/perl-gbQ4EDQp.js",revision:null},{url:"assets/php-C_J3wAEq.js",revision:null},{url:"assets/php-CY6yUTFD.js",revision:null},{url:"assets/pkl-Bgt2qsfh.js",revision:null},{url:"assets/plain-B9tCnS2r.js",revision:null},{url:"assets/plastic-DvXFbjTk.js",revision:null},{url:"assets/player2-speech-DRfVfleA.js",revision:null},{url:"assets/plsql-LLe2fRET.js",revision:null},{url:"assets/po-Cx4wPUoO.js",revision:null},{url:"assets/poimandres-B3ZUAEY2.js",revision:null},{url:"assets/polar-eOWqpxzk.js",revision:null},{url:"assets/polaroid-CqSaE7FQ.js",revision:null},{url:"assets/postcss-BUQ4KAJ7.js",revision:null},{url:"assets/postcss-DEmBk4B9.js",revision:null},{url:"assets/powerquery-jEq8X5lc.js",revision:null},{url:"assets/powershell-wtzDOglF.js",revision:null},{url:"assets/preload-helper-Dn1uWANL.js",revision:null},{url:"assets/prisma-BkYxdhao.js",revision:null},{url:"assets/process.worklet-Cmmnc6Go.js",revision:null},{url:"assets/process.worklet-DNDGcsYh.js",revision:null},{url:"assets/prolog-CyhT_Kch.js",revision:null},{url:"assets/proto-B00zSp6m.js",revision:null},{url:"assets/providers-CP--1bBf.js",revision:null},{url:"assets/providers-transcription-realtime-aliyun-nls-5fvDNN_K.js",revision:null},{url:"assets/pug-HFyCGSoj.js",revision:null},{url:"assets/puppet-BjQM09js.js",revision:null},{url:"assets/purescript-Bf731CSj.js",revision:null},{url:"assets/purify.es-Dld0-TNF.js",revision:null},{url:"assets/python-BYCXN1fG.js",revision:null},{url:"assets/python-I5cicAGo.js",revision:null},{url:"assets/qml-CA7WJUu7.js",revision:null},{url:"assets/qmldir-CIXSNd08.js",revision:null},{url:"assets/qss-Cm8HJbD3.js",revision:null},{url:"assets/r-Ddhwej8I.js",revision:null},{url:"assets/r-DXVBc-0d.js",revision:null},{url:"assets/racket-q17mysri.js",revision:null},{url:"assets/raku-Bhpw2cnH.js",revision:null},{url:"assets/razor-CZbfBDaQ.js",revision:null},{url:"assets/red-D9ge-y6r.js",revision:null},{url:"assets/reg-B66f_NTa.js",revision:null},{url:"assets/regexp-B_5nnJWQ.js",revision:null},{url:"assets/regexp-BSO1rOx5.js",revision:null},{url:"assets/rel-7t0FBVSQ.js",revision:null},{url:"assets/resettable-CbXzRviW.js",revision:null},{url:"assets/riscv-BsLTjfEo.js",revision:null},{url:"assets/rose-pine-6db7_EjW.js",revision:null},{url:"assets/rose-pine-dawn-BAtMQyf-.js",revision:null},{url:"assets/rose-pine-moon-XKjeq-op.js",revision:null},{url:"assets/rosmsg-BK5oE9Av.js",revision:null},{url:"assets/route-block-CpjdOEnv.js",revision:null},{url:"assets/rst-C_Pj8QDw.js",revision:null},{url:"assets/ruby-BGDggo_i.js",revision:null},{url:"assets/ruby-D5-34Kc7.js",revision:null},{url:"assets/rust-DZM2L0Tt.js",revision:null},{url:"assets/sas-ClgPuXh9.js",revision:null},{url:"assets/sass-Dv9-m3z_.js",revision:null},{url:"assets/scala-CU_mRqgp.js",revision:null},{url:"assets/scene-NwOIl7WX.js",revision:null},{url:"assets/scenes-Ct-xUphs.js",revision:null},{url:"assets/scheme-D6Dp4SNN.js",revision:null},{url:"assets/scss-D5x63j_P.js",revision:null},{url:"assets/scss-SahjZYbx.js",revision:null},{url:"assets/sdbl-6qSwaYs5.js",revision:null},{url:"assets/sdbl-BFRivVXs.js",revision:null},{url:"assets/settings-B7G0W455.js",revision:null},{url:"assets/settings-C2pLQvYa.js",revision:null},{url:"assets/settings-D1kLcsvA.js",revision:null},{url:"assets/shaderlab-BJ9GiKkz.js",revision:null},{url:"assets/shellscript-pp2ez-I0.js",revision:null},{url:"assets/shellscript-vAa2iWrr.js",revision:null},{url:"assets/shellsession-D5QvUGYH.js",revision:null},{url:"assets/slack-dark-wQzwN0hH.js",revision:null},{url:"assets/slack-ochin-DuSyZAor.js",revision:null},{url:"assets/sleep-CkgWku9y.js",revision:null},{url:"assets/smalltalk-BwyN9gTg.js",revision:null},{url:"assets/snazzy-light-xjiGX6N3.js",revision:null},{url:"assets/solarized-dark-DzVV8Zv3.js",revision:null},{url:"assets/solarized-light-BCZkMzYV.js",revision:null},{url:"assets/solidity-kc7fmE2u.js",revision:null},{url:"assets/soy-CrDbnlG-.js",revision:null},{url:"assets/sparql-CIWSOXvP.js",revision:null},{url:"assets/speech-6W29lyZ_.js",revision:null},{url:"assets/speech-DH-rHMWX.js",revision:null},{url:"assets/splunk-D53h09Fd.js",revision:null},{url:"assets/sql-CNGZv43K.js",revision:null},{url:"assets/sql-DEHoZ3CS.js",revision:null},{url:"assets/src-BccD0BFR.js",revision:null},{url:"assets/src-C83SCWbW.js",revision:null},{url:"assets/src-CO8_9JkB.css",revision:null},{url:"assets/src-DYQXbDgu.js",revision:null},{url:"assets/ssh-config-DCF77iQP.js",revision:null},{url:"assets/stage-DZQk1vzw.js",revision:null},{url:"assets/stata-D6hNc7qD.js",revision:null},{url:"assets/stream-transcription-_Xuw_VzN.js",revision:null},{url:"assets/stylus-CTQWQil7.js",revision:null},{url:"assets/stylus-elBmfiaN.js",revision:null},{url:"assets/sury-DaaR_vre-S-1HmUCu.js",revision:null},{url:"assets/svelte-CcfQZqL8.js",revision:null},{url:"assets/swift-Dacca_Jc.js",revision:null},{url:"assets/synthwave-84-D-648CXm.js",revision:null},{url:"assets/system-BRtfNILC.js",revision:null},{url:"assets/system-verilog-BTofcmVu.js",revision:null},{url:"assets/systemd-BkAX-S6s.js",revision:null},{url:"assets/talonscript-BNTQ6DWE.js",revision:null},{url:"assets/tasl-f-WWXNqB.js",revision:null},{url:"assets/tcl-BOKvqrKS.js",revision:null},{url:"assets/templ-BWumpO_4.js",revision:null},{url:"assets/terraform-Dagbz1ye.js",revision:null},{url:"assets/tex-BPt6iNUT.js",revision:null},{url:"assets/tex-C_wmpywk.js",revision:null},{url:"assets/theme-color-CCXuu6C1.js",revision:null},{url:"assets/tokyo-night-jXjrDZFD.js",revision:null},{url:"assets/toml-DJntSiET.js",revision:null},{url:"assets/transformers.web-DAjDoeaJ.js",revision:null},{url:"assets/tres-B5z5lcdF.js",revision:null},{url:"assets/ts-tags-BAPF9r3N.js",revision:null},{url:"assets/tsv-XF2da-CK.js",revision:null},{url:"assets/tsx-CNS5Dh9u.js",revision:null},{url:"assets/tsx-DMd3gS0e.js",revision:null},{url:"assets/turtle-Bl_4e10u.js",revision:null},{url:"assets/turtle-DhkuLyiH.js",revision:null},{url:"assets/twig-Db3qd8yh.js",revision:null},{url:"assets/typescript-DWWSNqcd.js",revision:null},{url:"assets/typescript-U0J5IFfI.js",revision:null},{url:"assets/typespec-DekmLJ8h.js",revision:null},{url:"assets/typst-Bd_YFLaH.js",revision:null},{url:"assets/use-magic-keys-NMOzQ56z.js",revision:null},{url:"assets/use-provider-validation-DbXr83wX.js",revision:null},{url:"assets/use-ripple-grid-state-DcESPJAf.js",revision:null},{url:"assets/v-DhC4I5cZ.js",revision:null},{url:"assets/vala-BddkFOhf.js",revision:null},{url:"assets/valibot-iYGh1vpl-By45phQb.js",revision:null},{url:"assets/vb-CaZky7a-.js",revision:null},{url:"assets/verilog-Cj7CaRZg.js",revision:null},{url:"assets/vesper-BUFuXQSQ.js",revision:null},{url:"assets/vhdl-BtxO3ezd.js",revision:null},{url:"assets/vibrant-DaA7KX3v.js",revision:null},{url:"assets/viml-BUE_2zAk.js",revision:null},{url:"assets/vision-DhhLFD5o.js",revision:null},{url:"assets/vitesse-black-CF9uDtDi.js",revision:null},{url:"assets/vitesse-dark-CP9lMcan.js",revision:null},{url:"assets/vitesse-light-C8jSamq3.js",revision:null},{url:"assets/volcengine-CwHpcYQ0.js",revision:null},{url:"assets/vue-BGjJvQz8.js",revision:null},{url:"assets/vue-CTSsf9M1.js",revision:null},{url:"assets/vue-html-HA0p16KG.js",revision:null},{url:"assets/vue-i18n.runtime-Dah5zGm4.js",revision:null},{url:"assets/vue-router-Chhv6vZu.js",revision:null},{url:"assets/vue-vine-CBJbFliW.js",revision:null},{url:"assets/vue.runtime.esm-bundler-_ZPRHVd_.js",revision:null},{url:"assets/vyper-BInCbDzV.js",revision:null},{url:"assets/wasm-CKx2Vz69.js",revision:null},{url:"assets/wasm-Hu82aUW2.js",revision:null},{url:"assets/webgpu-C-1YCssS.js",revision:null},{url:"assets/wenyan-Cy1jg-XS.js",revision:null},{url:"assets/wgsl-D17iwfua.js",revision:null},{url:"assets/widgets-CeetJ7Oc.css",revision:null},{url:"assets/widgets-CZ9Rvki9.js",revision:null},{url:"assets/wikitext-CmDv8s3f.js",revision:null},{url:"assets/wit-xzAe2GYp.js",revision:null},{url:"assets/wolfram-DCJUMk03.js",revision:null},{url:"assets/worklet-D3oCvJ3_.js",revision:null},{url:"assets/x-CfzkhX9_.js",revision:null},{url:"assets/xml-CHddl9DN.js",revision:null},{url:"assets/xml-CLaxgXK0.js",revision:null},{url:"assets/xsl-DcWTn_FV.js",revision:null},{url:"assets/yaml-Cx7z1uMB.js",revision:null},{url:"assets/yaml-DnYR2pUT.js",revision:null},{url:"assets/zenscript-Chle_NUB.js",revision:null},{url:"assets/zig-qt-oQSr9.js",revision:null},{url:"assets/zod-D6g6461c-DxjQm07h.js",revision:null},{url:"index.html",revision:"32ed7feda487d29669c2a17a3683863a"},{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,l={};const e=(e,r)=>(e=new URL(e+".js",r).href,l[e]||new Promise(l=>{if("document"in self){const s=document.createElement("script");s.src=e,s.onload=l,document.head.appendChild(s)}else s=e,importScripts(e),l()}).then(()=>{let s=l[e];if(!s)throw new Error(`Module ${e} didn’t register its module`);return s}));self.define=(r,i)=>{const n=s||("document"in self?document.currentScript.src:"")||location.href;if(l[n])return;let u={};const a=s=>e(s,n),t={module:{uri:n},exports:u,require:a};l[n]=Promise.all(r.map(s=>t[s]||a(s))).then(s=>(i(...s),u))}}define(["./workbox-3aa584b4"],function(s){"use strict";self.skipWaiting(),s.clientsClaim(),s.precacheAndRoute([{url:"assets/__vite-browser-external-BaycPy5b.js",revision:null},{url:"assets/__vite-browser-external-D2g2gZ4Q.js",revision:null},{url:"assets/__vite-optional-peer-dep_effect_xsschema-CHaPnELX.js",revision:null},{url:"assets/__vite-optional-peer-dep_sury_xsschema-COo5msSl.js",revision:null},{url:"assets/_...all_-fHhcuF9K.js",revision:null},{url:"assets/_plugin-vue_export-helper-DGA9ry_j.js",revision:null},{url:"assets/_providerId_-DkkPbN-6.js",revision:null},{url:"assets/abap-DNEQqHTI.js",revision:null},{url:"assets/actionscript-3-jr2Q1tgz.js",revision:null},{url:"assets/ada-D44zNlqf.js",revision:null},{url:"assets/airi-card-DD-Ao_D4.js",revision:null},{url:"assets/airi-card-DuhaYjQU.js",revision:null},{url:"assets/alibaba-cloud-model-studio-y2JPUG5u.js",revision:null},{url:"assets/aliyun-nls-transcription-BDaEju68.js",revision:null},{url:"assets/andromeeda-Dm_JRRO6.js",revision:null},{url:"assets/angular-html-BsVOYn8U.js",revision:null},{url:"assets/angular-html-Dluh5dHB.js",revision:null},{url:"assets/angular-ts-DENmNPbC.js",revision:null},{url:"assets/apache-C8U1VYoB.js",revision:null},{url:"assets/apex-TFyYES6i.js",revision:null},{url:"assets/apl-VtBj-tPm.js",revision:null},{url:"assets/applescript-D16bIlPF.js",revision:null},{url:"assets/ara-CYxDLRKk.js",revision:null},{url:"assets/arktype-C-GObzDh-ClCHvlPE.js",revision:null},{url:"assets/asciidoc-CsauW8bX.js",revision:null},{url:"assets/asm-7XjRSjeI.js",revision:null},{url:"assets/astro-gQZvG91z.js",revision:null},{url:"assets/audio-record-DfNNs2vE.js",revision:null},{url:"assets/aurora-x-DYZJqKGn.js",revision:null},{url:"assets/awk-D9p0YUDr.js",revision:null},{url:"assets/ayu-dark-DxF0TxdA.js",revision:null},{url:"assets/azure-ai-foundry-J2oDBayK.js",revision:null},{url:"assets/background-gradient-blending-B88qVe8m.css",revision:null},{url:"assets/background-gradient-blending-DV35Xxp1.js",revision:null},{url:"assets/background-removal-SpmG5Lvm.js",revision:null},{url:"assets/ballerina-DKGX9qsb.js",revision:null},{url:"assets/Basic-EclD3L6X.js",revision:null},{url:"assets/BasicInputFile-C2AMSzxu.js",revision:null},{url:"assets/bat-BlE6u8qd.js",revision:null},{url:"assets/beancount-DRLwIUdY.js",revision:null},{url:"assets/beat-sync-BiFnmXe_.js",revision:null},{url:"assets/beat-sync-CMy6-y_I.js",revision:null},{url:"assets/beat-sync-GCfX3UHH.js",revision:null},{url:"assets/berry-DruSnAin.js",revision:null},{url:"assets/bibtex-Czt5baZX.js",revision:null},{url:"assets/bicep-CUSf3d_c.js",revision:null},{url:"assets/blade-BEEM-9q_.js",revision:null},{url:"assets/browser-2lyKKTPE.js",revision:null},{url:"assets/browser-DY5K31Vk.js",revision:null},{url:"assets/browser-kTlZS2wy.js",revision:null},{url:"assets/bsl-BV-OxT7W.js",revision:null},{url:"assets/c-Db_j_sRr.js",revision:null},{url:"assets/c-jsZCKY_j.js",revision:null},{url:"assets/cadence-Cudh-o45.js",revision:null},{url:"assets/cairo-BfHIMykh.js",revision:null},{url:"assets/CardCreate-CdxiTrqh.js",revision:null},{url:"assets/CardCreate-CQTxdn4D.js",revision:null},{url:"assets/CardCreationDialog-B2njkXhJ.js",revision:null},{url:"assets/CardCreationDialog-BEG0qYyE.css",revision:null},{url:"assets/CardCreationDialog-cN7py1P6.js",revision:null},{url:"assets/CardDetailDialog-BFPxHsY4.js",revision:null},{url:"assets/CardDetailDialog-CsobWwkt.js",revision:null},{url:"assets/CardListItem-CRpic1C1.js",revision:null},{url:"assets/CardListItem-D0jnzgCC.js",revision:null},{url:"assets/catppuccin-frappe-DKts5Yn4.js",revision:null},{url:"assets/catppuccin-latte-qXTdWSZc.js",revision:null},{url:"assets/catppuccin-macchiato-CsngxuSi.js",revision:null},{url:"assets/catppuccin-mocha-ercpYTsj.js",revision:null},{url:"assets/chat-CxQ_IGrj.js",revision:null},{url:"assets/chunk-B78Zgmat.js",revision:null},{url:"assets/clarity-D2i4pxTJ.js",revision:null},{url:"assets/clojure-CGWXBQrJ.js",revision:null},{url:"assets/cloudflare-workers-ai-Cx078Khx.js",revision:null},{url:"assets/cmake-B4HUKzrc.js",revision:null},{url:"assets/cmake-DHYimkbZ.js",revision:null},{url:"assets/cobol-BnpJdJAJ.js",revision:null},{url:"assets/codeowners-BGDgDa0r.js",revision:null},{url:"assets/codeql-gbYbs8C5.js",revision:null},{url:"assets/coffee-C3vE_C0-.js",revision:null},{url:"assets/color-scheme-B_nVc7uH.css",revision:null},{url:"assets/color-scheme-CBrwAUe-.js",revision:null},{url:"assets/comet-api-speech-bC6Lt6Xh.js",revision:null},{url:"assets/comet-api-transcription-B8mNI5J9.js",revision:null},{url:"assets/common-lisp-BYInJj3g.js",revision:null},{url:"assets/components-CeE-UiLT.js",revision:null},{url:"assets/components-DBIH4UgO.css",revision:null},{url:"assets/composables-eN7drneV.js",revision:null},{url:"assets/consciousness-C5rSlsFJ.js",revision:null},{url:"assets/coq-CHFw-dch.js",revision:null},{url:"assets/core-Bb6Rlujp.js",revision:null},{url:"assets/core-DzkbPWey.js",revision:null},{url:"assets/cpp-DWHzviHr.js",revision:null},{url:"assets/cpp-QskMk08h.js",revision:null},{url:"assets/crystal-ODocUc7k.js",revision:null},{url:"assets/csharp-C0f2l-Yr.js",revision:null},{url:"assets/csharp-CBbPrYij.js",revision:null},{url:"assets/css-0NmOwaIy.js",revision:null},{url:"assets/css-D-dnNlYl.js",revision:null},{url:"assets/csv-CXNsSmCZ.js",revision:null},{url:"assets/csv-D09rDnp3.js",revision:null},{url:"assets/cue-H2GowkIg.js",revision:null},{url:"assets/cypher-0hlBAt-6.js",revision:null},{url:"assets/d-CrPA3hg-.js",revision:null},{url:"assets/dark-plus-D6Fl1Lx6.js",revision:null},{url:"assets/dart-ZcB4Pz59.js",revision:null},{url:"assets/data-gBWwTXY5.js",revision:null},{url:"assets/dax-BFLZg8Xz.js",revision:null},{url:"assets/default-browser-I0ZU1HCD.js",revision:null},{url:"assets/default-CTPUQ2Uf.js",revision:null},{url:"assets/default-node-BJAWWm9L.js",revision:null},{url:"assets/DeleteCardDialog-Bby7Qwvm.js",revision:null},{url:"assets/DeleteCardDialog-DkR1Cc9E.js",revision:null},{url:"assets/desktop-DNRAqRwo.js",revision:null},{url:"assets/developer-DhPQaokR.js",revision:null},{url:"assets/DialogTitle-ytlEE0A-.js",revision:null},{url:"assets/diff-DF-bn-p5.js",revision:null},{url:"assets/diff-LBCBSdFv.js",revision:null},{url:"assets/dist-CB18iuyA.js",revision:null},{url:"assets/dist-Che88T83.js",revision:null},{url:"assets/dist-D8jfttal.js",revision:null},{url:"assets/docker-DWslceEV.js",revision:null},{url:"assets/dotenv-DmJB2num.js",revision:null},{url:"assets/dracula-D6lo-CaK.js",revision:null},{url:"assets/dracula-soft-C5i2H3nJ.js",revision:null},{url:"assets/dream-maker-Dqp7x8Cg.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-8HYqhb4i.wasm",revision:null},{url:"assets/duckdb-mvp-BP8S3C4a.js",revision:null},{url:"assets/edge-DGGGOGiX.js",revision:null},{url:"assets/effect-D2vKoLgT-DFr0kiYz.js",revision:null},{url:"assets/elevenlabs-C4xZyC-g.js",revision:null},{url:"assets/elixir-DdmtoNcn.js",revision:null},{url:"assets/elm-C87e-l4N.js",revision:null},{url:"assets/emacs-lisp-BkrGQZgR.js",revision:null},{url:"assets/environment-CyZLTg97.js",revision:null},{url:"assets/erb-Cf-BYXiS.js",revision:null},{url:"assets/erlang-CIu3zK3d.js",revision:null},{url:"assets/esm-PIKjlpnV.js",revision:null},{url:"assets/everforest-dark-Bv0KzsdB.js",revision:null},{url:"assets/everforest-light-DrANOxth.js",revision:null},{url:"assets/fennel-BXVdpdAw.js",revision:null},{url:"assets/fish-CNStBh9X.js",revision:null},{url:"assets/fluent-D1IO-_sn.js",revision:null},{url:"assets/fortran-fixed-form-CXwy3AN3.js",revision:null},{url:"assets/fortran-free-form-D272xYfW.js",revision:null},{url:"assets/fortran-free-form-Dnk4Dl5P.js",revision:null},{url:"assets/fsharp-BqHhZ4Us.js",revision:null},{url:"assets/gaming-factorio-l8EQ5MQM.js",revision:null},{url:"assets/gaming-minecraft-DfdBhRo1.js",revision:null},{url:"assets/gdresource-B-8GQb7C.js",revision:null},{url:"assets/gdscript-D1a8fDKt.js",revision:null},{url:"assets/gdscript-DZ-vcsgQ.js",revision:null},{url:"assets/gdshader-BOC-sw7F.js",revision:null},{url:"assets/gdshader-CUDFl6z8.js",revision:null},{url:"assets/general-BGIB4bwV.js",revision:null},{url:"assets/genie-YHUp_Oud.js",revision:null},{url:"assets/gesture-circle-Dz-6GhkK.js",revision:null},{url:"assets/gherkin-Dcb9bMGm.js",revision:null},{url:"assets/git-commit-CNjwX6_5.js",revision:null},{url:"assets/git-rebase-CmHNvJSJ.js",revision:null},{url:"assets/github-dark-default-PLAWyEwZ.js",revision:null},{url:"assets/github-dark-dimmed-B82G7wK0.js",revision:null},{url:"assets/github-dark-DvgxXLYG.js",revision:null},{url:"assets/github-dark-high-contrast-DkIp9DNm.js",revision:null},{url:"assets/github-light-default-D5BxSrQ8.js",revision:null},{url:"assets/github-light-high-contrast-ChHCej2r.js",revision:null},{url:"assets/github-light-zVOc2YnV.js",revision:null},{url:"assets/gleam-D9GXSYhG.js",revision:null},{url:"assets/glimmer-js-FOvWOlAr.js",revision:null},{url:"assets/glimmer-ts-DN_oCYdM.js",revision:null},{url:"assets/glsl-Br38NFbK.js",revision:null},{url:"assets/glsl-DdAWLLg-.js",revision:null},{url:"assets/gnuplot-DyoVpAbZ.js",revision:null},{url:"assets/go-B6mD6ydg.js",revision:null},{url:"assets/go-DiF8FLLy.js",revision:null},{url:"assets/graphql-9u5LjVmy.js",revision:null},{url:"assets/graphql-DMjFSnc1.js",revision:null},{url:"assets/groovy-ChCZwCXr.js",revision:null},{url:"assets/gruvbox-dark-hard-CFOMcT1o.js",revision:null},{url:"assets/gruvbox-dark-medium-CYs2SaLC.js",revision:null},{url:"assets/gruvbox-dark-soft-D5TcfUwQ.js",revision:null},{url:"assets/gruvbox-light-hard-DL8g_c8w.js",revision:null},{url:"assets/gruvbox-light-medium-Bh48gTRE.js",revision:null},{url:"assets/gruvbox-light-soft-Cp67CA_R.js",revision:null},{url:"assets/hack-BUnBSK8E.js",revision:null},{url:"assets/haml-Cu_s5oUC.js",revision:null},{url:"assets/haml-rbnFKDKe.js",revision:null},{url:"assets/handlebars-Bit6i92P.js",revision:null},{url:"assets/haskell-C20M97UH.js",revision:null},{url:"assets/haxe-BRLPuKN2.js",revision:null},{url:"assets/haxe-DyFF3WBQ.js",revision:null},{url:"assets/hcl-CaTIleE-.js",revision:null},{url:"assets/HeaderLink-CNK9co0e.js",revision:null},{url:"assets/HeaderLink-CO18o3XU.css",revision:null},{url:"assets/hearing-BH9rth_f.js",revision:null},{url:"assets/hearing-D9i_dzhe.js",revision:null},{url:"assets/hjson-BgpHRAB4.js",revision:null},{url:"assets/hlsl-D_WlsJ5R.js",revision:null},{url:"assets/hlsl-DO1yDaS5.js",revision:null},{url:"assets/home-BH9GCqHR.js",revision:null},{url:"assets/houston-C8UOwQd6.js",revision:null},{url:"assets/html-CttVmCOa.js",revision:null},{url:"assets/html-derivative-D-UoP5du.js",revision:null},{url:"assets/html-derivative-Def2Eh7H.js",revision:null},{url:"assets/html-HW8A3Dcn.js",revision:null},{url:"assets/http-BPUd0Zxi.js",revision:null},{url:"assets/hurl-ArZMoDH7.js",revision:null},{url:"assets/hxml-iqbx3G6B.js",revision:null},{url:"assets/hy-DAOwJ7Zx.js",revision:null},{url:"assets/image-CCjIWUuW.js",revision:null},{url:"assets/image-DolN1ewS.css",revision:null},{url:"assets/imba-CFLGnQn4.js",revision:null},{url:"assets/import-url-browser-CzUXxC7A.js",revision:null},{url:"assets/import-url-browser-DRsAP6zH.js",revision:null},{url:"assets/import-url-node-BEwwqk0-.js",revision:null},{url:"assets/index-BTKouhQt.css",revision:null},{url:"assets/index-CbpKegAc.js",revision:null},{url:"assets/index-Cx_srAfm-DhadnX4q.js",revision:null},{url:"assets/index-tts-vllm-CL4142hK.js",revision:null},{url:"assets/index.browser-Dc5HQ32a.js",revision:null},{url:"assets/ini-BmrSiBML.js",revision:null},{url:"assets/InputFile-CjPYZ8S-.js",revision:null},{url:"assets/java-BxPaqRPc.js",revision:null},{url:"assets/java-DNbb1Epk.js",revision:null},{url:"assets/javascript-Cwo-aX3E.js",revision:null},{url:"assets/javascript-DGYr-y5f.js",revision:null},{url:"assets/jinja-DCr5FxIa.js",revision:null},{url:"assets/jison-oyMrken4.js",revision:null},{url:"assets/js/CubismSdkForWeb-5-r.3/Core/live2dcubismcore.min.js",revision:null},{url:"assets/json-BatLJ8q8.js",revision:null},{url:"assets/json-BybUBpwp.js",revision:null},{url:"assets/json5-CiXRzD2p.js",revision:null},{url:"assets/jsonc-BBrgrlwa.js",revision:null},{url:"assets/jsonl-C_pAhQDa.js",revision:null},{url:"assets/jsonnet-CXes_Bkh.js",revision:null},{url:"assets/jssm-DprmdNEX.js",revision:null},{url:"assets/jsx-3S_5mzm5.js",revision:null},{url:"assets/jsx-B4JCk6gF.js",revision:null},{url:"assets/julia-BCLgBE7O.js",revision:null},{url:"assets/kanagawa-dragon-CnX8KX7Q.js",revision:null},{url:"assets/kanagawa-lotus-BMZ_tYmB.js",revision:null},{url:"assets/kanagawa-wave-DM6e6ph6.js",revision:null},{url:"assets/kdl-CY_VG9V1.js",revision:null},{url:"assets/kotlin-B4CrsQC3.js",revision:null},{url:"assets/kusto-hb_-cOWk.js",revision:null},{url:"assets/laserwave-BMNWe_jE.js",revision:null},{url:"assets/latex-CTNmyalJ.js",revision:null},{url:"assets/lean-Cj2O-JaK.js",revision:null},{url:"assets/less-82bUNl9Z.js",revision:null},{url:"assets/less-DdxGSI8R.js",revision:null},{url:"assets/light-plus-CnzmuHbE.js",revision:null},{url:"assets/liquid-Ctt3EYNO.js",revision:null},{url:"assets/live2d-DukystQI.js",revision:null},{url:"assets/llmmarkerParser-CpinDrSK.js",revision:null},{url:"assets/llvm-C78PpEc2.js",revision:null},{url:"assets/lm-studio-Dqkjrkzg.js",revision:null},{url:"assets/log-Bm1YVe0C.js",revision:null},{url:"assets/logo-BsNoYTpI.js",revision:null},{url:"assets/lua-CZfvyPhi.js",revision:null},{url:"assets/lua-DTYqVhuF.js",revision:null},{url:"assets/luau-BxiReOnZ.js",revision:null},{url:"assets/make-CQ5AWO_I.js",revision:null},{url:"assets/markdown-CxX2QUo5.js",revision:null},{url:"assets/markdown-Dxe2aSDX.js",revision:null},{url:"assets/marko-B1C6HK5k.js",revision:null},{url:"assets/material-theme-CMk9K9QH.js",revision:null},{url:"assets/material-theme-darker-BrIWGZFh.js",revision:null},{url:"assets/material-theme-lighter-BlsDFn0M.js",revision:null},{url:"assets/material-theme-ocean-Ck9s-pC4.js",revision:null},{url:"assets/material-theme-palenight-vYiy848M.js",revision:null},{url:"assets/matlab-myXh3E11.js",revision:null},{url:"assets/mdc-BiFfzJRB.js",revision:null},{url:"assets/mdx-6Z9l8GrU.js",revision:null},{url:"assets/memory-C9clolgI.js",revision:null},{url:"assets/memory-long-term-CtgFbvBe.js",revision:null},{url:"assets/memory-short-term-Dgai2Btn.js",revision:null},{url:"assets/merge-BvxP9iBC.js",revision:null},{url:"assets/mermaid-DrdcjxCo.js",revision:null},{url:"assets/messaging-discord-8qKSV5dK.js",revision:null},{url:"assets/microsoft-speech-wTQgkZ27.js",revision:null},{url:"assets/min-dark-CWWlrldf.js",revision:null},{url:"assets/min-light-BKrEQtDo.js",revision:null},{url:"assets/mipsasm-fwDkgGny.js",revision:null},{url:"assets/models-DCzLlqM2.js",revision:null},{url:"assets/modules-QYm9z3UJ.js",revision:null},{url:"assets/mojo-XIlWlG2E.js",revision:null},{url:"assets/monokai-LbR4YGSl.js",revision:null},{url:"assets/move-BVIc_AEk.js",revision:null},{url:"assets/narrat-BE4ZwDw8.js",revision:null},{url:"assets/nextflow-COztCr2T.js",revision:null},{url:"assets/nginx-DDvT-Ioe.js",revision:null},{url:"assets/night-owl-j6fuvZL9.js",revision:null},{url:"assets/nim-CYFIfJqN.js",revision:null},{url:"assets/nix-Cc8CtVhp.js",revision:null},{url:"assets/nord-WeWn5l3P.js",revision:null},{url:"assets/nushell-VwMnLzAV.js",revision:null},{url:"assets/objective-c-CX6rgGQW.js",revision:null},{url:"assets/objective-cpp-CibqCln4.js",revision:null},{url:"assets/ocaml-B-_49PKI.js",revision:null},{url:"assets/ollama-CMuzyH-X.js",revision:null},{url:"assets/onboarding-DCg6WaMD.js",revision:null},{url:"assets/one-dark-pro-D3PAYJmy.js",revision:null},{url:"assets/one-light-BJ0S8wlu.js",revision:null},{url:"assets/openai-audio-speech-BC1Afz1l.js",revision:null},{url:"assets/openai-audio-transcription-DPdPA8Wy.js",revision:null},{url:"assets/openai-compatible-audio-speech-DSAFQ68v.js",revision:null},{url:"assets/openai-compatible-audio-transcription-Dr6AdUfM.js",revision:null},{url:"assets/openscad-B03CWcpV.js",revision:null},{url:"assets/ort-wasm-simd-threaded.jsep-B0T3yYHD.wasm",revision:null},{url:"assets/output-C8zlODy6.js",revision:null},{url:"assets/pages-BHkaRTzj.css",revision:null},{url:"assets/pages-DZRbeQEX.js",revision:null},{url:"assets/pascal-D6PNl1GR.js",revision:null},{url:"assets/perl-gbQ4EDQp.js",revision:null},{url:"assets/php-C_J3wAEq.js",revision:null},{url:"assets/php-CY6yUTFD.js",revision:null},{url:"assets/pkl-Bgt2qsfh.js",revision:null},{url:"assets/plain-B9tCnS2r.js",revision:null},{url:"assets/plastic-DvXFbjTk.js",revision:null},{url:"assets/player2-speech-Bb53Rejb.js",revision:null},{url:"assets/plsql-LLe2fRET.js",revision:null},{url:"assets/po-Cx4wPUoO.js",revision:null},{url:"assets/poimandres-B3ZUAEY2.js",revision:null},{url:"assets/polar-eOWqpxzk.js",revision:null},{url:"assets/polaroid-DwT_lq0B.js",revision:null},{url:"assets/postcss-BUQ4KAJ7.js",revision:null},{url:"assets/postcss-DEmBk4B9.js",revision:null},{url:"assets/powerquery-jEq8X5lc.js",revision:null},{url:"assets/powershell-wtzDOglF.js",revision:null},{url:"assets/preload-helper-Dn1uWANL.js",revision:null},{url:"assets/prisma-BkYxdhao.js",revision:null},{url:"assets/process.worklet-Cmmnc6Go.js",revision:null},{url:"assets/process.worklet-DNDGcsYh.js",revision:null},{url:"assets/prolog-CyhT_Kch.js",revision:null},{url:"assets/proto-B00zSp6m.js",revision:null},{url:"assets/providers-CGUDsN-A.js",revision:null},{url:"assets/providers-transcription-realtime-aliyun-nls-5fvDNN_K.js",revision:null},{url:"assets/pug-HFyCGSoj.js",revision:null},{url:"assets/puppet-BjQM09js.js",revision:null},{url:"assets/purescript-Bf731CSj.js",revision:null},{url:"assets/purify.es-Dld0-TNF.js",revision:null},{url:"assets/python-BYCXN1fG.js",revision:null},{url:"assets/python-I5cicAGo.js",revision:null},{url:"assets/qml-CA7WJUu7.js",revision:null},{url:"assets/qmldir-CIXSNd08.js",revision:null},{url:"assets/qss-Cm8HJbD3.js",revision:null},{url:"assets/r-Ddhwej8I.js",revision:null},{url:"assets/r-DXVBc-0d.js",revision:null},{url:"assets/racket-q17mysri.js",revision:null},{url:"assets/raku-Bhpw2cnH.js",revision:null},{url:"assets/razor-CZbfBDaQ.js",revision:null},{url:"assets/red-D9ge-y6r.js",revision:null},{url:"assets/reg-B66f_NTa.js",revision:null},{url:"assets/regexp-B_5nnJWQ.js",revision:null},{url:"assets/regexp-BSO1rOx5.js",revision:null},{url:"assets/rel-7t0FBVSQ.js",revision:null},{url:"assets/resettable-CbXzRviW.js",revision:null},{url:"assets/riscv-BsLTjfEo.js",revision:null},{url:"assets/rose-pine-6db7_EjW.js",revision:null},{url:"assets/rose-pine-dawn-BAtMQyf-.js",revision:null},{url:"assets/rose-pine-moon-XKjeq-op.js",revision:null},{url:"assets/rosmsg-BK5oE9Av.js",revision:null},{url:"assets/route-block-CpjdOEnv.js",revision:null},{url:"assets/rst-C_Pj8QDw.js",revision:null},{url:"assets/ruby-BGDggo_i.js",revision:null},{url:"assets/ruby-D5-34Kc7.js",revision:null},{url:"assets/rust-DZM2L0Tt.js",revision:null},{url:"assets/sas-ClgPuXh9.js",revision:null},{url:"assets/sass-Dv9-m3z_.js",revision:null},{url:"assets/scala-CU_mRqgp.js",revision:null},{url:"assets/scene-1FHG2Mso.js",revision:null},{url:"assets/scenes-BnArCCLz.js",revision:null},{url:"assets/scheme-D6Dp4SNN.js",revision:null},{url:"assets/scss-D5x63j_P.js",revision:null},{url:"assets/scss-SahjZYbx.js",revision:null},{url:"assets/sdbl-6qSwaYs5.js",revision:null},{url:"assets/sdbl-BFRivVXs.js",revision:null},{url:"assets/settings-73vyHOZs.js",revision:null},{url:"assets/settings-DinwczH5.js",revision:null},{url:"assets/settings-HCl6bqsC.js",revision:null},{url:"assets/shaderlab-BJ9GiKkz.js",revision:null},{url:"assets/shellscript-pp2ez-I0.js",revision:null},{url:"assets/shellscript-vAa2iWrr.js",revision:null},{url:"assets/shellsession-D5QvUGYH.js",revision:null},{url:"assets/slack-dark-wQzwN0hH.js",revision:null},{url:"assets/slack-ochin-DuSyZAor.js",revision:null},{url:"assets/sleep-CkgWku9y.js",revision:null},{url:"assets/smalltalk-BwyN9gTg.js",revision:null},{url:"assets/snazzy-light-xjiGX6N3.js",revision:null},{url:"assets/solarized-dark-DzVV8Zv3.js",revision:null},{url:"assets/solarized-light-BCZkMzYV.js",revision:null},{url:"assets/solidity-kc7fmE2u.js",revision:null},{url:"assets/soy-CrDbnlG-.js",revision:null},{url:"assets/sparql-CIWSOXvP.js",revision:null},{url:"assets/speech-6W29lyZ_.js",revision:null},{url:"assets/speech-DYSGLno_.js",revision:null},{url:"assets/splunk-D53h09Fd.js",revision:null},{url:"assets/sql-CNGZv43K.js",revision:null},{url:"assets/sql-DEHoZ3CS.js",revision:null},{url:"assets/src-C83SCWbW.js",revision:null},{url:"assets/src-CO8_9JkB.css",revision:null},{url:"assets/src-DYQXbDgu.js",revision:null},{url:"assets/src-mAITpvbv.js",revision:null},{url:"assets/ssh-config-DCF77iQP.js",revision:null},{url:"assets/stage-DZQk1vzw.js",revision:null},{url:"assets/stata-D6hNc7qD.js",revision:null},{url:"assets/stream-transcription-_Xuw_VzN.js",revision:null},{url:"assets/stylus-CTQWQil7.js",revision:null},{url:"assets/stylus-elBmfiaN.js",revision:null},{url:"assets/sury-DaaR_vre-S-1HmUCu.js",revision:null},{url:"assets/svelte-CcfQZqL8.js",revision:null},{url:"assets/swift-Dacca_Jc.js",revision:null},{url:"assets/synthwave-84-D-648CXm.js",revision:null},{url:"assets/system-DxqKh5f_.js",revision:null},{url:"assets/system-verilog-BTofcmVu.js",revision:null},{url:"assets/systemd-BkAX-S6s.js",revision:null},{url:"assets/talonscript-BNTQ6DWE.js",revision:null},{url:"assets/tasl-f-WWXNqB.js",revision:null},{url:"assets/tcl-BOKvqrKS.js",revision:null},{url:"assets/templ-BWumpO_4.js",revision:null},{url:"assets/terraform-Dagbz1ye.js",revision:null},{url:"assets/tex-BPt6iNUT.js",revision:null},{url:"assets/tex-C_wmpywk.js",revision:null},{url:"assets/theme-color-CCXuu6C1.js",revision:null},{url:"assets/tokyo-night-jXjrDZFD.js",revision:null},{url:"assets/toml-DJntSiET.js",revision:null},{url:"assets/transformers.web-DAjDoeaJ.js",revision:null},{url:"assets/tres-Bk8ucvrj.js",revision:null},{url:"assets/ts-tags-BAPF9r3N.js",revision:null},{url:"assets/tsv-XF2da-CK.js",revision:null},{url:"assets/tsx-CNS5Dh9u.js",revision:null},{url:"assets/tsx-DMd3gS0e.js",revision:null},{url:"assets/turtle-Bl_4e10u.js",revision:null},{url:"assets/turtle-DhkuLyiH.js",revision:null},{url:"assets/twig-Db3qd8yh.js",revision:null},{url:"assets/typescript-DWWSNqcd.js",revision:null},{url:"assets/typescript-U0J5IFfI.js",revision:null},{url:"assets/typespec-DekmLJ8h.js",revision:null},{url:"assets/typst-Bd_YFLaH.js",revision:null},{url:"assets/use-magic-keys-NMOzQ56z.js",revision:null},{url:"assets/use-provider-validation-DbXr83wX.js",revision:null},{url:"assets/use-ripple-grid-state-DcESPJAf.js",revision:null},{url:"assets/v-DhC4I5cZ.js",revision:null},{url:"assets/vala-BddkFOhf.js",revision:null},{url:"assets/valibot-iYGh1vpl-By45phQb.js",revision:null},{url:"assets/vb-CaZky7a-.js",revision:null},{url:"assets/verilog-Cj7CaRZg.js",revision:null},{url:"assets/vesper-BUFuXQSQ.js",revision:null},{url:"assets/vhdl-BtxO3ezd.js",revision:null},{url:"assets/vibrant-DaA7KX3v.js",revision:null},{url:"assets/viml-BUE_2zAk.js",revision:null},{url:"assets/vision-CkbueePt.js",revision:null},{url:"assets/vitesse-black-CF9uDtDi.js",revision:null},{url:"assets/vitesse-dark-CP9lMcan.js",revision:null},{url:"assets/vitesse-light-C8jSamq3.js",revision:null},{url:"assets/volcengine-3lrl6sUc.js",revision:null},{url:"assets/vue-BGjJvQz8.js",revision:null},{url:"assets/vue-CTSsf9M1.js",revision:null},{url:"assets/vue-html-HA0p16KG.js",revision:null},{url:"assets/vue-i18n.runtime-Dah5zGm4.js",revision:null},{url:"assets/vue-router-Chhv6vZu.js",revision:null},{url:"assets/vue-vine-CBJbFliW.js",revision:null},{url:"assets/vue.runtime.esm-bundler-_ZPRHVd_.js",revision:null},{url:"assets/vyper-BInCbDzV.js",revision:null},{url:"assets/wasm-CKx2Vz69.js",revision:null},{url:"assets/wasm-Hu82aUW2.js",revision:null},{url:"assets/webgpu-C-1YCssS.js",revision:null},{url:"assets/wenyan-Cy1jg-XS.js",revision:null},{url:"assets/wgsl-D17iwfua.js",revision:null},{url:"assets/widgets-C0YByt49.js",revision:null},{url:"assets/widgets-CeetJ7Oc.css",revision:null},{url:"assets/wikitext-CmDv8s3f.js",revision:null},{url:"assets/wit-xzAe2GYp.js",revision:null},{url:"assets/wolfram-DCJUMk03.js",revision:null},{url:"assets/worklet-D3oCvJ3_.js",revision:null},{url:"assets/x-DOlEMeNX.js",revision:null},{url:"assets/xml-CHddl9DN.js",revision:null},{url:"assets/xml-CLaxgXK0.js",revision:null},{url:"assets/xsl-DcWTn_FV.js",revision:null},{url:"assets/yaml-Cx7z1uMB.js",revision:null},{url:"assets/yaml-DnYR2pUT.js",revision:null},{url:"assets/zenscript-Chle_NUB.js",revision:null},{url:"assets/zig-qt-oQSr9.js",revision:null},{url:"assets/zod-D6g6461c-DxjQm07h.js",revision:null},{url:"index.html",revision:"268c5e2458d79f20995e86d5eeca00af"},{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\//]}))});