diff --git a/assets/Basic.vue_vue_type_script_setup_true_lang-DiEujAxb.js b/assets/Basic.vue_vue_type_script_setup_true_lang-DiEujAxb.js new file mode 100644 index 0000000000000000000000000000000000000000..276f55b81ac9b5e8322ee56008700fa54e3a993d --- /dev/null +++ b/assets/Basic.vue_vue_type_script_setup_true_lang-DiEujAxb.js @@ -0,0 +1 @@ +import{d,m as c,u as f,r as s,v,x as p,y as x,o as y,c as h,z as _}from"./index-BNq7Hbz_.js";const w=d({__name:"Basic",props:{modelValue:{default:""},modelModifiers:{}},emits:c(["submit"],["update:modelValue"]),setup(n,{emit:u}){const r=u,e=f(n,"modelValue"),a=s(),o=s("auto");function i(t){t.code==="Enter"&&!t.shiftKey&&(t.preventDefault(),r("submit",e.value))}return v(e,()=>{o.value="auto",requestAnimationFrame(()=>{a.value&&(o.value=`${a.value.scrollHeight}px`)})},{immediate:!0}),(t,l)=>p((y(),h("textarea",{ref_key:"textareaRef",ref:a,"onUpdate:modelValue":l[0]||(l[0]=m=>e.value=m),style:_({height:o.value}),onKeydown:i},null,36)),[[x,e.value]])}});export{w as _}; diff --git a/assets/Basic.vue_vue_type_script_setup_true_lang-Sei3qL1b.js b/assets/Basic.vue_vue_type_script_setup_true_lang-Sei3qL1b.js deleted file mode 100644 index bc90c83472f95d77bf34ef6803360dae5966ae68..0000000000000000000000000000000000000000 --- a/assets/Basic.vue_vue_type_script_setup_true_lang-Sei3qL1b.js +++ /dev/null @@ -1 +0,0 @@ -import{d,bK as c,bL as f,r as s,w as p,G as v,bH as x,o as h,c as y,q as _}from"./index-D3pfQUMu.js";const w=d({__name:"Basic",props:{modelValue:{default:""},modelModifiers:{}},emits:c(["submit"],["update:modelValue"]),setup(n,{emit:r}){const u=r,e=f(n,"modelValue"),a=s(),o=s("auto");function i(t){t.code==="Enter"&&!t.shiftKey&&(t.preventDefault(),u("submit",e.value))}return p(e,()=>{o.value="auto",requestAnimationFrame(()=>{a.value&&(o.value=`${a.value.scrollHeight}px`)})},{immediate:!0}),(t,l)=>v((h(),y("textarea",{ref_key:"textareaRef",ref:a,"onUpdate:modelValue":l[0]||(l[0]=m=>e.value=m),style:_({height:o.value}),onKeydown:i},null,36)),[[x,e.value]])}});export{w as _}; diff --git a/assets/CardDetailDialog-mu8EzJmZ.js b/assets/CardDetailDialog-mu8EzJmZ.js deleted file mode 100644 index e87956c8dc1aadfb16cd6053e35468cfd1efbea8..0000000000000000000000000000000000000000 --- a/assets/CardDetailDialog-mu8EzJmZ.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as o}from"./CardDetailDialog.vue_vue_type_script_setup_true_lang-S8wNk2oU.js";import"./DeleteCardDialog.vue_vue_type_script_setup_true_lang-CCouu6-u.js";import"./index-D3pfQUMu.js";import"./index-BZFiQ_k-.js";import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-t8bgqiA6.js";import"./three-vrm-animation.module-DLbUhddZ.js";import"./airi-card-vOKXd5VS.js";import"./emotions-CAex_2dA.js";import"./consciousness-DynZMlUo.js";import"./providers-CCvie00Z.js";import"./index-LHmcipjy.js";import"./speech-CIOuIakE.js";/* empty css */export{o as default}; diff --git a/assets/CardDetailDialog-qMNZyDHS.js b/assets/CardDetailDialog-qMNZyDHS.js new file mode 100644 index 0000000000000000000000000000000000000000..fa14223666aaa62122fc53ef81561e49dc2dfa0c --- /dev/null +++ b/assets/CardDetailDialog-qMNZyDHS.js @@ -0,0 +1 @@ +import{_ as o}from"./CardDetailDialog.vue_vue_type_script_setup_true_lang-DgSekOLF.js";import"./DeleteCardDialog.vue_vue_type_script_setup_true_lang-C2ofomcy.js";import"./index-BNq7Hbz_.js";import"./index-Df6I5b4c.js";import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-B6whjTNv.js";import"./three-vrm-animation.module-BPuMi1if.js";import"./mcp-D2taTyhO.js";import"./airi-card-BqbOXX1s.js";import"./mini_xsschema-P_8cZcRg.js";import"./consciousness-BV44f_Xl.js";import"./providers-Ddg6LLwH.js";import"./index-LHmcipjy.js";import"./speech-CKvssz06.js";/* empty css */export{o as default}; diff --git a/assets/CardDetailDialog.vue_vue_type_script_setup_true_lang-DgSekOLF.js b/assets/CardDetailDialog.vue_vue_type_script_setup_true_lang-DgSekOLF.js new file mode 100644 index 0000000000000000000000000000000000000000..b1b09203fbac9cd0526d8c094dc5ac14f8badc0b --- /dev/null +++ b/assets/CardDetailDialog.vue_vue_type_script_setup_true_lang-DgSekOLF.js @@ -0,0 +1 @@ +import{_ as O,a as E}from"./DeleteCardDialog.vue_vue_type_script_setup_true_lang-C2ofomcy.js";import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-B6whjTNv.js";import{d as F,g as U,s as q,h as x,r as L,c as l,o as n,F as f,i as m,b as o,w as k,e,j as v,k as u,t as i,n as $,l as D}from"./index-BNq7Hbz_.js";import"./three-vrm-animation.module-BPuMi1if.js";import"./mcp-D2taTyhO.js";import{u as R}from"./airi-card-BqbOXX1s.js";/* empty css */import"./mini_xsschema-P_8cZcRg.js";import{n as G,I as J,$ as K,P as Q,B as W}from"./index-Df6I5b4c.js";const X={key:0,class:"w-full flex flex-col gap-5"},Y={flex:"~ col","gap-3":""},Z={flex:"~ row","items-center":"","justify-between":""},ee={flex:"~ row","items-center":"","gap-2":""},te={key:0,class:"bg-primary-100 text-primary-600 dark:bg-primary-900/40 dark:text-primary-400 flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium"},ae={"mt-1":"","text-sm":"","text-neutral-500":"","dark:text-neutral-400":""},re={"font-medium":""},se={flex:"~ row","gap-2":""},oe={class:"mt-4"},le={class:"border-b border-neutral-200 dark:border-neutral-700"},ne={class:"flex justify-center -mb-px sm:justify-start space-x-1"},ie=["onClick"],de={class:"flex items-center gap-1"},ue={key:0},ce=["innerHTML"],me={key:1},ve=["innerHTML"],pe={key:2},ge={flex:"~ col","max-h-60":"","gap-4":"","overflow-auto":"","pr-1":"","sm:max-h-80":""},xe={key:0,flex:"~ col","gap-2":""},be={"text-lg":"","text-neutral-500":"","font-medium":"","dark:text-neutral-400":""},fe=["innerHTML"],he={key:3},_e={grid:"~ cols-1 sm:cols-3","gap-4":""},ke={flex:"~ col",bg:"white/60 dark:black/30","gap-1":"","rounded-lg":"","p-3":"",border:"~ neutral-200/50 dark:neutral-700/30",transition:"all duration-200",hover:"bg-white/80 dark:bg-black/40"},we={flex:"~ row","items-center":"","gap-2":"","text-sm":"","text-neutral-500":"","dark:text-neutral-400":""},ye={truncate:"","font-medium":""},Ce={flex:"~ col",bg:"white/60 dark:black/30","gap-2":"","rounded-lg":"","p-3":"",border:"~ neutral-200/50 dark:neutral-700/30",transition:"all duration-200",hover:"bg-white/80 dark:bg-black/40"},Ie={flex:"~ row","items-center":"","gap-2":"","text-sm":"","text-neutral-500":"","dark:text-neutral-400":""},Te={truncate:"","font-medium":""},Ve={flex:"~ col",bg:"white/60 dark:black/30","gap-2":"","rounded-lg":"","p-3":"",border:"~ neutral-200/50 dark:neutral-700/30",transition:"all duration-200",hover:"bg-white/80 dark:bg-black/40"},He={flex:"~ row","items-center":"","gap-2":"","text-sm":"","text-neutral-500":"","dark:text-neutral-400":""},Le={truncate:"","font-medium":""},$e={key:1,bg:"neutral-50/50 dark:neutral-900/50","rounded-xl":"","p-8":"","text-center":"",border:"~ neutral-200/50 dark:neutral-700/30",shadow:"sm"},Oe=F({__name:"CardDetailDialog",props:{modelValue:{type:Boolean},cardId:null},emits:["update:modelValue"],setup(j,{emit:A}){const b=j,B=A,{t:d}=U(),w=R(),{removeCard:N}=w,{activeCardId:M}=q(w),a=x(()=>{if(b.cardId)return w.getCard(b.cardId)}),y=x(()=>{var t,c,r,g,S;if(!a.value||!((c=(t=a.value.extensions)==null?void 0:t.airi)!=null&&c.modules))return{consciousness:"",speech:"",voice:""};const s=a.value.extensions.airi.modules;return{consciousness:((r=s.consciousness)==null?void 0:r.model)||"",speech:((g=s.speech)==null?void 0:g.model)||"",voice:((S=s.speech)==null?void 0:S.voice_id)||""}}),C=x(()=>a.value?{personality:a.value.personality,scenario:a.value.scenario,systemPrompt:a.value.systemPrompt,postHistoryInstructions:a.value.postHistoryInstructions}:{}),h=x(()=>b.cardId===M.value),I=L(!1);function P(){I.value=!0,setTimeout(()=>{M.value=b.cardId,I.value=!1},300)}function T(s){return s==null?void 0:s.replace(/\{\{(.*?)\}\}/g,'{{ $1 }}').trim()}const _=L(!1);function z(){a.value&&(N(b.cardId),B("update:modelValue",!1)),_.value=!1}const V=L(""),H=x(()=>{var t,c;const s=[];return(t=a.value)!=null&&t.description&&s.push({id:"description",label:d("settings.pages.card.description_label"),icon:"i-solar:document-text-linear"}),(c=a.value)!=null&&c.notes&&s.push({id:"notes",label:d("settings.pages.card.creator_notes"),icon:"i-solar:notes-linear"}),Object.values(C.value).some(r=>!!r)&&s.push({id:"character",label:d("settings.pages.card.character"),icon:"i-solar:user-rounded-linear"}),s.push({id:"modules",label:d("settings.pages.card.modules"),icon:"i-solar:tuning-square-linear"}),s}),p=x({get:()=>{var s;return H.value.find(t=>t.id===V.value)?V.value:((s=H.value[0])==null?void 0:s.id)||""},set:s=>{V.value=s}});return(s,t)=>{var c;return n(),l(f,null,[m(o(G),{open:j.modelValue,"onUpdate:open":t[0]||(t[0]=r=>B("update:modelValue",r))},{default:k(()=>[m(o(J),null,{default:k(()=>[m(o(K),{class:"data-[state=open]:animate-fadeIn data-[state=closed]:animate-fadeOut fixed inset-0 z-50 bg-black/50 backdrop-blur-sm"}),m(o(Q),{class:"data-[state=open]:animate-contentShow data-[state=closed]:animate-contentHide fixed left-1/2 top-1/2 z-50 m-0 max-h-[90vh] max-w-6xl w-[92vw] flex flex-col overflow-auto border border-neutral-200 rounded-xl bg-white p-5 shadow-xl 2xl:w-[60vw] lg:w-[80vw] md:w-[85vw] xl:w-[70vw] -translate-x-1/2 -translate-y-1/2 dark:border-neutral-700 dark:bg-neutral-800 sm:p-6"},{default:k(()=>[a.value?(n(),l("div",X,[e("div",Y,[e("div",Z,[e("div",null,[e("div",ee,[m(o(W),{"text-2xl":"","font-bold":"",class:"from-primary-500 to-primary-400 bg-gradient-to-r bg-clip-text text-transparent"},{default:k(()=>[u(i(a.value.name),1)]),_:1}),h.value?(n(),l("div",te,[t[3]||(t[3]=e("div",{"i-solar:check-circle-bold-duotone":"","text-xs":""},null,-1)),u(" "+i(o(d)("settings.pages.card.active_badge")),1)])):v("",!0)]),e("div",ae,[u(" v"+i(a.value.version)+" ",1),a.value.creator?(n(),l(f,{key:0},[u(" · "+i(o(d)("settings.pages.card.created_by"))+" ",1),e("span",re,i(a.value.creator),1)],64)):v("",!0)])]),e("div",se,[m(o(O),{variant:"primary",icon:h.value?"i-solar:check-circle-bold-duotone":"i-solar:play-circle-broken",label:h.value?o(d)("settings.pages.card.active"):o(d)("settings.pages.card.activate"),disabled:h.value,class:$({"animate-pulse":I.value}),onClick:P},null,8,["icon","label","disabled","class"])])]),e("div",oe,[e("div",le,[e("div",ne,[(n(!0),l(f,null,D(H.value,r=>(n(),l("button",{key:r.id,class:$(["px-4 py-2 text-sm font-medium",[p.value===r.id?"text-primary-600 dark:text-primary-400 border-b-2 border-primary-500 dark:border-primary-400":"text-neutral-500 dark:text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-300"]]),onClick:g=>p.value=r.id},[e("div",de,[e("div",{class:$(r.icon)},null,2),u(" "+i(r.label),1)])],10,ie))),128))])])]),p.value==="notes"&&a.value.notes?(n(),l("div",ue,[e("div",{bg:"white/60 dark:black/30",border:"~ neutral-200/50 dark:neutral-700/30","max-h-60":"","overflow-auto":"","whitespace-pre-line":"","rounded-lg":"","p-4":"","text-neutral-700":"","sm:max-h-80":"","dark:text-neutral-300":"",transition:"all duration-200",hover:"bg-white/80 dark:bg-black/40",innerHTML:T(a.value.notes)},null,8,ce)])):v("",!0),p.value==="description"&&a.value.description?(n(),l("div",me,[e("div",{bg:"white/60 dark:black/30","max-h-60":"","overflow-auto":"","whitespace-pre-line":"","rounded-lg":"","p-4":"","sm:max-h-80":"",text:"neutral-600 dark:neutral-300",border:"~ neutral-200/50 dark:neutral-700/30",innerHTML:T(a.value.description)},null,8,ve)])):v("",!0),p.value==="character"&&Object.values(C.value).some(r=>!!r)?(n(),l("div",pe,[e("div",ge,[(n(!0),l(f,null,D(C.value,(r,g)=>(n(),l(f,{key:g},[r?(n(),l("div",xe,[e("h2",be,i(o(d)(`settings.pages.card.${g.toLowerCase()}`)),1),e("div",{bg:"white/60 dark:black/30",border:"~ neutral-200/50 dark:neutral-700/30",transition:"all duration-200",hover:"bg-white/80 dark:bg-black/40","max-h-none":"","overflow-auto":"","whitespace-pre-line":"","rounded-lg":"","p-3":"","text-neutral-700":"","dark:text-neutral-300":"",innerHTML:T(r)},null,8,fe)])):v("",!0)],64))),128))])])):v("",!0),p.value==="modules"?(n(),l("div",he,[e("div",_e,[e("div",ke,[e("span",we,[t[4]||(t[4]=e("div",{"i-lucide:ghost":""},null,-1)),u(" "+i(o(d)("settings.pages.card.consciousness.model")),1)]),e("div",ye,i(y.value.consciousness??"default"),1)]),e("div",Ce,[e("span",Ie,[t[5]||(t[5]=e("div",{"i-lucide:mic":""},null,-1)),u(" "+i(o(d)("settings.pages.card.speech.model")),1)]),e("div",Te,i(y.value.speech??"default"),1)]),e("div",Ve,[e("span",He,[t[6]||(t[6]=e("div",{"i-lucide:music":""},null,-1)),u(" "+i(o(d)("settings.pages.card.speech.voice")),1)]),e("div",Le,i(y.value.voice??"default"),1)])])])):v("",!0)])])):(n(),l("div",$e,[t[7]||(t[7]=e("div",{"i-solar:card-search-broken":"","mx-auto":"","mb-3":"","text-6xl":"","text-neutral-400":""},null,-1)),u(" "+i(o(d)("settings.pages.card.card_not_found")),1)]))]),_:1})]),_:1})]),_:1},8,["open"]),m(E,{modelValue:_.value,"onUpdate:modelValue":t[1]||(t[1]=r=>_.value=r),"card-name":(c=a.value)==null?void 0:c.name,onConfirm:z,onCancel:t[2]||(t[2]=r=>_.value=!1)},null,8,["modelValue","card-name"])],64)}}});export{Oe as _}; diff --git a/assets/CardDetailDialog.vue_vue_type_script_setup_true_lang-S8wNk2oU.js b/assets/CardDetailDialog.vue_vue_type_script_setup_true_lang-S8wNk2oU.js deleted file mode 100644 index 58e826a2d2411ab465894be0ade2c36a056405a2..0000000000000000000000000000000000000000 --- a/assets/CardDetailDialog.vue_vue_type_script_setup_true_lang-S8wNk2oU.js +++ /dev/null @@ -1 +0,0 @@ -import{a as E,_ as O}from"./DeleteCardDialog.vue_vue_type_script_setup_true_lang-CCouu6-u.js";import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-t8bgqiA6.js";import{d as F,k as U,s as q,l as x,r as L,c as l,o as n,bA as f,b as m,u as o,E as k,a as e,i as v,bN as u,t as i,F as $,bB as A}from"./index-D3pfQUMu.js";import"./three-vrm-animation.module-DLbUhddZ.js";import{u as R}from"./airi-card-vOKXd5VS.js";/* empty css */import"./emotions-CAex_2dA.js";import{n as G,I as J,$ as K,P as Q,B as W}from"./index-BZFiQ_k-.js";const X={key:0,class:"w-full flex flex-col gap-5"},Y={flex:"~ col","gap-3":""},Z={flex:"~ row","items-center":"","justify-between":""},ee={flex:"~ row","items-center":"","gap-2":""},te={key:0,class:"bg-primary-100 text-primary-600 dark:bg-primary-900/40 dark:text-primary-400 flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium"},ae={"mt-1":"","text-sm":"","text-neutral-500":"","dark:text-neutral-400":""},re={"font-medium":""},se={flex:"~ row","gap-2":""},oe={class:"mt-4"},le={class:"border-b border-neutral-200 dark:border-neutral-700"},ne={class:"flex justify-center -mb-px sm:justify-start space-x-1"},ie=["onClick"],de={class:"flex items-center gap-1"},ue={key:0},ce=["innerHTML"],me={key:1},ve=["innerHTML"],pe={key:2},ge={flex:"~ col","max-h-60":"","gap-4":"","overflow-auto":"","pr-1":"","sm:max-h-80":""},xe={key:0,flex:"~ col","gap-2":""},be={"text-lg":"","text-neutral-500":"","font-medium":"","dark:text-neutral-400":""},fe=["innerHTML"],he={key:3},_e={grid:"~ cols-1 sm:cols-3","gap-4":""},ke={flex:"~ col",bg:"white/60 dark:black/30","gap-1":"","rounded-lg":"","p-3":"",border:"~ neutral-200/50 dark:neutral-700/30",transition:"all duration-200",hover:"bg-white/80 dark:bg-black/40"},we={flex:"~ row","items-center":"","gap-2":"","text-sm":"","text-neutral-500":"","dark:text-neutral-400":""},ye={truncate:"","font-medium":""},Ce={flex:"~ col",bg:"white/60 dark:black/30","gap-2":"","rounded-lg":"","p-3":"",border:"~ neutral-200/50 dark:neutral-700/30",transition:"all duration-200",hover:"bg-white/80 dark:bg-black/40"},Ie={flex:"~ row","items-center":"","gap-2":"","text-sm":"","text-neutral-500":"","dark:text-neutral-400":""},Te={truncate:"","font-medium":""},Ve={flex:"~ col",bg:"white/60 dark:black/30","gap-2":"","rounded-lg":"","p-3":"",border:"~ neutral-200/50 dark:neutral-700/30",transition:"all duration-200",hover:"bg-white/80 dark:bg-black/40"},He={flex:"~ row","items-center":"","gap-2":"","text-sm":"","text-neutral-500":"","dark:text-neutral-400":""},Le={truncate:"","font-medium":""},$e={key:1,bg:"neutral-50/50 dark:neutral-900/50","rounded-xl":"","p-8":"","text-center":"",border:"~ neutral-200/50 dark:neutral-700/30",shadow:"sm"},ze=F({__name:"CardDetailDialog",props:{modelValue:{type:Boolean},cardId:null},emits:["update:modelValue"],setup(B,{emit:D}){const b=B,M=D,{t:d}=U(),w=R(),{removeCard:N}=w,{activeCardId:S}=q(w),a=x(()=>{if(b.cardId)return w.getCard(b.cardId)}),y=x(()=>{var t,c,r,g,j;if(!a.value||!((c=(t=a.value.extensions)==null?void 0:t.airi)!=null&&c.modules))return{consciousness:"",speech:"",voice:""};const s=a.value.extensions.airi.modules;return{consciousness:((r=s.consciousness)==null?void 0:r.model)||"",speech:((g=s.speech)==null?void 0:g.model)||"",voice:((j=s.speech)==null?void 0:j.voice_id)||""}}),C=x(()=>a.value?{personality:a.value.personality,scenario:a.value.scenario,systemPrompt:a.value.systemPrompt,postHistoryInstructions:a.value.postHistoryInstructions}:{}),h=x(()=>b.cardId===S.value),I=L(!1);function P(){I.value=!0,setTimeout(()=>{S.value=b.cardId,I.value=!1},300)}function T(s){return s==null?void 0:s.replace(/\{\{(.*?)\}\}/g,'{{ $1 }}').trim()}const _=L(!1);function z(){a.value&&(N(b.cardId),M("update:modelValue",!1)),_.value=!1}const V=L(""),H=x(()=>{var t,c;const s=[];return(t=a.value)!=null&&t.description&&s.push({id:"description",label:d("settings.pages.card.description_label"),icon:"i-solar:document-text-linear"}),(c=a.value)!=null&&c.notes&&s.push({id:"notes",label:d("settings.pages.card.creator_notes"),icon:"i-solar:notes-linear"}),Object.values(C.value).some(r=>!!r)&&s.push({id:"character",label:d("settings.pages.card.character"),icon:"i-solar:user-rounded-linear"}),s.push({id:"modules",label:d("settings.pages.card.modules"),icon:"i-solar:tuning-square-linear"}),s}),p=x({get:()=>{var s;return H.value.find(t=>t.id===V.value)?V.value:((s=H.value[0])==null?void 0:s.id)||""},set:s=>{V.value=s}});return(s,t)=>{var c;return n(),l(f,null,[m(o(G),{open:B.modelValue,"onUpdate:open":t[0]||(t[0]=r=>M("update:modelValue",r))},{default:k(()=>[m(o(J),null,{default:k(()=>[m(o(K),{class:"data-[state=open]:animate-fadeIn data-[state=closed]:animate-fadeOut fixed inset-0 z-50 bg-black/50 backdrop-blur-sm"}),m(o(Q),{class:"data-[state=open]:animate-contentShow data-[state=closed]:animate-contentHide fixed left-1/2 top-1/2 z-50 m-0 max-h-[90vh] max-w-6xl w-[92vw] flex flex-col overflow-auto border border-neutral-200 rounded-xl bg-white p-5 shadow-xl 2xl:w-[60vw] lg:w-[80vw] md:w-[85vw] xl:w-[70vw] -translate-x-1/2 -translate-y-1/2 dark:border-neutral-700 dark:bg-neutral-800 sm:p-6"},{default:k(()=>[a.value?(n(),l("div",X,[e("div",Y,[e("div",Z,[e("div",null,[e("div",ee,[m(o(W),{"text-2xl":"","font-bold":"",class:"from-primary-500 to-primary-400 bg-gradient-to-r bg-clip-text text-transparent"},{default:k(()=>[u(i(a.value.name),1)]),_:1}),h.value?(n(),l("div",te,[t[3]||(t[3]=e("div",{"i-solar:check-circle-bold-duotone":"","text-xs":""},null,-1)),u(" "+i(o(d)("settings.pages.card.active_badge")),1)])):v("",!0)]),e("div",ae,[u(" v"+i(a.value.version)+" ",1),a.value.creator?(n(),l(f,{key:0},[u(" · "+i(o(d)("settings.pages.card.created_by"))+" ",1),e("span",re,i(a.value.creator),1)],64)):v("",!0)])]),e("div",se,[m(o(E),{variant:"primary",icon:h.value?"i-solar:check-circle-bold-duotone":"i-solar:play-circle-broken",label:h.value?o(d)("settings.pages.card.active"):o(d)("settings.pages.card.activate"),disabled:h.value,class:$({"animate-pulse":I.value}),onClick:P},null,8,["icon","label","disabled","class"])])]),e("div",oe,[e("div",le,[e("div",ne,[(n(!0),l(f,null,A(H.value,r=>(n(),l("button",{key:r.id,class:$(["px-4 py-2 text-sm font-medium",[p.value===r.id?"text-primary-600 dark:text-primary-400 border-b-2 border-primary-500 dark:border-primary-400":"text-neutral-500 dark:text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-300"]]),onClick:g=>p.value=r.id},[e("div",de,[e("div",{class:$(r.icon)},null,2),u(" "+i(r.label),1)])],10,ie))),128))])])]),p.value==="notes"&&a.value.notes?(n(),l("div",ue,[e("div",{bg:"white/60 dark:black/30",border:"~ neutral-200/50 dark:neutral-700/30","max-h-60":"","overflow-auto":"","whitespace-pre-line":"","rounded-lg":"","p-4":"","text-neutral-700":"","sm:max-h-80":"","dark:text-neutral-300":"",transition:"all duration-200",hover:"bg-white/80 dark:bg-black/40",innerHTML:T(a.value.notes)},null,8,ce)])):v("",!0),p.value==="description"&&a.value.description?(n(),l("div",me,[e("div",{bg:"white/60 dark:black/30","max-h-60":"","overflow-auto":"","whitespace-pre-line":"","rounded-lg":"","p-4":"","sm:max-h-80":"",text:"neutral-600 dark:neutral-300",border:"~ neutral-200/50 dark:neutral-700/30",innerHTML:T(a.value.description)},null,8,ve)])):v("",!0),p.value==="character"&&Object.values(C.value).some(r=>!!r)?(n(),l("div",pe,[e("div",ge,[(n(!0),l(f,null,A(C.value,(r,g)=>(n(),l(f,{key:g},[r?(n(),l("div",xe,[e("h2",be,i(o(d)(`settings.pages.card.${g.toLowerCase()}`)),1),e("div",{bg:"white/60 dark:black/30",border:"~ neutral-200/50 dark:neutral-700/30",transition:"all duration-200",hover:"bg-white/80 dark:bg-black/40","max-h-none":"","overflow-auto":"","whitespace-pre-line":"","rounded-lg":"","p-3":"","text-neutral-700":"","dark:text-neutral-300":"",innerHTML:T(r)},null,8,fe)])):v("",!0)],64))),128))])])):v("",!0),p.value==="modules"?(n(),l("div",he,[e("div",_e,[e("div",ke,[e("span",we,[t[4]||(t[4]=e("div",{"i-lucide:ghost":""},null,-1)),u(" "+i(o(d)("settings.pages.card.consciousness.model")),1)]),e("div",ye,i(y.value.consciousness??"default"),1)]),e("div",Ce,[e("span",Ie,[t[5]||(t[5]=e("div",{"i-lucide:mic":""},null,-1)),u(" "+i(o(d)("settings.pages.card.speech.model")),1)]),e("div",Te,i(y.value.speech??"default"),1)]),e("div",Ve,[e("span",He,[t[6]||(t[6]=e("div",{"i-lucide:music":""},null,-1)),u(" "+i(o(d)("settings.pages.card.speech.voice")),1)]),e("div",Le,i(y.value.voice??"default"),1)])])])):v("",!0)])])):(n(),l("div",$e,[t[7]||(t[7]=e("div",{"i-solar:card-search-broken":"","mx-auto":"","mb-3":"","text-6xl":"","text-neutral-400":""},null,-1)),u(" "+i(o(d)("settings.pages.card.card_not_found")),1)]))]),_:1})]),_:1})]),_:1},8,["open"]),m(O,{modelValue:_.value,"onUpdate:modelValue":t[1]||(t[1]=r=>_.value=r),"card-name":(c=a.value)==null?void 0:c.name,onConfirm:z,onCancel:t[2]||(t[2]=r=>_.value=!1)},null,8,["modelValue","card-name"])],64)}}});export{ze as _}; diff --git a/assets/CardListItem-CEhV1j5b.js b/assets/CardListItem-CEhV1j5b.js new file mode 100644 index 0000000000000000000000000000000000000000..93bbfbc20803b1da37a0a5b44837dae6d3302bf3 --- /dev/null +++ b/assets/CardListItem-CEhV1j5b.js @@ -0,0 +1 @@ +import{_ as o}from"./CardListItem.vue_vue_type_script_setup_true_lang-CGSvzeuN.js";import"./index-BNq7Hbz_.js";import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-B6whjTNv.js";import"./three-vrm-animation.module-BPuMi1if.js";import"./mcp-D2taTyhO.js";import"./mini_xsschema-P_8cZcRg.js";/* empty css */export{o as default}; diff --git a/assets/CardListItem-ztWYktU9.js b/assets/CardListItem-ztWYktU9.js deleted file mode 100644 index e63572fe1a4d15a32ba4fd31505e416f9216c720..0000000000000000000000000000000000000000 --- a/assets/CardListItem-ztWYktU9.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as o}from"./CardListItem.vue_vue_type_script_setup_true_lang-C0yUofWx.js";import"./index-D3pfQUMu.js";import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-t8bgqiA6.js";import"./three-vrm-animation.module-DLbUhddZ.js";import"./emotions-CAex_2dA.js";/* empty css */export{o as default}; diff --git a/assets/CardListItem.vue_vue_type_script_setup_true_lang-C0yUofWx.js b/assets/CardListItem.vue_vue_type_script_setup_true_lang-C0yUofWx.js deleted file mode 100644 index 35c7d68368891a17aba6deec1493e491c6ccde90..0000000000000000000000000000000000000000 --- a/assets/CardListItem.vue_vue_type_script_setup_true_lang-C0yUofWx.js +++ /dev/null @@ -1 +0,0 @@ -import{d as M,r as s,f as F,c as p,o as d,B as R,q,bq as E,m as H,E as I,a as t,i as v,t as l,bO as k,F as h,u as N}from"./index-D3pfQUMu.js";import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-t8bgqiA6.js";import"./three-vrm-animation.module-DLbUhddZ.js";import"./emotions-CAex_2dA.js";/* empty css */const O=M({__name:"CursorFloating",props:{intensity:{default:1.5}},setup(r){const n=r,o=s(null),a=s(""),e=s("50% 50%"),i=s("50% 50%"),y=s(.5);function w(c){if(!o.value)return;const u=o.value,b=u.getBoundingClientRect(),_=c.clientX-b.left,C=c.clientY-b.top,B=u.offsetWidth,z=u.offsetHeight,f=Math.abs(Math.floor(100/B*_)-100),m=Math.abs(Math.floor(100/z*C)-100),x=50+(f-50)/1.5,g=50+(m-50)/1.5,P=50+(f-50)/7,S=50+(m-50)/7,X=(x-50)/1.5*.2*n.intensity,Y=(g-50)/2*-1*.2*n.intensity,A=50-f+(50-m),j=.5+Math.abs(A)*.008*n.intensity;a.value=`perspective(1200px) rotateX(${Y}deg) rotateY(${X}deg) scale3d(${1+.015*n.intensity}, ${1+.015*n.intensity}, ${1+.015*n.intensity})`,e.value=`${x}% ${g}%`,i.value=`${P}% ${S}%`,y.value=j}function $(){a.value="perspective(1200px) rotateX(0deg) rotateY(0deg) scale3d(1, 1, 1)",e.value="50% 50%",i.value="50% 50%",y.value=.5}return F(()=>{a.value="perspective(1200px) rotateX(0deg) rotateY(0deg) scale3d(1, 1, 1)"}),(c,u)=>(d(),p("div",{ref_key:"cardRef",ref:o,class:"card-hover-effect",style:q({transform:a.value,"--effect-intensity":r.intensity}),onMousemove:w,onMouseleave:$},[R(c.$slots,"default",{},void 0,!0)],36))}}),V=E(O,[["__scopeId","data-v-895421da"]]),W={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"},D={"z-1":"",flex:"","items-start":"","justify-between":"","gap-2":""},L={"flex-1":"",truncate:"","text-lg":"","font-bold":""},G={key:0,"shrink-0":"","rounded-md":"","p-1":"",bg:"primary-100 dark:primary-900/40",text:"primary-600 dark:primary-400"},J={key:0,"line-clamp-3":"","min-h-40px":"","flex-1":"","text-sm":"",text:"neutral-500 dark:neutral-400"},K={"z-1":"",flex:"","items-center":"","justify-between":"","text-xs":"",text:"neutral-500 dark:neutral-400"},Q={flex:"","items-center":"","gap-1.5":""},T={flex:"","items-center":"","gap-0.5":""},U={flex:"","items-center":"","gap-0.5":""},Z={flex:"","items-center":"","justify-end":"","px-2":"","py-1.5":""},ee=["disabled"],ie=M({__name:"CardListItem",props:{id:null,name:null,description:null,isActive:{type:Boolean},isSelected:{type:Boolean},version:null,consciousnessModel:null,voiceModel:null},emits:["select","activate","delete"],setup(r,{emit:n}){const o=n;return(a,e)=>(d(),H(N(V),{relative:"","min-h-120px":"",flex:"~ col","cursor-pointer":"","overflow-hidden":"","rounded-xl":"",class:h([r.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:w-50% 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:e[2]||(e[2]=i=>o("select"))},{default:I(()=>[t("div",W,[t("div",D,[t("h3",L,l(r.name),1),r.isActive?(d(),p("div",G,e[3]||(e[3]=[t("div",{"i-solar:check-circle-bold-duotone":"","text-sm":""},null,-1)]))):v("",!0)]),r.description?(d(),p("p",J,l(r.description),1)):v("",!0),t("div",K,[t("div",null,"v"+l(r.version),1),t("div",Q,[t("div",T,[e[4]||(e[4]=t("div",{"i-lucide:ghost":"","text-xs":""},null,-1)),t("span",null,l(r.consciousnessModel),1)]),t("div",U,[e[5]||(e[5]=t("div",{"i-lucide:mic":"","text-xs":""},null,-1)),t("span",null,l(r.voiceModel),1)])])])]),t("div",Z,[t("button",{"rounded-lg":"","p-1.5":"","transition-colors":"",hover:"bg-neutral-200 dark:bg-neutral-700/50",disabled:r.isActive,onClick:e[0]||(e[0]=k(i=>o("activate"),["stop"]))},[t("div",{class:h([r.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,ee),r.id!=="default"?(d(),p("button",{key:0,"rounded-lg":"","p-1.5":"","transition-colors":"",hover:"bg-neutral-200 dark:bg-neutral-700/50",onClick:e[1]||(e[1]=k(i=>o("delete"),["stop"]))},e[6]||(e[6]=[t("div",{"i-solar:trash-bin-trash-linear":"",text:"neutral-500 dark:neutral-400"},null,-1)]))):v("",!0)])]),_:1},8,["class"]))}});export{ie as _}; diff --git a/assets/CardListItem.vue_vue_type_script_setup_true_lang-CGSvzeuN.js b/assets/CardListItem.vue_vue_type_script_setup_true_lang-CGSvzeuN.js new file mode 100644 index 0000000000000000000000000000000000000000..59a07157f87fc0d624e529fd068955dbd400fab6 --- /dev/null +++ b/assets/CardListItem.vue_vue_type_script_setup_true_lang-CGSvzeuN.js @@ -0,0 +1 @@ +import{d as w,r as s,H,c as p,o as d,f as R,z as F,_ as I,A as N,w as V,e as t,j as v,t as l,Y as k,n as h,b as W}from"./index-BNq7Hbz_.js";import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-B6whjTNv.js";import"./three-vrm-animation.module-BPuMi1if.js";import"./mcp-D2taTyhO.js";import"./mini_xsschema-P_8cZcRg.js";/* empty css */const D=w({__name:"CursorFloating",props:{intensity:{default:1.5}},setup(r){const n=r,o=s(null),a=s(""),e=s("50% 50%"),i=s("50% 50%"),y=s(.5);function M(c){if(!o.value)return;const u=o.value,b=u.getBoundingClientRect(),$=c.clientX-b.left,C=c.clientY-b.top,z=u.offsetWidth,B=u.offsetHeight,f=Math.abs(Math.floor(100/z*$)-100),m=Math.abs(Math.floor(100/B*C)-100),x=50+(f-50)/1.5,g=50+(m-50)/1.5,Y=50+(f-50)/7,A=50+(m-50)/7,P=(x-50)/1.5*.2*n.intensity,S=(g-50)/2*-1*.2*n.intensity,X=50-f+(50-m),j=.5+Math.abs(X)*.008*n.intensity;a.value=`perspective(1200px) rotateX(${S}deg) rotateY(${P}deg) scale3d(${1+.015*n.intensity}, ${1+.015*n.intensity}, ${1+.015*n.intensity})`,e.value=`${x}% ${g}%`,i.value=`${Y}% ${A}%`,y.value=j}function _(){a.value="perspective(1200px) rotateX(0deg) rotateY(0deg) scale3d(1, 1, 1)",e.value="50% 50%",i.value="50% 50%",y.value=.5}return H(()=>{a.value="perspective(1200px) rotateX(0deg) rotateY(0deg) scale3d(1, 1, 1)"}),(c,u)=>(d(),p("div",{ref_key:"cardRef",ref:o,class:"card-hover-effect",style:F({transform:a.value,"--effect-intensity":r.intensity}),onMousemove:M,onMouseleave:_},[R(c.$slots,"default",{},void 0,!0)],36))}}),E=I(D,[["__scopeId","data-v-895421da"]]),L={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"},O={"z-1":"",flex:"","items-start":"","justify-between":"","gap-2":""},q={"flex-1":"",truncate:"","text-lg":"","font-bold":""},G={key:0,"shrink-0":"","rounded-md":"","p-1":"",bg:"primary-100 dark:primary-900/40",text:"primary-600 dark:primary-400"},J={key:0,"line-clamp-3":"","min-h-40px":"","flex-1":"","text-sm":"",text:"neutral-500 dark:neutral-400"},K={"z-1":"",flex:"","items-center":"","justify-between":"","text-xs":"",text:"neutral-500 dark:neutral-400"},Q={flex:"","items-center":"","gap-1.5":""},T={flex:"","items-center":"","gap-0.5":""},U={flex:"","items-center":"","gap-0.5":""},Z={flex:"","items-center":"","justify-end":"","px-2":"","py-1.5":""},ee=["disabled"],se=w({__name:"CardListItem",props:{id:null,name:null,description:null,isActive:{type:Boolean},isSelected:{type:Boolean},version:null,consciousnessModel:null,voiceModel:null},emits:["select","activate","delete"],setup(r,{emit:n}){const o=n;return(a,e)=>(d(),N(W(E),{relative:"","min-h-120px":"",flex:"~ col","cursor-pointer":"","overflow-hidden":"","rounded-xl":"",class:h([r.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:w-50% 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:e[2]||(e[2]=i=>o("select"))},{default:V(()=>[t("div",L,[t("div",O,[t("h3",q,l(r.name),1),r.isActive?(d(),p("div",G,e[3]||(e[3]=[t("div",{"i-solar:check-circle-bold-duotone":"","text-sm":""},null,-1)]))):v("",!0)]),r.description?(d(),p("p",J,l(r.description),1)):v("",!0),t("div",K,[t("div",null,"v"+l(r.version),1),t("div",Q,[t("div",T,[e[4]||(e[4]=t("div",{"i-lucide:ghost":"","text-xs":""},null,-1)),t("span",null,l(r.consciousnessModel),1)]),t("div",U,[e[5]||(e[5]=t("div",{"i-lucide:mic":"","text-xs":""},null,-1)),t("span",null,l(r.voiceModel),1)])])])]),t("div",Z,[t("button",{"rounded-lg":"","p-1.5":"","transition-colors":"",hover:"bg-neutral-200 dark:bg-neutral-700/50",disabled:r.isActive,onClick:e[0]||(e[0]=k(i=>o("activate"),["stop"]))},[t("div",{class:h([r.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,ee),r.id!=="default"?(d(),p("button",{key:0,"rounded-lg":"","p-1.5":"","transition-colors":"",hover:"bg-neutral-200 dark:bg-neutral-700/50",onClick:e[1]||(e[1]=k(i=>o("delete"),["stop"]))},e[6]||(e[6]=[t("div",{"i-solar:trash-bin-trash-linear":"",text:"neutral-500 dark:neutral-400"},null,-1)]))):v("",!0)])]),_:1},8,["class"]))}});export{se as _}; diff --git a/assets/Collapsable.vue_vue_type_script_setup_true_lang-DDNOeGH3.js b/assets/Collapsable.vue_vue_type_script_setup_true_lang-DDNOeGH3.js deleted file mode 100644 index 3757adc667a892d5c24e81ee33f971d3f628ca98..0000000000000000000000000000000000000000 --- a/assets/Collapsable.vue_vue_type_script_setup_true_lang-DDNOeGH3.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as d}from"./TransitionVertical.vue_vue_type_script_setup_true_lang-D_DUmSTM.js";/* empty css */import{d as p,bK as m,bL as f,ai as b,c,o as v,B as r,b as V,bW as u,bX as y,u as g,E as k,i as x,bY as B,a as s,bN as C,t as i}from"./index-D3pfQUMu.js";const N={op50:""},M=p({__name:"Collapsable",props:m({default:{type:Boolean},label:null},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const t=o,e=f(o,"modelValue");b(()=>{t.default!=null&&(e.value=!!t.default)});function n(a){return e.value=a,a}return(a,l)=>(v(),c("div",null,[r(a.$slots,"trigger",u(y({visible:e.value,setVisible:n})),()=>[s("button",{sticky:"","top-0":"","z-10":"",flex:"","items-center":"","justify-between":"",px2:"",py1:"","text-sm":"","backdrop-blur-xl":"",onClick:l[0]||(l[0]=_=>e.value=!e.value)},[s("span",null,i(t.label??"Collapsable"),1),l[1]||(l[1]=C()),s("span",N,i(e.value?"▲":"▼"),1)])]),V(g(d),null,{default:k(()=>[e.value?r(a.$slots,"default",u(B({key:0},{visible:e.value,setVisible:n}))):x("",!0)]),_:3})]))}});export{M as _}; diff --git a/assets/Collapsable.vue_vue_type_script_setup_true_lang-IiDV8qQX.js b/assets/Collapsable.vue_vue_type_script_setup_true_lang-IiDV8qQX.js new file mode 100644 index 0000000000000000000000000000000000000000..cd41fe9ebb6d77686a7e0ac211627356391df6bf --- /dev/null +++ b/assets/Collapsable.vue_vue_type_script_setup_true_lang-IiDV8qQX.js @@ -0,0 +1 @@ +import{_ as d}from"./TransitionVertical.vue_vue_type_script_setup_true_lang-BlPB-gCV.js";/* empty css */import{d as p,m,u as f,B as c,c as b,o as v,f as r,i as V,C as u,D as k,b as y,w as C,j as g,E as x,e as s,k as B,t as i}from"./index-BNq7Hbz_.js";const _={op50:""},M=p({__name:"Collapsable",props:m({default:{type:Boolean},label:null},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const t=o,e=f(o,"modelValue");c(()=>{t.default!=null&&(e.value=!!t.default)});function n(l){return e.value=l,l}return(l,a)=>(v(),b("div",null,[r(l.$slots,"trigger",u(k({visible:e.value,setVisible:n})),()=>[s("button",{sticky:"","top-0":"","z-10":"",flex:"","items-center":"","justify-between":"",px2:"",py1:"","text-sm":"","backdrop-blur-xl":"",onClick:a[0]||(a[0]=w=>e.value=!e.value)},[s("span",null,i(t.label??"Collapsable"),1),a[1]||(a[1]=B()),s("span",_,i(e.value?"▲":"▼"),1)])]),V(y(d),null,{default:C(()=>[e.value?r(l.$slots,"default",u(x({key:0},{visible:e.value,setVisible:n}))):g("",!0)]),_:3})]))}});export{M as _}; diff --git a/assets/ColorPalette.vue_vue_type_script_setup_true_lang-AiOxL6bj.js b/assets/ColorPalette.vue_vue_type_script_setup_true_lang-AiOxL6bj.js new file mode 100644 index 0000000000000000000000000000000000000000..f84c6896579b9f4acc700ac3a66986ef4a02c09b --- /dev/null +++ b/assets/ColorPalette.vue_vue_type_script_setup_true_lang-AiOxL6bj.js @@ -0,0 +1 @@ +import{_ as k}from"./Collapsable.vue_vue_type_script_setup_true_lang-IiDV8qQX.js";import{d as c,A as m,o as i,w as l,e as n,n as u,f as y,k as f,t as g,G as C,c as d,j as b,F as v,l as h,i as s,b as e,z as w,P as x}from"./index-BNq7Hbz_.js";import"./mcp-D2taTyhO.js";import"./mini_xsschema-P_8cZcRg.js";import{W as S,j as $,q as z,U as B,G as E,H as F}from"./index-Df6I5b4c.js";const V=["onClick"],j={flex:"","gap-1.5":""},A=c({__name:"Section",props:{title:null,icon:null,innerClass:null,expand:{type:Boolean,default:!0}},setup(t){return(r,_)=>(i(),m(k,{default:t.expand},{trigger:l(o=>[n("button",{class:"w-full flex items-center justify-between rounded-lg px-4 py-3 outline-none transition-all duration-250 ease-in-out",bg:"neutral-100 dark:neutral-800",hover:"bg-neutral-200 dark:bg-neutral-700",onClick:a=>o.setVisible(!o.visible)},[n("div",j,[n("div",{class:u(t.icon),"size-6":""},null,2),f(" "+g(t.title),1)]),n("div",{"i-solar:alt-arrow-down-bold-duotone":"",transition:"transform duration-250",class:u({"rotate-180":o.visible})},null,2)],8,V)]),default:l(()=>[n("div",{grid:"","gap-4":"","p-4":"",class:u(t.innerClass)},[y(r.$slots,"default")],2)]),_:3},8,["default"]))}}),H={key:0,flex:"","gap-2":""},D=c({__name:"ColorPalette",props:{colors:null},setup(t){const r=C();return(_,o)=>t.colors.length?(i(),d("div",H,[(i(!0),d(v,null,h(t.colors,({hex:a,name:p})=>(i(),m(e(F),{key:a||"default"},{default:l(()=>[s(e(S),null,{default:l(()=>[s(e($),{transition:"all ease-in-out duration-250","bg-primary-500":"","size-6":"","cursor-pointer":"","rounded-full":"",style:w(a?{background:a}:{"--theme-colors-hue":e(x)}),class:u(e(r).isColorSelectedForPrimary(a)?"scale-150 mx-1":"hover:scale-110"),onClick:N=>e(r).applyPrimaryColorFrom(a)},null,8,["style","class","onClick"]),s(e(z),null,{default:l(()=>[s(e(B),{bg:"white dark:neutral-800","rounded-lg":"","px-3":"","py-1.5":"","text-sm":"","shadow-md":""},{default:l(()=>[f(g(p)+" ",1),s(e(E),{"fill-white":"","dark:fill-neutral-800":""})]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024))),128))])):b("",!0)}});export{A as _,D as a}; diff --git a/assets/ColorPalette.vue_vue_type_script_setup_true_lang-BEcLR9qj.js b/assets/ColorPalette.vue_vue_type_script_setup_true_lang-BEcLR9qj.js deleted file mode 100644 index b5066f58e632cad96fb087d9bb868926f842b2db..0000000000000000000000000000000000000000 --- a/assets/ColorPalette.vue_vue_type_script_setup_true_lang-BEcLR9qj.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as b}from"./Collapsable.vue_vue_type_script_setup_true_lang-DDNOeGH3.js";import{d as c,m,o as i,E as l,a as n,F as u,B as k,bN as f,t as g,D as y,c as d,i as C,bA as v,bB as h,b as s,u as e,q as x,bU as w}from"./index-D3pfQUMu.js";import"./emotions-CAex_2dA.js";import{W as B,j as S,q as E,U as $,G as F,H as N}from"./index-BZFiQ_k-.js";const U=["onClick"],V={flex:"","gap-1.5":""},T=c({__name:"Section",props:{title:null,icon:null,innerClass:null,expand:{type:Boolean,default:!0}},setup(t){return(r,_)=>(i(),m(b,{default:t.expand},{trigger:l(o=>[n("button",{class:"w-full flex items-center justify-between rounded-lg px-4 py-3 outline-none transition-all duration-250 ease-in-out",bg:"neutral-100 dark:neutral-800",hover:"bg-neutral-200 dark:bg-neutral-700",onClick:a=>o.setVisible(!o.visible)},[n("div",V,[n("div",{class:u(t.icon),"size-6":""},null,2),f(" "+g(t.title),1)]),n("div",{"i-solar:alt-arrow-down-bold-duotone":"",transition:"transform duration-250",class:u({"rotate-180":o.visible})},null,2)],8,U)]),default:l(()=>[n("div",{grid:"","gap-4":"","p-4":"",class:u(t.innerClass)},[k(r.$slots,"default")],2)]),_:3},8,["default"]))}}),z={key:0,flex:"","gap-2":""},A=c({__name:"ColorPalette",props:{colors:null},setup(t){const r=y();return(_,o)=>t.colors.length?(i(),d("div",z,[(i(!0),d(v,null,h(t.colors,({hex:a,name:p})=>(i(),m(e(N),{key:a||"default"},{default:l(()=>[s(e(B),null,{default:l(()=>[s(e(S),{transition:"all ease-in-out duration-250","bg-primary-500":"","size-6":"","cursor-pointer":"","rounded-full":"",style:x(a?{background:a}:{"--theme-colors-hue":e(w)}),class:u(e(r).isColorSelectedForPrimary(a)?"scale-150 mx-1":"hover:scale-110"),onClick:H=>e(r).applyPrimaryColorFrom(a)},null,8,["style","class","onClick"]),s(e(E),null,{default:l(()=>[s(e($),{bg:"white dark:neutral-800","rounded-lg":"","px-3":"","py-1.5":"","text-sm":"","shadow-md":""},{default:l(()=>[f(g(p)+" ",1),s(e(F),{"fill-white":"","dark:fill-neutral-800":""})]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024))),128))])):C("",!0)}});export{T as _,A as a}; diff --git a/assets/DeleteCardDialog-BBI3VAtl.js b/assets/DeleteCardDialog-BBI3VAtl.js new file mode 100644 index 0000000000000000000000000000000000000000..d02759cf0ca16e858ddc88bf00f4925eca255a5a --- /dev/null +++ b/assets/DeleteCardDialog-BBI3VAtl.js @@ -0,0 +1 @@ +import{a as m}from"./DeleteCardDialog.vue_vue_type_script_setup_true_lang-C2ofomcy.js";import"./index-BNq7Hbz_.js";import"./index-Df6I5b4c.js";export{m as default}; diff --git a/assets/DeleteCardDialog-BWC1TUJo.js b/assets/DeleteCardDialog-BWC1TUJo.js deleted file mode 100644 index 47402065e7c5a6befd26b9e29a9954353db80bf4..0000000000000000000000000000000000000000 --- a/assets/DeleteCardDialog-BWC1TUJo.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as o}from"./DeleteCardDialog.vue_vue_type_script_setup_true_lang-CCouu6-u.js";import"./index-D3pfQUMu.js";import"./index-BZFiQ_k-.js";export{o as default}; diff --git a/assets/DeleteCardDialog.vue_vue_type_script_setup_true_lang-C2ofomcy.js b/assets/DeleteCardDialog.vue_vue_type_script_setup_true_lang-C2ofomcy.js new file mode 100644 index 0000000000000000000000000000000000000000..3befef2f4d0c39ca66829cc5c6eca08aea10d4a0 --- /dev/null +++ b/assets/DeleteCardDialog.vue_vue_type_script_setup_true_lang-C2ofomcy.js @@ -0,0 +1 @@ +import{d as k,h as p,c as r,o as d,n as g,e as m,j as h,f as _,t as i,g as w,A as C,w as n,i as t,b as e,k as x}from"./index-BNq7Hbz_.js";import{A as V,k as B,O as N,V as z,F as D,M as j,N as A,T as O}from"./index-Df6I5b4c.js";const S=["disabled"],T={class:"flex flex-row items-center justify-center gap-2"},$={key:0,class:"i-lucide:loader-circle animate-spin"},F={key:2},y=k({__name:"Button",props:{icon:null,label:null,disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},variant:{default:"primary"},size:{default:"md"},block:{type:Boolean,default:!1}},setup(a){const s=a,l=p(()=>s.disabled||s.loading),o={primary:"bg-primary-500 hover:bg-primary-600 dark:bg-primary-400 dark:hover:bg-primary-500 text-white",secondary:"bg-neutral-100 hover:bg-neutral-200 dark:bg-neutral-600 dark:hover:bg-neutral-500 text-neutral-900 dark:text-neutral-100",danger:"bg-red-500 hover:bg-red-600 dark:bg-red-400 dark:hover:bg-red-500 text-white"},c={sm:"px-3 py-1.5 text-xs",md:"px-4 py-2 text-sm",lg:"px-6 py-3 text-base"},u=p(()=>["rounded-lg font-medium outline-none transition-all duration-200 ease-in-out","disabled:cursor-not-allowed disabled:opacity-50",s.block?"w-full":"",c[s.size],o[s.variant],{"opacity-50 cursor-not-allowed":l.value},"focus:ring-2 focus:ring-offset-2 focus:ring-offset-white dark:focus:ring-offset-neutral-900","focus:ring-primary-500/50 dark:focus:ring-primary-400/50"]);return(b,f)=>(d(),r("button",{disabled:l.value,class:g(u.value)},[m("div",T,[a.loading?(d(),r("div",$)):a.icon?(d(),r("div",{key:1,class:g(a.icon)},null,2)):h("",!0),a.label?(d(),r("span",F,i(a.label),1)):_(b.$slots,"default",{key:3})])],10,S))}}),I={class:"flex flex-row justify-end gap-3"},H=k({__name:"DeleteCardDialog",props:{modelValue:{type:Boolean},cardName:null},emits:["update:modelValue","confirm","cancel"],setup(a,{emit:s}){const l=s,{t:o}=w();function c(){l("update:modelValue",!1),l("cancel")}function u(){l("update:modelValue",!1),l("confirm")}return(b,f)=>(d(),C(e(O),{open:a.modelValue,"onUpdate:open":f[0]||(f[0]=v=>l("update:modelValue",v))},{default:n(()=>[t(e(V),null,{default:n(()=>[t(e(B),{class:"data-[state=open]:animate-fadeIn data-[state=closed]:animate-fadeOut fixed inset-0 z-50 bg-black/50"}),t(e(N),{class:"data-[state=open]:animate-contentShow data-[state=closed]:animate-contentHide fixed left-1/2 top-1/2 z-50 max-w-md w-full border border-neutral-200 rounded-xl bg-white p-6 shadow-xl -translate-x-1/2 -translate-y-1/2 dark:border-neutral-700 dark:bg-neutral-800"},{default:n(()=>[t(e(z),{class:"mb-4 text-xl font-bold"},{default:n(()=>[x(i(e(o)("settings.pages.card.delete_card")),1)]),_:1}),t(e(D),{class:"mb-6"},{default:n(()=>[x(i(e(o)("settings.pages.card.delete_confirmation"))+" ",1),m("b",null,'"'+i(a.cardName||"")+'"',1)]),_:1}),m("div",I,[t(e(j),{"as-child":""},{default:n(()=>[t(e(y),{variant:"secondary",label:e(o)("settings.pages.card.cancel"),onClick:c},null,8,["label"])]),_:1}),t(e(A),{"as-child":""},{default:n(()=>[t(e(y),{variant:"danger",label:e(o)("settings.pages.card.delete"),onClick:u},null,8,["label"])]),_:1})])]),_:1})]),_:1})]),_:1},8,["open"]))}});export{y as _,H as a}; diff --git a/assets/DeleteCardDialog.vue_vue_type_script_setup_true_lang-CCouu6-u.js b/assets/DeleteCardDialog.vue_vue_type_script_setup_true_lang-CCouu6-u.js deleted file mode 100644 index 5863e53e78864f94bfc95516b2e030c1b62502db..0000000000000000000000000000000000000000 --- a/assets/DeleteCardDialog.vue_vue_type_script_setup_true_lang-CCouu6-u.js +++ /dev/null @@ -1 +0,0 @@ -import{d as k,l as p,c as r,o as d,F as g,a as m,i as h,B as _,t as i,k as w,m as C,E as n,b as t,u as e,bN as x}from"./index-D3pfQUMu.js";import{A as V,k as B,O as N,V as z,F as D,M as F,N as O,T as S}from"./index-BZFiQ_k-.js";const T=["disabled"],$={class:"flex flex-row items-center justify-center gap-2"},j={key:0,class:"i-lucide:loader-circle animate-spin"},A={key:2},y=k({__name:"Button",props:{icon:null,label:null,disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},variant:{default:"primary"},size:{default:"md"},block:{type:Boolean,default:!1}},setup(a){const s=a,l=p(()=>s.disabled||s.loading),o={primary:"bg-primary-500 hover:bg-primary-600 dark:bg-primary-400 dark:hover:bg-primary-500 text-white",secondary:"bg-neutral-100 hover:bg-neutral-200 dark:bg-neutral-600 dark:hover:bg-neutral-500 text-neutral-900 dark:text-neutral-100",danger:"bg-red-500 hover:bg-red-600 dark:bg-red-400 dark:hover:bg-red-500 text-white"},c={sm:"px-3 py-1.5 text-xs",md:"px-4 py-2 text-sm",lg:"px-6 py-3 text-base"},u=p(()=>["rounded-lg font-medium outline-none transition-all duration-200 ease-in-out","disabled:cursor-not-allowed disabled:opacity-50",s.block?"w-full":"",c[s.size],o[s.variant],{"opacity-50 cursor-not-allowed":l.value},"focus:ring-2 focus:ring-offset-2 focus:ring-offset-white dark:focus:ring-offset-neutral-900","focus:ring-primary-500/50 dark:focus:ring-primary-400/50"]);return(b,f)=>(d(),r("button",{disabled:l.value,class:g(u.value)},[m("div",$,[a.loading?(d(),r("div",j)):a.icon?(d(),r("div",{key:1,class:g(a.icon)},null,2)):h("",!0),a.label?(d(),r("span",A,i(a.label),1)):_(b.$slots,"default",{key:3})])],10,T))}}),E={class:"flex flex-row justify-end gap-3"},H=k({__name:"DeleteCardDialog",props:{modelValue:{type:Boolean},cardName:null},emits:["update:modelValue","confirm","cancel"],setup(a,{emit:s}){const l=s,{t:o}=w();function c(){l("update:modelValue",!1),l("cancel")}function u(){l("update:modelValue",!1),l("confirm")}return(b,f)=>(d(),C(e(S),{open:a.modelValue,"onUpdate:open":f[0]||(f[0]=v=>l("update:modelValue",v))},{default:n(()=>[t(e(V),null,{default:n(()=>[t(e(B),{class:"data-[state=open]:animate-fadeIn data-[state=closed]:animate-fadeOut fixed inset-0 z-50 bg-black/50"}),t(e(N),{class:"data-[state=open]:animate-contentShow data-[state=closed]:animate-contentHide fixed left-1/2 top-1/2 z-50 max-w-md w-full border border-neutral-200 rounded-xl bg-white p-6 shadow-xl -translate-x-1/2 -translate-y-1/2 dark:border-neutral-700 dark:bg-neutral-800"},{default:n(()=>[t(e(z),{class:"mb-4 text-xl font-bold"},{default:n(()=>[x(i(e(o)("settings.pages.card.delete_card")),1)]),_:1}),t(e(D),{class:"mb-6"},{default:n(()=>[x(i(e(o)("settings.pages.card.delete_confirmation"))+" ",1),m("b",null,'"'+i(a.cardName||"")+'"',1)]),_:1}),m("div",E,[t(e(F),{"as-child":""},{default:n(()=>[t(e(y),{variant:"secondary",label:e(o)("settings.pages.card.cancel"),onClick:c},null,8,["label"])]),_:1}),t(e(O),{"as-child":""},{default:n(()=>[t(e(y),{variant:"danger",label:e(o)("settings.pages.card.delete"),onClick:u},null,8,["label"])]),_:1})])]),_:1})]),_:1})]),_:1},8,["open"]))}});export{H as _,y as a}; diff --git a/assets/FieldInput.vue_vue_type_script_setup_true_lang-Brkyubp9.js b/assets/FieldInput.vue_vue_type_script_setup_true_lang-Brkyubp9.js deleted file mode 100644 index adc284eeee78cb38add87fd1e42cff3424253256..0000000000000000000000000000000000000000 --- a/assets/FieldInput.vue_vue_type_script_setup_true_lang-Brkyubp9.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as i}from"./Input.vue_vue_type_script_setup_true_lang-B223oRg0.js";import{d as u,bK as c,bL as p,c as o,o as d,a as l,b as m,bN as _,i as x,t as n,F as f}from"./index-D3pfQUMu.js";const V={"max-w-full":""},h={flex:"~ col gap-4"},b={class:"flex items-center gap-1 text-sm font-medium"},y={key:0,class:"text-red-500"},v={class:"text-xs text-neutral-500 dark:text-neutral-400","text-nowrap":""},k=u({__name:"FieldInput",props:c({label:null,description:null,placeholder:null,required:{type:Boolean},type:null,inputClass:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,a=p(t,"modelValue");return(C,s)=>(d(),o("div",V,[l("label",h,[l("div",null,[l("div",b,[_(n(e.label)+" ",1),e.required!==!1?(d(),o("span",y,"*")):x("",!0)]),l("div",v,n(e.description),1)]),m(i,{modelValue:a.value,"onUpdate:modelValue":s[0]||(s[0]=r=>a.value=r),type:e.type,placeholder:e.placeholder,class:f(e.inputClass)},null,8,["modelValue","type","placeholder","class"])])]))}});export{k as _}; diff --git a/assets/FieldInput.vue_vue_type_script_setup_true_lang-IanARj3w.js b/assets/FieldInput.vue_vue_type_script_setup_true_lang-IanARj3w.js new file mode 100644 index 0000000000000000000000000000000000000000..ad8a446f35caa33320e891f1e3da95e69407deaf --- /dev/null +++ b/assets/FieldInput.vue_vue_type_script_setup_true_lang-IanARj3w.js @@ -0,0 +1 @@ +import{_ as u}from"./Input.vue_vue_type_script_setup_true_lang-1pgLpBi1.js";import{d as i,m as c,u as p,c as o,o as n,e as l,i as m,k as _,j as x,t as d,n as f}from"./index-BNq7Hbz_.js";const V={"max-w-full":""},h={flex:"~ col gap-4"},y={class:"flex items-center gap-1 text-sm font-medium"},v={key:0,class:"text-red-500"},k={class:"text-xs text-neutral-500 dark:text-neutral-400","text-nowrap":""},N=i({__name:"FieldInput",props:c({label:null,description:null,placeholder:null,required:{type:Boolean},type:null,inputClass:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,a=p(t,"modelValue");return(C,s)=>(n(),o("div",V,[l("label",h,[l("div",null,[l("div",y,[_(d(e.label)+" ",1),e.required!==!1?(n(),o("span",v,"*")):x("",!0)]),l("div",k,d(e.description),1)]),m(u,{modelValue:a.value,"onUpdate:modelValue":s[0]||(s[0]=r=>a.value=r),type:e.type,placeholder:e.placeholder,class:f(e.inputClass)},null,8,["modelValue","type","placeholder","class"])])]))}});export{N as _}; diff --git a/assets/FieldRange.vue_vue_type_script_setup_true_lang-IEKed7Lk.js b/assets/FieldRange.vue_vue_type_script_setup_true_lang-IEKed7Lk.js deleted file mode 100644 index e43f5d2fcd3fd55a2957e379814417b9bca95645..0000000000000000000000000000000000000000 --- a/assets/FieldRange.vue_vue_type_script_setup_true_lang-IEKed7Lk.js +++ /dev/null @@ -1 +0,0 @@ -import{d as m,c as g,o as c,q as B,B as k,bq as M,r as V,bu as E,f as P,g as T,a as f,m as b,E as _,b as $,bA as R,c5 as N,bY as w,c6 as D,c2 as S,u as d,c1 as L,cf as z,l as v,cr as q,b_ as U,cs as H,w as K,bB as G,I as Y,ct as W,i as X,cu as J,bO as Q,bL as C,bK as j,t as x,G as Z,bH as ee}from"./index-D3pfQUMu.js";import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-t8bgqiA6.js";/* empty css */const te=m({__name:"Volumed",props:{perspective:null,transform:null},setup(t){return(e,n)=>(c(),g("div",{class:"volumed",style:B({perspective:`${t.perspective}px`,transform:t.transform})},[k(e.$slots,"default",{},void 0,!0)],4))}}),ae=M(te,[["__scopeId","data-v-568551bc"]]),ne=m({__name:"CursorMomentum",props:{baseSpeed:{default:.1},friction:{default:.95},momentumFactor:{default:.005}},setup(t,{expose:e}){const n=t,o=V(1),l=V(0);let r=0;const a=E(()=>n.friction),u=E(()=>n.baseSpeed),p=E(()=>n.momentumFactor);function h(s){r||(r=s);const y=s-r;r=s,o.value=u.value+(o.value-u.value)*a.value,l.value+=o.value*y,requestAnimationFrame(h)}function i(s){const y=Math.sqrt(s.movementX**2+s.movementY**2);o.value+=y*p.value}return P(()=>{window.addEventListener("mousemove",i),requestAnimationFrame(h)}),T(()=>{window.removeEventListener("mousemove",i)}),e({momentum:o,currentValue:l}),(s,y)=>k(s.$slots,"default",{momentum:o.value,currentValue:l.value})}}),le=m({__name:"TestDummyMarkerFlat",props:{size:null},setup(t){return(e,n)=>(c(),g("div",{class:"test-dummy-flat",style:B({width:`${t.size}px`,height:`${t.size}px`})},n[0]||(n[0]=[f("div",{class:"marker"},null,-1)]),4))}}),oe=M(le,[["__scopeId","data-v-b4ef37ac"]]),Re=m({__name:"TestDummyMarker",setup(t){return(e,n)=>(c(),b(ne,{"base-speed":.1,friction:.95,"momentum-factor":5e-4},{default:_(({currentValue:o})=>[$(ae,{perspective:800,transform:"rotateX(45deg) translateY(3px)"},{default:_(()=>[$(oe,{size:24,style:B({transform:`rotate(${o}deg)`})},null,8,["style"])]),_:2},1024)]),_:1}))}});function I(t){return t?t.flatMap(e=>e.type===R?I(e.children):[e]):[]}const re=m({name:"PrimitiveSlot",inheritAttrs:!1,setup(t,{attrs:e,slots:n}){return()=>{var p,h;if(!n.default)return null;const o=I(n.default()),l=o.findIndex(i=>i.type!==N);if(l===-1)return o;const r=o[l];(p=r.props)==null||delete p.ref;const a=r.props?w(e,r.props):e;e.class&&((h=r.props)!=null&&h.class)&&delete r.props.class;const u=D(r,a);for(const i in a)i.startsWith("on")&&(u.props||(u.props={}),u.props[i]=a[i]);return o.length===1?u:(o[l]=u,o)}}}),se=["area","img","input"],A=m({name:"Primitive",inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:"div"}},setup(t,{attrs:e,slots:n}){const o=t.asChild?"template":t.as;return typeof o=="string"&&se.includes(o)?()=>S(o,e):o!=="template"?()=>S(t.as,e,{default:n.default}):()=>S(re,e,{default:n.default})}}),ue=m({__name:"VisuallyHidden",props:{feature:{default:"focusable"},asChild:{type:Boolean},as:{default:"span"}},setup(t){return(e,n)=>(c(),b(d(A),{as:e.as,"as-child":e.asChild,"aria-hidden":e.feature==="focusable"?"true":void 0,"data-hidden":e.feature==="fully-hidden"?"":void 0,tabindex:e.feature==="fully-hidden"?"-1":void 0,style:{position:"absolute",border:0,width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",whiteSpace:"nowrap",wordWrap:"normal"}},{default:_(()=>[k(e.$slots,"default")]),_:3},8,["as","as-child","aria-hidden","data-hidden","tabindex"]))}});function ie(t,e){const n=`${t}Context`,o=Symbol(n);return[a=>{const u=L(o,a);if(u||u===null)return u;throw new Error(`Injection \`${o.toString()}\` not found. Component must be used within ${Array.isArray(t)?`one of the following components: ${t.join(", ")}`:`\`${t}\``}`)},a=>(z(o,a),a)]}function O(){const t=U(),e=V(),n=v(()=>{var a,u;return["#text","#comment"].includes((a=e.value)==null?void 0:a.$el.nodeName)?(u=e.value)==null?void 0:u.$el.nextElementSibling:q(e)}),o=Object.assign({},t.exposed),l={};for(const a in t.props)Object.defineProperty(l,a,{enumerable:!0,configurable:!0,get:()=>t.props[a]});if(Object.keys(o).length>0)for(const a in o)Object.defineProperty(l,a,{enumerable:!0,configurable:!0,get:()=>o[a]});Object.defineProperty(l,"$el",{enumerable:!0,configurable:!0,get:()=>t.vnode.el}),t.exposed=l;function r(a){e.value=a,a&&(Object.defineProperty(l,"$el",{enumerable:!0,configurable:!0,get:()=>a instanceof Element?a:a.$el}),t.exposed=l)}return{forwardRef:r,currentRef:e,currentElement:n}}function de(){const t=V(),e=v(()=>{var n,o;return["#text","#comment"].includes((n=t.value)==null?void 0:n.$el.nodeName)?(o=t.value)==null?void 0:o.$el.nextElementSibling:q(t)});return{primitiveElement:t,currentElement:e}}function ce(t){return v(()=>{var e;return H(t)?!!((e=q(t))!=null&&e.closest("form")):!0})}const F=m({inheritAttrs:!1,__name:"VisuallyHiddenInputBubble",props:{name:{},value:{},checked:{type:Boolean,default:void 0},required:{type:Boolean},disabled:{type:Boolean},feature:{default:"fully-hidden"}},setup(t){const e=t,{primitiveElement:n,currentElement:o}=de(),l=v(()=>e.checked??e.value);return K(l,(r,a)=>{if(!o.value)return;const u=o.value,p=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(p,"value").set;if(i&&r!==a){const s=new Event("input",{bubbles:!0}),y=new Event("change",{bubbles:!0});i.call(u,r),u.dispatchEvent(s),u.dispatchEvent(y)}}),(r,a)=>(c(),b(ue,w({ref_key:"primitiveElement",ref:n},{...e,...r.$attrs},{as:"input"}),null,16))}}),me=m({inheritAttrs:!1,__name:"VisuallyHiddenInput",props:{name:{},value:{},checked:{type:Boolean,default:void 0},required:{type:Boolean},disabled:{type:Boolean},feature:{default:"fully-hidden"}},setup(t){const e=t,n=v(()=>typeof e.value=="object"&&Array.isArray(e.value)&&e.value.length===0&&e.required),o=v(()=>typeof e.value=="string"||typeof e.value=="number"||typeof e.value=="boolean"?[{name:e.name,value:e.value}]:typeof e.value=="object"&&Array.isArray(e.value)?e.value.flatMap((l,r)=>typeof l=="object"?Object.entries(l).map(([a,u])=>({name:`[${e.name}][${r}][${a}]`,value:u})):{name:`[${e.name}][${r}]`,value:l}):e.value!==null&&typeof e.value=="object"&&!Array.isArray(e.value)?Object.entries(e.value).map(([l,r])=>({name:`[${e.name}][${l}]`,value:r})):[]);return(l,r)=>n.value?(c(),b(F,w({key:l.name},{...e,...l.$attrs},{name:l.name,value:l.value}),null,16,["name","value"])):(c(!0),g(R,{key:1},G(o.value,a=>(c(),b(F,w({key:a.name,ref_for:!0},{...e,...l.$attrs},{name:a.name,value:a.value}),null,16,["name","value"]))),128))}}),[pe,fe]=ie("SwitchRoot"),ve=m({__name:"SwitchRoot",props:{defaultValue:{type:Boolean},modelValue:{type:[Boolean,null],default:void 0},disabled:{type:Boolean},id:{},value:{default:"on"},asChild:{type:Boolean},as:{default:"button"},name:{},required:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e,{disabled:l}=Y(n),r=W(n,"modelValue",o,{defaultValue:n.defaultValue,passive:n.modelValue===void 0});function a(){l.value||(r.value=!r.value)}const{forwardRef:u,currentElement:p}=O(),h=ce(p),i=v(()=>{var s;return n.id&&p.value?(s=document.querySelector(`[for="${n.id}"]`))==null?void 0:s.innerText:void 0});return fe({modelValue:r,toggleCheck:a,disabled:l}),(s,y)=>(c(),b(d(A),w(s.$attrs,{id:s.id,ref:d(u),role:"switch",type:s.as==="button"?"button":void 0,value:s.value,"aria-label":s.$attrs["aria-label"]||i.value,"aria-checked":d(r),"aria-required":s.required,"data-state":d(r)?"checked":"unchecked","data-disabled":d(l)?"":void 0,"as-child":s.asChild,as:s.as,disabled:d(l),onClick:a,onKeydown:J(Q(a,["prevent"]),["enter"])}),{default:_(()=>[k(s.$slots,"default",{modelValue:d(r)}),d(h)&&s.name?(c(),b(d(me),{key:0,type:"checkbox",name:s.name,disabled:d(l),required:s.required,value:s.value,checked:!!d(r)},null,8,["name","disabled","required","value","checked"])):X("",!0)]),_:3},16,["id","type","value","aria-label","aria-checked","aria-required","data-state","data-disabled","as-child","as","disabled","onKeydown"]))}}),he=m({__name:"SwitchThumb",props:{asChild:{type:Boolean},as:{default:"span"}},setup(t){const e=pe();return O(),(n,o)=>{var l;return c(),b(d(A),{"data-state":(l=d(e).modelValue)!=null&&l.value?"checked":"unchecked","data-disabled":d(e).disabled.value?"":void 0,"as-child":n.asChild,as:n.as},{default:_(()=>[k(n.$slots,"default")]),_:3},8,["data-state","data-disabled","as-child","as"])}}}),ye=m({__name:"Checkbox",props:{modelValue:{type:Boolean,required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(t){const e=C(t,"modelValue");return(n,o)=>(c(),b(d(ve),{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=l=>e.value=l),transition:"background duration-250 ease-in-out",outline:"focus-within:none",flex:"~",border:"neutral-300 dark:neutral-700 data-[state=checked]:primary-200 data-[state=unchecked]:neutral-300 focus-within:neutral-800",bg:"data-[state=checked]:primary-400 data-[state=unchecked]:neutral-300 data-[state=checked]:dark:primary-400/80 dark:data-[state=unchecked]:neutral-800",relative:"","h-7":"",w:"12.5","rounded-full":"",shadow:"sm focus-within:shadow-neutral-800 focus-within:[0_0_0_1px] "},{default:_(()=>[$(d(he),{"my-auto":"","size-6":"",flex:"","items-center":"","justify-center":"","translate-x":"0.5 data-[state=checked]:full","rounded-full":"","bg-white":"","text-xs":"","shadow-xl":"",transition:"transform duration-250 ease-in-out","will-change-transform":""})]),_:1},8,["modelValue"]))}}),be={flex:"~ col gap-4"},_e={flex:"~ row","items-center":"","gap-2":""},ge={flex:"1"},xe={class:"flex items-center gap-1 text-sm font-medium"},Ve={class:"text-xs text-neutral-500 dark:text-neutral-400"},Ie=m({__name:"FieldCheckbox",props:j({label:null,description:null},{modelValue:{type:Boolean,required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,n=C(t,"modelValue");return(o,l)=>(c(),g("label",be,[f("div",_e,[f("div",ge,[f("div",xe,x(e.label),1),f("div",Ve,x(e.description),1)]),$(ye,{modelValue:n.value,"onUpdate:modelValue":l[0]||(l[0]=r=>n.value=r)},null,8,["modelValue"])])]))}}),$e=["min","max","step"],we=m({__name:"Range",props:j({min:{default:0},max:{default:100},step:{default:1},disabled:{type:Boolean,default:!1},thumbColor:{default:"#9090906e"},trackColor:{default:"gray"},trackValueColor:{default:"red"}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,n=C(t,"modelValue"),o=v(()=>e.min*1e4),l=v(()=>e.max*1e4),r=v(()=>e.step*1e4),a=V(),u=v({get:()=>n.value*1e4,set:i=>{n.value=i/1e4,p()}});P(()=>{p()});function p(){a.value&&(a.value.style.setProperty("--value",a.value.value),a.value.style.setProperty("--min",a.value.min?a.value.min:e.min.toString()),a.value.style.setProperty("--max",a.value.max?a.value.max:e.max.toString()))}function h(i){const s=i.target;s.style.setProperty("--value",s.value)}return(i,s)=>Z((c(),g("input",{ref_key:"sliderRef",ref:a,"onUpdate:modelValue":s[0]||(s[0]=y=>u.value=y),type:"range",min:o.value,max:l.value,step:r.value,class:"slider-progress form_input-range",onInput:h},null,40,$e)),[[ee,u.value,void 0,{number:!0}]])}}),ke=M(we,[["__scopeId","data-v-d88ffd28"]]),Ce={flex:"~ col gap-4"},Ee={flex:"~ row","items-center":"","gap-2":""},Se={flex:"1"},Be={class:"flex items-center gap-1 text-sm font-medium"},Me={class:"text-xs text-neutral-500 dark:text-neutral-400"},qe={"font-mono":""},je={flex:"~ row","items-center":"","gap-2":""},Oe=m({__name:"FieldRange",props:j({min:null,max:null,step:null,label:null,description:null,formatValue:{type:Function}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,n=C(t,"modelValue");return(o,l)=>{var r;return c(),g("label",Ce,[f("div",Ee,[f("div",Se,[f("div",Be,x(t.label),1),f("div",Me,x(t.description),1)]),f("span",qe,x(((r=e.formatValue)==null?void 0:r.call(e,n.value))||n.value),1)]),f("div",je,[$(ke,{modelValue:n.value,"onUpdate:modelValue":l[0]||(l[0]=a=>n.value=a),min:t.min||0,max:t.max||1,step:t.step||.01,"w-full":""},null,8,["modelValue","min","max","step"])])])}}});export{Oe as _,Ie as a,Re as b}; diff --git a/assets/FieldRange.vue_vue_type_script_setup_true_lang-RRSKRN5w.js b/assets/FieldRange.vue_vue_type_script_setup_true_lang-RRSKRN5w.js new file mode 100644 index 0000000000000000000000000000000000000000..56efa163c746eedd0bc8f05d1484124c0b0d405a --- /dev/null +++ b/assets/FieldRange.vue_vue_type_script_setup_true_lang-RRSKRN5w.js @@ -0,0 +1 @@ +import{d as m,c as g,o as c,z as M,f as k,_ as B,r as V,aC as E,H as P,I as T,e as f,A as b,w as _,i as $,F as R,aX as N,E as w,aY as D,aU as S,b as d,aT as z,b5 as L,h as v,b7 as j,aQ as U,b8 as H,v as K,l as Y,aO as X,b9 as G,j as W,ba as Q,Y as J,u as C,m as A,t as x,x as Z,y as ee}from"./index-BNq7Hbz_.js";import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-B6whjTNv.js";/* empty css */const te=m({__name:"Volumed",props:{perspective:null,transform:null},setup(t){return(e,n)=>(c(),g("div",{class:"volumed",style:M({perspective:`${t.perspective}px`,transform:t.transform})},[k(e.$slots,"default",{},void 0,!0)],4))}}),ae=B(te,[["__scopeId","data-v-568551bc"]]),ne=m({__name:"CursorMomentum",props:{baseSpeed:{default:.1},friction:{default:.95},momentumFactor:{default:.005}},setup(t,{expose:e}){const n=t,o=V(1),l=V(0);let r=0;const a=E(()=>n.friction),u=E(()=>n.baseSpeed),p=E(()=>n.momentumFactor);function h(s){r||(r=s);const y=s-r;r=s,o.value=u.value+(o.value-u.value)*a.value,l.value+=o.value*y,requestAnimationFrame(h)}function i(s){const y=Math.sqrt(s.movementX**2+s.movementY**2);o.value+=y*p.value}return P(()=>{window.addEventListener("mousemove",i),requestAnimationFrame(h)}),T(()=>{window.removeEventListener("mousemove",i)}),e({momentum:o,currentValue:l}),(s,y)=>k(s.$slots,"default",{momentum:o.value,currentValue:l.value})}}),le=m({__name:"TestDummyMarkerFlat",props:{size:null},setup(t){return(e,n)=>(c(),g("div",{class:"test-dummy-flat",style:M({width:`${t.size}px`,height:`${t.size}px`})},n[0]||(n[0]=[f("div",{class:"marker"},null,-1)]),4))}}),oe=B(le,[["__scopeId","data-v-b4ef37ac"]]),Re=m({__name:"TestDummyMarker",setup(t){return(e,n)=>(c(),b(ne,{"base-speed":.1,friction:.95,"momentum-factor":5e-4},{default:_(({currentValue:o})=>[$(ae,{perspective:800,transform:"rotateX(45deg) translateY(3px)"},{default:_(()=>[$(oe,{size:24,style:M({transform:`rotate(${o}deg)`})},null,8,["style"])]),_:2},1024)]),_:1}))}});function I(t){return t?t.flatMap(e=>e.type===R?I(e.children):[e]):[]}const re=m({name:"PrimitiveSlot",inheritAttrs:!1,setup(t,{attrs:e,slots:n}){return()=>{var p,h;if(!n.default)return null;const o=I(n.default()),l=o.findIndex(i=>i.type!==N);if(l===-1)return o;const r=o[l];(p=r.props)==null||delete p.ref;const a=r.props?w(e,r.props):e;e.class&&((h=r.props)!=null&&h.class)&&delete r.props.class;const u=D(r,a);for(const i in a)i.startsWith("on")&&(u.props||(u.props={}),u.props[i]=a[i]);return o.length===1?u:(o[l]=u,o)}}}),se=["area","img","input"],q=m({name:"Primitive",inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:"div"}},setup(t,{attrs:e,slots:n}){const o=t.asChild?"template":t.as;return typeof o=="string"&&se.includes(o)?()=>S(o,e):o!=="template"?()=>S(t.as,e,{default:n.default}):()=>S(re,e,{default:n.default})}}),ue=m({__name:"VisuallyHidden",props:{feature:{default:"focusable"},asChild:{type:Boolean},as:{default:"span"}},setup(t){return(e,n)=>(c(),b(d(q),{as:e.as,"as-child":e.asChild,"aria-hidden":e.feature==="focusable"?"true":void 0,"data-hidden":e.feature==="fully-hidden"?"":void 0,tabindex:e.feature==="fully-hidden"?"-1":void 0,style:{position:"absolute",border:0,width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",whiteSpace:"nowrap",wordWrap:"normal"}},{default:_(()=>[k(e.$slots,"default")]),_:3},8,["as","as-child","aria-hidden","data-hidden","tabindex"]))}});function ie(t,e){const n=`${t}Context`,o=Symbol(n);return[a=>{const u=z(o,a);if(u||u===null)return u;throw new Error(`Injection \`${o.toString()}\` not found. Component must be used within ${Array.isArray(t)?`one of the following components: ${t.join(", ")}`:`\`${t}\``}`)},a=>(L(o,a),a)]}function O(){const t=U(),e=V(),n=v(()=>{var a,u;return["#text","#comment"].includes((a=e.value)==null?void 0:a.$el.nodeName)?(u=e.value)==null?void 0:u.$el.nextElementSibling:j(e)}),o=Object.assign({},t.exposed),l={};for(const a in t.props)Object.defineProperty(l,a,{enumerable:!0,configurable:!0,get:()=>t.props[a]});if(Object.keys(o).length>0)for(const a in o)Object.defineProperty(l,a,{enumerable:!0,configurable:!0,get:()=>o[a]});Object.defineProperty(l,"$el",{enumerable:!0,configurable:!0,get:()=>t.vnode.el}),t.exposed=l;function r(a){e.value=a,a&&(Object.defineProperty(l,"$el",{enumerable:!0,configurable:!0,get:()=>a instanceof Element?a:a.$el}),t.exposed=l)}return{forwardRef:r,currentRef:e,currentElement:n}}function de(){const t=V(),e=v(()=>{var n,o;return["#text","#comment"].includes((n=t.value)==null?void 0:n.$el.nodeName)?(o=t.value)==null?void 0:o.$el.nextElementSibling:j(t)});return{primitiveElement:t,currentElement:e}}function ce(t){return v(()=>{var e;return H(t)?!!((e=j(t))!=null&&e.closest("form")):!0})}const F=m({inheritAttrs:!1,__name:"VisuallyHiddenInputBubble",props:{name:{},value:{},checked:{type:Boolean,default:void 0},required:{type:Boolean},disabled:{type:Boolean},feature:{default:"fully-hidden"}},setup(t){const e=t,{primitiveElement:n,currentElement:o}=de(),l=v(()=>e.checked??e.value);return K(l,(r,a)=>{if(!o.value)return;const u=o.value,p=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(p,"value").set;if(i&&r!==a){const s=new Event("input",{bubbles:!0}),y=new Event("change",{bubbles:!0});i.call(u,r),u.dispatchEvent(s),u.dispatchEvent(y)}}),(r,a)=>(c(),b(ue,w({ref_key:"primitiveElement",ref:n},{...e,...r.$attrs},{as:"input"}),null,16))}}),me=m({inheritAttrs:!1,__name:"VisuallyHiddenInput",props:{name:{},value:{},checked:{type:Boolean,default:void 0},required:{type:Boolean},disabled:{type:Boolean},feature:{default:"fully-hidden"}},setup(t){const e=t,n=v(()=>typeof e.value=="object"&&Array.isArray(e.value)&&e.value.length===0&&e.required),o=v(()=>typeof e.value=="string"||typeof e.value=="number"||typeof e.value=="boolean"?[{name:e.name,value:e.value}]:typeof e.value=="object"&&Array.isArray(e.value)?e.value.flatMap((l,r)=>typeof l=="object"?Object.entries(l).map(([a,u])=>({name:`[${e.name}][${r}][${a}]`,value:u})):{name:`[${e.name}][${r}]`,value:l}):e.value!==null&&typeof e.value=="object"&&!Array.isArray(e.value)?Object.entries(e.value).map(([l,r])=>({name:`[${e.name}][${l}]`,value:r})):[]);return(l,r)=>n.value?(c(),b(F,w({key:l.name},{...e,...l.$attrs},{name:l.name,value:l.value}),null,16,["name","value"])):(c(!0),g(R,{key:1},Y(o.value,a=>(c(),b(F,w({key:a.name,ref_for:!0},{...e,...l.$attrs},{name:a.name,value:a.value}),null,16,["name","value"]))),128))}}),[pe,fe]=ie("SwitchRoot"),ve=m({__name:"SwitchRoot",props:{defaultValue:{type:Boolean},modelValue:{type:[Boolean,null],default:void 0},disabled:{type:Boolean},id:{},value:{default:"on"},asChild:{type:Boolean},as:{default:"button"},name:{},required:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e,{disabled:l}=X(n),r=G(n,"modelValue",o,{defaultValue:n.defaultValue,passive:n.modelValue===void 0});function a(){l.value||(r.value=!r.value)}const{forwardRef:u,currentElement:p}=O(),h=ce(p),i=v(()=>{var s;return n.id&&p.value?(s=document.querySelector(`[for="${n.id}"]`))==null?void 0:s.innerText:void 0});return fe({modelValue:r,toggleCheck:a,disabled:l}),(s,y)=>(c(),b(d(q),w(s.$attrs,{id:s.id,ref:d(u),role:"switch",type:s.as==="button"?"button":void 0,value:s.value,"aria-label":s.$attrs["aria-label"]||i.value,"aria-checked":d(r),"aria-required":s.required,"data-state":d(r)?"checked":"unchecked","data-disabled":d(l)?"":void 0,"as-child":s.asChild,as:s.as,disabled:d(l),onClick:a,onKeydown:Q(J(a,["prevent"]),["enter"])}),{default:_(()=>[k(s.$slots,"default",{modelValue:d(r)}),d(h)&&s.name?(c(),b(d(me),{key:0,type:"checkbox",name:s.name,disabled:d(l),required:s.required,value:s.value,checked:!!d(r)},null,8,["name","disabled","required","value","checked"])):W("",!0)]),_:3},16,["id","type","value","aria-label","aria-checked","aria-required","data-state","data-disabled","as-child","as","disabled","onKeydown"]))}}),he=m({__name:"SwitchThumb",props:{asChild:{type:Boolean},as:{default:"span"}},setup(t){const e=pe();return O(),(n,o)=>{var l;return c(),b(d(q),{"data-state":(l=d(e).modelValue)!=null&&l.value?"checked":"unchecked","data-disabled":d(e).disabled.value?"":void 0,"as-child":n.asChild,as:n.as},{default:_(()=>[k(n.$slots,"default")]),_:3},8,["data-state","data-disabled","as-child","as"])}}}),ye=m({__name:"Checkbox",props:{modelValue:{type:Boolean,required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(t){const e=C(t,"modelValue");return(n,o)=>(c(),b(d(ve),{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=l=>e.value=l),transition:"background duration-250 ease-in-out",outline:"focus-within:none",flex:"~",border:"neutral-300 dark:neutral-700 data-[state=checked]:primary-200 data-[state=unchecked]:neutral-300 focus-within:neutral-800",bg:"data-[state=checked]:primary-400 data-[state=unchecked]:neutral-300 data-[state=checked]:dark:primary-400/80 dark:data-[state=unchecked]:neutral-800",relative:"","h-7":"",w:"12.5","rounded-full":"",shadow:"sm focus-within:shadow-neutral-800 focus-within:[0_0_0_1px] "},{default:_(()=>[$(d(he),{"my-auto":"","size-6":"",flex:"","items-center":"","justify-center":"","translate-x":"0.5 data-[state=checked]:full","rounded-full":"","bg-white":"","text-xs":"","shadow-xl":"",transition:"transform duration-250 ease-in-out","will-change-transform":""})]),_:1},8,["modelValue"]))}}),be={flex:"~ col gap-4"},_e={flex:"~ row","items-center":"","gap-2":""},ge={flex:"1"},xe={class:"flex items-center gap-1 text-sm font-medium"},Ve={class:"text-xs text-neutral-500 dark:text-neutral-400"},Ie=m({__name:"FieldCheckbox",props:A({label:null,description:null},{modelValue:{type:Boolean,required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,n=C(t,"modelValue");return(o,l)=>(c(),g("label",be,[f("div",_e,[f("div",ge,[f("div",xe,x(e.label),1),f("div",Ve,x(e.description),1)]),$(ye,{modelValue:n.value,"onUpdate:modelValue":l[0]||(l[0]=r=>n.value=r)},null,8,["modelValue"])])]))}}),$e=["min","max","step"],we=m({__name:"Range",props:A({min:{default:0},max:{default:100},step:{default:1},disabled:{type:Boolean,default:!1},thumbColor:{default:"#9090906e"},trackColor:{default:"gray"},trackValueColor:{default:"red"}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,n=C(t,"modelValue"),o=v(()=>e.min*1e4),l=v(()=>e.max*1e4),r=v(()=>e.step*1e4),a=V(),u=v({get:()=>n.value*1e4,set:i=>{n.value=i/1e4,p()}});P(()=>{p()});function p(){a.value&&(a.value.style.setProperty("--value",a.value.value),a.value.style.setProperty("--min",a.value.min?a.value.min:e.min.toString()),a.value.style.setProperty("--max",a.value.max?a.value.max:e.max.toString()))}function h(i){const s=i.target;s.style.setProperty("--value",s.value)}return(i,s)=>Z((c(),g("input",{ref_key:"sliderRef",ref:a,"onUpdate:modelValue":s[0]||(s[0]=y=>u.value=y),type:"range",min:o.value,max:l.value,step:r.value,class:"slider-progress form_input-range",onInput:h},null,40,$e)),[[ee,u.value,void 0,{number:!0}]])}}),ke=B(we,[["__scopeId","data-v-d88ffd28"]]),Ce={flex:"~ col gap-4"},Ee={flex:"~ row","items-center":"","gap-2":""},Se={flex:"1"},Me={class:"flex items-center gap-1 text-sm font-medium"},Be={class:"text-xs text-neutral-500 dark:text-neutral-400"},je={"font-mono":""},Ae={flex:"~ row","items-center":"","gap-2":""},Oe=m({__name:"FieldRange",props:A({min:null,max:null,step:null,label:null,description:null,formatValue:{type:Function}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,n=C(t,"modelValue");return(o,l)=>{var r;return c(),g("label",Ce,[f("div",Ee,[f("div",Se,[f("div",Me,x(t.label),1),f("div",Be,x(t.description),1)]),f("span",je,x(((r=e.formatValue)==null?void 0:r.call(e,n.value))||n.value),1)]),f("div",Ae,[$(ke,{modelValue:n.value,"onUpdate:modelValue":l[0]||(l[0]=a=>n.value=a),min:t.min||0,max:t.max||1,step:t.step||.01,"w-full":""},null,8,["modelValue","min","max","step"])])])}}});export{Oe as _,Ie as a,Re as b}; diff --git a/assets/HeaderLink-SBXLiv0n.js b/assets/HeaderLink-SBXLiv0n.js deleted file mode 100644 index 42a8d30bed946e680b2881b07243ca37312c99d7..0000000000000000000000000000000000000000 --- a/assets/HeaderLink-SBXLiv0n.js +++ /dev/null @@ -1 +0,0 @@ -import{d as r,bF as c,m as l,u as e,br as d,o as s,E as _,c as t,a,bq as i}from"./index-D3pfQUMu.js";const k="/assets/logo-dark-CO0kwKsz.svg",p="/assets/logo-D6zeZTFl.svg",u=["src"],m=["src"],g=r({__name:"HeaderLink",setup(x){const n=c();return(f,o)=>(s(),l(e(d),{to:"/",flex:"~","items-center":"","gap-2":"","px-2":"","text-nowrap":"","text-2xl":"","outline-none":""},{default:_(()=>[e(n)?(s(),t("img",{key:0,src:e(k),"h-8":"","w-8":"",class:"theme-colored"},null,8,u)):(s(),t("img",{key:1,src:e(p),"h-8":"","w-8":"",class:"theme-colored"},null,8,m)),o[0]||(o[0]=a("div",{"font-cute":""},[a("span",null,"アイリ")],-1))]),_:1}))}}),w=i(g,[["__scopeId","data-v-496b6cde"]]);export{w as H}; diff --git a/assets/HeaderLink-nC9K3Z33.js b/assets/HeaderLink-nC9K3Z33.js new file mode 100644 index 0000000000000000000000000000000000000000..47c806bb25c321e403a21e4f3dd9d32972f6e00f --- /dev/null +++ b/assets/HeaderLink-nC9K3Z33.js @@ -0,0 +1 @@ +import{d as r,az as c,A as l,b as e,Q as d,o as s,w as _,c as t,e as a,_ as i}from"./index-BNq7Hbz_.js";const k="/assets/logo-dark-CO0kwKsz.svg",p="/assets/logo-D6zeZTFl.svg",u=["src"],m=["src"],g=r({__name:"HeaderLink",setup(x){const n=c();return(f,o)=>(s(),l(e(d),{to:"/",flex:"~","items-center":"","gap-2":"","px-2":"","text-nowrap":"","text-2xl":"","outline-none":""},{default:_(()=>[e(n)?(s(),t("img",{key:0,src:e(k),"h-8":"","w-8":"",class:"theme-colored"},null,8,u)):(s(),t("img",{key:1,src:e(p),"h-8":"","w-8":"",class:"theme-colored"},null,8,m)),o[0]||(o[0]=a("div",{"font-cute":""},[a("span",null,"アイリ")],-1))]),_:1}))}}),w=i(g,[["__scopeId","data-v-496b6cde"]]);export{w as H}; diff --git a/assets/IconAnimation.vue_vue_type_script_setup_true_lang-D-TDNw-F.js b/assets/IconAnimation.vue_vue_type_script_setup_true_lang-D-TDNw-F.js new file mode 100644 index 0000000000000000000000000000000000000000..602fcd9fdff4305d4f2516a72c0d1bfa7cf41839 --- /dev/null +++ b/assets/IconAnimation.vue_vue_type_script_setup_true_lang-D-TDNw-F.js @@ -0,0 +1 @@ +import{d as m,r as s,v as p,h,c as f,o as x,z as l,e as u,n as y}from"./index-BNq7Hbz_.js";const C=m({__name:"IconAnimation",props:{icon:null,iconSize:null,position:null,duration:null,started:{type:Boolean},textColor:null,isReverse:{type:Boolean},zIndex:null},emits:["animationEnded"],setup(a,{emit:d}){const e=a,c=d,n=s(!1);p(()=>e.started,o=>{o&&requestAnimationFrame(()=>{n.value=!0})});const t=h(()=>({opacity:n.value!==e.isReverse?1:0,size:n.value!==e.isReverse?25:e.iconSize,position:n.value!==e.isReverse?"calc(50dvw - 12.5rem), calc(50dvh - 12.5rem)":e.position,textColor:n.value!==e.isReverse?"text-white":e.textColor})),i=s([]),r=s(!1);function v(o){i.value.push(o.propertyName),i.value.includes("color")&&i.value.includes("width")&&i.value.includes("height")&&i.value.includes("transform")&&(r.value=!0,c("animationEnded"))}return(o,z)=>(x(),f("div",{"pointer-events-none":"",fixed:"",w:"100dvw",h:"100dvh",style:l({zIndex:r.value?a.zIndex:void 0})},[u("div",{"bg-primary-500":"",fixed:"","inset-0":"","transition-opacity":"","ease-linear":"",style:l({opacity:t.value.opacity,transitionDuration:`${a.duration}ms`})},null,4),u("div",{fixed:"","inset-0":"","ease-in-out":"",style:l({width:`${t.value.size}rem`,height:`${t.value.size}rem`,transform:`translate(${t.value.position})`,transitionDuration:`${a.duration}ms`}),class:y([t.value.textColor,e.icon,{"transition-all":n.value}]),onTransitionend:v},null,38)],4))}});export{C as _}; diff --git a/assets/IconAnimation.vue_vue_type_script_setup_true_lang-DtxQmMu9.js b/assets/IconAnimation.vue_vue_type_script_setup_true_lang-DtxQmMu9.js deleted file mode 100644 index 442c51b375c00db39da1ef719b2f67d877f3a744..0000000000000000000000000000000000000000 --- a/assets/IconAnimation.vue_vue_type_script_setup_true_lang-DtxQmMu9.js +++ /dev/null @@ -1 +0,0 @@ -import{d as m,r as s,w as p,l as f,c as h,o as x,q as l,a as u,F as y}from"./index-D3pfQUMu.js";const C=m({__name:"IconAnimation",props:{icon:null,iconSize:null,position:null,duration:null,started:{type:Boolean},textColor:null,isReverse:{type:Boolean},zIndex:null},emits:["animationEnded"],setup(a,{emit:d}){const e=a,c=d,n=s(!1);p(()=>e.started,o=>{o&&requestAnimationFrame(()=>{n.value=!0})});const t=f(()=>({opacity:n.value!==e.isReverse?1:0,size:n.value!==e.isReverse?25:e.iconSize,position:n.value!==e.isReverse?"calc(50dvw - 12.5rem), calc(50dvh - 12.5rem)":e.position,textColor:n.value!==e.isReverse?"text-white":e.textColor})),i=s([]),r=s(!1);function v(o){i.value.push(o.propertyName),i.value.includes("color")&&i.value.includes("width")&&i.value.includes("height")&&i.value.includes("transform")&&(r.value=!0,c("animationEnded"))}return(o,z)=>(x(),h("div",{"pointer-events-none":"",fixed:"",w:"100dvw",h:"100dvh",style:l({zIndex:r.value?a.zIndex:void 0})},[u("div",{"bg-primary-500":"",fixed:"","inset-0":"","transition-opacity":"","ease-linear":"",style:l({opacity:t.value.opacity,transitionDuration:`${a.duration}ms`})},null,4),u("div",{fixed:"","inset-0":"","ease-in-out":"",style:l({width:`${t.value.size}rem`,height:`${t.value.size}rem`,transform:`translate(${t.value.position})`,transitionDuration:`${a.duration}ms`}),class:y([t.value.textColor,e.icon,{"transition-all":n.value}]),onTransitionend:v},null,38)],4))}});export{C as _}; diff --git a/assets/IconStatusItem-CqRKpLO4.js b/assets/IconStatusItem-CqRKpLO4.js new file mode 100644 index 0000000000000000000000000000000000000000..6a91ad2226ba3c607a2b816b4cc3780565d29fe0 --- /dev/null +++ b/assets/IconStatusItem-CqRKpLO4.js @@ -0,0 +1 @@ +import{d as u,N as c,c as e,o as n,i as d,e as o,w as m,j as a,t as i,n as s,_}from"./index-BNq7Hbz_.js";import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-B6whjTNv.js";const p={flex:"~ col",bg:"neutral-50 dark:neutral-800",border:"neutral-100 dark:neutral-800/25 hover:primary-500/30 dark:hover:primary-400/30 solid 2","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",class:"menu-icon-status-item",transition:"all ease-in-out duration-400","w-full":"","cursor-pointer":"","of-hidden":"","rounded-xl":""},g={"z-1":"","flex-1":""},h={"text-lg":"","font-bold":"",class:"menu-icon-status-item-title",transition:"all ease-in-out duration-400"},k={text:"sm neutral-500 dark:neutral-400",class:"menu-icon-status-item-description",transition:"all ease-in-out duration-400"},f=["src"],x={"p-2":""},v={key:0,"size-3":"",bg:"green-500 dark:green-600","rounded-full":""},y={key:1,"size-3":"",bg:"neutral-400 dark:neutral-500","rounded-full":""},b=u({__name:"IconStatusItem",props:{title:null,description:null,icon:null,iconColor:null,iconImage:null,to:null,configured:{type:Boolean}},setup(r){const t=r;return(I,w)=>{const l=c("RouterLink");return n(),e("div",p,[d(l,{flex:"~ row",class:"menu-icon-status-item-link",bg:"white dark:neutral-900",transition:"all ease-in-out duration-400",relative:"","h-full":"","w-full":"","items-center":"","overflow-hidden":"","rounded-lg":"","p-5":"","text-left":"",to:t.to},{default:m(()=>[o("div",g,[o("div",h,i(t.title),1),o("div",k,[o("span",null,i(t.description),1)])]),t.icon?(n(),e("div",{key:0,class:s(["menu-icon-status-item-icon",[t.icon]]),transition:"all ease-in-out duration-400",absolute:"","right-0":"","size-16":"","translate-y-2":"",text:"neutral-400/50 dark:neutral-600/50","grayscale-100":""},null,2)):a("",!0),t.iconColor?(n(),e("div",{key:1,class:s(["menu-icon-status-item-icon-color",[t.iconColor]]),transition:"all ease-in-out duration-400",absolute:"","right-0":"","size-16":"","translate-y-2":"",text:"neutral-400/50 dark:neutral-600/50","grayscale-100":""},null,2)):a("",!0),t.iconImage?(n(),e("img",{key:2,src:t.iconImage,class:"menu-icon-status-item-icon-image",transition:"all ease-in-out duration-400",absolute:"","right-0":"","size-16":"","translate-y-2":"","grayscale-100":""},null,8,f)):a("",!0)]),_:1},8,["to"]),o("div",x,[t.configured?(n(),e("div",v)):(n(),e("div",y))])])}}}),B=_(b,[["__scopeId","data-v-6e5b5c9c"]]);export{B as I}; diff --git a/assets/IconStatusItem-Do_zSdCF.js b/assets/IconStatusItem-Do_zSdCF.js deleted file mode 100644 index f6c2f23003d2996e92d3f95187e4d1da27a6d2ab..0000000000000000000000000000000000000000 --- a/assets/IconStatusItem-Do_zSdCF.js +++ /dev/null @@ -1 +0,0 @@ -import{d as u,p as c,c as e,o as n,b as d,a as o,E as m,i as a,t as i,F as s,bq as _}from"./index-D3pfQUMu.js";import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-t8bgqiA6.js";const p={flex:"~ col",bg:"neutral-50 dark:neutral-800",border:"neutral-100 dark:neutral-800/25 hover:primary-500/30 dark:hover:primary-400/30 solid 2","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",class:"menu-icon-status-item",transition:"all ease-in-out duration-400","w-full":"","cursor-pointer":"","of-hidden":"","rounded-xl":""},g={"z-1":"","flex-1":""},h={"text-lg":"","font-bold":"",class:"menu-icon-status-item-title",transition:"all ease-in-out duration-400"},k={text:"sm neutral-500 dark:neutral-400",class:"menu-icon-status-item-description",transition:"all ease-in-out duration-400"},f=["src"],x={"p-2":""},v={key:0,"size-3":"",bg:"green-500 dark:green-600","rounded-full":""},y={key:1,"size-3":"",bg:"neutral-400 dark:neutral-500","rounded-full":""},b=u({__name:"IconStatusItem",props:{title:null,description:null,icon:null,iconColor:null,iconImage:null,to:null,configured:{type:Boolean}},setup(r){const t=r;return(I,C)=>{const l=c("RouterLink");return n(),e("div",p,[d(l,{flex:"~ row",class:"menu-icon-status-item-link",bg:"white dark:neutral-900",transition:"all ease-in-out duration-400",relative:"","h-full":"","w-full":"","items-center":"","overflow-hidden":"","rounded-lg":"","p-5":"","text-left":"",to:t.to},{default:m(()=>[o("div",g,[o("div",h,i(t.title),1),o("div",k,[o("span",null,i(t.description),1)])]),t.icon?(n(),e("div",{key:0,class:s(["menu-icon-status-item-icon",[t.icon]]),transition:"all ease-in-out duration-400",absolute:"","right-0":"","size-16":"","translate-y-2":"",text:"neutral-400/50 dark:neutral-600/50","grayscale-100":""},null,2)):a("",!0),t.iconColor?(n(),e("div",{key:1,class:s(["menu-icon-status-item-icon-color",[t.iconColor]]),transition:"all ease-in-out duration-400",absolute:"","right-0":"","size-16":"","translate-y-2":"",text:"neutral-400/50 dark:neutral-600/50","grayscale-100":""},null,2)):a("",!0),t.iconImage?(n(),e("img",{key:2,src:t.iconImage,class:"menu-icon-status-item-icon-image",transition:"all ease-in-out duration-400",absolute:"","right-0":"","size-16":"","translate-y-2":"","grayscale-100":""},null,8,f)):a("",!0)]),_:1},8,["to"]),o("div",x,[t.configured?(n(),e("div",v)):(n(),e("div",y))])])}}}),B=_(b,[["__scopeId","data-v-6e5b5c9c"]]);export{B as I}; diff --git a/assets/Input.vue_vue_type_script_setup_true_lang-1pgLpBi1.js b/assets/Input.vue_vue_type_script_setup_true_lang-1pgLpBi1.js new file mode 100644 index 0000000000000000000000000000000000000000..0d07f327c91c8500eeb9e9102990cf52a83d8b87 --- /dev/null +++ b/assets/Input.vue_vue_type_script_setup_true_lang-1pgLpBi1.js @@ -0,0 +1 @@ +import{d as r,m as n,u,x as s,J as d,o as i,c as m}from"./index-BNq7Hbz_.js";const p=["type"],x=r({__name:"Input",props:n({type:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const l=e,t=u(e,"modelValue");return(c,a)=>s((i(),m("input",{"onUpdate:modelValue":a[0]||(a[0]=o=>t.value=o),type:l.type||"text",border:"focus:primary-300 dark:focus:primary-400/50 2 solid neutral-100 dark:neutral-900",transition:"all duration-200 ease-in-out",text:"disabled:neutral-400 dark:disabled:neutral-600",cursor:"disabled:not-allowed","w-full":"","rounded-lg":"","px-2":"","py-1":"","text-nowrap":"","text-sm":"","outline-none":"",shadow:"sm",bg:"neutral-50 dark:neutral-950 focus:neutral-50 dark:focus:neutral-900"},null,8,p)),[[d,t.value]])}});export{x as _}; diff --git a/assets/Input.vue_vue_type_script_setup_true_lang-B223oRg0.js b/assets/Input.vue_vue_type_script_setup_true_lang-B223oRg0.js deleted file mode 100644 index 97b669e0244f59caaa1f5a19741ee3eab802eb2e..0000000000000000000000000000000000000000 --- a/assets/Input.vue_vue_type_script_setup_true_lang-B223oRg0.js +++ /dev/null @@ -1 +0,0 @@ -import{d as r,bK as n,bL as u,G as s,cq as d,o as i,c as p}from"./index-D3pfQUMu.js";const m=["type"],y=r({__name:"Input",props:n({type:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const l=e,t=u(e,"modelValue");return(c,a)=>s((i(),p("input",{"onUpdate:modelValue":a[0]||(a[0]=o=>t.value=o),type:l.type||"text",border:"focus:primary-300 dark:focus:primary-400/50 2 solid neutral-100 dark:neutral-900",transition:"all duration-200 ease-in-out",text:"disabled:neutral-400 dark:disabled:neutral-600",cursor:"disabled:not-allowed","w-full":"","rounded-lg":"","px-2":"","py-1":"","text-nowrap":"","text-sm":"","outline-none":"",shadow:"sm",bg:"neutral-50 dark:neutral-950 focus:neutral-50 dark:focus:neutral-900"},null,8,m)),[[d,t.value]])}});export{y as _}; diff --git a/assets/InputFile.vue_vue_type_script_setup_true_lang-BFgYfCCt.js b/assets/InputFile.vue_vue_type_script_setup_true_lang-BFgYfCCt.js deleted file mode 100644 index e26937ce18934e23c257377bb29bebdffbec4f9e..0000000000000000000000000000000000000000 --- a/assets/InputFile.vue_vue_type_script_setup_true_lang-BFgYfCCt.js +++ /dev/null @@ -1 +0,0 @@ -import{d as b,bK as g,bL as v,r as p,bM as y,c as i,o as n,F as m,u as t,a as l,B as x}from"./index-D3pfQUMu.js";const k=["accept","multiple"],h={key:0,text:"center","text-sm":""},D={key:1,text:"center","text-sm":""},B=b({__name:"InputFile",props:g({accept:null,multiple:{type:Boolean}},{modelValue:{required:!1,default:()=>[]},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const d=v(o,"modelValue"),u=p(),a=p(!1),r=y(a,150);function f(s){const e=s.target;e.files&&e.files.length>0&&(u.value=e.files[0]),d.value=Array.from(e.files||[]),a.value=!1}return(s,e)=>(n(),i("label",{relative:"",class:m(["min-h-[120px] flex flex-col cursor-pointer items-center justify-center rounded-xl p-6",[t(r)?"border-primary-400 dark:border-primary-600 hover:border-primary-300 dark:hover:border-primary-700":"border-neutral-200 dark:border-neutral-700 hover:border-primary-300 dark:hover:border-primary-700",t(r)?"bg-primary-50/5 dark:bg-primary-900/5":"bg-white/60 dark:bg-black/30 hover:bg-white/80 dark:hover:bg-black/40"]]),border:"dashed 2",transition:"all duration-300","cursor-pointer":"","opacity-95":"",hover:"scale-100 opacity-100 shadow-md dark:shadow-lg",onDragover:e[0]||(e[0]=c=>a.value=!0),onDragleave:e[1]||(e[1]=c=>a.value=!1)},[l("input",{type:"file",accept:o.accept,multiple:o.multiple,"cursor-pointer":"",class:"absolute inset-0 h-full w-full opacity-0",onChange:f},null,40,k),x(s.$slots,"default",{isDragging:t(r),firstFile:u.value,files:d.value},()=>[l("div",{class:m(["flex flex-col items-center",[t(r)?"text-primary-500 dark:text-primary-400":"text-neutral-400 dark:text-neutral-500"]])},[e[2]||(e[2]=l("div",{"i-solar:upload-square-line-duotone":"","mb-2":"","text-5xl":""},null,-1)),e[3]||(e[3]=l("p",{"font-medium":"",text:"center lg"}," Upload ",-1)),t(r)?(n(),i("p",h," Release to upload ")):(n(),i("p",D," Click or drag and drop a file here "))],2)])],34))}});export{B as _}; diff --git a/assets/InputFile.vue_vue_type_script_setup_true_lang-DHNEAW-b.js b/assets/InputFile.vue_vue_type_script_setup_true_lang-DHNEAW-b.js new file mode 100644 index 0000000000000000000000000000000000000000..525229ff4fedcda78f61ba4a82c1276b047fd266 --- /dev/null +++ b/assets/InputFile.vue_vue_type_script_setup_true_lang-DHNEAW-b.js @@ -0,0 +1 @@ +import{d as g,m as b,u as v,r as p,a as y,c as i,o as n,n as m,b as t,e as l,f as x}from"./index-BNq7Hbz_.js";const k=["accept","multiple"],h={key:0,text:"center","text-sm":""},D={key:1,text:"center","text-sm":""},C=g({__name:"InputFile",props:b({accept:null,multiple:{type:Boolean}},{modelValue:{required:!1,default:()=>[]},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const d=v(o,"modelValue"),u=p(),a=p(!1),r=y(a,150);function f(s){const e=s.target;e.files&&e.files.length>0&&(u.value=e.files[0]),d.value=Array.from(e.files||[]),a.value=!1}return(s,e)=>(n(),i("label",{relative:"",class:m(["min-h-[120px] flex flex-col cursor-pointer items-center justify-center rounded-xl p-6",[t(r)?"border-primary-400 dark:border-primary-600 hover:border-primary-300 dark:hover:border-primary-700":"border-neutral-200 dark:border-neutral-700 hover:border-primary-300 dark:hover:border-primary-700",t(r)?"bg-primary-50/5 dark:bg-primary-900/5":"bg-white/60 dark:bg-black/30 hover:bg-white/80 dark:hover:bg-black/40"]]),border:"dashed 2",transition:"all duration-300","cursor-pointer":"","opacity-95":"",hover:"scale-100 opacity-100 shadow-md dark:shadow-lg",onDragover:e[0]||(e[0]=c=>a.value=!0),onDragleave:e[1]||(e[1]=c=>a.value=!1)},[l("input",{type:"file",accept:o.accept,multiple:o.multiple,"cursor-pointer":"",class:"absolute inset-0 h-full w-full opacity-0",onChange:f},null,40,k),x(s.$slots,"default",{isDragging:t(r),firstFile:u.value,files:d.value},()=>[l("div",{class:m(["flex flex-col items-center",[t(r)?"text-primary-500 dark:text-primary-400":"text-neutral-400 dark:text-neutral-500"]])},[e[2]||(e[2]=l("div",{"i-solar:upload-square-line-duotone":"","mb-2":"","text-5xl":""},null,-1)),e[3]||(e[3]=l("p",{"font-medium":"",text:"center lg"}," Upload ",-1)),t(r)?(n(),i("p",h," Release to upload ")):(n(),i("p",D," Click or drag and drop a file here "))],2)])],34))}});export{C as _}; diff --git a/assets/Model.vue_vue_type_script_setup_true_lang-CYzfx59_.js b/assets/Model.vue_vue_type_script_setup_true_lang-CYzfx59_.js deleted file mode 100644 index ebfbb3ea25453497912f6a93684cb312b6ad3fee..0000000000000000000000000000000000000000 --- a/assets/Model.vue_vue_type_script_setup_true_lang-CYzfx59_.js +++ /dev/null @@ -1 +0,0 @@ -import{e as C,T as Y,A as re,L as P,a as $,D as ue,I as se,l as R,M as de,b as T}from"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-t8bgqiA6.js";import{bR as ce,d as N,r as f,w as p,f as X,g as j,c as q,o as G,B as K,bu as z,l as O,bF as ve,y as pe,K as fe,s as he,D as me,bS as ge,bT as Me,bA as we,a as ye,C as be}from"./index-D3pfQUMu.js";import{r as Se}from"./three-vrm-animation.module-DLbUhddZ.js";import"./emotions-CAex_2dA.js";const xe=o=>Math.max(0,Math.min(1,o||0)),F=o=>Math.round(xe(o)*255),Be=ce("rgb"),Fe=o=>{if(o===void 0)return;let l=F(o.r),t=F(o.g),d=F(o.b);return"#"+(1<<24|l<<16|t<<8|d).toString(16).slice(1)},Ce=o=>Fe(Be(o)),Ae=N({__name:"Canvas",props:{width:null,height:null},setup(o,{expose:l}){const t=o,d=f(),e=f(),i=f();async function c(n){P.registerTicker($),C.add(Y),e.value=new re({width:t.width,height:t.height,backgroundAlpha:0,preserveDrawingBuffer:!0}),i.value=e.value.view,i.value.style.objectFit="contain",n.appendChild(e.value.view)}function y(){var n;e.value&&e.value.renderer.resize(t.width,t.height),(n=e.value)!=null&&n.view&&(e.value.view.width=t.width,e.value.view.height=t.height)}p([()=>t.width,()=>t.height],()=>y()),X(async()=>d.value&&await c(d.value)),j(()=>{var n;return(n=e.value)==null?void 0:n.destroy()});async function B(){return new Promise(g=>{if(!i.value||!e.value)return g(null);e.value.render(),i.value.toBlob(g)})}return l({captureFrame:B}),(n,g)=>(G(),q("div",{ref_key:"containerRef",ref:d,"h-full":"","w-full":""},[K(n.$slots,"default",{app:e.value})],512))}});function V(o,l,t){return(1-t)*o+t*l}function H(o,l){return o+Math.random()*(l-o)}function Pe(){let o=-1,l,t=-1;function d(e,i){(i>=o||il.app),d=z(()=>l.paused),e=f(),i=f(0),c=f(0),y=O(()=>Math.max(0,Math.min(100,l.mouthOpenSize))),B=ve(),n=pe(be),g=O(()=>n.between("sm","md").value||n.smaller("sm").value),U=Pe(),D=fe(new ue({alpha:.2,blur:0,distance:20,rotation:45}));function W(){return e.value.internalModel.coreModel}function I(a){if(!a.value)return;let r=2.2;g.value&&(r=2.2);const h=l.height*.95/c.value*r,s=l.width*.95/i.value*r,m=Math.min(h,s);a.value.scale.set(m,m)}const{live2dModelFile:b,loadingLive2dModel:M,live2dCurrentMotion:J,availableLive2dMotions:Q,live2dLoadSource:S,live2dModelUrl:k,themeColorsHue:Z,themeColorsHueDynamic:_}=he(me()),ee=f({group:"Idle",index:0});async function ae(){var L;if(!t.value)return;e.value&&(t.value.stage.removeChild(e.value),e.value.destroy(),e.value=void 0);const a=new P;S.value==="file"?await T.setupLive2DModel(a,[b.value]):S.value==="url"&&await T.setupLive2DModel(a,k.value),e.value=a,t.value.stage.addChild(e.value),i.value=e.value.width,c.value=e.value.height,e.value.x=l.width/2,e.value.y=l.height,e.value.rotation=Math.PI,e.value.skew.x=Math.PI,e.value.anchor.set(.5,.5),I(e),e.value.on("hit",v=>{e.value&&v.includes("body")&&e.value.motion("tap_body")});const r=e.value.internalModel,h=r.coreModel,s=r.motionManager;h.setParameterValueById("ParamMouthOpenY",y.value),Q.value=Object.entries(s.definitions).flatMap(([v,u])=>u?u.map((ie,ne)=>({motionName:v,motionIndex:ne,fileName:ie.File})):[]).filter(Boolean),s.groups.idle&&((L=s.motionGroups[s.groups.idle])==null||L.forEach(v=>{v._motionData.curves.forEach(u=>{(u.id==="ParamEyeBallX"||u.id==="ParamEyeBallY")&&(u.id=`_${u.id}`)})}));const m=s.update;s.update=function(v,u){return m==null||m.call(this,v,u),s.state.currentGroup===s.groups.idle&&U.update(r,u),!0},s.on("motionStart",(v,u)=>{ee.value={group:v,index:u}}),b.value&&await R.setItem("live2dModel",b.value),M.value=!1}async function te(){if(!t.value)return;P.registerTicker($),C.add(Y),C.add(se);const a=await R.getItem("live2dModel");if(a){b.value=a,S.value="file",M.value=!0;return}if(k.value){S.value="url",M.value=!0;return}M.value=!1}async function le(a,r){await e.value.motion(a,r,de.FORCE)}const oe=ge(()=>{e.value&&(e.value.x=l.width/2,e.value.y=l.height,I(e))},100),A=f(),w=f(0);function x(){if(e.value){const a=getComputedStyle(A.value).backgroundColor;D.value.color=Number(Ce(a).replace("#","0x")),e.value.filters=[D.value]}}p([()=>l.width,()=>l.height],()=>oe()),p(B,x,{immediate:!0}),p([e,Z],x);function E(){x(),w.value=requestAnimationFrame(E)}return p(_,()=>{_.value?w.value=requestAnimationFrame(E):(cancelAnimationFrame(w.value),w.value=0)},{immediate:!0}),p(y,a=>W().setParameterValueById("ParamMouthOpenY",a)),p(t,te),p(J,a=>le(a.group,a.index)),p(d,a=>{var r,h;a?(r=t.value)==null||r.stop():(h=t.value)==null||h.start()}),Me(M,a=>{a&&ae()},{debounce:1e3}),X(x),j(()=>{var a;cancelAnimationFrame(w.value),e.value&&((a=t.value)==null||a.stage.removeChild(e.value))}),(a,r)=>(G(),q(we,null,[ye("div",{ref_key:"dropShadowColorComputer",ref:A,hidden:"",bg:"primary-400 dark:primary-500"},null,512),K(a.$slots,"default")],64))}});export{Ee as _,Ae as a,H as r}; diff --git a/assets/Model.vue_vue_type_script_setup_true_lang-DPC1qTx5.js b/assets/Model.vue_vue_type_script_setup_true_lang-DPC1qTx5.js new file mode 100644 index 0000000000000000000000000000000000000000..55df8e258f5f35f13428dbcfbb0fd2f58fd0da45 --- /dev/null +++ b/assets/Model.vue_vue_type_script_setup_true_lang-DPC1qTx5.js @@ -0,0 +1 @@ +import{e as C,T as Y,A as re,L as P,a as G,D as ue,I as se,l as z,M as de,b as R}from"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-B6whjTNv.js";import{aB as ce,d as $,r as f,v as p,H as N,I as X,c as j,o as q,f as U,aC as T,h as O,az as ve,aD as pe,aE as fe,s as he,G as me,aw as ge,aF as Me,F as we,e as ye,aG as Se}from"./index-BNq7Hbz_.js";import{r as be}from"./three-vrm-animation.module-BPuMi1if.js";import"./mcp-D2taTyhO.js";import"./mini_xsschema-P_8cZcRg.js";const Fe=o=>Math.max(0,Math.min(1,o||0)),B=o=>Math.round(Fe(o)*255),xe=ce("rgb"),Be=o=>{if(o===void 0)return;let l=B(o.r),t=B(o.g),d=B(o.b);return"#"+(1<<24|l<<16|t<<8|d).toString(16).slice(1)},Ce=o=>Be(xe(o)),Ee=$({__name:"Canvas",props:{width:null,height:null},setup(o,{expose:l}){const t=o,d=f(),e=f(),i=f();async function c(n){P.registerTicker(G),C.add(Y),e.value=new re({width:t.width,height:t.height,backgroundAlpha:0,preserveDrawingBuffer:!0}),i.value=e.value.view,i.value.style.objectFit="contain",n.appendChild(e.value.view)}function y(){var n;e.value&&e.value.renderer.resize(t.width,t.height),(n=e.value)!=null&&n.view&&(e.value.view.width=t.width,e.value.view.height=t.height)}p([()=>t.width,()=>t.height],()=>y()),N(async()=>d.value&&await c(d.value)),X(()=>{var n;return(n=e.value)==null?void 0:n.destroy()});async function x(){return new Promise(g=>{if(!i.value||!e.value)return g(null);e.value.render(),i.value.toBlob(g)})}return l({captureFrame:x}),(n,g)=>(q(),j("div",{ref_key:"containerRef",ref:d,"h-full":"","w-full":""},[U(n.$slots,"default",{app:e.value})],512))}});function V(o,l,t){return(1-t)*o+t*l}function H(o,l){return o+Math.random()*(l-o)}function Pe(){let o=-1,l,t=-1;function d(e,i){(i>=o||il.app),d=T(()=>l.paused),e=f(),i=f(0),c=f(0),y=O(()=>Math.max(0,Math.min(100,l.mouthOpenSize))),x=ve(),n=pe(Se),g=O(()=>n.between("sm","md").value||n.smaller("sm").value),W=Pe(),I=fe(new ue({alpha:.2,blur:0,distance:20,rotation:45}));function J(){return e.value.internalModel.coreModel}function D(a){if(!a.value)return;let r=2.2;g.value&&(r=2.2);const h=l.height*.95/c.value*r,s=l.width*.95/i.value*r,m=Math.min(h,s);a.value.scale.set(m,m)}const{live2dModelFile:S,loadingLive2dModel:M,live2dCurrentMotion:K,availableLive2dMotions:Q,live2dLoadSource:b,live2dModelUrl:k,themeColorsHue:Z,themeColorsHueDynamic:_}=he(me()),ee=f({group:"Idle",index:0});async function ae(){var L;if(!t.value)return;e.value&&(t.value.stage.removeChild(e.value),e.value.destroy(),e.value=void 0);const a=new P;b.value==="file"?await R.setupLive2DModel(a,[S.value]):b.value==="url"&&await R.setupLive2DModel(a,k.value),e.value=a,t.value.stage.addChild(e.value),i.value=e.value.width,c.value=e.value.height,e.value.x=l.width/2,e.value.y=l.height,e.value.rotation=Math.PI,e.value.skew.x=Math.PI,e.value.anchor.set(.5,.5),D(e),e.value.on("hit",v=>{e.value&&v.includes("body")&&e.value.motion("tap_body")});const r=e.value.internalModel,h=r.coreModel,s=r.motionManager;h.setParameterValueById("ParamMouthOpenY",y.value),Q.value=Object.entries(s.definitions).flatMap(([v,u])=>u?u.map((ie,ne)=>({motionName:v,motionIndex:ne,fileName:ie.File})):[]).filter(Boolean),s.groups.idle&&((L=s.motionGroups[s.groups.idle])==null||L.forEach(v=>{v._motionData.curves.forEach(u=>{(u.id==="ParamEyeBallX"||u.id==="ParamEyeBallY")&&(u.id=`_${u.id}`)})}));const m=s.update;s.update=function(v,u){return m==null||m.call(this,v,u),s.state.currentGroup===s.groups.idle&&W.update(r,u),!0},s.on("motionStart",(v,u)=>{ee.value={group:v,index:u}}),S.value&&await z.setItem("live2dModel",S.value),M.value=!1}async function te(){if(!t.value)return;P.registerTicker(G),C.add(Y),C.add(se);const a=await z.getItem("live2dModel");if(a){S.value=a,b.value="file",M.value=!0;return}if(k.value){b.value="url",M.value=!0;return}M.value=!1}async function le(a,r){await e.value.motion(a,r,de.FORCE)}const oe=ge(()=>{e.value&&(e.value.x=l.width/2,e.value.y=l.height,D(e))},100),A=f(),w=f(0);function F(){if(e.value){const a=getComputedStyle(A.value).backgroundColor;I.value.color=Number(Ce(a).replace("#","0x")),e.value.filters=[I.value]}}p([()=>l.width,()=>l.height],()=>oe()),p(x,F,{immediate:!0}),p([e,Z],F);function E(){F(),w.value=requestAnimationFrame(E)}return p(_,()=>{_.value?w.value=requestAnimationFrame(E):(cancelAnimationFrame(w.value),w.value=0)},{immediate:!0}),p(y,a=>J().setParameterValueById("ParamMouthOpenY",a)),p(t,te),p(K,a=>le(a.group,a.index)),p(d,a=>{var r,h;a?(r=t.value)==null||r.stop():(h=t.value)==null||h.start()}),Me(M,a=>{a&&ae()},{debounce:1e3}),N(F),X(()=>{var a;cancelAnimationFrame(w.value),e.value&&((a=t.value)==null||a.stage.removeChild(e.value))}),(a,r)=>(q(),j(we,null,[ye("div",{ref_key:"dropShadowColorComputer",ref:A,hidden:"",bg:"primary-400 dark:primary-500"},null,512),U(a.$slots,"default")],64))}});export{Le as _,Ee as a,H as r}; diff --git a/assets/ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-8yNUgi8_.js b/assets/ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-8yNUgi8_.js new file mode 100644 index 0000000000000000000000000000000000000000..3f952cfcc40bfa2ce42278a8b0af24c893d05af8 --- /dev/null +++ b/assets/ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-8yNUgi8_.js @@ -0,0 +1 @@ +import{_ as t}from"./FieldInput.vue_vue_type_script_setup_true_lang-IanARj3w.js";/* empty css */import{d as u,m as n,g as m,u as p,h as c,A as f,o as v,b as a}from"./index-BNq7Hbz_.js";const g=u({__name:"ProviderApiKeyInput",props:n({providerName:null,placeholder:null,required:{type:Boolean},label:null,description:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const l=e,{t:d}=m(),o=p(e,"modelValue"),i=c(()=>l.description||`API Key for ${l.providerName}`);return(V,r)=>(v(),f(a(t),{modelValue:o.value,"onUpdate:modelValue":r[0]||(r[0]=s=>o.value=s),label:e.label||a(d)("settings.pages.providers.common.fields.field.api-key.label"),description:i.value,placeholder:e.placeholder,required:e.required,type:"password"},null,8,["modelValue","label","description","placeholder","required"]))}});export{g as _}; diff --git a/assets/ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-yC-Tsbbb.js b/assets/ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-yC-Tsbbb.js deleted file mode 100644 index e393f6aa6f5a26aeae673ae13b7c82a83f27b6a7..0000000000000000000000000000000000000000 --- a/assets/ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-yC-Tsbbb.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as t}from"./FieldInput.vue_vue_type_script_setup_true_lang-Brkyubp9.js";/* empty css */import{d as u,bK as n,k as m,bL as p,l as c,m as f,o as b,u as a}from"./index-D3pfQUMu.js";const k=u({__name:"ProviderApiKeyInput",props:n({providerName:null,placeholder:null,required:{type:Boolean},label:null,description:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const l=e,{t:d}=m(),o=p(e,"modelValue"),i=c(()=>l.description||`API Key for ${l.providerName}`);return(v,r)=>(b(),f(a(t),{modelValue:o.value,"onUpdate:modelValue":r[0]||(r[0]=s=>o.value=s),label:e.label||a(d)("settings.pages.providers.common.fields.field.api-key.label"),description:i.value,placeholder:e.placeholder,required:e.required,type:"password"},null,8,["modelValue","label","description","placeholder","required"]))}});export{k as _}; diff --git a/assets/ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DETFnj2t.js b/assets/ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DETFnj2t.js new file mode 100644 index 0000000000000000000000000000000000000000..deb44dd1c2a8fa560a4a44870f09af3a466aa33c --- /dev/null +++ b/assets/ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DETFnj2t.js @@ -0,0 +1 @@ +import{_ as p}from"./Collapsable.vue_vue_type_script_setup_true_lang-IiDV8qQX.js";import{d,r as m,A as u,o as c,w as n,e,f,t as _,n as v,m as b,u as V,b as g}from"./index-BNq7Hbz_.js";import{_ as x}from"./FieldInput.vue_vue_type_script_setup_true_lang-IanARj3w.js";/* empty css */const h=["onClick"],B={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},w={"mt-4":""},U=d({__name:"ProviderAdvancedSettings",props:{title:null,initialVisible:{type:Boolean}},setup(l){const a=m(l.initialVisible||!1);function s(){a.value=!a.value}return(o,i)=>(c(),u(p,{"w-full":""},{trigger:n(r=>[e("button",{transition:"all ease-in-out duration-250","w-full":"",flex:"","items-center":"","gap-1.5":"","outline-none":"",class:"[&_.provider-icon]:grayscale-100 [&_.provider-icon]:hover:grayscale-0",onClick:()=>r.setVisible(!r.visible)&&s()},[e("h2",B,[e("span",null,_(l.title||"Advanced"),1)]),e("div",{transform:"",transition:"transform duration-250",class:v({"rotate-180":r.visible})},i[0]||(i[0]=[e("div",{"i-solar:alt-arrow-down-bold-duotone":""},null,-1)]),2)],8,h)]),default:n(()=>[e("div",w,[f(o.$slots,"default")])]),_:3}))}}),$=d({__name:"ProviderBaseUrlInput",props:b({placeholder:null,required:{type:Boolean},label:null,description:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,a=V(l,"modelValue");return(s,o)=>(c(),u(g(x),{modelValue:a.value,"onUpdate:modelValue":o[0]||(o[0]=i=>a.value=i),label:t.label||"Base URL",description:t.description||"Custom base URL (optional)",placeholder:t.placeholder,required:t.required,type:"text"},null,8,["modelValue","label","description","placeholder","required"]))}});export{U as _,$ as a}; diff --git a/assets/ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Qp-g_fu5.js b/assets/ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Qp-g_fu5.js deleted file mode 100644 index 3d73b219dd996fc09ccd7df3f77ca38a9651e7f7..0000000000000000000000000000000000000000 --- a/assets/ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Qp-g_fu5.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as p}from"./Collapsable.vue_vue_type_script_setup_true_lang-DDNOeGH3.js";import{d,r as m,m as u,o as c,E as n,a as e,B as f,t as _,F as v,bK as b,bL as V,u as g}from"./index-D3pfQUMu.js";import{_ as x}from"./FieldInput.vue_vue_type_script_setup_true_lang-Brkyubp9.js";/* empty css */const h=["onClick"],B={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},y={"mt-4":""},U=d({__name:"ProviderAdvancedSettings",props:{title:null,initialVisible:{type:Boolean}},setup(l){const a=m(l.initialVisible||!1);function s(){a.value=!a.value}return(o,i)=>(c(),u(p,{"w-full":""},{trigger:n(r=>[e("button",{transition:"all ease-in-out duration-250","w-full":"",flex:"","items-center":"","gap-1.5":"","outline-none":"",class:"[&_.provider-icon]:grayscale-100 [&_.provider-icon]:hover:grayscale-0",onClick:()=>r.setVisible(!r.visible)&&s()},[e("h2",B,[e("span",null,_(l.title||"Advanced"),1)]),e("div",{transform:"",transition:"transform duration-250",class:v({"rotate-180":r.visible})},i[0]||(i[0]=[e("div",{"i-solar:alt-arrow-down-bold-duotone":""},null,-1)]),2)],8,h)]),default:n(()=>[e("div",y,[f(o.$slots,"default")])]),_:3}))}}),$=d({__name:"ProviderBaseUrlInput",props:b({placeholder:null,required:{type:Boolean},label:null,description:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,a=V(l,"modelValue");return(s,o)=>(c(),u(g(x),{modelValue:a.value,"onUpdate:modelValue":o[0]||(o[0]=i=>a.value=i),label:t.label||"Base URL",description:t.description||"Custom base URL (optional)",placeholder:t.placeholder,required:t.required,type:"text"},null,8,["modelValue","label","description","placeholder","required"]))}});export{U as _,$ as a}; diff --git a/assets/ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C-W-PZMl.js b/assets/ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C-W-PZMl.js new file mode 100644 index 0000000000000000000000000000000000000000..cf3b8b48ced877446b188793ee8884b0151129fa --- /dev/null +++ b/assets/ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C-W-PZMl.js @@ -0,0 +1 @@ +import{d as o,c as s,o as a,e,f as i,j as u,t as l}from"./index-BNq7Hbz_.js";const c={flex:"~ col gap-6"},f={flex:"~ row","items-center":"","justify-between":""},x={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},m={text:"neutral-400 dark:neutral-500"},g=o({__name:"ProviderBasicSettings",props:{title:null,description:null,onReset:{type:Function}},setup(t){return(r,n)=>(a(),s("div",c,[e("div",f,[e("div",null,[e("h2",x,l(t.title||"Basic"),1),e("div",m,[e("span",null,l(t.description||"Essential settings"),1)])]),t.onReset?(a(),s("button",{key:0,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:n[0]||(n[0]=(...d)=>t.onReset&&t.onReset(...d))},n[1]||(n[1]=[e("div",{"i-solar:refresh-bold-duotone":"","text-xl":""},null,-1)]))):u("",!0)]),i(r.$slots,"default")]))}}),p={bg:"neutral-50 dark:[rgba(0,0,0,0.3)]","rounded-xl":"","p-4":"",flex:"~ col gap-6"},k=o({__name:"ProviderSettingsContainer",setup(t){return(r,n)=>(a(),s("div",p,[i(r.$slots,"default")]))}});export{k as _,g as a}; diff --git a/assets/ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C8wZQWhG.js b/assets/ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C8wZQWhG.js deleted file mode 100644 index 888e093a492995c65631efd180f3ee4710941cb7..0000000000000000000000000000000000000000 --- a/assets/ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C8wZQWhG.js +++ /dev/null @@ -1 +0,0 @@ -import{d as o,c as s,o as a,a as e,B as i,i as u,t as l}from"./index-D3pfQUMu.js";const c={flex:"~ col gap-6"},x={flex:"~ row","items-center":"","justify-between":""},f={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},m={text:"neutral-400 dark:neutral-500"},g=o({__name:"ProviderBasicSettings",props:{title:null,description:null,onReset:{type:Function}},setup(t){return(r,n)=>(a(),s("div",c,[e("div",x,[e("div",null,[e("h2",f,l(t.title||"Basic"),1),e("div",m,[e("span",null,l(t.description||"Essential settings"),1)])]),t.onReset?(a(),s("button",{key:0,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:n[0]||(n[0]=(...d)=>t.onReset&&t.onReset(...d))},n[1]||(n[1]=[e("div",{"i-solar:refresh-bold-duotone":"","text-xl":""},null,-1)]))):u("",!0)]),i(r.$slots,"default")]))}}),p={bg:"neutral-50 dark:[rgba(0,0,0,0.3)]","rounded-xl":"","p-4":"",flex:"~ col gap-6"},k=o({__name:"ProviderSettingsContainer",setup(t){return(r,n)=>(a(),s("div",p,[i(r.$slots,"default")]))}});export{k as _,g as a}; diff --git a/assets/ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-CRYYAVy7.js b/assets/ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-CRYYAVy7.js deleted file mode 100644 index cf7096ad9cc6c9c6df784af2bf2780288d95869e..0000000000000000000000000000000000000000 --- a/assets/ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-CRYYAVy7.js +++ /dev/null @@ -1 +0,0 @@ -import{d as a,bz as i,c as o,o as t,B as s,G as l,a as c,F as d,bA as p}from"./index-D3pfQUMu.js";const u={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":""},_=a({__name:"ProviderSettingsLayout",props:{providerName:null,providerIcon:null,providerIconColor:null,onBack:{type:Function}},setup(e){return(n,v)=>{const r=i("motion");return t(),o(p,null,[s(n.$slots,"default"),l((t(),o("div",u,[c("div",{text:"60",class:d(e.providerIcon||e.providerIconColor)},null,2)])),[[r]])],64)}}});export{_}; diff --git a/assets/ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-kCkYL1sn.js b/assets/ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-kCkYL1sn.js new file mode 100644 index 0000000000000000000000000000000000000000..dd13db03a403693b469af9f216e9046b32312495 --- /dev/null +++ b/assets/ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-kCkYL1sn.js @@ -0,0 +1 @@ +import{d as a,K as i,c as o,o as t,f as s,x as l,e as c,n as d,F as p}from"./index-BNq7Hbz_.js";const u={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":""},_=a({__name:"ProviderSettingsLayout",props:{providerName:null,providerIcon:null,providerIconColor:null,onBack:{type:Function}},setup(e){return(n,v)=>{const r=i("motion");return t(),o(p,null,[s(n.$slots,"default"),l((t(),o("div",u,[c("div",{text:"60",class:d(e.providerIcon||e.providerIconColor)},null,2)])),[[r]])],64)}}});export{_}; diff --git a/assets/RadioCardSimple-DTOaU_HK.js b/assets/RadioCardSimple-DTOaU_HK.js new file mode 100644 index 0000000000000000000000000000000000000000..da8b1d528cd4de82ed65a0343e3b415284c362b2 --- /dev/null +++ b/assets/RadioCardSimple-DTOaU_HK.js @@ -0,0 +1 @@ +import{d as g,m as b,u as w,r as f,c as n,o as d,n as o,x as V,e as t,b6 as I,j as v,t as c,i as $,w as S,Y as k,b as B,_ as C,h as T,y as z,F as E,l as N,A as D}from"./index-BNq7Hbz_.js";import{_ as P}from"./TransitionVertical.vue_vue_type_script_setup_true_lang-BlPB-gCV.js";import{_ as U}from"./Input.vue_vue_type_script_setup_true_lang-1pgLpBi1.js";/* empty css */import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-B6whjTNv.js";const q=["checked","name","value"],L={class:"relative mr-3 mt-0.5 flex-shrink-0"},j={class:"w-full flex flex-col gap-2"},F={class:"flex items-center"},A={key:0,class:"relative"},Q=["title"],Y={key:1,class:"mt-2"},G=g({__name:"RadioCardDetail",props:b({id:null,name:null,value:null,title:null,description:null,deprecated:{type:Boolean,default:!1},showExpandCollapse:{type:Boolean,default:!0},expandCollapseThreshold:{default:100},customInputValue:{default:""},customInputPlaceholder:{default:""},showCustomInput:{type:Boolean,default:!1}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const a=w(e,"modelValue"),m=f(!1);function s(){m.value=!m.value}return(x,r)=>(d(),n("label",{key:e.id,class:o(["form_radio-card-detail relative flex cursor-pointer items-start rounded-xl p-3 pr-[20px]",[a.value===e.value?"bg-primary-50 dark:bg-primary-900/20 border-primary-100 dark:border-primary-900 hover:border-primary-500/30 dark:hover:border-primary-400/30":"bg-white dark:bg-neutral-900/20 border-neutral-100 dark:border-neutral-900 hover:border-primary-500/30 dark:hover:border-primary-400/30",a.value===e.value?"form_radio-card-detail-active":"",e.deprecated?"opacity-60":""]]),transition:"all duration-200 ease-in-out",border:"2 solid"},[V(t("input",{"onUpdate:modelValue":r[0]||(r[0]=u=>a.value=u),checked:a.value===e.value,type:"radio",name:e.name,value:e.value,class:"absolute opacity-0"},null,8,q),[[I,a.value]]),t("div",L,[t("div",{class:o(["size-5 border-2 rounded-full transition-colors duration-200",[a.value===e.value?"border-primary-500 dark:border-primary-400":"border-neutral-300 dark:border-neutral-600"]])},[t("div",{class:o(["absolute left-1/2 top-1/2 size-3 rounded-full transition-opacity duration-200 -translate-x-1/2 -translate-y-1/2",[a.value===e.value?"opacity-100 bg-primary-500 dark:bg-primary-400":"opacity-0"]])},null,2)],2)]),t("div",j,[t("div",F,[t("span",{class:o(["line-clamp-1 font-medium",[a.value===e.value?"text-neutral-700 dark:text-neutral-300":"text-neutral-700 dark:text-neutral-400"]])},c(e.title),3)]),e.description?(d(),n("div",A,[$(B(P),null,{default:S(()=>[!m.value||!e.showExpandCollapse?(d(),n("div",{key:0,class:o(["line-clamp-2 cursor-pointer text-xs",[a.value===e.value?"text-neutral-600 dark:text-neutral-400":"text-neutral-500 dark:text-neutral-500"]]),title:e.description,onClick:k(s,["prevent"])},c(e.description),11,Q)):(d(),n("div",{key:1,class:o(["cursor-pointer text-xs",[a.value===e.value?"text-neutral-600 dark:text-neutral-400":"text-neutral-500 dark:text-neutral-500"]]),onClick:k(s,["prevent"])},c(e.description),3))]),_:1}),e.showExpandCollapse&&e.description.length>e.expandCollapseThreshold?(d(),n("button",{key:0,class:"text-primary-500 dark:text-primary-600 mt-0.5 inline-flex items-center text-xs",onClick:k(s,["prevent"])},[t("span",null,c(m.value?"Show less":"Show more"),1),t("div",{class:o([{"rotate-180":m.value},"transition-transform duration-200"])},r[2]||(r[2]=[t("div",{"i-solar:alt-arrow-down-bold-duotone":"","ml-0.5":"","text-xs":""},null,-1)]),2)])):v("",!0)])):v("",!0),e.showCustomInput&&a.value===e.value?(d(),n("div",Y,[$(B(U),{modelValue:a.value,"onUpdate:modelValue":r[1]||(r[1]=u=>a.value=u),type:"text",class:"w-full border border-neutral-300 rounded bg-white px-2 py-1 text-sm dark:border-neutral-700 dark:bg-neutral-900",placeholder:e.customInputPlaceholder},null,8,["modelValue","placeholder"])])):v("",!0)])],2))}}),H=C(G,[["__scopeId","data-v-0e0bc18f"]]),J={class:"radio-card-detail-many-select"},K={key:0,class:"relative","inline-flex":"~","w-full":"","items-center":""},O=["placeholder"],W={class:"mt-4 space-y-2"},X={key:0,class:"text-sm text-neutral-500 dark:text-neutral-400"},Z={key:1,class:"flex items-center gap-3 border border-2 border-amber-200 rounded-xl bg-amber-50 p-4 dark:border-amber-800 dark:bg-amber-900/20"},_={class:"flex flex-col"},ee={class:"font-medium"},te={class:"text-sm text-amber-600 dark:text-amber-400"},ae={class:"relative"},le=g({__name:"RadioCardManySelect",props:b({items:null,searchable:{type:Boolean,default:!0},searchPlaceholder:{default:"Search..."},searchNoResultsTitle:{default:"No results found"},searchNoResultsDescription:{default:"Try a different search term"},searchResultsText:{default:"{count} of {total} results"},customInputPlaceholder:{default:"Enter custom value"},expandButtonText:{default:"Show more"},collapseButtonText:{default:"Show less"},showMore:{type:Boolean,default:!0}},{modelValue:{required:!0},modelModifiers:{}}),emits:b(["update:customValue"],["update:modelValue"]),setup(e,{emit:a}){const m=e,s=a,x=w(e,"modelValue"),r=f(""),u=f(!1),R=f(""),h=T(()=>{if(!r.value)return m.items;const p=r.value.toLowerCase();return m.items.filter(l=>l.name.toLowerCase().includes(p)||l.description&&l.description.toLowerCase().includes(p))});function M(p){R.value=p,s("update:customValue",p)}return(p,l)=>(d(),n("div",J,[e.searchable?(d(),n("div",K,[l[4]||(l[4]=t("div",{class:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3"},[t("div",{"i-solar:magnifer-line-duotone":"",class:"text-neutral-500 dark:text-neutral-400"})],-1)),V(t("input",{"onUpdate:modelValue":l[0]||(l[0]=i=>r.value=i),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:e.searchPlaceholder},null,8,O),[[z,r.value]])])):v("",!0),t("div",W,[r.value?(d(),n("div",X,c(e.searchResultsText.replace("{count}",h.value.length.toString()).replace("{total}",e.items.length.toString())),1)):v("",!0),r.value&&h.value.length===0?(d(),n("div",Z,[l[5]||(l[5]=t("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1)),t("div",_,[t("span",ee,c(e.searchNoResultsTitle),1),t("span",te,c(e.searchNoResultsDescription.replace("{query}",r.value)),1)])])):v("",!0),t("div",ae,[t("div",{class:o(["grid auto-cols-[350px] grid-flow-col max-h-[calc(100dvh-7lh)] gap-4 overflow-x-auto pb-4 scrollbar-none",[u.value?"grid-cols-1 md:grid-cols-2 grid-flow-row auto-cols-auto":""]]),transition:"all duration-200 ease-in-out",style:{"scroll-snap-type":"x mandatory"}},[(d(!0),n(E,null,N(h.value,i=>(d(),D(H,{id:i.id,key:i.id,modelValue:x.value,"onUpdate:modelValue":l[1]||(l[1]=y=>x.value=y),value:i.id,title:i.name,description:i.description,deprecated:i.deprecated,"show-expand-collapse":e.showMore,"expand-collapse-threshold":100,"show-custom-input":i.customizable,"custom-input-value":R.value,"custom-input-placeholder":e.customInputPlaceholder,name:"radio-card-detail-many-select",class:"scroll-snap-align-start","onUpdate:customInputValue":l[2]||(l[2]=y=>M(y))},null,8,["id","modelValue","value","title","description","deprecated","show-expand-collapse","show-custom-input","custom-input-value","custom-input-placeholder"]))),128))],2),t("div",{bg:"neutral-100 dark:[rgba(0,0,0,0.3)]","rounded-xl":"",class:o([u.value?"w-full":"mt-4 w-full rounded-lg"])},[t("button",{"w-full":"",flex:"","items-center":"","justify-center":"","gap-2":"","rounded-lg":"","py-2":"",transition:"all duration-200 ease-in-out",class:o([u.value?"bg-primary-500 hover:bg-primary-600 text-white":"bg-white dark:bg-neutral-900 hover:bg-neutral-100 dark:hover:bg-neutral-800"]),onClick:l[3]||(l[3]=i=>u.value=!u.value)},[t("span",null,c(u.value?e.collapseButtonText:e.expandButtonText),1),t("div",{class:o([u.value?"rotate-180":"","text-lg"]),"i-solar:alt-arrow-down-bold-duotone":"",transition:"transform duration-200 ease-in-out"},null,2)],2)],2)])])]))}}),me=C(le,[["__scopeId","data-v-7ad6d626"]]),re=["checked","name","value"],oe={flex:"~ col","min-h-16":"","w-full":"","items-start":"","justify-center":"","pb-2":"","pl-5":"","pr-4":"","pt-2":""},de=g({__name:"RadioCardSimple",props:b({id:null,name:null,value:null,title:null,description:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const a=w(e,"modelValue");return(m,s)=>(d(),n("label",{key:e.id,border:"2px solid",class:o(["form_radio-card-simple relative",[a.value===e.value?"bg-primary-50 dark:bg-primary-900/20 border-primary-100 dark:border-primary-900 hover:border-primary-500/30 dark:hover:border-primary-400/30":"bg-white dark:bg-neutral-900/20 border-neutral-100 dark:border-neutral-900 hover:border-primary-500/30 dark:hover:border-primary-400/30",a.value===e.value?"form_radio-card-simple-active":""]]),transition:"all duration-200 ease-in-out",flex:"~ col",block:"","min-w-50":"","w-fit":"","cursor-pointer":"","items-start":"","rounded-xl":"","p-4":"","text-left":""},[V(t("input",{"onUpdate:modelValue":s[0]||(s[0]=x=>a.value=x),checked:a.value===e.value,type:"radio",name:e.name,value:e.value,class:"[&:checked+div]:border-primary-500 dark:[&:checked+div]:border-primary-400 absolute opacity-0 [&:checked+div_.radio-dot]:opacity-100"},null,8,re),[[I,a.value]]),s[1]||(s[1]=t("div",{class:"radio-circle absolute left-2 top-2 size-5 rounded-full",border:"2 solid neutral-300 dark:neutral-600",transition:"all duration-200 ease-in-out"},[t("div",{class:"radio-dot absolute left-1/2 top-1/2 size-3 rounded-full opacity-0 -translate-x-1/2 -translate-y-1/2",transition:"all duration-200 ease-in-out",bg:"primary-500 dark:primary-400"})],-1)),t("div",oe,[t("span",{class:o(["radio-item-name font-bold",[a.value===e.value?"text-neutral-700 dark:text-neutral-300":"text-neutral-500 dark:text-neutral-500"]]),text:"md",transition:"all duration-200 ease-in-out"},c(e.title),3),e.description?(d(),n("span",{key:0,class:o(["radio-item-description",[a.value===e.value?"text-neutral-600 dark:text-neutral-400":"text-neutral-400 dark:text-neutral-600"]]),transition:"all duration-200 ease-in-out"},c(e.description),3)):v("",!0)]),s[2]||(s[2]=t("div",{class:"bg-dotted-neutral-200/80 dark:bg-dotted-neutral-700/50 [input:checked~&]:bg-dotted-primary-300/50 dark:[input:checked~&]:bg-dotted-primary-200/20",absolute:"","inset-0":"","z--1":"",style:{"background-size":"10px 10px","mask-image":"linear-gradient(165deg, white 30%, transparent 50%)"}},null,-1))],2))}}),ve=C(de,[["__scopeId","data-v-475841e0"]]);export{me as R,ve as a}; diff --git a/assets/RadioCardSimple-DtKqsojA.js b/assets/RadioCardSimple-DtKqsojA.js deleted file mode 100644 index 6746bbfbca072d0cf6c8dea454bcb09c670c28ef..0000000000000000000000000000000000000000 --- a/assets/RadioCardSimple-DtKqsojA.js +++ /dev/null @@ -1 +0,0 @@ -import{d as g,bK as f,bL as w,r as b,c as n,o as d,F as o,G as V,a as t,bD as I,i as v,t as c,b as R,E as S,bO as k,u as $,bq as C,l as T,bH as E,bA as z,bB as N,m as D}from"./index-D3pfQUMu.js";import{_ as q}from"./TransitionVertical.vue_vue_type_script_setup_true_lang-D_DUmSTM.js";import{_ as L}from"./Input.vue_vue_type_script_setup_true_lang-B223oRg0.js";/* empty css */import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-t8bgqiA6.js";const P=["checked","name","value"],U={class:"relative mr-3 mt-0.5 flex-shrink-0"},j={class:"w-full flex flex-col gap-2"},F={class:"flex items-center"},A={key:0,class:"relative"},G=["title"],H={key:1,class:"mt-2"},K=g({__name:"RadioCardDetail",props:f({id:null,name:null,value:null,title:null,description:null,deprecated:{type:Boolean,default:!1},showExpandCollapse:{type:Boolean,default:!0},expandCollapseThreshold:{default:100},customInputValue:{default:""},customInputPlaceholder:{default:""},showCustomInput:{type:Boolean,default:!1}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const a=w(e,"modelValue"),m=b(!1);function s(){m.value=!m.value}return(x,r)=>(d(),n("label",{key:e.id,class:o(["form_radio-card-detail relative flex cursor-pointer items-start rounded-xl p-3 pr-[20px]",[a.value===e.value?"bg-primary-50 dark:bg-primary-900/20 border-primary-100 dark:border-primary-900 hover:border-primary-500/30 dark:hover:border-primary-400/30":"bg-white dark:bg-neutral-900/20 border-neutral-100 dark:border-neutral-900 hover:border-primary-500/30 dark:hover:border-primary-400/30",a.value===e.value?"form_radio-card-detail-active":"",e.deprecated?"opacity-60":""]]),transition:"all duration-200 ease-in-out",border:"2 solid"},[V(t("input",{"onUpdate:modelValue":r[0]||(r[0]=u=>a.value=u),checked:a.value===e.value,type:"radio",name:e.name,value:e.value,class:"absolute opacity-0"},null,8,P),[[I,a.value]]),t("div",U,[t("div",{class:o(["size-5 border-2 rounded-full transition-colors duration-200",[a.value===e.value?"border-primary-500 dark:border-primary-400":"border-neutral-300 dark:border-neutral-600"]])},[t("div",{class:o(["absolute left-1/2 top-1/2 size-3 rounded-full transition-opacity duration-200 -translate-x-1/2 -translate-y-1/2",[a.value===e.value?"opacity-100 bg-primary-500 dark:bg-primary-400":"opacity-0"]])},null,2)],2)]),t("div",j,[t("div",F,[t("span",{class:o(["line-clamp-1 font-medium",[a.value===e.value?"text-neutral-700 dark:text-neutral-300":"text-neutral-700 dark:text-neutral-400"]])},c(e.title),3)]),e.description?(d(),n("div",A,[R($(q),null,{default:S(()=>[!m.value||!e.showExpandCollapse?(d(),n("div",{key:0,class:o(["line-clamp-2 cursor-pointer text-xs",[a.value===e.value?"text-neutral-600 dark:text-neutral-400":"text-neutral-500 dark:text-neutral-500"]]),title:e.description,onClick:k(s,["prevent"])},c(e.description),11,G)):(d(),n("div",{key:1,class:o(["cursor-pointer text-xs",[a.value===e.value?"text-neutral-600 dark:text-neutral-400":"text-neutral-500 dark:text-neutral-500"]]),onClick:k(s,["prevent"])},c(e.description),3))]),_:1}),e.showExpandCollapse&&e.description.length>e.expandCollapseThreshold?(d(),n("button",{key:0,class:"text-primary-500 dark:text-primary-600 mt-0.5 inline-flex items-center text-xs",onClick:k(s,["prevent"])},[t("span",null,c(m.value?"Show less":"Show more"),1),t("div",{class:o([{"rotate-180":m.value},"transition-transform duration-200"])},r[2]||(r[2]=[t("div",{"i-solar:alt-arrow-down-bold-duotone":"","ml-0.5":"","text-xs":""},null,-1)]),2)])):v("",!0)])):v("",!0),e.showCustomInput&&a.value===e.value?(d(),n("div",H,[R($(L),{modelValue:a.value,"onUpdate:modelValue":r[1]||(r[1]=u=>a.value=u),type:"text",class:"w-full border border-neutral-300 rounded bg-white px-2 py-1 text-sm dark:border-neutral-700 dark:bg-neutral-900",placeholder:e.customInputPlaceholder},null,8,["modelValue","placeholder"])])):v("",!0)])],2))}}),O=C(K,[["__scopeId","data-v-0e0bc18f"]]),Q={class:"radio-card-detail-many-select"},J={key:0,class:"relative","inline-flex":"~","w-full":"","items-center":""},W=["placeholder"],X={class:"mt-4 space-y-2"},Y={key:0,class:"text-sm text-neutral-500 dark:text-neutral-400"},Z={key:1,class:"flex items-center gap-3 border border-2 border-amber-200 rounded-xl bg-amber-50 p-4 dark:border-amber-800 dark:bg-amber-900/20"},_={class:"flex flex-col"},ee={class:"font-medium"},te={class:"text-sm text-amber-600 dark:text-amber-400"},ae={class:"relative"},le=g({__name:"RadioCardManySelect",props:f({items:null,searchable:{type:Boolean,default:!0},searchPlaceholder:{default:"Search..."},searchNoResultsTitle:{default:"No results found"},searchNoResultsDescription:{default:"Try a different search term"},searchResultsText:{default:"{count} of {total} results"},customInputPlaceholder:{default:"Enter custom value"},expandButtonText:{default:"Show more"},collapseButtonText:{default:"Show less"},showMore:{type:Boolean,default:!0}},{modelValue:{required:!0},modelModifiers:{}}),emits:f(["update:customValue"],["update:modelValue"]),setup(e,{emit:a}){const m=e,s=a,x=w(e,"modelValue"),r=b(""),u=b(!1),B=b(""),h=T(()=>{if(!r.value)return m.items;const p=r.value.toLowerCase();return m.items.filter(l=>l.name.toLowerCase().includes(p)||l.description&&l.description.toLowerCase().includes(p))});function M(p){B.value=p,s("update:customValue",p)}return(p,l)=>(d(),n("div",Q,[e.searchable?(d(),n("div",J,[l[4]||(l[4]=t("div",{class:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3"},[t("div",{"i-solar:magnifer-line-duotone":"",class:"text-neutral-500 dark:text-neutral-400"})],-1)),V(t("input",{"onUpdate:modelValue":l[0]||(l[0]=i=>r.value=i),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:e.searchPlaceholder},null,8,W),[[E,r.value]])])):v("",!0),t("div",X,[r.value?(d(),n("div",Y,c(e.searchResultsText.replace("{count}",h.value.length.toString()).replace("{total}",e.items.length.toString())),1)):v("",!0),r.value&&h.value.length===0?(d(),n("div",Z,[l[5]||(l[5]=t("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1)),t("div",_,[t("span",ee,c(e.searchNoResultsTitle),1),t("span",te,c(e.searchNoResultsDescription.replace("{query}",r.value)),1)])])):v("",!0),t("div",ae,[t("div",{class:o(["grid auto-cols-[350px] grid-flow-col max-h-[calc(100dvh-7lh)] gap-4 overflow-x-auto pb-4 scrollbar-none",[u.value?"grid-cols-1 md:grid-cols-2 grid-flow-row auto-cols-auto":""]]),transition:"all duration-200 ease-in-out",style:{"scroll-snap-type":"x mandatory"}},[(d(!0),n(z,null,N(h.value,i=>(d(),D(O,{id:i.id,key:i.id,modelValue:x.value,"onUpdate:modelValue":l[1]||(l[1]=y=>x.value=y),value:i.id,title:i.name,description:i.description,deprecated:i.deprecated,"show-expand-collapse":e.showMore,"expand-collapse-threshold":100,"show-custom-input":i.customizable,"custom-input-value":B.value,"custom-input-placeholder":e.customInputPlaceholder,name:"radio-card-detail-many-select",class:"scroll-snap-align-start","onUpdate:customInputValue":l[2]||(l[2]=y=>M(y))},null,8,["id","modelValue","value","title","description","deprecated","show-expand-collapse","show-custom-input","custom-input-value","custom-input-placeholder"]))),128))],2),t("div",{bg:"neutral-100 dark:[rgba(0,0,0,0.3)]","rounded-xl":"",class:o([u.value?"w-full":"mt-4 w-full rounded-lg"])},[t("button",{"w-full":"",flex:"","items-center":"","justify-center":"","gap-2":"","rounded-lg":"","py-2":"",transition:"all duration-200 ease-in-out",class:o([u.value?"bg-primary-500 hover:bg-primary-600 text-white":"bg-white dark:bg-neutral-900 hover:bg-neutral-100 dark:hover:bg-neutral-800"]),onClick:l[3]||(l[3]=i=>u.value=!u.value)},[t("span",null,c(u.value?e.collapseButtonText:e.expandButtonText),1),t("div",{class:o([u.value?"rotate-180":"","text-lg"]),"i-solar:alt-arrow-down-bold-duotone":"",transition:"transform duration-200 ease-in-out"},null,2)],2)],2)])])]))}}),me=C(le,[["__scopeId","data-v-7ad6d626"]]),re=["checked","name","value"],oe={flex:"~ col","min-h-16":"","w-full":"","items-start":"","justify-center":"","pb-2":"","pl-5":"","pr-4":"","pt-2":""},de=g({__name:"RadioCardSimple",props:f({id:null,name:null,value:null,title:null,description:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const a=w(e,"modelValue");return(m,s)=>(d(),n("label",{key:e.id,border:"2px solid",class:o(["form_radio-card-simple relative",[a.value===e.value?"bg-primary-50 dark:bg-primary-900/20 border-primary-100 dark:border-primary-900 hover:border-primary-500/30 dark:hover:border-primary-400/30":"bg-white dark:bg-neutral-900/20 border-neutral-100 dark:border-neutral-900 hover:border-primary-500/30 dark:hover:border-primary-400/30",a.value===e.value?"form_radio-card-simple-active":""]]),transition:"all duration-200 ease-in-out",flex:"~ col",block:"","min-w-50":"","w-fit":"","cursor-pointer":"","items-start":"","rounded-xl":"","p-4":"","text-left":""},[V(t("input",{"onUpdate:modelValue":s[0]||(s[0]=x=>a.value=x),checked:a.value===e.value,type:"radio",name:e.name,value:e.value,class:"[&:checked+div]:border-primary-500 dark:[&:checked+div]:border-primary-400 absolute opacity-0 [&:checked+div_.radio-dot]:opacity-100"},null,8,re),[[I,a.value]]),s[1]||(s[1]=t("div",{class:"radio-circle absolute left-2 top-2 size-5 rounded-full",border:"2 solid neutral-300 dark:neutral-600",transition:"all duration-200 ease-in-out"},[t("div",{class:"radio-dot absolute left-1/2 top-1/2 size-3 rounded-full opacity-0 -translate-x-1/2 -translate-y-1/2",transition:"all duration-200 ease-in-out",bg:"primary-500 dark:primary-400"})],-1)),t("div",oe,[t("span",{class:o(["radio-item-name font-bold",[a.value===e.value?"text-neutral-700 dark:text-neutral-300":"text-neutral-500 dark:text-neutral-500"]]),text:"md",transition:"all duration-200 ease-in-out"},c(e.title),3),e.description?(d(),n("span",{key:0,class:o(["radio-item-description",[a.value===e.value?"text-neutral-600 dark:text-neutral-400":"text-neutral-400 dark:text-neutral-600"]]),transition:"all duration-200 ease-in-out"},c(e.description),3)):v("",!0)]),s[2]||(s[2]=t("div",{class:"bg-dotted-neutral-200/80 dark:bg-dotted-neutral-700/50 [input:checked~&]:bg-dotted-primary-300/50 dark:[input:checked~&]:bg-dotted-primary-200/20",absolute:"","inset-0":"","z--1":"",style:{"background-size":"10px 10px","mask-image":"linear-gradient(165deg, white 30%, transparent 50%)"}},null,-1))],2))}}),ve=C(de,[["__scopeId","data-v-475841e0"]]);export{me as R,ve as a}; diff --git a/assets/SpeechProviderSettings.vue_vue_type_script_setup_true_lang-ByvvVpU4.js b/assets/SpeechProviderSettings.vue_vue_type_script_setup_true_lang-ByvvVpU4.js deleted file mode 100644 index fec4904ba5f045d78bb0e86c5da1d82d3f14e0ce..0000000000000000000000000000000000000000 --- a/assets/SpeechProviderSettings.vue_vue_type_script_setup_true_lang-ByvvVpU4.js +++ /dev/null @@ -1 +0,0 @@ -import{d as K,bz as ee,c as b,o as g,B as $,G as O,a,F as G,bA as H,k as q,r as u,w as B,g as J,b as T,u as s,t as k,i as R,bH as E,bJ as te,bB as oe,h as ae,s as le,l as M,f as se,m as re,E as C,bW as A,bX as D,bS as ie}from"./index-D3pfQUMu.js";import{b as ne,a as ue}from"./FieldRange.vue_vue_type_script_setup_true_lang-IEKed7Lk.js";/* empty css */import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-t8bgqiA6.js";import"./three-vrm-animation.module-DLbUhddZ.js";import"./emotions-CAex_2dA.js";import{u as de,g as ve}from"./speech-CIOuIakE.js";import{u as ce}from"./providers-CCvie00Z.js";import{_ as pe,a as me}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Qp-g_fu5.js";import{_ as fe}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-yC-Tsbbb.js";import{_ as ge,a as be}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C8wZQWhG.js";const he={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":""},_e=K({__name:"ProviderSettingsLayout2",props:{providerName:null,providerIcon:null,providerIconColor:null,onBack:{type:Function}},setup(x){return(o,S)=>{const d=ee("motion");return g(),b(H,null,[$(o.$slots,"default"),O((g(),b("div",he,[a("div",{text:"60",class:G(x.providerIcon||x.providerIconColor)},null,2)])),[[d]])],64)}}}),xe={"w-full":"","rounded-xl":""},ye={class:"mb-4 text-lg text-neutral-500 md:text-2xl dark:text-neutral-400","w-full":""},ke={class:"inline-flex items-center gap-4"},Se={flex:"~ col gap-4"},Ue=["placeholder"],we=["placeholder"],Ie={flex:"~ col gap-6"},Ve={grid:"~ cols-2 gap-4"},Te={class:"flex items-center gap-1 text-sm font-medium"},$e={class:"text-xs text-neutral-500 dark:text-neutral-400"},Le=["value"],Re={flex:"~ row","gap-4":""},Pe=["disabled"],Me={flex:"~ row","items-center":"","gap-2":""},Ce={flex:"~ row","items-center":"","gap-2":""},Oe={key:2,class:"mt-2 text-sm text-red-500"},ze={key:3,class:"mt-2 text-sm text-red-500"},Be={key:4,class:"mt-2 text-sm text-red-500"},Ke=["src"],ot=K({__name:"SpeechPlayground",props:{defaultText:null,availableVoices:null,generateSpeech:{type:Function},apiKeyConfigured:{type:Boolean}},setup(x,{expose:o}){const S=x,{t:d}=q(),m=u(S.defaultText||"Hello! This is a test of the voice synthesis."),U=u(!1),t=u(""),c=u(""),f=u(null),i=u(!1),h=u(""),p=u("");B(()=>S.availableVoices,n=>{var r;n.length>0&&!p.value&&(p.value=((r=n[0])==null?void 0:r.id)||"")},{immediate:!0});async function _(){if(!(!m.value.trim()&&!i.value||i.value&&!h.value.trim()||!p.value)){U.value=!0,c.value="";try{t.value&&I();const n=i.value?h.value:m.value,r=await S.generateSpeech(n,p.value,i.value);t.value=URL.createObjectURL(new Blob([r])),setTimeout(()=>{f.value&&f.value.play()},100)}catch(n){console.error("Error generating speech:",n),c.value=n instanceof Error?n.message:"An unknown error occurred"}finally{U.value=!1}}}function I(){f.value&&(f.value.pause(),f.value.currentTime=0),t.value&&(URL.revokeObjectURL(t.value),t.value="")}return J(()=>{t.value&&URL.revokeObjectURL(t.value)}),o({testText:m,ssmlText:h,useSSML:i,selectedVoice:p,isGenerating:U,audioUrl:t,errorMessage:c,audioPlayer:f,generateTestSpeech:_,stopTestAudio:I}),(n,r)=>(g(),b("div",xe,[a("h2",ye,[a("div",ke,[T(s(ne)),a("div",null,k(s(d)("settings.pages.providers.provider.elevenlabs.playground.title")),1)])]),a("div",Se,[T(s(ue),{modelValue:i.value,"onUpdate:modelValue":r[0]||(r[0]=v=>i.value=v),label:s(d)("settings.pages.modules.speech.sections.section.voice-settings.use-ssml.label"),description:s(d)("settings.pages.modules.speech.sections.section.voice-settings.use-ssml.description")},null,8,["modelValue","label","description"]),i.value?O((g(),b("textarea",{key:1,"onUpdate:modelValue":r[2]||(r[2]=v=>h.value=v),placeholder:s(d)("settings.pages.modules.speech.sections.section.voice-settings.input-ssml.placeholder"),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,8,we)),[[E,h.value]]):O((g(),b("textarea",{key:0,"onUpdate:modelValue":r[1]||(r[1]=v=>m.value=v),placeholder:s(d)("settings.pages.providers.provider.elevenlabs.playground.fields.field.input.placeholder"),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-24":"","w-full":"","rounded-lg":"","px-3":"","py-2":"","text-sm":"","outline-none":""},null,8,Ue)),[[E,m.value]]),a("div",Ie,[a("label",Ve,[a("div",null,[a("div",Te,k(s(d)("settings.pages.providers.provider.elevenlabs.playground.fields.field.voice.label")),1),a("div",$e,k(s(d)("settings.pages.providers.provider.elevenlabs.playground.fields.field.voice.description")),1)]),O(a("select",{"onUpdate:modelValue":r[3]||(r[3]=v=>p.value=v),border:"neutral-300 dark:neutral-800 solid 2 focus:neutral-400 dark:focus:neutral-600",transition:"border duration-250 ease-in-out","w-full":"","rounded-lg":"","px-2":"","py-1":"","text-nowrap":"","text-sm":"","outline-none":""},[(g(!0),b(H,null,oe(x.availableVoices,v=>(g(),b("option",{key:v.id,value:v.id},k(v.name),9,Le))),128))],512),[[te,p.value]])])]),a("div",Re,[a("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:U.value||!m.value.trim()&&!i.value||i.value&&!h.value.trim()||!p.value||!x.apiKeyConfigured,class:G({"opacity-50 cursor-not-allowed":U.value||!m.value.trim()&&!i.value||i.value&&!h.value.trim()||!p.value||!x.apiKeyConfigured}),bg:"neutral-700 dark:neutral-300",onClick:_},[a("div",Me,[r[4]||(r[4]=a("div",{"i-solar:play-circle-bold-duotone":""},null,-1)),a("span",null,k(U.value?s(d)("settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.generating"):s(d)("settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.label")),1)])],10,Pe),t.value?(g(),b("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:I},[a("div",Ce,[r[5]||(r[5]=a("div",{"i-solar:stop-circle-bold-duotone":""},null,-1)),a("span",null,k(s(d)("settings.pages.modules.speech.sections.section.playground.buttons.stop.label")),1)])])):R("",!0)]),x.apiKeyConfigured?R("",!0):(g(),b("div",Oe,k(s(d)("settings.pages.providers.provider.elevenlabs.playground.validation.error-missing-api-key")),1)),p.value?R("",!0):(g(),b("div",ze,k(s(d)("settings.pages.modules.speech.sections.section.playground.select-voice.required")),1)),c.value?(g(),b("div",Be,k(c.value),1)):R("",!0),t.value?(g(),b("audio",{key:5,ref_key:"audioPlayer",ref:f,src:t.value,controls:"",class:"mt-2 w-full"},null,8,Ke)):R("",!0)]),$(n.$slots,"default")]))}}),Fe={flex:"~ col md:row gap-6"},Ne={flex:"~ col gap-6"},je={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},Ee={flex:"~ col gap-4"},Ae={flex:"~ col gap-6",class:"w-full md:w-[60%]"},De={"w-full":"","rounded-xl":""},at=K({__name:"SpeechProviderSettings",props:{providerId:null,defaultModel:null,additionalSettings:null},setup(x){const o=x,{t:S}=q(),d=ae(),m=ce(),U=de(),{providers:t}=le(m),c=M(()=>m.getProviderMetadata(o.providerId)),f=M({get:()=>{var e;return((e=t.value[o.providerId])==null?void 0:e.apiKey)||""},set:e=>{t.value[o.providerId]||(t.value[o.providerId]={}),t.value[o.providerId].apiKey=e}}),i=M({get:()=>{var e,l,y;return((e=t.value[o.providerId])==null?void 0:e.baseUrl)||((y=(l=c.value)==null?void 0:l.defaultOptions)==null?void 0:y.baseUrl)||""},set:e=>{t.value[o.providerId]||(t.value[o.providerId]={}),t.value[o.providerId].baseUrl=e}}),h=u("Hello! This is a test of voice synthesis."),p=u(!1),_=u(""),I=u(""),n=u(null),r=u(!1),v=u(""),F=u(""),w=u({});function W(){var e;(e=t.value[o.providerId])!=null&&e.voiceSettings?w.value={...t.value[o.providerId].voiceSettings}:w.value={pitch:0,speed:1,volume:0,...o.additionalSettings}}se(()=>{var e,l,y,V;m.initializeProvider(o.providerId),f.value=((e=t.value[o.providerId])==null?void 0:e.apiKey)||"",i.value=((l=t.value[o.providerId])==null?void 0:l.baseUrl)||((V=(y=c.value)==null?void 0:y.defaultOptions)==null?void 0:V.baseUrl)||"",W(),m.configuredProviders[o.providerId]&&U.loadVoicesForProvider(o.providerId)});const z=ie(()=>{var e,l;t.value[o.providerId]={...t.value[o.providerId],apiKey:f.value,baseUrl:i.value||((l=(e=c.value)==null?void 0:e.defaultOptions)==null?void 0:l.baseUrl)||"",voiceSettings:{...w.value}}},1e3);B([f,i],z),B(w,z,{deep:!0});async function X(){if(!h.value.trim()&&!r.value||r.value&&!v.value.trim())return;const e=m.getProviderInstance(o.providerId);if(!e){console.error("Failed to initialize speech provider");return}if(!F.value){console.error("No active speech voice selected");return}p.value=!0,I.value="";try{_.value&&N();const l=o.defaultModel||"default",y=r.value?v.value:h.value,V=await ve({...e.speech(l,{voiceSettings:w.value}),input:y,voice:F.value});_.value=URL.createObjectURL(new Blob([V])),setTimeout(()=>{n.value&&n.value.play()},100)}catch(l){console.error("Error generating speech:",l),I.value=l instanceof Error?l.message:"An unknown error occurred"}finally{p.value=!1}}function N(){n.value&&(n.value.pause(),n.value.currentTime=0),_.value&&(URL.revokeObjectURL(_.value),_.value="")}J(()=>{_.value&&URL.revokeObjectURL(_.value)});function Q(){var e,l;w.value={...((l=(e=c.value)==null?void 0:e.defaultOptions)==null?void 0:l.voiceSettings)||{}},z()}function Y(e,l){w.value[e]=l}const j=M(()=>({voiceSettings:w.value,updateVoiceSettings:Y,isGenerating:p.value,testText:h.value,useSSML:r.value,ssmlText:v.value,generateTestSpeech:X,stopTestAudio:N,audioUrl:_.value,audioPlayer:n.value,errorMessage:I.value}));return(e,l)=>{var y,V;return g(),re(_e,{"provider-name":(y=c.value)==null?void 0:y.localizedName,"provider-icon":(V=c.value)==null?void 0:V.icon,"on-back":()=>s(d).back()},{default:C(()=>[a("div",Fe,[T(s(ge),{class:"w-full md:w-[40%]"},{default:C(()=>[T(s(be),{title:s(S)("settings.pages.providers.common.section.basic.title"),description:s(S)("settings.pages.providers.common.section.basic.description"),"on-reset":Q},{default:C(()=>{var L;return[T(s(fe),{modelValue:f.value,"onUpdate:modelValue":l[0]||(l[0]=P=>f.value=P),"provider-name":(L=c.value)==null?void 0:L.localizedName,placeholder:"sk-"},null,8,["modelValue","provider-name"]),$(e.$slots,"basic-settings")]}),_:3},8,["title","description"]),a("div",Ne,[a("h2",je,k(s(S)("settings.pages.providers.common.section.voice.title")),1),a("div",Ee,[$(e.$slots,"voice-settings",A(D(j.value)))])]),T(s(pe),{title:s(S)("settings.pages.providers.common.section.advanced.title")},{default:C(()=>{var L,P;return[T(s(me),{modelValue:i.value,"onUpdate:modelValue":l[1]||(l[1]=Z=>i.value=Z),placeholder:((P=(L=c.value)==null?void 0:L.defaultOptions)==null?void 0:P.baseUrl)||"",required:""},null,8,["modelValue","placeholder"]),$(e.$slots,"advanced-settings")]}),_:3},8,["title"])]),_:3}),a("div",Ae,[a("div",De,[$(e.$slots,"playground",A(D(j.value)))])])])]),_:3},8,["provider-name","provider-icon","on-back"])}}});export{ot as _,at as a}; diff --git a/assets/SpeechProviderSettings.vue_vue_type_script_setup_true_lang-DQ9q1Mut.js b/assets/SpeechProviderSettings.vue_vue_type_script_setup_true_lang-DQ9q1Mut.js new file mode 100644 index 0000000000000000000000000000000000000000..21c2ba5c73a7dc538190d43c5d7064269cd23e0a --- /dev/null +++ b/assets/SpeechProviderSettings.vue_vue_type_script_setup_true_lang-DQ9q1Mut.js @@ -0,0 +1 @@ +import{d as B,K as ee,c as b,o as g,f as $,x as O,e as a,n as G,F as H,g as q,r as u,v as z,I as J,i as T,b as s,t as k,j as R,y as D,O as te,l as oe,U as ae,s as le,h as C,H as se,A as re,w as M,C as A,D as E,aw as ie}from"./index-BNq7Hbz_.js";import{b as ne,a as ue}from"./FieldRange.vue_vue_type_script_setup_true_lang-RRSKRN5w.js";/* empty css */import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-B6whjTNv.js";import"./three-vrm-animation.module-BPuMi1if.js";import"./mcp-D2taTyhO.js";import"./mini_xsschema-P_8cZcRg.js";import{u as de,g as ve}from"./speech-CKvssz06.js";import{u as ce}from"./providers-Ddg6LLwH.js";import{_ as pe,a as me}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DETFnj2t.js";import{_ as fe}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-8yNUgi8_.js";import{_ as ge,a as be}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C-W-PZMl.js";const he={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":""},xe=B({__name:"ProviderSettingsLayout2",props:{providerName:null,providerIcon:null,providerIconColor:null,onBack:{type:Function}},setup(_){return(o,S)=>{const d=ee("motion");return g(),b(H,null,[$(o.$slots,"default"),O((g(),b("div",he,[a("div",{text:"60",class:G(_.providerIcon||_.providerIconColor)},null,2)])),[[d]])],64)}}}),_e={"w-full":"","rounded-xl":""},ye={class:"mb-4 text-lg text-neutral-500 md:text-2xl dark:text-neutral-400","w-full":""},ke={class:"inline-flex items-center gap-4"},Se={flex:"~ col gap-4"},Ue=["placeholder"],we=["placeholder"],Ie={flex:"~ col gap-6"},Ve={grid:"~ cols-2 gap-4"},Te={class:"flex items-center gap-1 text-sm font-medium"},$e={class:"text-xs text-neutral-500 dark:text-neutral-400"},Le=["value"],Re={flex:"~ row","gap-4":""},Pe=["disabled"],Ce={flex:"~ row","items-center":"","gap-2":""},Me={flex:"~ row","items-center":"","gap-2":""},Oe={key:2,class:"mt-2 text-sm text-red-500"},Ke={key:3,class:"mt-2 text-sm text-red-500"},ze={key:4,class:"mt-2 text-sm text-red-500"},Be=["src"],at=B({__name:"SpeechPlayground",props:{defaultText:null,availableVoices:null,generateSpeech:{type:Function},apiKeyConfigured:{type:Boolean}},setup(_,{expose:o}){const S=_,{t:d}=q(),m=u(S.defaultText||"Hello! This is a test of the voice synthesis."),U=u(!1),t=u(""),c=u(""),f=u(null),i=u(!1),h=u(""),p=u("");z(()=>S.availableVoices,n=>{var r;n.length>0&&!p.value&&(p.value=((r=n[0])==null?void 0:r.id)||"")},{immediate:!0});async function x(){if(!(!m.value.trim()&&!i.value||i.value&&!h.value.trim()||!p.value)){U.value=!0,c.value="";try{t.value&&I();const n=i.value?h.value:m.value,r=await S.generateSpeech(n,p.value,i.value);t.value=URL.createObjectURL(new Blob([r])),setTimeout(()=>{f.value&&f.value.play()},100)}catch(n){console.error("Error generating speech:",n),c.value=n instanceof Error?n.message:"An unknown error occurred"}finally{U.value=!1}}}function I(){f.value&&(f.value.pause(),f.value.currentTime=0),t.value&&(URL.revokeObjectURL(t.value),t.value="")}return J(()=>{t.value&&URL.revokeObjectURL(t.value)}),o({testText:m,ssmlText:h,useSSML:i,selectedVoice:p,isGenerating:U,audioUrl:t,errorMessage:c,audioPlayer:f,generateTestSpeech:x,stopTestAudio:I}),(n,r)=>(g(),b("div",_e,[a("h2",ye,[a("div",ke,[T(s(ne)),a("div",null,k(s(d)("settings.pages.providers.provider.elevenlabs.playground.title")),1)])]),a("div",Se,[T(s(ue),{modelValue:i.value,"onUpdate:modelValue":r[0]||(r[0]=v=>i.value=v),label:s(d)("settings.pages.modules.speech.sections.section.voice-settings.use-ssml.label"),description:s(d)("settings.pages.modules.speech.sections.section.voice-settings.use-ssml.description")},null,8,["modelValue","label","description"]),i.value?O((g(),b("textarea",{key:1,"onUpdate:modelValue":r[2]||(r[2]=v=>h.value=v),placeholder:s(d)("settings.pages.modules.speech.sections.section.voice-settings.input-ssml.placeholder"),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,8,we)),[[D,h.value]]):O((g(),b("textarea",{key:0,"onUpdate:modelValue":r[1]||(r[1]=v=>m.value=v),placeholder:s(d)("settings.pages.providers.provider.elevenlabs.playground.fields.field.input.placeholder"),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-24":"","w-full":"","rounded-lg":"","px-3":"","py-2":"","text-sm":"","outline-none":""},null,8,Ue)),[[D,m.value]]),a("div",Ie,[a("label",Ve,[a("div",null,[a("div",Te,k(s(d)("settings.pages.providers.provider.elevenlabs.playground.fields.field.voice.label")),1),a("div",$e,k(s(d)("settings.pages.providers.provider.elevenlabs.playground.fields.field.voice.description")),1)]),O(a("select",{"onUpdate:modelValue":r[3]||(r[3]=v=>p.value=v),border:"neutral-300 dark:neutral-800 solid 2 focus:neutral-400 dark:focus:neutral-600",transition:"border duration-250 ease-in-out","w-full":"","rounded-lg":"","px-2":"","py-1":"","text-nowrap":"","text-sm":"","outline-none":""},[(g(!0),b(H,null,oe(_.availableVoices,v=>(g(),b("option",{key:v.id,value:v.id},k(v.name),9,Le))),128))],512),[[te,p.value]])])]),a("div",Re,[a("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:U.value||!m.value.trim()&&!i.value||i.value&&!h.value.trim()||!p.value||!_.apiKeyConfigured,class:G({"opacity-50 cursor-not-allowed":U.value||!m.value.trim()&&!i.value||i.value&&!h.value.trim()||!p.value||!_.apiKeyConfigured}),bg:"neutral-700 dark:neutral-300",onClick:x},[a("div",Ce,[r[4]||(r[4]=a("div",{"i-solar:play-circle-bold-duotone":""},null,-1)),a("span",null,k(U.value?s(d)("settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.generating"):s(d)("settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.label")),1)])],10,Pe),t.value?(g(),b("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:I},[a("div",Me,[r[5]||(r[5]=a("div",{"i-solar:stop-circle-bold-duotone":""},null,-1)),a("span",null,k(s(d)("settings.pages.modules.speech.sections.section.playground.buttons.stop.label")),1)])])):R("",!0)]),_.apiKeyConfigured?R("",!0):(g(),b("div",Oe,k(s(d)("settings.pages.providers.provider.elevenlabs.playground.validation.error-missing-api-key")),1)),p.value?R("",!0):(g(),b("div",Ke,k(s(d)("settings.pages.modules.speech.sections.section.playground.select-voice.required")),1)),c.value?(g(),b("div",ze,k(c.value),1)):R("",!0),t.value?(g(),b("audio",{key:5,ref_key:"audioPlayer",ref:f,src:t.value,controls:"",class:"mt-2 w-full"},null,8,Be)):R("",!0)]),$(n.$slots,"default")]))}}),je={flex:"~ col md:row gap-6"},Fe={flex:"~ col gap-6"},Ne={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},De={flex:"~ col gap-4"},Ae={flex:"~ col gap-6",class:"w-full md:w-[60%]"},Ee={"w-full":"","rounded-xl":""},lt=B({__name:"SpeechProviderSettings",props:{providerId:null,defaultModel:null,additionalSettings:null},setup(_){const o=_,{t:S}=q(),d=ae(),m=ce(),U=de(),{providers:t}=le(m),c=C(()=>m.getProviderMetadata(o.providerId)),f=C({get:()=>{var e;return((e=t.value[o.providerId])==null?void 0:e.apiKey)||""},set:e=>{t.value[o.providerId]||(t.value[o.providerId]={}),t.value[o.providerId].apiKey=e}}),i=C({get:()=>{var e,l,y;return((e=t.value[o.providerId])==null?void 0:e.baseUrl)||((y=(l=c.value)==null?void 0:l.defaultOptions)==null?void 0:y.baseUrl)||""},set:e=>{t.value[o.providerId]||(t.value[o.providerId]={}),t.value[o.providerId].baseUrl=e}}),h=u("Hello! This is a test of voice synthesis."),p=u(!1),x=u(""),I=u(""),n=u(null),r=u(!1),v=u(""),j=u(""),w=u({});function Q(){var e;(e=t.value[o.providerId])!=null&&e.voiceSettings?w.value={...t.value[o.providerId].voiceSettings}:w.value={pitch:0,speed:1,volume:0,...o.additionalSettings}}se(()=>{var e,l,y,V;m.initializeProvider(o.providerId),f.value=((e=t.value[o.providerId])==null?void 0:e.apiKey)||"",i.value=((l=t.value[o.providerId])==null?void 0:l.baseUrl)||((V=(y=c.value)==null?void 0:y.defaultOptions)==null?void 0:V.baseUrl)||"",Q(),m.configuredProviders[o.providerId]&&U.loadVoicesForProvider(o.providerId)});const K=ie(()=>{var e,l;t.value[o.providerId]={...t.value[o.providerId],apiKey:f.value,baseUrl:i.value||((l=(e=c.value)==null?void 0:e.defaultOptions)==null?void 0:l.baseUrl)||"",voiceSettings:{...w.value}}},1e3);z([f,i],K),z(w,K,{deep:!0});async function W(){if(!h.value.trim()&&!r.value||r.value&&!v.value.trim())return;const e=m.getProviderInstance(o.providerId);if(!e){console.error("Failed to initialize speech provider");return}if(!j.value){console.error("No active speech voice selected");return}p.value=!0,I.value="";try{x.value&&F();const l=o.defaultModel||"default",y=r.value?v.value:h.value,V=await ve({...e.speech(l,{voiceSettings:w.value}),input:y,voice:j.value});x.value=URL.createObjectURL(new Blob([V])),setTimeout(()=>{n.value&&n.value.play()},100)}catch(l){console.error("Error generating speech:",l),I.value=l instanceof Error?l.message:"An unknown error occurred"}finally{p.value=!1}}function F(){n.value&&(n.value.pause(),n.value.currentTime=0),x.value&&(URL.revokeObjectURL(x.value),x.value="")}J(()=>{x.value&&URL.revokeObjectURL(x.value)});function X(){var e,l;w.value={...((l=(e=c.value)==null?void 0:e.defaultOptions)==null?void 0:l.voiceSettings)||{}},K()}function Y(e,l){w.value[e]=l}const N=C(()=>({voiceSettings:w.value,updateVoiceSettings:Y,isGenerating:p.value,testText:h.value,useSSML:r.value,ssmlText:v.value,generateTestSpeech:W,stopTestAudio:F,audioUrl:x.value,audioPlayer:n.value,errorMessage:I.value}));return(e,l)=>{var y,V;return g(),re(xe,{"provider-name":(y=c.value)==null?void 0:y.localizedName,"provider-icon":(V=c.value)==null?void 0:V.icon,"on-back":()=>s(d).back()},{default:M(()=>[a("div",je,[T(s(ge),{class:"w-full md:w-[40%]"},{default:M(()=>[T(s(be),{title:s(S)("settings.pages.providers.common.section.basic.title"),description:s(S)("settings.pages.providers.common.section.basic.description"),"on-reset":X},{default:M(()=>{var L;return[T(s(fe),{modelValue:f.value,"onUpdate:modelValue":l[0]||(l[0]=P=>f.value=P),"provider-name":(L=c.value)==null?void 0:L.localizedName,placeholder:"sk-"},null,8,["modelValue","provider-name"]),$(e.$slots,"basic-settings")]}),_:3},8,["title","description"]),a("div",Fe,[a("h2",Ne,k(s(S)("settings.pages.providers.common.section.voice.title")),1),a("div",De,[$(e.$slots,"voice-settings",A(E(N.value)))])]),T(s(pe),{title:s(S)("settings.pages.providers.common.section.advanced.title")},{default:M(()=>{var L,P;return[T(s(me),{modelValue:i.value,"onUpdate:modelValue":l[1]||(l[1]=Z=>i.value=Z),placeholder:((P=(L=c.value)==null?void 0:L.defaultOptions)==null?void 0:P.baseUrl)||"",required:""},null,8,["modelValue","placeholder"]),$(e.$slots,"advanced-settings")]}),_:3},8,["title"])]),_:3}),a("div",Ae,[a("div",Ee,[$(e.$slots,"playground",A(E(N.value)))])])])]),_:3},8,["provider-name","provider-icon","on-back"])}}});export{at as _,lt as a}; diff --git a/assets/Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-t8bgqiA6.js b/assets/Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-B6whjTNv.js similarity index 99% rename from assets/Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-t8bgqiA6.js rename to assets/Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-B6whjTNv.js index c8db1d38d74bd44656051a195536559c52176be9..b31e7432ac18f7437b9b7e62bc27f85cf249a76c 100644 --- a/assets/Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-t8bgqiA6.js +++ b/assets/Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-B6whjTNv.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/default-node-DRO9_bbw.js","assets/index-D3pfQUMu.js","assets/index-Bsn4xRdB.css","assets/import-url-browser-CPN8ipMD.js","assets/duckdb-mvp-CaaD-olE.js","assets/import-url-node-BfNoxhRr.js"])))=>i.map(i=>d[i]); -var Ix=Object.defineProperty;var Ex=(r,t,e)=>t in r?Ix(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var G=(r,t,e)=>Ex(r,typeof t!="symbol"?t+"":t,e);import{bp as Nh,cg as gi,bs as Cx,ch as ln}from"./index-D3pfQUMu.js";/*! +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/default-node-Dkg9OG4q.js","assets/index-BNq7Hbz_.js","assets/index-Bsn4xRdB.css","assets/import-url-browser-CPN8ipMD.js","assets/duckdb-mvp-CaaD-olE.js","assets/import-url-node-BfNoxhRr.js"])))=>i.map(i=>d[i]); +var Ix=Object.defineProperty;var Ex=(r,t,e)=>t in r?Ix(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var G=(r,t,e)=>Ex(r,typeof t!="symbol"?t+"":t,e);import{cn as Nh,cu as gi,co as Cx,L as ln}from"./index-BNq7Hbz_.js";/*! * @pixi/constants - v6.5.10 * Compiled Thu, 06 Jul 2023 15:25:11 UTC * @@ -3095,10 +3095,10 @@ https://github.com/nodeca/pako/blob/main/LICENSE \0`,et+=s(C,2),et+=F.magic,et+=s(S,2),et+=s(E,2),et+=s(k.crc32,4),et+=s(k.compressedSize,4),et+=s(k.uncompressedSize,4),et+=s(z.length,2),et+=s(it.length,2),{fileRecord:h.LOCAL_FILE_HEADER+et+z+it,dirRecord:h.CENTRAL_FILE_HEADER+s($,2)+et+s(st.length,2)+"\0\0\0\0"+s(A,4)+s(d,4)+z+it+st}}var a=e("../utils"),l=e("../stream/GenericWorker"),u=e("../utf8"),c=e("../crc32"),h=e("../signature");function p(f,y,g,d){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=y,this.zipPlatform=g,this.encodeFileName=d,this.streamFiles=f,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(p,l),p.prototype.push=function(f){var y=f.meta.percent||0,g=this.entriesCount,d=this._sources.length;this.accumulate?this.contentBuffer.push(f):(this.bytesWritten+=f.data.length,l.prototype.push.call(this,{data:f.data,meta:{currentFile:this.currentFile,percent:g?(y+100*(g-d-1))/g:100}}))},p.prototype.openedSource=function(f){this.currentSourceOffset=this.bytesWritten,this.currentFile=f.file.name;var y=this.streamFiles&&!f.file.dir;if(y){var g=o(f,y,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:g.fileRecord,meta:{percent:0}})}else this.accumulate=!0},p.prototype.closedSource=function(f){this.accumulate=!1;var y=this.streamFiles&&!f.file.dir,g=o(f,y,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(g.dirRecord),y)this.push({data:function(d){return h.DATA_DESCRIPTOR+s(d.crc32,4)+s(d.compressedSize,4)+s(d.uncompressedSize,4)}(f),meta:{percent:100}});else for(this.push({data:g.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},p.prototype.flush=function(){for(var f=this.bytesWritten,y=0;y=this.index;l--)u=(u<<8)+this.byteAt(l);return this.index+=a,u},readString:function(a){return s.transformTo("string",this.readData(a))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var a=this.readInt(4);return new Date(Date.UTC(1980+(a>>25&127),(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1))}},i.exports=o},{"../utils":32}],19:[function(e,i,n){var s=e("./Uint8ArrayReader");function o(a){s.call(this,a)}e("../utils").inherits(o,s),o.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},i.exports=o},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,i,n){var s=e("./DataReader");function o(a){s.call(this,a)}e("../utils").inherits(o,s),o.prototype.byteAt=function(a){return this.data.charCodeAt(this.zero+a)},o.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)-this.zero},o.prototype.readAndCheckSignature=function(a){return a===this.readData(4)},o.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},i.exports=o},{"../utils":32,"./DataReader":18}],21:[function(e,i,n){var s=e("./ArrayReader");function o(a){s.call(this,a)}e("../utils").inherits(o,s),o.prototype.readData=function(a){if(this.checkOffset(a),a===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},i.exports=o},{"../utils":32,"./ArrayReader":17}],22:[function(e,i,n){var s=e("../utils"),o=e("../support"),a=e("./ArrayReader"),l=e("./StringReader"),u=e("./NodeBufferReader"),c=e("./Uint8ArrayReader");i.exports=function(h){var p=s.getTypeOf(h);return s.checkSupport(p),p!=="string"||o.uint8array?p==="nodebuffer"?new u(h):o.uint8array?new c(s.transformTo("uint8array",h)):new a(s.transformTo("array",h)):new l(h)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,i,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,i,n){var s=e("./GenericWorker"),o=e("../utils");function a(l){s.call(this,"ConvertWorker to "+l),this.destType=l}o.inherits(a,s),a.prototype.processChunk=function(l){this.push({data:o.transformTo(this.destType,l.data),meta:l.meta})},i.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(e,i,n){var s=e("./GenericWorker"),o=e("../crc32");function a(){s.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}e("../utils").inherits(a,s),a.prototype.processChunk=function(l){this.streamInfo.crc32=o(l.data,this.streamInfo.crc32||0),this.push(l)},i.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,i,n){var s=e("../utils"),o=e("./GenericWorker");function a(l){o.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}s.inherits(a,o),a.prototype.processChunk=function(l){if(l){var u=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=u+l.data.length}o.prototype.processChunk.call(this,l)},i.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(e,i,n){var s=e("../utils"),o=e("./GenericWorker");function a(l){o.call(this,"DataWorker");var u=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(c){u.dataIsReady=!0,u.data=c,u.max=c&&c.length||0,u.type=s.getTypeOf(c),u.isPaused||u._tickAndRepeat()},function(c){u.error(c)})}s.inherits(a,o),a.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,s.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(s.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var l=null,u=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":l=this.data.substring(this.index,u);break;case"uint8array":l=this.data.subarray(this.index,u);break;case"array":case"nodebuffer":l=this.data.slice(this.index,u)}return this.index=u,this.push({data:l,meta:{percent:this.max?this.index/this.max*100:0}})},i.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(e,i,n){function s(o){this.name=o||"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}s.prototype={push:function(o){this.emit("data",o)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(o){this.emit("error",o)}return!0},error:function(o){return!this.isFinished&&(this.isPaused?this.generatedError=o:(this.isFinished=!0,this.emit("error",o),this.previous&&this.previous.error(o),this.cleanUp()),!0)},on:function(o,a){return this._listeners[o].push(a),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(o,a){if(this._listeners[o])for(var l=0;l "+o:o}},i.exports=s},{}],29:[function(e,i,n){var s=e("../utils"),o=e("./ConvertWorker"),a=e("./GenericWorker"),l=e("../base64"),u=e("../support"),c=e("../external"),h=null;if(u.nodestream)try{h=e("../nodejs/NodejsStreamOutputAdapter")}catch{}function p(y,g){return new c.Promise(function(d,m){var _=[],S=y._internalType,E=y._outputType,b=y._mimeType;y.on("data",function(F,x){_.push(F),g&&g(x)}).on("error",function(F){_=[],m(F)}).on("end",function(){try{var F=function(x,z,B){switch(x){case"blob":return s.newBlob(s.transformTo("arraybuffer",z),B);case"base64":return l.encode(z);default:return s.transformTo(x,z)}}(E,function(x,z){var B,tt=0,st=null,I=0;for(B=0;B"u")n.blob=!1;else{var s=new ArrayBuffer(0);try{n.blob=new Blob([s],{type:"application/zip"}).size===0}catch{try{var o=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);o.append(s),n.blob=o.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,i,n){for(var s=e("./utils"),o=e("./support"),a=e("./nodejsUtils"),l=e("./stream/GenericWorker"),u=new Array(256),c=0;c<256;c++)u[c]=252<=c?6:248<=c?5:240<=c?4:224<=c?3:192<=c?2:1;u[254]=u[254]=1;function h(){l.call(this,"utf-8 decode"),this.leftOver=null}function p(){l.call(this,"utf-8 encode")}n.utf8encode=function(f){return o.nodebuffer?a.newBufferFrom(f,"utf-8"):function(y){var g,d,m,_,S,E=y.length,b=0;for(_=0;_>>6:(d<65536?g[S++]=224|d>>>12:(g[S++]=240|d>>>18,g[S++]=128|d>>>12&63),g[S++]=128|d>>>6&63),g[S++]=128|63&d);return g}(f)},n.utf8decode=function(f){return o.nodebuffer?s.transformTo("nodebuffer",f).toString("utf-8"):function(y){var g,d,m,_,S=y.length,E=new Array(2*S);for(g=d=0;g>10&1023,E[d++]=56320|1023&m)}return E.length!==d&&(E.subarray?E=E.subarray(0,d):E.length=d),s.applyFromCharCode(E)}(f=s.transformTo(o.uint8array?"uint8array":"array",f))},s.inherits(h,l),h.prototype.processChunk=function(f){var y=s.transformTo(o.uint8array?"uint8array":"array",f.data);if(this.leftOver&&this.leftOver.length){if(o.uint8array){var g=y;(y=new Uint8Array(g.length+this.leftOver.length)).set(this.leftOver,0),y.set(g,this.leftOver.length)}else y=this.leftOver.concat(y);this.leftOver=null}var d=function(_,S){var E;for((S=S||_.length)>_.length&&(S=_.length),E=S-1;0<=E&&(192&_[E])==128;)E--;return E<0||E===0?S:E+u[_[E]]>S?E:S}(y),m=y;d!==y.length&&(o.uint8array?(m=y.subarray(0,d),this.leftOver=y.subarray(d,y.length)):(m=y.slice(0,d),this.leftOver=y.slice(d,y.length))),this.push({data:n.utf8decode(m),meta:f.meta})},h.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:n.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},n.Utf8DecodeWorker=h,s.inherits(p,l),p.prototype.processChunk=function(f){this.push({data:n.utf8encode(f.data),meta:f.meta})},n.Utf8EncodeWorker=p},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,i,n){var s=e("./support"),o=e("./base64"),a=e("./nodejsUtils"),l=e("./external");function u(g){return g}function c(g,d){for(var m=0;m>8;this.dir=!!(16&this.externalFileAttributes),f==0&&(this.dosPermissions=63&this.externalFileAttributes),f==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var f=s(this.extraFields[1].value);this.uncompressedSize===o.MAX_VALUE_32BITS&&(this.uncompressedSize=f.readInt(8)),this.compressedSize===o.MAX_VALUE_32BITS&&(this.compressedSize=f.readInt(8)),this.localHeaderOffset===o.MAX_VALUE_32BITS&&(this.localHeaderOffset=f.readInt(8)),this.diskNumberStart===o.MAX_VALUE_32BITS&&(this.diskNumberStart=f.readInt(4))}},readExtraFields:function(f){var y,g,d,m=f.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});f.index+4>>6:(f<65536?p[d++]=224|f>>>12:(p[d++]=240|f>>>18,p[d++]=128|f>>>12&63),p[d++]=128|f>>>6&63),p[d++]=128|63&f);return p},n.buf2binstring=function(h){return c(h,h.length)},n.binstring2buf=function(h){for(var p=new s.Buf8(h.length),f=0,y=p.length;f>10&1023,_[y++]=56320|1023&g)}return c(_,y)},n.utf8border=function(h,p){var f;for((p=p||h.length)>h.length&&(p=h.length),f=p-1;0<=f&&(192&h[f])==128;)f--;return f<0||f===0?p:f+l[h[f]]>p?f:p}},{"./common":41}],43:[function(e,i,n){i.exports=function(s,o,a,l){for(var u=65535&s|0,c=s>>>16&65535|0,h=0;a!==0;){for(a-=h=2e3>>1:o>>>1;a[l]=o}return a}();i.exports=function(o,a,l,u){var c=s,h=u+l;o^=-1;for(var p=u;p>>8^c[255&(o^a[p])];return-1^o}},{}],46:[function(e,i,n){var s,o=e("../utils/common"),a=e("./trees"),l=e("./adler32"),u=e("./crc32"),c=e("./messages"),h=0,p=4,f=0,y=-2,g=-1,d=4,m=2,_=8,S=9,E=286,b=30,F=19,x=2*E+1,z=15,B=3,tt=258,st=tt+B+1,I=42,Z=113,w=1,it=2,M=3,O=4;function D(v,K){return v.msg=c[K],K}function U(v){return(v<<1)-(4v.avail_out&&(q=v.avail_out),q!==0&&(o.arraySet(v.output,K.pending_buf,K.pending_out,q,v.next_out),v.next_out+=q,K.pending_out+=q,v.total_out+=q,v.avail_out-=q,K.pending-=q,K.pending===0&&(K.pending_out=0))}function A(v,K){a._tr_flush_block(v,0<=v.block_start?v.block_start:-1,v.strstart-v.block_start,K),v.block_start=v.strstart,C(v.strm)}function $(v,K){v.pending_buf[v.pending++]=K}function et(v,K){v.pending_buf[v.pending++]=K>>>8&255,v.pending_buf[v.pending++]=255&K}function J(v,K){var q,N,R=v.max_chain_length,Y=v.strstart,ot=v.prev_length,at=v.nice_match,rt=v.strstart>v.w_size-st?v.strstart-(v.w_size-st):0,ht=v.window,bt=v.w_mask,pt=v.prev,Ot=v.strstart+tt,ye=ht[Y+ot-1],oe=ht[Y+ot];v.prev_length>=v.good_match&&(R>>=2),at>v.lookahead&&(at=v.lookahead);do if(ht[(q=K)+ot]===oe&&ht[q+ot-1]===ye&&ht[q]===ht[Y]&&ht[++q]===ht[Y+1]){Y+=2,q++;do;while(ht[++Y]===ht[++q]&&ht[++Y]===ht[++q]&&ht[++Y]===ht[++q]&&ht[++Y]===ht[++q]&&ht[++Y]===ht[++q]&&ht[++Y]===ht[++q]&&ht[++Y]===ht[++q]&&ht[++Y]===ht[++q]&&Yrt&&--R!=0);return ot<=v.lookahead?ot:v.lookahead}function yt(v){var K,q,N,R,Y,ot,at,rt,ht,bt,pt=v.w_size;do{if(R=v.window_size-v.lookahead-v.strstart,v.strstart>=pt+(pt-st)){for(o.arraySet(v.window,v.window,pt,pt,0),v.match_start-=pt,v.strstart-=pt,v.block_start-=pt,K=q=v.hash_size;N=v.head[--K],v.head[K]=pt<=N?N-pt:0,--q;);for(K=q=pt;N=v.prev[--K],v.prev[K]=pt<=N?N-pt:0,--q;);R+=pt}if(v.strm.avail_in===0)break;if(ot=v.strm,at=v.window,rt=v.strstart+v.lookahead,ht=R,bt=void 0,bt=ot.avail_in,ht=B)for(Y=v.strstart-v.insert,v.ins_h=v.window[Y],v.ins_h=(v.ins_h<=B&&(v.ins_h=(v.ins_h<=B)if(N=a._tr_tally(v,v.strstart-v.match_start,v.match_length-B),v.lookahead-=v.match_length,v.match_length<=v.max_lazy_match&&v.lookahead>=B){for(v.match_length--;v.strstart++,v.ins_h=(v.ins_h<=B&&(v.ins_h=(v.ins_h<=B&&v.match_length<=v.prev_length){for(R=v.strstart+v.lookahead-B,N=a._tr_tally(v,v.strstart-1-v.prev_match,v.prev_length-B),v.lookahead-=v.prev_length-1,v.prev_length-=2;++v.strstart<=R&&(v.ins_h=(v.ins_h<v.pending_buf_size-5&&(q=v.pending_buf_size-5);;){if(v.lookahead<=1){if(yt(v),v.lookahead===0&&K===h)return w;if(v.lookahead===0)break}v.strstart+=v.lookahead,v.lookahead=0;var N=v.block_start+q;if((v.strstart===0||v.strstart>=N)&&(v.lookahead=v.strstart-N,v.strstart=N,A(v,!1),v.strm.avail_out===0)||v.strstart-v.block_start>=v.w_size-st&&(A(v,!1),v.strm.avail_out===0))return w}return v.insert=0,K===p?(A(v,!0),v.strm.avail_out===0?M:O):(v.strstart>v.block_start&&(A(v,!1),v.strm.avail_out),w)}),new _t(4,4,8,4,vt),new _t(4,5,16,8,vt),new _t(4,6,32,32,vt),new _t(4,4,16,16,dt),new _t(8,16,32,32,dt),new _t(8,16,128,128,dt),new _t(8,32,128,256,dt),new _t(32,128,258,1024,dt),new _t(32,258,258,4096,dt)],n.deflateInit=function(v,K){return he(v,K,_,15,8,0)},n.deflateInit2=he,n.deflateReset=ee,n.deflateResetKeep=Ct,n.deflateSetHeader=function(v,K){return v&&v.state?v.state.wrap!==2?y:(v.state.gzhead=K,f):y},n.deflate=function(v,K){var q,N,R,Y;if(!v||!v.state||5>8&255),$(N,N.gzhead.time>>16&255),$(N,N.gzhead.time>>24&255),$(N,N.level===9?2:2<=N.strategy||N.level<2?4:0),$(N,255&N.gzhead.os),N.gzhead.extra&&N.gzhead.extra.length&&($(N,255&N.gzhead.extra.length),$(N,N.gzhead.extra.length>>8&255)),N.gzhead.hcrc&&(v.adler=u(v.adler,N.pending_buf,N.pending,0)),N.gzindex=0,N.status=69):($(N,0),$(N,0),$(N,0),$(N,0),$(N,0),$(N,N.level===9?2:2<=N.strategy||N.level<2?4:0),$(N,3),N.status=Z);else{var ot=_+(N.w_bits-8<<4)<<8;ot|=(2<=N.strategy||N.level<2?0:N.level<6?1:N.level===6?2:3)<<6,N.strstart!==0&&(ot|=32),ot+=31-ot%31,N.status=Z,et(N,ot),N.strstart!==0&&(et(N,v.adler>>>16),et(N,65535&v.adler)),v.adler=1}if(N.status===69)if(N.gzhead.extra){for(R=N.pending;N.gzindex<(65535&N.gzhead.extra.length)&&(N.pending!==N.pending_buf_size||(N.gzhead.hcrc&&N.pending>R&&(v.adler=u(v.adler,N.pending_buf,N.pending-R,R)),C(v),R=N.pending,N.pending!==N.pending_buf_size));)$(N,255&N.gzhead.extra[N.gzindex]),N.gzindex++;N.gzhead.hcrc&&N.pending>R&&(v.adler=u(v.adler,N.pending_buf,N.pending-R,R)),N.gzindex===N.gzhead.extra.length&&(N.gzindex=0,N.status=73)}else N.status=73;if(N.status===73)if(N.gzhead.name){R=N.pending;do{if(N.pending===N.pending_buf_size&&(N.gzhead.hcrc&&N.pending>R&&(v.adler=u(v.adler,N.pending_buf,N.pending-R,R)),C(v),R=N.pending,N.pending===N.pending_buf_size)){Y=1;break}Y=N.gzindexR&&(v.adler=u(v.adler,N.pending_buf,N.pending-R,R)),Y===0&&(N.gzindex=0,N.status=91)}else N.status=91;if(N.status===91)if(N.gzhead.comment){R=N.pending;do{if(N.pending===N.pending_buf_size&&(N.gzhead.hcrc&&N.pending>R&&(v.adler=u(v.adler,N.pending_buf,N.pending-R,R)),C(v),R=N.pending,N.pending===N.pending_buf_size)){Y=1;break}Y=N.gzindexR&&(v.adler=u(v.adler,N.pending_buf,N.pending-R,R)),Y===0&&(N.status=103)}else N.status=103;if(N.status===103&&(N.gzhead.hcrc?(N.pending+2>N.pending_buf_size&&C(v),N.pending+2<=N.pending_buf_size&&($(N,255&v.adler),$(N,v.adler>>8&255),v.adler=0,N.status=Z)):N.status=Z),N.pending!==0){if(C(v),v.avail_out===0)return N.last_flush=-1,f}else if(v.avail_in===0&&U(K)<=U(q)&&K!==p)return D(v,-5);if(N.status===666&&v.avail_in!==0)return D(v,-5);if(v.avail_in!==0||N.lookahead!==0||K!==h&&N.status!==666){var at=N.strategy===2?function(rt,ht){for(var bt;;){if(rt.lookahead===0&&(yt(rt),rt.lookahead===0)){if(ht===h)return w;break}if(rt.match_length=0,bt=a._tr_tally(rt,0,rt.window[rt.strstart]),rt.lookahead--,rt.strstart++,bt&&(A(rt,!1),rt.strm.avail_out===0))return w}return rt.insert=0,ht===p?(A(rt,!0),rt.strm.avail_out===0?M:O):rt.last_lit&&(A(rt,!1),rt.strm.avail_out===0)?w:it}(N,K):N.strategy===3?function(rt,ht){for(var bt,pt,Ot,ye,oe=rt.window;;){if(rt.lookahead<=tt){if(yt(rt),rt.lookahead<=tt&&ht===h)return w;if(rt.lookahead===0)break}if(rt.match_length=0,rt.lookahead>=B&&0rt.lookahead&&(rt.match_length=rt.lookahead)}if(rt.match_length>=B?(bt=a._tr_tally(rt,1,rt.match_length-B),rt.lookahead-=rt.match_length,rt.strstart+=rt.match_length,rt.match_length=0):(bt=a._tr_tally(rt,0,rt.window[rt.strstart]),rt.lookahead--,rt.strstart++),bt&&(A(rt,!1),rt.strm.avail_out===0))return w}return rt.insert=0,ht===p?(A(rt,!0),rt.strm.avail_out===0?M:O):rt.last_lit&&(A(rt,!1),rt.strm.avail_out===0)?w:it}(N,K):s[N.level].func(N,K);if(at!==M&&at!==O||(N.status=666),at===w||at===M)return v.avail_out===0&&(N.last_flush=-1),f;if(at===it&&(K===1?a._tr_align(N):K!==5&&(a._tr_stored_block(N,0,0,!1),K===3&&(k(N.head),N.lookahead===0&&(N.strstart=0,N.block_start=0,N.insert=0))),C(v),v.avail_out===0))return N.last_flush=-1,f}return K!==p?f:N.wrap<=0?1:(N.wrap===2?($(N,255&v.adler),$(N,v.adler>>8&255),$(N,v.adler>>16&255),$(N,v.adler>>24&255),$(N,255&v.total_in),$(N,v.total_in>>8&255),$(N,v.total_in>>16&255),$(N,v.total_in>>24&255)):(et(N,v.adler>>>16),et(N,65535&v.adler)),C(v),0=q.w_size&&(Y===0&&(k(q.head),q.strstart=0,q.block_start=0,q.insert=0),ht=new o.Buf8(q.w_size),o.arraySet(ht,K,bt-q.w_size,q.w_size,0),K=ht,bt=q.w_size),ot=v.avail_in,at=v.next_in,rt=v.input,v.avail_in=bt,v.next_in=0,v.input=K,yt(q);q.lookahead>=B;){for(N=q.strstart,R=q.lookahead-(B-1);q.ins_h=(q.ins_h<>>=B=z>>>24,S-=B,(B=z>>>16&255)===0)it[c++]=65535&z;else{if(!(16&B)){if((64&B)==0){z=E[(65535&z)+(_&(1<>>=B,S-=B),S<15&&(_+=w[l++]<>>=B=z>>>24,S-=B,!(16&(B=z>>>16&255))){if((64&B)==0){z=b[(65535&z)+(_&(1<>>=B,S-=B,(B=c-h)>3,_&=(1<<(S-=tt<<3))-1,s.next_in=l,s.next_out=c,s.avail_in=l>>24&255)+(I>>>8&65280)+((65280&I)<<8)+((255&I)<<24)}function _(){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 s.Buf16(320),this.work=new s.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function S(I){var Z;return I&&I.state?(Z=I.state,I.total_in=I.total_out=Z.total=0,I.msg="",Z.wrap&&(I.adler=1&Z.wrap),Z.mode=y,Z.last=0,Z.havedict=0,Z.dmax=32768,Z.head=null,Z.hold=0,Z.bits=0,Z.lencode=Z.lendyn=new s.Buf32(g),Z.distcode=Z.distdyn=new s.Buf32(d),Z.sane=1,Z.back=-1,p):f}function E(I){var Z;return I&&I.state?((Z=I.state).wsize=0,Z.whave=0,Z.wnext=0,S(I)):f}function b(I,Z){var w,it;return I&&I.state?(it=I.state,Z<0?(w=0,Z=-Z):(w=1+(Z>>4),Z<48&&(Z&=15)),Z&&(Z<8||15=O.wsize?(s.arraySet(O.window,Z,w-O.wsize,O.wsize,0),O.wnext=0,O.whave=O.wsize):(it<(M=O.wsize-O.wnext)&&(M=it),s.arraySet(O.window,Z,w-it,M,O.wnext),(it-=M)?(s.arraySet(O.window,Z,w-it,it,0),O.wnext=it,O.whave=O.wsize):(O.wnext+=M,O.wnext===O.wsize&&(O.wnext=0),O.whave>>8&255,w.check=a(w.check,Y,2,0),A=C=0,w.mode=2;break}if(w.flags=0,w.head&&(w.head.done=!1),!(1&w.wrap)||(((255&C)<<8)+(C>>8))%31){I.msg="incorrect header check",w.mode=30;break}if((15&C)!=8){I.msg="unknown compression method",w.mode=30;break}if(A-=4,v=8+(15&(C>>>=4)),w.wbits===0)w.wbits=v;else if(v>w.wbits){I.msg="invalid window size",w.mode=30;break}w.dmax=1<>8&1),512&w.flags&&(Y[0]=255&C,Y[1]=C>>>8&255,w.check=a(w.check,Y,2,0)),A=C=0,w.mode=3;case 3:for(;A<32;){if(U===0)break t;U--,C+=it[O++]<>>8&255,Y[2]=C>>>16&255,Y[3]=C>>>24&255,w.check=a(w.check,Y,4,0)),A=C=0,w.mode=4;case 4:for(;A<16;){if(U===0)break t;U--,C+=it[O++]<>8),512&w.flags&&(Y[0]=255&C,Y[1]=C>>>8&255,w.check=a(w.check,Y,2,0)),A=C=0,w.mode=5;case 5:if(1024&w.flags){for(;A<16;){if(U===0)break t;U--,C+=it[O++]<>>8&255,w.check=a(w.check,Y,2,0)),A=C=0}else w.head&&(w.head.extra=null);w.mode=6;case 6:if(1024&w.flags&&(U<(J=w.length)&&(J=U),J&&(w.head&&(v=w.head.extra_len-w.length,w.head.extra||(w.head.extra=new Array(w.head.extra_len)),s.arraySet(w.head.extra,it,O,J,v)),512&w.flags&&(w.check=a(w.check,it,J,O)),U-=J,O+=J,w.length-=J),w.length))break t;w.length=0,w.mode=7;case 7:if(2048&w.flags){if(U===0)break t;for(J=0;v=it[O+J++],w.head&&v&&w.length<65536&&(w.head.name+=String.fromCharCode(v)),v&&J>9&1,w.head.done=!0),I.adler=w.check=0,w.mode=12;break;case 10:for(;A<32;){if(U===0)break t;U--,C+=it[O++]<>>=7&A,A-=7&A,w.mode=27;break}for(;A<3;){if(U===0)break t;U--,C+=it[O++]<>>=1)){case 0:w.mode=14;break;case 1:if(tt(w),w.mode=20,Z!==6)break;C>>>=2,A-=2;break t;case 2:w.mode=17;break;case 3:I.msg="invalid block type",w.mode=30}C>>>=2,A-=2;break;case 14:for(C>>>=7&A,A-=7&A;A<32;){if(U===0)break t;U--,C+=it[O++]<>>16^65535)){I.msg="invalid stored block lengths",w.mode=30;break}if(w.length=65535&C,A=C=0,w.mode=15,Z===6)break t;case 15:w.mode=16;case 16:if(J=w.length){if(U>>=5,A-=5,w.ndist=1+(31&C),C>>>=5,A-=5,w.ncode=4+(15&C),C>>>=4,A-=4,286>>=3,A-=3}for(;w.have<19;)w.lens[ot[w.have++]]=0;if(w.lencode=w.lendyn,w.lenbits=7,q={bits:w.lenbits},K=u(0,w.lens,0,19,w.lencode,0,w.work,q),w.lenbits=q.bits,K){I.msg="invalid code lengths set",w.mode=30;break}w.have=0,w.mode=19;case 19:for(;w.have>>16&255,gt=65535&R,!((dt=R>>>24)<=A);){if(U===0)break t;U--,C+=it[O++]<>>=dt,A-=dt,w.lens[w.have++]=gt;else{if(gt===16){for(N=dt+2;A>>=dt,A-=dt,w.have===0){I.msg="invalid bit length repeat",w.mode=30;break}v=w.lens[w.have-1],J=3+(3&C),C>>>=2,A-=2}else if(gt===17){for(N=dt+3;A>>=dt)),C>>>=3,A-=3}else{for(N=dt+7;A>>=dt)),C>>>=7,A-=7}if(w.have+J>w.nlen+w.ndist){I.msg="invalid bit length repeat",w.mode=30;break}for(;J--;)w.lens[w.have++]=v}}if(w.mode===30)break;if(w.lens[256]===0){I.msg="invalid code -- missing end-of-block",w.mode=30;break}if(w.lenbits=9,q={bits:w.lenbits},K=u(c,w.lens,0,w.nlen,w.lencode,0,w.work,q),w.lenbits=q.bits,K){I.msg="invalid literal/lengths set",w.mode=30;break}if(w.distbits=6,w.distcode=w.distdyn,q={bits:w.distbits},K=u(h,w.lens,w.nlen,w.ndist,w.distcode,0,w.work,q),w.distbits=q.bits,K){I.msg="invalid distances set",w.mode=30;break}if(w.mode=20,Z===6)break t;case 20:w.mode=21;case 21:if(6<=U&&258<=k){I.next_out=D,I.avail_out=k,I.next_in=O,I.avail_in=U,w.hold=C,w.bits=A,l(I,et),D=I.next_out,M=I.output,k=I.avail_out,O=I.next_in,it=I.input,U=I.avail_in,C=w.hold,A=w.bits,w.mode===12&&(w.back=-1);break}for(w.back=0;_t=(R=w.lencode[C&(1<>>16&255,gt=65535&R,!((dt=R>>>24)<=A);){if(U===0)break t;U--,C+=it[O++]<>Ct)])>>>16&255,gt=65535&R,!(Ct+(dt=R>>>24)<=A);){if(U===0)break t;U--,C+=it[O++]<>>=Ct,A-=Ct,w.back+=Ct}if(C>>>=dt,A-=dt,w.back+=dt,w.length=gt,_t===0){w.mode=26;break}if(32&_t){w.back=-1,w.mode=12;break}if(64&_t){I.msg="invalid literal/length code",w.mode=30;break}w.extra=15&_t,w.mode=22;case 22:if(w.extra){for(N=w.extra;A>>=w.extra,A-=w.extra,w.back+=w.extra}w.was=w.length,w.mode=23;case 23:for(;_t=(R=w.distcode[C&(1<>>16&255,gt=65535&R,!((dt=R>>>24)<=A);){if(U===0)break t;U--,C+=it[O++]<>Ct)])>>>16&255,gt=65535&R,!(Ct+(dt=R>>>24)<=A);){if(U===0)break t;U--,C+=it[O++]<>>=Ct,A-=Ct,w.back+=Ct}if(C>>>=dt,A-=dt,w.back+=dt,64&_t){I.msg="invalid distance code",w.mode=30;break}w.offset=gt,w.extra=15&_t,w.mode=24;case 24:if(w.extra){for(N=w.extra;A>>=w.extra,A-=w.extra,w.back+=w.extra}if(w.offset>w.dmax){I.msg="invalid distance too far back",w.mode=30;break}w.mode=25;case 25:if(k===0)break t;if(J=et-k,w.offset>J){if((J=w.offset-J)>w.whave&&w.sane){I.msg="invalid distance too far back",w.mode=30;break}yt=J>w.wnext?(J-=w.wnext,w.wsize-J):w.wnext-J,J>w.length&&(J=w.length),vt=w.window}else vt=M,yt=D-w.offset,J=w.length;for(kx?(B=yt[vt+d[Z]],A[$+d[Z]]):(B=96,0),_=1<>D)+(S-=_)]=z<<24|B<<16|tt|0,S!==0;);for(_=1<>=1;if(_!==0?(C&=_-1,C+=_):C=0,Z++,--et[I]==0){if(I===it)break;I=h[p+d[Z]]}if(M>>7)]}function $(R,Y){R.pending_buf[R.pending++]=255&Y,R.pending_buf[R.pending++]=Y>>>8&255}function et(R,Y,ot){R.bi_valid>m-ot?(R.bi_buf|=Y<>m-R.bi_valid,R.bi_valid+=ot-m):(R.bi_buf|=Y<>>=1,ot<<=1,0<--Y;);return ot>>>1}function vt(R,Y,ot){var at,rt,ht=new Array(d+1),bt=0;for(at=1;at<=d;at++)ht[at]=bt=bt+ot[at-1]<<1;for(rt=0;rt<=Y;rt++){var pt=R[2*rt+1];pt!==0&&(R[2*rt]=yt(ht[pt]++,pt))}}function dt(R){var Y;for(Y=0;Y>1;1<=ot;ot--)Ct(R,ht,ot);for(rt=Ot;ot=R.heap[1],R.heap[1]=R.heap[R.heap_len--],Ct(R,ht,1),at=R.heap[1],R.heap[--R.heap_max]=ot,R.heap[--R.heap_max]=at,ht[2*rt]=ht[2*ot]+ht[2*at],R.depth[rt]=(R.depth[ot]>=R.depth[at]?R.depth[ot]:R.depth[at])+1,ht[2*ot+1]=ht[2*at+1]=rt,R.heap[1]=rt++,Ct(R,ht,1),2<=R.heap_len;);R.heap[--R.heap_max]=R.heap[1],function(oe,ir){var Ki,vr,Zi,Ae,Ji,ao,Qr=ir.dyn_tree,fs=ir.max_code,ma=ir.stat_desc.static_tree,hu=ir.stat_desc.has_stree,si=ir.stat_desc.extra_bits,ya=ir.stat_desc.extra_base,In=ir.stat_desc.max_length,En=0;for(Ae=0;Ae<=d;Ae++)oe.bl_count[Ae]=0;for(Qr[2*oe.heap[oe.heap_max]+1]=0,Ki=oe.heap_max+1;Ki>=7;rt>>=1)if(1&ye&&pt.dyn_ltree[2*Ot]!==0)return o;if(pt.dyn_ltree[18]!==0||pt.dyn_ltree[20]!==0||pt.dyn_ltree[26]!==0)return a;for(Ot=32;Ot>>3,(ht=R.static_len+3+7>>>3)<=rt&&(rt=ht)):rt=ht=ot+5,ot+4<=rt&&Y!==-1?N(R,Y,ot,at):R.strategy===4||ht===rt?(et(R,2+(at?1:0),3),ee(R,st,I)):(et(R,4+(at?1:0),3),function(pt,Ot,ye,oe){var ir;for(et(pt,Ot-257,5),et(pt,ye-1,5),et(pt,oe-4,4),ir=0;ir>>8&255,R.pending_buf[R.d_buf+2*R.last_lit+1]=255&Y,R.pending_buf[R.l_buf+R.last_lit]=255&ot,R.last_lit++,Y===0?R.dyn_ltree[2*ot]++:(R.matches++,Y--,R.dyn_ltree[2*(w[ot]+h+1)]++,R.dyn_dtree[2*A(Y)]++),R.last_lit===R.lit_bufsize-1},n._tr_align=function(R){et(R,2,3),J(R,S,st),function(Y){Y.bi_valid===16?($(Y,Y.bi_buf),Y.bi_buf=0,Y.bi_valid=0):8<=Y.bi_valid&&(Y.pending_buf[Y.pending++]=255&Y.bi_buf,Y.bi_buf>>=8,Y.bi_valid-=8)}(R)}},{"../utils/common":41}],53:[function(e,i,n){i.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(e,i,n){(function(s){(function(o,a){if(!o.setImmediate){var l,u,c,h,p=1,f={},y=!1,g=o.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(o);d=d&&d.setTimeout?d:o,l={}.toString.call(o.process)==="[object process]"?function(E){process.nextTick(function(){_(E)})}:function(){if(o.postMessage&&!o.importScripts){var E=!0,b=o.onmessage;return o.onmessage=function(){E=!1},o.postMessage("","*"),o.onmessage=b,E}}()?(h="setImmediate$"+Math.random()+"$",o.addEventListener?o.addEventListener("message",S,!1):o.attachEvent("onmessage",S),function(E){o.postMessage(h+E,"*")}):o.MessageChannel?((c=new MessageChannel).port1.onmessage=function(E){_(E.data)},function(E){c.port2.postMessage(E)}):g&&"onreadystatechange"in g.createElement("script")?(u=g.documentElement,function(E){var b=g.createElement("script");b.onreadystatechange=function(){_(E),b.onreadystatechange=null,u.removeChild(b),b=null},u.appendChild(b)}):function(E){setTimeout(_,0,E)},d.setImmediate=function(E){typeof E!="function"&&(E=new Function(""+E));for(var b=new Array(arguments.length-1),F=0;F"u"?s===void 0?this:s:self)}).call(this,typeof gi<"u"?gi:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})}(Gu)),Gu.exports}var dC=fC();const pC=Nh(dC);Ai.zipReader=(r,t)=>pC.loadAsync(r);const mC=Ai.createSettings;Ai.createSettings=async r=>{const t=Object.keys(r.files);return t.find(e=>yC(e))?mC(r):_C(t)};function yC(r){return r.endsWith("model3.json")}function gC(r){return r.endsWith(".moc3")}function vC(r){return r.split(/[\\/]/).pop()}function _C(r){const t=r.filter(u=>gC(u));if(t.length!==1){const u=t.length?`(${t.map(c=>`"${c}"`).join(",")})`:"";throw new Error(`Expected exactly one moc file, got ${t.length} ${u}`)}const e=t[0],i=vC(e).replace(/\.moc3?/,""),n=r.filter(u=>u.endsWith(".png"));if(!n.length)throw new Error("Textures not found");const s=r.filter(u=>u.endsWith(".mtn")||u.endsWith(".motion3.json")),o=r.find(u=>u.includes("physics")),a=r.find(u=>u.includes("pose")),l=new Jn({url:`${i}.model3.json`,Version:3,FileReferences:{Moc:e,Textures:n,Physics:o,Pose:a,Motions:s.length?{"":s.map(u=>({File:u}))}:void 0}});return l.name=i,l._objectURL=`example://${l.url}`,l}Ai.readText=(r,t)=>{const e=r.file(t);if(!e)throw new Error(`Cannot find file: ${t}`);return e.async("text")};Ai.getFilePaths=r=>{const t=[];return r.forEach(e=>t.push(e)),Promise.resolve(t)};Ai.getFiles=(r,t)=>Promise.all(t.map(async e=>{const i=e.slice(e.lastIndexOf("/")+1),n=await r.file(e).async("blob");return new File([n],i)}));function Zt(r,t,e,i){function n(s){return s instanceof e?s:new e(function(o){o(s)})}return new(e||(e=Promise))(function(s,o){function a(c){try{u(i.next(c))}catch(h){o(h)}}function l(c){try{u(i.throw(c))}catch(h){o(h)}}function u(c){c.done?s(c.value):n(c.value).then(a,l)}u((i=i.apply(r,t||[])).next())})}function up(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],i=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Pt(r){return this instanceof Pt?(this.v=r,this):new Pt(r)}function dr(r,t,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=e.apply(r,t||[]),n,s=[];return n=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),n[Symbol.asyncIterator]=function(){return this},n;function o(f){return function(y){return Promise.resolve(y).then(f,h)}}function a(f,y){i[f]&&(n[f]=function(g){return new Promise(function(d,m){s.push([f,g,d,m])>1||l(f,g)})},y&&(n[f]=y(n[f])))}function l(f,y){try{u(i[f](y))}catch(g){p(s[0][3],g)}}function u(f){f.value instanceof Pt?Promise.resolve(f.value.v).then(c,h):p(s[0][2],f)}function c(f){l("next",f)}function h(f){l("throw",f)}function p(f,y){f(y),s.shift(),s.length&&l(s[0][0],s[0][1])}}function ts(r){var t,e;return t={},i("next"),i("throw",function(n){throw n}),i("return"),t[Symbol.iterator]=function(){return this},t;function i(n,s){t[n]=r[n]?function(o){return(e=!e)?{value:Pt(r[n](o)),done:!1}:s?s(o):o}:s}}function bi(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=r[Symbol.asyncIterator],e;return t?t.call(r):(r=typeof up=="function"?up(r):r[Symbol.iterator](),e={},i("next"),i("throw"),i("return"),e[Symbol.asyncIterator]=function(){return this},e);function i(s){e[s]=r[s]&&function(o){return new Promise(function(a,l){o=r[s](o),n(a,l,o.done,o.value)})}}function n(s,o,a,l){Promise.resolve(l).then(function(u){s({value:u,done:a})},o)}}const bC=new TextDecoder("utf-8"),eh=r=>bC.decode(r),wC=new TextEncoder,ef=r=>wC.encode(r),xC=r=>typeof r=="number",_v=r=>typeof r=="boolean",Ge=r=>typeof r=="function",pr=r=>r!=null&&Object(r)===r,rs=r=>pr(r)&&Ge(r.then),oa=r=>pr(r)&&Ge(r[Symbol.iterator]),no=r=>pr(r)&&Ge(r[Symbol.asyncIterator]),rh=r=>pr(r)&&pr(r.schema),bv=r=>pr(r)&&"done"in r&&"value"in r,wv=r=>pr(r)&&Ge(r.stat)&&xC(r.fd),xv=r=>pr(r)&&rf(r.body),tu=r=>"_getDOMStream"in r&&"_getNodeStream"in r,SC=r=>pr(r)&&Ge(r.abort)&&Ge(r.getWriter)&&!tu(r),rf=r=>pr(r)&&Ge(r.cancel)&&Ge(r.getReader)&&!tu(r),TC=r=>pr(r)&&Ge(r.end)&&Ge(r.write)&&_v(r.writable)&&!tu(r),Sv=r=>pr(r)&&Ge(r.read)&&Ge(r.pipe)&&_v(r.readable)&&!tu(r),IC=r=>pr(r)&&Ge(r.clear)&&Ge(r.bytes)&&Ge(r.position)&&Ge(r.setPosition)&&Ge(r.capacity)&&Ge(r.getBufferIdentifier)&&Ge(r.createLong),nf=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function EC(r){const t=r[0]?[r[0]]:[];let e,i,n,s;for(let o,a,l=0,u=0,c=r.length;++lc+h.byteLength,0);let n,s,o,a=0,l=-1;const u=Math.min(t||Number.POSITIVE_INFINITY,i);for(const c=e.length;++l_e(Int32Array,r),hp=r=>_e(BigInt64Array,r),ae=r=>_e(Uint8Array,r),ih=r=>(r.next(),r);function*CC(r,t){const e=function*(n){yield n},i=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof nf?e(t):oa(t)?t:e(t);return yield*ih(function*(n){let s=null;do s=n.next(yield _e(r,s));while(!s.done)}(i[Symbol.iterator]())),new r}const AC=r=>CC(Uint8Array,r);function Tv(r,t){return dr(this,arguments,function*(){if(rs(t))return yield Pt(yield Pt(yield*ts(bi(Tv(r,yield Pt(t))))));const i=function(o){return dr(this,arguments,function*(){yield yield Pt(yield Pt(o))})},n=function(o){return dr(this,arguments,function*(){yield Pt(yield*ts(bi(ih(function*(a){let l=null;do l=a.next(yield l==null?void 0:l.value);while(!l.done)}(o[Symbol.iterator]())))))})},s=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof nf?i(t):oa(t)?n(t):no(t)?t:i(t);return yield Pt(yield*ts(bi(ih(function(o){return dr(this,arguments,function*(){let a=null;do a=yield Pt(o.next(yield yield Pt(_e(r,a))));while(!a.done)})}(s[Symbol.asyncIterator]()))))),yield Pt(new r)})}const OC=r=>Tv(Uint8Array,r);function Iv(r,t,e){if(r!==0){e=e.slice(0,t);for(let i=-1,n=e.length;++i0)do if(r[e]!==t[e])return!1;while(++e(r.next(),r);function*PC(r){let t,e=!1,i=[],n,s,o,a=0;function l(){return s==="peek"?xi(i,o)[0]:([n,i,a]=xi(i,o),n)}({cmd:s,size:o}=(yield null)||{cmd:"read",size:0});const u=AC(r)[Symbol.iterator]();try{do if({done:t,value:n}=Number.isNaN(o-a)?u.next():u.next(o-a),!t&&n.byteLength>0&&(i.push(n),a+=n.byteLength),t||o<=a)do({cmd:s,size:o}=yield l());while(o0&&(n.push(s),l+=s.byteLength),e||a<=l)do({cmd:o,size:a}=yield yield Pt(u()));while(a0&&(n.push(ae(s)),l+=s.byteLength),e||a<=l)do({cmd:o,size:a}=yield yield Pt(u()));while(a{})}get closed(){return this.reader?this.reader.closed.catch(()=>{}):Promise.resolve()}releaseLock(){this.reader&&this.reader.releaseLock(),this.reader=null}cancel(t){return Zt(this,void 0,void 0,function*(){const{reader:e,source:i}=this;e&&(yield e.cancel(t).catch(()=>{})),i&&i.locked&&this.releaseLock()})}read(t){return Zt(this,void 0,void 0,function*(){if(t===0)return{done:this.reader==null,value:new Uint8Array(0)};const e=yield this.reader.read();return!e.done&&(e.value=ae(e)),e})}}const Wu=(r,t)=>{const e=n=>i([t,n]);let i;return[t,e,new Promise(n=>(i=n)&&r.once(t,e))]};function NC(r){return dr(this,arguments,function*(){const e=[];let i="error",n=!1,s=null,o,a,l=0,u=[],c;function h(){return o==="peek"?xi(u,a)[0]:([c,u,l]=xi(u,a),c)}if({cmd:o,size:a}=(yield yield Pt(null))||{cmd:"read",size:0},r.isTTY)return yield yield Pt(new Uint8Array(0)),yield Pt(null);try{e[0]=Wu(r,"end"),e[1]=Wu(r,"error");do{if(e[2]=Wu(r,"readable"),[i,s]=yield Pt(Promise.race(e.map(f=>f[2]))),i==="error")break;if((n=i==="end")||(Number.isFinite(a-l)?(c=ae(r.read(a-l)),c.byteLength0&&(u.push(c),l+=c.byteLength)),n||a<=l)do({cmd:o,size:a}=yield yield Pt(h()));while(a{for(const[m,_]of f)r.off(m,_);try{const m=r.destroy;m&&m.call(r,y),y=void 0}catch(m){y=m||y}finally{y!=null?d(y):g()}})}})}var ke;(function(r){r[r.V1=0]="V1",r[r.V2=1]="V2",r[r.V3=2]="V3",r[r.V4=3]="V4",r[r.V5=4]="V5"})(ke||(ke={}));var er;(function(r){r[r.Sparse=0]="Sparse",r[r.Dense=1]="Dense"})(er||(er={}));var tr;(function(r){r[r.HALF=0]="HALF",r[r.SINGLE=1]="SINGLE",r[r.DOUBLE=2]="DOUBLE"})(tr||(tr={}));var Hr;(function(r){r[r.DAY=0]="DAY",r[r.MILLISECOND=1]="MILLISECOND"})(Hr||(Hr={}));var zt;(function(r){r[r.SECOND=0]="SECOND",r[r.MILLISECOND=1]="MILLISECOND",r[r.MICROSECOND=2]="MICROSECOND",r[r.NANOSECOND=3]="NANOSECOND"})(zt||(zt={}));var Si;(function(r){r[r.YEAR_MONTH=0]="YEAR_MONTH",r[r.DAY_TIME=1]="DAY_TIME",r[r.MONTH_DAY_NANO=2]="MONTH_DAY_NANO"})(Si||(Si={}));const Hu=2,pi=4,ji=4,me=4,on=new Int32Array(2),fp=new Float32Array(on.buffer),dp=new Float64Array(on.buffer),Na=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;var nh;(function(r){r[r.UTF8_BYTES=1]="UTF8_BYTES",r[r.UTF16_STRING=2]="UTF16_STRING"})(nh||(nh={}));let Qs=class Ev{constructor(t){this.bytes_=t,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(t){return new Ev(new Uint8Array(t))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(t){this.position_=t}capacity(){return this.bytes_.length}readInt8(t){return this.readUint8(t)<<24>>24}readUint8(t){return this.bytes_[t]}readInt16(t){return this.readUint16(t)<<16>>16}readUint16(t){return this.bytes_[t]|this.bytes_[t+1]<<8}readInt32(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24}readUint32(t){return this.readInt32(t)>>>0}readInt64(t){return BigInt.asIntN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<>8}writeUint16(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8}writeInt32(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24}writeUint32(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24}writeInt64(t,e){this.writeInt32(t,Number(BigInt.asIntN(32,e))),this.writeInt32(t+4,Number(BigInt.asIntN(32,e>>BigInt(32))))}writeUint64(t,e){this.writeUint32(t,Number(BigInt.asUintN(32,e))),this.writeUint32(t+4,Number(BigInt.asUintN(32,e>>BigInt(32))))}writeFloat32(t,e){fp[0]=e,this.writeInt32(t,on[0])}writeFloat64(t,e){dp[0]=e,this.writeInt32(t,on[Na?0:1]),this.writeInt32(t+4,on[Na?1:0])}getBufferIdentifier(){if(this.bytes_.lengththis.minalign&&(this.minalign=t);const i=~(this.bb.capacity()-this.space+e)+1&t-1;for(;this.space=0&&this.vtable[e]==0;e--);const i=e+1;for(;e>=0;e--)this.addInt16(this.vtable[e]!=0?t-this.vtable[e]:0);const n=2;this.addInt16(t-this.object_start);const s=(i+n)*Hu;this.addInt16(s);let o=0;const a=this.space;t:for(e=0;e=0;o--)this.writeInt8(s.charCodeAt(o))}this.prep(this.minalign,pi+n),this.addOffset(t),n&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(t,e){this.finish(t,e,!0)}requiredField(t,e){const i=this.bb.capacity()-t,n=i-this.bb.readInt32(i);if(!(e=0;i--)t.addInt32(e[i]);return t.endVector()}static startTypeIdsVector(t,e){t.startVector(4,e,4)}static endUnion(t){return t.endObject()}static createUnion(t,e,i){return hr.startUnion(t),hr.addMode(t,e),hr.addTypeIds(t,i),hr.endUnion(t)}}let bp=class Fo{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsUtf8(t,e){return(e||new Fo).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUtf8(t,e){return t.setPosition(t.position()+me),(e||new Fo).__init(t.readInt32(t.position())+t.position(),t)}static startUtf8(t){t.startObject(0)}static endUtf8(t){return t.endObject()}static createUtf8(t){return Fo.startUtf8(t),Fo.endUtf8(t)}};var xe;(function(r){r[r.NONE=0]="NONE",r[r.Null=1]="Null",r[r.Int=2]="Int",r[r.FloatingPoint=3]="FloatingPoint",r[r.Binary=4]="Binary",r[r.Utf8=5]="Utf8",r[r.Bool=6]="Bool",r[r.Decimal=7]="Decimal",r[r.Date=8]="Date",r[r.Time=9]="Time",r[r.Timestamp=10]="Timestamp",r[r.Interval=11]="Interval",r[r.List=12]="List",r[r.Struct_=13]="Struct_",r[r.Union=14]="Union",r[r.FixedSizeBinary=15]="FixedSizeBinary",r[r.FixedSizeList=16]="FixedSizeList",r[r.Map=17]="Map",r[r.Duration=18]="Duration",r[r.LargeBinary=19]="LargeBinary",r[r.LargeUtf8=20]="LargeUtf8",r[r.LargeList=21]="LargeList",r[r.RunEndEncoded=22]="RunEndEncoded"})(xe||(xe={}));let Nr=class Ga{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsField(t,e){return(e||new Ga).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsField(t,e){return t.setPosition(t.position()+me),(e||new Ga).__init(t.readInt32(t.position())+t.position(),t)}name(t){const e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}nullable(){const t=this.bb.__offset(this.bb_pos,6);return t?!!this.bb.readInt8(this.bb_pos+t):!1}typeType(){const t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readUint8(this.bb_pos+t):xe.NONE}type(t){const e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__union(t,this.bb_pos+e):null}dictionary(t){const e=this.bb.__offset(this.bb_pos,12);return e?(t||new $i).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}children(t,e){const i=this.bb.__offset(this.bb_pos,14);return i?(e||new Ga).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+t*4),this.bb):null}childrenLength(){const t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,e){const i=this.bb.__offset(this.bb_pos,16);return i?(e||new We).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+t*4),this.bb):null}customMetadataLength(){const t=this.bb.__offset(this.bb_pos,16);return t?this.bb.__vector_len(this.bb_pos+t):0}static startField(t){t.startObject(7)}static addName(t,e){t.addFieldOffset(0,e,0)}static addNullable(t,e){t.addFieldInt8(1,+e,0)}static addTypeType(t,e){t.addFieldInt8(2,e,xe.NONE)}static addType(t,e){t.addFieldOffset(3,e,0)}static addDictionary(t,e){t.addFieldOffset(4,e,0)}static addChildren(t,e){t.addFieldOffset(5,e,0)}static createChildrenVector(t,e){t.startVector(4,e.length,4);for(let i=e.length-1;i>=0;i--)t.addOffset(e[i]);return t.endVector()}static startChildrenVector(t,e){t.startVector(4,e,4)}static addCustomMetadata(t,e){t.addFieldOffset(6,e,0)}static createCustomMetadataVector(t,e){t.startVector(4,e.length,4);for(let i=e.length-1;i>=0;i--)t.addOffset(e[i]);return t.endVector()}static startCustomMetadataVector(t,e){t.startVector(4,e,4)}static endField(t){return t.endObject()}},ui=class Mi{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsSchema(t,e){return(e||new Mi).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSchema(t,e){return t.setPosition(t.position()+me),(e||new Mi).__init(t.readInt32(t.position())+t.position(),t)}endianness(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):Ks.Little}fields(t,e){const i=this.bb.__offset(this.bb_pos,6);return i?(e||new Nr).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+t*4),this.bb):null}fieldsLength(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,e){const i=this.bb.__offset(this.bb_pos,8);return i?(e||new We).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+t*4),this.bb):null}customMetadataLength(){const t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}features(t){const e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt64(this.bb.__vector(this.bb_pos+e)+t*8):BigInt(0)}featuresLength(){const t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}static startSchema(t){t.startObject(4)}static addEndianness(t,e){t.addFieldInt16(0,e,Ks.Little)}static addFields(t,e){t.addFieldOffset(1,e,0)}static createFieldsVector(t,e){t.startVector(4,e.length,4);for(let i=e.length-1;i>=0;i--)t.addOffset(e[i]);return t.endVector()}static startFieldsVector(t,e){t.startVector(4,e,4)}static addCustomMetadata(t,e){t.addFieldOffset(2,e,0)}static createCustomMetadataVector(t,e){t.startVector(4,e.length,4);for(let i=e.length-1;i>=0;i--)t.addOffset(e[i]);return t.endVector()}static startCustomMetadataVector(t,e){t.startVector(4,e,4)}static addFeatures(t,e){t.addFieldOffset(3,e,0)}static createFeaturesVector(t,e){t.startVector(8,e.length,8);for(let i=e.length-1;i>=0;i--)t.addInt64(e[i]);return t.endVector()}static startFeaturesVector(t,e){t.startVector(8,e,8)}static endSchema(t){return t.endObject()}static finishSchemaBuffer(t,e){t.finish(e)}static finishSizePrefixedSchemaBuffer(t,e){t.finish(e,void 0,!0)}static createSchema(t,e,i,n,s){return Mi.startSchema(t),Mi.addEndianness(t,e),Mi.addFields(t,i),Mi.addCustomMetadata(t,n),Mi.addFeatures(t,s),Mi.endSchema(t)}};var fe;(function(r){r[r.NONE=0]="NONE",r[r.Schema=1]="Schema",r[r.DictionaryBatch=2]="DictionaryBatch",r[r.RecordBatch=3]="RecordBatch",r[r.Tensor=4]="Tensor",r[r.SparseTensor=5]="SparseTensor"})(fe||(fe={}));var L;(function(r){r[r.NONE=0]="NONE",r[r.Null=1]="Null",r[r.Int=2]="Int",r[r.Float=3]="Float",r[r.Binary=4]="Binary",r[r.Utf8=5]="Utf8",r[r.Bool=6]="Bool",r[r.Decimal=7]="Decimal",r[r.Date=8]="Date",r[r.Time=9]="Time",r[r.Timestamp=10]="Timestamp",r[r.Interval=11]="Interval",r[r.List=12]="List",r[r.Struct=13]="Struct",r[r.Union=14]="Union",r[r.FixedSizeBinary=15]="FixedSizeBinary",r[r.FixedSizeList=16]="FixedSizeList",r[r.Map=17]="Map",r[r.Duration=18]="Duration",r[r.LargeBinary=19]="LargeBinary",r[r.LargeUtf8=20]="LargeUtf8",r[r.Dictionary=-1]="Dictionary",r[r.Int8=-2]="Int8",r[r.Int16=-3]="Int16",r[r.Int32=-4]="Int32",r[r.Int64=-5]="Int64",r[r.Uint8=-6]="Uint8",r[r.Uint16=-7]="Uint16",r[r.Uint32=-8]="Uint32",r[r.Uint64=-9]="Uint64",r[r.Float16=-10]="Float16",r[r.Float32=-11]="Float32",r[r.Float64=-12]="Float64",r[r.DateDay=-13]="DateDay",r[r.DateMillisecond=-14]="DateMillisecond",r[r.TimestampSecond=-15]="TimestampSecond",r[r.TimestampMillisecond=-16]="TimestampMillisecond",r[r.TimestampMicrosecond=-17]="TimestampMicrosecond",r[r.TimestampNanosecond=-18]="TimestampNanosecond",r[r.TimeSecond=-19]="TimeSecond",r[r.TimeMillisecond=-20]="TimeMillisecond",r[r.TimeMicrosecond=-21]="TimeMicrosecond",r[r.TimeNanosecond=-22]="TimeNanosecond",r[r.DenseUnion=-23]="DenseUnion",r[r.SparseUnion=-24]="SparseUnion",r[r.IntervalDayTime=-25]="IntervalDayTime",r[r.IntervalYearMonth=-26]="IntervalYearMonth",r[r.DurationSecond=-27]="DurationSecond",r[r.DurationMillisecond=-28]="DurationMillisecond",r[r.DurationMicrosecond=-29]="DurationMicrosecond",r[r.DurationNanosecond=-30]="DurationNanosecond"})(L||(L={}));var ki;(function(r){r[r.OFFSET=0]="OFFSET",r[r.DATA=1]="DATA",r[r.VALIDITY=2]="VALIDITY",r[r.TYPE=3]="TYPE"})(ki||(ki={}));const LC=void 0;function Xo(r){if(r===null)return"null";if(r===LC)return"undefined";switch(typeof r){case"number":return`${r}`;case"bigint":return`${r}`;case"string":return`"${r}"`}return typeof r[Symbol.toPrimitive]=="function"?r[Symbol.toPrimitive]("string"):ArrayBuffer.isView(r)?r instanceof BigInt64Array||r instanceof BigUint64Array?`[${[...r].map(t=>Xo(t))}]`:`[${r}]`:ArrayBuffer.isView(r)?`[${r}]`:JSON.stringify(r,(t,e)=>typeof e=="bigint"?`${e}`:e)}function we(r){if(typeof r=="bigint"&&(rNumber.MAX_SAFE_INTEGER))throw new TypeError(`${r} is not safe to convert to a number.`);return Number(r)}function Pv(r,t){return we(r/t)+we(r%t)/we(t)}const BC=Symbol.for("isArrowBigNum");function ri(r,...t){return t.length===0?Object.setPrototypeOf(_e(this.TypedArray,r),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(r,...t),this.constructor.prototype)}ri.prototype[BC]=!0;ri.prototype.toJSON=function(){return`"${qo(this)}"`};ri.prototype.valueOf=function(r){return Mv(this,r)};ri.prototype.toString=function(){return qo(this)};ri.prototype[Symbol.toPrimitive]=function(r="default"){switch(r){case"number":return Mv(this);case"string":return qo(this);case"default":return zC(this)}return qo(this)};function zs(...r){return ri.apply(this,r)}function js(...r){return ri.apply(this,r)}function Yo(...r){return ri.apply(this,r)}Object.setPrototypeOf(zs.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(js.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(Yo.prototype,Object.create(Uint32Array.prototype));Object.assign(zs.prototype,ri.prototype,{constructor:zs,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(js.prototype,ri.prototype,{constructor:js,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign(Yo.prototype,ri.prototype,{constructor:Yo,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});const kC=BigInt(4294967296)*BigInt(4294967296),UC=kC-BigInt(1);function Mv(r,t){const{buffer:e,byteOffset:i,byteLength:n,signed:s}=r,o=new BigUint64Array(e,i,n/8),a=s&&o.at(-1)&BigInt(1)<=0)return Xu(r);t=t.slice();let i=1;for(let s=0;s(r.children=null,r.ArrayType=Array,r.OffsetArrayType=Int32Array,r[Symbol.toStringTag]="DataType"))(At.prototype);let pn=class extends At{constructor(){super(L.Null)}toString(){return"Null"}};Nv=Symbol.toStringTag;pn[Nv]=(r=>r[Symbol.toStringTag]="Null")(pn.prototype);let is=class extends At{constructor(t,e){super(L.Int),this.isSigned=t,this.bitWidth=e}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 new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}};Lv=Symbol.toStringTag;is[Lv]=(r=>(r.isSigned=null,r.bitWidth=null,r[Symbol.toStringTag]="Int"))(is.prototype);class Qo extends is{constructor(){super(!0,32)}get ArrayType(){return Int32Array}}Object.defineProperty(Qo.prototype,"ArrayType",{value:Int32Array});let cl=class extends At{constructor(t){super(L.Float),this.precision=t}get ArrayType(){switch(this.precision){case tr.HALF:return Uint16Array;case tr.SINGLE:return Float32Array;case tr.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};Bv=Symbol.toStringTag;cl[Bv]=(r=>(r.precision=null,r[Symbol.toStringTag]="Float"))(cl.prototype);let hl=class extends At{constructor(){super(L.Binary)}toString(){return"Binary"}};kv=Symbol.toStringTag;hl[kv]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Binary"))(hl.prototype);let fl=class extends At{constructor(){super(L.LargeBinary)}toString(){return"LargeBinary"}};Uv=Symbol.toStringTag;fl[Uv]=(r=>(r.ArrayType=Uint8Array,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeBinary"))(fl.prototype);let dl=class extends At{constructor(){super(L.Utf8)}toString(){return"Utf8"}};zv=Symbol.toStringTag;dl[zv]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Utf8"))(dl.prototype);let pl=class extends At{constructor(){super(L.LargeUtf8)}toString(){return"LargeUtf8"}};jv=Symbol.toStringTag;pl[jv]=(r=>(r.ArrayType=Uint8Array,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeUtf8"))(pl.prototype);let ml=class extends At{constructor(){super(L.Bool)}toString(){return"Bool"}};$v=Symbol.toStringTag;ml[$v]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Bool"))(ml.prototype);let yl=class extends At{constructor(t,e,i=128){super(L.Decimal),this.scale=t,this.precision=e,this.bitWidth=i}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}};Vv=Symbol.toStringTag;yl[Vv]=(r=>(r.scale=null,r.precision=null,r.ArrayType=Uint32Array,r[Symbol.toStringTag]="Decimal"))(yl.prototype);let gl=class extends At{constructor(t){super(L.Date),this.unit=t}toString(){return`Date${(this.unit+1)*32}<${Hr[this.unit]}>`}get ArrayType(){return this.unit===Hr.DAY?Int32Array:BigInt64Array}};Gv=Symbol.toStringTag;gl[Gv]=(r=>(r.unit=null,r[Symbol.toStringTag]="Date"))(gl.prototype);let vl=class extends At{constructor(t,e){super(L.Time),this.unit=t,this.bitWidth=e}toString(){return`Time${this.bitWidth}<${zt[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}};Wv=Symbol.toStringTag;vl[Wv]=(r=>(r.unit=null,r.bitWidth=null,r[Symbol.toStringTag]="Time"))(vl.prototype);let _l=class extends At{constructor(t,e){super(L.Timestamp),this.unit=t,this.timezone=e}toString(){return`Timestamp<${zt[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}};Hv=Symbol.toStringTag;_l[Hv]=(r=>(r.unit=null,r.timezone=null,r.ArrayType=BigInt64Array,r[Symbol.toStringTag]="Timestamp"))(_l.prototype);let bl=class extends At{constructor(t){super(L.Interval),this.unit=t}toString(){return`Interval<${Si[this.unit]}>`}};Xv=Symbol.toStringTag;bl[Xv]=(r=>(r.unit=null,r.ArrayType=Int32Array,r[Symbol.toStringTag]="Interval"))(bl.prototype);let wl=class extends At{constructor(t){super(L.Duration),this.unit=t}toString(){return`Duration<${zt[this.unit]}>`}};Yv=Symbol.toStringTag;wl[Yv]=(r=>(r.unit=null,r.ArrayType=BigInt64Array,r[Symbol.toStringTag]="Duration"))(wl.prototype);let xl=class extends At{constructor(t){super(L.List),this.children=[t]}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};qv=Symbol.toStringTag;xl[qv]=(r=>(r.children=null,r[Symbol.toStringTag]="List"))(xl.prototype);let sr=class extends At{constructor(t){super(L.Struct),this.children=t}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}};Qv=Symbol.toStringTag;sr[Qv]=(r=>(r.children=null,r[Symbol.toStringTag]="Struct"))(sr.prototype);let Sl=class extends At{constructor(t,e,i){super(L.Union),this.mode=t,this.children=i,this.typeIds=e=Int32Array.from(e),this.typeIdToChildIndex=e.reduce((n,s,o)=>(n[s]=o)&&n||n,Object.create(null))}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(t=>`${t.type}`).join(" | ")}>`}};Kv=Symbol.toStringTag;Sl[Kv]=(r=>(r.mode=null,r.typeIds=null,r.children=null,r.typeIdToChildIndex=null,r.ArrayType=Int8Array,r[Symbol.toStringTag]="Union"))(Sl.prototype);let Tl=class extends At{constructor(t){super(L.FixedSizeBinary),this.byteWidth=t}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};Zv=Symbol.toStringTag;Tl[Zv]=(r=>(r.byteWidth=null,r.ArrayType=Uint8Array,r[Symbol.toStringTag]="FixedSizeBinary"))(Tl.prototype);let Il=class extends At{constructor(t,e){super(L.FixedSizeList),this.listSize=t,this.children=[e]}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}>`}};Jv=Symbol.toStringTag;Il[Jv]=(r=>(r.children=null,r.listSize=null,r[Symbol.toStringTag]="FixedSizeList"))(Il.prototype);let El=class extends At{constructor(t,e=!1){var i,n,s;if(super(L.Map),this.children=[t],this.keysSorted=e,t&&(t.name="entries",!((i=t==null?void 0:t.type)===null||i===void 0)&&i.children)){const o=(n=t==null?void 0:t.type)===null||n===void 0?void 0:n.children[0];o&&(o.name="key");const a=(s=t==null?void 0:t.type)===null||s===void 0?void 0:s.children[1];a&&(a.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(t=>`${t.name}:${t.type}`).join(", ")}}>`}};t_=Symbol.toStringTag;El[t_]=(r=>(r.children=null,r.keysSorted=null,r[Symbol.toStringTag]="Map_"))(El.prototype);const $C=(r=>()=>++r)(-1);let Zs=class extends At{constructor(t,e,i,n){super(L.Dictionary),this.indices=e,this.dictionary=t,this.isOrdered=n||!1,this.id=i==null?$C():we(i)}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}};e_=Symbol.toStringTag;Zs[e_]=(r=>(r.id=null,r.indices=null,r.isOrdered=null,r.dictionary=null,r[Symbol.toStringTag]="Dictionary"))(Zs.prototype);function Ui(r){const t=r;switch(r.typeId){case L.Decimal:return r.bitWidth/32;case L.Interval:return 1+t.unit;case L.FixedSizeList:return t.listSize;case L.FixedSizeBinary:return t.byteWidth;default:return 1}}let ie=class{visitMany(t,...e){return t.map((i,n)=>this.visit(i,...e.map(s=>s[n])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,e=!0){return VC(this,t,e)}getVisitFnByTypeId(t,e=!0){return As(this,t,e)}visitNull(t,...e){return null}visitBool(t,...e){return null}visitInt(t,...e){return null}visitFloat(t,...e){return null}visitUtf8(t,...e){return null}visitLargeUtf8(t,...e){return null}visitBinary(t,...e){return null}visitLargeBinary(t,...e){return null}visitFixedSizeBinary(t,...e){return null}visitDate(t,...e){return null}visitTimestamp(t,...e){return null}visitTime(t,...e){return null}visitDecimal(t,...e){return null}visitList(t,...e){return null}visitStruct(t,...e){return null}visitUnion(t,...e){return null}visitDictionary(t,...e){return null}visitInterval(t,...e){return null}visitDuration(t,...e){return null}visitFixedSizeList(t,...e){return null}visitMap(t,...e){return null}};function VC(r,t,e=!0){return typeof t=="number"?As(r,t,e):typeof t=="string"&&t in L?As(r,L[t],e):t&&t instanceof At?As(r,wp(t),e):t!=null&&t.type&&t.type instanceof At?As(r,wp(t.type),e):As(r,L.NONE,e)}function As(r,t,e=!0){let i=null;switch(t){case L.Null:i=r.visitNull;break;case L.Bool:i=r.visitBool;break;case L.Int:i=r.visitInt;break;case L.Int8:i=r.visitInt8||r.visitInt;break;case L.Int16:i=r.visitInt16||r.visitInt;break;case L.Int32:i=r.visitInt32||r.visitInt;break;case L.Int64:i=r.visitInt64||r.visitInt;break;case L.Uint8:i=r.visitUint8||r.visitInt;break;case L.Uint16:i=r.visitUint16||r.visitInt;break;case L.Uint32:i=r.visitUint32||r.visitInt;break;case L.Uint64:i=r.visitUint64||r.visitInt;break;case L.Float:i=r.visitFloat;break;case L.Float16:i=r.visitFloat16||r.visitFloat;break;case L.Float32:i=r.visitFloat32||r.visitFloat;break;case L.Float64:i=r.visitFloat64||r.visitFloat;break;case L.Utf8:i=r.visitUtf8;break;case L.LargeUtf8:i=r.visitLargeUtf8;break;case L.Binary:i=r.visitBinary;break;case L.LargeBinary:i=r.visitLargeBinary;break;case L.FixedSizeBinary:i=r.visitFixedSizeBinary;break;case L.Date:i=r.visitDate;break;case L.DateDay:i=r.visitDateDay||r.visitDate;break;case L.DateMillisecond:i=r.visitDateMillisecond||r.visitDate;break;case L.Timestamp:i=r.visitTimestamp;break;case L.TimestampSecond:i=r.visitTimestampSecond||r.visitTimestamp;break;case L.TimestampMillisecond:i=r.visitTimestampMillisecond||r.visitTimestamp;break;case L.TimestampMicrosecond:i=r.visitTimestampMicrosecond||r.visitTimestamp;break;case L.TimestampNanosecond:i=r.visitTimestampNanosecond||r.visitTimestamp;break;case L.Time:i=r.visitTime;break;case L.TimeSecond:i=r.visitTimeSecond||r.visitTime;break;case L.TimeMillisecond:i=r.visitTimeMillisecond||r.visitTime;break;case L.TimeMicrosecond:i=r.visitTimeMicrosecond||r.visitTime;break;case L.TimeNanosecond:i=r.visitTimeNanosecond||r.visitTime;break;case L.Decimal:i=r.visitDecimal;break;case L.List:i=r.visitList;break;case L.Struct:i=r.visitStruct;break;case L.Union:i=r.visitUnion;break;case L.DenseUnion:i=r.visitDenseUnion||r.visitUnion;break;case L.SparseUnion:i=r.visitSparseUnion||r.visitUnion;break;case L.Dictionary:i=r.visitDictionary;break;case L.Interval:i=r.visitInterval;break;case L.IntervalDayTime:i=r.visitIntervalDayTime||r.visitInterval;break;case L.IntervalYearMonth:i=r.visitIntervalYearMonth||r.visitInterval;break;case L.Duration:i=r.visitDuration;break;case L.DurationSecond:i=r.visitDurationSecond||r.visitDuration;break;case L.DurationMillisecond:i=r.visitDurationMillisecond||r.visitDuration;break;case L.DurationMicrosecond:i=r.visitDurationMicrosecond||r.visitDuration;break;case L.DurationNanosecond:i=r.visitDurationNanosecond||r.visitDuration;break;case L.FixedSizeList:i=r.visitFixedSizeList;break;case L.Map:i=r.visitMap;break}if(typeof i=="function")return i;if(!e)return()=>null;throw new Error(`Unrecognized type '${L[t]}'`)}function wp(r){switch(r.typeId){case L.Null:return L.Null;case L.Int:{const{bitWidth:t,isSigned:e}=r;switch(t){case 8:return e?L.Int8:L.Uint8;case 16:return e?L.Int16:L.Uint16;case 32:return e?L.Int32:L.Uint32;case 64:return e?L.Int64:L.Uint64}return L.Int}case L.Float:switch(r.precision){case tr.HALF:return L.Float16;case tr.SINGLE:return L.Float32;case tr.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(r.unit){case zt.SECOND:return L.TimeSecond;case zt.MILLISECOND:return L.TimeMillisecond;case zt.MICROSECOND:return L.TimeMicrosecond;case zt.NANOSECOND:return L.TimeNanosecond}return L.Time;case L.Timestamp:switch(r.unit){case zt.SECOND:return L.TimestampSecond;case zt.MILLISECOND:return L.TimestampMillisecond;case zt.MICROSECOND:return L.TimestampMicrosecond;case zt.NANOSECOND:return L.TimestampNanosecond}return L.Timestamp;case L.Date:switch(r.unit){case Hr.DAY:return L.DateDay;case Hr.MILLISECOND:return L.DateMillisecond}return L.Date;case L.Interval:switch(r.unit){case Si.DAY_TIME:return L.IntervalDayTime;case Si.YEAR_MONTH:return L.IntervalYearMonth}return L.Interval;case L.Duration:switch(r.unit){case zt.SECOND:return L.DurationSecond;case zt.MILLISECOND:return L.DurationMillisecond;case zt.MICROSECOND:return L.DurationMicrosecond;case zt.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(r.mode){case er.Dense:return L.DenseUnion;case er.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 new Error(`Unrecognized type '${L[r.typeId]}'`)}ie.prototype.visitInt8=null;ie.prototype.visitInt16=null;ie.prototype.visitInt32=null;ie.prototype.visitInt64=null;ie.prototype.visitUint8=null;ie.prototype.visitUint16=null;ie.prototype.visitUint32=null;ie.prototype.visitUint64=null;ie.prototype.visitFloat16=null;ie.prototype.visitFloat32=null;ie.prototype.visitFloat64=null;ie.prototype.visitDateDay=null;ie.prototype.visitDateMillisecond=null;ie.prototype.visitTimestampSecond=null;ie.prototype.visitTimestampMillisecond=null;ie.prototype.visitTimestampMicrosecond=null;ie.prototype.visitTimestampNanosecond=null;ie.prototype.visitTimeSecond=null;ie.prototype.visitTimeMillisecond=null;ie.prototype.visitTimeMicrosecond=null;ie.prototype.visitTimeNanosecond=null;ie.prototype.visitDenseUnion=null;ie.prototype.visitSparseUnion=null;ie.prototype.visitIntervalDayTime=null;ie.prototype.visitIntervalYearMonth=null;ie.prototype.visitDuration=null;ie.prototype.visitDurationSecond=null;ie.prototype.visitDurationMillisecond=null;ie.prototype.visitDurationMicrosecond=null;ie.prototype.visitDurationNanosecond=null;const r_=new Float64Array(1),gs=new Uint32Array(r_.buffer);function i_(r){const t=(r&31744)>>10,e=(r&1023)/1024,i=Math.pow(-1,(r&32768)>>15);switch(t){case 31:return i*(e?Number.NaN:1/0);case 0:return i*(e?6103515625e-14*e:0)}return i*Math.pow(2,t-15)*(1+e)}function GC(r){if(r!==r)return 32256;r_[0]=r;const t=(gs[1]&2147483648)>>16&65535;let e=gs[1]&2146435072,i=0;return e>=1089470464?gs[0]>0?e=31744:(e=(e&2080374784)>>16,i=(gs[1]&1048575)>>10):e<=1056964608?(i=1048576+(gs[1]&1048575),i=1048576+(i<<(e>>20)-998)>>21,e=0):(e=e-1056964608>>10,i=(gs[1]&1048575)+512>>10),t|e|i&65535}let jt=class extends ie{};function Xt(r){return(t,e,i)=>{if(t.setValid(e,i!=null))return r(t,e,i)}}const WC=(r,t,e)=>{r[t]=Math.floor(e/864e5)},n_=(r,t,e,i)=>{if(e+1{const n=r+e;i?t[n>>3]|=1<>3]&=~(1<{r[t]=e},sf=({values:r},t,e)=>{r[t]=e},s_=({values:r},t,e)=>{r[t]=GC(e)},XC=(r,t,e)=>{switch(r.type.precision){case tr.HALF:return s_(r,t,e);case tr.SINGLE:case tr.DOUBLE:return sf(r,t,e)}},o_=({values:r},t,e)=>{WC(r,t,e.valueOf())},a_=({values:r},t,e)=>{r[t]=BigInt(e)},YC=({stride:r,values:t},e,i)=>{t.set(i.subarray(0,r),r*e)},l_=({values:r,valueOffsets:t},e,i)=>n_(r,t,e,i),u_=({values:r,valueOffsets:t},e,i)=>n_(r,t,e,ef(i)),qC=(r,t,e)=>{r.type.unit===Hr.DAY?o_(r,t,e):a_(r,t,e)},c_=({values:r},t,e)=>{r[t]=BigInt(e/1e3)},h_=({values:r},t,e)=>{r[t]=BigInt(e)},f_=({values:r},t,e)=>{r[t]=BigInt(e*1e3)},d_=({values:r},t,e)=>{r[t]=BigInt(e*1e6)},QC=(r,t,e)=>{switch(r.type.unit){case zt.SECOND:return c_(r,t,e);case zt.MILLISECOND:return h_(r,t,e);case zt.MICROSECOND:return f_(r,t,e);case zt.NANOSECOND:return d_(r,t,e)}},p_=({values:r},t,e)=>{r[t]=e},m_=({values:r},t,e)=>{r[t]=e},y_=({values:r},t,e)=>{r[t]=e},g_=({values:r},t,e)=>{r[t]=e},KC=(r,t,e)=>{switch(r.type.unit){case zt.SECOND:return p_(r,t,e);case zt.MILLISECOND:return m_(r,t,e);case zt.MICROSECOND:return y_(r,t,e);case zt.NANOSECOND:return g_(r,t,e)}},ZC=({values:r,stride:t},e,i)=>{r.set(i.subarray(0,t),t*e)},JC=(r,t,e)=>{const i=r.children[0],n=r.valueOffsets,s=Xr.getVisitFn(i);if(Array.isArray(e))for(let o=-1,a=n[t],l=n[t+1];a{const i=r.children[0],{valueOffsets:n}=r,s=Xr.getVisitFn(i);let{[t]:o,[t+1]:a}=n;const l=e instanceof Map?e.entries():Object.entries(e);for(const u of l)if(s(i,o,u),++o>=a)break},eA=(r,t)=>(e,i,n,s)=>i&&e(i,r,t[s]),rA=(r,t)=>(e,i,n,s)=>i&&e(i,r,t.get(s)),iA=(r,t)=>(e,i,n,s)=>i&&e(i,r,t.get(n.name)),nA=(r,t)=>(e,i,n,s)=>i&&e(i,r,t[n.name]),sA=(r,t,e)=>{const i=r.type.children.map(s=>Xr.getVisitFn(s.type)),n=e instanceof Map?iA(t,e):e instanceof Me?rA(t,e):Array.isArray(e)?eA(t,e):nA(t,e);r.type.children.forEach((s,o)=>n(i[o],r.children[o],s,o))},oA=(r,t,e)=>{r.type.mode===er.Dense?v_(r,t,e):__(r,t,e)},v_=(r,t,e)=>{const i=r.type.typeIdToChildIndex[r.typeIds[t]],n=r.children[i];Xr.visit(n,r.valueOffsets[t],e)},__=(r,t,e)=>{const i=r.type.typeIdToChildIndex[r.typeIds[t]],n=r.children[i];Xr.visit(n,t,e)},aA=(r,t,e)=>{var i;(i=r.dictionary)===null||i===void 0||i.set(r.values[t],e)},lA=(r,t,e)=>{r.type.unit===Si.DAY_TIME?b_(r,t,e):w_(r,t,e)},b_=({values:r},t,e)=>{r.set(e.subarray(0,2),2*t)},w_=({values:r},t,e)=>{r[t]=e[0]*12+e[1]%12},x_=({values:r},t,e)=>{r[t]=e},S_=({values:r},t,e)=>{r[t]=e},T_=({values:r},t,e)=>{r[t]=e},I_=({values:r},t,e)=>{r[t]=e},uA=(r,t,e)=>{switch(r.type.unit){case zt.SECOND:return x_(r,t,e);case zt.MILLISECOND:return S_(r,t,e);case zt.MICROSECOND:return T_(r,t,e);case zt.NANOSECOND:return I_(r,t,e)}},cA=(r,t,e)=>{const{stride:i}=r,n=r.children[0],s=Xr.getVisitFn(n);if(Array.isArray(e))for(let o=-1,a=t*i;++o`${Xo(t)}: ${Xo(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new hA(this[Kr],this[$s])}},hA=class{constructor(t,e){this.childIndex=0,this.children=t.children,this.rowIndex=e,this.childFields=t.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){const t=this.childIndex;return te.name)}has(t,e){return t[Kr].type.children.findIndex(i=>i.name===e)!==-1}getOwnPropertyDescriptor(t,e){if(t[Kr].type.children.findIndex(i=>i.name===e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const i=t[Kr].type.children.findIndex(n=>n.name===e);if(i!==-1){const n=mr.visit(t[Kr].children[i],t[$s]);return Reflect.set(t,e,n),n}}set(t,e,i){const n=t[Kr].type.children.findIndex(s=>s.name===e);return n!==-1?(Xr.visit(t[Kr].children[n],t[$s],i),Reflect.set(t,e,i)):Reflect.has(t,e)||typeof e=="symbol"?Reflect.set(t,e,i):!1}},Mt=class extends ie{};function $t(r){return(t,e)=>t.getValid(e)?r(t,e):null}const dA=(r,t)=>864e5*r[t],pA=(r,t)=>null,E_=(r,t,e)=>{if(e+1>=t.length)return null;const i=we(t[e]),n=we(t[e+1]);return r.subarray(i,n)},mA=({offset:r,values:t},e)=>{const i=r+e;return(t[i>>3]&1<dA(r,t),A_=({values:r},t)=>we(r[t]),wn=({stride:r,values:t},e)=>t[r*e],yA=({stride:r,values:t},e)=>i_(t[r*e]),O_=({values:r},t)=>r[t],gA=({stride:r,values:t},e)=>t.subarray(r*e,r*(e+1)),F_=({values:r,valueOffsets:t},e)=>E_(r,t,e),P_=({values:r,valueOffsets:t},e)=>{const i=E_(r,t,e);return i!==null?eh(i):null},vA=({values:r},t)=>r[t],_A=({type:r,values:t},e)=>r.precision!==tr.HALF?t[e]:i_(t[e]),bA=(r,t)=>r.type.unit===Hr.DAY?C_(r,t):A_(r,t),M_=({values:r},t)=>1e3*we(r[t]),D_=({values:r},t)=>we(r[t]),R_=({values:r},t)=>Pv(r[t],BigInt(1e3)),N_=({values:r},t)=>Pv(r[t],BigInt(1e6)),wA=(r,t)=>{switch(r.type.unit){case zt.SECOND:return M_(r,t);case zt.MILLISECOND:return D_(r,t);case zt.MICROSECOND:return R_(r,t);case zt.NANOSECOND:return N_(r,t)}},L_=({values:r},t)=>r[t],B_=({values:r},t)=>r[t],k_=({values:r},t)=>r[t],U_=({values:r},t)=>r[t],xA=(r,t)=>{switch(r.type.unit){case zt.SECOND:return L_(r,t);case zt.MILLISECOND:return B_(r,t);case zt.MICROSECOND:return k_(r,t);case zt.NANOSECOND:return U_(r,t)}},SA=({values:r,stride:t},e)=>jC.decimal(r.subarray(t*e,t*(e+1))),TA=(r,t)=>{const{valueOffsets:e,stride:i,children:n}=r,{[t*i]:s,[t*i+1]:o}=e,l=n[0].slice(s,o-s);return new Me([l])},IA=(r,t)=>{const{valueOffsets:e,children:i}=r,{[t]:n,[t+1]:s}=e,o=i[0];return new af(o.slice(n,s-n))},EA=(r,t)=>new of(r,t),CA=(r,t)=>r.type.mode===er.Dense?z_(r,t):j_(r,t),z_=(r,t)=>{const e=r.type.typeIdToChildIndex[r.typeIds[t]],i=r.children[e];return mr.visit(i,r.valueOffsets[t])},j_=(r,t)=>{const e=r.type.typeIdToChildIndex[r.typeIds[t]],i=r.children[e];return mr.visit(i,t)},AA=(r,t)=>{var e;return(e=r.dictionary)===null||e===void 0?void 0:e.get(r.values[t])},OA=(r,t)=>r.type.unit===Si.DAY_TIME?$_(r,t):V_(r,t),$_=({values:r},t)=>r.subarray(2*t,2*(t+1)),V_=({values:r},t)=>{const e=r[t],i=new Int32Array(2);return i[0]=Math.trunc(e/12),i[1]=Math.trunc(e%12),i},G_=({values:r},t)=>r[t],W_=({values:r},t)=>r[t],H_=({values:r},t)=>r[t],X_=({values:r},t)=>r[t],FA=(r,t)=>{switch(r.type.unit){case zt.SECOND:return G_(r,t);case zt.MILLISECOND:return W_(r,t);case zt.MICROSECOND:return H_(r,t);case zt.NANOSECOND:return X_(r,t)}},PA=(r,t)=>{const{stride:e,children:i}=r,s=i[0].slice(t*e,e);return new Me([s])};Mt.prototype.visitNull=$t(pA);Mt.prototype.visitBool=$t(mA);Mt.prototype.visitInt=$t(vA);Mt.prototype.visitInt8=$t(wn);Mt.prototype.visitInt16=$t(wn);Mt.prototype.visitInt32=$t(wn);Mt.prototype.visitInt64=$t(O_);Mt.prototype.visitUint8=$t(wn);Mt.prototype.visitUint16=$t(wn);Mt.prototype.visitUint32=$t(wn);Mt.prototype.visitUint64=$t(O_);Mt.prototype.visitFloat=$t(_A);Mt.prototype.visitFloat16=$t(yA);Mt.prototype.visitFloat32=$t(wn);Mt.prototype.visitFloat64=$t(wn);Mt.prototype.visitUtf8=$t(P_);Mt.prototype.visitLargeUtf8=$t(P_);Mt.prototype.visitBinary=$t(F_);Mt.prototype.visitLargeBinary=$t(F_);Mt.prototype.visitFixedSizeBinary=$t(gA);Mt.prototype.visitDate=$t(bA);Mt.prototype.visitDateDay=$t(C_);Mt.prototype.visitDateMillisecond=$t(A_);Mt.prototype.visitTimestamp=$t(wA);Mt.prototype.visitTimestampSecond=$t(M_);Mt.prototype.visitTimestampMillisecond=$t(D_);Mt.prototype.visitTimestampMicrosecond=$t(R_);Mt.prototype.visitTimestampNanosecond=$t(N_);Mt.prototype.visitTime=$t(xA);Mt.prototype.visitTimeSecond=$t(L_);Mt.prototype.visitTimeMillisecond=$t(B_);Mt.prototype.visitTimeMicrosecond=$t(k_);Mt.prototype.visitTimeNanosecond=$t(U_);Mt.prototype.visitDecimal=$t(SA);Mt.prototype.visitList=$t(TA);Mt.prototype.visitStruct=$t(EA);Mt.prototype.visitUnion=$t(CA);Mt.prototype.visitDenseUnion=$t(z_);Mt.prototype.visitSparseUnion=$t(j_);Mt.prototype.visitDictionary=$t(AA);Mt.prototype.visitInterval=$t(OA);Mt.prototype.visitIntervalDayTime=$t($_);Mt.prototype.visitIntervalYearMonth=$t(V_);Mt.prototype.visitDuration=$t(FA);Mt.prototype.visitDurationSecond=$t(G_);Mt.prototype.visitDurationMillisecond=$t(W_);Mt.prototype.visitDurationMicrosecond=$t(H_);Mt.prototype.visitDurationNanosecond=$t(X_);Mt.prototype.visitFixedSizeList=$t(PA);Mt.prototype.visitMap=$t(IA);const mr=new Mt,Os=Symbol.for("keys"),Vs=Symbol.for("vals"),Fs=Symbol.for("kKeysAsStrings"),lh=Symbol.for("_kKeysAsStrings");let af=class{constructor(t){return this[Os]=new Me([t.children[0]]).memoize(),this[Vs]=t.children[1],new Proxy(this,new DA)}get[Fs](){return this[lh]||(this[lh]=Array.from(this[Os].toArray(),String))}[Symbol.iterator](){return new MA(this[Os],this[Vs])}get size(){return this[Os].length}toArray(){return Object.values(this.toJSON())}toJSON(){const t=this[Os],e=this[Vs],i={};for(let n=-1,s=t.length;++n`${Xo(t)}: ${Xo(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}},MA=class{constructor(t,e){this.keys=t,this.vals=e,this.keyIndex=0,this.numKeys=t.length}[Symbol.iterator](){return this}next(){const t=this.keyIndex;return t===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(t),mr.visit(this.vals,t)]})}},DA=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[Fs]}has(t,e){return t[Fs].includes(e)}getOwnPropertyDescriptor(t,e){if(t[Fs].indexOf(e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const i=t[Fs].indexOf(e);if(i!==-1){const n=mr.visit(Reflect.get(t,Vs),i);return Reflect.set(t,e,n),n}}set(t,e,i){const n=t[Fs].indexOf(e);return n!==-1?(Xr.visit(Reflect.get(t,Vs),n,i),Reflect.set(t,e,i)):Reflect.has(t,e)?Reflect.set(t,e,i):!1}};Object.defineProperties(af.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[Os]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Vs]:{writable:!0,enumerable:!1,configurable:!1,value:null},[lh]:{writable:!0,enumerable:!1,configurable:!1,value:null}});let xp;function Y_(r,t,e,i){const{length:n=0}=r;let s=typeof t!="number"?0:t,o=typeof e!="number"?n:e;return s<0&&(s=(s%n+n)%n),o<0&&(o=(o%n+n)%n),on&&(o=n),i?i(r,s,o):[s,o]}const lf=(r,t)=>r<0?t+r:r,Sp=r=>r!==r;function so(r){if(typeof r!=="object"||r===null)return Sp(r)?Sp:e=>e===r;if(r instanceof Date){const e=r.valueOf();return i=>i instanceof Date?i.valueOf()===e:!1}return ArrayBuffer.isView(r)?e=>e?FC(r,e):!1:r instanceof Map?NA(r):Array.isArray(r)?RA(r):r instanceof Me?LA(r):BA(r,!0)}function RA(r){const t=[];for(let e=-1,i=r.length;++e!1;const i=[];for(let n=-1,s=e.length;++n{if(!e||typeof e!="object")return!1;switch(e.constructor){case Array:return kA(r,e);case Map:return Tp(r,e,e.keys());case af:case of:case Object:case void 0:return Tp(r,e,t||Object.keys(e))}return e instanceof Me?UA(r,e):!1}}function kA(r,t){const e=r.length;if(t.length!==e)return!1;for(let i=-1;++i>i}function Cl(r,t,e){const i=e.byteLength+7&-8;if(r>0||e.byteLength>3):Al(new uf(e,r,t,null,q_)).subarray(0,i)),n}return e}function Al(r){const t=[];let e=0,i=0,n=0;for(const o of r)o&&(n|=1<0)&&(t[e++]=n);const s=new Uint8Array(t.length+7&-8);return s.set(t),s}let uf=class{constructor(t,e,i,n,s){this.bytes=t,this.length=i,this.context=n,this.get=s,this.bit=e%8,this.byteIndex=e>>3,this.byte=t[this.byteIndex++],this.index=0}next(){return this.index>3<<3,n=t+(t%8===0?0:8-t%8);return uh(r,t,n)+uh(r,i,e)+jA(r,n>>3,i-n>>3)}function jA(r,t,e){let i=0,n=Math.trunc(t);const s=new DataView(r.buffer,r.byteOffset,r.byteLength),o=e===void 0?r.byteLength:n+e;for(;o-n>=4;)i+=Yu(s.getUint32(n)),n+=4;for(;o-n>=2;)i+=Yu(s.getUint16(n)),n+=2;for(;o-n>=1;)i+=Yu(s.getUint8(n)),n+=1;return i}function Yu(r){let t=Math.trunc(r);return t=t-(t>>>1&1431655765),t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}const $A=-1;let Se=class ch{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){const{type:t}=this;return At.isSparseUnion(t)?this.children.some(e=>e.nullable):At.isDenseUnion(t)?this.children.some(e=>e.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let t=0;const{valueOffsets:e,values:i,nullBitmap:n,typeIds:s}=this;return e&&(t+=e.byteLength),i&&(t+=i.byteLength),n&&(t+=n.byteLength),s&&(t+=s.byteLength),this.children.reduce((o,a)=>o+a.byteLength,t)}get nullCount(){if(At.isUnion(this.type))return this.children.reduce((i,n)=>i+n.nullCount,0);let t=this._nullCount,e;return t<=$A&&(e=this.nullBitmap)&&(this._nullCount=t=e.length===0?0:this.length-uh(e,this.offset,this.offset+this.length)),t}constructor(t,e,i,n,s,o=[],a){this.type=t,this.children=o,this.dictionary=a,this.offset=Math.floor(Math.max(e||0,0)),this.length=Math.floor(Math.max(i||0,0)),this._nullCount=Math.floor(Math.max(n||0,-1));let l;s instanceof ch?(this.stride=s.stride,this.values=s.values,this.typeIds=s.typeIds,this.nullBitmap=s.nullBitmap,this.valueOffsets=s.valueOffsets):(this.stride=Ui(t),s&&((l=s[0])&&(this.valueOffsets=l),(l=s[1])&&(this.values=l),(l=s[2])&&(this.nullBitmap=l),(l=s[3])&&(this.typeIds=l)))}getValid(t){const{type:e}=this;if(At.isUnion(e)){const i=e,n=this.children[i.typeIdToChildIndex[this.typeIds[t]]],s=i.mode===er.Dense?this.valueOffsets[t]:t;return n.getValid(s)}if(this.nullable&&this.nullCount>0){const i=this.offset+t;return(this.nullBitmap[i>>3]&1<>3;(!s||s.byteLength<=c)&&(s=new Uint8Array((o+a+63&-64)>>3).fill(255),this.nullCount>0?(s.set(Cl(o,a,this.nullBitmap),0),Object.assign(this,{nullBitmap:s})):Object.assign(this,{nullBitmap:s,_nullCount:0}));const h=s[c];i=(h&u)!==0,s[c]=e?h|u:h&~u}return i!==!!e&&(this._nullCount=this.nullCount+(e?-1:1)),e}clone(t=this.type,e=this.offset,i=this.length,n=this._nullCount,s=this,o=this.children){return new ch(t,e,i,n,s,o,this.dictionary)}slice(t,e){const{stride:i,typeId:n,children:s}=this,o=+(this._nullCount===0)-1,a=n===16?i:1,l=this._sliceBuffers(t,e,i,n);return this.clone(this.type,this.offset+t,e,o,l,s.length===0||this.valueOffsets?s:this._sliceChildren(s,a*t,a*e))}_changeLengthAndBackfillNullBitmap(t){if(this.typeId===L.Null)return this.clone(this.type,0,t,0);const{length:e,nullCount:i}=this,n=new Uint8Array((t+63&-64)>>3).fill(255,0,e>>3);n[e>>3]=(1<0&&n.set(Cl(this.offset,e,this.nullBitmap),0);const s=this.buffers;return s[ki.VALIDITY]=n,this.clone(this.type,0,t,i+(t-e),s)}_sliceBuffers(t,e,i,n){let s;const{buffers:o}=this;return(s=o[ki.TYPE])&&(o[ki.TYPE]=s.subarray(t,t+e)),(s=o[ki.OFFSET])&&(o[ki.OFFSET]=s.subarray(t,t+e+1))||(s=o[ki.DATA])&&(o[ki.DATA]=n===6?s:s.subarray(i*t,i*(t+e))),o}_sliceChildren(t,e,i){return t.map(n=>n.slice(e,i))}};Se.prototype.children=Object.freeze([]);class Ro extends ie{visit(t){return this.getVisitFn(t.type).call(this,t)}visitNull(t){const{["type"]:e,["offset"]:i=0,["length"]:n=0}=t;return new Se(e,i,n,n)}visitBool(t){const{["type"]:e,["offset"]:i=0}=t,n=ae(t.nullBitmap),s=_e(e.ArrayType,t.data),{["length"]:o=s.length>>3,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,s,n])}visitInt(t){const{["type"]:e,["offset"]:i=0}=t,n=ae(t.nullBitmap),s=_e(e.ArrayType,t.data),{["length"]:o=s.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,s,n])}visitFloat(t){const{["type"]:e,["offset"]:i=0}=t,n=ae(t.nullBitmap),s=_e(e.ArrayType,t.data),{["length"]:o=s.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,s,n])}visitUtf8(t){const{["type"]:e,["offset"]:i=0}=t,n=ae(t.data),s=ae(t.nullBitmap),o=yo(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new Se(e,i,a,l,[o,n,s])}visitLargeUtf8(t){const{["type"]:e,["offset"]:i=0}=t,n=ae(t.data),s=ae(t.nullBitmap),o=hp(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new Se(e,i,a,l,[o,n,s])}visitBinary(t){const{["type"]:e,["offset"]:i=0}=t,n=ae(t.data),s=ae(t.nullBitmap),o=yo(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new Se(e,i,a,l,[o,n,s])}visitLargeBinary(t){const{["type"]:e,["offset"]:i=0}=t,n=ae(t.data),s=ae(t.nullBitmap),o=hp(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new Se(e,i,a,l,[o,n,s])}visitFixedSizeBinary(t){const{["type"]:e,["offset"]:i=0}=t,n=ae(t.nullBitmap),s=_e(e.ArrayType,t.data),{["length"]:o=s.length/Ui(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,s,n])}visitDate(t){const{["type"]:e,["offset"]:i=0}=t,n=ae(t.nullBitmap),s=_e(e.ArrayType,t.data),{["length"]:o=s.length/Ui(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,s,n])}visitTimestamp(t){const{["type"]:e,["offset"]:i=0}=t,n=ae(t.nullBitmap),s=_e(e.ArrayType,t.data),{["length"]:o=s.length/Ui(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,s,n])}visitTime(t){const{["type"]:e,["offset"]:i=0}=t,n=ae(t.nullBitmap),s=_e(e.ArrayType,t.data),{["length"]:o=s.length/Ui(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,s,n])}visitDecimal(t){const{["type"]:e,["offset"]:i=0}=t,n=ae(t.nullBitmap),s=_e(e.ArrayType,t.data),{["length"]:o=s.length/Ui(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,s,n])}visitList(t){const{["type"]:e,["offset"]:i=0,["child"]:n}=t,s=ae(t.nullBitmap),o=yo(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new Se(e,i,a,l,[o,void 0,s],[n])}visitStruct(t){const{["type"]:e,["offset"]:i=0,["children"]:n=[]}=t,s=ae(t.nullBitmap),{length:o=n.reduce((l,{length:u})=>Math.max(l,u),0),nullCount:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,void 0,s],n)}visitUnion(t){const{["type"]:e,["offset"]:i=0,["children"]:n=[]}=t,s=_e(e.ArrayType,t.typeIds),{["length"]:o=s.length,["nullCount"]:a=-1}=t;if(At.isSparseUnion(e))return new Se(e,i,o,a,[void 0,void 0,void 0,s],n);const l=yo(t.valueOffsets);return new Se(e,i,o,a,[l,void 0,void 0,s],n)}visitDictionary(t){const{["type"]:e,["offset"]:i=0}=t,n=ae(t.nullBitmap),s=_e(e.indices.ArrayType,t.data),{["dictionary"]:o=new Me([new Ro().visit({type:e.dictionary})])}=t,{["length"]:a=s.length,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new Se(e,i,a,l,[void 0,s,n],[],o)}visitInterval(t){const{["type"]:e,["offset"]:i=0}=t,n=ae(t.nullBitmap),s=_e(e.ArrayType,t.data),{["length"]:o=s.length/Ui(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,s,n])}visitDuration(t){const{["type"]:e,["offset"]:i=0}=t,n=ae(t.nullBitmap),s=_e(e.ArrayType,t.data),{["length"]:o=s.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,s,n])}visitFixedSizeList(t){const{["type"]:e,["offset"]:i=0,["child"]:n=new Ro().visit({type:e.valueType})}=t,s=ae(t.nullBitmap),{["length"]:o=n.length/Ui(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,void 0,s],[n])}visitMap(t){const{["type"]:e,["offset"]:i=0,["child"]:n=new Ro().visit({type:e.childType})}=t,s=ae(t.nullBitmap),o=yo(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new Se(e,i,a,l,[o,void 0,s],[n])}}const VA=new Ro;function se(r){return VA.visit(r)}let Ip=class{constructor(t=0,e){this.numChunks=t,this.getChunkIterator=e,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndext.nullable)}function Q_(r){return r.reduce((t,e)=>t+e.nullCount,0)}function K_(r){return r.reduce((t,e,i)=>(t[i+1]=t[i]+e.length,t),new Uint32Array(r.length+1))}function Z_(r,t,e,i){const n=[];for(let s=-1,o=r.length;++s=i)break;if(e>=l+u)continue;if(l>=e&&l+u<=i){n.push(a);continue}const c=Math.max(0,e-l),h=Math.min(i-l,u);n.push(a.slice(c,h-c))}return n.length===0&&n.push(r[0].slice(0,0)),n}function cf(r,t,e,i){let n=0,s=0,o=t.length-1;do{if(n>=o-1)return e0?0:-1}function HA(r,t){const{nullBitmap:e}=r;if(!e||r.nullCount<=0)return-1;let i=0;for(const n of new uf(e,r.offset+(t||0),r.length,e,q_)){if(!n)return i;++i}return-1}function Qt(r,t,e){if(t===void 0)return-1;if(t===null)switch(r.typeId){case L.Union:break;case L.Dictionary:break;default:return HA(r,e)}const i=mr.getVisitFn(r),n=so(t);for(let s=(e||0)-1,o=r.length;++s{const n=r.data[i];return n.values.subarray(0,n.length)[Symbol.iterator]()});let e=0;return new Ip(r.data.length,i=>{const s=r.data[i].length,o=r.slice(e,e+s);return e+=s,new XA(o)})}let XA=class{constructor(t){this.vector=t,this.index=0}next(){return this.indexa.data):t;if(s.length===0||s.some(a=>!(a instanceof Se)))throw new TypeError("Vector constructor expects an Array of Data instances.");const o=(e=s[0])===null||e===void 0?void 0:e.type;switch(s.length){case 0:this._offsets=[0];break;case 1:{const{get:a,set:l,indexOf:u}=i0[o.typeId],c=s[0];this.isValid=h=>hf(c,h),this.get=h=>a(c,h),this.set=(h,p)=>l(c,h,p),this.indexOf=h=>u(c,h),this._offsets=[0,c.length];break}default:Object.setPrototypeOf(this,n0[o.typeId]),this._offsets=K_(s);break}this.data=s,this.type=o,this.stride=Ui(o),this.numChildren=(n=(i=o.children)===null||i===void 0?void 0:i.length)!==null&&n!==void 0?n:0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((t,e)=>t+e.byteLength,0)}get nullable(){return GA(this.data)}get nullCount(){return Q_(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(t){return!1}get(t){return null}at(t){return this.get(lf(t,this.length))}set(t,e){}indexOf(t,e){return-1}includes(t,e){return this.indexOf(t,e)>-1}[Symbol.iterator](){return ff.visit(this)}concat(...t){return new zn(this.data.concat(t.flatMap(e=>e.data).flat(Number.POSITIVE_INFINITY)))}slice(t,e){return new zn(Y_(this,t,e,({data:i,_offsets:n},s,o)=>Z_(i,n,s,o)))}toJSON(){return[...this]}toArray(){const{type:t,data:e,length:i,stride:n,ArrayType:s}=this;switch(t.typeId){case L.Int:case L.Float:case L.Decimal:case L.Time:case L.Timestamp:switch(e.length){case 0:return new s;case 1:return e[0].values.subarray(0,i*n);default:return e.reduce((o,{values:a,length:l})=>(o.array.set(a.subarray(0,l*n),o.offset),o.offset+=l*n,o),{array:new s(i*n),offset:0}).array}}return[...this]}toString(){return`[${[...this].join(",")}]`}getChild(t){var e;return this.getChildAt((e=this.type.children)===null||e===void 0?void 0:e.findIndex(i=>i.name===t))}getChildAt(t){return t>-1&&te[t])):null}get isMemoized(){return At.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(At.isDictionary(this.type)){const t=new Ep(this.data[0].dictionary),e=this.data.map(i=>{const n=i.clone();return n.dictionary=t,n});return new zn(e)}return new Ep(this)}unmemoize(){if(At.isDictionary(this.type)&&this.isMemoized){const t=this.data[0].dictionary.unmemoize(),e=this.data.map(i=>{const n=i.clone();return n.dictionary=t,n});return new zn(e)}return this}};r0=Symbol.toStringTag;Me[r0]=(r=>{r.type=At.prototype,r.data=[],r.length=0,r.stride=1,r.numChildren=0,r._offsets=new Uint32Array([0]),r[Symbol.isConcatSpreadable]=!0;const t=Object.keys(L).map(e=>L[e]).filter(e=>typeof e=="number"&&e!==L.NONE);for(const e of t){const i=mr.getVisitFnByTypeId(e),n=Xr.getVisitFnByTypeId(e),s=Fl.getVisitFnByTypeId(e);i0[e]={get:i,set:n,indexOf:s},n0[e]=Object.create(r,{isValid:{value:Ol(hf)},get:{value:Ol(mr.getVisitFnByTypeId(e))},set:{value:J_(Xr.getVisitFnByTypeId(e))},indexOf:{value:t0(Fl.getVisitFnByTypeId(e))}})}return"Vector"})(Me.prototype);let Ep=class s0 extends Me{constructor(t){super(t.data);const e=this.get,i=this.set,n=this.slice,s=new Array(this.length);Object.defineProperty(this,"get",{value(o){const a=s[o];if(a!==void 0)return a;const l=e.call(this,o);return s[o]=l,l}}),Object.defineProperty(this,"set",{value(o,a){i.call(this,o,a),s[o]=a}}),Object.defineProperty(this,"slice",{value:(o,a)=>new s0(n.call(this,o,a))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new Me(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}};class hh{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,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(t,e,i,n){return t.prep(8,24),t.writeInt64(BigInt(n??0)),t.pad(4),t.writeInt32(i),t.writeInt64(BigInt(e??0)),t.offset()}}class _r{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsFooter(t,e){return(e||new _r).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFooter(t,e){return t.setPosition(t.position()+me),(e||new _r).__init(t.readInt32(t.position())+t.position(),t)}version(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):ke.V1}schema(t){const e=this.bb.__offset(this.bb_pos,6);return e?(t||new ui).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}dictionaries(t,e){const i=this.bb.__offset(this.bb_pos,8);return i?(e||new hh).__init(this.bb.__vector(this.bb_pos+i)+t*24,this.bb):null}dictionariesLength(){const t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}recordBatches(t,e){const i=this.bb.__offset(this.bb_pos,10);return i?(e||new hh).__init(this.bb.__vector(this.bb_pos+i)+t*24,this.bb):null}recordBatchesLength(){const t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}customMetadata(t,e){const i=this.bb.__offset(this.bb_pos,12);return i?(e||new We).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+t*4),this.bb):null}customMetadataLength(){const t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}static startFooter(t){t.startObject(5)}static addVersion(t,e){t.addFieldInt16(0,e,ke.V1)}static addSchema(t,e){t.addFieldOffset(1,e,0)}static addDictionaries(t,e){t.addFieldOffset(2,e,0)}static startDictionariesVector(t,e){t.startVector(24,e,8)}static addRecordBatches(t,e){t.addFieldOffset(3,e,0)}static startRecordBatchesVector(t,e){t.startVector(24,e,8)}static addCustomMetadata(t,e){t.addFieldOffset(4,e,0)}static createCustomMetadataVector(t,e){t.startVector(4,e.length,4);for(let i=e.length-1;i>=0;i--)t.addOffset(e[i]);return t.endVector()}static startCustomMetadataVector(t,e){t.startVector(4,e,4)}static endFooter(t){return t.endObject()}static finishFooterBuffer(t,e){t.finish(e)}static finishSizePrefixedFooterBuffer(t,e){t.finish(e,void 0,!0)}}let Pe=class jn{constructor(t=[],e,i,n=ke.V5){this.fields=t||[],this.metadata=e||new Map,i||(i=fh(this.fields)),this.dictionaries=i,this.metadataVersion=n}get[Symbol.toStringTag](){return"Schema"}get names(){return this.fields.map(t=>t.name)}toString(){return`Schema<{ ${this.fields.map((t,e)=>`${e}: ${t}`).join(", ")} }>`}select(t){const e=new Set(t),i=this.fields.filter(n=>e.has(n.name));return new jn(i,this.metadata)}selectAt(t){const e=t.map(i=>this.fields[i]).filter(Boolean);return new jn(e,this.metadata)}assign(...t){const e=t[0]instanceof jn?t[0]:Array.isArray(t[0])?new jn(t[0]):new jn(t),i=[...this.fields],n=La(La(new Map,this.metadata),e.metadata),s=e.fields.filter(a=>{const l=i.findIndex(u=>u.name===a.name);return~l?(i[l]=a.clone({metadata:La(La(new Map,i[l].metadata),a.metadata)}))&&!1:!0}),o=fh(s,new Map);return new jn([...i,...s],n,new Map([...this.dictionaries,...o]))}};Pe.prototype.fields=null;Pe.prototype.metadata=null;Pe.prototype.dictionaries=null;class Ce{static new(...t){let[e,i,n,s]=t;return t[0]&&typeof t[0]=="object"&&({name:e}=t[0],i===void 0&&(i=t[0].type),n===void 0&&(n=t[0].nullable),s===void 0&&(s=t[0].metadata)),new Ce(`${e}`,i,n,s)}constructor(t,e,i=!1,n){this.name=t,this.type=e,this.nullable=i,this.metadata=n||new Map}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return"Field"}toString(){return`${this.name}: ${this.type}`}clone(...t){let[e,i,n,s]=t;return!t[0]||typeof t[0]!="object"?[e=this.name,i=this.type,n=this.nullable,s=this.metadata]=t:{name:e=this.name,type:i=this.type,nullable:n=this.nullable,metadata:s=this.metadata}=t[0],Ce.new(e,i,n,s)}}Ce.prototype.type=null;Ce.prototype.name=null;Ce.prototype.nullable=null;Ce.prototype.metadata=null;function La(r,t){return new Map([...r||new Map,...t||new Map])}function fh(r,t=new Map){for(let e=-1,i=r.length;++e0&&fh(s.children,t)}return t}var YA=Cv,qA=Qs;class Ko{static decode(t){t=new qA(ae(t));const e=_r.getRootAsFooter(t),i=Pe.decode(e.schema(),new Map,e.version());return new QA(i,e)}static encode(t){const e=new YA,i=Pe.encode(e,t.schema);_r.startRecordBatchesVector(e,t.numRecordBatches);for(const o of[...t.recordBatches()].slice().reverse())mn.encode(e,o);const n=e.endVector();_r.startDictionariesVector(e,t.numDictionaries);for(const o of[...t.dictionaryBatches()].slice().reverse())mn.encode(e,o);const s=e.endVector();return _r.startFooter(e),_r.addSchema(e,i),_r.addVersion(e,ke.V5),_r.addRecordBatches(e,n),_r.addDictionaries(e,s),_r.finishFooterBuffer(e,_r.endFooter(e)),e.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}constructor(t,e=ke.V5,i,n){this.schema=t,this.version=e,i&&(this._recordBatches=i),n&&(this._dictionaryBatches=n)}*recordBatches(){for(let t,e=-1,i=this.numRecordBatches;++e=0&&t=0&&t=0&&t=0&&tthis._closedPromiseResolve=t)}get closed(){return this._closedPromise}cancel(t){return Zt(this,void 0,void 0,function*(){yield this.return(t)})}write(t){this._ensureOpen()&&(this.resolvers.length<=0?this._values.push(t):this.resolvers.shift().resolve({done:!1,value:t}))}abort(t){this._closedPromiseResolve&&(this.resolvers.length<=0?this._error={error:t}:this.resolvers.shift().reject({done:!0,value:t}))}close(){if(this._closedPromiseResolve){const{resolvers:t}=this;for(;t.length>0;)t.shift().resolve(De);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(t){return kr.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,t)}toNodeStream(t){return kr.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,t)}throw(t){return Zt(this,void 0,void 0,function*(){return yield this.abort(t),De})}return(t){return Zt(this,void 0,void 0,function*(){return yield this.close(),De})}read(t){return Zt(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return Zt(this,void 0,void 0,function*(){return(yield this.next(t,"peek")).value})}next(...t){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,i)=>{this.resolvers.push({resolve:e,reject:i})}):Promise.resolve(De)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("AsyncQueue is closed")}}class Wa extends KA{write(t){if((t=ae(t)).byteLength>0)return super.write(t)}toString(t=!1){return t?eh(this.toUint8Array(!0)):this.toUint8Array(!1).then(eh)}toUint8Array(t=!1){return t?xi(this._values)[0]:Zt(this,void 0,void 0,function*(){var e,i,n,s;const o=[];let a=0;try{for(var l=!0,u=bi(this),c;c=yield u.next(),e=c.done,!e;l=!0){s=c.value,l=!1;const h=s;o.push(h),a+=h.byteLength}}catch(h){i={error:h}}finally{try{!l&&!e&&(n=u.return)&&(yield n.call(u))}finally{if(i)throw i.error}}return xi(o,a)[0]})}}class Pl{constructor(t){t&&(this.source=new ZA(kr.fromIterable(t)))}[Symbol.iterator](){return this}next(t){return this.source.next(t)}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}peek(t){return this.source.peek(t)}read(t){return this.source.read(t)}}class Js{constructor(t){t instanceof Js?this.source=t.source:t instanceof Wa?this.source=new Mn(kr.fromAsyncIterable(t)):Sv(t)?this.source=new Mn(kr.fromNodeStream(t)):rf(t)?this.source=new Mn(kr.fromDOMStream(t)):xv(t)?this.source=new Mn(kr.fromDOMStream(t.body)):oa(t)?this.source=new Mn(kr.fromIterable(t)):rs(t)?this.source=new Mn(kr.fromAsyncIterable(t)):no(t)&&(this.source=new Mn(kr.fromAsyncIterable(t)))}[Symbol.asyncIterator](){return this}next(t){return this.source.next(t)}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}get closed(){return this.source.closed}cancel(t){return this.source.cancel(t)}peek(t){return this.source.peek(t)}read(t){return this.source.read(t)}}class ZA{constructor(t){this.source=t}cancel(t){this.return(t)}peek(t){return this.next(t,"peek").value}read(t){return this.next(t,"read").value}next(t,e="read"){return this.source.next({cmd:e,size:t})}throw(t){return Object.create(this.source.throw&&this.source.throw(t)||De)}return(t){return Object.create(this.source.return&&this.source.return(t)||De)}}class Mn{constructor(t){this.source=t,this._closedPromise=new Promise(e=>this._closedPromiseResolve=e)}cancel(t){return Zt(this,void 0,void 0,function*(){yield this.return(t)})}get closed(){return this._closedPromise}read(t){return Zt(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return Zt(this,void 0,void 0,function*(){return(yield this.next(t,"peek")).value})}next(t){return Zt(this,arguments,void 0,function*(e,i="read"){return yield this.source.next({cmd:i,size:e})})}throw(t){return Zt(this,void 0,void 0,function*(){const e=this.source.throw&&(yield this.source.throw(t))||De;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(e)})}return(t){return Zt(this,void 0,void 0,function*(){const e=this.source.return&&(yield this.source.return(t))||De;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(e)})}}class Ap extends Pl{constructor(t,e){super(),this.position=0,this.buffer=ae(t),this.size=e===void 0?this.buffer.byteLength:e}readInt32(t){const{buffer:e,byteOffset:i}=this.readAt(t,4);return new DataView(e,i).getInt32(0,!0)}seek(t){return this.position=Math.min(t,this.size),t>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),i=new Uint32Array([t.buffer[1]>>>16,t.buffer[1]&65535,t.buffer[0]>>>16,t.buffer[0]&65535]);let n=e[3]*i[3];this.buffer[0]=n&65535;let s=n>>>16;return n=e[2]*i[3],s+=n,n=e[3]*i[2]>>>0,s+=n,this.buffer[0]+=s<<16,this.buffer[1]=s>>>0>>16,this.buffer[1]+=e[1]*i[3]+e[2]*i[2]+e[3]*i[1],this.buffer[1]+=e[0]*i[3]+e[1]*i[2]+e[2]*i[1]+e[3]*i[0]<<16,this}_plus(t){const e=this.buffer[0]+t.buffer[0]>>>0;this.buffer[1]+=t.buffer[1],e>>0&&++this.buffer[1],this.buffer[0]=e}lessThan(t){return this.buffer[1]>>0,e[2]=this.buffer[2]+t.buffer[2]>>>0,e[1]=this.buffer[1]+t.buffer[1]>>>0,e[0]=this.buffer[0]+t.buffer[0]>>>0,e[0]>>0&&++e[1],e[1]>>0&&++e[2],e[2]>>0&&++e[3],this.buffer[3]=e[3],this.buffer[2]=e[2],this.buffer[1]=e[1],this.buffer[0]=e[0],this}hex(){return`${Ns(this.buffer[3])} ${Ns(this.buffer[2])} ${Ns(this.buffer[1])} ${Ns(this.buffer[0])}`}static multiply(t,e){return new Ni(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new Ni(new Uint32Array(t.buffer)).plus(e)}static from(t,e=new Uint32Array(4)){return Ni.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(4)){return Ni.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(4)){const i=t.startsWith("-"),n=t.length,s=new Ni(e);for(let o=i?1:0;o0&&this.readData(t,i)||new Uint8Array(0)}readOffsets(t,e){return this.readData(t,e)}readTypeIds(t,e){return this.readData(t,e)}readData(t,{length:e,offset:i}=this.nextBufferRange()){return this.bytes.subarray(i,i+e)}readDictionary(t){return this.dictionaries.get(t.id)}}class eO extends a0{constructor(t,e,i,n,s){super(new Uint8Array(0),e,i,n,s),this.sources=t}readNullBitmap(t,e,{offset:i}=this.nextBufferRange()){return e<=0?new Uint8Array(0):Al(this.sources[i])}readOffsets(t,{offset:e}=this.nextBufferRange()){return _e(Uint8Array,_e(t.OffsetArrayType,this.sources[e]))}readTypeIds(t,{offset:e}=this.nextBufferRange()){return _e(Uint8Array,_e(t.ArrayType,this.sources[e]))}readData(t,{offset:e}=this.nextBufferRange()){const{sources:i}=this;return At.isTimestamp(t)||(At.isInt(t)||At.isTime(t))&&t.bitWidth===64||At.isDuration(t)||At.isDate(t)&&t.unit===Hr.MILLISECOND?_e(Uint8Array,No.convertArray(i[e])):At.isDecimal(t)?_e(Uint8Array,tO.convertArray(i[e])):At.isBinary(t)||At.isLargeBinary(t)||At.isFixedSizeBinary(t)?rO(i[e]):At.isBool(t)?Al(i[e]):At.isUtf8(t)||At.isLargeUtf8(t)?ef(i[e].join("")):_e(Uint8Array,_e(t.ArrayType,i[e].map(n=>+n)))}}function rO(r){const t=r.join(""),e=new Uint8Array(t.length/2);for(let i=0;i>1]=Number.parseInt(t.slice(i,i+2),16);return e}let Nt=class extends ie{compareSchemas(t,e){return t===e||e instanceof t.constructor&&this.compareManyFields(t.fields,e.fields)}compareManyFields(t,e){return t===e||Array.isArray(t)&&Array.isArray(e)&&t.length===e.length&&t.every((i,n)=>this.compareFields(i,e[n]))}compareFields(t,e){return t===e||e instanceof t.constructor&&t.name===e.name&&t.nullable===e.nullable&&this.visit(t.type,e.type)}};function lr(r,t){return t instanceof r.constructor}function us(r,t){return r===t||lr(r,t)}function Xi(r,t){return r===t||lr(r,t)&&r.bitWidth===t.bitWidth&&r.isSigned===t.isSigned}function ru(r,t){return r===t||lr(r,t)&&r.precision===t.precision}function iO(r,t){return r===t||lr(r,t)&&r.byteWidth===t.byteWidth}function mf(r,t){return r===t||lr(r,t)&&r.unit===t.unit}function aa(r,t){return r===t||lr(r,t)&&r.unit===t.unit&&r.timezone===t.timezone}function la(r,t){return r===t||lr(r,t)&&r.unit===t.unit&&r.bitWidth===t.bitWidth}function nO(r,t){return r===t||lr(r,t)&&r.children.length===t.children.length&&yn.compareManyFields(r.children,t.children)}function sO(r,t){return r===t||lr(r,t)&&r.children.length===t.children.length&&yn.compareManyFields(r.children,t.children)}function yf(r,t){return r===t||lr(r,t)&&r.mode===t.mode&&r.typeIds.every((e,i)=>e===t.typeIds[i])&&yn.compareManyFields(r.children,t.children)}function oO(r,t){return r===t||lr(r,t)&&r.id===t.id&&r.isOrdered===t.isOrdered&&yn.visit(r.indices,t.indices)&&yn.visit(r.dictionary,t.dictionary)}function gf(r,t){return r===t||lr(r,t)&&r.unit===t.unit}function ua(r,t){return r===t||lr(r,t)&&r.unit===t.unit}function aO(r,t){return r===t||lr(r,t)&&r.listSize===t.listSize&&r.children.length===t.children.length&&yn.compareManyFields(r.children,t.children)}function lO(r,t){return r===t||lr(r,t)&&r.keysSorted===t.keysSorted&&r.children.length===t.children.length&&yn.compareManyFields(r.children,t.children)}Nt.prototype.visitNull=us;Nt.prototype.visitBool=us;Nt.prototype.visitInt=Xi;Nt.prototype.visitInt8=Xi;Nt.prototype.visitInt16=Xi;Nt.prototype.visitInt32=Xi;Nt.prototype.visitInt64=Xi;Nt.prototype.visitUint8=Xi;Nt.prototype.visitUint16=Xi;Nt.prototype.visitUint32=Xi;Nt.prototype.visitUint64=Xi;Nt.prototype.visitFloat=ru;Nt.prototype.visitFloat16=ru;Nt.prototype.visitFloat32=ru;Nt.prototype.visitFloat64=ru;Nt.prototype.visitUtf8=us;Nt.prototype.visitLargeUtf8=us;Nt.prototype.visitBinary=us;Nt.prototype.visitLargeBinary=us;Nt.prototype.visitFixedSizeBinary=iO;Nt.prototype.visitDate=mf;Nt.prototype.visitDateDay=mf;Nt.prototype.visitDateMillisecond=mf;Nt.prototype.visitTimestamp=aa;Nt.prototype.visitTimestampSecond=aa;Nt.prototype.visitTimestampMillisecond=aa;Nt.prototype.visitTimestampMicrosecond=aa;Nt.prototype.visitTimestampNanosecond=aa;Nt.prototype.visitTime=la;Nt.prototype.visitTimeSecond=la;Nt.prototype.visitTimeMillisecond=la;Nt.prototype.visitTimeMicrosecond=la;Nt.prototype.visitTimeNanosecond=la;Nt.prototype.visitDecimal=us;Nt.prototype.visitList=nO;Nt.prototype.visitStruct=sO;Nt.prototype.visitUnion=yf;Nt.prototype.visitDenseUnion=yf;Nt.prototype.visitSparseUnion=yf;Nt.prototype.visitDictionary=oO;Nt.prototype.visitInterval=gf;Nt.prototype.visitIntervalDayTime=gf;Nt.prototype.visitIntervalYearMonth=gf;Nt.prototype.visitDuration=ua;Nt.prototype.visitDurationSecond=ua;Nt.prototype.visitDurationMillisecond=ua;Nt.prototype.visitDurationMicrosecond=ua;Nt.prototype.visitDurationNanosecond=ua;Nt.prototype.visitFixedSizeList=aO;Nt.prototype.visitMap=lO;const yn=new Nt;function dh(r,t){return yn.compareSchemas(r,t)}function qu(r,t){return uO(r,t.map(e=>e.data.concat()))}function uO(r,t){const e=[...r.fields],i=[],n={numBatches:t.reduce((h,p)=>Math.max(h,p.length),0)};let s=0,o=0,a=-1;const l=t.length;let u,c=[];for(;n.numBatches-- >0;){for(o=Number.POSITIVE_INFINITY,a=-1;++a0&&(i[s++]=se({type:new sr(e),length:o,nullCount:0,children:c.slice()})))}return[r=r.assign(e),i.map(h=>new fr(r,h))]}function cO(r,t,e,i,n){var s;const o=(t+63&-64)>>3;for(let a=-1,l=i.length;++a=t)c===t?e[a]=u:(e[a]=u.slice(0,t),n.numBatches=Math.max(n.numBatches,i[a].unshift(u.slice(t,c-t))));else{const h=r[a];r[a]=h.clone({nullable:!0}),e[a]=(s=u==null?void 0:u._changeLengthAndBackfillNullBitmap(t))!==null&&s!==void 0?s:se({type:h.type,length:t,nullCount:t,nullBitmap:new Uint8Array(o)})}}return e}var l0;let gn=class $n{constructor(...t){var e,i;if(t.length===0)return this.batches=[],this.schema=new Pe([]),this._offsets=[0],this;let n,s;t[0]instanceof Pe&&(n=t.shift()),t.at(-1)instanceof Uint32Array&&(s=t.pop());const o=l=>{if(l){if(l instanceof fr)return[l];if(l instanceof $n)return l.batches;if(l instanceof Se){if(l.type instanceof sr)return[new fr(new Pe(l.type.children),l)]}else{if(Array.isArray(l))return l.flatMap(u=>o(u));if(typeof l[Symbol.iterator]=="function")return[...l].flatMap(u=>o(u));if(typeof l=="object"){const u=Object.keys(l),c=u.map(f=>new Me([l[f]])),h=n??new Pe(u.map((f,y)=>new Ce(String(f),c[y].type,c[y].nullable))),[,p]=qu(h,c);return p.length===0?[new fr(l)]:p}}}return[]},a=t.flatMap(l=>o(l));if(n=(i=n??((e=a[0])===null||e===void 0?void 0:e.schema))!==null&&i!==void 0?i:new Pe([]),!(n instanceof Pe))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");for(const l of a){if(!(l instanceof fr))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");if(!dh(n,l.schema))throw new TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=n,this.batches=a,this._offsets=s??K_(this.data)}get data(){return this.batches.map(({data:t})=>t)}get numCols(){return this.schema.fields.length}get numRows(){return this.data.reduce((t,e)=>t+e.length,0)}get nullCount(){return this._nullCount===-1&&(this._nullCount=Q_(this.data)),this._nullCount}isValid(t){return!1}get(t){return null}at(t){return this.get(lf(t,this.numRows))}set(t,e){}indexOf(t,e){return-1}[Symbol.iterator](){return this.batches.length>0?ff.visit(new Me(this.data)):new Array(0)[Symbol.iterator]()}toArray(){return[...this]}toString(){return`[ ${this.toArray().join(`, `)} -]`}concat(...t){const e=this.schema,i=this.data.concat(t.flatMap(({data:n})=>n));return new $n(e,i.map(n=>new fr(e,n)))}slice(t,e){const i=this.schema;[t,e]=Y_({length:this.numRows},t,e);const n=Z_(this.data,this._offsets,t,e);return new $n(i,n.map(s=>new fr(i,s)))}getChild(t){return this.getChildAt(this.schema.fields.findIndex(e=>e.name===t))}getChildAt(t){if(t>-1&&ti.children[t]);if(e.length===0){const{type:i}=this.schema.fields[t],n=se({type:i,length:0,nullCount:0});e.push(n._changeLengthAndBackfillNullBitmap(this.numRows))}return new Me(e)}return null}setChild(t,e){var i;return this.setChildAt((i=this.schema.fields)===null||i===void 0?void 0:i.findIndex(n=>n.name===t),e)}setChildAt(t,e){let i=this.schema,n=[...this.batches];if(t>-1&&tthis.getChildAt(u));[s[t],a[t]]=[o,e],[i,n]=qu(i,a)}return new $n(i,n)}select(t){const e=this.schema.fields.reduce((i,n,s)=>i.set(n.name,s),new Map);return this.selectAt(t.map(i=>e.get(i)).filter(i=>i>-1))}selectAt(t){const e=this.schema.selectAt(t),i=this.batches.map(n=>n.selectAt(t));return new $n(e,i)}assign(t){const e=this.schema.fields,[i,n]=t.schema.fields.reduce((a,l,u)=>{const[c,h]=a,p=e.findIndex(f=>f.name===l.name);return~p?h[p]=u:c.push(u),a},[[],[]]),s=this.schema.assign(t.schema),o=[...e.map((a,l)=>[l,n[l]]).map(([a,l])=>l===void 0?this.getChildAt(a):t.getChildAt(l)),...i.map(a=>t.getChildAt(a))].filter(Boolean);return new $n(...qu(s,o))}};l0=Symbol.toStringTag;gn[l0]=(r=>(r.schema=null,r.batches=[],r._offsets=new Uint32Array([0]),r._nullCount=-1,r[Symbol.isConcatSpreadable]=!0,r.isValid=Ol(hf),r.get=Ol(mr.getVisitFn(L.Struct)),r.set=J_(Xr.getVisitFn(L.Struct)),r.indexOf=t0(Fl.getVisitFn(L.Struct)),"Table"))(gn.prototype);var u0;let fr=class Po{constructor(...t){switch(t.length){case 2:{if([this.schema]=t,!(this.schema instanceof Pe))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=se({nullCount:0,type:new sr(this.schema.fields),children:this.schema.fields.map(e=>se({type:e.type,nullCount:0}))})]=t,!(this.data instanceof Se))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=Op(this.schema,this.data.children);break}case 1:{const[e]=t,{fields:i,children:n,length:s}=Object.keys(e).reduce((l,u,c)=>(l.children[c]=e[u],l.length=Math.max(l.length,e[u].length),l.fields[c]=Ce.new({name:u,type:e[u].type,nullable:!0}),l),{length:0,fields:new Array,children:new Array}),o=new Pe(i),a=se({type:new sr(i),length:s,children:n,nullCount:0});[this.schema,this.data]=Op(o,a.children,s);break}default:throw new TypeError("RecordBatch constructor expects an Object mapping names to child Data, or a [Schema, Data] pair.")}}get dictionaries(){return this._dictionaries||(this._dictionaries=c0(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(t){return this.data.getValid(t)}get(t){return mr.visit(this.data,t)}at(t){return this.get(lf(t,this.numRows))}set(t,e){return Xr.visit(this.data,t,e)}indexOf(t,e){return Fl.visit(this.data,t,e)}[Symbol.iterator](){return ff.visit(new Me([this.data]))}toArray(){return[...this]}concat(...t){return new gn(this.schema,[this,...t])}slice(t,e){const[i]=new Me([this.data]).slice(t,e).data;return new Po(this.schema,i)}getChild(t){var e;return this.getChildAt((e=this.schema.fields)===null||e===void 0?void 0:e.findIndex(i=>i.name===t))}getChildAt(t){return t>-1&&tn.name===t),e)}setChildAt(t,e){let i=this.schema,n=this.data;if(t>-1&&ta.name===s);~o&&(n[o]=this.data.children[o])}return new Po(e,se({type:i,length:this.numRows,children:n}))}selectAt(t){const e=this.schema.selectAt(t),i=t.map(s=>this.data.children[s]).filter(Boolean),n=se({type:new sr(e.fields),length:this.numRows,children:i});return new Po(e,n)}};u0=Symbol.toStringTag;fr[u0]=(r=>(r._nullCount=-1,r[Symbol.isConcatSpreadable]=!0,"RecordBatch"))(fr.prototype);function Op(r,t,e=t.reduce((i,n)=>Math.max(i,n.length),0)){var i;const n=[...r.fields],s=[...t],o=(e+63&-64)>>3;for(const[a,l]of r.fields.entries()){const u=t[a];(!u||u.length!==e)&&(n[a]=l.clone({nullable:!0}),s[a]=(i=u==null?void 0:u._changeLengthAndBackfillNullBitmap(e))!==null&&i!==void 0?i:se({type:l.type,length:e,nullCount:e,nullBitmap:new Uint8Array(o)}))}return[r.assign(n),se({type:new sr(n),length:e,children:s})]}function c0(r,t,e=new Map){var i,n;if(((i=r==null?void 0:r.length)!==null&&i!==void 0?i:0)>0&&(r==null?void 0:r.length)===(t==null?void 0:t.length))for(let s=-1,o=r.length;++sse({type:n.type})),i=se({type:new sr(t.fields),nullCount:0,children:e});super(t,i)}}let en=class ai{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsMessage(t,e){return(e||new ai).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMessage(t,e){return t.setPosition(t.position()+me),(e||new ai).__init(t.readInt32(t.position())+t.position(),t)}version(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):ke.V1}headerType(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):fe.NONE}header(t){const e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__union(t,this.bb_pos+e):null}bodyLength(){const t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}customMetadata(t,e){const i=this.bb.__offset(this.bb_pos,12);return i?(e||new We).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+t*4),this.bb):null}customMetadataLength(){const t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}static startMessage(t){t.startObject(5)}static addVersion(t,e){t.addFieldInt16(0,e,ke.V1)}static addHeaderType(t,e){t.addFieldInt8(1,e,fe.NONE)}static addHeader(t,e){t.addFieldOffset(2,e,0)}static addBodyLength(t,e){t.addFieldInt64(3,e,BigInt("0"))}static addCustomMetadata(t,e){t.addFieldOffset(4,e,0)}static createCustomMetadataVector(t,e){t.startVector(4,e.length,4);for(let i=e.length-1;i>=0;i--)t.addOffset(e[i]);return t.endVector()}static startCustomMetadataVector(t,e){t.startVector(4,e,4)}static endMessage(t){return t.endObject()}static finishMessageBuffer(t,e){t.finish(e)}static finishSizePrefixedMessageBuffer(t,e){t.finish(e,void 0,!0)}static createMessage(t,e,i,n,s,o){return ai.startMessage(t),ai.addVersion(t,e),ai.addHeaderType(t,i),ai.addHeader(t,n),ai.addBodyLength(t,s),ai.addCustomMetadata(t,o),ai.endMessage(t)}};class hO extends ie{visit(t,e){return t==null||e==null?void 0:super.visit(t,e)}visitNull(t,e){return _p.startNull(e),_p.endNull(e)}visitInt(t,e){return xr.startInt(e),xr.addBitWidth(e,t.bitWidth),xr.addIsSigned(e,t.isSigned),xr.endInt(e)}visitFloat(t,e){return mi.startFloatingPoint(e),mi.addPrecision(e,t.precision),mi.endFloatingPoint(e)}visitBinary(t,e){return pp.startBinary(e),pp.endBinary(e)}visitLargeBinary(t,e){return yp.startLargeBinary(e),yp.endLargeBinary(e)}visitBool(t,e){return mp.startBool(e),mp.endBool(e)}visitUtf8(t,e){return bp.startUtf8(e),bp.endUtf8(e)}visitLargeUtf8(t,e){return gp.startLargeUtf8(e),gp.endLargeUtf8(e)}visitDecimal(t,e){return Ss.startDecimal(e),Ss.addScale(e,t.scale),Ss.addPrecision(e,t.precision),Ss.addBitWidth(e,t.bitWidth),Ss.endDecimal(e)}visitDate(t,e){return Ua.startDate(e),Ua.addUnit(e,t.unit),Ua.endDate(e)}visitTime(t,e){return zr.startTime(e),zr.addUnit(e,t.unit),zr.addBitWidth(e,t.bitWidth),zr.endTime(e)}visitTimestamp(t,e){const i=t.timezone&&e.createString(t.timezone)||void 0;return jr.startTimestamp(e),jr.addUnit(e,t.unit),i!==void 0&&jr.addTimezone(e,i),jr.endTimestamp(e)}visitInterval(t,e){return yi.startInterval(e),yi.addUnit(e,t.unit),yi.endInterval(e)}visitDuration(t,e){return za.startDuration(e),za.addUnit(e,t.unit),za.endDuration(e)}visitList(t,e){return vp.startList(e),vp.endList(e)}visitStruct(t,e){return Yn.startStruct_(e),Yn.endStruct_(e)}visitUnion(t,e){hr.startTypeIdsVector(e,t.typeIds.length);const i=hr.createTypeIdsVector(e,t.typeIds);return hr.startUnion(e),hr.addMode(e,t.mode),hr.addTypeIds(e,i),hr.endUnion(e)}visitDictionary(t,e){const i=this.visit(t.indices,e);return $i.startDictionaryEncoding(e),$i.addId(e,BigInt(t.id)),$i.addIsOrdered(e,t.isOrdered),i!==void 0&&$i.addIndexType(e,i),$i.endDictionaryEncoding(e)}visitFixedSizeBinary(t,e){return ja.startFixedSizeBinary(e),ja.addByteWidth(e,t.byteWidth),ja.endFixedSizeBinary(e)}visitFixedSizeList(t,e){return $a.startFixedSizeList(e),$a.addListSize(e,t.listSize),$a.endFixedSizeList(e)}visitMap(t,e){return Va.startMap(e),Va.addKeysSorted(e,t.keysSorted),Va.endMap(e)}}const Qu=new hO;function fO(r,t=new Map){return new Pe(pO(r,t),Ha(r.metadata),t)}function h0(r){return new Fr(r.count,f0(r.columns),d0(r.columns))}function dO(r){return new Ti(h0(r.data),r.id,r.isDelta)}function pO(r,t){return(r.fields||[]).filter(Boolean).map(e=>Ce.fromJSON(e,t))}function Fp(r,t){return(r.children||[]).filter(Boolean).map(e=>Ce.fromJSON(e,t))}function f0(r){return(r||[]).reduce((t,e)=>[...t,new vn(e.count,mO(e.VALIDITY)),...f0(e.children)],[])}function d0(r,t=[]){for(let e=-1,i=(r||[]).length;++et+ +(e===0),0)}function yO(r,t){let e,i,n,s,o,a;return!t||!(s=r.dictionary)?(o=Mp(r,Fp(r,t)),n=new Ce(r.name,o,r.nullable,Ha(r.metadata))):t.has(e=s.id)?(i=(i=s.indexType)?Pp(i):new Qo,a=new Zs(t.get(e),i,e,s.isOrdered),n=new Ce(r.name,a,r.nullable,Ha(r.metadata))):(i=(i=s.indexType)?Pp(i):new Qo,t.set(e,o=Mp(r,Fp(r,t))),a=new Zs(o,i,e,s.isOrdered),n=new Ce(r.name,a,r.nullable,Ha(r.metadata))),n||null}function Ha(r=[]){return new Map(r.map(({key:t,value:e})=>[t,e]))}function Pp(r){return new is(r.isSigned,r.bitWidth)}function Mp(r,t){const e=r.type.name;switch(e){case"NONE":return new pn;case"null":return new pn;case"binary":return new hl;case"largebinary":return new fl;case"utf8":return new dl;case"largeutf8":return new pl;case"bool":return new ml;case"list":return new xl((t||[])[0]);case"struct":return new sr(t||[]);case"struct_":return new sr(t||[])}switch(e){case"int":{const i=r.type;return new is(i.isSigned,i.bitWidth)}case"floatingpoint":{const i=r.type;return new cl(tr[i.precision])}case"decimal":{const i=r.type;return new yl(i.scale,i.precision,i.bitWidth)}case"date":{const i=r.type;return new gl(Hr[i.unit])}case"time":{const i=r.type;return new vl(zt[i.unit],i.bitWidth)}case"timestamp":{const i=r.type;return new _l(zt[i.unit],i.timezone)}case"interval":{const i=r.type;return new bl(Si[i.unit])}case"duration":{const i=r.type;return new wl(zt[i.unit])}case"union":{const i=r.type,[n,...s]=(i.mode+"").toLowerCase(),o=n.toUpperCase()+s.join("");return new Sl(er[o],i.typeIds||[],t||[])}case"fixedsizebinary":{const i=r.type;return new Tl(i.byteWidth)}case"fixedsizelist":{const i=r.type;return new Il(i.listSize,(t||[])[0])}case"map":{const i=r.type;return new El((t||[])[0],i.keysSorted)}}throw new Error(`Unrecognized type: "${e}"`)}var gO=Cv,vO=Qs;class or{static fromJSON(t,e){const i=new or(0,ke.V5,e);return i._createHeader=_O(t,e),i}static decode(t){t=new vO(ae(t));const e=en.getRootAsMessage(t),i=e.bodyLength(),n=e.version(),s=e.headerType(),o=new or(i,n,s);return o._createHeader=bO(e,s),o}static encode(t){const e=new gO;let i=-1;return t.isSchema()?i=Pe.encode(e,t.header()):t.isRecordBatch()?i=Fr.encode(e,t.header()):t.isDictionaryBatch()&&(i=Ti.encode(e,t.header())),en.startMessage(e),en.addVersion(e,ke.V5),en.addHeader(e,i),en.addHeaderType(e,t.headerType),en.addBodyLength(e,BigInt(t.bodyLength)),en.finishMessageBuffer(e,en.endMessage(e)),e.asUint8Array()}static from(t,e=0){if(t instanceof Pe)return new or(0,ke.V5,fe.Schema,t);if(t instanceof Fr)return new or(e,ke.V5,fe.RecordBatch,t);if(t instanceof Ti)return new or(e,ke.V5,fe.DictionaryBatch,t);throw new 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===fe.Schema}isRecordBatch(){return this.headerType===fe.RecordBatch}isDictionaryBatch(){return this.headerType===fe.DictionaryBatch}constructor(t,e,i,n){this._version=e,this._headerType=i,this.body=new Uint8Array(0),n&&(this._createHeader=()=>n),this._bodyLength=we(t)}}class Fr{get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}constructor(t,e,i){this._nodes=e,this._buffers=i,this._length=we(t)}}class Ti{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(t,e,i=!1){this._data=t,this._isDelta=i,this._id=we(e)}}class vi{constructor(t,e){this.offset=we(t),this.length=we(e)}}class vn{constructor(t,e){this.length=we(t),this.nullCount=we(e)}}function _O(r,t){return()=>{switch(t){case fe.Schema:return Pe.fromJSON(r);case fe.RecordBatch:return Fr.fromJSON(r);case fe.DictionaryBatch:return Ti.fromJSON(r)}throw new Error(`Unrecognized Message type: { name: ${fe[t]}, type: ${t} }`)}}function bO(r,t){return()=>{switch(t){case fe.Schema:return Pe.decode(r.header(new ui),new Map,r.version());case fe.RecordBatch:return Fr.decode(r.header(new Bi),r.version());case fe.DictionaryBatch:return Ti.decode(r.header(new ws),r.version())}throw new Error(`Unrecognized Message type: { name: ${fe[t]}, type: ${t} }`)}}Ce.encode=PO;Ce.decode=OO;Ce.fromJSON=yO;Pe.encode=FO;Pe.decode=wO;Pe.fromJSON=fO;Fr.encode=MO;Fr.decode=xO;Fr.fromJSON=h0;Ti.encode=DO;Ti.decode=SO;Ti.fromJSON=dO;vn.encode=RO;vn.decode=IO;vi.encode=NO;vi.decode=TO;function wO(r,t=new Map,e=ke.V5){const i=AO(r,t);return new Pe(i,Xa(r),t,e)}function xO(r,t=ke.V5){if(r.compression()!==null)throw new Error("Record batch compression not implemented");return new Fr(r.length(),EO(r),CO(r,t))}function SO(r,t=ke.V5){return new Ti(Fr.decode(r.data(),t),r.id(),r.isDelta())}function TO(r){return new vi(r.offset(),r.length())}function IO(r){return new vn(r.length(),r.nullCount())}function EO(r){const t=[];for(let e,i=-1,n=-1,s=r.nodesLength();++iCe.encode(r,s));ui.startFieldsVector(r,e.length);const i=ui.createFieldsVector(r,e),n=t.metadata&&t.metadata.size>0?ui.createCustomMetadataVector(r,[...t.metadata].map(([s,o])=>{const a=r.createString(`${s}`),l=r.createString(`${o}`);return We.startKeyValue(r),We.addKey(r,a),We.addValue(r,l),We.endKeyValue(r)})):-1;return ui.startSchema(r),ui.addFields(r,i),ui.addEndianness(r,LO?Ks.Little:Ks.Big),n!==-1&&ui.addCustomMetadata(r,n),ui.endSchema(r)}function PO(r,t){let e=-1,i=-1,n=-1;const s=t.type;let o=t.typeId;At.isDictionary(s)?(o=s.dictionary.typeId,n=Qu.visit(s,r),i=Qu.visit(s.dictionary,r)):i=Qu.visit(s,r);const a=(s.children||[]).map(c=>Ce.encode(r,c)),l=Nr.createChildrenVector(r,a),u=t.metadata&&t.metadata.size>0?Nr.createCustomMetadataVector(r,[...t.metadata].map(([c,h])=>{const p=r.createString(`${c}`),f=r.createString(`${h}`);return We.startKeyValue(r),We.addKey(r,p),We.addValue(r,f),We.endKeyValue(r)})):-1;return t.name&&(e=r.createString(t.name)),Nr.startField(r),Nr.addType(r,i),Nr.addTypeType(r,o),Nr.addChildren(r,l),Nr.addNullable(r,!!t.nullable),e!==-1&&Nr.addName(r,e),n!==-1&&Nr.addDictionary(r,n),u!==-1&&Nr.addCustomMetadata(r,u),Nr.endField(r)}function MO(r,t){const e=t.nodes||[],i=t.buffers||[];Bi.startNodesVector(r,e.length);for(const o of e.slice().reverse())vn.encode(r,o);const n=r.endVector();Bi.startBuffersVector(r,i.length);for(const o of i.slice().reverse())vi.encode(r,o);const s=r.endVector();return Bi.startRecordBatch(r),Bi.addLength(r,BigInt(t.length)),Bi.addNodes(r,n),Bi.addBuffers(r,s),Bi.endRecordBatch(r)}function DO(r,t){const e=Fr.encode(r,t.data);return ws.startDictionaryBatch(r),ws.addId(r,BigInt(t.id)),ws.addIsDelta(r,t.isDelta),ws.addData(r,e),ws.endDictionaryBatch(r)}function RO(r,t){return Fv.createFieldNode(r,BigInt(t.length),BigInt(t.nullCount))}function NO(r,t){return Ov.createBuffer(r,BigInt(t.offset),BigInt(t.length))}const LO=(()=>{const r=new ArrayBuffer(2);return new DataView(r).setInt16(0,256,!0),new Int16Array(r)[0]===256})(),_f=r=>`Expected ${fe[r]} Message in stream, but was null or length 0.`,bf=r=>`Header pointer of flatbuffer-encoded ${fe[r]} Message is null or length 0.`,p0=(r,t)=>`Expected to read ${r} metadata bytes, but only read ${t}.`,m0=(r,t)=>`Expected to read ${r} bytes for message body, but only read ${t}.`;class y0{constructor(t){this.source=t instanceof Pl?t:new Pl(t)}[Symbol.iterator](){return this}next(){let t;return(t=this.readMetadataLength()).done||t.value===-1&&(t=this.readMetadataLength()).done||(t=this.readMetadata(t.value)).done?De:t}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}readMessage(t){let e;if((e=this.next()).done)return null;if(t!=null&&e.value.headerType!==t)throw new Error(_f(t));return e.value}readMessageBody(t){if(t<=0)return new Uint8Array(0);const e=ae(this.source.read(t));if(e.byteLength[...n,...s.VALIDITY&&[s.VALIDITY]||[],...s.TYPE_ID&&[s.TYPE_ID]||[],...s.OFFSET&&[s.OFFSET]||[],...s.DATA&&[s.DATA]||[],...e(s.children)],[])}}readMessage(t){let e;if((e=this.next()).done)return null;if(t!=null&&e.value.headerType!==t)throw new Error(_f(t));return e.value}readSchema(){const t=fe.Schema,e=this.readMessage(t),i=e==null?void 0:e.header();if(!e||!i)throw new Error(bf(t));return i}}const iu=4,ph="ARROW1",Zo=new Uint8Array(ph.length);for(let r=0;rthis):this}readRecordBatch(t){return this._impl.isFile()?this._impl.readRecordBatch(t):null}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}toDOMStream(){return kr.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return kr.toNodeStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this},{objectMode:!0})}static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t,e){throw new Error('"throughDOM" not available in this environment')}static from(t){return t instanceof Vr?t:rh(t)?VO(t):wv(t)?HO(t):rs(t)?Zt(this,void 0,void 0,function*(){return yield Vr.from(yield t)}):xv(t)||rf(t)||Sv(t)||no(t)?WO(new Js(t)):GO(new Pl(t))}static readAll(t){return t instanceof Vr?t.isSync()?Lp(t):Bp(t):rh(t)||ArrayBuffer.isView(t)||oa(t)||bv(t)?Lp(t):Bp(t)}}class Dl extends Vr{constructor(t){super(t),this._impl=t}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return dr(this,arguments,function*(){yield Pt(yield*ts(bi(this[Symbol.iterator]())))})}}class Rl extends Vr{constructor(t){super(t),this._impl=t}readAll(){return Zt(this,void 0,void 0,function*(){var t,e,i,n;const s=new Array;try{for(var o=!0,a=bi(this),l;l=yield a.next(),t=l.done,!t;o=!0){n=l.value,o=!1;const u=n;s.push(u)}}catch(u){e={error:u}}finally{try{!o&&!t&&(i=a.return)&&(yield i.call(a))}finally{if(e)throw e.error}}return s})}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}}class v0 extends Dl{constructor(t){super(t),this._impl=t}}class zO extends Rl{constructor(t){super(t),this._impl=t}}class _0{get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}constructor(t=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=t}isSync(){return!1}isAsync(){return!1}isFile(){return!1}isStream(){return!1}reset(t){return this._dictionaryIndex=0,this._recordBatchIndex=0,this.schema=t,this.dictionaries=new Map,this}_loadRecordBatch(t,e){const i=this._loadVectors(t,e,this.schema.fields),n=se({type:new sr(this.schema.fields),length:t.length,children:i});return new fr(this.schema,n)}_loadDictionaryBatch(t,e){const{id:i,isDelta:n}=t,{dictionaries:s,schema:o}=this,a=s.get(i),l=o.dictionaries.get(i),u=this._loadVectors(t.data,e,[l]);return(a&&n?a.concat(new Me(u)):new Me(u)).memoize()}_loadVectors(t,e,i){return new a0(e,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(i)}}class Nl extends _0{constructor(t,e){super(e),this._reader=rh(t)?new kO(this._handle=t):new y0(this._handle=t)}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(t){return this.closed||(this.autoDestroy=w0(this,t),this.schema||(this.schema=this._reader.readSchema())||this.cancel()),this}throw(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.throw(t):De}return(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(t):De}next(){if(this.closed)return De;let t;const{_reader:e}=this;for(;t=this._readNextMessageAndValidate();)if(t.isSchema())this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;const i=t.header(),n=e.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(i,n)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;const i=t.header(),n=e.readMessageBody(t.bodyLength),s=this._loadDictionaryBatch(i,n);this.dictionaries.set(i.id,s)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new vf(this.schema)}):this.return()}_readNextMessageAndValidate(t){return this._reader.readMessage(t)}}class Ll extends _0{constructor(t,e){super(e),this._reader=new BO(this._handle=t)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return Zt(this,void 0,void 0,function*(){!this.closed&&(this.closed=!0)&&(yield this.reset()._reader.return(),this._reader=null,this.dictionaries=null)})}open(t){return Zt(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=w0(this,t),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(t){return Zt(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(t):De})}return(t){return Zt(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(t):De})}next(){return Zt(this,void 0,void 0,function*(){if(this.closed)return De;let t;const{_reader:e}=this;for(;t=yield this._readNextMessageAndValidate();)if(t.isSchema())yield this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;const i=t.header(),n=yield e.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(i,n)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;const i=t.header(),n=yield e.readMessageBody(t.bodyLength),s=this._loadDictionaryBatch(i,n);this.dictionaries.set(i.id,s)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new vf(this.schema)}):yield this.return()})}_readNextMessageAndValidate(t){return Zt(this,void 0,void 0,function*(){return yield this._reader.readMessage(t)})}}class b0 extends Nl{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(t,e){super(t instanceof Ap?t:new Ap(t),e)}isSync(){return!0}isFile(){return!0}open(t){if(!this.closed&&!this._footer){this.schema=(this._footer=this._readFooter()).schema;for(const e of this._footer.dictionaryBatches())e&&this._readDictionaryBatch(this._dictionaryIndex++)}return super.open(t)}readRecordBatch(t){var e;if(this.closed)return null;this._footer||this.open();const i=(e=this._footer)===null||e===void 0?void 0:e.getRecordBatch(t);if(i&&this._handle.seek(i.offset)){const n=this._reader.readMessage(fe.RecordBatch);if(n!=null&&n.isRecordBatch()){const s=n.header(),o=this._reader.readMessageBody(n.bodyLength);return this._loadRecordBatch(s,o)}}return null}_readDictionaryBatch(t){var e;const i=(e=this._footer)===null||e===void 0?void 0:e.getDictionaryBatch(t);if(i&&this._handle.seek(i.offset)){const n=this._reader.readMessage(fe.DictionaryBatch);if(n!=null&&n.isDictionaryBatch()){const s=n.header(),o=this._reader.readMessageBody(n.bodyLength),a=this._loadDictionaryBatch(s,o);this.dictionaries.set(s.id,a)}}}_readFooter(){const{_handle:t}=this,e=t.size-g0,i=t.readInt32(e),n=t.readAt(e-i,i);return Ko.decode(n)}_readNextMessageAndValidate(t){var e;if(this._footer||this.open(),this._footer&&this._recordBatchIndexsuper.open}});return Zt(this,void 0,void 0,function*(){if(!this.closed&&!this._footer){this.schema=(this._footer=yield this._readFooter()).schema;for(const i of this._footer.dictionaryBatches())i&&(yield this._readDictionaryBatch(this._dictionaryIndex++))}return yield e.open.call(this,t)})}readRecordBatch(t){return Zt(this,void 0,void 0,function*(){var e;if(this.closed)return null;this._footer||(yield this.open());const i=(e=this._footer)===null||e===void 0?void 0:e.getRecordBatch(t);if(i&&(yield this._handle.seek(i.offset))){const n=yield this._reader.readMessage(fe.RecordBatch);if(n!=null&&n.isRecordBatch()){const s=n.header(),o=yield this._reader.readMessageBody(n.bodyLength);return this._loadRecordBatch(s,o)}}return null})}_readDictionaryBatch(t){return Zt(this,void 0,void 0,function*(){var e;const i=(e=this._footer)===null||e===void 0?void 0:e.getDictionaryBatch(t);if(i&&(yield this._handle.seek(i.offset))){const n=yield this._reader.readMessage(fe.DictionaryBatch);if(n!=null&&n.isDictionaryBatch()){const s=n.header(),o=yield this._reader.readMessageBody(n.bodyLength),a=this._loadDictionaryBatch(s,o);this.dictionaries.set(s.id,a)}}})}_readFooter(){return Zt(this,void 0,void 0,function*(){const{_handle:t}=this;t._pending&&(yield t._pending);const e=t.size-g0,i=yield t.readInt32(e),n=yield t.readAt(e-i,i);return Ko.decode(n)})}_readNextMessageAndValidate(t){return Zt(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex=4?wf(t)?new v0(new b0(r.read())):new Dl(new Nl(r)):new Dl(new Nl(function*(){}()))}function WO(r){return Zt(this,void 0,void 0,function*(){const t=yield r.peek(ca+7&-8);return t&&t.byteLength>=4?wf(t)?new v0(new b0(yield r.read())):new Rl(new Ll(r)):new Rl(new Ll(function(){return dr(this,arguments,function*(){})}()))})}function HO(r){return Zt(this,void 0,void 0,function*(){const{size:t}=yield r.stat(),e=new Ml(r,t);return t>=UO&&wf(yield e.readAt(0,ca+7&-8))?new zO(new jO(e)):new Rl(new Ll(e))})}class Ne extends ie{static assemble(...t){const e=n=>n.flatMap(s=>Array.isArray(s)?e(s):s instanceof fr?s.data.children:s.data),i=new Ne;return i.visitMany(e(t)),i}constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[]}visit(t){if(t instanceof Me)return this.visitMany(t.data),this;const{type:e}=t;if(!At.isDictionary(e)){const{length:i}=t;if(i>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");if(At.isUnion(e))this.nodes.push(new vn(i,0));else{const{nullCount:n}=t;At.isNull(e)||ti.call(this,n<=0?new Uint8Array(0):Cl(t.offset,i,t.nullBitmap)),this.nodes.push(new vn(i,n))}}return super.visit(t)}visitNull(t){return this}visitDictionary(t){return this.visit(t.clone(t.type.indices))}get nodes(){return this._nodes}get buffers(){return this._buffers}get byteLength(){return this._byteLength}get bufferRegions(){return this._bufferRegions}}function ti(r){const t=r.byteLength+7&-8;return this.buffers.push(r),this.bufferRegions.push(new vi(this._byteLength,t)),this._byteLength+=t,this}function XO(r){var t;const{type:e,length:i,typeIds:n,valueOffsets:s}=r;if(ti.call(this,n),e.mode===er.Sparse)return mh.call(this,r);if(e.mode===er.Dense){if(r.offset<=0)return ti.call(this,s),mh.call(this,r);{const o=new Int32Array(i),a=Object.create(null),l=Object.create(null);for(let u,c,h=-1;++h{const h=e.typeIds[c],p=a[h],f=l[h];return u.slice(p,Math.min(i,f))}))}}return this}function YO(r){let t;return r.nullCount>=r.length?ti.call(this,new Uint8Array(0)):(t=r.values)instanceof Uint8Array?ti.call(this,Cl(r.offset,r.length,t)):ti.call(this,Al(r.values))}function Yi(r){return ti.call(this,r.values.subarray(0,r.length*r.stride))}function nu(r){const{length:t,values:e,valueOffsets:i}=r,n=we(i[0]),s=we(i[t]),o=Math.min(s-n,e.byteLength-n);return ti.call(this,Iv(-n,t+1,i)),ti.call(this,e.subarray(n,n+o)),this}function xf(r){const{length:t,valueOffsets:e}=r;if(e){const{[0]:i,[t]:n}=e;return ti.call(this,Iv(-i,t+1,e)),this.visit(r.children[0].slice(i,n-i))}return this.visit(r.children[0])}function mh(r){return this.visitMany(r.type.children.map((t,e)=>r.children[e]).filter(Boolean))[0]}Ne.prototype.visitBool=YO;Ne.prototype.visitInt=Yi;Ne.prototype.visitFloat=Yi;Ne.prototype.visitUtf8=nu;Ne.prototype.visitLargeUtf8=nu;Ne.prototype.visitBinary=nu;Ne.prototype.visitLargeBinary=nu;Ne.prototype.visitFixedSizeBinary=Yi;Ne.prototype.visitDate=Yi;Ne.prototype.visitTimestamp=Yi;Ne.prototype.visitTime=Yi;Ne.prototype.visitDecimal=Yi;Ne.prototype.visitList=xf;Ne.prototype.visitStruct=mh;Ne.prototype.visitUnion=XO;Ne.prototype.visitInterval=Yi;Ne.prototype.visitDuration=Yi;Ne.prototype.visitFixedSizeList=xf;Ne.prototype.visitMap=xf;class x0 extends df{static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t,e){throw new Error('"throughDOM" not available in this environment')}constructor(t){super(),this._position=0,this._started=!1,this._sink=new Wa,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,pr(t)||(t={autoDestroy:!0,writeLegacyIpcFormat:!1}),this._autoDestroy=typeof t.autoDestroy=="boolean"?t.autoDestroy:!0,this._writeLegacyIpcFormat=typeof t.writeLegacyIpcFormat=="boolean"?t.writeLegacyIpcFormat:!1}toString(t=!1){return this._sink.toString(t)}toUint8Array(t=!1){return this._sink.toUint8Array(t)}writeAll(t){return rs(t)?t.then(e=>this.writeAll(e)):no(t)?Ef(this,t):If(this,t)}get closed(){return this._sink.closed}[Symbol.asyncIterator](){return this._sink[Symbol.asyncIterator]()}toDOMStream(t){return this._sink.toDOMStream(t)}toNodeStream(t){return this._sink.toNodeStream(t)}close(){return this.reset()._sink.close()}abort(t){return this.reset()._sink.abort(t)}finish(){return this._autoDestroy?this.close():this.reset(this._sink,this._schema),this}reset(t=this._sink,e=null){return t===this._sink||t instanceof Wa?this._sink=t:(this._sink=new Wa,t&&SC(t)?this.toDOMStream({type:"bytes"}).pipeTo(t):t&&TC(t)&&this.toNodeStream({objectMode:!1}).pipe(t)),this._started&&this._schema&&this._writeFooter(this._schema),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,(!e||!dh(e,this._schema))&&(e==null?(this._position=0,this._schema=null):(this._started=!0,this._schema=e,this._writeSchema(e))),this}write(t){let e=null;if(this._sink){if(t==null)return this.finish()&&void 0;if(t instanceof gn&&!(e=t.schema))return this.finish()&&void 0;if(t instanceof fr&&!(e=t.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(e&&!dh(e,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,e)}t instanceof fr?t instanceof vf||this._writeRecordBatch(t):t instanceof gn?this.writeAll(t.batches):oa(t)&&this.writeAll(t)}_writeMessage(t,e=8){const i=e-1,n=or.encode(t),s=n.byteLength,o=this._writeLegacyIpcFormat?4:8,a=s+o+i&~i,l=a-s-o;return t.headerType===fe.RecordBatch?this._recordBatchBlocks.push(new mn(a,t.bodyLength,this._position)):t.headerType===fe.DictionaryBatch&&this._dictionaryBlocks.push(new mn(a,t.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(a-o)),s>0&&this._write(n),this._writePadding(l)}_write(t){if(this._started){const e=ae(t);e&&e.byteLength>0&&(this._sink.write(e),this._position+=e.byteLength)}return this}_writeSchema(t){return this._writeMessage(or.from(t))}_writeFooter(t){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(Zo)}_writePadding(t){return t>0?this._write(new Uint8Array(t)):this}_writeRecordBatch(t){const{byteLength:e,nodes:i,bufferRegions:n,buffers:s}=Ne.assemble(t),o=new Fr(t.numRows,i,n),a=or.from(o,e);return this._writeDictionaries(t)._writeMessage(a)._writeBodyBuffers(s)}_writeDictionaryBatch(t,e,i=!1){const{byteLength:n,nodes:s,bufferRegions:o,buffers:a}=Ne.assemble(new Me([t])),l=new Fr(t.length,s,o),u=new Ti(l,e,i),c=or.from(u,n);return this._writeMessage(c)._writeBodyBuffers(a)}_writeBodyBuffers(t){let e,i,n;for(let s=-1,o=t.length;++s0&&(this._write(e),(n=(i+7&-8)-i)>0&&this._writePadding(n));return this}_writeDictionaries(t){var e,i;for(const[n,s]of t.dictionaries){const o=(e=s==null?void 0:s.data)!==null&&e!==void 0?e:[],a=this._seenDictionaries.get(n),l=(i=this._dictionaryDeltaOffsets.get(n))!==null&&i!==void 0?i:0;if(!a||a.data[0]!==o[0])for(const[u,c]of o.entries())this._writeDictionaryBatch(c,n,u>0);else if(li.writeAll(n)):no(t)?Ef(i,t):If(i,t)}}class Tf extends x0{static writeAll(t){const e=new Tf;return rs(t)?t.then(i=>e.writeAll(i)):no(t)?Ef(e,t):If(e,t)}constructor(){super(),this._autoDestroy=!0}_writeSchema(t){return this._writeMagic()._writePadding(2)}_writeDictionaryBatch(t,e,i=!1){if(!i&&this._seenDictionaries.has(e))throw new Error("The Arrow File format does not support replacement dictionaries. ");return super._writeDictionaryBatch(t,e,i)}_writeFooter(t){const e=Ko.encode(new Ko(t,ke.V5,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(t)._write(e)._write(Int32Array.of(e.byteLength))._writeMagic()}}function If(r,t){let e=t;t instanceof gn&&(e=t.batches,r.reset(void 0,t.schema));for(const i of e)r.write(i);return r.finish()}function Ef(r,t){return Zt(this,void 0,void 0,function*(){var e,i,n,s,o,a,l;try{for(e=!0,i=bi(t);n=yield i.next(),s=n.done,!s;e=!0){l=n.value,e=!1;const u=l;r.write(u)}}catch(u){o={error:u}}finally{try{!e&&!s&&(a=i.return)&&(yield a.call(i))}finally{if(o)throw o.error}}return r.finish()})}function qO(r,t="stream"){return(t==="stream"?Sf:Tf).writeAll(r).toUint8Array(!0)}var QO=Object.create,S0=Object.defineProperty,KO=Object.getOwnPropertyDescriptor,ZO=Object.getOwnPropertyNames,JO=Object.getPrototypeOf,t2=Object.prototype.hasOwnProperty,e2=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),r2=(r,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of ZO(t))!t2.call(r,n)&&n!==e&&S0(r,n,{get:()=>t[n],enumerable:!(i=KO(t,n))||i.enumerable});return r},i2=(r,t,e)=>(e=r!=null?QO(JO(r)):{},r2(!r||!r.__esModule?S0(e,"default",{value:r,enumerable:!0}):e,r)),n2=e2((r,t)=>{t.exports=Worker}),T0=(r=>(r[r.UNDEFINED=0]="UNDEFINED",r[r.AUTOMATIC=1]="AUTOMATIC",r[r.READ_ONLY=2]="READ_ONLY",r[r.READ_WRITE=3]="READ_WRITE",r))(T0||{}),s2=(r=>(r[r.IDENTIFIER=0]="IDENTIFIER",r[r.NUMERIC_CONSTANT=1]="NUMERIC_CONSTANT",r[r.STRING_CONSTANT=2]="STRING_CONSTANT",r[r.OPERATOR=3]="OPERATOR",r[r.KEYWORD=4]="KEYWORD",r[r.COMMENT=5]="COMMENT",r))(s2||{}),o2=(r=>(r[r.NONE=0]="NONE",r[r.DEBUG=1]="DEBUG",r[r.INFO=2]="INFO",r[r.WARNING=3]="WARNING",r[r.ERROR=4]="ERROR",r))(o2||{}),a2=(r=>(r[r.NONE=0]="NONE",r[r.CONNECT=1]="CONNECT",r[r.DISCONNECT=2]="DISCONNECT",r[r.OPEN=3]="OPEN",r[r.QUERY=4]="QUERY",r[r.INSTANTIATE=5]="INSTANTIATE",r))(a2||{}),l2=(r=>(r[r.NONE=0]="NONE",r[r.OK=1]="OK",r[r.ERROR=2]="ERROR",r[r.START=3]="START",r[r.RUN=4]="RUN",r[r.CAPTURE=5]="CAPTURE",r))(l2||{}),u2=(r=>(r[r.NONE=0]="NONE",r[r.WEB_WORKER=1]="WEB_WORKER",r[r.NODE_WORKER=2]="NODE_WORKER",r[r.BINDINGS=3]="BINDINGS",r[r.ASYNC_DUCKDB=4]="ASYNC_DUCKDB",r))(u2||{}),c2=class{log(r){}},I0=class{constructor(r=2){this.level=r}log(r){r.level>=this.level&&console.log(r)}},h2=(r=>(r[r.SUCCESS=0]="SUCCESS",r))(h2||{}),f2=class{constructor(r,t){this._bindings=r,this._conn=t}get bindings(){return this._bindings}async close(){return this._bindings.disconnect(this._conn)}useUnsafe(r){return r(this._bindings,this._conn)}async query(r){this._bindings.logger.log({timestamp:new Date,level:2,origin:4,topic:4,event:4,value:r});let t=await this._bindings.runQuery(this._conn,r),e=Vr.from(t);return console.assert(e.isSync(),"Reader is not sync"),console.assert(e.isFile(),"Reader is not file"),new gn(e)}async send(r,t=!1){this._bindings.logger.log({timestamp:new Date,level:2,origin:4,topic:4,event:4,value:r});let e=await this._bindings.startPendingQuery(this._conn,r,t);for(;e==null;)e=await this._bindings.pollPendingQuery(this._conn);let i=new E0(this._bindings,this._conn,e),n=await Vr.from(i);return console.assert(n.isAsync()),console.assert(n.isStream()),n}async cancelSent(){return await this._bindings.cancelPendingQuery(this._conn)}async getTableNames(r){return await this._bindings.getTableNames(this._conn,r)}async prepare(r){let t=await this._bindings.createPrepared(this._conn,r);return new d2(this._bindings,this._conn,t)}async insertArrowTable(r,t){let e=qO(r,"stream");await this.insertArrowFromIPCStream(e,t)}async insertArrowFromIPCStream(r,t){await this._bindings.insertArrowFromIPCStream(this._conn,r,t)}async insertCSVFromPath(r,t){await this._bindings.insertCSVFromPath(this._conn,r,t)}async insertJSONFromPath(r,t){await this._bindings.insertJSONFromPath(this._conn,r,t)}},E0=class{constructor(r,t,e){this.db=r,this.conn=t,this.header=e,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 r;return this._inFlight!=null?(r=await this._inFlight,this._inFlight=null):r=await this.db.fetchQueryResults(this.conn),this._depleted=r.length==0,this._depleted||(this._inFlight=this.db.fetchQueryResults(this.conn)),{done:this._depleted,value:r}}[Symbol.asyncIterator](){return this}},d2=class{constructor(r,t,e){this.bindings=r,this.connectionId=t,this.statementId=e}async close(){await this.bindings.closePrepared(this.connectionId,this.statementId)}async query(...r){let t=await this.bindings.runPrepared(this.connectionId,this.statementId,r),e=Vr.from(t);return console.assert(e.isSync()),console.assert(e.isFile()),new gn(e)}async send(...r){let t=await this.bindings.sendPrepared(this.connectionId,this.statementId,r),e=new E0(this.bindings,this.connectionId,t),i=await Vr.from(e);return console.assert(i.isAsync()),console.assert(i.isStream()),i}},p2=(r=>(r.CANCEL_PENDING_QUERY="CANCEL_PENDING_QUERY",r.CLOSE_PREPARED="CLOSE_PREPARED",r.COLLECT_FILE_STATISTICS="COLLECT_FILE_STATISTICS",r.REGISTER_OPFS_FILE_NAME="REGISTER_OPFS_FILE_NAME",r.CONNECT="CONNECT",r.COPY_FILE_TO_BUFFER="COPY_FILE_TO_BUFFER",r.COPY_FILE_TO_PATH="COPY_FILE_TO_PATH",r.CREATE_PREPARED="CREATE_PREPARED",r.DISCONNECT="DISCONNECT",r.DROP_FILE="DROP_FILE",r.DROP_FILES="DROP_FILES",r.EXPORT_FILE_STATISTICS="EXPORT_FILE_STATISTICS",r.FETCH_QUERY_RESULTS="FETCH_QUERY_RESULTS",r.FLUSH_FILES="FLUSH_FILES",r.GET_FEATURE_FLAGS="GET_FEATURE_FLAGS",r.GET_TABLE_NAMES="GET_TABLE_NAMES",r.GET_VERSION="GET_VERSION",r.GLOB_FILE_INFOS="GLOB_FILE_INFOS",r.INSERT_ARROW_FROM_IPC_STREAM="INSERT_ARROW_FROM_IPC_STREAM",r.INSERT_CSV_FROM_PATH="IMPORT_CSV_FROM_PATH",r.INSERT_JSON_FROM_PATH="IMPORT_JSON_FROM_PATH",r.INSTANTIATE="INSTANTIATE",r.OPEN="OPEN",r.PING="PING",r.POLL_PENDING_QUERY="POLL_PENDING_QUERY",r.REGISTER_FILE_BUFFER="REGISTER_FILE_BUFFER",r.REGISTER_FILE_HANDLE="REGISTER_FILE_HANDLE",r.REGISTER_FILE_URL="REGISTER_FILE_URL",r.RESET="RESET",r.RUN_PREPARED="RUN_PREPARED",r.RUN_QUERY="RUN_QUERY",r.SEND_PREPARED="SEND_PREPARED",r.START_PENDING_QUERY="START_PENDING_QUERY",r.TOKENIZE="TOKENIZE",r))(p2||{}),m2=(r=>(r.CONNECTION_INFO="CONNECTION_INFO",r.ERROR="ERROR",r.FEATURE_FLAGS="FEATURE_FLAGS",r.FILE_BUFFER="FILE_BUFFER",r.FILE_INFOS="FILE_INFOS",r.FILE_SIZE="FILE_SIZE",r.FILE_STATISTICS="FILE_STATISTICS",r.INSTANTIATE_PROGRESS="INSTANTIATE_PROGRESS",r.LOG="LOG",r.OK="OK",r.PREPARED_STATEMENT_ID="PREPARED_STATEMENT_ID",r.QUERY_PLAN="QUERY_PLAN",r.QUERY_RESULT="QUERY_RESULT",r.QUERY_RESULT_CHUNK="QUERY_RESULT_CHUNK",r.QUERY_RESULT_HEADER="QUERY_RESULT_HEADER",r.QUERY_RESULT_HEADER_OR_NULL="QUERY_RESULT_HEADER_OR_NULL",r.REGISTERED_FILE="REGISTERED_FILE",r.SCRIPT_TOKENS="SCRIPT_TOKENS",r.SUCCESS="SUCCESS",r.TABLE_NAMES="TABLE_NAMES",r.VERSION_STRING="VERSION_STRING",r))(m2||{}),ue=class{constructor(r,t){this.promiseResolver=()=>{},this.promiseRejecter=()=>{},this.type=r,this.data=t,this.promise=new Promise((e,i)=>{this.promiseResolver=e,this.promiseRejecter=i})}};function Ya(r){switch(r.typeId){case L.Binary:return{sqlType:"binary"};case L.Bool:return{sqlType:"bool"};case L.Date:return{sqlType:"date"};case L.DateDay:return{sqlType:"date32[d]"};case L.DateMillisecond:return{sqlType:"date64[ms]"};case L.Decimal:{let t=r;return{sqlType:"decimal",precision:t.precision,scale:t.scale}}case L.Float:return{sqlType:"float"};case L.Float16:return{sqlType:"float16"};case L.Float32:return{sqlType:"float32"};case L.Float64:return{sqlType:"float64"};case L.Int:return{sqlType:"int32"};case L.Int16:return{sqlType:"int16"};case L.Int32:return{sqlType:"int32"};case L.Int64:return{sqlType:"int64"};case L.Uint16:return{sqlType:"uint16"};case L.Uint32:return{sqlType:"uint32"};case L.Uint64:return{sqlType:"uint64"};case L.Uint8:return{sqlType:"uint8"};case L.IntervalDayTime:return{sqlType:"interval[dt]"};case L.IntervalYearMonth:return{sqlType:"interval[m]"};case L.List:return{sqlType:"list",valueType:Ya(r.valueType)};case L.FixedSizeBinary:return{sqlType:"fixedsizebinary",byteWidth:r.byteWidth};case L.Null:return{sqlType:"null"};case L.Utf8:return{sqlType:"utf8"};case L.Struct:return{sqlType:"struct",fields:r.children.map(t=>yh(t.name,t.type))};case L.Map:{let t=r;return{sqlType:"map",keyType:Ya(t.keyType),valueType:Ya(t.valueType)}}case L.Time:return{sqlType:"time[s]"};case L.TimeMicrosecond:return{sqlType:"time[us]"};case L.TimeMillisecond:return{sqlType:"time[ms]"};case L.TimeNanosecond:return{sqlType:"time[ns]"};case L.TimeSecond:return{sqlType:"time[s]"};case L.Timestamp:return{sqlType:"timestamp",timezone:r.timezone||void 0};case L.TimestampSecond:return{sqlType:"timestamp[s]",timezone:r.timezone||void 0};case L.TimestampMicrosecond:return{sqlType:"timestamp[us]",timezone:r.timezone||void 0};case L.TimestampNanosecond:return{sqlType:"timestamp[ns]",timezone:r.timezone||void 0};case L.TimestampMillisecond:return{sqlType:"timestamp[ms]",timezone:r.timezone||void 0}}throw new Error("unsupported arrow type: ".concat(r.toString()))}function yh(r,t){let e=Ya(t);return e.name=r,e}var y2=new TextEncoder,g2=class{constructor(r,t=null){this._onInstantiationProgress=[],this._worker=null,this._workerShutdownPromise=null,this._workerShutdownResolver=()=>{},this._nextMessageId=0,this._pendingRequests=new Map,this._logger=r,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(r){this._worker=r,this._worker.addEventListener("message",this._onMessageHandler),this._worker.addEventListener("error",this._onErrorHandler),this._worker.addEventListener("close",this._onCloseHandler),this._workerShutdownPromise=new Promise((t,e)=>{this._workerShutdownResolver=t})}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(r,t=[]){if(!this._worker){console.error("cannot send a message since the worker is not set!");return}let e=this._nextMessageId++;return this._pendingRequests.set(e,r),this._worker.postMessage({messageId:e,type:r.type,data:r.data},t),await r.promise}onMessage(r){var t;let e=r.data;switch(e.type){case"LOG":{this._logger.log(e.data);return}case"INSTANTIATE_PROGRESS":{for(let n of this._onInstantiationProgress)n(e.data);return}}let i=this._pendingRequests.get(e.requestId);if(!i){console.warn("unassociated response: [".concat(e.requestId,", ").concat(e.type.toString(),"]"));return}if(this._pendingRequests.delete(e.requestId),e.type=="ERROR"){let n=new Error(e.data.message);n.name=e.data.name,(t=Object.getOwnPropertyDescriptor(n,"stack"))!=null&&t.writable&&(n.stack=e.data.stack),i.promiseRejecter(n);return}switch(i.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(e.type=="OK"){i.promiseResolver(e.data);return}break;case"INSTANTIATE":if(this._onInstantiationProgress=[],e.type=="OK"){i.promiseResolver(e.data);return}break;case"GLOB_FILE_INFOS":if(e.type=="FILE_INFOS"){i.promiseResolver(e.data);return}break;case"GET_VERSION":if(e.type=="VERSION_STRING"){i.promiseResolver(e.data);return}break;case"GET_FEATURE_FLAGS":if(e.type=="FEATURE_FLAGS"){i.promiseResolver(e.data);return}break;case"GET_TABLE_NAMES":if(e.type=="TABLE_NAMES"){i.promiseResolver(e.data);return}break;case"TOKENIZE":if(e.type=="SCRIPT_TOKENS"){i.promiseResolver(e.data);return}break;case"COPY_FILE_TO_BUFFER":if(e.type=="FILE_BUFFER"){i.promiseResolver(e.data);return}break;case"EXPORT_FILE_STATISTICS":if(e.type=="FILE_STATISTICS"){i.promiseResolver(e.data);return}break;case"CONNECT":if(e.type=="CONNECTION_INFO"){i.promiseResolver(e.data);return}break;case"RUN_PREPARED":case"RUN_QUERY":if(e.type=="QUERY_RESULT"){i.promiseResolver(e.data);return}break;case"SEND_PREPARED":if(e.type=="QUERY_RESULT_HEADER"){i.promiseResolver(e.data);return}break;case"START_PENDING_QUERY":if(e.type=="QUERY_RESULT_HEADER_OR_NULL"){i.promiseResolver(e.data);return}break;case"POLL_PENDING_QUERY":if(e.type=="QUERY_RESULT_HEADER_OR_NULL"){i.promiseResolver(e.data);return}break;case"CANCEL_PENDING_QUERY":if(this._onInstantiationProgress=[],e.type=="SUCCESS"){i.promiseResolver(e.data);return}break;case"FETCH_QUERY_RESULTS":if(e.type=="QUERY_RESULT_CHUNK"){i.promiseResolver(e.data);return}break;case"CREATE_PREPARED":if(e.type=="PREPARED_STATEMENT_ID"){i.promiseResolver(e.data);return}break}i.promiseRejecter(new Error("unexpected response type: ".concat(e.type.toString())))}onError(r){console.error(r),console.error("error in duckdb worker: ".concat(r.message)),this._pendingRequests.clear()}onClose(){if(this._workerShutdownResolver(null),this._pendingRequests.size!=0){console.warn("worker terminated with ".concat(this._pendingRequests.size," pending requests"));return}this._pendingRequests.clear()}async reset(){let r=new ue("RESET",null);return await this.postTask(r)}async ping(){let r=new ue("PING",null);await this.postTask(r)}async dropFile(r){let t=new ue("DROP_FILE",r);return await this.postTask(t)}async dropFiles(){let r=new ue("DROP_FILES",null);return await this.postTask(r)}async flushFiles(){let r=new ue("FLUSH_FILES",null);return await this.postTask(r)}async instantiate(r,t=null,e=i=>{}){this._onInstantiationProgress.push(e);let i=new ue("INSTANTIATE",[r,t]);return await this.postTask(i)}async getVersion(){let r=new ue("GET_VERSION",null);return await this.postTask(r)}async getFeatureFlags(){let r=new ue("GET_FEATURE_FLAGS",null);return await this.postTask(r)}async open(r){let t=new ue("OPEN",r);await this.postTask(t)}async tokenize(r){let t=new ue("TOKENIZE",r);return await this.postTask(t)}async connectInternal(){let r=new ue("CONNECT",null);return await this.postTask(r)}async connect(){let r=await this.connectInternal();return new f2(this,r)}async disconnect(r){let t=new ue("DISCONNECT",r);await this.postTask(t)}async runQuery(r,t){let e=new ue("RUN_QUERY",[r,t]);return await this.postTask(e)}async startPendingQuery(r,t,e=!1){let i=new ue("START_PENDING_QUERY",[r,t,e]);return await this.postTask(i)}async pollPendingQuery(r){let t=new ue("POLL_PENDING_QUERY",r);return await this.postTask(t)}async cancelPendingQuery(r){let t=new ue("CANCEL_PENDING_QUERY",r);return await this.postTask(t)}async fetchQueryResults(r){let t=new ue("FETCH_QUERY_RESULTS",r);return await this.postTask(t)}async getTableNames(r,t){let e=new ue("GET_TABLE_NAMES",[r,t]);return await this.postTask(e)}async createPrepared(r,t){let e=new ue("CREATE_PREPARED",[r,t]);return await this.postTask(e)}async closePrepared(r,t){let e=new ue("CLOSE_PREPARED",[r,t]);await this.postTask(e)}async runPrepared(r,t,e){let i=new ue("RUN_PREPARED",[r,t,e]);return await this.postTask(i)}async sendPrepared(r,t,e){let i=new ue("SEND_PREPARED",[r,t,e]);return await this.postTask(i)}async globFiles(r){let t=new ue("GLOB_FILE_INFOS",r);return await this.postTask(t)}async registerFileText(r,t){let e=y2.encode(t);await this.registerFileBuffer(r,e)}async registerFileURL(r,t,e,i){t===void 0&&(t=r);let n=new ue("REGISTER_FILE_URL",[r,t,e,i]);await this.postTask(n)}async registerEmptyFileBuffer(r){}async registerFileBuffer(r,t){let e=new ue("REGISTER_FILE_BUFFER",[r,t]);await this.postTask(e,[t.buffer])}async registerFileHandle(r,t,e,i){let n=new ue("REGISTER_FILE_HANDLE",[r,t,e,i]);await this.postTask(n,[])}async registerOPFSFileName(r){let t=new ue("REGISTER_OPFS_FILE_NAME",[r]);await this.postTask(t,[])}async collectFileStatistics(r,t){let e=new ue("COLLECT_FILE_STATISTICS",[r,t]);await this.postTask(e,[])}async exportFileStatistics(r){let t=new ue("EXPORT_FILE_STATISTICS",r);return await this.postTask(t,[])}async copyFileToBuffer(r){let t=new ue("COPY_FILE_TO_BUFFER",r);return await this.postTask(t)}async copyFileToPath(r,t){let e=new ue("COPY_FILE_TO_PATH",[r,t]);await this.postTask(e)}async insertArrowFromIPCStream(r,t,e){if(t.length==0)return;let i=new ue("INSERT_ARROW_FROM_IPC_STREAM",[r,t,e]);await this.postTask(i,[t.buffer])}async insertCSVFromPath(r,t,e){if(e.columns!==void 0){let n=[];for(let s in e.columns){let o=e.columns[s];n.push(yh(s,o))}e.columnsFlat=n,delete e.columns}let i=new ue("IMPORT_CSV_FROM_PATH",[r,t,e]);await this.postTask(i)}async insertJSONFromPath(r,t,e){if(e.columns!==void 0){let n=[];for(let s in e.columns){let o=e.columns[s];n.push(yh(s,o))}e.columnsFlat=n,delete e.columns}let i=new ue("IMPORT_JSON_FROM_PATH",[r,t,e]);await this.postTask(i)}};function v2(){let r=new TextDecoder;return t=>(typeof SharedArrayBuffer<"u"&&t.buffer instanceof SharedArrayBuffer&&(t=new Uint8Array(t)),r.decode(t))}v2();var _2=(r=>(r[r.BUFFER=0]="BUFFER",r[r.NODE_FS=1]="NODE_FS",r[r.BROWSER_FILEREADER=2]="BROWSER_FILEREADER",r[r.BROWSER_FSACCESS=3]="BROWSER_FSACCESS",r[r.HTTP=4]="HTTP",r[r.S3=5]="S3",r))(_2||{}),b2=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])),w2=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])),x2=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])),S2=()=>(async r=>{try{return typeof MessageChannel<"u"&&new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(r)}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])),T2={version:"1.29.1-dev68.0"},Cf=T2.version.split(".");Cf[0];Cf[1];Cf[2];var I2=()=>typeof navigator>"u",Ku=null,Zu=null,Ju=null,tc=null,ec=null;async function E2(){return Ku==null&&(Ku=typeof BigInt64Array<"u"),Zu==null&&(Zu=await w2()),Ju==null&&(Ju=await S2()),tc==null&&(tc=await x2()),ec==null&&(ec=await b2()),{bigInt64Array:Ku,crossOriginIsolated:I2()||globalThis.crossOriginIsolated||!1,wasmExceptions:Zu,wasmSIMD:tc,wasmThreads:Ju,wasmBulkMemory:ec}}async function kp(r){let t=await E2();if(t.wasmExceptions){if(t.wasmSIMD&&t.wasmThreads&&t.crossOriginIsolated&&r.coi)return{mainModule:r.coi.mainModule,mainWorker:r.coi.mainWorker,pthreadWorker:r.coi.pthreadWorker};if(r.eh)return{mainModule:r.eh.mainModule,mainWorker:r.eh.mainWorker,pthreadWorker:null}}return{mainModule:r.mvp.mainModule,mainWorker:r.mvp.mainWorker,pthreadWorker:null}}i2(n2());const rc={},Mo={};function Lo(r,t){try{const i=(rc[r]||(rc[r]=new Intl.DateTimeFormat("en-GB",{timeZone:r,hour:"numeric",timeZoneName:"longOffset"}).format))(t).split("GMT")[1]||"";return i in Mo?Mo[i]:Up(i,i.split(":"))}catch{if(r in Mo)return Mo[r];const e=r==null?void 0:r.match(C2);return e?Up(r,e.slice(1)):NaN}}const C2=/([+-]\d\d):?(\d\d)?/;function Up(r,t){const e=+t[0],i=+(t[1]||0);return Mo[r]=e>0?e*60+i:e*60-i}class Er extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(Lo(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),C0(this),gh(this)):this.setTime(Date.now())}static tz(t,...e){return e.length?new Er(...e,t):new Er(Date.now(),t)}withTimeZone(t){return new Er(+this,t)}getTimezoneOffset(){return-Lo(this.timeZone,this)}setTime(t){return Date.prototype.setTime.apply(this,arguments),gh(this),+this}[Symbol.for("constructDateFrom")](t){return new Er(+new Date(t),this.timeZone)}}const zp=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(r=>{if(!zp.test(r))return;const t=r.replace(zp,"$1UTC");Er.prototype[t]&&(r.startsWith("get")?Er.prototype[r]=function(){return this.internal[t]()}:(Er.prototype[r]=function(){return Date.prototype[t].apply(this.internal,arguments),A2(this),+this},Er.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),gh(this),+this}))});function gh(r){r.internal.setTime(+r),r.internal.setUTCMinutes(r.internal.getUTCMinutes()-r.getTimezoneOffset())}function A2(r){Date.prototype.setFullYear.call(r,r.internal.getUTCFullYear(),r.internal.getUTCMonth(),r.internal.getUTCDate()),Date.prototype.setHours.call(r,r.internal.getUTCHours(),r.internal.getUTCMinutes(),r.internal.getUTCSeconds(),r.internal.getUTCMilliseconds()),C0(r)}function C0(r){const t=Lo(r.timeZone,r),e=new Date(+r);e.setUTCHours(e.getUTCHours()-1);const i=-new Date(+r).getTimezoneOffset(),n=-new Date(+e).getTimezoneOffset(),s=i-n,o=Date.prototype.getHours.apply(r)!==r.internal.getUTCHours();s&&o&&r.internal.setUTCMinutes(r.internal.getUTCMinutes()+s);const a=i-t;a&&Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+a);const l=Lo(r.timeZone,r),c=-new Date(+r).getTimezoneOffset()-l,h=l!==t,p=c-a;if(h&&p){Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+p);const f=Lo(r.timeZone,r),y=l-f;y&&(r.internal.setUTCMinutes(r.internal.getUTCMinutes()+y),Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+y))}}const O2=new TextDecoder("utf-8"),F2=r=>O2.decode(r),P2=new TextEncoder,A0=r=>P2.encode(r),hi=r=>typeof r=="function",ha=r=>r!=null&&Object(r)===r,M2=r=>ha(r)&&hi(r.then),O0=r=>ha(r)&&hi(r[Symbol.iterator]),D2=r=>ha(r)&&hi(r[Symbol.asyncIterator]),R2=r=>ha(r)&&"done"in r&&"value"in r,N2=r=>ha(r)&&hi(r.clear)&&hi(r.bytes)&&hi(r.position)&&hi(r.setPosition)&&hi(r.capacity)&&hi(r.getBufferIdentifier)&&hi(r.createLong),Af=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function L2(r){const t=r[0]?[r[0]]:[];let e,i,n,s;for(let o,a,l=0,u=0,c=r.length;++lc+h.byteLength,0);let n,s,o,a=0,l=-1;const u=Math.min(t||Number.POSITIVE_INFINITY,i);for(const c=e.length;++lrr(Int8Array,r),U2=r=>rr(Int16Array,r),z2=r=>rr(Int32Array,r),j2=r=>rr(BigInt64Array,r),$2=r=>rr(Uint8Array,r),V2=r=>rr(Uint16Array,r),G2=r=>rr(Uint32Array,r),W2=r=>rr(BigUint64Array,r),H2=r=>rr(Float32Array,r),X2=r=>rr(Float64Array,r),Y2=r=>rr(Uint8ClampedArray,r),_h=r=>(r.next(),r);function*Oi(r,t){const e=function*(n){yield n},i=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Af?e(t):O0(t)?t:e(t);return yield*_h(function*(n){let s=null;do s=n.next(yield rr(r,s));while(!s.done)}(i[Symbol.iterator]())),new r}const q2=r=>Oi(Int8Array,r),Q2=r=>Oi(Int16Array,r),K2=r=>Oi(Int32Array,r),Z2=r=>Oi(Uint8Array,r),J2=r=>Oi(Uint16Array,r),tF=r=>Oi(Uint32Array,r),eF=r=>Oi(Float32Array,r),rF=r=>Oi(Float64Array,r),iF=r=>Oi(Uint8ClampedArray,r);function ii(r,t){return dr(this,arguments,function*(){if(M2(t))return yield Pt(yield Pt(yield*ts(bi(ii(r,yield Pt(t))))));const i=function(o){return dr(this,arguments,function*(){yield yield Pt(yield Pt(o))})},n=function(o){return dr(this,arguments,function*(){yield Pt(yield*ts(bi(_h(function*(a){let l=null;do l=a.next(yield l==null?void 0:l.value);while(!l.done)}(o[Symbol.iterator]())))))})},s=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Af?i(t):O0(t)?n(t):D2(t)?t:i(t);return yield Pt(yield*ts(bi(_h(function(o){return dr(this,arguments,function*(){let a=null;do a=yield Pt(o.next(yield yield Pt(rr(r,a))));while(!a.done)})}(s[Symbol.asyncIterator]()))))),yield Pt(new r)})}const nF=r=>ii(Int8Array,r),sF=r=>ii(Int16Array,r),oF=r=>ii(Int32Array,r),aF=r=>ii(Uint8Array,r),lF=r=>ii(Uint16Array,r),uF=r=>ii(Uint32Array,r),cF=r=>ii(Float32Array,r),hF=r=>ii(Float64Array,r),fF=r=>ii(Uint8ClampedArray,r);function dF(r,t,e){if(r!==0){e=e.slice(0,t);for(let i=-1,n=e.length;++i0)do if(r[e]!==t[e])return!1;while(++eeo(t))}]`:`[${r}]`:ArrayBuffer.isView(r)?`[${r}]`:JSON.stringify(r,(t,e)=>typeof e=="bigint"?`${e}`:e)}const yF=Object.freeze(Object.defineProperty({__proto__:null,valueToString:eo},Symbol.toStringTag,{value:"Module"}));function ar(r){if(typeof r=="bigint"&&(rNumber.MAX_SAFE_INTEGER))throw new TypeError(`${r} is not safe to convert to a number.`);return Number(r)}function P0(r,t){return ar(r/t)+ar(r%t)/ar(t)}const M0=Symbol.for("isArrowBigNum");function ni(r,...t){return t.length===0?Object.setPrototypeOf(rr(this.TypedArray,r),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(r,...t),this.constructor.prototype)}ni.prototype[M0]=!0;ni.prototype.toJSON=function(){return`"${ro(this)}"`};ni.prototype.valueOf=function(r){return Of(this,r)};ni.prototype.toString=function(){return ro(this)};ni.prototype[Symbol.toPrimitive]=function(r="default"){switch(r){case"number":return Of(this);case"string":return ro(this);case"default":return D0(this)}return ro(this)};function Gs(...r){return ni.apply(this,r)}function Ws(...r){return ni.apply(this,r)}function Jo(...r){return ni.apply(this,r)}Object.setPrototypeOf(Gs.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(Ws.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(Jo.prototype,Object.create(Uint32Array.prototype));Object.assign(Gs.prototype,ni.prototype,{constructor:Gs,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(Ws.prototype,ni.prototype,{constructor:Ws,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign(Jo.prototype,ni.prototype,{constructor:Jo,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});const gF=BigInt(4294967296)*BigInt(4294967296),vF=gF-BigInt(1);function Of(r,t){const{buffer:e,byteOffset:i,byteLength:n,signed:s}=r,o=new BigUint64Array(e,i,n/8),a=s&&o.at(-1)&BigInt(1)<=0)return ic(r);t=t.slice();let i=1;for(let s=0;s(r.children=null,r.ArrayType=Array,r.OffsetArrayType=Int32Array,r[Symbol.toStringTag]="DataType"))(Et.prototype);class jp extends Et{constructor(){super(W.Null)}toString(){return"Null"}}N0=Symbol.toStringTag;jp[N0]=(r=>r[Symbol.toStringTag]="Null")(jp.prototype);class $p extends Et{constructor(t,e){super(W.Int),this.isSigned=t,this.bitWidth=e}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 new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}L0=Symbol.toStringTag;$p[L0]=(r=>(r.isSigned=null,r.bitWidth=null,r[Symbol.toStringTag]="Int"))($p.prototype);class Vp extends Et{constructor(t){super(W.Float),this.precision=t}get ArrayType(){switch(this.precision){case Cr.HALF:return Uint16Array;case Cr.SINGLE:return Float32Array;case Cr.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}}B0=Symbol.toStringTag;Vp[B0]=(r=>(r.precision=null,r[Symbol.toStringTag]="Float"))(Vp.prototype);class Gp extends Et{constructor(){super(W.Binary)}toString(){return"Binary"}}k0=Symbol.toStringTag;Gp[k0]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Binary"))(Gp.prototype);class Wp extends Et{constructor(){super(W.LargeBinary)}toString(){return"LargeBinary"}}U0=Symbol.toStringTag;Wp[U0]=(r=>(r.ArrayType=Uint8Array,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeBinary"))(Wp.prototype);class Hp extends Et{constructor(){super(W.Utf8)}toString(){return"Utf8"}}z0=Symbol.toStringTag;Hp[z0]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Utf8"))(Hp.prototype);class Xp extends Et{constructor(){super(W.LargeUtf8)}toString(){return"LargeUtf8"}}j0=Symbol.toStringTag;Xp[j0]=(r=>(r.ArrayType=Uint8Array,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeUtf8"))(Xp.prototype);class Yp extends Et{constructor(){super(W.Bool)}toString(){return"Bool"}}$0=Symbol.toStringTag;Yp[$0]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Bool"))(Yp.prototype);class qp extends Et{constructor(t,e,i=128){super(W.Decimal),this.scale=t,this.precision=e,this.bitWidth=i}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}}V0=Symbol.toStringTag;qp[V0]=(r=>(r.scale=null,r.precision=null,r.ArrayType=Uint32Array,r[Symbol.toStringTag]="Decimal"))(qp.prototype);class Qp extends Et{constructor(t){super(W.Date),this.unit=t}toString(){return`Date${(this.unit+1)*32}<${_n[this.unit]}>`}get ArrayType(){return this.unit===_n.DAY?Int32Array:BigInt64Array}}G0=Symbol.toStringTag;Qp[G0]=(r=>(r.unit=null,r[Symbol.toStringTag]="Date"))(Qp.prototype);class Kp extends Et{constructor(t,e){super(W.Time),this.unit=t,this.bitWidth=e}toString(){return`Time${this.bitWidth}<${Jt[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}}W0=Symbol.toStringTag;Kp[W0]=(r=>(r.unit=null,r.bitWidth=null,r[Symbol.toStringTag]="Time"))(Kp.prototype);class Zp extends Et{constructor(t,e){super(W.Timestamp),this.unit=t,this.timezone=e}toString(){return`Timestamp<${Jt[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}}H0=Symbol.toStringTag;Zp[H0]=(r=>(r.unit=null,r.timezone=null,r.ArrayType=BigInt64Array,r[Symbol.toStringTag]="Timestamp"))(Zp.prototype);class Jp extends Et{constructor(t){super(W.Interval),this.unit=t}toString(){return`Interval<${ns[this.unit]}>`}}X0=Symbol.toStringTag;Jp[X0]=(r=>(r.unit=null,r.ArrayType=Int32Array,r[Symbol.toStringTag]="Interval"))(Jp.prototype);class tm extends Et{constructor(t){super(W.Duration),this.unit=t}toString(){return`Duration<${Jt[this.unit]}>`}}Y0=Symbol.toStringTag;tm[Y0]=(r=>(r.unit=null,r.ArrayType=BigInt64Array,r[Symbol.toStringTag]="Duration"))(tm.prototype);class em extends Et{constructor(t){super(W.List),this.children=[t]}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}}q0=Symbol.toStringTag;em[q0]=(r=>(r.children=null,r[Symbol.toStringTag]="List"))(em.prototype);class bh extends Et{constructor(t){super(W.Struct),this.children=t}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}}Q0=Symbol.toStringTag;bh[Q0]=(r=>(r.children=null,r[Symbol.toStringTag]="Struct"))(bh.prototype);class rm extends Et{constructor(t,e,i){super(W.Union),this.mode=t,this.children=i,this.typeIds=e=Int32Array.from(e),this.typeIdToChildIndex=e.reduce((n,s,o)=>(n[s]=o)&&n||n,Object.create(null))}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(t=>`${t.type}`).join(" | ")}>`}}K0=Symbol.toStringTag;rm[K0]=(r=>(r.mode=null,r.typeIds=null,r.children=null,r.typeIdToChildIndex=null,r.ArrayType=Int8Array,r[Symbol.toStringTag]="Union"))(rm.prototype);class im extends Et{constructor(t){super(W.FixedSizeBinary),this.byteWidth=t}toString(){return`FixedSizeBinary[${this.byteWidth}]`}}Z0=Symbol.toStringTag;im[Z0]=(r=>(r.byteWidth=null,r.ArrayType=Uint8Array,r[Symbol.toStringTag]="FixedSizeBinary"))(im.prototype);class nm extends Et{constructor(t,e){super(W.FixedSizeList),this.listSize=t,this.children=[e]}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}>`}}J0=Symbol.toStringTag;nm[J0]=(r=>(r.children=null,r.listSize=null,r[Symbol.toStringTag]="FixedSizeList"))(nm.prototype);class sm extends Et{constructor(t,e=!1){var i,n,s;if(super(W.Map),this.children=[t],this.keysSorted=e,t&&(t.name="entries",!((i=t==null?void 0:t.type)===null||i===void 0)&&i.children)){const o=(n=t==null?void 0:t.type)===null||n===void 0?void 0:n.children[0];o&&(o.name="key");const a=(s=t==null?void 0:t.type)===null||s===void 0?void 0:s.children[1];a&&(a.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(t=>`${t.name}:${t.type}`).join(", ")}}>`}}tb=Symbol.toStringTag;sm[tb]=(r=>(r.children=null,r.keysSorted=null,r[Symbol.toStringTag]="Map_"))(sm.prototype);const bF=(r=>()=>++r)(-1);class om extends Et{constructor(t,e,i,n){super(W.Dictionary),this.indices=e,this.dictionary=t,this.isOrdered=n||!1,this.id=i==null?bF():ar(i)}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}}eb=Symbol.toStringTag;om[eb]=(r=>(r.id=null,r.indices=null,r.isOrdered=null,r.dictionary=null,r[Symbol.toStringTag]="Dictionary"))(om.prototype);function rb(r){const t=r;switch(r.typeId){case W.Decimal:return r.bitWidth/32;case W.Interval:return 1+t.unit;case W.FixedSizeList:return t.listSize;case W.FixedSizeBinary:return t.byteWidth;default:return 1}}class le{visitMany(t,...e){return t.map((i,n)=>this.visit(i,...e.map(s=>s[n])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,e=!0){return wF(this,t,e)}getVisitFnByTypeId(t,e=!0){return Ps(this,t,e)}visitNull(t,...e){return null}visitBool(t,...e){return null}visitInt(t,...e){return null}visitFloat(t,...e){return null}visitUtf8(t,...e){return null}visitLargeUtf8(t,...e){return null}visitBinary(t,...e){return null}visitLargeBinary(t,...e){return null}visitFixedSizeBinary(t,...e){return null}visitDate(t,...e){return null}visitTimestamp(t,...e){return null}visitTime(t,...e){return null}visitDecimal(t,...e){return null}visitList(t,...e){return null}visitStruct(t,...e){return null}visitUnion(t,...e){return null}visitDictionary(t,...e){return null}visitInterval(t,...e){return null}visitDuration(t,...e){return null}visitFixedSizeList(t,...e){return null}visitMap(t,...e){return null}}function wF(r,t,e=!0){return typeof t=="number"?Ps(r,t,e):typeof t=="string"&&t in W?Ps(r,W[t],e):t&&t instanceof Et?Ps(r,am(t),e):t!=null&&t.type&&t.type instanceof Et?Ps(r,am(t.type),e):Ps(r,W.NONE,e)}function Ps(r,t,e=!0){let i=null;switch(t){case W.Null:i=r.visitNull;break;case W.Bool:i=r.visitBool;break;case W.Int:i=r.visitInt;break;case W.Int8:i=r.visitInt8||r.visitInt;break;case W.Int16:i=r.visitInt16||r.visitInt;break;case W.Int32:i=r.visitInt32||r.visitInt;break;case W.Int64:i=r.visitInt64||r.visitInt;break;case W.Uint8:i=r.visitUint8||r.visitInt;break;case W.Uint16:i=r.visitUint16||r.visitInt;break;case W.Uint32:i=r.visitUint32||r.visitInt;break;case W.Uint64:i=r.visitUint64||r.visitInt;break;case W.Float:i=r.visitFloat;break;case W.Float16:i=r.visitFloat16||r.visitFloat;break;case W.Float32:i=r.visitFloat32||r.visitFloat;break;case W.Float64:i=r.visitFloat64||r.visitFloat;break;case W.Utf8:i=r.visitUtf8;break;case W.LargeUtf8:i=r.visitLargeUtf8;break;case W.Binary:i=r.visitBinary;break;case W.LargeBinary:i=r.visitLargeBinary;break;case W.FixedSizeBinary:i=r.visitFixedSizeBinary;break;case W.Date:i=r.visitDate;break;case W.DateDay:i=r.visitDateDay||r.visitDate;break;case W.DateMillisecond:i=r.visitDateMillisecond||r.visitDate;break;case W.Timestamp:i=r.visitTimestamp;break;case W.TimestampSecond:i=r.visitTimestampSecond||r.visitTimestamp;break;case W.TimestampMillisecond:i=r.visitTimestampMillisecond||r.visitTimestamp;break;case W.TimestampMicrosecond:i=r.visitTimestampMicrosecond||r.visitTimestamp;break;case W.TimestampNanosecond:i=r.visitTimestampNanosecond||r.visitTimestamp;break;case W.Time:i=r.visitTime;break;case W.TimeSecond:i=r.visitTimeSecond||r.visitTime;break;case W.TimeMillisecond:i=r.visitTimeMillisecond||r.visitTime;break;case W.TimeMicrosecond:i=r.visitTimeMicrosecond||r.visitTime;break;case W.TimeNanosecond:i=r.visitTimeNanosecond||r.visitTime;break;case W.Decimal:i=r.visitDecimal;break;case W.List:i=r.visitList;break;case W.Struct:i=r.visitStruct;break;case W.Union:i=r.visitUnion;break;case W.DenseUnion:i=r.visitDenseUnion||r.visitUnion;break;case W.SparseUnion:i=r.visitSparseUnion||r.visitUnion;break;case W.Dictionary:i=r.visitDictionary;break;case W.Interval:i=r.visitInterval;break;case W.IntervalDayTime:i=r.visitIntervalDayTime||r.visitInterval;break;case W.IntervalYearMonth:i=r.visitIntervalYearMonth||r.visitInterval;break;case W.Duration:i=r.visitDuration;break;case W.DurationSecond:i=r.visitDurationSecond||r.visitDuration;break;case W.DurationMillisecond:i=r.visitDurationMillisecond||r.visitDuration;break;case W.DurationMicrosecond:i=r.visitDurationMicrosecond||r.visitDuration;break;case W.DurationNanosecond:i=r.visitDurationNanosecond||r.visitDuration;break;case W.FixedSizeList:i=r.visitFixedSizeList;break;case W.Map:i=r.visitMap;break}if(typeof i=="function")return i;if(!e)return()=>null;throw new Error(`Unrecognized type '${W[t]}'`)}function am(r){switch(r.typeId){case W.Null:return W.Null;case W.Int:{const{bitWidth:t,isSigned:e}=r;switch(t){case 8:return e?W.Int8:W.Uint8;case 16:return e?W.Int16:W.Uint16;case 32:return e?W.Int32:W.Uint32;case 64:return e?W.Int64:W.Uint64}return W.Int}case W.Float:switch(r.precision){case Cr.HALF:return W.Float16;case Cr.SINGLE:return W.Float32;case Cr.DOUBLE:return W.Float64}return W.Float;case W.Binary:return W.Binary;case W.LargeBinary:return W.LargeBinary;case W.Utf8:return W.Utf8;case W.LargeUtf8:return W.LargeUtf8;case W.Bool:return W.Bool;case W.Decimal:return W.Decimal;case W.Time:switch(r.unit){case Jt.SECOND:return W.TimeSecond;case Jt.MILLISECOND:return W.TimeMillisecond;case Jt.MICROSECOND:return W.TimeMicrosecond;case Jt.NANOSECOND:return W.TimeNanosecond}return W.Time;case W.Timestamp:switch(r.unit){case Jt.SECOND:return W.TimestampSecond;case Jt.MILLISECOND:return W.TimestampMillisecond;case Jt.MICROSECOND:return W.TimestampMicrosecond;case Jt.NANOSECOND:return W.TimestampNanosecond}return W.Timestamp;case W.Date:switch(r.unit){case _n.DAY:return W.DateDay;case _n.MILLISECOND:return W.DateMillisecond}return W.Date;case W.Interval:switch(r.unit){case ns.DAY_TIME:return W.IntervalDayTime;case ns.YEAR_MONTH:return W.IntervalYearMonth}return W.Interval;case W.Duration:switch(r.unit){case Jt.SECOND:return W.DurationSecond;case Jt.MILLISECOND:return W.DurationMillisecond;case Jt.MICROSECOND:return W.DurationMicrosecond;case Jt.NANOSECOND:return W.DurationNanosecond}return W.Duration;case W.Map:return W.Map;case W.List:return W.List;case W.Struct:return W.Struct;case W.Union:switch(r.mode){case Ii.Dense:return W.DenseUnion;case Ii.Sparse:return W.SparseUnion}return W.Union;case W.FixedSizeBinary:return W.FixedSizeBinary;case W.FixedSizeList:return W.FixedSizeList;case W.Dictionary:return W.Dictionary}throw new Error(`Unrecognized type '${W[r.typeId]}'`)}le.prototype.visitInt8=null;le.prototype.visitInt16=null;le.prototype.visitInt32=null;le.prototype.visitInt64=null;le.prototype.visitUint8=null;le.prototype.visitUint16=null;le.prototype.visitUint32=null;le.prototype.visitUint64=null;le.prototype.visitFloat16=null;le.prototype.visitFloat32=null;le.prototype.visitFloat64=null;le.prototype.visitDateDay=null;le.prototype.visitDateMillisecond=null;le.prototype.visitTimestampSecond=null;le.prototype.visitTimestampMillisecond=null;le.prototype.visitTimestampMicrosecond=null;le.prototype.visitTimestampNanosecond=null;le.prototype.visitTimeSecond=null;le.prototype.visitTimeMillisecond=null;le.prototype.visitTimeMicrosecond=null;le.prototype.visitTimeNanosecond=null;le.prototype.visitDenseUnion=null;le.prototype.visitSparseUnion=null;le.prototype.visitIntervalDayTime=null;le.prototype.visitIntervalYearMonth=null;le.prototype.visitDuration=null;le.prototype.visitDurationSecond=null;le.prototype.visitDurationMillisecond=null;le.prototype.visitDurationMicrosecond=null;le.prototype.visitDurationNanosecond=null;const ib=new Float64Array(1),vs=new Uint32Array(ib.buffer);function Ff(r){const t=(r&31744)>>10,e=(r&1023)/1024,i=Math.pow(-1,(r&32768)>>15);switch(t){case 31:return i*(e?Number.NaN:1/0);case 0:return i*(e?6103515625e-14*e:0)}return i*Math.pow(2,t-15)*(1+e)}function nb(r){if(r!==r)return 32256;ib[0]=r;const t=(vs[1]&2147483648)>>16&65535;let e=vs[1]&2146435072,i=0;return e>=1089470464?vs[0]>0?e=31744:(e=(e&2080374784)>>16,i=(vs[1]&1048575)>>10):e<=1056964608?(i=1048576+(vs[1]&1048575),i=1048576+(i<<(e>>20)-998)>>21,e=0):(e=e-1056964608>>10,i=(vs[1]&1048575)+512>>10),t|e|i&65535}const xF=Object.freeze(Object.defineProperty({__proto__:null,float64ToUint16:nb,uint16ToFloat64:Ff},Symbol.toStringTag,{value:"Module"}));class Gt extends le{}function Yt(r){return(t,e,i)=>{if(t.setValid(e,i!=null))return r(t,e,i)}}const SF=(r,t,e)=>{r[t]=Math.floor(e/864e5)},sb=(r,t,e,i)=>{if(e+1{const n=r+e;i?t[n>>3]|=1<>3]&=~(1<{r[t]=e},Pf=({values:r},t,e)=>{r[t]=e},ob=({values:r},t,e)=>{r[t]=nb(e)},IF=(r,t,e)=>{switch(r.type.precision){case Cr.HALF:return ob(r,t,e);case Cr.SINGLE:case Cr.DOUBLE:return Pf(r,t,e)}},ab=({values:r},t,e)=>{SF(r,t,e.valueOf())},lb=({values:r},t,e)=>{r[t]=BigInt(e)},EF=({stride:r,values:t},e,i)=>{t.set(i.subarray(0,r),r*e)},ub=({values:r,valueOffsets:t},e,i)=>sb(r,t,e,i),cb=({values:r,valueOffsets:t},e,i)=>sb(r,t,e,A0(i)),CF=(r,t,e)=>{r.type.unit===_n.DAY?ab(r,t,e):lb(r,t,e)},hb=({values:r},t,e)=>{r[t]=BigInt(e/1e3)},fb=({values:r},t,e)=>{r[t]=BigInt(e)},db=({values:r},t,e)=>{r[t]=BigInt(e*1e3)},pb=({values:r},t,e)=>{r[t]=BigInt(e*1e6)},AF=(r,t,e)=>{switch(r.type.unit){case Jt.SECOND:return hb(r,t,e);case Jt.MILLISECOND:return fb(r,t,e);case Jt.MICROSECOND:return db(r,t,e);case Jt.NANOSECOND:return pb(r,t,e)}},mb=({values:r},t,e)=>{r[t]=e},yb=({values:r},t,e)=>{r[t]=e},gb=({values:r},t,e)=>{r[t]=e},vb=({values:r},t,e)=>{r[t]=e},OF=(r,t,e)=>{switch(r.type.unit){case Jt.SECOND:return mb(r,t,e);case Jt.MILLISECOND:return yb(r,t,e);case Jt.MICROSECOND:return gb(r,t,e);case Jt.NANOSECOND:return vb(r,t,e)}},FF=({values:r,stride:t},e,i)=>{r.set(i.subarray(0,t),t*e)},PF=(r,t,e)=>{const i=r.children[0],n=r.valueOffsets,s=Ei.getVisitFn(i);if(Array.isArray(e))for(let o=-1,a=n[t],l=n[t+1];a{const i=r.children[0],{valueOffsets:n}=r,s=Ei.getVisitFn(i);let{[t]:o,[t+1]:a}=n;const l=e instanceof Map?e.entries():Object.entries(e);for(const u of l)if(s(i,o,u),++o>=a)break},DF=(r,t)=>(e,i,n,s)=>i&&e(i,r,t[s]),RF=(r,t)=>(e,i,n,s)=>i&&e(i,r,t.get(s)),NF=(r,t)=>(e,i,n,s)=>i&&e(i,r,t.get(n.name)),LF=(r,t)=>(e,i,n,s)=>i&&e(i,r,t[n.name]),BF=(r,t,e)=>{const i=r.type.children.map(s=>Ei.getVisitFn(s.type)),n=e instanceof Map?NF(t,e):e instanceof Qe?RF(t,e):Array.isArray(e)?DF(t,e):LF(t,e);r.type.children.forEach((s,o)=>n(i[o],r.children[o],s,o))},kF=(r,t,e)=>{r.type.mode===Ii.Dense?_b(r,t,e):bb(r,t,e)},_b=(r,t,e)=>{const i=r.type.typeIdToChildIndex[r.typeIds[t]],n=r.children[i];Ei.visit(n,r.valueOffsets[t],e)},bb=(r,t,e)=>{const i=r.type.typeIdToChildIndex[r.typeIds[t]],n=r.children[i];Ei.visit(n,t,e)},UF=(r,t,e)=>{var i;(i=r.dictionary)===null||i===void 0||i.set(r.values[t],e)},zF=(r,t,e)=>{r.type.unit===ns.DAY_TIME?wb(r,t,e):xb(r,t,e)},wb=({values:r},t,e)=>{r.set(e.subarray(0,2),2*t)},xb=({values:r},t,e)=>{r[t]=e[0]*12+e[1]%12},Sb=({values:r},t,e)=>{r[t]=e},Tb=({values:r},t,e)=>{r[t]=e},Ib=({values:r},t,e)=>{r[t]=e},Eb=({values:r},t,e)=>{r[t]=e},jF=(r,t,e)=>{switch(r.type.unit){case Jt.SECOND:return Sb(r,t,e);case Jt.MILLISECOND:return Tb(r,t,e);case Jt.MICROSECOND:return Ib(r,t,e);case Jt.NANOSECOND:return Eb(r,t,e)}},$F=(r,t,e)=>{const{stride:i}=r,n=r.children[0],s=Ei.getVisitFn(n);if(Array.isArray(e))for(let o=-1,a=t*i;++o`${eo(t)}: ${eo(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new VF(this[Zr],this[Hs])}}class VF{constructor(t,e){this.childIndex=0,this.children=t.children,this.rowIndex=e,this.childFields=t.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){const t=this.childIndex;return te.name)}has(t,e){return t[Zr].type.children.some(i=>i.name===e)}getOwnPropertyDescriptor(t,e){if(t[Zr].type.children.some(i=>i.name===e))return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const i=t[Zr].type.children.findIndex(n=>n.name===e);if(i!==-1){const n=Yr.visit(t[Zr].children[i],t[Hs]);return Reflect.set(t,e,n),n}}set(t,e,i){const n=t[Zr].type.children.findIndex(s=>s.name===e);return n!==-1?(Ei.visit(t[Zr].children[n],t[Hs],i),Reflect.set(t,e,i)):Reflect.has(t,e)||typeof e=="symbol"?Reflect.set(t,e,i):!1}}const WF=new GF;class Lt extends le{}function Wt(r){return(t,e)=>t.getValid(e)?r(t,e):null}const HF=(r,t)=>864e5*r[t],XF=(r,t)=>null,Cb=(r,t,e)=>{if(e+1>=t.length)return null;const i=ar(t[e]),n=ar(t[e+1]);return r.subarray(i,n)},YF=({offset:r,values:t},e)=>{const i=r+e;return(t[i>>3]&1<HF(r,t),Ob=({values:r},t)=>ar(r[t]),xn=({stride:r,values:t},e)=>t[r*e],qF=({stride:r,values:t},e)=>Ff(t[r*e]),Fb=({values:r},t)=>r[t],QF=({stride:r,values:t},e)=>t.subarray(r*e,r*(e+1)),Pb=({values:r,valueOffsets:t},e)=>Cb(r,t,e),Mb=({values:r,valueOffsets:t},e)=>{const i=Cb(r,t,e);return i!==null?F2(i):null},KF=({values:r},t)=>r[t],ZF=({type:r,values:t},e)=>r.precision!==Cr.HALF?t[e]:Ff(t[e]),JF=(r,t)=>r.type.unit===_n.DAY?Ab(r,t):Ob(r,t),Db=({values:r},t)=>1e3*ar(r[t]),Rb=({values:r},t)=>ar(r[t]),Nb=({values:r},t)=>P0(r[t],BigInt(1e3)),Lb=({values:r},t)=>P0(r[t],BigInt(1e6)),tP=(r,t)=>{switch(r.type.unit){case Jt.SECOND:return Db(r,t);case Jt.MILLISECOND:return Rb(r,t);case Jt.MICROSECOND:return Nb(r,t);case Jt.NANOSECOND:return Lb(r,t)}},Bb=({values:r},t)=>r[t],kb=({values:r},t)=>r[t],Ub=({values:r},t)=>r[t],zb=({values:r},t)=>r[t],eP=(r,t)=>{switch(r.type.unit){case Jt.SECOND:return Bb(r,t);case Jt.MILLISECOND:return kb(r,t);case Jt.MICROSECOND:return Ub(r,t);case Jt.NANOSECOND:return zb(r,t)}},rP=({values:r,stride:t},e)=>su.decimal(r.subarray(t*e,t*(e+1))),iP=(r,t)=>{const{valueOffsets:e,stride:i,children:n}=r,{[t*i]:s,[t*i+1]:o}=e,l=n[0].slice(s,o-s);return new Qe([l])},nP=(r,t)=>{const{valueOffsets:e,children:i}=r,{[t]:n,[t+1]:s}=e,o=i[0];return new Df(o.slice(n,s-n))},sP=(r,t)=>new Mf(r,t),oP=(r,t)=>r.type.mode===Ii.Dense?jb(r,t):$b(r,t),jb=(r,t)=>{const e=r.type.typeIdToChildIndex[r.typeIds[t]],i=r.children[e];return Yr.visit(i,r.valueOffsets[t])},$b=(r,t)=>{const e=r.type.typeIdToChildIndex[r.typeIds[t]],i=r.children[e];return Yr.visit(i,t)},aP=(r,t)=>{var e;return(e=r.dictionary)===null||e===void 0?void 0:e.get(r.values[t])},lP=(r,t)=>r.type.unit===ns.DAY_TIME?Vb(r,t):Gb(r,t),Vb=({values:r},t)=>r.subarray(2*t,2*(t+1)),Gb=({values:r},t)=>{const e=r[t],i=new Int32Array(2);return i[0]=Math.trunc(e/12),i[1]=Math.trunc(e%12),i},Wb=({values:r},t)=>r[t],Hb=({values:r},t)=>r[t],Xb=({values:r},t)=>r[t],Yb=({values:r},t)=>r[t],uP=(r,t)=>{switch(r.type.unit){case Jt.SECOND:return Wb(r,t);case Jt.MILLISECOND:return Hb(r,t);case Jt.MICROSECOND:return Xb(r,t);case Jt.NANOSECOND:return Yb(r,t)}},cP=(r,t)=>{const{stride:e,children:i}=r,s=i[0].slice(t*e,e);return new Qe([s])};Lt.prototype.visitNull=Wt(XF);Lt.prototype.visitBool=Wt(YF);Lt.prototype.visitInt=Wt(KF);Lt.prototype.visitInt8=Wt(xn);Lt.prototype.visitInt16=Wt(xn);Lt.prototype.visitInt32=Wt(xn);Lt.prototype.visitInt64=Wt(Fb);Lt.prototype.visitUint8=Wt(xn);Lt.prototype.visitUint16=Wt(xn);Lt.prototype.visitUint32=Wt(xn);Lt.prototype.visitUint64=Wt(Fb);Lt.prototype.visitFloat=Wt(ZF);Lt.prototype.visitFloat16=Wt(qF);Lt.prototype.visitFloat32=Wt(xn);Lt.prototype.visitFloat64=Wt(xn);Lt.prototype.visitUtf8=Wt(Mb);Lt.prototype.visitLargeUtf8=Wt(Mb);Lt.prototype.visitBinary=Wt(Pb);Lt.prototype.visitLargeBinary=Wt(Pb);Lt.prototype.visitFixedSizeBinary=Wt(QF);Lt.prototype.visitDate=Wt(JF);Lt.prototype.visitDateDay=Wt(Ab);Lt.prototype.visitDateMillisecond=Wt(Ob);Lt.prototype.visitTimestamp=Wt(tP);Lt.prototype.visitTimestampSecond=Wt(Db);Lt.prototype.visitTimestampMillisecond=Wt(Rb);Lt.prototype.visitTimestampMicrosecond=Wt(Nb);Lt.prototype.visitTimestampNanosecond=Wt(Lb);Lt.prototype.visitTime=Wt(eP);Lt.prototype.visitTimeSecond=Wt(Bb);Lt.prototype.visitTimeMillisecond=Wt(kb);Lt.prototype.visitTimeMicrosecond=Wt(Ub);Lt.prototype.visitTimeNanosecond=Wt(zb);Lt.prototype.visitDecimal=Wt(rP);Lt.prototype.visitList=Wt(iP);Lt.prototype.visitStruct=Wt(sP);Lt.prototype.visitUnion=Wt(oP);Lt.prototype.visitDenseUnion=Wt(jb);Lt.prototype.visitSparseUnion=Wt($b);Lt.prototype.visitDictionary=Wt(aP);Lt.prototype.visitInterval=Wt(lP);Lt.prototype.visitIntervalDayTime=Wt(Vb);Lt.prototype.visitIntervalYearMonth=Wt(Gb);Lt.prototype.visitDuration=Wt(uP);Lt.prototype.visitDurationSecond=Wt(Wb);Lt.prototype.visitDurationMillisecond=Wt(Hb);Lt.prototype.visitDurationMicrosecond=Wt(Xb);Lt.prototype.visitDurationNanosecond=Wt(Yb);Lt.prototype.visitFixedSizeList=Wt(cP);Lt.prototype.visitMap=Wt(nP);const Yr=new Lt,Ms=Symbol.for("keys"),Xs=Symbol.for("vals"),Ds=Symbol.for("kKeysAsStrings"),wh=Symbol.for("_kKeysAsStrings");class Df{constructor(t){return this[Ms]=new Qe([t.children[0]]).memoize(),this[Xs]=t.children[1],new Proxy(this,new fP)}get[Ds](){return this[wh]||(this[wh]=Array.from(this[Ms].toArray(),String))}[Symbol.iterator](){return new hP(this[Ms],this[Xs])}get size(){return this[Ms].length}toArray(){return Object.values(this.toJSON())}toJSON(){const t=this[Ms],e=this[Xs],i={};for(let n=-1,s=t.length;++n`${eo(t)}: ${eo(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}}class hP{constructor(t,e){this.keys=t,this.vals=e,this.keyIndex=0,this.numKeys=t.length}[Symbol.iterator](){return this}next(){const t=this.keyIndex;return t===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(t),Yr.visit(this.vals,t)]})}}class fP{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[Ds]}has(t,e){return t[Ds].includes(e)}getOwnPropertyDescriptor(t,e){if(t[Ds].indexOf(e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const i=t[Ds].indexOf(e);if(i!==-1){const n=Yr.visit(Reflect.get(t,Xs),i);return Reflect.set(t,e,n),n}}set(t,e,i){const n=t[Ds].indexOf(e);return n!==-1?(Ei.visit(Reflect.get(t,Xs),n,i),Reflect.set(t,e,i)):Reflect.has(t,e)?Reflect.set(t,e,i):!1}}Object.defineProperties(Df.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[Ms]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Xs]:{writable:!0,enumerable:!1,configurable:!1,value:null},[wh]:{writable:!0,enumerable:!1,configurable:!1,value:null}});let lm;function qb(r,t,e,i){const{length:n=0}=r;let s=typeof t!="number"?0:t,o=typeof e!="number"?n:e;return s<0&&(s=(s%n+n)%n),o<0&&(o=(o%n+n)%n),on&&(o=n),i?i(r,s,o):[s,o]}const Qb=(r,t)=>r<0?t+r:r,um=r=>r!==r;function cs(r){if(typeof r!=="object"||r===null)return um(r)?um:e=>e===r;if(r instanceof Date){const e=r.valueOf();return i=>i instanceof Date?i.valueOf()===e:!1}return ArrayBuffer.isView(r)?e=>e?F0(r,e):!1:r instanceof Map?pP(r):Array.isArray(r)?dP(r):r instanceof Qe?mP(r):yP(r,!0)}function dP(r){const t=[];for(let e=-1,i=r.length;++e!1;const i=[];for(let n=-1,s=e.length;++n{if(!e||typeof e!="object")return!1;switch(e.constructor){case Array:return gP(r,e);case Map:return cm(r,e,e.keys());case Df:case Mf:case Object:case void 0:return cm(r,e,t||Object.keys(e))}return e instanceof Qe?vP(r,e):!1}}function gP(r,t){const e=r.length;if(t.length!==e)return!1;for(let i=-1;++i>i}function bP(r,t,e){return e?!!(r[t>>3]|=1<>3]&=~(1<0||e.byteLength>3):Zb(new au(e,r,t,null,Rf)).subarray(0,i)),n}return e}function Zb(r){const t=[];let e=0,i=0,n=0;for(const o of r)o&&(n|=1<0)&&(t[e++]=n);const s=new Uint8Array(t.length+7&-8);return s.set(t),s}class au{constructor(t,e,i,n,s){this.bytes=t,this.length=i,this.context=n,this.get=s,this.bit=e%8,this.byteIndex=e>>3,this.byte=t[this.byteIndex++],this.index=0}next(){return this.index>3<<3,n=t+(t%8===0?0:8-t%8);return Bl(r,t,n)+Bl(r,i,e)+Jb(r,n>>3,i-n>>3)}function Jb(r,t,e){let i=0,n=Math.trunc(t);const s=new DataView(r.buffer,r.byteOffset,r.byteLength),o=e===void 0?r.byteLength:n+e;for(;o-n>=4;)i+=qa(s.getUint32(n)),n+=4;for(;o-n>=2;)i+=qa(s.getUint16(n)),n+=2;for(;o-n>=1;)i+=qa(s.getUint8(n)),n+=1;return i}function qa(r){let t=Math.trunc(r);return t=t-(t>>>1&1431655765),t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}const wP=Object.freeze(Object.defineProperty({__proto__:null,BitIterator:au,getBit:Kb,getBool:Rf,packBools:Zb,popcnt_array:Jb,popcnt_bit_range:Bl,popcnt_uint32:qa,setBool:bP,truncateBitmap:xh},Symbol.toStringTag,{value:"Module"})),xP=-1;class ta{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){const{type:t}=this;return Et.isSparseUnion(t)?this.children.some(e=>e.nullable):Et.isDenseUnion(t)?this.children.some(e=>e.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let t=0;const{valueOffsets:e,values:i,nullBitmap:n,typeIds:s}=this;return e&&(t+=e.byteLength),i&&(t+=i.byteLength),n&&(t+=n.byteLength),s&&(t+=s.byteLength),this.children.reduce((o,a)=>o+a.byteLength,t)}get nullCount(){if(Et.isUnion(this.type))return this.children.reduce((i,n)=>i+n.nullCount,0);let t=this._nullCount,e;return t<=xP&&(e=this.nullBitmap)&&(this._nullCount=t=e.length===0?0:this.length-Bl(e,this.offset,this.offset+this.length)),t}constructor(t,e,i,n,s,o=[],a){this.type=t,this.children=o,this.dictionary=a,this.offset=Math.floor(Math.max(e||0,0)),this.length=Math.floor(Math.max(i||0,0)),this._nullCount=Math.floor(Math.max(n||0,-1));let l;s instanceof ta?(this.stride=s.stride,this.values=s.values,this.typeIds=s.typeIds,this.nullBitmap=s.nullBitmap,this.valueOffsets=s.valueOffsets):(this.stride=rb(t),s&&((l=s[0])&&(this.valueOffsets=l),(l=s[1])&&(this.values=l),(l=s[2])&&(this.nullBitmap=l),(l=s[3])&&(this.typeIds=l)))}getValid(t){const{type:e}=this;if(Et.isUnion(e)){const i=e,n=this.children[i.typeIdToChildIndex[this.typeIds[t]]],s=i.mode===Ii.Dense?this.valueOffsets[t]:t;return n.getValid(s)}if(this.nullable&&this.nullCount>0){const i=this.offset+t;return(this.nullBitmap[i>>3]&1<>3;(!s||s.byteLength<=c)&&(s=new Uint8Array((o+a+63&-64)>>3).fill(255),this.nullCount>0?(s.set(xh(o,a,this.nullBitmap),0),Object.assign(this,{nullBitmap:s})):Object.assign(this,{nullBitmap:s,_nullCount:0}));const h=s[c];i=(h&u)!==0,s[c]=e?h|u:h&~u}return i!==!!e&&(this._nullCount=this.nullCount+(e?-1:1)),e}clone(t=this.type,e=this.offset,i=this.length,n=this._nullCount,s=this,o=this.children){return new ta(t,e,i,n,s,o,this.dictionary)}slice(t,e){const{stride:i,typeId:n,children:s}=this,o=+(this._nullCount===0)-1,a=n===16?i:1,l=this._sliceBuffers(t,e,i,n);return this.clone(this.type,this.offset+t,e,o,l,s.length===0||this.valueOffsets?s:this._sliceChildren(s,a*t,a*e))}_changeLengthAndBackfillNullBitmap(t){if(this.typeId===W.Null)return this.clone(this.type,0,t,0);const{length:e,nullCount:i}=this,n=new Uint8Array((t+63&-64)>>3).fill(255,0,e>>3);n[e>>3]=(1<0&&n.set(xh(this.offset,e,this.nullBitmap),0);const s=this.buffers;return s[zi.VALIDITY]=n,this.clone(this.type,0,t,i+(t-e),s)}_sliceBuffers(t,e,i,n){let s;const{buffers:o}=this;return(s=o[zi.TYPE])&&(o[zi.TYPE]=s.subarray(t,t+e)),(s=o[zi.OFFSET])&&(o[zi.OFFSET]=s.subarray(t,t+e+1))||(s=o[zi.DATA])&&(o[zi.DATA]=n===6?s:s.subarray(i*t,i*(t+e))),o}_sliceChildren(t,e,i){return t.map(n=>n.slice(e,i))}}ta.prototype.children=Object.freeze([]);class hm{constructor(t=0,e){this.numChunks=t,this.getChunkIterator=e,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndext.nullable)}function TP(r){return r.reduce((t,e)=>t+e.nullCount,0)}function IP(r){return r.reduce((t,e,i)=>(t[i+1]=t[i]+e.length,t),new Uint32Array(r.length+1))}function EP(r,t,e,i){const n=[];for(let s=-1,o=r.length;++s=i)break;if(e>=l+u)continue;if(l>=e&&l+u<=i){n.push(a);continue}const c=Math.max(0,e-l),h=Math.min(i-l,u);n.push(a.slice(c,h-c))}return n.length===0&&n.push(r[0].slice(0,0)),n}function Nf(r,t,e,i){let n=0,s=0,o=t.length-1;do{if(n>=o-1)return e0?0:-1}function FP(r,t){const{nullBitmap:e}=r;if(!e||r.nullCount<=0)return-1;let i=0;for(const n of new au(e,r.offset+(t||0),r.length,e,Rf)){if(!n)return i;++i}return-1}function Kt(r,t,e){if(t===void 0)return-1;if(t===null)switch(r.typeId){case W.Union:break;case W.Dictionary:break;default:return FP(r,e)}const i=Yr.getVisitFn(r),n=cs(t);for(let s=(e||0)-1,o=r.length;++s{const n=r.data[i];return n.values.subarray(0,n.length)[Symbol.iterator]()});let e=0;return new hm(r.data.length,i=>{const s=r.data[i].length,o=r.slice(e,e+s);return e+=s,new PP(o)})}class PP{constructor(t){this.vector=t,this.index=0}next(){return this.indexa.data):t;if(s.length===0||s.some(a=>!(a instanceof ta)))throw new TypeError("Vector constructor expects an Array of Data instances.");const o=(e=s[0])===null||e===void 0?void 0:e.type;switch(s.length){case 0:this._offsets=[0];break;case 1:{const{get:a,set:l,indexOf:u}=iw[o.typeId],c=s[0];this.isValid=h=>tw(c,h),this.get=h=>a(c,h),this.set=(h,p)=>l(c,h,p),this.indexOf=h=>u(c,h),this._offsets=[0,c.length];break}default:Object.setPrototypeOf(this,nw[o.typeId]),this._offsets=IP(s);break}this.data=s,this.type=o,this.stride=rb(o),this.numChildren=(n=(i=o.children)===null||i===void 0?void 0:i.length)!==null&&n!==void 0?n:0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((t,e)=>t+e.byteLength,0)}get nullable(){return SP(this.data)}get nullCount(){return TP(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${W[this.type.typeId]}Vector`}isValid(t){return!1}get(t){return null}at(t){return this.get(Qb(t,this.length))}set(t,e){}indexOf(t,e){return-1}includes(t,e){return this.indexOf(t,e)>-1}[Symbol.iterator](){return MP.visit(this)}concat(...t){return new Qe(this.data.concat(t.flatMap(e=>e.data).flat(Number.POSITIVE_INFINITY)))}slice(t,e){return new Qe(qb(this,t,e,({data:i,_offsets:n},s,o)=>EP(i,n,s,o)))}toJSON(){return[...this]}toArray(){const{type:t,data:e,length:i,stride:n,ArrayType:s}=this;switch(t.typeId){case W.Int:case W.Float:case W.Decimal:case W.Time:case W.Timestamp:switch(e.length){case 0:return new s;case 1:return e[0].values.subarray(0,i*n);default:return e.reduce((o,{values:a,length:l})=>(o.array.set(a.subarray(0,l*n),o.offset),o.offset+=l*n,o),{array:new s(i*n),offset:0}).array}}return[...this]}toString(){return`[${[...this].join(",")}]`}getChild(t){var e;return this.getChildAt((e=this.type.children)===null||e===void 0?void 0:e.findIndex(i=>i.name===t))}getChildAt(t){return t>-1&&te[t])):null}get isMemoized(){return Et.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(Et.isDictionary(this.type)){const t=new kl(this.data[0].dictionary),e=this.data.map(i=>{const n=i.clone();return n.dictionary=t,n});return new Qe(e)}return new kl(this)}unmemoize(){if(Et.isDictionary(this.type)&&this.isMemoized){const t=this.data[0].dictionary.unmemoize(),e=this.data.map(i=>{const n=i.clone();return n.dictionary=t,n});return new Qe(e)}return this}}rw=Symbol.toStringTag;Qe[rw]=(r=>{r.type=Et.prototype,r.data=[],r.length=0,r.stride=1,r.numChildren=0,r._offsets=new Uint32Array([0]),r[Symbol.isConcatSpreadable]=!0;const t=Object.keys(W).map(e=>W[e]).filter(e=>typeof e=="number"&&e!==W.NONE);for(const e of t){const i=Yr.getVisitFnByTypeId(e),n=Ei.getVisitFnByTypeId(e),s=dm.getVisitFnByTypeId(e);iw[e]={get:i,set:n,indexOf:s},nw[e]=Object.create(r,{isValid:{value:fm(tw)},get:{value:fm(Yr.getVisitFnByTypeId(e))},set:{value:CP(Ei.getVisitFnByTypeId(e))},indexOf:{value:AP(dm.getVisitFnByTypeId(e))}})}return"Vector"})(Qe.prototype);class kl extends Qe{constructor(t){super(t.data);const e=this.get,i=this.set,n=this.slice,s=new Array(this.length);Object.defineProperty(this,"get",{value(o){const a=s[o];if(a!==void 0)return a;const l=e.call(this,o);return s[o]=l,l}}),Object.defineProperty(this,"set",{value(o,a){i.call(this,o,a),s[o]=a}}),Object.defineProperty(this,"slice",{value:(o,a)=>new kl(n.call(this,o,a))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new Qe(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}}const DP=65536;function Ls(r){return r<0&&(r=4294967295+r+1),`0x${r.toString(16)}`}const io=8,Lf=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8];class Bf{constructor(t){this.buffer=t}high(){return this.buffer[1]}low(){return this.buffer[0]}_times(t){const e=new Uint32Array([this.buffer[1]>>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),i=new Uint32Array([t.buffer[1]>>>16,t.buffer[1]&65535,t.buffer[0]>>>16,t.buffer[0]&65535]);let n=e[3]*i[3];this.buffer[0]=n&65535;let s=n>>>16;return n=e[2]*i[3],s+=n,n=e[3]*i[2]>>>0,s+=n,this.buffer[0]+=s<<16,this.buffer[1]=s>>>0>>16,this.buffer[1]+=e[1]*i[3]+e[2]*i[2]+e[3]*i[1],this.buffer[1]+=e[0]*i[3]+e[1]*i[2]+e[2]*i[1]+e[3]*i[0]<<16,this}_plus(t){const e=this.buffer[0]+t.buffer[0]>>>0;this.buffer[1]+=t.buffer[1],e>>0&&++this.buffer[1],this.buffer[0]=e}lessThan(t){return this.buffer[1]>>0,e[2]=this.buffer[2]+t.buffer[2]>>>0,e[1]=this.buffer[1]+t.buffer[1]>>>0,e[0]=this.buffer[0]+t.buffer[0]>>>0,e[0]>>0&&++e[1],e[1]>>0&&++e[2],e[2]>>0&&++e[3],this.buffer[3]=e[3],this.buffer[2]=e[2],this.buffer[1]=e[1],this.buffer[0]=e[0],this}hex(){return`${Ls(this.buffer[3])} ${Ls(this.buffer[2])} ${Ls(this.buffer[1])} ${Ls(this.buffer[0])}`}static multiply(t,e){return new ci(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new ci(new Uint32Array(t.buffer)).plus(e)}static from(t,e=new Uint32Array(4)){return ci.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(4)){return ci.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(4)){const i=t.startsWith("-"),n=t.length,s=new ci(e);for(let o=i?1:0;othis.compareFields(i,e[n]))}compareFields(t,e){return t===e||e instanceof t.constructor&&t.name===e.name&&t.nullable===e.nullable&&this.visit(t.type,e.type)}}function ur(r,t){return t instanceof r.constructor}function hs(r,t){return r===t||ur(r,t)}function Qi(r,t){return r===t||ur(r,t)&&r.bitWidth===t.bitWidth&&r.isSigned===t.isSigned}function lu(r,t){return r===t||ur(r,t)&&r.precision===t.precision}function NP(r,t){return r===t||ur(r,t)&&r.byteWidth===t.byteWidth}function kf(r,t){return r===t||ur(r,t)&&r.unit===t.unit}function fa(r,t){return r===t||ur(r,t)&&r.unit===t.unit&&r.timezone===t.timezone}function da(r,t){return r===t||ur(r,t)&&r.unit===t.unit&&r.bitWidth===t.bitWidth}function LP(r,t){return r===t||ur(r,t)&&r.children.length===t.children.length&&Ci.compareManyFields(r.children,t.children)}function BP(r,t){return r===t||ur(r,t)&&r.children.length===t.children.length&&Ci.compareManyFields(r.children,t.children)}function Uf(r,t){return r===t||ur(r,t)&&r.mode===t.mode&&r.typeIds.every((e,i)=>e===t.typeIds[i])&&Ci.compareManyFields(r.children,t.children)}function kP(r,t){return r===t||ur(r,t)&&r.id===t.id&&r.isOrdered===t.isOrdered&&Ci.visit(r.indices,t.indices)&&Ci.visit(r.dictionary,t.dictionary)}function zf(r,t){return r===t||ur(r,t)&&r.unit===t.unit}function pa(r,t){return r===t||ur(r,t)&&r.unit===t.unit}function UP(r,t){return r===t||ur(r,t)&&r.listSize===t.listSize&&r.children.length===t.children.length&&Ci.compareManyFields(r.children,t.children)}function zP(r,t){return r===t||ur(r,t)&&r.keysSorted===t.keysSorted&&r.children.length===t.children.length&&Ci.compareManyFields(r.children,t.children)}Ut.prototype.visitNull=hs;Ut.prototype.visitBool=hs;Ut.prototype.visitInt=Qi;Ut.prototype.visitInt8=Qi;Ut.prototype.visitInt16=Qi;Ut.prototype.visitInt32=Qi;Ut.prototype.visitInt64=Qi;Ut.prototype.visitUint8=Qi;Ut.prototype.visitUint16=Qi;Ut.prototype.visitUint32=Qi;Ut.prototype.visitUint64=Qi;Ut.prototype.visitFloat=lu;Ut.prototype.visitFloat16=lu;Ut.prototype.visitFloat32=lu;Ut.prototype.visitFloat64=lu;Ut.prototype.visitUtf8=hs;Ut.prototype.visitLargeUtf8=hs;Ut.prototype.visitBinary=hs;Ut.prototype.visitLargeBinary=hs;Ut.prototype.visitFixedSizeBinary=NP;Ut.prototype.visitDate=kf;Ut.prototype.visitDateDay=kf;Ut.prototype.visitDateMillisecond=kf;Ut.prototype.visitTimestamp=fa;Ut.prototype.visitTimestampSecond=fa;Ut.prototype.visitTimestampMillisecond=fa;Ut.prototype.visitTimestampMicrosecond=fa;Ut.prototype.visitTimestampNanosecond=fa;Ut.prototype.visitTime=da;Ut.prototype.visitTimeSecond=da;Ut.prototype.visitTimeMillisecond=da;Ut.prototype.visitTimeMicrosecond=da;Ut.prototype.visitTimeNanosecond=da;Ut.prototype.visitDecimal=hs;Ut.prototype.visitList=LP;Ut.prototype.visitStruct=BP;Ut.prototype.visitUnion=Uf;Ut.prototype.visitDenseUnion=Uf;Ut.prototype.visitSparseUnion=Uf;Ut.prototype.visitDictionary=kP;Ut.prototype.visitInterval=zf;Ut.prototype.visitIntervalDayTime=zf;Ut.prototype.visitIntervalYearMonth=zf;Ut.prototype.visitDuration=pa;Ut.prototype.visitDurationSecond=pa;Ut.prototype.visitDurationMillisecond=pa;Ut.prototype.visitDurationMicrosecond=pa;Ut.prototype.visitDurationNanosecond=pa;Ut.prototype.visitFixedSizeList=UP;Ut.prototype.visitMap=zP;const Ci=new Ut;function jP(r,t){return Ci.compareSchemas(r,t)}function $P(r,t){return Ci.compareFields(r,t)}function VP(r,t){return Ci.visit(r,t)}const pm=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},_F),RP),wP),xF),pF),_P),yF),{compareSchemas:jP,compareFields:$P,compareTypes:VP}),sw=6048e5,GP=864e5,mm=Symbol.for("constructDateFrom");function Gi(r,t){return typeof r=="function"?r(t):r&&typeof r=="object"&&mm in r?r[mm](t):r instanceof Date?new r.constructor(t):new Date(t)}function qr(r,t){return Gi(t||r,r)}let WP={};function uu(){return WP}function ea(r,t){var a,l,u,c;const e=uu(),i=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??e.weekStartsOn??((c=(u=e.locale)==null?void 0:u.options)==null?void 0:c.weekStartsOn)??0,n=qr(r,t==null?void 0:t.in),s=n.getDay(),o=(s=s.getTime()?i+1:e.getTime()>=a.getTime()?i:i-1}function ym(r){const t=qr(r),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+r-+e}function HP(r,...t){const e=Gi.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function gm(r,t){const e=qr(r,t==null?void 0:t.in);return e.setHours(0,0,0,0),e}function XP(r,t,e){const[i,n]=HP(e==null?void 0:e.in,r,t),s=gm(i),o=gm(n),a=+s-ym(s),l=+o-ym(o);return Math.round((a-l)/GP)}function YP(r,t){const e=ow(r,t),i=Gi(r,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),Ul(i)}function qP(r){return r instanceof Date||typeof r=="object"&&Object.prototype.toString.call(r)==="[object Date]"}function QP(r){return!(!qP(r)&&typeof r!="number"||isNaN(+qr(r)))}function KP(r,t){const e=qr(r,t==null?void 0:t.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}const ZP={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},JP=(r,t,e)=>{let i;const n=ZP[r];return typeof n=="string"?i=n:t===1?i=n.one:i=n.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function nc(r){return(t={})=>{const e=t.width?String(t.width):r.defaultWidth;return r.formats[e]||r.formats[r.defaultWidth]}}const tM={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},eM={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},rM={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},iM={date:nc({formats:tM,defaultWidth:"full"}),time:nc({formats:eM,defaultWidth:"full"}),dateTime:nc({formats:rM,defaultWidth:"full"})},nM={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},sM=(r,t,e,i)=>nM[r];function go(r){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let n;if(i==="formatting"&&r.formattingValues){const o=r.defaultFormattingWidth||r.defaultWidth,a=e!=null&&e.width?String(e.width):o;n=r.formattingValues[a]||r.formattingValues[o]}else{const o=r.defaultWidth,a=e!=null&&e.width?String(e.width):r.defaultWidth;n=r.values[a]||r.values[o]}const s=r.argumentCallback?r.argumentCallback(t):t;return n[s]}}const oM={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},aM={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},lM={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},uM={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},cM={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},hM={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},fM=(r,t)=>{const e=Number(r),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},dM={ordinalNumber:fM,era:go({values:oM,defaultWidth:"wide"}),quarter:go({values:aM,defaultWidth:"wide",argumentCallback:r=>r-1}),month:go({values:lM,defaultWidth:"wide"}),day:go({values:uM,defaultWidth:"wide"}),dayPeriod:go({values:cM,defaultWidth:"wide",formattingValues:hM,defaultFormattingWidth:"wide"})};function vo(r){return(t,e={})=>{const i=e.width,n=i&&r.matchPatterns[i]||r.matchPatterns[r.defaultMatchWidth],s=t.match(n);if(!s)return null;const o=s[0],a=i&&r.parsePatterns[i]||r.parsePatterns[r.defaultParseWidth],l=Array.isArray(a)?mM(a,h=>h.test(o)):pM(a,h=>h.test(o));let u;u=r.valueCallback?r.valueCallback(l):l,u=e.valueCallback?e.valueCallback(u):u;const c=t.slice(o.length);return{value:u,rest:c}}}function pM(r,t){for(const e in r)if(Object.prototype.hasOwnProperty.call(r,e)&&t(r[e]))return e}function mM(r,t){for(let e=0;e{const i=t.match(r.matchPattern);if(!i)return null;const n=i[0],s=t.match(r.parsePattern);if(!s)return null;let o=r.valueCallback?r.valueCallback(s[0]):s[0];o=e.valueCallback?e.valueCallback(o):o;const a=t.slice(n.length);return{value:o,rest:a}}}const gM=/^(\d+)(th|st|nd|rd)?/i,vM=/\d+/i,_M={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},bM={any:[/^b/i,/^(a|c)/i]},wM={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},xM={any:[/1/i,/2/i,/3/i,/4/i]},SM={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},TM={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},IM={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},EM={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},CM={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},AM={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},OM={ordinalNumber:yM({matchPattern:gM,parsePattern:vM,valueCallback:r=>parseInt(r,10)}),era:vo({matchPatterns:_M,defaultMatchWidth:"wide",parsePatterns:bM,defaultParseWidth:"any"}),quarter:vo({matchPatterns:wM,defaultMatchWidth:"wide",parsePatterns:xM,defaultParseWidth:"any",valueCallback:r=>r+1}),month:vo({matchPatterns:SM,defaultMatchWidth:"wide",parsePatterns:TM,defaultParseWidth:"any"}),day:vo({matchPatterns:IM,defaultMatchWidth:"wide",parsePatterns:EM,defaultParseWidth:"any"}),dayPeriod:vo({matchPatterns:CM,defaultMatchWidth:"any",parsePatterns:AM,defaultParseWidth:"any"})},FM={code:"en-US",formatDistance:JP,formatLong:iM,formatRelative:sM,localize:dM,match:OM,options:{weekStartsOn:0,firstWeekContainsDate:1}};function PM(r,t){const e=qr(r,t==null?void 0:t.in);return XP(e,KP(e))+1}function MM(r,t){const e=qr(r,t==null?void 0:t.in),i=+Ul(e)-+YP(e);return Math.round(i/sw)+1}function aw(r,t){var c,h,p,f;const e=qr(r,t==null?void 0:t.in),i=e.getFullYear(),n=uu(),s=(t==null?void 0:t.firstWeekContainsDate)??((h=(c=t==null?void 0:t.locale)==null?void 0:c.options)==null?void 0:h.firstWeekContainsDate)??n.firstWeekContainsDate??((f=(p=n.locale)==null?void 0:p.options)==null?void 0:f.firstWeekContainsDate)??1,o=Gi((t==null?void 0:t.in)||r,0);o.setFullYear(i+1,0,s),o.setHours(0,0,0,0);const a=ea(o,t),l=Gi((t==null?void 0:t.in)||r,0);l.setFullYear(i,0,s),l.setHours(0,0,0,0);const u=ea(l,t);return+e>=+a?i+1:+e>=+u?i:i-1}function DM(r,t){var a,l,u,c;const e=uu(),i=(t==null?void 0:t.firstWeekContainsDate)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)??e.firstWeekContainsDate??((c=(u=e.locale)==null?void 0:u.options)==null?void 0:c.firstWeekContainsDate)??1,n=aw(r,t),s=Gi((t==null?void 0:t.in)||r,0);return s.setFullYear(n,0,i),s.setHours(0,0,0,0),ea(s,t)}function RM(r,t){const e=qr(r,t==null?void 0:t.in),i=+ea(e,t)-+DM(e,t);return Math.round(i/sw)+1}function ve(r,t){const e=r<0?"-":"",i=Math.abs(r).toString().padStart(t,"0");return e+i}const rn={y(r,t){const e=r.getFullYear(),i=e>0?e:1-e;return ve(t==="yy"?i%100:i,t.length)},M(r,t){const e=r.getMonth();return t==="M"?String(e+1):ve(e+1,2)},d(r,t){return ve(r.getDate(),t.length)},a(r,t){const e=r.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(r,t){return ve(r.getHours()%12||12,t.length)},H(r,t){return ve(r.getHours(),t.length)},m(r,t){return ve(r.getMinutes(),t.length)},s(r,t){return ve(r.getSeconds(),t.length)},S(r,t){const e=t.length,i=r.getMilliseconds(),n=Math.trunc(i*Math.pow(10,e-3));return ve(n,t.length)}},_s={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},vm={G:function(r,t,e){const i=r.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});case"GGGG":default:return e.era(i,{width:"wide"})}},y:function(r,t,e){if(t==="yo"){const i=r.getFullYear(),n=i>0?i:1-i;return e.ordinalNumber(n,{unit:"year"})}return rn.y(r,t)},Y:function(r,t,e,i){const n=aw(r,i),s=n>0?n:1-n;if(t==="YY"){const o=s%100;return ve(o,2)}return t==="Yo"?e.ordinalNumber(s,{unit:"year"}):ve(s,t.length)},R:function(r,t){const e=ow(r);return ve(e,t.length)},u:function(r,t){const e=r.getFullYear();return ve(e,t.length)},Q:function(r,t,e){const i=Math.ceil((r.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return ve(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(r,t,e){const i=Math.ceil((r.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return ve(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(r,t,e){const i=r.getMonth();switch(t){case"M":case"MM":return rn.M(r,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(r,t,e){const i=r.getMonth();switch(t){case"L":return String(i+1);case"LL":return ve(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(r,t,e,i){const n=RM(r,i);return t==="wo"?e.ordinalNumber(n,{unit:"week"}):ve(n,t.length)},I:function(r,t,e){const i=MM(r);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):ve(i,t.length)},d:function(r,t,e){return t==="do"?e.ordinalNumber(r.getDate(),{unit:"date"}):rn.d(r,t)},D:function(r,t,e){const i=PM(r);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):ve(i,t.length)},E:function(r,t,e){const i=r.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});case"EEEE":default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(r,t,e,i){const n=r.getDay(),s=(n-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return ve(s,2);case"eo":return e.ordinalNumber(s,{unit:"day"});case"eee":return e.day(n,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(n,{width:"short",context:"formatting"});case"eeee":default:return e.day(n,{width:"wide",context:"formatting"})}},c:function(r,t,e,i){const n=r.getDay(),s=(n-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return ve(s,t.length);case"co":return e.ordinalNumber(s,{unit:"day"});case"ccc":return e.day(n,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(n,{width:"narrow",context:"standalone"});case"cccccc":return e.day(n,{width:"short",context:"standalone"});case"cccc":default:return e.day(n,{width:"wide",context:"standalone"})}},i:function(r,t,e){const i=r.getDay(),n=i===0?7:i;switch(t){case"i":return String(n);case"ii":return ve(n,t.length);case"io":return e.ordinalNumber(n,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});case"iiii":default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(r,t,e){const n=r.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(r,t,e){const i=r.getHours();let n;switch(i===12?n=_s.noon:i===0?n=_s.midnight:n=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(r,t,e){const i=r.getHours();let n;switch(i>=17?n=_s.evening:i>=12?n=_s.afternoon:i>=4?n=_s.morning:n=_s.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(r,t,e){if(t==="ho"){let i=r.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return rn.h(r,t)},H:function(r,t,e){return t==="Ho"?e.ordinalNumber(r.getHours(),{unit:"hour"}):rn.H(r,t)},K:function(r,t,e){const i=r.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):ve(i,t.length)},k:function(r,t,e){let i=r.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):ve(i,t.length)},m:function(r,t,e){return t==="mo"?e.ordinalNumber(r.getMinutes(),{unit:"minute"}):rn.m(r,t)},s:function(r,t,e){return t==="so"?e.ordinalNumber(r.getSeconds(),{unit:"second"}):rn.s(r,t)},S:function(r,t){return rn.S(r,t)},X:function(r,t,e){const i=r.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return bm(i);case"XXXX":case"XX":return Vn(i);case"XXXXX":case"XXX":default:return Vn(i,":")}},x:function(r,t,e){const i=r.getTimezoneOffset();switch(t){case"x":return bm(i);case"xxxx":case"xx":return Vn(i);case"xxxxx":case"xxx":default:return Vn(i,":")}},O:function(r,t,e){const i=r.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+_m(i,":");case"OOOO":default:return"GMT"+Vn(i,":")}},z:function(r,t,e){const i=r.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+_m(i,":");case"zzzz":default:return"GMT"+Vn(i,":")}},t:function(r,t,e){const i=Math.trunc(+r/1e3);return ve(i,t.length)},T:function(r,t,e){return ve(+r,t.length)}};function _m(r,t=""){const e=r>0?"-":"+",i=Math.abs(r),n=Math.trunc(i/60),s=i%60;return s===0?e+String(n):e+String(n)+t+ve(s,2)}function bm(r,t){return r%60===0?(r>0?"-":"+")+ve(Math.abs(r)/60,2):Vn(r,t)}function Vn(r,t=""){const e=r>0?"-":"+",i=Math.abs(r),n=ve(Math.trunc(i/60),2),s=ve(i%60,2);return e+n+t+s}const wm=(r,t)=>{switch(r){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},lw=(r,t)=>{switch(r){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},NM=(r,t)=>{const e=r.match(/(P+)(p+)?/)||[],i=e[1],n=e[2];if(!n)return wm(r,t);let s;switch(i){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",wm(i,t)).replace("{{time}}",lw(n,t))},LM={p:lw,P:NM},BM=/^D+$/,kM=/^Y+$/,UM=["D","DD","YY","YYYY"];function zM(r){return BM.test(r)}function jM(r){return kM.test(r)}function $M(r,t,e){const i=VM(r,t,e);if(console.warn(i),UM.includes(r))throw new RangeError(i)}function VM(r,t,e){const i=r[0]==="Y"?"years":"days of the month";return`Use \`${r.toLowerCase()}\` instead of \`${r}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const GM=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,WM=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,HM=/^'([^]*?)'?$/,XM=/''/g,YM=/[a-zA-Z]/;function uw(r,t,e){var c,h,p,f;const i=uu(),n=i.locale??FM,s=i.firstWeekContainsDate??((h=(c=i.locale)==null?void 0:c.options)==null?void 0:h.firstWeekContainsDate)??1,o=i.weekStartsOn??((f=(p=i.locale)==null?void 0:p.options)==null?void 0:f.weekStartsOn)??0,a=qr(r,e==null?void 0:e.in);if(!QP(a))throw new RangeError("Invalid time value");let l=t.match(WM).map(y=>{const g=y[0];if(g==="p"||g==="P"){const d=LM[g];return d(y,n.formatLong)}return y}).join("").match(GM).map(y=>{if(y==="''")return{isToken:!1,value:"'"};const g=y[0];if(g==="'")return{isToken:!1,value:qM(y)};if(vm[g])return{isToken:!0,value:y};if(g.match(YM))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");return{isToken:!1,value:y}});n.localize.preprocessor&&(l=n.localize.preprocessor(a,l));const u={firstWeekContainsDate:s,weekStartsOn:o,locale:n};return l.map(y=>{if(!y.isToken)return y.value;const g=y.value;(jM(g)||zM(g))&&$M(g,t,String(r));const d=vm[g[0]];return d(a,g,n.localize,u)}).join("")}function qM(r){const t=r.match(HM);return t?t[1].replace(XM,"'"):r}function QM(r,t){return qr(r*1e3,t==null?void 0:t.in)}function KM(r,t){const e=ZM(t)?new t(0):Gi(t,0);return e.setFullYear(r.getFullYear(),r.getMonth(),r.getDate()),e.setHours(r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()),e}function ZM(r){var t;return typeof r=="function"&&((t=r.prototype)==null?void 0:t.constructor)===r}function JM(r,t){let e=r.length;switch("string"){case"string":{if(t.length!==1)throw new Error("The 'chars' parameter should be a single character string.");for(;e>0&&r[e-1]===t;)e--;break}}return r.substring(0,e)}function gr(r){return r==null}function tD(r){return r!=null}async function Sh(){if(typeof window<"u"&&window!==null)return"browser";try{const r=await ln(()=>import("./__vite-browser-external-FmFgRqLi.js"),[]);return typeof r<"u"&&r.versions!=null&&r.versions.node!=null?"node":"unknown"}catch{return"unknown"}}function eD(r){return gr(r)?!1:Et.isInt(r.type)&&!cw(r)||rD(r)}function rD(r){return gr(r)?!1:Et.isInt(r.type)&&r.type.isSigned===!1}function iD(r){return gr(r)?!1:Et.isFloat(r.type)??!1}function nD(r){return gr(r)?!1:Et.isDecimal(r.type)}function sD(r){return gr(r)?!1:Et.isBool(r.type)}function oD(r){return gr(r)?!1:Et.isDuration(r.type)}function cw(r){return gr(r)?!1:Et.isInt(r.type)&&r.metadata.get("ARROW:extension:name")==="period"}function aD(r){return gr(r)?!1:Et.isTimestamp(r.type)}function lD(r){return gr(r)?!1:Et.isDate(r.type)}function uD(r){return gr(r)?!1:Et.isTime(r.type)}function cD(r){return gr(r)?!1:Et.isList(r.type)||Et.isFixedSizeList(r.type)}function hD(r){return gr(r)?!1:Et.isStruct(r.type)||Et.isMap(r.type)}function fD(r){return gr(r)?!1:Et.isStruct(r.type)&&r.metadata.get("ARROW:extension:name")==="interval"||Et.isInterval(r.type)}function dD(r,t){let e;if(t===Jt.MILLISECOND)e=1e3;else if(t===Jt.MICROSECOND)e=1e3*1e3;else if(t===Jt.NANOSECOND)e=1e3*1e3*1e3;else return Number(r);return typeof r=="bigint"&&!Number.isSafeInteger(Number(r))?Number(r/BigInt(e)):Number(r)/e}function pD(r,t){var i;const e=dD(r,((i=t==null?void 0:t.type)==null?void 0:i.unit)??Jt.SECOND);return QM(e)}function mD(r,t){const e=pD(r,t);return uw(e,e.getMilliseconds()===0?"HH:mm:ss":"HH:mm:ss.SSS")}function yD(r){const t="yyyy-MM-dd";return r instanceof Date||typeof r=="number"&&Number.isFinite(r)?uw(r,t):(console.warn(`Unsupported date value: ${r}`),String(r))}function gD(r,t){var n;if(!(r instanceof Date||typeof r=="number"&&Number.isFinite(r)))return console.warn(`Unsupported datetime value: ${r}`),null;let e;const i=(n=t==null?void 0:t.type)==null?void 0:n.timezone;return typeof r=="number"?i?e=new Er(r,i):e=new Er(r):i?e=new Er(r,i):e=new Er(r),KM(e,Date)}function vD(r,t){var a;const e=((a=t==null?void 0:t.type)==null?void 0:a.scale)||0;let i=pm.bigNumToString(new pm.BN(r)).padStart(e,"0");if(e===0)return i;let n="";i.startsWith("-")&&(n="-",i=i.slice(1));const s=i.slice(0,-e)||"0",o=JM(i.slice(-e),"0")||"";return`${n}${s}${o?`.${o}`:""}`}function _D(r){const t=r[0],e=r[1],i=[];return t!==0&&i.push(`${t} year${t>1?"s":""}`),e!==0&&i.push(`${e} month${e>1?"s":""}`),i.length?i.join(" "):"0 months"}function bD(r,t){var i,n,s,o;if(Et.isInterval(t==null?void 0:t.type))return _D(r);const e=t&&t.metadata.get("ARROW:extension:name");if(e&&e==="pandas.interval"){const a=JSON.parse(t.metadata.get("ARROW:extension:metadata")),{closed:l}=a,u=r.toJSON(),c=l==="both"||l==="left"?"[":"(",h=l==="both"||l==="right"?"]":")",p=Th(u.left,(n=(i=t.type)==null?void 0:i.children)==null?void 0:n[0]),f=Th(u.right,(o=(s=t.type)==null?void 0:s.children)==null?void 0:o[1]);return`${c+p}, ${f+h}`}return String(r)}function wD(r,t){return(t==null?void 0:t.type)instanceof bh?JSON.parse(JSON.stringify(r,(e,i)=>{if(tD(i))return typeof i=="bigint"?Number(i):i})):JSON.parse(JSON.stringify(r,(e,i)=>typeof i=="bigint"?Number(i):i))}function Th(r,t){if(gr(r))return null;const e=r instanceof Date||Number.isFinite(r);if(e&&lD(t))return yD(r);if(typeof r=="bigint"&&uD(t))return mD(Number(r),t);if(e&&aD(t))return gD(r,t);if(cw(t))throw new Error("Period type is not supported yet");if(fD(t))return bD(r,t);if(oD(t))throw new Error("Duration type is not supported yet");return nD(t)?vD(r,t):iD(t)&&Number.isFinite(r)||eD(t)?r:hD(t)||cD(t)?wD(r,t):sD(t)?!!r:String(r)}function xm(r){return((r.toArray()||[]).map(i=>i.toJSON())||[]).map(i=>(r.schema.fields.forEach(n=>i[n.name]=Th(i[n.name],n)),i))}var ra=(r=>(r.ORIGIN_PRIVATE_FS="origin-private-fs",r.NODE_FS="node-fs",r))(ra||{});async function hw(r){const t=Cx(r,{logger:!1});let e,i;const n=await Sh();if(n==="browser"){if(typeof t.bundles>"u"){const{getBundles:l}=await ln(async()=>{const{getBundles:u}=await import("./default-browser-BrgSDbLD.js");return{getBundles:u}},[]);t.bundles=await l()}i=await kp(await t.bundles),e=new Worker(i.mainWorker)}else if(n==="node"){if(typeof t.bundles>"u"){const{getBundles:c}=await ln(async()=>{const{getBundles:h}=await import("./default-node-DRO9_bbw.js");return{getBundles:h}},__vite__mapDeps([0,1,2]));t.bundles=await c()}i=await kp(await t.bundles);let l=i.mainWorker;l.startsWith("/@fs/")&&(l=l.replace("/@fs/","file://"));const u=await ln(()=>import("./index-Cp8iQ_hy.js"),[]);e=new u.default(l,{type:"module"})}else throw new Error(`Unsupported environment: ${n}`);let s;t.logger===!0?s=new I0:t.logger===!1?s=new c2:s=t.logger;const o=new g2(s,e);if(await o.instantiate(i.mainModule,i.pthreadWorker),t.storage)switch(t.storage.type){case ra.ORIGIN_PRIVATE_FS:{try{let l=t.storage.path;l.startsWith("/")&&(l=l.slice(1)),await o.open({path:`opfs://${l}`,accessMode:t.storage.accessMode})}catch(l){throw await o.terminate(),await e.terminate(),l}break}case ra.NODE_FS:{try{await o.open({path:t.storage.path,accessMode:t.storage.accessMode,useDirectIO:!0})}catch(l){throw await o.terminate(),await e.terminate(),l}break}}const a=await o.connect();return{worker:e,db:o,conn:a,query:async(l,u=[])=>{if(!u||u.length===0){const f=await a.query(l);return xm(f)}const c=await a.prepare(l),h=await c.query(...u),p=xm(h);return c.close(),p},close:async()=>{await a.close(),await o.terminate(),await e.terminate()}}}async function xD(r,t){await(await r).conn.send("BEGIN TRANSACTION");try{const e=await t(r);return await(await r).conn.send("COMMIT"),e}catch(e){throw await(await r).conn.send("ROLLBACK"),e}}async function SD(r,t,e){await(await r).conn.send(`SAVEPOINT ${t}`);try{const i=await e(r);return await(await r).conn.send(`RELEASE SAVEPOINT ${t}`),i}catch(i){throw await(await r).conn.send(`ROLLBACK TO SAVEPOINT ${t}`),i}}const xt=Symbol.for("drizzle:entityKind");function lt(r,t){if(!r||typeof r!="object")return!1;if(r instanceof t)return!0;if(!Object.prototype.hasOwnProperty.call(t,xt))throw new 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 e=Object.getPrototypeOf(r).constructor;if(e)for(;e;){if(xt in e&&e[xt]===t[xt])return!0;e=Object.getPrototypeOf(e)}return!1}var Mm;Mm=xt;class Ke{constructor(t,e){G(this,"name");G(this,"keyAsName");G(this,"primary");G(this,"notNull");G(this,"default");G(this,"defaultFn");G(this,"onUpdateFn");G(this,"hasDefault");G(this,"isUnique");G(this,"uniqueName");G(this,"uniqueType");G(this,"dataType");G(this,"columnType");G(this,"enumValues");G(this,"generated");G(this,"generatedIdentity");G(this,"config");this.table=t,this.config=e,this.name=e.name,this.keyAsName=e.keyAsName,this.notNull=e.notNull,this.default=e.default,this.defaultFn=e.defaultFn,this.onUpdateFn=e.onUpdateFn,this.hasDefault=e.hasDefault,this.primary=e.primaryKey,this.isUnique=e.isUnique,this.uniqueName=e.uniqueName,this.uniqueType=e.uniqueType,this.dataType=e.dataType,this.columnType=e.columnType,this.generated=e.generated,this.generatedIdentity=e.generatedIdentity}mapFromDriverValue(t){return t}mapToDriverValue(t){return t}shouldDisableInsert(){return this.config.generated!==void 0&&this.config.generated.type!=="byDefault"}}G(Ke,Mm,"Column");const Ys=Symbol.for("drizzle:Name");function TD(r,t){return`${r[Ys]}_${t.join("_")}_unique`}var Dm,Rm;class Ar extends(Rm=Ke,Dm=xt,Rm){constructor(t,e){e.uniqueName||(e.uniqueName=TD(t,[e.name])),super(t,e),this.table=t}}G(Ar,Dm,"PgColumn");const Sm=Symbol.for("drizzle:isPgEnum");function ID(r){return!!r&&typeof r=="function"&&Sm in r&&r[Sm]===!0}var Nm;Nm=xt;class Or{constructor(t,e,i,n=!1){this._={brand:"Subquery",sql:t,selectedFields:e,alias:i,isWith:n}}}G(Or,Nm,"Subquery");var Lm,Bm;class jf extends(Bm=Or,Lm=xt,Bm){}G(jf,Lm,"WithSubquery");const Pr={startActiveSpan(r,t){return t()}},He=Symbol.for("drizzle:ViewBaseConfig"),Qa=Symbol.for("drizzle:Schema"),Ih=Symbol.for("drizzle:Columns"),Tm=Symbol.for("drizzle:ExtraConfigColumns"),sc=Symbol.for("drizzle:OriginalName"),oc=Symbol.for("drizzle:BaseName"),zl=Symbol.for("drizzle:IsAlias"),Im=Symbol.for("drizzle:ExtraConfigBuilder"),ED=Symbol.for("drizzle:IsDrizzleTable");var km,Um,zm,jm,$m,Vm,Gm,Wm,Hm,Xm;Xm=xt,Hm=Ys,Wm=sc,Gm=Qa,Vm=Ih,$m=Tm,jm=oc,zm=zl,Um=ED,km=Im;class Tt{constructor(t,e,i){G(this,Hm);G(this,Wm);G(this,Gm);G(this,Vm);G(this,$m);G(this,jm);G(this,zm,!1);G(this,Um,!0);G(this,km);this[Ys]=this[sc]=t,this[Qa]=e,this[oc]=i}}G(Tt,Xm,"Table"),G(Tt,"Symbol",{Name:Ys,Schema:Qa,OriginalName:sc,Columns:Ih,ExtraConfigColumns:Tm,BaseName:oc,IsAlias:zl,ExtraConfigBuilder:Im});function qn(r){return r[Ys]}function ia(r){return`${r[Qa]??"public"}.${r[Ys]}`}function fw(r){return r!=null&&typeof r.getSQL=="function"}function CD(r){var e;const t={sql:"",params:[]};for(const i of r)t.sql+=i.sql,t.params.push(...i.params),(e=i.typings)!=null&&e.length&&(t.typings||(t.typings=[]),t.typings.push(...i.typings));return t}var Ym;Ym=xt;class Xe{constructor(t){G(this,"value");this.value=Array.isArray(t)?t:[t]}getSQL(){return new Ft([this])}}G(Xe,Ym,"StringChunk");var qm;qm=xt;const Hn=class Hn{constructor(t){G(this,"decoder",dw);G(this,"shouldInlineParams",!1);this.queryChunks=t}append(t){return this.queryChunks.push(...t.queryChunks),this}toQuery(t){return Pr.startActiveSpan("drizzle.buildSQL",e=>{const i=this.buildQueryFromSourceParams(this.queryChunks,t);return e==null||e.setAttributes({"drizzle.query.text":i.sql,"drizzle.query.params":JSON.stringify(i.params)}),i})}buildQueryFromSourceParams(t,e){const i=Object.assign({},e,{inlineParams:e.inlineParams||this.shouldInlineParams,paramStartIndex:e.paramStartIndex||{value:0}}),{casing:n,escapeName:s,escapeParam:o,prepareTyping:a,inlineParams:l,paramStartIndex:u}=i;return CD(t.map(c=>{var h;if(lt(c,Xe))return{sql:c.value.join(""),params:[]};if(lt(c,jl))return{sql:s(c.value),params:[]};if(c===void 0)return{sql:"",params:[]};if(Array.isArray(c)){const p=[new Xe("(")];for(const[f,y]of c.entries())p.push(y),fr},pw={mapToDriverValue:r=>r};({...dw,...pw});var Km;Km=xt;class Wi{constructor(t,e=pw){G(this,"brand");this.value=t,this.encoder=e}getSQL(){return new Ft([this])}}G(Wi,Km,"Param");function X(r,...t){const e=[];(t.length>0||r.length>0&&r[0]!=="")&&e.push(new Xe(r[0]));for(const[i,n]of t.entries())e.push(n,new Xe(r[i+1]));return new Ft(e)}(r=>{function t(){return new Ft([])}r.empty=t;function e(l){return new Ft(l)}r.fromList=e;function i(l){return new Ft([new Xe(l)])}r.raw=i;function n(l,u){const c=[];for(const[h,p]of l.entries())h>0&&u!==void 0&&c.push(u),c.push(p);return new Ft(c)}r.join=n;function s(l){return new jl(l)}r.identifier=s;function o(l){return new ss(l)}r.placeholder=o;function a(l,u){return new Wi(l,u)}r.param=a})(X||(X={}));(r=>{var e;e=xt;const i=class i{constructor(s,o){G(this,"isSelectionField",!1);this.sql=s,this.fieldAlias=o}getSQL(){return this.sql}clone(){return new i(this.sql,this.fieldAlias)}};G(i,e,"SQL.Aliased");let t=i;r.Aliased=t})(Ft||(Ft={}));var Zm;Zm=xt;class ss{constructor(t){this.name=t}getSQL(){return new Ft([this])}}G(ss,Zm,"Placeholder");function Em(r,t){return r.map(e=>{if(lt(e,ss)){if(!(e.name in t))throw new Error(`No value for placeholder "${e.name}" was provided`);return t[e.name]}if(lt(e,Wi)&<(e.value,ss)){if(!(e.value.name in t))throw new Error(`No value for placeholder "${e.value.name}" was provided`);return e.encoder.mapToDriverValue(t[e.value.name])}return e})}const OD=Symbol.for("drizzle:IsDrizzleView");var Jm,ty,ey;ey=xt,ty=He,Jm=OD;class Sn{constructor({name:t,schema:e,selectedFields:i,query:n}){G(this,ty);G(this,Jm,!0);this[He]={name:t,originalName:t,schema:e,selectedFields:i,query:n,isExisting:!n,isAlias:!1}}getSQL(){return new Ft([this])}}G(Sn,ey,"View");Ke.prototype.getSQL=function(){return new Ft([this])};Tt.prototype.getSQL=function(){return new Ft([this])};Or.prototype.getSQL=function(){return new Ft([this])};var ry;ry=xt;class na{constructor(t){this.table=t}get(t,e){return e==="table"?this.table:t[e]}}G(na,ry,"ColumnAliasProxyHandler");var iy;iy=xt;class cu{constructor(t,e){this.alias=t,this.replaceOriginalName=e}get(t,e){if(e===Tt.Symbol.IsAlias)return!0;if(e===Tt.Symbol.Name)return this.alias;if(this.replaceOriginalName&&e===Tt.Symbol.OriginalName)return this.alias;if(e===He)return{...t[He],name:this.alias,isAlias:!0};if(e===Tt.Symbol.Columns){const n=t[Tt.Symbol.Columns];if(!n)return n;const s={};return Object.keys(n).map(o=>{s[o]=new Proxy(n[o],new na(new Proxy(t,this)))}),s}const i=t[e];return lt(i,Ke)?new Proxy(i,new na(new Proxy(t,this))):i}}G(cu,iy,"TableAliasProxyHandler");function ac(r,t){return new Proxy(r,new cu(t,!1))}function Li(r,t){return new Proxy(r,new na(new Proxy(r.table,new cu(t,!1))))}function mw(r,t){return new Ft.Aliased($l(r.sql,t),r.fieldAlias)}function $l(r,t){return X.join(r.queryChunks.map(e=>lt(e,Ke)?Li(e,t):lt(e,Ft)?$l(e,t):lt(e,Ft.Aliased)?mw(e,t):e))}var ny,sy;class $f extends(sy=Error,ny=xt,sy){constructor({message:t,cause:e}){super(t),this.name="DrizzleError",this.cause=e}}G($f,ny,"DrizzleError");var oy,ay;class yw extends(ay=$f,oy=xt,ay){constructor(){super({message:"Rollback"})}}G(yw,oy,"TransactionRollbackError");function yr(r,t){return AD(t)&&!fw(r)&&!lt(r,Wi)&&!lt(r,ss)&&!lt(r,Ke)&&!lt(r,Tt)&&!lt(r,Sn)?new Wi(r,t):r}const gw=(r,t)=>X`${r} = ${yr(t,r)}`,FD=(r,t)=>X`${r} <> ${yr(t,r)}`;function Eh(...r){const t=r.filter(e=>e!==void 0);if(t.length!==0)return t.length===1?new Ft(t):new Ft([new Xe("("),X.join(t,new Xe(" and ")),new Xe(")")])}function PD(...r){const t=r.filter(e=>e!==void 0);if(t.length!==0)return t.length===1?new Ft(t):new Ft([new Xe("("),X.join(t,new Xe(" or ")),new Xe(")")])}function MD(r){return X`not ${r}`}const DD=(r,t)=>X`${r} > ${yr(t,r)}`,RD=(r,t)=>X`${r} >= ${yr(t,r)}`,ND=(r,t)=>X`${r} < ${yr(t,r)}`,LD=(r,t)=>X`${r} <= ${yr(t,r)}`;function BD(r,t){return Array.isArray(t)?t.length===0?X`false`:X`${r} in ${t.map(e=>yr(e,r))}`:X`${r} in ${yr(t,r)}`}function kD(r,t){return Array.isArray(t)?t.length===0?X`true`:X`${r} not in ${t.map(e=>yr(e,r))}`:X`${r} not in ${yr(t,r)}`}function UD(r){return X`${r} is null`}function zD(r){return X`${r} is not null`}function jD(r){return X`exists ${r}`}function $D(r){return X`not exists ${r}`}function VD(r,t,e){return X`${r} between ${yr(t,r)} and ${yr(e,r)}`}function GD(r,t,e){return X`${r} not between ${yr(t,r)} and ${yr(e,r)}`}function WD(r,t){return X`${r} like ${t}`}function HD(r,t){return X`${r} not like ${t}`}function XD(r,t){return X`${r} ilike ${t}`}function YD(r,t){return X`${r} not ilike ${t}`}function qD(r){return X`${r} asc`}function QD(r){return X`${r} desc`}var ly;ly=xt;class vw{write(t){console.log(t)}}G(vw,ly,"ConsoleLogWriter");var uy;uy=xt;class _w{constructor(t){G(this,"writer");this.writer=(t==null?void 0:t.writer)??new vw}logQuery(t,e){const i=e.map(s=>{try{return JSON.stringify(s)}catch{return String(s)}}),n=i.length?` -- params: [${i.join(", ")}]`:"";this.writer.write(`Query: ${t}${n}`)}}G(_w,uy,"DefaultLogger");var cy;cy=xt;class bw{logQuery(){}}G(bw,cy,"NoopLogger");var hy,fy;fy=xt,hy=Symbol.toStringTag;class Tn{constructor(){G(this,hy,"QueryPromise")}catch(t){return this.then(void 0,t)}finally(t){return this.then(e=>(t==null||t(),e),e=>{throw t==null||t(),e})}then(t,e){return this.execute().then(t,e)}}G(Tn,fy,"QueryPromise");function os(r,t){return Object.entries(r).reduce((e,[i,n])=>{if(typeof i!="string")return e;const s=t?[...t,i]:[i];return lt(n,Ke)||lt(n,Ft)||lt(n,Ft.Aliased)?e.push({path:s,field:n}):lt(n,Tt)?e.push(...os(n[Tt.Symbol.Columns],s)):e.push(...os(n,s)),e},[])}function Vf(r,t){const e=Object.keys(r),i=Object.keys(t);if(e.length!==i.length)return!1;for(const[n,s]of e.entries())if(s!==i[n])return!1;return!0}function ww(r,t){const e=Object.entries(t).filter(([,i])=>i!==void 0).map(([i,n])=>lt(n,Ft)||lt(n,Ke)?[i,n]:[i,new Wi(n,r[Tt.Symbol.Columns][i])]);if(e.length===0)throw new Error("No values to set");return Object.fromEntries(e)}function KD(r,t){for(const e of t)for(const i of Object.getOwnPropertyNames(e.prototype))i!=="constructor"&&Object.defineProperty(r.prototype,i,Object.getOwnPropertyDescriptor(e.prototype,i)||Object.create(null))}function ZD(r){return r[Tt.Symbol.Columns]}function Wn(r){return lt(r,Or)?r._.alias:lt(r,Sn)?r[He].name:lt(r,Ft)?void 0:r[Tt.Symbol.IsAlias]?r[Tt.Symbol.Name]:r[Tt.Symbol.BaseName]}function JD(r){if(typeof r!="object"||r===null||r.constructor.name!=="Object")return!1;if("logger"in r){const t=typeof r.logger;return!(t!=="boolean"&&(t!=="object"||typeof r.logger.logQuery!="function")&&t!=="undefined")}if("schema"in r){const t=typeof r.schema;return!(t!=="object"&&t!=="undefined")}if("casing"in r){const t=typeof r.casing;return!(t!=="string"&&t!=="undefined")}if("mode"in r)return!(r.mode!=="default"||r.mode!=="planetscale"||r.mode!==void 0);if("connection"in r){const t=typeof r.connection;return!(t!=="string"&&t!=="object"&&t!=="undefined")}if("client"in r){const t=typeof r.client;return!(t!=="object"&&t!=="function"&&t!=="undefined")}return Object.keys(r).length===0}var dy,py;class xw extends(py=Ar,dy=xt,py){getSQLType(){return"date"}mapFromDriverValue(t){return new Date(t)}mapToDriverValue(t){return t.toISOString()}}G(xw,dy,"PgDate");var my,yy;class Sw extends(yy=Ar,my=xt,yy){getSQLType(){return"date"}}G(Sw,my,"PgDateString");var gy,vy;class Tw extends(vy=Ar,gy=xt,vy){constructor(t,e){super(t,e)}getSQLType(){return"json"}mapToDriverValue(t){return JSON.stringify(t)}mapFromDriverValue(t){if(typeof t=="string")try{return JSON.parse(t)}catch{return t}return t}}G(Tw,gy,"PgJson");var _y,by;class Iw extends(by=Ar,_y=xt,by){constructor(t,e){super(t,e)}getSQLType(){return"jsonb"}mapToDriverValue(t){return JSON.stringify(t)}mapFromDriverValue(t){if(typeof t=="string")try{return JSON.parse(t)}catch{return t}return t}}G(Iw,_y,"PgJsonb");var wy,xy;class Ew extends(xy=Ar,wy=xt,xy){constructor(e,i){super(e,i);G(this,"precision");G(this,"scale");this.precision=i.precision,this.scale=i.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})`}}G(Ew,wy,"PgNumeric");var Sy,Ty;class Cw extends(Ty=Ar,Sy=xt,Ty){constructor(e,i){super(e,i);G(this,"withTimezone");G(this,"precision");this.withTimezone=i.withTimezone,this.precision=i.precision}getSQLType(){return`time${this.precision===void 0?"":`(${this.precision})`}${this.withTimezone?" with time zone":""}`}}G(Cw,Sy,"PgTime");var Iy,Ey;class Aw extends(Ey=Ar,Iy=xt,Ey){constructor(e,i){super(e,i);G(this,"withTimezone");G(this,"precision");G(this,"mapFromDriverValue",e=>new Date(this.withTimezone?e:e+"+0000"));G(this,"mapToDriverValue",e=>e.toISOString());this.withTimezone=i.withTimezone,this.precision=i.precision}getSQLType(){return`timestamp${this.precision===void 0?"":` (${this.precision})`}${this.withTimezone?" with time zone":""}`}}G(Aw,Iy,"PgTimestamp");var Cy,Ay;class Ow extends(Ay=Ar,Cy=xt,Ay){constructor(e,i){super(e,i);G(this,"withTimezone");G(this,"precision");this.withTimezone=i.withTimezone,this.precision=i.precision}getSQLType(){return`timestamp${this.precision===void 0?"":`(${this.precision})`}${this.withTimezone?" with time zone":""}`}}G(Ow,Cy,"PgTimestampString");var Oy,Fy;class Fw extends(Fy=Ar,Oy=xt,Fy){getSQLType(){return"uuid"}}G(Fw,Oy,"PgUUID");const Cm=Symbol.for("drizzle:PgInlineForeignKeys"),Am=Symbol.for("drizzle:EnableRLS");var Py,My,Dy,Ry,Ny,Ly;class Br extends(Ly=Tt,Ny=xt,Ry=Cm,Dy=Am,My=Tt.Symbol.ExtraConfigBuilder,Py=Tt.Symbol.ExtraConfigColumns,Ly){constructor(){super(...arguments);G(this,Ry,[]);G(this,Dy,!1);G(this,My);G(this,Py,{})}}G(Br,Ny,"PgTable"),G(Br,"Symbol",Object.assign({},Tt.Symbol,{InlineForeignKeys:Cm,EnableRLS:Am}));var By;By=xt;class Pw{constructor(t,e){G(this,"columns");G(this,"name");this.columns=t,this.name=e}build(t){return new Mw(t,this.columns,this.name)}}G(Pw,By,"PgPrimaryKeyBuilder");var ky;ky=xt;class Mw{constructor(t,e,i){G(this,"columns");G(this,"name");this.table=t,this.columns=e,this.name=i}getName(){return this.name??`${this.table[Br.Symbol.Name]}_${this.columns.map(t=>t.name).join("_")}_pk`}}G(Mw,ky,"PgPrimaryKey");var Uy;Uy=xt;class Gf{constructor(t,e,i){G(this,"referencedTableName");G(this,"fieldName");this.sourceTable=t,this.referencedTable=e,this.relationName=i,this.referencedTableName=e[Tt.Symbol.Name]}}G(Gf,Uy,"Relation");var zy;zy=xt;class Dw{constructor(t,e){this.table=t,this.config=e}}G(Dw,zy,"Relations");var jy,$y;const Wl=class Wl extends($y=Gf,jy=xt,$y){constructor(t,e,i,n){super(t,e,i==null?void 0:i.relationName),this.config=i,this.isNullable=n}withFieldName(t){const e=new Wl(this.sourceTable,this.referencedTable,this.config,this.isNullable);return e.fieldName=t,e}};G(Wl,jy,"One");let as=Wl;var Vy,Gy;const Hl=class Hl extends(Gy=Gf,Vy=xt,Gy){constructor(t,e,i){super(t,e,i==null?void 0:i.relationName),this.config=i}withFieldName(t){const e=new Hl(this.sourceTable,this.referencedTable,this.config);return e.fieldName=t,e}};G(Hl,Vy,"Many");let Vl=Hl;function tR(){return{and:Eh,between:VD,eq:gw,exists:jD,gt:DD,gte:RD,ilike:XD,inArray:BD,isNull:UD,isNotNull:zD,like:WD,lt:ND,lte:LD,ne:FD,not:MD,notBetween:GD,notExists:$D,notLike:HD,notIlike:YD,notInArray:kD,or:PD,sql:X}}function eR(){return{sql:X,asc:qD,desc:QD}}function rR(r,t){var s;Object.keys(r).length===1&&"default"in r&&!lt(r.default,Tt)&&(r=r.default);const e={},i={},n={};for(const[o,a]of Object.entries(r))if(lt(a,Tt)){const l=ia(a),u=i[l];e[l]=o,n[o]={tsName:o,dbName:a[Tt.Symbol.Name],schema:a[Tt.Symbol.Schema],columns:a[Tt.Symbol.Columns],relations:(u==null?void 0:u.relations)??{},primaryKey:(u==null?void 0:u.primaryKey)??[]};for(const h of Object.values(a[Tt.Symbol.Columns]))h.primary&&n[o].primaryKey.push(h);const c=(s=a[Tt.Symbol.ExtraConfigBuilder])==null?void 0:s.call(a,a[Tt.Symbol.ExtraConfigColumns]);if(c)for(const h of Object.values(c))lt(h,Pw)&&n[o].primaryKey.push(...h.columns)}else if(lt(a,Dw)){const l=ia(a.table),u=e[l],c=a.config(t(a.table));let h;for(const[p,f]of Object.entries(c))if(u){const y=n[u];y.relations[p]=f}else l in i||(i[l]={relations:{},primaryKey:h}),i[l].relations[p]=f}return{tables:n,tableNamesMap:e}}function iR(r){return function(e,i){return new as(r,e,i,(i==null?void 0:i.fields.reduce((n,s)=>n&&s.notNull,!0))??!1)}}function nR(r){return function(e,i){return new Vl(r,e,i)}}function sR(r,t,e){if(lt(e,as)&&e.config)return{fields:e.config.fields,references:e.config.references};const i=t[ia(e.referencedTable)];if(!i)throw new Error(`Table "${e.referencedTable[Tt.Symbol.Name]}" not found in schema`);const n=r[i];if(!n)throw new Error(`Table "${i}" not found in schema`);const s=e.sourceTable,o=t[ia(s)];if(!o)throw new Error(`Table "${s[Tt.Symbol.Name]}" not found in schema`);const a=[];for(const l of Object.values(n.relations))(e.relationName&&e!==l&&l.relationName===e.relationName||!e.relationName&&l.referencedTable===e.sourceTable)&&a.push(l);if(a.length>1)throw e.relationName?new Error(`There are multiple relations with name "${e.relationName}" in table "${i}"`):new Error(`There are multiple relations between "${i}" and "${e.sourceTable[Tt.Symbol.Name]}". Please specify relation name`);if(a[0]&<(a[0],as)&&a[0].config)return{fields:a[0].config.references,references:a[0].config.fields};throw new Error(`There is not enough information to infer relation "${o}.${e.fieldName}"`)}function oR(r){return{one:iR(r),many:nR(r)}}function Ch(r,t,e,i,n=s=>s){const s={};for(const[o,a]of i.entries())if(a.isJson){const l=t.relations[a.tsKey],u=e[o],c=typeof u=="string"?JSON.parse(u):u;s[a.tsKey]=lt(l,as)?c&&Ch(r,r[a.relationTableTsKey],c,a.selection,n):c.map(h=>Ch(r,r[a.relationTableTsKey],h,a.selection,n))}else{const l=n(e[o]),u=a.field;let c;lt(u,Ke)?c=u:lt(u,Ft)?c=u.decoder:c=u.sql.decoder,s[a.tsKey]=l===null?null:c.mapFromDriverValue(l)}return s}var Wy;Wy=xt;const Xl=class Xl{constructor(t){G(this,"config");this.config={...t}}get(t,e){if(e==="_")return{...t._,selectedFields:new Proxy(t._.selectedFields,this)};if(e===He)return{...t[He],selectedFields:new Proxy(t[He].selectedFields,this)};if(typeof e=="symbol")return t[e];const n=(lt(t,Or)?t._.selectedFields:lt(t,Sn)?t[He].selectedFields:t)[e];if(lt(n,Ft.Aliased)){if(this.config.sqlAliasedBehavior==="sql"&&!n.isSelectionField)return n.sql;const s=n.clone();return s.isSelectionField=!0,s}if(lt(n,Ft)){if(this.config.sqlBehavior==="sql")return n;throw new Error(`You tried to reference "${e}" 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 lt(n,Ke)?this.config.alias?new Proxy(n,new na(new Proxy(n.table,new cu(this.config.alias,this.config.replaceOriginalName??!1)))):n:typeof n!="object"||n===null?n:new Proxy(n,new Xl(this.config))}};G(Xl,Wy,"SelectionProxyHandler");let Je=Xl;var Hy,Xy;class Ah extends(Xy=Tn,Hy=xt,Xy){constructor(e,i,n,s){super();G(this,"config");G(this,"authToken");G(this,"execute",e=>Pr.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e,this.authToken)));this.session=i,this.dialect=n,this.config={table:e,withList:s}}where(e){return this.config.where=e,this}returning(e=this.config.table[Tt.Symbol.Columns]){return this.config.returningFields=e,this.config.returning=os(e),this}getSQL(){return this.dialect.buildDeleteQuery(this.config)}toSQL(){const{typings:e,...i}=this.dialect.sqlToQuery(this.getSQL());return i}_prepare(e){return Pr.startActiveSpan("drizzle.prepareQuery",()=>this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,e,!0))}prepare(e){return this._prepare(e)}setToken(e){return this.authToken=e,this}getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new Je({alias:qn(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}}G(Ah,Hy,"PgDelete");function aR(r){return(r.replace(/['\u2019]/g,"").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).map(e=>e.toLowerCase()).join("_")}function lR(r){return(r.replace(/['\u2019]/g,"").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).reduce((e,i,n)=>{const s=n===0?i.toLowerCase():`${i[0].toUpperCase()}${i.slice(1)}`;return e+s},"")}function uR(r){return r}var Yy;Yy=xt;class Rw{constructor(t){G(this,"cache",{});G(this,"cachedTables",{});G(this,"convert");this.convert=t==="snake_case"?aR:t==="camelCase"?lR:uR}getColumnCasing(t){if(!t.keyAsName)return t.name;const e=t.table[Tt.Symbol.Schema]??"public",i=t.table[Tt.Symbol.OriginalName],n=`${e}.${i}.${t.name}`;return this.cache[n]||this.cacheTable(t.table),this.cache[n]}cacheTable(t){const e=t[Tt.Symbol.Schema]??"public",i=t[Tt.Symbol.OriginalName],n=`${e}.${i}`;if(!this.cachedTables[n]){for(const s of Object.values(t[Tt.Symbol.Columns])){const o=`${n}.${s.name}`;this.cache[o]=this.convert(s.name)}this.cachedTables[n]=!0}}clearCache(){this.cache={},this.cachedTables={}}}G(Rw,Yy,"CasingCache");var qy,Qy;class Wf extends(Qy=Sn,qy=xt,Qy){}G(Wf,qy,"PgViewBase");var Ky;Ky=xt;class Bo{constructor(t){G(this,"casing");this.casing=new Rw(t==null?void 0:t.casing)}async migrate(t,e,i){const n=typeof i=="string"?"__drizzle_migrations":i.migrationsTable??"__drizzle_migrations",s=typeof i=="string"?"drizzle":i.migrationsSchema??"drizzle",o=X` +]`}concat(...t){const e=this.schema,i=this.data.concat(t.flatMap(({data:n})=>n));return new $n(e,i.map(n=>new fr(e,n)))}slice(t,e){const i=this.schema;[t,e]=Y_({length:this.numRows},t,e);const n=Z_(this.data,this._offsets,t,e);return new $n(i,n.map(s=>new fr(i,s)))}getChild(t){return this.getChildAt(this.schema.fields.findIndex(e=>e.name===t))}getChildAt(t){if(t>-1&&ti.children[t]);if(e.length===0){const{type:i}=this.schema.fields[t],n=se({type:i,length:0,nullCount:0});e.push(n._changeLengthAndBackfillNullBitmap(this.numRows))}return new Me(e)}return null}setChild(t,e){var i;return this.setChildAt((i=this.schema.fields)===null||i===void 0?void 0:i.findIndex(n=>n.name===t),e)}setChildAt(t,e){let i=this.schema,n=[...this.batches];if(t>-1&&tthis.getChildAt(u));[s[t],a[t]]=[o,e],[i,n]=qu(i,a)}return new $n(i,n)}select(t){const e=this.schema.fields.reduce((i,n,s)=>i.set(n.name,s),new Map);return this.selectAt(t.map(i=>e.get(i)).filter(i=>i>-1))}selectAt(t){const e=this.schema.selectAt(t),i=this.batches.map(n=>n.selectAt(t));return new $n(e,i)}assign(t){const e=this.schema.fields,[i,n]=t.schema.fields.reduce((a,l,u)=>{const[c,h]=a,p=e.findIndex(f=>f.name===l.name);return~p?h[p]=u:c.push(u),a},[[],[]]),s=this.schema.assign(t.schema),o=[...e.map((a,l)=>[l,n[l]]).map(([a,l])=>l===void 0?this.getChildAt(a):t.getChildAt(l)),...i.map(a=>t.getChildAt(a))].filter(Boolean);return new $n(...qu(s,o))}};l0=Symbol.toStringTag;gn[l0]=(r=>(r.schema=null,r.batches=[],r._offsets=new Uint32Array([0]),r._nullCount=-1,r[Symbol.isConcatSpreadable]=!0,r.isValid=Ol(hf),r.get=Ol(mr.getVisitFn(L.Struct)),r.set=J_(Xr.getVisitFn(L.Struct)),r.indexOf=t0(Fl.getVisitFn(L.Struct)),"Table"))(gn.prototype);var u0;let fr=class Po{constructor(...t){switch(t.length){case 2:{if([this.schema]=t,!(this.schema instanceof Pe))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=se({nullCount:0,type:new sr(this.schema.fields),children:this.schema.fields.map(e=>se({type:e.type,nullCount:0}))})]=t,!(this.data instanceof Se))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=Op(this.schema,this.data.children);break}case 1:{const[e]=t,{fields:i,children:n,length:s}=Object.keys(e).reduce((l,u,c)=>(l.children[c]=e[u],l.length=Math.max(l.length,e[u].length),l.fields[c]=Ce.new({name:u,type:e[u].type,nullable:!0}),l),{length:0,fields:new Array,children:new Array}),o=new Pe(i),a=se({type:new sr(i),length:s,children:n,nullCount:0});[this.schema,this.data]=Op(o,a.children,s);break}default:throw new TypeError("RecordBatch constructor expects an Object mapping names to child Data, or a [Schema, Data] pair.")}}get dictionaries(){return this._dictionaries||(this._dictionaries=c0(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(t){return this.data.getValid(t)}get(t){return mr.visit(this.data,t)}at(t){return this.get(lf(t,this.numRows))}set(t,e){return Xr.visit(this.data,t,e)}indexOf(t,e){return Fl.visit(this.data,t,e)}[Symbol.iterator](){return ff.visit(new Me([this.data]))}toArray(){return[...this]}concat(...t){return new gn(this.schema,[this,...t])}slice(t,e){const[i]=new Me([this.data]).slice(t,e).data;return new Po(this.schema,i)}getChild(t){var e;return this.getChildAt((e=this.schema.fields)===null||e===void 0?void 0:e.findIndex(i=>i.name===t))}getChildAt(t){return t>-1&&tn.name===t),e)}setChildAt(t,e){let i=this.schema,n=this.data;if(t>-1&&ta.name===s);~o&&(n[o]=this.data.children[o])}return new Po(e,se({type:i,length:this.numRows,children:n}))}selectAt(t){const e=this.schema.selectAt(t),i=t.map(s=>this.data.children[s]).filter(Boolean),n=se({type:new sr(e.fields),length:this.numRows,children:i});return new Po(e,n)}};u0=Symbol.toStringTag;fr[u0]=(r=>(r._nullCount=-1,r[Symbol.isConcatSpreadable]=!0,"RecordBatch"))(fr.prototype);function Op(r,t,e=t.reduce((i,n)=>Math.max(i,n.length),0)){var i;const n=[...r.fields],s=[...t],o=(e+63&-64)>>3;for(const[a,l]of r.fields.entries()){const u=t[a];(!u||u.length!==e)&&(n[a]=l.clone({nullable:!0}),s[a]=(i=u==null?void 0:u._changeLengthAndBackfillNullBitmap(e))!==null&&i!==void 0?i:se({type:l.type,length:e,nullCount:e,nullBitmap:new Uint8Array(o)}))}return[r.assign(n),se({type:new sr(n),length:e,children:s})]}function c0(r,t,e=new Map){var i,n;if(((i=r==null?void 0:r.length)!==null&&i!==void 0?i:0)>0&&(r==null?void 0:r.length)===(t==null?void 0:t.length))for(let s=-1,o=r.length;++sse({type:n.type})),i=se({type:new sr(t.fields),nullCount:0,children:e});super(t,i)}}let en=class ai{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsMessage(t,e){return(e||new ai).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMessage(t,e){return t.setPosition(t.position()+me),(e||new ai).__init(t.readInt32(t.position())+t.position(),t)}version(){const t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt16(this.bb_pos+t):ke.V1}headerType(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):fe.NONE}header(t){const e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__union(t,this.bb_pos+e):null}bodyLength(){const t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt64(this.bb_pos+t):BigInt("0")}customMetadata(t,e){const i=this.bb.__offset(this.bb_pos,12);return i?(e||new We).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+t*4),this.bb):null}customMetadataLength(){const t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}static startMessage(t){t.startObject(5)}static addVersion(t,e){t.addFieldInt16(0,e,ke.V1)}static addHeaderType(t,e){t.addFieldInt8(1,e,fe.NONE)}static addHeader(t,e){t.addFieldOffset(2,e,0)}static addBodyLength(t,e){t.addFieldInt64(3,e,BigInt("0"))}static addCustomMetadata(t,e){t.addFieldOffset(4,e,0)}static createCustomMetadataVector(t,e){t.startVector(4,e.length,4);for(let i=e.length-1;i>=0;i--)t.addOffset(e[i]);return t.endVector()}static startCustomMetadataVector(t,e){t.startVector(4,e,4)}static endMessage(t){return t.endObject()}static finishMessageBuffer(t,e){t.finish(e)}static finishSizePrefixedMessageBuffer(t,e){t.finish(e,void 0,!0)}static createMessage(t,e,i,n,s,o){return ai.startMessage(t),ai.addVersion(t,e),ai.addHeaderType(t,i),ai.addHeader(t,n),ai.addBodyLength(t,s),ai.addCustomMetadata(t,o),ai.endMessage(t)}};class hO extends ie{visit(t,e){return t==null||e==null?void 0:super.visit(t,e)}visitNull(t,e){return _p.startNull(e),_p.endNull(e)}visitInt(t,e){return xr.startInt(e),xr.addBitWidth(e,t.bitWidth),xr.addIsSigned(e,t.isSigned),xr.endInt(e)}visitFloat(t,e){return mi.startFloatingPoint(e),mi.addPrecision(e,t.precision),mi.endFloatingPoint(e)}visitBinary(t,e){return pp.startBinary(e),pp.endBinary(e)}visitLargeBinary(t,e){return yp.startLargeBinary(e),yp.endLargeBinary(e)}visitBool(t,e){return mp.startBool(e),mp.endBool(e)}visitUtf8(t,e){return bp.startUtf8(e),bp.endUtf8(e)}visitLargeUtf8(t,e){return gp.startLargeUtf8(e),gp.endLargeUtf8(e)}visitDecimal(t,e){return Ss.startDecimal(e),Ss.addScale(e,t.scale),Ss.addPrecision(e,t.precision),Ss.addBitWidth(e,t.bitWidth),Ss.endDecimal(e)}visitDate(t,e){return Ua.startDate(e),Ua.addUnit(e,t.unit),Ua.endDate(e)}visitTime(t,e){return zr.startTime(e),zr.addUnit(e,t.unit),zr.addBitWidth(e,t.bitWidth),zr.endTime(e)}visitTimestamp(t,e){const i=t.timezone&&e.createString(t.timezone)||void 0;return jr.startTimestamp(e),jr.addUnit(e,t.unit),i!==void 0&&jr.addTimezone(e,i),jr.endTimestamp(e)}visitInterval(t,e){return yi.startInterval(e),yi.addUnit(e,t.unit),yi.endInterval(e)}visitDuration(t,e){return za.startDuration(e),za.addUnit(e,t.unit),za.endDuration(e)}visitList(t,e){return vp.startList(e),vp.endList(e)}visitStruct(t,e){return Yn.startStruct_(e),Yn.endStruct_(e)}visitUnion(t,e){hr.startTypeIdsVector(e,t.typeIds.length);const i=hr.createTypeIdsVector(e,t.typeIds);return hr.startUnion(e),hr.addMode(e,t.mode),hr.addTypeIds(e,i),hr.endUnion(e)}visitDictionary(t,e){const i=this.visit(t.indices,e);return $i.startDictionaryEncoding(e),$i.addId(e,BigInt(t.id)),$i.addIsOrdered(e,t.isOrdered),i!==void 0&&$i.addIndexType(e,i),$i.endDictionaryEncoding(e)}visitFixedSizeBinary(t,e){return ja.startFixedSizeBinary(e),ja.addByteWidth(e,t.byteWidth),ja.endFixedSizeBinary(e)}visitFixedSizeList(t,e){return $a.startFixedSizeList(e),$a.addListSize(e,t.listSize),$a.endFixedSizeList(e)}visitMap(t,e){return Va.startMap(e),Va.addKeysSorted(e,t.keysSorted),Va.endMap(e)}}const Qu=new hO;function fO(r,t=new Map){return new Pe(pO(r,t),Ha(r.metadata),t)}function h0(r){return new Fr(r.count,f0(r.columns),d0(r.columns))}function dO(r){return new Ti(h0(r.data),r.id,r.isDelta)}function pO(r,t){return(r.fields||[]).filter(Boolean).map(e=>Ce.fromJSON(e,t))}function Fp(r,t){return(r.children||[]).filter(Boolean).map(e=>Ce.fromJSON(e,t))}function f0(r){return(r||[]).reduce((t,e)=>[...t,new vn(e.count,mO(e.VALIDITY)),...f0(e.children)],[])}function d0(r,t=[]){for(let e=-1,i=(r||[]).length;++et+ +(e===0),0)}function yO(r,t){let e,i,n,s,o,a;return!t||!(s=r.dictionary)?(o=Mp(r,Fp(r,t)),n=new Ce(r.name,o,r.nullable,Ha(r.metadata))):t.has(e=s.id)?(i=(i=s.indexType)?Pp(i):new Qo,a=new Zs(t.get(e),i,e,s.isOrdered),n=new Ce(r.name,a,r.nullable,Ha(r.metadata))):(i=(i=s.indexType)?Pp(i):new Qo,t.set(e,o=Mp(r,Fp(r,t))),a=new Zs(o,i,e,s.isOrdered),n=new Ce(r.name,a,r.nullable,Ha(r.metadata))),n||null}function Ha(r=[]){return new Map(r.map(({key:t,value:e})=>[t,e]))}function Pp(r){return new is(r.isSigned,r.bitWidth)}function Mp(r,t){const e=r.type.name;switch(e){case"NONE":return new pn;case"null":return new pn;case"binary":return new hl;case"largebinary":return new fl;case"utf8":return new dl;case"largeutf8":return new pl;case"bool":return new ml;case"list":return new xl((t||[])[0]);case"struct":return new sr(t||[]);case"struct_":return new sr(t||[])}switch(e){case"int":{const i=r.type;return new is(i.isSigned,i.bitWidth)}case"floatingpoint":{const i=r.type;return new cl(tr[i.precision])}case"decimal":{const i=r.type;return new yl(i.scale,i.precision,i.bitWidth)}case"date":{const i=r.type;return new gl(Hr[i.unit])}case"time":{const i=r.type;return new vl(zt[i.unit],i.bitWidth)}case"timestamp":{const i=r.type;return new _l(zt[i.unit],i.timezone)}case"interval":{const i=r.type;return new bl(Si[i.unit])}case"duration":{const i=r.type;return new wl(zt[i.unit])}case"union":{const i=r.type,[n,...s]=(i.mode+"").toLowerCase(),o=n.toUpperCase()+s.join("");return new Sl(er[o],i.typeIds||[],t||[])}case"fixedsizebinary":{const i=r.type;return new Tl(i.byteWidth)}case"fixedsizelist":{const i=r.type;return new Il(i.listSize,(t||[])[0])}case"map":{const i=r.type;return new El((t||[])[0],i.keysSorted)}}throw new Error(`Unrecognized type: "${e}"`)}var gO=Cv,vO=Qs;class or{static fromJSON(t,e){const i=new or(0,ke.V5,e);return i._createHeader=_O(t,e),i}static decode(t){t=new vO(ae(t));const e=en.getRootAsMessage(t),i=e.bodyLength(),n=e.version(),s=e.headerType(),o=new or(i,n,s);return o._createHeader=bO(e,s),o}static encode(t){const e=new gO;let i=-1;return t.isSchema()?i=Pe.encode(e,t.header()):t.isRecordBatch()?i=Fr.encode(e,t.header()):t.isDictionaryBatch()&&(i=Ti.encode(e,t.header())),en.startMessage(e),en.addVersion(e,ke.V5),en.addHeader(e,i),en.addHeaderType(e,t.headerType),en.addBodyLength(e,BigInt(t.bodyLength)),en.finishMessageBuffer(e,en.endMessage(e)),e.asUint8Array()}static from(t,e=0){if(t instanceof Pe)return new or(0,ke.V5,fe.Schema,t);if(t instanceof Fr)return new or(e,ke.V5,fe.RecordBatch,t);if(t instanceof Ti)return new or(e,ke.V5,fe.DictionaryBatch,t);throw new 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===fe.Schema}isRecordBatch(){return this.headerType===fe.RecordBatch}isDictionaryBatch(){return this.headerType===fe.DictionaryBatch}constructor(t,e,i,n){this._version=e,this._headerType=i,this.body=new Uint8Array(0),n&&(this._createHeader=()=>n),this._bodyLength=we(t)}}class Fr{get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}constructor(t,e,i){this._nodes=e,this._buffers=i,this._length=we(t)}}class Ti{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(t,e,i=!1){this._data=t,this._isDelta=i,this._id=we(e)}}class vi{constructor(t,e){this.offset=we(t),this.length=we(e)}}class vn{constructor(t,e){this.length=we(t),this.nullCount=we(e)}}function _O(r,t){return()=>{switch(t){case fe.Schema:return Pe.fromJSON(r);case fe.RecordBatch:return Fr.fromJSON(r);case fe.DictionaryBatch:return Ti.fromJSON(r)}throw new Error(`Unrecognized Message type: { name: ${fe[t]}, type: ${t} }`)}}function bO(r,t){return()=>{switch(t){case fe.Schema:return Pe.decode(r.header(new ui),new Map,r.version());case fe.RecordBatch:return Fr.decode(r.header(new Bi),r.version());case fe.DictionaryBatch:return Ti.decode(r.header(new ws),r.version())}throw new Error(`Unrecognized Message type: { name: ${fe[t]}, type: ${t} }`)}}Ce.encode=PO;Ce.decode=OO;Ce.fromJSON=yO;Pe.encode=FO;Pe.decode=wO;Pe.fromJSON=fO;Fr.encode=MO;Fr.decode=xO;Fr.fromJSON=h0;Ti.encode=DO;Ti.decode=SO;Ti.fromJSON=dO;vn.encode=RO;vn.decode=IO;vi.encode=NO;vi.decode=TO;function wO(r,t=new Map,e=ke.V5){const i=AO(r,t);return new Pe(i,Xa(r),t,e)}function xO(r,t=ke.V5){if(r.compression()!==null)throw new Error("Record batch compression not implemented");return new Fr(r.length(),EO(r),CO(r,t))}function SO(r,t=ke.V5){return new Ti(Fr.decode(r.data(),t),r.id(),r.isDelta())}function TO(r){return new vi(r.offset(),r.length())}function IO(r){return new vn(r.length(),r.nullCount())}function EO(r){const t=[];for(let e,i=-1,n=-1,s=r.nodesLength();++iCe.encode(r,s));ui.startFieldsVector(r,e.length);const i=ui.createFieldsVector(r,e),n=t.metadata&&t.metadata.size>0?ui.createCustomMetadataVector(r,[...t.metadata].map(([s,o])=>{const a=r.createString(`${s}`),l=r.createString(`${o}`);return We.startKeyValue(r),We.addKey(r,a),We.addValue(r,l),We.endKeyValue(r)})):-1;return ui.startSchema(r),ui.addFields(r,i),ui.addEndianness(r,LO?Ks.Little:Ks.Big),n!==-1&&ui.addCustomMetadata(r,n),ui.endSchema(r)}function PO(r,t){let e=-1,i=-1,n=-1;const s=t.type;let o=t.typeId;At.isDictionary(s)?(o=s.dictionary.typeId,n=Qu.visit(s,r),i=Qu.visit(s.dictionary,r)):i=Qu.visit(s,r);const a=(s.children||[]).map(c=>Ce.encode(r,c)),l=Nr.createChildrenVector(r,a),u=t.metadata&&t.metadata.size>0?Nr.createCustomMetadataVector(r,[...t.metadata].map(([c,h])=>{const p=r.createString(`${c}`),f=r.createString(`${h}`);return We.startKeyValue(r),We.addKey(r,p),We.addValue(r,f),We.endKeyValue(r)})):-1;return t.name&&(e=r.createString(t.name)),Nr.startField(r),Nr.addType(r,i),Nr.addTypeType(r,o),Nr.addChildren(r,l),Nr.addNullable(r,!!t.nullable),e!==-1&&Nr.addName(r,e),n!==-1&&Nr.addDictionary(r,n),u!==-1&&Nr.addCustomMetadata(r,u),Nr.endField(r)}function MO(r,t){const e=t.nodes||[],i=t.buffers||[];Bi.startNodesVector(r,e.length);for(const o of e.slice().reverse())vn.encode(r,o);const n=r.endVector();Bi.startBuffersVector(r,i.length);for(const o of i.slice().reverse())vi.encode(r,o);const s=r.endVector();return Bi.startRecordBatch(r),Bi.addLength(r,BigInt(t.length)),Bi.addNodes(r,n),Bi.addBuffers(r,s),Bi.endRecordBatch(r)}function DO(r,t){const e=Fr.encode(r,t.data);return ws.startDictionaryBatch(r),ws.addId(r,BigInt(t.id)),ws.addIsDelta(r,t.isDelta),ws.addData(r,e),ws.endDictionaryBatch(r)}function RO(r,t){return Fv.createFieldNode(r,BigInt(t.length),BigInt(t.nullCount))}function NO(r,t){return Ov.createBuffer(r,BigInt(t.offset),BigInt(t.length))}const LO=(()=>{const r=new ArrayBuffer(2);return new DataView(r).setInt16(0,256,!0),new Int16Array(r)[0]===256})(),_f=r=>`Expected ${fe[r]} Message in stream, but was null or length 0.`,bf=r=>`Header pointer of flatbuffer-encoded ${fe[r]} Message is null or length 0.`,p0=(r,t)=>`Expected to read ${r} metadata bytes, but only read ${t}.`,m0=(r,t)=>`Expected to read ${r} bytes for message body, but only read ${t}.`;class y0{constructor(t){this.source=t instanceof Pl?t:new Pl(t)}[Symbol.iterator](){return this}next(){let t;return(t=this.readMetadataLength()).done||t.value===-1&&(t=this.readMetadataLength()).done||(t=this.readMetadata(t.value)).done?De:t}throw(t){return this.source.throw(t)}return(t){return this.source.return(t)}readMessage(t){let e;if((e=this.next()).done)return null;if(t!=null&&e.value.headerType!==t)throw new Error(_f(t));return e.value}readMessageBody(t){if(t<=0)return new Uint8Array(0);const e=ae(this.source.read(t));if(e.byteLength[...n,...s.VALIDITY&&[s.VALIDITY]||[],...s.TYPE_ID&&[s.TYPE_ID]||[],...s.OFFSET&&[s.OFFSET]||[],...s.DATA&&[s.DATA]||[],...e(s.children)],[])}}readMessage(t){let e;if((e=this.next()).done)return null;if(t!=null&&e.value.headerType!==t)throw new Error(_f(t));return e.value}readSchema(){const t=fe.Schema,e=this.readMessage(t),i=e==null?void 0:e.header();if(!e||!i)throw new Error(bf(t));return i}}const iu=4,ph="ARROW1",Zo=new Uint8Array(ph.length);for(let r=0;rthis):this}readRecordBatch(t){return this._impl.isFile()?this._impl.readRecordBatch(t):null}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}toDOMStream(){return kr.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return kr.toNodeStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this},{objectMode:!0})}static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t,e){throw new Error('"throughDOM" not available in this environment')}static from(t){return t instanceof Vr?t:rh(t)?VO(t):wv(t)?HO(t):rs(t)?Zt(this,void 0,void 0,function*(){return yield Vr.from(yield t)}):xv(t)||rf(t)||Sv(t)||no(t)?WO(new Js(t)):GO(new Pl(t))}static readAll(t){return t instanceof Vr?t.isSync()?Lp(t):Bp(t):rh(t)||ArrayBuffer.isView(t)||oa(t)||bv(t)?Lp(t):Bp(t)}}class Dl extends Vr{constructor(t){super(t),this._impl=t}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return dr(this,arguments,function*(){yield Pt(yield*ts(bi(this[Symbol.iterator]())))})}}class Rl extends Vr{constructor(t){super(t),this._impl=t}readAll(){return Zt(this,void 0,void 0,function*(){var t,e,i,n;const s=new Array;try{for(var o=!0,a=bi(this),l;l=yield a.next(),t=l.done,!t;o=!0){n=l.value,o=!1;const u=n;s.push(u)}}catch(u){e={error:u}}finally{try{!o&&!t&&(i=a.return)&&(yield i.call(a))}finally{if(e)throw e.error}}return s})}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}}class v0 extends Dl{constructor(t){super(t),this._impl=t}}class zO extends Rl{constructor(t){super(t),this._impl=t}}class _0{get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}constructor(t=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=t}isSync(){return!1}isAsync(){return!1}isFile(){return!1}isStream(){return!1}reset(t){return this._dictionaryIndex=0,this._recordBatchIndex=0,this.schema=t,this.dictionaries=new Map,this}_loadRecordBatch(t,e){const i=this._loadVectors(t,e,this.schema.fields),n=se({type:new sr(this.schema.fields),length:t.length,children:i});return new fr(this.schema,n)}_loadDictionaryBatch(t,e){const{id:i,isDelta:n}=t,{dictionaries:s,schema:o}=this,a=s.get(i),l=o.dictionaries.get(i),u=this._loadVectors(t.data,e,[l]);return(a&&n?a.concat(new Me(u)):new Me(u)).memoize()}_loadVectors(t,e,i){return new a0(e,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(i)}}class Nl extends _0{constructor(t,e){super(e),this._reader=rh(t)?new kO(this._handle=t):new y0(this._handle=t)}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(t){return this.closed||(this.autoDestroy=w0(this,t),this.schema||(this.schema=this._reader.readSchema())||this.cancel()),this}throw(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.throw(t):De}return(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(t):De}next(){if(this.closed)return De;let t;const{_reader:e}=this;for(;t=this._readNextMessageAndValidate();)if(t.isSchema())this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;const i=t.header(),n=e.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(i,n)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;const i=t.header(),n=e.readMessageBody(t.bodyLength),s=this._loadDictionaryBatch(i,n);this.dictionaries.set(i.id,s)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new vf(this.schema)}):this.return()}_readNextMessageAndValidate(t){return this._reader.readMessage(t)}}class Ll extends _0{constructor(t,e){super(e),this._reader=new BO(this._handle=t)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return Zt(this,void 0,void 0,function*(){!this.closed&&(this.closed=!0)&&(yield this.reset()._reader.return(),this._reader=null,this.dictionaries=null)})}open(t){return Zt(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=w0(this,t),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(t){return Zt(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(t):De})}return(t){return Zt(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(t):De})}next(){return Zt(this,void 0,void 0,function*(){if(this.closed)return De;let t;const{_reader:e}=this;for(;t=yield this._readNextMessageAndValidate();)if(t.isSchema())yield this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;const i=t.header(),n=yield e.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(i,n)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;const i=t.header(),n=yield e.readMessageBody(t.bodyLength),s=this._loadDictionaryBatch(i,n);this.dictionaries.set(i.id,s)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new vf(this.schema)}):yield this.return()})}_readNextMessageAndValidate(t){return Zt(this,void 0,void 0,function*(){return yield this._reader.readMessage(t)})}}class b0 extends Nl{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(t,e){super(t instanceof Ap?t:new Ap(t),e)}isSync(){return!0}isFile(){return!0}open(t){if(!this.closed&&!this._footer){this.schema=(this._footer=this._readFooter()).schema;for(const e of this._footer.dictionaryBatches())e&&this._readDictionaryBatch(this._dictionaryIndex++)}return super.open(t)}readRecordBatch(t){var e;if(this.closed)return null;this._footer||this.open();const i=(e=this._footer)===null||e===void 0?void 0:e.getRecordBatch(t);if(i&&this._handle.seek(i.offset)){const n=this._reader.readMessage(fe.RecordBatch);if(n!=null&&n.isRecordBatch()){const s=n.header(),o=this._reader.readMessageBody(n.bodyLength);return this._loadRecordBatch(s,o)}}return null}_readDictionaryBatch(t){var e;const i=(e=this._footer)===null||e===void 0?void 0:e.getDictionaryBatch(t);if(i&&this._handle.seek(i.offset)){const n=this._reader.readMessage(fe.DictionaryBatch);if(n!=null&&n.isDictionaryBatch()){const s=n.header(),o=this._reader.readMessageBody(n.bodyLength),a=this._loadDictionaryBatch(s,o);this.dictionaries.set(s.id,a)}}}_readFooter(){const{_handle:t}=this,e=t.size-g0,i=t.readInt32(e),n=t.readAt(e-i,i);return Ko.decode(n)}_readNextMessageAndValidate(t){var e;if(this._footer||this.open(),this._footer&&this._recordBatchIndexsuper.open}});return Zt(this,void 0,void 0,function*(){if(!this.closed&&!this._footer){this.schema=(this._footer=yield this._readFooter()).schema;for(const i of this._footer.dictionaryBatches())i&&(yield this._readDictionaryBatch(this._dictionaryIndex++))}return yield e.open.call(this,t)})}readRecordBatch(t){return Zt(this,void 0,void 0,function*(){var e;if(this.closed)return null;this._footer||(yield this.open());const i=(e=this._footer)===null||e===void 0?void 0:e.getRecordBatch(t);if(i&&(yield this._handle.seek(i.offset))){const n=yield this._reader.readMessage(fe.RecordBatch);if(n!=null&&n.isRecordBatch()){const s=n.header(),o=yield this._reader.readMessageBody(n.bodyLength);return this._loadRecordBatch(s,o)}}return null})}_readDictionaryBatch(t){return Zt(this,void 0,void 0,function*(){var e;const i=(e=this._footer)===null||e===void 0?void 0:e.getDictionaryBatch(t);if(i&&(yield this._handle.seek(i.offset))){const n=yield this._reader.readMessage(fe.DictionaryBatch);if(n!=null&&n.isDictionaryBatch()){const s=n.header(),o=yield this._reader.readMessageBody(n.bodyLength),a=this._loadDictionaryBatch(s,o);this.dictionaries.set(s.id,a)}}})}_readFooter(){return Zt(this,void 0,void 0,function*(){const{_handle:t}=this;t._pending&&(yield t._pending);const e=t.size-g0,i=yield t.readInt32(e),n=yield t.readAt(e-i,i);return Ko.decode(n)})}_readNextMessageAndValidate(t){return Zt(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex=4?wf(t)?new v0(new b0(r.read())):new Dl(new Nl(r)):new Dl(new Nl(function*(){}()))}function WO(r){return Zt(this,void 0,void 0,function*(){const t=yield r.peek(ca+7&-8);return t&&t.byteLength>=4?wf(t)?new v0(new b0(yield r.read())):new Rl(new Ll(r)):new Rl(new Ll(function(){return dr(this,arguments,function*(){})}()))})}function HO(r){return Zt(this,void 0,void 0,function*(){const{size:t}=yield r.stat(),e=new Ml(r,t);return t>=UO&&wf(yield e.readAt(0,ca+7&-8))?new zO(new jO(e)):new Rl(new Ll(e))})}class Ne extends ie{static assemble(...t){const e=n=>n.flatMap(s=>Array.isArray(s)?e(s):s instanceof fr?s.data.children:s.data),i=new Ne;return i.visitMany(e(t)),i}constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[]}visit(t){if(t instanceof Me)return this.visitMany(t.data),this;const{type:e}=t;if(!At.isDictionary(e)){const{length:i}=t;if(i>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");if(At.isUnion(e))this.nodes.push(new vn(i,0));else{const{nullCount:n}=t;At.isNull(e)||ti.call(this,n<=0?new Uint8Array(0):Cl(t.offset,i,t.nullBitmap)),this.nodes.push(new vn(i,n))}}return super.visit(t)}visitNull(t){return this}visitDictionary(t){return this.visit(t.clone(t.type.indices))}get nodes(){return this._nodes}get buffers(){return this._buffers}get byteLength(){return this._byteLength}get bufferRegions(){return this._bufferRegions}}function ti(r){const t=r.byteLength+7&-8;return this.buffers.push(r),this.bufferRegions.push(new vi(this._byteLength,t)),this._byteLength+=t,this}function XO(r){var t;const{type:e,length:i,typeIds:n,valueOffsets:s}=r;if(ti.call(this,n),e.mode===er.Sparse)return mh.call(this,r);if(e.mode===er.Dense){if(r.offset<=0)return ti.call(this,s),mh.call(this,r);{const o=new Int32Array(i),a=Object.create(null),l=Object.create(null);for(let u,c,h=-1;++h{const h=e.typeIds[c],p=a[h],f=l[h];return u.slice(p,Math.min(i,f))}))}}return this}function YO(r){let t;return r.nullCount>=r.length?ti.call(this,new Uint8Array(0)):(t=r.values)instanceof Uint8Array?ti.call(this,Cl(r.offset,r.length,t)):ti.call(this,Al(r.values))}function Yi(r){return ti.call(this,r.values.subarray(0,r.length*r.stride))}function nu(r){const{length:t,values:e,valueOffsets:i}=r,n=we(i[0]),s=we(i[t]),o=Math.min(s-n,e.byteLength-n);return ti.call(this,Iv(-n,t+1,i)),ti.call(this,e.subarray(n,n+o)),this}function xf(r){const{length:t,valueOffsets:e}=r;if(e){const{[0]:i,[t]:n}=e;return ti.call(this,Iv(-i,t+1,e)),this.visit(r.children[0].slice(i,n-i))}return this.visit(r.children[0])}function mh(r){return this.visitMany(r.type.children.map((t,e)=>r.children[e]).filter(Boolean))[0]}Ne.prototype.visitBool=YO;Ne.prototype.visitInt=Yi;Ne.prototype.visitFloat=Yi;Ne.prototype.visitUtf8=nu;Ne.prototype.visitLargeUtf8=nu;Ne.prototype.visitBinary=nu;Ne.prototype.visitLargeBinary=nu;Ne.prototype.visitFixedSizeBinary=Yi;Ne.prototype.visitDate=Yi;Ne.prototype.visitTimestamp=Yi;Ne.prototype.visitTime=Yi;Ne.prototype.visitDecimal=Yi;Ne.prototype.visitList=xf;Ne.prototype.visitStruct=mh;Ne.prototype.visitUnion=XO;Ne.prototype.visitInterval=Yi;Ne.prototype.visitDuration=Yi;Ne.prototype.visitFixedSizeList=xf;Ne.prototype.visitMap=xf;class x0 extends df{static throughNode(t){throw new Error('"throughNode" not available in this environment')}static throughDOM(t,e){throw new Error('"throughDOM" not available in this environment')}constructor(t){super(),this._position=0,this._started=!1,this._sink=new Wa,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,pr(t)||(t={autoDestroy:!0,writeLegacyIpcFormat:!1}),this._autoDestroy=typeof t.autoDestroy=="boolean"?t.autoDestroy:!0,this._writeLegacyIpcFormat=typeof t.writeLegacyIpcFormat=="boolean"?t.writeLegacyIpcFormat:!1}toString(t=!1){return this._sink.toString(t)}toUint8Array(t=!1){return this._sink.toUint8Array(t)}writeAll(t){return rs(t)?t.then(e=>this.writeAll(e)):no(t)?Ef(this,t):If(this,t)}get closed(){return this._sink.closed}[Symbol.asyncIterator](){return this._sink[Symbol.asyncIterator]()}toDOMStream(t){return this._sink.toDOMStream(t)}toNodeStream(t){return this._sink.toNodeStream(t)}close(){return this.reset()._sink.close()}abort(t){return this.reset()._sink.abort(t)}finish(){return this._autoDestroy?this.close():this.reset(this._sink,this._schema),this}reset(t=this._sink,e=null){return t===this._sink||t instanceof Wa?this._sink=t:(this._sink=new Wa,t&&SC(t)?this.toDOMStream({type:"bytes"}).pipeTo(t):t&&TC(t)&&this.toNodeStream({objectMode:!1}).pipe(t)),this._started&&this._schema&&this._writeFooter(this._schema),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,(!e||!dh(e,this._schema))&&(e==null?(this._position=0,this._schema=null):(this._started=!0,this._schema=e,this._writeSchema(e))),this}write(t){let e=null;if(this._sink){if(t==null)return this.finish()&&void 0;if(t instanceof gn&&!(e=t.schema))return this.finish()&&void 0;if(t instanceof fr&&!(e=t.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(e&&!dh(e,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,e)}t instanceof fr?t instanceof vf||this._writeRecordBatch(t):t instanceof gn?this.writeAll(t.batches):oa(t)&&this.writeAll(t)}_writeMessage(t,e=8){const i=e-1,n=or.encode(t),s=n.byteLength,o=this._writeLegacyIpcFormat?4:8,a=s+o+i&~i,l=a-s-o;return t.headerType===fe.RecordBatch?this._recordBatchBlocks.push(new mn(a,t.bodyLength,this._position)):t.headerType===fe.DictionaryBatch&&this._dictionaryBlocks.push(new mn(a,t.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(a-o)),s>0&&this._write(n),this._writePadding(l)}_write(t){if(this._started){const e=ae(t);e&&e.byteLength>0&&(this._sink.write(e),this._position+=e.byteLength)}return this}_writeSchema(t){return this._writeMessage(or.from(t))}_writeFooter(t){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(Zo)}_writePadding(t){return t>0?this._write(new Uint8Array(t)):this}_writeRecordBatch(t){const{byteLength:e,nodes:i,bufferRegions:n,buffers:s}=Ne.assemble(t),o=new Fr(t.numRows,i,n),a=or.from(o,e);return this._writeDictionaries(t)._writeMessage(a)._writeBodyBuffers(s)}_writeDictionaryBatch(t,e,i=!1){const{byteLength:n,nodes:s,bufferRegions:o,buffers:a}=Ne.assemble(new Me([t])),l=new Fr(t.length,s,o),u=new Ti(l,e,i),c=or.from(u,n);return this._writeMessage(c)._writeBodyBuffers(a)}_writeBodyBuffers(t){let e,i,n;for(let s=-1,o=t.length;++s0&&(this._write(e),(n=(i+7&-8)-i)>0&&this._writePadding(n));return this}_writeDictionaries(t){var e,i;for(const[n,s]of t.dictionaries){const o=(e=s==null?void 0:s.data)!==null&&e!==void 0?e:[],a=this._seenDictionaries.get(n),l=(i=this._dictionaryDeltaOffsets.get(n))!==null&&i!==void 0?i:0;if(!a||a.data[0]!==o[0])for(const[u,c]of o.entries())this._writeDictionaryBatch(c,n,u>0);else if(li.writeAll(n)):no(t)?Ef(i,t):If(i,t)}}class Tf extends x0{static writeAll(t){const e=new Tf;return rs(t)?t.then(i=>e.writeAll(i)):no(t)?Ef(e,t):If(e,t)}constructor(){super(),this._autoDestroy=!0}_writeSchema(t){return this._writeMagic()._writePadding(2)}_writeDictionaryBatch(t,e,i=!1){if(!i&&this._seenDictionaries.has(e))throw new Error("The Arrow File format does not support replacement dictionaries. ");return super._writeDictionaryBatch(t,e,i)}_writeFooter(t){const e=Ko.encode(new Ko(t,ke.V5,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(t)._write(e)._write(Int32Array.of(e.byteLength))._writeMagic()}}function If(r,t){let e=t;t instanceof gn&&(e=t.batches,r.reset(void 0,t.schema));for(const i of e)r.write(i);return r.finish()}function Ef(r,t){return Zt(this,void 0,void 0,function*(){var e,i,n,s,o,a,l;try{for(e=!0,i=bi(t);n=yield i.next(),s=n.done,!s;e=!0){l=n.value,e=!1;const u=l;r.write(u)}}catch(u){o={error:u}}finally{try{!e&&!s&&(a=i.return)&&(yield a.call(i))}finally{if(o)throw o.error}}return r.finish()})}function qO(r,t="stream"){return(t==="stream"?Sf:Tf).writeAll(r).toUint8Array(!0)}var QO=Object.create,S0=Object.defineProperty,KO=Object.getOwnPropertyDescriptor,ZO=Object.getOwnPropertyNames,JO=Object.getPrototypeOf,t2=Object.prototype.hasOwnProperty,e2=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),r2=(r,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of ZO(t))!t2.call(r,n)&&n!==e&&S0(r,n,{get:()=>t[n],enumerable:!(i=KO(t,n))||i.enumerable});return r},i2=(r,t,e)=>(e=r!=null?QO(JO(r)):{},r2(!r||!r.__esModule?S0(e,"default",{value:r,enumerable:!0}):e,r)),n2=e2((r,t)=>{t.exports=Worker}),T0=(r=>(r[r.UNDEFINED=0]="UNDEFINED",r[r.AUTOMATIC=1]="AUTOMATIC",r[r.READ_ONLY=2]="READ_ONLY",r[r.READ_WRITE=3]="READ_WRITE",r))(T0||{}),s2=(r=>(r[r.IDENTIFIER=0]="IDENTIFIER",r[r.NUMERIC_CONSTANT=1]="NUMERIC_CONSTANT",r[r.STRING_CONSTANT=2]="STRING_CONSTANT",r[r.OPERATOR=3]="OPERATOR",r[r.KEYWORD=4]="KEYWORD",r[r.COMMENT=5]="COMMENT",r))(s2||{}),o2=(r=>(r[r.NONE=0]="NONE",r[r.DEBUG=1]="DEBUG",r[r.INFO=2]="INFO",r[r.WARNING=3]="WARNING",r[r.ERROR=4]="ERROR",r))(o2||{}),a2=(r=>(r[r.NONE=0]="NONE",r[r.CONNECT=1]="CONNECT",r[r.DISCONNECT=2]="DISCONNECT",r[r.OPEN=3]="OPEN",r[r.QUERY=4]="QUERY",r[r.INSTANTIATE=5]="INSTANTIATE",r))(a2||{}),l2=(r=>(r[r.NONE=0]="NONE",r[r.OK=1]="OK",r[r.ERROR=2]="ERROR",r[r.START=3]="START",r[r.RUN=4]="RUN",r[r.CAPTURE=5]="CAPTURE",r))(l2||{}),u2=(r=>(r[r.NONE=0]="NONE",r[r.WEB_WORKER=1]="WEB_WORKER",r[r.NODE_WORKER=2]="NODE_WORKER",r[r.BINDINGS=3]="BINDINGS",r[r.ASYNC_DUCKDB=4]="ASYNC_DUCKDB",r))(u2||{}),c2=class{log(r){}},I0=class{constructor(r=2){this.level=r}log(r){r.level>=this.level&&console.log(r)}},h2=(r=>(r[r.SUCCESS=0]="SUCCESS",r))(h2||{}),f2=class{constructor(r,t){this._bindings=r,this._conn=t}get bindings(){return this._bindings}async close(){return this._bindings.disconnect(this._conn)}useUnsafe(r){return r(this._bindings,this._conn)}async query(r){this._bindings.logger.log({timestamp:new Date,level:2,origin:4,topic:4,event:4,value:r});let t=await this._bindings.runQuery(this._conn,r),e=Vr.from(t);return console.assert(e.isSync(),"Reader is not sync"),console.assert(e.isFile(),"Reader is not file"),new gn(e)}async send(r,t=!1){this._bindings.logger.log({timestamp:new Date,level:2,origin:4,topic:4,event:4,value:r});let e=await this._bindings.startPendingQuery(this._conn,r,t);for(;e==null;)e=await this._bindings.pollPendingQuery(this._conn);let i=new E0(this._bindings,this._conn,e),n=await Vr.from(i);return console.assert(n.isAsync()),console.assert(n.isStream()),n}async cancelSent(){return await this._bindings.cancelPendingQuery(this._conn)}async getTableNames(r){return await this._bindings.getTableNames(this._conn,r)}async prepare(r){let t=await this._bindings.createPrepared(this._conn,r);return new d2(this._bindings,this._conn,t)}async insertArrowTable(r,t){let e=qO(r,"stream");await this.insertArrowFromIPCStream(e,t)}async insertArrowFromIPCStream(r,t){await this._bindings.insertArrowFromIPCStream(this._conn,r,t)}async insertCSVFromPath(r,t){await this._bindings.insertCSVFromPath(this._conn,r,t)}async insertJSONFromPath(r,t){await this._bindings.insertJSONFromPath(this._conn,r,t)}},E0=class{constructor(r,t,e){this.db=r,this.conn=t,this.header=e,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 r;return this._inFlight!=null?(r=await this._inFlight,this._inFlight=null):r=await this.db.fetchQueryResults(this.conn),this._depleted=r.length==0,this._depleted||(this._inFlight=this.db.fetchQueryResults(this.conn)),{done:this._depleted,value:r}}[Symbol.asyncIterator](){return this}},d2=class{constructor(r,t,e){this.bindings=r,this.connectionId=t,this.statementId=e}async close(){await this.bindings.closePrepared(this.connectionId,this.statementId)}async query(...r){let t=await this.bindings.runPrepared(this.connectionId,this.statementId,r),e=Vr.from(t);return console.assert(e.isSync()),console.assert(e.isFile()),new gn(e)}async send(...r){let t=await this.bindings.sendPrepared(this.connectionId,this.statementId,r),e=new E0(this.bindings,this.connectionId,t),i=await Vr.from(e);return console.assert(i.isAsync()),console.assert(i.isStream()),i}},p2=(r=>(r.CANCEL_PENDING_QUERY="CANCEL_PENDING_QUERY",r.CLOSE_PREPARED="CLOSE_PREPARED",r.COLLECT_FILE_STATISTICS="COLLECT_FILE_STATISTICS",r.REGISTER_OPFS_FILE_NAME="REGISTER_OPFS_FILE_NAME",r.CONNECT="CONNECT",r.COPY_FILE_TO_BUFFER="COPY_FILE_TO_BUFFER",r.COPY_FILE_TO_PATH="COPY_FILE_TO_PATH",r.CREATE_PREPARED="CREATE_PREPARED",r.DISCONNECT="DISCONNECT",r.DROP_FILE="DROP_FILE",r.DROP_FILES="DROP_FILES",r.EXPORT_FILE_STATISTICS="EXPORT_FILE_STATISTICS",r.FETCH_QUERY_RESULTS="FETCH_QUERY_RESULTS",r.FLUSH_FILES="FLUSH_FILES",r.GET_FEATURE_FLAGS="GET_FEATURE_FLAGS",r.GET_TABLE_NAMES="GET_TABLE_NAMES",r.GET_VERSION="GET_VERSION",r.GLOB_FILE_INFOS="GLOB_FILE_INFOS",r.INSERT_ARROW_FROM_IPC_STREAM="INSERT_ARROW_FROM_IPC_STREAM",r.INSERT_CSV_FROM_PATH="IMPORT_CSV_FROM_PATH",r.INSERT_JSON_FROM_PATH="IMPORT_JSON_FROM_PATH",r.INSTANTIATE="INSTANTIATE",r.OPEN="OPEN",r.PING="PING",r.POLL_PENDING_QUERY="POLL_PENDING_QUERY",r.REGISTER_FILE_BUFFER="REGISTER_FILE_BUFFER",r.REGISTER_FILE_HANDLE="REGISTER_FILE_HANDLE",r.REGISTER_FILE_URL="REGISTER_FILE_URL",r.RESET="RESET",r.RUN_PREPARED="RUN_PREPARED",r.RUN_QUERY="RUN_QUERY",r.SEND_PREPARED="SEND_PREPARED",r.START_PENDING_QUERY="START_PENDING_QUERY",r.TOKENIZE="TOKENIZE",r))(p2||{}),m2=(r=>(r.CONNECTION_INFO="CONNECTION_INFO",r.ERROR="ERROR",r.FEATURE_FLAGS="FEATURE_FLAGS",r.FILE_BUFFER="FILE_BUFFER",r.FILE_INFOS="FILE_INFOS",r.FILE_SIZE="FILE_SIZE",r.FILE_STATISTICS="FILE_STATISTICS",r.INSTANTIATE_PROGRESS="INSTANTIATE_PROGRESS",r.LOG="LOG",r.OK="OK",r.PREPARED_STATEMENT_ID="PREPARED_STATEMENT_ID",r.QUERY_PLAN="QUERY_PLAN",r.QUERY_RESULT="QUERY_RESULT",r.QUERY_RESULT_CHUNK="QUERY_RESULT_CHUNK",r.QUERY_RESULT_HEADER="QUERY_RESULT_HEADER",r.QUERY_RESULT_HEADER_OR_NULL="QUERY_RESULT_HEADER_OR_NULL",r.REGISTERED_FILE="REGISTERED_FILE",r.SCRIPT_TOKENS="SCRIPT_TOKENS",r.SUCCESS="SUCCESS",r.TABLE_NAMES="TABLE_NAMES",r.VERSION_STRING="VERSION_STRING",r))(m2||{}),ue=class{constructor(r,t){this.promiseResolver=()=>{},this.promiseRejecter=()=>{},this.type=r,this.data=t,this.promise=new Promise((e,i)=>{this.promiseResolver=e,this.promiseRejecter=i})}};function Ya(r){switch(r.typeId){case L.Binary:return{sqlType:"binary"};case L.Bool:return{sqlType:"bool"};case L.Date:return{sqlType:"date"};case L.DateDay:return{sqlType:"date32[d]"};case L.DateMillisecond:return{sqlType:"date64[ms]"};case L.Decimal:{let t=r;return{sqlType:"decimal",precision:t.precision,scale:t.scale}}case L.Float:return{sqlType:"float"};case L.Float16:return{sqlType:"float16"};case L.Float32:return{sqlType:"float32"};case L.Float64:return{sqlType:"float64"};case L.Int:return{sqlType:"int32"};case L.Int16:return{sqlType:"int16"};case L.Int32:return{sqlType:"int32"};case L.Int64:return{sqlType:"int64"};case L.Uint16:return{sqlType:"uint16"};case L.Uint32:return{sqlType:"uint32"};case L.Uint64:return{sqlType:"uint64"};case L.Uint8:return{sqlType:"uint8"};case L.IntervalDayTime:return{sqlType:"interval[dt]"};case L.IntervalYearMonth:return{sqlType:"interval[m]"};case L.List:return{sqlType:"list",valueType:Ya(r.valueType)};case L.FixedSizeBinary:return{sqlType:"fixedsizebinary",byteWidth:r.byteWidth};case L.Null:return{sqlType:"null"};case L.Utf8:return{sqlType:"utf8"};case L.Struct:return{sqlType:"struct",fields:r.children.map(t=>yh(t.name,t.type))};case L.Map:{let t=r;return{sqlType:"map",keyType:Ya(t.keyType),valueType:Ya(t.valueType)}}case L.Time:return{sqlType:"time[s]"};case L.TimeMicrosecond:return{sqlType:"time[us]"};case L.TimeMillisecond:return{sqlType:"time[ms]"};case L.TimeNanosecond:return{sqlType:"time[ns]"};case L.TimeSecond:return{sqlType:"time[s]"};case L.Timestamp:return{sqlType:"timestamp",timezone:r.timezone||void 0};case L.TimestampSecond:return{sqlType:"timestamp[s]",timezone:r.timezone||void 0};case L.TimestampMicrosecond:return{sqlType:"timestamp[us]",timezone:r.timezone||void 0};case L.TimestampNanosecond:return{sqlType:"timestamp[ns]",timezone:r.timezone||void 0};case L.TimestampMillisecond:return{sqlType:"timestamp[ms]",timezone:r.timezone||void 0}}throw new Error("unsupported arrow type: ".concat(r.toString()))}function yh(r,t){let e=Ya(t);return e.name=r,e}var y2=new TextEncoder,g2=class{constructor(r,t=null){this._onInstantiationProgress=[],this._worker=null,this._workerShutdownPromise=null,this._workerShutdownResolver=()=>{},this._nextMessageId=0,this._pendingRequests=new Map,this._logger=r,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(r){this._worker=r,this._worker.addEventListener("message",this._onMessageHandler),this._worker.addEventListener("error",this._onErrorHandler),this._worker.addEventListener("close",this._onCloseHandler),this._workerShutdownPromise=new Promise((t,e)=>{this._workerShutdownResolver=t})}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(r,t=[]){if(!this._worker){console.error("cannot send a message since the worker is not set!");return}let e=this._nextMessageId++;return this._pendingRequests.set(e,r),this._worker.postMessage({messageId:e,type:r.type,data:r.data},t),await r.promise}onMessage(r){var t;let e=r.data;switch(e.type){case"LOG":{this._logger.log(e.data);return}case"INSTANTIATE_PROGRESS":{for(let n of this._onInstantiationProgress)n(e.data);return}}let i=this._pendingRequests.get(e.requestId);if(!i){console.warn("unassociated response: [".concat(e.requestId,", ").concat(e.type.toString(),"]"));return}if(this._pendingRequests.delete(e.requestId),e.type=="ERROR"){let n=new Error(e.data.message);n.name=e.data.name,(t=Object.getOwnPropertyDescriptor(n,"stack"))!=null&&t.writable&&(n.stack=e.data.stack),i.promiseRejecter(n);return}switch(i.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(e.type=="OK"){i.promiseResolver(e.data);return}break;case"INSTANTIATE":if(this._onInstantiationProgress=[],e.type=="OK"){i.promiseResolver(e.data);return}break;case"GLOB_FILE_INFOS":if(e.type=="FILE_INFOS"){i.promiseResolver(e.data);return}break;case"GET_VERSION":if(e.type=="VERSION_STRING"){i.promiseResolver(e.data);return}break;case"GET_FEATURE_FLAGS":if(e.type=="FEATURE_FLAGS"){i.promiseResolver(e.data);return}break;case"GET_TABLE_NAMES":if(e.type=="TABLE_NAMES"){i.promiseResolver(e.data);return}break;case"TOKENIZE":if(e.type=="SCRIPT_TOKENS"){i.promiseResolver(e.data);return}break;case"COPY_FILE_TO_BUFFER":if(e.type=="FILE_BUFFER"){i.promiseResolver(e.data);return}break;case"EXPORT_FILE_STATISTICS":if(e.type=="FILE_STATISTICS"){i.promiseResolver(e.data);return}break;case"CONNECT":if(e.type=="CONNECTION_INFO"){i.promiseResolver(e.data);return}break;case"RUN_PREPARED":case"RUN_QUERY":if(e.type=="QUERY_RESULT"){i.promiseResolver(e.data);return}break;case"SEND_PREPARED":if(e.type=="QUERY_RESULT_HEADER"){i.promiseResolver(e.data);return}break;case"START_PENDING_QUERY":if(e.type=="QUERY_RESULT_HEADER_OR_NULL"){i.promiseResolver(e.data);return}break;case"POLL_PENDING_QUERY":if(e.type=="QUERY_RESULT_HEADER_OR_NULL"){i.promiseResolver(e.data);return}break;case"CANCEL_PENDING_QUERY":if(this._onInstantiationProgress=[],e.type=="SUCCESS"){i.promiseResolver(e.data);return}break;case"FETCH_QUERY_RESULTS":if(e.type=="QUERY_RESULT_CHUNK"){i.promiseResolver(e.data);return}break;case"CREATE_PREPARED":if(e.type=="PREPARED_STATEMENT_ID"){i.promiseResolver(e.data);return}break}i.promiseRejecter(new Error("unexpected response type: ".concat(e.type.toString())))}onError(r){console.error(r),console.error("error in duckdb worker: ".concat(r.message)),this._pendingRequests.clear()}onClose(){if(this._workerShutdownResolver(null),this._pendingRequests.size!=0){console.warn("worker terminated with ".concat(this._pendingRequests.size," pending requests"));return}this._pendingRequests.clear()}async reset(){let r=new ue("RESET",null);return await this.postTask(r)}async ping(){let r=new ue("PING",null);await this.postTask(r)}async dropFile(r){let t=new ue("DROP_FILE",r);return await this.postTask(t)}async dropFiles(){let r=new ue("DROP_FILES",null);return await this.postTask(r)}async flushFiles(){let r=new ue("FLUSH_FILES",null);return await this.postTask(r)}async instantiate(r,t=null,e=i=>{}){this._onInstantiationProgress.push(e);let i=new ue("INSTANTIATE",[r,t]);return await this.postTask(i)}async getVersion(){let r=new ue("GET_VERSION",null);return await this.postTask(r)}async getFeatureFlags(){let r=new ue("GET_FEATURE_FLAGS",null);return await this.postTask(r)}async open(r){let t=new ue("OPEN",r);await this.postTask(t)}async tokenize(r){let t=new ue("TOKENIZE",r);return await this.postTask(t)}async connectInternal(){let r=new ue("CONNECT",null);return await this.postTask(r)}async connect(){let r=await this.connectInternal();return new f2(this,r)}async disconnect(r){let t=new ue("DISCONNECT",r);await this.postTask(t)}async runQuery(r,t){let e=new ue("RUN_QUERY",[r,t]);return await this.postTask(e)}async startPendingQuery(r,t,e=!1){let i=new ue("START_PENDING_QUERY",[r,t,e]);return await this.postTask(i)}async pollPendingQuery(r){let t=new ue("POLL_PENDING_QUERY",r);return await this.postTask(t)}async cancelPendingQuery(r){let t=new ue("CANCEL_PENDING_QUERY",r);return await this.postTask(t)}async fetchQueryResults(r){let t=new ue("FETCH_QUERY_RESULTS",r);return await this.postTask(t)}async getTableNames(r,t){let e=new ue("GET_TABLE_NAMES",[r,t]);return await this.postTask(e)}async createPrepared(r,t){let e=new ue("CREATE_PREPARED",[r,t]);return await this.postTask(e)}async closePrepared(r,t){let e=new ue("CLOSE_PREPARED",[r,t]);await this.postTask(e)}async runPrepared(r,t,e){let i=new ue("RUN_PREPARED",[r,t,e]);return await this.postTask(i)}async sendPrepared(r,t,e){let i=new ue("SEND_PREPARED",[r,t,e]);return await this.postTask(i)}async globFiles(r){let t=new ue("GLOB_FILE_INFOS",r);return await this.postTask(t)}async registerFileText(r,t){let e=y2.encode(t);await this.registerFileBuffer(r,e)}async registerFileURL(r,t,e,i){t===void 0&&(t=r);let n=new ue("REGISTER_FILE_URL",[r,t,e,i]);await this.postTask(n)}async registerEmptyFileBuffer(r){}async registerFileBuffer(r,t){let e=new ue("REGISTER_FILE_BUFFER",[r,t]);await this.postTask(e,[t.buffer])}async registerFileHandle(r,t,e,i){let n=new ue("REGISTER_FILE_HANDLE",[r,t,e,i]);await this.postTask(n,[])}async registerOPFSFileName(r){let t=new ue("REGISTER_OPFS_FILE_NAME",[r]);await this.postTask(t,[])}async collectFileStatistics(r,t){let e=new ue("COLLECT_FILE_STATISTICS",[r,t]);await this.postTask(e,[])}async exportFileStatistics(r){let t=new ue("EXPORT_FILE_STATISTICS",r);return await this.postTask(t,[])}async copyFileToBuffer(r){let t=new ue("COPY_FILE_TO_BUFFER",r);return await this.postTask(t)}async copyFileToPath(r,t){let e=new ue("COPY_FILE_TO_PATH",[r,t]);await this.postTask(e)}async insertArrowFromIPCStream(r,t,e){if(t.length==0)return;let i=new ue("INSERT_ARROW_FROM_IPC_STREAM",[r,t,e]);await this.postTask(i,[t.buffer])}async insertCSVFromPath(r,t,e){if(e.columns!==void 0){let n=[];for(let s in e.columns){let o=e.columns[s];n.push(yh(s,o))}e.columnsFlat=n,delete e.columns}let i=new ue("IMPORT_CSV_FROM_PATH",[r,t,e]);await this.postTask(i)}async insertJSONFromPath(r,t,e){if(e.columns!==void 0){let n=[];for(let s in e.columns){let o=e.columns[s];n.push(yh(s,o))}e.columnsFlat=n,delete e.columns}let i=new ue("IMPORT_JSON_FROM_PATH",[r,t,e]);await this.postTask(i)}};function v2(){let r=new TextDecoder;return t=>(typeof SharedArrayBuffer<"u"&&t.buffer instanceof SharedArrayBuffer&&(t=new Uint8Array(t)),r.decode(t))}v2();var _2=(r=>(r[r.BUFFER=0]="BUFFER",r[r.NODE_FS=1]="NODE_FS",r[r.BROWSER_FILEREADER=2]="BROWSER_FILEREADER",r[r.BROWSER_FSACCESS=3]="BROWSER_FSACCESS",r[r.HTTP=4]="HTTP",r[r.S3=5]="S3",r))(_2||{}),b2=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])),w2=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])),x2=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])),S2=()=>(async r=>{try{return typeof MessageChannel<"u"&&new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(r)}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])),T2={version:"1.29.1-dev68.0"},Cf=T2.version.split(".");Cf[0];Cf[1];Cf[2];var I2=()=>typeof navigator>"u",Ku=null,Zu=null,Ju=null,tc=null,ec=null;async function E2(){return Ku==null&&(Ku=typeof BigInt64Array<"u"),Zu==null&&(Zu=await w2()),Ju==null&&(Ju=await S2()),tc==null&&(tc=await x2()),ec==null&&(ec=await b2()),{bigInt64Array:Ku,crossOriginIsolated:I2()||globalThis.crossOriginIsolated||!1,wasmExceptions:Zu,wasmSIMD:tc,wasmThreads:Ju,wasmBulkMemory:ec}}async function kp(r){let t=await E2();if(t.wasmExceptions){if(t.wasmSIMD&&t.wasmThreads&&t.crossOriginIsolated&&r.coi)return{mainModule:r.coi.mainModule,mainWorker:r.coi.mainWorker,pthreadWorker:r.coi.pthreadWorker};if(r.eh)return{mainModule:r.eh.mainModule,mainWorker:r.eh.mainWorker,pthreadWorker:null}}return{mainModule:r.mvp.mainModule,mainWorker:r.mvp.mainWorker,pthreadWorker:null}}i2(n2());const rc={},Mo={};function Lo(r,t){try{const i=(rc[r]||(rc[r]=new Intl.DateTimeFormat("en-GB",{timeZone:r,hour:"numeric",timeZoneName:"longOffset"}).format))(t).split("GMT")[1]||"";return i in Mo?Mo[i]:Up(i,i.split(":"))}catch{if(r in Mo)return Mo[r];const e=r==null?void 0:r.match(C2);return e?Up(r,e.slice(1)):NaN}}const C2=/([+-]\d\d):?(\d\d)?/;function Up(r,t){const e=+t[0],i=+(t[1]||0);return Mo[r]=e>0?e*60+i:e*60-i}class Er extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(Lo(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),C0(this),gh(this)):this.setTime(Date.now())}static tz(t,...e){return e.length?new Er(...e,t):new Er(Date.now(),t)}withTimeZone(t){return new Er(+this,t)}getTimezoneOffset(){return-Lo(this.timeZone,this)}setTime(t){return Date.prototype.setTime.apply(this,arguments),gh(this),+this}[Symbol.for("constructDateFrom")](t){return new Er(+new Date(t),this.timeZone)}}const zp=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(r=>{if(!zp.test(r))return;const t=r.replace(zp,"$1UTC");Er.prototype[t]&&(r.startsWith("get")?Er.prototype[r]=function(){return this.internal[t]()}:(Er.prototype[r]=function(){return Date.prototype[t].apply(this.internal,arguments),A2(this),+this},Er.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),gh(this),+this}))});function gh(r){r.internal.setTime(+r),r.internal.setUTCMinutes(r.internal.getUTCMinutes()-r.getTimezoneOffset())}function A2(r){Date.prototype.setFullYear.call(r,r.internal.getUTCFullYear(),r.internal.getUTCMonth(),r.internal.getUTCDate()),Date.prototype.setHours.call(r,r.internal.getUTCHours(),r.internal.getUTCMinutes(),r.internal.getUTCSeconds(),r.internal.getUTCMilliseconds()),C0(r)}function C0(r){const t=Lo(r.timeZone,r),e=new Date(+r);e.setUTCHours(e.getUTCHours()-1);const i=-new Date(+r).getTimezoneOffset(),n=-new Date(+e).getTimezoneOffset(),s=i-n,o=Date.prototype.getHours.apply(r)!==r.internal.getUTCHours();s&&o&&r.internal.setUTCMinutes(r.internal.getUTCMinutes()+s);const a=i-t;a&&Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+a);const l=Lo(r.timeZone,r),c=-new Date(+r).getTimezoneOffset()-l,h=l!==t,p=c-a;if(h&&p){Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+p);const f=Lo(r.timeZone,r),y=l-f;y&&(r.internal.setUTCMinutes(r.internal.getUTCMinutes()+y),Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+y))}}const O2=new TextDecoder("utf-8"),F2=r=>O2.decode(r),P2=new TextEncoder,A0=r=>P2.encode(r),hi=r=>typeof r=="function",ha=r=>r!=null&&Object(r)===r,M2=r=>ha(r)&&hi(r.then),O0=r=>ha(r)&&hi(r[Symbol.iterator]),D2=r=>ha(r)&&hi(r[Symbol.asyncIterator]),R2=r=>ha(r)&&"done"in r&&"value"in r,N2=r=>ha(r)&&hi(r.clear)&&hi(r.bytes)&&hi(r.position)&&hi(r.setPosition)&&hi(r.capacity)&&hi(r.getBufferIdentifier)&&hi(r.createLong),Af=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function L2(r){const t=r[0]?[r[0]]:[];let e,i,n,s;for(let o,a,l=0,u=0,c=r.length;++lc+h.byteLength,0);let n,s,o,a=0,l=-1;const u=Math.min(t||Number.POSITIVE_INFINITY,i);for(const c=e.length;++lrr(Int8Array,r),U2=r=>rr(Int16Array,r),z2=r=>rr(Int32Array,r),j2=r=>rr(BigInt64Array,r),$2=r=>rr(Uint8Array,r),V2=r=>rr(Uint16Array,r),G2=r=>rr(Uint32Array,r),W2=r=>rr(BigUint64Array,r),H2=r=>rr(Float32Array,r),X2=r=>rr(Float64Array,r),Y2=r=>rr(Uint8ClampedArray,r),_h=r=>(r.next(),r);function*Oi(r,t){const e=function*(n){yield n},i=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Af?e(t):O0(t)?t:e(t);return yield*_h(function*(n){let s=null;do s=n.next(yield rr(r,s));while(!s.done)}(i[Symbol.iterator]())),new r}const q2=r=>Oi(Int8Array,r),Q2=r=>Oi(Int16Array,r),K2=r=>Oi(Int32Array,r),Z2=r=>Oi(Uint8Array,r),J2=r=>Oi(Uint16Array,r),tF=r=>Oi(Uint32Array,r),eF=r=>Oi(Float32Array,r),rF=r=>Oi(Float64Array,r),iF=r=>Oi(Uint8ClampedArray,r);function ii(r,t){return dr(this,arguments,function*(){if(M2(t))return yield Pt(yield Pt(yield*ts(bi(ii(r,yield Pt(t))))));const i=function(o){return dr(this,arguments,function*(){yield yield Pt(yield Pt(o))})},n=function(o){return dr(this,arguments,function*(){yield Pt(yield*ts(bi(_h(function*(a){let l=null;do l=a.next(yield l==null?void 0:l.value);while(!l.done)}(o[Symbol.iterator]())))))})},s=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Af?i(t):O0(t)?n(t):D2(t)?t:i(t);return yield Pt(yield*ts(bi(_h(function(o){return dr(this,arguments,function*(){let a=null;do a=yield Pt(o.next(yield yield Pt(rr(r,a))));while(!a.done)})}(s[Symbol.asyncIterator]()))))),yield Pt(new r)})}const nF=r=>ii(Int8Array,r),sF=r=>ii(Int16Array,r),oF=r=>ii(Int32Array,r),aF=r=>ii(Uint8Array,r),lF=r=>ii(Uint16Array,r),uF=r=>ii(Uint32Array,r),cF=r=>ii(Float32Array,r),hF=r=>ii(Float64Array,r),fF=r=>ii(Uint8ClampedArray,r);function dF(r,t,e){if(r!==0){e=e.slice(0,t);for(let i=-1,n=e.length;++i0)do if(r[e]!==t[e])return!1;while(++eeo(t))}]`:`[${r}]`:ArrayBuffer.isView(r)?`[${r}]`:JSON.stringify(r,(t,e)=>typeof e=="bigint"?`${e}`:e)}const yF=Object.freeze(Object.defineProperty({__proto__:null,valueToString:eo},Symbol.toStringTag,{value:"Module"}));function ar(r){if(typeof r=="bigint"&&(rNumber.MAX_SAFE_INTEGER))throw new TypeError(`${r} is not safe to convert to a number.`);return Number(r)}function P0(r,t){return ar(r/t)+ar(r%t)/ar(t)}const M0=Symbol.for("isArrowBigNum");function ni(r,...t){return t.length===0?Object.setPrototypeOf(rr(this.TypedArray,r),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(r,...t),this.constructor.prototype)}ni.prototype[M0]=!0;ni.prototype.toJSON=function(){return`"${ro(this)}"`};ni.prototype.valueOf=function(r){return Of(this,r)};ni.prototype.toString=function(){return ro(this)};ni.prototype[Symbol.toPrimitive]=function(r="default"){switch(r){case"number":return Of(this);case"string":return ro(this);case"default":return D0(this)}return ro(this)};function Gs(...r){return ni.apply(this,r)}function Ws(...r){return ni.apply(this,r)}function Jo(...r){return ni.apply(this,r)}Object.setPrototypeOf(Gs.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(Ws.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(Jo.prototype,Object.create(Uint32Array.prototype));Object.assign(Gs.prototype,ni.prototype,{constructor:Gs,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(Ws.prototype,ni.prototype,{constructor:Ws,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign(Jo.prototype,ni.prototype,{constructor:Jo,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});const gF=BigInt(4294967296)*BigInt(4294967296),vF=gF-BigInt(1);function Of(r,t){const{buffer:e,byteOffset:i,byteLength:n,signed:s}=r,o=new BigUint64Array(e,i,n/8),a=s&&o.at(-1)&BigInt(1)<=0)return ic(r);t=t.slice();let i=1;for(let s=0;s(r.children=null,r.ArrayType=Array,r.OffsetArrayType=Int32Array,r[Symbol.toStringTag]="DataType"))(Et.prototype);class jp extends Et{constructor(){super(W.Null)}toString(){return"Null"}}N0=Symbol.toStringTag;jp[N0]=(r=>r[Symbol.toStringTag]="Null")(jp.prototype);class $p extends Et{constructor(t,e){super(W.Int),this.isSigned=t,this.bitWidth=e}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 new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}}L0=Symbol.toStringTag;$p[L0]=(r=>(r.isSigned=null,r.bitWidth=null,r[Symbol.toStringTag]="Int"))($p.prototype);class Vp extends Et{constructor(t){super(W.Float),this.precision=t}get ArrayType(){switch(this.precision){case Cr.HALF:return Uint16Array;case Cr.SINGLE:return Float32Array;case Cr.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}}B0=Symbol.toStringTag;Vp[B0]=(r=>(r.precision=null,r[Symbol.toStringTag]="Float"))(Vp.prototype);class Gp extends Et{constructor(){super(W.Binary)}toString(){return"Binary"}}k0=Symbol.toStringTag;Gp[k0]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Binary"))(Gp.prototype);class Wp extends Et{constructor(){super(W.LargeBinary)}toString(){return"LargeBinary"}}U0=Symbol.toStringTag;Wp[U0]=(r=>(r.ArrayType=Uint8Array,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeBinary"))(Wp.prototype);class Hp extends Et{constructor(){super(W.Utf8)}toString(){return"Utf8"}}z0=Symbol.toStringTag;Hp[z0]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Utf8"))(Hp.prototype);class Xp extends Et{constructor(){super(W.LargeUtf8)}toString(){return"LargeUtf8"}}j0=Symbol.toStringTag;Xp[j0]=(r=>(r.ArrayType=Uint8Array,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeUtf8"))(Xp.prototype);class Yp extends Et{constructor(){super(W.Bool)}toString(){return"Bool"}}$0=Symbol.toStringTag;Yp[$0]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Bool"))(Yp.prototype);class qp extends Et{constructor(t,e,i=128){super(W.Decimal),this.scale=t,this.precision=e,this.bitWidth=i}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}}V0=Symbol.toStringTag;qp[V0]=(r=>(r.scale=null,r.precision=null,r.ArrayType=Uint32Array,r[Symbol.toStringTag]="Decimal"))(qp.prototype);class Qp extends Et{constructor(t){super(W.Date),this.unit=t}toString(){return`Date${(this.unit+1)*32}<${_n[this.unit]}>`}get ArrayType(){return this.unit===_n.DAY?Int32Array:BigInt64Array}}G0=Symbol.toStringTag;Qp[G0]=(r=>(r.unit=null,r[Symbol.toStringTag]="Date"))(Qp.prototype);class Kp extends Et{constructor(t,e){super(W.Time),this.unit=t,this.bitWidth=e}toString(){return`Time${this.bitWidth}<${Jt[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}}W0=Symbol.toStringTag;Kp[W0]=(r=>(r.unit=null,r.bitWidth=null,r[Symbol.toStringTag]="Time"))(Kp.prototype);class Zp extends Et{constructor(t,e){super(W.Timestamp),this.unit=t,this.timezone=e}toString(){return`Timestamp<${Jt[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}}H0=Symbol.toStringTag;Zp[H0]=(r=>(r.unit=null,r.timezone=null,r.ArrayType=BigInt64Array,r[Symbol.toStringTag]="Timestamp"))(Zp.prototype);class Jp extends Et{constructor(t){super(W.Interval),this.unit=t}toString(){return`Interval<${ns[this.unit]}>`}}X0=Symbol.toStringTag;Jp[X0]=(r=>(r.unit=null,r.ArrayType=Int32Array,r[Symbol.toStringTag]="Interval"))(Jp.prototype);class tm extends Et{constructor(t){super(W.Duration),this.unit=t}toString(){return`Duration<${Jt[this.unit]}>`}}Y0=Symbol.toStringTag;tm[Y0]=(r=>(r.unit=null,r.ArrayType=BigInt64Array,r[Symbol.toStringTag]="Duration"))(tm.prototype);class em extends Et{constructor(t){super(W.List),this.children=[t]}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}}q0=Symbol.toStringTag;em[q0]=(r=>(r.children=null,r[Symbol.toStringTag]="List"))(em.prototype);class bh extends Et{constructor(t){super(W.Struct),this.children=t}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}}Q0=Symbol.toStringTag;bh[Q0]=(r=>(r.children=null,r[Symbol.toStringTag]="Struct"))(bh.prototype);class rm extends Et{constructor(t,e,i){super(W.Union),this.mode=t,this.children=i,this.typeIds=e=Int32Array.from(e),this.typeIdToChildIndex=e.reduce((n,s,o)=>(n[s]=o)&&n||n,Object.create(null))}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(t=>`${t.type}`).join(" | ")}>`}}K0=Symbol.toStringTag;rm[K0]=(r=>(r.mode=null,r.typeIds=null,r.children=null,r.typeIdToChildIndex=null,r.ArrayType=Int8Array,r[Symbol.toStringTag]="Union"))(rm.prototype);class im extends Et{constructor(t){super(W.FixedSizeBinary),this.byteWidth=t}toString(){return`FixedSizeBinary[${this.byteWidth}]`}}Z0=Symbol.toStringTag;im[Z0]=(r=>(r.byteWidth=null,r.ArrayType=Uint8Array,r[Symbol.toStringTag]="FixedSizeBinary"))(im.prototype);class nm extends Et{constructor(t,e){super(W.FixedSizeList),this.listSize=t,this.children=[e]}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}>`}}J0=Symbol.toStringTag;nm[J0]=(r=>(r.children=null,r.listSize=null,r[Symbol.toStringTag]="FixedSizeList"))(nm.prototype);class sm extends Et{constructor(t,e=!1){var i,n,s;if(super(W.Map),this.children=[t],this.keysSorted=e,t&&(t.name="entries",!((i=t==null?void 0:t.type)===null||i===void 0)&&i.children)){const o=(n=t==null?void 0:t.type)===null||n===void 0?void 0:n.children[0];o&&(o.name="key");const a=(s=t==null?void 0:t.type)===null||s===void 0?void 0:s.children[1];a&&(a.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(t=>`${t.name}:${t.type}`).join(", ")}}>`}}tb=Symbol.toStringTag;sm[tb]=(r=>(r.children=null,r.keysSorted=null,r[Symbol.toStringTag]="Map_"))(sm.prototype);const bF=(r=>()=>++r)(-1);class om extends Et{constructor(t,e,i,n){super(W.Dictionary),this.indices=e,this.dictionary=t,this.isOrdered=n||!1,this.id=i==null?bF():ar(i)}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}}eb=Symbol.toStringTag;om[eb]=(r=>(r.id=null,r.indices=null,r.isOrdered=null,r.dictionary=null,r[Symbol.toStringTag]="Dictionary"))(om.prototype);function rb(r){const t=r;switch(r.typeId){case W.Decimal:return r.bitWidth/32;case W.Interval:return 1+t.unit;case W.FixedSizeList:return t.listSize;case W.FixedSizeBinary:return t.byteWidth;default:return 1}}class le{visitMany(t,...e){return t.map((i,n)=>this.visit(i,...e.map(s=>s[n])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,e=!0){return wF(this,t,e)}getVisitFnByTypeId(t,e=!0){return Ps(this,t,e)}visitNull(t,...e){return null}visitBool(t,...e){return null}visitInt(t,...e){return null}visitFloat(t,...e){return null}visitUtf8(t,...e){return null}visitLargeUtf8(t,...e){return null}visitBinary(t,...e){return null}visitLargeBinary(t,...e){return null}visitFixedSizeBinary(t,...e){return null}visitDate(t,...e){return null}visitTimestamp(t,...e){return null}visitTime(t,...e){return null}visitDecimal(t,...e){return null}visitList(t,...e){return null}visitStruct(t,...e){return null}visitUnion(t,...e){return null}visitDictionary(t,...e){return null}visitInterval(t,...e){return null}visitDuration(t,...e){return null}visitFixedSizeList(t,...e){return null}visitMap(t,...e){return null}}function wF(r,t,e=!0){return typeof t=="number"?Ps(r,t,e):typeof t=="string"&&t in W?Ps(r,W[t],e):t&&t instanceof Et?Ps(r,am(t),e):t!=null&&t.type&&t.type instanceof Et?Ps(r,am(t.type),e):Ps(r,W.NONE,e)}function Ps(r,t,e=!0){let i=null;switch(t){case W.Null:i=r.visitNull;break;case W.Bool:i=r.visitBool;break;case W.Int:i=r.visitInt;break;case W.Int8:i=r.visitInt8||r.visitInt;break;case W.Int16:i=r.visitInt16||r.visitInt;break;case W.Int32:i=r.visitInt32||r.visitInt;break;case W.Int64:i=r.visitInt64||r.visitInt;break;case W.Uint8:i=r.visitUint8||r.visitInt;break;case W.Uint16:i=r.visitUint16||r.visitInt;break;case W.Uint32:i=r.visitUint32||r.visitInt;break;case W.Uint64:i=r.visitUint64||r.visitInt;break;case W.Float:i=r.visitFloat;break;case W.Float16:i=r.visitFloat16||r.visitFloat;break;case W.Float32:i=r.visitFloat32||r.visitFloat;break;case W.Float64:i=r.visitFloat64||r.visitFloat;break;case W.Utf8:i=r.visitUtf8;break;case W.LargeUtf8:i=r.visitLargeUtf8;break;case W.Binary:i=r.visitBinary;break;case W.LargeBinary:i=r.visitLargeBinary;break;case W.FixedSizeBinary:i=r.visitFixedSizeBinary;break;case W.Date:i=r.visitDate;break;case W.DateDay:i=r.visitDateDay||r.visitDate;break;case W.DateMillisecond:i=r.visitDateMillisecond||r.visitDate;break;case W.Timestamp:i=r.visitTimestamp;break;case W.TimestampSecond:i=r.visitTimestampSecond||r.visitTimestamp;break;case W.TimestampMillisecond:i=r.visitTimestampMillisecond||r.visitTimestamp;break;case W.TimestampMicrosecond:i=r.visitTimestampMicrosecond||r.visitTimestamp;break;case W.TimestampNanosecond:i=r.visitTimestampNanosecond||r.visitTimestamp;break;case W.Time:i=r.visitTime;break;case W.TimeSecond:i=r.visitTimeSecond||r.visitTime;break;case W.TimeMillisecond:i=r.visitTimeMillisecond||r.visitTime;break;case W.TimeMicrosecond:i=r.visitTimeMicrosecond||r.visitTime;break;case W.TimeNanosecond:i=r.visitTimeNanosecond||r.visitTime;break;case W.Decimal:i=r.visitDecimal;break;case W.List:i=r.visitList;break;case W.Struct:i=r.visitStruct;break;case W.Union:i=r.visitUnion;break;case W.DenseUnion:i=r.visitDenseUnion||r.visitUnion;break;case W.SparseUnion:i=r.visitSparseUnion||r.visitUnion;break;case W.Dictionary:i=r.visitDictionary;break;case W.Interval:i=r.visitInterval;break;case W.IntervalDayTime:i=r.visitIntervalDayTime||r.visitInterval;break;case W.IntervalYearMonth:i=r.visitIntervalYearMonth||r.visitInterval;break;case W.Duration:i=r.visitDuration;break;case W.DurationSecond:i=r.visitDurationSecond||r.visitDuration;break;case W.DurationMillisecond:i=r.visitDurationMillisecond||r.visitDuration;break;case W.DurationMicrosecond:i=r.visitDurationMicrosecond||r.visitDuration;break;case W.DurationNanosecond:i=r.visitDurationNanosecond||r.visitDuration;break;case W.FixedSizeList:i=r.visitFixedSizeList;break;case W.Map:i=r.visitMap;break}if(typeof i=="function")return i;if(!e)return()=>null;throw new Error(`Unrecognized type '${W[t]}'`)}function am(r){switch(r.typeId){case W.Null:return W.Null;case W.Int:{const{bitWidth:t,isSigned:e}=r;switch(t){case 8:return e?W.Int8:W.Uint8;case 16:return e?W.Int16:W.Uint16;case 32:return e?W.Int32:W.Uint32;case 64:return e?W.Int64:W.Uint64}return W.Int}case W.Float:switch(r.precision){case Cr.HALF:return W.Float16;case Cr.SINGLE:return W.Float32;case Cr.DOUBLE:return W.Float64}return W.Float;case W.Binary:return W.Binary;case W.LargeBinary:return W.LargeBinary;case W.Utf8:return W.Utf8;case W.LargeUtf8:return W.LargeUtf8;case W.Bool:return W.Bool;case W.Decimal:return W.Decimal;case W.Time:switch(r.unit){case Jt.SECOND:return W.TimeSecond;case Jt.MILLISECOND:return W.TimeMillisecond;case Jt.MICROSECOND:return W.TimeMicrosecond;case Jt.NANOSECOND:return W.TimeNanosecond}return W.Time;case W.Timestamp:switch(r.unit){case Jt.SECOND:return W.TimestampSecond;case Jt.MILLISECOND:return W.TimestampMillisecond;case Jt.MICROSECOND:return W.TimestampMicrosecond;case Jt.NANOSECOND:return W.TimestampNanosecond}return W.Timestamp;case W.Date:switch(r.unit){case _n.DAY:return W.DateDay;case _n.MILLISECOND:return W.DateMillisecond}return W.Date;case W.Interval:switch(r.unit){case ns.DAY_TIME:return W.IntervalDayTime;case ns.YEAR_MONTH:return W.IntervalYearMonth}return W.Interval;case W.Duration:switch(r.unit){case Jt.SECOND:return W.DurationSecond;case Jt.MILLISECOND:return W.DurationMillisecond;case Jt.MICROSECOND:return W.DurationMicrosecond;case Jt.NANOSECOND:return W.DurationNanosecond}return W.Duration;case W.Map:return W.Map;case W.List:return W.List;case W.Struct:return W.Struct;case W.Union:switch(r.mode){case Ii.Dense:return W.DenseUnion;case Ii.Sparse:return W.SparseUnion}return W.Union;case W.FixedSizeBinary:return W.FixedSizeBinary;case W.FixedSizeList:return W.FixedSizeList;case W.Dictionary:return W.Dictionary}throw new Error(`Unrecognized type '${W[r.typeId]}'`)}le.prototype.visitInt8=null;le.prototype.visitInt16=null;le.prototype.visitInt32=null;le.prototype.visitInt64=null;le.prototype.visitUint8=null;le.prototype.visitUint16=null;le.prototype.visitUint32=null;le.prototype.visitUint64=null;le.prototype.visitFloat16=null;le.prototype.visitFloat32=null;le.prototype.visitFloat64=null;le.prototype.visitDateDay=null;le.prototype.visitDateMillisecond=null;le.prototype.visitTimestampSecond=null;le.prototype.visitTimestampMillisecond=null;le.prototype.visitTimestampMicrosecond=null;le.prototype.visitTimestampNanosecond=null;le.prototype.visitTimeSecond=null;le.prototype.visitTimeMillisecond=null;le.prototype.visitTimeMicrosecond=null;le.prototype.visitTimeNanosecond=null;le.prototype.visitDenseUnion=null;le.prototype.visitSparseUnion=null;le.prototype.visitIntervalDayTime=null;le.prototype.visitIntervalYearMonth=null;le.prototype.visitDuration=null;le.prototype.visitDurationSecond=null;le.prototype.visitDurationMillisecond=null;le.prototype.visitDurationMicrosecond=null;le.prototype.visitDurationNanosecond=null;const ib=new Float64Array(1),vs=new Uint32Array(ib.buffer);function Ff(r){const t=(r&31744)>>10,e=(r&1023)/1024,i=Math.pow(-1,(r&32768)>>15);switch(t){case 31:return i*(e?Number.NaN:1/0);case 0:return i*(e?6103515625e-14*e:0)}return i*Math.pow(2,t-15)*(1+e)}function nb(r){if(r!==r)return 32256;ib[0]=r;const t=(vs[1]&2147483648)>>16&65535;let e=vs[1]&2146435072,i=0;return e>=1089470464?vs[0]>0?e=31744:(e=(e&2080374784)>>16,i=(vs[1]&1048575)>>10):e<=1056964608?(i=1048576+(vs[1]&1048575),i=1048576+(i<<(e>>20)-998)>>21,e=0):(e=e-1056964608>>10,i=(vs[1]&1048575)+512>>10),t|e|i&65535}const xF=Object.freeze(Object.defineProperty({__proto__:null,float64ToUint16:nb,uint16ToFloat64:Ff},Symbol.toStringTag,{value:"Module"}));class Gt extends le{}function Yt(r){return(t,e,i)=>{if(t.setValid(e,i!=null))return r(t,e,i)}}const SF=(r,t,e)=>{r[t]=Math.floor(e/864e5)},sb=(r,t,e,i)=>{if(e+1{const n=r+e;i?t[n>>3]|=1<>3]&=~(1<{r[t]=e},Pf=({values:r},t,e)=>{r[t]=e},ob=({values:r},t,e)=>{r[t]=nb(e)},IF=(r,t,e)=>{switch(r.type.precision){case Cr.HALF:return ob(r,t,e);case Cr.SINGLE:case Cr.DOUBLE:return Pf(r,t,e)}},ab=({values:r},t,e)=>{SF(r,t,e.valueOf())},lb=({values:r},t,e)=>{r[t]=BigInt(e)},EF=({stride:r,values:t},e,i)=>{t.set(i.subarray(0,r),r*e)},ub=({values:r,valueOffsets:t},e,i)=>sb(r,t,e,i),cb=({values:r,valueOffsets:t},e,i)=>sb(r,t,e,A0(i)),CF=(r,t,e)=>{r.type.unit===_n.DAY?ab(r,t,e):lb(r,t,e)},hb=({values:r},t,e)=>{r[t]=BigInt(e/1e3)},fb=({values:r},t,e)=>{r[t]=BigInt(e)},db=({values:r},t,e)=>{r[t]=BigInt(e*1e3)},pb=({values:r},t,e)=>{r[t]=BigInt(e*1e6)},AF=(r,t,e)=>{switch(r.type.unit){case Jt.SECOND:return hb(r,t,e);case Jt.MILLISECOND:return fb(r,t,e);case Jt.MICROSECOND:return db(r,t,e);case Jt.NANOSECOND:return pb(r,t,e)}},mb=({values:r},t,e)=>{r[t]=e},yb=({values:r},t,e)=>{r[t]=e},gb=({values:r},t,e)=>{r[t]=e},vb=({values:r},t,e)=>{r[t]=e},OF=(r,t,e)=>{switch(r.type.unit){case Jt.SECOND:return mb(r,t,e);case Jt.MILLISECOND:return yb(r,t,e);case Jt.MICROSECOND:return gb(r,t,e);case Jt.NANOSECOND:return vb(r,t,e)}},FF=({values:r,stride:t},e,i)=>{r.set(i.subarray(0,t),t*e)},PF=(r,t,e)=>{const i=r.children[0],n=r.valueOffsets,s=Ei.getVisitFn(i);if(Array.isArray(e))for(let o=-1,a=n[t],l=n[t+1];a{const i=r.children[0],{valueOffsets:n}=r,s=Ei.getVisitFn(i);let{[t]:o,[t+1]:a}=n;const l=e instanceof Map?e.entries():Object.entries(e);for(const u of l)if(s(i,o,u),++o>=a)break},DF=(r,t)=>(e,i,n,s)=>i&&e(i,r,t[s]),RF=(r,t)=>(e,i,n,s)=>i&&e(i,r,t.get(s)),NF=(r,t)=>(e,i,n,s)=>i&&e(i,r,t.get(n.name)),LF=(r,t)=>(e,i,n,s)=>i&&e(i,r,t[n.name]),BF=(r,t,e)=>{const i=r.type.children.map(s=>Ei.getVisitFn(s.type)),n=e instanceof Map?NF(t,e):e instanceof Qe?RF(t,e):Array.isArray(e)?DF(t,e):LF(t,e);r.type.children.forEach((s,o)=>n(i[o],r.children[o],s,o))},kF=(r,t,e)=>{r.type.mode===Ii.Dense?_b(r,t,e):bb(r,t,e)},_b=(r,t,e)=>{const i=r.type.typeIdToChildIndex[r.typeIds[t]],n=r.children[i];Ei.visit(n,r.valueOffsets[t],e)},bb=(r,t,e)=>{const i=r.type.typeIdToChildIndex[r.typeIds[t]],n=r.children[i];Ei.visit(n,t,e)},UF=(r,t,e)=>{var i;(i=r.dictionary)===null||i===void 0||i.set(r.values[t],e)},zF=(r,t,e)=>{r.type.unit===ns.DAY_TIME?wb(r,t,e):xb(r,t,e)},wb=({values:r},t,e)=>{r.set(e.subarray(0,2),2*t)},xb=({values:r},t,e)=>{r[t]=e[0]*12+e[1]%12},Sb=({values:r},t,e)=>{r[t]=e},Tb=({values:r},t,e)=>{r[t]=e},Ib=({values:r},t,e)=>{r[t]=e},Eb=({values:r},t,e)=>{r[t]=e},jF=(r,t,e)=>{switch(r.type.unit){case Jt.SECOND:return Sb(r,t,e);case Jt.MILLISECOND:return Tb(r,t,e);case Jt.MICROSECOND:return Ib(r,t,e);case Jt.NANOSECOND:return Eb(r,t,e)}},$F=(r,t,e)=>{const{stride:i}=r,n=r.children[0],s=Ei.getVisitFn(n);if(Array.isArray(e))for(let o=-1,a=t*i;++o`${eo(t)}: ${eo(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new VF(this[Zr],this[Hs])}}class VF{constructor(t,e){this.childIndex=0,this.children=t.children,this.rowIndex=e,this.childFields=t.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){const t=this.childIndex;return te.name)}has(t,e){return t[Zr].type.children.some(i=>i.name===e)}getOwnPropertyDescriptor(t,e){if(t[Zr].type.children.some(i=>i.name===e))return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const i=t[Zr].type.children.findIndex(n=>n.name===e);if(i!==-1){const n=Yr.visit(t[Zr].children[i],t[Hs]);return Reflect.set(t,e,n),n}}set(t,e,i){const n=t[Zr].type.children.findIndex(s=>s.name===e);return n!==-1?(Ei.visit(t[Zr].children[n],t[Hs],i),Reflect.set(t,e,i)):Reflect.has(t,e)||typeof e=="symbol"?Reflect.set(t,e,i):!1}}const WF=new GF;class Lt extends le{}function Wt(r){return(t,e)=>t.getValid(e)?r(t,e):null}const HF=(r,t)=>864e5*r[t],XF=(r,t)=>null,Cb=(r,t,e)=>{if(e+1>=t.length)return null;const i=ar(t[e]),n=ar(t[e+1]);return r.subarray(i,n)},YF=({offset:r,values:t},e)=>{const i=r+e;return(t[i>>3]&1<HF(r,t),Ob=({values:r},t)=>ar(r[t]),xn=({stride:r,values:t},e)=>t[r*e],qF=({stride:r,values:t},e)=>Ff(t[r*e]),Fb=({values:r},t)=>r[t],QF=({stride:r,values:t},e)=>t.subarray(r*e,r*(e+1)),Pb=({values:r,valueOffsets:t},e)=>Cb(r,t,e),Mb=({values:r,valueOffsets:t},e)=>{const i=Cb(r,t,e);return i!==null?F2(i):null},KF=({values:r},t)=>r[t],ZF=({type:r,values:t},e)=>r.precision!==Cr.HALF?t[e]:Ff(t[e]),JF=(r,t)=>r.type.unit===_n.DAY?Ab(r,t):Ob(r,t),Db=({values:r},t)=>1e3*ar(r[t]),Rb=({values:r},t)=>ar(r[t]),Nb=({values:r},t)=>P0(r[t],BigInt(1e3)),Lb=({values:r},t)=>P0(r[t],BigInt(1e6)),tP=(r,t)=>{switch(r.type.unit){case Jt.SECOND:return Db(r,t);case Jt.MILLISECOND:return Rb(r,t);case Jt.MICROSECOND:return Nb(r,t);case Jt.NANOSECOND:return Lb(r,t)}},Bb=({values:r},t)=>r[t],kb=({values:r},t)=>r[t],Ub=({values:r},t)=>r[t],zb=({values:r},t)=>r[t],eP=(r,t)=>{switch(r.type.unit){case Jt.SECOND:return Bb(r,t);case Jt.MILLISECOND:return kb(r,t);case Jt.MICROSECOND:return Ub(r,t);case Jt.NANOSECOND:return zb(r,t)}},rP=({values:r,stride:t},e)=>su.decimal(r.subarray(t*e,t*(e+1))),iP=(r,t)=>{const{valueOffsets:e,stride:i,children:n}=r,{[t*i]:s,[t*i+1]:o}=e,l=n[0].slice(s,o-s);return new Qe([l])},nP=(r,t)=>{const{valueOffsets:e,children:i}=r,{[t]:n,[t+1]:s}=e,o=i[0];return new Df(o.slice(n,s-n))},sP=(r,t)=>new Mf(r,t),oP=(r,t)=>r.type.mode===Ii.Dense?jb(r,t):$b(r,t),jb=(r,t)=>{const e=r.type.typeIdToChildIndex[r.typeIds[t]],i=r.children[e];return Yr.visit(i,r.valueOffsets[t])},$b=(r,t)=>{const e=r.type.typeIdToChildIndex[r.typeIds[t]],i=r.children[e];return Yr.visit(i,t)},aP=(r,t)=>{var e;return(e=r.dictionary)===null||e===void 0?void 0:e.get(r.values[t])},lP=(r,t)=>r.type.unit===ns.DAY_TIME?Vb(r,t):Gb(r,t),Vb=({values:r},t)=>r.subarray(2*t,2*(t+1)),Gb=({values:r},t)=>{const e=r[t],i=new Int32Array(2);return i[0]=Math.trunc(e/12),i[1]=Math.trunc(e%12),i},Wb=({values:r},t)=>r[t],Hb=({values:r},t)=>r[t],Xb=({values:r},t)=>r[t],Yb=({values:r},t)=>r[t],uP=(r,t)=>{switch(r.type.unit){case Jt.SECOND:return Wb(r,t);case Jt.MILLISECOND:return Hb(r,t);case Jt.MICROSECOND:return Xb(r,t);case Jt.NANOSECOND:return Yb(r,t)}},cP=(r,t)=>{const{stride:e,children:i}=r,s=i[0].slice(t*e,e);return new Qe([s])};Lt.prototype.visitNull=Wt(XF);Lt.prototype.visitBool=Wt(YF);Lt.prototype.visitInt=Wt(KF);Lt.prototype.visitInt8=Wt(xn);Lt.prototype.visitInt16=Wt(xn);Lt.prototype.visitInt32=Wt(xn);Lt.prototype.visitInt64=Wt(Fb);Lt.prototype.visitUint8=Wt(xn);Lt.prototype.visitUint16=Wt(xn);Lt.prototype.visitUint32=Wt(xn);Lt.prototype.visitUint64=Wt(Fb);Lt.prototype.visitFloat=Wt(ZF);Lt.prototype.visitFloat16=Wt(qF);Lt.prototype.visitFloat32=Wt(xn);Lt.prototype.visitFloat64=Wt(xn);Lt.prototype.visitUtf8=Wt(Mb);Lt.prototype.visitLargeUtf8=Wt(Mb);Lt.prototype.visitBinary=Wt(Pb);Lt.prototype.visitLargeBinary=Wt(Pb);Lt.prototype.visitFixedSizeBinary=Wt(QF);Lt.prototype.visitDate=Wt(JF);Lt.prototype.visitDateDay=Wt(Ab);Lt.prototype.visitDateMillisecond=Wt(Ob);Lt.prototype.visitTimestamp=Wt(tP);Lt.prototype.visitTimestampSecond=Wt(Db);Lt.prototype.visitTimestampMillisecond=Wt(Rb);Lt.prototype.visitTimestampMicrosecond=Wt(Nb);Lt.prototype.visitTimestampNanosecond=Wt(Lb);Lt.prototype.visitTime=Wt(eP);Lt.prototype.visitTimeSecond=Wt(Bb);Lt.prototype.visitTimeMillisecond=Wt(kb);Lt.prototype.visitTimeMicrosecond=Wt(Ub);Lt.prototype.visitTimeNanosecond=Wt(zb);Lt.prototype.visitDecimal=Wt(rP);Lt.prototype.visitList=Wt(iP);Lt.prototype.visitStruct=Wt(sP);Lt.prototype.visitUnion=Wt(oP);Lt.prototype.visitDenseUnion=Wt(jb);Lt.prototype.visitSparseUnion=Wt($b);Lt.prototype.visitDictionary=Wt(aP);Lt.prototype.visitInterval=Wt(lP);Lt.prototype.visitIntervalDayTime=Wt(Vb);Lt.prototype.visitIntervalYearMonth=Wt(Gb);Lt.prototype.visitDuration=Wt(uP);Lt.prototype.visitDurationSecond=Wt(Wb);Lt.prototype.visitDurationMillisecond=Wt(Hb);Lt.prototype.visitDurationMicrosecond=Wt(Xb);Lt.prototype.visitDurationNanosecond=Wt(Yb);Lt.prototype.visitFixedSizeList=Wt(cP);Lt.prototype.visitMap=Wt(nP);const Yr=new Lt,Ms=Symbol.for("keys"),Xs=Symbol.for("vals"),Ds=Symbol.for("kKeysAsStrings"),wh=Symbol.for("_kKeysAsStrings");class Df{constructor(t){return this[Ms]=new Qe([t.children[0]]).memoize(),this[Xs]=t.children[1],new Proxy(this,new fP)}get[Ds](){return this[wh]||(this[wh]=Array.from(this[Ms].toArray(),String))}[Symbol.iterator](){return new hP(this[Ms],this[Xs])}get size(){return this[Ms].length}toArray(){return Object.values(this.toJSON())}toJSON(){const t=this[Ms],e=this[Xs],i={};for(let n=-1,s=t.length;++n`${eo(t)}: ${eo(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}}class hP{constructor(t,e){this.keys=t,this.vals=e,this.keyIndex=0,this.numKeys=t.length}[Symbol.iterator](){return this}next(){const t=this.keyIndex;return t===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(t),Yr.visit(this.vals,t)]})}}class fP{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[Ds]}has(t,e){return t[Ds].includes(e)}getOwnPropertyDescriptor(t,e){if(t[Ds].indexOf(e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const i=t[Ds].indexOf(e);if(i!==-1){const n=Yr.visit(Reflect.get(t,Xs),i);return Reflect.set(t,e,n),n}}set(t,e,i){const n=t[Ds].indexOf(e);return n!==-1?(Ei.visit(Reflect.get(t,Xs),n,i),Reflect.set(t,e,i)):Reflect.has(t,e)?Reflect.set(t,e,i):!1}}Object.defineProperties(Df.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[Ms]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Xs]:{writable:!0,enumerable:!1,configurable:!1,value:null},[wh]:{writable:!0,enumerable:!1,configurable:!1,value:null}});let lm;function qb(r,t,e,i){const{length:n=0}=r;let s=typeof t!="number"?0:t,o=typeof e!="number"?n:e;return s<0&&(s=(s%n+n)%n),o<0&&(o=(o%n+n)%n),on&&(o=n),i?i(r,s,o):[s,o]}const Qb=(r,t)=>r<0?t+r:r,um=r=>r!==r;function cs(r){if(typeof r!=="object"||r===null)return um(r)?um:e=>e===r;if(r instanceof Date){const e=r.valueOf();return i=>i instanceof Date?i.valueOf()===e:!1}return ArrayBuffer.isView(r)?e=>e?F0(r,e):!1:r instanceof Map?pP(r):Array.isArray(r)?dP(r):r instanceof Qe?mP(r):yP(r,!0)}function dP(r){const t=[];for(let e=-1,i=r.length;++e!1;const i=[];for(let n=-1,s=e.length;++n{if(!e||typeof e!="object")return!1;switch(e.constructor){case Array:return gP(r,e);case Map:return cm(r,e,e.keys());case Df:case Mf:case Object:case void 0:return cm(r,e,t||Object.keys(e))}return e instanceof Qe?vP(r,e):!1}}function gP(r,t){const e=r.length;if(t.length!==e)return!1;for(let i=-1;++i>i}function bP(r,t,e){return e?!!(r[t>>3]|=1<>3]&=~(1<0||e.byteLength>3):Zb(new au(e,r,t,null,Rf)).subarray(0,i)),n}return e}function Zb(r){const t=[];let e=0,i=0,n=0;for(const o of r)o&&(n|=1<0)&&(t[e++]=n);const s=new Uint8Array(t.length+7&-8);return s.set(t),s}class au{constructor(t,e,i,n,s){this.bytes=t,this.length=i,this.context=n,this.get=s,this.bit=e%8,this.byteIndex=e>>3,this.byte=t[this.byteIndex++],this.index=0}next(){return this.index>3<<3,n=t+(t%8===0?0:8-t%8);return Bl(r,t,n)+Bl(r,i,e)+Jb(r,n>>3,i-n>>3)}function Jb(r,t,e){let i=0,n=Math.trunc(t);const s=new DataView(r.buffer,r.byteOffset,r.byteLength),o=e===void 0?r.byteLength:n+e;for(;o-n>=4;)i+=qa(s.getUint32(n)),n+=4;for(;o-n>=2;)i+=qa(s.getUint16(n)),n+=2;for(;o-n>=1;)i+=qa(s.getUint8(n)),n+=1;return i}function qa(r){let t=Math.trunc(r);return t=t-(t>>>1&1431655765),t=(t&858993459)+(t>>>2&858993459),(t+(t>>>4)&252645135)*16843009>>>24}const wP=Object.freeze(Object.defineProperty({__proto__:null,BitIterator:au,getBit:Kb,getBool:Rf,packBools:Zb,popcnt_array:Jb,popcnt_bit_range:Bl,popcnt_uint32:qa,setBool:bP,truncateBitmap:xh},Symbol.toStringTag,{value:"Module"})),xP=-1;class ta{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){const{type:t}=this;return Et.isSparseUnion(t)?this.children.some(e=>e.nullable):Et.isDenseUnion(t)?this.children.some(e=>e.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let t=0;const{valueOffsets:e,values:i,nullBitmap:n,typeIds:s}=this;return e&&(t+=e.byteLength),i&&(t+=i.byteLength),n&&(t+=n.byteLength),s&&(t+=s.byteLength),this.children.reduce((o,a)=>o+a.byteLength,t)}get nullCount(){if(Et.isUnion(this.type))return this.children.reduce((i,n)=>i+n.nullCount,0);let t=this._nullCount,e;return t<=xP&&(e=this.nullBitmap)&&(this._nullCount=t=e.length===0?0:this.length-Bl(e,this.offset,this.offset+this.length)),t}constructor(t,e,i,n,s,o=[],a){this.type=t,this.children=o,this.dictionary=a,this.offset=Math.floor(Math.max(e||0,0)),this.length=Math.floor(Math.max(i||0,0)),this._nullCount=Math.floor(Math.max(n||0,-1));let l;s instanceof ta?(this.stride=s.stride,this.values=s.values,this.typeIds=s.typeIds,this.nullBitmap=s.nullBitmap,this.valueOffsets=s.valueOffsets):(this.stride=rb(t),s&&((l=s[0])&&(this.valueOffsets=l),(l=s[1])&&(this.values=l),(l=s[2])&&(this.nullBitmap=l),(l=s[3])&&(this.typeIds=l)))}getValid(t){const{type:e}=this;if(Et.isUnion(e)){const i=e,n=this.children[i.typeIdToChildIndex[this.typeIds[t]]],s=i.mode===Ii.Dense?this.valueOffsets[t]:t;return n.getValid(s)}if(this.nullable&&this.nullCount>0){const i=this.offset+t;return(this.nullBitmap[i>>3]&1<>3;(!s||s.byteLength<=c)&&(s=new Uint8Array((o+a+63&-64)>>3).fill(255),this.nullCount>0?(s.set(xh(o,a,this.nullBitmap),0),Object.assign(this,{nullBitmap:s})):Object.assign(this,{nullBitmap:s,_nullCount:0}));const h=s[c];i=(h&u)!==0,s[c]=e?h|u:h&~u}return i!==!!e&&(this._nullCount=this.nullCount+(e?-1:1)),e}clone(t=this.type,e=this.offset,i=this.length,n=this._nullCount,s=this,o=this.children){return new ta(t,e,i,n,s,o,this.dictionary)}slice(t,e){const{stride:i,typeId:n,children:s}=this,o=+(this._nullCount===0)-1,a=n===16?i:1,l=this._sliceBuffers(t,e,i,n);return this.clone(this.type,this.offset+t,e,o,l,s.length===0||this.valueOffsets?s:this._sliceChildren(s,a*t,a*e))}_changeLengthAndBackfillNullBitmap(t){if(this.typeId===W.Null)return this.clone(this.type,0,t,0);const{length:e,nullCount:i}=this,n=new Uint8Array((t+63&-64)>>3).fill(255,0,e>>3);n[e>>3]=(1<0&&n.set(xh(this.offset,e,this.nullBitmap),0);const s=this.buffers;return s[zi.VALIDITY]=n,this.clone(this.type,0,t,i+(t-e),s)}_sliceBuffers(t,e,i,n){let s;const{buffers:o}=this;return(s=o[zi.TYPE])&&(o[zi.TYPE]=s.subarray(t,t+e)),(s=o[zi.OFFSET])&&(o[zi.OFFSET]=s.subarray(t,t+e+1))||(s=o[zi.DATA])&&(o[zi.DATA]=n===6?s:s.subarray(i*t,i*(t+e))),o}_sliceChildren(t,e,i){return t.map(n=>n.slice(e,i))}}ta.prototype.children=Object.freeze([]);class hm{constructor(t=0,e){this.numChunks=t,this.getChunkIterator=e,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndext.nullable)}function TP(r){return r.reduce((t,e)=>t+e.nullCount,0)}function IP(r){return r.reduce((t,e,i)=>(t[i+1]=t[i]+e.length,t),new Uint32Array(r.length+1))}function EP(r,t,e,i){const n=[];for(let s=-1,o=r.length;++s=i)break;if(e>=l+u)continue;if(l>=e&&l+u<=i){n.push(a);continue}const c=Math.max(0,e-l),h=Math.min(i-l,u);n.push(a.slice(c,h-c))}return n.length===0&&n.push(r[0].slice(0,0)),n}function Nf(r,t,e,i){let n=0,s=0,o=t.length-1;do{if(n>=o-1)return e0?0:-1}function FP(r,t){const{nullBitmap:e}=r;if(!e||r.nullCount<=0)return-1;let i=0;for(const n of new au(e,r.offset+(t||0),r.length,e,Rf)){if(!n)return i;++i}return-1}function Kt(r,t,e){if(t===void 0)return-1;if(t===null)switch(r.typeId){case W.Union:break;case W.Dictionary:break;default:return FP(r,e)}const i=Yr.getVisitFn(r),n=cs(t);for(let s=(e||0)-1,o=r.length;++s{const n=r.data[i];return n.values.subarray(0,n.length)[Symbol.iterator]()});let e=0;return new hm(r.data.length,i=>{const s=r.data[i].length,o=r.slice(e,e+s);return e+=s,new PP(o)})}class PP{constructor(t){this.vector=t,this.index=0}next(){return this.indexa.data):t;if(s.length===0||s.some(a=>!(a instanceof ta)))throw new TypeError("Vector constructor expects an Array of Data instances.");const o=(e=s[0])===null||e===void 0?void 0:e.type;switch(s.length){case 0:this._offsets=[0];break;case 1:{const{get:a,set:l,indexOf:u}=iw[o.typeId],c=s[0];this.isValid=h=>tw(c,h),this.get=h=>a(c,h),this.set=(h,p)=>l(c,h,p),this.indexOf=h=>u(c,h),this._offsets=[0,c.length];break}default:Object.setPrototypeOf(this,nw[o.typeId]),this._offsets=IP(s);break}this.data=s,this.type=o,this.stride=rb(o),this.numChildren=(n=(i=o.children)===null||i===void 0?void 0:i.length)!==null&&n!==void 0?n:0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((t,e)=>t+e.byteLength,0)}get nullable(){return SP(this.data)}get nullCount(){return TP(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${W[this.type.typeId]}Vector`}isValid(t){return!1}get(t){return null}at(t){return this.get(Qb(t,this.length))}set(t,e){}indexOf(t,e){return-1}includes(t,e){return this.indexOf(t,e)>-1}[Symbol.iterator](){return MP.visit(this)}concat(...t){return new Qe(this.data.concat(t.flatMap(e=>e.data).flat(Number.POSITIVE_INFINITY)))}slice(t,e){return new Qe(qb(this,t,e,({data:i,_offsets:n},s,o)=>EP(i,n,s,o)))}toJSON(){return[...this]}toArray(){const{type:t,data:e,length:i,stride:n,ArrayType:s}=this;switch(t.typeId){case W.Int:case W.Float:case W.Decimal:case W.Time:case W.Timestamp:switch(e.length){case 0:return new s;case 1:return e[0].values.subarray(0,i*n);default:return e.reduce((o,{values:a,length:l})=>(o.array.set(a.subarray(0,l*n),o.offset),o.offset+=l*n,o),{array:new s(i*n),offset:0}).array}}return[...this]}toString(){return`[${[...this].join(",")}]`}getChild(t){var e;return this.getChildAt((e=this.type.children)===null||e===void 0?void 0:e.findIndex(i=>i.name===t))}getChildAt(t){return t>-1&&te[t])):null}get isMemoized(){return Et.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(Et.isDictionary(this.type)){const t=new kl(this.data[0].dictionary),e=this.data.map(i=>{const n=i.clone();return n.dictionary=t,n});return new Qe(e)}return new kl(this)}unmemoize(){if(Et.isDictionary(this.type)&&this.isMemoized){const t=this.data[0].dictionary.unmemoize(),e=this.data.map(i=>{const n=i.clone();return n.dictionary=t,n});return new Qe(e)}return this}}rw=Symbol.toStringTag;Qe[rw]=(r=>{r.type=Et.prototype,r.data=[],r.length=0,r.stride=1,r.numChildren=0,r._offsets=new Uint32Array([0]),r[Symbol.isConcatSpreadable]=!0;const t=Object.keys(W).map(e=>W[e]).filter(e=>typeof e=="number"&&e!==W.NONE);for(const e of t){const i=Yr.getVisitFnByTypeId(e),n=Ei.getVisitFnByTypeId(e),s=dm.getVisitFnByTypeId(e);iw[e]={get:i,set:n,indexOf:s},nw[e]=Object.create(r,{isValid:{value:fm(tw)},get:{value:fm(Yr.getVisitFnByTypeId(e))},set:{value:CP(Ei.getVisitFnByTypeId(e))},indexOf:{value:AP(dm.getVisitFnByTypeId(e))}})}return"Vector"})(Qe.prototype);class kl extends Qe{constructor(t){super(t.data);const e=this.get,i=this.set,n=this.slice,s=new Array(this.length);Object.defineProperty(this,"get",{value(o){const a=s[o];if(a!==void 0)return a;const l=e.call(this,o);return s[o]=l,l}}),Object.defineProperty(this,"set",{value(o,a){i.call(this,o,a),s[o]=a}}),Object.defineProperty(this,"slice",{value:(o,a)=>new kl(n.call(this,o,a))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new Qe(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}}const DP=65536;function Ls(r){return r<0&&(r=4294967295+r+1),`0x${r.toString(16)}`}const io=8,Lf=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8];class Bf{constructor(t){this.buffer=t}high(){return this.buffer[1]}low(){return this.buffer[0]}_times(t){const e=new Uint32Array([this.buffer[1]>>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),i=new Uint32Array([t.buffer[1]>>>16,t.buffer[1]&65535,t.buffer[0]>>>16,t.buffer[0]&65535]);let n=e[3]*i[3];this.buffer[0]=n&65535;let s=n>>>16;return n=e[2]*i[3],s+=n,n=e[3]*i[2]>>>0,s+=n,this.buffer[0]+=s<<16,this.buffer[1]=s>>>0>>16,this.buffer[1]+=e[1]*i[3]+e[2]*i[2]+e[3]*i[1],this.buffer[1]+=e[0]*i[3]+e[1]*i[2]+e[2]*i[1]+e[3]*i[0]<<16,this}_plus(t){const e=this.buffer[0]+t.buffer[0]>>>0;this.buffer[1]+=t.buffer[1],e>>0&&++this.buffer[1],this.buffer[0]=e}lessThan(t){return this.buffer[1]>>0,e[2]=this.buffer[2]+t.buffer[2]>>>0,e[1]=this.buffer[1]+t.buffer[1]>>>0,e[0]=this.buffer[0]+t.buffer[0]>>>0,e[0]>>0&&++e[1],e[1]>>0&&++e[2],e[2]>>0&&++e[3],this.buffer[3]=e[3],this.buffer[2]=e[2],this.buffer[1]=e[1],this.buffer[0]=e[0],this}hex(){return`${Ls(this.buffer[3])} ${Ls(this.buffer[2])} ${Ls(this.buffer[1])} ${Ls(this.buffer[0])}`}static multiply(t,e){return new ci(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new ci(new Uint32Array(t.buffer)).plus(e)}static from(t,e=new Uint32Array(4)){return ci.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(4)){return ci.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(4)){const i=t.startsWith("-"),n=t.length,s=new ci(e);for(let o=i?1:0;othis.compareFields(i,e[n]))}compareFields(t,e){return t===e||e instanceof t.constructor&&t.name===e.name&&t.nullable===e.nullable&&this.visit(t.type,e.type)}}function ur(r,t){return t instanceof r.constructor}function hs(r,t){return r===t||ur(r,t)}function Qi(r,t){return r===t||ur(r,t)&&r.bitWidth===t.bitWidth&&r.isSigned===t.isSigned}function lu(r,t){return r===t||ur(r,t)&&r.precision===t.precision}function NP(r,t){return r===t||ur(r,t)&&r.byteWidth===t.byteWidth}function kf(r,t){return r===t||ur(r,t)&&r.unit===t.unit}function fa(r,t){return r===t||ur(r,t)&&r.unit===t.unit&&r.timezone===t.timezone}function da(r,t){return r===t||ur(r,t)&&r.unit===t.unit&&r.bitWidth===t.bitWidth}function LP(r,t){return r===t||ur(r,t)&&r.children.length===t.children.length&&Ci.compareManyFields(r.children,t.children)}function BP(r,t){return r===t||ur(r,t)&&r.children.length===t.children.length&&Ci.compareManyFields(r.children,t.children)}function Uf(r,t){return r===t||ur(r,t)&&r.mode===t.mode&&r.typeIds.every((e,i)=>e===t.typeIds[i])&&Ci.compareManyFields(r.children,t.children)}function kP(r,t){return r===t||ur(r,t)&&r.id===t.id&&r.isOrdered===t.isOrdered&&Ci.visit(r.indices,t.indices)&&Ci.visit(r.dictionary,t.dictionary)}function zf(r,t){return r===t||ur(r,t)&&r.unit===t.unit}function pa(r,t){return r===t||ur(r,t)&&r.unit===t.unit}function UP(r,t){return r===t||ur(r,t)&&r.listSize===t.listSize&&r.children.length===t.children.length&&Ci.compareManyFields(r.children,t.children)}function zP(r,t){return r===t||ur(r,t)&&r.keysSorted===t.keysSorted&&r.children.length===t.children.length&&Ci.compareManyFields(r.children,t.children)}Ut.prototype.visitNull=hs;Ut.prototype.visitBool=hs;Ut.prototype.visitInt=Qi;Ut.prototype.visitInt8=Qi;Ut.prototype.visitInt16=Qi;Ut.prototype.visitInt32=Qi;Ut.prototype.visitInt64=Qi;Ut.prototype.visitUint8=Qi;Ut.prototype.visitUint16=Qi;Ut.prototype.visitUint32=Qi;Ut.prototype.visitUint64=Qi;Ut.prototype.visitFloat=lu;Ut.prototype.visitFloat16=lu;Ut.prototype.visitFloat32=lu;Ut.prototype.visitFloat64=lu;Ut.prototype.visitUtf8=hs;Ut.prototype.visitLargeUtf8=hs;Ut.prototype.visitBinary=hs;Ut.prototype.visitLargeBinary=hs;Ut.prototype.visitFixedSizeBinary=NP;Ut.prototype.visitDate=kf;Ut.prototype.visitDateDay=kf;Ut.prototype.visitDateMillisecond=kf;Ut.prototype.visitTimestamp=fa;Ut.prototype.visitTimestampSecond=fa;Ut.prototype.visitTimestampMillisecond=fa;Ut.prototype.visitTimestampMicrosecond=fa;Ut.prototype.visitTimestampNanosecond=fa;Ut.prototype.visitTime=da;Ut.prototype.visitTimeSecond=da;Ut.prototype.visitTimeMillisecond=da;Ut.prototype.visitTimeMicrosecond=da;Ut.prototype.visitTimeNanosecond=da;Ut.prototype.visitDecimal=hs;Ut.prototype.visitList=LP;Ut.prototype.visitStruct=BP;Ut.prototype.visitUnion=Uf;Ut.prototype.visitDenseUnion=Uf;Ut.prototype.visitSparseUnion=Uf;Ut.prototype.visitDictionary=kP;Ut.prototype.visitInterval=zf;Ut.prototype.visitIntervalDayTime=zf;Ut.prototype.visitIntervalYearMonth=zf;Ut.prototype.visitDuration=pa;Ut.prototype.visitDurationSecond=pa;Ut.prototype.visitDurationMillisecond=pa;Ut.prototype.visitDurationMicrosecond=pa;Ut.prototype.visitDurationNanosecond=pa;Ut.prototype.visitFixedSizeList=UP;Ut.prototype.visitMap=zP;const Ci=new Ut;function jP(r,t){return Ci.compareSchemas(r,t)}function $P(r,t){return Ci.compareFields(r,t)}function VP(r,t){return Ci.visit(r,t)}const pm=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},_F),RP),wP),xF),pF),_P),yF),{compareSchemas:jP,compareFields:$P,compareTypes:VP}),sw=6048e5,GP=864e5,mm=Symbol.for("constructDateFrom");function Gi(r,t){return typeof r=="function"?r(t):r&&typeof r=="object"&&mm in r?r[mm](t):r instanceof Date?new r.constructor(t):new Date(t)}function qr(r,t){return Gi(t||r,r)}let WP={};function uu(){return WP}function ea(r,t){var a,l,u,c;const e=uu(),i=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??e.weekStartsOn??((c=(u=e.locale)==null?void 0:u.options)==null?void 0:c.weekStartsOn)??0,n=qr(r,t==null?void 0:t.in),s=n.getDay(),o=(s=s.getTime()?i+1:e.getTime()>=a.getTime()?i:i-1}function ym(r){const t=qr(r),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+r-+e}function HP(r,...t){const e=Gi.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function gm(r,t){const e=qr(r,t==null?void 0:t.in);return e.setHours(0,0,0,0),e}function XP(r,t,e){const[i,n]=HP(e==null?void 0:e.in,r,t),s=gm(i),o=gm(n),a=+s-ym(s),l=+o-ym(o);return Math.round((a-l)/GP)}function YP(r,t){const e=ow(r,t),i=Gi(r,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),Ul(i)}function qP(r){return r instanceof Date||typeof r=="object"&&Object.prototype.toString.call(r)==="[object Date]"}function QP(r){return!(!qP(r)&&typeof r!="number"||isNaN(+qr(r)))}function KP(r,t){const e=qr(r,t==null?void 0:t.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}const ZP={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},JP=(r,t,e)=>{let i;const n=ZP[r];return typeof n=="string"?i=n:t===1?i=n.one:i=n.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function nc(r){return(t={})=>{const e=t.width?String(t.width):r.defaultWidth;return r.formats[e]||r.formats[r.defaultWidth]}}const tM={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},eM={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},rM={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},iM={date:nc({formats:tM,defaultWidth:"full"}),time:nc({formats:eM,defaultWidth:"full"}),dateTime:nc({formats:rM,defaultWidth:"full"})},nM={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},sM=(r,t,e,i)=>nM[r];function go(r){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let n;if(i==="formatting"&&r.formattingValues){const o=r.defaultFormattingWidth||r.defaultWidth,a=e!=null&&e.width?String(e.width):o;n=r.formattingValues[a]||r.formattingValues[o]}else{const o=r.defaultWidth,a=e!=null&&e.width?String(e.width):r.defaultWidth;n=r.values[a]||r.values[o]}const s=r.argumentCallback?r.argumentCallback(t):t;return n[s]}}const oM={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},aM={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},lM={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},uM={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},cM={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},hM={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},fM=(r,t)=>{const e=Number(r),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},dM={ordinalNumber:fM,era:go({values:oM,defaultWidth:"wide"}),quarter:go({values:aM,defaultWidth:"wide",argumentCallback:r=>r-1}),month:go({values:lM,defaultWidth:"wide"}),day:go({values:uM,defaultWidth:"wide"}),dayPeriod:go({values:cM,defaultWidth:"wide",formattingValues:hM,defaultFormattingWidth:"wide"})};function vo(r){return(t,e={})=>{const i=e.width,n=i&&r.matchPatterns[i]||r.matchPatterns[r.defaultMatchWidth],s=t.match(n);if(!s)return null;const o=s[0],a=i&&r.parsePatterns[i]||r.parsePatterns[r.defaultParseWidth],l=Array.isArray(a)?mM(a,h=>h.test(o)):pM(a,h=>h.test(o));let u;u=r.valueCallback?r.valueCallback(l):l,u=e.valueCallback?e.valueCallback(u):u;const c=t.slice(o.length);return{value:u,rest:c}}}function pM(r,t){for(const e in r)if(Object.prototype.hasOwnProperty.call(r,e)&&t(r[e]))return e}function mM(r,t){for(let e=0;e{const i=t.match(r.matchPattern);if(!i)return null;const n=i[0],s=t.match(r.parsePattern);if(!s)return null;let o=r.valueCallback?r.valueCallback(s[0]):s[0];o=e.valueCallback?e.valueCallback(o):o;const a=t.slice(n.length);return{value:o,rest:a}}}const gM=/^(\d+)(th|st|nd|rd)?/i,vM=/\d+/i,_M={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},bM={any:[/^b/i,/^(a|c)/i]},wM={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},xM={any:[/1/i,/2/i,/3/i,/4/i]},SM={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},TM={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},IM={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},EM={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},CM={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},AM={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},OM={ordinalNumber:yM({matchPattern:gM,parsePattern:vM,valueCallback:r=>parseInt(r,10)}),era:vo({matchPatterns:_M,defaultMatchWidth:"wide",parsePatterns:bM,defaultParseWidth:"any"}),quarter:vo({matchPatterns:wM,defaultMatchWidth:"wide",parsePatterns:xM,defaultParseWidth:"any",valueCallback:r=>r+1}),month:vo({matchPatterns:SM,defaultMatchWidth:"wide",parsePatterns:TM,defaultParseWidth:"any"}),day:vo({matchPatterns:IM,defaultMatchWidth:"wide",parsePatterns:EM,defaultParseWidth:"any"}),dayPeriod:vo({matchPatterns:CM,defaultMatchWidth:"any",parsePatterns:AM,defaultParseWidth:"any"})},FM={code:"en-US",formatDistance:JP,formatLong:iM,formatRelative:sM,localize:dM,match:OM,options:{weekStartsOn:0,firstWeekContainsDate:1}};function PM(r,t){const e=qr(r,t==null?void 0:t.in);return XP(e,KP(e))+1}function MM(r,t){const e=qr(r,t==null?void 0:t.in),i=+Ul(e)-+YP(e);return Math.round(i/sw)+1}function aw(r,t){var c,h,p,f;const e=qr(r,t==null?void 0:t.in),i=e.getFullYear(),n=uu(),s=(t==null?void 0:t.firstWeekContainsDate)??((h=(c=t==null?void 0:t.locale)==null?void 0:c.options)==null?void 0:h.firstWeekContainsDate)??n.firstWeekContainsDate??((f=(p=n.locale)==null?void 0:p.options)==null?void 0:f.firstWeekContainsDate)??1,o=Gi((t==null?void 0:t.in)||r,0);o.setFullYear(i+1,0,s),o.setHours(0,0,0,0);const a=ea(o,t),l=Gi((t==null?void 0:t.in)||r,0);l.setFullYear(i,0,s),l.setHours(0,0,0,0);const u=ea(l,t);return+e>=+a?i+1:+e>=+u?i:i-1}function DM(r,t){var a,l,u,c;const e=uu(),i=(t==null?void 0:t.firstWeekContainsDate)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)??e.firstWeekContainsDate??((c=(u=e.locale)==null?void 0:u.options)==null?void 0:c.firstWeekContainsDate)??1,n=aw(r,t),s=Gi((t==null?void 0:t.in)||r,0);return s.setFullYear(n,0,i),s.setHours(0,0,0,0),ea(s,t)}function RM(r,t){const e=qr(r,t==null?void 0:t.in),i=+ea(e,t)-+DM(e,t);return Math.round(i/sw)+1}function ve(r,t){const e=r<0?"-":"",i=Math.abs(r).toString().padStart(t,"0");return e+i}const rn={y(r,t){const e=r.getFullYear(),i=e>0?e:1-e;return ve(t==="yy"?i%100:i,t.length)},M(r,t){const e=r.getMonth();return t==="M"?String(e+1):ve(e+1,2)},d(r,t){return ve(r.getDate(),t.length)},a(r,t){const e=r.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(r,t){return ve(r.getHours()%12||12,t.length)},H(r,t){return ve(r.getHours(),t.length)},m(r,t){return ve(r.getMinutes(),t.length)},s(r,t){return ve(r.getSeconds(),t.length)},S(r,t){const e=t.length,i=r.getMilliseconds(),n=Math.trunc(i*Math.pow(10,e-3));return ve(n,t.length)}},_s={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},vm={G:function(r,t,e){const i=r.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});case"GGGG":default:return e.era(i,{width:"wide"})}},y:function(r,t,e){if(t==="yo"){const i=r.getFullYear(),n=i>0?i:1-i;return e.ordinalNumber(n,{unit:"year"})}return rn.y(r,t)},Y:function(r,t,e,i){const n=aw(r,i),s=n>0?n:1-n;if(t==="YY"){const o=s%100;return ve(o,2)}return t==="Yo"?e.ordinalNumber(s,{unit:"year"}):ve(s,t.length)},R:function(r,t){const e=ow(r);return ve(e,t.length)},u:function(r,t){const e=r.getFullYear();return ve(e,t.length)},Q:function(r,t,e){const i=Math.ceil((r.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return ve(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(r,t,e){const i=Math.ceil((r.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return ve(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(r,t,e){const i=r.getMonth();switch(t){case"M":case"MM":return rn.M(r,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(r,t,e){const i=r.getMonth();switch(t){case"L":return String(i+1);case"LL":return ve(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(r,t,e,i){const n=RM(r,i);return t==="wo"?e.ordinalNumber(n,{unit:"week"}):ve(n,t.length)},I:function(r,t,e){const i=MM(r);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):ve(i,t.length)},d:function(r,t,e){return t==="do"?e.ordinalNumber(r.getDate(),{unit:"date"}):rn.d(r,t)},D:function(r,t,e){const i=PM(r);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):ve(i,t.length)},E:function(r,t,e){const i=r.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});case"EEEE":default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(r,t,e,i){const n=r.getDay(),s=(n-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return ve(s,2);case"eo":return e.ordinalNumber(s,{unit:"day"});case"eee":return e.day(n,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(n,{width:"short",context:"formatting"});case"eeee":default:return e.day(n,{width:"wide",context:"formatting"})}},c:function(r,t,e,i){const n=r.getDay(),s=(n-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return ve(s,t.length);case"co":return e.ordinalNumber(s,{unit:"day"});case"ccc":return e.day(n,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(n,{width:"narrow",context:"standalone"});case"cccccc":return e.day(n,{width:"short",context:"standalone"});case"cccc":default:return e.day(n,{width:"wide",context:"standalone"})}},i:function(r,t,e){const i=r.getDay(),n=i===0?7:i;switch(t){case"i":return String(n);case"ii":return ve(n,t.length);case"io":return e.ordinalNumber(n,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});case"iiii":default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(r,t,e){const n=r.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(r,t,e){const i=r.getHours();let n;switch(i===12?n=_s.noon:i===0?n=_s.midnight:n=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(r,t,e){const i=r.getHours();let n;switch(i>=17?n=_s.evening:i>=12?n=_s.afternoon:i>=4?n=_s.morning:n=_s.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(r,t,e){if(t==="ho"){let i=r.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return rn.h(r,t)},H:function(r,t,e){return t==="Ho"?e.ordinalNumber(r.getHours(),{unit:"hour"}):rn.H(r,t)},K:function(r,t,e){const i=r.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):ve(i,t.length)},k:function(r,t,e){let i=r.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):ve(i,t.length)},m:function(r,t,e){return t==="mo"?e.ordinalNumber(r.getMinutes(),{unit:"minute"}):rn.m(r,t)},s:function(r,t,e){return t==="so"?e.ordinalNumber(r.getSeconds(),{unit:"second"}):rn.s(r,t)},S:function(r,t){return rn.S(r,t)},X:function(r,t,e){const i=r.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return bm(i);case"XXXX":case"XX":return Vn(i);case"XXXXX":case"XXX":default:return Vn(i,":")}},x:function(r,t,e){const i=r.getTimezoneOffset();switch(t){case"x":return bm(i);case"xxxx":case"xx":return Vn(i);case"xxxxx":case"xxx":default:return Vn(i,":")}},O:function(r,t,e){const i=r.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+_m(i,":");case"OOOO":default:return"GMT"+Vn(i,":")}},z:function(r,t,e){const i=r.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+_m(i,":");case"zzzz":default:return"GMT"+Vn(i,":")}},t:function(r,t,e){const i=Math.trunc(+r/1e3);return ve(i,t.length)},T:function(r,t,e){return ve(+r,t.length)}};function _m(r,t=""){const e=r>0?"-":"+",i=Math.abs(r),n=Math.trunc(i/60),s=i%60;return s===0?e+String(n):e+String(n)+t+ve(s,2)}function bm(r,t){return r%60===0?(r>0?"-":"+")+ve(Math.abs(r)/60,2):Vn(r,t)}function Vn(r,t=""){const e=r>0?"-":"+",i=Math.abs(r),n=ve(Math.trunc(i/60),2),s=ve(i%60,2);return e+n+t+s}const wm=(r,t)=>{switch(r){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},lw=(r,t)=>{switch(r){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},NM=(r,t)=>{const e=r.match(/(P+)(p+)?/)||[],i=e[1],n=e[2];if(!n)return wm(r,t);let s;switch(i){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",wm(i,t)).replace("{{time}}",lw(n,t))},LM={p:lw,P:NM},BM=/^D+$/,kM=/^Y+$/,UM=["D","DD","YY","YYYY"];function zM(r){return BM.test(r)}function jM(r){return kM.test(r)}function $M(r,t,e){const i=VM(r,t,e);if(console.warn(i),UM.includes(r))throw new RangeError(i)}function VM(r,t,e){const i=r[0]==="Y"?"years":"days of the month";return`Use \`${r.toLowerCase()}\` instead of \`${r}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const GM=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,WM=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,HM=/^'([^]*?)'?$/,XM=/''/g,YM=/[a-zA-Z]/;function uw(r,t,e){var c,h,p,f;const i=uu(),n=i.locale??FM,s=i.firstWeekContainsDate??((h=(c=i.locale)==null?void 0:c.options)==null?void 0:h.firstWeekContainsDate)??1,o=i.weekStartsOn??((f=(p=i.locale)==null?void 0:p.options)==null?void 0:f.weekStartsOn)??0,a=qr(r,e==null?void 0:e.in);if(!QP(a))throw new RangeError("Invalid time value");let l=t.match(WM).map(y=>{const g=y[0];if(g==="p"||g==="P"){const d=LM[g];return d(y,n.formatLong)}return y}).join("").match(GM).map(y=>{if(y==="''")return{isToken:!1,value:"'"};const g=y[0];if(g==="'")return{isToken:!1,value:qM(y)};if(vm[g])return{isToken:!0,value:y};if(g.match(YM))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");return{isToken:!1,value:y}});n.localize.preprocessor&&(l=n.localize.preprocessor(a,l));const u={firstWeekContainsDate:s,weekStartsOn:o,locale:n};return l.map(y=>{if(!y.isToken)return y.value;const g=y.value;(jM(g)||zM(g))&&$M(g,t,String(r));const d=vm[g[0]];return d(a,g,n.localize,u)}).join("")}function qM(r){const t=r.match(HM);return t?t[1].replace(XM,"'"):r}function QM(r,t){return qr(r*1e3,t==null?void 0:t.in)}function KM(r,t){const e=ZM(t)?new t(0):Gi(t,0);return e.setFullYear(r.getFullYear(),r.getMonth(),r.getDate()),e.setHours(r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()),e}function ZM(r){var t;return typeof r=="function"&&((t=r.prototype)==null?void 0:t.constructor)===r}function JM(r,t){let e=r.length;switch("string"){case"string":{if(t.length!==1)throw new Error("The 'chars' parameter should be a single character string.");for(;e>0&&r[e-1]===t;)e--;break}}return r.substring(0,e)}function gr(r){return r==null}function tD(r){return r!=null}async function Sh(){if(typeof window<"u"&&window!==null)return"browser";try{const r=await ln(()=>import("./__vite-browser-external-FmFgRqLi.js"),[]);return typeof r<"u"&&r.versions!=null&&r.versions.node!=null?"node":"unknown"}catch{return"unknown"}}function eD(r){return gr(r)?!1:Et.isInt(r.type)&&!cw(r)||rD(r)}function rD(r){return gr(r)?!1:Et.isInt(r.type)&&r.type.isSigned===!1}function iD(r){return gr(r)?!1:Et.isFloat(r.type)??!1}function nD(r){return gr(r)?!1:Et.isDecimal(r.type)}function sD(r){return gr(r)?!1:Et.isBool(r.type)}function oD(r){return gr(r)?!1:Et.isDuration(r.type)}function cw(r){return gr(r)?!1:Et.isInt(r.type)&&r.metadata.get("ARROW:extension:name")==="period"}function aD(r){return gr(r)?!1:Et.isTimestamp(r.type)}function lD(r){return gr(r)?!1:Et.isDate(r.type)}function uD(r){return gr(r)?!1:Et.isTime(r.type)}function cD(r){return gr(r)?!1:Et.isList(r.type)||Et.isFixedSizeList(r.type)}function hD(r){return gr(r)?!1:Et.isStruct(r.type)||Et.isMap(r.type)}function fD(r){return gr(r)?!1:Et.isStruct(r.type)&&r.metadata.get("ARROW:extension:name")==="interval"||Et.isInterval(r.type)}function dD(r,t){let e;if(t===Jt.MILLISECOND)e=1e3;else if(t===Jt.MICROSECOND)e=1e3*1e3;else if(t===Jt.NANOSECOND)e=1e3*1e3*1e3;else return Number(r);return typeof r=="bigint"&&!Number.isSafeInteger(Number(r))?Number(r/BigInt(e)):Number(r)/e}function pD(r,t){var i;const e=dD(r,((i=t==null?void 0:t.type)==null?void 0:i.unit)??Jt.SECOND);return QM(e)}function mD(r,t){const e=pD(r,t);return uw(e,e.getMilliseconds()===0?"HH:mm:ss":"HH:mm:ss.SSS")}function yD(r){const t="yyyy-MM-dd";return r instanceof Date||typeof r=="number"&&Number.isFinite(r)?uw(r,t):(console.warn(`Unsupported date value: ${r}`),String(r))}function gD(r,t){var n;if(!(r instanceof Date||typeof r=="number"&&Number.isFinite(r)))return console.warn(`Unsupported datetime value: ${r}`),null;let e;const i=(n=t==null?void 0:t.type)==null?void 0:n.timezone;return typeof r=="number"?i?e=new Er(r,i):e=new Er(r):i?e=new Er(r,i):e=new Er(r),KM(e,Date)}function vD(r,t){var a;const e=((a=t==null?void 0:t.type)==null?void 0:a.scale)||0;let i=pm.bigNumToString(new pm.BN(r)).padStart(e,"0");if(e===0)return i;let n="";i.startsWith("-")&&(n="-",i=i.slice(1));const s=i.slice(0,-e)||"0",o=JM(i.slice(-e),"0")||"";return`${n}${s}${o?`.${o}`:""}`}function _D(r){const t=r[0],e=r[1],i=[];return t!==0&&i.push(`${t} year${t>1?"s":""}`),e!==0&&i.push(`${e} month${e>1?"s":""}`),i.length?i.join(" "):"0 months"}function bD(r,t){var i,n,s,o;if(Et.isInterval(t==null?void 0:t.type))return _D(r);const e=t&&t.metadata.get("ARROW:extension:name");if(e&&e==="pandas.interval"){const a=JSON.parse(t.metadata.get("ARROW:extension:metadata")),{closed:l}=a,u=r.toJSON(),c=l==="both"||l==="left"?"[":"(",h=l==="both"||l==="right"?"]":")",p=Th(u.left,(n=(i=t.type)==null?void 0:i.children)==null?void 0:n[0]),f=Th(u.right,(o=(s=t.type)==null?void 0:s.children)==null?void 0:o[1]);return`${c+p}, ${f+h}`}return String(r)}function wD(r,t){return(t==null?void 0:t.type)instanceof bh?JSON.parse(JSON.stringify(r,(e,i)=>{if(tD(i))return typeof i=="bigint"?Number(i):i})):JSON.parse(JSON.stringify(r,(e,i)=>typeof i=="bigint"?Number(i):i))}function Th(r,t){if(gr(r))return null;const e=r instanceof Date||Number.isFinite(r);if(e&&lD(t))return yD(r);if(typeof r=="bigint"&&uD(t))return mD(Number(r),t);if(e&&aD(t))return gD(r,t);if(cw(t))throw new Error("Period type is not supported yet");if(fD(t))return bD(r,t);if(oD(t))throw new Error("Duration type is not supported yet");return nD(t)?vD(r,t):iD(t)&&Number.isFinite(r)||eD(t)?r:hD(t)||cD(t)?wD(r,t):sD(t)?!!r:String(r)}function xm(r){return((r.toArray()||[]).map(i=>i.toJSON())||[]).map(i=>(r.schema.fields.forEach(n=>i[n.name]=Th(i[n.name],n)),i))}var ra=(r=>(r.ORIGIN_PRIVATE_FS="origin-private-fs",r.NODE_FS="node-fs",r))(ra||{});async function hw(r){const t=Cx(r,{logger:!1});let e,i;const n=await Sh();if(n==="browser"){if(typeof t.bundles>"u"){const{getBundles:l}=await ln(async()=>{const{getBundles:u}=await import("./default-browser-BrgSDbLD.js");return{getBundles:u}},[]);t.bundles=await l()}i=await kp(await t.bundles),e=new Worker(i.mainWorker)}else if(n==="node"){if(typeof t.bundles>"u"){const{getBundles:c}=await ln(async()=>{const{getBundles:h}=await import("./default-node-Dkg9OG4q.js");return{getBundles:h}},__vite__mapDeps([0,1,2]));t.bundles=await c()}i=await kp(await t.bundles);let l=i.mainWorker;l.startsWith("/@fs/")&&(l=l.replace("/@fs/","file://"));const u=await ln(()=>import("./index-Cp8iQ_hy.js"),[]);e=new u.default(l,{type:"module"})}else throw new Error(`Unsupported environment: ${n}`);let s;t.logger===!0?s=new I0:t.logger===!1?s=new c2:s=t.logger;const o=new g2(s,e);if(await o.instantiate(i.mainModule,i.pthreadWorker),t.storage)switch(t.storage.type){case ra.ORIGIN_PRIVATE_FS:{try{let l=t.storage.path;l.startsWith("/")&&(l=l.slice(1)),await o.open({path:`opfs://${l}`,accessMode:t.storage.accessMode})}catch(l){throw await o.terminate(),await e.terminate(),l}break}case ra.NODE_FS:{try{await o.open({path:t.storage.path,accessMode:t.storage.accessMode,useDirectIO:!0})}catch(l){throw await o.terminate(),await e.terminate(),l}break}}const a=await o.connect();return{worker:e,db:o,conn:a,query:async(l,u=[])=>{if(!u||u.length===0){const f=await a.query(l);return xm(f)}const c=await a.prepare(l),h=await c.query(...u),p=xm(h);return c.close(),p},close:async()=>{await a.close(),await o.terminate(),await e.terminate()}}}async function xD(r,t){await(await r).conn.send("BEGIN TRANSACTION");try{const e=await t(r);return await(await r).conn.send("COMMIT"),e}catch(e){throw await(await r).conn.send("ROLLBACK"),e}}async function SD(r,t,e){await(await r).conn.send(`SAVEPOINT ${t}`);try{const i=await e(r);return await(await r).conn.send(`RELEASE SAVEPOINT ${t}`),i}catch(i){throw await(await r).conn.send(`ROLLBACK TO SAVEPOINT ${t}`),i}}const xt=Symbol.for("drizzle:entityKind");function lt(r,t){if(!r||typeof r!="object")return!1;if(r instanceof t)return!0;if(!Object.prototype.hasOwnProperty.call(t,xt))throw new 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 e=Object.getPrototypeOf(r).constructor;if(e)for(;e;){if(xt in e&&e[xt]===t[xt])return!0;e=Object.getPrototypeOf(e)}return!1}var Mm;Mm=xt;class Ke{constructor(t,e){G(this,"name");G(this,"keyAsName");G(this,"primary");G(this,"notNull");G(this,"default");G(this,"defaultFn");G(this,"onUpdateFn");G(this,"hasDefault");G(this,"isUnique");G(this,"uniqueName");G(this,"uniqueType");G(this,"dataType");G(this,"columnType");G(this,"enumValues");G(this,"generated");G(this,"generatedIdentity");G(this,"config");this.table=t,this.config=e,this.name=e.name,this.keyAsName=e.keyAsName,this.notNull=e.notNull,this.default=e.default,this.defaultFn=e.defaultFn,this.onUpdateFn=e.onUpdateFn,this.hasDefault=e.hasDefault,this.primary=e.primaryKey,this.isUnique=e.isUnique,this.uniqueName=e.uniqueName,this.uniqueType=e.uniqueType,this.dataType=e.dataType,this.columnType=e.columnType,this.generated=e.generated,this.generatedIdentity=e.generatedIdentity}mapFromDriverValue(t){return t}mapToDriverValue(t){return t}shouldDisableInsert(){return this.config.generated!==void 0&&this.config.generated.type!=="byDefault"}}G(Ke,Mm,"Column");const Ys=Symbol.for("drizzle:Name");function TD(r,t){return`${r[Ys]}_${t.join("_")}_unique`}var Dm,Rm;class Ar extends(Rm=Ke,Dm=xt,Rm){constructor(t,e){e.uniqueName||(e.uniqueName=TD(t,[e.name])),super(t,e),this.table=t}}G(Ar,Dm,"PgColumn");const Sm=Symbol.for("drizzle:isPgEnum");function ID(r){return!!r&&typeof r=="function"&&Sm in r&&r[Sm]===!0}var Nm;Nm=xt;class Or{constructor(t,e,i,n=!1){this._={brand:"Subquery",sql:t,selectedFields:e,alias:i,isWith:n}}}G(Or,Nm,"Subquery");var Lm,Bm;class jf extends(Bm=Or,Lm=xt,Bm){}G(jf,Lm,"WithSubquery");const Pr={startActiveSpan(r,t){return t()}},He=Symbol.for("drizzle:ViewBaseConfig"),Qa=Symbol.for("drizzle:Schema"),Ih=Symbol.for("drizzle:Columns"),Tm=Symbol.for("drizzle:ExtraConfigColumns"),sc=Symbol.for("drizzle:OriginalName"),oc=Symbol.for("drizzle:BaseName"),zl=Symbol.for("drizzle:IsAlias"),Im=Symbol.for("drizzle:ExtraConfigBuilder"),ED=Symbol.for("drizzle:IsDrizzleTable");var km,Um,zm,jm,$m,Vm,Gm,Wm,Hm,Xm;Xm=xt,Hm=Ys,Wm=sc,Gm=Qa,Vm=Ih,$m=Tm,jm=oc,zm=zl,Um=ED,km=Im;class Tt{constructor(t,e,i){G(this,Hm);G(this,Wm);G(this,Gm);G(this,Vm);G(this,$m);G(this,jm);G(this,zm,!1);G(this,Um,!0);G(this,km);this[Ys]=this[sc]=t,this[Qa]=e,this[oc]=i}}G(Tt,Xm,"Table"),G(Tt,"Symbol",{Name:Ys,Schema:Qa,OriginalName:sc,Columns:Ih,ExtraConfigColumns:Tm,BaseName:oc,IsAlias:zl,ExtraConfigBuilder:Im});function qn(r){return r[Ys]}function ia(r){return`${r[Qa]??"public"}.${r[Ys]}`}function fw(r){return r!=null&&typeof r.getSQL=="function"}function CD(r){var e;const t={sql:"",params:[]};for(const i of r)t.sql+=i.sql,t.params.push(...i.params),(e=i.typings)!=null&&e.length&&(t.typings||(t.typings=[]),t.typings.push(...i.typings));return t}var Ym;Ym=xt;class Xe{constructor(t){G(this,"value");this.value=Array.isArray(t)?t:[t]}getSQL(){return new Ft([this])}}G(Xe,Ym,"StringChunk");var qm;qm=xt;const Hn=class Hn{constructor(t){G(this,"decoder",dw);G(this,"shouldInlineParams",!1);this.queryChunks=t}append(t){return this.queryChunks.push(...t.queryChunks),this}toQuery(t){return Pr.startActiveSpan("drizzle.buildSQL",e=>{const i=this.buildQueryFromSourceParams(this.queryChunks,t);return e==null||e.setAttributes({"drizzle.query.text":i.sql,"drizzle.query.params":JSON.stringify(i.params)}),i})}buildQueryFromSourceParams(t,e){const i=Object.assign({},e,{inlineParams:e.inlineParams||this.shouldInlineParams,paramStartIndex:e.paramStartIndex||{value:0}}),{casing:n,escapeName:s,escapeParam:o,prepareTyping:a,inlineParams:l,paramStartIndex:u}=i;return CD(t.map(c=>{var h;if(lt(c,Xe))return{sql:c.value.join(""),params:[]};if(lt(c,jl))return{sql:s(c.value),params:[]};if(c===void 0)return{sql:"",params:[]};if(Array.isArray(c)){const p=[new Xe("(")];for(const[f,y]of c.entries())p.push(y),fr},pw={mapToDriverValue:r=>r};({...dw,...pw});var Km;Km=xt;class Wi{constructor(t,e=pw){G(this,"brand");this.value=t,this.encoder=e}getSQL(){return new Ft([this])}}G(Wi,Km,"Param");function X(r,...t){const e=[];(t.length>0||r.length>0&&r[0]!=="")&&e.push(new Xe(r[0]));for(const[i,n]of t.entries())e.push(n,new Xe(r[i+1]));return new Ft(e)}(r=>{function t(){return new Ft([])}r.empty=t;function e(l){return new Ft(l)}r.fromList=e;function i(l){return new Ft([new Xe(l)])}r.raw=i;function n(l,u){const c=[];for(const[h,p]of l.entries())h>0&&u!==void 0&&c.push(u),c.push(p);return new Ft(c)}r.join=n;function s(l){return new jl(l)}r.identifier=s;function o(l){return new ss(l)}r.placeholder=o;function a(l,u){return new Wi(l,u)}r.param=a})(X||(X={}));(r=>{var e;e=xt;const i=class i{constructor(s,o){G(this,"isSelectionField",!1);this.sql=s,this.fieldAlias=o}getSQL(){return this.sql}clone(){return new i(this.sql,this.fieldAlias)}};G(i,e,"SQL.Aliased");let t=i;r.Aliased=t})(Ft||(Ft={}));var Zm;Zm=xt;class ss{constructor(t){this.name=t}getSQL(){return new Ft([this])}}G(ss,Zm,"Placeholder");function Em(r,t){return r.map(e=>{if(lt(e,ss)){if(!(e.name in t))throw new Error(`No value for placeholder "${e.name}" was provided`);return t[e.name]}if(lt(e,Wi)&<(e.value,ss)){if(!(e.value.name in t))throw new Error(`No value for placeholder "${e.value.name}" was provided`);return e.encoder.mapToDriverValue(t[e.value.name])}return e})}const OD=Symbol.for("drizzle:IsDrizzleView");var Jm,ty,ey;ey=xt,ty=He,Jm=OD;class Sn{constructor({name:t,schema:e,selectedFields:i,query:n}){G(this,ty);G(this,Jm,!0);this[He]={name:t,originalName:t,schema:e,selectedFields:i,query:n,isExisting:!n,isAlias:!1}}getSQL(){return new Ft([this])}}G(Sn,ey,"View");Ke.prototype.getSQL=function(){return new Ft([this])};Tt.prototype.getSQL=function(){return new Ft([this])};Or.prototype.getSQL=function(){return new Ft([this])};var ry;ry=xt;class na{constructor(t){this.table=t}get(t,e){return e==="table"?this.table:t[e]}}G(na,ry,"ColumnAliasProxyHandler");var iy;iy=xt;class cu{constructor(t,e){this.alias=t,this.replaceOriginalName=e}get(t,e){if(e===Tt.Symbol.IsAlias)return!0;if(e===Tt.Symbol.Name)return this.alias;if(this.replaceOriginalName&&e===Tt.Symbol.OriginalName)return this.alias;if(e===He)return{...t[He],name:this.alias,isAlias:!0};if(e===Tt.Symbol.Columns){const n=t[Tt.Symbol.Columns];if(!n)return n;const s={};return Object.keys(n).map(o=>{s[o]=new Proxy(n[o],new na(new Proxy(t,this)))}),s}const i=t[e];return lt(i,Ke)?new Proxy(i,new na(new Proxy(t,this))):i}}G(cu,iy,"TableAliasProxyHandler");function ac(r,t){return new Proxy(r,new cu(t,!1))}function Li(r,t){return new Proxy(r,new na(new Proxy(r.table,new cu(t,!1))))}function mw(r,t){return new Ft.Aliased($l(r.sql,t),r.fieldAlias)}function $l(r,t){return X.join(r.queryChunks.map(e=>lt(e,Ke)?Li(e,t):lt(e,Ft)?$l(e,t):lt(e,Ft.Aliased)?mw(e,t):e))}var ny,sy;class $f extends(sy=Error,ny=xt,sy){constructor({message:t,cause:e}){super(t),this.name="DrizzleError",this.cause=e}}G($f,ny,"DrizzleError");var oy,ay;class yw extends(ay=$f,oy=xt,ay){constructor(){super({message:"Rollback"})}}G(yw,oy,"TransactionRollbackError");function yr(r,t){return AD(t)&&!fw(r)&&!lt(r,Wi)&&!lt(r,ss)&&!lt(r,Ke)&&!lt(r,Tt)&&!lt(r,Sn)?new Wi(r,t):r}const gw=(r,t)=>X`${r} = ${yr(t,r)}`,FD=(r,t)=>X`${r} <> ${yr(t,r)}`;function Eh(...r){const t=r.filter(e=>e!==void 0);if(t.length!==0)return t.length===1?new Ft(t):new Ft([new Xe("("),X.join(t,new Xe(" and ")),new Xe(")")])}function PD(...r){const t=r.filter(e=>e!==void 0);if(t.length!==0)return t.length===1?new Ft(t):new Ft([new Xe("("),X.join(t,new Xe(" or ")),new Xe(")")])}function MD(r){return X`not ${r}`}const DD=(r,t)=>X`${r} > ${yr(t,r)}`,RD=(r,t)=>X`${r} >= ${yr(t,r)}`,ND=(r,t)=>X`${r} < ${yr(t,r)}`,LD=(r,t)=>X`${r} <= ${yr(t,r)}`;function BD(r,t){return Array.isArray(t)?t.length===0?X`false`:X`${r} in ${t.map(e=>yr(e,r))}`:X`${r} in ${yr(t,r)}`}function kD(r,t){return Array.isArray(t)?t.length===0?X`true`:X`${r} not in ${t.map(e=>yr(e,r))}`:X`${r} not in ${yr(t,r)}`}function UD(r){return X`${r} is null`}function zD(r){return X`${r} is not null`}function jD(r){return X`exists ${r}`}function $D(r){return X`not exists ${r}`}function VD(r,t,e){return X`${r} between ${yr(t,r)} and ${yr(e,r)}`}function GD(r,t,e){return X`${r} not between ${yr(t,r)} and ${yr(e,r)}`}function WD(r,t){return X`${r} like ${t}`}function HD(r,t){return X`${r} not like ${t}`}function XD(r,t){return X`${r} ilike ${t}`}function YD(r,t){return X`${r} not ilike ${t}`}function qD(r){return X`${r} asc`}function QD(r){return X`${r} desc`}var ly;ly=xt;class vw{write(t){console.log(t)}}G(vw,ly,"ConsoleLogWriter");var uy;uy=xt;class _w{constructor(t){G(this,"writer");this.writer=(t==null?void 0:t.writer)??new vw}logQuery(t,e){const i=e.map(s=>{try{return JSON.stringify(s)}catch{return String(s)}}),n=i.length?` -- params: [${i.join(", ")}]`:"";this.writer.write(`Query: ${t}${n}`)}}G(_w,uy,"DefaultLogger");var cy;cy=xt;class bw{logQuery(){}}G(bw,cy,"NoopLogger");var hy,fy;fy=xt,hy=Symbol.toStringTag;class Tn{constructor(){G(this,hy,"QueryPromise")}catch(t){return this.then(void 0,t)}finally(t){return this.then(e=>(t==null||t(),e),e=>{throw t==null||t(),e})}then(t,e){return this.execute().then(t,e)}}G(Tn,fy,"QueryPromise");function os(r,t){return Object.entries(r).reduce((e,[i,n])=>{if(typeof i!="string")return e;const s=t?[...t,i]:[i];return lt(n,Ke)||lt(n,Ft)||lt(n,Ft.Aliased)?e.push({path:s,field:n}):lt(n,Tt)?e.push(...os(n[Tt.Symbol.Columns],s)):e.push(...os(n,s)),e},[])}function Vf(r,t){const e=Object.keys(r),i=Object.keys(t);if(e.length!==i.length)return!1;for(const[n,s]of e.entries())if(s!==i[n])return!1;return!0}function ww(r,t){const e=Object.entries(t).filter(([,i])=>i!==void 0).map(([i,n])=>lt(n,Ft)||lt(n,Ke)?[i,n]:[i,new Wi(n,r[Tt.Symbol.Columns][i])]);if(e.length===0)throw new Error("No values to set");return Object.fromEntries(e)}function KD(r,t){for(const e of t)for(const i of Object.getOwnPropertyNames(e.prototype))i!=="constructor"&&Object.defineProperty(r.prototype,i,Object.getOwnPropertyDescriptor(e.prototype,i)||Object.create(null))}function ZD(r){return r[Tt.Symbol.Columns]}function Wn(r){return lt(r,Or)?r._.alias:lt(r,Sn)?r[He].name:lt(r,Ft)?void 0:r[Tt.Symbol.IsAlias]?r[Tt.Symbol.Name]:r[Tt.Symbol.BaseName]}function JD(r){if(typeof r!="object"||r===null||r.constructor.name!=="Object")return!1;if("logger"in r){const t=typeof r.logger;return!(t!=="boolean"&&(t!=="object"||typeof r.logger.logQuery!="function")&&t!=="undefined")}if("schema"in r){const t=typeof r.schema;return!(t!=="object"&&t!=="undefined")}if("casing"in r){const t=typeof r.casing;return!(t!=="string"&&t!=="undefined")}if("mode"in r)return!(r.mode!=="default"||r.mode!=="planetscale"||r.mode!==void 0);if("connection"in r){const t=typeof r.connection;return!(t!=="string"&&t!=="object"&&t!=="undefined")}if("client"in r){const t=typeof r.client;return!(t!=="object"&&t!=="function"&&t!=="undefined")}return Object.keys(r).length===0}var dy,py;class xw extends(py=Ar,dy=xt,py){getSQLType(){return"date"}mapFromDriverValue(t){return new Date(t)}mapToDriverValue(t){return t.toISOString()}}G(xw,dy,"PgDate");var my,yy;class Sw extends(yy=Ar,my=xt,yy){getSQLType(){return"date"}}G(Sw,my,"PgDateString");var gy,vy;class Tw extends(vy=Ar,gy=xt,vy){constructor(t,e){super(t,e)}getSQLType(){return"json"}mapToDriverValue(t){return JSON.stringify(t)}mapFromDriverValue(t){if(typeof t=="string")try{return JSON.parse(t)}catch{return t}return t}}G(Tw,gy,"PgJson");var _y,by;class Iw extends(by=Ar,_y=xt,by){constructor(t,e){super(t,e)}getSQLType(){return"jsonb"}mapToDriverValue(t){return JSON.stringify(t)}mapFromDriverValue(t){if(typeof t=="string")try{return JSON.parse(t)}catch{return t}return t}}G(Iw,_y,"PgJsonb");var wy,xy;class Ew extends(xy=Ar,wy=xt,xy){constructor(e,i){super(e,i);G(this,"precision");G(this,"scale");this.precision=i.precision,this.scale=i.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})`}}G(Ew,wy,"PgNumeric");var Sy,Ty;class Cw extends(Ty=Ar,Sy=xt,Ty){constructor(e,i){super(e,i);G(this,"withTimezone");G(this,"precision");this.withTimezone=i.withTimezone,this.precision=i.precision}getSQLType(){return`time${this.precision===void 0?"":`(${this.precision})`}${this.withTimezone?" with time zone":""}`}}G(Cw,Sy,"PgTime");var Iy,Ey;class Aw extends(Ey=Ar,Iy=xt,Ey){constructor(e,i){super(e,i);G(this,"withTimezone");G(this,"precision");G(this,"mapFromDriverValue",e=>new Date(this.withTimezone?e:e+"+0000"));G(this,"mapToDriverValue",e=>e.toISOString());this.withTimezone=i.withTimezone,this.precision=i.precision}getSQLType(){return`timestamp${this.precision===void 0?"":` (${this.precision})`}${this.withTimezone?" with time zone":""}`}}G(Aw,Iy,"PgTimestamp");var Cy,Ay;class Ow extends(Ay=Ar,Cy=xt,Ay){constructor(e,i){super(e,i);G(this,"withTimezone");G(this,"precision");this.withTimezone=i.withTimezone,this.precision=i.precision}getSQLType(){return`timestamp${this.precision===void 0?"":`(${this.precision})`}${this.withTimezone?" with time zone":""}`}}G(Ow,Cy,"PgTimestampString");var Oy,Fy;class Fw extends(Fy=Ar,Oy=xt,Fy){getSQLType(){return"uuid"}}G(Fw,Oy,"PgUUID");const Cm=Symbol.for("drizzle:PgInlineForeignKeys"),Am=Symbol.for("drizzle:EnableRLS");var Py,My,Dy,Ry,Ny,Ly;class Br extends(Ly=Tt,Ny=xt,Ry=Cm,Dy=Am,My=Tt.Symbol.ExtraConfigBuilder,Py=Tt.Symbol.ExtraConfigColumns,Ly){constructor(){super(...arguments);G(this,Ry,[]);G(this,Dy,!1);G(this,My);G(this,Py,{})}}G(Br,Ny,"PgTable"),G(Br,"Symbol",Object.assign({},Tt.Symbol,{InlineForeignKeys:Cm,EnableRLS:Am}));var By;By=xt;class Pw{constructor(t,e){G(this,"columns");G(this,"name");this.columns=t,this.name=e}build(t){return new Mw(t,this.columns,this.name)}}G(Pw,By,"PgPrimaryKeyBuilder");var ky;ky=xt;class Mw{constructor(t,e,i){G(this,"columns");G(this,"name");this.table=t,this.columns=e,this.name=i}getName(){return this.name??`${this.table[Br.Symbol.Name]}_${this.columns.map(t=>t.name).join("_")}_pk`}}G(Mw,ky,"PgPrimaryKey");var Uy;Uy=xt;class Gf{constructor(t,e,i){G(this,"referencedTableName");G(this,"fieldName");this.sourceTable=t,this.referencedTable=e,this.relationName=i,this.referencedTableName=e[Tt.Symbol.Name]}}G(Gf,Uy,"Relation");var zy;zy=xt;class Dw{constructor(t,e){this.table=t,this.config=e}}G(Dw,zy,"Relations");var jy,$y;const Wl=class Wl extends($y=Gf,jy=xt,$y){constructor(t,e,i,n){super(t,e,i==null?void 0:i.relationName),this.config=i,this.isNullable=n}withFieldName(t){const e=new Wl(this.sourceTable,this.referencedTable,this.config,this.isNullable);return e.fieldName=t,e}};G(Wl,jy,"One");let as=Wl;var Vy,Gy;const Hl=class Hl extends(Gy=Gf,Vy=xt,Gy){constructor(t,e,i){super(t,e,i==null?void 0:i.relationName),this.config=i}withFieldName(t){const e=new Hl(this.sourceTable,this.referencedTable,this.config);return e.fieldName=t,e}};G(Hl,Vy,"Many");let Vl=Hl;function tR(){return{and:Eh,between:VD,eq:gw,exists:jD,gt:DD,gte:RD,ilike:XD,inArray:BD,isNull:UD,isNotNull:zD,like:WD,lt:ND,lte:LD,ne:FD,not:MD,notBetween:GD,notExists:$D,notLike:HD,notIlike:YD,notInArray:kD,or:PD,sql:X}}function eR(){return{sql:X,asc:qD,desc:QD}}function rR(r,t){var s;Object.keys(r).length===1&&"default"in r&&!lt(r.default,Tt)&&(r=r.default);const e={},i={},n={};for(const[o,a]of Object.entries(r))if(lt(a,Tt)){const l=ia(a),u=i[l];e[l]=o,n[o]={tsName:o,dbName:a[Tt.Symbol.Name],schema:a[Tt.Symbol.Schema],columns:a[Tt.Symbol.Columns],relations:(u==null?void 0:u.relations)??{},primaryKey:(u==null?void 0:u.primaryKey)??[]};for(const h of Object.values(a[Tt.Symbol.Columns]))h.primary&&n[o].primaryKey.push(h);const c=(s=a[Tt.Symbol.ExtraConfigBuilder])==null?void 0:s.call(a,a[Tt.Symbol.ExtraConfigColumns]);if(c)for(const h of Object.values(c))lt(h,Pw)&&n[o].primaryKey.push(...h.columns)}else if(lt(a,Dw)){const l=ia(a.table),u=e[l],c=a.config(t(a.table));let h;for(const[p,f]of Object.entries(c))if(u){const y=n[u];y.relations[p]=f}else l in i||(i[l]={relations:{},primaryKey:h}),i[l].relations[p]=f}return{tables:n,tableNamesMap:e}}function iR(r){return function(e,i){return new as(r,e,i,(i==null?void 0:i.fields.reduce((n,s)=>n&&s.notNull,!0))??!1)}}function nR(r){return function(e,i){return new Vl(r,e,i)}}function sR(r,t,e){if(lt(e,as)&&e.config)return{fields:e.config.fields,references:e.config.references};const i=t[ia(e.referencedTable)];if(!i)throw new Error(`Table "${e.referencedTable[Tt.Symbol.Name]}" not found in schema`);const n=r[i];if(!n)throw new Error(`Table "${i}" not found in schema`);const s=e.sourceTable,o=t[ia(s)];if(!o)throw new Error(`Table "${s[Tt.Symbol.Name]}" not found in schema`);const a=[];for(const l of Object.values(n.relations))(e.relationName&&e!==l&&l.relationName===e.relationName||!e.relationName&&l.referencedTable===e.sourceTable)&&a.push(l);if(a.length>1)throw e.relationName?new Error(`There are multiple relations with name "${e.relationName}" in table "${i}"`):new Error(`There are multiple relations between "${i}" and "${e.sourceTable[Tt.Symbol.Name]}". Please specify relation name`);if(a[0]&<(a[0],as)&&a[0].config)return{fields:a[0].config.references,references:a[0].config.fields};throw new Error(`There is not enough information to infer relation "${o}.${e.fieldName}"`)}function oR(r){return{one:iR(r),many:nR(r)}}function Ch(r,t,e,i,n=s=>s){const s={};for(const[o,a]of i.entries())if(a.isJson){const l=t.relations[a.tsKey],u=e[o],c=typeof u=="string"?JSON.parse(u):u;s[a.tsKey]=lt(l,as)?c&&Ch(r,r[a.relationTableTsKey],c,a.selection,n):c.map(h=>Ch(r,r[a.relationTableTsKey],h,a.selection,n))}else{const l=n(e[o]),u=a.field;let c;lt(u,Ke)?c=u:lt(u,Ft)?c=u.decoder:c=u.sql.decoder,s[a.tsKey]=l===null?null:c.mapFromDriverValue(l)}return s}var Wy;Wy=xt;const Xl=class Xl{constructor(t){G(this,"config");this.config={...t}}get(t,e){if(e==="_")return{...t._,selectedFields:new Proxy(t._.selectedFields,this)};if(e===He)return{...t[He],selectedFields:new Proxy(t[He].selectedFields,this)};if(typeof e=="symbol")return t[e];const n=(lt(t,Or)?t._.selectedFields:lt(t,Sn)?t[He].selectedFields:t)[e];if(lt(n,Ft.Aliased)){if(this.config.sqlAliasedBehavior==="sql"&&!n.isSelectionField)return n.sql;const s=n.clone();return s.isSelectionField=!0,s}if(lt(n,Ft)){if(this.config.sqlBehavior==="sql")return n;throw new Error(`You tried to reference "${e}" 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 lt(n,Ke)?this.config.alias?new Proxy(n,new na(new Proxy(n.table,new cu(this.config.alias,this.config.replaceOriginalName??!1)))):n:typeof n!="object"||n===null?n:new Proxy(n,new Xl(this.config))}};G(Xl,Wy,"SelectionProxyHandler");let Je=Xl;var Hy,Xy;class Ah extends(Xy=Tn,Hy=xt,Xy){constructor(e,i,n,s){super();G(this,"config");G(this,"authToken");G(this,"execute",e=>Pr.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e,this.authToken)));this.session=i,this.dialect=n,this.config={table:e,withList:s}}where(e){return this.config.where=e,this}returning(e=this.config.table[Tt.Symbol.Columns]){return this.config.returningFields=e,this.config.returning=os(e),this}getSQL(){return this.dialect.buildDeleteQuery(this.config)}toSQL(){const{typings:e,...i}=this.dialect.sqlToQuery(this.getSQL());return i}_prepare(e){return Pr.startActiveSpan("drizzle.prepareQuery",()=>this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,e,!0))}prepare(e){return this._prepare(e)}setToken(e){return this.authToken=e,this}getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new Je({alias:qn(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}}G(Ah,Hy,"PgDelete");function aR(r){return(r.replace(/['\u2019]/g,"").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).map(e=>e.toLowerCase()).join("_")}function lR(r){return(r.replace(/['\u2019]/g,"").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).reduce((e,i,n)=>{const s=n===0?i.toLowerCase():`${i[0].toUpperCase()}${i.slice(1)}`;return e+s},"")}function uR(r){return r}var Yy;Yy=xt;class Rw{constructor(t){G(this,"cache",{});G(this,"cachedTables",{});G(this,"convert");this.convert=t==="snake_case"?aR:t==="camelCase"?lR:uR}getColumnCasing(t){if(!t.keyAsName)return t.name;const e=t.table[Tt.Symbol.Schema]??"public",i=t.table[Tt.Symbol.OriginalName],n=`${e}.${i}.${t.name}`;return this.cache[n]||this.cacheTable(t.table),this.cache[n]}cacheTable(t){const e=t[Tt.Symbol.Schema]??"public",i=t[Tt.Symbol.OriginalName],n=`${e}.${i}`;if(!this.cachedTables[n]){for(const s of Object.values(t[Tt.Symbol.Columns])){const o=`${n}.${s.name}`;this.cache[o]=this.convert(s.name)}this.cachedTables[n]=!0}}clearCache(){this.cache={},this.cachedTables={}}}G(Rw,Yy,"CasingCache");var qy,Qy;class Wf extends(Qy=Sn,qy=xt,Qy){}G(Wf,qy,"PgViewBase");var Ky;Ky=xt;class Bo{constructor(t){G(this,"casing");this.casing=new Rw(t==null?void 0:t.casing)}async migrate(t,e,i){const n=typeof i=="string"?"__drizzle_migrations":i.migrationsTable??"__drizzle_migrations",s=typeof i=="string"?"drizzle":i.migrationsSchema??"drizzle",o=X` CREATE TABLE IF NOT EXISTS ${X.identifier(s)}.${X.identifier(n)} ( id SERIAL PRIMARY KEY, hash text NOT NULL, created_at bigint ) - `;await e.execute(X`CREATE SCHEMA IF NOT EXISTS ${X.identifier(s)}`),await e.execute(o);const l=(await e.all(X`select id, hash, created_at from ${X.identifier(s)}.${X.identifier(n)} order by created_at desc limit 1`))[0];await e.transaction(async u=>{for await(const c of t)if(!l||Number(l.created_at){var a;return e[o]!==void 0||((a=i[o])==null?void 0:a.onUpdateFn)!==void 0}),s=n.length;return X.join(n.flatMap((o,a)=>{const l=i[o],u=e[o]??X.param(l.onUpdateFn(),l),c=X`${X.identifier(this.casing.getColumnCasing(l))} = ${u}`;return a{const a=[];if(lt(s,Ft.Aliased)&&s.isSelectionField)a.push(X.identifier(s.fieldAlias));else if(lt(s,Ft.Aliased)||lt(s,Ft)){const l=lt(s,Ft.Aliased)?s.sql:s;e?a.push(new Ft(l.queryChunks.map(u=>lt(u,Ar)?X.identifier(this.casing.getColumnCasing(u)):u))):a.push(l),lt(s,Ft.Aliased)&&a.push(X` as ${X.identifier(s.fieldAlias)}`)}else lt(s,Ke)&&(e?a.push(X.identifier(this.casing.getColumnCasing(s))):a.push(s));return oa==null?void 0:a.some(({alias:M})=>M===(it[Tt.Symbol.IsAlias]?qn(it):it[Tt.Symbol.BaseName])))(w.field.table)){const it=qn(w.field.table);throw new Error(`Your "${w.path.join("->")}" field references a column "${it}"."${w.field.name}", but the table "${it}" is not part of the query! Did you forget to join it?`)}const d=!a||a.length===0,m=this.buildWithCTE(t);let _;f&&(_=f===!0?X` distinct`:X` distinct on (${X.join(f.on,X`, `)})`);const S=this.buildSelection(g,{isSingleTable:d}),E=this.buildFromTable(o),b=this.buildJoins(a),F=n?X` where ${n}`:void 0,x=s?X` having ${s}`:void 0;let z;l&&l.length>0&&(z=X` order by ${X.join(l,X`, `)}`);let B;u&&u.length>0&&(B=X` group by ${X.join(u,X`, `)}`);const tt=typeof c=="object"||typeof c=="number"&&c>=0?X` limit ${c}`:void 0,st=h?X` offset ${h}`:void 0,I=X.empty();if(p){const w=X` for ${X.raw(p.strength)}`;p.config.of&&w.append(X` of ${X.join(Array.isArray(p.config.of)?p.config.of:[p.config.of],X`, `)}`),p.config.noWait?w.append(X` no wait`):p.config.skipLocked&&w.append(X` skip locked`),I.append(w)}const Z=X`${m}select${_} ${S} from ${E}${b}${F}${B}${x}${z}${tt}${st}${I}`;return y.length>0?this.buildSetOperations(Z,y):Z}buildSetOperations(t,e){const[i,...n]=e;if(!i)throw new Error("Cannot pass undefined values to any set operator");return n.length===0?this.buildSetOperationQuery({leftSelect:t,setOperator:i}):this.buildSetOperations(this.buildSetOperationQuery({leftSelect:t,setOperator:i}),n)}buildSetOperationQuery({leftSelect:t,setOperator:{type:e,isAll:i,rightSelect:n,limit:s,orderBy:o,offset:a}}){const l=X`(${t.getSQL()}) `,u=X`(${n.getSQL()})`;let c;if(o&&o.length>0){const y=[];for(const g of o)if(lt(g,Ar))y.push(X.identifier(g.name));else if(lt(g,Ft)){for(let d=0;d=0?X` limit ${s}`:void 0,p=X.raw(`${e} ${i?"all ":""}`),f=a?X` offset ${a}`:void 0;return X`${l}${p}${u}${c}${h}${f}`}buildInsertQuery({table:t,values:e,onConflict:i,returning:n,withList:s,select:o,overridingSystemValue_:a}){const l=[],u=t[Tt.Symbol.Columns],c=Object.entries(u).filter(([m,_])=>!_.shouldDisableInsert()),h=c.map(([,m])=>X.identifier(this.casing.getColumnCasing(m)));if(o){const m=e;lt(m,Ft)?l.push(m):l.push(m.getSQL())}else{const m=e;l.push(X.raw("values "));for(const[_,S]of m.entries()){const E=[];for(const[b,F]of c){const x=S[b];if(x===void 0||lt(x,Wi)&&x.value===void 0)if(F.defaultFn!==void 0){const z=F.defaultFn(),B=lt(z,Ft)?z:X.param(z,F);E.push(B)}else if(!F.default&&F.onUpdateFn!==void 0){const z=F.onUpdateFn(),B=lt(z,Ft)?z:X.param(z,F);E.push(B)}else E.push(X`default`);else E.push(x)}l.push(E),_({dbKey:S.name,tsKey:_,field:Li(S,a),relationTableTsKey:void 0,isJson:!1,selection:[]}));else{const m=Object.fromEntries(Object.entries(s.columns).map(([x,z])=>[x,Li(z,a)]));if(o.where){const x=typeof o.where=="function"?o.where(m,tR()):o.where;y=x&&$l(x,a)}const _=[];let S=[];if(o.columns){let x=!1;for(const[z,B]of Object.entries(o.columns))B!==void 0&&z in s.columns&&(!x&&B===!0&&(x=!0),S.push(z));S.length>0&&(S=x?S.filter(z=>{var B;return((B=o.columns)==null?void 0:B[z])===!0}):Object.keys(s.columns).filter(z=>!S.includes(z)))}else S=Object.keys(s.columns);for(const x of S){const z=s.columns[x];_.push({tsKey:x,value:z})}let E=[];o.with&&(E=Object.entries(o.with).filter(x=>!!x[1]).map(([x,z])=>({tsKey:x,queryConfig:z,relation:s.relations[x]})));let b;if(o.extras){b=typeof o.extras=="function"?o.extras(m,{sql:X}):o.extras;for(const[x,z]of Object.entries(b))_.push({tsKey:x,value:mw(z,a)})}for(const{tsKey:x,value:z}of _)c.push({dbKey:lt(z,Ft.Aliased)?z.fieldAlias:s.columns[x].name,tsKey:x,field:lt(z,Ke)?Li(z,a):z,relationTableTsKey:void 0,isJson:!1,selection:[]});let F=typeof o.orderBy=="function"?o.orderBy(m,eR()):o.orderBy??[];Array.isArray(F)||(F=[F]),f=F.map(x=>lt(x,Ke)?Li(x,a):$l(x,a)),h=o.limit,p=o.offset;for(const{tsKey:x,queryConfig:z,relation:B}of E){const tt=sR(e,i,B),st=ia(B.referencedTable),I=i[st],Z=`${a}_${x}`,w=Eh(...tt.fields.map((O,D)=>gw(Li(tt.references[D],Z),Li(O,a)))),it=this.buildRelationalQueryWithoutPK({fullSchema:t,schema:e,tableNamesMap:i,table:t[I],tableConfig:e[I],queryConfig:lt(B,as)?z===!0?{limit:1}:{...z,limit:1}:z,tableAlias:Z,joinOn:w,nestedQueryRelation:B}),M=X`${X.identifier(Z)}.${X.identifier("data")}`.as(x);g.push({on:X`true`,table:new Or(it.sql,{},Z),alias:Z,joinType:"left",lateral:!0}),c.push({dbKey:x,tsKey:x,field:M,relationTableTsKey:I,isJson:!0,selection:it.selection})}}if(c.length===0)throw new $f({message:`No fields selected for table "${s.tsName}" ("${a}")`});let d;if(y=Eh(u,y),l){let m=X`json_build_array(${X.join(c.map(({field:E,tsKey:b,isJson:F})=>F?X`${X.identifier(`${a}_${b}`)}.${X.identifier("data")}`:lt(E,Ft.Aliased)?E.sql:E),X`, `)})`;lt(l,Vl)&&(m=X`coalesce(json_agg(${m}${f.length>0?X` order by ${X.join(f,X`, `)}`:void 0}), '[]'::json)`);const _=[{dbKey:"data",tsKey:"data",field:m.as("data"),isJson:!0,relationTableTsKey:s.tsName,selection:c}];h!==void 0||p!==void 0||f.length>0?(d=this.buildSelectQuery({table:ac(n,a),fields:{},fieldsFlat:[{path:[],field:X.raw("*")}],where:y,limit:h,offset:p,orderBy:f,setOperators:[]}),y=void 0,h=void 0,p=void 0,f=[]):d=ac(n,a),d=this.buildSelectQuery({table:lt(d,Br)?d:new Or(d,{},a),fields:{},fieldsFlat:_.map(({field:E})=>({path:[],field:lt(E,Ke)?Li(E,a):E})),joins:g,where:y,limit:h,offset:p,orderBy:f,setOperators:[]})}else d=this.buildSelectQuery({table:ac(n,a),fields:{},fieldsFlat:c.map(({field:m})=>({path:[],field:lt(m,Ke)?Li(m,a):m})),joins:g,where:y,limit:h,offset:p,orderBy:f,setOperators:[]});return{tableTsKey:s.tsName,sql:d,selection:c}}}G(Bo,Ky,"PgDialect");var Zy;Zy=xt;class Nw{getSelectedFields(){return this._.selectedFields}}G(Nw,Zy,"TypedQueryBuilder");var Jy;Jy=xt;class Sr{constructor(t){G(this,"fields");G(this,"session");G(this,"dialect");G(this,"withList",[]);G(this,"distinct");G(this,"authToken");this.fields=t.fields,this.session=t.session,this.dialect=t.dialect,t.withList&&(this.withList=t.withList),this.distinct=t.distinct}setToken(t){return this.authToken=t,this}from(t){const e=!!this.fields,i=t;let n;return this.fields?n=this.fields:lt(i,Or)?n=Object.fromEntries(Object.keys(i._.selectedFields).map(s=>[s,i[s]])):lt(i,Wf)?n=i[He].selectedFields:lt(i,Ft)?n={}:n=ZD(i),new Hf({table:i,fields:n,isPartialSelect:e,session:this.session,dialect:this.dialect,withList:this.withList,distinct:this.distinct}).setToken(this.authToken)}}G(Sr,Jy,"PgSelectBuilder");var tg,eg;class Lw extends(eg=Nw,tg=xt,eg){constructor({table:e,fields:i,isPartialSelect:n,session:s,dialect:o,withList:a,distinct:l}){super();G(this,"_");G(this,"config");G(this,"joinsNotNullableMap");G(this,"tableName");G(this,"isPartialSelect");G(this,"session");G(this,"dialect");G(this,"leftJoin",this.createJoin("left"));G(this,"rightJoin",this.createJoin("right"));G(this,"innerJoin",this.createJoin("inner"));G(this,"fullJoin",this.createJoin("full"));G(this,"union",this.createSetOperator("union",!1));G(this,"unionAll",this.createSetOperator("union",!0));G(this,"intersect",this.createSetOperator("intersect",!1));G(this,"intersectAll",this.createSetOperator("intersect",!0));G(this,"except",this.createSetOperator("except",!1));G(this,"exceptAll",this.createSetOperator("except",!0));this.config={withList:a,table:e,fields:{...i},distinct:l,setOperators:[]},this.isPartialSelect=n,this.session=s,this.dialect=o,this._={selectedFields:i},this.tableName=Wn(e),this.joinsNotNullableMap=typeof this.tableName=="string"?{[this.tableName]:!0}:{}}createJoin(e){return(i,n)=>{var a;const s=this.tableName,o=Wn(i);if(typeof o=="string"&&((a=this.config.joins)!=null&&a.some(l=>l.alias===o)))throw new Error(`Alias "${o}" is already used in this query`);if(!this.isPartialSelect&&(Object.keys(this.joinsNotNullableMap).length===1&&typeof s=="string"&&(this.config.fields={[s]:this.config.fields}),typeof o=="string"&&!lt(i,Ft))){const l=lt(i,Or)?i._.selectedFields:lt(i,Sn)?i[He].selectedFields:i[Tt.Symbol.Columns];this.config.fields[o]=l}if(typeof n=="function"&&(n=n(new Proxy(this.config.fields,new Je({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.joins||(this.config.joins=[]),this.config.joins.push({on:n,table:i,joinType:e,alias:o}),typeof o=="string")switch(e){case"left":{this.joinsNotNullableMap[o]=!1;break}case"right":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([l])=>[l,!1])),this.joinsNotNullableMap[o]=!0;break}case"inner":{this.joinsNotNullableMap[o]=!0;break}case"full":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([l])=>[l,!1])),this.joinsNotNullableMap[o]=!1;break}}return this}}createSetOperator(e,i){return n=>{const s=typeof n=="function"?n(cR()):n;if(!Vf(this.getSelectedFields(),s.getSelectedFields()))throw new Error("Set operator error (union / intersect / except): selected fields are not the same or are in a different order");return this.config.setOperators.push({type:e,isAll:i,rightSelect:s}),this}}addSetOperators(e){return this.config.setOperators.push(...e),this}where(e){return typeof e=="function"&&(e=e(new Proxy(this.config.fields,new Je({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.where=e,this}having(e){return typeof e=="function"&&(e=e(new Proxy(this.config.fields,new Je({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.having=e,this}groupBy(...e){if(typeof e[0]=="function"){const i=e[0](new Proxy(this.config.fields,new Je({sqlAliasedBehavior:"alias",sqlBehavior:"sql"})));this.config.groupBy=Array.isArray(i)?i:[i]}else this.config.groupBy=e;return this}orderBy(...e){if(typeof e[0]=="function"){const i=e[0](new Proxy(this.config.fields,new Je({sqlAliasedBehavior:"alias",sqlBehavior:"sql"}))),n=Array.isArray(i)?i:[i];this.config.setOperators.length>0?this.config.setOperators.at(-1).orderBy=n:this.config.orderBy=n}else{const i=e;this.config.setOperators.length>0?this.config.setOperators.at(-1).orderBy=i:this.config.orderBy=i}return this}limit(e){return this.config.setOperators.length>0?this.config.setOperators.at(-1).limit=e:this.config.limit=e,this}offset(e){return this.config.setOperators.length>0?this.config.setOperators.at(-1).offset=e:this.config.offset=e,this}for(e,i={}){return this.config.lockingClause={strength:e,config:i},this}getSQL(){return this.dialect.buildSelectQuery(this.config)}toSQL(){const{typings:e,...i}=this.dialect.sqlToQuery(this.getSQL());return i}as(e){return new Proxy(new Or(this.getSQL(),this.config.fields,e),new Je({alias:e,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}getSelectedFields(){return new Proxy(this.config.fields,new Je({alias:this.tableName,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}$dynamic(){return this}}G(Lw,tg,"PgSelectQueryBuilder");var rg,ig;class Hf extends(ig=Lw,rg=xt,ig){constructor(){super(...arguments);G(this,"authToken");G(this,"execute",e=>Pr.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e,this.authToken)))}_prepare(e){const{session:i,config:n,dialect:s,joinsNotNullableMap:o,authToken:a}=this;if(!i)throw new Error("Cannot execute a query on a query builder. Please use a database instance instead.");return Pr.startActiveSpan("drizzle.prepareQuery",()=>{const l=os(n.fields),u=i.prepareQuery(s.sqlToQuery(this.getSQL()),l,e,!0);return u.joinsNotNullableMap=o,u.setToken(a)})}prepare(e){return this._prepare(e)}setToken(e){return this.authToken=e,this}}G(Hf,rg,"PgSelect");KD(Hf,[Tn]);function oo(r,t){return(e,i,...n)=>{const s=[i,...n].map(o=>({type:r,isAll:t,rightSelect:o}));for(const o of s)if(!Vf(e.getSelectedFields(),o.rightSelect.getSelectedFields()))throw new Error("Set operator error (union / intersect / except): selected fields are not the same or are in a different order");return e.addSetOperators(s)}}const cR=()=>({union:hR,unionAll:fR,intersect:dR,intersectAll:pR,except:mR,exceptAll:yR}),hR=oo("union",!1),fR=oo("union",!0),dR=oo("intersect",!1),pR=oo("intersect",!0),mR=oo("except",!1),yR=oo("except",!0);var ng;ng=xt;class Xf{constructor(t){G(this,"dialect");G(this,"dialectConfig");G(this,"$with",(t,e)=>{const i=this;return{as:s=>(typeof s=="function"&&(s=s(i)),new Proxy(new jf(s.getSQL(),e??("getSelectedFields"in s?s.getSelectedFields()??{}:{}),t,!0),new Je({alias:t,sqlAliasedBehavior:"alias",sqlBehavior:"error"})))}});this.dialect=lt(t,Bo)?t:void 0,this.dialectConfig=lt(t,Bo)?void 0:t}with(...t){const e=this;function i(o){return new Sr({fields:o??void 0,session:void 0,dialect:e.getDialect(),withList:t})}function n(o){return new Sr({fields:o??void 0,session:void 0,dialect:e.getDialect(),distinct:!0})}function s(o,a){return new Sr({fields:a??void 0,session:void 0,dialect:e.getDialect(),distinct:{on:o}})}return{select:i,selectDistinct:n,selectDistinctOn:s}}select(t){return new Sr({fields:t??void 0,session:void 0,dialect:this.getDialect()})}selectDistinct(t){return new Sr({fields:t??void 0,session:void 0,dialect:this.getDialect(),distinct:!0})}selectDistinctOn(t,e){return new Sr({fields:e??void 0,session:void 0,dialect:this.getDialect(),distinct:{on:t}})}getDialect(){return this.dialect||(this.dialect=new Bo(this.dialectConfig)),this.dialect}}G(Xf,ng,"PgQueryBuilder");var sg;sg=xt;class Oh{constructor(t,e,i,n,s){G(this,"authToken");this.table=t,this.session=e,this.dialect=i,this.withList=n,this.overridingSystemValue_=s}setToken(t){return this.authToken=t,this}overridingSystemValue(){return this.overridingSystemValue_=!0,this}values(t){if(t=Array.isArray(t)?t:[t],t.length===0)throw new Error("values() must be called with at least one value");const e=t.map(i=>{const n={},s=this.table[Tt.Symbol.Columns];for(const o of Object.keys(i)){const a=i[o];n[o]=lt(a,Ft)?a:new Wi(a,s[o])}return n});return new Fh(this.table,e,this.session,this.dialect,this.withList,!1,this.overridingSystemValue_).setToken(this.authToken)}select(t){const e=typeof t=="function"?t(new Xf):t;if(!lt(e,Ft)&&!Vf(this.table[Ih],e._.selectedFields))throw new Error("Insert select error: selected fields are not the same or are in a different order compared to the table definition");return new Fh(this.table,e,this.session,this.dialect,this.withList,!0)}}G(Oh,sg,"PgInsertBuilder");var og,ag;class Fh extends(ag=Tn,og=xt,ag){constructor(e,i,n,s,o,a,l){super();G(this,"config");G(this,"authToken");G(this,"execute",e=>Pr.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e,this.authToken)));this.session=n,this.dialect=s,this.config={table:e,values:i,withList:o,select:a,overridingSystemValue_:l}}returning(e=this.config.table[Tt.Symbol.Columns]){return this.config.returningFields=e,this.config.returning=os(e),this}onConflictDoNothing(e={}){if(e.target===void 0)this.config.onConflict=X`do nothing`;else{let i="";i=Array.isArray(e.target)?e.target.map(s=>this.dialect.escapeName(this.dialect.casing.getColumnCasing(s))).join(","):this.dialect.escapeName(this.dialect.casing.getColumnCasing(e.target));const n=e.where?X` where ${e.where}`:void 0;this.config.onConflict=X`(${X.raw(i)})${n} do nothing`}return this}onConflictDoUpdate(e){if(e.where&&(e.targetWhere||e.setWhere))throw new Error('You cannot use both "where" and "targetWhere"/"setWhere" at the same time - "where" is deprecated, use "targetWhere" or "setWhere" instead.');const i=e.where?X` where ${e.where}`:void 0,n=e.targetWhere?X` where ${e.targetWhere}`:void 0,s=e.setWhere?X` where ${e.setWhere}`:void 0,o=this.dialect.buildUpdateSet(this.config.table,ww(this.config.table,e.set));let a="";return a=Array.isArray(e.target)?e.target.map(l=>this.dialect.escapeName(this.dialect.casing.getColumnCasing(l))).join(","):this.dialect.escapeName(this.dialect.casing.getColumnCasing(e.target)),this.config.onConflict=X`(${X.raw(a)})${n} do update set ${o}${i}${s}`,this}getSQL(){return this.dialect.buildInsertQuery(this.config)}toSQL(){const{typings:e,...i}=this.dialect.sqlToQuery(this.getSQL());return i}_prepare(e){return Pr.startActiveSpan("drizzle.prepareQuery",()=>this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,e,!0))}prepare(e){return this._prepare(e)}setToken(e){return this.authToken=e,this}getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new Je({alias:qn(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}}G(Fh,og,"PgInsert");var lg,ug;class Bw extends(ug=Tn,lg=xt,ug){constructor(e,i,n){super();G(this,"config");G(this,"authToken");G(this,"execute",e=>Pr.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e,this.authToken)));this.session=i,this.dialect=n,this.config={view:e}}concurrently(){if(this.config.withNoData!==void 0)throw new Error("Cannot use concurrently and withNoData together");return this.config.concurrently=!0,this}withNoData(){if(this.config.concurrently!==void 0)throw new Error("Cannot use concurrently and withNoData together");return this.config.withNoData=!0,this}getSQL(){return this.dialect.buildRefreshMaterializedViewQuery(this.config)}toSQL(){const{typings:e,...i}=this.dialect.sqlToQuery(this.getSQL());return i}_prepare(e){return Pr.startActiveSpan("drizzle.prepareQuery",()=>this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),void 0,e,!0))}prepare(e){return this._prepare(e)}setToken(e){return this.authToken=e,this}}G(Bw,lg,"PgRefreshMaterializedView");var cg;cg=xt;class Ph{constructor(t,e,i,n){G(this,"authToken");this.table=t,this.session=e,this.dialect=i,this.withList=n}setToken(t){return this.authToken=t,this}set(t){return new kw(this.table,ww(this.table,t),this.session,this.dialect,this.withList).setToken(this.authToken)}}G(Ph,cg,"PgUpdateBuilder");var hg,fg;class kw extends(fg=Tn,hg=xt,fg){constructor(e,i,n,s,o){super();G(this,"config");G(this,"tableName");G(this,"joinsNotNullableMap");G(this,"leftJoin",this.createJoin("left"));G(this,"rightJoin",this.createJoin("right"));G(this,"innerJoin",this.createJoin("inner"));G(this,"fullJoin",this.createJoin("full"));G(this,"authToken");G(this,"execute",e=>this._prepare().execute(e,this.authToken));this.session=n,this.dialect=s,this.config={set:i,table:e,withList:o,joins:[]},this.tableName=Wn(e),this.joinsNotNullableMap=typeof this.tableName=="string"?{[this.tableName]:!0}:{}}from(e){const i=e,n=Wn(i);return typeof n=="string"&&(this.joinsNotNullableMap[n]=!0),this.config.from=i,this}getTableLikeFields(e){return lt(e,Br)?e[Tt.Symbol.Columns]:lt(e,Or)?e._.selectedFields:e[He].selectedFields}createJoin(e){return(i,n)=>{const s=Wn(i);if(typeof s=="string"&&this.config.joins.some(o=>o.alias===s))throw new Error(`Alias "${s}" is already used in this query`);if(typeof n=="function"){const o=this.config.from&&!lt(this.config.from,Ft)?this.getTableLikeFields(this.config.from):void 0;n=n(new Proxy(this.config.table[Tt.Symbol.Columns],new Je({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})),o&&new Proxy(o,new Je({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))}if(this.config.joins.push({on:n,table:i,joinType:e,alias:s}),typeof s=="string")switch(e){case"left":{this.joinsNotNullableMap[s]=!1;break}case"right":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([o])=>[o,!1])),this.joinsNotNullableMap[s]=!0;break}case"inner":{this.joinsNotNullableMap[s]=!0;break}case"full":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([o])=>[o,!1])),this.joinsNotNullableMap[s]=!1;break}}return this}}where(e){return this.config.where=e,this}returning(e){if(!e&&(e=Object.assign({},this.config.table[Tt.Symbol.Columns]),this.config.from)){const i=Wn(this.config.from);if(typeof i=="string"&&this.config.from&&!lt(this.config.from,Ft)){const n=this.getTableLikeFields(this.config.from);e[i]=n}for(const n of this.config.joins){const s=Wn(n.table);if(typeof s=="string"&&!lt(n.table,Ft)){const o=this.getTableLikeFields(n.table);e[s]=o}}}return this.config.returningFields=e,this.config.returning=os(e),this}getSQL(){return this.dialect.buildUpdateQuery(this.config)}toSQL(){const{typings:e,...i}=this.dialect.sqlToQuery(this.getSQL());return i}_prepare(e){const i=this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,e,!0);return i.joinsNotNullableMap=this.joinsNotNullableMap,i}prepare(e){return this._prepare(e)}setToken(e){return this.authToken=e,this}getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new Je({alias:qn(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}}G(kw,hg,"PgUpdate");var dg,pg,mg;const Uo=class Uo extends(mg=Ft,pg=xt,dg=Symbol.toStringTag,mg){constructor(e){super(Uo.buildEmbeddedCount(e.source,e.filters).queryChunks);G(this,"sql");G(this,"token");G(this,dg,"PgCountBuilder");G(this,"session");this.params=e,this.mapWith(Number),this.session=e.session,this.sql=Uo.buildCount(e.source,e.filters)}static buildEmbeddedCount(e,i){return X`(select count(*) from ${e}${X.raw(" where ").if(i)}${i})`}static buildCount(e,i){return X`select count(*) as count from ${e}${X.raw(" where ").if(i)}${i};`}setToken(e){return this.token=e,this}then(e,i){return Promise.resolve(this.session.count(this.sql,this.token)).then(e,i)}catch(e){return this.then(void 0,e)}finally(e){return this.then(i=>(e==null||e(),i),i=>{throw e==null||e(),i})}};G(Uo,pg,"PgCountBuilder");let Mh=Uo;var yg;yg=xt;class Uw{constructor(t,e,i,n,s,o,a){this.fullSchema=t,this.schema=e,this.tableNamesMap=i,this.table=n,this.tableConfig=s,this.dialect=o,this.session=a}findMany(t){return new Dh(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,t||{},"many")}findFirst(t){return new Dh(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,t?{...t,limit:1}:{limit:1},"first")}}G(Uw,yg,"PgRelationalQueryBuilder");var gg,vg;class Dh extends(vg=Tn,gg=xt,vg){constructor(e,i,n,s,o,a,l,u,c){super();G(this,"authToken");this.fullSchema=e,this.schema=i,this.tableNamesMap=n,this.table=s,this.tableConfig=o,this.dialect=a,this.session=l,this.config=u,this.mode=c}_prepare(e){return Pr.startActiveSpan("drizzle.prepareQuery",()=>{const{query:i,builtQuery:n}=this._toSQL();return this.session.prepareQuery(n,void 0,e,!0,(s,o)=>{const a=s.map(l=>Ch(this.schema,this.tableConfig,l,i.selection,o));return this.mode==="first"?a[0]:a})})}prepare(e){return this._prepare(e)}_getQuery(){return this.dialect.buildRelationalQueryWithoutPK({fullSchema:this.fullSchema,schema:this.schema,tableNamesMap:this.tableNamesMap,table:this.table,tableConfig:this.tableConfig,queryConfig:this.config,tableAlias:this.tableConfig.tsName})}getSQL(){return this._getQuery().sql}_toSQL(){const e=this._getQuery(),i=this.dialect.sqlToQuery(e.sql);return{query:e,builtQuery:i}}toSQL(){return this._toSQL().builtQuery}setToken(e){return this.authToken=e,this}execute(){return Pr.startActiveSpan("drizzle.operation",()=>this._prepare().execute(void 0,this.authToken))}}G(Dh,gg,"PgRelationalQuery");var _g,bg;class zw extends(bg=Tn,_g=xt,bg){constructor(t,e,i,n){super(),this.execute=t,this.sql=e,this.query=i,this.mapBatchResult=n}getSQL(){return this.sql}getQuery(){return this.query}mapResult(t,e){return e?this.mapBatchResult(t):t}_prepare(){return this}isResponseInArrayMode(){return!1}}G(zw,_g,"PgRaw");var wg;wg=xt;class Yf{constructor(t,e,i){G(this,"query");G(this,"$with",(t,e)=>{const i=this;return{as:s=>(typeof s=="function"&&(s=s(new Xf(i.dialect))),new Proxy(new jf(s.getSQL(),e??("getSelectedFields"in s?s.getSelectedFields()??{}:{}),t,!0),new Je({alias:t,sqlAliasedBehavior:"alias",sqlBehavior:"error"})))}});G(this,"authToken");if(this.dialect=t,this.session=e,this._=i?{schema:i.schema,fullSchema:i.fullSchema,tableNamesMap:i.tableNamesMap,session:e}:{schema:void 0,fullSchema:{},tableNamesMap:{},session:e},this.query={},this._.schema)for(const[n,s]of Object.entries(this._.schema))this.query[n]=new Uw(i.fullSchema,this._.schema,this._.tableNamesMap,i.fullSchema[n],s,t,e)}$count(t,e){return new Mh({source:t,filters:e,session:this.session})}with(...t){const e=this;function i(u){return new Sr({fields:u??void 0,session:e.session,dialect:e.dialect,withList:t})}function n(u){return new Sr({fields:u??void 0,session:e.session,dialect:e.dialect,withList:t,distinct:!0})}function s(u,c){return new Sr({fields:c??void 0,session:e.session,dialect:e.dialect,withList:t,distinct:{on:u}})}function o(u){return new Ph(u,e.session,e.dialect,t)}function a(u){return new Oh(u,e.session,e.dialect,t)}function l(u){return new Ah(u,e.session,e.dialect,t)}return{select:i,selectDistinct:n,selectDistinctOn:s,update:o,insert:a,delete:l}}select(t){return new Sr({fields:t??void 0,session:this.session,dialect:this.dialect})}selectDistinct(t){return new Sr({fields:t??void 0,session:this.session,dialect:this.dialect,distinct:!0})}selectDistinctOn(t,e){return new Sr({fields:e??void 0,session:this.session,dialect:this.dialect,distinct:{on:t}})}update(t){return new Ph(t,this.session,this.dialect)}insert(t){return new Oh(t,this.session,this.dialect)}delete(t){return new Ah(t,this.session,this.dialect)}refreshMaterializedView(t){return new Bw(t,this.session,this.dialect)}execute(t){const e=typeof t=="string"?X.raw(t):t.getSQL(),i=this.dialect.sqlToQuery(e),n=this.session.prepareQuery(i,void 0,void 0,!1);return new zw(()=>n.execute(void 0,this.authToken),e,i,s=>n.mapResult(s,!0))}transaction(t,e){return this.session.transaction(t,e)}}G(Yf,wg,"PgDatabase");var xg;xg=xt;class jw{constructor(t){G(this,"authToken");G(this,"joinsNotNullableMap");this.query=t}getQuery(){return this.query}mapResult(t,e){return t}setToken(t){return this.authToken=t,this}}G(jw,xg,"PgPreparedQuery");var Sg;Sg=xt;class $w{constructor(t){this.dialect=t}execute(t,e){return Pr.startActiveSpan("drizzle.operation",()=>Pr.startActiveSpan("drizzle.prepareQuery",()=>this.prepareQuery(this.dialect.sqlToQuery(t),void 0,void 0,!1)).setToken(e).execute(void 0,e))}all(t){return this.prepareQuery(this.dialect.sqlToQuery(t),void 0,void 0,!1).all()}async count(t,e){const i=await this.execute(t,e);return Number(i[0].count)}}G($w,Sg,"PgSession");var Tg,Ig;class Vw extends(Ig=Yf,Tg=xt,Ig){constructor(t,e,i,n=0){super(t,e,i),this.schema=i,this.nestedIndex=n}rollback(){throw new yw}getTransactionConfigSQL(t){const e=[];return t.isolationLevel&&e.push(`isolation level ${t.isolationLevel}`),t.accessMode&&e.push(t.accessMode),typeof t.deferrable=="boolean"&&e.push(t.deferrable?"deferrable":"not deferrable"),X.raw(e.join(" "))}setTransaction(t){return this.session.execute(X`set transaction ${this.getTransactionConfigSQL(t)}`)}}G(Vw,Tg,"PgTransaction");function Om(r){return typeof r=="string"&&/^true$/i.test(r)}function gR(r){const t={scheme:"duckdb-wasm:"},e=new URL(r);if(!e.protocol.startsWith("duckdb-wasm:"))throw new Error(`Expected scheme to be "duckdb-wasm:" but got "${e.protocol}"`);e.searchParams.get("bundles")==="import-url"&&(t.bundles="import-url");const i=e.searchParams.get("logger");i&&Om(i)&&(t.logger=!0);const n=e.searchParams.get("storage");switch(n){case ra.ORIGIN_PRIVATE_FS:{e.host.length>0&&console.warn(`Host "${e.host}" will be ignored while using Origin Private FS`);const s=e.searchParams.get("write");t.storage={type:ra.ORIGIN_PRIVATE_FS,path:e.pathname.startsWith("/")?e.pathname.slice(1):e.pathname,...s&&Om(s)&&{accessMode:T0.READ_WRITE}};break}case null:break;default:console.warn(`Unknown storage type "${n}"`);break}return t}var Eg,Cg;class Gw extends(Cg=jw,Eg=xt,Cg){constructor(t,e,i,n,s,o){super({sql:e,params:i}),this.client=t,this.queryString=e,this.params=i,this.logger=n,this.fields=s,this.customResultMapper=o}async execute(t={}){const e=Em(this.params,t);this.logger.logQuery(this.queryString,e);const{fields:i,queryString:n,client:s,customResultMapper:o}=this,a=await s;return a.query(n,e)}async all(t={}){const e=Em(this.params,t);return this.logger.logQuery(this.queryString,e),(await this.client).query(this.queryString,e)}}G(Gw,Eg,"DuckDBWasmPreparedQuery");var Ag,Og;const Yl=class Yl extends(Og=$w,Ag=xt,Og){constructor(e,i,n,s={}){super(i);G(this,"logger");this.client=e,this.schema=n,this.options=s,this.logger=s.logger??new bw}prepareQuery(e,i,n,s,o){return new Gw(this.client,e.sql,e.params,this.logger,i,o)}async query(e,i){return this.logger.logQuery(e,i),(await this.client).query(e,i)}async queryObjects(e,i){return this.logger.logQuery(e,i),(await this.client).query(e,i)}transaction(e,i){return xD(this.client,async n=>{const s=new Yl(n,this.dialect,this.schema,this.options),o=new Rh(this.dialect,s,this.schema);return i&&await o.setTransaction(i),e(o)})}};G(Yl,Ag,"DuckDBWasmSession");let Gl=Yl;var Fg,Pg;const ql=class ql extends(Pg=Vw,Fg=xt,Pg){constructor(e,i,n,s=0){super(e,i,n,s);G(this,"dialect");G(this,"session");this.dialect=e,this.session=i}async transaction(e){return SD(this.session.client,"",async i=>{const n=new Gl(i,this.dialect,this.schema,this.session.options),s=new ql(this.dialect,n,this.schema);return e(s)})}};G(ql,Fg,"DuckDBWasmTransaction");let Rh=ql;var Mg,Dg;class Ww extends(Dg=Yf,Mg=xt,Dg){}G(Ww,Mg,"DuckDBWasmDatabase");function ko(r,t={}){const e=new Bo({casing:t.casing});let i;t.logger===!0?i=new _w:t.logger!==!1&&(i=t.logger);let n;if(t.schema){const a=rR(t.schema,oR);n={fullSchema:t.schema,schema:a.tables,tableNamesMap:a.tableNamesMap}}const s=new Gl(r,e,n,{logger:i}),o=new Ww(e,s,n);return o.$client=r,o}function Fm(r,t){const e=gR(r);let i;return e.bundles==="import-url"?i=(async()=>{const s=await Sh();switch(s){case"browser":return(await ln(async()=>{const{getImportUrlBundles:o}=await import("./import-url-browser-CPN8ipMD.js");return{getImportUrlBundles:o}},__vite__mapDeps([3,4]))).getImportUrlBundles();case"node":return await(await ln(async()=>{const{getImportUrlBundles:o}=await import("./import-url-node-BfNoxhRr.js");return{getImportUrlBundles:o}},__vite__mapDeps([5,4]))).getImportUrlBundles();default:throw new Error(`Unsupported environment: "${s}"`)}})():i=(async()=>{const s=await Sh();switch(s){case"browser":return(await ln(async()=>{const{getBundles:o}=await import("./default-browser-BrgSDbLD.js");return{getBundles:o}},[])).getBundles();case"node":return await(await ln(async()=>{const{getBundles:o}=await import("./default-node-DRO9_bbw.js");return{getBundles:o}},__vite__mapDeps([0,1,2]))).getBundles();default:throw new Error(`Unsupported environment: "${s}"`)}})(),ko(hw({bundles:i,logger:e.logger?new I0:void 0,storage:e.storage}),t)}function Pm(...r){if(typeof r[0]=="string")return Fm(r[0],r[1]);if(JD(r[0])){const{connection:t,client:e,...i}=r[0];if(e)return ko(e,i);if(typeof t=="string")return Fm(t,i);if(typeof t>"u")throw new Error("connection option is required");return ko(hw({bundles:t.bundles,logger:t.logger,storage:t.storage}),i)}return ko(r[0],r[1])}(r=>{function t(e){return ko({options:{parsers:{},serializers:{}}},e)}r.mock=t})(Pm||(Pm={}));export{L1 as A,TR as D,xR as I,pC as J,eI as L,_c as M,wR as T,fi as a,Re as b,Pm as d,sa as e,SR as l}; + `;await e.execute(X`CREATE SCHEMA IF NOT EXISTS ${X.identifier(s)}`),await e.execute(o);const l=(await e.all(X`select id, hash, created_at from ${X.identifier(s)}.${X.identifier(n)} order by created_at desc limit 1`))[0];await e.transaction(async u=>{for await(const c of t)if(!l||Number(l.created_at){var a;return e[o]!==void 0||((a=i[o])==null?void 0:a.onUpdateFn)!==void 0}),s=n.length;return X.join(n.flatMap((o,a)=>{const l=i[o],u=e[o]??X.param(l.onUpdateFn(),l),c=X`${X.identifier(this.casing.getColumnCasing(l))} = ${u}`;return a{const a=[];if(lt(s,Ft.Aliased)&&s.isSelectionField)a.push(X.identifier(s.fieldAlias));else if(lt(s,Ft.Aliased)||lt(s,Ft)){const l=lt(s,Ft.Aliased)?s.sql:s;e?a.push(new Ft(l.queryChunks.map(u=>lt(u,Ar)?X.identifier(this.casing.getColumnCasing(u)):u))):a.push(l),lt(s,Ft.Aliased)&&a.push(X` as ${X.identifier(s.fieldAlias)}`)}else lt(s,Ke)&&(e?a.push(X.identifier(this.casing.getColumnCasing(s))):a.push(s));return oa==null?void 0:a.some(({alias:M})=>M===(it[Tt.Symbol.IsAlias]?qn(it):it[Tt.Symbol.BaseName])))(w.field.table)){const it=qn(w.field.table);throw new Error(`Your "${w.path.join("->")}" field references a column "${it}"."${w.field.name}", but the table "${it}" is not part of the query! Did you forget to join it?`)}const d=!a||a.length===0,m=this.buildWithCTE(t);let _;f&&(_=f===!0?X` distinct`:X` distinct on (${X.join(f.on,X`, `)})`);const S=this.buildSelection(g,{isSingleTable:d}),E=this.buildFromTable(o),b=this.buildJoins(a),F=n?X` where ${n}`:void 0,x=s?X` having ${s}`:void 0;let z;l&&l.length>0&&(z=X` order by ${X.join(l,X`, `)}`);let B;u&&u.length>0&&(B=X` group by ${X.join(u,X`, `)}`);const tt=typeof c=="object"||typeof c=="number"&&c>=0?X` limit ${c}`:void 0,st=h?X` offset ${h}`:void 0,I=X.empty();if(p){const w=X` for ${X.raw(p.strength)}`;p.config.of&&w.append(X` of ${X.join(Array.isArray(p.config.of)?p.config.of:[p.config.of],X`, `)}`),p.config.noWait?w.append(X` no wait`):p.config.skipLocked&&w.append(X` skip locked`),I.append(w)}const Z=X`${m}select${_} ${S} from ${E}${b}${F}${B}${x}${z}${tt}${st}${I}`;return y.length>0?this.buildSetOperations(Z,y):Z}buildSetOperations(t,e){const[i,...n]=e;if(!i)throw new Error("Cannot pass undefined values to any set operator");return n.length===0?this.buildSetOperationQuery({leftSelect:t,setOperator:i}):this.buildSetOperations(this.buildSetOperationQuery({leftSelect:t,setOperator:i}),n)}buildSetOperationQuery({leftSelect:t,setOperator:{type:e,isAll:i,rightSelect:n,limit:s,orderBy:o,offset:a}}){const l=X`(${t.getSQL()}) `,u=X`(${n.getSQL()})`;let c;if(o&&o.length>0){const y=[];for(const g of o)if(lt(g,Ar))y.push(X.identifier(g.name));else if(lt(g,Ft)){for(let d=0;d=0?X` limit ${s}`:void 0,p=X.raw(`${e} ${i?"all ":""}`),f=a?X` offset ${a}`:void 0;return X`${l}${p}${u}${c}${h}${f}`}buildInsertQuery({table:t,values:e,onConflict:i,returning:n,withList:s,select:o,overridingSystemValue_:a}){const l=[],u=t[Tt.Symbol.Columns],c=Object.entries(u).filter(([m,_])=>!_.shouldDisableInsert()),h=c.map(([,m])=>X.identifier(this.casing.getColumnCasing(m)));if(o){const m=e;lt(m,Ft)?l.push(m):l.push(m.getSQL())}else{const m=e;l.push(X.raw("values "));for(const[_,S]of m.entries()){const E=[];for(const[b,F]of c){const x=S[b];if(x===void 0||lt(x,Wi)&&x.value===void 0)if(F.defaultFn!==void 0){const z=F.defaultFn(),B=lt(z,Ft)?z:X.param(z,F);E.push(B)}else if(!F.default&&F.onUpdateFn!==void 0){const z=F.onUpdateFn(),B=lt(z,Ft)?z:X.param(z,F);E.push(B)}else E.push(X`default`);else E.push(x)}l.push(E),_({dbKey:S.name,tsKey:_,field:Li(S,a),relationTableTsKey:void 0,isJson:!1,selection:[]}));else{const m=Object.fromEntries(Object.entries(s.columns).map(([x,z])=>[x,Li(z,a)]));if(o.where){const x=typeof o.where=="function"?o.where(m,tR()):o.where;y=x&&$l(x,a)}const _=[];let S=[];if(o.columns){let x=!1;for(const[z,B]of Object.entries(o.columns))B!==void 0&&z in s.columns&&(!x&&B===!0&&(x=!0),S.push(z));S.length>0&&(S=x?S.filter(z=>{var B;return((B=o.columns)==null?void 0:B[z])===!0}):Object.keys(s.columns).filter(z=>!S.includes(z)))}else S=Object.keys(s.columns);for(const x of S){const z=s.columns[x];_.push({tsKey:x,value:z})}let E=[];o.with&&(E=Object.entries(o.with).filter(x=>!!x[1]).map(([x,z])=>({tsKey:x,queryConfig:z,relation:s.relations[x]})));let b;if(o.extras){b=typeof o.extras=="function"?o.extras(m,{sql:X}):o.extras;for(const[x,z]of Object.entries(b))_.push({tsKey:x,value:mw(z,a)})}for(const{tsKey:x,value:z}of _)c.push({dbKey:lt(z,Ft.Aliased)?z.fieldAlias:s.columns[x].name,tsKey:x,field:lt(z,Ke)?Li(z,a):z,relationTableTsKey:void 0,isJson:!1,selection:[]});let F=typeof o.orderBy=="function"?o.orderBy(m,eR()):o.orderBy??[];Array.isArray(F)||(F=[F]),f=F.map(x=>lt(x,Ke)?Li(x,a):$l(x,a)),h=o.limit,p=o.offset;for(const{tsKey:x,queryConfig:z,relation:B}of E){const tt=sR(e,i,B),st=ia(B.referencedTable),I=i[st],Z=`${a}_${x}`,w=Eh(...tt.fields.map((O,D)=>gw(Li(tt.references[D],Z),Li(O,a)))),it=this.buildRelationalQueryWithoutPK({fullSchema:t,schema:e,tableNamesMap:i,table:t[I],tableConfig:e[I],queryConfig:lt(B,as)?z===!0?{limit:1}:{...z,limit:1}:z,tableAlias:Z,joinOn:w,nestedQueryRelation:B}),M=X`${X.identifier(Z)}.${X.identifier("data")}`.as(x);g.push({on:X`true`,table:new Or(it.sql,{},Z),alias:Z,joinType:"left",lateral:!0}),c.push({dbKey:x,tsKey:x,field:M,relationTableTsKey:I,isJson:!0,selection:it.selection})}}if(c.length===0)throw new $f({message:`No fields selected for table "${s.tsName}" ("${a}")`});let d;if(y=Eh(u,y),l){let m=X`json_build_array(${X.join(c.map(({field:E,tsKey:b,isJson:F})=>F?X`${X.identifier(`${a}_${b}`)}.${X.identifier("data")}`:lt(E,Ft.Aliased)?E.sql:E),X`, `)})`;lt(l,Vl)&&(m=X`coalesce(json_agg(${m}${f.length>0?X` order by ${X.join(f,X`, `)}`:void 0}), '[]'::json)`);const _=[{dbKey:"data",tsKey:"data",field:m.as("data"),isJson:!0,relationTableTsKey:s.tsName,selection:c}];h!==void 0||p!==void 0||f.length>0?(d=this.buildSelectQuery({table:ac(n,a),fields:{},fieldsFlat:[{path:[],field:X.raw("*")}],where:y,limit:h,offset:p,orderBy:f,setOperators:[]}),y=void 0,h=void 0,p=void 0,f=[]):d=ac(n,a),d=this.buildSelectQuery({table:lt(d,Br)?d:new Or(d,{},a),fields:{},fieldsFlat:_.map(({field:E})=>({path:[],field:lt(E,Ke)?Li(E,a):E})),joins:g,where:y,limit:h,offset:p,orderBy:f,setOperators:[]})}else d=this.buildSelectQuery({table:ac(n,a),fields:{},fieldsFlat:c.map(({field:m})=>({path:[],field:lt(m,Ke)?Li(m,a):m})),joins:g,where:y,limit:h,offset:p,orderBy:f,setOperators:[]});return{tableTsKey:s.tsName,sql:d,selection:c}}}G(Bo,Ky,"PgDialect");var Zy;Zy=xt;class Nw{getSelectedFields(){return this._.selectedFields}}G(Nw,Zy,"TypedQueryBuilder");var Jy;Jy=xt;class Sr{constructor(t){G(this,"fields");G(this,"session");G(this,"dialect");G(this,"withList",[]);G(this,"distinct");G(this,"authToken");this.fields=t.fields,this.session=t.session,this.dialect=t.dialect,t.withList&&(this.withList=t.withList),this.distinct=t.distinct}setToken(t){return this.authToken=t,this}from(t){const e=!!this.fields,i=t;let n;return this.fields?n=this.fields:lt(i,Or)?n=Object.fromEntries(Object.keys(i._.selectedFields).map(s=>[s,i[s]])):lt(i,Wf)?n=i[He].selectedFields:lt(i,Ft)?n={}:n=ZD(i),new Hf({table:i,fields:n,isPartialSelect:e,session:this.session,dialect:this.dialect,withList:this.withList,distinct:this.distinct}).setToken(this.authToken)}}G(Sr,Jy,"PgSelectBuilder");var tg,eg;class Lw extends(eg=Nw,tg=xt,eg){constructor({table:e,fields:i,isPartialSelect:n,session:s,dialect:o,withList:a,distinct:l}){super();G(this,"_");G(this,"config");G(this,"joinsNotNullableMap");G(this,"tableName");G(this,"isPartialSelect");G(this,"session");G(this,"dialect");G(this,"leftJoin",this.createJoin("left"));G(this,"rightJoin",this.createJoin("right"));G(this,"innerJoin",this.createJoin("inner"));G(this,"fullJoin",this.createJoin("full"));G(this,"union",this.createSetOperator("union",!1));G(this,"unionAll",this.createSetOperator("union",!0));G(this,"intersect",this.createSetOperator("intersect",!1));G(this,"intersectAll",this.createSetOperator("intersect",!0));G(this,"except",this.createSetOperator("except",!1));G(this,"exceptAll",this.createSetOperator("except",!0));this.config={withList:a,table:e,fields:{...i},distinct:l,setOperators:[]},this.isPartialSelect=n,this.session=s,this.dialect=o,this._={selectedFields:i},this.tableName=Wn(e),this.joinsNotNullableMap=typeof this.tableName=="string"?{[this.tableName]:!0}:{}}createJoin(e){return(i,n)=>{var a;const s=this.tableName,o=Wn(i);if(typeof o=="string"&&((a=this.config.joins)!=null&&a.some(l=>l.alias===o)))throw new Error(`Alias "${o}" is already used in this query`);if(!this.isPartialSelect&&(Object.keys(this.joinsNotNullableMap).length===1&&typeof s=="string"&&(this.config.fields={[s]:this.config.fields}),typeof o=="string"&&!lt(i,Ft))){const l=lt(i,Or)?i._.selectedFields:lt(i,Sn)?i[He].selectedFields:i[Tt.Symbol.Columns];this.config.fields[o]=l}if(typeof n=="function"&&(n=n(new Proxy(this.config.fields,new Je({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.joins||(this.config.joins=[]),this.config.joins.push({on:n,table:i,joinType:e,alias:o}),typeof o=="string")switch(e){case"left":{this.joinsNotNullableMap[o]=!1;break}case"right":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([l])=>[l,!1])),this.joinsNotNullableMap[o]=!0;break}case"inner":{this.joinsNotNullableMap[o]=!0;break}case"full":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([l])=>[l,!1])),this.joinsNotNullableMap[o]=!1;break}}return this}}createSetOperator(e,i){return n=>{const s=typeof n=="function"?n(cR()):n;if(!Vf(this.getSelectedFields(),s.getSelectedFields()))throw new Error("Set operator error (union / intersect / except): selected fields are not the same or are in a different order");return this.config.setOperators.push({type:e,isAll:i,rightSelect:s}),this}}addSetOperators(e){return this.config.setOperators.push(...e),this}where(e){return typeof e=="function"&&(e=e(new Proxy(this.config.fields,new Je({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.where=e,this}having(e){return typeof e=="function"&&(e=e(new Proxy(this.config.fields,new Je({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.having=e,this}groupBy(...e){if(typeof e[0]=="function"){const i=e[0](new Proxy(this.config.fields,new Je({sqlAliasedBehavior:"alias",sqlBehavior:"sql"})));this.config.groupBy=Array.isArray(i)?i:[i]}else this.config.groupBy=e;return this}orderBy(...e){if(typeof e[0]=="function"){const i=e[0](new Proxy(this.config.fields,new Je({sqlAliasedBehavior:"alias",sqlBehavior:"sql"}))),n=Array.isArray(i)?i:[i];this.config.setOperators.length>0?this.config.setOperators.at(-1).orderBy=n:this.config.orderBy=n}else{const i=e;this.config.setOperators.length>0?this.config.setOperators.at(-1).orderBy=i:this.config.orderBy=i}return this}limit(e){return this.config.setOperators.length>0?this.config.setOperators.at(-1).limit=e:this.config.limit=e,this}offset(e){return this.config.setOperators.length>0?this.config.setOperators.at(-1).offset=e:this.config.offset=e,this}for(e,i={}){return this.config.lockingClause={strength:e,config:i},this}getSQL(){return this.dialect.buildSelectQuery(this.config)}toSQL(){const{typings:e,...i}=this.dialect.sqlToQuery(this.getSQL());return i}as(e){return new Proxy(new Or(this.getSQL(),this.config.fields,e),new Je({alias:e,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}getSelectedFields(){return new Proxy(this.config.fields,new Je({alias:this.tableName,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}$dynamic(){return this}}G(Lw,tg,"PgSelectQueryBuilder");var rg,ig;class Hf extends(ig=Lw,rg=xt,ig){constructor(){super(...arguments);G(this,"authToken");G(this,"execute",e=>Pr.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e,this.authToken)))}_prepare(e){const{session:i,config:n,dialect:s,joinsNotNullableMap:o,authToken:a}=this;if(!i)throw new Error("Cannot execute a query on a query builder. Please use a database instance instead.");return Pr.startActiveSpan("drizzle.prepareQuery",()=>{const l=os(n.fields),u=i.prepareQuery(s.sqlToQuery(this.getSQL()),l,e,!0);return u.joinsNotNullableMap=o,u.setToken(a)})}prepare(e){return this._prepare(e)}setToken(e){return this.authToken=e,this}}G(Hf,rg,"PgSelect");KD(Hf,[Tn]);function oo(r,t){return(e,i,...n)=>{const s=[i,...n].map(o=>({type:r,isAll:t,rightSelect:o}));for(const o of s)if(!Vf(e.getSelectedFields(),o.rightSelect.getSelectedFields()))throw new Error("Set operator error (union / intersect / except): selected fields are not the same or are in a different order");return e.addSetOperators(s)}}const cR=()=>({union:hR,unionAll:fR,intersect:dR,intersectAll:pR,except:mR,exceptAll:yR}),hR=oo("union",!1),fR=oo("union",!0),dR=oo("intersect",!1),pR=oo("intersect",!0),mR=oo("except",!1),yR=oo("except",!0);var ng;ng=xt;class Xf{constructor(t){G(this,"dialect");G(this,"dialectConfig");G(this,"$with",(t,e)=>{const i=this;return{as:s=>(typeof s=="function"&&(s=s(i)),new Proxy(new jf(s.getSQL(),e??("getSelectedFields"in s?s.getSelectedFields()??{}:{}),t,!0),new Je({alias:t,sqlAliasedBehavior:"alias",sqlBehavior:"error"})))}});this.dialect=lt(t,Bo)?t:void 0,this.dialectConfig=lt(t,Bo)?void 0:t}with(...t){const e=this;function i(o){return new Sr({fields:o??void 0,session:void 0,dialect:e.getDialect(),withList:t})}function n(o){return new Sr({fields:o??void 0,session:void 0,dialect:e.getDialect(),distinct:!0})}function s(o,a){return new Sr({fields:a??void 0,session:void 0,dialect:e.getDialect(),distinct:{on:o}})}return{select:i,selectDistinct:n,selectDistinctOn:s}}select(t){return new Sr({fields:t??void 0,session:void 0,dialect:this.getDialect()})}selectDistinct(t){return new Sr({fields:t??void 0,session:void 0,dialect:this.getDialect(),distinct:!0})}selectDistinctOn(t,e){return new Sr({fields:e??void 0,session:void 0,dialect:this.getDialect(),distinct:{on:t}})}getDialect(){return this.dialect||(this.dialect=new Bo(this.dialectConfig)),this.dialect}}G(Xf,ng,"PgQueryBuilder");var sg;sg=xt;class Oh{constructor(t,e,i,n,s){G(this,"authToken");this.table=t,this.session=e,this.dialect=i,this.withList=n,this.overridingSystemValue_=s}setToken(t){return this.authToken=t,this}overridingSystemValue(){return this.overridingSystemValue_=!0,this}values(t){if(t=Array.isArray(t)?t:[t],t.length===0)throw new Error("values() must be called with at least one value");const e=t.map(i=>{const n={},s=this.table[Tt.Symbol.Columns];for(const o of Object.keys(i)){const a=i[o];n[o]=lt(a,Ft)?a:new Wi(a,s[o])}return n});return new Fh(this.table,e,this.session,this.dialect,this.withList,!1,this.overridingSystemValue_).setToken(this.authToken)}select(t){const e=typeof t=="function"?t(new Xf):t;if(!lt(e,Ft)&&!Vf(this.table[Ih],e._.selectedFields))throw new Error("Insert select error: selected fields are not the same or are in a different order compared to the table definition");return new Fh(this.table,e,this.session,this.dialect,this.withList,!0)}}G(Oh,sg,"PgInsertBuilder");var og,ag;class Fh extends(ag=Tn,og=xt,ag){constructor(e,i,n,s,o,a,l){super();G(this,"config");G(this,"authToken");G(this,"execute",e=>Pr.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e,this.authToken)));this.session=n,this.dialect=s,this.config={table:e,values:i,withList:o,select:a,overridingSystemValue_:l}}returning(e=this.config.table[Tt.Symbol.Columns]){return this.config.returningFields=e,this.config.returning=os(e),this}onConflictDoNothing(e={}){if(e.target===void 0)this.config.onConflict=X`do nothing`;else{let i="";i=Array.isArray(e.target)?e.target.map(s=>this.dialect.escapeName(this.dialect.casing.getColumnCasing(s))).join(","):this.dialect.escapeName(this.dialect.casing.getColumnCasing(e.target));const n=e.where?X` where ${e.where}`:void 0;this.config.onConflict=X`(${X.raw(i)})${n} do nothing`}return this}onConflictDoUpdate(e){if(e.where&&(e.targetWhere||e.setWhere))throw new Error('You cannot use both "where" and "targetWhere"/"setWhere" at the same time - "where" is deprecated, use "targetWhere" or "setWhere" instead.');const i=e.where?X` where ${e.where}`:void 0,n=e.targetWhere?X` where ${e.targetWhere}`:void 0,s=e.setWhere?X` where ${e.setWhere}`:void 0,o=this.dialect.buildUpdateSet(this.config.table,ww(this.config.table,e.set));let a="";return a=Array.isArray(e.target)?e.target.map(l=>this.dialect.escapeName(this.dialect.casing.getColumnCasing(l))).join(","):this.dialect.escapeName(this.dialect.casing.getColumnCasing(e.target)),this.config.onConflict=X`(${X.raw(a)})${n} do update set ${o}${i}${s}`,this}getSQL(){return this.dialect.buildInsertQuery(this.config)}toSQL(){const{typings:e,...i}=this.dialect.sqlToQuery(this.getSQL());return i}_prepare(e){return Pr.startActiveSpan("drizzle.prepareQuery",()=>this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,e,!0))}prepare(e){return this._prepare(e)}setToken(e){return this.authToken=e,this}getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new Je({alias:qn(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}}G(Fh,og,"PgInsert");var lg,ug;class Bw extends(ug=Tn,lg=xt,ug){constructor(e,i,n){super();G(this,"config");G(this,"authToken");G(this,"execute",e=>Pr.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e,this.authToken)));this.session=i,this.dialect=n,this.config={view:e}}concurrently(){if(this.config.withNoData!==void 0)throw new Error("Cannot use concurrently and withNoData together");return this.config.concurrently=!0,this}withNoData(){if(this.config.concurrently!==void 0)throw new Error("Cannot use concurrently and withNoData together");return this.config.withNoData=!0,this}getSQL(){return this.dialect.buildRefreshMaterializedViewQuery(this.config)}toSQL(){const{typings:e,...i}=this.dialect.sqlToQuery(this.getSQL());return i}_prepare(e){return Pr.startActiveSpan("drizzle.prepareQuery",()=>this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),void 0,e,!0))}prepare(e){return this._prepare(e)}setToken(e){return this.authToken=e,this}}G(Bw,lg,"PgRefreshMaterializedView");var cg;cg=xt;class Ph{constructor(t,e,i,n){G(this,"authToken");this.table=t,this.session=e,this.dialect=i,this.withList=n}setToken(t){return this.authToken=t,this}set(t){return new kw(this.table,ww(this.table,t),this.session,this.dialect,this.withList).setToken(this.authToken)}}G(Ph,cg,"PgUpdateBuilder");var hg,fg;class kw extends(fg=Tn,hg=xt,fg){constructor(e,i,n,s,o){super();G(this,"config");G(this,"tableName");G(this,"joinsNotNullableMap");G(this,"leftJoin",this.createJoin("left"));G(this,"rightJoin",this.createJoin("right"));G(this,"innerJoin",this.createJoin("inner"));G(this,"fullJoin",this.createJoin("full"));G(this,"authToken");G(this,"execute",e=>this._prepare().execute(e,this.authToken));this.session=n,this.dialect=s,this.config={set:i,table:e,withList:o,joins:[]},this.tableName=Wn(e),this.joinsNotNullableMap=typeof this.tableName=="string"?{[this.tableName]:!0}:{}}from(e){const i=e,n=Wn(i);return typeof n=="string"&&(this.joinsNotNullableMap[n]=!0),this.config.from=i,this}getTableLikeFields(e){return lt(e,Br)?e[Tt.Symbol.Columns]:lt(e,Or)?e._.selectedFields:e[He].selectedFields}createJoin(e){return(i,n)=>{const s=Wn(i);if(typeof s=="string"&&this.config.joins.some(o=>o.alias===s))throw new Error(`Alias "${s}" is already used in this query`);if(typeof n=="function"){const o=this.config.from&&!lt(this.config.from,Ft)?this.getTableLikeFields(this.config.from):void 0;n=n(new Proxy(this.config.table[Tt.Symbol.Columns],new Je({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})),o&&new Proxy(o,new Je({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))}if(this.config.joins.push({on:n,table:i,joinType:e,alias:s}),typeof s=="string")switch(e){case"left":{this.joinsNotNullableMap[s]=!1;break}case"right":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([o])=>[o,!1])),this.joinsNotNullableMap[s]=!0;break}case"inner":{this.joinsNotNullableMap[s]=!0;break}case"full":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([o])=>[o,!1])),this.joinsNotNullableMap[s]=!1;break}}return this}}where(e){return this.config.where=e,this}returning(e){if(!e&&(e=Object.assign({},this.config.table[Tt.Symbol.Columns]),this.config.from)){const i=Wn(this.config.from);if(typeof i=="string"&&this.config.from&&!lt(this.config.from,Ft)){const n=this.getTableLikeFields(this.config.from);e[i]=n}for(const n of this.config.joins){const s=Wn(n.table);if(typeof s=="string"&&!lt(n.table,Ft)){const o=this.getTableLikeFields(n.table);e[s]=o}}}return this.config.returningFields=e,this.config.returning=os(e),this}getSQL(){return this.dialect.buildUpdateQuery(this.config)}toSQL(){const{typings:e,...i}=this.dialect.sqlToQuery(this.getSQL());return i}_prepare(e){const i=this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,e,!0);return i.joinsNotNullableMap=this.joinsNotNullableMap,i}prepare(e){return this._prepare(e)}setToken(e){return this.authToken=e,this}getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new Je({alias:qn(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}}G(kw,hg,"PgUpdate");var dg,pg,mg;const Uo=class Uo extends(mg=Ft,pg=xt,dg=Symbol.toStringTag,mg){constructor(e){super(Uo.buildEmbeddedCount(e.source,e.filters).queryChunks);G(this,"sql");G(this,"token");G(this,dg,"PgCountBuilder");G(this,"session");this.params=e,this.mapWith(Number),this.session=e.session,this.sql=Uo.buildCount(e.source,e.filters)}static buildEmbeddedCount(e,i){return X`(select count(*) from ${e}${X.raw(" where ").if(i)}${i})`}static buildCount(e,i){return X`select count(*) as count from ${e}${X.raw(" where ").if(i)}${i};`}setToken(e){return this.token=e,this}then(e,i){return Promise.resolve(this.session.count(this.sql,this.token)).then(e,i)}catch(e){return this.then(void 0,e)}finally(e){return this.then(i=>(e==null||e(),i),i=>{throw e==null||e(),i})}};G(Uo,pg,"PgCountBuilder");let Mh=Uo;var yg;yg=xt;class Uw{constructor(t,e,i,n,s,o,a){this.fullSchema=t,this.schema=e,this.tableNamesMap=i,this.table=n,this.tableConfig=s,this.dialect=o,this.session=a}findMany(t){return new Dh(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,t||{},"many")}findFirst(t){return new Dh(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,t?{...t,limit:1}:{limit:1},"first")}}G(Uw,yg,"PgRelationalQueryBuilder");var gg,vg;class Dh extends(vg=Tn,gg=xt,vg){constructor(e,i,n,s,o,a,l,u,c){super();G(this,"authToken");this.fullSchema=e,this.schema=i,this.tableNamesMap=n,this.table=s,this.tableConfig=o,this.dialect=a,this.session=l,this.config=u,this.mode=c}_prepare(e){return Pr.startActiveSpan("drizzle.prepareQuery",()=>{const{query:i,builtQuery:n}=this._toSQL();return this.session.prepareQuery(n,void 0,e,!0,(s,o)=>{const a=s.map(l=>Ch(this.schema,this.tableConfig,l,i.selection,o));return this.mode==="first"?a[0]:a})})}prepare(e){return this._prepare(e)}_getQuery(){return this.dialect.buildRelationalQueryWithoutPK({fullSchema:this.fullSchema,schema:this.schema,tableNamesMap:this.tableNamesMap,table:this.table,tableConfig:this.tableConfig,queryConfig:this.config,tableAlias:this.tableConfig.tsName})}getSQL(){return this._getQuery().sql}_toSQL(){const e=this._getQuery(),i=this.dialect.sqlToQuery(e.sql);return{query:e,builtQuery:i}}toSQL(){return this._toSQL().builtQuery}setToken(e){return this.authToken=e,this}execute(){return Pr.startActiveSpan("drizzle.operation",()=>this._prepare().execute(void 0,this.authToken))}}G(Dh,gg,"PgRelationalQuery");var _g,bg;class zw extends(bg=Tn,_g=xt,bg){constructor(t,e,i,n){super(),this.execute=t,this.sql=e,this.query=i,this.mapBatchResult=n}getSQL(){return this.sql}getQuery(){return this.query}mapResult(t,e){return e?this.mapBatchResult(t):t}_prepare(){return this}isResponseInArrayMode(){return!1}}G(zw,_g,"PgRaw");var wg;wg=xt;class Yf{constructor(t,e,i){G(this,"query");G(this,"$with",(t,e)=>{const i=this;return{as:s=>(typeof s=="function"&&(s=s(new Xf(i.dialect))),new Proxy(new jf(s.getSQL(),e??("getSelectedFields"in s?s.getSelectedFields()??{}:{}),t,!0),new Je({alias:t,sqlAliasedBehavior:"alias",sqlBehavior:"error"})))}});G(this,"authToken");if(this.dialect=t,this.session=e,this._=i?{schema:i.schema,fullSchema:i.fullSchema,tableNamesMap:i.tableNamesMap,session:e}:{schema:void 0,fullSchema:{},tableNamesMap:{},session:e},this.query={},this._.schema)for(const[n,s]of Object.entries(this._.schema))this.query[n]=new Uw(i.fullSchema,this._.schema,this._.tableNamesMap,i.fullSchema[n],s,t,e)}$count(t,e){return new Mh({source:t,filters:e,session:this.session})}with(...t){const e=this;function i(u){return new Sr({fields:u??void 0,session:e.session,dialect:e.dialect,withList:t})}function n(u){return new Sr({fields:u??void 0,session:e.session,dialect:e.dialect,withList:t,distinct:!0})}function s(u,c){return new Sr({fields:c??void 0,session:e.session,dialect:e.dialect,withList:t,distinct:{on:u}})}function o(u){return new Ph(u,e.session,e.dialect,t)}function a(u){return new Oh(u,e.session,e.dialect,t)}function l(u){return new Ah(u,e.session,e.dialect,t)}return{select:i,selectDistinct:n,selectDistinctOn:s,update:o,insert:a,delete:l}}select(t){return new Sr({fields:t??void 0,session:this.session,dialect:this.dialect})}selectDistinct(t){return new Sr({fields:t??void 0,session:this.session,dialect:this.dialect,distinct:!0})}selectDistinctOn(t,e){return new Sr({fields:e??void 0,session:this.session,dialect:this.dialect,distinct:{on:t}})}update(t){return new Ph(t,this.session,this.dialect)}insert(t){return new Oh(t,this.session,this.dialect)}delete(t){return new Ah(t,this.session,this.dialect)}refreshMaterializedView(t){return new Bw(t,this.session,this.dialect)}execute(t){const e=typeof t=="string"?X.raw(t):t.getSQL(),i=this.dialect.sqlToQuery(e),n=this.session.prepareQuery(i,void 0,void 0,!1);return new zw(()=>n.execute(void 0,this.authToken),e,i,s=>n.mapResult(s,!0))}transaction(t,e){return this.session.transaction(t,e)}}G(Yf,wg,"PgDatabase");var xg;xg=xt;class jw{constructor(t){G(this,"authToken");G(this,"joinsNotNullableMap");this.query=t}getQuery(){return this.query}mapResult(t,e){return t}setToken(t){return this.authToken=t,this}}G(jw,xg,"PgPreparedQuery");var Sg;Sg=xt;class $w{constructor(t){this.dialect=t}execute(t,e){return Pr.startActiveSpan("drizzle.operation",()=>Pr.startActiveSpan("drizzle.prepareQuery",()=>this.prepareQuery(this.dialect.sqlToQuery(t),void 0,void 0,!1)).setToken(e).execute(void 0,e))}all(t){return this.prepareQuery(this.dialect.sqlToQuery(t),void 0,void 0,!1).all()}async count(t,e){const i=await this.execute(t,e);return Number(i[0].count)}}G($w,Sg,"PgSession");var Tg,Ig;class Vw extends(Ig=Yf,Tg=xt,Ig){constructor(t,e,i,n=0){super(t,e,i),this.schema=i,this.nestedIndex=n}rollback(){throw new yw}getTransactionConfigSQL(t){const e=[];return t.isolationLevel&&e.push(`isolation level ${t.isolationLevel}`),t.accessMode&&e.push(t.accessMode),typeof t.deferrable=="boolean"&&e.push(t.deferrable?"deferrable":"not deferrable"),X.raw(e.join(" "))}setTransaction(t){return this.session.execute(X`set transaction ${this.getTransactionConfigSQL(t)}`)}}G(Vw,Tg,"PgTransaction");function Om(r){return typeof r=="string"&&/^true$/i.test(r)}function gR(r){const t={scheme:"duckdb-wasm:"},e=new URL(r);if(!e.protocol.startsWith("duckdb-wasm:"))throw new Error(`Expected scheme to be "duckdb-wasm:" but got "${e.protocol}"`);e.searchParams.get("bundles")==="import-url"&&(t.bundles="import-url");const i=e.searchParams.get("logger");i&&Om(i)&&(t.logger=!0);const n=e.searchParams.get("storage");switch(n){case ra.ORIGIN_PRIVATE_FS:{e.host.length>0&&console.warn(`Host "${e.host}" will be ignored while using Origin Private FS`);const s=e.searchParams.get("write");t.storage={type:ra.ORIGIN_PRIVATE_FS,path:e.pathname.startsWith("/")?e.pathname.slice(1):e.pathname,...s&&Om(s)&&{accessMode:T0.READ_WRITE}};break}case null:break;default:console.warn(`Unknown storage type "${n}"`);break}return t}var Eg,Cg;class Gw extends(Cg=jw,Eg=xt,Cg){constructor(t,e,i,n,s,o){super({sql:e,params:i}),this.client=t,this.queryString=e,this.params=i,this.logger=n,this.fields=s,this.customResultMapper=o}async execute(t={}){const e=Em(this.params,t);this.logger.logQuery(this.queryString,e);const{fields:i,queryString:n,client:s,customResultMapper:o}=this,a=await s;return a.query(n,e)}async all(t={}){const e=Em(this.params,t);return this.logger.logQuery(this.queryString,e),(await this.client).query(this.queryString,e)}}G(Gw,Eg,"DuckDBWasmPreparedQuery");var Ag,Og;const Yl=class Yl extends(Og=$w,Ag=xt,Og){constructor(e,i,n,s={}){super(i);G(this,"logger");this.client=e,this.schema=n,this.options=s,this.logger=s.logger??new bw}prepareQuery(e,i,n,s,o){return new Gw(this.client,e.sql,e.params,this.logger,i,o)}async query(e,i){return this.logger.logQuery(e,i),(await this.client).query(e,i)}async queryObjects(e,i){return this.logger.logQuery(e,i),(await this.client).query(e,i)}transaction(e,i){return xD(this.client,async n=>{const s=new Yl(n,this.dialect,this.schema,this.options),o=new Rh(this.dialect,s,this.schema);return i&&await o.setTransaction(i),e(o)})}};G(Yl,Ag,"DuckDBWasmSession");let Gl=Yl;var Fg,Pg;const ql=class ql extends(Pg=Vw,Fg=xt,Pg){constructor(e,i,n,s=0){super(e,i,n,s);G(this,"dialect");G(this,"session");this.dialect=e,this.session=i}async transaction(e){return SD(this.session.client,"",async i=>{const n=new Gl(i,this.dialect,this.schema,this.session.options),s=new ql(this.dialect,n,this.schema);return e(s)})}};G(ql,Fg,"DuckDBWasmTransaction");let Rh=ql;var Mg,Dg;class Ww extends(Dg=Yf,Mg=xt,Dg){}G(Ww,Mg,"DuckDBWasmDatabase");function ko(r,t={}){const e=new Bo({casing:t.casing});let i;t.logger===!0?i=new _w:t.logger!==!1&&(i=t.logger);let n;if(t.schema){const a=rR(t.schema,oR);n={fullSchema:t.schema,schema:a.tables,tableNamesMap:a.tableNamesMap}}const s=new Gl(r,e,n,{logger:i}),o=new Ww(e,s,n);return o.$client=r,o}function Fm(r,t){const e=gR(r);let i;return e.bundles==="import-url"?i=(async()=>{const s=await Sh();switch(s){case"browser":return(await ln(async()=>{const{getImportUrlBundles:o}=await import("./import-url-browser-CPN8ipMD.js");return{getImportUrlBundles:o}},__vite__mapDeps([3,4]))).getImportUrlBundles();case"node":return await(await ln(async()=>{const{getImportUrlBundles:o}=await import("./import-url-node-BfNoxhRr.js");return{getImportUrlBundles:o}},__vite__mapDeps([5,4]))).getImportUrlBundles();default:throw new Error(`Unsupported environment: "${s}"`)}})():i=(async()=>{const s=await Sh();switch(s){case"browser":return(await ln(async()=>{const{getBundles:o}=await import("./default-browser-BrgSDbLD.js");return{getBundles:o}},[])).getBundles();case"node":return await(await ln(async()=>{const{getBundles:o}=await import("./default-node-Dkg9OG4q.js");return{getBundles:o}},__vite__mapDeps([0,1,2]))).getBundles();default:throw new Error(`Unsupported environment: "${s}"`)}})(),ko(hw({bundles:i,logger:e.logger?new I0:void 0,storage:e.storage}),t)}function Pm(...r){if(typeof r[0]=="string")return Fm(r[0],r[1]);if(JD(r[0])){const{connection:t,client:e,...i}=r[0];if(e)return ko(e,i);if(typeof t=="string")return Fm(t,i);if(typeof t>"u")throw new Error("connection option is required");return ko(hw({bundles:t.bundles,logger:t.logger,storage:t.storage}),i)}return ko(r[0],r[1])}(r=>{function t(e){return ko({options:{parsers:{},serializers:{}}},e)}r.mock=t})(Pm||(Pm={}));export{L1 as A,TR as D,xR as I,pC as J,eI as L,_c as M,wR as T,fi as a,Re as b,Pm as d,sa as e,SR as l}; diff --git a/assets/Textarea.vue_vue_type_script_setup_true_lang-DVhP8J-8.js b/assets/Textarea.vue_vue_type_script_setup_true_lang-DVhP8J-8.js new file mode 100644 index 0000000000000000000000000000000000000000..28b9cd46a180daca71d76c9432523bc457ff848b --- /dev/null +++ b/assets/Textarea.vue_vue_type_script_setup_true_lang-DVhP8J-8.js @@ -0,0 +1 @@ +import{_ as r}from"./Basic.vue_vue_type_script_setup_true_lang-DiEujAxb.js";import{d as u,u as t,A as d,o as n}from"./index-BNq7Hbz_.js";const p=u({__name:"Textarea",props:{modelValue:{default:""},modelModifiers:{}},emits:["update:modelValue"],setup(l){const e=t(l,"modelValue");return(s,a)=>(n(),d(r,{modelValue:e.value,"onUpdate:modelValue":a[0]||(a[0]=o=>e.value=o),border:"focus:primary-300 dark:focus:primary-400/50 2 solid neutral-100 dark:neutral-900",transition:"all duration-200 ease-in-out",text:"disabled:neutral-400 dark:disabled:neutral-600",cursor:"disabled:not-allowed","w-full":"","rounded-lg":"","px-3":"","py-2":"","text-sm":"","outline-none":"",shadow:"sm",bg:"neutral-50 dark:neutral-950 focus:neutral-50 dark:focus:neutral-900"},null,8,["modelValue"]))}});export{p as _}; diff --git a/assets/Textarea.vue_vue_type_script_setup_true_lang-DYk_co3B.js b/assets/Textarea.vue_vue_type_script_setup_true_lang-DYk_co3B.js deleted file mode 100644 index a3e1f0a2b51a85160b8835221f0b23fd10048291..0000000000000000000000000000000000000000 --- a/assets/Textarea.vue_vue_type_script_setup_true_lang-DYk_co3B.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as r}from"./Basic.vue_vue_type_script_setup_true_lang-Sei3qL1b.js";import{d as t,bL as u,m as d,o as n}from"./index-D3pfQUMu.js";const p=t({__name:"Textarea",props:{modelValue:{default:""},modelModifiers:{}},emits:["update:modelValue"],setup(l){const e=u(l,"modelValue");return(s,a)=>(n(),d(r,{modelValue:e.value,"onUpdate:modelValue":a[0]||(a[0]=o=>e.value=o),border:"focus:primary-300 dark:focus:primary-400/50 2 solid neutral-100 dark:neutral-900",transition:"all duration-200 ease-in-out",text:"disabled:neutral-400 dark:disabled:neutral-600",cursor:"disabled:not-allowed","w-full":"","rounded-lg":"","px-3":"","py-2":"","text-sm":"","outline-none":"",shadow:"sm",bg:"neutral-50 dark:neutral-950 focus:neutral-50 dark:focus:neutral-900"},null,8,["modelValue"]))}});export{p as _}; diff --git a/assets/TransitionVertical.vue_vue_type_script_setup_true_lang-BlPB-gCV.js b/assets/TransitionVertical.vue_vue_type_script_setup_true_lang-BlPB-gCV.js new file mode 100644 index 0000000000000000000000000000000000000000..8dfd49ecae530cbdc6ca9f7ca491f5f777536b0f --- /dev/null +++ b/assets/TransitionVertical.vue_vue_type_script_setup_true_lang-BlPB-gCV.js @@ -0,0 +1 @@ +import{d as T,A as l,o as m,T as B,w as b,f as v}from"./index-BNq7Hbz_.js";const n="0px",W=T({__name:"TransitionVertical",props:{duration:{default:250},easingEnter:{default:"ease-in-out"},easingLeave:{default:"ease-in-out"},opacityClosed:{default:0},opacityOpened:{default:1}},setup(c){const r=c;function p(o){return{height:o.style.height,width:o.style.width,position:o.style.position,visibility:o.style.visibility,overflow:o.style.overflow,paddingTop:o.style.paddingTop,paddingBottom:o.style.paddingBottom,borderTopWidth:o.style.borderTopWidth,borderBottomWidth:o.style.borderBottomWidth,marginTop:o.style.marginTop,marginBottom:o.style.marginBottom}}function y(o,t){const{width:i}=getComputedStyle(o);o.style.width=i,o.style.position="absolute",o.style.visibility="hidden",o.style.height="";const{height:s}=getComputedStyle(o);return o.style.width=t.width,o.style.position=t.position,o.style.visibility=t.visibility,o.style.height=n,o.style.overflow="hidden",t.height&&t.height!==n?t.height:s}function h(o,t,i,s,d){const e=o.animate(s,d);o.style.height=t.height,e.onfinish=()=>{o.style.overflow=t.overflow,i()}}function g(o,t){return[{height:n,opacity:r.opacityClosed,paddingTop:n,paddingBottom:n,borderTopWidth:n,borderBottomWidth:n,marginTop:n,marginBottom:n},{height:o,opacity:r.opacityOpened,paddingTop:t.paddingTop,paddingBottom:t.paddingBottom,borderTopWidth:t.borderTopWidth,borderBottomWidth:t.borderBottomWidth,marginTop:t.marginTop,marginBottom:t.marginBottom}]}function u(o,t){const i=o,s=p(i),d=y(i,s),e=g(d,s),a={duration:r.duration,easing:r.easingEnter};h(i,s,t,e,a)}function f(o,t){const i=o,s=p(i),{height:d}=getComputedStyle(i);i.style.height=d,i.style.overflow="hidden";const e=g(d,s).reverse(),a={duration:r.duration,easing:r.easingLeave};h(i,s,t,e,a)}return(o,t)=>(m(),l(B,{css:!1,onEnter:u,onLeave:f},{default:b(()=>[v(o.$slots,"default")]),_:3}))}});export{W as _}; diff --git a/assets/TransitionVertical.vue_vue_type_script_setup_true_lang-D_DUmSTM.js b/assets/TransitionVertical.vue_vue_type_script_setup_true_lang-D_DUmSTM.js deleted file mode 100644 index 7641ff71d7621fe2f00d1a07514eb0548f21c08c..0000000000000000000000000000000000000000 --- a/assets/TransitionVertical.vue_vue_type_script_setup_true_lang-D_DUmSTM.js +++ /dev/null @@ -1 +0,0 @@ -import{d as m,m as T,o as l,bE as B,E as b,B as v}from"./index-D3pfQUMu.js";const n="0px",E=m({__name:"TransitionVertical",props:{duration:{default:250},easingEnter:{default:"ease-in-out"},easingLeave:{default:"ease-in-out"},opacityClosed:{default:0},opacityOpened:{default:1}},setup(c){const r=c;function p(o){return{height:o.style.height,width:o.style.width,position:o.style.position,visibility:o.style.visibility,overflow:o.style.overflow,paddingTop:o.style.paddingTop,paddingBottom:o.style.paddingBottom,borderTopWidth:o.style.borderTopWidth,borderBottomWidth:o.style.borderBottomWidth,marginTop:o.style.marginTop,marginBottom:o.style.marginBottom}}function y(o,t){const{width:i}=getComputedStyle(o);o.style.width=i,o.style.position="absolute",o.style.visibility="hidden",o.style.height="";const{height:s}=getComputedStyle(o);return o.style.width=t.width,o.style.position=t.position,o.style.visibility=t.visibility,o.style.height=n,o.style.overflow="hidden",t.height&&t.height!==n?t.height:s}function h(o,t,i,s,d){const e=o.animate(s,d);o.style.height=t.height,e.onfinish=()=>{o.style.overflow=t.overflow,i()}}function g(o,t){return[{height:n,opacity:r.opacityClosed,paddingTop:n,paddingBottom:n,borderTopWidth:n,borderBottomWidth:n,marginTop:n,marginBottom:n},{height:o,opacity:r.opacityOpened,paddingTop:t.paddingTop,paddingBottom:t.paddingBottom,borderTopWidth:t.borderTopWidth,borderBottomWidth:t.borderBottomWidth,marginTop:t.marginTop,marginBottom:t.marginBottom}]}function u(o,t){const i=o,s=p(i),d=y(i,s),e=g(d,s),a={duration:r.duration,easing:r.easingEnter};h(i,s,t,e,a)}function f(o,t){const i=o,s=p(i),{height:d}=getComputedStyle(i);i.style.height=d,i.style.overflow="hidden";const e=g(d,s).reverse(),a={duration:r.duration,easing:r.easingLeave};h(i,s,t,e,a)}return(o,t)=>(l(),T(B,{css:!1,onEnter:u,onLeave:f},{default:b(()=>[v(o.$slots,"default")]),_:3}))}});export{E as _}; diff --git a/assets/_...all_-2hR2XxLq.js b/assets/_...all_-2hR2XxLq.js new file mode 100644 index 0000000000000000000000000000000000000000..b1dc16e51b2207fae1917de2edfbe846d2da45e2 --- /dev/null +++ b/assets/_...all_-2hR2XxLq.js @@ -0,0 +1 @@ +import{_ as e,c as _,o as c}from"./index-BNq7Hbz_.js";const n={};function o(t,r){return c(),_("div",null," 404 - Page not found ")}const s=e(n,[["render",o]]);export{s as default}; diff --git a/assets/_...all_-D526ellk.js b/assets/_...all_-D526ellk.js deleted file mode 100644 index 9f55e72051964fd07cf0b9674e05d74ecc3da4da..0000000000000000000000000000000000000000 --- a/assets/_...all_-D526ellk.js +++ /dev/null @@ -1 +0,0 @@ -import{bq as e,c,o as n}from"./index-D3pfQUMu.js";const o={};function _(t,r){return n(),c("div",null," 404 - Page not found ")}const s=e(o,[["render",_]]);export{s as default}; diff --git a/assets/__vite-optional-peer-dep_effect_xsschema-BIHI7g3E.js b/assets/__vite-optional-peer-dep_effect_xsschema-BIHI7g3E.js new file mode 100644 index 0000000000000000000000000000000000000000..b480ffe6ce7040f68468da9d453d371cbc190177 --- /dev/null +++ b/assets/__vite-optional-peer-dep_effect_xsschema-BIHI7g3E.js @@ -0,0 +1 @@ +const e={};export{e as default}; diff --git a/assets/airi-card-vOKXd5VS.js b/assets/airi-card-BqbOXX1s.js similarity index 71% rename from assets/airi-card-vOKXd5VS.js rename to assets/airi-card-BqbOXX1s.js index df35140dabe1a195064e63095417bc5f6bff3ebe..f01852668f71a4da3ffa94b200d9e561cad60179 100644 --- a/assets/airi-card-vOKXd5VS.js +++ b/assets/airi-card-BqbOXX1s.js @@ -1,7 +1,7 @@ -import{v as W,bG as L,l as g,s as O,f as $,k as b,w as k}from"./index-D3pfQUMu.js";import{e as D}from"./emotions-CAex_2dA.js";import{u as H}from"./consciousness-DynZMlUo.js";import{u as N}from"./speech-CIOuIakE.js";function q(a,u){return{role:"system",content:[a,D.map(n=>`- ${n}`).join(` +import{p as W,q as L,h as g,s as O,H as $,g as q,v as D}from"./index-BNq7Hbz_.js";import{E as G}from"./mini_xsschema-P_8cZcRg.js";import{u as N}from"./consciousness-BV44f_Xl.js";import{u as b}from"./speech-CKvssz06.js";function k(a,u){return{role:"system",content:[a,G.map(n=>`- ${n}`).join(` `),u].join(` -`)}}const Q=W("airi-card",()=>{const a=L("airi-cards",new Map),u=L("airi-card-active-id","default"),n=g(()=>a.value.get(u.value)),P=H(),R=N(),{activeModel:l}=O(P),{activeSpeechVoiceId:m,activeSpeechModel:p}=O(R),B=s=>{const e=crypto.randomUUID();return a.value.set(e,f(s)),e},G=s=>{a.value.delete(s)},V=s=>a.value.get(s);function v(s){var t,r,i,c,d,h,_,y,S,x,C,M,I,w,E,A,T,U,j;const e="data"in s?(r=(t=s.data)==null?void 0:t.extensions)==null?void 0:r.airi:(i=s.extensions)==null?void 0:i.airi,o={consciousness:{model:l.value},speech:{model:p.value,voice_id:m.value}};return e?{modules:{consciousness:{model:((d=(c=e.modules)==null?void 0:c.consciousness)==null?void 0:d.model)??o.consciousness.model},speech:{model:((_=(h=e.modules)==null?void 0:h.speech)==null?void 0:_.model)??o.speech.model,voice_id:((S=(y=e.modules)==null?void 0:y.speech)==null?void 0:S.voice_id)??o.speech.voice_id,pitch:(C=(x=e.modules)==null?void 0:x.speech)==null?void 0:C.pitch,rate:(I=(M=e.modules)==null?void 0:M.speech)==null?void 0:I.rate,ssml:(E=(w=e.modules)==null?void 0:w.speech)==null?void 0:E.ssml,language:(T=(A=e.modules)==null?void 0:A.speech)==null?void 0:T.language},vrm:(U=e.modules)==null?void 0:U.vrm,live2d:(j=e.modules)==null?void 0:j.live2d},agents:e.agents??{}}:{modules:o,agents:{}}}function f(s){if("data"in s){const e=s;return{name:e.data.name,version:e.data.character_version??"1.0.0",description:e.data.description??"",creator:e.data.creator??"",notes:e.data.creator_notes??"",notesMultilingual:e.data.creator_notes_multilingual,personality:e.data.personality??"",scenario:e.data.scenario??"",greetings:[e.data.first_mes,...e.data.alternate_greetings??[]],greetingsGroupOnly:e.data.group_only_greetings??[],systemPrompt:e.data.system_prompt??"",postHistoryInstructions:e.data.post_history_instructions??"",messageExample:e.data.mes_example?e.data.mes_example.split(` +`)}}const Q=W("airi-card",()=>{const a=L("airi-cards",new Map),u=L("airi-card-active-id","default"),n=g(()=>a.value.get(u.value)),P=N(),R=b(),{activeModel:l}=O(P),{activeSpeechVoiceId:m,activeSpeechModel:p}=O(R),B=s=>{const e=crypto.randomUUID();return a.value.set(e,h(s)),e},H=s=>{a.value.delete(s)},V=s=>a.value.get(s);function v(s){var t,r,i,c,d,f,_,y,S,x,C,M,I,E,w,A,T,U,j;const e="data"in s?(r=(t=s.data)==null?void 0:t.extensions)==null?void 0:r.airi:(i=s.extensions)==null?void 0:i.airi,o={consciousness:{model:l.value},speech:{model:p.value,voice_id:m.value}};return e?{modules:{consciousness:{model:((d=(c=e.modules)==null?void 0:c.consciousness)==null?void 0:d.model)??o.consciousness.model},speech:{model:((_=(f=e.modules)==null?void 0:f.speech)==null?void 0:_.model)??o.speech.model,voice_id:((S=(y=e.modules)==null?void 0:y.speech)==null?void 0:S.voice_id)??o.speech.voice_id,pitch:(C=(x=e.modules)==null?void 0:x.speech)==null?void 0:C.pitch,rate:(I=(M=e.modules)==null?void 0:M.speech)==null?void 0:I.rate,ssml:(w=(E=e.modules)==null?void 0:E.speech)==null?void 0:w.ssml,language:(T=(A=e.modules)==null?void 0:A.speech)==null?void 0:T.language},vrm:(U=e.modules)==null?void 0:U.vrm,live2d:(j=e.modules)==null?void 0:j.live2d},agents:e.agents??{}}:{modules:o,agents:{}}}function h(s){if("data"in s){const e=s;return{name:e.data.name,version:e.data.character_version??"1.0.0",description:e.data.description??"",creator:e.data.creator??"",notes:e.data.creator_notes??"",notesMultilingual:e.data.creator_notes_multilingual,personality:e.data.personality??"",scenario:e.data.scenario??"",greetings:[e.data.first_mes,...e.data.alternate_greetings??[]],greetingsGroupOnly:e.data.group_only_greetings??[],systemPrompt:e.data.system_prompt??"",postHistoryInstructions:e.data.post_history_instructions??"",messageExample:e.data.mes_example?e.data.mes_example.split(` `).filter(Boolean).map(o=>o.split(` -`).map(t=>{if(t.startsWith("{{char}}:")||t.startsWith("{{user}}:"))return t;throw new Error(`Invalid message example format: ${t}`)})):[],tags:e.data.tags??[],extensions:{airi:v(e),...e.data.extensions}}}return{...s,extensions:{airi:v(s),...s.extensions}}}return $(()=>{const{t:s}=b();a.value.set("default",f({name:"ReLU",version:"1.0.0",description:q(s("prompt.prefix"),s("prompt.suffix")).content}))}),k(n,s=>{var o,t,r,i,c,d;if(!s)return;const e=v(s);e&&(l.value=(t=(o=e==null?void 0:e.modules)==null?void 0:o.consciousness)==null?void 0:t.model,p.value=(i=(r=e==null?void 0:e.modules)==null?void 0:r.speech)==null?void 0:i.model,m.value=(d=(c=e==null?void 0:e.modules)==null?void 0:c.speech)==null?void 0:d.voice_id)}),{cards:a,activeCard:n,activeCardId:u,addCard:B,removeCard:G,getCard:V,currentModels:g(()=>({consciousness:{model:l.value},speech:{model:p.value,voice_id:m.value}})),systemPrompt:g(()=>{const s=n.value;return s?[s.systemPrompt,s.description,s.personality].filter(Boolean).join(` +`).map(t=>{if(t.startsWith("{{char}}:")||t.startsWith("{{user}}:"))return t;throw new Error(`Invalid message example format: ${t}`)})):[],tags:e.data.tags??[],extensions:{airi:v(e),...e.data.extensions}}}return{...s,extensions:{airi:v(s),...s.extensions}}}return $(()=>{const{t:s}=q();a.value.set("default",h({name:"ReLU",version:"1.0.0",description:k(s("prompt.prefix"),s("prompt.suffix")).content}))}),D(n,s=>{var o,t,r,i,c,d;if(!s)return;const e=v(s);e&&(l.value=(t=(o=e==null?void 0:e.modules)==null?void 0:o.consciousness)==null?void 0:t.model,p.value=(i=(r=e==null?void 0:e.modules)==null?void 0:r.speech)==null?void 0:i.model,m.value=(d=(c=e==null?void 0:e.modules)==null?void 0:c.speech)==null?void 0:d.voice_id)}),{cards:a,activeCard:n,activeCardId:u,addCard:B,removeCard:H,getCard:V,currentModels:g(()=>({consciousness:{model:l.value},speech:{model:p.value,voice_id:m.value}})),systemPrompt:g(()=>{const s=n.value;return s?[s.systemPrompt,s.description,s.personality].filter(Boolean).join(` `):""})}});export{Q as u}; diff --git a/assets/alibaba-cloud-model-studio-BTh-z50z.js b/assets/alibaba-cloud-model-studio-BTh-z50z.js new file mode 100644 index 0000000000000000000000000000000000000000..e3821d66604e9c1aadf4ced8474ec8f033b14b47 --- /dev/null +++ b/assets/alibaba-cloud-model-studio-BTh-z50z.js @@ -0,0 +1 @@ +import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-B6whjTNv.js";import{d as x,r as m,s as k,g as F,h as V,H as $,v,A as B,o as I,w as h,i as c,b as i,e as U}from"./index-BNq7Hbz_.js";import"./three-vrm-animation.module-BPuMi1if.js";import"./mcp-D2taTyhO.js";import"./mini_xsschema-P_8cZcRg.js";import{u as E}from"./providers-Ddg6LLwH.js";import{u as H}from"./speech-CKvssz06.js";import{_ as f}from"./FieldRange.vue_vue_type_script_setup_true_lang-RRSKRN5w.js";/* empty css */import{_ as K,a as L}from"./SpeechProviderSettings.vue_vue_type_script_setup_true_lang-DQ9q1Mut.js";import{b as y}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DETFnj2t.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-IiDV8qQX.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BlPB-gCV.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-IanARj3w.js";import"./Input.vue_vue_type_script_setup_true_lang-1pgLpBi1.js";import"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-8yNUgi8_.js";import"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C-W-PZMl.js";const N={flex:"~ col gap-4"},o="alibaba-cloud-model-studio",P="cosyvoice-v1",T=x({__name:"alibaba-cloud-model-studio",setup(z){const u={speed:1},d=m(0),l=m(1),n=m(0),p=H(),r=E(),{providers:g}=k(r),{t:s}=F(),_=V(()=>{var e;return!!((e=g.value[o])!=null&&e.apiKey)}),w=V(()=>p.availableVoices[o]||[]);async function M(e,a,t){const b=r.getProviderInstance(o);if(!b)throw new Error("Failed to initialize speech provider");const C=r.getProviderConfig(o),S=C.model||P;return await p.speech(b,S,e,a,{...C,...u})}return $(async()=>{const e=r.getProviderConfig(o);await r.getProviderMetadata(o).validators.validateProviderConfig(e)?await p.loadVoicesForProvider(o):console.error("Failed to validate provider config",e)}),v(d,async()=>{const e=r.getProviderConfig(o);e.pitch=d.value}),v(l,async()=>{const e=r.getProviderConfig(o);e.speed=l.value}),v(n,async()=>{const e=r.getProviderConfig(o);e.volume=n.value}),v(g,async()=>{const e=r.getProviderConfig(o);await r.getProviderMetadata(o).validators.validateProviderConfig(e)?await p.loadVoicesForProvider(o):console.error("Failed to validate provider config",e)},{immediate:!0}),(e,a)=>(I(),B(i(L),{"provider-id":o,"default-model":P,"additional-settings":u},{"voice-settings":h(()=>[U("div",N,[c(i(f),{modelValue:d.value,"onUpdate:modelValue":a[0]||(a[0]=t=>d.value=t),label:i(s)("settings.pages.providers.provider.common.fields.field.pitch.label"),description:i(s)("settings.pages.providers.provider.common.fields.field.pitch.description"),min:-100,max:100,step:1,"format-value":t=>`${t}%`},null,8,["modelValue","label","description","format-value"]),c(i(f),{modelValue:l.value,"onUpdate:modelValue":a[1]||(a[1]=t=>l.value=t),label:i(s)("settings.pages.providers.provider.common.fields.field.speed.label"),description:i(s)("settings.pages.providers.provider.common.fields.field.speed.description"),min:.5,max:2,step:.01},null,8,["modelValue","label","description"]),c(i(f),{modelValue:n.value,"onUpdate:modelValue":a[2]||(a[2]=t=>n.value=t),label:i(s)("settings.pages.providers.provider.common.fields.field.volume.label"),description:i(s)("settings.pages.providers.provider.common.fields.field.volume.description"),min:-100,max:100,step:1,"format-value":t=>`${t}%`},null,8,["modelValue","label","description","format-value"])])]),playground:h(()=>[c(i(K),{"available-voices":w.value,"generate-speech":M,"api-key-configured":_.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(T);export{T as default}; diff --git a/assets/alibaba-cloud-model-studio-D2Z7LyWw.js b/assets/alibaba-cloud-model-studio-D2Z7LyWw.js deleted file mode 100644 index 2519d181c5d4bf4750b8fc57b58f277eb96ca8c9..0000000000000000000000000000000000000000 --- a/assets/alibaba-cloud-model-studio-D2Z7LyWw.js +++ /dev/null @@ -1 +0,0 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-t8bgqiA6.js";import{d as x,r as m,s as k,k as F,l as V,f as $,w as v,m as B,o as E,E as y,b as c,u as i,a as I}from"./index-D3pfQUMu.js";import"./three-vrm-animation.module-DLbUhddZ.js";import"./emotions-CAex_2dA.js";import{u as U}from"./providers-CCvie00Z.js";import{u as K}from"./speech-CIOuIakE.js";import{_ as f}from"./FieldRange.vue_vue_type_script_setup_true_lang-IEKed7Lk.js";/* empty css */import{_ as L,a as N}from"./SpeechProviderSettings.vue_vue_type_script_setup_true_lang-ByvvVpU4.js";import{b as P}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Qp-g_fu5.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-DDNOeGH3.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-D_DUmSTM.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-Brkyubp9.js";import"./Input.vue_vue_type_script_setup_true_lang-B223oRg0.js";import"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-yC-Tsbbb.js";import"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C8wZQWhG.js";const T={flex:"~ col gap-4"},o="alibaba-cloud-model-studio",_="cosyvoice-v1",z=x({__name:"alibaba-cloud-model-studio",setup(G){const u={speed:1},d=m(0),l=m(1),n=m(0),p=K(),a=U(),{providers:g}=k(a),{t:s}=F(),h=V(()=>{var e;return!!((e=g.value[o])!=null&&e.apiKey)}),w=V(()=>p.availableVoices[o]||[]);async function M(e,r,t){const b=a.getProviderInstance(o);if(!b)throw new Error("Failed to initialize speech provider");const C=a.getProviderConfig(o),S=C.model||_;return await p.speech(b,S,e,r,{...C,...u})}return $(async()=>{const e=a.getProviderConfig(o);await a.getProviderMetadata(o).validators.validateProviderConfig(e)?await p.loadVoicesForProvider(o):console.error("Failed to validate provider config",e)}),v(d,async()=>{const e=a.getProviderConfig(o);e.pitch=d.value}),v(l,async()=>{const e=a.getProviderConfig(o);e.speed=l.value}),v(n,async()=>{const e=a.getProviderConfig(o);e.volume=n.value}),v(g,async()=>{const e=a.getProviderConfig(o);await a.getProviderMetadata(o).validators.validateProviderConfig(e)?await p.loadVoicesForProvider(o):console.error("Failed to validate provider config",e)},{immediate:!0}),(e,r)=>(E(),B(i(N),{"provider-id":o,"default-model":_,"additional-settings":u},{"voice-settings":y(()=>[I("div",T,[c(i(f),{modelValue:d.value,"onUpdate:modelValue":r[0]||(r[0]=t=>d.value=t),label:i(s)("settings.pages.providers.provider.common.fields.field.pitch.label"),description:i(s)("settings.pages.providers.provider.common.fields.field.pitch.description"),min:-100,max:100,step:1,"format-value":t=>`${t}%`},null,8,["modelValue","label","description","format-value"]),c(i(f),{modelValue:l.value,"onUpdate:modelValue":r[1]||(r[1]=t=>l.value=t),label:i(s)("settings.pages.providers.provider.common.fields.field.speed.label"),description:i(s)("settings.pages.providers.provider.common.fields.field.speed.description"),min:.5,max:2,step:.01},null,8,["modelValue","label","description"]),c(i(f),{modelValue:n.value,"onUpdate:modelValue":r[2]||(r[2]=t=>n.value=t),label:i(s)("settings.pages.providers.provider.common.fields.field.volume.label"),description:i(s)("settings.pages.providers.provider.common.fields.field.volume.description"),min:-100,max:100,step:1,"format-value":t=>`${t}%`},null,8,["modelValue","label","description","format-value"])])]),playground:y(()=>[c(i(L),{"available-voices":w.value,"generate-speech":M,"api-key-configured":h.value,"default-text":"Hello! This is a test of the ElevenLabs voice synthesis."},null,8,["available-voices","api-key-configured"])]),_:1}))}});typeof P=="function"&&P(z);export{z as default}; diff --git a/assets/anthropic-B-QXh4_7.js b/assets/anthropic-B-QXh4_7.js new file mode 100644 index 0000000000000000000000000000000000000000..a8f0f70411f436070f86b266770e68d4bdbbe30c --- /dev/null +++ b/assets/anthropic-B-QXh4_7.js @@ -0,0 +1 @@ +import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-B6whjTNv.js";import{d as S,g as U,U as x,s as w,h as v,H as V,v as C,A as K,o as R,w as c,e as i,i as l,k as p,b as a}from"./index-BNq7Hbz_.js";import"./three-vrm-animation.module-BPuMi1if.js";import"./mcp-D2taTyhO.js";import"./mini_xsschema-P_8cZcRg.js";import{u as A}from"./providers-Ddg6LLwH.js";/* empty css */import{_ as O,a as $}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DETFnj2t.js";import{_ as I}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-8yNUgi8_.js";import{_ as N,a as B}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C-W-PZMl.js";import{_ as T}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-kCkYL1sn.js";import{b as g}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-IiDV8qQX.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BlPB-gCV.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-IanARj3w.js";import"./Input.vue_vue_type_script_setup_true_lang-1pgLpBi1.js";const e="anthropic",z=S({__name:"anthropic",setup(M){const{t:u}=U(),_=x(),h=A(),{providers:o}=w(h),m=v(()=>h.getProviderMetadata(e)),s=v({get:()=>{var t;return((t=o.value[e])==null?void 0:t.apiKey)||""},set:t=>{o.value[e]||(o.value[e]={}),o.value[e].apiKey=t}}),n=v({get:()=>{var t;return((t=o.value[e])==null?void 0:t.baseUrl)||"https://api.anthropic.com/v1/"},set:t=>{o.value[e]||(o.value[e]={}),o.value[e].baseUrl=t}});V(()=>{var t,r;o.value[e]||(o.value[e]={baseUrl:"https://api.anthropic.com/v1/"}),s.value=((t=o.value[e])==null?void 0:t.apiKey)||"",n.value=((r=o.value[e])==null?void 0:r.baseUrl)||"https://api.anthropic.com/v1/"}),C([s,n],()=>{o.value[e]={...o.value[e],apiKey:s.value,baseUrl:n.value||"https://api.anthropic.com/v1/"}});function y(){o.value[e]={baseUrl:"https://api.anthropic.com/v1/"}}return(t,r)=>{var f,b;return R(),K(a(T),{"provider-name":((f=m.value)==null?void 0:f.localizedName)||"Anthropic | Claude","provider-icon":(b=m.value)==null?void 0:b.icon,"on-back":()=>a(_).back()},{default:c(()=>[r[2]||(r[2]=i("div",{bg:"orange-50 dark:orange-900/20","rounded-xl":"","p-4":"",flex:"~ col gap-3"},[i("h2",{"text-xl":"","font-bold":"",text:"orange-700 dark:orange-500"}," Before you start "),i("p",null,[p(" While Anthropic recently did announce that they are having a beta support for OpenAI SDK compatibility "),i("a",{underline:"",href:"https://docs.anthropic.com/en/api/openai-sdk"},"(you can read more here)"),p(", but due to the implementation details comes with "),i("a",{underline:"",href:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CORS"},"CORS"),p(" restrictions which not aligned with the OpenAI SDK, it's currently not possible to use this provider in the browser. ")]),i("p",null,[p(" If you do need to use this provider, you will need a dedicated proxy backend like a Serverless Function running on "),i("a",{underline:"",href:"https://workers.cloudflare.com/"},"Cloudflare Workers"),p(" or some CORS bypassing services to bypass the CORS restrictions. ")])],-1)),l(a(N),null,{default:c(()=>[l(a(B),{title:a(u)("settings.pages.providers.common.section.basic.title"),description:a(u)("settings.pages.providers.common.section.basic.description"),"on-reset":y},{default:c(()=>{var d;return[l(a(I),{modelValue:s.value,"onUpdate:modelValue":r[0]||(r[0]=k=>s.value=k),"provider-name":((d=m.value)==null?void 0:d.localizedName)||"Anthropic",placeholder:"sk-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(a(O),{title:a(u)("settings.pages.providers.common.section.advanced.title")},{default:c(()=>[l(a($),{modelValue:n.value,"onUpdate:modelValue":r[1]||(r[1]=d=>n.value=d),placeholder:"https://api.anthropic.com/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});typeof g=="function"&&g(z);export{z as default}; diff --git a/assets/anthropic-Ph_Cu-AQ.js b/assets/anthropic-Ph_Cu-AQ.js deleted file mode 100644 index 0f1a951163a57c80ed554312e1a3df83ea6d7bf7..0000000000000000000000000000000000000000 --- a/assets/anthropic-Ph_Cu-AQ.js +++ /dev/null @@ -1 +0,0 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-t8bgqiA6.js";import{d as S,k as x,h as U,s as w,l as v,f as V,w as C,m as K,o as R,E as u,a as i,b as l,bN as p,u as a}from"./index-D3pfQUMu.js";import"./three-vrm-animation.module-DLbUhddZ.js";import"./emotions-CAex_2dA.js";import{u as N}from"./providers-CCvie00Z.js";/* empty css */import{_ as O,a as $}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Qp-g_fu5.js";import{_ as A}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-yC-Tsbbb.js";import{_ as I,a as B}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C8wZQWhG.js";import{_ as T}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-CRYYAVy7.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-DDNOeGH3.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-D_DUmSTM.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-Brkyubp9.js";import"./Input.vue_vue_type_script_setup_true_lang-B223oRg0.js";const e="anthropic",z=S({__name:"anthropic",setup(M){const{t:c}=x(),g=U(),h=N(),{providers:o}=w(h),m=v(()=>h.getProviderMetadata(e)),s=v({get:()=>{var t;return((t=o.value[e])==null?void 0:t.apiKey)||""},set:t=>{o.value[e]||(o.value[e]={}),o.value[e].apiKey=t}}),n=v({get:()=>{var t;return((t=o.value[e])==null?void 0:t.baseUrl)||"https://api.anthropic.com/v1/"},set:t=>{o.value[e]||(o.value[e]={}),o.value[e].baseUrl=t}});V(()=>{var t,r;o.value[e]||(o.value[e]={baseUrl:"https://api.anthropic.com/v1/"}),s.value=((t=o.value[e])==null?void 0:t.apiKey)||"",n.value=((r=o.value[e])==null?void 0:r.baseUrl)||"https://api.anthropic.com/v1/"}),C([s,n],()=>{o.value[e]={...o.value[e],apiKey:s.value,baseUrl:n.value||"https://api.anthropic.com/v1/"}});function y(){o.value[e]={baseUrl:"https://api.anthropic.com/v1/"}}return(t,r)=>{var f,b;return R(),K(a(T),{"provider-name":((f=m.value)==null?void 0:f.localizedName)||"Anthropic | Claude","provider-icon":(b=m.value)==null?void 0:b.icon,"on-back":()=>a(g).back()},{default:u(()=>[r[2]||(r[2]=i("div",{bg:"orange-50 dark:orange-900/20","rounded-xl":"","p-4":"",flex:"~ col gap-3"},[i("h2",{"text-xl":"","font-bold":"",text:"orange-700 dark:orange-500"}," Before you start "),i("p",null,[p(" While Anthropic recently did announce that they are having a beta support for OpenAI SDK compatibility "),i("a",{underline:"",href:"https://docs.anthropic.com/en/api/openai-sdk"},"(you can read more here)"),p(", but due to the implementation details comes with "),i("a",{underline:"",href:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CORS"},"CORS"),p(" restrictions which not aligned with the OpenAI SDK, it's currently not possible to use this provider in the browser. ")]),i("p",null,[p(" If you do need to use this provider, you will need a dedicated proxy backend like a Serverless Function running on "),i("a",{underline:"",href:"https://workers.cloudflare.com/"},"Cloudflare Workers"),p(" or some CORS bypassing services to bypass the CORS restrictions. ")])],-1)),l(a(I),null,{default:u(()=>[l(a(B),{title:a(c)("settings.pages.providers.common.section.basic.title"),description:a(c)("settings.pages.providers.common.section.basic.description"),"on-reset":y},{default:u(()=>{var d;return[l(a(A),{modelValue:s.value,"onUpdate:modelValue":r[0]||(r[0]=k=>s.value=k),"provider-name":((d=m.value)==null?void 0:d.localizedName)||"Anthropic",placeholder:"sk-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(a(O),{title:a(c)("settings.pages.providers.common.section.advanced.title")},{default:u(()=>[l(a($),{modelValue:n.value,"onUpdate:modelValue":r[1]||(r[1]=d=>n.value=d),placeholder:"https://api.anthropic.com/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});typeof _=="function"&&_(z);export{z as default}; diff --git a/assets/arktype-C-GObzDh-1xlRyYUo.js b/assets/arktype-C-GObzDh-1xlRyYUo.js new file mode 100644 index 0000000000000000000000000000000000000000..f363de0fa1616a8784c02dbf09b0b0eeacc841d2 --- /dev/null +++ b/assets/arktype-C-GObzDh-1xlRyYUo.js @@ -0,0 +1 @@ +const n=async()=>o=>o.toJsonSchema();export{n as getToJsonSchemaFn}; diff --git a/assets/audio-CAykWCVt.js b/assets/audio-BOdw_4V2.js similarity index 88% rename from assets/audio-CAykWCVt.js rename to assets/audio-BOdw_4V2.js index 88f2a6bc56ae383f651c6ed2586a9d01c8b566f1..7eb471a5f4623758a27bf729c0e3661cdbd7225a 100644 --- a/assets/audio-CAykWCVt.js +++ b/assets/audio-BOdw_4V2.js @@ -1 +1 @@ -import{d as s,r as f,c as d,o as p,a as t}from"./index-D3pfQUMu.js";const R=s({__name:"audio",setup(_){const a=f(),l=f();function u(o){var r,c,i;if(!o)return;const n=(c=(r=l.value)==null?void 0:r.files)==null?void 0:c[0];if(!n)return;const e=document.createElement("audio");(i=a.value)==null||i.appendChild(e),e.src=URL.createObjectURL(n),e.controls=!0,e.load(),e.play()}return(o,n)=>(p(),d("div",null,[t("div",null,[t("div",{ref_key:"containerRef",ref:a},null,512),t("input",{ref_key:"fileInputRef",ref:l,type:"file",onChange:u},null,544)])]))}});export{R as default}; +import{d as s,r as f,c as d,o as p,e as t}from"./index-BNq7Hbz_.js";const R=s({__name:"audio",setup(_){const a=f(),l=f();function u(o){var r,c,i;if(!o)return;const n=(c=(r=l.value)==null?void 0:r.files)==null?void 0:c[0];if(!n)return;const e=document.createElement("audio");(i=a.value)==null||i.appendChild(e),e.src=URL.createObjectURL(n),e.controls=!0,e.load(),e.play()}return(o,n)=>(p(),d("div",null,[t("div",null,[t("div",{ref_key:"containerRef",ref:a},null,512),t("input",{ref_key:"fileInputRef",ref:l,type:"file",onChange:u},null,544)])]))}});export{R as default}; diff --git a/assets/background-remove-CM2rMDto.js b/assets/background-remove-B5-hUPmC.js similarity index 97% rename from assets/background-remove-CM2rMDto.js rename to assets/background-remove-B5-hUPmC.js index dd9b6ddfee23cbe989cdae6555a5b38f5b16982b..41869ba2e70a9fb4a8385043361795e9ed5ee8b8 100644 --- a/assets/background-remove-CM2rMDto.js +++ b/assets/background-remove-B5-hUPmC.js @@ -1,4 +1,4 @@ -var uv=Object.defineProperty;var dv=(e,r,t)=>r in e?uv(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t;var te=(e,r,t)=>dv(e,typeof r!="symbol"?r+"":r,t);/* empty css */import{_ as cv}from"./InputFile.vue_vue_type_script_setup_true_lang-BFgYfCCt.js";import{d as pv,r as ks,l as hv,f as mv,c as Tn,o as En,a as Sr,b as fv,t as wf,bA as bf,bB as Mf,i as yf,q as _v,u as gv}from"./index-D3pfQUMu.js";const la=new Map,kn=[],wv=(e,r,t)=>{if(r&&typeof r.init=="function"&&typeof r.createInferenceSessionHandler=="function"){const s=la.get(e);if(s===void 0)la.set(e,{backend:r,priority:t});else{if(s.priority>t)return;if(s.priority===t&&s.backend!==r)throw new Error(`cannot register backend "${e}" using priority ${t}`)}if(t>=0){const o=kn.indexOf(e);o!==-1&&kn.splice(o,1);for(let n=0;n{const r=la.get(e);if(!r)return"backend not found.";if(r.initialized)return r.backend;if(r.aborted)return r.error;{const t=!!r.initPromise;try{return t||(r.initPromise=r.backend.init(e)),await r.initPromise,r.initialized=!0,r.backend}catch(s){return t||(r.error=`${s}`,r.aborted=!0),r.error}finally{delete r.initPromise}}},Mv=async e=>{const r=e.executionProviders||[],t=r.map(l=>typeof l=="string"?l:l.name),s=t.length===0?kn:t;let o;const n=[],i=new Set;for(const l of s){const u=await bv(l);typeof u=="string"?n.push({name:l,err:u}):(o||(o=u),o===u&&i.add(l))}if(!o)throw new Error(`no available backend found. ERR: ${n.map(l=>`[${l.name}] ${l.err}`).join(", ")}`);for(const{name:l,err:u}of n)t.includes(l)&&console.warn(`removing requested execution provider "${l}" from session options because it is not available: ${u}`);const a=r.filter(l=>i.has(typeof l=="string"?l:l.name));return[o,new Proxy(e,{get:(l,u)=>u==="executionProviders"?a:Reflect.get(l,u)})]},yv="1.21.1";let vf="warning";const ms={wasm:{},webgl:{},webgpu:{},versions:{common:yv},set logLevel(e){if(e!==void 0){if(typeof e!="string"||["verbose","info","warning","error","fatal"].indexOf(e)===-1)throw new Error(`Unsupported logging level: ${e}`);vf=e}},get logLevel(){return vf}};Object.defineProperty(ms,"logLevel",{enumerable:!0});const vv=ms,xv=(e,r)=>{const t=typeof document<"u"?document.createElement("canvas"):new OffscreenCanvas(1,1);t.width=e.dims[3],t.height=e.dims[2];const s=t.getContext("2d");if(s!=null){let o,n;(r==null?void 0:r.tensorLayout)!==void 0&&r.tensorLayout==="NHWC"?(o=e.dims[2],n=e.dims[3]):(o=e.dims[3],n=e.dims[2]);const i=(r==null?void 0:r.format)!==void 0?r.format:"RGB",a=r==null?void 0:r.norm;let l,u;a===void 0||a.mean===void 0?l=[255,255,255,255]:typeof a.mean=="number"?l=[a.mean,a.mean,a.mean,a.mean]:(l=[a.mean[0],a.mean[1],a.mean[2],0],a.mean[3]!==void 0&&(l[3]=a.mean[3])),a===void 0||a.bias===void 0?u=[0,0,0,0]:typeof a.bias=="number"?u=[a.bias,a.bias,a.bias,a.bias]:(u=[a.bias[0],a.bias[1],a.bias[2],0],a.bias[3]!==void 0&&(u[3]=a.bias[3]));const p=n*o;let d=0,c=p,_=p*2,f=-1;i==="RGBA"?(d=0,c=p,_=p*2,f=p*3):i==="RGB"?(d=0,c=p,_=p*2):i==="RBG"&&(d=0,_=p,c=p*2);for(let v=0;v{const t=typeof document<"u"?document.createElement("canvas").getContext("2d"):new OffscreenCanvas(1,1).getContext("2d");let s;if(t!=null){let o,n,i;(r==null?void 0:r.tensorLayout)!==void 0&&r.tensorLayout==="NHWC"?(o=e.dims[2],n=e.dims[1],i=e.dims[3]):(o=e.dims[3],n=e.dims[2],i=e.dims[1]);const a=r!==void 0&&r.format!==void 0?r.format:"RGB",l=r==null?void 0:r.norm;let u,p;l===void 0||l.mean===void 0?u=[255,255,255,255]:typeof l.mean=="number"?u=[l.mean,l.mean,l.mean,l.mean]:(u=[l.mean[0],l.mean[1],l.mean[2],255],l.mean[3]!==void 0&&(u[3]=l.mean[3])),l===void 0||l.bias===void 0?p=[0,0,0,0]:typeof l.bias=="number"?p=[l.bias,l.bias,l.bias,l.bias]:(p=[l.bias[0],l.bias[1],l.bias[2],0],l.bias[3]!==void 0&&(p[3]=l.bias[3]));const d=n*o;if(r!==void 0&&(r.format!==void 0&&i===4&&r.format!=="RGBA"||i===3&&r.format!=="RGB"&&r.format!=="BGR"))throw new Error("Tensor format doesn't match input tensor dims");const c=4;let _=0,f=1,v=2,$=3,w=0,g=d,C=d*2,E=-1;a==="RGBA"?(w=0,g=d,C=d*2,E=d*3):a==="RGB"?(w=0,g=d,C=d*2):a==="RBG"&&(w=0,C=d,g=d*2),s=t.createImageData(o,n);for(let y=0;y{if(e===void 0)throw new Error("Image buffer must be defined");if(r.height===void 0||r.width===void 0)throw new Error("Image height and width must be defined");if(r.tensorLayout==="NHWC")throw new Error("NHWC Tensor layout is not supported yet");const{height:t,width:s}=r,o=r.norm??{mean:255,bias:0};let n,i;typeof o.mean=="number"?n=[o.mean,o.mean,o.mean,o.mean]:n=[o.mean[0],o.mean[1],o.mean[2],o.mean[3]??255],typeof o.bias=="number"?i=[o.bias,o.bias,o.bias,o.bias]:i=[o.bias[0],o.bias[1],o.bias[2],o.bias[3]??0];const a=r.format!==void 0?r.format:"RGBA",l=r.tensorFormat!==void 0&&r.tensorFormat!==void 0?r.tensorFormat:"RGB",u=t*s,p=l==="RGBA"?new Float32Array(u*4):new Float32Array(u*3);let d=4,c=0,_=1,f=2,v=3,$=0,w=u,g=u*2,C=-1;a==="RGB"&&(d=3,c=0,_=1,f=2,v=-1),l==="RGBA"?C=u*3:l==="RBG"?($=0,g=u,w=u*2):l==="BGR"&&(g=0,w=u,$=u*2);for(let y=0;y{const t=typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement,s=typeof ImageData<"u"&&e instanceof ImageData,o=typeof ImageBitmap<"u"&&e instanceof ImageBitmap,n=typeof e=="string";let i,a=r??{};const l=()=>{if(typeof document<"u")return document.createElement("canvas");if(typeof OffscreenCanvas<"u")return new OffscreenCanvas(1,1);throw new Error("Canvas is not supported")},u=p=>typeof HTMLCanvasElement<"u"&&p instanceof HTMLCanvasElement||p instanceof OffscreenCanvas?p.getContext("2d"):null;if(t){const p=l();p.width=e.width,p.height=e.height;const d=u(p);if(d!=null){let c=e.height,_=e.width;if(r!==void 0&&r.resizedHeight!==void 0&&r.resizedWidth!==void 0&&(c=r.resizedHeight,_=r.resizedWidth),r!==void 0){if(a=r,r.tensorFormat!==void 0)throw new Error("Image input config format must be RGBA for HTMLImageElement");a.tensorFormat="RGBA",a.height=c,a.width=_}else a.tensorFormat="RGBA",a.height=c,a.width=_;d.drawImage(e,0,0),i=d.getImageData(0,0,_,c).data}else throw new Error("Can not access image data")}else if(s){let p,d;if(r!==void 0&&r.resizedWidth!==void 0&&r.resizedHeight!==void 0?(p=r.resizedHeight,d=r.resizedWidth):(p=e.height,d=e.width),r!==void 0&&(a=r),a.format="RGBA",a.height=p,a.width=d,r!==void 0){const c=l();c.width=d,c.height=p;const _=u(c);if(_!=null)_.putImageData(e,0,0),i=_.getImageData(0,0,d,p).data;else throw new Error("Can not access image data")}else i=e.data}else if(o){if(r===void 0)throw new Error("Please provide image config with format for Imagebitmap");const p=l();p.width=e.width,p.height=e.height;const d=u(p);if(d!=null){const c=e.height,_=e.width;return d.drawImage(e,0,0,_,c),i=d.getImageData(0,0,_,c).data,a.height=c,a.width=_,kl(i,a)}else throw new Error("Can not access image data")}else{if(n)return new Promise((p,d)=>{const c=l(),_=u(c);if(!e||!_)return d();const f=new Image;f.crossOrigin="Anonymous",f.src=e,f.onload=()=>{c.width=f.width,c.height=f.height,_.drawImage(f,0,0,c.width,c.height);const v=_.getImageData(0,0,c.width,c.height);a.height=c.height,a.width=c.width,p(kl(v.data,a))}});throw new Error("Input data provided is not supported - aborted tensor creation")}if(i!==void 0)return kl(i,a);throw new Error("Input data provided is not supported - aborted tensor creation")},Pv=(e,r)=>{const{width:t,height:s,download:o,dispose:n}=r,i=[1,s,t,4];return new Qr({location:"texture",type:"float32",texture:e,dims:i,download:o,dispose:n})},Cv=(e,r)=>{const{dataType:t,dims:s,download:o,dispose:n}=r;return new Qr({location:"gpu-buffer",type:t??"float32",gpuBuffer:e,dims:s,download:o,dispose:n})},Sv=(e,r)=>{const{dataType:t,dims:s,download:o,dispose:n}=r;return new Qr({location:"ml-tensor",type:t??"float32",mlTensor:e,dims:s,download:o,dispose:n})},$v=(e,r,t)=>new Qr({location:"cpu-pinned",type:e,data:r,dims:t??[r.length]}),so=new Map([["float32",Float32Array],["uint8",Uint8Array],["int8",Int8Array],["uint16",Uint16Array],["int16",Int16Array],["int32",Int32Array],["bool",Uint8Array],["float64",Float64Array],["uint32",Uint32Array],["int4",Uint8Array],["uint4",Uint8Array]]),ua=new Map([[Float32Array,"float32"],[Uint8Array,"uint8"],[Int8Array,"int8"],[Uint16Array,"uint16"],[Int16Array,"int16"],[Int32Array,"int32"],[Float64Array,"float64"],[Uint32Array,"uint32"]]);let xf=!1;const kv=()=>{if(!xf){xf=!0;const e=typeof BigInt64Array<"u"&&BigInt64Array.from,r=typeof BigUint64Array<"u"&&BigUint64Array.from,t=globalThis.Float16Array,s=typeof t<"u"&&t.from;e&&(so.set("int64",BigInt64Array),ua.set(BigInt64Array,"int64")),r&&(so.set("uint64",BigUint64Array),ua.set(BigUint64Array,"uint64")),s?(so.set("float16",t),ua.set(t,"float16")):so.set("float16",Uint16Array)}},Iv=e=>{let r=1;for(let t=0;t{switch(e.location){case"cpu":return new Qr(e.type,e.data,r);case"cpu-pinned":return new Qr({location:"cpu-pinned",data:e.data,type:e.type,dims:r});case"texture":return new Qr({location:"texture",texture:e.texture,type:e.type,dims:r});case"gpu-buffer":return new Qr({location:"gpu-buffer",gpuBuffer:e.gpuBuffer,type:e.type,dims:r});case"ml-tensor":return new Qr({location:"ml-tensor",mlTensor:e.mlTensor,type:e.type,dims:r});default:throw new Error(`tensorReshape: tensor location ${e.location} is not supported`)}};let Qr=class{constructor(r,t,s){kv();let o,n;if(typeof r=="object"&&"location"in r)switch(this.dataLocation=r.location,o=r.type,n=r.dims,r.location){case"cpu-pinned":{const a=so.get(o);if(!a)throw new TypeError(`unsupported type "${o}" to create tensor from pinned buffer`);if(!(r.data instanceof a))throw new TypeError(`buffer should be of type ${a.name}`);this.cpuData=r.data;break}case"texture":{if(o!=="float32")throw new TypeError(`unsupported type "${o}" to create tensor from texture`);this.gpuTextureData=r.texture,this.downloader=r.download,this.disposer=r.dispose;break}case"gpu-buffer":{if(o!=="float32"&&o!=="float16"&&o!=="int32"&&o!=="int64"&&o!=="uint32"&&o!=="uint8"&&o!=="bool"&&o!=="uint4"&&o!=="int4")throw new TypeError(`unsupported type "${o}" to create tensor from gpu buffer`);this.gpuBufferData=r.gpuBuffer,this.downloader=r.download,this.disposer=r.dispose;break}case"ml-tensor":{if(o!=="float32"&&o!=="float16"&&o!=="int32"&&o!=="int64"&&o!=="uint32"&&o!=="uint64"&&o!=="int8"&&o!=="uint8"&&o!=="bool"&&o!=="uint4"&&o!=="int4")throw new TypeError(`unsupported type "${o}" to create tensor from MLTensor`);this.mlTensorData=r.mlTensor,this.downloader=r.download,this.disposer=r.dispose;break}default:throw new Error(`Tensor constructor: unsupported location '${this.dataLocation}'`)}else{let a,l;if(typeof r=="string")if(o=r,l=s,r==="string"){if(!Array.isArray(t))throw new TypeError("A string tensor's data must be a string array.");a=t}else{const u=so.get(r);if(u===void 0)throw new TypeError(`Unsupported tensor type: ${r}.`);if(Array.isArray(t)){if(r==="float16"&&u===Uint16Array||r==="uint4"||r==="int4")throw new TypeError(`Creating a ${r} tensor from number array is not supported. Please use ${u.name} as data.`);r==="uint64"||r==="int64"?a=u.from(t,BigInt):a=u.from(t)}else if(t instanceof u)a=t;else if(t instanceof Uint8ClampedArray)if(r==="uint8")a=Uint8Array.from(t);else throw new TypeError("A Uint8ClampedArray tensor's data must be type of uint8");else if(r==="float16"&&t instanceof Uint16Array&&u!==Uint16Array)a=new globalThis.Float16Array(t.buffer,t.byteOffset,t.length);else throw new TypeError(`A ${o} tensor's data must be type of ${u}`)}else if(l=t,Array.isArray(r)){if(r.length===0)throw new TypeError("Tensor type cannot be inferred from an empty array.");const u=typeof r[0];if(u==="string")o="string",a=r;else if(u==="boolean")o="bool",a=Uint8Array.from(r);else throw new TypeError(`Invalid element type of data array: ${u}.`)}else if(r instanceof Uint8ClampedArray)o="uint8",a=Uint8Array.from(r);else{const u=ua.get(r.constructor);if(u===void 0)throw new TypeError(`Unsupported type for tensor data: ${r.constructor}.`);o=u,a=r}if(l===void 0)l=[a.length];else if(!Array.isArray(l))throw new TypeError("A tensor's dims must be a number array");n=l,this.cpuData=a,this.dataLocation="cpu"}const i=Iv(n);if(this.cpuData&&i!==this.cpuData.length&&!((o==="uint4"||o==="int4")&&Math.ceil(i/2)===this.cpuData.length))throw new Error(`Tensor's size(${i}) does not match data length(${this.cpuData.length}).`);this.type=o,this.dims=n,this.size=i}static async fromImage(r,t){return Ev(r,t)}static fromTexture(r,t){return Pv(r,t)}static fromGpuBuffer(r,t){return Cv(r,t)}static fromMLTensor(r,t){return Sv(r,t)}static fromPinnedBuffer(r,t,s){return $v(r,t,s)}toDataURL(r){return xv(this,r)}toImageData(r){return Tv(this,r)}get data(){if(this.ensureValid(),!this.cpuData)throw new Error("The data is not on CPU. Use `getData()` to download GPU data to CPU, or use `texture` or `gpuBuffer` property to access the GPU data directly.");return this.cpuData}get location(){return this.dataLocation}get texture(){if(this.ensureValid(),!this.gpuTextureData)throw new Error("The data is not stored as a WebGL texture.");return this.gpuTextureData}get gpuBuffer(){if(this.ensureValid(),!this.gpuBufferData)throw new Error("The data is not stored as a WebGPU buffer.");return this.gpuBufferData}get mlTensor(){if(this.ensureValid(),!this.mlTensorData)throw new Error("The data is not stored as a WebNN MLTensor.");return this.mlTensorData}async getData(r){switch(this.ensureValid(),this.dataLocation){case"cpu":case"cpu-pinned":return this.data;case"texture":case"gpu-buffer":case"ml-tensor":{if(!this.downloader)throw new Error("The current tensor is not created with a specified data downloader.");if(this.isDownloading)throw new Error("The current tensor is being downloaded.");try{this.isDownloading=!0;const t=await this.downloader();return this.downloader=void 0,this.dataLocation="cpu",this.cpuData=t,r&&this.disposer&&(this.disposer(),this.disposer=void 0),t}finally{this.isDownloading=!1}}default:throw new Error(`cannot get data from location: ${this.dataLocation}`)}}dispose(){if(this.isDownloading)throw new Error("The current tensor is being downloaded.");this.disposer&&(this.disposer(),this.disposer=void 0),this.cpuData=void 0,this.gpuTextureData=void 0,this.gpuBufferData=void 0,this.mlTensorData=void 0,this.downloader=void 0,this.isDownloading=void 0,this.dataLocation="none"}ensureValid(){if(this.dataLocation==="none")throw new Error("The tensor is disposed.")}reshape(r){if(this.ensureValid(),this.downloader||this.disposer)throw new Error("Cannot reshape a tensor that owns GPU resource.");return Av(this,r)}};const to=Qr,nb=(e,r)=>{(typeof ms.trace>"u"?!ms.wasm.trace:!ms.trace)||console.timeStamp(`${e}::ORT::${r}`)},ob=(e,r)=>{var o;const t=((o=new Error().stack)==null?void 0:o.split(/\r\n|\r|\n/g))||[];let s=!1;for(let n=0;n{(typeof ms.trace>"u"?!ms.wasm.trace:!ms.trace)||ob("BEGIN",e)},Iu=e=>{(typeof ms.trace>"u"?!ms.wasm.trace:!ms.trace)||ob("END",e)};let Fv=class ib{constructor(r){this.handler=r}async run(r,t,s){ku();const o={};let n={};if(typeof r!="object"||r===null||r instanceof to||Array.isArray(r))throw new TypeError("'feeds' must be an object that use input names as keys and OnnxValue as corresponding values.");let i=!0;if(typeof t=="object"){if(t===null)throw new TypeError("Unexpected argument[1]: cannot be null.");if(t instanceof to)throw new TypeError("'fetches' cannot be a Tensor");if(Array.isArray(t)){if(t.length===0)throw new TypeError("'fetches' cannot be an empty array.");i=!1;for(const u of t){if(typeof u!="string")throw new TypeError("'fetches' must be a string array or an object.");if(this.outputNames.indexOf(u)===-1)throw new RangeError(`'fetches' contains invalid output name: ${u}.`);o[u]=null}if(typeof s=="object"&&s!==null)n=s;else if(typeof s<"u")throw new TypeError("'options' must be an object.")}else{let u=!1;const p=Object.getOwnPropertyNames(t);for(const d of this.outputNames)if(p.indexOf(d)!==-1){const c=t[d];(c===null||c instanceof to)&&(u=!0,i=!1,o[d]=c)}if(u){if(typeof s=="object"&&s!==null)n=s;else if(typeof s<"u")throw new TypeError("'options' must be an object.")}else n=t}}else if(typeof t<"u")throw new TypeError("Unexpected argument[1]: must be 'fetches' or 'options'.");for(const u of this.inputNames)if(typeof r[u]>"u")throw new Error(`input '${u}' is missing in 'feeds'.`);if(i)for(const u of this.outputNames)o[u]=null;const a=await this.handler.run(r,o,n),l={};for(const u in a)if(Object.hasOwnProperty.call(a,u)){const p=a[u];p instanceof to?l[u]=p:l[u]=new to(p.type,p.data,p.dims)}return Iu(),l}async release(){return this.handler.dispose()}static async create(r,t,s,o){ku();let n,i={};if(typeof r=="string"){if(n=r,typeof t=="object"&&t!==null)i=t;else if(typeof t<"u")throw new TypeError("'options' must be an object.")}else if(r instanceof Uint8Array){if(n=r,typeof t=="object"&&t!==null)i=t;else if(typeof t<"u")throw new TypeError("'options' must be an object.")}else if(r instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&r instanceof SharedArrayBuffer){const p=r;let d=0,c=r.byteLength;if(typeof t=="object"&&t!==null)i=t;else if(typeof t=="number"){if(d=t,!Number.isSafeInteger(d))throw new RangeError("'byteOffset' must be an integer.");if(d<0||d>=p.byteLength)throw new RangeError(`'byteOffset' is out of range [0, ${p.byteLength}).`);if(c=r.byteLength-d,typeof s=="number"){if(c=s,!Number.isSafeInteger(c))throw new RangeError("'byteLength' must be an integer.");if(c<=0||d+c>p.byteLength)throw new RangeError(`'byteLength' is out of range (0, ${p.byteLength-d}].`);if(typeof o=="object"&&o!==null)i=o;else if(typeof o<"u")throw new TypeError("'options' must be an object.")}else if(typeof s<"u")throw new TypeError("'byteLength' must be a number.")}else if(typeof t<"u")throw new TypeError("'options' must be an object.");n=new Uint8Array(p,d,c)}else throw new TypeError("Unexpected argument[0]: must be 'path' or 'buffer'.");const[a,l]=await Mv(i),u=await a.createInferenceSessionHandler(n,l);return Iu(),new ib(u)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}};const Ov=Fv,Dv=Object.freeze(Object.defineProperty({__proto__:null,InferenceSession:Ov,TRACE:nb,TRACE_FUNC_BEGIN:ku,TRACE_FUNC_END:Iu,Tensor:to,env:vv,registerBackend:wv},Symbol.toStringTag,{value:"Module"}));/*! +var uv=Object.defineProperty;var dv=(e,r,t)=>r in e?uv(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t;var te=(e,r,t)=>dv(e,typeof r!="symbol"?r+"":r,t);/* empty css */import{_ as cv}from"./InputFile.vue_vue_type_script_setup_true_lang-DHNEAW-b.js";import{d as pv,r as ks,h as hv,H as mv,c as Tn,o as En,e as Sr,i as fv,t as wf,F as bf,l as Mf,j as yf,z as _v,b as gv}from"./index-BNq7Hbz_.js";const la=new Map,kn=[],wv=(e,r,t)=>{if(r&&typeof r.init=="function"&&typeof r.createInferenceSessionHandler=="function"){const s=la.get(e);if(s===void 0)la.set(e,{backend:r,priority:t});else{if(s.priority>t)return;if(s.priority===t&&s.backend!==r)throw new Error(`cannot register backend "${e}" using priority ${t}`)}if(t>=0){const o=kn.indexOf(e);o!==-1&&kn.splice(o,1);for(let n=0;n{const r=la.get(e);if(!r)return"backend not found.";if(r.initialized)return r.backend;if(r.aborted)return r.error;{const t=!!r.initPromise;try{return t||(r.initPromise=r.backend.init(e)),await r.initPromise,r.initialized=!0,r.backend}catch(s){return t||(r.error=`${s}`,r.aborted=!0),r.error}finally{delete r.initPromise}}},Mv=async e=>{const r=e.executionProviders||[],t=r.map(l=>typeof l=="string"?l:l.name),s=t.length===0?kn:t;let o;const n=[],i=new Set;for(const l of s){const u=await bv(l);typeof u=="string"?n.push({name:l,err:u}):(o||(o=u),o===u&&i.add(l))}if(!o)throw new Error(`no available backend found. ERR: ${n.map(l=>`[${l.name}] ${l.err}`).join(", ")}`);for(const{name:l,err:u}of n)t.includes(l)&&console.warn(`removing requested execution provider "${l}" from session options because it is not available: ${u}`);const a=r.filter(l=>i.has(typeof l=="string"?l:l.name));return[o,new Proxy(e,{get:(l,u)=>u==="executionProviders"?a:Reflect.get(l,u)})]},yv="1.21.1";let vf="warning";const ms={wasm:{},webgl:{},webgpu:{},versions:{common:yv},set logLevel(e){if(e!==void 0){if(typeof e!="string"||["verbose","info","warning","error","fatal"].indexOf(e)===-1)throw new Error(`Unsupported logging level: ${e}`);vf=e}},get logLevel(){return vf}};Object.defineProperty(ms,"logLevel",{enumerable:!0});const vv=ms,xv=(e,r)=>{const t=typeof document<"u"?document.createElement("canvas"):new OffscreenCanvas(1,1);t.width=e.dims[3],t.height=e.dims[2];const s=t.getContext("2d");if(s!=null){let o,n;(r==null?void 0:r.tensorLayout)!==void 0&&r.tensorLayout==="NHWC"?(o=e.dims[2],n=e.dims[3]):(o=e.dims[3],n=e.dims[2]);const i=(r==null?void 0:r.format)!==void 0?r.format:"RGB",a=r==null?void 0:r.norm;let l,u;a===void 0||a.mean===void 0?l=[255,255,255,255]:typeof a.mean=="number"?l=[a.mean,a.mean,a.mean,a.mean]:(l=[a.mean[0],a.mean[1],a.mean[2],0],a.mean[3]!==void 0&&(l[3]=a.mean[3])),a===void 0||a.bias===void 0?u=[0,0,0,0]:typeof a.bias=="number"?u=[a.bias,a.bias,a.bias,a.bias]:(u=[a.bias[0],a.bias[1],a.bias[2],0],a.bias[3]!==void 0&&(u[3]=a.bias[3]));const p=n*o;let d=0,c=p,_=p*2,f=-1;i==="RGBA"?(d=0,c=p,_=p*2,f=p*3):i==="RGB"?(d=0,c=p,_=p*2):i==="RBG"&&(d=0,_=p,c=p*2);for(let v=0;v{const t=typeof document<"u"?document.createElement("canvas").getContext("2d"):new OffscreenCanvas(1,1).getContext("2d");let s;if(t!=null){let o,n,i;(r==null?void 0:r.tensorLayout)!==void 0&&r.tensorLayout==="NHWC"?(o=e.dims[2],n=e.dims[1],i=e.dims[3]):(o=e.dims[3],n=e.dims[2],i=e.dims[1]);const a=r!==void 0&&r.format!==void 0?r.format:"RGB",l=r==null?void 0:r.norm;let u,p;l===void 0||l.mean===void 0?u=[255,255,255,255]:typeof l.mean=="number"?u=[l.mean,l.mean,l.mean,l.mean]:(u=[l.mean[0],l.mean[1],l.mean[2],255],l.mean[3]!==void 0&&(u[3]=l.mean[3])),l===void 0||l.bias===void 0?p=[0,0,0,0]:typeof l.bias=="number"?p=[l.bias,l.bias,l.bias,l.bias]:(p=[l.bias[0],l.bias[1],l.bias[2],0],l.bias[3]!==void 0&&(p[3]=l.bias[3]));const d=n*o;if(r!==void 0&&(r.format!==void 0&&i===4&&r.format!=="RGBA"||i===3&&r.format!=="RGB"&&r.format!=="BGR"))throw new Error("Tensor format doesn't match input tensor dims");const c=4;let _=0,f=1,v=2,$=3,w=0,g=d,C=d*2,E=-1;a==="RGBA"?(w=0,g=d,C=d*2,E=d*3):a==="RGB"?(w=0,g=d,C=d*2):a==="RBG"&&(w=0,C=d,g=d*2),s=t.createImageData(o,n);for(let y=0;y{if(e===void 0)throw new Error("Image buffer must be defined");if(r.height===void 0||r.width===void 0)throw new Error("Image height and width must be defined");if(r.tensorLayout==="NHWC")throw new Error("NHWC Tensor layout is not supported yet");const{height:t,width:s}=r,o=r.norm??{mean:255,bias:0};let n,i;typeof o.mean=="number"?n=[o.mean,o.mean,o.mean,o.mean]:n=[o.mean[0],o.mean[1],o.mean[2],o.mean[3]??255],typeof o.bias=="number"?i=[o.bias,o.bias,o.bias,o.bias]:i=[o.bias[0],o.bias[1],o.bias[2],o.bias[3]??0];const a=r.format!==void 0?r.format:"RGBA",l=r.tensorFormat!==void 0&&r.tensorFormat!==void 0?r.tensorFormat:"RGB",u=t*s,p=l==="RGBA"?new Float32Array(u*4):new Float32Array(u*3);let d=4,c=0,_=1,f=2,v=3,$=0,w=u,g=u*2,C=-1;a==="RGB"&&(d=3,c=0,_=1,f=2,v=-1),l==="RGBA"?C=u*3:l==="RBG"?($=0,g=u,w=u*2):l==="BGR"&&(g=0,w=u,$=u*2);for(let y=0;y{const t=typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement,s=typeof ImageData<"u"&&e instanceof ImageData,o=typeof ImageBitmap<"u"&&e instanceof ImageBitmap,n=typeof e=="string";let i,a=r??{};const l=()=>{if(typeof document<"u")return document.createElement("canvas");if(typeof OffscreenCanvas<"u")return new OffscreenCanvas(1,1);throw new Error("Canvas is not supported")},u=p=>typeof HTMLCanvasElement<"u"&&p instanceof HTMLCanvasElement||p instanceof OffscreenCanvas?p.getContext("2d"):null;if(t){const p=l();p.width=e.width,p.height=e.height;const d=u(p);if(d!=null){let c=e.height,_=e.width;if(r!==void 0&&r.resizedHeight!==void 0&&r.resizedWidth!==void 0&&(c=r.resizedHeight,_=r.resizedWidth),r!==void 0){if(a=r,r.tensorFormat!==void 0)throw new Error("Image input config format must be RGBA for HTMLImageElement");a.tensorFormat="RGBA",a.height=c,a.width=_}else a.tensorFormat="RGBA",a.height=c,a.width=_;d.drawImage(e,0,0),i=d.getImageData(0,0,_,c).data}else throw new Error("Can not access image data")}else if(s){let p,d;if(r!==void 0&&r.resizedWidth!==void 0&&r.resizedHeight!==void 0?(p=r.resizedHeight,d=r.resizedWidth):(p=e.height,d=e.width),r!==void 0&&(a=r),a.format="RGBA",a.height=p,a.width=d,r!==void 0){const c=l();c.width=d,c.height=p;const _=u(c);if(_!=null)_.putImageData(e,0,0),i=_.getImageData(0,0,d,p).data;else throw new Error("Can not access image data")}else i=e.data}else if(o){if(r===void 0)throw new Error("Please provide image config with format for Imagebitmap");const p=l();p.width=e.width,p.height=e.height;const d=u(p);if(d!=null){const c=e.height,_=e.width;return d.drawImage(e,0,0,_,c),i=d.getImageData(0,0,_,c).data,a.height=c,a.width=_,kl(i,a)}else throw new Error("Can not access image data")}else{if(n)return new Promise((p,d)=>{const c=l(),_=u(c);if(!e||!_)return d();const f=new Image;f.crossOrigin="Anonymous",f.src=e,f.onload=()=>{c.width=f.width,c.height=f.height,_.drawImage(f,0,0,c.width,c.height);const v=_.getImageData(0,0,c.width,c.height);a.height=c.height,a.width=c.width,p(kl(v.data,a))}});throw new Error("Input data provided is not supported - aborted tensor creation")}if(i!==void 0)return kl(i,a);throw new Error("Input data provided is not supported - aborted tensor creation")},Pv=(e,r)=>{const{width:t,height:s,download:o,dispose:n}=r,i=[1,s,t,4];return new Qr({location:"texture",type:"float32",texture:e,dims:i,download:o,dispose:n})},Cv=(e,r)=>{const{dataType:t,dims:s,download:o,dispose:n}=r;return new Qr({location:"gpu-buffer",type:t??"float32",gpuBuffer:e,dims:s,download:o,dispose:n})},Sv=(e,r)=>{const{dataType:t,dims:s,download:o,dispose:n}=r;return new Qr({location:"ml-tensor",type:t??"float32",mlTensor:e,dims:s,download:o,dispose:n})},$v=(e,r,t)=>new Qr({location:"cpu-pinned",type:e,data:r,dims:t??[r.length]}),so=new Map([["float32",Float32Array],["uint8",Uint8Array],["int8",Int8Array],["uint16",Uint16Array],["int16",Int16Array],["int32",Int32Array],["bool",Uint8Array],["float64",Float64Array],["uint32",Uint32Array],["int4",Uint8Array],["uint4",Uint8Array]]),ua=new Map([[Float32Array,"float32"],[Uint8Array,"uint8"],[Int8Array,"int8"],[Uint16Array,"uint16"],[Int16Array,"int16"],[Int32Array,"int32"],[Float64Array,"float64"],[Uint32Array,"uint32"]]);let xf=!1;const kv=()=>{if(!xf){xf=!0;const e=typeof BigInt64Array<"u"&&BigInt64Array.from,r=typeof BigUint64Array<"u"&&BigUint64Array.from,t=globalThis.Float16Array,s=typeof t<"u"&&t.from;e&&(so.set("int64",BigInt64Array),ua.set(BigInt64Array,"int64")),r&&(so.set("uint64",BigUint64Array),ua.set(BigUint64Array,"uint64")),s?(so.set("float16",t),ua.set(t,"float16")):so.set("float16",Uint16Array)}},Iv=e=>{let r=1;for(let t=0;t{switch(e.location){case"cpu":return new Qr(e.type,e.data,r);case"cpu-pinned":return new Qr({location:"cpu-pinned",data:e.data,type:e.type,dims:r});case"texture":return new Qr({location:"texture",texture:e.texture,type:e.type,dims:r});case"gpu-buffer":return new Qr({location:"gpu-buffer",gpuBuffer:e.gpuBuffer,type:e.type,dims:r});case"ml-tensor":return new Qr({location:"ml-tensor",mlTensor:e.mlTensor,type:e.type,dims:r});default:throw new Error(`tensorReshape: tensor location ${e.location} is not supported`)}};let Qr=class{constructor(r,t,s){kv();let o,n;if(typeof r=="object"&&"location"in r)switch(this.dataLocation=r.location,o=r.type,n=r.dims,r.location){case"cpu-pinned":{const a=so.get(o);if(!a)throw new TypeError(`unsupported type "${o}" to create tensor from pinned buffer`);if(!(r.data instanceof a))throw new TypeError(`buffer should be of type ${a.name}`);this.cpuData=r.data;break}case"texture":{if(o!=="float32")throw new TypeError(`unsupported type "${o}" to create tensor from texture`);this.gpuTextureData=r.texture,this.downloader=r.download,this.disposer=r.dispose;break}case"gpu-buffer":{if(o!=="float32"&&o!=="float16"&&o!=="int32"&&o!=="int64"&&o!=="uint32"&&o!=="uint8"&&o!=="bool"&&o!=="uint4"&&o!=="int4")throw new TypeError(`unsupported type "${o}" to create tensor from gpu buffer`);this.gpuBufferData=r.gpuBuffer,this.downloader=r.download,this.disposer=r.dispose;break}case"ml-tensor":{if(o!=="float32"&&o!=="float16"&&o!=="int32"&&o!=="int64"&&o!=="uint32"&&o!=="uint64"&&o!=="int8"&&o!=="uint8"&&o!=="bool"&&o!=="uint4"&&o!=="int4")throw new TypeError(`unsupported type "${o}" to create tensor from MLTensor`);this.mlTensorData=r.mlTensor,this.downloader=r.download,this.disposer=r.dispose;break}default:throw new Error(`Tensor constructor: unsupported location '${this.dataLocation}'`)}else{let a,l;if(typeof r=="string")if(o=r,l=s,r==="string"){if(!Array.isArray(t))throw new TypeError("A string tensor's data must be a string array.");a=t}else{const u=so.get(r);if(u===void 0)throw new TypeError(`Unsupported tensor type: ${r}.`);if(Array.isArray(t)){if(r==="float16"&&u===Uint16Array||r==="uint4"||r==="int4")throw new TypeError(`Creating a ${r} tensor from number array is not supported. Please use ${u.name} as data.`);r==="uint64"||r==="int64"?a=u.from(t,BigInt):a=u.from(t)}else if(t instanceof u)a=t;else if(t instanceof Uint8ClampedArray)if(r==="uint8")a=Uint8Array.from(t);else throw new TypeError("A Uint8ClampedArray tensor's data must be type of uint8");else if(r==="float16"&&t instanceof Uint16Array&&u!==Uint16Array)a=new globalThis.Float16Array(t.buffer,t.byteOffset,t.length);else throw new TypeError(`A ${o} tensor's data must be type of ${u}`)}else if(l=t,Array.isArray(r)){if(r.length===0)throw new TypeError("Tensor type cannot be inferred from an empty array.");const u=typeof r[0];if(u==="string")o="string",a=r;else if(u==="boolean")o="bool",a=Uint8Array.from(r);else throw new TypeError(`Invalid element type of data array: ${u}.`)}else if(r instanceof Uint8ClampedArray)o="uint8",a=Uint8Array.from(r);else{const u=ua.get(r.constructor);if(u===void 0)throw new TypeError(`Unsupported type for tensor data: ${r.constructor}.`);o=u,a=r}if(l===void 0)l=[a.length];else if(!Array.isArray(l))throw new TypeError("A tensor's dims must be a number array");n=l,this.cpuData=a,this.dataLocation="cpu"}const i=Iv(n);if(this.cpuData&&i!==this.cpuData.length&&!((o==="uint4"||o==="int4")&&Math.ceil(i/2)===this.cpuData.length))throw new Error(`Tensor's size(${i}) does not match data length(${this.cpuData.length}).`);this.type=o,this.dims=n,this.size=i}static async fromImage(r,t){return Ev(r,t)}static fromTexture(r,t){return Pv(r,t)}static fromGpuBuffer(r,t){return Cv(r,t)}static fromMLTensor(r,t){return Sv(r,t)}static fromPinnedBuffer(r,t,s){return $v(r,t,s)}toDataURL(r){return xv(this,r)}toImageData(r){return Tv(this,r)}get data(){if(this.ensureValid(),!this.cpuData)throw new Error("The data is not on CPU. Use `getData()` to download GPU data to CPU, or use `texture` or `gpuBuffer` property to access the GPU data directly.");return this.cpuData}get location(){return this.dataLocation}get texture(){if(this.ensureValid(),!this.gpuTextureData)throw new Error("The data is not stored as a WebGL texture.");return this.gpuTextureData}get gpuBuffer(){if(this.ensureValid(),!this.gpuBufferData)throw new Error("The data is not stored as a WebGPU buffer.");return this.gpuBufferData}get mlTensor(){if(this.ensureValid(),!this.mlTensorData)throw new Error("The data is not stored as a WebNN MLTensor.");return this.mlTensorData}async getData(r){switch(this.ensureValid(),this.dataLocation){case"cpu":case"cpu-pinned":return this.data;case"texture":case"gpu-buffer":case"ml-tensor":{if(!this.downloader)throw new Error("The current tensor is not created with a specified data downloader.");if(this.isDownloading)throw new Error("The current tensor is being downloaded.");try{this.isDownloading=!0;const t=await this.downloader();return this.downloader=void 0,this.dataLocation="cpu",this.cpuData=t,r&&this.disposer&&(this.disposer(),this.disposer=void 0),t}finally{this.isDownloading=!1}}default:throw new Error(`cannot get data from location: ${this.dataLocation}`)}}dispose(){if(this.isDownloading)throw new Error("The current tensor is being downloaded.");this.disposer&&(this.disposer(),this.disposer=void 0),this.cpuData=void 0,this.gpuTextureData=void 0,this.gpuBufferData=void 0,this.mlTensorData=void 0,this.downloader=void 0,this.isDownloading=void 0,this.dataLocation="none"}ensureValid(){if(this.dataLocation==="none")throw new Error("The tensor is disposed.")}reshape(r){if(this.ensureValid(),this.downloader||this.disposer)throw new Error("Cannot reshape a tensor that owns GPU resource.");return Av(this,r)}};const to=Qr,nb=(e,r)=>{(typeof ms.trace>"u"?!ms.wasm.trace:!ms.trace)||console.timeStamp(`${e}::ORT::${r}`)},ob=(e,r)=>{var o;const t=((o=new Error().stack)==null?void 0:o.split(/\r\n|\r|\n/g))||[];let s=!1;for(let n=0;n{(typeof ms.trace>"u"?!ms.wasm.trace:!ms.trace)||ob("BEGIN",e)},Iu=e=>{(typeof ms.trace>"u"?!ms.wasm.trace:!ms.trace)||ob("END",e)};let Fv=class ib{constructor(r){this.handler=r}async run(r,t,s){ku();const o={};let n={};if(typeof r!="object"||r===null||r instanceof to||Array.isArray(r))throw new TypeError("'feeds' must be an object that use input names as keys and OnnxValue as corresponding values.");let i=!0;if(typeof t=="object"){if(t===null)throw new TypeError("Unexpected argument[1]: cannot be null.");if(t instanceof to)throw new TypeError("'fetches' cannot be a Tensor");if(Array.isArray(t)){if(t.length===0)throw new TypeError("'fetches' cannot be an empty array.");i=!1;for(const u of t){if(typeof u!="string")throw new TypeError("'fetches' must be a string array or an object.");if(this.outputNames.indexOf(u)===-1)throw new RangeError(`'fetches' contains invalid output name: ${u}.`);o[u]=null}if(typeof s=="object"&&s!==null)n=s;else if(typeof s<"u")throw new TypeError("'options' must be an object.")}else{let u=!1;const p=Object.getOwnPropertyNames(t);for(const d of this.outputNames)if(p.indexOf(d)!==-1){const c=t[d];(c===null||c instanceof to)&&(u=!0,i=!1,o[d]=c)}if(u){if(typeof s=="object"&&s!==null)n=s;else if(typeof s<"u")throw new TypeError("'options' must be an object.")}else n=t}}else if(typeof t<"u")throw new TypeError("Unexpected argument[1]: must be 'fetches' or 'options'.");for(const u of this.inputNames)if(typeof r[u]>"u")throw new Error(`input '${u}' is missing in 'feeds'.`);if(i)for(const u of this.outputNames)o[u]=null;const a=await this.handler.run(r,o,n),l={};for(const u in a)if(Object.hasOwnProperty.call(a,u)){const p=a[u];p instanceof to?l[u]=p:l[u]=new to(p.type,p.data,p.dims)}return Iu(),l}async release(){return this.handler.dispose()}static async create(r,t,s,o){ku();let n,i={};if(typeof r=="string"){if(n=r,typeof t=="object"&&t!==null)i=t;else if(typeof t<"u")throw new TypeError("'options' must be an object.")}else if(r instanceof Uint8Array){if(n=r,typeof t=="object"&&t!==null)i=t;else if(typeof t<"u")throw new TypeError("'options' must be an object.")}else if(r instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&r instanceof SharedArrayBuffer){const p=r;let d=0,c=r.byteLength;if(typeof t=="object"&&t!==null)i=t;else if(typeof t=="number"){if(d=t,!Number.isSafeInteger(d))throw new RangeError("'byteOffset' must be an integer.");if(d<0||d>=p.byteLength)throw new RangeError(`'byteOffset' is out of range [0, ${p.byteLength}).`);if(c=r.byteLength-d,typeof s=="number"){if(c=s,!Number.isSafeInteger(c))throw new RangeError("'byteLength' must be an integer.");if(c<=0||d+c>p.byteLength)throw new RangeError(`'byteLength' is out of range (0, ${p.byteLength-d}].`);if(typeof o=="object"&&o!==null)i=o;else if(typeof o<"u")throw new TypeError("'options' must be an object.")}else if(typeof s<"u")throw new TypeError("'byteLength' must be a number.")}else if(typeof t<"u")throw new TypeError("'options' must be an object.");n=new Uint8Array(p,d,c)}else throw new TypeError("Unexpected argument[0]: must be 'path' or 'buffer'.");const[a,l]=await Mv(i),u=await a.createInferenceSessionHandler(n,l);return Iu(),new ib(u)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}};const Ov=Fv,Dv=Object.freeze(Object.defineProperty({__proto__:null,InferenceSession:Ov,TRACE:nb,TRACE_FUNC_BEGIN:ku,TRACE_FUNC_END:Iu,Tensor:to,env:vv,registerBackend:wv},Symbol.toStringTag,{value:"Module"}));/*! * ONNX Runtime Web v1.22.0-dev.20250409-89f8206ba4 * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. diff --git a/assets/chat-BKZ7zE82.js b/assets/chat-BKZ7zE82.js deleted file mode 100644 index 423b19ff73af93c633f367990aeb53766f574bd7..0000000000000000000000000000000000000000 --- a/assets/chat-BKZ7zE82.js +++ /dev/null @@ -1 +0,0 @@ -import{d as P,bG as W,r as S,c as h,o as y,a as i,G as C,bH as E,u as M,ag as A,bA as q,bB as z,x as D,i as U,t as $}from"./index-D3pfQUMu.js";import{s as H}from"./index-C4mUnpiM.js";import"./index-LHmcipjy.js";var O=()=>{let e=null;return{getStore:()=>(e===null&&console.warn("Woops! Looks like you are calling `getContext` after `await fn()`. Please move `getContext` to top level of handler."),e),run(r,o){e=r;try{return o()}finally{e=null}}}},K=new WeakMap,G=new WeakMap,I=0,T=0,_=e=>{const r=`${I++}`,o={include:t=>n.has(t),with:t=>{const d=`${T++}`,l={[Symbol.toStringTag]:`WorkflowEvent(${r}.${d})`,toString:()=>`WorkflowEvent(${r}.${d})`,toJSON:()=>({event:r,data:t}),get data(){return t}};return n.add(l),Object.freeze(l),G.set(l,o),l}},n=new WeakSet;return K.set(o,n),Object.defineProperty(o,Symbol.toStringTag,{get:()=>`WorkflowEvent<${r}>`}),Object.defineProperty(o,"displayName",{value:`WorkflowEvent<${r}>`}),o.toString=()=>`WorkflowEvent<${r}>`,Object.freeze(o),o},j=e=>e!=null&&typeof e=="object"&&"data"in e,F=e=>e!=null&&typeof e.then=="function";function R(e,r){const o=new Array(e.length);for(const n of r)for(let t=0;t{const r=[],o=(a,f,p)=>{let c;const g={get abortController(){return c||(c=new AbortController),c},handler:a,inputs:f,outputs:[],prev:p,next:new Set};g.prev.next.add(g);const v=d(g);J.run(g,()=>{const s=[...new Set([...x.__internal__call_context,...v.__internal__call_context])];N.run(v,()=>{let u=0;const b=()=>{if(u===s.length){let k;try{k=a(...f)}catch(m){if(c??l)(c??l).abort(m);else throw console.error("unhandled error in handler",m),m}F(k)?k.then(m=>{j(m)&&v.sendEvent(m)}):j(k)&&v.sendEvent(k)}const L=s[u];L&&(u++,L(v,f,b))};b()})})},n=a=>{const f=[...r];[...e].filter(([p])=>R(p,f).length===p.length).map(([p,c])=>{const g=R(p,f);g.forEach(v=>{r.splice(r.indexOf(v),1)});for(const v of c)o(v.handler,g,a)})},t=[],d=a=>({get stream(){let f;return new ReadableStream({start:async p=>{f=c=>{let g=B.get(c);for(;g;){if(g===a){p.enqueue(c);break}g=g.prev}},t.push(f)}})},get signal(){return a.abortController.signal},sendEvent:(...f)=>{f.forEach(p=>{B.set(p,a),a.outputs.push(p),r.push(p),t.forEach(c=>c(p)),n(a)})},__internal__call_context:new Set});let l=new AbortController;const x=d({get abortController(){return l||(l=new AbortController),l},inputs:[],outputs:[],handler:null,prev:null,next:new Set});return x};function X(){const e={steps:new Map};return{handle:(r,o)=>{if(e.steps.has(r)){const n=e.steps.get(r),t={get handler(){return o},unsubscribe:()=>{n.delete(t),n.size===0&&e.steps.delete(r)}};return n.add(t),t}else{const n=new Set,t={get handler(){return o},unsubscribe:()=>{n.delete(t),n.size===0&&e.steps.delete(r)}};return n.add(t),e.steps.set(r,n),t}},createContext(){return Q({listeners:e.steps})}}}async function Y(e,r,o){const{stream:n,sendEvent:t}=e.createContext();t(r);for await(const d of n)if(o.include(d))return d;throw new Error("Workflow did not return a stop event")}function Z(e,r){const o=(...n)=>{const t=r.filter(([w])=>w.every((x,a)=>x.include(n[a]))).map(([w,x])=>x),l=V().sendEvent;return(...w)=>{let x=!1;for(let a=0;ap.include(w[c]))){x=!0;break}}return x&&console.warn("Invalid input detected [%s]",w.map(a=>a.data).join(", ")),l(...w)}};return{...e,handle:(n,t)=>{const d=(...l)=>{const w=V();return t(w.safeSendEvent,...l)};return e.handle(n,d)},createContext(){const n=e.createContext();return n.__internal__call_context.add((t,d,l)=>{t.safeSendEvent=o(...d),l()}),n}}}const ee={flex:"","flex-col":"","gap-2":""},te={flex:"~ col","gap-2":""},ne={flex:"","flex-col":"","gap-2":""},re={grid:"","grid-cols-2":"","gap-2":""},oe={flex:"","items-center":"","gap-2":""},ae={flex:"","items-center":"","gap-2":""},le={flex:"","items-center":"","gap-2":""},se={key:0},ue={key:1},fe=P({__name:"chat",setup(e){const r=W("settings/llm/baseUrl","https://openrouter.ai/api/v1/"),o=W("settings/llm/apiKey",""),n=W("settings/llm/model","openai/gpt-4o-mini"),t=S(""),d=S([]),l=S({role:"assistant",content:""}),w=S(!1),x=_(),a=_(),f=_(),p=_(),c=_();async function g(){w.value=!0;try{const v=Z(X(),[[[x],[a,c]],[[a],[f]],[[f],[p]]]);v.handle([x],async s=>{l.value={role:"assistant",content:""},d.value.push({role:"user",content:t.value}),d.value.push(l.value);const u=await H({baseURL:r.value,apiKey:o.value,model:n.value,messages:d.value.slice(0,d.value.length-1).map(b=>D(b))});for await(const b of u.chunkStream)s(a.with(b.choices[0].delta.content||""));return c.with()}),v.handle([a],async(s,u)=>{l.value.content?l.value.content+=u.data:l.value.content=u.data}),await Y(v,x.with(),c)}catch(v){console.error(v)}finally{w.value=!1}}return(v,s)=>(y(),h("div",ee,[i("div",te,[i("div",ne,[s[7]||(s[7]=i("div",null,[i("span",{"text-neutral-500":"","dark:text-neutral-400":""},"LLM")],-1)),i("div",re,[i("label",oe,[s[4]||(s[4]=i("span",{"text-nowrap":""}," Base URL ",-1)),C(i("input",{"onUpdate:modelValue":s[0]||(s[0]=u=>A(r)?r.value=u:null),border:"focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800",transition:"all duration-200 ease-in-out",text:"disabled:neutral-400 dark:disabled:neutral-600",cursor:"disabled:not-allowed","w-full":"","rounded-lg":"","px-2":"","py-1":"","text-nowrap":"","text-sm":"","outline-none":"",shadow:"sm",bg:"neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900"},null,512),[[E,M(r)]])]),i("label",ae,[s[5]||(s[5]=i("span",{"text-nowrap":""}," API Key ",-1)),C(i("input",{"onUpdate:modelValue":s[1]||(s[1]=u=>A(o)?o.value=u:null),type:"password",border:"focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800",transition:"all duration-200 ease-in-out",text:"disabled:neutral-400 dark:disabled:neutral-600",cursor:"disabled:not-allowed","w-full":"","rounded-lg":"","px-2":"","py-1":"","text-nowrap":"","text-sm":"","outline-none":"",shadow:"sm",bg:"neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900"},null,512),[[E,M(o)]])]),i("label",le,[s[6]||(s[6]=i("span",{"text-nowrap":""}," Model ",-1)),C(i("input",{"onUpdate:modelValue":s[2]||(s[2]=u=>A(n)?n.value=u:null),border:"focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800",transition:"all duration-200 ease-in-out",text:"disabled:neutral-400 dark:disabled:neutral-600",cursor:"disabled:not-allowed","w-full":"","rounded-lg":"","px-2":"","py-1":"","text-nowrap":"","text-sm":"","outline-none":"",shadow:"sm",bg:"neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900"},null,512),[[E,M(n)]])])])]),i("div",null,[C(i("textarea",{"onUpdate:modelValue":s[3]||(s[3]=u=>t.value=u),border:"focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800",transition:"all duration-200 ease-in-out",text:"disabled:neutral-400 dark:disabled:neutral-600",cursor:"disabled:not-allowed","w-full":"","rounded-lg":"","px-2":"","py-1":"","text-nowrap":"","text-sm":"","outline-none":"",shadow:"sm",bg:"neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900"},null,512),[[E,t.value]])]),i("button",{"rounded-lg":"",bg:"blue-100 dark:blue-900","px-4":"","py-2":"",onClick:g}," Send "),i("div",null,[(y(!0),h(q,null,z(d.value,(u,b)=>(y(),h("div",{key:b},[u.role==="user"?(y(),h("div",se,[i("span",null,$(u.content),1)])):U("",!0),u.role==="assistant"?(y(),h("div",ue,[i("span",null,$(u.content),1)])):U("",!0)]))),128))])])]))}});export{fe as default}; diff --git a/assets/chat-CFaWDr1y.js b/assets/chat-CFaWDr1y.js new file mode 100644 index 0000000000000000000000000000000000000000..e4c20c231580265f40fbaff3037d755143c2bb88 --- /dev/null +++ b/assets/chat-CFaWDr1y.js @@ -0,0 +1 @@ +import{d as N,q as W,r as S,c as h,o as y,e as i,x as C,y as E,b as M,S as A,F as P,l as z,aH as D,j as U,t as $}from"./index-BNq7Hbz_.js";import{s as H}from"./index-C4mUnpiM.js";import"./index-LHmcipjy.js";var q=()=>{let e=null;return{getStore:()=>(e===null&&console.warn("Woops! Looks like you are calling `getContext` after `await fn()`. Please move `getContext` to top level of handler."),e),run(r,o){e=r;try{return o()}finally{e=null}}}},K=new WeakMap,F=new WeakMap,I=0,T=0,_=e=>{const r=`${I++}`,o={include:t=>n.has(t),with:t=>{const d=`${T++}`,l={[Symbol.toStringTag]:`WorkflowEvent(${r}.${d})`,toString:()=>`WorkflowEvent(${r}.${d})`,toJSON:()=>({event:r,data:t}),get data(){return t}};return n.add(l),Object.freeze(l),F.set(l,o),l}},n=new WeakSet;return K.set(o,n),Object.defineProperty(o,Symbol.toStringTag,{get:()=>`WorkflowEvent<${r}>`}),Object.defineProperty(o,"displayName",{value:`WorkflowEvent<${r}>`}),o.toString=()=>`WorkflowEvent<${r}>`,Object.freeze(o),o},j=e=>e!=null&&typeof e=="object"&&"data"in e,J=e=>e!=null&&typeof e.then=="function";function R(e,r){const o=new Array(e.length);for(const n of r)for(let t=0;t{const r=[],o=(a,f,p)=>{let c;const g={get abortController(){return c||(c=new AbortController),c},handler:a,inputs:f,outputs:[],prev:p,next:new Set};g.prev.next.add(g);const v=d(g);G.run(g,()=>{const s=[...new Set([...x.__internal__call_context,...v.__internal__call_context])];B.run(v,()=>{let u=0;const b=()=>{if(u===s.length){let k;try{k=a(...f)}catch(m){if(c??l)(c??l).abort(m);else throw console.error("unhandled error in handler",m),m}J(k)?k.then(m=>{j(m)&&v.sendEvent(m)}):j(k)&&v.sendEvent(k)}const L=s[u];L&&(u++,L(v,f,b))};b()})})},n=a=>{const f=[...r];[...e].filter(([p])=>R(p,f).length===p.length).map(([p,c])=>{const g=R(p,f);g.forEach(v=>{r.splice(r.indexOf(v),1)});for(const v of c)o(v.handler,g,a)})},t=[],d=a=>({get stream(){let f;return new ReadableStream({start:async p=>{f=c=>{let g=O.get(c);for(;g;){if(g===a){p.enqueue(c);break}g=g.prev}},t.push(f)}})},get signal(){return a.abortController.signal},sendEvent:(...f)=>{f.forEach(p=>{O.set(p,a),a.outputs.push(p),r.push(p),t.forEach(c=>c(p)),n(a)})},__internal__call_context:new Set});let l=new AbortController;const x=d({get abortController(){return l||(l=new AbortController),l},inputs:[],outputs:[],handler:null,prev:null,next:new Set});return x};function X(){const e={steps:new Map};return{handle:(r,o)=>{if(e.steps.has(r)){const n=e.steps.get(r),t={get handler(){return o},unsubscribe:()=>{n.delete(t),n.size===0&&e.steps.delete(r)}};return n.add(t),t}else{const n=new Set,t={get handler(){return o},unsubscribe:()=>{n.delete(t),n.size===0&&e.steps.delete(r)}};return n.add(t),e.steps.set(r,n),t}},createContext(){return Q({listeners:e.steps})}}}async function Y(e,r,o){const{stream:n,sendEvent:t}=e.createContext();t(r);for await(const d of n)if(o.include(d))return d;throw new Error("Workflow did not return a stop event")}function Z(e,r){const o=(...n)=>{const t=r.filter(([w])=>w.every((x,a)=>x.include(n[a]))).map(([w,x])=>x),l=V().sendEvent;return(...w)=>{let x=!1;for(let a=0;ap.include(w[c]))){x=!0;break}}return x&&console.warn("Invalid input detected [%s]",w.map(a=>a.data).join(", ")),l(...w)}};return{...e,handle:(n,t)=>{const d=(...l)=>{const w=V();return t(w.safeSendEvent,...l)};return e.handle(n,d)},createContext(){const n=e.createContext();return n.__internal__call_context.add((t,d,l)=>{t.safeSendEvent=o(...d),l()}),n}}}const ee={flex:"","flex-col":"","gap-2":""},te={flex:"~ col","gap-2":""},ne={flex:"","flex-col":"","gap-2":""},re={grid:"","grid-cols-2":"","gap-2":""},oe={flex:"","items-center":"","gap-2":""},ae={flex:"","items-center":"","gap-2":""},le={flex:"","items-center":"","gap-2":""},se={key:0},ue={key:1},fe=N({__name:"chat",setup(e){const r=W("settings/llm/baseUrl","https://openrouter.ai/api/v1/"),o=W("settings/llm/apiKey",""),n=W("settings/llm/model","openai/gpt-4o-mini"),t=S(""),d=S([]),l=S({role:"assistant",content:""}),w=S(!1),x=_(),a=_(),f=_(),p=_(),c=_();async function g(){w.value=!0;try{const v=Z(X(),[[[x],[a,c]],[[a],[f]],[[f],[p]]]);v.handle([x],async s=>{l.value={role:"assistant",content:""},d.value.push({role:"user",content:t.value}),d.value.push(l.value);const u=await H({baseURL:r.value,apiKey:o.value,model:n.value,messages:d.value.slice(0,d.value.length-1).map(b=>D(b))});for await(const b of u.chunkStream)s(a.with(b.choices[0].delta.content||""));return c.with()}),v.handle([a],async(s,u)=>{l.value.content?l.value.content+=u.data:l.value.content=u.data}),await Y(v,x.with(),c)}catch(v){console.error(v)}finally{w.value=!1}}return(v,s)=>(y(),h("div",ee,[i("div",te,[i("div",ne,[s[7]||(s[7]=i("div",null,[i("span",{"text-neutral-500":"","dark:text-neutral-400":""},"LLM")],-1)),i("div",re,[i("label",oe,[s[4]||(s[4]=i("span",{"text-nowrap":""}," Base URL ",-1)),C(i("input",{"onUpdate:modelValue":s[0]||(s[0]=u=>A(r)?r.value=u:null),border:"focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800",transition:"all duration-200 ease-in-out",text:"disabled:neutral-400 dark:disabled:neutral-600",cursor:"disabled:not-allowed","w-full":"","rounded-lg":"","px-2":"","py-1":"","text-nowrap":"","text-sm":"","outline-none":"",shadow:"sm",bg:"neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900"},null,512),[[E,M(r)]])]),i("label",ae,[s[5]||(s[5]=i("span",{"text-nowrap":""}," API Key ",-1)),C(i("input",{"onUpdate:modelValue":s[1]||(s[1]=u=>A(o)?o.value=u:null),type:"password",border:"focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800",transition:"all duration-200 ease-in-out",text:"disabled:neutral-400 dark:disabled:neutral-600",cursor:"disabled:not-allowed","w-full":"","rounded-lg":"","px-2":"","py-1":"","text-nowrap":"","text-sm":"","outline-none":"",shadow:"sm",bg:"neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900"},null,512),[[E,M(o)]])]),i("label",le,[s[6]||(s[6]=i("span",{"text-nowrap":""}," Model ",-1)),C(i("input",{"onUpdate:modelValue":s[2]||(s[2]=u=>A(n)?n.value=u:null),border:"focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800",transition:"all duration-200 ease-in-out",text:"disabled:neutral-400 dark:disabled:neutral-600",cursor:"disabled:not-allowed","w-full":"","rounded-lg":"","px-2":"","py-1":"","text-nowrap":"","text-sm":"","outline-none":"",shadow:"sm",bg:"neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900"},null,512),[[E,M(n)]])])])]),i("div",null,[C(i("textarea",{"onUpdate:modelValue":s[3]||(s[3]=u=>t.value=u),border:"focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800",transition:"all duration-200 ease-in-out",text:"disabled:neutral-400 dark:disabled:neutral-600",cursor:"disabled:not-allowed","w-full":"","rounded-lg":"","px-2":"","py-1":"","text-nowrap":"","text-sm":"","outline-none":"",shadow:"sm",bg:"neutral-100 dark:neutral-800 focus:neutral-50 dark:focus:neutral-900"},null,512),[[E,t.value]])]),i("button",{"rounded-lg":"",bg:"blue-100 dark:blue-900","px-4":"","py-2":"",onClick:g}," Send "),i("div",null,[(y(!0),h(P,null,z(d.value,(u,b)=>(y(),h("div",{key:b},[u.role==="user"?(y(),h("div",se,[i("span",null,$(u.content),1)])):U("",!0),u.role==="assistant"?(y(),h("div",ue,[i("span",null,$(u.content),1)])):U("",!0)]))),128))])])]))}});export{fe as default}; diff --git a/assets/cloudflare-workers-ai-BelZ37WY.js b/assets/cloudflare-workers-ai-BelZ37WY.js deleted file mode 100644 index de063422dcc1b94fcd4f8e051c11e28c4edca2d6..0000000000000000000000000000000000000000 --- a/assets/cloudflare-workers-ai-BelZ37WY.js +++ /dev/null @@ -1 +0,0 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-t8bgqiA6.js";import{d as V,bK as y,bL as K,m as I,o as h,u as l,k as M,h as $,s as q,l as v,f as x,w as P,E as f,b as c}from"./index-D3pfQUMu.js";import"./three-vrm-animation.module-DLbUhddZ.js";import"./emotions-CAex_2dA.js";import{u as z}from"./providers-CCvie00Z.js";/* empty css */import{_ as A}from"./FieldInput.vue_vue_type_script_setup_true_lang-Brkyubp9.js";import{_ as B}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-yC-Tsbbb.js";import{_ as C,a as N}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C8wZQWhG.js";import{_ as R}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-CRYYAVy7.js";import{b as k}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./Input.vue_vue_type_script_setup_true_lang-B223oRg0.js";const S=V({__name:"ProviderAccountIdInput",props:y({placeholder:null,required:{type:Boolean},label:null,description:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(p){const r=p,u=K(p,"modelValue");return(n,e)=>(h(),I(l(A),{modelValue:u.value,"onUpdate:modelValue":e[0]||(e[0]=t=>u.value=t),label:r.label||"Account ID",description:r.description||"Account ID",placeholder:r.placeholder,required:r.required,type:"text"},null,8,["modelValue","label","description","placeholder","required"]))}}),a="cloudflare-workers-ai",U=V({__name:"cloudflare-workers-ai",setup(p){const{t:r}=M(),u=$(),n=z(),{providers:e}=q(n),t=v(()=>n.getProviderMetadata(a)),s=v({get:()=>{var o;return((o=e.value[a])==null?void 0:o.apiKey)||""},set:o=>{e.value[a]||(e.value[a]={}),e.value[a].apiKey=o}}),d=v({get:()=>{var o;return((o=e.value[a])==null?void 0:o.accountId)||""},set:o=>{e.value[a]||(e.value[a]={}),e.value[a].accountId=o}});x(()=>{var o,i;n.initializeProvider(a),s.value=((o=e.value[a])==null?void 0:o.apiKey)||"",d.value=((i=e.value[a])==null?void 0:i.accountId)||""}),P([s,d],()=>{e.value[a]={...e.value[a],apiKey:s.value,accountId:d.value}});function w(){var o;e.value[a]={...(o=t.value)==null?void 0:o.defaultOptions}}return(o,i)=>{var _,b;return h(),I(l(R),{"provider-name":(_=t.value)==null?void 0:_.localizedName,"provider-icon-color":(b=t.value)==null?void 0:b.iconColor,"on-back":()=>l(u).back()},{default:f(()=>[c(l(C),null,{default:f(()=>[c(l(N),{title:l(r)("settings.pages.providers.common.section.basic.title"),description:l(r)("settings.pages.providers.common.section.basic.description"),"on-reset":w},{default:f(()=>{var g;return[c(l(B),{modelValue:s.value,"onUpdate:modelValue":i[0]||(i[0]=m=>s.value=m),"provider-name":(g=t.value)==null?void 0:g.localizedName,placeholder:l(r)("settings.pages.providers.provider.cloudflare-workers-ai.fields.field.api-key.placeholder")},null,8,["modelValue","provider-name","placeholder"]),c(l(S),{modelValue:d.value,"onUpdate:modelValue":i[1]||(i[1]=m=>d.value=m),label:l(r)("settings.pages.providers.provider.cloudflare-workers-ai.fields.field.account-id.label"),description:l(r)("settings.pages.providers.provider.cloudflare-workers-ai.fields.field.account-id.description"),placeholder:l(r)("settings.pages.providers.provider.cloudflare-workers-ai.fields.field.account-id.placeholder")},null,8,["modelValue","label","description","placeholder"])]}),_:1},8,["title","description"])]),_:1})]),_:1},8,["provider-name","provider-icon-color","on-back"])}}});typeof k=="function"&&k(U);export{U as default}; diff --git a/assets/cloudflare-workers-ai-DTBoU9aK.js b/assets/cloudflare-workers-ai-DTBoU9aK.js new file mode 100644 index 0000000000000000000000000000000000000000..6f67ebc8a500a79aac8c405d679f5c3f8ef51187 --- /dev/null +++ b/assets/cloudflare-workers-ai-DTBoU9aK.js @@ -0,0 +1 @@ +import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-B6whjTNv.js";import{d as k,m as y,u as M,A as I,o as h,b as l,g as $,U as q,s as x,h as v,H as K,v as A,w as f,i as c}from"./index-BNq7Hbz_.js";import"./three-vrm-animation.module-BPuMi1if.js";import"./mcp-D2taTyhO.js";import"./mini_xsschema-P_8cZcRg.js";import{u as P}from"./providers-Ddg6LLwH.js";/* empty css */import{_ as U}from"./FieldInput.vue_vue_type_script_setup_true_lang-IanARj3w.js";import{_ as z}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-8yNUgi8_.js";import{_ as B,a as C}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C-W-PZMl.js";import{_ as N}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-kCkYL1sn.js";import{b as V}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./Input.vue_vue_type_script_setup_true_lang-1pgLpBi1.js";const R=k({__name:"ProviderAccountIdInput",props:y({placeholder:null,required:{type:Boolean},label:null,description:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(p){const r=p,u=M(p,"modelValue");return(n,e)=>(h(),I(l(U),{modelValue:u.value,"onUpdate:modelValue":e[0]||(e[0]=t=>u.value=t),label:r.label||"Account ID",description:r.description||"Account ID",placeholder:r.placeholder,required:r.required,type:"text"},null,8,["modelValue","label","description","placeholder","required"]))}}),a="cloudflare-workers-ai",S=k({__name:"cloudflare-workers-ai",setup(p){const{t:r}=$(),u=q(),n=P(),{providers:e}=x(n),t=v(()=>n.getProviderMetadata(a)),s=v({get:()=>{var o;return((o=e.value[a])==null?void 0:o.apiKey)||""},set:o=>{e.value[a]||(e.value[a]={}),e.value[a].apiKey=o}}),d=v({get:()=>{var o;return((o=e.value[a])==null?void 0:o.accountId)||""},set:o=>{e.value[a]||(e.value[a]={}),e.value[a].accountId=o}});K(()=>{var o,i;n.initializeProvider(a),s.value=((o=e.value[a])==null?void 0:o.apiKey)||"",d.value=((i=e.value[a])==null?void 0:i.accountId)||""}),A([s,d],()=>{e.value[a]={...e.value[a],apiKey:s.value,accountId:d.value}});function w(){var o;e.value[a]={...(o=t.value)==null?void 0:o.defaultOptions}}return(o,i)=>{var _,g;return h(),I(l(N),{"provider-name":(_=t.value)==null?void 0:_.localizedName,"provider-icon-color":(g=t.value)==null?void 0:g.iconColor,"on-back":()=>l(u).back()},{default:f(()=>[c(l(B),null,{default:f(()=>[c(l(C),{title:l(r)("settings.pages.providers.common.section.basic.title"),description:l(r)("settings.pages.providers.common.section.basic.description"),"on-reset":w},{default:f(()=>{var b;return[c(l(z),{modelValue:s.value,"onUpdate:modelValue":i[0]||(i[0]=m=>s.value=m),"provider-name":(b=t.value)==null?void 0:b.localizedName,placeholder:l(r)("settings.pages.providers.provider.cloudflare-workers-ai.fields.field.api-key.placeholder")},null,8,["modelValue","provider-name","placeholder"]),c(l(R),{modelValue:d.value,"onUpdate:modelValue":i[1]||(i[1]=m=>d.value=m),label:l(r)("settings.pages.providers.provider.cloudflare-workers-ai.fields.field.account-id.label"),description:l(r)("settings.pages.providers.provider.cloudflare-workers-ai.fields.field.account-id.description"),placeholder:l(r)("settings.pages.providers.provider.cloudflare-workers-ai.fields.field.account-id.placeholder")},null,8,["modelValue","label","description","placeholder"])]}),_:1},8,["title","description"])]),_:1})]),_:1},8,["provider-name","provider-icon-color","on-back"])}}});typeof V=="function"&&V(S);export{S as default}; diff --git a/assets/consciousness-BV44f_Xl.js b/assets/consciousness-BV44f_Xl.js new file mode 100644 index 0000000000000000000000000000000000000000..69c17c810cda790cbf8c38ed09d4b6306aaea89b --- /dev/null +++ b/assets/consciousness-BV44f_Xl.js @@ -0,0 +1 @@ +import{p as P,q as n,r as M,h as r,v as L}from"./index-BNq7Hbz_.js";import{u as w}from"./providers-Ddg6LLwH.js";const h=P("consciousness",()=>{const o=w(),s=n("settings/consciousness/active-provider",""),c=n("settings/consciousness/active-model",""),d=n("settings/consciousness/active-custom-model",""),l=M({}),i=M(""),m=r(()=>{var e;return((e=o.getProviderMetadata(s.value))==null?void 0:e.capabilities.listModels)!==void 0}),a=r(()=>o.getModelsForProvider(s.value)),p=r(()=>o.isLoadingModels[s.value]||!1),f=r(()=>o.modelLoadError[s.value]||null),g=r(()=>{if(!i.value.trim())return a.value;const e=i.value.toLowerCase().trim();return a.value.filter(t=>t.name.toLowerCase().includes(e)||t.id.toLowerCase().includes(e)||t.description&&t.description.toLowerCase().includes(e))});function u(){c.value="",d.value="",l.value={},i.value=""}async function v(e){var t;e&&((t=o.getProviderMetadata(s.value))==null?void 0:t.capabilities.listModels)!==void 0&&o.getModelsForProvider(e).length===0&&await o.fetchModelsForProvider(e)}return L(s,async e=>{await v(e),u()}),{activeProvider:s,activeModel:c,customModelName:d,expandedDescriptions:l,modelSearchQuery:i,supportsModelListing:m,providerModels:a,isLoadingActiveProviderModels:p,activeProviderModelError:f,filteredModels:g,resetModelSelection:u,loadModelsForProvider:v}});export{h as u}; diff --git a/assets/consciousness-Ce8qJ0rp.js b/assets/consciousness-Ce8qJ0rp.js new file mode 100644 index 0000000000000000000000000000000000000000..5b21d2e449224136166e731cb8491b3b5d02283b --- /dev/null +++ b/assets/consciousness-Ce8qJ0rp.js @@ -0,0 +1 @@ +import{d as R,s as h,g as U,H as z,K as B,c as r,o as n,e,x as b,j as f,t as i,b as s,F as k,l as D,i as j,w as q,Q as F,A as y,S as u,y as Q}from"./index-BNq7Hbz_.js";import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-B6whjTNv.js";import"./three-vrm-animation.module-BPuMi1if.js";import"./mcp-D2taTyhO.js";import"./mini_xsschema-P_8cZcRg.js";import{u as T}from"./consciousness-BV44f_Xl.js";import{u as A}from"./providers-Ddg6LLwH.js";/* empty css */import{R as E,a as G}from"./RadioCardSimple-DTOaU_HK.js";import{b as M}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BlPB-gCV.js";import"./Input.vue_vue_type_script_setup_true_lang-1pgLpBi1.js";const H={bg:"neutral-50 dark:[rgba(0,0,0,0.3)]","rounded-xl":"","p-4":"",flex:"~ col gap-4"},I={flex:"~ col gap-4"},K={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-500"},J={text:"neutral-400 dark:neutral-400"},O={"max-w-full":""},W={key:0,flex:"~ row gap-4",style:{"scrollbar-width":"none"},"min-w-0":"","of-x-scroll":"","scroll-smooth":"",role:"radiogroup"},X={key:1},Y={key:0},Z={flex:"~ col gap-4"},$={class:"text-lg md:text-2xl"},ee={text:"neutral-400 dark:neutral-400"},se={key:0,class:"flex items-center justify-center py-4"},te={key:1,class:"flex items-center gap-3 border border-red-200 rounded-lg bg-red-50 p-4 dark:border-red-800 dark:bg-red-900/20"},oe={class:"flex flex-col"},ie={class:"font-medium"},ne={class:"text-sm text-red-600 dark:text-red-400"},le={key:2,class:"flex items-center gap-3 border border-amber-200 rounded-lg bg-amber-50 p-4 dark:border-amber-800 dark:bg-amber-900/20"},re={class:"flex flex-col"},de={class:"font-medium"},ae={class:"text-sm text-amber-600 dark:text-amber-400"},ce={key:1},ue={flex:"~ col gap-4"},pe={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},me={text:"neutral-400 dark:neutral-500"},xe={class:"bg-primary-50 border-primary-200 dark:bg-primary-900/20 dark:border-primary-800 flex items-center gap-3 border rounded-lg p-4"},ve={class:"flex flex-col"},ge={class:"font-medium"},_e={class:"dark:text-primary-400 text-primary-600 text-sm"},he={class:"mt-2"},be={class:"mb-1 block text-sm font-medium"},fe=["placeholder"],ke={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":""},ye=R({__name:"consciousness",setup(Me){const w=A(),m=T(),{availableProviders:V,availableTextGenerationsProvidersMetadata:C}=h(w),{activeProvider:d,activeModel:a,customModelName:S,modelSearchQuery:c,supportsModelListing:x,providerModels:p,isLoadingActiveProviderModels:v,activeProviderModelError:g}=h(m),{t}=U();z(async()=>{await m.loadModelsForProvider(d.value)});function P(_){S.value=_}return(_,o)=>{const N=B("motion");return n(),r(k,null,[e("div",H,[e("div",null,[e("div",I,[e("div",null,[e("h2",K,i(s(t)("settings.pages.providers.title")),1),e("div",J,[e("span",null,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.description")),1)])]),e("div",O,[s(V).length>0?(n(),r("fieldset",W,[(n(!0),r(k,null,D(s(C),l=>(n(),y(s(G),{id:l.id,key:l.id,modelValue:s(d),"onUpdate:modelValue":o[0]||(o[0]=L=>u(d)?d.value=L:null),name:"provider",value:l.id,title:l.localizedName,description:l.localizedDescription},null,8,["id","modelValue","value","title","description"]))),128))])):(n(),r("div",X,[j(s(F),{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:q(()=>o[4]||(o[4]=[e("div",{"i-solar:warning-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1),e("div",{class:"flex flex-col"},[e("span",{class:"font-medium"},"No Providers Configured"),e("span",{class:"text-sm text-neutral-400 dark:text-neutral-500"},"Click here to set up your LLM providers")],-1),e("div",{"i-solar:arrow-right-line-duotone":"",class:"ml-auto text-xl text-neutral-400 dark:text-neutral-500"},null,-1)])),_:1})]))])])]),s(d)&&s(x)?(n(),r("div",Y,[e("div",Z,[e("div",null,[e("h2",$,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.title")),1),e("div",ee,[e("span",null,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle")),1)])]),s(v)?(n(),r("div",se,[o[5]||(o[5]=e("div",{class:"mr-2 animate-spin"},[e("div",{"i-solar:spinner-line-duotone":"","text-xl":""})],-1)),e("span",null,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.loading")),1)])):s(g)?(n(),r("div",te,[o[6]||(o[6]=e("div",{"i-solar:close-circle-line-duotone":"",class:"text-2xl text-red-500 dark:text-red-400"},null,-1)),e("div",oe,[e("span",ie,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.error")),1),e("span",ne,i(s(g)),1)])])):s(p).length===0&&!s(v)?(n(),r("div",le,[o[7]||(o[7]=e("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1)),e("div",re,[e("span",de,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models")),1),e("span",ae,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models_description")),1)])])):s(p).length>0?(n(),y(s(E),{key:3,modelValue:s(a),"onUpdate:modelValue":o[1]||(o[1]=l=>u(a)?a.value=l:null),"search-query":s(c),"onUpdate:searchQuery":o[2]||(o[2]=l=>u(c)?c.value=l:null),items:s(p),searchable:!0,"search-placeholder":s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.search_placeholder"),"search-no-results-title":s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results"),"search-no-results-description":s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results_description",{query:s(c)}),"search-results-text":s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.search_results",{count:"{count}",total:"{total}"}),"custom-input-placeholder":s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.custom_model_placeholder"),"expand-button-text":s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.expand"),"collapse-button-text":s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.collapse"),"onUpdate:customValue":P},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"])):f("",!0)])])):s(d)&&!s(x)?(n(),r("div",ce,[e("div",ue,[e("div",null,[e("h2",pe,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.title")),1),e("div",me,[e("span",null,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle")),1)])]),e("div",xe,[o[8]||(o[8]=e("div",{"i-solar:info-circle-line-duotone":"",class:"text-primary-500 dark:text-primary-400 text-2xl"},null,-1)),e("div",ve,[e("span",ge,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.not_supported")),1),e("span",_e,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.not_supported_description")),1)])]),e("div",he,[e("label",be,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.manual_model_name")),1),b(e("input",{"onUpdate:modelValue":o[3]||(o[3]=l=>u(a)?a.value=l: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:s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.manual_model_placeholder")},null,8,fe),[[Q,s(a)]])])])])):f("",!0)]),b((n(),r("div",ke,o[9]||(o[9]=[e("div",{text:"60","i-solar:ghost-bold-duotone":""},null,-1)]))),[[N]])],64)}}});typeof M=="function"&&M(ye);export{ye as default}; diff --git a/assets/consciousness-DynZMlUo.js b/assets/consciousness-DynZMlUo.js deleted file mode 100644 index 60981debd0873a471550be5ab523b3628206bca8..0000000000000000000000000000000000000000 --- a/assets/consciousness-DynZMlUo.js +++ /dev/null @@ -1 +0,0 @@ -import{v as P,bG as n,r as M,l as r,w as L}from"./index-D3pfQUMu.js";import{u as w}from"./providers-CCvie00Z.js";const h=P("consciousness",()=>{const o=w(),s=n("settings/consciousness/active-provider",""),c=n("settings/consciousness/active-model",""),d=n("settings/consciousness/active-custom-model",""),l=M({}),i=M(""),m=r(()=>{var e;return((e=o.getProviderMetadata(s.value))==null?void 0:e.capabilities.listModels)!==void 0}),a=r(()=>o.getModelsForProvider(s.value)),p=r(()=>o.isLoadingModels[s.value]||!1),f=r(()=>o.modelLoadError[s.value]||null),g=r(()=>{if(!i.value.trim())return a.value;const e=i.value.toLowerCase().trim();return a.value.filter(t=>t.name.toLowerCase().includes(e)||t.id.toLowerCase().includes(e)||t.description&&t.description.toLowerCase().includes(e))});function u(){c.value="",d.value="",l.value={},i.value=""}async function v(e){var t;e&&((t=o.getProviderMetadata(s.value))==null?void 0:t.capabilities.listModels)!==void 0&&o.getModelsForProvider(e).length===0&&await o.fetchModelsForProvider(e)}return L(s,async e=>{await v(e),u()}),{activeProvider:s,activeModel:c,customModelName:d,expandedDescriptions:l,modelSearchQuery:i,supportsModelListing:m,providerModels:a,isLoadingActiveProviderModels:p,activeProviderModelError:f,filteredModels:g,resetModelSelection:u,loadModelsForProvider:v}});export{h as u}; diff --git a/assets/consciousness-tp80ZbML.js b/assets/consciousness-tp80ZbML.js deleted file mode 100644 index b5c744f40e1749b716d3a0ef3096ae9f0860c4a3..0000000000000000000000000000000000000000 --- a/assets/consciousness-tp80ZbML.js +++ /dev/null @@ -1 +0,0 @@ -import{d as R,s as b,k as z,f as B,bz as U,c as r,o as n,a as e,G as h,i as f,t as i,u as s,bA as k,bB as D,b as q,E,br as T,m as y,ag as u,bH as j}from"./index-D3pfQUMu.js";import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-t8bgqiA6.js";import"./three-vrm-animation.module-DLbUhddZ.js";import"./emotions-CAex_2dA.js";import{u as A}from"./consciousness-DynZMlUo.js";import{u as F}from"./providers-CCvie00Z.js";/* empty css */import{R as G,a as Q}from"./RadioCardSimple-DtKqsojA.js";import{b as M}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-D_DUmSTM.js";import"./Input.vue_vue_type_script_setup_true_lang-B223oRg0.js";const H={bg:"neutral-50 dark:[rgba(0,0,0,0.3)]","rounded-xl":"","p-4":"",flex:"~ col gap-4"},I={flex:"~ col gap-4"},J={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-500"},K={text:"neutral-400 dark:neutral-400"},O={"max-w-full":""},W={key:0,flex:"~ row gap-4",style:{"scrollbar-width":"none"},"min-w-0":"","of-x-scroll":"","scroll-smooth":"",role:"radiogroup"},X={key:1},Y={key:0},Z={flex:"~ col gap-4"},$={class:"text-lg md:text-2xl"},ee={text:"neutral-400 dark:neutral-400"},se={key:0,class:"flex items-center justify-center py-4"},te={key:1,class:"flex items-center gap-3 border border-red-200 rounded-lg bg-red-50 p-4 dark:border-red-800 dark:bg-red-900/20"},oe={class:"flex flex-col"},ie={class:"font-medium"},ne={class:"text-sm text-red-600 dark:text-red-400"},le={key:2,class:"flex items-center gap-3 border border-amber-200 rounded-lg bg-amber-50 p-4 dark:border-amber-800 dark:bg-amber-900/20"},re={class:"flex flex-col"},de={class:"font-medium"},ae={class:"text-sm text-amber-600 dark:text-amber-400"},ce={key:1},ue={flex:"~ col gap-4"},pe={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},me={text:"neutral-400 dark:neutral-500"},xe={class:"bg-primary-50 border-primary-200 dark:bg-primary-900/20 dark:border-primary-800 flex items-center gap-3 border rounded-lg p-4"},ve={class:"flex flex-col"},ge={class:"font-medium"},_e={class:"dark:text-primary-400 text-primary-600 text-sm"},be={class:"mt-2"},he={class:"mb-1 block text-sm font-medium"},fe=["placeholder"],ke={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":""},ye=R({__name:"consciousness",setup(Me){const w=F(),m=A(),{availableProviders:V,availableTextGenerationsProvidersMetadata:C}=b(w),{activeProvider:d,activeModel:a,customModelName:P,modelSearchQuery:c,supportsModelListing:x,providerModels:p,isLoadingActiveProviderModels:v,activeProviderModelError:g}=b(m),{t}=z();B(async()=>{await m.loadModelsForProvider(d.value)});function S(_){P.value=_}return(_,o)=>{const N=U("motion");return n(),r(k,null,[e("div",H,[e("div",null,[e("div",I,[e("div",null,[e("h2",J,i(s(t)("settings.pages.providers.title")),1),e("div",K,[e("span",null,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.description")),1)])]),e("div",O,[s(V).length>0?(n(),r("fieldset",W,[(n(!0),r(k,null,D(s(C),l=>(n(),y(s(Q),{id:l.id,key:l.id,modelValue:s(d),"onUpdate:modelValue":o[0]||(o[0]=L=>u(d)?d.value=L:null),name:"provider",value:l.id,title:l.localizedName,description:l.localizedDescription},null,8,["id","modelValue","value","title","description"]))),128))])):(n(),r("div",X,[q(s(T),{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:E(()=>o[4]||(o[4]=[e("div",{"i-solar:warning-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1),e("div",{class:"flex flex-col"},[e("span",{class:"font-medium"},"No Providers Configured"),e("span",{class:"text-sm text-neutral-400 dark:text-neutral-500"},"Click here to set up your LLM providers")],-1),e("div",{"i-solar:arrow-right-line-duotone":"",class:"ml-auto text-xl text-neutral-400 dark:text-neutral-500"},null,-1)])),_:1})]))])])]),s(d)&&s(x)?(n(),r("div",Y,[e("div",Z,[e("div",null,[e("h2",$,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.title")),1),e("div",ee,[e("span",null,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle")),1)])]),s(v)?(n(),r("div",se,[o[5]||(o[5]=e("div",{class:"mr-2 animate-spin"},[e("div",{"i-solar:spinner-line-duotone":"","text-xl":""})],-1)),e("span",null,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.loading")),1)])):s(g)?(n(),r("div",te,[o[6]||(o[6]=e("div",{"i-solar:close-circle-line-duotone":"",class:"text-2xl text-red-500 dark:text-red-400"},null,-1)),e("div",oe,[e("span",ie,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.error")),1),e("span",ne,i(s(g)),1)])])):s(p).length===0&&!s(v)?(n(),r("div",le,[o[7]||(o[7]=e("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1)),e("div",re,[e("span",de,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models")),1),e("span",ae,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models_description")),1)])])):s(p).length>0?(n(),y(s(G),{key:3,modelValue:s(a),"onUpdate:modelValue":o[1]||(o[1]=l=>u(a)?a.value=l:null),"search-query":s(c),"onUpdate:searchQuery":o[2]||(o[2]=l=>u(c)?c.value=l:null),items:s(p),searchable:!0,"search-placeholder":s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.search_placeholder"),"search-no-results-title":s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results"),"search-no-results-description":s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results_description",{query:s(c)}),"search-results-text":s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.search_results",{count:"{count}",total:"{total}"}),"custom-input-placeholder":s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.custom_model_placeholder"),"expand-button-text":s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.expand"),"collapse-button-text":s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.collapse"),"onUpdate:customValue":S},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"])):f("",!0)])])):s(d)&&!s(x)?(n(),r("div",ce,[e("div",ue,[e("div",null,[e("h2",pe,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.title")),1),e("div",me,[e("span",null,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle")),1)])]),e("div",xe,[o[8]||(o[8]=e("div",{"i-solar:info-circle-line-duotone":"",class:"text-primary-500 dark:text-primary-400 text-2xl"},null,-1)),e("div",ve,[e("span",ge,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.not_supported")),1),e("span",_e,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.not_supported_description")),1)])]),e("div",be,[e("label",he,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.manual_model_name")),1),h(e("input",{"onUpdate:modelValue":o[3]||(o[3]=l=>u(a)?a.value=l: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:s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.manual_model_placeholder")},null,8,fe),[[j,s(a)]])])])])):f("",!0)]),h((n(),r("div",ke,o[9]||(o[9]=[e("div",{text:"60","i-solar:ghost-bold-duotone":""},null,-1)]))),[[N]])],64)}}});typeof M=="function"&&M(ye);export{ye as default}; diff --git a/assets/deepseek-BW4eoDhy.js b/assets/deepseek-BW4eoDhy.js new file mode 100644 index 0000000000000000000000000000000000000000..6fbaa893c641a6604f0212bcfb7e5fbdd8feb0e7 --- /dev/null +++ b/assets/deepseek-BW4eoDhy.js @@ -0,0 +1 @@ +import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-B6whjTNv.js";import{d as U,g as V,U as y,s as $,h as c,H as K,v as h,A as w,o as x,w as u,i as l,b as t}from"./index-BNq7Hbz_.js";import"./three-vrm-animation.module-BPuMi1if.js";import"./mcp-D2taTyhO.js";import"./mini_xsschema-P_8cZcRg.js";import{u as z}from"./providers-Ddg6LLwH.js";/* empty css */import{_ as C,a as M}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DETFnj2t.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-8yNUgi8_.js";import{_ as P,a as R}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C-W-PZMl.js";import{_ as S}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-kCkYL1sn.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-IiDV8qQX.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BlPB-gCV.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-IanARj3w.js";import"./Input.vue_vue_type_script_setup_true_lang-1pgLpBi1.js";const a="deepseek",B=U({__name:"deepseek",setup(I){const{t:m}=V(),b=y(),d=z(),{providers:o}=$(d),n=c(()=>d.getProviderMetadata(a)),r=c({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),s=c({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});K(()=>{var e,i;d.initializeProvider(a),r.value=((e=o.value[a])==null?void 0:e.apiKey)||"",s.value=((i=o.value[a])==null?void 0:i.baseUrl)||""}),h([r,s],()=>{o.value[a]={...o.value[a],apiKey:r.value,baseUrl:s.value||""}});function g(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var v,f;return x(),w(t(S),{"provider-name":(v=n.value)==null?void 0:v.localizedName,"provider-icon-color":(f=n.value)==null?void 0:f.iconColor,"on-back":()=>t(b).back()},{default:u(()=>[l(t(P),null,{default:u(()=>[l(t(R),{title:t(m)("settings.pages.providers.common.section.basic.title"),description:t(m)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:u(()=>{var p;return[l(t(N),{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=k=>r.value=k),"provider-name":(p=n.value)==null?void 0:p.localizedName,placeholder:"sk-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(C),{title:t(m)("settings.pages.providers.common.section.advanced.title")},{default:u(()=>[l(t(M),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=p=>s.value=p),placeholder:"https://api.deepseek.com/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon-color","on-back"])}}});typeof _=="function"&&_(B);export{B as default}; diff --git a/assets/deepseek-CYpdpBQ2.js b/assets/deepseek-CYpdpBQ2.js deleted file mode 100644 index a15577af73ae7c36b42551481c38e3b6cb99c65c..0000000000000000000000000000000000000000 --- a/assets/deepseek-CYpdpBQ2.js +++ /dev/null @@ -1 +0,0 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-t8bgqiA6.js";import{d as U,k as V,h as y,s as $,l as c,f as K,w as h,m as w,o as x,E as u,b as l,u as t}from"./index-D3pfQUMu.js";import"./three-vrm-animation.module-DLbUhddZ.js";import"./emotions-CAex_2dA.js";import{u as z}from"./providers-CCvie00Z.js";/* empty css */import{_ as C,a as M}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Qp-g_fu5.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-yC-Tsbbb.js";import{_ as P,a as R}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C8wZQWhG.js";import{_ as S}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-CRYYAVy7.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-DDNOeGH3.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-D_DUmSTM.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-Brkyubp9.js";import"./Input.vue_vue_type_script_setup_true_lang-B223oRg0.js";const a="deepseek",B=U({__name:"deepseek",setup(I){const{t:m}=V(),b=y(),d=z(),{providers:o}=$(d),n=c(()=>d.getProviderMetadata(a)),s=c({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),i=c({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});K(()=>{var e,r;d.initializeProvider(a),s.value=((e=o.value[a])==null?void 0:e.apiKey)||"",i.value=((r=o.value[a])==null?void 0:r.baseUrl)||""}),h([s,i],()=>{o.value[a]={...o.value[a],apiKey:s.value,baseUrl:i.value||""}});function k(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,r)=>{var v,f;return x(),w(t(S),{"provider-name":(v=n.value)==null?void 0:v.localizedName,"provider-icon-color":(f=n.value)==null?void 0:f.iconColor,"on-back":()=>t(b).back()},{default:u(()=>[l(t(P),null,{default:u(()=>[l(t(R),{title:t(m)("settings.pages.providers.common.section.basic.title"),description:t(m)("settings.pages.providers.common.section.basic.description"),"on-reset":k},{default:u(()=>{var p;return[l(t(N),{modelValue:s.value,"onUpdate:modelValue":r[0]||(r[0]=g=>s.value=g),"provider-name":(p=n.value)==null?void 0:p.localizedName,placeholder:"sk-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(C),{title:t(m)("settings.pages.providers.common.section.advanced.title")},{default:u(()=>[l(t(M),{modelValue:i.value,"onUpdate:modelValue":r[1]||(r[1]=p=>i.value=p),placeholder:"https://api.deepseek.com/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon-color","on-back"])}}});typeof _=="function"&&_(B);export{B as default}; diff --git a/assets/default-BpwML_61.js b/assets/default-BpwML_61.js new file mode 100644 index 0000000000000000000000000000000000000000..8265ced7d40f1ba12775f18c4e72218699c074b5 --- /dev/null +++ b/assets/default-BpwML_61.js @@ -0,0 +1 @@ +import{d as t,c as s,e,i as a,b as o,R as n,o as p}from"./index-BNq7Hbz_.js";import{H as d}from"./HeaderLink-nC9K3Z33.js";const i={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)"}},r={class:"px-0 py-1 md:px-3 md:py-3","w-full":"","gap-2":"",bg:"$bg-color"},c={class:"px-3 py-2 md:px-5 md:py-5",flex:"~ col","mx-auto":"","max-w-screen-xl":""},g=t({__name:"default",setup(m){return(f,l)=>(p(),s("div",i,[e("div",r,[a(d)]),e("div",c,[a(o(n))])]))}});export{g as default}; diff --git a/assets/default-DzFYMGHe.js b/assets/default-DzFYMGHe.js deleted file mode 100644 index 3f7eb525cccb26d46286bcecc0191e6a12c1e0c5..0000000000000000000000000000000000000000 --- a/assets/default-DzFYMGHe.js +++ /dev/null @@ -1 +0,0 @@ -import{d as t,c as s,a as e,b as a,u as o,R as n,o as p}from"./index-D3pfQUMu.js";import{H as d}from"./HeaderLink-SBXLiv0n.js";const r={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)"}},i={class:"px-0 py-1 md:px-3 md:py-3","w-full":"","gap-2":"",bg:"$bg-color"},c={class:"px-3 py-2 md:px-5 md:py-5",flex:"~ col","mx-auto":"","max-w-screen-xl":""},u=t({__name:"default",setup(m){return(f,l)=>(p(),s("div",r,[e("div",i,[a(d)]),e("div",c,[a(o(n))])]))}});export{u as default}; diff --git a/assets/default-node-DRO9_bbw.js b/assets/default-node-DRO9_bbw.js deleted file mode 100644 index 3b44470309645a61084595768f0ae6eeb9c91cea..0000000000000000000000000000000000000000 --- a/assets/default-node-DRO9_bbw.js +++ /dev/null @@ -1 +0,0 @@ -import{ch as t}from"./index-D3pfQUMu.js";async function s(){const{createRequire:a}=await t(async()=>{const{createRequire:o}=await import("./__vite-browser-external-FmFgRqLi.js");return{createRequire:o}},[]),{dirname:n,resolve:e}=await t(async()=>{const{dirname:o,resolve:c}=await import("./__vite-browser-external-FmFgRqLi.js");return{dirname:o,resolve:c}},[]),d=a(import.meta.url),r=n(d.resolve("@duckdb/duckdb-wasm"));return{mvp:{mainModule:e(r,"./duckdb-mvp.wasm"),mainWorker:e(r,"./duckdb-node-mvp.worker.cjs")},eh:{mainModule:e(r,"./duckdb-eh.wasm"),mainWorker:e(r,"./duckdb-node-eh.worker.cjs")}}}export{s as getBundles}; diff --git a/assets/default-node-Dkg9OG4q.js b/assets/default-node-Dkg9OG4q.js new file mode 100644 index 0000000000000000000000000000000000000000..161318f08e94682f30cbe1102f2a7a55d11167af --- /dev/null +++ b/assets/default-node-Dkg9OG4q.js @@ -0,0 +1 @@ +import{L as t}from"./index-BNq7Hbz_.js";async function s(){const{createRequire:a}=await t(async()=>{const{createRequire:o}=await import("./__vite-browser-external-FmFgRqLi.js");return{createRequire:o}},[]),{dirname:n,resolve:e}=await t(async()=>{const{dirname:o,resolve:i}=await import("./__vite-browser-external-FmFgRqLi.js");return{dirname:o,resolve:i}},[]),d=a(import.meta.url),r=n(d.resolve("@duckdb/duckdb-wasm"));return{mvp:{mainModule:e(r,"./duckdb-mvp.wasm"),mainWorker:e(r,"./duckdb-node-mvp.worker.cjs")},eh:{mainModule:e(r,"./duckdb-eh.wasm"),mainWorker:e(r,"./duckdb-node-eh.worker.cjs")}}}export{s as getBundles}; diff --git a/assets/delays-BI9nYLvl.js b/assets/delays-BI9nYLvl.js new file mode 100644 index 0000000000000000000000000000000000000000..696eb37e9a1b45fed4a5d859668581b5356b851a --- /dev/null +++ b/assets/delays-BI9nYLvl.js @@ -0,0 +1 @@ +import"./index-BVssmUEI.js";import{u as g,l as _}from"./queues-yzb6LxwZ.js";import"./three-vrm-animation.module-BPuMi1if.js";/* empty css */import{_ as k}from"./Textarea.vue_vue_type_script_setup_true_lang-DVhP8J-8.js";import{d as b,r,c as n,o as t,e,i as y,b as x,t as i,F as f,l as m}from"./index-BNq7Hbz_.js";import"./mini_xsschema-P_8cZcRg.js";import"./queue-Bkpr_I5o.js";import"./Basic.vue_vue_type_script_setup_true_lang-DiEujAxb.js";const w={flex:"","flex-col":"","gap-2":"","p-2":""},h={flex:"","flex-row":"","gap-2":""},M={"rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-4":""},V={"w-full":"",flex:"","flex-row":"","gap-4":""},E={"w-full":"","rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-2":""},S={"w-full":"","rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-2":""},T=b({__name:"delays",setup(B){const s=r(""),c=r([]),p=r([]),u=r(!1),d=g();d.onHandlerEvent("delay",a=>{p.value.push(a)});function v(){u.value=!0;const a=s.value.split("");for(const o of a)d.add(o);d.add(_),s.value="",u.value=!1}return(a,o)=>(t(),n("div",w,[e("div",h,[y(x(k),{modelValue:s.value,"onUpdate:modelValue":o[0]||(o[0]=l=>s.value=l),placeholder:"Message",p:"2",bg:"neutral-100 dark:neutral-700","w-full":"","rounded-lg":"","outline-none":"",onSubmit:v},null,8,["modelValue"]),e("button",M,i(u.value?"Processing...":"Send"),1)]),e("div",V,[e("div",E,[o[1]||(o[1]=e("h3",{"font-semibold":""}," Emotion Message ",-1)),(t(!0),n(f,null,m(c.value,l=>(t(),n("div",{key:l},[e("div",null,i(l),1)]))),128))]),e("div",S,[o[2]||(o[2]=e("h3",{"font-semibold":""}," Delays ",-1)),(t(!0),n(f,null,m(p.value,l=>(t(),n("div",{key:l},[e("div",null,i(l)+"s",1)]))),128))])])]))}});export{T as default}; diff --git a/assets/delays-GOvkFfLX.js b/assets/delays-GOvkFfLX.js deleted file mode 100644 index 4ef1049e7c1e255daffb8a7ff9ed28ebb6d86cdc..0000000000000000000000000000000000000000 --- a/assets/delays-GOvkFfLX.js +++ /dev/null @@ -1 +0,0 @@ -import"./index-CdYg-KxO.js";import{b as g,l as _}from"./queues-CCpGc-RL.js";import"./three-vrm-animation.module-DLbUhddZ.js";/* empty css */import{_ as b}from"./Textarea.vue_vue_type_script_setup_true_lang-DYk_co3B.js";import{d as k,r,c as n,o as t,a as e,b as y,u as x,t as i,bA as f,bB as m}from"./index-D3pfQUMu.js";import"./emotions-CAex_2dA.js";import"./queue-6PX0h0Ry.js";import"./Basic.vue_vue_type_script_setup_true_lang-Sei3qL1b.js";const w={flex:"","flex-col":"","gap-2":"","p-2":""},h={flex:"","flex-row":"","gap-2":""},M={"rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-4":""},V={"w-full":"",flex:"","flex-row":"","gap-4":""},B={"w-full":"","rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-2":""},E={"w-full":"","rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-2":""},L=k({__name:"delays",setup(S){const s=r(""),c=r([]),p=r([]),u=r(!1),d=g();d.onHandlerEvent("delay",a=>{p.value.push(a)});function v(){u.value=!0;const a=s.value.split("");for(const o of a)d.add(o);d.add(_),s.value="",u.value=!1}return(a,o)=>(t(),n("div",w,[e("div",h,[y(x(b),{modelValue:s.value,"onUpdate:modelValue":o[0]||(o[0]=l=>s.value=l),placeholder:"Message",p:"2",bg:"neutral-100 dark:neutral-700","w-full":"","rounded-lg":"","outline-none":"",onSubmit:v},null,8,["modelValue"]),e("button",M,i(u.value?"Processing...":"Send"),1)]),e("div",V,[e("div",B,[o[1]||(o[1]=e("h3",{"font-semibold":""}," Emotion Message ",-1)),(t(!0),n(f,null,m(c.value,l=>(t(),n("div",{key:l},[e("div",null,i(l),1)]))),128))]),e("div",E,[o[2]||(o[2]=e("h3",{"font-semibold":""}," Delays ",-1)),(t(!0),n(f,null,m(p.value,l=>(t(),n("div",{key:l},[e("div",null,i(l)+"s",1)]))),128))])])]))}});export{L as default}; diff --git a/assets/effect-AvyXEvwH-C1QXj6zT.js b/assets/effect-AvyXEvwH-C1QXj6zT.js new file mode 100644 index 0000000000000000000000000000000000000000..6c82fa139588500d53f48154b4831622fb51f741 --- /dev/null +++ b/assets/effect-AvyXEvwH-C1QXj6zT.js @@ -0,0 +1 @@ +import{L as r}from"./index-BNq7Hbz_.js";import{t as e}from"./mcp-D2taTyhO.js";const _=async()=>{const{JSONSchema:t}=await e(r(()=>import("./__vite-optional-peer-dep_effect_xsschema-BIHI7g3E.js"),[]),"effect");return o=>t.make(o)};export{_ as getToJsonSchemaFn}; diff --git a/assets/elevenlabs-DEXiXl5s.js b/assets/elevenlabs-DEXiXl5s.js new file mode 100644 index 0000000000000000000000000000000000000000..af42771782e8a63cd9bb89ae9423bb4e9eb66287 --- /dev/null +++ b/assets/elevenlabs-DEXiXl5s.js @@ -0,0 +1 @@ +import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-B6whjTNv.js";import{d as $,r as n,s as F,g as I,h as x,H as E,v as a,A as H,o as K,w as k,i as d,b as o,e as L}from"./index-BNq7Hbz_.js";import"./three-vrm-animation.module-BPuMi1if.js";import"./mcp-D2taTyhO.js";import"./mini_xsschema-P_8cZcRg.js";import{u as N}from"./providers-Ddg6LLwH.js";import{u as T}from"./speech-CKvssz06.js";import{_ as p,a as z}from"./FieldRange.vue_vue_type_script_setup_true_lang-RRSKRN5w.js";/* empty css */import{_ as A,a as G}from"./SpeechProviderSettings.vue_vue_type_script_setup_true_lang-DQ9q1Mut.js";import{b as w}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DETFnj2t.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-IiDV8qQX.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BlPB-gCV.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-IanARj3w.js";import"./Input.vue_vue_type_script_setup_true_lang-1pgLpBi1.js";import"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-8yNUgi8_.js";import"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C-W-PZMl.js";const R={flex:"~ col gap-4"},l="elevenlabs",_="eleven_multilingual_v2",j=$({__name:"elevenlabs",setup(q){const V={similarityBoost:.75,stability:.5,speed:1,style:0,useSpeakerBoost:!0},v=n(0),m=n(1),u=n(0),f=n(0),c=n(.5),g=n(.75),b=n(!1),y=T(),t=N(),{providers:C}=F(t),{t:r}=I(),B=x(()=>{var e;return!!((e=C.value[l])!=null&&e.apiKey)}),M=x(()=>y.availableVoices[l]||[]);async function U(e,i,s){const P=t.getProviderInstance(l);if(!P)throw new Error("Failed to initialize speech provider");const S=t.getProviderConfig(l),h=S.model||_;return await y.speech(P,h,e,i,{...S,...V})}return E(async()=>{const e=t.getProviderConfig(l);await t.getProviderMetadata(l).validators.validateProviderConfig(e)?await y.loadVoicesForProvider(l):console.error("Failed to validate provider config",e)}),a(v,async()=>{const e=t.getProviderConfig(l);e.pitch=v.value}),a(m,async()=>{const e=t.getProviderConfig(l);e.speed=m.value}),a(u,async()=>{const e=t.getProviderConfig(l);e.volume=u.value}),a(f,async()=>{const e=t.getProviderConfig(l);e.style=f.value}),a(c,async()=>{const e=t.getProviderConfig(l);e.stability=c.value}),a(g,async()=>{const e=t.getProviderConfig(l);e.similarityBoost=g.value}),a(b,async()=>{const e=t.getProviderConfig(l);e.useSpeakerBoost=b.value}),a(C,async()=>{const e=t.getProviderConfig(l);await t.getProviderMetadata(l).validators.validateProviderConfig(e)?await y.loadVoicesForProvider(l):console.error("Failed to validate provider config",e)},{immediate:!0}),(e,i)=>(K(),H(o(G),{"provider-id":l,"default-model":_,"additional-settings":V},{"voice-settings":k(()=>[L("div",R,[d(o(p),{modelValue:v.value,"onUpdate:modelValue":i[0]||(i[0]=s=>v.value=s),label:o(r)("settings.pages.providers.provider.common.fields.field.pitch.label"),description:o(r)("settings.pages.providers.provider.common.fields.field.pitch.description"),min:-100,max:100,step:1,"format-value":s=>`${s}%`},null,8,["modelValue","label","description","format-value"]),d(o(p),{modelValue:m.value,"onUpdate:modelValue":i[1]||(i[1]=s=>m.value=s),label:o(r)("settings.pages.providers.provider.common.fields.field.speed.label"),description:o(r)("settings.pages.providers.provider.common.fields.field.speed.description"),min:.5,max:2,step:.01},null,8,["modelValue","label","description"]),d(o(p),{modelValue:u.value,"onUpdate:modelValue":i[2]||(i[2]=s=>u.value=s),label:o(r)("settings.pages.providers.provider.common.fields.field.volume.label"),description:o(r)("settings.pages.providers.provider.common.fields.field.volume.description"),min:-100,max:100,step:1,"format-value":s=>`${s}%`},null,8,["modelValue","label","description","format-value"]),d(o(p),{modelValue:f.value,"onUpdate:modelValue":i[3]||(i[3]=s=>f.value=s),label:o(r)("settings.pages.providers.provider.elevenlabs.fields.field.style.label"),description:o(r)("settings.pages.providers.provider.elevenlabs.fields.field.style.description"),min:0,max:1,step:.01},null,8,["modelValue","label","description"]),d(o(p),{modelValue:c.value,"onUpdate:modelValue":i[4]||(i[4]=s=>c.value=s),label:o(r)("settings.pages.providers.provider.elevenlabs.fields.field.stability.label"),description:o(r)("settings.pages.providers.provider.elevenlabs.fields.field.stability.description"),min:0,max:1,step:.01},null,8,["modelValue","label","description"]),d(o(p),{modelValue:g.value,"onUpdate:modelValue":i[5]||(i[5]=s=>g.value=s),label:o(r)("settings.pages.providers.provider.elevenlabs.fields.field.simularity-boost.label"),description:o(r)("settings.pages.providers.provider.elevenlabs.fields.field.simularity-boost.description"),min:0,max:1,step:.01},null,8,["modelValue","label","description"]),d(o(z),{modelValue:b.value,"onUpdate:modelValue":i[6]||(i[6]=s=>b.value=s),label:o(r)("settings.pages.providers.provider.elevenlabs.fields.field.speaker-boost.label"),description:o(r)("settings.pages.providers.provider.elevenlabs.fields.field.speaker-boost.description")},null,8,["modelValue","label","description"])])]),playground:k(()=>[d(o(A),{"available-voices":M.value,"generate-speech":U,"api-key-configured":B.value,"default-text":"Hello! This is a test of the ElevenLabs voice synthesis."},null,8,["available-voices","api-key-configured"])]),_:1}))}});typeof w=="function"&&w(j);export{j as default}; diff --git a/assets/elevenlabs-DWHleb5O.js b/assets/elevenlabs-DWHleb5O.js deleted file mode 100644 index c1a8d3711451aceca49de72d48b2a304fb7c4019..0000000000000000000000000000000000000000 --- a/assets/elevenlabs-DWHleb5O.js +++ /dev/null @@ -1 +0,0 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-t8bgqiA6.js";import{d as h,r as n,s as F,k as E,l as k,f as I,w as r,m as K,o as L,E as x,b as d,u as o,a as N}from"./index-D3pfQUMu.js";import"./three-vrm-animation.module-DLbUhddZ.js";import"./emotions-CAex_2dA.js";import{u as T}from"./providers-CCvie00Z.js";import{u as z}from"./speech-CIOuIakE.js";import{_ as p,a as G}from"./FieldRange.vue_vue_type_script_setup_true_lang-IEKed7Lk.js";/* empty css */import{_ as H,a as R}from"./SpeechProviderSettings.vue_vue_type_script_setup_true_lang-ByvvVpU4.js";import{b as w}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Qp-g_fu5.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-DDNOeGH3.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-D_DUmSTM.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-Brkyubp9.js";import"./Input.vue_vue_type_script_setup_true_lang-B223oRg0.js";import"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-yC-Tsbbb.js";import"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C8wZQWhG.js";const j={flex:"~ col gap-4"},l="elevenlabs",_="eleven_multilingual_v2",q=h({__name:"elevenlabs",setup(A){const V={similarityBoost:.75,stability:.5,speed:1,style:0,useSpeakerBoost:!0},v=n(0),m=n(1),u=n(0),f=n(0),c=n(.5),g=n(.75),b=n(!1),y=z(),t=T(),{providers:C}=F(t),{t:a}=E(),B=k(()=>{var e;return!!((e=C.value[l])!=null&&e.apiKey)}),M=k(()=>y.availableVoices[l]||[]);async function U(e,i,s){const P=t.getProviderInstance(l);if(!P)throw new Error("Failed to initialize speech provider");const S=t.getProviderConfig(l),$=S.model||_;return await y.speech(P,$,e,i,{...S,...V})}return I(async()=>{const e=t.getProviderConfig(l);await t.getProviderMetadata(l).validators.validateProviderConfig(e)?await y.loadVoicesForProvider(l):console.error("Failed to validate provider config",e)}),r(v,async()=>{const e=t.getProviderConfig(l);e.pitch=v.value}),r(m,async()=>{const e=t.getProviderConfig(l);e.speed=m.value}),r(u,async()=>{const e=t.getProviderConfig(l);e.volume=u.value}),r(f,async()=>{const e=t.getProviderConfig(l);e.style=f.value}),r(c,async()=>{const e=t.getProviderConfig(l);e.stability=c.value}),r(g,async()=>{const e=t.getProviderConfig(l);e.similarityBoost=g.value}),r(b,async()=>{const e=t.getProviderConfig(l);e.useSpeakerBoost=b.value}),r(C,async()=>{const e=t.getProviderConfig(l);await t.getProviderMetadata(l).validators.validateProviderConfig(e)?await y.loadVoicesForProvider(l):console.error("Failed to validate provider config",e)},{immediate:!0}),(e,i)=>(L(),K(o(R),{"provider-id":l,"default-model":_,"additional-settings":V},{"voice-settings":x(()=>[N("div",j,[d(o(p),{modelValue:v.value,"onUpdate:modelValue":i[0]||(i[0]=s=>v.value=s),label:o(a)("settings.pages.providers.provider.common.fields.field.pitch.label"),description:o(a)("settings.pages.providers.provider.common.fields.field.pitch.description"),min:-100,max:100,step:1,"format-value":s=>`${s}%`},null,8,["modelValue","label","description","format-value"]),d(o(p),{modelValue:m.value,"onUpdate:modelValue":i[1]||(i[1]=s=>m.value=s),label:o(a)("settings.pages.providers.provider.common.fields.field.speed.label"),description:o(a)("settings.pages.providers.provider.common.fields.field.speed.description"),min:.5,max:2,step:.01},null,8,["modelValue","label","description"]),d(o(p),{modelValue:u.value,"onUpdate:modelValue":i[2]||(i[2]=s=>u.value=s),label:o(a)("settings.pages.providers.provider.common.fields.field.volume.label"),description:o(a)("settings.pages.providers.provider.common.fields.field.volume.description"),min:-100,max:100,step:1,"format-value":s=>`${s}%`},null,8,["modelValue","label","description","format-value"]),d(o(p),{modelValue:f.value,"onUpdate:modelValue":i[3]||(i[3]=s=>f.value=s),label:o(a)("settings.pages.providers.provider.elevenlabs.fields.field.style.label"),description:o(a)("settings.pages.providers.provider.elevenlabs.fields.field.style.description"),min:0,max:1,step:.01},null,8,["modelValue","label","description"]),d(o(p),{modelValue:c.value,"onUpdate:modelValue":i[4]||(i[4]=s=>c.value=s),label:o(a)("settings.pages.providers.provider.elevenlabs.fields.field.stability.label"),description:o(a)("settings.pages.providers.provider.elevenlabs.fields.field.stability.description"),min:0,max:1,step:.01},null,8,["modelValue","label","description"]),d(o(p),{modelValue:g.value,"onUpdate:modelValue":i[5]||(i[5]=s=>g.value=s),label:o(a)("settings.pages.providers.provider.elevenlabs.fields.field.simularity-boost.label"),description:o(a)("settings.pages.providers.provider.elevenlabs.fields.field.simularity-boost.description"),min:0,max:1,step:.01},null,8,["modelValue","label","description"]),d(o(G),{modelValue:b.value,"onUpdate:modelValue":i[6]||(i[6]=s=>b.value=s),label:o(a)("settings.pages.providers.provider.elevenlabs.fields.field.speaker-boost.label"),description:o(a)("settings.pages.providers.provider.elevenlabs.fields.field.speaker-boost.description")},null,8,["modelValue","label","description"])])]),playground:x(()=>[d(o(H),{"available-voices":M.value,"generate-speech":U,"api-key-configured":B.value,"default-text":"Hello! This is a test of the ElevenLabs voice synthesis."},null,8,["available-voices","api-key-configured"])]),_:1}))}});typeof w=="function"&&w(q);export{q as default}; diff --git a/assets/emotions-CAex_2dA.js b/assets/emotions-CAex_2dA.js deleted file mode 100644 index 1ce1f81698d29e25bc7357c94581e5ba5999279e..0000000000000000000000000000000000000000 --- a/assets/emotions-CAex_2dA.js +++ /dev/null @@ -1 +0,0 @@ -var o=(E=>(E.Idle="<|EMOTE_NEUTRAL|>",E.Happy="<|EMOTE_HAPPY|>",E.Sad="<|EMOTE_SAD|>",E.Angry="<|EMOTE_ANGRY|>",E.Think="<|EMOTE_THINK|>",E.Surprise="<|EMOTE_SURPRISE|>",E.Awkward="<|EMOTE_AWKWARD|>",E.Question="<|EMOTE_QUESTION|>",E))(o||{});const e=Object.values(o),T="Happy",M="Sad",a="Angry",n="Awkward",O="Think",s="Surprise",t="Question",_="Idle",i={"<|EMOTE_HAPPY|>":T,"<|EMOTE_SAD|>":M,"<|EMOTE_ANGRY|>":a,"<|EMOTE_THINK|>":O,"<|EMOTE_SURPRISE|>":s,"<|EMOTE_AWKWARD|>":n,"<|EMOTE_QUESTION|>":t,"<|EMOTE_NEUTRAL|>":_},N={"<|EMOTE_HAPPY|>":"happy","<|EMOTE_SAD|>":"sad","<|EMOTE_ANGRY|>":"angry","<|EMOTE_THINK|>":void 0,"<|EMOTE_SURPRISE|>":"surprised","<|EMOTE_AWKWARD|>":void 0,"<|EMOTE_QUESTION|>":void 0,"<|EMOTE_NEUTRAL|>":void 0};export{O as E,a,T as b,N as c,i as d,e,o as f,_ as g}; diff --git a/assets/emotions-CIHTBxtQ.js b/assets/emotions-CIHTBxtQ.js new file mode 100644 index 0000000000000000000000000000000000000000..d95c2b51c2a729209fd41762f3b29a63a5c58545 --- /dev/null +++ b/assets/emotions-CIHTBxtQ.js @@ -0,0 +1 @@ +import{u as _}from"./queue-Bkpr_I5o.js";import{a as k,l as b}from"./queues-yzb6LxwZ.js";/* empty css */import{_ as x}from"./Textarea.vue_vue_type_script_setup_true_lang-DVhP8J-8.js";import{d as h,r as u,c as s,o as t,e,i as w,b as M,t as d,F as f,l as p}from"./index-BNq7Hbz_.js";import"./mini_xsschema-P_8cZcRg.js";import"./Basic.vue_vue_type_script_setup_true_lang-DiEujAxb.js";const V={flex:"","flex-col":"","gap-2":"","p-2":""},y={flex:"","flex-row":"","gap-2":""},E={"rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-4":""},Q={"w-full":"",flex:"","flex-row":"","gap-4":""},S={"w-full":"","rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-2":""},B={"w-full":"","rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-2":""},U=h({__name:"emotions",setup(P){const l=u(""),c=u([]),i=u([]),r=u(!1),g=_({handlers:[async a=>{i.value.push(a.data)}]}),m=k(g);function v(){r.value=!0;const a=l.value.split("");for(const o of a)m.add(o);m.add(b),l.value="",r.value=!1}return(a,o)=>(t(),s("div",V,[e("div",y,[w(M(x),{modelValue:l.value,"onUpdate:modelValue":o[0]||(o[0]=n=>l.value=n),placeholder:"Message",p:"2",bg:"neutral-100 dark:neutral-700","w-full":"","rounded-lg":"","outline-none":"",onSubmit:v},null,8,["modelValue"]),e("button",E,d(r.value?"Processing...":"Send"),1)]),e("div",Q,[e("div",S,[o[1]||(o[1]=e("h3",{"font-semibold":""}," Messages ",-1)),(t(!0),s(f,null,p(c.value,n=>(t(),s("div",{key:n},[e("div",null,d(n),1)]))),128))]),e("div",B,[o[2]||(o[2]=e("h3",{"font-semibold":""}," Emotions ",-1)),(t(!0),s(f,null,p(i.value,n=>(t(),s("div",{key:n},[e("div",null,d(n),1)]))),128))])])]))}});export{U as default}; diff --git a/assets/emotions-D1MeHkXq.js b/assets/emotions-D1MeHkXq.js deleted file mode 100644 index dc5f0b447a02090dd35bb84cf07a9f70e7c79c87..0000000000000000000000000000000000000000 --- a/assets/emotions-D1MeHkXq.js +++ /dev/null @@ -1 +0,0 @@ -import{u as _}from"./queue-6PX0h0Ry.js";import{a as b,l as k}from"./queues-CCpGc-RL.js";/* empty css */import{_ as x}from"./Textarea.vue_vue_type_script_setup_true_lang-DYk_co3B.js";import{d as h,r as u,c as s,o as t,a as e,b as w,u as M,t as d,bA as f,bB as p}from"./index-D3pfQUMu.js";import"./emotions-CAex_2dA.js";import"./Basic.vue_vue_type_script_setup_true_lang-Sei3qL1b.js";const V={flex:"","flex-col":"","gap-2":"","p-2":""},y={flex:"","flex-row":"","gap-2":""},B={"rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-4":""},E={"w-full":"",flex:"","flex-row":"","gap-4":""},Q={"w-full":"","rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-2":""},S={"w-full":"","rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-2":""},T=h({__name:"emotions",setup(P){const l=u(""),c=u([]),i=u([]),r=u(!1),g=_({handlers:[async a=>{i.value.push(a.data)}]}),m=b(g);function v(){r.value=!0;const a=l.value.split("");for(const o of a)m.add(o);m.add(k),l.value="",r.value=!1}return(a,o)=>(t(),s("div",V,[e("div",y,[w(M(x),{modelValue:l.value,"onUpdate:modelValue":o[0]||(o[0]=n=>l.value=n),placeholder:"Message",p:"2",bg:"neutral-100 dark:neutral-700","w-full":"","rounded-lg":"","outline-none":"",onSubmit:v},null,8,["modelValue"]),e("button",B,d(r.value?"Processing...":"Send"),1)]),e("div",E,[e("div",Q,[o[1]||(o[1]=e("h3",{"font-semibold":""}," Messages ",-1)),(t(!0),s(f,null,p(c.value,n=>(t(),s("div",{key:n},[e("div",null,d(n),1)]))),128))]),e("div",S,[o[2]||(o[2]=e("h3",{"font-semibold":""}," Emotions ",-1)),(t(!0),s(f,null,p(i.value,n=>(t(),s("div",{key:n},[e("div",null,d(n),1)]))),128))])])]))}});export{T as default}; diff --git a/assets/featherless-ai-B2aQkHo9.js b/assets/featherless-ai-B2aQkHo9.js new file mode 100644 index 0000000000000000000000000000000000000000..e3c9c27ec457ba018e7c35d9818061703fef0bd1 --- /dev/null +++ b/assets/featherless-ai-B2aQkHo9.js @@ -0,0 +1 @@ +import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-B6whjTNv.js";import{d as h,g as V,U as k,s as y,h as v,H as $,v as K,A as w,o as x,w as u,i as l,b as t}from"./index-BNq7Hbz_.js";import"./three-vrm-animation.module-BPuMi1if.js";import"./mcp-D2taTyhO.js";import"./mini_xsschema-P_8cZcRg.js";import{u as z}from"./providers-Ddg6LLwH.js";/* empty css */import{_ as M,a as N}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DETFnj2t.js";import{_ as P}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-8yNUgi8_.js";import{_ as R,a as S}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C-W-PZMl.js";import{_ as B}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-kCkYL1sn.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-IiDV8qQX.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BlPB-gCV.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-IanARj3w.js";import"./Input.vue_vue_type_script_setup_true_lang-1pgLpBi1.js";const a="featherless-ai",C=h({__name:"featherless-ai",setup(I){const{t:m}=V(),b=k(),d=z(),{providers:o}=y(d),n=v(()=>d.getProviderMetadata(a)),s=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),r=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});$(()=>{var e,i;d.initializeProvider(a),s.value=((e=o.value[a])==null?void 0:e.apiKey)||"",r.value=((i=o.value[a])==null?void 0:i.baseUrl)||""}),K([s,r],()=>{o.value[a]={...o.value[a],apiKey:s.value,baseUrl:r.value||""}});function g(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var c,f;return x(),w(t(B),{"provider-name":(c=n.value)==null?void 0:c.localizedName,"provider-icon":(f=n.value)==null?void 0:f.icon,"on-back":()=>t(b).back()},{default:u(()=>[l(t(R),null,{default:u(()=>[l(t(S),{title:t(m)("settings.pages.providers.common.section.basic.title"),description:t(m)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:u(()=>{var p;return[l(t(P),{modelValue:s.value,"onUpdate:modelValue":i[0]||(i[0]=U=>s.value=U),"provider-name":(p=n.value)==null?void 0:p.localizedName,placeholder:"fw-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(M),{title:t(m)("settings.pages.providers.common.section.advanced.title")},{default:u(()=>[l(t(N),{modelValue:r.value,"onUpdate:modelValue":i[1]||(i[1]=p=>r.value=p),placeholder:"https://api.featherless.ai/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});typeof _=="function"&&_(C);export{C as default}; diff --git a/assets/featherless-ai-DARE6Tp5.js b/assets/featherless-ai-DARE6Tp5.js deleted file mode 100644 index 21a781ffa22dac9b58d000721ee791d84b47b97d..0000000000000000000000000000000000000000 --- a/assets/featherless-ai-DARE6Tp5.js +++ /dev/null @@ -1 +0,0 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-t8bgqiA6.js";import{d as k,k as U,h as V,s as y,l as v,f as $,w as K,m as w,o as x,E as u,b as l,u as t}from"./index-D3pfQUMu.js";import"./three-vrm-animation.module-DLbUhddZ.js";import"./emotions-CAex_2dA.js";import{u as z}from"./providers-CCvie00Z.js";/* empty css */import{_ as M,a as N}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Qp-g_fu5.js";import{_ as P}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-yC-Tsbbb.js";import{_ as R,a as S}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C8wZQWhG.js";import{_ as B}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-CRYYAVy7.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-DDNOeGH3.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-D_DUmSTM.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-Brkyubp9.js";import"./Input.vue_vue_type_script_setup_true_lang-B223oRg0.js";const a="featherless-ai",C=k({__name:"featherless-ai",setup(I){const{t:m}=U(),b=V(),d=z(),{providers:o}=y(d),n=v(()=>d.getProviderMetadata(a)),s=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),r=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});$(()=>{var e,i;d.initializeProvider(a),s.value=((e=o.value[a])==null?void 0:e.apiKey)||"",r.value=((i=o.value[a])==null?void 0:i.baseUrl)||""}),K([s,r],()=>{o.value[a]={...o.value[a],apiKey:s.value,baseUrl:r.value||""}});function g(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var c,f;return x(),w(t(B),{"provider-name":(c=n.value)==null?void 0:c.localizedName,"provider-icon":(f=n.value)==null?void 0:f.icon,"on-back":()=>t(b).back()},{default:u(()=>[l(t(R),null,{default:u(()=>[l(t(S),{title:t(m)("settings.pages.providers.common.section.basic.title"),description:t(m)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:u(()=>{var p;return[l(t(P),{modelValue:s.value,"onUpdate:modelValue":i[0]||(i[0]=h=>s.value=h),"provider-name":(p=n.value)==null?void 0:p.localizedName,placeholder:"fw-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(M),{title:t(m)("settings.pages.providers.common.section.advanced.title")},{default:u(()=>[l(t(N),{modelValue:r.value,"onUpdate:modelValue":i[1]||(i[1]=p=>r.value=p),placeholder:"https://api.featherless.ai/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});typeof _=="function"&&_(C);export{C as default}; diff --git a/assets/filter-message-BXRmVdLj.js b/assets/filter-message-BXRmVdLj.js new file mode 100644 index 0000000000000000000000000000000000000000..986fb75084a85cd03c9596c9755bb083b33526ea --- /dev/null +++ b/assets/filter-message-BXRmVdLj.js @@ -0,0 +1 @@ +/* empty css */import{_ as m}from"./Textarea.vue_vue_type_script_setup_true_lang-DVhP8J-8.js";import{d as g,r as c,c as v,o as _,e as s,i as b,b as x,t as d}from"./index-BNq7Hbz_.js";import"./Basic.vue_vue_type_script_setup_true_lang-DiEujAxb.js";const S={flex:"","flex-col":"","gap-2":"","p-2":""},k={flex:"","flex-row":"","gap-2":""},w={"rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-4":""},V={"w-full":"","rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-2":""},N=g({__name:"filter-message",setup(M){const o=c(""),u=c(!1),r=c({content:""});async function f(i){return new Promise(e=>setTimeout(e,i))}async function p(){u.value=!0;const i=o.value.split("");let e;(a=>{a.Literal="literal",a.Special="special"})(e||(e={}));let t="literal",l="";for(const a of i){await f(50);let n=t;a==="<"?n="special":a===">"&&(n="literal"),t==="literal"&&n==="special"&&(r.value.content+=l,l=""),t==="special"&&n==="literal"&&(l=""),t==="literal"&&n==="literal"&&(r.value.content+=a,l=""),t=n}l&&(r.value.content+=l),o.value="",u.value=!1}return(i,e)=>(_(),v("div",S,[s("div",k,[b(x(m),{modelValue:o.value,"onUpdate:modelValue":e[0]||(e[0]=t=>o.value=t),placeholder:"Message",p:"2",bg:"neutral-100 dark:neutral-700","w-full":"","rounded-lg":"","outline-none":"",onSubmit:p},null,8,["modelValue"]),s("button",w,d(u.value?"Processing...":"Send"),1)]),s("div",V,[e[1]||(e[1]=s("h3",{"font-semibold":""}," Streaming Message ",-1)),s("div",null,d(r.value.content),1)])]))}});export{N as default}; diff --git a/assets/filter-message-DE-HM8Ub.js b/assets/filter-message-DE-HM8Ub.js deleted file mode 100644 index 31966be01cee596056319fe3f1d49af3f07d5428..0000000000000000000000000000000000000000 --- a/assets/filter-message-DE-HM8Ub.js +++ /dev/null @@ -1 +0,0 @@ -/* empty css */import{_ as m}from"./Textarea.vue_vue_type_script_setup_true_lang-DYk_co3B.js";import{d as g,r as c,c as v,o as _,a as s,b,u as x,t as d}from"./index-D3pfQUMu.js";import"./Basic.vue_vue_type_script_setup_true_lang-Sei3qL1b.js";const S={flex:"","flex-col":"","gap-2":"","p-2":""},k={flex:"","flex-row":"","gap-2":""},w={"rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-4":""},V={"w-full":"","rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-2":""},N=g({__name:"filter-message",setup(M){const o=c(""),u=c(!1),r=c({content:""});async function f(i){return new Promise(e=>setTimeout(e,i))}async function p(){u.value=!0;const i=o.value.split("");let e;(a=>{a.Literal="literal",a.Special="special"})(e||(e={}));let t="literal",l="";for(const a of i){await f(50);let n=t;a==="<"?n="special":a===">"&&(n="literal"),t==="literal"&&n==="special"&&(r.value.content+=l,l=""),t==="special"&&n==="literal"&&(l=""),t==="literal"&&n==="literal"&&(r.value.content+=a,l=""),t=n}l&&(r.value.content+=l),o.value="",u.value=!1}return(i,e)=>(_(),v("div",S,[s("div",k,[b(x(m),{modelValue:o.value,"onUpdate:modelValue":e[0]||(e[0]=t=>o.value=t),placeholder:"Message",p:"2",bg:"neutral-100 dark:neutral-700","w-full":"","rounded-lg":"","outline-none":"",onSubmit:p},null,8,["modelValue"]),s("button",w,d(u.value?"Processing...":"Send"),1)]),s("div",V,[e[1]||(e[1]=s("h3",{"font-semibold":""}," Streaming Message ",-1)),s("div",null,d(r.value.content),1)])]))}});export{N as default}; diff --git a/assets/fireworks-ai-BN-10Pky.js b/assets/fireworks-ai-BN-10Pky.js new file mode 100644 index 0000000000000000000000000000000000000000..a2ba3d8dfeb8ed52b8ccd9b4dc13c55321545179 --- /dev/null +++ b/assets/fireworks-ai-BN-10Pky.js @@ -0,0 +1 @@ +import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-B6whjTNv.js";import{d as U,g as w,U as V,s as y,h as v,H as $,v as K,A as h,o as x,w as u,i as l,b as t}from"./index-BNq7Hbz_.js";import"./three-vrm-animation.module-BPuMi1if.js";import"./mcp-D2taTyhO.js";import"./mini_xsschema-P_8cZcRg.js";import{u as z}from"./providers-Ddg6LLwH.js";/* empty css */import{_ as M,a as N}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DETFnj2t.js";import{_ as P}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-8yNUgi8_.js";import{_ as R,a as S}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C-W-PZMl.js";import{_ as B}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-kCkYL1sn.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-IiDV8qQX.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BlPB-gCV.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-IanARj3w.js";import"./Input.vue_vue_type_script_setup_true_lang-1pgLpBi1.js";const a="fireworks-ai",C=U({__name:"fireworks-ai",setup(I){const{t:m}=w(),b=V(),d=z(),{providers:o}=y(d),n=v(()=>d.getProviderMetadata(a)),r=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),s=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});$(()=>{var e,i;d.initializeProvider(a),r.value=((e=o.value[a])==null?void 0:e.apiKey)||"",s.value=((i=o.value[a])==null?void 0:i.baseUrl)||""}),K([r,s],()=>{o.value[a]={...o.value[a],apiKey:r.value,baseUrl:s.value||""}});function g(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var c,f;return x(),h(t(B),{"provider-name":(c=n.value)==null?void 0:c.localizedName,"provider-icon":(f=n.value)==null?void 0:f.icon,"on-back":()=>t(b).back()},{default:u(()=>[l(t(R),null,{default:u(()=>[l(t(S),{title:t(m)("settings.pages.providers.common.section.basic.title"),description:t(m)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:u(()=>{var p;return[l(t(P),{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=k=>r.value=k),"provider-name":(p=n.value)==null?void 0:p.localizedName,placeholder:"fw-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(M),{title:t(m)("settings.pages.providers.common.section.advanced.title")},{default:u(()=>[l(t(N),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=p=>s.value=p),placeholder:"https://api.fireworks.ai/inference/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});typeof _=="function"&&_(C);export{C as default}; diff --git a/assets/fireworks-ai-C8z0lOo5.js b/assets/fireworks-ai-C8z0lOo5.js deleted file mode 100644 index 8774df7c339aed86f8117a39a325efe61c8a6172..0000000000000000000000000000000000000000 --- a/assets/fireworks-ai-C8z0lOo5.js +++ /dev/null @@ -1 +0,0 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-t8bgqiA6.js";import{d as w,k as U,h as V,s as y,l as c,f as $,w as K,m as h,o as x,E as u,b as l,u as t}from"./index-D3pfQUMu.js";import"./three-vrm-animation.module-DLbUhddZ.js";import"./emotions-CAex_2dA.js";import{u as z}from"./providers-CCvie00Z.js";/* empty css */import{_ as M,a as N}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Qp-g_fu5.js";import{_ as P}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-yC-Tsbbb.js";import{_ as R,a as S}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C8wZQWhG.js";import{_ as B}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-CRYYAVy7.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-DDNOeGH3.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-D_DUmSTM.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-Brkyubp9.js";import"./Input.vue_vue_type_script_setup_true_lang-B223oRg0.js";const a="fireworks-ai",C=w({__name:"fireworks-ai",setup(I){const{t:m}=U(),b=V(),d=z(),{providers:o}=y(d),n=c(()=>d.getProviderMetadata(a)),r=c({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),s=c({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});$(()=>{var e,i;d.initializeProvider(a),r.value=((e=o.value[a])==null?void 0:e.apiKey)||"",s.value=((i=o.value[a])==null?void 0:i.baseUrl)||""}),K([r,s],()=>{o.value[a]={...o.value[a],apiKey:r.value,baseUrl:s.value||""}});function g(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var v,f;return x(),h(t(B),{"provider-name":(v=n.value)==null?void 0:v.localizedName,"provider-icon":(f=n.value)==null?void 0:f.icon,"on-back":()=>t(b).back()},{default:u(()=>[l(t(R),null,{default:u(()=>[l(t(S),{title:t(m)("settings.pages.providers.common.section.basic.title"),description:t(m)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:u(()=>{var p;return[l(t(P),{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=k=>r.value=k),"provider-name":(p=n.value)==null?void 0:p.localizedName,placeholder:"fw-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(M),{title:t(m)("settings.pages.providers.common.section.advanced.title")},{default:u(()=>[l(t(N),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=p=>s.value=p),placeholder:"https://api.fireworks.ai/inference/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});typeof _=="function"&&_(C);export{C as default}; diff --git a/assets/google-generative-ai-B68fMhhy.js b/assets/google-generative-ai-B68fMhhy.js deleted file mode 100644 index e027a146fde0ae1edffeb7911a5a5f29c9c4cef5..0000000000000000000000000000000000000000 --- a/assets/google-generative-ai-B68fMhhy.js +++ /dev/null @@ -1 +0,0 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-t8bgqiA6.js";import{d as U,k,h as V,s as y,l as v,f as $,w as K,m as w,o as x,E as p,b as r,u as t}from"./index-D3pfQUMu.js";import"./three-vrm-animation.module-DLbUhddZ.js";import"./emotions-CAex_2dA.js";import{u as G}from"./providers-CCvie00Z.js";/* empty css */import{_ as M,a as N}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Qp-g_fu5.js";import{_ as R}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-yC-Tsbbb.js";import{_ as S,a as z}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C8wZQWhG.js";import{_ as B}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-CRYYAVy7.js";import{b as f}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-DDNOeGH3.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-D_DUmSTM.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-Brkyubp9.js";import"./Input.vue_vue_type_script_setup_true_lang-B223oRg0.js";const e="google-generative-ai",C=U({__name:"google-generative-ai",setup(I){const{t:u}=k(),_=V(),c=G(),{providers:a}=y(c),m=v(()=>c.getProviderMetadata(e)),s=v({get:()=>{var o;return((o=a.value[e])==null?void 0:o.apiKey)||""},set:o=>{a.value[e]||(a.value[e]={}),a.value[e].apiKey=o}}),l=v({get:()=>{var o;return((o=a.value[e])==null?void 0:o.baseUrl)||"https://generativelanguage.googleapis.com/v1beta/openai/"},set:o=>{a.value[e]||(a.value[e]={}),a.value[e].baseUrl=o}});$(()=>{var o,i;a.value[e]||(a.value[e]={baseUrl:"https://api.anthropic.com/v1/"}),s.value=((o=a.value[e])==null?void 0:o.apiKey)||"",l.value=((i=a.value[e])==null?void 0:i.baseUrl)||"https://generativelanguage.googleapis.com/v1beta/openai/"}),K([s,l],()=>{a.value[e]={...a.value[e],apiKey:s.value,baseUrl:l.value||"https://generativelanguage.googleapis.com/v1beta/openai/"}});function b(){a.value[e]={baseUrl:"https://generativelanguage.googleapis.com/v1beta/openai/"}}return(o,i)=>{var d,g;return x(),w(t(B),{"provider-name":((d=m.value)==null?void 0:d.localizedName)||"Google | Gemini","provider-icon":(g=m.value)==null?void 0:g.icon,"on-back":()=>t(_).back()},{default:p(()=>[r(t(S),null,{default:p(()=>[r(t(z),{title:t(u)("settings.pages.providers.common.section.basic.title"),description:t(u)("settings.pages.providers.common.section.basic.description"),"on-reset":b},{default:p(()=>{var n;return[r(t(R),{modelValue:s.value,"onUpdate:modelValue":i[0]||(i[0]=h=>s.value=h),"provider-name":((n=m.value)==null?void 0:n.localizedName)||"Google",placeholder:"sk-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),r(t(M),{title:t(u)("settings.pages.providers.common.section.advanced.title")},{default:p(()=>[r(t(N),{modelValue:l.value,"onUpdate:modelValue":i[1]||(i[1]=n=>l.value=n),placeholder:"https://generativelanguage.googleapis.com/v1beta/openai/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});typeof f=="function"&&f(C);export{C as default}; diff --git a/assets/google-generative-ai-BWKD0Fn7.js b/assets/google-generative-ai-BWKD0Fn7.js new file mode 100644 index 0000000000000000000000000000000000000000..71948dbbe2b957c414b5f639fbcbbf4260bda45c --- /dev/null +++ b/assets/google-generative-ai-BWKD0Fn7.js @@ -0,0 +1 @@ +import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-B6whjTNv.js";import{d as U,g as k,U as V,s as y,h as v,H as $,v as K,A as w,o as x,w as p,i as l,b as t}from"./index-BNq7Hbz_.js";import"./three-vrm-animation.module-BPuMi1if.js";import"./mcp-D2taTyhO.js";import"./mini_xsschema-P_8cZcRg.js";import{u as G}from"./providers-Ddg6LLwH.js";/* empty css */import{_ as M,a as N}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DETFnj2t.js";import{_ as R}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-8yNUgi8_.js";import{_ as S,a as z}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C-W-PZMl.js";import{_ as B}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-kCkYL1sn.js";import{b as f}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-IiDV8qQX.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BlPB-gCV.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-IanARj3w.js";import"./Input.vue_vue_type_script_setup_true_lang-1pgLpBi1.js";const e="google-generative-ai",C=U({__name:"google-generative-ai",setup(I){const{t:m}=k(),_=V(),c=G(),{providers:a}=y(c),u=v(()=>c.getProviderMetadata(e)),s=v({get:()=>{var o;return((o=a.value[e])==null?void 0:o.apiKey)||""},set:o=>{a.value[e]||(a.value[e]={}),a.value[e].apiKey=o}}),r=v({get:()=>{var o;return((o=a.value[e])==null?void 0:o.baseUrl)||"https://generativelanguage.googleapis.com/v1beta/openai/"},set:o=>{a.value[e]||(a.value[e]={}),a.value[e].baseUrl=o}});$(()=>{var o,i;a.value[e]||(a.value[e]={baseUrl:"https://api.anthropic.com/v1/"}),s.value=((o=a.value[e])==null?void 0:o.apiKey)||"",r.value=((i=a.value[e])==null?void 0:i.baseUrl)||"https://generativelanguage.googleapis.com/v1beta/openai/"}),K([s,r],()=>{a.value[e]={...a.value[e],apiKey:s.value,baseUrl:r.value||"https://generativelanguage.googleapis.com/v1beta/openai/"}});function b(){a.value[e]={baseUrl:"https://generativelanguage.googleapis.com/v1beta/openai/"}}return(o,i)=>{var d,g;return x(),w(t(B),{"provider-name":((d=u.value)==null?void 0:d.localizedName)||"Google | Gemini","provider-icon":(g=u.value)==null?void 0:g.icon,"on-back":()=>t(_).back()},{default:p(()=>[l(t(S),null,{default:p(()=>[l(t(z),{title:t(m)("settings.pages.providers.common.section.basic.title"),description:t(m)("settings.pages.providers.common.section.basic.description"),"on-reset":b},{default:p(()=>{var n;return[l(t(R),{modelValue:s.value,"onUpdate:modelValue":i[0]||(i[0]=h=>s.value=h),"provider-name":((n=u.value)==null?void 0:n.localizedName)||"Google",placeholder:"sk-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(M),{title:t(m)("settings.pages.providers.common.section.advanced.title")},{default:p(()=>[l(t(N),{modelValue:r.value,"onUpdate:modelValue":i[1]||(i[1]=n=>r.value=n),placeholder:"https://generativelanguage.googleapis.com/v1beta/openai/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});typeof f=="function"&&f(C);export{C as default}; diff --git a/assets/image-C2-G5ALe.js b/assets/image-C2-G5ALe.js new file mode 100644 index 0000000000000000000000000000000000000000..ffd6265e7bba76106b76cd491ca18383cd291b95 --- /dev/null +++ b/assets/image-C2-G5ALe.js @@ -0,0 +1,2 @@ +import{d as _,r as c,X as y,c as d,o as u,e as a,j as x,t as v,b,_ as w}from"./index-BNq7Hbz_.js";const h={bg:"neutral-100",flex:"~ col","items-center":"","justify-center":"","rounded-lg":"","px-4":"","py-3":""},C={key:0},U=["src"],R={bg:"neutral-100",class:"text-wrap-any","max-h":"100","overflow-scroll":"","rounded-lg":"","text-wrap":"","text-black":"","font-mono":""},k=_({__name:"image",setup(D){const p=c(),n=c(""),{copy:g}=y({source:n});async function m(s){return new Promise((e,o)=>{const t=new FileReader;t.onload=r=>{var l,i;e(((i=(l=r.target)==null?void 0:l.result)==null?void 0:i.toString())||"")},t.onerror=r=>{o(r)},t.readAsDataURL(s)})}async function f(s){var t;const o=(t=s.target.files)==null?void 0:t[0];if(o){p.value=o;const r=await m(o);n.value=r}}return(s,e)=>(u(),d("div",null,[a("label",h,[a("input",{type:"file",accept:"image/*",hidden:"",onChange:f},null,32),e[1]||(e[1]=a("span",null,"Upload Image",-1))]),n.value?(u(),d("div",C,[a("img",{src:n.value,alt:"Uploaded Image","w-100":""},null,8,U),a("pre",R," "+v(n.value)+` + `,1),a("button",{bg:"primary-500",text:"white","mt-4":"","rounded-lg":"","px-4":"","py-2":"",onClick:e[0]||(e[0]=()=>b(g)())}," Copy Data URL ")])):x("",!0)]))}}),B=w(k,[["__scopeId","data-v-7edd53e6"]]);export{B as default}; diff --git a/assets/image-pnvoD1mw.js b/assets/image-pnvoD1mw.js deleted file mode 100644 index f57f46be502e0ed5a6125e13ff35172b925a33b4..0000000000000000000000000000000000000000 --- a/assets/image-pnvoD1mw.js +++ /dev/null @@ -1,2 +0,0 @@ -import{d as _,r as c,bI as y,c as d,o as u,a,i as x,t as b,u as v,bq as w}from"./index-D3pfQUMu.js";const h={bg:"neutral-100",flex:"~ col","items-center":"","justify-center":"","rounded-lg":"","px-4":"","py-3":""},C={key:0},U=["src"],R={bg:"neutral-100",class:"text-wrap-any","max-h":"100","overflow-scroll":"","rounded-lg":"","text-wrap":"","text-black":"","font-mono":""},k=_({__name:"image",setup(D){const p=c(),n=c(""),{copy:g}=y({source:n});async function m(s){return new Promise((e,o)=>{const t=new FileReader;t.onload=r=>{var l,i;e(((i=(l=r.target)==null?void 0:l.result)==null?void 0:i.toString())||"")},t.onerror=r=>{o(r)},t.readAsDataURL(s)})}async function f(s){var t;const o=(t=s.target.files)==null?void 0:t[0];if(o){p.value=o;const r=await m(o);n.value=r}}return(s,e)=>(u(),d("div",null,[a("label",h,[a("input",{type:"file",accept:"image/*",hidden:"",onChange:f},null,32),e[1]||(e[1]=a("span",null,"Upload Image",-1))]),n.value?(u(),d("div",C,[a("img",{src:n.value,alt:"Uploaded Image","w-100":""},null,8,U),a("pre",R," "+b(n.value)+` - `,1),a("button",{bg:"primary-500",text:"white","mt-4":"","rounded-lg":"","px-4":"","py-2":"",onClick:e[0]||(e[0]=()=>v(g)())}," Copy Data URL ")])):x("",!0)]))}}),I=w(k,[["__scopeId","data-v-7edd53e6"]]);export{I as default}; diff --git a/assets/index-BErwKygs.js b/assets/index-BErwKygs.js deleted file mode 100644 index 6b55d93513e6e457a085743ddbdb608601c9d20b..0000000000000000000000000000000000000000 --- a/assets/index-BErwKygs.js +++ /dev/null @@ -1 +0,0 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-t8bgqiA6.js";import{d as h,k as b,l as v,bz as k,c as t,o as i,a as c,m as d,G as m,bA as l,bB as _,u as s}from"./index-D3pfQUMu.js";import"./three-vrm-animation.module-DLbUhddZ.js";import"./emotions-CAex_2dA.js";import{I as x}from"./IconStatusItem-Do_zSdCF.js";/* empty css */import{_ as I}from"./IconAnimation.vue_vue_type_script_setup_true_lang-DtxQmMu9.js";import{u as z}from"./useIconAnimation-RrGZYl5Z.js";import{b as g}from"./route-block-B_A1xBdJ.js";const B={grid:"~ cols-1 sm:cols-2 gap-4"},A={key:1,text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[calc(100dvh-15rem)]","bottom-0":"","right--5":"","z--1":"",initial:{scale:.9,opacity:0,y:20},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":"",flex:"","items-center":"","justify-center":""},w=h({__name:"index",setup(C){const{t:e}=b(),p=v(()=>[{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:!1},{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:!1},{id:"hearing",name:e("settings.pages.modules.hearing.title"),description:e("settings.pages.modules.hearing.description"),icon:"i-solar:microphone-3-bold-duotone",to:"",configured:!1},{id:"vision",name:e("settings.pages.modules.vision.title"),description:e("settings.pages.modules.vision.description"),icon:"i-solar:eye-closed-bold-duotone",to:"",configured:!1},{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},{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},{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:"",configured:!1},{id:"x",name:e("settings.pages.modules.x.title"),description:e("settings.pages.modules.x.description"),icon:"i-simple-icons:x",to:"",configured:!1},{id:"game-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:"",configured:!1},{id:"game-factorio",name:e("settings.pages.modules.gaming-factorio.title"),description:e("settings.pages.modules.gaming-factorio.description"),iconImage:"",to:"",configured:!1}]),{iconAnimationStarted:u,showIconAnimation:f,animationIcon:y}=z("i-solar:layers-bold-duotone");return(D,n)=>{const r=k("motion");return i(),t(l,null,[c("div",B,[(i(!0),t(l,null,_(p.value,(o,a)=>m((i(),d(s(x),{key:o.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+a*10,delay:a*50,title:o.name,description:o.description,icon:o.icon,"icon-color":o.iconColor,"icon-image":o.iconImage,to:o.to,configured:o.configured},null,8,["duration","delay","title","description","icon","icon-color","icon-image","to","configured"])),[[r]])),128))]),s(f)?(i(),d(I,{key:0,icon:s(y),"icon-size":12,duration:1e3,started:s(u),"is-reverse":!0,"z-index":-1,"text-color":"text-neutral-200/50 dark:text-neutral-600/20",position:"calc(100dvw - 9.5rem), calc(100dvh - 9.5rem)"},null,8,["icon","started"])):m((i(),t("div",A,n[0]||(n[0]=[c("div",{text:"60","i-solar:layers-bold-duotone":""},null,-1)]))),[[r]])],64)}}});typeof g=="function"&&g(w);export{w as default}; diff --git a/assets/index-D3pfQUMu.js b/assets/index-BNq7Hbz_.js similarity index 97% rename from assets/index-D3pfQUMu.js rename to assets/index-BNq7Hbz_.js index 57ce9a1c54cad1a00651c16de07093780fae47bc..e2bbb83c49a72fac883f34fa2d34ecd767f9934e 100644 --- a/assets/index-D3pfQUMu.js +++ b/assets/index-BNq7Hbz_.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/default-DzFYMGHe.js","assets/HeaderLink-SBXLiv0n.js","assets/HeaderLink-DsxHr3rn.css","assets/settings-jO-GKHXW.js","assets/Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-t8bgqiA6.js","assets/Stage-B0Lug85R.css","assets/three-vrm-animation.module-DLbUhddZ.js","assets/emotions-CAex_2dA.js","assets/providers-CCvie00Z.js","assets/index-LHmcipjy.js","assets/Radio-CYvjI7WT.css","assets/index-D3kra94d.js","assets/import-url-browser-CPN8ipMD.js","assets/duckdb-mvp-CaaD-olE.js","assets/speech-CIOuIakE.js","assets/queue-6PX0h0Ry.js","assets/queues-CCpGc-RL.js","assets/index-C4mUnpiM.js","assets/airi-card-vOKXd5VS.js","assets/consciousness-DynZMlUo.js","assets/TransitionVertical.vue_vue_type_script_setup_true_lang-D_DUmSTM.js","assets/Model.vue_vue_type_script_setup_true_lang-CYzfx59_.js","assets/Collapsable.vue_vue_type_script_setup_true_lang-DDNOeGH3.js","assets/index-CdYg-KxO.js","assets/Basic.vue_vue_type_script_setup_true_lang-Sei3qL1b.js","assets/route-block-B_A1xBdJ.js","assets/index-BfhcFkpL.css","assets/background-remove-CM2rMDto.js","assets/InputFile.vue_vue_type_script_setup_true_lang-BFgYfCCt.js","assets/chat-BKZ7zE82.js","assets/image-pnvoD1mw.js","assets/image-BhuwcwI9.css","assets/vibrant-B-3LuKiX.js","assets/browser-CkchkNbv.js","assets/queue-Dr_7aGBJ.js","assets/index-Cr3taKDJ.js","assets/IconAnimation.vue_vue_type_script_setup_true_lang-DtxQmMu9.js","assets/index-DTlkELmN.js","assets/CardDetailDialog.vue_vue_type_script_setup_true_lang-S8wNk2oU.js","assets/DeleteCardDialog.vue_vue_type_script_setup_true_lang-CCouu6-u.js","assets/index-BZFiQ_k-.js","assets/CardListItem.vue_vue_type_script_setup_true_lang-C0yUofWx.js","assets/CardDetailDialog-mu8EzJmZ.js","assets/CardListItem-ztWYktU9.js","assets/DeleteCardDialog-BWC1TUJo.js","assets/index-Bx6crezv.js","assets/ColorPalette.vue_vue_type_script_setup_true_lang-BEcLR9qj.js","assets/index-CHoWYJ6u.css","assets/index-BtU1L1YB.js","assets/index-QxR2H6V8.js","assets/useIconAnimation-RrGZYl5Z.js","assets/index-rlpEp8ML.css","assets/index-BErwKygs.js","assets/IconStatusItem-Do_zSdCF.js","assets/consciousness-tp80ZbML.js","assets/RadioCardSimple-DtKqsojA.js","assets/Input.vue_vue_type_script_setup_true_lang-B223oRg0.js","assets/memory-long-term-CizHAZiS.js","assets/memory-short-term-C9gGzqJ9.js","assets/speech-CskFWSHK.js","assets/FieldRange.vue_vue_type_script_setup_true_lang-IEKed7Lk.js","assets/FieldInput.vue_vue_type_script_setup_true_lang-Brkyubp9.js","assets/Textarea.vue_vue_type_script_setup_true_lang-DYk_co3B.js","assets/index-DqB314Ha.js","assets/alibaba-cloud-model-studio-D2Z7LyWw.js","assets/SpeechProviderSettings.vue_vue_type_script_setup_true_lang-ByvvVpU4.js","assets/ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Qp-g_fu5.js","assets/ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-yC-Tsbbb.js","assets/ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C8wZQWhG.js","assets/anthropic-Ph_Cu-AQ.js","assets/ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-CRYYAVy7.js","assets/cloudflare-workers-ai-BelZ37WY.js","assets/deepseek-CYpdpBQ2.js","assets/elevenlabs-DWHleb5O.js","assets/featherless-ai-DARE6Tp5.js","assets/fireworks-ai-C8z0lOo5.js","assets/google-generative-ai-B68fMhhy.js","assets/microsoft-speech-Q7Jza_kf.js","assets/mistral-ai-BHjEqcAG.js","assets/moonshot-ai-CDYGrHyM.js","assets/novita-ai-DyRbwzhU.js","assets/ollama-x64Z6--K.js","assets/openai-Dt0OWE1-.js","assets/openrouter-ai-DEt-Ma_F.js","assets/together-ai-BRgSdW5k.js","assets/volcengine-hdss6LC5.js","assets/xai-DGMMhjzA.js","assets/index-ZPnS1DDS.js","assets/filter-message-DE-HM8Ub.js","assets/delays-GOvkFfLX.js","assets/emotions-D1MeHkXq.js","assets/messages-Co8AZqus.js"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/default-BpwML_61.js","assets/HeaderLink-nC9K3Z33.js","assets/HeaderLink-DsxHr3rn.css","assets/settings-DddKw7XJ.js","assets/Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-B6whjTNv.js","assets/Stage-B0Lug85R.css","assets/three-vrm-animation.module-BPuMi1if.js","assets/mcp-D2taTyhO.js","assets/mini_xsschema-P_8cZcRg.js","assets/providers-Ddg6LLwH.js","assets/index-LHmcipjy.js","assets/Radio-CYvjI7WT.css","assets/index-D1xt2h2l.js","assets/import-url-browser-CPN8ipMD.js","assets/duckdb-mvp-CaaD-olE.js","assets/speech-CKvssz06.js","assets/queue-Bkpr_I5o.js","assets/queues-yzb6LxwZ.js","assets/index-C4mUnpiM.js","assets/airi-card-BqbOXX1s.js","assets/consciousness-BV44f_Xl.js","assets/TransitionVertical.vue_vue_type_script_setup_true_lang-BlPB-gCV.js","assets/Model.vue_vue_type_script_setup_true_lang-DPC1qTx5.js","assets/Collapsable.vue_vue_type_script_setup_true_lang-IiDV8qQX.js","assets/index-BVssmUEI.js","assets/Basic.vue_vue_type_script_setup_true_lang-DiEujAxb.js","assets/route-block-B_A1xBdJ.js","assets/index-BfhcFkpL.css","assets/background-remove-B5-hUPmC.js","assets/InputFile.vue_vue_type_script_setup_true_lang-DHNEAW-b.js","assets/chat-CFaWDr1y.js","assets/image-C2-G5ALe.js","assets/image-BhuwcwI9.css","assets/vibrant-BjWjzLe_.js","assets/browser-CkchkNbv.js","assets/queue-CPjEEqUV.js","assets/index-TkjzwIq7.js","assets/IconAnimation.vue_vue_type_script_setup_true_lang-D-TDNw-F.js","assets/index-DjtWjpVM.js","assets/CardDetailDialog.vue_vue_type_script_setup_true_lang-DgSekOLF.js","assets/DeleteCardDialog.vue_vue_type_script_setup_true_lang-C2ofomcy.js","assets/index-Df6I5b4c.js","assets/CardListItem.vue_vue_type_script_setup_true_lang-CGSvzeuN.js","assets/CardDetailDialog-qMNZyDHS.js","assets/CardListItem-CEhV1j5b.js","assets/DeleteCardDialog-BBI3VAtl.js","assets/index-D0HHrws7.js","assets/ColorPalette.vue_vue_type_script_setup_true_lang-AiOxL6bj.js","assets/index-CHoWYJ6u.css","assets/index-G9i1VvgN.js","assets/index-DdibLJzw.js","assets/useIconAnimation-CpaNr068.js","assets/index-rlpEp8ML.css","assets/index-CISelA4u.js","assets/IconStatusItem-CqRKpLO4.js","assets/consciousness-Ce8qJ0rp.js","assets/RadioCardSimple-DTOaU_HK.js","assets/Input.vue_vue_type_script_setup_true_lang-1pgLpBi1.js","assets/memory-long-term-C3AAmu0J.js","assets/memory-short-term-ma1r-ic1.js","assets/speech-Pn8felHV.js","assets/FieldRange.vue_vue_type_script_setup_true_lang-RRSKRN5w.js","assets/FieldInput.vue_vue_type_script_setup_true_lang-IanARj3w.js","assets/Textarea.vue_vue_type_script_setup_true_lang-DVhP8J-8.js","assets/index-rh9u0eeX.js","assets/alibaba-cloud-model-studio-BTh-z50z.js","assets/SpeechProviderSettings.vue_vue_type_script_setup_true_lang-DQ9q1Mut.js","assets/ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DETFnj2t.js","assets/ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-8yNUgi8_.js","assets/ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C-W-PZMl.js","assets/anthropic-B-QXh4_7.js","assets/ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-kCkYL1sn.js","assets/cloudflare-workers-ai-DTBoU9aK.js","assets/deepseek-BW4eoDhy.js","assets/elevenlabs-DEXiXl5s.js","assets/featherless-ai-B2aQkHo9.js","assets/fireworks-ai-BN-10Pky.js","assets/google-generative-ai-BWKD0Fn7.js","assets/microsoft-speech-JS0kPLKG.js","assets/mistral-ai-CbulwOqs.js","assets/moonshot-ai-Cxu00yNw.js","assets/novita-ai-CuTBCJhw.js","assets/ollama-C5hsqtdz.js","assets/openai-C8A-hPqI.js","assets/openrouter-ai-CSDlnHSe.js","assets/together-ai-DYtDSEI-.js","assets/volcengine-byeJ4X8x.js","assets/xai-Dhgty11s.js","assets/index-DlpcTXeT.js","assets/filter-message-BXRmVdLj.js","assets/delays-BI9nYLvl.js","assets/emotions-CIHTBxtQ.js","assets/messages-MQBl8nH2.js"])))=>i.map(i=>d[i]); var tC=Object.defineProperty;var nC=(n,e,t)=>e in n?tC(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var fi=(n,e,t)=>nC(n,typeof e!="symbol"?e+"":e,t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const r of s)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(s){const r={};return s.integrity&&(r.integrity=s.integrity),s.referrerPolicy&&(r.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?r.credentials="include":s.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(s){if(s.ep)return;s.ep=!0;const r=t(s);fetch(s.href,r)}})();const iC="modulepreload",sC=function(n){return"/"+n},fv={},je=function(e,t,i){let s=Promise.resolve();if(t&&t.length>0){let o=function(c){return Promise.all(c.map(u=>Promise.resolve(u).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),l=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));s=o(t.map(c=>{if(c=sC(c),c in fv)return;fv[c]=!0;const u=c.endsWith(".css"),f=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${f}`))return;const d=document.createElement("link");if(d.rel=u?"stylesheet":iC,u||(d.as="script"),d.crossOrigin="",d.href=c,l&&d.setAttribute("nonce",l),document.head.appendChild(d),u)return new Promise((h,p)=>{d.addEventListener("load",h),d.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${c}`)))})}))}function r(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return s.then(o=>{for(const a of o||[])a.status==="rejected"&&r(a.reason);return e().catch(r)})};/** * @vue/shared v3.5.13 * (c) 2018-present Yuxi (Evan) You and Vue contributors @@ -3846,11 +3846,11 @@ void main() { * pinia v3.0.2 * (c) 2025 Eduardo San Martin Morote * @license MIT - */let Pw;const Xh=n=>Pw=n,Iw=Symbol();function Xg(n){return n&&typeof n=="object"&&Object.prototype.toString.call(n)==="[object Object]"&&typeof n.toJSON!="function"}var zl;(function(n){n.direct="direct",n.patchObject="patch object",n.patchFunction="patch function"})(zl||(zl={}));function Oz(){const n=y0(!0),e=n.run(()=>et({}));let t=[],i=[];const s=T0({install(r){Xh(s),s._a=r,r.provide(Iw,s),r.config.globalProperties.$pinia=s,i.forEach(o=>t.push(o)),i=[]},use(r){return this._a?t.push(r):i.push(r),this},_p:t,_a:null,_e:n,_s:new Map,state:e});return s}const Lw=()=>{};function mx(n,e,t,i=Lw){n.push(e);const s=()=>{const r=n.indexOf(e);r>-1&&(n.splice(r,1),i())};return!t&&qd()&&b0(s),s}function na(n,...e){n.slice().forEach(t=>{t(...e)})}const Nz=n=>n(),gx=Symbol(),bm=Symbol();function $g(n,e){n instanceof Map&&e instanceof Map?e.forEach((t,i)=>n.set(i,t)):n instanceof Set&&e instanceof Set&&e.forEach(n.add,n);for(const t in e){if(!e.hasOwnProperty(t))continue;const i=e[t],s=n[t];Xg(s)&&Xg(i)&&n.hasOwnProperty(t)&&!Pt(i)&&!Is(i)?n[t]=$g(s,i):n[t]=i}return n}const Uz=Symbol();function Fz(n){return!Xg(n)||!Object.prototype.hasOwnProperty.call(n,Uz)}const{assign:ir}=Object;function kz(n){return!!(Pt(n)&&n.effect)}function Bz(n,e,t,i){const{state:s,actions:r,getters:o}=e,a=t.state.value[n];let l;function c(){a||(t.state.value[n]=s?s():{});const u=uS(t.state.value[n]);return ir(u,r,Object.keys(o||{}).reduce((f,d)=>(f[d]=T0(Me(()=>{Xh(t);const h=t._s.get(n);return o[d].call(h,h)})),f),{}))}return l=Dw(n,c,e,t,i,!0),l}function Dw(n,e,t={},i,s,r){let o;const a=ir({actions:{}},t),l={deep:!0};let c,u,f=[],d=[],h;const p=i.state.value[n];!r&&!p&&(i.state.value[n]={}),et({});let _;function g(P){let x;c=u=!1,typeof P=="function"?(P(i.state.value[n]),x={type:zl.patchFunction,storeId:n,events:h}):($g(i.state.value[n],P),x={type:zl.patchObject,payload:P,storeId:n,events:h});const M=_=Symbol();wr().then(()=>{_===M&&(c=!0)}),u=!0,na(f,x,i.state.value[n])}const m=r?function(){const{state:x}=t,M=x?x():{};this.$patch(I=>{ir(I,M)})}:Lw;function y(){o.stop(),f=[],d=[],i._s.delete(n)}const b=(P,x="")=>{if(gx in P)return P[bm]=x,P;const M=function(){Xh(i);const I=Array.from(arguments),N=[],V=[];function j(ee){N.push(ee)}function te(ee){V.push(ee)}na(d,{args:I,name:M[bm],store:E,after:j,onError:te});let Z;try{Z=P.apply(this&&this.$id===n?this:E,I)}catch(ee){throw na(V,ee),ee}return Z instanceof Promise?Z.then(ee=>(na(N,ee),ee)).catch(ee=>(na(V,ee),Promise.reject(ee))):(na(N,Z),Z)};return M[gx]=!0,M[bm]=x,M},v={_p:i,$id:n,$onAction:mx.bind(null,d),$patch:g,$reset:m,$subscribe(P,x={}){const M=mx(f,P,x.detached,()=>I()),I=o.run(()=>Xe(()=>i.state.value[n],N=>{(x.flush==="sync"?u:c)&&P({storeId:n,type:zl.direct,events:h},N)},ir({},l,x)));return M},$dispose:y},E=xi(v);i._s.set(n,E);const S=(i._a&&i._a.runWithContext||Nz)(()=>i._e.run(()=>(o=y0()).run(()=>e({action:b}))));for(const P in S){const x=S[P];if(Pt(x)&&!kz(x)||Is(x))r||(p&&Fz(x)&&(Pt(x)?x.value=p[P]:$g(x,p[P])),i.state.value[n][P]=x);else if(typeof x=="function"){const M=b(x,P);S[P]=M,a.actions[P]=x}}return ir(E,S),ir(ut(E),S),Object.defineProperty(E,"$state",{get:()=>i.state.value[n],set:P=>{g(x=>{ir(x,P)})}}),i._p.forEach(P=>{ir(E,o.run(()=>P({store:E,app:i._a,pinia:i,options:a})))}),p&&r&&t.hydrate&&t.hydrate(E.$state,p),c=!0,u=!0,E}/*! #__NO_SIDE_EFFECTS__ */function zz(n,e,t){let i;const s=typeof e=="function";i=s?t:e;function r(o,a){const l=Rc();return o=o||(l?mn(Iw,null):null),o&&Xh(o),o=Pw,o._s.has(n)||(s?Dw(n,e,i,o):Bz(n,i,o)),o._s.get(n)}return r.$id=n,r}function Vz(n){const e=ut(n),t={};for(const i in e){const s=e[i];s.effect?t[i]=Me({get:()=>n[i],set(r){n[i]=r}}):(Pt(s)||Is(s))&&(t[i]=fS(n,i))}return t}const Hz=n=>{const e={};Object.entries(Object.assign({"/src/layouts/default.vue":()=>je(()=>import("./default-DzFYMGHe.js"),__vite__mapDeps([0,1,2])),"/src/layouts/settings.vue":()=>je(()=>import("./settings-jO-GKHXW.js"),__vite__mapDeps([3,4,5,6,7,8,9,1,2,10])),"/src/layouts/stage.vue":()=>je(()=>import("./stage-DyJiUv5T.js"),[])})).forEach(([s,r])=>{let o=s.replace("/src/layouts/","").replace(".vue","");e[o]=r});function i(s,r=!0){return s.map(o=>{var a,l,c,u,f,d;if(((a=o.children)==null?void 0:a.length)>0&&(o.children=i(o.children,!1)),r){if(!o.component&&((l=o.children)==null?void 0:l.find(p=>{var _;return(p.path===""||p.path==="/")&&((_=p.meta)==null?void 0:_.isLayout)})))return o;if(((c=o.meta)==null?void 0:c.layout)!==!1)return{path:o.path,component:e[((u=o.meta)==null?void 0:u.layout)||"default"],children:o.path==="/"?[o]:[{...o,path:""}],meta:{isLayout:!0}}}return(f=o.meta)!=null&&f.layout?{path:o.path,component:e[(d=o.meta)==null?void 0:d.layout],children:[{...o,path:""}],meta:{isLayout:!0}}:o})}return i(n)};/*! + */let Pw;const Xh=n=>Pw=n,Iw=Symbol();function Xg(n){return n&&typeof n=="object"&&Object.prototype.toString.call(n)==="[object Object]"&&typeof n.toJSON!="function"}var zl;(function(n){n.direct="direct",n.patchObject="patch object",n.patchFunction="patch function"})(zl||(zl={}));function Oz(){const n=y0(!0),e=n.run(()=>et({}));let t=[],i=[];const s=T0({install(r){Xh(s),s._a=r,r.provide(Iw,s),r.config.globalProperties.$pinia=s,i.forEach(o=>t.push(o)),i=[]},use(r){return this._a?t.push(r):i.push(r),this},_p:t,_a:null,_e:n,_s:new Map,state:e});return s}const Lw=()=>{};function mx(n,e,t,i=Lw){n.push(e);const s=()=>{const r=n.indexOf(e);r>-1&&(n.splice(r,1),i())};return!t&&qd()&&b0(s),s}function na(n,...e){n.slice().forEach(t=>{t(...e)})}const Nz=n=>n(),gx=Symbol(),bm=Symbol();function $g(n,e){n instanceof Map&&e instanceof Map?e.forEach((t,i)=>n.set(i,t)):n instanceof Set&&e instanceof Set&&e.forEach(n.add,n);for(const t in e){if(!e.hasOwnProperty(t))continue;const i=e[t],s=n[t];Xg(s)&&Xg(i)&&n.hasOwnProperty(t)&&!Pt(i)&&!Is(i)?n[t]=$g(s,i):n[t]=i}return n}const Uz=Symbol();function Fz(n){return!Xg(n)||!Object.prototype.hasOwnProperty.call(n,Uz)}const{assign:ir}=Object;function kz(n){return!!(Pt(n)&&n.effect)}function Bz(n,e,t,i){const{state:s,actions:r,getters:o}=e,a=t.state.value[n];let l;function c(){a||(t.state.value[n]=s?s():{});const u=uS(t.state.value[n]);return ir(u,r,Object.keys(o||{}).reduce((f,d)=>(f[d]=T0(Me(()=>{Xh(t);const h=t._s.get(n);return o[d].call(h,h)})),f),{}))}return l=Dw(n,c,e,t,i,!0),l}function Dw(n,e,t={},i,s,r){let o;const a=ir({actions:{}},t),l={deep:!0};let c,u,f=[],d=[],h;const p=i.state.value[n];!r&&!p&&(i.state.value[n]={}),et({});let _;function g(P){let x;c=u=!1,typeof P=="function"?(P(i.state.value[n]),x={type:zl.patchFunction,storeId:n,events:h}):($g(i.state.value[n],P),x={type:zl.patchObject,payload:P,storeId:n,events:h});const M=_=Symbol();wr().then(()=>{_===M&&(c=!0)}),u=!0,na(f,x,i.state.value[n])}const m=r?function(){const{state:x}=t,M=x?x():{};this.$patch(I=>{ir(I,M)})}:Lw;function y(){o.stop(),f=[],d=[],i._s.delete(n)}const b=(P,x="")=>{if(gx in P)return P[bm]=x,P;const M=function(){Xh(i);const I=Array.from(arguments),N=[],V=[];function j(ee){N.push(ee)}function te(ee){V.push(ee)}na(d,{args:I,name:M[bm],store:E,after:j,onError:te});let Z;try{Z=P.apply(this&&this.$id===n?this:E,I)}catch(ee){throw na(V,ee),ee}return Z instanceof Promise?Z.then(ee=>(na(N,ee),ee)).catch(ee=>(na(V,ee),Promise.reject(ee))):(na(N,Z),Z)};return M[gx]=!0,M[bm]=x,M},v={_p:i,$id:n,$onAction:mx.bind(null,d),$patch:g,$reset:m,$subscribe(P,x={}){const M=mx(f,P,x.detached,()=>I()),I=o.run(()=>Xe(()=>i.state.value[n],N=>{(x.flush==="sync"?u:c)&&P({storeId:n,type:zl.direct,events:h},N)},ir({},l,x)));return M},$dispose:y},E=xi(v);i._s.set(n,E);const S=(i._a&&i._a.runWithContext||Nz)(()=>i._e.run(()=>(o=y0()).run(()=>e({action:b}))));for(const P in S){const x=S[P];if(Pt(x)&&!kz(x)||Is(x))r||(p&&Fz(x)&&(Pt(x)?x.value=p[P]:$g(x,p[P])),i.state.value[n][P]=x);else if(typeof x=="function"){const M=b(x,P);S[P]=M,a.actions[P]=x}}return ir(E,S),ir(ut(E),S),Object.defineProperty(E,"$state",{get:()=>i.state.value[n],set:P=>{g(x=>{ir(x,P)})}}),i._p.forEach(P=>{ir(E,o.run(()=>P({store:E,app:i._a,pinia:i,options:a})))}),p&&r&&t.hydrate&&t.hydrate(E.$state,p),c=!0,u=!0,E}/*! #__NO_SIDE_EFFECTS__ */function zz(n,e,t){let i;const s=typeof e=="function";i=s?t:e;function r(o,a){const l=Rc();return o=o||(l?mn(Iw,null):null),o&&Xh(o),o=Pw,o._s.has(n)||(s?Dw(n,e,i,o):Bz(n,i,o)),o._s.get(n)}return r.$id=n,r}function Vz(n){const e=ut(n),t={};for(const i in e){const s=e[i];s.effect?t[i]=Me({get:()=>n[i],set(r){n[i]=r}}):(Pt(s)||Is(s))&&(t[i]=fS(n,i))}return t}const Hz=n=>{const e={};Object.entries(Object.assign({"/src/layouts/default.vue":()=>je(()=>import("./default-BpwML_61.js"),__vite__mapDeps([0,1,2])),"/src/layouts/settings.vue":()=>je(()=>import("./settings-DddKw7XJ.js"),__vite__mapDeps([3,4,5,6,7,8,9,10,1,2,11])),"/src/layouts/stage.vue":()=>je(()=>import("./stage-D2VVUTOX.js"),[])})).forEach(([s,r])=>{let o=s.replace("/src/layouts/","").replace(".vue","");e[o]=r});function i(s,r=!0){return s.map(o=>{var a,l,c,u,f,d;if(((a=o.children)==null?void 0:a.length)>0&&(o.children=i(o.children,!1)),r){if(!o.component&&((l=o.children)==null?void 0:l.find(p=>{var _;return(p.path===""||p.path==="/")&&((_=p.meta)==null?void 0:_.isLayout)})))return o;if(((c=o.meta)==null?void 0:c.layout)!==!1)return{path:o.path,component:e[((u=o.meta)==null?void 0:u.layout)||"default"],children:o.path==="/"?[o]:[{...o,path:""}],meta:{isLayout:!0}}}return(f=o.meta)!=null&&f.layout?{path:o.path,component:e[(d=o.meta)==null?void 0:d.layout],children:[{...o,path:""}],meta:{isLayout:!0}}:o})}return i(n)};/*! * vue-router v4.5.1 * (c) 2025 Eduardo San Martin Morote * @license MIT - */const sa=typeof document<"u";function Ow(n){return typeof n=="object"||"displayName"in n||"props"in n||"__vccOpts"in n}function Gz(n){return n.__esModule||n[Symbol.toStringTag]==="Module"||n.default&&Ow(n.default)}const Mt=Object.assign;function xm(n,e){const t={};for(const i in e){const s=e[i];t[i]=Vi(s)?s.map(n):n(s)}return t}const Vl=()=>{},Vi=Array.isArray,Nw=/#/g,Wz=/&/g,Xz=/\//g,$z=/=/g,qz=/\?/g,Uw=/\+/g,Yz=/%5B/g,jz=/%5D/g,Fw=/%5E/g,Kz=/%60/g,kw=/%7B/g,Zz=/%7C/g,Bw=/%7D/g,Jz=/%20/g;function z_(n){return encodeURI(""+n).replace(Zz,"|").replace(Yz,"[").replace(jz,"]")}function Qz(n){return z_(n).replace(kw,"{").replace(Bw,"}").replace(Fw,"^")}function qg(n){return z_(n).replace(Uw,"%2B").replace(Jz,"+").replace(Nw,"%23").replace(Wz,"%26").replace(Kz,"`").replace(kw,"{").replace(Bw,"}").replace(Fw,"^")}function eV(n){return qg(n).replace($z,"%3D")}function tV(n){return z_(n).replace(Nw,"%23").replace(qz,"%3F")}function nV(n){return n==null?"":tV(n).replace(Xz,"%2F")}function xc(n){try{return decodeURIComponent(""+n)}catch{}return""+n}const iV=/\/$/,sV=n=>n.replace(iV,"");function Mm(n,e,t="/"){let i,s={},r="",o="";const a=e.indexOf("#");let l=e.indexOf("?");return a=0&&(l=-1),l>-1&&(i=e.slice(0,l),r=e.slice(l+1,a>-1?a:e.length),s=n(r)),a>-1&&(i=i||e.slice(0,a),o=e.slice(a,e.length)),i=lV(i??e,t),{fullPath:i+(r&&"?")+r+o,path:i,query:s,hash:xc(o)}}function rV(n,e){const t=e.query?n(e.query):"";return e.path+(t&&"?")+t+(e.hash||"")}function _x(n,e){return!e||!n.toLowerCase().startsWith(e.toLowerCase())?n:n.slice(e.length)||"/"}function oV(n,e,t){const i=e.matched.length-1,s=t.matched.length-1;return i>-1&&i===s&&Ia(e.matched[i],t.matched[s])&&zw(e.params,t.params)&&n(e.query)===n(t.query)&&e.hash===t.hash}function Ia(n,e){return(n.aliasOf||n)===(e.aliasOf||e)}function zw(n,e){if(Object.keys(n).length!==Object.keys(e).length)return!1;for(const t in n)if(!aV(n[t],e[t]))return!1;return!0}function aV(n,e){return Vi(n)?vx(n,e):Vi(e)?vx(e,n):n===e}function vx(n,e){return Vi(e)?n.length===e.length&&n.every((t,i)=>t===e[i]):n.length===1&&n[0]===e}function lV(n,e){if(n.startsWith("/"))return n;if(!n)return e;const t=e.split("/"),i=n.split("/"),s=i[i.length-1];(s===".."||s===".")&&i.push("");let r=t.length-1,o,a;for(o=0;o1&&r--;else break;return t.slice(0,r).join("/")+"/"+i.slice(o).join("/")}const tr={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};var Mc;(function(n){n.pop="pop",n.push="push"})(Mc||(Mc={}));var Hl;(function(n){n.back="back",n.forward="forward",n.unknown=""})(Hl||(Hl={}));function cV(n){if(!n)if(sa){const e=document.querySelector("base");n=e&&e.getAttribute("href")||"/",n=n.replace(/^\w+:\/\/[^\/]+/,"")}else n="/";return n[0]!=="/"&&n[0]!=="#"&&(n="/"+n),sV(n)}const uV=/^[^#]+#/;function fV(n,e){return n.replace(uV,"#")+e}function dV(n,e){const t=document.documentElement.getBoundingClientRect(),i=n.getBoundingClientRect();return{behavior:e.behavior,left:i.left-t.left-(e.left||0),top:i.top-t.top-(e.top||0)}}const $h=()=>({left:window.scrollX,top:window.scrollY});function hV(n){let e;if("el"in n){const t=n.el,i=typeof t=="string"&&t.startsWith("#"),s=typeof t=="string"?i?document.getElementById(t.slice(1)):document.querySelector(t):t;if(!s)return;e=dV(s,n)}else e=n;"scrollBehavior"in document.documentElement.style?window.scrollTo(e):window.scrollTo(e.left!=null?e.left:window.scrollX,e.top!=null?e.top:window.scrollY)}function yx(n,e){return(history.state?history.state.position-e:-1)+n}const Yg=new Map;function pV(n,e){Yg.set(n,e)}function mV(n){const e=Yg.get(n);return Yg.delete(n),e}let gV=()=>location.protocol+"//"+location.host;function Vw(n,e){const{pathname:t,search:i,hash:s}=e,r=n.indexOf("#");if(r>-1){let a=s.includes(n.slice(r))?n.slice(r).length:1,l=s.slice(a);return l[0]!=="/"&&(l="/"+l),_x(l,"")}return _x(t,n)+i+s}function _V(n,e,t,i){let s=[],r=[],o=null;const a=({state:d})=>{const h=Vw(n,location),p=t.value,_=e.value;let g=0;if(d){if(t.value=h,e.value=d,o&&o===p){o=null;return}g=_?d.position-_.position:0}else i(h);s.forEach(m=>{m(t.value,p,{delta:g,type:Mc.pop,direction:g?g>0?Hl.forward:Hl.back:Hl.unknown})})};function l(){o=t.value}function c(d){s.push(d);const h=()=>{const p=s.indexOf(d);p>-1&&s.splice(p,1)};return r.push(h),h}function u(){const{history:d}=window;d.state&&d.replaceState(Mt({},d.state,{scroll:$h()}),"")}function f(){for(const d of r)d();r=[],window.removeEventListener("popstate",a),window.removeEventListener("beforeunload",u)}return window.addEventListener("popstate",a),window.addEventListener("beforeunload",u,{passive:!0}),{pauseListeners:l,listen:c,destroy:f}}function bx(n,e,t,i=!1,s=!1){return{back:n,current:e,forward:t,replaced:i,position:window.history.length,scroll:s?$h():null}}function vV(n){const{history:e,location:t}=window,i={value:Vw(n,t)},s={value:e.state};s.value||r(i.value,{back:null,current:i.value,forward:null,position:e.length-1,replaced:!0,scroll:null},!0);function r(l,c,u){const f=n.indexOf("#"),d=f>-1?(t.host&&document.querySelector("base")?n:n.slice(f))+l:gV()+n+l;try{e[u?"replaceState":"pushState"](c,"",d),s.value=c}catch(h){console.error(h),t[u?"replace":"assign"](d)}}function o(l,c){const u=Mt({},e.state,bx(s.value.back,l,s.value.forward,!0),c,{position:s.value.position});r(l,u,!0),i.value=l}function a(l,c){const u=Mt({},s.value,e.state,{forward:l,scroll:$h()});r(u.current,u,!0);const f=Mt({},bx(i.value,l,null),{position:u.position+1},c);r(l,f,!1),i.value=l}return{location:i,state:s,push:a,replace:o}}function yV(n){n=cV(n);const e=vV(n),t=_V(n,e.state,e.location,e.replace);function i(r,o=!0){o||t.pauseListeners(),history.go(r)}const s=Mt({location:"",base:n,go:i,createHref:fV.bind(null,n)},e,t);return Object.defineProperty(s,"location",{enumerable:!0,get:()=>e.location.value}),Object.defineProperty(s,"state",{enumerable:!0,get:()=>e.state.value}),s}function bV(n){return n=location.host?n||location.pathname+location.search:"",n.includes("#")||(n+="#"),yV(n)}function xV(n){return typeof n=="string"||n&&typeof n=="object"}function Hw(n){return typeof n=="string"||typeof n=="symbol"}const Gw=Symbol("");var xx;(function(n){n[n.aborted=4]="aborted",n[n.cancelled=8]="cancelled",n[n.duplicated=16]="duplicated"})(xx||(xx={}));function La(n,e){return Mt(new Error,{type:n,[Gw]:!0},e)}function ys(n,e){return n instanceof Error&&Gw in n&&(e==null||!!(n.type&e))}const Mx="[^/]+?",MV={sensitive:!1,strict:!1,start:!0,end:!0},SV=/[.+*?^${}()[\]/\\]/g;function EV(n,e){const t=Mt({},MV,e),i=[];let s=t.start?"^":"";const r=[];for(const c of n){const u=c.length?[]:[90];t.strict&&!c.length&&(s+="/");for(let f=0;fe.length?e.length===1&&e[0]===80?1:-1:0}function Ww(n,e){let t=0;const i=n.score,s=e.score;for(;t0&&e[e.length-1]<0}const wV={type:0,value:""},AV=/[a-zA-Z0-9_]/;function CV(n){if(!n)return[[]];if(n==="/")return[[wV]];if(!n.startsWith("/"))throw new Error(`Invalid path "${n}"`);function e(h){throw new Error(`ERR (${t})/"${c}": ${h}`)}let t=0,i=t;const s=[];let r;function o(){r&&s.push(r),r=[]}let a=0,l,c="",u="";function f(){c&&(t===0?r.push({type:0,value:c}):t===1||t===2||t===3?(r.length>1&&(l==="*"||l==="+")&&e(`A repeatable param (${c}) must be alone in its segment. eg: '/:ids+.`),r.push({type:1,value:c,regexp:u,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):e("Invalid state to consume buffer"),c="")}function d(){c+=l}for(;a{o(b)}:Vl}function o(f){if(Hw(f)){const d=i.get(f);d&&(i.delete(f),t.splice(t.indexOf(d),1),d.children.forEach(o),d.alias.forEach(o))}else{const d=t.indexOf(f);d>-1&&(t.splice(d,1),f.record.name&&i.delete(f.record.name),f.children.forEach(o),f.alias.forEach(o))}}function a(){return t}function l(f){const d=DV(f,t);t.splice(d,0,f),f.record.name&&!wx(f)&&i.set(f.record.name,f)}function c(f,d){let h,p={},_,g;if("name"in f&&f.name){if(h=i.get(f.name),!h)throw La(1,{location:f});g=h.record.name,p=Mt(Ex(d.params,h.keys.filter(b=>!b.optional).concat(h.parent?h.parent.keys.filter(b=>b.optional):[]).map(b=>b.name)),f.params&&Ex(f.params,h.keys.map(b=>b.name))),_=h.stringify(p)}else if(f.path!=null)_=f.path,h=t.find(b=>b.re.test(_)),h&&(p=h.parse(_),g=h.record.name);else{if(h=d.name?i.get(d.name):t.find(b=>b.re.test(d.path)),!h)throw La(1,{location:f,currentLocation:d});g=h.record.name,p=Mt({},d.params,f.params),_=h.stringify(p)}const m=[];let y=h;for(;y;)m.unshift(y.record),y=y.parent;return{name:g,path:_,params:p,matched:m,meta:LV(m)}}n.forEach(f=>r(f));function u(){t.length=0,i.clear()}return{addRoute:r,resolve:c,removeRoute:o,clearRoutes:u,getRoutes:a,getRecordMatcher:s}}function Ex(n,e){const t={};for(const i of e)i in n&&(t[i]=n[i]);return t}function Tx(n){const e={path:n.path,redirect:n.redirect,name:n.name,meta:n.meta||{},aliasOf:n.aliasOf,beforeEnter:n.beforeEnter,props:IV(n),children:n.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in n?n.components||null:n.component&&{default:n.component}};return Object.defineProperty(e,"mods",{value:{}}),e}function IV(n){const e={},t=n.props||!1;if("component"in n)e.default=t;else for(const i in n.components)e[i]=typeof t=="object"?t[i]:t;return e}function wx(n){for(;n;){if(n.record.aliasOf)return!0;n=n.parent}return!1}function LV(n){return n.reduce((e,t)=>Mt(e,t.meta),{})}function Ax(n,e){const t={};for(const i in n)t[i]=i in e?e[i]:n[i];return t}function DV(n,e){let t=0,i=e.length;for(;t!==i;){const r=t+i>>1;Ww(n,e[r])<0?i=r:t=r+1}const s=OV(n);return s&&(i=e.lastIndexOf(s,i-1)),i}function OV(n){let e=n;for(;e=e.parent;)if(Xw(e)&&Ww(n,e)===0)return e}function Xw({record:n}){return!!(n.name||n.components&&Object.keys(n.components).length||n.redirect)}function NV(n){const e={};if(n===""||n==="?")return e;const i=(n[0]==="?"?n.slice(1):n).split("&");for(let s=0;sr&&qg(r)):[i&&qg(i)]).forEach(r=>{r!==void 0&&(e+=(e.length?"&":"")+t,r!=null&&(e+="="+r))})}return e}function UV(n){const e={};for(const t in n){const i=n[t];i!==void 0&&(e[t]=Vi(i)?i.map(s=>s==null?null:""+s):i==null?i:""+i)}return e}const FV=Symbol(""),Rx=Symbol(""),qh=Symbol(""),V_=Symbol(""),jg=Symbol("");function ul(){let n=[];function e(i){return n.push(i),()=>{const s=n.indexOf(i);s>-1&&n.splice(s,1)}}function t(){n=[]}return{add:e,list:()=>n.slice(),reset:t}}function cr(n,e,t,i,s,r=o=>o()){const o=i&&(i.enterCallbacks[s]=i.enterCallbacks[s]||[]);return()=>new Promise((a,l)=>{const c=d=>{d===!1?l(La(4,{from:t,to:e})):d instanceof Error?l(d):xV(d)?l(La(2,{from:e,to:d})):(o&&i.enterCallbacks[s]===o&&typeof d=="function"&&o.push(d),a())},u=r(()=>n.call(i&&i.instances[s],e,t,c));let f=Promise.resolve(u);n.length<3&&(f=f.then(c)),f.catch(d=>l(d))})}function Sm(n,e,t,i,s=r=>r()){const r=[];for(const o of n)for(const a in o.components){let l=o.components[a];if(!(e!=="beforeRouteEnter"&&!o.instances[a]))if(Ow(l)){const u=(l.__vccOpts||l)[e];u&&r.push(cr(u,t,i,o,a,s))}else{let c=l();r.push(()=>c.then(u=>{if(!u)throw new Error(`Couldn't resolve component "${a}" at "${o.path}"`);const f=Gz(u)?u.default:u;o.mods[a]=u,o.components[a]=f;const h=(f.__vccOpts||f)[e];return h&&cr(h,t,i,o,a,s)()}))}}return r}function Px(n){const e=mn(qh),t=mn(V_),i=Me(()=>{const l=Ot(n.to);return e.resolve(l)}),s=Me(()=>{const{matched:l}=i.value,{length:c}=l,u=l[c-1],f=t.matched;if(!u||!f.length)return-1;const d=f.findIndex(Ia.bind(null,u));if(d>-1)return d;const h=Ix(l[c-2]);return c>1&&Ix(u)===h&&f[f.length-1].path!==h?f.findIndex(Ia.bind(null,l[c-2])):d}),r=Me(()=>s.value>-1&&HV(t.params,i.value.params)),o=Me(()=>s.value>-1&&s.value===t.matched.length-1&&zw(t.params,i.value.params));function a(l={}){if(VV(l)){const c=e[Ot(n.replace)?"replace":"push"](Ot(n.to)).catch(Vl);return n.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>c),c}return Promise.resolve()}return{route:i,href:Me(()=>i.value.href),isActive:r,isExactActive:o,navigate:a}}function kV(n){return n.length===1?n[0]:n}const BV=fn({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:Px,setup(n,{slots:e}){const t=xi(Px(n)),{options:i}=mn(qh),s=Me(()=>({[Lx(n.activeClass,i.linkActiveClass,"router-link-active")]:t.isActive,[Lx(n.exactActiveClass,i.linkExactActiveClass,"router-link-exact-active")]:t.isExactActive}));return()=>{const r=e.default&&kV(e.default(t));return n.custom?r:Ns("a",{"aria-current":t.isExactActive?n.ariaCurrentValue:null,href:t.href,onClick:t.navigate,class:s.value},r)}}}),zV=BV;function VV(n){if(!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)&&!n.defaultPrevented&&!(n.button!==void 0&&n.button!==0)){if(n.currentTarget&&n.currentTarget.getAttribute){const e=n.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return n.preventDefault&&n.preventDefault(),!0}}function HV(n,e){for(const t in e){const i=e[t],s=n[t];if(typeof i=="string"){if(i!==s)return!1}else if(!Vi(s)||s.length!==i.length||i.some((r,o)=>r!==s[o]))return!1}return!0}function Ix(n){return n?n.aliasOf?n.aliasOf.path:n.path:""}const Lx=(n,e,t)=>n??e??t,GV=fn({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(n,{attrs:e,slots:t}){const i=mn(jg),s=Me(()=>n.route||i.value),r=mn(Rx,0),o=Me(()=>{let c=Ot(r);const{matched:u}=s.value;let f;for(;(f=u[c])&&!f.components;)c++;return c}),a=Me(()=>s.value.matched[o.value]);pr(Rx,Me(()=>o.value+1)),pr(FV,a),pr(jg,s);const l=et();return Xe(()=>[l.value,a.value,n.name],([c,u,f],[d,h,p])=>{u&&(u.instances[f]=c,h&&h!==u&&c&&c===d&&(u.leaveGuards.size||(u.leaveGuards=h.leaveGuards),u.updateGuards.size||(u.updateGuards=h.updateGuards))),c&&u&&(!h||!Ia(u,h)||!d)&&(u.enterCallbacks[f]||[]).forEach(_=>_(c))},{flush:"post"}),()=>{const c=s.value,u=n.name,f=a.value,d=f&&f.components[u];if(!d)return Dx(t.default,{Component:d,route:c});const h=f.props[u],p=h?h===!0?c.params:typeof h=="function"?h(c):h:null,g=Ns(d,Mt({},p,e,{onVnodeUnmounted:m=>{m.component.isUnmounted&&(f.instances[u]=null)},ref:l}));return Dx(t.default,{Component:g,route:c})||g}}});function Dx(n,e){if(!n)return null;const t=n(e);return t.length===1?t[0]:t}const $w=GV;function WV(n){const e=PV(n.routes,n),t=n.parseQuery||NV,i=n.stringifyQuery||Cx,s=n.history,r=ul(),o=ul(),a=ul(),l=Oe(tr);let c=tr;sa&&n.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=xm.bind(null,$=>""+$),f=xm.bind(null,nV),d=xm.bind(null,xc);function h($,ae){let le,ce;return Hw($)?(le=e.getRecordMatcher($),ce=ae):ce=$,e.addRoute(ce,le)}function p($){const ae=e.getRecordMatcher($);ae&&e.removeRoute(ae)}function _(){return e.getRoutes().map($=>$.record)}function g($){return!!e.getRecordMatcher($)}function m($,ae){if(ae=Mt({},ae||l.value),typeof $=="string"){const w=Mm(t,$,ae.path),X=e.resolve({path:w.path},ae),G=s.createHref(w.fullPath);return Mt(w,X,{params:d(X.params),hash:xc(w.hash),redirectedFrom:void 0,href:G})}let le;if($.path!=null)le=Mt({},$,{path:Mm(t,$.path,ae.path).path});else{const w=Mt({},$.params);for(const X in w)w[X]==null&&delete w[X];le=Mt({},$,{params:f(w)}),ae.params=f(ae.params)}const ce=e.resolve(le,ae),He=$.hash||"";ce.params=u(d(ce.params));const F=rV(i,Mt({},$,{hash:Qz(He),path:ce.path})),k=s.createHref(F);return Mt({fullPath:F,hash:He,query:i===Cx?UV($.query):$.query||{}},ce,{redirectedFrom:void 0,href:k})}function y($){return typeof $=="string"?Mm(t,$,l.value.path):Mt({},$)}function b($,ae){if(c!==$)return La(8,{from:ae,to:$})}function v($){return S($)}function E($){return v(Mt(y($),{replace:!0}))}function T($){const ae=$.matched[$.matched.length-1];if(ae&&ae.redirect){const{redirect:le}=ae;let ce=typeof le=="function"?le($):le;return typeof ce=="string"&&(ce=ce.includes("?")||ce.includes("#")?ce=y(ce):{path:ce},ce.params={}),Mt({query:$.query,hash:$.hash,params:ce.path!=null?{}:$.params},ce)}}function S($,ae){const le=c=m($),ce=l.value,He=$.state,F=$.force,k=$.replace===!0,w=T(le);if(w)return S(Mt(y(w),{state:typeof w=="object"?Mt({},He,w.state):He,force:F,replace:k}),ae||le);const X=le;X.redirectedFrom=ae;let G;return!F&&oV(i,ce,le)&&(G=La(16,{to:X,from:ce}),se(ce,ce,!0,!1)),(G?Promise.resolve(G):M(X,ce)).catch(W=>ys(W)?ys(W,2)?W:be(W):J(W,X,ce)).then(W=>{if(W){if(ys(W,2))return S(Mt({replace:k},y(W.to),{state:typeof W.to=="object"?Mt({},He,W.to.state):He,force:F}),ae||X)}else W=N(X,ce,!0,k,He);return I(X,ce,W),W})}function P($,ae){const le=b($,ae);return le?Promise.reject(le):Promise.resolve()}function x($){const ae=re.values().next().value;return ae&&typeof ae.runWithContext=="function"?ae.runWithContext($):$()}function M($,ae){let le;const[ce,He,F]=XV($,ae);le=Sm(ce.reverse(),"beforeRouteLeave",$,ae);for(const w of ce)w.leaveGuards.forEach(X=>{le.push(cr(X,$,ae))});const k=P.bind(null,$,ae);return le.push(k),xe(le).then(()=>{le=[];for(const w of r.list())le.push(cr(w,$,ae));return le.push(k),xe(le)}).then(()=>{le=Sm(He,"beforeRouteUpdate",$,ae);for(const w of He)w.updateGuards.forEach(X=>{le.push(cr(X,$,ae))});return le.push(k),xe(le)}).then(()=>{le=[];for(const w of F)if(w.beforeEnter)if(Vi(w.beforeEnter))for(const X of w.beforeEnter)le.push(cr(X,$,ae));else le.push(cr(w.beforeEnter,$,ae));return le.push(k),xe(le)}).then(()=>($.matched.forEach(w=>w.enterCallbacks={}),le=Sm(F,"beforeRouteEnter",$,ae,x),le.push(k),xe(le))).then(()=>{le=[];for(const w of o.list())le.push(cr(w,$,ae));return le.push(k),xe(le)}).catch(w=>ys(w,8)?w:Promise.reject(w))}function I($,ae,le){a.list().forEach(ce=>x(()=>ce($,ae,le)))}function N($,ae,le,ce,He){const F=b($,ae);if(F)return F;const k=ae===tr,w=sa?history.state:{};le&&(ce||k?s.replace($.fullPath,Mt({scroll:k&&w&&w.scroll},He)):s.push($.fullPath,He)),l.value=$,se($,ae,le,k),be()}let V;function j(){V||(V=s.listen(($,ae,le)=>{if(!ge.listening)return;const ce=m($),He=T(ce);if(He){S(Mt(He,{replace:!0,force:!0}),ce).catch(Vl);return}c=ce;const F=l.value;sa&&pV(yx(F.fullPath,le.delta),$h()),M(ce,F).catch(k=>ys(k,12)?k:ys(k,2)?(S(Mt(y(k.to),{force:!0}),ce).then(w=>{ys(w,20)&&!le.delta&&le.type===Mc.pop&&s.go(-1,!1)}).catch(Vl),Promise.reject()):(le.delta&&s.go(-le.delta,!1),J(k,ce,F))).then(k=>{k=k||N(ce,F,!1),k&&(le.delta&&!ys(k,8)?s.go(-le.delta,!1):le.type===Mc.pop&&ys(k,20)&&s.go(-1,!1)),I(ce,F,k)}).catch(Vl)}))}let te=ul(),Z=ul(),ee;function J($,ae,le){be($);const ce=Z.list();return ce.length?ce.forEach(He=>He($,ae,le)):console.error($),Promise.reject($)}function he(){return ee&&l.value!==tr?Promise.resolve():new Promise(($,ae)=>{te.add([$,ae])})}function be($){return ee||(ee=!$,j(),te.list().forEach(([ae,le])=>$?le($):ae()),te.reset()),$}function se($,ae,le,ce){const{scrollBehavior:He}=n;if(!sa||!He)return Promise.resolve();const F=!le&&mV(yx($.fullPath,0))||(ce||!le)&&history.state&&history.state.scroll||null;return wr().then(()=>He($,ae,F)).then(k=>k&&hV(k)).catch(k=>J(k,$,ae))}const ye=$=>s.go($);let Be;const re=new Set,ge={currentRoute:l,listening:!0,addRoute:h,removeRoute:p,clearRoutes:e.clearRoutes,hasRoute:g,getRoutes:_,resolve:m,options:n,push:v,replace:E,go:ye,back:()=>ye(-1),forward:()=>ye(1),beforeEach:r.add,beforeResolve:o.add,afterEach:a.add,onError:Z.add,isReady:he,install($){const ae=this;$.component("RouterLink",zV),$.component("RouterView",$w),$.config.globalProperties.$router=ae,Object.defineProperty($.config.globalProperties,"$route",{enumerable:!0,get:()=>Ot(l)}),sa&&!Be&&l.value===tr&&(Be=!0,v(s.location).catch(He=>{}));const le={};for(const He in tr)Object.defineProperty(le,He,{get:()=>l.value[He],enumerable:!0});$.provide(qh,ae),$.provide(V_,oS(le)),$.provide(jg,l);const ce=$.unmount;re.add($),$.unmount=function(){re.delete($),re.size<1&&(c=tr,V&&V(),V=null,l.value=tr,Be=!1,ee=!1),ce()}}};function xe($){return $.reduce((ae,le)=>ae.then(()=>x(le)),Promise.resolve())}return ge}function XV(n,e){const t=[],i=[],s=[],r=Math.max(e.matched.length,n.matched.length);for(let o=0;oIa(c,a))?i.push(a):t.push(a));const l=n.matched[o];l&&(e.matched.find(c=>Ia(c,l))||s.push(l))}return[t,i,s]}function $V(){return mn(qh)}function OG(n){return mn(V_)}const qV=[{path:"/",name:"/",component:()=>je(()=>import("./index-D3kra94d.js"),__vite__mapDeps([11,4,5,6,7,12,13,14,9,8,15,16,17,18,19,20,21,22,10,1,2,23,24,25,26])),meta:{layout:"stage",stageTransition:{name:"bubble-wave-out"}}},{path:"/:all(.*)",name:"/[...all]",component:()=>je(()=>import("./_...all_-D526ellk.js"),[])},{path:"/audio",name:"/audio",component:()=>je(()=>import("./audio-CAykWCVt.js"),[])},{path:"/devtools",children:[{path:"background-remove",name:"/devtools/background-remove",component:()=>je(()=>import("./background-remove-CM2rMDto.js"),__vite__mapDeps([27,28,10]))},{path:"chat",name:"/devtools/chat",component:()=>je(()=>import("./chat-BKZ7zE82.js"),__vite__mapDeps([29,17,9]))},{path:"image",name:"/devtools/image",component:()=>je(()=>import("./image-pnvoD1mw.js"),__vite__mapDeps([30,31]))},{path:"vibrant",name:"/devtools/vibrant",component:()=>je(()=>import("./vibrant-B-3LuKiX.js"),__vite__mapDeps([32,28,33,10]))}]},{path:"/queue",name:"/queue",component:()=>je(()=>import("./queue-Dr_7aGBJ.js"),__vite__mapDeps([34,15]))},{path:"/settings",children:[{path:"",name:"/settings/",component:()=>je(()=>import("./index-Cr3taKDJ.js"),__vite__mapDeps([35,4,5,6,7,36,25,10])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"airi-card",children:[{path:"",name:"/settings/airi-card/",component:()=>je(()=>import("./index-DTlkELmN.js"),__vite__mapDeps([37,18,7,19,8,9,14,28,38,39,40,4,5,6,10,41,25])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"components",children:[{path:"CardDetailDialog",name:"/settings/airi-card/components/CardDetailDialog",component:()=>je(()=>import("./CardDetailDialog-mu8EzJmZ.js"),__vite__mapDeps([42,38,39,40,4,5,6,18,7,19,8,9,14,10]))},{path:"CardListItem",name:"/settings/airi-card/components/CardListItem",component:()=>je(()=>import("./CardListItem-ztWYktU9.js"),__vite__mapDeps([43,41,4,5,6,7,10]))},{path:"DeleteCardDialog",name:"/settings/airi-card/components/DeleteCardDialog",component:()=>je(()=>import("./DeleteCardDialog-BWC1TUJo.js"),__vite__mapDeps([44,39,40]))}]}]},{path:"appearance",children:[{path:"",name:"/settings/appearance/",component:()=>je(()=>import("./index-Bx6crezv.js"),__vite__mapDeps([45,4,5,6,7,46,22,20,10,40,25,47])),meta:{layout:"settings",stageTransition:{name:"slide",pageSpecificAvailable:!0}}}]},{path:"memory",children:[{path:"",name:"/settings/memory/",component:()=>je(()=>import("./index-BtU1L1YB.js"),__vite__mapDeps([48,25])),meta:{layout:"settings",stageTransition:{name:"slide"}}}]},{path:"models",children:[{path:"",name:"/settings/models/",component:()=>je(()=>import("./index-QxR2H6V8.js"),__vite__mapDeps([49,36,4,5,21,6,7,33,46,22,20,10,40,50,25,51])),meta:{layout:"settings",stageTransition:{name:"slide",pageSpecificAvailable:!0}}}]},{path:"modules",children:[{path:"",name:"/settings/modules/",component:()=>je(()=>import("./index-BErwKygs.js"),__vite__mapDeps([52,4,5,6,7,53,36,50,25,10])),meta:{layout:"settings",stageTransition:{name:"slide",pageSpecificAvailable:!0}}},{path:"consciousness",name:"/settings/modules/consciousness",component:()=>je(()=>import("./consciousness-tp80ZbML.js"),__vite__mapDeps([54,4,5,6,7,19,8,9,55,20,56,10,25])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"memory-long-term",name:"/settings/modules/memory-long-term",component:()=>je(()=>import("./memory-long-term-CizHAZiS.js"),__vite__mapDeps([57,25])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"memory-short-term",name:"/settings/modules/memory-short-term",component:()=>je(()=>import("./memory-short-term-C9gGzqJ9.js"),__vite__mapDeps([58,25])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"speech",name:"/settings/modules/speech",component:()=>je(()=>import("./speech-CskFWSHK.js"),__vite__mapDeps([59,60,4,5,10,6,7,8,9,14,61,56,62,24,55,20,25])),meta:{layout:"settings",stageTransition:{name:"slide"}}}]},{path:"providers",children:[{path:"",name:"/settings/providers/",component:()=>je(()=>import("./index-DqB314Ha.js"),__vite__mapDeps([63,36,4,5,6,7,8,9,53,50,25,10])),meta:{layout:"settings",stageTransition:{name:"slide",pageSpecificAvailable:!0}}},{path:"alibaba-cloud-model-studio",name:"/settings/providers/alibaba-cloud-model-studio",component:()=>je(()=>import("./alibaba-cloud-model-studio-D2Z7LyWw.js"),__vite__mapDeps([64,4,5,6,7,8,9,14,60,10,65,66,22,20,61,56,67,68,25])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"anthropic",name:"/settings/providers/anthropic",component:()=>je(()=>import("./anthropic-Ph_Cu-AQ.js"),__vite__mapDeps([69,4,5,6,7,8,9,66,22,20,10,61,56,67,68,70,25])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"cloudflare-workers-ai",name:"/settings/providers/cloudflare-workers-ai",component:()=>je(()=>import("./cloudflare-workers-ai-BelZ37WY.js"),__vite__mapDeps([71,4,5,6,7,8,9,61,56,67,10,68,70,25])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"deepseek",name:"/settings/providers/deepseek",component:()=>je(()=>import("./deepseek-CYpdpBQ2.js"),__vite__mapDeps([72,4,5,6,7,8,9,66,22,20,10,61,56,67,68,70,25])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"elevenlabs",name:"/settings/providers/elevenlabs",component:()=>je(()=>import("./elevenlabs-DWHleb5O.js"),__vite__mapDeps([73,4,5,6,7,8,9,14,60,10,65,66,22,20,61,56,67,68,25])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"featherless-ai",name:"/settings/providers/featherless-ai",component:()=>je(()=>import("./featherless-ai-DARE6Tp5.js"),__vite__mapDeps([74,4,5,6,7,8,9,66,22,20,10,61,56,67,68,70,25])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"fireworks-ai",name:"/settings/providers/fireworks-ai",component:()=>je(()=>import("./fireworks-ai-C8z0lOo5.js"),__vite__mapDeps([75,4,5,6,7,8,9,66,22,20,10,61,56,67,68,70,25])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"google-generative-ai",name:"/settings/providers/google-generative-ai",component:()=>je(()=>import("./google-generative-ai-B68fMhhy.js"),__vite__mapDeps([76,4,5,6,7,8,9,66,22,20,10,61,56,67,68,70,25])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"microsoft-speech",name:"/settings/providers/microsoft-speech",component:()=>je(()=>import("./microsoft-speech-Q7Jza_kf.js"),__vite__mapDeps([77,4,5,6,7,8,9,14,61,56,60,10,65,66,22,20,67,68,25])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"mistral-ai",name:"/settings/providers/mistral-ai",component:()=>je(()=>import("./mistral-ai-BHjEqcAG.js"),__vite__mapDeps([78,4,5,6,7,8,9,66,22,20,10,61,56,67,68,70,25])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"moonshot-ai",name:"/settings/providers/moonshot-ai",component:()=>je(()=>import("./moonshot-ai-CDYGrHyM.js"),__vite__mapDeps([79,4,5,6,7,8,9,66,22,20,10,61,56,67,68,70,25])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"novita-ai",name:"/settings/providers/novita-ai",component:()=>je(()=>import("./novita-ai-DyRbwzhU.js"),__vite__mapDeps([80,4,5,6,7,8,9,66,22,20,10,61,56,67,68,70,25])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"ollama",name:"/settings/providers/ollama",component:()=>je(()=>import("./ollama-x64Z6--K.js"),__vite__mapDeps([81,4,5,6,7,8,9,56,66,22,20,10,61,68,70,25])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"openai",name:"/settings/providers/openai",component:()=>je(()=>import("./openai-Dt0OWE1-.js"),__vite__mapDeps([82,4,5,6,7,8,9,66,22,20,10,61,56,67,68,70,25])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"openrouter-ai",name:"/settings/providers/openrouter-ai",component:()=>je(()=>import("./openrouter-ai-DEt-Ma_F.js"),__vite__mapDeps([83,4,5,6,7,8,9,66,22,20,10,61,56,67,68,70,25])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"together-ai",name:"/settings/providers/together-ai",component:()=>je(()=>import("./together-ai-BRgSdW5k.js"),__vite__mapDeps([84,4,5,6,7,8,9,66,22,20,10,61,56,67,68,70,25])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"volcengine",name:"/settings/providers/volcengine",component:()=>je(()=>import("./volcengine-hdss6LC5.js"),__vite__mapDeps([85,4,5,6,7,8,9,14,61,56,60,10,65,66,22,20,67,68,25])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"xai",name:"/settings/providers/xai",component:()=>je(()=>import("./xai-DGMMhjzA.js"),__vite__mapDeps([86,4,5,6,7,8,9,66,22,20,10,61,56,67,68,70,25])),meta:{layout:"settings",stageTransition:{name:"slide"}}}]},{path:"scene",children:[{path:"",name:"/settings/scene/",component:()=>je(()=>import("./index-ZPnS1DDS.js"),__vite__mapDeps([87,36,50,7,25])),meta:{layout:"settings",stageTransition:{name:"slide",pageSpecificAvailable:!0}}}]}]},{path:"/test",children:[{path:"filter-message",name:"/test/filter-message",component:()=>je(()=>import("./filter-message-DE-HM8Ub.js"),__vite__mapDeps([88,62,24,10]))},{path:"queues",children:[{path:"delays",name:"/test/queues/delays",component:()=>je(()=>import("./delays-GOvkFfLX.js"),__vite__mapDeps([89,23,16,7,15,6,62,24,10]))},{path:"emotions",name:"/test/queues/emotions",component:()=>je(()=>import("./emotions-D1MeHkXq.js"),__vite__mapDeps([90,15,16,7,62,24,10]))},{path:"messages",name:"/test/queues/messages",component:()=>je(()=>import("./messages-Co8AZqus.js"),__vite__mapDeps([91,15,16,7,62,24,10]))}]}]}],qw=(n,e)=>{if(typeof n=="number"){if(e===3)return{mode:"rgb",r:(n>>8&15|n>>4&240)/255,g:(n>>4&15|n&240)/255,b:(n&15|n<<4&240)/255};if(e===4)return{mode:"rgb",r:(n>>12&15|n>>8&240)/255,g:(n>>8&15|n>>4&240)/255,b:(n>>4&15|n&240)/255,alpha:(n&15|n<<4&240)/255};if(e===6)return{mode:"rgb",r:(n>>16&255)/255,g:(n>>8&255)/255,b:(n&255)/255};if(e===8)return{mode:"rgb",r:(n>>24&255)/255,g:(n>>16&255)/255,b:(n>>8&255)/255,alpha:(n&255)/255}}},YV={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},jV=n=>qw(YV[n.toLowerCase()],6),KV=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,ZV=n=>{let e;return(e=n.match(KV))?qw(parseInt(e[1],16),e[1].length):void 0},mr="([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)",Gl=`${mr}%`,H_=`(?:${mr}%|${mr})`,JV=`(?:${mr}(deg|grad|rad|turn)|${mr})`,Da="\\s*,\\s*",QV=new RegExp(`^rgba?\\(\\s*${mr}${Da}${mr}${Da}${mr}\\s*(?:,\\s*${H_}\\s*)?\\)$`),e6=new RegExp(`^rgba?\\(\\s*${Gl}${Da}${Gl}${Da}${Gl}\\s*(?:,\\s*${H_}\\s*)?\\)$`),t6=n=>{let e={mode:"rgb"},t;if(t=n.match(QV))t[1]!==void 0&&(e.r=t[1]/255),t[2]!==void 0&&(e.g=t[2]/255),t[3]!==void 0&&(e.b=t[3]/255);else if(t=n.match(e6))t[1]!==void 0&&(e.r=t[1]/100),t[2]!==void 0&&(e.g=t[2]/100),t[3]!==void 0&&(e.b=t[3]/100);else return;return t[4]!==void 0?e.alpha=Math.max(0,Math.min(1,t[4]/100)):t[5]!==void 0&&(e.alpha=Math.max(0,Math.min(1,+t[5]))),e},n6=(n,e)=>n===void 0?void 0:typeof n!="object"?d6(n):n.mode!==void 0?n:e?{...n,mode:e}:void 0,Yw=(n="rgb")=>e=>(e=n6(e,n))!==void 0?e.mode===n?e:Ji[e.mode][n]?Ji[e.mode][n](e):n==="rgb"?Ji[e.mode].rgb(e):Ji.rgb[n](Ji[e.mode].rgb(e)):void 0,Ji={},jw={},Od=[],Kw={},i6=n=>n,Et=n=>(Ji[n.mode]={...Ji[n.mode],...n.toMode},Object.keys(n.fromMode||{}).forEach(e=>{Ji[e]||(Ji[e]={}),Ji[e][n.mode]=n.fromMode[e]}),n.ranges||(n.ranges={}),n.difference||(n.difference={}),n.channels.forEach(e=>{if(n.ranges[e]===void 0&&(n.ranges[e]=[0,1]),!n.interpolate[e])throw new Error(`Missing interpolator for: ${e}`);typeof n.interpolate[e]=="function"&&(n.interpolate[e]={use:n.interpolate[e]}),n.interpolate[e].fixup||(n.interpolate[e].fixup=i6)}),jw[n.mode]=n,(n.parse||[]).forEach(e=>{r6(e,n.mode)}),Yw(n.mode)),s6=n=>jw[n],r6=(n,e)=>{if(typeof n=="string"){if(!e)throw new Error("'mode' required when 'parser' is a string");Kw[n]=e}else typeof n=="function"&&Od.indexOf(n)<0&&Od.push(n)},Kg=/[^\x00-\x7F]|[a-zA-Z_]/,o6=/[^\x00-\x7F]|[-\w]/,_e={Function:"function",Ident:"ident",Number:"number",Percentage:"percentage",ParenClose:")",None:"none",Hue:"hue",Alpha:"alpha"};let $e=0;function uf(n){let e=n[$e],t=n[$e+1];return e==="-"||e==="+"?/\d/.test(t)||t==="."&&/\d/.test(n[$e+2]):e==="."?/\d/.test(t):/\d/.test(e)}function Zg(n){if($e>=n.length)return!1;let e=n[$e];if(Kg.test(e))return!0;if(e==="-"){if(n.length-$e<2)return!1;let t=n[$e+1];return!!(t==="-"||Kg.test(t))}return!1}const a6={deg:1,rad:180/Math.PI,grad:9/10,turn:360};function fl(n){let e="";if((n[$e]==="-"||n[$e]==="+")&&(e+=n[$e++]),e+=ff(n),n[$e]==="."&&/\d/.test(n[$e+1])&&(e+=n[$e++]+ff(n)),(n[$e]==="e"||n[$e]==="E")&&((n[$e+1]==="-"||n[$e+1]==="+")&&/\d/.test(n[$e+2])?e+=n[$e++]+n[$e++]+ff(n):/\d/.test(n[$e+1])&&(e+=n[$e++]+ff(n))),Zg(n)){let t=Nd(n);return t==="deg"||t==="rad"||t==="turn"||t==="grad"?{type:_e.Hue,value:e*a6[t]}:void 0}return n[$e]==="%"?($e++,{type:_e.Percentage,value:+e}):{type:_e.Number,value:+e}}function ff(n){let e="";for(;/\d/.test(n[$e]);)e+=n[$e++];return e}function Nd(n){let e="";for(;$e{},Vi=Array.isArray,Nw=/#/g,Wz=/&/g,Xz=/\//g,$z=/=/g,qz=/\?/g,Uw=/\+/g,Yz=/%5B/g,jz=/%5D/g,Fw=/%5E/g,Kz=/%60/g,kw=/%7B/g,Zz=/%7C/g,Bw=/%7D/g,Jz=/%20/g;function z_(n){return encodeURI(""+n).replace(Zz,"|").replace(Yz,"[").replace(jz,"]")}function Qz(n){return z_(n).replace(kw,"{").replace(Bw,"}").replace(Fw,"^")}function qg(n){return z_(n).replace(Uw,"%2B").replace(Jz,"+").replace(Nw,"%23").replace(Wz,"%26").replace(Kz,"`").replace(kw,"{").replace(Bw,"}").replace(Fw,"^")}function eV(n){return qg(n).replace($z,"%3D")}function tV(n){return z_(n).replace(Nw,"%23").replace(qz,"%3F")}function nV(n){return n==null?"":tV(n).replace(Xz,"%2F")}function xc(n){try{return decodeURIComponent(""+n)}catch{}return""+n}const iV=/\/$/,sV=n=>n.replace(iV,"");function Mm(n,e,t="/"){let i,s={},r="",o="";const a=e.indexOf("#");let l=e.indexOf("?");return a=0&&(l=-1),l>-1&&(i=e.slice(0,l),r=e.slice(l+1,a>-1?a:e.length),s=n(r)),a>-1&&(i=i||e.slice(0,a),o=e.slice(a,e.length)),i=lV(i??e,t),{fullPath:i+(r&&"?")+r+o,path:i,query:s,hash:xc(o)}}function rV(n,e){const t=e.query?n(e.query):"";return e.path+(t&&"?")+t+(e.hash||"")}function _x(n,e){return!e||!n.toLowerCase().startsWith(e.toLowerCase())?n:n.slice(e.length)||"/"}function oV(n,e,t){const i=e.matched.length-1,s=t.matched.length-1;return i>-1&&i===s&&Ia(e.matched[i],t.matched[s])&&zw(e.params,t.params)&&n(e.query)===n(t.query)&&e.hash===t.hash}function Ia(n,e){return(n.aliasOf||n)===(e.aliasOf||e)}function zw(n,e){if(Object.keys(n).length!==Object.keys(e).length)return!1;for(const t in n)if(!aV(n[t],e[t]))return!1;return!0}function aV(n,e){return Vi(n)?vx(n,e):Vi(e)?vx(e,n):n===e}function vx(n,e){return Vi(e)?n.length===e.length&&n.every((t,i)=>t===e[i]):n.length===1&&n[0]===e}function lV(n,e){if(n.startsWith("/"))return n;if(!n)return e;const t=e.split("/"),i=n.split("/"),s=i[i.length-1];(s===".."||s===".")&&i.push("");let r=t.length-1,o,a;for(o=0;o1&&r--;else break;return t.slice(0,r).join("/")+"/"+i.slice(o).join("/")}const tr={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};var Mc;(function(n){n.pop="pop",n.push="push"})(Mc||(Mc={}));var Hl;(function(n){n.back="back",n.forward="forward",n.unknown=""})(Hl||(Hl={}));function cV(n){if(!n)if(sa){const e=document.querySelector("base");n=e&&e.getAttribute("href")||"/",n=n.replace(/^\w+:\/\/[^\/]+/,"")}else n="/";return n[0]!=="/"&&n[0]!=="#"&&(n="/"+n),sV(n)}const uV=/^[^#]+#/;function fV(n,e){return n.replace(uV,"#")+e}function dV(n,e){const t=document.documentElement.getBoundingClientRect(),i=n.getBoundingClientRect();return{behavior:e.behavior,left:i.left-t.left-(e.left||0),top:i.top-t.top-(e.top||0)}}const $h=()=>({left:window.scrollX,top:window.scrollY});function hV(n){let e;if("el"in n){const t=n.el,i=typeof t=="string"&&t.startsWith("#"),s=typeof t=="string"?i?document.getElementById(t.slice(1)):document.querySelector(t):t;if(!s)return;e=dV(s,n)}else e=n;"scrollBehavior"in document.documentElement.style?window.scrollTo(e):window.scrollTo(e.left!=null?e.left:window.scrollX,e.top!=null?e.top:window.scrollY)}function yx(n,e){return(history.state?history.state.position-e:-1)+n}const Yg=new Map;function pV(n,e){Yg.set(n,e)}function mV(n){const e=Yg.get(n);return Yg.delete(n),e}let gV=()=>location.protocol+"//"+location.host;function Vw(n,e){const{pathname:t,search:i,hash:s}=e,r=n.indexOf("#");if(r>-1){let a=s.includes(n.slice(r))?n.slice(r).length:1,l=s.slice(a);return l[0]!=="/"&&(l="/"+l),_x(l,"")}return _x(t,n)+i+s}function _V(n,e,t,i){let s=[],r=[],o=null;const a=({state:d})=>{const h=Vw(n,location),p=t.value,_=e.value;let g=0;if(d){if(t.value=h,e.value=d,o&&o===p){o=null;return}g=_?d.position-_.position:0}else i(h);s.forEach(m=>{m(t.value,p,{delta:g,type:Mc.pop,direction:g?g>0?Hl.forward:Hl.back:Hl.unknown})})};function l(){o=t.value}function c(d){s.push(d);const h=()=>{const p=s.indexOf(d);p>-1&&s.splice(p,1)};return r.push(h),h}function u(){const{history:d}=window;d.state&&d.replaceState(Mt({},d.state,{scroll:$h()}),"")}function f(){for(const d of r)d();r=[],window.removeEventListener("popstate",a),window.removeEventListener("beforeunload",u)}return window.addEventListener("popstate",a),window.addEventListener("beforeunload",u,{passive:!0}),{pauseListeners:l,listen:c,destroy:f}}function bx(n,e,t,i=!1,s=!1){return{back:n,current:e,forward:t,replaced:i,position:window.history.length,scroll:s?$h():null}}function vV(n){const{history:e,location:t}=window,i={value:Vw(n,t)},s={value:e.state};s.value||r(i.value,{back:null,current:i.value,forward:null,position:e.length-1,replaced:!0,scroll:null},!0);function r(l,c,u){const f=n.indexOf("#"),d=f>-1?(t.host&&document.querySelector("base")?n:n.slice(f))+l:gV()+n+l;try{e[u?"replaceState":"pushState"](c,"",d),s.value=c}catch(h){console.error(h),t[u?"replace":"assign"](d)}}function o(l,c){const u=Mt({},e.state,bx(s.value.back,l,s.value.forward,!0),c,{position:s.value.position});r(l,u,!0),i.value=l}function a(l,c){const u=Mt({},s.value,e.state,{forward:l,scroll:$h()});r(u.current,u,!0);const f=Mt({},bx(i.value,l,null),{position:u.position+1},c);r(l,f,!1),i.value=l}return{location:i,state:s,push:a,replace:o}}function yV(n){n=cV(n);const e=vV(n),t=_V(n,e.state,e.location,e.replace);function i(r,o=!0){o||t.pauseListeners(),history.go(r)}const s=Mt({location:"",base:n,go:i,createHref:fV.bind(null,n)},e,t);return Object.defineProperty(s,"location",{enumerable:!0,get:()=>e.location.value}),Object.defineProperty(s,"state",{enumerable:!0,get:()=>e.state.value}),s}function bV(n){return n=location.host?n||location.pathname+location.search:"",n.includes("#")||(n+="#"),yV(n)}function xV(n){return typeof n=="string"||n&&typeof n=="object"}function Hw(n){return typeof n=="string"||typeof n=="symbol"}const Gw=Symbol("");var xx;(function(n){n[n.aborted=4]="aborted",n[n.cancelled=8]="cancelled",n[n.duplicated=16]="duplicated"})(xx||(xx={}));function La(n,e){return Mt(new Error,{type:n,[Gw]:!0},e)}function ys(n,e){return n instanceof Error&&Gw in n&&(e==null||!!(n.type&e))}const Mx="[^/]+?",MV={sensitive:!1,strict:!1,start:!0,end:!0},SV=/[.+*?^${}()[\]/\\]/g;function EV(n,e){const t=Mt({},MV,e),i=[];let s=t.start?"^":"";const r=[];for(const c of n){const u=c.length?[]:[90];t.strict&&!c.length&&(s+="/");for(let f=0;fe.length?e.length===1&&e[0]===80?1:-1:0}function Ww(n,e){let t=0;const i=n.score,s=e.score;for(;t0&&e[e.length-1]<0}const wV={type:0,value:""},AV=/[a-zA-Z0-9_]/;function CV(n){if(!n)return[[]];if(n==="/")return[[wV]];if(!n.startsWith("/"))throw new Error(`Invalid path "${n}"`);function e(h){throw new Error(`ERR (${t})/"${c}": ${h}`)}let t=0,i=t;const s=[];let r;function o(){r&&s.push(r),r=[]}let a=0,l,c="",u="";function f(){c&&(t===0?r.push({type:0,value:c}):t===1||t===2||t===3?(r.length>1&&(l==="*"||l==="+")&&e(`A repeatable param (${c}) must be alone in its segment. eg: '/:ids+.`),r.push({type:1,value:c,regexp:u,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):e("Invalid state to consume buffer"),c="")}function d(){c+=l}for(;a{o(b)}:Vl}function o(f){if(Hw(f)){const d=i.get(f);d&&(i.delete(f),t.splice(t.indexOf(d),1),d.children.forEach(o),d.alias.forEach(o))}else{const d=t.indexOf(f);d>-1&&(t.splice(d,1),f.record.name&&i.delete(f.record.name),f.children.forEach(o),f.alias.forEach(o))}}function a(){return t}function l(f){const d=DV(f,t);t.splice(d,0,f),f.record.name&&!wx(f)&&i.set(f.record.name,f)}function c(f,d){let h,p={},_,g;if("name"in f&&f.name){if(h=i.get(f.name),!h)throw La(1,{location:f});g=h.record.name,p=Mt(Ex(d.params,h.keys.filter(b=>!b.optional).concat(h.parent?h.parent.keys.filter(b=>b.optional):[]).map(b=>b.name)),f.params&&Ex(f.params,h.keys.map(b=>b.name))),_=h.stringify(p)}else if(f.path!=null)_=f.path,h=t.find(b=>b.re.test(_)),h&&(p=h.parse(_),g=h.record.name);else{if(h=d.name?i.get(d.name):t.find(b=>b.re.test(d.path)),!h)throw La(1,{location:f,currentLocation:d});g=h.record.name,p=Mt({},d.params,f.params),_=h.stringify(p)}const m=[];let y=h;for(;y;)m.unshift(y.record),y=y.parent;return{name:g,path:_,params:p,matched:m,meta:LV(m)}}n.forEach(f=>r(f));function u(){t.length=0,i.clear()}return{addRoute:r,resolve:c,removeRoute:o,clearRoutes:u,getRoutes:a,getRecordMatcher:s}}function Ex(n,e){const t={};for(const i of e)i in n&&(t[i]=n[i]);return t}function Tx(n){const e={path:n.path,redirect:n.redirect,name:n.name,meta:n.meta||{},aliasOf:n.aliasOf,beforeEnter:n.beforeEnter,props:IV(n),children:n.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in n?n.components||null:n.component&&{default:n.component}};return Object.defineProperty(e,"mods",{value:{}}),e}function IV(n){const e={},t=n.props||!1;if("component"in n)e.default=t;else for(const i in n.components)e[i]=typeof t=="object"?t[i]:t;return e}function wx(n){for(;n;){if(n.record.aliasOf)return!0;n=n.parent}return!1}function LV(n){return n.reduce((e,t)=>Mt(e,t.meta),{})}function Ax(n,e){const t={};for(const i in n)t[i]=i in e?e[i]:n[i];return t}function DV(n,e){let t=0,i=e.length;for(;t!==i;){const r=t+i>>1;Ww(n,e[r])<0?i=r:t=r+1}const s=OV(n);return s&&(i=e.lastIndexOf(s,i-1)),i}function OV(n){let e=n;for(;e=e.parent;)if(Xw(e)&&Ww(n,e)===0)return e}function Xw({record:n}){return!!(n.name||n.components&&Object.keys(n.components).length||n.redirect)}function NV(n){const e={};if(n===""||n==="?")return e;const i=(n[0]==="?"?n.slice(1):n).split("&");for(let s=0;sr&&qg(r)):[i&&qg(i)]).forEach(r=>{r!==void 0&&(e+=(e.length?"&":"")+t,r!=null&&(e+="="+r))})}return e}function UV(n){const e={};for(const t in n){const i=n[t];i!==void 0&&(e[t]=Vi(i)?i.map(s=>s==null?null:""+s):i==null?i:""+i)}return e}const FV=Symbol(""),Rx=Symbol(""),qh=Symbol(""),V_=Symbol(""),jg=Symbol("");function ul(){let n=[];function e(i){return n.push(i),()=>{const s=n.indexOf(i);s>-1&&n.splice(s,1)}}function t(){n=[]}return{add:e,list:()=>n.slice(),reset:t}}function cr(n,e,t,i,s,r=o=>o()){const o=i&&(i.enterCallbacks[s]=i.enterCallbacks[s]||[]);return()=>new Promise((a,l)=>{const c=d=>{d===!1?l(La(4,{from:t,to:e})):d instanceof Error?l(d):xV(d)?l(La(2,{from:e,to:d})):(o&&i.enterCallbacks[s]===o&&typeof d=="function"&&o.push(d),a())},u=r(()=>n.call(i&&i.instances[s],e,t,c));let f=Promise.resolve(u);n.length<3&&(f=f.then(c)),f.catch(d=>l(d))})}function Sm(n,e,t,i,s=r=>r()){const r=[];for(const o of n)for(const a in o.components){let l=o.components[a];if(!(e!=="beforeRouteEnter"&&!o.instances[a]))if(Ow(l)){const u=(l.__vccOpts||l)[e];u&&r.push(cr(u,t,i,o,a,s))}else{let c=l();r.push(()=>c.then(u=>{if(!u)throw new Error(`Couldn't resolve component "${a}" at "${o.path}"`);const f=Gz(u)?u.default:u;o.mods[a]=u,o.components[a]=f;const h=(f.__vccOpts||f)[e];return h&&cr(h,t,i,o,a,s)()}))}}return r}function Px(n){const e=mn(qh),t=mn(V_),i=Me(()=>{const l=Ot(n.to);return e.resolve(l)}),s=Me(()=>{const{matched:l}=i.value,{length:c}=l,u=l[c-1],f=t.matched;if(!u||!f.length)return-1;const d=f.findIndex(Ia.bind(null,u));if(d>-1)return d;const h=Ix(l[c-2]);return c>1&&Ix(u)===h&&f[f.length-1].path!==h?f.findIndex(Ia.bind(null,l[c-2])):d}),r=Me(()=>s.value>-1&&HV(t.params,i.value.params)),o=Me(()=>s.value>-1&&s.value===t.matched.length-1&&zw(t.params,i.value.params));function a(l={}){if(VV(l)){const c=e[Ot(n.replace)?"replace":"push"](Ot(n.to)).catch(Vl);return n.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>c),c}return Promise.resolve()}return{route:i,href:Me(()=>i.value.href),isActive:r,isExactActive:o,navigate:a}}function kV(n){return n.length===1?n[0]:n}const BV=fn({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:Px,setup(n,{slots:e}){const t=xi(Px(n)),{options:i}=mn(qh),s=Me(()=>({[Lx(n.activeClass,i.linkActiveClass,"router-link-active")]:t.isActive,[Lx(n.exactActiveClass,i.linkExactActiveClass,"router-link-exact-active")]:t.isExactActive}));return()=>{const r=e.default&&kV(e.default(t));return n.custom?r:Ns("a",{"aria-current":t.isExactActive?n.ariaCurrentValue:null,href:t.href,onClick:t.navigate,class:s.value},r)}}}),zV=BV;function VV(n){if(!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)&&!n.defaultPrevented&&!(n.button!==void 0&&n.button!==0)){if(n.currentTarget&&n.currentTarget.getAttribute){const e=n.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return n.preventDefault&&n.preventDefault(),!0}}function HV(n,e){for(const t in e){const i=e[t],s=n[t];if(typeof i=="string"){if(i!==s)return!1}else if(!Vi(s)||s.length!==i.length||i.some((r,o)=>r!==s[o]))return!1}return!0}function Ix(n){return n?n.aliasOf?n.aliasOf.path:n.path:""}const Lx=(n,e,t)=>n??e??t,GV=fn({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(n,{attrs:e,slots:t}){const i=mn(jg),s=Me(()=>n.route||i.value),r=mn(Rx,0),o=Me(()=>{let c=Ot(r);const{matched:u}=s.value;let f;for(;(f=u[c])&&!f.components;)c++;return c}),a=Me(()=>s.value.matched[o.value]);pr(Rx,Me(()=>o.value+1)),pr(FV,a),pr(jg,s);const l=et();return Xe(()=>[l.value,a.value,n.name],([c,u,f],[d,h,p])=>{u&&(u.instances[f]=c,h&&h!==u&&c&&c===d&&(u.leaveGuards.size||(u.leaveGuards=h.leaveGuards),u.updateGuards.size||(u.updateGuards=h.updateGuards))),c&&u&&(!h||!Ia(u,h)||!d)&&(u.enterCallbacks[f]||[]).forEach(_=>_(c))},{flush:"post"}),()=>{const c=s.value,u=n.name,f=a.value,d=f&&f.components[u];if(!d)return Dx(t.default,{Component:d,route:c});const h=f.props[u],p=h?h===!0?c.params:typeof h=="function"?h(c):h:null,g=Ns(d,Mt({},p,e,{onVnodeUnmounted:m=>{m.component.isUnmounted&&(f.instances[u]=null)},ref:l}));return Dx(t.default,{Component:g,route:c})||g}}});function Dx(n,e){if(!n)return null;const t=n(e);return t.length===1?t[0]:t}const $w=GV;function WV(n){const e=PV(n.routes,n),t=n.parseQuery||NV,i=n.stringifyQuery||Cx,s=n.history,r=ul(),o=ul(),a=ul(),l=Oe(tr);let c=tr;sa&&n.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=xm.bind(null,$=>""+$),f=xm.bind(null,nV),d=xm.bind(null,xc);function h($,ae){let le,ce;return Hw($)?(le=e.getRecordMatcher($),ce=ae):ce=$,e.addRoute(ce,le)}function p($){const ae=e.getRecordMatcher($);ae&&e.removeRoute(ae)}function _(){return e.getRoutes().map($=>$.record)}function g($){return!!e.getRecordMatcher($)}function m($,ae){if(ae=Mt({},ae||l.value),typeof $=="string"){const w=Mm(t,$,ae.path),X=e.resolve({path:w.path},ae),G=s.createHref(w.fullPath);return Mt(w,X,{params:d(X.params),hash:xc(w.hash),redirectedFrom:void 0,href:G})}let le;if($.path!=null)le=Mt({},$,{path:Mm(t,$.path,ae.path).path});else{const w=Mt({},$.params);for(const X in w)w[X]==null&&delete w[X];le=Mt({},$,{params:f(w)}),ae.params=f(ae.params)}const ce=e.resolve(le,ae),He=$.hash||"";ce.params=u(d(ce.params));const F=rV(i,Mt({},$,{hash:Qz(He),path:ce.path})),k=s.createHref(F);return Mt({fullPath:F,hash:He,query:i===Cx?UV($.query):$.query||{}},ce,{redirectedFrom:void 0,href:k})}function y($){return typeof $=="string"?Mm(t,$,l.value.path):Mt({},$)}function b($,ae){if(c!==$)return La(8,{from:ae,to:$})}function v($){return S($)}function E($){return v(Mt(y($),{replace:!0}))}function T($){const ae=$.matched[$.matched.length-1];if(ae&&ae.redirect){const{redirect:le}=ae;let ce=typeof le=="function"?le($):le;return typeof ce=="string"&&(ce=ce.includes("?")||ce.includes("#")?ce=y(ce):{path:ce},ce.params={}),Mt({query:$.query,hash:$.hash,params:ce.path!=null?{}:$.params},ce)}}function S($,ae){const le=c=m($),ce=l.value,He=$.state,F=$.force,k=$.replace===!0,w=T(le);if(w)return S(Mt(y(w),{state:typeof w=="object"?Mt({},He,w.state):He,force:F,replace:k}),ae||le);const X=le;X.redirectedFrom=ae;let G;return!F&&oV(i,ce,le)&&(G=La(16,{to:X,from:ce}),se(ce,ce,!0,!1)),(G?Promise.resolve(G):M(X,ce)).catch(W=>ys(W)?ys(W,2)?W:be(W):J(W,X,ce)).then(W=>{if(W){if(ys(W,2))return S(Mt({replace:k},y(W.to),{state:typeof W.to=="object"?Mt({},He,W.to.state):He,force:F}),ae||X)}else W=N(X,ce,!0,k,He);return I(X,ce,W),W})}function P($,ae){const le=b($,ae);return le?Promise.reject(le):Promise.resolve()}function x($){const ae=re.values().next().value;return ae&&typeof ae.runWithContext=="function"?ae.runWithContext($):$()}function M($,ae){let le;const[ce,He,F]=XV($,ae);le=Sm(ce.reverse(),"beforeRouteLeave",$,ae);for(const w of ce)w.leaveGuards.forEach(X=>{le.push(cr(X,$,ae))});const k=P.bind(null,$,ae);return le.push(k),xe(le).then(()=>{le=[];for(const w of r.list())le.push(cr(w,$,ae));return le.push(k),xe(le)}).then(()=>{le=Sm(He,"beforeRouteUpdate",$,ae);for(const w of He)w.updateGuards.forEach(X=>{le.push(cr(X,$,ae))});return le.push(k),xe(le)}).then(()=>{le=[];for(const w of F)if(w.beforeEnter)if(Vi(w.beforeEnter))for(const X of w.beforeEnter)le.push(cr(X,$,ae));else le.push(cr(w.beforeEnter,$,ae));return le.push(k),xe(le)}).then(()=>($.matched.forEach(w=>w.enterCallbacks={}),le=Sm(F,"beforeRouteEnter",$,ae,x),le.push(k),xe(le))).then(()=>{le=[];for(const w of o.list())le.push(cr(w,$,ae));return le.push(k),xe(le)}).catch(w=>ys(w,8)?w:Promise.reject(w))}function I($,ae,le){a.list().forEach(ce=>x(()=>ce($,ae,le)))}function N($,ae,le,ce,He){const F=b($,ae);if(F)return F;const k=ae===tr,w=sa?history.state:{};le&&(ce||k?s.replace($.fullPath,Mt({scroll:k&&w&&w.scroll},He)):s.push($.fullPath,He)),l.value=$,se($,ae,le,k),be()}let V;function j(){V||(V=s.listen(($,ae,le)=>{if(!ge.listening)return;const ce=m($),He=T(ce);if(He){S(Mt(He,{replace:!0,force:!0}),ce).catch(Vl);return}c=ce;const F=l.value;sa&&pV(yx(F.fullPath,le.delta),$h()),M(ce,F).catch(k=>ys(k,12)?k:ys(k,2)?(S(Mt(y(k.to),{force:!0}),ce).then(w=>{ys(w,20)&&!le.delta&&le.type===Mc.pop&&s.go(-1,!1)}).catch(Vl),Promise.reject()):(le.delta&&s.go(-le.delta,!1),J(k,ce,F))).then(k=>{k=k||N(ce,F,!1),k&&(le.delta&&!ys(k,8)?s.go(-le.delta,!1):le.type===Mc.pop&&ys(k,20)&&s.go(-1,!1)),I(ce,F,k)}).catch(Vl)}))}let te=ul(),Z=ul(),ee;function J($,ae,le){be($);const ce=Z.list();return ce.length?ce.forEach(He=>He($,ae,le)):console.error($),Promise.reject($)}function he(){return ee&&l.value!==tr?Promise.resolve():new Promise(($,ae)=>{te.add([$,ae])})}function be($){return ee||(ee=!$,j(),te.list().forEach(([ae,le])=>$?le($):ae()),te.reset()),$}function se($,ae,le,ce){const{scrollBehavior:He}=n;if(!sa||!He)return Promise.resolve();const F=!le&&mV(yx($.fullPath,0))||(ce||!le)&&history.state&&history.state.scroll||null;return wr().then(()=>He($,ae,F)).then(k=>k&&hV(k)).catch(k=>J(k,$,ae))}const ye=$=>s.go($);let Be;const re=new Set,ge={currentRoute:l,listening:!0,addRoute:h,removeRoute:p,clearRoutes:e.clearRoutes,hasRoute:g,getRoutes:_,resolve:m,options:n,push:v,replace:E,go:ye,back:()=>ye(-1),forward:()=>ye(1),beforeEach:r.add,beforeResolve:o.add,afterEach:a.add,onError:Z.add,isReady:he,install($){const ae=this;$.component("RouterLink",zV),$.component("RouterView",$w),$.config.globalProperties.$router=ae,Object.defineProperty($.config.globalProperties,"$route",{enumerable:!0,get:()=>Ot(l)}),sa&&!Be&&l.value===tr&&(Be=!0,v(s.location).catch(He=>{}));const le={};for(const He in tr)Object.defineProperty(le,He,{get:()=>l.value[He],enumerable:!0});$.provide(qh,ae),$.provide(V_,oS(le)),$.provide(jg,l);const ce=$.unmount;re.add($),$.unmount=function(){re.delete($),re.size<1&&(c=tr,V&&V(),V=null,l.value=tr,Be=!1,ee=!1),ce()}}};function xe($){return $.reduce((ae,le)=>ae.then(()=>x(le)),Promise.resolve())}return ge}function XV(n,e){const t=[],i=[],s=[],r=Math.max(e.matched.length,n.matched.length);for(let o=0;oIa(c,a))?i.push(a):t.push(a));const l=n.matched[o];l&&(e.matched.find(c=>Ia(c,l))||s.push(l))}return[t,i,s]}function $V(){return mn(qh)}function OG(n){return mn(V_)}const qV=[{path:"/",name:"/",component:()=>je(()=>import("./index-D1xt2h2l.js"),__vite__mapDeps([12,4,5,6,7,8,13,14,15,10,9,16,17,18,19,20,21,22,23,11,1,2,24,25,26,27])),meta:{layout:"stage",stageTransition:{name:"bubble-wave-out"}}},{path:"/:all(.*)",name:"/[...all]",component:()=>je(()=>import("./_...all_-2hR2XxLq.js"),[])},{path:"/audio",name:"/audio",component:()=>je(()=>import("./audio-BOdw_4V2.js"),[])},{path:"/devtools",children:[{path:"background-remove",name:"/devtools/background-remove",component:()=>je(()=>import("./background-remove-B5-hUPmC.js"),__vite__mapDeps([28,29,11]))},{path:"chat",name:"/devtools/chat",component:()=>je(()=>import("./chat-CFaWDr1y.js"),__vite__mapDeps([30,18,10]))},{path:"image",name:"/devtools/image",component:()=>je(()=>import("./image-C2-G5ALe.js"),__vite__mapDeps([31,32]))},{path:"vibrant",name:"/devtools/vibrant",component:()=>je(()=>import("./vibrant-BjWjzLe_.js"),__vite__mapDeps([33,29,34,11]))}]},{path:"/queue",name:"/queue",component:()=>je(()=>import("./queue-CPjEEqUV.js"),__vite__mapDeps([35,16]))},{path:"/settings",children:[{path:"",name:"/settings/",component:()=>je(()=>import("./index-TkjzwIq7.js"),__vite__mapDeps([36,4,5,6,7,8,37,26,11])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"airi-card",children:[{path:"",name:"/settings/airi-card/",component:()=>je(()=>import("./index-DjtWjpVM.js"),__vite__mapDeps([38,7,19,8,20,9,10,15,29,39,40,41,4,5,6,11,42,26])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"components",children:[{path:"CardDetailDialog",name:"/settings/airi-card/components/CardDetailDialog",component:()=>je(()=>import("./CardDetailDialog-qMNZyDHS.js"),__vite__mapDeps([43,39,40,41,4,5,6,7,19,8,20,9,10,15,11]))},{path:"CardListItem",name:"/settings/airi-card/components/CardListItem",component:()=>je(()=>import("./CardListItem-CEhV1j5b.js"),__vite__mapDeps([44,42,4,5,6,7,8,11]))},{path:"DeleteCardDialog",name:"/settings/airi-card/components/DeleteCardDialog",component:()=>je(()=>import("./DeleteCardDialog-BBI3VAtl.js"),__vite__mapDeps([45,40,41]))}]}]},{path:"appearance",children:[{path:"",name:"/settings/appearance/",component:()=>je(()=>import("./index-D0HHrws7.js"),__vite__mapDeps([46,4,5,6,7,8,47,23,21,11,41,26,48])),meta:{layout:"settings",stageTransition:{name:"slide",pageSpecificAvailable:!0}}}]},{path:"memory",children:[{path:"",name:"/settings/memory/",component:()=>je(()=>import("./index-G9i1VvgN.js"),__vite__mapDeps([49,26])),meta:{layout:"settings",stageTransition:{name:"slide"}}}]},{path:"models",children:[{path:"",name:"/settings/models/",component:()=>je(()=>import("./index-DdibLJzw.js"),__vite__mapDeps([50,37,4,5,22,6,7,8,34,47,23,21,11,41,51,26,52])),meta:{layout:"settings",stageTransition:{name:"slide",pageSpecificAvailable:!0}}}]},{path:"modules",children:[{path:"",name:"/settings/modules/",component:()=>je(()=>import("./index-CISelA4u.js"),__vite__mapDeps([53,4,5,6,7,8,54,37,51,26,11])),meta:{layout:"settings",stageTransition:{name:"slide",pageSpecificAvailable:!0}}},{path:"consciousness",name:"/settings/modules/consciousness",component:()=>je(()=>import("./consciousness-Ce8qJ0rp.js"),__vite__mapDeps([55,4,5,6,7,8,20,9,10,56,21,57,11,26])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"memory-long-term",name:"/settings/modules/memory-long-term",component:()=>je(()=>import("./memory-long-term-C3AAmu0J.js"),__vite__mapDeps([58,26])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"memory-short-term",name:"/settings/modules/memory-short-term",component:()=>je(()=>import("./memory-short-term-ma1r-ic1.js"),__vite__mapDeps([59,26])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"speech",name:"/settings/modules/speech",component:()=>je(()=>import("./speech-Pn8felHV.js"),__vite__mapDeps([60,61,4,5,11,6,7,8,9,10,15,62,57,63,25,56,21,26])),meta:{layout:"settings",stageTransition:{name:"slide"}}}]},{path:"providers",children:[{path:"",name:"/settings/providers/",component:()=>je(()=>import("./index-rh9u0eeX.js"),__vite__mapDeps([64,37,4,5,6,7,8,9,10,54,51,26,11])),meta:{layout:"settings",stageTransition:{name:"slide",pageSpecificAvailable:!0}}},{path:"alibaba-cloud-model-studio",name:"/settings/providers/alibaba-cloud-model-studio",component:()=>je(()=>import("./alibaba-cloud-model-studio-BTh-z50z.js"),__vite__mapDeps([65,4,5,6,7,8,9,10,15,61,11,66,67,23,21,62,57,68,69,26])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"anthropic",name:"/settings/providers/anthropic",component:()=>je(()=>import("./anthropic-B-QXh4_7.js"),__vite__mapDeps([70,4,5,6,7,8,9,10,67,23,21,11,62,57,68,69,71,26])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"cloudflare-workers-ai",name:"/settings/providers/cloudflare-workers-ai",component:()=>je(()=>import("./cloudflare-workers-ai-DTBoU9aK.js"),__vite__mapDeps([72,4,5,6,7,8,9,10,62,57,68,11,69,71,26])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"deepseek",name:"/settings/providers/deepseek",component:()=>je(()=>import("./deepseek-BW4eoDhy.js"),__vite__mapDeps([73,4,5,6,7,8,9,10,67,23,21,11,62,57,68,69,71,26])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"elevenlabs",name:"/settings/providers/elevenlabs",component:()=>je(()=>import("./elevenlabs-DEXiXl5s.js"),__vite__mapDeps([74,4,5,6,7,8,9,10,15,61,11,66,67,23,21,62,57,68,69,26])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"featherless-ai",name:"/settings/providers/featherless-ai",component:()=>je(()=>import("./featherless-ai-B2aQkHo9.js"),__vite__mapDeps([75,4,5,6,7,8,9,10,67,23,21,11,62,57,68,69,71,26])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"fireworks-ai",name:"/settings/providers/fireworks-ai",component:()=>je(()=>import("./fireworks-ai-BN-10Pky.js"),__vite__mapDeps([76,4,5,6,7,8,9,10,67,23,21,11,62,57,68,69,71,26])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"google-generative-ai",name:"/settings/providers/google-generative-ai",component:()=>je(()=>import("./google-generative-ai-BWKD0Fn7.js"),__vite__mapDeps([77,4,5,6,7,8,9,10,67,23,21,11,62,57,68,69,71,26])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"microsoft-speech",name:"/settings/providers/microsoft-speech",component:()=>je(()=>import("./microsoft-speech-JS0kPLKG.js"),__vite__mapDeps([78,4,5,6,7,8,9,10,15,62,57,61,11,66,67,23,21,68,69,26])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"mistral-ai",name:"/settings/providers/mistral-ai",component:()=>je(()=>import("./mistral-ai-CbulwOqs.js"),__vite__mapDeps([79,4,5,6,7,8,9,10,67,23,21,11,62,57,68,69,71,26])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"moonshot-ai",name:"/settings/providers/moonshot-ai",component:()=>je(()=>import("./moonshot-ai-Cxu00yNw.js"),__vite__mapDeps([80,4,5,6,7,8,9,10,67,23,21,11,62,57,68,69,71,26])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"novita-ai",name:"/settings/providers/novita-ai",component:()=>je(()=>import("./novita-ai-CuTBCJhw.js"),__vite__mapDeps([81,4,5,6,7,8,9,10,67,23,21,11,62,57,68,69,71,26])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"ollama",name:"/settings/providers/ollama",component:()=>je(()=>import("./ollama-C5hsqtdz.js"),__vite__mapDeps([82,4,5,6,7,8,9,10,57,67,23,21,11,62,69,71,26])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"openai",name:"/settings/providers/openai",component:()=>je(()=>import("./openai-C8A-hPqI.js"),__vite__mapDeps([83,4,5,6,7,8,9,10,67,23,21,11,62,57,68,69,71,26])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"openrouter-ai",name:"/settings/providers/openrouter-ai",component:()=>je(()=>import("./openrouter-ai-CSDlnHSe.js"),__vite__mapDeps([84,4,5,6,7,8,9,10,67,23,21,11,62,57,68,69,71,26])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"together-ai",name:"/settings/providers/together-ai",component:()=>je(()=>import("./together-ai-DYtDSEI-.js"),__vite__mapDeps([85,4,5,6,7,8,9,10,67,23,21,11,62,57,68,69,71,26])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"volcengine",name:"/settings/providers/volcengine",component:()=>je(()=>import("./volcengine-byeJ4X8x.js"),__vite__mapDeps([86,4,5,6,7,8,9,10,15,62,57,61,11,66,67,23,21,68,69,26])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"xai",name:"/settings/providers/xai",component:()=>je(()=>import("./xai-Dhgty11s.js"),__vite__mapDeps([87,4,5,6,7,8,9,10,67,23,21,11,62,57,68,69,71,26])),meta:{layout:"settings",stageTransition:{name:"slide"}}}]},{path:"scene",children:[{path:"",name:"/settings/scene/",component:()=>je(()=>import("./index-DlpcTXeT.js"),__vite__mapDeps([88,37,51,7,8,26])),meta:{layout:"settings",stageTransition:{name:"slide",pageSpecificAvailable:!0}}}]}]},{path:"/test",children:[{path:"filter-message",name:"/test/filter-message",component:()=>je(()=>import("./filter-message-BXRmVdLj.js"),__vite__mapDeps([89,63,25,11]))},{path:"queues",children:[{path:"delays",name:"/test/queues/delays",component:()=>je(()=>import("./delays-BI9nYLvl.js"),__vite__mapDeps([90,24,17,8,16,6,63,25,11]))},{path:"emotions",name:"/test/queues/emotions",component:()=>je(()=>import("./emotions-CIHTBxtQ.js"),__vite__mapDeps([91,16,17,8,63,25,11]))},{path:"messages",name:"/test/queues/messages",component:()=>je(()=>import("./messages-MQBl8nH2.js"),__vite__mapDeps([92,16,17,8,63,25,11]))}]}]}],qw=(n,e)=>{if(typeof n=="number"){if(e===3)return{mode:"rgb",r:(n>>8&15|n>>4&240)/255,g:(n>>4&15|n&240)/255,b:(n&15|n<<4&240)/255};if(e===4)return{mode:"rgb",r:(n>>12&15|n>>8&240)/255,g:(n>>8&15|n>>4&240)/255,b:(n>>4&15|n&240)/255,alpha:(n&15|n<<4&240)/255};if(e===6)return{mode:"rgb",r:(n>>16&255)/255,g:(n>>8&255)/255,b:(n&255)/255};if(e===8)return{mode:"rgb",r:(n>>24&255)/255,g:(n>>16&255)/255,b:(n>>8&255)/255,alpha:(n&255)/255}}},YV={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},jV=n=>qw(YV[n.toLowerCase()],6),KV=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,ZV=n=>{let e;return(e=n.match(KV))?qw(parseInt(e[1],16),e[1].length):void 0},mr="([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)",Gl=`${mr}%`,H_=`(?:${mr}%|${mr})`,JV=`(?:${mr}(deg|grad|rad|turn)|${mr})`,Da="\\s*,\\s*",QV=new RegExp(`^rgba?\\(\\s*${mr}${Da}${mr}${Da}${mr}\\s*(?:,\\s*${H_}\\s*)?\\)$`),e6=new RegExp(`^rgba?\\(\\s*${Gl}${Da}${Gl}${Da}${Gl}\\s*(?:,\\s*${H_}\\s*)?\\)$`),t6=n=>{let e={mode:"rgb"},t;if(t=n.match(QV))t[1]!==void 0&&(e.r=t[1]/255),t[2]!==void 0&&(e.g=t[2]/255),t[3]!==void 0&&(e.b=t[3]/255);else if(t=n.match(e6))t[1]!==void 0&&(e.r=t[1]/100),t[2]!==void 0&&(e.g=t[2]/100),t[3]!==void 0&&(e.b=t[3]/100);else return;return t[4]!==void 0?e.alpha=Math.max(0,Math.min(1,t[4]/100)):t[5]!==void 0&&(e.alpha=Math.max(0,Math.min(1,+t[5]))),e},n6=(n,e)=>n===void 0?void 0:typeof n!="object"?d6(n):n.mode!==void 0?n:e?{...n,mode:e}:void 0,Yw=(n="rgb")=>e=>(e=n6(e,n))!==void 0?e.mode===n?e:Ji[e.mode][n]?Ji[e.mode][n](e):n==="rgb"?Ji[e.mode].rgb(e):Ji.rgb[n](Ji[e.mode].rgb(e)):void 0,Ji={},jw={},Od=[],Kw={},i6=n=>n,Et=n=>(Ji[n.mode]={...Ji[n.mode],...n.toMode},Object.keys(n.fromMode||{}).forEach(e=>{Ji[e]||(Ji[e]={}),Ji[e][n.mode]=n.fromMode[e]}),n.ranges||(n.ranges={}),n.difference||(n.difference={}),n.channels.forEach(e=>{if(n.ranges[e]===void 0&&(n.ranges[e]=[0,1]),!n.interpolate[e])throw new Error(`Missing interpolator for: ${e}`);typeof n.interpolate[e]=="function"&&(n.interpolate[e]={use:n.interpolate[e]}),n.interpolate[e].fixup||(n.interpolate[e].fixup=i6)}),jw[n.mode]=n,(n.parse||[]).forEach(e=>{r6(e,n.mode)}),Yw(n.mode)),s6=n=>jw[n],r6=(n,e)=>{if(typeof n=="string"){if(!e)throw new Error("'mode' required when 'parser' is a string");Kw[n]=e}else typeof n=="function"&&Od.indexOf(n)<0&&Od.push(n)},Kg=/[^\x00-\x7F]|[a-zA-Z_]/,o6=/[^\x00-\x7F]|[-\w]/,_e={Function:"function",Ident:"ident",Number:"number",Percentage:"percentage",ParenClose:")",None:"none",Hue:"hue",Alpha:"alpha"};let $e=0;function uf(n){let e=n[$e],t=n[$e+1];return e==="-"||e==="+"?/\d/.test(t)||t==="."&&/\d/.test(n[$e+2]):e==="."?/\d/.test(t):/\d/.test(e)}function Zg(n){if($e>=n.length)return!1;let e=n[$e];if(Kg.test(e))return!0;if(e==="-"){if(n.length-$e<2)return!1;let t=n[$e+1];return!!(t==="-"||Kg.test(t))}return!1}const a6={deg:1,rad:180/Math.PI,grad:9/10,turn:360};function fl(n){let e="";if((n[$e]==="-"||n[$e]==="+")&&(e+=n[$e++]),e+=ff(n),n[$e]==="."&&/\d/.test(n[$e+1])&&(e+=n[$e++]+ff(n)),(n[$e]==="e"||n[$e]==="E")&&((n[$e+1]==="-"||n[$e+1]==="+")&&/\d/.test(n[$e+2])?e+=n[$e++]+n[$e++]+ff(n):/\d/.test(n[$e+1])&&(e+=n[$e++]+ff(n))),Zg(n)){let t=Nd(n);return t==="deg"||t==="rad"||t==="turn"||t==="grad"?{type:_e.Hue,value:e*a6[t]}:void 0}return n[$e]==="%"?($e++,{type:_e.Percentage,value:+e}):{type:_e.Number,value:+e}}function ff(n){let e="";for(;/\d/.test(n[$e]);)e+=n[$e++];return e}function Nd(n){let e="";for(;$e4)){if(t.length===4){if(t[3].type!==_e.Alpha)return;t[3]=t[3].value}return t.length===3&&t.push({type:_e.None,value:void 0}),t.every(s=>s.type!==_e.Alpha)?t:void 0}}function f6(n,e){n._i=0;let t=n[n._i++];if(!t||t.type!==_e.Function)return;let i=Zw(n,e);if(i)return i.unshift(t.value),i}const d6=n=>{if(typeof n!="string")return;const e=c6(n),t=e?f6(e,!0):void 0;let i,s=0,r=Od.length;for(;sn==="transparent"?{mode:"rgb",r:0,g:0,b:0,alpha:0}:void 0,m6=(n,e,t)=>n+t*(e-n),g6=n=>{let e=[];for(let t=0;te=>{let t=g6(e);return i=>{let s=i*t.length,r=i>=1?t.length-1:Math.max(Math.floor(s),0),o=t[r];return o===void 0?void 0:n(o[0],o[1],s-r)}},we=_6(m6),on=n=>{let e=!1,t=n.map(i=>i!==void 0?(e=!0,i):1);return e?t:n},Wa={mode:"rgb",channels:["r","g","b","alpha"],parse:[h6,ZV,t6,jV,p6,"srgb"],serialize:"srgb",interpolate:{r:we,g:we,b:we,alpha:{use:we,fixup:on}},gamut:!0,white:{r:1,g:1,b:1},black:{r:0,g:0,b:0}},Em=(n=0)=>Math.pow(Math.abs(n),563/256)*Math.sign(n),Ox=n=>{let e=Em(n.r),t=Em(n.g),i=Em(n.b),s={mode:"xyz65",x:.5766690429101305*e+.1855582379065463*t+.1882286462349947*i,y:.297344975250536*e+.6273635662554661*t+.0752914584939979*i,z:.0270313613864123*e+.0706888525358272*t+.9913375368376386*i};return n.alpha!==void 0&&(s.alpha=n.alpha),s},Tm=n=>Math.pow(Math.abs(n),256/563)*Math.sign(n),Nx=({x:n,y:e,z:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s={mode:"a98",r:Tm(n*2.0415879038107465-e*.5650069742788597-.3447313507783297*t),g:Tm(n*-.9692436362808798+e*1.8759675015077206+.0415550574071756*t),b:Tm(n*.0134442806320312-e*.1183623922310184+1.0151749943912058*t)};return i!==void 0&&(s.alpha=i),s},wm=(n=0)=>{const e=Math.abs(n);return e<=.04045?n/12.92:(Math.sign(n)||1)*Math.pow((e+.055)/1.055,2.4)},Xa=({r:n,g:e,b:t,alpha:i})=>{let s={mode:"lrgb",r:wm(n),g:wm(e),b:wm(t)};return i!==void 0&&(s.alpha=i),s},Do=n=>{let{r:e,g:t,b:i,alpha:s}=Xa(n),r={mode:"xyz65",x:.4123907992659593*e+.357584339383878*t+.1804807884018343*i,y:.2126390058715102*e+.715168678767756*t+.0721923153607337*i,z:.0193308187155918*e+.119194779794626*t+.9505321522496607*i};return s!==void 0&&(r.alpha=s),r},Am=(n=0)=>{const e=Math.abs(n);return e>.0031308?(Math.sign(n)||1)*(1.055*Math.pow(e,1/2.4)-.055):n*12.92},$a=({r:n,g:e,b:t,alpha:i},s="rgb")=>{let r={mode:s,r:Am(n),g:Am(e),b:Am(t)};return i!==void 0&&(r.alpha=i),r},Oo=({x:n,y:e,z:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=$a({r:n*3.2409699419045226-e*1.537383177570094-.4986107602930034*t,g:n*-.9692436362808796+e*1.8759675015077204+.0415550574071756*t,b:n*.0556300796969936-e*.2039769588889765+1.0569715142428784*t});return i!==void 0&&(s.alpha=i),s},v6={...Wa,mode:"a98",parse:["a98-rgb"],serialize:"a98-rgb",fromMode:{rgb:n=>Nx(Do(n)),xyz65:Nx},toMode:{rgb:n=>Oo(Ox(n)),xyz65:Ox}},yn=n=>(n=n%360)<0?n+360:n,y6=(n,e)=>n.map((t,i,s)=>{if(t===void 0)return t;let r=yn(t);return i===0||n[i-1]===void 0?r:e(r-yn(s[i-1]))}).reduce((t,i)=>!t.length||i===void 0||t[t.length-1]===void 0?(t.push(i),t):(t.push(i+t[t.length-1]),t),[]),Xs=n=>y6(n,e=>Math.abs(e)<=180?e:e-360*Math.sign(e)),ln=[-.14861,1.78277,-.29227,-.90649,1.97294,0],b6=Math.PI/180,x6=180/Math.PI;let Ux=ln[3]*ln[4],Fx=ln[1]*ln[4],kx=ln[1]*ln[2]-ln[0]*ln[3];const M6=({r:n,g:e,b:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=(kx*t+n*Ux-e*Fx)/(kx+Ux-Fx),r=t-s,o=(ln[4]*(e-s)-ln[2]*r)/ln[3],a={mode:"cubehelix",l:s,s:s===0||s===1?void 0:Math.sqrt(r*r+o*o)/(ln[4]*s*(1-s))};return a.s&&(a.h=Math.atan2(o,r)*x6-120),i!==void 0&&(a.alpha=i),a},S6=({h:n,s:e,l:t,alpha:i})=>{let s={mode:"rgb"};n=(n===void 0?0:n+120)*b6,t===void 0&&(t=0);let r=e===void 0?0:e*t*(1-t),o=Math.cos(n),a=Math.sin(n);return s.r=t+r*(ln[0]*o+ln[1]*a),s.g=t+r*(ln[2]*o+ln[3]*a),s.b=t+r*(ln[4]*o+ln[5]*a),i!==void 0&&(s.alpha=i),s},Yh=(n,e)=>{if(n.h===void 0||e.h===void 0||!n.s||!e.s)return 0;let t=yn(n.h),i=yn(e.h),s=Math.sin((i-t+360)/2*Math.PI/180);return 2*Math.sqrt(n.s*e.s)*s},E6=(n,e)=>{if(n.h===void 0||e.h===void 0)return 0;let t=yn(n.h),i=yn(e.h);return Math.abs(i-t)>180?t-(i-360*Math.sign(i-t)):i-t},jh=(n,e)=>{if(n.h===void 0||e.h===void 0||!n.c||!e.c)return 0;let t=yn(n.h),i=yn(e.h),s=Math.sin((i-t+360)/2*Math.PI/180);return 2*Math.sqrt(n.c*e.c)*s},$s=n=>{let e=n.reduce((i,s)=>{if(s!==void 0){let r=s*Math.PI/180;i.sin+=Math.sin(r),i.cos+=Math.cos(r)}return i},{sin:0,cos:0}),t=Math.atan2(e.sin,e.cos)*180/Math.PI;return t<0?360+t:t},T6={mode:"cubehelix",channels:["h","s","l","alpha"],parse:["--cubehelix"],serialize:"--cubehelix",ranges:{h:[0,360],s:[0,4.614],l:[0,1]},fromMode:{rgb:M6},toMode:{rgb:S6},interpolate:{h:{use:we,fixup:Xs},s:we,l:we,alpha:{use:we,fixup:on}},difference:{h:Yh},average:{h:$s}},Mr=({l:n,a:e,b:t,alpha:i},s="lch")=>{e===void 0&&(e=0),t===void 0&&(t=0);let r=Math.sqrt(e*e+t*t),o={mode:s,l:n,c:r};return r&&(o.h=yn(Math.atan2(t,e)*180/Math.PI)),i!==void 0&&(o.alpha=i),o},Sr=({l:n,c:e,h:t,alpha:i},s="lab")=>{t===void 0&&(t=0);let r={mode:s,l:n,a:e?e*Math.cos(t/180*Math.PI):0,b:e?e*Math.sin(t/180*Math.PI):0};return i!==void 0&&(r.alpha=i),r},Jw=Math.pow(29,3)/Math.pow(3,3),Qw=Math.pow(6,3)/Math.pow(29,3),Jt={X:.3457/.3585,Y:1,Z:(1-.3457-.3585)/.3585},_a={X:.3127/.329,Y:1,Z:(1-.3127-.329)/.329};let Cm=n=>Math.pow(n,3)>Qw?Math.pow(n,3):(116*n-16)/Jw;const eA=({l:n,a:e,b:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=(n+16)/116,r=e/500+s,o=s-t/200,a={mode:"xyz65",x:Cm(r)*_a.X,y:Cm(s)*_a.Y,z:Cm(o)*_a.Z};return i!==void 0&&(a.alpha=i),a},Kh=n=>Oo(eA(n)),Rm=n=>n>Qw?Math.cbrt(n):(Jw*n+16)/116,tA=({x:n,y:e,z:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=Rm(n/_a.X),r=Rm(e/_a.Y),o=Rm(t/_a.Z),a={mode:"lab65",l:116*r-16,a:500*(s-r),b:200*(r-o)};return i!==void 0&&(a.alpha=i),a},Zh=n=>{let e=tA(Do(n));return n.r===n.b&&n.b===n.g&&(e.a=e.b=0),e},Ud=1,nA=1,Sc=26/180*Math.PI,Fd=Math.cos(Sc),kd=Math.sin(Sc),iA=100/Math.log(139/100),Jg=({l:n,c:e,h:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s={mode:"lab65",l:(Math.exp(n*Ud/iA)-1)/.0039},r=(Math.exp(.0435*e*nA*Ud)-1)/.075,o=r*Math.cos(t/180*Math.PI-Sc),a=r*Math.sin(t/180*Math.PI-Sc);return s.a=o*Fd-a/.83*kd,s.b=o*kd+a/.83*Fd,i!==void 0&&(s.alpha=i),s},Qg=({l:n,a:e,b:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=e*Fd+t*kd,r=.83*(t*Fd-e*kd),o=Math.sqrt(s*s+r*r),a={mode:"dlch",l:iA/Ud*Math.log(1+.0039*n),c:Math.log(1+.075*o)/(.0435*nA*Ud)};return a.c&&(a.h=yn((Math.atan2(r,s)+Sc)/Math.PI*180)),i!==void 0&&(a.alpha=i),a},Bx=n=>Jg(Mr(n,"dlch")),zx=n=>Sr(Qg(n),"dlab"),w6={mode:"dlab",parse:["--din99o-lab"],serialize:"--din99o-lab",toMode:{lab65:Bx,rgb:n=>Kh(Bx(n))},fromMode:{lab65:zx,rgb:n=>zx(Zh(n))},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-40.09,45.501],b:[-40.469,44.344]},interpolate:{l:we,a:we,b:we,alpha:{use:we,fixup:on}}},A6={mode:"dlch",parse:["--din99o-lch"],serialize:"--din99o-lch",toMode:{lab65:Jg,dlab:n=>Sr(n,"dlab"),rgb:n=>Kh(Jg(n))},fromMode:{lab65:Qg,dlab:n=>Mr(n,"dlch"),rgb:n=>Qg(Zh(n))},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,51.484],h:[0,360]},interpolate:{l:we,c:we,h:{use:we,fixup:Xs},alpha:{use:we,fixup:on}},difference:{h:jh},average:{h:$s}};function C6({h:n,s:e,i:t,alpha:i}){n=yn(n!==void 0?n:0),e===void 0&&(e=0),t===void 0&&(t=0);let s=Math.abs(n/60%2-1),r;switch(Math.floor(n/60)){case 0:r={r:t*(1+e*(3/(2-s)-1)),g:t*(1+e*(3*(1-s)/(2-s)-1)),b:t*(1-e)};break;case 1:r={r:t*(1+e*(3*(1-s)/(2-s)-1)),g:t*(1+e*(3/(2-s)-1)),b:t*(1-e)};break;case 2:r={r:t*(1-e),g:t*(1+e*(3/(2-s)-1)),b:t*(1+e*(3*(1-s)/(2-s)-1))};break;case 3:r={r:t*(1-e),g:t*(1+e*(3*(1-s)/(2-s)-1)),b:t*(1+e*(3/(2-s)-1))};break;case 4:r={r:t*(1+e*(3*(1-s)/(2-s)-1)),g:t*(1-e),b:t*(1+e*(3/(2-s)-1))};break;case 5:r={r:t*(1+e*(3/(2-s)-1)),g:t*(1-e),b:t*(1+e*(3*(1-s)/(2-s)-1))};break;default:r={r:t*(1-e),g:t*(1-e),b:t*(1-e)}}return r.mode="rgb",i!==void 0&&(r.alpha=i),r}function R6({r:n,g:e,b:t,alpha:i}){n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=Math.max(n,e,t),r=Math.min(n,e,t),o={mode:"hsi",s:n+e+t===0?0:1-3*r/(n+e+t),i:(n+e+t)/3};return s-r!==0&&(o.h=(s===n?(e-t)/(s-r)+(e{switch(e){case"deg":return+n;case"rad":return n/Math.PI*180;case"grad":return n/10*9;case"turn":return n*360}},O6=new RegExp(`^hsla?\\(\\s*${JV}${Da}${Gl}${Da}${Gl}\\s*(?:,\\s*${H_}\\s*)?\\)$`),N6=n=>{let e=n.match(O6);if(!e)return;let t={mode:"hsl"};return e[3]!==void 0?t.h=+e[3]:e[1]!==void 0&&e[2]!==void 0&&(t.h=D6(e[1],e[2])),e[4]!==void 0&&(t.s=Math.min(Math.max(0,e[4]/100),1)),e[5]!==void 0&&(t.l=Math.min(Math.max(0,e[5]/100),1)),e[6]!==void 0?t.alpha=Math.max(0,Math.min(1,e[6]/100)):e[7]!==void 0&&(t.alpha=Math.max(0,Math.min(1,+e[7]))),t};function U6(n,e){if(!e||e[0]!=="hsl"&&e[0]!=="hsla")return;const t={mode:"hsl"},[,i,s,r,o]=e;if(i.type!==_e.None){if(i.type===_e.Percentage)return;t.h=i.value}if(s.type!==_e.None){if(s.type===_e.Hue)return;t.s=s.value/100}if(r.type!==_e.None){if(r.type===_e.Hue)return;t.l=r.value/100}return o.type!==_e.None&&(t.alpha=Math.min(1,Math.max(0,o.type===_e.Number?o.value:o.value/100))),t}const sA={mode:"hsl",toMode:{rgb:I6},fromMode:{rgb:L6},channels:["h","s","l","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[U6,N6],serialize:n=>`hsl(${n.h!==void 0?n.h:"none"} ${n.s!==void 0?n.s*100+"%":"none"} ${n.l!==void 0?n.l*100+"%":"none"}${n.alpha<1?` / ${n.alpha}`:""})`,interpolate:{h:{use:we,fixup:Xs},s:we,l:we,alpha:{use:we,fixup:on}},difference:{h:Yh},average:{h:$s}};function rA({h:n,s:e,v:t,alpha:i}){n=yn(n!==void 0?n:0),e===void 0&&(e=0),t===void 0&&(t=0);let s=Math.abs(n/60%2-1),r;switch(Math.floor(n/60)){case 0:r={r:t,g:t*(1-e*s),b:t*(1-e)};break;case 1:r={r:t*(1-e*s),g:t,b:t*(1-e)};break;case 2:r={r:t*(1-e),g:t,b:t*(1-e*s)};break;case 3:r={r:t*(1-e),g:t*(1-e*s),b:t};break;case 4:r={r:t*(1-e*s),g:t*(1-e),b:t};break;case 5:r={r:t,g:t*(1-e),b:t*(1-e*s)};break;default:r={r:t*(1-e),g:t*(1-e),b:t*(1-e)}}return r.mode="rgb",i!==void 0&&(r.alpha=i),r}function oA({r:n,g:e,b:t,alpha:i}){n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=Math.max(n,e,t),r=Math.min(n,e,t),o={mode:"hsv",s:s===0?0:1-r/s,v:s};return s-r!==0&&(o.h=(s===n?(e-t)/(s-r)+(e1){let s=e+t;e/=s,t/=s}return rA({h:n,s:t===1?1:1-e/(1-t),v:1-t,alpha:i})}function k6(n){let e=oA(n);if(e===void 0)return;let t=e.s!==void 0?e.s:0,i=e.v!==void 0?e.v:0,s={mode:"hwb",w:(1-t)*i,b:1-i};return e.h!==void 0&&(s.h=e.h),e.alpha!==void 0&&(s.alpha=e.alpha),s}function B6(n,e){if(!e||e[0]!=="hwb")return;const t={mode:"hwb"},[,i,s,r,o]=e;if(i.type!==_e.None){if(i.type===_e.Percentage)return;t.h=i.value}if(s.type!==_e.None){if(s.type===_e.Hue)return;t.w=s.value/100}if(r.type!==_e.None){if(r.type===_e.Hue)return;t.b=r.value/100}return o.type!==_e.None&&(t.alpha=Math.min(1,Math.max(0,o.type===_e.Number?o.value:o.value/100))),t}const z6={mode:"hwb",toMode:{rgb:F6},fromMode:{rgb:k6},channels:["h","w","b","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[B6],serialize:n=>`hwb(${n.h!==void 0?n.h:"none"} ${n.w!==void 0?n.w*100+"%":"none"} ${n.b!==void 0?n.b*100+"%":"none"}${n.alpha<1?` / ${n.alpha}`:""})`,interpolate:{h:{use:we,fixup:Xs},w:we,b:we,alpha:{use:we,fixup:on}},difference:{h:E6},average:{h:$s}},lA=203,Jh=.1593017578125,cA=78.84375,Qh=.8359375,ep=18.8515625,tp=18.6875;function Pm(n){if(n<0)return 0;const e=Math.pow(n,1/cA);return 1e4*Math.pow(Math.max(0,e-Qh)/(ep-tp*e),1/Jh)}function Im(n){if(n<0)return 0;const e=Math.pow(n/1e4,Jh);return Math.pow((Qh+ep*e)/(1+tp*e),cA)}const Lm=n=>Math.max(n/lA,0),Vx=({i:n,t:e,p:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);const s=Pm(n+.008609037037932761*e+.11102962500302593*t),r=Pm(n-.00860903703793275*e-.11102962500302599*t),o=Pm(n+.5600313357106791*e-.32062717498731885*t),a={mode:"xyz65",x:Lm(2.070152218389422*s-1.3263473389671556*r+.2066510476294051*o),y:Lm(.3647385209748074*s+.680566024947227*r-.0453045459220346*o),z:Lm(-.049747207535812*s-.0492609666966138*r+1.1880659249923042*o)};return i!==void 0&&(a.alpha=i),a},Dm=(n=0)=>Math.max(n*lA,0),Hx=({x:n,y:e,z:t,alpha:i})=>{const s=Dm(n),r=Dm(e),o=Dm(t),a=Im(.3592832590121217*s+.6976051147779502*r-.0358915932320289*o),l=Im(-.1920808463704995*s+1.1004767970374323*r+.0753748658519118*o),c=Im(.0070797844607477*s+.0748396662186366*r+.8433265453898765*o),u=.5*a+.5*l,f=1.61376953125*a-3.323486328125*l+1.709716796875*c,d=4.378173828125*a-4.24560546875*l-.132568359375*c,h={mode:"itp",i:u,t:f,p:d};return i!==void 0&&(h.alpha=i),h},V6={mode:"itp",channels:["i","t","p","alpha"],parse:["--ictcp"],serialize:"--ictcp",toMode:{xyz65:Vx,rgb:n=>Oo(Vx(n))},fromMode:{xyz65:Hx,rgb:n=>Hx(Do(n))},ranges:{i:[0,.581],t:[-.369,.272],p:[-.164,.331]},interpolate:{i:we,t:we,p:we,alpha:{use:we,fixup:on}}},H6=134.03437499999998,G6=16295499532821565e-27,Om=n=>{if(n<0)return 0;let e=Math.pow(n/1e4,Jh);return Math.pow((Qh+ep*e)/(1+tp*e),H6)},Nm=(n=0)=>Math.max(n*203,0),uA=({x:n,y:e,z:t,alpha:i})=>{n=Nm(n),e=Nm(e),t=Nm(t);let s=1.15*n-.15*t,r=.66*e+.34*n,o=Om(.41478972*s+.579999*r+.014648*t),a=Om(-.20151*s+1.120649*r+.0531008*t),l=Om(-.0166008*s+.2648*r+.6684799*t),c=(o+a)/2,u={mode:"jab",j:.44*c/(1-.56*c)-G6,a:3.524*o-4.066708*a+.542708*l,b:.199076*o+1.096799*a-1.295875*l};return i!==void 0&&(u.alpha=i),u},W6=134.03437499999998,Gx=16295499532821565e-27,Um=n=>{if(n<0)return 0;let e=Math.pow(n,1/W6);return 1e4*Math.pow((Qh-e)/(tp*e-ep),1/Jh)},Fm=n=>n/203,fA=({j:n,a:e,b:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=(n+Gx)/(.44+.56*(n+Gx)),r=Um(s+.13860504*e+.058047316*t),o=Um(s-.13860504*e-.058047316*t),a=Um(s-.096019242*e-.8118919*t),l={mode:"xyz65",x:Fm(1.661373024652174*r-.914523081304348*o+.23136208173913045*a),y:Fm(-.3250758611844533*r+1.571847026732543*o-.21825383453227928*a),z:Fm(-.090982811*r-.31272829*o+1.5227666*a)};return i!==void 0&&(l.alpha=i),l},dA=n=>{let e=uA(Do(n));return n.r===n.b&&n.b===n.g&&(e.a=e.b=0),e},hA=n=>Oo(fA(n)),X6={mode:"jab",channels:["j","a","b","alpha"],parse:["--jzazbz"],serialize:"--jzazbz",fromMode:{rgb:dA,xyz65:uA},toMode:{rgb:hA,xyz65:fA},ranges:{j:[0,.222],a:[-.109,.129],b:[-.185,.134]},interpolate:{j:we,a:we,b:we,alpha:{use:we,fixup:on}}},Wx=({j:n,a:e,b:t,alpha:i})=>{e===void 0&&(e=0),t===void 0&&(t=0);let s=Math.sqrt(e*e+t*t),r={mode:"jch",j:n,c:s};return s&&(r.h=yn(Math.atan2(t,e)*180/Math.PI)),i!==void 0&&(r.alpha=i),r},Xx=({j:n,c:e,h:t,alpha:i})=>{t===void 0&&(t=0);let s={mode:"jab",j:n,a:e?e*Math.cos(t/180*Math.PI):0,b:e?e*Math.sin(t/180*Math.PI):0};return i!==void 0&&(s.alpha=i),s},$6={mode:"jch",parse:["--jzczhz"],serialize:"--jzczhz",toMode:{jab:Xx,rgb:n=>hA(Xx(n))},fromMode:{rgb:n=>Wx(dA(n)),jab:Wx},channels:["j","c","h","alpha"],ranges:{j:[0,.221],c:[0,.19],h:[0,360]},interpolate:{h:{use:we,fixup:Xs},c:we,j:we,alpha:{use:we,fixup:on}},difference:{h:jh},average:{h:$s}},np=Math.pow(29,3)/Math.pow(3,3),G_=Math.pow(6,3)/Math.pow(29,3);let km=n=>Math.pow(n,3)>G_?Math.pow(n,3):(116*n-16)/np;const W_=({l:n,a:e,b:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=(n+16)/116,r=e/500+s,o=s-t/200,a={mode:"xyz50",x:km(r)*Jt.X,y:km(s)*Jt.Y,z:km(o)*Jt.Z};return i!==void 0&&(a.alpha=i),a},Zc=({x:n,y:e,z:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=$a({r:n*3.1341359569958707-e*1.6173863321612538-.4906619460083532*t,g:n*-.978795502912089+e*1.916254567259524+.03344273116131949*t,b:n*.07195537988411677-e*.2289768264158322+1.405386058324125*t});return i!==void 0&&(s.alpha=i),s},pA=n=>Zc(W_(n)),Jc=n=>{let{r:e,g:t,b:i,alpha:s}=Xa(n),r={mode:"xyz50",x:.436065742824811*e+.3851514688337912*t+.14307845442264197*i,y:.22249319175623702*e+.7168870538238823*t+.06061979053616537*i,z:.013923904500943465*e+.09708128566574634*t+.7140993584005155*i};return s!==void 0&&(r.alpha=s),r},Bm=n=>n>G_?Math.cbrt(n):(np*n+16)/116,X_=({x:n,y:e,z:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=Bm(n/Jt.X),r=Bm(e/Jt.Y),o=Bm(t/Jt.Z),a={mode:"lab",l:116*r-16,a:500*(s-r),b:200*(r-o)};return i!==void 0&&(a.alpha=i),a},mA=n=>{let e=X_(Jc(n));return n.r===n.b&&n.b===n.g&&(e.a=e.b=0),e};function q6(n,e){if(!e||e[0]!=="lab")return;const t={mode:"lab"},[,i,s,r,o]=e;if(!(i.type===_e.Hue||s.type===_e.Hue||r.type===_e.Hue))return i.type!==_e.None&&(t.l=Math.min(Math.max(0,i.value),100)),s.type!==_e.None&&(t.a=s.type===_e.Number?s.value:s.value*125/100),r.type!==_e.None&&(t.b=r.type===_e.Number?r.value:r.value*125/100),o.type!==_e.None&&(t.alpha=Math.min(1,Math.max(0,o.type===_e.Number?o.value:o.value/100))),t}const $_={mode:"lab",toMode:{xyz50:W_,rgb:pA},fromMode:{xyz50:X_,rgb:mA},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-100,100],b:[-100,100]},parse:[q6],serialize:n=>`lab(${n.l!==void 0?n.l:"none"} ${n.a!==void 0?n.a:"none"} ${n.b!==void 0?n.b:"none"}${n.alpha<1?` / ${n.alpha}`:""})`,interpolate:{l:we,a:we,b:we,alpha:{use:we,fixup:on}}},Y6={...$_,mode:"lab65",parse:["--lab-d65"],serialize:"--lab-d65",toMode:{xyz65:eA,rgb:Kh},fromMode:{xyz65:tA,rgb:Zh},ranges:{l:[0,100],a:[-86.182,98.234],b:[-107.86,94.477]}};function j6(n,e){if(!e||e[0]!=="lch")return;const t={mode:"lch"},[,i,s,r,o]=e;if(i.type!==_e.None){if(i.type===_e.Hue)return;t.l=Math.min(Math.max(0,i.value),100)}if(s.type!==_e.None&&(t.c=Math.max(0,s.type===_e.Number?s.value:s.value*150/100)),r.type!==_e.None){if(r.type===_e.Percentage)return;t.h=r.value}return o.type!==_e.None&&(t.alpha=Math.min(1,Math.max(0,o.type===_e.Number?o.value:o.value/100))),t}const q_={mode:"lch",toMode:{lab:Sr,rgb:n=>pA(Sr(n))},fromMode:{rgb:n=>Mr(mA(n)),lab:Mr},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,150],h:[0,360]},parse:[j6],serialize:n=>`lch(${n.l!==void 0?n.l:"none"} ${n.c!==void 0?n.c:"none"} ${n.h!==void 0?n.h:"none"}${n.alpha<1?` / ${n.alpha}`:""})`,interpolate:{h:{use:we,fixup:Xs},c:we,l:we,alpha:{use:we,fixup:on}},difference:{h:jh},average:{h:$s}},K6={...q_,mode:"lch65",parse:["--lch-d65"],serialize:"--lch-d65",toMode:{lab65:n=>Sr(n,"lab65"),rgb:n=>Kh(Sr(n,"lab65"))},fromMode:{rgb:n=>Mr(Zh(n),"lch65"),lab65:n=>Mr(n,"lch65")},ranges:{l:[0,100],c:[0,133.807],h:[0,360]}},gA=({l:n,u:e,v:t,alpha:i})=>{e===void 0&&(e=0),t===void 0&&(t=0);let s=Math.sqrt(e*e+t*t),r={mode:"lchuv",l:n,c:s};return s&&(r.h=yn(Math.atan2(t,e)*180/Math.PI)),i!==void 0&&(r.alpha=i),r},_A=({l:n,c:e,h:t,alpha:i})=>{t===void 0&&(t=0);let s={mode:"luv",l:n,u:e?e*Math.cos(t/180*Math.PI):0,v:e?e*Math.sin(t/180*Math.PI):0};return i!==void 0&&(s.alpha=i),s},vA=(n,e,t)=>4*n/(n+15*e+3*t),yA=(n,e,t)=>9*e/(n+15*e+3*t),Z6=vA(Jt.X,Jt.Y,Jt.Z),J6=yA(Jt.X,Jt.Y,Jt.Z),Q6=n=>n<=G_?np*n:116*Math.cbrt(n)-16,e0=({x:n,y:e,z:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=Q6(e/Jt.Y),r=vA(n,e,t),o=yA(n,e,t);!isFinite(r)||!isFinite(o)?s=r=o=0:(r=13*s*(r-Z6),o=13*s*(o-J6));let a={mode:"luv",l:s,u:r,v:o};return i!==void 0&&(a.alpha=i),a},eH=(n,e,t)=>4*n/(n+15*e+3*t),tH=(n,e,t)=>9*e/(n+15*e+3*t),nH=eH(Jt.X,Jt.Y,Jt.Z),iH=tH(Jt.X,Jt.Y,Jt.Z),t0=({l:n,u:e,v:t,alpha:i})=>{if(n===void 0&&(n=0),n===0)return{mode:"xyz50",x:0,y:0,z:0};e===void 0&&(e=0),t===void 0&&(t=0);let s=e/(13*n)+nH,r=t/(13*n)+iH,o=Jt.Y*(n<=8?n/np:Math.pow((n+16)/116,3)),a=o*(9*s)/(4*r),l=o*(12-3*s-20*r)/(4*r),c={mode:"xyz50",x:a,y:o,z:l};return i!==void 0&&(c.alpha=i),c},sH=n=>gA(e0(Jc(n))),rH=n=>Zc(t0(_A(n))),oH={mode:"lchuv",toMode:{luv:_A,rgb:rH},fromMode:{rgb:sH,luv:gA},channels:["l","c","h","alpha"],parse:["--lchuv"],serialize:"--lchuv",ranges:{l:[0,100],c:[0,176.956],h:[0,360]},interpolate:{h:{use:we,fixup:Xs},c:we,l:we,alpha:{use:we,fixup:on}},difference:{h:jh},average:{h:$s}},aH={...Wa,mode:"lrgb",toMode:{rgb:$a},fromMode:{rgb:Xa},parse:["srgb-linear"],serialize:"srgb-linear"},lH={mode:"luv",toMode:{xyz50:t0,rgb:n=>Zc(t0(n))},fromMode:{xyz50:e0,rgb:n=>e0(Jc(n))},channels:["l","u","v","alpha"],parse:["--luv"],serialize:"--luv",ranges:{l:[0,100],u:[-84.936,175.042],v:[-125.882,87.243]},interpolate:{l:we,u:we,v:we,alpha:{use:we,fixup:on}}},bA=({r:n,g:e,b:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=Math.cbrt(.41222147079999993*n+.5363325363*e+.0514459929*t),r=Math.cbrt(.2119034981999999*n+.6806995450999999*e+.1073969566*t),o=Math.cbrt(.08830246189999998*n+.2817188376*e+.6299787005000002*t),a={mode:"oklab",l:.2104542553*s+.793617785*r-.0040720468*o,a:1.9779984951*s-2.428592205*r+.4505937099*o,b:.0259040371*s+.7827717662*r-.808675766*o};return i!==void 0&&(a.alpha=i),a},ip=n=>{let e=bA(Xa(n));return n.r===n.b&&n.b===n.g&&(e.a=e.b=0),e},Qc=({l:n,a:e,b:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=Math.pow(n*.9999999984505198+.39633779217376786*e+.2158037580607588*t,3),r=Math.pow(n*1.0000000088817609-.10556134232365635*e-.06385417477170591*t,3),o=Math.pow(n*1.0000000546724108-.08948418209496575*e-1.2914855378640917*t,3),a={mode:"lrgb",r:4.076741661347994*s-3.307711590408193*r+.230969928729428*o,g:-1.2684380040921763*s+2.6097574006633715*r-.3413193963102197*o,b:-.004196086541837188*s-.7034186144594493*r+1.7076147009309444*o};return i!==void 0&&(a.alpha=i),a},sp=n=>$a(Qc(n));function n0(n){const i=1.170873786407767;return .5*(i*n-.206+Math.sqrt((i*n-.206)*(i*n-.206)+4*.03*i*n))}function Bd(n){return(n*n+.206*n)/(1.170873786407767*(n+.03))}function cH(n,e){let t,i,s,r,o,a,l,c;-1.88170328*n-.80936493*e>1?(t=1.19086277,i=1.76576728,s=.59662641,r=.75515197,o=.56771245,a=4.0767416621,l=-3.3077115913,c=.2309699292):1.81444104*n-1.19445276*e>1?(t=.73956515,i=-.45954404,s=.08285427,r=.1254107,o=.14503204,a=-1.2684380046,l=2.6097574011,c=-.3413193965):(t=1.35733652,i=-.00915799,s=-1.1513021,r=-.50559606,o=.00692167,a=-.0041960863,l=-.7034186147,c=1.707614701);let u=t+i*n+s*e+r*n*n+o*n*e,f=.3963377774*n+.2158037573*e,d=-.1055613458*n-.0638541728*e,h=-.0894841775*n-1.291485548*e;{let p=1+u*f,_=1+u*d,g=1+u*h,m=p*p*p,y=_*_*_,b=g*g*g,v=3*f*p*p,E=3*d*_*_,T=3*h*g*g,S=6*f*f*p,P=6*d*d*_,x=6*h*h*g,M=a*m+l*y+c*b,I=a*v+l*E+c*T,N=a*S+l*P+c*x;u=u-M*I/(I*I-.5*M*N)}return u}function Y_(n,e){let t=cH(n,e),i=Qc({l:1,a:t*n,b:t*e}),s=Math.cbrt(1/Math.max(i.r,i.g,i.b)),r=s*t;return[s,r]}function uH(n,e,t,i,s,r=null){r||(r=Y_(n,e));let o;if((t-s)*r[1]-(r[0]-s)*i<=0)o=r[1]*s/(i*r[0]+r[1]*(s-t));else{o=r[1]*(s-1)/(i*(r[0]-1)+r[1]*(s-t));{let a=t-s,l=i,c=.3963377774*n+.2158037573*e,u=-.1055613458*n-.0638541728*e,f=-.0894841775*n-1.291485548*e,d=a+l*c,h=a+l*u,p=a+l*f;{let _=s*(1-o)+o*t,g=o*i,m=_+g*c,y=_+g*u,b=_+g*f,v=m*m*m,E=y*y*y,T=b*b*b,S=3*d*m*m,P=3*h*y*y,x=3*p*b*b,M=6*d*d*m,I=6*h*h*y,N=6*p*p*b,V=4.0767416621*v-3.3077115913*E+.2309699292*T-1,j=4.0767416621*S-3.3077115913*P+.2309699292*x,te=4.0767416621*M-3.3077115913*I+.2309699292*N,Z=j/(j*j-.5*V*te),ee=-V*Z,J=-1.2684380046*v+2.6097574011*E-.3413193965*T-1,he=-1.2684380046*S+2.6097574011*P-.3413193965*x,be=-1.2684380046*M+2.6097574011*I-.3413193965*N,se=he/(he*he-.5*J*be),ye=-J*se,Be=-.0041960863*v-.7034186147*E+1.707614701*T-1,re=-.0041960863*S-.7034186147*P+1.707614701*x,ge=-.0041960863*M-.7034186147*I+1.707614701*N,xe=re/(re*re-.5*Be*ge),$=-Be*xe;ee=Z>=0?ee:1e6,ye=se>=0?ye:1e6,$=xe>=0?$:1e6,o+=Math.min(ee,Math.min(ye,$))}}}return o}function j_(n,e,t=null){t||(t=Y_(n,e));let i=t[0],s=t[1];return[s/i,s/(1-i)]}function xA(n,e,t){let i=Y_(e,t),s=uH(e,t,n,1,n,i),r=j_(e,t,i),o=.11516993+1/(7.4477897+4.1590124*t+e*(-2.19557347+1.75198401*t+e*(-2.13704948-10.02301043*t+e*(-4.24894561+5.38770819*t+4.69891013*e)))),a=.11239642+1/(1.6132032-.68124379*t+e*(.40370612+.90148123*t+e*(-.27087943+.6122399*t+e*(.00299215-.45399568*t-.14661872*e)))),l=s/Math.min(n*r[0],(1-n)*r[1]),c=n*o,u=(1-n)*a,f=.9*l*Math.sqrt(Math.sqrt(1/(1/(c*c*c*c)+1/(u*u*u*u))));return c=n*.4,u=(1-n)*.8,[Math.sqrt(1/(1/(c*c)+1/(u*u))),f,s]}function $x(n){const e=n.l!==void 0?n.l:0,t=n.a!==void 0?n.a:0,i=n.b!==void 0?n.b:0,s={mode:"okhsl",l:n0(e)};n.alpha!==void 0&&(s.alpha=n.alpha);let r=Math.sqrt(t*t+i*i);if(!r)return s.s=0,s;let[o,a,l]=xA(e,t/r,i/r),c;if(r$x(ip(n))},toMode:{oklab:qx,rgb:n=>sp(qx(n))}};function Yx(n){let e=n.l!==void 0?n.l:0,t=n.a!==void 0?n.a:0,i=n.b!==void 0?n.b:0,s=Math.sqrt(t*t+i*i),r=s?t/s:1,o=s?i/s:1,[a,l]=j_(r,o),c=.5,u=1-c/a,f=l/(s+e*l),d=f*e,h=f*s,p=Bd(d),_=h*p/d,g=Qc({l:p,a:r*_,b:o*_}),m=Math.cbrt(1/Math.max(g.r,g.g,g.b,0));e=e/m,s=s/m*n0(e)/e,e=n0(e);const y={mode:"okhsv",s:s?(c+l)*h/(l*c+l*u*h):0,v:e?e/d:0};return y.s&&(y.h=yn(Math.atan2(i,t)*180/Math.PI)),n.alpha!==void 0&&(y.alpha=n.alpha),y}function jx(n){const e={mode:"oklab"};n.alpha!==void 0&&(e.alpha=n.alpha);const t=n.h!==void 0?n.h:0,i=n.s!==void 0?n.s:0,s=n.v!==void 0?n.v:0,r=Math.cos(t/180*Math.PI),o=Math.sin(t/180*Math.PI),[a,l]=j_(r,o),c=.5,u=1-c/a,f=1-i*c/(c+l-l*u*i),d=i*l*c/(c+l-l*u*i),h=Bd(f),p=d*h/f,_=Qc({l:h,a:r*p,b:o*p}),g=Math.cbrt(1/Math.max(_.r,_.g,_.b,0)),m=Bd(s*f),y=d*m/f;return e.l=m*g,e.a=y*r*g,e.b=y*o*g,e}const dH={...aA,mode:"okhsv",channels:["h","s","v","alpha"],parse:["--okhsv"],serialize:"--okhsv",fromMode:{oklab:Yx,rgb:n=>Yx(ip(n))},toMode:{oklab:jx,rgb:n=>sp(jx(n))}};function hH(n,e){if(!e||e[0]!=="oklab")return;const t={mode:"oklab"},[,i,s,r,o]=e;if(!(i.type===_e.Hue||s.type===_e.Hue||r.type===_e.Hue))return i.type!==_e.None&&(t.l=Math.min(Math.max(0,i.type===_e.Number?i.value:i.value/100),1)),s.type!==_e.None&&(t.a=s.type===_e.Number?s.value:s.value*.4/100),r.type!==_e.None&&(t.b=r.type===_e.Number?r.value:r.value*.4/100),o.type!==_e.None&&(t.alpha=Math.min(1,Math.max(0,o.type===_e.Number?o.value:o.value/100))),t}const pH={...$_,mode:"oklab",toMode:{lrgb:Qc,rgb:sp},fromMode:{lrgb:bA,rgb:ip},ranges:{l:[0,1],a:[-.4,.4],b:[-.4,.4]},parse:[hH],serialize:n=>`oklab(${n.l!==void 0?n.l:"none"} ${n.a!==void 0?n.a:"none"} ${n.b!==void 0?n.b:"none"}${n.alpha<1?` / ${n.alpha}`:""})`};function mH(n,e){if(!e||e[0]!=="oklch")return;const t={mode:"oklch"},[,i,s,r,o]=e;if(i.type!==_e.None){if(i.type===_e.Hue)return;t.l=Math.min(Math.max(0,i.type===_e.Number?i.value:i.value/100),1)}if(s.type!==_e.None&&(t.c=Math.max(0,s.type===_e.Number?s.value:s.value*.4/100)),r.type!==_e.None){if(r.type===_e.Percentage)return;t.h=r.value}return o.type!==_e.None&&(t.alpha=Math.min(1,Math.max(0,o.type===_e.Number?o.value:o.value/100))),t}const gH={...q_,mode:"oklch",toMode:{oklab:n=>Sr(n,"oklab"),rgb:n=>sp(Sr(n,"oklab"))},fromMode:{rgb:n=>Mr(ip(n),"oklch"),oklab:n=>Mr(n,"oklch")},parse:[mH],serialize:n=>`oklch(${n.l!==void 0?n.l:"none"} ${n.c!==void 0?n.c:"none"} ${n.h!==void 0?n.h:"none"}${n.alpha<1?` / ${n.alpha}`:""})`,ranges:{l:[0,1],c:[0,.4],h:[0,360]}},Kx=n=>{let{r:e,g:t,b:i,alpha:s}=Xa(n),r={mode:"xyz65",x:.486570948648216*e+.265667693169093*t+.1982172852343625*i,y:.2289745640697487*e+.6917385218365062*t+.079286914093745*i,z:0*e+.0451133818589026*t+1.043944368900976*i};return s!==void 0&&(r.alpha=s),r},Zx=({x:n,y:e,z:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s=$a({r:n*2.4934969119414263-e*.9313836179191242-.402710784450717*t,g:n*-.8294889695615749+e*1.7626640603183465+.0236246858419436*t,b:n*.0358458302437845-e*.0761723892680418+.9568845240076871*t},"p3");return i!==void 0&&(s.alpha=i),s},_H={...Wa,mode:"p3",parse:["display-p3"],serialize:"display-p3",fromMode:{rgb:n=>Zx(Do(n)),xyz65:Zx},toMode:{rgb:n=>Oo(Kx(n)),xyz65:Kx}},zm=n=>{let e=Math.abs(n);return e>=1/512?Math.sign(n)*Math.pow(e,1/1.8):16*n},Jx=({x:n,y:e,z:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s={mode:"prophoto",r:zm(n*1.3457868816471585-e*.2555720873797946-.0511018649755453*t),g:zm(n*-.5446307051249019+e*1.5082477428451466+.0205274474364214*t),b:zm(n*0+e*0+1.2119675456389452*t)};return i!==void 0&&(s.alpha=i),s},Vm=(n=0)=>{let e=Math.abs(n);return e>=16/512?Math.sign(n)*Math.pow(e,1.8):n/16},Qx=n=>{let e=Vm(n.r),t=Vm(n.g),i=Vm(n.b),s={mode:"xyz50",x:.7977666449006423*e+.1351812974005331*t+.0313477341283922*i,y:.2880748288194013*e+.7118352342418731*t+899369387256e-16*i,z:0*e+0*t+.8251046025104602*i};return n.alpha!==void 0&&(s.alpha=n.alpha),s},vH={...Wa,mode:"prophoto",parse:["prophoto-rgb"],serialize:"prophoto-rgb",fromMode:{xyz50:Jx,rgb:n=>Jx(Jc(n))},toMode:{xyz50:Qx,rgb:n=>Zc(Qx(n))}},eM=1.09929682680944,yH=.018053968510807,Hm=n=>{const e=Math.abs(n);return e>yH?(Math.sign(n)||1)*(eM*Math.pow(e,.45)-(eM-1)):4.5*n},tM=({x:n,y:e,z:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);let s={mode:"rec2020",r:Hm(n*1.7166511879712683-e*.3556707837763925-.2533662813736599*t),g:Hm(n*-.6666843518324893+e*1.6164812366349395+.0157685458139111*t),b:Hm(n*.0176398574453108-e*.0427706132578085+.9421031212354739*t)};return i!==void 0&&(s.alpha=i),s},nM=1.09929682680944,bH=.018053968510807,Gm=(n=0)=>{let e=Math.abs(n);return e{let e=Gm(n.r),t=Gm(n.g),i=Gm(n.b),s={mode:"xyz65",x:.6369580483012911*e+.1446169035862083*t+.1688809751641721*i,y:.262700212011267*e+.6779980715188708*t+.059301716469862*i,z:0*e+.0280726930490874*t+1.0609850577107909*i};return n.alpha!==void 0&&(s.alpha=n.alpha),s},xH={...Wa,mode:"rec2020",fromMode:{xyz65:tM,rgb:n=>tM(Do(n))},toMode:{xyz65:iM,rgb:n=>Oo(iM(n))},parse:["rec2020"],serialize:"rec2020"},yo=.0037930732552754493,MA=Math.cbrt(yo),Wm=n=>Math.cbrt(n)-MA,MH=n=>{const{r:e,g:t,b:i,alpha:s}=Xa(n),r=Wm(.3*e+.622*t+.078*i+yo),o=Wm(.23*e+.692*t+.078*i+yo),a=Wm(.2434226892454782*e+.2047674442449682*t+.5518098665095535*i+yo),l={mode:"xyb",x:(r-o)/2,y:(r+o)/2,b:a-(r+o)/2};return s!==void 0&&(l.alpha=s),l},Xm=n=>Math.pow(n+MA,3),SH=({x:n,y:e,b:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);const s=Xm(n+e)-yo,r=Xm(e-n)-yo,o=Xm(t+e)-yo,a=$a({r:11.031566904639861*s-9.866943908131562*r-.16462299650829934*o,g:-3.2541473810744237*s+4.418770377582723*r-.16462299650829934*o,b:-3.6588512867136815*s+2.7129230459360922*r+1.9459282407775895*o});return i!==void 0&&(a.alpha=i),a},EH={mode:"xyb",channels:["x","y","b","alpha"],parse:["--xyb"],serialize:"--xyb",toMode:{rgb:SH},fromMode:{rgb:MH},ranges:{x:[-.0154,.0281],y:[0,.8453],b:[-.2778,.388]},interpolate:{x:we,y:we,b:we,alpha:{use:we,fixup:on}}},TH={mode:"xyz50",parse:["xyz-d50"],serialize:"xyz-d50",toMode:{rgb:Zc,lab:X_},fromMode:{rgb:Jc,lab:W_},channels:["x","y","z","alpha"],ranges:{x:[0,.964],y:[0,.999],z:[0,.825]},interpolate:{x:we,y:we,z:we,alpha:{use:we,fixup:on}}},wH=n=>{let{x:e,y:t,z:i,alpha:s}=n;e===void 0&&(e=0),t===void 0&&(t=0),i===void 0&&(i=0);let r={mode:"xyz50",x:1.0479298208405488*e+.0229467933410191*t-.0501922295431356*i,y:.0296278156881593*e+.990434484573249*t-.0170738250293851*i,z:-.0092430581525912*e+.0150551448965779*t+.7518742899580008*i};return s!==void 0&&(r.alpha=s),r},AH=n=>{let{x:e,y:t,z:i,alpha:s}=n;e===void 0&&(e=0),t===void 0&&(t=0),i===void 0&&(i=0);let r={mode:"xyz65",x:.9554734527042182*e-.0230985368742614*t+.0632593086610217*i,y:-.0283697069632081*e+1.0099954580058226*t+.021041398966943*i,z:.0123140016883199*e-.0205076964334779*t+1.3303659366080753*i};return s!==void 0&&(r.alpha=s),r},CH={mode:"xyz65",toMode:{rgb:Oo,xyz50:wH},fromMode:{rgb:Do,xyz50:AH},ranges:{x:[0,.95],y:[0,1],z:[0,1.088]},channels:["x","y","z","alpha"],parse:["xyz","xyz-d65"],serialize:"xyz-d65",interpolate:{x:we,y:we,z:we,alpha:{use:we,fixup:on}}},RH=({r:n,g:e,b:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);const s={mode:"yiq",y:.29889531*n+.58662247*e+.11448223*t,i:.59597799*n-.2741761*e-.32180189*t,q:.21147017*n-.52261711*e+.31114694*t};return i!==void 0&&(s.alpha=i),s},PH=({y:n,i:e,q:t,alpha:i})=>{n===void 0&&(n=0),e===void 0&&(e=0),t===void 0&&(t=0);const s={mode:"rgb",r:n+.95608445*e+.6208885*t,g:n-.27137664*e-.6486059*t,b:n-1.10561724*e+1.70250126*t};return i!==void 0&&(s.alpha=i),s},IH={mode:"yiq",toMode:{rgb:PH},fromMode:{rgb:RH},channels:["y","i","q","alpha"],parse:["--yiq"],serialize:"--yiq",ranges:{i:[-.595,.595],q:[-.522,.522]},interpolate:{y:we,i:we,q:we,alpha:{use:we,fixup:on}}};Et(v6);Et(T6);Et(w6);Et(A6);Et(P6);Et(sA);Et(aA);Et(z6);Et(V6);Et(X6);Et($6);Et($_);Et(Y6);Et(q_);Et(K6);Et(oH);Et(aH);Et(lH);Et(fH);Et(dH);Et(pH);Et(gH);Et(_H);Et(vH);Et(xH);Et(Wa);Et(EH);Et(TH);Et(CH);Et(IH);const i0=220.44,LH=Yw("oklch"),sM=n=>{var e;return n?(e=LH(n))==null?void 0:e.h:i0},DH=zz("settings",()=>{const n=et(),e=vs("settings/language","en-US"),t=vs("settings/stage/view/model-renderer","2d"),i=vs("settings/audio/input","false"),s=Me(()=>{var T;return(T=n.value)==null?void 0:T.deviceId}),{audioInputs:r,ensurePermissions:o}=WB({constraints:{audio:!0}}),a=et(),l=et("/assets/live2d/models/hiyori_pro_zh.zip"),c=et("url"),u=et(!1),f=vs("settings/live2d/position",{x:0,y:0}),d=et({group:"Idle",index:0}),h=et([]),p=vs("settings/live2d/motion-map",{}),_=vs("settings/disable-transitions",!0),g=vs("settings/use-page-specific-transitions",!0),m=vs("settings/theme/colors/hue",i0),y=vs("settings/theme/colors/hue-dynamic",!1);function b(T=i0){m.value=T,y.value=!1}function v(T){b(sM(T))}function E(T){if(y.value)return!1;const S=sM(T);if(!S)return!1;const P=Math.abs(S-m.value);return P<.01||P>359.99}return Xe(i,T=>{T==="false"&&(n.value=void 0),T==="true"&&o().then(()=>{n.value=r.value[0]})}),Xe(r,()=>{i.value==="true"&&!n.value&&(n.value=r.value[0])},{immediate:!0}),{live2dModelFile:a,live2dModelUrl:l,live2dLoadSource:c,live2dCurrentMotion:d,live2dPosition:f,availableLive2dMotions:h,live2dMotionMap:p,loadingLive2dModel:u,disableTransitions:_,usePageSpecificTransitions:g,language:e,stageView:t,themeColorsHue:m,themeColorsHueDynamic:y,isAudioInputOn:i,selectedAudioDevice:n,selectedAudioDeviceId:s,setThemeColorsHue:b,applyPrimaryColorFrom:v,isColorSelectedForPrimary:E}}),OH=fn({__name:"ArrowTransition",props:{stageTransition:{default:()=>({primaryColor:"#666",secondaryColor:"#ccc"})}},setup(n){const e=n,t=Me(()=>e.stageTransition),i=Me(()=>t.value.primaryColor||"#666"),s=Me(()=>t.value.secondaryColor||"#ccc");return Hn(()=>{document.documentElement.style.setProperty("--stage-transition-3-overlay-color-1",i.value),document.documentElement.style.setProperty("--stage-transition-3-overlay-color-2",s.value)}),(r,o)=>(gn(),yi("div",{class:"stage-transition-3",style:Si({zIndex:t.value.zIndex||100})},null,4))}}),No=(n,e)=>{const t=n.__vccOpts||n;for(const[i,s]of e)t[i]=s;return t},NH=No(OH,[["__scopeId","data-v-df576df0"]]),UH=fn({__name:"BubbleWaveOutTransition",props:{stageTransition:null},setup(n){const e=n,t=Me(()=>{var i;return((i=e.stageTransition)==null?void 0:i.colors)||["#eee","#ebcb8b","#c56370","#3f3b52"]});return Hn(()=>{var i,s;document.documentElement.style.setProperty("--circle-expansion-delay",`${((i=e.stageTransition)==null?void 0:i.delay)||0}s`),document.documentElement.style.setProperty("--circle-expansion-duration",`${((s=e.stageTransition)==null?void 0:s.duration)||.4}s`),t.value.forEach((r,o)=>{document.documentElement.style.setProperty(`--circle-expansion-color-${o+1}`,r)})}),(i,s)=>{var r;return gn(),yi("div",{class:"circle-expansion-transition",style:Si({zIndex:((r=n.stageTransition)==null?void 0:r.zIndex)||100})},[(gn(!0),yi(jt,null,d2(t.value,(o,a)=>(gn(),yi("div",{key:a}))),128))],4)}}}),FH=No(UH,[["__scopeId","data-v-0c29056c"]]),kH=fn({__name:"FantasyFallTransition",props:{stageTransition:null},setup(n){const e=n,t=Me(()=>{var s;return((s=e.stageTransition)==null?void 0:s.direction)||"up"}),i=Me(()=>`fantasy-fall-${t.value}`);return Hn(()=>{var s,r,o,a,l,c,u,f,d;document.documentElement.style.setProperty("--fantasy-fall-color",((s=e.stageTransition)==null?void 0:s.primaryColor)||"#eee"),document.documentElement.style.setProperty("--fantasy-fall-duration",`${((r=e.stageTransition)==null?void 0:r.duration)||.6}s`),document.documentElement.style.setProperty("--fantasy-fall-delay",`${((o=e.stageTransition)==null?void 0:o.delay)||0}s`),document.documentElement.style.setProperty("--fantasy-fall-radius-sm",`${((l=(a=e.stageTransition)==null?void 0:a.borderRadius)==null?void 0:l.sm)||"14rem"}`),document.documentElement.style.setProperty("--fantasy-fall-radius-md",`${((u=(c=e.stageTransition)==null?void 0:c.borderRadius)==null?void 0:u.md)||"14rem"}`),document.documentElement.style.setProperty("--fantasy-fall-radius-lg",`${((d=(f=e.stageTransition)==null?void 0:f.borderRadius)==null?void 0:d.lg)||"50%"}`)}),(s,r)=>{var o;return gn(),yi("div",{class:Ua(["fantasy-fall-transition",i.value]),style:Si({zIndex:((o=n.stageTransition)==null?void 0:o.zIndex)??100})},null,6)}}}),BH=No(kH,[["__scopeId","data-v-e62bf496"]]),zH=fn({__name:"MultipleBlocksRevealTransition",props:{stageTransition:null},setup(n){const e=n,t=Me(()=>e.stageTransition),i=Me(()=>{var r;return((r=t.value)==null?void 0:r.primaryColor)||"#666"}),s=Me(()=>{var r;return((r=t.value)==null?void 0:r.secondaryColor)||"#ccc"});return Hn(()=>{document.documentElement.style.setProperty("--stage-transition-4-overlay-color-1",i.value),document.documentElement.style.setProperty("--stage-transition-4-overlay-color-2",s.value)}),(r,o)=>{var a;return gn(),yi("div",{class:"stage-transition-4",style:Si({zIndex:((a=t.value)==null?void 0:a.zIndex)??100})},o[0]||(o[0]=[X2('
',5)]),4)}}}),VH=No(zH,[["__scopeId","data-v-6d1179fc"]]),HH=fn({__name:"SlideTransition",props:{stageTransition:null},setup(n){const e=n,t=Me(()=>e.stageTransition),i=Me(()=>{var r;return((r=t.value)==null?void 0:r.primaryColor)||"#666"}),s=Me(()=>{var r;return((r=t.value)==null?void 0:r.secondaryColor)||"#ccc"});return Xe([t,i,s],()=>{document.documentElement.style.setProperty("--stage-transition-1-overlay-color-1",i.value),document.documentElement.style.setProperty("--stage-transition-1-overlay-color-2",s.value)}),Hn(()=>{document.documentElement.style.setProperty("--stage-transition-1-overlay-color-1",i.value),document.documentElement.style.setProperty("--stage-transition-1-overlay-color-2",s.value)}),(r,o)=>{var a;return gn(),yi("div",{class:"stage-transition-1",style:Si({zIndex:((a=t.value)==null?void 0:a.zIndex)??100})},null,4)}}}),GH=No(HH,[["__scopeId","data-v-bf1d1566"]]),WH=fn({__name:"SlopeSlideTransition",props:{stageTransition:null},setup(n){const e=n,t=Me(()=>e.stageTransition),i=Me(()=>{var r;return((r=t.value)==null?void 0:r.primaryColor)??"#666"}),s=Me(()=>{var r;return((r=t.value)==null?void 0:r.secondaryColor)??"#ccc"});return Hn(()=>{document.documentElement.style.setProperty("--stage-transition-2-overlay-color-1",i.value),document.documentElement.style.setProperty("--stage-transition-2-overlay-color-2",s.value)}),(r,o)=>{var a;return gn(),yi("div",{class:"stage-transition-2",style:Si({zIndex:((a=t.value)==null?void 0:a.zIndex)??100})},null,4)}}}),XH=No(WH,[["__scopeId","data-v-8ff7120f"]]),$H=fn({__name:"RectanglesRotateTransition",props:{stageTransition:null},setup(n){const e=n;return Hn(()=>{var t,i,s,r,o,a,l;document.documentElement.style.setProperty("--rectangle-rotate-1-color",((t=e.stageTransition)==null?void 0:t.primaryColor)||"#ebcb8b"),document.documentElement.style.setProperty("--rectangle-rotate-2-color",((i=e.stageTransition)==null?void 0:i.secondaryColor)||"#c56370"),document.documentElement.style.setProperty("--rectangle-rotate-3-color",((s=e.stageTransition)==null?void 0:s.tertiaryColor)||"#43445b"),document.documentElement.style.setProperty("--rectangle-rotate-duration",`${((r=e.stageTransition)==null?void 0:r.duration)||.6}s`),document.documentElement.style.setProperty("--rectangle-rotate-delay",`${((o=e.stageTransition)==null?void 0:o.delay)||0}s`),document.documentElement.style.setProperty("--rectangle-rotate-stagger",`${((a=e.stageTransition)==null?void 0:a.staggerDelay)||.1}s`),document.documentElement.style.setProperty("--rectangle-rotate-rotation",`${((l=e.stageTransition)==null?void 0:l.rotation)||270}deg`)}),(t,i)=>{var s;return gn(),yi("div",{class:"rectangle-rotate-transition",style:Si({zIndex:((s=n.stageTransition)==null?void 0:s.zIndex)??100})},i[0]||(i[0]=[or("div",{class:"rectangle rectangle-rotate-1"},[or("div")],-1),or("div",{class:"rectangle rectangle-rotate-2"},[or("div")],-1),or("div",{class:"rectangle rectangle-rotate-3"},[or("div")],-1)]),4)}}}),qH=No($H,[["__scopeId","data-v-f4b1dc64"]]),YH=fn({__name:"StageTransitionGroup",props:{primaryColor:null,secondaryColor:null,tertiaryColor:null,colors:null,zIndex:null,disableTransitions:{type:Boolean},usePageSpecificTransitions:{type:Boolean}},setup(n){const e=n,t=$V(),i=et(!1),s=et(),r=et(""),o=et(),a=Oe({slide:{component:GH,duration:2700},"slope-slide":{component:XH,duration:2700},arrow:{component:NH,duration:2700},"multiple-blocks-reveal":{component:VH,duration:2800},"fantasy-fall":{component:BH,duration:2700},"rectangles-rotate":{component:qH,duration:2700},"bubble-wave-out":{component:FH,duration:1e3}}),l=et([]);function c(h){return l.value.push(h),()=>{const p=l.value.indexOf(h);p>=0&&l.value.splice(p,1)}}async function u(h,p={}){s.value=h;for(const _ of l.value)try{await Promise.resolve(_(h,p))}catch(g){console.error(`Error in transition hook at stage "${h}":`,g)}}async function f(h,p,_){if(h.name==="none"||!h.name){p(),_();return}const g=a.value[h.name];if(!g){console.error(`Transition ${h.name} not found`),p(),_();return}const m=g.nextDelay!==void 0?g.nextDelay:g.duration/3;let y=!1;const v=c(E=>{E==="navigation"&&!y&&(y=!0,p())});try{await u("before-enter",{transitionName:h.name}),i.value&&(await u("before-leave",{transitionName:r.value}),r.value="",o.value=void 0,i.value=!1,await u("after-leave",{transitionName:r.value}),await new Promise(T=>setTimeout(T,50))),r.value=h.name,o.value=h,i.value=!0,await u("enter-active",{transitionName:name}),setTimeout(async()=>{await u("navigation",{transitionName:h.name,config:g}),y||(y=!0,p())},m),setTimeout(async()=>{await u("after-enter",{transitionName:h.name})},g.duration),setTimeout(async()=>{await u("before-leave",{transitionName:h.name})},g.duration+10),setTimeout(async()=>{await u("leave-active",{transitionName:h.name})},g.duration+20);const E=g.exitDuration??0;setTimeout(async()=>{i.value=!1,r.value="",o.value=void 0,await u("after-leave",{transitionName:h.name}),_()},g.duration+E)}catch(E){console.error(E)}finally{v(),setTimeout(()=>{y||(y=!0,p())},g.duration*2)}}function d(h,p){return new Promise(_=>{f(h,p,_)})}return t.beforeEach((h,p,_)=>{if(e.disableTransitions){_();return}if(typeof h.meta.stageTransition!="object"){_();return}const g=h.meta.stageTransition;if(e.usePageSpecificTransitions&&g.pageSpecificAvailable){_();return}typeof e.primaryColor<"u"&&(g.primaryColor=e.primaryColor),typeof e.secondaryColor<"u"&&(g.secondaryColor=e.secondaryColor),typeof e.tertiaryColor<"u"&&(g.tertiaryColor=e.tertiaryColor),typeof e.colors<"u"&&(g.colors=e.colors),typeof e.zIndex<"u"&&(g.zIndex=e.zIndex),d(g,_)}),(h,p)=>(gn(),yi(jt,null,[h2(h.$slots,"default"),i.value?(gn(),yi(jt,{key:0},[a.value[r.value]?(gn(),Kl(f2(a.value[r.value].component),{key:0,"stage-transition":o.value},null,8,["stage-transition"])):Pv("",!0)],64)):Pv("",!0)],64))}});/*! @@ -3903,4 +3903,4 @@ And the last, do what ever you want! - <|DELAY:3|> (延迟 3 秒) 最后,做任何你想做的事! -`}}},settings:{animations:{"stage-transitions":{title:{t:0,b:{t:2,i:[{t:3}],s:"是否开启舞台动画"}}},"use-page-specific-transitions":{description:{t:0,b:{t:2,i:[{t:3}],s:"某些页面会有自己的过场动画,这将覆盖舞台过场动画"}},title:{t:0,b:{t:2,i:[{t:3}],s:"是否使用页面特定过场动画"}}}},language:{chinese:{t:0,b:{t:2,i:[{t:3}],s:"简体中文"}},english:{t:0,b:{t:2,i:[{t:3}],s:"English"}},title:{t:0,b:{t:2,i:[{t:3}],s:"语言"}}},live2d:{"change-model":{"from-file":{t:0,b:{t:2,i:[{t:3}],s:"从文件加载"}},"from-file-select":{t:0,b:{t:2,i:[{t:3}],s:"选择"}},"from-url":{t:0,b:{t:2,i:[{t:3}],s:"从 URL 加载"}},"from-url-confirm":{t:0,b:{t:2,i:[{t:3}],s:"加载"}},"from-url-placeholder":{t:0,b:{t:2,i:[{t:3}],s:"输入 Live2D 模型 URL"}},title:{t:0,b:{t:2,i:[{t:3}],s:"更换模型"}}},"edit-motion-map":{title:{t:0,b:{t:2,i:[{t:3}],s:"编辑动作映射"}}},"map-motions":{play:{t:0,b:{t:2,i:[{t:3}],s:"播放动作"}},title:{t:0,b:{t:2,i:[{t:3}],s:"映射动作"}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Live2D 设置"}}},microphone:{t:0,b:{t:2,i:[{t:3}],s:"麦克风"}},models:{t:0,b:{t:2,i:[{t:3}],s:"模型"}},pages:{card:{activate:{t:0,b:{t:2,i:[{t:3}],s:"激活"}},active:{t:0,b:{t:2,i:[{t:3}],s:"已激活"}},active_badge:{t:0,b:{t:2,i:[{t:3}],s:"当前使用中"}},cancel:{t:0,b:{t:2,i:[{t:3}],s:"取消"}},card_not_found:{t:0,b:{t:2,i:[{t:3}],s:"未找到角色卡"}},character:{t:0,b:{t:2,i:[{t:3}],s:"角色设定"}},close:{t:0,b:{t:2,i:[{t:3}],s:"关闭"}},consciousness:{model:{t:0,b:{t:2,i:[{t:3}],s:"意识 / 模型"}}},created_by:{t:0,b:{t:2,i:[{t:3}],s:"创建者"}},creator_notes:{t:0,b:{t:2,i:[{t:3}],s:"创建者笔记"}},delete:{t:0,b:{t:2,i:[{t:3}],s:"删除"}},delete_card:{t:0,b:{t:2,i:[{t:3}],s:"删除角色卡"}},delete_confirmation:{t:0,b:{t:2,i:[{t:3}],s:"确定要删除这张角色卡吗?"}},description:{t:0,b:{t:2,i:[{t:3}],s:"使用 Airi 角色卡预设"}},description_label:{t:0,b:{t:2,i:[{t:3}],s:"描述"}},drop_here:{t:0,b:{t:2,i:[{t:3}],s:"放开以上传文件"}},modules:{t:0,b:{t:2,i:[{t:3}],s:"模块"}},name_asc:{t:0,b:{t:2,i:[{t:3}],s:"名称 (A-Z)"}},name_desc:{t:0,b:{t:2,i:[{t:3}],s:"名称 (Z-A)"}},no_cards:{t:0,b:{t:2,i:[{t:3}],s:"还没有任何角色卡,点击上方按钮上传一个吧!"}},no_results:{t:0,b:{t:2,i:[{t:3}],s:"没有找到匹配的角色卡"}},personality:{t:0,b:{t:2,i:[{t:3}],s:"性格"}},posthistoryinstructions:{t:0,b:{t:2,i:[{t:3}],s:"历史提示指令"}},recent:{t:0,b:{t:2,i:[{t:3}],s:"最近添加"}},scenario:{t:0,b:{t:2,i:[{t:3}],s:"场景"}},search:{t:0,b:{t:2,i:[{t:3}],s:"搜索角色卡..."}},sort_by:{t:0,b:{t:2,i:[{t:3}],s:"排序方式"}},speech:{model:{t:0,b:{t:2,i:[{t:3}],s:"声音 / 模型"}},voice:{t:0,b:{t:2,i:[{t:3}],s:"声音 / 声线"}}},systemprompt:{t:0,b:{t:2,i:[{t:3}],s:"系统提示词"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Airi 角色卡"}},try_different_search:{t:0,b:{t:2,i:[{t:3}],s:"尝试使用其他关键词搜索"}},upload:{t:0,b:{t:2,i:[{t:3}],s:"上传"}},upload_desc:{t:0,b:{t:2,i:[{t:3}],s:"点击或拖拽文件到此处上传"}}},memory:{description:{t:0,b:{t:2,i:[{t:3}],s:"存放记忆的地方,以及策略"}},title:{t:0,b:{t:2,i:[{t:3}],s:"记忆体"}}},models:{description:{t:0,b:{t:2,i:[{t:3}],s:"切换角色的 Live2D,VRM 模型"}},title:{t:0,b:{t:2,i:[{t:3}],s:"角色模型"}}},modules:{consciousness:{description:{t:0,b:{t:2,i:[{t:3}],s:"人格设定、使用的模型等配置"}},sections:{section:{"provider-model-selection":{collapse:{t:0,b:{t:2,i:[{t:3}],s:"折叠"}},custom_model_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"输入自订模型名字"}},description:{t:0,b:{t:2,i:[{t:3}],s:"为意识选择合适的 LLM 提供商"}},error:{t:0,b:{t:2,i:[{t:3}],s:"获取出错啦"}},expand:{t:0,b:{t:2,i:[{t:3}],s:"展开"}},loading:{t:0,b:{t:2,i:[{t:3}],s:"获取模型中..."}},manual_model_name:{t:0,b:{t:2,i:[{t:3}],s:"模型名字"}},manual_model_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"输入与该提供商一起使用的模型名字"}},no_models:{t:0,b:{t:2,i:[{t:3}],s:"没有任何可用的模型"}},no_models_description:{t:0,b:{t:2,i:[{t:3}],s:"该提供商的模型列表没有返回任何的数据"}},no_search_results:{t:0,b:{t:2,i:[{t:3}],s:"没有匹配的模型"}},no_search_results_description:{t:0,b:{t:2,i:[{t:3,v:"没有模型匹配 '"},{t:4,k:"query"},{t:3,v:"' 关键字,请尝试一下别的关键词呢"}]}},not_supported:{t:0,b:{t:2,i:[{t:3}],s:"无法列出模型"}},not_supported_description:{t:0,b:{t:2,i:[{t:3}],s:"此提供商不支持列出模型的功能"}},search_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"搜索模型..."}},search_results:{t:0,b:{t:2,i:[{t:3,v:"找到 "},{t:4,k:"count"},{t:3,v:" / "},{t:4,k:"total"},{t:3,v:" 个模型"}]}},show_less:{t:0,b:{t:2,i:[{t:3}],s:"显示更多"}},show_more:{t:0,b:{t:2,i:[{t:3}],s:"收起"}},subtitle:{t:0,b:{t:2,i:[{t:3}],s:"选择一个模型"}},title:{t:0,b:{t:2,i:[{t:3}],s:"模型"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"意识"}}},description:{t:0,b:{t:2,i:[{t:3}],s:"思维,视觉,言语综合,游戏等"}},"gaming-factorio":{description:{t:0,b:{t:2,i:[{t:3}],s:"一起玩 Factorio!"}},title:{t:0,b:{t:2,i:[{t:3}],s:"异星工厂 Factorio"}}},"gaming-minecraft":{description:{t:0,b:{t:2,i:[{t:3}],s:"一起 Minecraft!"}},title:{t:0,b:{t:2,i:[{t:3}],s:"我的世界 Minecraft"}}},hearing:{description:{t:0,b:{t:2,i:[{t:3}],s:"语音识别"}},title:{t:0,b:{t:2,i:[{t:3}],s:"听觉"}}},"memory-long-term":{description:{t:0,b:{t:2,i:[{t:3}],s:"长期记忆"}},title:{t:0,b:{t:2,i:[{t:3}],s:"长期记忆"}}},"memory-short-term":{description:{t:0,b:{t:2,i:[{t:3}],s:"短期记忆"}},title:{t:0,b:{t:2,i:[{t:3}],s:"短期记忆"}}},"messaging-discord":{description:{t:0,b:{t:2,i:[{t:3}],s:"Discord 发消息和语音聊天"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Discord"}}},speech:{description:{t:0,b:{t:2,i:[{t:3}],s:"语音合成"}},sections:{section:{playground:{buttons:{stop:{label:{t:0,b:{t:2,i:[{t:3}],s:"停止"}}}},"select-voice":{required:{t:0,b:{t:2,i:[{t:3}],s:"请选择声线"}}}},"provider-voice-selection":{custom_model_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"输入指定模型名字..."}},custom_voice_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"输入指定声线 ID..."}},description:{t:0,b:{t:2,i:[{t:3}],s:"选择合适的语音提供商"}},no_models:{t:0,b:{t:2,i:[{t:3}],s:"没有任何可用的模型"}},no_models_description:{t:0,b:{t:2,i:[{t:3}],s:"该提供商的模型列表没有返回任何的数据"}},no_voices:{t:0,b:{t:2,i:[{t:3}],s:"没有任何可用的声线"}},no_voices_description:{t:0,b:{t:2,i:[{t:3}],s:"该提供商的声线列表没有返回任何的数据"}},pause:{t:0,b:{t:2,i:[{t:3}],s:"Pause"}},play_sample:{t:0,b:{t:2,i:[{t:3}],s:"Play"}},search_models_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"搜索模型..."}},search_models_results:{t:0,b:{t:2,i:[{t:3,v:"找到 "},{t:4,k:"count"},{t:3,v:" / "},{t:4,k:"total"},{t:3,v:" 个模型"}]}},search_voices_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"搜索声线..."}},search_voices_results:{t:0,b:{t:2,i:[{t:3,v:"找到 "},{t:4,k:"count"},{t:3,v:" / "},{t:4,k:"total"},{t:3,v:" 个声线"}]}},show_less:{t:0,b:{t:2,i:[{t:3}],s:"显示更少"}},show_more:{t:0,b:{t:2,i:[{t:3}],s:"显示更多"}},title:{t:0,b:{t:2,i:[{t:3}],s:"选择语音合成提供商"}}},"voice-settings":{"input-ssml":{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"请输入 SSML 文本"}}},"use-ssml":{description:{t:0,b:{t:2,i:[{t:3}],s:"启用后可以输入原始 SSML 而不是纯文本"}},label:{t:0,b:{t:2,i:[{t:3}],s:"选用自定义 SSML"}}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"发声"}}},title:{t:0,b:{t:2,i:[{t:3}],s:"机体模块"}},vision:{description:{t:0,b:{t:2,i:[{t:3}],s:"视觉"}},title:{t:0,b:{t:2,i:[{t:3}],s:"视觉"}}},x:{description:{t:0,b:{t:2,i:[{t:3}],s:"X / Twitter 的浏览和使用"}},title:{t:0,b:{t:2,i:[{t:3}],s:"X / Twitter"}}}},providers:{common:{fields:{field:{"api-key":{label:{t:0,b:{t:2,i:[{t:3}],s:"API 密钥"}}}}},section:{advanced:{fields:{field:{headers:{description:{t:0,b:{t:2,i:[{t:3}],s:"添加自定义 HTTP 标头"}},key:{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"请求头名字"}}},label:{t:0,b:{t:2,i:[{t:3}],s:"HTTP 请求头"}},value:{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"请求头数值"}}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"高级配置"}}},basic:{description:{t:0,b:{t:2,i:[{t:3}],s:"基本设置"}},title:{t:0,b:{t:2,i:[{t:3}],s:"基础配置"}}},voice:{title:{t:0,b:{t:2,i:[{t:3}],s:"声音配置"}}}}},description:{t:0,b:{t:2,i:[{t:3}],s:"LLM,语音合成,语音识别提供商等"}},provider:{"alibaba-cloud-model-studio":{description:{t:0,b:{t:2,i:[{t:3}],s:"bailian.console.aliyun.com"}},title:{t:0,b:{t:2,i:[{t:3}],s:"阿里百炼"}}},anthropic:{description:{t:0,b:{t:2,i:[{t:3}],s:"anthropic.com"}},title:{t:0,b:{t:1,c:[{t:2,i:[{t:3}],s:"Anthropic"},{t:2,i:[{t:3}],s:"Claude"}]}}},"cloudflare-workers-ai":{description:{t:0,b:{t:2,i:[{t:3}],s:"Cloudflare.com"}},fields:{field:{"account-id":{description:{t:0,b:{t:2,i:[{t:3}],s:"Cloudflare 帐户 ID"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Cloudflare Account ID"}},placeholder:{t:0,b:{t:2,i:[{t:3}],s:"请输入 Cloudflare Account ID"}}},"api-key":{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"请输入 Cloudflare Workers AI 的 API Key"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Workers AI"}}},common:{fields:{field:{pitch:{description:{t:0,b:{t:2,i:[{t:3}],s:"调节合成语音的音高(比如更尖锐或更粗旷)"}},label:{t:0,b:{t:2,i:[{t:3}],s:"音高"}}},speed:{description:{t:0,b:{t:2,i:[{t:3}],s:"调节说话的语速"}},label:{t:0,b:{t:2,i:[{t:3}],s:"语速"}}},volume:{description:{t:0,b:{t:2,i:[{t:3}],s:"调节语音的响度"}},label:{t:0,b:{t:2,i:[{t:3}],s:"响度"}}}}}},deepseek:{description:{t:0,b:{t:2,i:[{t:3}],s:"DeepSeek.com"}},title:{t:0,b:{t:2,i:[{t:3}],s:"深度求索 DeepSeek"}}},elevenlabs:{description:{t:0,b:{t:2,i:[{t:3}],s:"Elevenlabs.io"}},fields:{field:{"simularity-boost":{description:{t:0,b:{t:2,i:[{t:3}],s:"声音相似性依从性"}},label:{t:0,b:{t:2,i:[{t:3}],s:"相似度修正"}}},"speaker-boost":{description:{t:0,b:{t:2,i:[{t:3}],s:"增强说话者的相似性"}},label:{t:0,b:{t:2,i:[{t:3}],s:"扬声器增强"}}},speed:{description:{t:0,b:{t:2,i:[{t:3}],s:"语音生成速度"}},label:{t:0,b:{t:2,i:[{t:3}],s:"语速"}}},stability:{description:{t:0,b:{t:2,i:[{t:3}],s:"语音稳定性和随机性"}},label:{t:0,b:{t:2,i:[{t:3}],s:"稳定性"}}},style:{description:{t:0,b:{t:2,i:[{t:3}],s:"语音风格夸张"}},label:{t:0,b:{t:2,i:[{t:3}],s:"风格"}}}}},playground:{buttons:{button:{"test-voice":{generating:{t:0,b:{t:2,i:[{t:3}],s:"生成中..."}},label:{t:0,b:{t:2,i:[{t:3}],s:"测试声音"}}}}},fields:{field:{input:{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"输入用于测试发音的文本"}}},language:{description:{t:0,b:{t:2,i:[{t:3}],s:"选择语音语言"}},label:{t:0,b:{t:2,i:[{t:3}],s:"语言"}}},voice:{description:{t:0,b:{t:2,i:[{t:3}],s:"选择首选语音"}},label:{t:0,b:{t:2,i:[{t:3}],s:"声线"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"实验平台"}},validation:{"error-missing-api-key":{t:0,b:{t:2,i:[{t:3}],s:"需要填写 API Key 才能用哦!"}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"ElevenLabs (11labs)"}}},fireworks:{description:{t:0,b:{t:2,i:[{t:3}],s:"Fireworks.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Fireworks.ai"}}},"microsoft-speech":{description:{t:0,b:{t:2,i:[{t:3}],s:"speech.microsoft.com"}},fields:{field:{region:{description:{t:0,b:{t:2,i:[{t:3}],s:"服务 Endpoint 地区(比如亚太 eastasia 区域)"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Endpoint 地区"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Microsoft / Azure 语音服务"}}},mistral:{description:{t:0,b:{t:2,i:[{t:3}],s:"mistral.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Mistral"}}},moonshot:{description:{t:0,b:{t:2,i:[{t:3}],s:"Moonshot.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"月之暗面"}}},novita:{description:{t:0,b:{t:2,i:[{t:3}],s:"novita.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Novita"}}},ollama:{description:{t:0,b:{t:2,i:[{t:3}],s:"ollama.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Ollama"}}},openai:{description:{t:0,b:{t:2,i:[{t:3}],s:"OpenAi.com"}},title:{t:0,b:{t:2,i:[{t:3}],s:"OpenAI"}}},openrouter:{description:{t:0,b:{t:2,i:[{t:3}],s:"OpenRouter.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"OpenRouter"}}},perplexity:{description:{t:0,b:{t:2,i:[{t:3}],s:"perplexity.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Perplexity"}}},together:{description:{t:0,b:{t:2,i:[{t:3}],s:"一起"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Together.ai"}}},vllm:{description:{t:0,b:{t:2,i:[{t:3}],s:"vllm.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"vLLM"}}},volcengine:{description:{t:0,b:{t:2,i:[{t:3}],s:"volcengine.com"}},fields:{field:{appId:{description:{t:0,b:{t:2,i:[{t:3}],s:"可在控制台获取的 App ID"}},label:{t:0,b:{t:2,i:[{t:3}],s:"App ID"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"火山引擎"}}},xai:{description:{t:0,b:{t:2,i:[{t:3}],s:"X.AI"}},title:{t:0,b:{t:2,i:[{t:3}],s:"xAI"}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"提供商"}}},scene:{description:{t:0,b:{t:2,i:[{t:3}],s:"配置角色所在环境"}},title:{t:0,b:{t:2,i:[{t:3}],s:"场景"}}},themes:{description:{t:0,b:{t:2,i:[{t:3}],s:"自定义你的舞台外观!"}},sections:{section:{"custom-color":{fields:{field:{"primary-color":{label:{t:0,b:{t:2,i:[{t:3}],s:"强调色"}},"rgb-on":{title:{t:0,b:{t:2,i:[{t:3}],s:"RGB ON!"}}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"配色"}}},developer:{title:{t:0,b:{t:2,i:[{t:3}],s:"开发者"}}},"theme-presets":{presets:[{colors:[{t:0,b:{t:2,i:[{t:3}],s:"Airi 绿"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"默认的绿色主题,由 Airi 为您带来!"}},title:{t:0,b:{t:2,i:[{t:3}],s:"默认颜色"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"灰褐色"}},{t:0,b:{t:2,i:[{t:3}],s:"米色"}},{t:0,b:{t:2,i:[{t:3}],s:"灰白色"}},{t:0,b:{t:2,i:[{t:3}],s:"浅灰褐色"}},{t:0,b:{t:2,i:[{t:3}],s:"象牙色"}},{t:0,b:{t:2,i:[{t:3}],s:"橄榄灰"}},{t:0,b:{t:2,i:[{t:3}],s:"沙色"}},{t:0,b:{t:2,i:[{t:3}],s:"暖灰色"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"受乔治·莫兰迪绘画启发的柔和、低调的色调"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Morandi 颜色"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"天蓝色"}},{t:0,b:{t:2,i:[{t:3}],s:"薄雾色"}},{t:0,b:{t:2,i:[{t:3}],s:"沙色"}},{t:0,b:{t:2,i:[{t:3}],s:"苔藓绿"}},{t:0,b:{t:2,i:[{t:3}],s:"睡莲色"}},{t:0,b:{t:2,i:[{t:3}],s:"小麦色"}},{t:0,b:{t:2,i:[{t:3}],s:"板岩蓝"}},{t:0,b:{t:2,i:[{t:3}],s:"鼠尾草色"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"受克劳德·莫奈作品启发的印象派调色板"}},title:{t:0,b:{t:2,i:[{t:3}],s:"莫奈颜色"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"棕褐色"}},{t:0,b:{t:2,i:[{t:3}],s:"暖灰褐色"}},{t:0,b:{t:2,i:[{t:3}],s:"赭色"}},{t:0,b:{t:2,i:[{t:3}],s:"咖啡色"}},{t:0,b:{t:2,i:[{t:3}],s:"青铜色"}},{t:0,b:{t:2,i:[{t:3}],s:"金色"}},{t:0,b:{t:2,i:[{t:3}],s:"芥末色"}},{t:0,b:{t:2,i:[{t:3}],s:"琥珀色"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"传统日本色彩调色板"}},title:{t:0,b:{t:2,i:[{t:3}],s:"日本颜色"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"北欧蓝"}},{t:0,b:{t:2,i:[{t:3}],s:"冰色"}},{t:0,b:{t:2,i:[{t:3}],s:"峡湾色"}},{t:0,b:{t:2,i:[{t:3}],s:"钢铁色"}},{t:0,b:{t:2,i:[{t:3}],s:"冰川色"}},{t:0,b:{t:2,i:[{t:3}],s:"板岩色"}},{t:0,b:{t:2,i:[{t:3}],s:"云色"}},{t:0,b:{t:2,i:[{t:3}],s:"石头色"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"北欧极简主义配色方案"}},title:{t:0,b:{t:2,i:[{t:3}],s:"北欧颜色"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"霞光红"}},{t:0,b:{t:2,i:[{t:3}],s:"枣红"}},{t:0,b:{t:2,i:[{t:3}],s:"黄栌"}},{t:0,b:{t:2,i:[{t:3}],s:"竹青"}},{t:0,b:{t:2,i:[{t:3}],s:"乌梅紫"}},{t:0,b:{t:2,i:[{t:3}],s:"缃色"}},{t:0,b:{t:2,i:[{t:3}],s:"青冥"}},{t:0,b:{t:2,i:[{t:3}],s:"赭石"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"中国传统色彩,源自古代纺织品、瓷器和绘画"}},title:{t:0,b:{t:2,i:[{t:3}],s:"中国传统颜色"}}}],title:{t:0,b:{t:2,i:[{t:3}],s:"预设"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"外观"}}}},sections:{section:{general:{title:{t:0,b:{t:2,i:[{t:3}],s:"通用"}}}}},theme:{t:0,b:{t:2,i:[{t:3}],s:"主题"}},title:{t:0,b:{t:2,i:[{t:3}],s:"设置"}},voices:{t:0,b:{t:2,i:[{t:3}],s:"声线"}}},stage:{chat:{message:{"character-name":{airi:{t:0,b:{t:2,i:[{t:3}],s:"Airi"}},"core-system":{t:0,b:{t:2,i:[{t:3}],s:"核心系统"}},you:{t:0,b:{t:2,i:[{t:3}],s:"你"}}}},tabs:{chat:{t:0,b:{t:2,i:[{t:3}],s:"聊天"}},clothes:{t:0,b:{t:2,i:[{t:3}],s:"换装"}},custom:{t:0,b:{t:2,i:[{t:3}],s:"自定义"}}}},message:{t:0,b:{t:2,i:[{t:3}],s:"消息"}},operations:{"load-models":{t:0,b:{t:2,i:[{t:3}],s:"加载推理模型"}},"load-models-status":{loading:{t:0,b:{t:2,i:[{t:3}],s:"加载中"}},ready:{t:0,b:{t:2,i:[{t:3}],s:"已就绪"}}}},"select-a-audio-input":{t:0,b:{t:2,i:[{t:3}],s:"选择一个音频输入设备"}},"select-a-model":{t:0,b:{t:2,i:[{t:3}],s:"选择一个模型"}},"select-a-voice":{t:0,b:{t:2,i:[{t:3}],s:"选择一个声线"}},viewers:{"debug-menu":{emotions:{t:0,b:{t:2,i:[{t:3}],s:"表情"}},"emotions-btn":{angry:{t:0,b:{t:2,i:[{t:3}],s:"生气"}},awkward:{t:0,b:{t:2,i:[{t:3}],s:"尴尬"}},happy:{t:0,b:{t:2,i:[{t:3}],s:"开心"}},neutral:{t:0,b:{t:2,i:[{t:3}],s:"日常"}},question:{t:0,b:{t:2,i:[{t:3}],s:"疑问"}},sad:{t:0,b:{t:2,i:[{t:3}],s:"难过"}},surprised:{t:0,b:{t:2,i:[{t:3}],s:"惊喜"}},think:{t:0,b:{t:2,i:[{t:3}],s:"思考"}}},vrm:{camera:{t:0,b:{t:2,i:[{t:3}],s:"摄像机"}},model:{title:{t:0,b:{t:2,i:[{t:3}],s:"模型"}}}}}},waiting:{t:0,b:{t:2,i:[{t:3}],s:"等待中"}}}}}),K9=k9({locale:Z9(),fallbackLocale:"en",messages:YA});function Z9(){const n=localStorage.getItem("settings/language"),e=Object.keys(YA);return n&&e.includes(n)?n:"en"}const J9=Oz(),Q9=Hz(qV);let eu;eu=WV({routes:Q9,history:bV()});eu.beforeEach((n,e)=>{n.path!==e.path&&Rw.start()});eu.afterEach(()=>{Rw.done()});eu.isReady().then(async()=>{}).catch(()=>{});NR(j9).use(Rz).use(t3).use(eu).use(J9).use(K9).use(yB).mount("#app");export{ot as $,TG as A,h2 as B,MG as C,DH as D,vS as E,Ua as F,nG as G,AR as H,uS as I,ST as J,Oe as K,as as L,n3 as M,de as N,Fh as O,Kt as P,Jn as Q,$w as R,gL as S,i3 as T,Ba as U,z as V,lr as W,mt as X,Sd as Y,yG as Z,Ae as _,or as a,dE as a$,yh as a0,To as a1,zi as a2,Vn as a3,rE as a4,jn as a5,li as a6,qe as a7,wn as a8,gt as a9,_n as aA,gi as aB,RE as aC,fg as aD,vL as aE,b_ as aF,Tf as aG,z0 as aH,aa as aI,en as aJ,El as aK,Qi as aL,sc as aM,rc as aN,OL as aO,f3 as aP,h3 as aQ,d3 as aR,ei as aS,xg as aT,Bs as aU,PE as aV,Eo as aW,Un as aX,WE as aY,XE as aZ,$E as a_,yL as aa,vn as ab,Z0 as ac,Va as ad,P0 as ae,lG as af,Pt as ag,_G as ah,Pc as ai,Ii as aj,qd as ak,b0 as al,Oc as am,$t as an,Ro as ao,os as ap,ka as aq,ts as ar,Mh as as,Wt as at,zn as au,Ct as av,oc as aw,vh as ax,Hs as ay,ns as az,pn as b,mf as b$,Ca as b0,ht as b1,kI as b2,WI as b3,n_ as b4,Cn as b5,Gn as b6,c_ as b7,fE as b8,ls as b9,jt as bA,d2 as bB,WB as bC,CR as bD,hG as bE,GB as bF,vs as bG,Zv as bH,EG as bI,RR as bJ,uG as bK,dG as bL,bG as bM,W2 as bN,mG as bO,wG as bP,CG as bQ,Yw as bR,A_ as bS,xG as bT,i0 as bU,aS as bV,tG as bW,G2 as bX,$2 as bY,iG as bZ,An as b_,br as ba,pE as bb,mE as bc,ca as bd,bh as be,_c as bf,t_ as bg,gc as bh,mc as bi,Xc as bj,ft as bk,Us as bl,Wc as bm,cL as bn,vB as bo,Pz as bp,No as bq,zV as br,CT as bs,Og as bt,fS as bu,Ga as bv,PG as bw,AG as bx,wr as by,oG as bz,yi as c,ai as c0,mn as c1,Ns as c2,aG as c3,f2 as c4,kn as c5,gr as c6,Fi as c7,sG as c8,y0 as c9,PS as ca,xi as cb,cG as cc,fG as cd,w0 as ce,pr as cf,LG as cg,je as ch,st as ci,vc as cj,Ar as ck,Te as cl,P3 as cm,mL as cn,DL as co,DG as cp,pG as cq,Di as cr,hn as cs,vG as ct,gG as cu,fn as d,Ew as e,Hn as f,rs as g,$V as h,Pv as i,OG as j,lp as k,Me as l,Kl as m,RG as n,gn as o,rG as p,Si as q,et as r,Vz as s,vC as t,Ot as u,zz as v,Xe as w,ut as x,SG as y,IG as z}; +`}}},settings:{animations:{"stage-transitions":{title:{t:0,b:{t:2,i:[{t:3}],s:"是否开启舞台动画"}}},"use-page-specific-transitions":{description:{t:0,b:{t:2,i:[{t:3}],s:"某些页面会有自己的过场动画,这将覆盖舞台过场动画"}},title:{t:0,b:{t:2,i:[{t:3}],s:"是否使用页面特定过场动画"}}}},language:{chinese:{t:0,b:{t:2,i:[{t:3}],s:"简体中文"}},english:{t:0,b:{t:2,i:[{t:3}],s:"English"}},title:{t:0,b:{t:2,i:[{t:3}],s:"语言"}}},live2d:{"change-model":{"from-file":{t:0,b:{t:2,i:[{t:3}],s:"从文件加载"}},"from-file-select":{t:0,b:{t:2,i:[{t:3}],s:"选择"}},"from-url":{t:0,b:{t:2,i:[{t:3}],s:"从 URL 加载"}},"from-url-confirm":{t:0,b:{t:2,i:[{t:3}],s:"加载"}},"from-url-placeholder":{t:0,b:{t:2,i:[{t:3}],s:"输入 Live2D 模型 URL"}},title:{t:0,b:{t:2,i:[{t:3}],s:"更换模型"}}},"edit-motion-map":{title:{t:0,b:{t:2,i:[{t:3}],s:"编辑动作映射"}}},"map-motions":{play:{t:0,b:{t:2,i:[{t:3}],s:"播放动作"}},title:{t:0,b:{t:2,i:[{t:3}],s:"映射动作"}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Live2D 设置"}}},microphone:{t:0,b:{t:2,i:[{t:3}],s:"麦克风"}},models:{t:0,b:{t:2,i:[{t:3}],s:"模型"}},pages:{card:{activate:{t:0,b:{t:2,i:[{t:3}],s:"激活"}},active:{t:0,b:{t:2,i:[{t:3}],s:"已激活"}},active_badge:{t:0,b:{t:2,i:[{t:3}],s:"当前使用中"}},cancel:{t:0,b:{t:2,i:[{t:3}],s:"取消"}},card_not_found:{t:0,b:{t:2,i:[{t:3}],s:"未找到角色卡"}},character:{t:0,b:{t:2,i:[{t:3}],s:"角色设定"}},close:{t:0,b:{t:2,i:[{t:3}],s:"关闭"}},consciousness:{model:{t:0,b:{t:2,i:[{t:3}],s:"意识 / 模型"}}},created_by:{t:0,b:{t:2,i:[{t:3}],s:"创建者"}},creator_notes:{t:0,b:{t:2,i:[{t:3}],s:"创建者笔记"}},delete:{t:0,b:{t:2,i:[{t:3}],s:"删除"}},delete_card:{t:0,b:{t:2,i:[{t:3}],s:"删除角色卡"}},delete_confirmation:{t:0,b:{t:2,i:[{t:3}],s:"确定要删除这张角色卡吗?"}},description:{t:0,b:{t:2,i:[{t:3}],s:"使用 Airi 角色卡预设"}},description_label:{t:0,b:{t:2,i:[{t:3}],s:"描述"}},drop_here:{t:0,b:{t:2,i:[{t:3}],s:"放开以上传文件"}},modules:{t:0,b:{t:2,i:[{t:3}],s:"模块"}},name_asc:{t:0,b:{t:2,i:[{t:3}],s:"名称 (A-Z)"}},name_desc:{t:0,b:{t:2,i:[{t:3}],s:"名称 (Z-A)"}},no_cards:{t:0,b:{t:2,i:[{t:3}],s:"还没有任何角色卡,点击上方按钮上传一个吧!"}},no_results:{t:0,b:{t:2,i:[{t:3}],s:"没有找到匹配的角色卡"}},personality:{t:0,b:{t:2,i:[{t:3}],s:"性格"}},posthistoryinstructions:{t:0,b:{t:2,i:[{t:3}],s:"历史提示指令"}},recent:{t:0,b:{t:2,i:[{t:3}],s:"最近添加"}},scenario:{t:0,b:{t:2,i:[{t:3}],s:"场景"}},search:{t:0,b:{t:2,i:[{t:3}],s:"搜索角色卡..."}},sort_by:{t:0,b:{t:2,i:[{t:3}],s:"排序方式"}},speech:{model:{t:0,b:{t:2,i:[{t:3}],s:"声音 / 模型"}},voice:{t:0,b:{t:2,i:[{t:3}],s:"声音 / 声线"}}},systemprompt:{t:0,b:{t:2,i:[{t:3}],s:"系统提示词"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Airi 角色卡"}},try_different_search:{t:0,b:{t:2,i:[{t:3}],s:"尝试使用其他关键词搜索"}},upload:{t:0,b:{t:2,i:[{t:3}],s:"上传"}},upload_desc:{t:0,b:{t:2,i:[{t:3}],s:"点击或拖拽文件到此处上传"}}},memory:{description:{t:0,b:{t:2,i:[{t:3}],s:"存放记忆的地方,以及策略"}},title:{t:0,b:{t:2,i:[{t:3}],s:"记忆体"}}},models:{description:{t:0,b:{t:2,i:[{t:3}],s:"切换角色的 Live2D,VRM 模型"}},title:{t:0,b:{t:2,i:[{t:3}],s:"角色模型"}}},modules:{consciousness:{description:{t:0,b:{t:2,i:[{t:3}],s:"人格设定、使用的模型等配置"}},sections:{section:{"provider-model-selection":{collapse:{t:0,b:{t:2,i:[{t:3}],s:"折叠"}},custom_model_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"输入自订模型名字"}},description:{t:0,b:{t:2,i:[{t:3}],s:"为意识选择合适的 LLM 提供商"}},error:{t:0,b:{t:2,i:[{t:3}],s:"获取出错啦"}},expand:{t:0,b:{t:2,i:[{t:3}],s:"展开"}},loading:{t:0,b:{t:2,i:[{t:3}],s:"获取模型中..."}},manual_model_name:{t:0,b:{t:2,i:[{t:3}],s:"模型名字"}},manual_model_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"输入与该提供商一起使用的模型名字"}},no_models:{t:0,b:{t:2,i:[{t:3}],s:"没有任何可用的模型"}},no_models_description:{t:0,b:{t:2,i:[{t:3}],s:"该提供商的模型列表没有返回任何的数据"}},no_search_results:{t:0,b:{t:2,i:[{t:3}],s:"没有匹配的模型"}},no_search_results_description:{t:0,b:{t:2,i:[{t:3,v:"没有模型匹配 '"},{t:4,k:"query"},{t:3,v:"' 关键字,请尝试一下别的关键词呢"}]}},not_supported:{t:0,b:{t:2,i:[{t:3}],s:"无法列出模型"}},not_supported_description:{t:0,b:{t:2,i:[{t:3}],s:"此提供商不支持列出模型的功能"}},search_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"搜索模型..."}},search_results:{t:0,b:{t:2,i:[{t:3,v:"找到 "},{t:4,k:"count"},{t:3,v:" / "},{t:4,k:"total"},{t:3,v:" 个模型"}]}},show_less:{t:0,b:{t:2,i:[{t:3}],s:"显示更多"}},show_more:{t:0,b:{t:2,i:[{t:3}],s:"收起"}},subtitle:{t:0,b:{t:2,i:[{t:3}],s:"选择一个模型"}},title:{t:0,b:{t:2,i:[{t:3}],s:"模型"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"意识"}}},description:{t:0,b:{t:2,i:[{t:3}],s:"思维,视觉,言语综合,游戏等"}},"gaming-factorio":{description:{t:0,b:{t:2,i:[{t:3}],s:"一起玩 Factorio!"}},title:{t:0,b:{t:2,i:[{t:3}],s:"异星工厂 Factorio"}}},"gaming-minecraft":{description:{t:0,b:{t:2,i:[{t:3}],s:"一起 Minecraft!"}},title:{t:0,b:{t:2,i:[{t:3}],s:"我的世界 Minecraft"}}},hearing:{description:{t:0,b:{t:2,i:[{t:3}],s:"语音识别"}},title:{t:0,b:{t:2,i:[{t:3}],s:"听觉"}}},"memory-long-term":{description:{t:0,b:{t:2,i:[{t:3}],s:"长期记忆"}},title:{t:0,b:{t:2,i:[{t:3}],s:"长期记忆"}}},"memory-short-term":{description:{t:0,b:{t:2,i:[{t:3}],s:"短期记忆"}},title:{t:0,b:{t:2,i:[{t:3}],s:"短期记忆"}}},"messaging-discord":{description:{t:0,b:{t:2,i:[{t:3}],s:"Discord 发消息和语音聊天"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Discord"}}},speech:{description:{t:0,b:{t:2,i:[{t:3}],s:"语音合成"}},sections:{section:{playground:{buttons:{stop:{label:{t:0,b:{t:2,i:[{t:3}],s:"停止"}}}},"select-voice":{required:{t:0,b:{t:2,i:[{t:3}],s:"请选择声线"}}}},"provider-voice-selection":{custom_model_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"输入指定模型名字..."}},custom_voice_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"输入指定声线 ID..."}},description:{t:0,b:{t:2,i:[{t:3}],s:"选择合适的语音提供商"}},no_models:{t:0,b:{t:2,i:[{t:3}],s:"没有任何可用的模型"}},no_models_description:{t:0,b:{t:2,i:[{t:3}],s:"该提供商的模型列表没有返回任何的数据"}},no_voices:{t:0,b:{t:2,i:[{t:3}],s:"没有任何可用的声线"}},no_voices_description:{t:0,b:{t:2,i:[{t:3}],s:"该提供商的声线列表没有返回任何的数据"}},pause:{t:0,b:{t:2,i:[{t:3}],s:"Pause"}},play_sample:{t:0,b:{t:2,i:[{t:3}],s:"Play"}},search_models_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"搜索模型..."}},search_models_results:{t:0,b:{t:2,i:[{t:3,v:"找到 "},{t:4,k:"count"},{t:3,v:" / "},{t:4,k:"total"},{t:3,v:" 个模型"}]}},search_voices_placeholder:{t:0,b:{t:2,i:[{t:3}],s:"搜索声线..."}},search_voices_results:{t:0,b:{t:2,i:[{t:3,v:"找到 "},{t:4,k:"count"},{t:3,v:" / "},{t:4,k:"total"},{t:3,v:" 个声线"}]}},show_less:{t:0,b:{t:2,i:[{t:3}],s:"显示更少"}},show_more:{t:0,b:{t:2,i:[{t:3}],s:"显示更多"}},title:{t:0,b:{t:2,i:[{t:3}],s:"选择语音合成提供商"}}},"voice-settings":{"input-ssml":{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"请输入 SSML 文本"}}},"use-ssml":{description:{t:0,b:{t:2,i:[{t:3}],s:"启用后可以输入原始 SSML 而不是纯文本"}},label:{t:0,b:{t:2,i:[{t:3}],s:"选用自定义 SSML"}}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"发声"}}},title:{t:0,b:{t:2,i:[{t:3}],s:"机体模块"}},vision:{description:{t:0,b:{t:2,i:[{t:3}],s:"视觉"}},title:{t:0,b:{t:2,i:[{t:3}],s:"视觉"}}},x:{description:{t:0,b:{t:2,i:[{t:3}],s:"X / Twitter 的浏览和使用"}},title:{t:0,b:{t:2,i:[{t:3}],s:"X / Twitter"}}}},providers:{common:{fields:{field:{"api-key":{label:{t:0,b:{t:2,i:[{t:3}],s:"API 密钥"}}}}},section:{advanced:{fields:{field:{headers:{description:{t:0,b:{t:2,i:[{t:3}],s:"添加自定义 HTTP 标头"}},key:{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"请求头名字"}}},label:{t:0,b:{t:2,i:[{t:3}],s:"HTTP 请求头"}},value:{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"请求头数值"}}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"高级配置"}}},basic:{description:{t:0,b:{t:2,i:[{t:3}],s:"基本设置"}},title:{t:0,b:{t:2,i:[{t:3}],s:"基础配置"}}},voice:{title:{t:0,b:{t:2,i:[{t:3}],s:"声音配置"}}}}},description:{t:0,b:{t:2,i:[{t:3}],s:"LLM,语音合成,语音识别提供商等"}},provider:{"alibaba-cloud-model-studio":{description:{t:0,b:{t:2,i:[{t:3}],s:"bailian.console.aliyun.com"}},title:{t:0,b:{t:2,i:[{t:3}],s:"阿里百炼"}}},anthropic:{description:{t:0,b:{t:2,i:[{t:3}],s:"anthropic.com"}},title:{t:0,b:{t:1,c:[{t:2,i:[{t:3}],s:"Anthropic"},{t:2,i:[{t:3}],s:"Claude"}]}}},"cloudflare-workers-ai":{description:{t:0,b:{t:2,i:[{t:3}],s:"Cloudflare.com"}},fields:{field:{"account-id":{description:{t:0,b:{t:2,i:[{t:3}],s:"Cloudflare 帐户 ID"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Cloudflare Account ID"}},placeholder:{t:0,b:{t:2,i:[{t:3}],s:"请输入 Cloudflare Account ID"}}},"api-key":{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"请输入 Cloudflare Workers AI 的 API Key"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Workers AI"}}},common:{fields:{field:{pitch:{description:{t:0,b:{t:2,i:[{t:3}],s:"调节合成语音的音高(比如更尖锐或更粗旷)"}},label:{t:0,b:{t:2,i:[{t:3}],s:"音高"}}},speed:{description:{t:0,b:{t:2,i:[{t:3}],s:"调节说话的语速"}},label:{t:0,b:{t:2,i:[{t:3}],s:"语速"}}},volume:{description:{t:0,b:{t:2,i:[{t:3}],s:"调节语音的响度"}},label:{t:0,b:{t:2,i:[{t:3}],s:"响度"}}}}}},deepseek:{description:{t:0,b:{t:2,i:[{t:3}],s:"DeepSeek.com"}},title:{t:0,b:{t:2,i:[{t:3}],s:"深度求索 DeepSeek"}}},elevenlabs:{description:{t:0,b:{t:2,i:[{t:3}],s:"Elevenlabs.io"}},fields:{field:{"simularity-boost":{description:{t:0,b:{t:2,i:[{t:3}],s:"声音相似性依从性"}},label:{t:0,b:{t:2,i:[{t:3}],s:"相似度修正"}}},"speaker-boost":{description:{t:0,b:{t:2,i:[{t:3}],s:"增强说话者的相似性"}},label:{t:0,b:{t:2,i:[{t:3}],s:"扬声器增强"}}},speed:{description:{t:0,b:{t:2,i:[{t:3}],s:"语音生成速度"}},label:{t:0,b:{t:2,i:[{t:3}],s:"语速"}}},stability:{description:{t:0,b:{t:2,i:[{t:3}],s:"语音稳定性和随机性"}},label:{t:0,b:{t:2,i:[{t:3}],s:"稳定性"}}},style:{description:{t:0,b:{t:2,i:[{t:3}],s:"语音风格夸张"}},label:{t:0,b:{t:2,i:[{t:3}],s:"风格"}}}}},playground:{buttons:{button:{"test-voice":{generating:{t:0,b:{t:2,i:[{t:3}],s:"生成中..."}},label:{t:0,b:{t:2,i:[{t:3}],s:"测试声音"}}}}},fields:{field:{input:{placeholder:{t:0,b:{t:2,i:[{t:3}],s:"输入用于测试发音的文本"}}},language:{description:{t:0,b:{t:2,i:[{t:3}],s:"选择语音语言"}},label:{t:0,b:{t:2,i:[{t:3}],s:"语言"}}},voice:{description:{t:0,b:{t:2,i:[{t:3}],s:"选择首选语音"}},label:{t:0,b:{t:2,i:[{t:3}],s:"声线"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"实验平台"}},validation:{"error-missing-api-key":{t:0,b:{t:2,i:[{t:3}],s:"需要填写 API Key 才能用哦!"}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"ElevenLabs (11labs)"}}},fireworks:{description:{t:0,b:{t:2,i:[{t:3}],s:"Fireworks.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Fireworks.ai"}}},"microsoft-speech":{description:{t:0,b:{t:2,i:[{t:3}],s:"speech.microsoft.com"}},fields:{field:{region:{description:{t:0,b:{t:2,i:[{t:3}],s:"服务 Endpoint 地区(比如亚太 eastasia 区域)"}},label:{t:0,b:{t:2,i:[{t:3}],s:"Endpoint 地区"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"Microsoft / Azure 语音服务"}}},mistral:{description:{t:0,b:{t:2,i:[{t:3}],s:"mistral.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Mistral"}}},moonshot:{description:{t:0,b:{t:2,i:[{t:3}],s:"Moonshot.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"月之暗面"}}},novita:{description:{t:0,b:{t:2,i:[{t:3}],s:"novita.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Novita"}}},ollama:{description:{t:0,b:{t:2,i:[{t:3}],s:"ollama.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Ollama"}}},openai:{description:{t:0,b:{t:2,i:[{t:3}],s:"OpenAi.com"}},title:{t:0,b:{t:2,i:[{t:3}],s:"OpenAI"}}},openrouter:{description:{t:0,b:{t:2,i:[{t:3}],s:"OpenRouter.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"OpenRouter"}}},perplexity:{description:{t:0,b:{t:2,i:[{t:3}],s:"perplexity.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Perplexity"}}},together:{description:{t:0,b:{t:2,i:[{t:3}],s:"一起"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Together.ai"}}},vllm:{description:{t:0,b:{t:2,i:[{t:3}],s:"vllm.ai"}},title:{t:0,b:{t:2,i:[{t:3}],s:"vLLM"}}},volcengine:{description:{t:0,b:{t:2,i:[{t:3}],s:"volcengine.com"}},fields:{field:{appId:{description:{t:0,b:{t:2,i:[{t:3}],s:"可在控制台获取的 App ID"}},label:{t:0,b:{t:2,i:[{t:3}],s:"App ID"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"火山引擎"}}},xai:{description:{t:0,b:{t:2,i:[{t:3}],s:"X.AI"}},title:{t:0,b:{t:2,i:[{t:3}],s:"xAI"}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"提供商"}}},scene:{description:{t:0,b:{t:2,i:[{t:3}],s:"配置角色所在环境"}},title:{t:0,b:{t:2,i:[{t:3}],s:"场景"}}},themes:{description:{t:0,b:{t:2,i:[{t:3}],s:"自定义你的舞台外观!"}},sections:{section:{"custom-color":{fields:{field:{"primary-color":{label:{t:0,b:{t:2,i:[{t:3}],s:"强调色"}},"rgb-on":{title:{t:0,b:{t:2,i:[{t:3}],s:"RGB ON!"}}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"配色"}}},developer:{title:{t:0,b:{t:2,i:[{t:3}],s:"开发者"}}},"theme-presets":{presets:[{colors:[{t:0,b:{t:2,i:[{t:3}],s:"Airi 绿"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"默认的绿色主题,由 Airi 为您带来!"}},title:{t:0,b:{t:2,i:[{t:3}],s:"默认颜色"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"灰褐色"}},{t:0,b:{t:2,i:[{t:3}],s:"米色"}},{t:0,b:{t:2,i:[{t:3}],s:"灰白色"}},{t:0,b:{t:2,i:[{t:3}],s:"浅灰褐色"}},{t:0,b:{t:2,i:[{t:3}],s:"象牙色"}},{t:0,b:{t:2,i:[{t:3}],s:"橄榄灰"}},{t:0,b:{t:2,i:[{t:3}],s:"沙色"}},{t:0,b:{t:2,i:[{t:3}],s:"暖灰色"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"受乔治·莫兰迪绘画启发的柔和、低调的色调"}},title:{t:0,b:{t:2,i:[{t:3}],s:"Morandi 颜色"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"天蓝色"}},{t:0,b:{t:2,i:[{t:3}],s:"薄雾色"}},{t:0,b:{t:2,i:[{t:3}],s:"沙色"}},{t:0,b:{t:2,i:[{t:3}],s:"苔藓绿"}},{t:0,b:{t:2,i:[{t:3}],s:"睡莲色"}},{t:0,b:{t:2,i:[{t:3}],s:"小麦色"}},{t:0,b:{t:2,i:[{t:3}],s:"板岩蓝"}},{t:0,b:{t:2,i:[{t:3}],s:"鼠尾草色"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"受克劳德·莫奈作品启发的印象派调色板"}},title:{t:0,b:{t:2,i:[{t:3}],s:"莫奈颜色"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"棕褐色"}},{t:0,b:{t:2,i:[{t:3}],s:"暖灰褐色"}},{t:0,b:{t:2,i:[{t:3}],s:"赭色"}},{t:0,b:{t:2,i:[{t:3}],s:"咖啡色"}},{t:0,b:{t:2,i:[{t:3}],s:"青铜色"}},{t:0,b:{t:2,i:[{t:3}],s:"金色"}},{t:0,b:{t:2,i:[{t:3}],s:"芥末色"}},{t:0,b:{t:2,i:[{t:3}],s:"琥珀色"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"传统日本色彩调色板"}},title:{t:0,b:{t:2,i:[{t:3}],s:"日本颜色"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"北欧蓝"}},{t:0,b:{t:2,i:[{t:3}],s:"冰色"}},{t:0,b:{t:2,i:[{t:3}],s:"峡湾色"}},{t:0,b:{t:2,i:[{t:3}],s:"钢铁色"}},{t:0,b:{t:2,i:[{t:3}],s:"冰川色"}},{t:0,b:{t:2,i:[{t:3}],s:"板岩色"}},{t:0,b:{t:2,i:[{t:3}],s:"云色"}},{t:0,b:{t:2,i:[{t:3}],s:"石头色"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"北欧极简主义配色方案"}},title:{t:0,b:{t:2,i:[{t:3}],s:"北欧颜色"}}},{colors:[{t:0,b:{t:2,i:[{t:3}],s:"霞光红"}},{t:0,b:{t:2,i:[{t:3}],s:"枣红"}},{t:0,b:{t:2,i:[{t:3}],s:"黄栌"}},{t:0,b:{t:2,i:[{t:3}],s:"竹青"}},{t:0,b:{t:2,i:[{t:3}],s:"乌梅紫"}},{t:0,b:{t:2,i:[{t:3}],s:"缃色"}},{t:0,b:{t:2,i:[{t:3}],s:"青冥"}},{t:0,b:{t:2,i:[{t:3}],s:"赭石"}}],description:{t:0,b:{t:2,i:[{t:3}],s:"中国传统色彩,源自古代纺织品、瓷器和绘画"}},title:{t:0,b:{t:2,i:[{t:3}],s:"中国传统颜色"}}}],title:{t:0,b:{t:2,i:[{t:3}],s:"预设"}}}}},title:{t:0,b:{t:2,i:[{t:3}],s:"外观"}}}},sections:{section:{general:{title:{t:0,b:{t:2,i:[{t:3}],s:"通用"}}}}},theme:{t:0,b:{t:2,i:[{t:3}],s:"主题"}},title:{t:0,b:{t:2,i:[{t:3}],s:"设置"}},voices:{t:0,b:{t:2,i:[{t:3}],s:"声线"}}},stage:{chat:{message:{"character-name":{airi:{t:0,b:{t:2,i:[{t:3}],s:"Airi"}},"core-system":{t:0,b:{t:2,i:[{t:3}],s:"核心系统"}},you:{t:0,b:{t:2,i:[{t:3}],s:"你"}}}},tabs:{chat:{t:0,b:{t:2,i:[{t:3}],s:"聊天"}},clothes:{t:0,b:{t:2,i:[{t:3}],s:"换装"}},custom:{t:0,b:{t:2,i:[{t:3}],s:"自定义"}}}},message:{t:0,b:{t:2,i:[{t:3}],s:"消息"}},operations:{"load-models":{t:0,b:{t:2,i:[{t:3}],s:"加载推理模型"}},"load-models-status":{loading:{t:0,b:{t:2,i:[{t:3}],s:"加载中"}},ready:{t:0,b:{t:2,i:[{t:3}],s:"已就绪"}}}},"select-a-audio-input":{t:0,b:{t:2,i:[{t:3}],s:"选择一个音频输入设备"}},"select-a-model":{t:0,b:{t:2,i:[{t:3}],s:"选择一个模型"}},"select-a-voice":{t:0,b:{t:2,i:[{t:3}],s:"选择一个声线"}},viewers:{"debug-menu":{emotions:{t:0,b:{t:2,i:[{t:3}],s:"表情"}},"emotions-btn":{angry:{t:0,b:{t:2,i:[{t:3}],s:"生气"}},awkward:{t:0,b:{t:2,i:[{t:3}],s:"尴尬"}},happy:{t:0,b:{t:2,i:[{t:3}],s:"开心"}},neutral:{t:0,b:{t:2,i:[{t:3}],s:"日常"}},question:{t:0,b:{t:2,i:[{t:3}],s:"疑问"}},sad:{t:0,b:{t:2,i:[{t:3}],s:"难过"}},surprised:{t:0,b:{t:2,i:[{t:3}],s:"惊喜"}},think:{t:0,b:{t:2,i:[{t:3}],s:"思考"}}},vrm:{camera:{t:0,b:{t:2,i:[{t:3}],s:"摄像机"}},model:{title:{t:0,b:{t:2,i:[{t:3}],s:"模型"}}}}}},waiting:{t:0,b:{t:2,i:[{t:3}],s:"等待中"}}}}}),K9=k9({locale:Z9(),fallbackLocale:"en",messages:YA});function Z9(){const n=localStorage.getItem("settings/language"),e=Object.keys(YA);return n&&e.includes(n)?n:"en"}const J9=Oz(),Q9=Hz(qV);let eu;eu=WV({routes:Q9,history:bV()});eu.beforeEach((n,e)=>{n.path!==e.path&&Rw.start()});eu.afterEach(()=>{Rw.done()});eu.isReady().then(async()=>{}).catch(()=>{});NR(j9).use(Rz).use(t3).use(eu).use(J9).use(K9).use(yB).mount("#app");export{de as $,Kl as A,Pc as B,tG as C,G2 as D,$2 as E,jt as F,DH as G,Hn as H,rs as I,pG as J,oG as K,je as L,RG as M,rG as N,RR as O,i0 as P,zV as Q,$w as R,Pt as S,hG as T,$V as U,Ew as V,OG as W,EG as X,mG as Y,Ae as Z,No as _,bG as a,P0 as a$,z as a0,st as a1,qe as a2,Cn as a3,Vn as a4,Z0 as a5,Jn as a6,li as a7,ca as a8,Hs as a9,AR as aA,Yw as aB,fS as aC,SG as aD,Oe as aE,xG as aF,MG as aG,ut as aH,wG as aI,CG as aJ,TG as aK,qd as aL,b0 as aM,aS as aN,uS as aO,iG as aP,An as aQ,mf as aR,ai as aS,mn as aT,Ns as aU,aG as aV,f2 as aW,kn as aX,gr as aY,Fi as aZ,sG as a_,Ii as aa,$t as ab,Gn as ac,ls as ad,vc as ae,zi as af,Ar as ag,rE as ah,Te as ai,ht as aj,Ct as ak,P3 as al,ot as am,br as an,fE as ao,mL as ap,bh as aq,DL as ar,Oc as as,_c as at,mc as au,Xc as av,A_ as aw,wr as ax,xi as ay,GB as az,Ot as b,ei as b$,y0 as b0,PS as b1,cG as b2,fG as b3,w0 as b4,pr as b5,CR as b6,Di as b7,hn as b8,vG as b9,os as bA,ka as bB,ts as bC,Mh as bD,Wt as bE,zn as bF,oc as bG,vh as bH,ns as bI,_n as bJ,gi as bK,RE as bL,fg as bM,vL as bN,b_ as bO,Tf as bP,z0 as bQ,aa as bR,en as bS,El as bT,Qi as bU,sc as bV,rc as bW,OL as bX,f3 as bY,h3 as bZ,d3 as b_,gG as ba,DG as bb,IG as bc,n3 as bd,i3 as be,ST as bf,yG as bg,as as bh,gL as bi,Fh as bj,Kt as bk,Ba as bl,lr as bm,mt as bn,Sd as bo,yh as bp,To as bq,jn as br,wn as bs,gt as bt,yL as bu,vn as bv,Va as bw,lG as bx,_G as by,Ro as bz,yi as c,xg as c0,Bs as c1,PE as c2,Eo as c3,Un as c4,WE as c5,XE as c6,$E as c7,dE as c8,Ca as c9,kI as ca,WI as cb,n_ as cc,c_ as cd,pE as ce,mE as cf,t_ as cg,gc as ch,ft as ci,Us as cj,Wc as ck,cL as cl,vB as cm,Pz as cn,CT as co,Og as cp,Ga as cq,PG as cr,AG as cs,WB as ct,LG as cu,fn as d,or as e,h2 as f,lp as g,Me as h,pn as i,Pv as j,W2 as k,d2 as l,uG as m,Ua as n,gn as o,zz as p,vs as q,et as r,Vz as s,vC as t,dG as u,Xe as v,vS as w,nG as x,Zv as y,Si as z}; diff --git a/assets/index-CdYg-KxO.js b/assets/index-BVssmUEI.js similarity index 99% rename from assets/index-CdYg-KxO.js rename to assets/index-BVssmUEI.js index c504c23e3bac4d3c25bd45bde38517df96b3413e..e805a61a42d71cc16d0747ca5686cef8aa811b51 100644 --- a/assets/index-CdYg-KxO.js +++ b/assets/index-BVssmUEI.js @@ -1,4 +1,4 @@ -import{cp as getAugmentedNamespace}from"./index-D3pfQUMu.js";var dist={},ortWeb_min={exports:{}};const backends={},backendsSortedByPriority=[],registerBackend=(D,u,b)=>{if(u&&typeof u.init=="function"&&typeof u.createSessionHandler=="function"){const g=backends[D];if(g===void 0)backends[D]={backend:u,priority:b};else{if(g.priority>b)return;if(g.priority===b&&g.backend!==u)throw new Error(`cannot register backend "${D}" using priority ${b}`)}if(b>=0){const p=backendsSortedByPriority.indexOf(D);p!==-1&&backendsSortedByPriority.splice(p,1);for(let h=0;h{const u=D.length===0?backendsSortedByPriority:D,b=[];for(const g of u){const p=backends[g];if(p){if(p.initialized)return p.backend;if(p.aborted)continue;const h=!!p.initPromise;try{return h||(p.initPromise=p.backend.init()),await p.initPromise,p.initialized=!0,p.backend}catch(o){h||b.push({name:g,err:o}),p.aborted=!0}finally{delete p.initPromise}}}throw new Error(`no available backend found. ERR: ${b.map(g=>`[${g.name}] ${g.err}`).join(", ")}`)};class EnvImpl{constructor(){this.wasm={},this.webgl={},this.logLevelInternal="warning"}set logLevel(u){if(u!==void 0){if(typeof u!="string"||["verbose","info","warning","error","fatal"].indexOf(u)===-1)throw new Error(`Unsupported logging level: ${u}`);this.logLevelInternal=u}}get logLevel(){return this.logLevelInternal}}const env=new EnvImpl,isBigInt64ArrayAvailable=typeof BigInt64Array<"u"&&typeof BigInt64Array.from=="function",isBigUint64ArrayAvailable=typeof BigUint64Array<"u"&&typeof BigUint64Array.from=="function",NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP=new Map([["float32",Float32Array],["uint8",Uint8Array],["int8",Int8Array],["uint16",Uint16Array],["int16",Int16Array],["int32",Int32Array],["bool",Uint8Array],["float64",Float64Array],["uint32",Uint32Array]]),NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP=new Map([[Float32Array,"float32"],[Uint8Array,"uint8"],[Int8Array,"int8"],[Uint16Array,"uint16"],[Int16Array,"int16"],[Int32Array,"int32"],[Float64Array,"float64"],[Uint32Array,"uint32"]]);isBigInt64ArrayAvailable&&(NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP.set("int64",BigInt64Array),NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP.set(BigInt64Array,"int64"));isBigUint64ArrayAvailable&&(NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP.set("uint64",BigUint64Array),NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP.set(BigUint64Array,"uint64"));const calculateSize=D=>{let u=1;for(let b=0;b{const t=document.createElement("canvas"),e=t.getContext("2d");if(!u||!e)return i();const n=new Image;n.crossOrigin="Anonymous",n.src=u,n.onload=()=>{t.width=n.width,t.height=n.height,e.drawImage(n,0,0,t.width,t.height);const r=e.getImageData(0,0,t.width,t.height);if(b!==void 0){if(b.height!==void 0&&b.height!==t.height)throw new Error("Image input config height doesn't match ImageBitmap height");if(f.height=t.height,b.width!==void 0&&b.width!==t.width)throw new Error("Image input config width doesn't match ImageBitmap width");f.width=t.width}else f.height=t.height,f.width=t.width;s(at.bufferToTensor(r.data,f))}});throw new Error("Input data provided is not supported - aborted tensor creation")}if(c!==void 0)return at.bufferToTensor(c,f);throw new Error("Input data provided is not supported - aborted tensor creation")}toImageData(u){var b,g;const p=document.createElement("canvas").getContext("2d");let h;if(p!=null){const o=this.dims[3],c=this.dims[2],f=this.dims[1],s=u!==void 0&&u.format!==void 0?u.format:"RGB",i=u!==void 0&&((b=u.norm)===null||b===void 0?void 0:b.mean)!==void 0?u.norm.mean:255,t=u!==void 0&&((g=u.norm)===null||g===void 0?void 0:g.bias)!==void 0?u.norm.bias:0,e=c*o;if(u!==void 0){if(u.height!==void 0&&u.height!==c)throw new Error("Image output config height doesn't match tensor height");if(u.width!==void 0&&u.width!==o)throw new Error("Image output config width doesn't match tensor width");if(u.format!==void 0&&f===4&&u.format!=="RGBA"||f===3&&u.format!=="RGB"&&u.format!=="BGR")throw new Error("Tensor format doesn't match input tensor dims")}const n=4;let r=0,a=1,l=2,d=3,m=0,y=e,v=e*2,_=-1;s==="RGBA"?(m=0,y=e,v=e*2,_=e*3):s==="RGB"?(m=0,y=e,v=e*2):s==="RBG"&&(m=0,v=e,y=e*2),h=p.createImageData(o,c);for(let T=0;T"u")throw new Error(`input '${s}' is missing in 'feeds'.`);if(o)for(const s of this.outputNames)p[s]=null;const c=await this.handler.run(u,p,h),f={};for(const s in c)Object.hasOwnProperty.call(c,s)&&(f[s]=new Tensor(c[s].type,c[s].data,c[s].dims));return f}static async create(u,b,g,p){let h,o={};if(typeof u=="string"){if(h=u,typeof b=="object"&&b!==null)o=b;else if(typeof b<"u")throw new TypeError("'options' must be an object.")}else if(u instanceof Uint8Array){if(h=u,typeof b=="object"&&b!==null)o=b;else if(typeof b<"u")throw new TypeError("'options' must be an object.")}else if(u instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&u instanceof SharedArrayBuffer){const t=u;let e=0,n=u.byteLength;if(typeof b=="object"&&b!==null)o=b;else if(typeof b=="number"){if(e=b,!Number.isSafeInteger(e))throw new RangeError("'byteOffset' must be an integer.");if(e<0||e>=t.byteLength)throw new RangeError(`'byteOffset' is out of range [0, ${t.byteLength}).`);if(n=u.byteLength-e,typeof g=="number"){if(n=g,!Number.isSafeInteger(n))throw new RangeError("'byteLength' must be an integer.");if(n<=0||e+n>t.byteLength)throw new RangeError(`'byteLength' is out of range (0, ${t.byteLength-e}].`);if(typeof p=="object"&&p!==null)o=p;else if(typeof p<"u")throw new TypeError("'options' must be an object.")}else if(typeof g<"u")throw new TypeError("'byteLength' must be a number.")}else if(typeof b<"u")throw new TypeError("'options' must be an object.");h=new Uint8Array(t,e,n)}else throw new TypeError("Unexpected argument[0]: must be 'path' or 'buffer'.");const f=(o.executionProviders||[]).map(t=>typeof t=="string"?t:t.name),i=await(await resolveBackend(f)).createSessionHandler(h,o);return new cn(i)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}};const InferenceSession=InferenceSession$1,lib=Object.freeze(Object.defineProperty({__proto__:null,InferenceSession,Tensor,env,registerBackend},Symbol.toStringTag,{value:"Module"})),require$$0=getAugmentedNamespace(lib);/*! +import{bb as getAugmentedNamespace}from"./index-BNq7Hbz_.js";var dist={},ortWeb_min={exports:{}};const backends={},backendsSortedByPriority=[],registerBackend=(D,u,b)=>{if(u&&typeof u.init=="function"&&typeof u.createSessionHandler=="function"){const g=backends[D];if(g===void 0)backends[D]={backend:u,priority:b};else{if(g.priority>b)return;if(g.priority===b&&g.backend!==u)throw new Error(`cannot register backend "${D}" using priority ${b}`)}if(b>=0){const p=backendsSortedByPriority.indexOf(D);p!==-1&&backendsSortedByPriority.splice(p,1);for(let h=0;h{const u=D.length===0?backendsSortedByPriority:D,b=[];for(const g of u){const p=backends[g];if(p){if(p.initialized)return p.backend;if(p.aborted)continue;const h=!!p.initPromise;try{return h||(p.initPromise=p.backend.init()),await p.initPromise,p.initialized=!0,p.backend}catch(o){h||b.push({name:g,err:o}),p.aborted=!0}finally{delete p.initPromise}}}throw new Error(`no available backend found. ERR: ${b.map(g=>`[${g.name}] ${g.err}`).join(", ")}`)};class EnvImpl{constructor(){this.wasm={},this.webgl={},this.logLevelInternal="warning"}set logLevel(u){if(u!==void 0){if(typeof u!="string"||["verbose","info","warning","error","fatal"].indexOf(u)===-1)throw new Error(`Unsupported logging level: ${u}`);this.logLevelInternal=u}}get logLevel(){return this.logLevelInternal}}const env=new EnvImpl,isBigInt64ArrayAvailable=typeof BigInt64Array<"u"&&typeof BigInt64Array.from=="function",isBigUint64ArrayAvailable=typeof BigUint64Array<"u"&&typeof BigUint64Array.from=="function",NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP=new Map([["float32",Float32Array],["uint8",Uint8Array],["int8",Int8Array],["uint16",Uint16Array],["int16",Int16Array],["int32",Int32Array],["bool",Uint8Array],["float64",Float64Array],["uint32",Uint32Array]]),NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP=new Map([[Float32Array,"float32"],[Uint8Array,"uint8"],[Int8Array,"int8"],[Uint16Array,"uint16"],[Int16Array,"int16"],[Int32Array,"int32"],[Float64Array,"float64"],[Uint32Array,"uint32"]]);isBigInt64ArrayAvailable&&(NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP.set("int64",BigInt64Array),NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP.set(BigInt64Array,"int64"));isBigUint64ArrayAvailable&&(NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP.set("uint64",BigUint64Array),NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP.set(BigUint64Array,"uint64"));const calculateSize=D=>{let u=1;for(let b=0;b{const t=document.createElement("canvas"),e=t.getContext("2d");if(!u||!e)return i();const n=new Image;n.crossOrigin="Anonymous",n.src=u,n.onload=()=>{t.width=n.width,t.height=n.height,e.drawImage(n,0,0,t.width,t.height);const r=e.getImageData(0,0,t.width,t.height);if(b!==void 0){if(b.height!==void 0&&b.height!==t.height)throw new Error("Image input config height doesn't match ImageBitmap height");if(f.height=t.height,b.width!==void 0&&b.width!==t.width)throw new Error("Image input config width doesn't match ImageBitmap width");f.width=t.width}else f.height=t.height,f.width=t.width;s(at.bufferToTensor(r.data,f))}});throw new Error("Input data provided is not supported - aborted tensor creation")}if(c!==void 0)return at.bufferToTensor(c,f);throw new Error("Input data provided is not supported - aborted tensor creation")}toImageData(u){var b,g;const p=document.createElement("canvas").getContext("2d");let h;if(p!=null){const o=this.dims[3],c=this.dims[2],f=this.dims[1],s=u!==void 0&&u.format!==void 0?u.format:"RGB",i=u!==void 0&&((b=u.norm)===null||b===void 0?void 0:b.mean)!==void 0?u.norm.mean:255,t=u!==void 0&&((g=u.norm)===null||g===void 0?void 0:g.bias)!==void 0?u.norm.bias:0,e=c*o;if(u!==void 0){if(u.height!==void 0&&u.height!==c)throw new Error("Image output config height doesn't match tensor height");if(u.width!==void 0&&u.width!==o)throw new Error("Image output config width doesn't match tensor width");if(u.format!==void 0&&f===4&&u.format!=="RGBA"||f===3&&u.format!=="RGB"&&u.format!=="BGR")throw new Error("Tensor format doesn't match input tensor dims")}const n=4;let r=0,a=1,l=2,d=3,m=0,y=e,v=e*2,_=-1;s==="RGBA"?(m=0,y=e,v=e*2,_=e*3):s==="RGB"?(m=0,y=e,v=e*2):s==="RBG"&&(m=0,v=e,y=e*2),h=p.createImageData(o,c);for(let T=0;T"u")throw new Error(`input '${s}' is missing in 'feeds'.`);if(o)for(const s of this.outputNames)p[s]=null;const c=await this.handler.run(u,p,h),f={};for(const s in c)Object.hasOwnProperty.call(c,s)&&(f[s]=new Tensor(c[s].type,c[s].data,c[s].dims));return f}static async create(u,b,g,p){let h,o={};if(typeof u=="string"){if(h=u,typeof b=="object"&&b!==null)o=b;else if(typeof b<"u")throw new TypeError("'options' must be an object.")}else if(u instanceof Uint8Array){if(h=u,typeof b=="object"&&b!==null)o=b;else if(typeof b<"u")throw new TypeError("'options' must be an object.")}else if(u instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&u instanceof SharedArrayBuffer){const t=u;let e=0,n=u.byteLength;if(typeof b=="object"&&b!==null)o=b;else if(typeof b=="number"){if(e=b,!Number.isSafeInteger(e))throw new RangeError("'byteOffset' must be an integer.");if(e<0||e>=t.byteLength)throw new RangeError(`'byteOffset' is out of range [0, ${t.byteLength}).`);if(n=u.byteLength-e,typeof g=="number"){if(n=g,!Number.isSafeInteger(n))throw new RangeError("'byteLength' must be an integer.");if(n<=0||e+n>t.byteLength)throw new RangeError(`'byteLength' is out of range (0, ${t.byteLength-e}].`);if(typeof p=="object"&&p!==null)o=p;else if(typeof p<"u")throw new TypeError("'options' must be an object.")}else if(typeof g<"u")throw new TypeError("'byteLength' must be a number.")}else if(typeof b<"u")throw new TypeError("'options' must be an object.");h=new Uint8Array(t,e,n)}else throw new TypeError("Unexpected argument[0]: must be 'path' or 'buffer'.");const f=(o.executionProviders||[]).map(t=>typeof t=="string"?t:t.name),i=await(await resolveBackend(f)).createSessionHandler(h,o);return new cn(i)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}};const InferenceSession=InferenceSession$1,lib=Object.freeze(Object.defineProperty({__proto__:null,InferenceSession,Tensor,env,registerBackend},Symbol.toStringTag,{value:"Module"})),require$$0=getAugmentedNamespace(lib);/*! * ONNX Runtime Web v1.14.0 * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. diff --git a/assets/index-BZFiQ_k-.js b/assets/index-BZFiQ_k-.js deleted file mode 100644 index 17113921b62facf16fc601729d02ec1a1347427c..0000000000000000000000000000000000000000 --- a/assets/index-BZFiQ_k-.js +++ /dev/null @@ -1,3 +0,0 @@ -import{l as O,r as E,K as Mt,w as j,ak as Lt,al as Ft,bV as xe,u as m,d as D,m as T,o as B,E as A,B as P,bW as de,bX as fe,bY as F,bO as Ze,by as he,f as De,I as lt,i as Nt,b as me,bZ as yn,b_ as ye,b$ as wn,c0 as kt,c1 as bn,c2 as ke,c3 as xn,c4 as On,bu as Cn,g as It,bA as An,c5 as Wt,c6 as En,c7 as Ht,c8 as xt,ai as K,ae as Dn,bN as Pn,t as _n,c as Vt,q as st,c9 as jt,ca as Bn,cb as zt,cc as Tn,cd as Rn,a as $n,ce as Sn,cf as Mn}from"./index-D3pfQUMu.js";const Ln=["top","right","bottom","left"],ae=Math.min,H=Math.max,Ie=Math.round,Me=Math.floor,G=e=>({x:e,y:e}),Fn={left:"right",right:"left",bottom:"top",top:"bottom"},Nn={start:"end",end:"start"};function Qe(e,t,n){return H(e,ae(t,n))}function ee(e,t){return typeof e=="function"?e(t):e}function te(e){return e.split("-")[0]}function Pe(e){return e.split("-")[1]}function at(e){return e==="x"?"y":"x"}function ut(e){return e==="y"?"height":"width"}function ue(e){return["top","bottom"].includes(te(e))?"y":"x"}function ct(e){return at(ue(e))}function kn(e,t,n){n===void 0&&(n=!1);const o=Pe(e),i=ct(e),r=ut(i);let l=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(l=We(l)),[l,We(l)]}function In(e){const t=We(e);return[et(e),t,et(t)]}function et(e){return e.replace(/start|end/g,t=>Nn[t])}function Wn(e,t,n){const o=["left","right"],i=["right","left"],r=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:o:t?o:i;case"left":case"right":return t?r:l;default:return[]}}function Hn(e,t,n,o){const i=Pe(e);let r=Wn(te(e),n==="start",o);return i&&(r=r.map(l=>l+"-"+i),t&&(r=r.concat(r.map(et)))),r}function We(e){return e.replace(/left|right|bottom|top/g,t=>Fn[t])}function Vn(e){return{top:0,right:0,bottom:0,left:0,...e}}function Kt(e){return typeof e!="number"?Vn(e):{top:e,right:e,bottom:e,left:e}}function He(e){const{x:t,y:n,width:o,height:i}=e;return{width:o,height:i,top:n,left:t,right:t+o,bottom:n+i,x:t,y:n}}function Ot(e,t,n){let{reference:o,floating:i}=e;const r=ue(t),l=ct(t),s=ut(l),d=te(t),c=r==="y",a=o.x+o.width/2-i.width/2,u=o.y+o.height/2-i.height/2,p=o[s]/2-i[s]/2;let f;switch(d){case"top":f={x:a,y:o.y-i.height};break;case"bottom":f={x:a,y:o.y+o.height};break;case"right":f={x:o.x+o.width,y:u};break;case"left":f={x:o.x-i.width,y:u};break;default:f={x:o.x,y:o.y}}switch(Pe(t)){case"start":f[l]-=p*(n&&c?-1:1);break;case"end":f[l]+=p*(n&&c?-1:1);break}return f}const jn=async(e,t,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:l}=n,s=r.filter(Boolean),d=await(l.isRTL==null?void 0:l.isRTL(t));let c=await l.getElementRects({reference:e,floating:t,strategy:i}),{x:a,y:u}=Ot(c,o,d),p=o,f={},v=0;for(let h=0;h({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:i,rects:r,platform:l,elements:s,middlewareData:d}=t,{element:c,padding:a=0}=ee(e,t)||{};if(c==null)return{};const u=Kt(a),p={x:n,y:o},f=ct(i),v=ut(f),h=await l.getDimensions(c),g=f==="y",y=g?"top":"left",b=g?"bottom":"right",w=g?"clientHeight":"clientWidth",C=r.reference[v]+r.reference[f]-p[f]-r.floating[v],x=p[f]-r.reference[f],S=await(l.getOffsetParent==null?void 0:l.getOffsetParent(c));let _=S?S[w]:0;(!_||!await(l.isElement==null?void 0:l.isElement(S)))&&(_=s.floating[w]||r.floating[v]);const M=C/2-x/2,N=_/2-h[v]/2-1,R=ae(u[y],N),z=ae(u[b],N),k=R,W=_-h[v]-z,L=_/2-h[v]/2+M,oe=Qe(k,L,W),I=!d.arrow&&Pe(i)!=null&&L!==oe&&r.reference[v]/2-(LL<=0)){var z,k;const L=(((z=r.flip)==null?void 0:z.index)||0)+1,oe=_[L];if(oe)return{data:{index:L,overflows:R},reset:{placement:oe}};let I=(k=R.filter(q=>q.overflows[0]<=0).sort((q,ie)=>q.overflows[1]-ie.overflows[1])[0])==null?void 0:k.placement;if(!I)switch(f){case"bestFit":{var W;const q=(W=R.filter(ie=>{if(S){const re=ue(ie.placement);return re===b||re==="y"}return!0}).map(ie=>[ie.placement,ie.overflows.filter(re=>re>0).reduce((re,hn)=>re+hn,0)]).sort((ie,re)=>ie[1]-re[1])[0])==null?void 0:W[0];q&&(I=q);break}case"initialPlacement":I=s;break}if(i!==I)return{reset:{placement:I}}}return{}}}};function Ct(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function At(e){return Ln.some(t=>e[t]>=0)}const Un=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...i}=ee(e,t);switch(o){case"referenceHidden":{const r=await _e(t,{...i,elementContext:"reference"}),l=Ct(r,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:At(l)}}}case"escaped":{const r=await _e(t,{...i,altBoundary:!0}),l=Ct(r,n.floating);return{data:{escapedOffsets:l,escaped:At(l)}}}default:return{}}}}};async function Yn(e,t){const{placement:n,platform:o,elements:i}=e,r=await(o.isRTL==null?void 0:o.isRTL(i.floating)),l=te(n),s=Pe(n),d=ue(n)==="y",c=["left","top"].includes(l)?-1:1,a=r&&d?-1:1,u=ee(t,e);let{mainAxis:p,crossAxis:f,alignmentAxis:v}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return s&&typeof v=="number"&&(f=s==="end"?v*-1:v),d?{x:f*a,y:p*c}:{x:p*c,y:f*a}}const Xn=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:i,y:r,placement:l,middlewareData:s}=t,d=await Yn(t,e);return l===((n=s.offset)==null?void 0:n.placement)&&(o=s.arrow)!=null&&o.alignmentOffset?{}:{x:i+d.x,y:r+d.y,data:{...d,placement:l}}}}},qn=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:i}=t,{mainAxis:r=!0,crossAxis:l=!1,limiter:s={fn:g=>{let{x:y,y:b}=g;return{x:y,y:b}}},...d}=ee(e,t),c={x:n,y:o},a=await _e(t,d),u=ue(te(i)),p=at(u);let f=c[p],v=c[u];if(r){const g=p==="y"?"top":"left",y=p==="y"?"bottom":"right",b=f+a[g],w=f-a[y];f=Qe(b,f,w)}if(l){const g=u==="y"?"top":"left",y=u==="y"?"bottom":"right",b=v+a[g],w=v-a[y];v=Qe(b,v,w)}const h=s.fn({...t,[p]:f,[u]:v});return{...h,data:{x:h.x-n,y:h.y-o,enabled:{[p]:r,[u]:l}}}}}},Gn=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:i,rects:r,middlewareData:l}=t,{offset:s=0,mainAxis:d=!0,crossAxis:c=!0}=ee(e,t),a={x:n,y:o},u=ue(i),p=at(u);let f=a[p],v=a[u];const h=ee(s,t),g=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(d){const w=p==="y"?"height":"width",C=r.reference[p]-r.floating[w]+g.mainAxis,x=r.reference[p]+r.reference[w]-g.mainAxis;fx&&(f=x)}if(c){var y,b;const w=p==="y"?"width":"height",C=["top","left"].includes(te(i)),x=r.reference[u]-r.floating[w]+(C&&((y=l.offset)==null?void 0:y[u])||0)+(C?0:g.crossAxis),S=r.reference[u]+r.reference[w]+(C?0:((b=l.offset)==null?void 0:b[u])||0)-(C?g.crossAxis:0);vS&&(v=S)}return{[p]:f,[u]:v}}}},Jn=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:i,rects:r,platform:l,elements:s}=t,{apply:d=()=>{},...c}=ee(e,t),a=await _e(t,c),u=te(i),p=Pe(i),f=ue(i)==="y",{width:v,height:h}=r.floating;let g,y;u==="top"||u==="bottom"?(g=u,y=p===(await(l.isRTL==null?void 0:l.isRTL(s.floating))?"start":"end")?"left":"right"):(y=u,g=p==="end"?"top":"bottom");const b=h-a.top-a.bottom,w=v-a.left-a.right,C=ae(h-a[g],b),x=ae(v-a[y],w),S=!t.middlewareData.shift;let _=C,M=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(M=w),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(_=b),S&&!p){const R=H(a.left,0),z=H(a.right,0),k=H(a.top,0),W=H(a.bottom,0);f?M=v-2*(R!==0||z!==0?R+z:H(a.left,a.right)):_=h-2*(k!==0||W!==0?k+W:H(a.top,a.bottom))}await d({...t,availableWidth:M,availableHeight:_});const N=await l.getDimensions(s.floating);return v!==N.width||h!==N.height?{reset:{rects:!0}}:{}}}};function je(){return typeof window<"u"}function we(e){return dt(e)?(e.nodeName||"").toLowerCase():"#document"}function V(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Z(e){var t;return(t=(dt(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function dt(e){return je()?e instanceof Node||e instanceof V(e).Node:!1}function U(e){return je()?e instanceof Element||e instanceof V(e).Element:!1}function J(e){return je()?e instanceof HTMLElement||e instanceof V(e).HTMLElement:!1}function Et(e){return!je()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof V(e).ShadowRoot}function Te(e){const{overflow:t,overflowX:n,overflowY:o,display:i}=Y(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!["inline","contents"].includes(i)}function Zn(e){return["table","td","th"].includes(we(e))}function ze(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function ft(e){const t=pt(),n=U(e)?Y(e):e;return["transform","translate","scale","rotate","perspective"].some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function Qn(e){let t=ce(e);for(;J(t)&&!Ee(t);){if(ft(t))return t;if(ze(t))return null;t=ce(t)}return null}function pt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ee(e){return["html","body","#document"].includes(we(e))}function Y(e){return V(e).getComputedStyle(e)}function Ke(e){return U(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ce(e){if(we(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Et(e)&&e.host||Z(e);return Et(t)?t.host:t}function Ut(e){const t=ce(e);return Ee(t)?e.ownerDocument?e.ownerDocument.body:e.body:J(t)&&Te(t)?t:Ut(t)}function Be(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Ut(e),r=i===((o=e.ownerDocument)==null?void 0:o.body),l=V(i);if(r){const s=tt(l);return t.concat(l,l.visualViewport||[],Te(i)?i:[],s&&n?Be(s):[])}return t.concat(i,Be(i,[],n))}function tt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Yt(e){const t=Y(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const i=J(e),r=i?e.offsetWidth:n,l=i?e.offsetHeight:o,s=Ie(n)!==r||Ie(o)!==l;return s&&(n=r,o=l),{width:n,height:o,$:s}}function vt(e){return U(e)?e:e.contextElement}function Ae(e){const t=vt(e);if(!J(t))return G(1);const n=t.getBoundingClientRect(),{width:o,height:i,$:r}=Yt(t);let l=(r?Ie(n.width):n.width)/o,s=(r?Ie(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!s||!Number.isFinite(s))&&(s=1),{x:l,y:s}}const eo=G(0);function Xt(e){const t=V(e);return!pt()||!t.visualViewport?eo:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function to(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==V(e)?!1:t}function ge(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),r=vt(e);let l=G(1);t&&(o?U(o)&&(l=Ae(o)):l=Ae(e));const s=to(r,n,o)?Xt(r):G(0);let d=(i.left+s.x)/l.x,c=(i.top+s.y)/l.y,a=i.width/l.x,u=i.height/l.y;if(r){const p=V(r),f=o&&U(o)?V(o):o;let v=p,h=tt(v);for(;h&&o&&f!==v;){const g=Ae(h),y=h.getBoundingClientRect(),b=Y(h),w=y.left+(h.clientLeft+parseFloat(b.paddingLeft))*g.x,C=y.top+(h.clientTop+parseFloat(b.paddingTop))*g.y;d*=g.x,c*=g.y,a*=g.x,u*=g.y,d+=w,c+=C,v=V(h),h=tt(v)}}return He({width:a,height:u,x:d,y:c})}function mt(e,t){const n=Ke(e).scrollLeft;return t?t.left+n:ge(Z(e)).left+n}function qt(e,t,n){n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=o.left+t.scrollLeft-(n?0:mt(e,o)),r=o.top+t.scrollTop;return{x:i,y:r}}function no(e){let{elements:t,rect:n,offsetParent:o,strategy:i}=e;const r=i==="fixed",l=Z(o),s=t?ze(t.floating):!1;if(o===l||s&&r)return n;let d={scrollLeft:0,scrollTop:0},c=G(1);const a=G(0),u=J(o);if((u||!u&&!r)&&((we(o)!=="body"||Te(l))&&(d=Ke(o)),J(o))){const f=ge(o);c=Ae(o),a.x=f.x+o.clientLeft,a.y=f.y+o.clientTop}const p=l&&!u&&!r?qt(l,d,!0):G(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-d.scrollLeft*c.x+a.x+p.x,y:n.y*c.y-d.scrollTop*c.y+a.y+p.y}}function oo(e){return Array.from(e.getClientRects())}function io(e){const t=Z(e),n=Ke(e),o=e.ownerDocument.body,i=H(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),r=H(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let l=-n.scrollLeft+mt(e);const s=-n.scrollTop;return Y(o).direction==="rtl"&&(l+=H(t.clientWidth,o.clientWidth)-i),{width:i,height:r,x:l,y:s}}function ro(e,t){const n=V(e),o=Z(e),i=n.visualViewport;let r=o.clientWidth,l=o.clientHeight,s=0,d=0;if(i){r=i.width,l=i.height;const c=pt();(!c||c&&t==="fixed")&&(s=i.offsetLeft,d=i.offsetTop)}return{width:r,height:l,x:s,y:d}}function lo(e,t){const n=ge(e,!0,t==="fixed"),o=n.top+e.clientTop,i=n.left+e.clientLeft,r=J(e)?Ae(e):G(1),l=e.clientWidth*r.x,s=e.clientHeight*r.y,d=i*r.x,c=o*r.y;return{width:l,height:s,x:d,y:c}}function Dt(e,t,n){let o;if(t==="viewport")o=ro(e,n);else if(t==="document")o=io(Z(e));else if(U(t))o=lo(t,n);else{const i=Xt(e);o={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return He(o)}function Gt(e,t){const n=ce(e);return n===t||!U(n)||Ee(n)?!1:Y(n).position==="fixed"||Gt(n,t)}function so(e,t){const n=t.get(e);if(n)return n;let o=Be(e,[],!1).filter(s=>U(s)&&we(s)!=="body"),i=null;const r=Y(e).position==="fixed";let l=r?ce(e):e;for(;U(l)&&!Ee(l);){const s=Y(l),d=ft(l);!d&&s.position==="fixed"&&(i=null),(r?!d&&!i:!d&&s.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Te(l)&&!d&&Gt(e,l))?o=o.filter(a=>a!==l):i=s,l=ce(l)}return t.set(e,o),o}function ao(e){let{element:t,boundary:n,rootBoundary:o,strategy:i}=e;const l=[...n==="clippingAncestors"?ze(t)?[]:so(t,this._c):[].concat(n),o],s=l[0],d=l.reduce((c,a)=>{const u=Dt(t,a,i);return c.top=H(u.top,c.top),c.right=ae(u.right,c.right),c.bottom=ae(u.bottom,c.bottom),c.left=H(u.left,c.left),c},Dt(t,s,i));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function uo(e){const{width:t,height:n}=Yt(e);return{width:t,height:n}}function co(e,t,n){const o=J(t),i=Z(t),r=n==="fixed",l=ge(e,!0,r,t);let s={scrollLeft:0,scrollTop:0};const d=G(0);if(o||!o&&!r)if((we(t)!=="body"||Te(i))&&(s=Ke(t)),o){const p=ge(t,!0,r,t);d.x=p.x+t.clientLeft,d.y=p.y+t.clientTop}else i&&(d.x=mt(i));const c=i&&!o&&!r?qt(i,s):G(0),a=l.left+s.scrollLeft-d.x-c.x,u=l.top+s.scrollTop-d.y-c.y;return{x:a,y:u,width:l.width,height:l.height}}function Ye(e){return Y(e).position==="static"}function Pt(e,t){if(!J(e)||Y(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Z(e)===n&&(n=n.ownerDocument.body),n}function Jt(e,t){const n=V(e);if(ze(e))return n;if(!J(e)){let i=ce(e);for(;i&&!Ee(i);){if(U(i)&&!Ye(i))return i;i=ce(i)}return n}let o=Pt(e,t);for(;o&&Zn(o)&&Ye(o);)o=Pt(o,t);return o&&Ee(o)&&Ye(o)&&!ft(o)?n:o||Qn(e)||n}const fo=async function(e){const t=this.getOffsetParent||Jt,n=this.getDimensions,o=await n(e.floating);return{reference:co(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function po(e){return Y(e).direction==="rtl"}const vo={convertOffsetParentRelativeRectToViewportRelativeRect:no,getDocumentElement:Z,getClippingRect:ao,getOffsetParent:Jt,getElementRects:fo,getClientRects:oo,getDimensions:uo,getScale:Ae,isElement:U,isRTL:po};function Zt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function mo(e,t){let n=null,o;const i=Z(e);function r(){var s;clearTimeout(o),(s=n)==null||s.disconnect(),n=null}function l(s,d){s===void 0&&(s=!1),d===void 0&&(d=1),r();const c=e.getBoundingClientRect(),{left:a,top:u,width:p,height:f}=c;if(s||t(),!p||!f)return;const v=Me(u),h=Me(i.clientWidth-(a+p)),g=Me(i.clientHeight-(u+f)),y=Me(a),w={rootMargin:-v+"px "+-h+"px "+-g+"px "+-y+"px",threshold:H(0,ae(1,d))||1};let C=!0;function x(S){const _=S[0].intersectionRatio;if(_!==d){if(!C)return l();_?l(!1,_):o=setTimeout(()=>{l(!1,1e-7)},1e3)}_===1&&!Zt(c,e.getBoundingClientRect())&&l(),C=!1}try{n=new IntersectionObserver(x,{...w,root:i.ownerDocument})}catch{n=new IntersectionObserver(x,w)}n.observe(e)}return l(!0),r}function go(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:d=!1}=o,c=vt(e),a=i||r?[...c?Be(c):[],...Be(t)]:[];a.forEach(y=>{i&&y.addEventListener("scroll",n,{passive:!0}),r&&y.addEventListener("resize",n)});const u=c&&s?mo(c,n):null;let p=-1,f=null;l&&(f=new ResizeObserver(y=>{let[b]=y;b&&b.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var w;(w=f)==null||w.observe(t)})),n()}),c&&!d&&f.observe(c),f.observe(t));let v,h=d?ge(e):null;d&&g();function g(){const y=ge(e);h&&!Zt(h,y)&&n(),h=y,v=requestAnimationFrame(g)}return n(),()=>{var y;a.forEach(b=>{i&&b.removeEventListener("scroll",n),r&&b.removeEventListener("resize",n)}),u==null||u(),(y=f)==null||y.disconnect(),f=null,d&&cancelAnimationFrame(v)}}const ho=Xn,yo=qn,_t=Kn,wo=Jn,bo=Un,xo=zn,Oo=Gn,Co=(e,t,n)=>{const o=new Map,i={platform:vo,...n},r={...i.platform,_c:o};return jn(e,t,{...i,platform:r})};function Ao(e){return e!=null&&typeof e=="object"&&"$el"in e}function nt(e){if(Ao(e)){const t=e.$el;return dt(t)&&we(t)==="#comment"?null:t}return e}function Ce(e){return typeof e=="function"?e():m(e)}function Eo(e){return{name:"arrow",options:e,fn(t){const n=nt(Ce(e.element));return n==null?{}:xo({element:n,padding:e.padding}).fn(t)}}}function Qt(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Bt(e,t){const n=Qt(e);return Math.round(t*n)/n}function Do(e,t,n){n===void 0&&(n={});const o=n.whileElementsMounted,i=O(()=>{var _;return(_=Ce(n.open))!=null?_:!0}),r=O(()=>Ce(n.middleware)),l=O(()=>{var _;return(_=Ce(n.placement))!=null?_:"bottom"}),s=O(()=>{var _;return(_=Ce(n.strategy))!=null?_:"absolute"}),d=O(()=>{var _;return(_=Ce(n.transform))!=null?_:!0}),c=O(()=>nt(e.value)),a=O(()=>nt(t.value)),u=E(0),p=E(0),f=E(s.value),v=E(l.value),h=Mt({}),g=E(!1),y=O(()=>{const _={position:f.value,left:"0",top:"0"};if(!a.value)return _;const M=Bt(a.value,u.value),N=Bt(a.value,p.value);return d.value?{..._,transform:"translate("+M+"px, "+N+"px)",...Qt(a.value)>=1.5&&{willChange:"transform"}}:{position:f.value,left:M+"px",top:N+"px"}});let b;function w(){if(c.value==null||a.value==null)return;const _=i.value;Co(c.value,a.value,{middleware:r.value,placement:l.value,strategy:s.value}).then(M=>{u.value=M.x,p.value=M.y,f.value=M.strategy,v.value=M.placement,h.value=M.middlewareData,g.value=_!==!1})}function C(){typeof b=="function"&&(b(),b=void 0)}function x(){if(C(),o===void 0){w();return}if(c.value!=null&&a.value!=null){b=o(c.value,a.value,w);return}}function S(){i.value||(g.value=!1)}return j([r,l,s,i],w,{flush:"sync"}),j([c,a],x,{flush:"sync"}),j(i,S,{flush:"sync"}),Lt()&&Ft(C),{x:xe(u),y:xe(p),strategy:xe(f),placement:xe(v),middlewareData:xe(h),isPositioned:xe(g),floatingStyles:y,update:w}}function be(e,t){const n=typeof e=="string"&&!t?`${e}Context`:t,o=Symbol(n);return[i=>{const r=bn(o,i);if(r||r===null)return r;throw new Error(`Injection \`${o.toString()}\` not found. Component must be used within ${Array.isArray(e)?`one of the following components: ${e.join(", ")}`:`\`${e}\``}`)},i=>(Mn(o,i),i)]}function en(e,t,n){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),o.dispatchEvent(i)}function Po(e,t){var n;const o=Mt();return K(()=>{o.value=e()},{...t,flush:(n=void 0)!=null?n:"sync"}),Ht(o)}function Re(e){return Lt()?(Ft(e),!0):!1}function _o(){const e=new Set,t=n=>{e.delete(n)};return{on:n=>{e.add(n);const o=()=>t(n);return Re(o),{off:o}},off:t,trigger:(...n)=>Promise.all(Array.from(e).map(o=>o(...n)))}}function Bo(e){let t=!1,n;const o=jt(!0);return(...i)=>(t||(n=o.run(()=>e(...i)),t=!0),n)}function To(e){let t=0,n,o;const i=()=>{t-=1,o&&t<=0&&(o.stop(),n=void 0,o=void 0)};return(...r)=>(t+=1,n||(o=jt(!0),n=o.run(()=>e(...r))),Re(i),n)}function ve(e){return typeof e=="function"?e():m(e)}const pe=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Ro=e=>typeof e<"u",$o=Object.prototype.toString,So=e=>$o.call(e)==="[object Object]",Mo=()=>{},Tt=Lo();function Lo(){var e,t;return pe&&((e=window==null?void 0:window.navigator)==null?void 0:e.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((t=window==null?void 0:window.navigator)==null?void 0:t.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function Fo(e){return ye()}function No(e,t=1e4){return Sn((n,o)=>{let i=ve(e),r;const l=()=>setTimeout(()=>{i=ve(e),o()},ve(t));return Re(()=>{clearTimeout(r)}),{get(){return n(),i},set(s){i=s,o(),clearTimeout(r),r=l()}}})}function ko(e,t){Fo()&&Bn(e,t)}function tn(e,t,n={}){const{immediate:o=!0}=n,i=E(!1);let r=null;function l(){r&&(clearTimeout(r),r=null)}function s(){i.value=!1,l()}function d(...c){l(),i.value=!0,r=setTimeout(()=>{i.value=!1,r=null,e(...c)},ve(t))}return o&&(i.value=!0,pe&&d()),Re(s),{isPending:Ht(i),start:d,stop:s}}function $e(e){var t;const n=ve(e);return(t=n==null?void 0:n.$el)!=null?t:n}const gt=pe?window:void 0;function Ve(...e){let t,n,o,i;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,o,i]=e,t=gt):[t,n,o,i]=e,!t)return Mo;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const r=[],l=()=>{r.forEach(a=>a()),r.length=0},s=(a,u,p,f)=>(a.addEventListener(u,p,f),()=>a.removeEventListener(u,p,f)),d=j(()=>[$e(t),ve(i)],([a,u])=>{if(l(),!a)return;const p=So(u)?{...u}:u;r.push(...n.flatMap(f=>o.map(v=>s(a,f,v,p))))},{immediate:!0,flush:"post"}),c=()=>{d(),l()};return Re(c),c}function Io(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function Wo(...e){let t,n,o={};e.length===3?(t=e[0],n=e[1],o=e[2]):e.length===2?typeof e[1]=="object"?(t=!0,n=e[0],o=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);const{target:i=gt,eventName:r="keydown",passive:l=!1,dedupe:s=!1}=o,d=Io(t);return Ve(i,r,c=>{c.repeat&&ve(s)||d(c)&&n(c)},l)}function Ho(){const e=E(!1),t=ye();return t&&De(()=>{e.value=!0},t),e}function Vo(e){return JSON.parse(JSON.stringify(e))}function nn(e,t,n,o={}){var i,r,l;const{clone:s=!1,passive:d=!1,eventName:c,deep:a=!1,defaultValue:u,shouldEmit:p}=o,f=ye(),v=n||(f==null?void 0:f.emit)||((i=f==null?void 0:f.$emit)==null?void 0:i.bind(f))||((l=(r=f==null?void 0:f.proxy)==null?void 0:r.$emit)==null?void 0:l.bind(f==null?void 0:f.proxy));let h=c;h=h||`update:${t.toString()}`;const g=w=>s?typeof s=="function"?s(w):Vo(w):w,y=()=>Ro(e[t])?g(e[t]):u,b=w=>{p?p(w)&&v(h,w):v(h,w)};if(d){const w=y(),C=E(w);let x=!1;return j(()=>e[t],S=>{x||(x=!0,C.value=g(S),he(()=>x=!1))}),j(C,S=>{!x&&(S!==e[t]||a)&&b(S)},{deep:a}),C}else return O({get(){return y()},set(w){b(w)}})}function ht(e){return e?e.flatMap(t=>t.type===An?ht(t.children):[t]):[]}function se(){let e=document.activeElement;if(e==null)return null;for(;e!=null&&e.shadowRoot!=null&&e.shadowRoot.activeElement!=null;)e=e.shadowRoot.activeElement;return e}function Xe(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)==="[object Module]":!0}function ot(e,t,n=".",o){if(!Xe(t))return ot(e,{},n);const i=Object.assign({},t);for(const r in e){if(r==="__proto__"||r==="constructor")continue;const l=e[r];l!=null&&(Array.isArray(l)&&Array.isArray(i[r])?i[r]=[...l,...i[r]]:Xe(l)&&Xe(i[r])?i[r]=ot(l,i[r],(n?`${n}.`:"")+r.toString()):i[r]=l)}return i}function jo(e){return(...t)=>t.reduce((n,o)=>ot(n,o,""),{})}const zo=jo(),[on,nr]=be("ConfigProvider");let Ko="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",Uo=(e=21)=>{let t="",n=e;for(;n--;)t+=Ko[Math.random()*64|0];return t};const Yo=To(()=>{const e=E(new Map),t=E(),n=O(()=>{for(const l of e.value.values())if(l)return!0;return!1}),o=on({scrollBody:E(!0)});let i=null;const r=()=>{document.body.style.paddingRight="",document.body.style.marginRight="",document.body.style.pointerEvents="",document.body.style.removeProperty("--scrollbar-width"),document.body.style.overflow=t.value??"",Tt&&(i==null||i()),t.value=void 0};return j(n,(l,s)=>{var d;if(!pe)return;if(!l){s&&r();return}t.value===void 0&&(t.value=document.body.style.overflow);const c=window.innerWidth-document.documentElement.clientWidth,a={padding:c,margin:0},u=(d=o.scrollBody)!=null&&d.value?typeof o.scrollBody.value=="object"?zo({padding:o.scrollBody.value.padding===!0?c:o.scrollBody.value.padding,margin:o.scrollBody.value.margin===!0?c:o.scrollBody.value.margin},a):a:{padding:0,margin:0};c>0&&(document.body.style.paddingRight=typeof u.padding=="number"?`${u.padding}px`:String(u.padding),document.body.style.marginRight=typeof u.margin=="number"?`${u.margin}px`:String(u.margin),document.body.style.setProperty("--scrollbar-width",`${c}px`),document.body.style.overflow="hidden"),Tt&&(i=Ve(document,"touchmove",p=>qo(p),{passive:!1})),he(()=>{document.body.style.pointerEvents="none",document.body.style.overflow="hidden"})},{immediate:!0,flush:"sync"}),e});function Xo(e){const t=Uo(6),n=Yo();n.value.set(t,e);const o=O({get:()=>n.value.get(t)??!1,set:i=>n.value.set(t,i)});return ko(()=>{n.value.delete(t)}),o}function rn(e){const t=window.getComputedStyle(e);if(t.overflowX==="scroll"||t.overflowY==="scroll"||t.overflowX==="auto"&&e.clientWidth1?!0:(t.preventDefault&&t.cancelable&&t.preventDefault(),!1)}function Se(e){const t=ye(),n=t==null?void 0:t.type.emits,o={};return n!=null&&n.length||console.warn(`No emitted event found. Please check component: ${t==null?void 0:t.type.__name}`),n==null||n.forEach(i=>{o[wn(kt(i))]=(...r)=>e(i,...r)}),o}function ln(e){const t=ye(),n=Object.keys((t==null?void 0:t.type.props)??{}).reduce((i,r)=>{const l=(t==null?void 0:t.type.props[r]).default;return l!==void 0&&(i[r]=l),i},{}),o=Cn(e);return O(()=>{const i={},r=(t==null?void 0:t.vnode.props)??{};return Object.keys(r).forEach(l=>{i[kt(l)]=r[l]}),Object.keys({...n,...i}).reduce((l,s)=>(o.value[s]!==void 0&&(l[s]=o.value[s]),l),{})})}function sn(e,t){const n=ln(e),o=t?Se(t):{};return O(()=>({...n.value,...o}))}function $(){const e=ye(),t=E(),n=O(()=>{var l,s;return["#text","#comment"].includes((l=t.value)==null?void 0:l.$el.nodeName)?(s=t.value)==null?void 0:s.$el.nextElementSibling:$e(t)}),o=Object.assign({},e.exposed),i={};for(const l in e.props)Object.defineProperty(i,l,{enumerable:!0,configurable:!0,get:()=>e.props[l]});if(Object.keys(o).length>0)for(const l in o)Object.defineProperty(i,l,{enumerable:!0,configurable:!0,get:()=>o[l]});Object.defineProperty(i,"$el",{enumerable:!0,configurable:!0,get:()=>e.vnode.el}),e.exposed=i;function r(l){t.value=l,l&&(Object.defineProperty(i,"$el",{enumerable:!0,configurable:!0,get:()=>l instanceof Element?l:l.$el}),e.exposed=i)}return{forwardRef:r,currentRef:t,currentElement:n}}function Go(e,t){const n=No(!1,300),o=E(null),i=_o();function r(){o.value=null,n.value=!1}function l(s,d){const c=s.currentTarget,a={x:s.clientX,y:s.clientY},u=Jo(a,c.getBoundingClientRect()),p=Zo(a,u),f=Qo(d.getBoundingClientRect()),v=ti([...p,...f]);o.value=v,n.value=!0}return K(s=>{if(e.value&&t.value){const d=a=>l(a,t.value),c=a=>l(a,e.value);e.value.addEventListener("pointerleave",d),t.value.addEventListener("pointerleave",c),s(()=>{var a,u;(a=e.value)==null||a.removeEventListener("pointerleave",d),(u=t.value)==null||u.removeEventListener("pointerleave",c)})}}),K(s=>{var d;if(o.value){const c=a=>{var u,p;if(!o.value)return;const f=a.target,v={x:a.clientX,y:a.clientY},h=((u=e.value)==null?void 0:u.contains(f))||((p=t.value)==null?void 0:p.contains(f)),g=!ei(v,o.value),y=!!f.closest("[data-grace-area-trigger]");h?r():(g||y)&&(r(),i.trigger())};(d=e.value)==null||d.ownerDocument.addEventListener("pointermove",c),s(()=>{var a;return(a=e.value)==null?void 0:a.ownerDocument.removeEventListener("pointermove",c)})}}),{isPointerInTransit:n,onPointerExit:i.on}}function Jo(e,t){const n=Math.abs(t.top-e.y),o=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),r=Math.abs(t.left-e.x);switch(Math.min(n,o,i,r)){case r:return"left";case i:return"right";case n:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function Zo(e,t,n=5){const o=[];switch(t){case"top":o.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":o.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":o.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":o.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return o}function Qo(e){const{top:t,right:n,bottom:o,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:o},{x:i,y:o}]}function ei(e,t){const{x:n,y:o}=e;let i=!1;for(let r=0,l=t.length-1;ro!=a>o&&n<(c-s)*(o-d)/(a-d)+s&&(i=!i)}return i}function ti(e){const t=e.slice();return t.sort((n,o)=>n.xo.x?1:n.yo.y?1:0),ni(t)}function ni(e){if(e.length<=1)return e.slice();const t=[];for(let o=0;o=2;){const r=t[t.length-1],l=t[t.length-2];if((r.x-l.x)*(i.y-l.y)>=(r.y-l.y)*(i.x-l.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let o=e.length-1;o>=0;o--){const i=e[o];for(;n.length>=2;){const r=n[n.length-1],l=n[n.length-2];if((r.x-l.x)*(i.y-l.y)>=(r.y-l.y)*(i.x-l.x))n.pop();else break}n.push(i)}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 oi=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Oe=new WeakMap,Le=new WeakMap,Fe={},qe=0,an=function(e){return e&&(e.host||an(e.parentNode))},ii=function(e,t){return t.map(function(n){if(e.contains(n))return n;var o=an(n);return o&&e.contains(o)?o:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},ri=function(e,t,n,o){var i=ii(t,Array.isArray(e)?e:[e]);Fe[n]||(Fe[n]=new WeakMap);var r=Fe[n],l=[],s=new Set,d=new Set(i),c=function(u){!u||s.has(u)||(s.add(u),c(u.parentNode))};i.forEach(c);var a=function(u){!u||d.has(u)||Array.prototype.forEach.call(u.children,function(p){if(s.has(p))a(p);else try{var f=p.getAttribute(o),v=f!==null&&f!=="false",h=(Oe.get(p)||0)+1,g=(r.get(p)||0)+1;Oe.set(p,h),r.set(p,g),l.push(p),h===1&&v&&Le.set(p,!0),g===1&&p.setAttribute(n,"true"),v||p.setAttribute(o,"true")}catch(y){console.error("aria-hidden: cannot operate on ",p,y)}})};return a(t),s.clear(),qe++,function(){l.forEach(function(u){var p=Oe.get(u)-1,f=r.get(u)-1;Oe.set(u,p),r.set(u,f),p||(Le.has(u)||u.removeAttribute(o),Le.delete(u)),f||u.removeAttribute(n)}),qe--,qe||(Oe=new WeakMap,Oe=new WeakMap,Le=new WeakMap,Fe={})}},li=function(e,t,n){n===void 0&&(n="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),i=oi(e);return i?(o.push.apply(o,Array.from(i.querySelectorAll("[aria-live]"))),ri(o,i,n,"aria-hidden")):function(){return null}};function si(e){let t;j(()=>$e(e),n=>{n?t=li(n):t&&t()}),It(()=>{t&&t()})}let ai=0;function it(e,t="radix"){const n=on({useId:void 0});return xt?`${t}-${xt()}`:n.useId?`${t}-${n.useId()}`:`${t}-${++ai}`}function ui(e){const t=E(),n=O(()=>{var i;return((i=t.value)==null?void 0:i.width)??0}),o=O(()=>{var i;return((i=t.value)==null?void 0:i.height)??0});return De(()=>{const i=$e(e);if(i){t.value={width:i.offsetWidth,height:i.offsetHeight};const r=new ResizeObserver(l=>{if(!Array.isArray(l)||!l.length)return;const s=l[0];let d,c;if("borderBoxSize"in s){const a=s.borderBoxSize,u=Array.isArray(a)?a[0]:a;d=u.inlineSize,c=u.blockSize}else d=i.offsetWidth,c=i.offsetHeight;t.value={width:d,height:c}});return r.observe(i,{box:"border-box"}),()=>r.unobserve(i)}else t.value=void 0}),{width:n,height:o}}function ci(e,t){const n=E(e);function o(i){return t[n.value][i]??n.value}return{state:n,dispatch:i=>{n.value=o(i)}}}const di=D({name:"PrimitiveSlot",inheritAttrs:!1,setup(e,{attrs:t,slots:n}){return()=>{var o,i;if(!n.default)return null;const r=ht(n.default()),l=r.findIndex(a=>a.type!==Wt);if(l===-1)return r;const s=r[l];(o=s.props)==null||delete o.ref;const d=s.props?F(t,s.props):t;t.class&&(i=s.props)!=null&&i.class&&delete s.props.class;const c=En(s,d);for(const a in d)a.startsWith("on")&&(c.props||(c.props={}),c.props[a]=d[a]);return r.length===1?c:(r[l]=c,r)}}}),X=D({name:"Primitive",inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:"div"}},setup(e,{attrs:t,slots:n}){const o=e.asChild?"template":e.as;return typeof o=="string"&&["area","img","input"].includes(o)?()=>ke(o,t):o!=="template"?()=>ke(e.as,t,{default:n.default}):()=>ke(di,t,{default:n.default})}});function fi(e,t){var n;const o=E({}),i=E("none"),r=E(e),l=e.value?"mounted":"unmounted";let s;const d=((n=t.value)==null?void 0:n.ownerDocument.defaultView)??gt,{state:c,dispatch:a}=ci(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}}),u=g=>{var y;if(pe){const b=new CustomEvent(g,{bubbles:!1,cancelable:!1});(y=t.value)==null||y.dispatchEvent(b)}};j(e,async(g,y)=>{var b;const w=y!==g;if(await he(),w){const C=i.value,x=Ne(t.value);g?(a("MOUNT"),u("enter"),x==="none"&&u("after-enter")):x==="none"||((b=o.value)==null?void 0:b.display)==="none"?(a("UNMOUNT"),u("leave"),u("after-leave")):y&&C!==x?(a("ANIMATION_OUT"),u("leave")):(a("UNMOUNT"),u("after-leave"))}},{immediate:!0});const p=g=>{const y=Ne(t.value),b=y.includes(g.animationName),w=c.value==="mounted"?"enter":"leave";if(g.target===t.value&&b&&(u(`after-${w}`),a("ANIMATION_END"),!r.value)){const C=t.value.style.animationFillMode;t.value.style.animationFillMode="forwards",s=d==null?void 0:d.setTimeout(()=>{var x;((x=t.value)==null?void 0:x.style.animationFillMode)==="forwards"&&(t.value.style.animationFillMode=C)})}g.target===t.value&&y==="none"&&a("ANIMATION_END")},f=g=>{g.target===t.value&&(i.value=Ne(t.value))},v=j(t,(g,y)=>{g?(o.value=getComputedStyle(g),g.addEventListener("animationstart",f),g.addEventListener("animationcancel",p),g.addEventListener("animationend",p)):(a("ANIMATION_END"),s!==void 0&&(d==null||d.clearTimeout(s)),y==null||y.removeEventListener("animationstart",f),y==null||y.removeEventListener("animationcancel",p),y==null||y.removeEventListener("animationend",p))},{immediate:!0}),h=j(c,()=>{const g=Ne(t.value);i.value=c.value==="mounted"?g:"none"});return It(()=>{v(),h()}),{isPresent:O(()=>["mounted","unmountSuspended"].includes(c.value))}}function Ne(e){return e&&getComputedStyle(e).animationName||"none"}const yt=D({name:"Presence",props:{present:{type:Boolean,required:!0},forceMount:{type:Boolean}},slots:{},setup(e,{slots:t,expose:n}){var o;const{present:i,forceMount:r}=lt(e),l=E(),{isPresent:s}=fi(i,l);n({present:s});let d=t.default({present:s});d=ht(d||[]);const c=ye();if(d&&(d==null?void 0:d.length)>1){const a=(o=c==null?void 0:c.parent)!=null&&o.type.name?`<${c.parent.type.name} />`:"component";throw new Error([`Detected an invalid children for \`${a}\` for \`Presence\` component.`,"","Note: Presence works similarly to `v-if` directly, but it waits for animation/transition to finished before unmounting. So it expect only one direct child of valid VNode type.","You can apply a few solutions:",["Provide a single child element so that `presence` directive attach correctly.","Ensure the first child is an actual element instead of a raw text node or comment node."].map(u=>` - ${u}`).join(` -`)].join(` -`))}return()=>r.value||i.value||s.value?ke(t.default({present:s})[0],{ref:a=>{const u=$e(a);return typeof(u==null?void 0:u.hasAttribute)>"u"||(u!=null&&u.hasAttribute("data-radix-popper-content-wrapper")?l.value=u.firstElementChild:l.value=u),u}}):null}}),[ne,pi]=be("DialogRoot"),vi=D({inheritAttrs:!1,__name:"DialogRoot",props:{open:{type:Boolean,default:void 0},defaultOpen:{type:Boolean,default:!1},modal:{type:Boolean,default:!0}},emits:["update:open"],setup(e,{emit:t}){const n=e,o=nn(n,"open",t,{defaultValue:n.defaultOpen,passive:n.open===void 0}),i=E(),r=E(),{modal:l}=lt(n);return pi({open:o,modal:l,openModal:()=>{o.value=!0},onOpenChange:s=>{o.value=s},onOpenToggle:()=>{o.value=!o.value},contentId:"",titleId:"",descriptionId:"",triggerElement:i,contentElement:r}),(s,d)=>P(s.$slots,"default",{open:m(o)})}}),wt=D({__name:"Teleport",props:{to:{default:"body"},disabled:{type:Boolean},forceMount:{type:Boolean}},setup(e){const t=Ho();return(n,o)=>m(t)||n.forceMount?(B(),T(yn,{key:0,to:n.to,disabled:n.disabled},[P(n.$slots,"default")],8,["to","disabled"])):Nt("",!0)}}),or=D({__name:"DialogPortal",props:{to:{},disabled:{type:Boolean},forceMount:{type:Boolean}},setup(e){const t=e;return(n,o)=>(B(),T(m(wt),de(fe(t)),{default:A(()=>[P(n.$slots,"default")]),_:3},16))}}),mi="dismissableLayer.pointerDownOutside",gi="dismissableLayer.focusOutside";function un(e,t){const n=t.closest("[data-dismissable-layer]"),o=e.dataset.dismissableLayer===""?e:e.querySelector("[data-dismissable-layer]"),i=Array.from(e.ownerDocument.querySelectorAll("[data-dismissable-layer]"));return!!(n&&o===n||i.indexOf(o){});return K(l=>{if(!pe)return;const s=async c=>{const a=c.target;if(t!=null&&t.value){if(un(t.value,a)){i.value=!1;return}if(c.target&&!i.value){let u=function(){en(mi,e,p)};const p={originalEvent:c};c.pointerType==="touch"?(o.removeEventListener("click",r.value),r.value=u,o.addEventListener("click",r.value,{once:!0})):u()}else o.removeEventListener("click",r.value);i.value=!1}},d=window.setTimeout(()=>{o.addEventListener("pointerdown",s)},0);l(()=>{window.clearTimeout(d),o.removeEventListener("pointerdown",s),o.removeEventListener("click",r.value)})}),{onPointerDownCapture:()=>i.value=!0}}function yi(e,t){var n;const o=((n=t==null?void 0:t.value)==null?void 0:n.ownerDocument)??(globalThis==null?void 0:globalThis.document),i=E(!1);return K(r=>{if(!pe)return;const l=async s=>{t!=null&&t.value&&(await he(),!(!t.value||un(t.value,s.target))&&s.target&&!i.value&&en(gi,e,{originalEvent:s}))};o.addEventListener("focusin",l),r(()=>o.removeEventListener("focusin",l))}),{onFocusCapture:()=>i.value=!0,onBlurCapture:()=>i.value=!1}}const Q=zt({layersRoot:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),cn=D({__name:"DismissableLayer",props:{disableOutsidePointerEvents:{type:Boolean,default:!1},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","dismiss"],setup(e,{emit:t}){const n=e,o=t,{forwardRef:i,currentElement:r}=$(),l=O(()=>{var v;return((v=r.value)==null?void 0:v.ownerDocument)??globalThis.document}),s=O(()=>Q.layersRoot),d=O(()=>r.value?Array.from(s.value).indexOf(r.value):-1),c=O(()=>Q.layersWithOutsidePointerEventsDisabled.size>0),a=O(()=>{const v=Array.from(s.value),[h]=[...Q.layersWithOutsidePointerEventsDisabled].slice(-1),g=v.indexOf(h);return d.value>=g}),u=hi(async v=>{const h=[...Q.branches].some(g=>g==null?void 0:g.contains(v.target));!a.value||h||(o("pointerDownOutside",v),o("interactOutside",v),await he(),v.defaultPrevented||o("dismiss"))},r),p=yi(v=>{[...Q.branches].some(h=>h==null?void 0:h.contains(v.target))||(o("focusOutside",v),o("interactOutside",v),v.defaultPrevented||o("dismiss"))},r);Wo("Escape",v=>{d.value===s.value.size-1&&(o("escapeKeyDown",v),v.defaultPrevented||o("dismiss"))});let f;return K(v=>{r.value&&(n.disableOutsidePointerEvents&&(Q.layersWithOutsidePointerEventsDisabled.size===0&&(f=l.value.body.style.pointerEvents,l.value.body.style.pointerEvents="none"),Q.layersWithOutsidePointerEventsDisabled.add(r.value)),s.value.add(r.value),v(()=>{n.disableOutsidePointerEvents&&Q.layersWithOutsidePointerEventsDisabled.size===1&&(l.value.body.style.pointerEvents=f)}))}),K(v=>{v(()=>{r.value&&(s.value.delete(r.value),Q.layersWithOutsidePointerEventsDisabled.delete(r.value))})}),(v,h)=>(B(),T(m(X),{ref:m(i),"as-child":v.asChild,as:v.as,"data-dismissable-layer":"",style:st({pointerEvents:c.value?a.value?"auto":"none":void 0}),onFocusCapture:m(p).onFocusCapture,onBlurCapture:m(p).onBlurCapture,onPointerdownCapture:m(u).onPointerDownCapture},{default:A(()=>[P(v.$slots,"default")]),_:3},8,["as-child","as","style","onFocusCapture","onBlurCapture","onPointerdownCapture"]))}}),Ge="focusScope.autoFocusOnMount",Je="focusScope.autoFocusOnUnmount",Rt={bubbles:!1,cancelable:!0};function wi(e,{select:t=!1}={}){const n=se();for(const o of e)if(le(o,{select:t}),se()!==n)return!0}function bi(e){const t=dn(e),n=$t(t,e),o=$t(t.reverse(),e);return[n,o]}function dn(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const i=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||i?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function $t(e,t){for(const n of e)if(!xi(n,{upTo:t}))return n}function xi(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Oi(e){return e instanceof HTMLInputElement&&"select"in e}function le(e,{select:t=!1}={}){if(e&&e.focus){const n=se();e.focus({preventScroll:!0}),e!==n&&Oi(e)&&t&&e.select()}}const Ci=Bo(()=>E([]));function Ai(){const e=Ci();return{add(t){const n=e.value[0];t!==n&&(n==null||n.pause()),e.value=St(e.value,t),e.value.unshift(t)},remove(t){var n;e.value=St(e.value,t),(n=e.value[0])==null||n.resume()}}}function St(e,t){const n=[...e],o=n.indexOf(t);return o!==-1&&n.splice(o,1),n}function Ei(e){return e.filter(t=>t.tagName!=="A")}const Di=D({__name:"FocusScope",props:{loop:{type:Boolean,default:!1},trapped:{type:Boolean,default:!1},asChild:{type:Boolean},as:{}},emits:["mountAutoFocus","unmountAutoFocus"],setup(e,{emit:t}){const n=e,o=t,{currentRef:i,currentElement:r}=$(),l=E(null),s=Ai(),d=zt({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}});K(a=>{if(!pe)return;const u=r.value;if(!n.trapped)return;function p(g){if(d.paused||!u)return;const y=g.target;u.contains(y)?l.value=y:le(l.value,{select:!0})}function f(g){if(d.paused||!u)return;const y=g.relatedTarget;y!==null&&(u.contains(y)||le(l.value,{select:!0}))}function v(g){u.contains(l.value)||le(u)}document.addEventListener("focusin",p),document.addEventListener("focusout",f);const h=new MutationObserver(v);u&&h.observe(u,{childList:!0,subtree:!0}),a(()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",f),h.disconnect()})}),K(async a=>{const u=r.value;if(await he(),!u)return;s.add(d);const p=se();if(!u.contains(p)){const f=new CustomEvent(Ge,Rt);u.addEventListener(Ge,v=>o("mountAutoFocus",v)),u.dispatchEvent(f),f.defaultPrevented||(wi(Ei(dn(u)),{select:!0}),se()===p&&le(u))}a(()=>{u.removeEventListener(Ge,h=>o("mountAutoFocus",h));const f=new CustomEvent(Je,Rt),v=h=>{o("unmountAutoFocus",h)};u.addEventListener(Je,v),u.dispatchEvent(f),setTimeout(()=>{f.defaultPrevented||le(p??document.body,{select:!0}),u.removeEventListener(Je,v),s.remove(d)},0)})});function c(a){if(!n.loop&&!n.trapped||d.paused)return;const u=a.key==="Tab"&&!a.altKey&&!a.ctrlKey&&!a.metaKey,p=se();if(u&&p){const f=a.currentTarget,[v,h]=bi(f);v&&h?!a.shiftKey&&p===h?(a.preventDefault(),n.loop&&le(v,{select:!0})):a.shiftKey&&p===v&&(a.preventDefault(),n.loop&&le(h,{select:!0})):p===f&&a.preventDefault()}}return(a,u)=>(B(),T(m(X),{ref_key:"currentRef",ref:i,tabindex:"-1","as-child":a.asChild,as:a.as,onKeydown:c},{default:A(()=>[P(a.$slots,"default")]),_:3},8,["as-child","as"]))}});function Pi(e){return e?"open":"closed"}const fn=D({__name:"DialogContentImpl",props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const n=e,o=t,i=ne(),{forwardRef:r,currentElement:l}=$();return i.titleId||(i.titleId=it(void 0,"radix-vue-dialog-title")),i.descriptionId||(i.descriptionId=it(void 0,"radix-vue-dialog-description")),De(()=>{i.contentElement=l,se()!==document.body&&(i.triggerElement.value=se())}),(s,d)=>(B(),T(m(Di),{"as-child":"",loop:"",trapped:n.trapFocus,onMountAutoFocus:d[5]||(d[5]=c=>o("openAutoFocus",c)),onUnmountAutoFocus:d[6]||(d[6]=c=>o("closeAutoFocus",c))},{default:A(()=>[me(m(cn),F({id:m(i).contentId,ref:m(r),as:s.as,"as-child":s.asChild,"disable-outside-pointer-events":s.disableOutsidePointerEvents,role:"dialog","aria-describedby":m(i).descriptionId,"aria-labelledby":m(i).titleId,"data-state":m(Pi)(m(i).open.value)},s.$attrs,{onDismiss:d[0]||(d[0]=c=>m(i).onOpenChange(!1)),onEscapeKeyDown:d[1]||(d[1]=c=>o("escapeKeyDown",c)),onFocusOutside:d[2]||(d[2]=c=>o("focusOutside",c)),onInteractOutside:d[3]||(d[3]=c=>o("interactOutside",c)),onPointerDownOutside:d[4]||(d[4]=c=>o("pointerDownOutside",c))}),{default:A(()=>[P(s.$slots,"default")]),_:3},16,["id","as","as-child","disable-outside-pointer-events","aria-describedby","aria-labelledby","data-state"])]),_:3},8,["trapped"]))}}),_i=D({__name:"DialogContentModal",props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const n=e,o=t,i=ne(),r=Se(o),{forwardRef:l,currentElement:s}=$();return si(s),(d,c)=>(B(),T(fn,F({...n,...m(r)},{ref:m(l),"trap-focus":m(i).open.value,"disable-outside-pointer-events":!0,onCloseAutoFocus:c[0]||(c[0]=a=>{var u;a.defaultPrevented||(a.preventDefault(),(u=m(i).triggerElement.value)==null||u.focus())}),onPointerDownOutside:c[1]||(c[1]=a=>{const u=a.detail.originalEvent,p=u.button===0&&u.ctrlKey===!0;(u.button===2||p)&&a.preventDefault()}),onFocusOutside:c[2]||(c[2]=a=>{a.preventDefault()})}),{default:A(()=>[P(d.$slots,"default")]),_:3},16,["trap-focus"]))}}),Bi=D({__name:"DialogContentNonModal",props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const n=e,o=Se(t);$();const i=ne(),r=E(!1),l=E(!1);return(s,d)=>(B(),T(fn,F({...n,...m(o)},{"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:d[0]||(d[0]=c=>{var a;c.defaultPrevented||(r.value||(a=m(i).triggerElement.value)==null||a.focus(),c.preventDefault()),r.value=!1,l.value=!1}),onInteractOutside:d[1]||(d[1]=c=>{var a;c.defaultPrevented||(r.value=!0,c.detail.originalEvent.type==="pointerdown"&&(l.value=!0));const u=c.target;(a=m(i).triggerElement.value)!=null&&a.contains(u)&&c.preventDefault(),c.detail.originalEvent.type==="focusin"&&l.value&&c.preventDefault()})}),{default:A(()=>[P(s.$slots,"default")]),_:3},16))}}),Ti=D({__name:"DialogContent",props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const n=e,o=t,i=ne(),r=Se(o),{forwardRef:l}=$();return(s,d)=>(B(),T(m(yt),{present:s.forceMount||m(i).open.value},{default:A(()=>[m(i).modal.value?(B(),T(_i,F({key:0,ref:m(l)},{...n,...m(r),...s.$attrs}),{default:A(()=>[P(s.$slots,"default")]),_:3},16)):(B(),T(Bi,F({key:1,ref:m(l)},{...n,...m(r),...s.$attrs}),{default:A(()=>[P(s.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),Ri=D({__name:"DialogOverlayImpl",props:{asChild:{type:Boolean},as:{}},setup(e){const t=ne();return Xo(!0),$(),(n,o)=>(B(),T(m(X),{as:n.as,"as-child":n.asChild,"data-state":m(t).open.value?"open":"closed",style:{"pointer-events":"auto"}},{default:A(()=>[P(n.$slots,"default")]),_:3},8,["as","as-child","data-state"]))}}),$i=D({__name:"DialogOverlay",props:{forceMount:{type:Boolean},asChild:{type:Boolean},as:{}},setup(e){const t=ne(),{forwardRef:n}=$();return(o,i)=>{var r;return(r=m(t))!=null&&r.modal.value?(B(),T(m(yt),{key:0,present:o.forceMount||m(t).open.value},{default:A(()=>[me(Ri,F(o.$attrs,{ref:m(n),as:o.as,"as-child":o.asChild}),{default:A(()=>[P(o.$slots,"default")]),_:3},16,["as","as-child"])]),_:3},8,["present"])):Nt("",!0)}}}),pn=D({__name:"DialogClose",props:{asChild:{type:Boolean},as:{default:"button"}},setup(e){const t=e;$();const n=ne();return(o,i)=>(B(),T(m(X),F(t,{type:o.as==="button"?"button":void 0,onClick:i[0]||(i[0]=r=>m(n).onOpenChange(!1))}),{default:A(()=>[P(o.$slots,"default")]),_:3},16,["type"]))}}),Si=D({__name:"DialogTitle",props:{asChild:{type:Boolean},as:{default:"h2"}},setup(e){const t=e,n=ne();return $(),(o,i)=>(B(),T(m(X),F(t,{id:m(n).titleId}),{default:A(()=>[P(o.$slots,"default")]),_:3},16,["id"]))}}),Mi=D({__name:"DialogDescription",props:{asChild:{type:Boolean},as:{default:"p"}},setup(e){const t=e;$();const n=ne();return(o,i)=>(B(),T(m(X),F(t,{id:m(n).descriptionId}),{default:A(()=>[P(o.$slots,"default")]),_:3},16,["id"]))}}),ir=D({__name:"AlertDialogRoot",props:{open:{type:Boolean},defaultOpen:{type:Boolean}},emits:["update:open"],setup(e,{emit:t}){const n=sn(e,t);return $(),(o,i)=>(B(),T(m(vi),F(m(n),{modal:!0}),{default:A(()=>[P(o.$slots,"default")]),_:3},16))}}),rr=D({__name:"AlertDialogPortal",props:{to:{},disabled:{type:Boolean},forceMount:{type:Boolean}},setup(e){const t=e;return(n,o)=>(B(),T(m(wt),de(fe(t)),{default:A(()=>[P(n.$slots,"default")]),_:3},16))}}),[Li,Fi]=be("AlertDialogContent"),lr=D({__name:"AlertDialogContent",props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const n=e,o=Se(t);$();const i=E();return Fi({onCancelElementChange:r=>{i.value=r}}),(r,l)=>(B(),T(m(Ti),F({...n,...m(o)},{role:"alertdialog",onPointerDownOutside:l[0]||(l[0]=Ze(()=>{},["prevent"])),onInteractOutside:l[1]||(l[1]=Ze(()=>{},["prevent"])),onOpenAutoFocus:l[2]||(l[2]=()=>{he(()=>{var s;(s=i.value)==null||s.focus({preventScroll:!0})})})}),{default:A(()=>[P(r.$slots,"default")]),_:3},16))}}),sr=D({__name:"AlertDialogOverlay",props:{forceMount:{type:Boolean},asChild:{type:Boolean},as:{}},setup(e){const t=e;return $(),(n,o)=>(B(),T(m($i),de(fe(t)),{default:A(()=>[P(n.$slots,"default")]),_:3},16))}}),ar=D({__name:"AlertDialogCancel",props:{asChild:{type:Boolean},as:{default:"button"}},setup(e){const t=e,n=Li(),{forwardRef:o,currentElement:i}=$();return De(()=>{n.onCancelElementChange(i.value)}),(r,l)=>(B(),T(m(pn),F(t,{ref:m(o)}),{default:A(()=>[P(r.$slots,"default")]),_:3},16))}}),ur=D({__name:"AlertDialogTitle",props:{asChild:{type:Boolean},as:{default:"h2"}},setup(e){const t=e;return $(),(n,o)=>(B(),T(m(Si),de(fe(t)),{default:A(()=>[P(n.$slots,"default")]),_:3},16))}}),cr=D({__name:"AlertDialogDescription",props:{asChild:{type:Boolean},as:{default:"p"}},setup(e){const t=e;return $(),(n,o)=>(B(),T(m(Mi),de(fe(t)),{default:A(()=>[P(n.$slots,"default")]),_:3},16))}}),dr=D({__name:"AlertDialogAction",props:{asChild:{type:Boolean},as:{default:"button"}},setup(e){const t=e;return $(),(n,o)=>(B(),T(m(pn),de(fe(t)),{default:A(()=>[P(n.$slots,"default")]),_:3},16))}}),[vn,Ni]=be("PopperRoot"),ki=D({inheritAttrs:!1,__name:"PopperRoot",setup(e){const t=E();return Ni({anchor:t,onAnchorChange:n=>t.value=n}),(n,o)=>P(n.$slots,"default")}}),Ii=D({__name:"PopperAnchor",props:{element:{},asChild:{type:Boolean},as:{}},setup(e){const t=e,{forwardRef:n,currentElement:o}=$(),i=vn();return K(()=>{i.onAnchorChange(t.element??o.value)}),(r,l)=>(B(),T(m(X),{ref:m(n),as:r.as,"as-child":r.asChild},{default:A(()=>[P(r.$slots,"default")]),_:3},8,["as","as-child"]))}});function Wi(e){return e!==null}function Hi(e){return{name:"transformOrigin",options:e,fn(t){var n,o,i;const{placement:r,rects:l,middlewareData:s}=t,d=((n=s.arrow)==null?void 0:n.centerOffset)!==0,c=d?0:e.arrowWidth,a=d?0:e.arrowHeight,[u,p]=rt(r),f={start:"0%",center:"50%",end:"100%"}[p],v=(((o=s.arrow)==null?void 0:o.x)??0)+c/2,h=(((i=s.arrow)==null?void 0:i.y)??0)+a/2;let g="",y="";return u==="bottom"?(g=d?f:`${v}px`,y=`${-a}px`):u==="top"?(g=d?f:`${v}px`,y=`${l.floating.height+a}px`):u==="right"?(g=`${-a}px`,y=d?f:`${h}px`):u==="left"&&(g=`${l.floating.width+a}px`,y=d?f:`${h}px`),{data:{x:g,y}}}}}function rt(e){const[t,n="center"]=e.split("-");return[t,n]}const Vi={side:"bottom",sideOffset:0,align:"center",alignOffset:0,arrowPadding:0,avoidCollisions:!0,collisionBoundary:()=>[],collisionPadding:0,sticky:"partial",hideWhenDetached:!1,updatePositionStrategy:"optimized",prioritizePosition:!1},[ji,zi]=be("PopperContent"),Ki=D({inheritAttrs:!1,__name:"PopperContent",props:Tn({side:{},sideOffset:{},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},updatePositionStrategy:{},prioritizePosition:{type:Boolean},asChild:{type:Boolean},as:{}},{...Vi}),emits:["placed"],setup(e,{emit:t}){const n=e,o=t,i=vn(),{forwardRef:r,currentElement:l}=$(),s=E(),d=E(),{width:c,height:a}=ui(d),u=O(()=>n.side+(n.align!=="center"?`-${n.align}`:"")),p=O(()=>typeof n.collisionPadding=="number"?n.collisionPadding:{top:0,right:0,bottom:0,left:0,...n.collisionPadding}),f=O(()=>Array.isArray(n.collisionBoundary)?n.collisionBoundary:[n.collisionBoundary]),v=O(()=>({padding:p.value,boundary:f.value.filter(Wi),altBoundary:f.value.length>0})),h=Po(()=>[ho({mainAxis:n.sideOffset+a.value,alignmentAxis:n.alignOffset}),n.prioritizePosition&&n.avoidCollisions&&_t({...v.value}),n.avoidCollisions&&yo({mainAxis:!0,crossAxis:!!n.prioritizePosition,limiter:n.sticky==="partial"?Oo():void 0,...v.value}),!n.prioritizePosition&&n.avoidCollisions&&_t({...v.value}),wo({...v.value,apply:({elements:R,rects:z,availableWidth:k,availableHeight:W})=>{const{width:L,height:oe}=z.reference,I=R.floating.style;I.setProperty("--radix-popper-available-width",`${k}px`),I.setProperty("--radix-popper-available-height",`${W}px`),I.setProperty("--radix-popper-anchor-width",`${L}px`),I.setProperty("--radix-popper-anchor-height",`${oe}px`)}}),d.value&&Eo({element:d.value,padding:n.arrowPadding}),Hi({arrowWidth:c.value,arrowHeight:a.value}),n.hideWhenDetached&&bo({strategy:"referenceHidden",...v.value})]),{floatingStyles:g,placement:y,isPositioned:b,middlewareData:w}=Do(i.anchor,s,{strategy:"fixed",placement:u,whileElementsMounted:(...R)=>go(...R,{animationFrame:n.updatePositionStrategy==="always"}),middleware:h}),C=O(()=>rt(y.value)[0]),x=O(()=>rt(y.value)[1]);Rn(()=>{b.value&&o("placed")});const S=O(()=>{var R;return((R=w.value.arrow)==null?void 0:R.centerOffset)!==0}),_=E("");K(()=>{l.value&&(_.value=window.getComputedStyle(l.value).zIndex)});const M=O(()=>{var R;return((R=w.value.arrow)==null?void 0:R.x)??0}),N=O(()=>{var R;return((R=w.value.arrow)==null?void 0:R.y)??0});return zi({placedSide:C,onArrowChange:R=>d.value=R,arrowX:M,arrowY:N,shouldHideArrow:S}),(R,z)=>{var k,W,L;return B(),Vt("div",{ref_key:"floatingRef",ref:s,"data-radix-popper-content-wrapper":"",style:st({...m(g),transform:m(b)?m(g).transform:"translate(0, -200%)",minWidth:"max-content",zIndex:_.value,"--radix-popper-transform-origin":[(k=m(w).transformOrigin)==null?void 0:k.x,(W=m(w).transformOrigin)==null?void 0:W.y].join(" "),...((L=m(w).hide)==null?void 0:L.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}})},[me(m(X),F({ref:m(r)},R.$attrs,{"as-child":n.asChild,as:R.as,"data-side":C.value,"data-align":x.value,style:{animation:m(b)?void 0:"none"}}),{default:A(()=>[P(R.$slots,"default")]),_:3},16,["as-child","as","data-side","data-align","style"])],4)}}}),Ui=$n("polygon",{points:"0,0 30,0 15,10"},null,-1),Yi=D({__name:"Arrow",props:{width:{default:10},height:{default:5},asChild:{type:Boolean},as:{default:"svg"}},setup(e){const t=e;return $(),(n,o)=>(B(),T(m(X),F(t,{width:n.width,height:n.height,viewBox:n.asChild?void 0:"0 0 30 10",preserveAspectRatio:n.asChild?void 0:"none"}),{default:A(()=>[P(n.$slots,"default",{},()=>[Ui])]),_:3},16,["width","height","viewBox","preserveAspectRatio"]))}}),Xi={top:"bottom",right:"left",bottom:"top",left:"right"},qi=D({inheritAttrs:!1,__name:"PopperArrow",props:{width:{},height:{},asChild:{type:Boolean},as:{default:"svg"}},setup(e){const{forwardRef:t}=$(),n=ji(),o=O(()=>Xi[n.placedSide.value]);return(i,r)=>{var l,s,d,c;return B(),Vt("span",{ref:a=>{m(n).onArrowChange(a)},style:st({position:"absolute",left:(l=m(n).arrowX)!=null&&l.value?`${(s=m(n).arrowX)==null?void 0:s.value}px`:void 0,top:(d=m(n).arrowY)!=null&&d.value?`${(c=m(n).arrowY)==null?void 0:c.value}px`:void 0,[o.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})},[me(Yi,F(i.$attrs,{ref:m(t),style:{display:"block"},as:i.as,"as-child":i.asChild,width:i.width,height:i.height}),{default:A(()=>[P(i.$slots,"default")]),_:3},16,["as","as-child","width","height"])],4)}}}),Gi=D({__name:"VisuallyHidden",props:{asChild:{type:Boolean},as:{default:"span"}},setup(e){return $(),(t,n)=>(B(),T(m(X),{as:t.as,"as-child":t.asChild,style:{position:"absolute",border:0,width:"1px",display:"inline-block",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}},{default:A(()=>[P(t.$slots,"default")]),_:3},8,["as","as-child"]))}});function Ji(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}Ji();const mn="tooltip.open",[bt,Zi]=be("TooltipProvider"),fr=D({inheritAttrs:!1,__name:"TooltipProvider",props:{delayDuration:{default:700},skipDelayDuration:{default:300},disableHoverableContent:{type:Boolean,default:!1},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean,default:!1}},setup(e){const t=e,{delayDuration:n,skipDelayDuration:o,disableHoverableContent:i,disableClosingTrigger:r,ignoreNonKeyboardFocus:l,disabled:s}=lt(t);$();const d=E(!0),c=E(!1),{start:a,stop:u}=tn(()=>{d.value=!0},o,{immediate:!1});return Zi({isOpenDelayed:d,delayDuration:n,onOpen(){u(),d.value=!1},onClose(){a()},isPointerInTransitRef:c,disableHoverableContent:i,disableClosingTrigger:r,disabled:s,ignoreNonKeyboardFocus:l}),(p,f)=>P(p.$slots,"default")}}),[Ue,Qi]=be("TooltipRoot"),pr=D({__name:"TooltipRoot",props:{defaultOpen:{type:Boolean,default:!1},open:{type:Boolean,default:void 0},delayDuration:{default:void 0},disableHoverableContent:{type:Boolean,default:void 0},disableClosingTrigger:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},ignoreNonKeyboardFocus:{type:Boolean,default:void 0}},emits:["update:open"],setup(e,{emit:t}){const n=e,o=t;$();const i=bt(),r=O(()=>n.disableHoverableContent??i.disableHoverableContent.value),l=O(()=>n.disableClosingTrigger??i.disableClosingTrigger.value),s=O(()=>n.disabled??i.disabled.value),d=O(()=>n.delayDuration??i.delayDuration.value),c=O(()=>n.ignoreNonKeyboardFocus??i.ignoreNonKeyboardFocus.value),a=nn(n,"open",o,{defaultValue:n.defaultOpen,passive:n.open===void 0});j(a,w=>{i.onClose&&(w?(i.onOpen(),document.dispatchEvent(new CustomEvent(mn))):i.onClose())});const u=E(!1),p=E(),f=O(()=>a.value?u.value?"delayed-open":"instant-open":"closed"),{start:v,stop:h}=tn(()=>{u.value=!0,a.value=!0},d,{immediate:!1});function g(){h(),u.value=!1,a.value=!0}function y(){h(),a.value=!1}function b(){v()}return Qi({contentId:"",open:a,stateAttribute:f,trigger:p,onTriggerChange(w){p.value=w},onTriggerEnter(){i.isOpenDelayed.value?b():g()},onTriggerLeave(){r.value?y():h()},onOpen:g,onClose:y,disableHoverableContent:r,disableClosingTrigger:l,disabled:s,ignoreNonKeyboardFocus:c}),(w,C)=>(B(),T(m(ki),null,{default:A(()=>[P(w.$slots,"default",{open:m(a)})]),_:3}))}}),vr=D({__name:"TooltipTrigger",props:{asChild:{type:Boolean},as:{default:"button"}},setup(e){const t=e,n=Ue(),o=bt();n.contentId||(n.contentId=it(void 0,"radix-vue-tooltip-content"));const{forwardRef:i,currentElement:r}=$(),l=E(!1),s=E(!1),d=O(()=>n.disabled.value?{}:{click:h,focus:f,pointermove:u,pointerleave:p,pointerdown:a,blur:v});De(()=>{n.onTriggerChange(r.value)});function c(){setTimeout(()=>{l.value=!1},1)}function a(){l.value=!0,document.addEventListener("pointerup",c,{once:!0})}function u(g){g.pointerType!=="touch"&&!s.value&&!o.isPointerInTransitRef.value&&(n.onTriggerEnter(),s.value=!0)}function p(){n.onTriggerLeave(),s.value=!1}function f(g){var y,b;l.value||n.ignoreNonKeyboardFocus.value&&!((b=(y=g.target).matches)!=null&&b.call(y,":focus-visible"))||n.onOpen()}function v(){n.onClose()}function h(){n.disableClosingTrigger.value||n.onClose()}return(g,y)=>(B(),T(m(Ii),{"as-child":""},{default:A(()=>[me(m(X),F({ref:m(i),"aria-describedby":m(n).open.value?m(n).contentId:void 0,"data-state":m(n).stateAttribute.value,as:g.as,"as-child":t.asChild,"data-grace-area-trigger":""},xn(d.value)),{default:A(()=>[P(g.$slots,"default")]),_:3},16,["aria-describedby","data-state","as","as-child"])]),_:3}))}}),gn=D({__name:"TooltipContentImpl",props:{ariaLabel:{},asChild:{type:Boolean},as:{},side:{default:"top"},sideOffset:{default:0},align:{default:"center"},alignOffset:{},avoidCollisions:{type:Boolean,default:!0},collisionBoundary:{default:()=>[]},collisionPadding:{default:0},arrowPadding:{default:0},sticky:{default:"partial"},hideWhenDetached:{type:Boolean,default:!1}},emits:["escapeKeyDown","pointerDownOutside"],setup(e,{emit:t}){const n=e,o=t,i=Ue(),{forwardRef:r}=$(),l=Dn(),s=O(()=>{var a;return(a=l.default)==null?void 0:a.call(l)}),d=O(()=>{var a;if(n.ariaLabel)return n.ariaLabel;let u="";function p(f){typeof f.children=="string"&&f.type!==Wt?u+=f.children:Array.isArray(f.children)&&f.children.forEach(v=>p(v))}return(a=s.value)==null||a.forEach(f=>p(f)),u}),c=O(()=>{const{ariaLabel:a,...u}=n;return u});return De(()=>{Ve(window,"scroll",a=>{const u=a.target;u!=null&&u.contains(i.trigger.value)&&i.onClose()}),Ve(window,mn,i.onClose)}),(a,u)=>(B(),T(m(cn),{"as-child":"","disable-outside-pointer-events":!1,onEscapeKeyDown:u[0]||(u[0]=p=>o("escapeKeyDown",p)),onPointerDownOutside:u[1]||(u[1]=p=>{var f;m(i).disableClosingTrigger.value&&(f=m(i).trigger.value)!=null&&f.contains(p.target)&&p.preventDefault(),o("pointerDownOutside",p)}),onFocusOutside:u[2]||(u[2]=Ze(()=>{},["prevent"])),onDismiss:u[3]||(u[3]=p=>m(i).onClose())},{default:A(()=>[me(m(Ki),F({ref:m(r),"data-state":m(i).stateAttribute.value},{...a.$attrs,...c.value},{style:{"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"}}),{default:A(()=>[P(a.$slots,"default"),me(m(Gi),{id:m(i).contentId,role:"tooltip"},{default:A(()=>[Pn(_n(d.value),1)]),_:1},8,["id"])]),_:3},16,["data-state"])]),_:3}))}}),er=D({__name:"TooltipContentHoverable",props:{ariaLabel:{},asChild:{type:Boolean},as:{},side:{},sideOffset:{},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean}},setup(e){const t=ln(e),{forwardRef:n,currentElement:o}=$(),{trigger:i,onClose:r}=Ue(),l=bt(),{isPointerInTransit:s,onPointerExit:d}=Go(i,o);return l.isPointerInTransitRef=s,d(()=>{r()}),(c,a)=>(B(),T(gn,F({ref:m(n)},m(t)),{default:A(()=>[P(c.$slots,"default")]),_:3},16))}}),mr=D({__name:"TooltipContent",props:{forceMount:{type:Boolean},ariaLabel:{},asChild:{type:Boolean},as:{},side:{default:"top"},sideOffset:{},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean}},emits:["escapeKeyDown","pointerDownOutside"],setup(e,{emit:t}){const n=e,o=t,i=Ue(),r=sn(n,o),{forwardRef:l}=$();return(s,d)=>(B(),T(m(yt),{present:s.forceMount||m(i).open.value},{default:A(()=>[(B(),T(On(m(i).disableHoverableContent.value?gn:er),F({ref:m(l)},m(r)),{default:A(()=>[P(s.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),gr=D({__name:"TooltipArrow",props:{width:{default:10},height:{default:5},asChild:{type:Boolean},as:{default:"svg"}},setup(e){const t=e;return $(),(n,o)=>(B(),T(m(qi),de(fe(t)),{default:A(()=>[P(n.$slots,"default")]),_:3},16))}}),hr=D({__name:"TooltipPortal",props:{to:{},disabled:{type:Boolean},forceMount:{type:Boolean}},setup(e){const t=e;return(n,o)=>(B(),T(m(wt),de(fe(t)),{default:A(()=>[P(n.$slots,"default")]),_:3},16))}});export{$i as $,rr as A,Si as B,cr as F,gr as G,fr as H,or as I,ar as M,dr as N,lr as O,Ti as P,ir as T,mr as U,ur as V,pr as W,vr as j,sr as k,vi as n,hr as q}; diff --git a/assets/index-BtU1L1YB.js b/assets/index-BtU1L1YB.js deleted file mode 100644 index 8756e025bc03883b9fdeab0bfacf918f3e0f194b..0000000000000000000000000000000000000000 --- a/assets/index-BtU1L1YB.js +++ /dev/null @@ -1 +0,0 @@ -import{d as i,bz as n,G as r,o as a,c as s,a as c}from"./index-D3pfQUMu.js";import{b as t}from"./route-block-B_A1xBdJ.js";const 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,y:15},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":"",flex:"","items-center":"","justify-center":""},d=i({__name:"index",setup(m){return(p,e)=>{const o=n("motion");return r((a(),s("div",l,e[0]||(e[0]=[c("div",{text:"60","i-solar:leaf-bold-duotone":""},null,-1)]))),[[o]])}}});typeof t=="function"&&t(d);export{d as default}; diff --git a/assets/index-Bx6crezv.js b/assets/index-Bx6crezv.js deleted file mode 100644 index f054a94008c272a1fac48d4ec1b181934aa59be7..0000000000000000000000000000000000000000 --- a/assets/index-Bx6crezv.js +++ /dev/null @@ -1 +0,0 @@ -import{d as A,bK as S,bL as _,c as r,o,G as a,a as e,b as c,H as V,bN as h,i as H,t as u,E as g,F as x,bE as U,D as M,bF as N,k as O,r as j,w as P,bz as z,m as f,ag as L,u as i,bJ as R,bH as I,bA as k,bB as q,bq as G}from"./index-D3pfQUMu.js";import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-t8bgqiA6.js";import"./three-vrm-animation.module-DLbUhddZ.js";import"./emotions-CAex_2dA.js";/* empty css */import{_ as C,a as J}from"./ColorPalette.vue_vue_type_script_setup_true_lang-BEcLR9qj.js";import{b as D}from"./route-block-B_A1xBdJ.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-DDNOeGH3.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-D_DUmSTM.js";import"./index-BZFiQ_k-.js";const K={class:"w-full flex cursor-pointer items-center justify-between rounded-lg px-4 py-3 text-sm outline-none transition-all duration-250 ease-in-out",bg:"neutral-50 dark:neutral-800",hover:"bg-neutral-200 dark:bg-neutral-700"},Q=["aria-checked"],W={key:0,text:"sm neutral-500"},B=A({__name:"CheckBar",props:S({text:null,iconOn:null,iconOff:null,description:null},{modelValue:{type:Boolean},modelModifiers:{}}),emits:["update:modelValue"],setup(p){const n=_(p,"modelValue");return(y,m)=>(o(),r("label",K,[a(e("input",{"onUpdate:modelValue":m[0]||(m[0]=v=>n.value=v),"aria-checked":n.value,type:"checkbox",hidden:""},null,8,Q),[[V,n.value]]),e("div",null,[h(u(y.$t(p.text))+" ",1),p.description?(o(),r("div",W,u(y.$t(p.description)),1)):H("",!0)]),c(U,{name:"slide-away",mode:"out-in"},{default:g(()=>[n.value?(o(),r("div",{key:0,class:x(p.iconOn),transition:"all ease-in-out duration-250"},null,2)):(o(),r("div",{key:1,class:x(p.iconOff),transition:"all ease-in-out duration-250"},null,2))]),_:1})]))}}),X=[[],["#A5978B","#D8CAAF","#B8B4A7","#C4BCB1","#E5DED8","#9A8F7D","#BEB5A7","#C9C0B6"],["#7A9EAF","#B8C7CC","#D4B79C","#8B9D77","#C7D5CB","#E6D0B1","#94A7B1","#B4C8C3"],["#D9B48F","#B5917A","#8C7A6B","#A17F5F","#B98C46","#C7A252","#DAB300","#D19826"],["#9BA7B0","#C1CBD4","#A5ADB6","#8B959E","#D4DCE4","#7F8A94","#B3BCC6","#98A4AE"],["#E4C6D0","#A61B29","#5D513C","#789262","#1C0D1A","#F7C242","#62A9DD","#8C4B3C"]],Y={class:"w-full flex items-center justify-between rounded-lg px-4 py-3 text-sm outline-none transition-all duration-250 ease-in-out",bg:"neutral-50 dark:neutral-800",hover:"bg-neutral-200 dark:bg-neutral-700",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+3*10,delay:3*50,transition:"all ease-in-out duration-250"},Z={value:"en-US"},ee={value:"zh-CN"},te={flex:"","items-center":"","justify-between":"",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+5*10,delay:5*50,transition:"all ease-in-out duration-250"},ie={"text-lg":"","font-semibold":""},ne={relative:"",flex:"","cursor-pointer":"","items-center":"","gap-2":""},ae=["disabled"],oe={class:"color-bar",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+7*10,delay:7*50,transition:"all ease-in-out duration-250"},se={"text-white":"",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+8*10,delay:8*50,transition:"all ease-in-out duration-250"},le={class:"color-bar transparency-grid",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+9*10,delay:9*50,transition:"all ease-in-out duration-250"},re=["duration","delay"],de={"font-medium":""},ue={text:"sm neutral-500"},pe={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":""},w=A({__name:"index",setup(p){const n=M(),y=N(),{t:m}=O(),v=j(!1);return P(()=>[n.usePageSpecificTransitions,n.disableTransitions],()=>{v.value=!0}),(d,t)=>{const s=z("motion");return o(),r(k,null,[a((o(),f(i(C),{title:i(m)("settings.sections.section.general.title"),icon:"i-solar:filters-bold-duotone",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+1*10,delay:1*50,transition:"all ease-in-out duration-250"},{default:g(()=>[a(c(B,{modelValue:i(y),"onUpdate:modelValue":t[0]||(t[0]=l=>L(y)?y.value=l:null),initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+2*10,delay:2*50,"icon-on":"i-solar:moon-stars-bold-duotone","icon-off":"i-solar:sun-fog-bold-duotone",text:"settings.theme",transition:"all ease-in-out duration-250"},null,8,["modelValue"]),[[s]]),a((o(),r("div",Y,[h(u(d.$t("settings.language.title"))+" ",1),a(e("select",{"onUpdate:modelValue":t[1]||(t[1]=l=>i(n).language=l),transition:"all ease-in-out duration-250","cursor-pointer":"","bg-transparent":"","text-right":"","outline-none":""},[e("option",Z,u(d.$t("settings.language.english")),1),e("option",ee,u(d.$t("settings.language.chinese")),1)],512),[[R,i(n).language]])])),[[s]])]),_:1},8,["title"])),[[s]]),a((o(),f(i(C),{title:i(m)("settings.pages.themes.sections.section.custom-color.title"),icon:"i-solar:pallete-2-bold-duotone",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+4*10,delay:4*50,transition:"all ease-in-out duration-250"},{default:g(()=>[a((o(),r("div",te,[e("span",ie,u(d.$t("settings.pages.themes.sections.section.custom-color.fields.field.primary-color.label")),1),e("label",ne,[a(e("input",{"onUpdate:modelValue":t[2]||(t[2]=l=>i(n).themeColorsHueDynamic=l),type:"checkbox",class:"peer sr-only"},null,512),[[V,i(n).themeColorsHueDynamic]]),t[6]||(t[6]=e("div",{class:"peer-checked:bg-primary-500 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 after:transition-all after:content-[''] peer-checked:after:translate-x-full peer-checked:after:border-white"},null,-1)),h(" "+u(d.$t("settings.pages.themes.sections.section.custom-color.fields.field.primary-color.rgb-on.title")),1)])])),[[s]]),a(e("input",{"onUpdate:modelValue":t[3]||(t[3]=l=>i(n).themeColorsHue=l),initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+6*10,delay:6*50,transition:"all ease-in-out duration-250",type:"range",min:"0",max:"360",step:"0.01",class:x(["theme-hue-slider",i(n).themeColorsHueDynamic?"opacity-25 cursor-not-allowed":"cursor-pointer"]),disabled:i(n).themeColorsHueDynamic},null,10,ae),[[I,i(n).themeColorsHue],[s]]),a((o(),r("div",oe,[t[8]||(t[8]=e("span",{"bg-primary-50":""},"50",-1)),t[9]||(t[9]=e("span",{"bg-primary-100":""},"100",-1)),t[10]||(t[10]=e("span",{"bg-primary-200":""},"200",-1)),t[11]||(t[11]=e("span",{"bg-primary-300":""},"300",-1)),t[12]||(t[12]=e("span",{"bg-primary-400":""},"400",-1)),t[13]||(t[13]=e("span",{"bg-primary-500":""},"500",-1)),a((o(),r("div",se,t[7]||(t[7]=[e("span",{"bg-primary-600":""},"600",-1),e("span",{"bg-primary-700":""},"700",-1),e("span",{"bg-primary-800":""},"800",-1),e("span",{"bg-primary-900":""},"900",-1),e("span",{"bg-primary-950":""},"950",-1)]))),[[s]])])),[[s]]),a((o(),r("div",le,t[14]||(t[14]=[e("span",{bg:"primary-500/5"},"500/5",-1),e("span",{bg:"primary-500/10"},"500/10",-1),e("span",{bg:"primary-500/20"},"500/20",-1),e("span",{bg:"primary-500/30"},"500/30",-1),e("span",{bg:"primary-500/40"},"500/40",-1),e("span",{bg:"primary-500/50"},"500/50",-1),e("span",{bg:"primary-500/60"},"500/60",-1),e("span",{bg:"primary-500/70"},"500/70",-1),e("span",{bg:"primary-500/80"},"500/80",-1),e("span",{bg:"primary-500/90"},"500/90",-1),e("span",{bg:"primary-500"},"500",-1)]))),[[s]])]),_:1},8,["title"])),[[s]]),a((o(),f(i(C),{title:"settings.pages.themes.sections.section.theme-presets.title",icon:"i-solar:magic-stick-2-bold-duotone",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+10*10,delay:10*50,transition:"all ease-in-out duration-250"},{default:g(()=>[(o(!0),r(k,null,q(d.$tm("settings.pages.themes.sections.section.theme-presets.presets"),({title:l,description:$,colors:E},b)=>a((o(),r("div",{key:b,class:"w-full flex items-center justify-between rounded-lg px-4 py-3 outline-none transition-all duration-250 ease-in-out",bg:"neutral-100 dark:neutral-800",hover:"bg-neutral-200 dark:bg-neutral-700",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+11*10+b*10,delay:11*50+b*50,transition:"all ease-in-out duration-250"},[e("div",null,[e("span",de,u(d.$rt(l)),1),e("div",ue,u(d.$rt($)),1)]),c(J,{colors:E.map((T,F)=>({hex:i(X)[b][F],name:d.$rt(T)}))},null,8,["colors"])],8,re)),[[s]])),128))]),_:1})),[[s]]),a((o(),f(i(C),{title:"settings.pages.themes.sections.section.developer.title",icon:"i-solar:code-bold-duotone",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+18*10,delay:18*50,transition:"all ease-in-out duration-250"},{default:g(()=>[a(c(B,{modelValue:i(n).disableTransitions,"onUpdate:modelValue":t[4]||(t[4]=l=>i(n).disableTransitions=l),"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:250+19*10,delay:19*50,transition:"all ease-in-out duration-250"},null,8,["modelValue"]),[[s]]),a(c(B,{modelValue:i(n).usePageSpecificTransitions,"onUpdate:modelValue":t[5]||(t[5]=l=>i(n).usePageSpecificTransitions=l),disabled:i(n).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:250+20*10,delay:20*50,transition:"all ease-in-out duration-250"},null,8,["modelValue","disabled"]),[[s]])]),_:1})),[[s]]),a((o(),r("div",pe,t[15]||(t[15]=[e("div",{text:"60","i-solar:filters-bold-duotone":""},null,-1)]))),[[s]])],64)}}});typeof D=="function"&&D(w);const xe=G(w,[["__scopeId","data-v-0edbb762"]]);export{xe as default}; diff --git a/assets/index-CISelA4u.js b/assets/index-CISelA4u.js new file mode 100644 index 0000000000000000000000000000000000000000..ee830a93c3a5fde5b8f0e8315cab89e793a1d055 --- /dev/null +++ b/assets/index-CISelA4u.js @@ -0,0 +1 @@ +import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-B6whjTNv.js";import{d as h,g as v,h as b,K as k,c as t,o as i,e as c,A as d,x as m,F as l,l as x,b as s}from"./index-BNq7Hbz_.js";import"./three-vrm-animation.module-BPuMi1if.js";import"./mcp-D2taTyhO.js";import"./mini_xsschema-P_8cZcRg.js";import{I as _}from"./IconStatusItem-CqRKpLO4.js";/* empty css */import{_ as I}from"./IconAnimation.vue_vue_type_script_setup_true_lang-D-TDNw-F.js";import{u as z}from"./useIconAnimation-CpaNr068.js";import{b as g}from"./route-block-B_A1xBdJ.js";const A={grid:"~ cols-1 sm:cols-2 gap-4"},B={key:1,text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[calc(100dvh-15rem)]","bottom-0":"","right--5":"","z--1":"",initial:{scale:.9,opacity:0,y:20},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":"",flex:"","items-center":"","justify-center":""},w=h({__name:"index",setup(C){const{t:e}=v(),p=b(()=>[{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:!1},{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:!1},{id:"hearing",name:e("settings.pages.modules.hearing.title"),description:e("settings.pages.modules.hearing.description"),icon:"i-solar:microphone-3-bold-duotone",to:"",configured:!1},{id:"vision",name:e("settings.pages.modules.vision.title"),description:e("settings.pages.modules.vision.description"),icon:"i-solar:eye-closed-bold-duotone",to:"",configured:!1},{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},{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},{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:"",configured:!1},{id:"x",name:e("settings.pages.modules.x.title"),description:e("settings.pages.modules.x.description"),icon:"i-simple-icons:x",to:"",configured:!1},{id:"game-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:"",configured:!1},{id:"game-factorio",name:e("settings.pages.modules.gaming-factorio.title"),description:e("settings.pages.modules.gaming-factorio.description"),iconImage:"",to:"",configured:!1}]),{iconAnimationStarted:u,showIconAnimation:f,animationIcon:y}=z("i-solar:layers-bold-duotone");return(D,n)=>{const r=k("motion");return i(),t(l,null,[c("div",A,[(i(!0),t(l,null,x(p.value,(o,a)=>m((i(),d(s(_),{key:o.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+a*10,delay:a*50,title:o.name,description:o.description,icon:o.icon,"icon-color":o.iconColor,"icon-image":o.iconImage,to:o.to,configured:o.configured},null,8,["duration","delay","title","description","icon","icon-color","icon-image","to","configured"])),[[r]])),128))]),s(f)?(i(),d(I,{key:0,icon:s(y),"icon-size":12,duration:1e3,started:s(u),"is-reverse":!0,"z-index":-1,"text-color":"text-neutral-200/50 dark:text-neutral-600/20",position:"calc(100dvw - 9.5rem), calc(100dvh - 9.5rem)"},null,8,["icon","started"])):m((i(),t("div",B,n[0]||(n[0]=[c("div",{text:"60","i-solar:layers-bold-duotone":""},null,-1)]))),[[r]])],64)}}});typeof g=="function"&&g(w);export{w as default}; diff --git a/assets/index-CShXCEpO.js b/assets/index-CShXCEpO.js new file mode 100644 index 0000000000000000000000000000000000000000..571532c7d4ec085b27c0778895deb6ca2e0b99e6 --- /dev/null +++ b/assets/index-CShXCEpO.js @@ -0,0 +1 @@ +function f(e,r,t){return typeof e.default=="function"?e.default(r,t):e.default}function s(e,r){switch(r==null?void 0:r.errorMode){case"ignore":break;case"warn":{console.warn(e);break}default:throw new Error(e)}}function k(e,r,t){switch(r.type){case"base64":{e.contentEncoding="base64";break}case"bic":case"cuid2":case"decimal":case"digits":case"emoji":case"hexadecimal":case"hex_color":case"nanoid":case"octal":case"ulid":{e.pattern=r.requirement.source;break}case"description":{e.description=r.description;break}case"email":{e.format="email";break}case"empty":{e.type==="array"?e.maxItems=0:(e.type!=="string"&&s(`The "${r.type}" action is not supported on type "${e.type}".`,t),e.maxLength=0);break}case"integer":{e.type="integer";break}case"ipv4":{e.format="ipv4";break}case"ipv6":{e.format="ipv6";break}case"iso_date":{e.format="date";break}case"iso_date_time":case"iso_timestamp":{e.format="date-time";break}case"iso_time":{e.format="time";break}case"length":{e.type==="array"?(e.minItems=r.requirement,e.maxItems=r.requirement):(e.type!=="string"&&s(`The "${r.type}" action is not supported on type "${e.type}".`,t),e.minLength=r.requirement,e.maxLength=r.requirement);break}case"max_length":{e.type==="array"?e.maxItems=r.requirement:(e.type!=="string"&&s(`The "${r.type}" action is not supported on type "${e.type}".`,t),e.maxLength=r.requirement);break}case"max_value":{e.type!=="number"&&s(`The "max_value" action is not supported on type "${e.type}".`,t),e.maximum=r.requirement;break}case"min_length":{e.type==="array"?e.minItems=r.requirement:(e.type!=="string"&&s(`The "${r.type}" action is not supported on type "${e.type}".`,t),e.minLength=r.requirement);break}case"min_value":{e.type!=="number"&&s(`The "min_value" action is not supported on type "${e.type}".`,t),e.minimum=r.requirement;break}case"multiple_of":{e.multipleOf=r.requirement;break}case"non_empty":{e.type==="array"?e.minItems=1:(e.type!=="string"&&s(`The "${r.type}" action is not supported on type "${e.type}".`,t),e.minLength=1);break}case"regex":{r.requirement.flags&&s("RegExp flags are not supported by JSON Schema.",t),e.pattern=r.requirement.source;break}case"title":{e.title=r.title;break}case"url":{e.format="uri";break}case"uuid":{e.format="uuid";break}case"value":{e.const=r.requirement;break}default:s(`The "${r.type}" action cannot be converted to JSON Schema.`,t)}return e}var l=0;function u(e,r,t,i){const d=i.referenceMap.get(r);if(d&&d in i.definitions)return e.$ref=`#/$defs/${d}`,e;if("pipe"in r){for(let p=0;p0&&s('A "pipe" with multiple schemas cannot be converted to JSON Schema.',t);const y=u({},a,t,i);if(y.$ref){const n=y.$ref.split("/")[2];Object.assign(e,i.definitions[n])}else Object.assign(e,y)}else e=k(e,a,t)}return e}switch(r.type){case"boolean":{e.type="boolean";break}case"null":{e.type="null";break}case"number":{e.type="number";break}case"string":{e.type="string";break}case"array":{e.type="array",e.items=u({},r.item,t,i);break}case"tuple":case"tuple_with_rest":case"loose_tuple":case"strict_tuple":{e.type="array",e.items=[];for(const p of r.items)e.items.push(u({},p,t,i));r.type==="tuple_with_rest"?e.additionalItems=u({},r.rest,t,i):e.additionalItems=r.type==="loose_tuple";break}case"object":case"object_with_rest":case"loose_object":case"strict_object":{e.type="object",e.properties={},e.required=[];for(const p in r.entries){const a=r.entries[p];e.properties[p]=u({},a,t,i),a.type!=="nullish"&&a.type!=="optional"&&e.required.push(p)}r.type==="object_with_rest"?e.additionalProperties=u({},r.rest,t,i):r.type==="strict_object"&&(e.additionalProperties=!1);break}case"record":{"pipe"in r.key&&s('The "record" schema with a schema for the key that contains a "pipe" cannot be converted to JSON Schema.',t),r.key.type!=="string"&&s(`The "record" schema with the "${r.key.type}" schema for the key cannot be converted to JSON Schema.`,t),e.type="object",e.additionalProperties=u({},r.value,t,i);break}case"any":case"unknown":break;case"nullable":case"nullish":{e.anyOf=[u({},r.wrapped,t,i),{type:"null"}],r.default!==void 0&&(e.default=f(r));break}case"exact_optional":case"optional":case"undefinedable":{e=u(e,r.wrapped,t,i),r.default!==void 0&&(e.default=f(r));break}case"literal":{typeof r.literal!="boolean"&&typeof r.literal!="number"&&typeof r.literal!="string"&&s('The value of the "literal" schema is not JSON compatible.',t),e.const=r.literal;break}case"enum":{e.enum=r.options;break}case"picklist":{r.options.some(p=>typeof p!="number"&&typeof p!="string")&&s('An option of the "picklist" schema is not JSON compatible.',t),e.enum=r.options;break}case"union":case"variant":{e.anyOf=r.options.map(p=>u({},p,t,i));break}case"intersect":{e.allOf=r.options.map(p=>u({},p,t,i));break}case"lazy":{let p=i.getterMap.get(r.getter);p||(p=r.getter(void 0),i.getterMap.set(r.getter,p));let a=i.referenceMap.get(p);a||(a=`${l++}`,i.referenceMap.set(p,a),i.definitions[a]=u({},p,t,i)),e.$ref=`#/$defs/${a}`;break}default:s(`The "${r.type}" schema cannot be converted to JSON Schema.`,t)}return e}function _(e,r){const t={definitions:{},referenceMap:new Map,getterMap:new Map};if(r!=null&&r.definitions){for(const d in r.definitions)t.referenceMap.set(r.definitions[d],d);for(const d in r.definitions)t.definitions[d]=u({},r.definitions[d],r,t)}const i=u({$schema:"http://json-schema.org/draft-07/schema#"},e,r,t);return t.referenceMap.size&&(i.$defs=t.definitions),i}export{_ as toJsonSchema}; diff --git a/assets/index-Cr3taKDJ.js b/assets/index-Cr3taKDJ.js deleted file mode 100644 index 18df47e8532dc771f7ef0617bce773da5b5f0e73..0000000000000000000000000000000000000000 --- a/assets/index-Cr3taKDJ.js +++ /dev/null @@ -1 +0,0 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-t8bgqiA6.js";import{d as I,p as E,m as x,o as n,E as A,a as s,c as p,i as w,B as D,t as C,F as q,bq as P,h as R,r,k as L,D as j,l as F,bz as N,G as _,bA as V,bB as G,u as y,q as O,by as H}from"./index-D3pfQUMu.js";import"./three-vrm-animation.module-DLbUhddZ.js";import"./emotions-CAex_2dA.js";/* empty css */import{_ as J}from"./IconAnimation.vue_vue_type_script_setup_true_lang-DtxQmMu9.js";import{b as B}from"./route-block-B_A1xBdJ.js";const K={"z-1":"","flex-1":""},M={"text-lg":"","font-bold":"",class:"menu-icon-item-title",transition:"all ease-in-out duration-400"},Q={text:"sm neutral-500 dark:neutral-400",class:"menu-icon-item-description",transition:"all ease-in-out duration-400"},U=I({__name:"IconItem",props:{title:null,description:null,icon:null,iconTemplate:{type:Boolean},to:null},setup(o){return(m,g)=>{const f=E("RouterLink");return n(),x(f,{box:"border",flex:"~ row",bg:"neutral-50 dark:neutral-900",border:"neutral-100 dark:neutral-800/25 hover:primary-500/30 dark:hover:primary-400/30 solid 2","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",class:"menu-icon-item",transition:"all ease-in-out duration-400",relative:"","w-full":"","items-center":"","overflow-hidden":"","rounded-lg":"","p-5":"","text-left":"",cursor:"pointer",to:o.to},{default:A(()=>[s("div",K,[s("div",M,C(o.title),1),s("div",Q,[s("span",null,C(o.description),1)])]),typeof o.icon=="string"?(n(),p("div",{key:0,class:q(["menu-icon-item-icon",[o.icon]]),transition:"all ease-in-out duration-400",absolute:"","right-0":"","size-24":"","translate-y-4":"",text:"neutral-400/50 dark:neutral-600/50"},null,2)):w("",!0),o.iconTemplate?D(m.$slots,"icon",{key:1},void 0,!0):w("",!0)]),_:3},8,["to"])}}}),W=P(U,[["__scopeId","data-v-656e0116"]]),X={flex:"~ col gap-4"},Y={flex:"~ col gap-4"},Z={key:1,text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[calc(100dvh-12rem)]","bottom-0":"","right--10":"","z--1":"",initial:{scale:.9,opacity:0,rotate:180},enter:{scale:1,opacity:1,rotate:0},duration:500,"size-60":"",flex:"","items-center":"","justify-center":""},tt={text:"60","i-solar:settings-bold-duotone":""},et=I({__name:"index",setup(o){const m=R(),g=r(!1),f=r(),c=r(),{t}=L(),b=r(""),h=r(""),k=r(!1),d=j();function S(){var a;(a=c.value)==null||a.call(c)}async function $(a,l){const e=a.currentTarget.querySelector(".menu-icon-item-icon");if(!e)return;const u=e.getBoundingClientRect(),v=`${u.left}px, ${u.top}px`;b.value=l.icon,h.value=v,k.value=!0,await H(),g.value=!0}const z=m.beforeEach(async(a,l,i)=>{if(!d.usePageSpecificTransitions||d.disableTransitions){i();return}await new Promise(e=>{c.value=e}),z(),i()}),T=F(()=>[{title:t("settings.pages.card.title"),description:t("settings.pages.card.description"),icon:"i-solar:emoji-funny-square-bold-duotone",to:"/settings/airi-card"},{title:t("settings.pages.modules.title"),description:t("settings.pages.modules.description"),icon:"i-solar:layers-bold-duotone",to:"/settings/modules"},{title:t("settings.pages.scene.title"),description:t("settings.pages.scene.description"),icon:"i-solar:armchair-2-bold-duotone",to:"/settings/scene"},{title:t("settings.pages.models.title"),description:t("settings.pages.models.description"),icon:"i-solar:people-nearby-bold-duotone",to:"/settings/models"},{title:t("settings.pages.memory.title"),description:t("settings.pages.memory.description"),icon:"i-solar:leaf-bold-duotone",to:"/settings/memory"},{title:t("settings.pages.providers.title"),description:t("settings.pages.providers.description"),icon:"i-solar:box-minimalistic-bold-duotone",to:"/settings/providers"},{title:t("settings.pages.themes.title"),description:t("settings.pages.themes.description"),icon:"i-solar:filters-bold-duotone",to:"/settings/appearance"}]);return(a,l)=>{const i=N("motion");return n(),p("div",X,[l[0]||(l[0]=s("div",null,null,-1)),s("div",Y,[(n(!0),p(V,null,G(T.value,(e,u)=>_((n(),x(y(W),{key:e.to,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250,style:O({transitionDelay:`${u*50}ms`}),title:e.title,description:e.description,icon:e.icon,to:e.to,onClick:v=>$(v,e)},null,8,["style","title","description","icon","to","onClick"])),[[i]])),128))]),k.value&&!y(d).disableTransitions&&y(d).usePageSpecificTransitions?(n(),x(J,{key:0,ref_key:"iconAnimation",ref:f,icon:b.value,"icon-size":6*1.2,position:h.value,duration:1e3,"text-color":"text-neutral-400/50 dark:text-neutral-600/20",started:g.value,onAnimationEndedOnce:S},null,8,["icon","position","started"])):_((n(),p("div",Z,[_(s("div",tt,null,512),[[i]])])),[[i]])])}}});typeof B=="function"&&B(et);export{et as default}; diff --git a/assets/index-D0HHrws7.js b/assets/index-D0HHrws7.js new file mode 100644 index 0000000000000000000000000000000000000000..603519b9c856aab27e03580d96d9580b65124d29 --- /dev/null +++ b/assets/index-D0HHrws7.js @@ -0,0 +1 @@ +import{d as A,m as _,u as F,c as r,o,x as a,e,i as c,aA as V,k as h,j as U,t as u,w as g,n as x,T as O,G as j,az as H,g as M,r as N,v as P,K as z,A as b,S as R,b as i,O as I,y as L,F as k,l as G,_ as K}from"./index-BNq7Hbz_.js";import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-B6whjTNv.js";import"./three-vrm-animation.module-BPuMi1if.js";import"./mcp-D2taTyhO.js";import"./mini_xsschema-P_8cZcRg.js";/* empty css */import{_ as C,a as q}from"./ColorPalette.vue_vue_type_script_setup_true_lang-AiOxL6bj.js";import{b as D}from"./route-block-B_A1xBdJ.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-IiDV8qQX.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BlPB-gCV.js";import"./index-Df6I5b4c.js";const J={class:"w-full flex cursor-pointer items-center justify-between rounded-lg px-4 py-3 text-sm outline-none transition-all duration-250 ease-in-out",bg:"neutral-50 dark:neutral-800",hover:"bg-neutral-200 dark:bg-neutral-700"},Q=["aria-checked"],W={key:0,text:"sm neutral-500"},B=A({__name:"CheckBar",props:_({text:null,iconOn:null,iconOff:null,description:null},{modelValue:{type:Boolean},modelModifiers:{}}),emits:["update:modelValue"],setup(p){const n=F(p,"modelValue");return(y,m)=>(o(),r("label",J,[a(e("input",{"onUpdate:modelValue":m[0]||(m[0]=v=>n.value=v),"aria-checked":n.value,type:"checkbox",hidden:""},null,8,Q),[[V,n.value]]),e("div",null,[h(u(y.$t(p.text))+" ",1),p.description?(o(),r("div",W,u(y.$t(p.description)),1)):U("",!0)]),c(O,{name:"slide-away",mode:"out-in"},{default:g(()=>[n.value?(o(),r("div",{key:0,class:x(p.iconOn),transition:"all ease-in-out duration-250"},null,2)):(o(),r("div",{key:1,class:x(p.iconOff),transition:"all ease-in-out duration-250"},null,2))]),_:1})]))}}),X=[[],["#A5978B","#D8CAAF","#B8B4A7","#C4BCB1","#E5DED8","#9A8F7D","#BEB5A7","#C9C0B6"],["#7A9EAF","#B8C7CC","#D4B79C","#8B9D77","#C7D5CB","#E6D0B1","#94A7B1","#B4C8C3"],["#D9B48F","#B5917A","#8C7A6B","#A17F5F","#B98C46","#C7A252","#DAB300","#D19826"],["#9BA7B0","#C1CBD4","#A5ADB6","#8B959E","#D4DCE4","#7F8A94","#B3BCC6","#98A4AE"],["#E4C6D0","#A61B29","#5D513C","#789262","#1C0D1A","#F7C242","#62A9DD","#8C4B3C"]],Y={class:"w-full flex items-center justify-between rounded-lg px-4 py-3 text-sm outline-none transition-all duration-250 ease-in-out",bg:"neutral-50 dark:neutral-800",hover:"bg-neutral-200 dark:bg-neutral-700",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+3*10,delay:3*50,transition:"all ease-in-out duration-250"},Z={value:"en-US"},ee={value:"zh-CN"},te={flex:"","items-center":"","justify-between":"",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+5*10,delay:5*50,transition:"all ease-in-out duration-250"},ie={"text-lg":"","font-semibold":""},ne={relative:"",flex:"","cursor-pointer":"","items-center":"","gap-2":""},ae=["disabled"],oe={class:"color-bar",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+7*10,delay:7*50,transition:"all ease-in-out duration-250"},se={"text-white":"",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+8*10,delay:8*50,transition:"all ease-in-out duration-250"},le={class:"color-bar transparency-grid",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+9*10,delay:9*50,transition:"all ease-in-out duration-250"},re=["duration","delay"],de={"font-medium":""},ue={text:"sm neutral-500"},pe={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":""},w=A({__name:"index",setup(p){const n=j(),y=H(),{t:m}=M(),v=N(!1);return P(()=>[n.usePageSpecificTransitions,n.disableTransitions],()=>{v.value=!0}),(d,t)=>{const s=z("motion");return o(),r(k,null,[a((o(),b(i(C),{title:i(m)("settings.sections.section.general.title"),icon:"i-solar:filters-bold-duotone",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+1*10,delay:1*50,transition:"all ease-in-out duration-250"},{default:g(()=>[a(c(B,{modelValue:i(y),"onUpdate:modelValue":t[0]||(t[0]=l=>R(y)?y.value=l:null),initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+2*10,delay:2*50,"icon-on":"i-solar:moon-stars-bold-duotone","icon-off":"i-solar:sun-fog-bold-duotone",text:"settings.theme",transition:"all ease-in-out duration-250"},null,8,["modelValue"]),[[s]]),a((o(),r("div",Y,[h(u(d.$t("settings.language.title"))+" ",1),a(e("select",{"onUpdate:modelValue":t[1]||(t[1]=l=>i(n).language=l),transition:"all ease-in-out duration-250","cursor-pointer":"","bg-transparent":"","text-right":"","outline-none":""},[e("option",Z,u(d.$t("settings.language.english")),1),e("option",ee,u(d.$t("settings.language.chinese")),1)],512),[[I,i(n).language]])])),[[s]])]),_:1},8,["title"])),[[s]]),a((o(),b(i(C),{title:i(m)("settings.pages.themes.sections.section.custom-color.title"),icon:"i-solar:pallete-2-bold-duotone",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+4*10,delay:4*50,transition:"all ease-in-out duration-250"},{default:g(()=>[a((o(),r("div",te,[e("span",ie,u(d.$t("settings.pages.themes.sections.section.custom-color.fields.field.primary-color.label")),1),e("label",ne,[a(e("input",{"onUpdate:modelValue":t[2]||(t[2]=l=>i(n).themeColorsHueDynamic=l),type:"checkbox",class:"peer sr-only"},null,512),[[V,i(n).themeColorsHueDynamic]]),t[6]||(t[6]=e("div",{class:"peer-checked:bg-primary-500 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 after:transition-all after:content-[''] peer-checked:after:translate-x-full peer-checked:after:border-white"},null,-1)),h(" "+u(d.$t("settings.pages.themes.sections.section.custom-color.fields.field.primary-color.rgb-on.title")),1)])])),[[s]]),a(e("input",{"onUpdate:modelValue":t[3]||(t[3]=l=>i(n).themeColorsHue=l),initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+6*10,delay:6*50,transition:"all ease-in-out duration-250",type:"range",min:"0",max:"360",step:"0.01",class:x(["theme-hue-slider",i(n).themeColorsHueDynamic?"opacity-25 cursor-not-allowed":"cursor-pointer"]),disabled:i(n).themeColorsHueDynamic},null,10,ae),[[L,i(n).themeColorsHue],[s]]),a((o(),r("div",oe,[t[8]||(t[8]=e("span",{"bg-primary-50":""},"50",-1)),t[9]||(t[9]=e("span",{"bg-primary-100":""},"100",-1)),t[10]||(t[10]=e("span",{"bg-primary-200":""},"200",-1)),t[11]||(t[11]=e("span",{"bg-primary-300":""},"300",-1)),t[12]||(t[12]=e("span",{"bg-primary-400":""},"400",-1)),t[13]||(t[13]=e("span",{"bg-primary-500":""},"500",-1)),a((o(),r("div",se,t[7]||(t[7]=[e("span",{"bg-primary-600":""},"600",-1),e("span",{"bg-primary-700":""},"700",-1),e("span",{"bg-primary-800":""},"800",-1),e("span",{"bg-primary-900":""},"900",-1),e("span",{"bg-primary-950":""},"950",-1)]))),[[s]])])),[[s]]),a((o(),r("div",le,t[14]||(t[14]=[e("span",{bg:"primary-500/5"},"500/5",-1),e("span",{bg:"primary-500/10"},"500/10",-1),e("span",{bg:"primary-500/20"},"500/20",-1),e("span",{bg:"primary-500/30"},"500/30",-1),e("span",{bg:"primary-500/40"},"500/40",-1),e("span",{bg:"primary-500/50"},"500/50",-1),e("span",{bg:"primary-500/60"},"500/60",-1),e("span",{bg:"primary-500/70"},"500/70",-1),e("span",{bg:"primary-500/80"},"500/80",-1),e("span",{bg:"primary-500/90"},"500/90",-1),e("span",{bg:"primary-500"},"500",-1)]))),[[s]])]),_:1},8,["title"])),[[s]]),a((o(),b(i(C),{title:"settings.pages.themes.sections.section.theme-presets.title",icon:"i-solar:magic-stick-2-bold-duotone",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+10*10,delay:10*50,transition:"all ease-in-out duration-250"},{default:g(()=>[(o(!0),r(k,null,G(d.$tm("settings.pages.themes.sections.section.theme-presets.presets"),({title:l,description:$,colors:T},f)=>a((o(),r("div",{key:f,class:"w-full flex items-center justify-between rounded-lg px-4 py-3 outline-none transition-all duration-250 ease-in-out",bg:"neutral-100 dark:neutral-800",hover:"bg-neutral-200 dark:bg-neutral-700",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+11*10+f*10,delay:11*50+f*50,transition:"all ease-in-out duration-250"},[e("div",null,[e("span",de,u(d.$rt(l)),1),e("div",ue,u(d.$rt($)),1)]),c(q,{colors:T.map((E,S)=>({hex:i(X)[f][S],name:d.$rt(E)}))},null,8,["colors"])],8,re)),[[s]])),128))]),_:1})),[[s]]),a((o(),b(i(C),{title:"settings.pages.themes.sections.section.developer.title",icon:"i-solar:code-bold-duotone",initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+18*10,delay:18*50,transition:"all ease-in-out duration-250"},{default:g(()=>[a(c(B,{modelValue:i(n).disableTransitions,"onUpdate:modelValue":t[4]||(t[4]=l=>i(n).disableTransitions=l),"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:250+19*10,delay:19*50,transition:"all ease-in-out duration-250"},null,8,["modelValue"]),[[s]]),a(c(B,{modelValue:i(n).usePageSpecificTransitions,"onUpdate:modelValue":t[5]||(t[5]=l=>i(n).usePageSpecificTransitions=l),disabled:i(n).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:250+20*10,delay:20*50,transition:"all ease-in-out duration-250"},null,8,["modelValue","disabled"]),[[s]])]),_:1})),[[s]]),a((o(),r("div",pe,t[15]||(t[15]=[e("div",{text:"60","i-solar:filters-bold-duotone":""},null,-1)]))),[[s]])],64)}}});typeof D=="function"&&D(w);const ke=K(w,[["__scopeId","data-v-0edbb762"]]);export{ke as default}; diff --git a/assets/index-D3kra94d.js b/assets/index-D1xt2h2l.js similarity index 84% rename from assets/index-D3kra94d.js rename to assets/index-D1xt2h2l.js index 1be5eb73dbec00f2476326bcd267c3ca538cbcde..c2e480024ff53af3ab6e94cd48fed81e3d7ba40b 100644 --- a/assets/index-D3kra94d.js +++ b/assets/index-D1xt2h2l.js @@ -1,4 +1,4 @@ -import{d as vs}from"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-t8bgqiA6.js";import{v as Gn,r as W,l as je,s as Ke,x as bs,d as Fe,y as ws,z as ks,A as Zr,w as Be,f as pn,c as re,o as Z,B as gn,C as Ts,k as Zt,D as Wt,m as Xt,E as Ue,b as ke,a as O,F as st,G as Et,H as Qr,i as it,t as he,u as V,M as yt,T as _t,I as Jr,J as Yn,K as Yo,Z as On,g as Ot,L as _s,V as ae,S as Mi,Q as Fn,O as $t,N as Pe,P as Mt,U as Es,W as Ko,X as hn,Y as ei,_ as ze,$ as qo,a0 as Wo,a1 as ti,a2 as yn,a3 as Ms,a4 as ni,a5 as As,a6 as Xo,a7 as xt,a8 as ri,a9 as At,aa as Ss,ab as Zo,ac as Dt,ad as Qo,ae as Is,af as Rs,ag as Cs,ah as Ns,ai as Jo,aj as Kn,ak as Ls,al as Ps,am as Ds,an as Pt,ao as Os,ap as Fs,aq as Bs,ar as zs,as as er,at as Bn,au as Cr,av as Nt,aw as ea,ax as Nr,ay as Vt,az as Ai,aA as Lt,aB as Ht,aC as tr,aD as Us,aE as js,aF as Vs,aG as Hs,aH as ta,aI as na,aJ as zn,aK as ra,aL as ii,aM as Un,aN as ia,aO as $s,q as Lr,aP as Gs,aQ as Pr,aR as oa,aS as Ys,aT as cn,aU as aa,aV as ft,aW as vt,aX as mn,aY as Ks,aZ as qs,a_ as Ws,a$ as Xs,b0 as Zs,b1 as oi,b2 as Qs,b3 as Js,b4 as el,b5 as nr,b6 as tl,b7 as sa,b8 as nl,b9 as rl,ba as il,bb as ol,bc as al,bd as rr,be as sl,bf as ll,bg as ul,bh as Si,bi as Ii,bj as Ri,bk as Ci,bl as cl,bm as fl,bn as dl,bo as pl,bp as hl,bq as qn,br as ml,bs as la,bt as gl,bu as yl,bv as xl,bw as vl,bx as ua,by as jn,bz as ca,bA as ai,bB as si,bC as bl,bD as ir,bE as wl,bF as kl}from"./index-D3pfQUMu.js";import{V as Tl,a as _l,c as El,r as Ml,b as Dr,d as Al}from"./three-vrm-animation.module-DLbUhddZ.js";import{E as Ni,a as Sl,b as Il,c as Rl,d as Cl}from"./emotions-CAex_2dA.js";/* empty css */import{getImportUrlBundles as Nl}from"./import-url-browser-CPN8ipMD.js";import{s as Gt,c as Li,u as Ll,g as Pl}from"./speech-CIOuIakE.js";import{u as or}from"./queue-6PX0h0Ry.js";import{u as Dl,a as Ol,b as Fl,l as Bl}from"./queues-CCpGc-RL.js";import{l as zl,u as li}from"./providers-CCvie00Z.js";import{s as Ul}from"./index-C4mUnpiM.js";import{u as jl}from"./airi-card-vOKXd5VS.js";import{_ as ui}from"./TransitionVertical.vue_vue_type_script_setup_true_lang-D_DUmSTM.js";import{_ as Vl,a as Hl,r as on}from"./Model.vue_vue_type_script_setup_true_lang-CYzfx59_.js";import{_ as Pi}from"./Collapsable.vue_vue_type_script_setup_true_lang-DDNOeGH3.js";import{H as $l}from"./HeaderLink-SBXLiv0n.js";import{d as Di}from"./index-CdYg-KxO.js";import{u as fa}from"./consciousness-DynZMlUo.js";import{_ as da}from"./Basic.vue_vue_type_script_setup_true_lang-Sei3qL1b.js";import{b as Oi}from"./route-block-B_A1xBdJ.js";import"./duckdb-mvp-CaaD-olE.js";import"./index-LHmcipjy.js";async function*Gl(t,e){const n=t.getReader();try{for(;;){const{done:r,value:i}=await n.read();if(r)return;yield e(i)}}finally{n.releaseLock()}}function Yl(t){const e=new Uint8Array(t.frequencyBinCount);t.getByteFrequencyData(e);const n=[];for(let i=0;i<700;i+=80)n.push(e[i]);return e.map(i=>i**1.2).map(i=>i*1.2).reduce((i,o)=>i+o,0)/e.length/100}function Kl(t){const e=new Uint8Array(t.frequencyBinCount);t.getByteFrequencyData(e);const n=[];for(let u=0;u<700;u+=80)n.push(e[u]);const r=e.map(u=>u**1.5),i=Math.min(...r),a=Math.max(...r)-i;let s;return a===0?s=r.map(()=>0):s=r.map(u=>(u-i)/a),s.reduce((u,c)=>u+c,0)/e.length}function ql(t,e="linear"){switch(e){case"linear":return Yl(t);case"minmax":return Kl(t)}}const pa=Gn("AudioContext",()=>({audioContext:new AudioContext,calculateVolume:ql})),Wl=Gn("SpeakingStore",()=>{const n=W(0),r=W(!1),i=je(()=>r.value?(30+70*n.value)/100:30);return{mouthOpenSize:n,nowSpeaking:r,nowSpeakingAvatarBorderOpacity:i}});function _n(t,e,n){return e+n<0||e+n>=t.length-1?"":t[e+n]}function Xl(t){let e="literal",n="";return{async consume(r){var i,o,a;for(let s=0;s"?(l+=_n(r,s,1),u="literal",s++):l==="<"?u="special":l===">"&&(u="literal"),e==="literal"&&u==="special"?n!==""&&(await((i=t.onLiteral)==null?void 0:i.call(t,n)),n=""):e==="special"&&u==="literal"&&n!==""&&(n+=l,await((o=t.onSpecial)==null?void 0:o.call(t,n)),n=""),e==="literal"&&u==="literal"?(await((a=t.onLiteral)==null?void 0:a.call(t,l)),n=""):e==="special"&&u==="literal"?n="":n+=l,e=u}},async end(){var r,i;n!==""&&(e==="literal"?await((r=t.onLiteral)==null?void 0:r.call(t,n)):n.endsWith("|>")&&await((i=t.onSpecial)==null?void 0:i.call(t,n)))}}}const Zl=Gn("llm",()=>{async function t(n,r,i,o){const a=o==null?void 0:o.headers;return await Ul({...r.chat(n),messages:i,headers:a})}async function e(n,r){if(n==="")return[];try{return await zl({baseURL:n.endsWith("/")?n:`${n}/`,apiKey:r})}catch(i){if(String(i).includes("Failed to construct 'URL': Invalid URL"))return[];throw i}}return{models:e,stream:t}}),St=Gn("chat",()=>{const{stream:t}=Zl(),{systemPrompt:e}=Ke(jl()),n=W(!1),r=W([]),i=W([]),o=W([]),a=W([]),s=W([]),l=W([]),u=W([]),c=W([]);function f(h){r.value.push(h)}function p(h){i.value.push(h)}function d(h){o.value.push(h)}function y(h){a.value.push(h)}function x(h){s.value.push(h)}function v(h){l.value.push(h)}function k(h){u.value.push(h)}function A(h){c.value.push(h)}const E=W([{role:"system",content:e.value}]),C=W({role:"assistant",content:""});async function P(h,I){var b;try{if(n.value=!0,!h)return;for(const D of r.value)await D(h);C.value={role:"assistant",content:""},E.value.push({role:"user",content:h}),E.value.push(C.value);const g=E.value.slice(0,E.value.length-1).map(D=>bs(D));for(const D of i.value)await D(h);for(const D of o.value)await D(h);const m=((b=I.providerConfig)==null?void 0:b.headers)||{},T=await t(I.model,I.chatProvider,g,{headers:m});for(const D of a.value)await D(h);let S="";const B=Xl({onLiteral:async D=>{for(const F of s.value)await F(D);C.value.content+=D},onSpecial:async D=>{for(const F of l.value)await F(D)}});for await(const D of Gl(T.textStream,async F=>F))S+=D,await B.consume(D);await B.end();for(const D of u.value)await D();for(const D of c.value)await D(S);console.debug("LLM output:",S)}catch(g){throw console.error("Error sending message:",g),g}finally{n.value=!1}}return{sending:n,messages:E,streamingMessage:C,send:P,onBeforeMessageComposed:f,onAfterMessageComposed:p,onBeforeSend:d,onAfterSend:y,onTokenLiteral:x,onTokenSpecial:v,onStreamEnd:k,onAssistantResponseEnd:A}}),ha=Fe({__name:"Screen",setup(t){const e=W(),n=ws(Ts),{width:r,height:i}=ks(),o=Zr(e,{immediate:!0,windowResize:!0,reset:!0}),a=je(()=>n.between("sm","md").value||n.smaller("sm").value),s=je(()=>n.between("md","lg").value),l=je(()=>n.greaterOrEqual("lg").value),u=je(()=>l.value?o.width.value:a.value||s.value?r.value-16:o.width.value),c=W(0);return Be([r,i,e],()=>{var p,d;const f=(d=(p=e.value)==null?void 0:p.parentElement)==null?void 0:d.getBoundingClientRect();l.value||a.value||s.value?c.value=(f==null?void 0:f.height)||0:c.value=600}),Be([o.width,o.height],()=>{l.value||a.value||s.value?c.value=o.height.value:c.value=600}),pn(async()=>{e.value&&o.update()}),(f,p)=>(Z(),re("div",{ref_key:"containerRef",ref:e,"h-full":"","w-full":""},[gn(f.$slots,"default",{width:u.value,height:c.value})],512))}}),Ql={absolute:"",bottom:"3",right:"3"},Jl={flex:"~ row","cursor-pointer":""},eu=["checked","aria-checked"],tu={key:0,"min-w":"50vw",z:"(Z(),Xt(ha,{relative:""},{default:Ue(({width:a,height:s})=>[ke(Hl,{width:a,height:s},{default:Ue(({app:l})=>[ke(Vl,{app:l,"mouth-open-size":t.mouthOpenSize,width:a,height:s,paused:t.paused},null,8,["app","mouth-open-size","width","height","paused"])]),_:2},1032,["width","height"]),O("div",Ql,[O("div",Jl,[O("label",{class:st([n.value?"bg-neutral-300 dark:bg-neutral-200":"bg-neutral-100 dark:bg-neutral-700"]),transition:"all ease-in-out duration-500",text:"lg neutral-500 dark:neutral-400","m-1":"","h-fit":"","w-fit":"","cursor-pointer":"","appearance-none":"","gap-1":"","rounded-lg":"","rounded-md":"","border-none":"","p-2":"","outline-none":""},[Et(O("input",{"onUpdate:modelValue":o[0]||(o[0]=l=>n.value=l),checked:n.value,"aria-checked":n.value,name:"showLive2DViewerInspector",type:"checkbox",hidden:"","appearance-none":"","outline-none":""},null,8,eu),[[Qr,n.value]]),o[8]||(o[8]=O("div",{"select-none":""},[O("div",{"i-solar:bug-bold-duotone":""})],-1))],2)]),ke(V(ui),null,{default:Ue(()=>[n.value?(Z(),re("div",tu,[O("div",nu,[O("div",ru,[O("span",null,he(V(e)("stage.viewers.debug-menu.emotions")),1)]),O("div",iu,[O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[1]||(o[1]=l=>r.value={group:"Surprise",index:0})},he(V(e)("stage.viewers.debug-menu.emotions-btn.surprised")),1),O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[2]||(o[2]=l=>r.value={group:"Sad",index:0})},he(V(e)("stage.viewers.debug-menu.emotions-btn.sad")),1),O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[3]||(o[3]=l=>r.value={group:"Angry",index:0})},he(V(e)("stage.viewers.debug-menu.emotions-btn.angry")),1),O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[4]||(o[4]=l=>r.value={group:"Happy",index:0})},he(V(e)("stage.viewers.debug-menu.emotions-btn.happy")),1),O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[5]||(o[5]=l=>r.value={group:"Awkward",index:0})},he(V(e)("stage.viewers.debug-menu.emotions-btn.awkward")),1),O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[6]||(o[6]=l=>r.value={group:"Question",index:0})},he(V(e)("stage.viewers.debug-menu.emotions-btn.question")),1),O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[7]||(o[7]=l=>r.value={group:"Think",index:0})},he(V(e)("stage.viewers.debug-menu.emotions-btn.think")),1)])])])):it("",!0)]),_:1})])]),_:1}))}});var au=Object.defineProperty,su=(t,e,n)=>e in t?au(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,lu=(t,e,n)=>su(t,e+"",n);function uu(t){return Ls()?(Ps(t),!0):!1}function ma(t){return typeof t=="function"?t():V(t)}const cu=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const fu=Object.prototype.toString,du=t=>fu.call(t)==="[object Object]",pu=()=>{},hu=cu?window:void 0;function mu(t){var e;const n=ma(t);return(e=n==null?void 0:n.$el)!=null?e:n}function ar(...t){let e,n,r,i;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,r,i]=t,e=hu):[e,n,r,i]=t,!e)return pu;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);const o=[],a=()=>{o.forEach(c=>c()),o.length=0},s=(c,f,p,d)=>(c.addEventListener(f,p,d),()=>c.removeEventListener(f,p,d)),l=Be(()=>[mu(e),ma(i)],([c,f])=>{if(a(),!c)return;const p=du(f)?{...f}:f;o.push(...n.flatMap(d=>r.map(y=>s(c,d,y,p))))},{immediate:!0,flush:"post"}),u=()=>{l(),a()};return uu(u),u}function ga(t,e,n,r){const i=class extends yn{constructor(o={}){const a=Object.entries(t);super({uniforms:a.reduce((s,[l,u])=>{const c=ni.clone({[l]:{value:u}});return{...s,...c}},{}),vertexShader:e,fragmentShader:n}),lu(this,"key",""),a.forEach(([s])=>Object.defineProperty(this,s,{get:()=>this.uniforms[s].value,set:l=>this.uniforms[s].value=l})),Object.assign(this,o)}};return i.key=Dt.generateUUID(),i}ga({color:new ze("white"),scale:new Pe(1,1),imageBounds:new Pe(1,1),resolution:1024,map:null,zoom:1,radius:0,grayscale:0,opacity:1},` +import{d as vs}from"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-B6whjTNv.js";import{p as Gn,r as W,h as je,s as Ke,aH as bs,d as Fe,aD as ws,bc as ks,aK as Zr,v as Be,H as pn,c as re,o as Z,f as gn,aG as Ts,g as Zt,G as Wt,A as Xt,w as Ue,i as ke,e as O,n as st,x as Et,aA as Qr,j as it,t as he,b as V,bd as yt,be as _t,aO as Jr,bf as Yn,aE as Yo,bg as On,I as Ot,bh as _s,a0 as ae,bi as Mi,a6 as Fn,bj as $t,$ as Pe,bk as Mt,bl as Es,bm as Ko,bn as hn,bo as ei,Z as ze,am as qo,bp as Wo,bq as ti,af as yn,a4 as Ms,ah as ni,br as As,a7 as Xo,a2 as xt,bs as ri,bt as At,bu as Ss,bv as Zo,a5 as Dt,bw as Qo,a$ as Is,bx as Rs,S as Cs,by as Ns,B as Jo,aa as Kn,aL as Ls,aM as Ps,as as Ds,ab as Pt,bz as Os,bA as Fs,bB as Bs,bC as zs,bD as er,bE as Bn,bF as Cr,ak as Nt,bG as ea,bH as Nr,a9 as Vt,bI as Ai,bJ as Lt,bK as Ht,bL as tr,bM as Us,bN as js,bO as Vs,bP as Hs,bQ as ta,bR as na,bS as zn,bT as ra,bU as ii,bV as Un,bW as ia,bX as $s,z as Lr,bY as Gs,bZ as Pr,b_ as oa,b$ as Ys,c0 as cn,c1 as aa,c2 as ft,c3 as vt,c4 as mn,c5 as Ks,c6 as qs,c7 as Ws,c8 as Xs,c9 as Zs,aj as oi,ca as Qs,cb as Js,cc as el,a3 as nr,ac as tl,cd as sa,ao as nl,ad as rl,an as il,ce as ol,cf as al,a8 as rr,aq as sl,at as ll,cg as ul,ch as Si,au as Ii,av as Ri,ci as Ci,cj as cl,ck as fl,cl as dl,cm as pl,cn as hl,_ as qn,Q as ml,co as la,cp as gl,aC as yl,cq as xl,cr as vl,cs as ua,ax as jn,K as ca,F as ai,l as si,ct as bl,b6 as ir,T as wl,az as kl}from"./index-BNq7Hbz_.js";import{V as Tl,a as _l,c as El,r as Ml,b as Dr,d as Al}from"./three-vrm-animation.module-BPuMi1if.js";import{m as Sl}from"./mcp-D2taTyhO.js";import{c as Ni,d as Il,e as Rl,f as Cl,g as Nl}from"./mini_xsschema-P_8cZcRg.js";/* empty css */import{getImportUrlBundles as Ll}from"./import-url-browser-CPN8ipMD.js";import{s as Gt,c as Li,u as Pl,g as Dl}from"./speech-CKvssz06.js";import{u as or}from"./queue-Bkpr_I5o.js";import{b as Ol,a as Fl,u as Bl,l as zl}from"./queues-yzb6LxwZ.js";import{l as Ul,u as li}from"./providers-Ddg6LLwH.js";import{s as jl}from"./index-C4mUnpiM.js";import{u as Vl}from"./airi-card-BqbOXX1s.js";import{_ as ui}from"./TransitionVertical.vue_vue_type_script_setup_true_lang-BlPB-gCV.js";import{_ as Hl,a as $l,r as on}from"./Model.vue_vue_type_script_setup_true_lang-DPC1qTx5.js";import{_ as Pi}from"./Collapsable.vue_vue_type_script_setup_true_lang-IiDV8qQX.js";import{H as Gl}from"./HeaderLink-nC9K3Z33.js";import{d as Di}from"./index-BVssmUEI.js";import{u as fa}from"./consciousness-BV44f_Xl.js";import{_ as da}from"./Basic.vue_vue_type_script_setup_true_lang-DiEujAxb.js";import{b as Oi}from"./route-block-B_A1xBdJ.js";import"./duckdb-mvp-CaaD-olE.js";import"./index-LHmcipjy.js";async function*Yl(t,e){const n=t.getReader();try{for(;;){const{done:r,value:i}=await n.read();if(r)return;yield e(i)}}finally{n.releaseLock()}}function Kl(t){const e=new Uint8Array(t.frequencyBinCount);t.getByteFrequencyData(e);const n=[];for(let i=0;i<700;i+=80)n.push(e[i]);return e.map(i=>i**1.2).map(i=>i*1.2).reduce((i,o)=>i+o,0)/e.length/100}function ql(t){const e=new Uint8Array(t.frequencyBinCount);t.getByteFrequencyData(e);const n=[];for(let u=0;u<700;u+=80)n.push(e[u]);const r=e.map(u=>u**1.5),i=Math.min(...r),a=Math.max(...r)-i;let s;return a===0?s=r.map(()=>0):s=r.map(u=>(u-i)/a),s.reduce((u,c)=>u+c,0)/e.length}function Wl(t,e="linear"){switch(e){case"linear":return Kl(t);case"minmax":return ql(t)}}const pa=Gn("AudioContext",()=>({audioContext:new AudioContext,calculateVolume:Wl})),Xl=Gn("SpeakingStore",()=>{const n=W(0),r=W(!1),i=je(()=>r.value?(30+70*n.value)/100:30);return{mouthOpenSize:n,nowSpeaking:r,nowSpeakingAvatarBorderOpacity:i}});function _n(t,e,n){return e+n<0||e+n>=t.length-1?"":t[e+n]}function Zl(t){let e="literal",n="";return{async consume(r){var i,o,a;for(let s=0;s"?(l+=_n(r,s,1),u="literal",s++):l==="<"?u="special":l===">"&&(u="literal"),e==="literal"&&u==="special"?n!==""&&(await((i=t.onLiteral)==null?void 0:i.call(t,n)),n=""):e==="special"&&u==="literal"&&n!==""&&(n+=l,await((o=t.onSpecial)==null?void 0:o.call(t,n)),n=""),e==="literal"&&u==="literal"?(await((a=t.onLiteral)==null?void 0:a.call(t,l)),n=""):e==="special"&&u==="literal"?n="":n+=l,e=u}},async end(){var r,i;n!==""&&(e==="literal"?await((r=t.onLiteral)==null?void 0:r.call(t,n)):n.endsWith("|>")&&await((i=t.onSpecial)==null?void 0:i.call(t,n)))}}}const Ql=Gn("llm",()=>{async function t(n,r,i,o){const a=o==null?void 0:o.headers;return await jl({...r.chat(n),maxSteps:10,messages:i,headers:a,tools:[...await Sl()]})}async function e(n,r){if(n==="")return[];try{return await Ul({baseURL:n.endsWith("/")?n:`${n}/`,apiKey:r})}catch(i){if(String(i).includes("Failed to construct 'URL': Invalid URL"))return[];throw i}}return{models:e,stream:t}}),St=Gn("chat",()=>{const{stream:t}=Ql(),{systemPrompt:e}=Ke(Vl()),n=W(!1),r=W([]),i=W([]),o=W([]),a=W([]),s=W([]),l=W([]),u=W([]),c=W([]);function f(h){r.value.push(h)}function p(h){i.value.push(h)}function d(h){o.value.push(h)}function y(h){a.value.push(h)}function x(h){s.value.push(h)}function v(h){l.value.push(h)}function k(h){u.value.push(h)}function A(h){c.value.push(h)}const E=W([{role:"system",content:e.value}]),C=W({role:"assistant",content:""});async function P(h,I){var b;try{if(n.value=!0,!h)return;for(const D of r.value)await D(h);C.value={role:"assistant",content:""},E.value.push({role:"user",content:h}),E.value.push(C.value);const g=E.value.slice(0,E.value.length-1).map(D=>bs(D));for(const D of i.value)await D(h);for(const D of o.value)await D(h);const m=((b=I.providerConfig)==null?void 0:b.headers)||{},T=await t(I.model,I.chatProvider,g,{headers:m});for(const D of a.value)await D(h);let S="";const B=Zl({onLiteral:async D=>{for(const F of s.value)await F(D);C.value.content+=D},onSpecial:async D=>{for(const F of l.value)await F(D)}});for await(const D of Yl(T.textStream,async F=>F))S+=D,await B.consume(D);await B.end();for(const D of u.value)await D();for(const D of c.value)await D(S);console.debug("LLM output:",S)}catch(g){throw console.error("Error sending message:",g),g}finally{n.value=!1}}return{sending:n,messages:E,streamingMessage:C,send:P,onBeforeMessageComposed:f,onAfterMessageComposed:p,onBeforeSend:d,onAfterSend:y,onTokenLiteral:x,onTokenSpecial:v,onStreamEnd:k,onAssistantResponseEnd:A}}),ha=Fe({__name:"Screen",setup(t){const e=W(),n=ws(Ts),{width:r,height:i}=ks(),o=Zr(e,{immediate:!0,windowResize:!0,reset:!0}),a=je(()=>n.between("sm","md").value||n.smaller("sm").value),s=je(()=>n.between("md","lg").value),l=je(()=>n.greaterOrEqual("lg").value),u=je(()=>l.value?o.width.value:a.value||s.value?r.value-16:o.width.value),c=W(0);return Be([r,i,e],()=>{var p,d;const f=(d=(p=e.value)==null?void 0:p.parentElement)==null?void 0:d.getBoundingClientRect();l.value||a.value||s.value?c.value=(f==null?void 0:f.height)||0:c.value=600}),Be([o.width,o.height],()=>{l.value||a.value||s.value?c.value=o.height.value:c.value=600}),pn(async()=>{e.value&&o.update()}),(f,p)=>(Z(),re("div",{ref_key:"containerRef",ref:e,"h-full":"","w-full":""},[gn(f.$slots,"default",{width:u.value,height:c.value})],512))}}),Jl={absolute:"",bottom:"3",right:"3"},eu={flex:"~ row","cursor-pointer":""},tu=["checked","aria-checked"],nu={key:0,"min-w":"50vw",z:"(Z(),Xt(ha,{relative:""},{default:Ue(({width:a,height:s})=>[ke($l,{width:a,height:s},{default:Ue(({app:l})=>[ke(Hl,{app:l,"mouth-open-size":t.mouthOpenSize,width:a,height:s,paused:t.paused},null,8,["app","mouth-open-size","width","height","paused"])]),_:2},1032,["width","height"]),O("div",Jl,[O("div",eu,[O("label",{class:st([n.value?"bg-neutral-300 dark:bg-neutral-200":"bg-neutral-100 dark:bg-neutral-700"]),transition:"all ease-in-out duration-500",text:"lg neutral-500 dark:neutral-400","m-1":"","h-fit":"","w-fit":"","cursor-pointer":"","appearance-none":"","gap-1":"","rounded-lg":"","rounded-md":"","border-none":"","p-2":"","outline-none":""},[Et(O("input",{"onUpdate:modelValue":o[0]||(o[0]=l=>n.value=l),checked:n.value,"aria-checked":n.value,name:"showLive2DViewerInspector",type:"checkbox",hidden:"","appearance-none":"","outline-none":""},null,8,tu),[[Qr,n.value]]),o[8]||(o[8]=O("div",{"select-none":""},[O("div",{"i-solar:bug-bold-duotone":""})],-1))],2)]),ke(V(ui),null,{default:Ue(()=>[n.value?(Z(),re("div",nu,[O("div",ru,[O("div",iu,[O("span",null,he(V(e)("stage.viewers.debug-menu.emotions")),1)]),O("div",ou,[O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[1]||(o[1]=l=>r.value={group:"Surprise",index:0})},he(V(e)("stage.viewers.debug-menu.emotions-btn.surprised")),1),O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[2]||(o[2]=l=>r.value={group:"Sad",index:0})},he(V(e)("stage.viewers.debug-menu.emotions-btn.sad")),1),O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[3]||(o[3]=l=>r.value={group:"Angry",index:0})},he(V(e)("stage.viewers.debug-menu.emotions-btn.angry")),1),O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[4]||(o[4]=l=>r.value={group:"Happy",index:0})},he(V(e)("stage.viewers.debug-menu.emotions-btn.happy")),1),O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[5]||(o[5]=l=>r.value={group:"Awkward",index:0})},he(V(e)("stage.viewers.debug-menu.emotions-btn.awkward")),1),O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[6]||(o[6]=l=>r.value={group:"Question",index:0})},he(V(e)("stage.viewers.debug-menu.emotions-btn.question")),1),O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:o[7]||(o[7]=l=>r.value={group:"Think",index:0})},he(V(e)("stage.viewers.debug-menu.emotions-btn.think")),1)])])])):it("",!0)]),_:1})])]),_:1}))}});var su=Object.defineProperty,lu=(t,e,n)=>e in t?su(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,uu=(t,e,n)=>lu(t,e+"",n);function cu(t){return Ls()?(Ps(t),!0):!1}function ma(t){return typeof t=="function"?t():V(t)}const fu=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const du=Object.prototype.toString,pu=t=>du.call(t)==="[object Object]",hu=()=>{},mu=fu?window:void 0;function gu(t){var e;const n=ma(t);return(e=n==null?void 0:n.$el)!=null?e:n}function ar(...t){let e,n,r,i;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,r,i]=t,e=mu):[e,n,r,i]=t,!e)return hu;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);const o=[],a=()=>{o.forEach(c=>c()),o.length=0},s=(c,f,p,d)=>(c.addEventListener(f,p,d),()=>c.removeEventListener(f,p,d)),l=Be(()=>[gu(e),ma(i)],([c,f])=>{if(a(),!c)return;const p=pu(f)?{...f}:f;o.push(...n.flatMap(d=>r.map(y=>s(c,d,y,p))))},{immediate:!0,flush:"post"}),u=()=>{l(),a()};return cu(u),u}function ga(t,e,n,r){const i=class extends yn{constructor(o={}){const a=Object.entries(t);super({uniforms:a.reduce((s,[l,u])=>{const c=ni.clone({[l]:{value:u}});return{...s,...c}},{}),vertexShader:e,fragmentShader:n}),uu(this,"key",""),a.forEach(([s])=>Object.defineProperty(this,s,{get:()=>this.uniforms[s].value,set:l=>this.uniforms[s].value=l})),Object.assign(this,o)}};return i.key=Dt.generateUUID(),i}ga({color:new ze("white"),scale:new Pe(1,1),imageBounds:new Pe(1,1),resolution:1024,map:null,zoom:1,radius:0,grayscale:0,opacity:1},` varying vec2 vUv; varying vec2 vPos; void main() { @@ -53,7 +53,7 @@ import{d as vs}from"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-t8bg #include #include } - `);const ci=parseInt(Ds.replace(/\D+/g,""));var gu=Object.defineProperty,yu=(t,e,n)=>e in t?gu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,xu=(t,e,n)=>(yu(t,e+"",n),n);async function Fi(t){const e=await t.arrayBuffer(),n=btoa(String.fromCharCode(...new Uint8Array(e)));return`data:${t.type||""};base64,${n}`}let En,sr,Bt,Mn;function lr(t,e=1/0,n=null){sr||(sr=new Qo(2,2,1,1)),Bt||(Bt=new yn({uniforms:{blitTexture:new Vs(t)},vertexShader:` + `);const ci=parseInt(Ds.replace(/\D+/g,""));var yu=Object.defineProperty,xu=(t,e,n)=>e in t?yu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,vu=(t,e,n)=>(xu(t,e+"",n),n);async function Fi(t){const e=await t.arrayBuffer(),n=btoa(String.fromCharCode(...new Uint8Array(e)));return`data:${t.type||""};base64,${n}`}let En,sr,Bt,Mn;function lr(t,e=1/0,n=null){sr||(sr=new Qo(2,2,1,1)),Bt||(Bt=new yn({uniforms:{blitTexture:new Vs(t)},vertexShader:` varying vec2 vUv; void main(){ vUv = uv; @@ -72,7 +72,7 @@ import{d as vs}from"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-t8bg gl_FragColor = texture2D( blitTexture, vUv); #endif } - `})),Bt.uniforms.blitTexture.value=t,Bt.defines.IS_SRGB="colorSpace"in t?t.colorSpace==="srgb":t.encoding===3001,Bt.needsUpdate=!0,Mn||(Mn=new Pt(sr,Bt),Mn.frustrumCulled=!1);const r=new Mt,i=new Nr;i.add(Mn),n||(n=En=new Hs({antialias:!1})),n.setSize(Math.min(t.image.width,e),Math.min(t.image.height,e)),n.clear(),n.render(i,r);const o=new Bn(n.domElement);return o.minFilter=t.minFilter,o.magFilter=t.magFilter,o.wrapS=t.wrapS,o.wrapT=t.wrapT,o.name=t.name,En&&(En.dispose(),En=null),o}const Bi={POSITION:["byte","byte normalized","unsigned byte","unsigned byte normalized","short","short normalized","unsigned short","unsigned short normalized"],NORMAL:["byte normalized","short normalized"],TANGENT:["byte normalized","short normalized"],TEXCOORD:["byte","byte normalized","unsigned byte","short","short normalized","unsigned short"]};class ya{constructor(){this.pluginCallbacks=[],this.register(function(e){return new Su(e)}),this.register(function(e){return new Iu(e)}),this.register(function(e){return new Nu(e)}),this.register(function(e){return new Lu(e)}),this.register(function(e){return new Pu(e)}),this.register(function(e){return new Du(e)}),this.register(function(e){return new Ru(e)}),this.register(function(e){return new Cu(e)}),this.register(function(e){return new Ou(e)}),this.register(function(e){return new Fu(e)}),this.register(function(e){return new Bu(e)})}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,n,r,i){const o=new Au,a=[];for(let s=0,l=this.pluginCallbacks.length;st.times[t.times.length-1]){if(Math.abs(t.times[t.times.length-1]-e)<.001)return t.times.length-1;r[r.length-1]=e,r.set(t.times,0),i.set(t.values,0),i.set(o.evaluate(e),t.values.length),a=r.length-1}else for(let s=0;se){r.set(t.times.slice(0,s+1),0),r[s+1]=e,r.set(t.times.slice(s+1),s+2),i.set(t.values.slice(0,(s+1)*n),0),i.set(o.evaluate(e),(s+1)*n),i.set(t.values.slice((s+1)*n),(s+2)*n),a=s+1;break}}return t.times=r,t.values=i,a},mergeMorphTargetTracks:function(t,e){const n=[],r={},i=t.tracks;for(let o=0;o4?a=t.array[i*t.itemSize+o]:(o===0?a=t.getX(i):o===1?a=t.getY(i):o===2?a=t.getZ(i):o===3&&(a=t.getW(i)),t.normalized===!0&&(a=Dt.normalize(a,t.array))),r.min[o]=Math.min(r.min[o],a),r.max[o]=Math.max(r.max[o],a)}return r}function xa(t){return Math.ceil(t/4)*4}function cr(t,e=0){const n=xa(t.byteLength);if(n!==t.byteLength){const r=new Uint8Array(n);if(r.set(new Uint8Array(t)),e!==0)for(let i=t.byteLength;i"u"&&typeof OffscreenCanvas<"u"?new OffscreenCanvas(1,1):document.createElement("canvas")}function Hi(t,e){if(t.toBlob!==void 0)return new Promise(r=>t.toBlob(r,e));let n;return e==="image/jpeg"?n=.92:e==="image/webp"&&(n=.8),t.convertToBlob({type:e,quality:n})}class Au{constructor(){this.plugins=[],this.options={},this.pending=[],this.buffers=[],this.byteOffset=0,this.buffers=[],this.nodeMap=new Map,this.skins=[],this.extensionsUsed={},this.extensionsRequired={},this.uids=new Map,this.uid=0,this.json={asset:{version:"2.0",generator:"THREE.GLTFExporter"}},this.cache={meshes:new Map,attributes:new Map,attributesNormalized:new Map,materials:new Map,textures:new Map,images:new Map}}setPlugins(e){this.plugins=e}async write(e,n,r={}){this.options=Object.assign({binary:!1,trs:!1,onlyVisible:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},r),this.options.animations.length>0&&(this.options.trs=!0),this.processInput(e),await Promise.all(this.pending);const i=this,o=i.buffers,a=i.json;r=i.options;const s=i.extensionsUsed,l=i.extensionsRequired,u=new Blob(o,{type:"application/octet-stream"}),c=Object.keys(s),f=Object.keys(l);c.length>0&&(a.extensionsUsed=c),f.length>0&&(a.extensionsRequired=f),a.buffers&&a.buffers.length>0&&(a.buffers[0].byteLength=u.size),r.binary===!0?u.arrayBuffer().then(p=>{const d=cr(p),y=new DataView(new ArrayBuffer(ji));y.setUint32(0,d.byteLength,!0),y.setUint32(4,Tu,!0);const x=cr(_u(JSON.stringify(a)),32),v=new DataView(new ArrayBuffer(ji));v.setUint32(0,x.byteLength,!0),v.setUint32(4,ku,!0);const k=new ArrayBuffer(Ui),A=new DataView(k);A.setUint32(0,bu,!0),A.setUint32(4,wu,!0);const E=Ui+v.byteLength+x.byteLength+y.byteLength+d.byteLength;A.setUint32(8,E,!0),new Blob([k,v,x,y,d],{type:"application/octet-stream"}).arrayBuffer().then(n)}):a.buffers&&a.buffers.length>0?Fi(u).then(p=>{a.buffers[0].uri=p,n(a)}):n(a)}serializeUserData(e,n){if(Object.keys(e.userData).length===0)return;const r=this.options,i=this.extensionsUsed;try{const o=JSON.parse(JSON.stringify(e.userData));if(r.includeCustomExtensions&&o.gltfExtensions){n.extensions===void 0&&(n.extensions={});for(const a in o.gltfExtensions)n.extensions[a]=o.gltfExtensions[a],i[a]=!0;delete o.gltfExtensions}Object.keys(o).length>0&&(n.extras=o)}catch(o){console.warn("THREE.GLTFExporter: userData of '"+e.name+"' won't be serialized because of JSON.stringify error - "+o.message)}}getUID(e,n=!1){if(this.uids.has(e)===!1){const r=new Map;r.set(!0,this.uid++),r.set(!1,this.uid++),this.uids.set(e,r)}return this.uids.get(e).get(n)}isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;const n=new ae;for(let r=0,i=e.count;r5e-4)return!1;return!0}createNormalizedNormalAttribute(e){const n=this.cache;if(n.attributesNormalized.has(e))return n.attributesNormalized.get(e);const r=e.clone(),i=new ae;for(let o=0,a=r.count;o4?y=e.array[p*e.itemSize+d]:(d===0?y=e.getX(p):d===1?y=e.getY(p):d===2?y=e.getZ(p):d===3&&(y=e.getW(p)),e.normalized===!0&&(y=Dt.normalize(y,e.array))),n===pe.FLOAT?u.setFloat32(c,y,!0):n===pe.INT?u.setInt32(c,y,!0):n===pe.UNSIGNED_INT?u.setUint32(c,y,!0):n===pe.SHORT?u.setInt16(c,y,!0):n===pe.UNSIGNED_SHORT?u.setUint16(c,y,!0):n===pe.BYTE?u.setInt8(c,y):n===pe.UNSIGNED_BYTE&&u.setUint8(c,y),c+=s}const f={buffer:this.processBuffer(u.buffer),byteOffset:this.byteOffset,byteLength:l};return o!==void 0&&(f.target=o),o===pe.ARRAY_BUFFER&&(f.byteStride=e.itemSize*s),this.byteOffset+=l,a.bufferViews.push(f),{id:a.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){const n=this,r=n.json;return r.bufferViews||(r.bufferViews=[]),e.arrayBuffer().then(i=>{const o=cr(i),a={buffer:n.processBuffer(o),byteOffset:n.byteOffset,byteLength:o.byteLength};return n.byteOffset+=o.byteLength,r.bufferViews.push(a)-1})}processAccessor(e,n,r,i){const o=this.json,a={1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",9:"MAT3",16:"MAT4"};let s;if(e.array.constructor===Float32Array)s=pe.FLOAT;else if(e.array.constructor===Int32Array)s=pe.INT;else if(e.array.constructor===Uint32Array)s=pe.UNSIGNED_INT;else if(e.array.constructor===Int16Array)s=pe.SHORT;else if(e.array.constructor===Uint16Array)s=pe.UNSIGNED_SHORT;else if(e.array.constructor===Int8Array)s=pe.BYTE;else if(e.array.constructor===Uint8Array)s=pe.UNSIGNED_BYTE;else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type: "+e.array.constructor.name);if(r===void 0&&(r=0),i===void 0&&(i=e.count),i===0)return null;const l=Mu(e,r,i);let u;n!==void 0&&(u=e===n.index?pe.ELEMENT_ARRAY_BUFFER:pe.ARRAY_BUFFER);const c=this.processBufferView(e,s,r,i,u),f={bufferView:c.id,byteOffset:c.byteOffset,componentType:s,count:i,max:l.max,min:l.min,type:a[e.itemSize]};return e.normalized===!0&&(f.normalized=!0),o.accessors||(o.accessors=[]),o.accessors.push(f)-1}processImage(e,n,r,i="image/png"){if(e!==null){const o=this,a=o.cache,s=o.json,l=o.options,u=o.pending;a.images.has(e)||a.images.set(e,{});const c=a.images.get(e),f=i+":flipY/"+r.toString();if(c[f]!==void 0)return c[f];s.images||(s.images=[]);const p={mimeType:i},d=Vi();d.width=Math.min(e.width,l.maxTextureSize),d.height=Math.min(e.height,l.maxTextureSize);const y=d.getContext("2d");if(r===!0&&(y.translate(0,d.height),y.scale(1,-1)),e.data!==void 0){n!==Cr&&console.error("GLTFExporter: Only RGBAFormat is supported.",n),(e.width>l.maxTextureSize||e.height>l.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",e);const v=new Uint8ClampedArray(e.height*e.width*4);for(let k=0;ko.processBufferViewImage(v)).then(v=>{p.bufferView=v})):d.toDataURL!==void 0?p.uri=d.toDataURL(i):u.push(Hi(d,i).then(Fi).then(v=>{p.uri=v}));const x=s.images.push(p)-1;return c[f]=x,x}else throw new Error("THREE.GLTFExporter: No valid image data found. Unable to process texture.")}processSampler(e){const n=this.json;n.samplers||(n.samplers=[]);const r={magFilter:Je[e.magFilter],minFilter:Je[e.minFilter],wrapS:Je[e.wrapS],wrapT:Je[e.wrapT]};return n.samplers.push(r)-1}processTexture(e){const n=this.options,r=this.cache,i=this.json;if(r.textures.has(e))return r.textures.get(e);i.textures||(i.textures=[]),e instanceof er&&(e=lr(e,n.maxTextureSize));let o=e.userData.mimeType;o==="image/webp"&&(o="image/png");const a={sampler:this.processSampler(e),source:this.processImage(e.image,e.format,e.flipY,o)};e.name&&(a.name=e.name),this._invokeAll(function(l){l.writeTexture&&l.writeTexture(e,a)});const s=i.textures.push(a)-1;return r.textures.set(e,s),s}processMaterial(e){const n=this.cache,r=this.json;if(n.materials.has(e))return n.materials.get(e);if(e.isShaderMaterial)return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."),null;r.materials||(r.materials=[]);const i={pbrMetallicRoughness:{}};e.isMeshStandardMaterial!==!0&&e.isMeshBasicMaterial!==!0&&console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");const o=e.color.toArray().concat([e.opacity]);if(un(o,[1,1,1,1])||(i.pbrMetallicRoughness.baseColorFactor=o),e.isMeshStandardMaterial?(i.pbrMetallicRoughness.metallicFactor=e.metalness,i.pbrMetallicRoughness.roughnessFactor=e.roughness):(i.pbrMetallicRoughness.metallicFactor=.5,i.pbrMetallicRoughness.roughnessFactor=.5),e.metalnessMap||e.roughnessMap){const s=this.buildMetalRoughTexture(e.metalnessMap,e.roughnessMap),l={index:this.processTexture(s),channel:s.channel};this.applyTextureTransform(l,s),i.pbrMetallicRoughness.metallicRoughnessTexture=l}if(e.map){const s={index:this.processTexture(e.map),texCoord:e.map.channel};this.applyTextureTransform(s,e.map),i.pbrMetallicRoughness.baseColorTexture=s}if(e.emissive){const s=e.emissive;if(Math.max(s.r,s.g,s.b)>0&&(i.emissiveFactor=e.emissive.toArray()),e.emissiveMap){const l={index:this.processTexture(e.emissiveMap),texCoord:e.emissiveMap.channel};this.applyTextureTransform(l,e.emissiveMap),i.emissiveTexture=l}}if(e.normalMap){const s={index:this.processTexture(e.normalMap),texCoord:e.normalMap.channel};e.normalScale&&e.normalScale.x!==1&&(s.scale=e.normalScale.x),this.applyTextureTransform(s,e.normalMap),i.normalTexture=s}if(e.aoMap){const s={index:this.processTexture(e.aoMap),texCoord:e.aoMap.channel};e.aoMapIntensity!==1&&(s.strength=e.aoMapIntensity),this.applyTextureTransform(s,e.aoMap),i.occlusionTexture=s}e.transparent?i.alphaMode="BLEND":e.alphaTest>0&&(i.alphaMode="MASK",i.alphaCutoff=e.alphaTest),e.side===Kn&&(i.doubleSided=!0),e.name!==""&&(i.name=e.name),this.serializeUserData(e,i),this._invokeAll(function(s){s.writeMaterial&&s.writeMaterial(e,i)});const a=r.materials.push(i)-1;return n.materials.set(e,a),a}processMesh(e){const n=this.cache,r=this.json,i=[e.geometry.uuid];if(Array.isArray(e.material))for(let E=0,C=e.material.length;E=152?{uv:"TEXCOORD_0",uv1:"TEXCOORD_1",uv2:"TEXCOORD_2",uv3:"TEXCOORD_3"}:{uv:"TEXCOORD_0",uv2:"TEXCOORD_1"},color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},d=a.getAttribute("normal");d!==void 0&&!this.isNormalizedNormalAttribute(d)&&(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),a.setAttribute("normal",this.createNormalizedNormalAttribute(d)));let y=null;for(let E in a.attributes){if(E.slice(0,5)==="morph")continue;const C=a.attributes[E];if(E=p[E]||E.toUpperCase(),/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(E)||(E="_"+E),n.attributes.has(this.getUID(C))){u[E]=n.attributes.get(this.getUID(C));continue}y=null;const P=C.array;E==="JOINTS_0"&&!(P instanceof Uint16Array)&&!(P instanceof Uint8Array)&&(console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),y=new Nt(new Uint16Array(P),C.itemSize,C.normalized));const h=this.processAccessor(y||C,a);h!==null&&(E.startsWith("_")||this.detectMeshQuantization(E,C),u[E]=h,n.attributes.set(this.getUID(C),h))}if(d!==void 0&&a.setAttribute("normal",d),Object.keys(u).length===0)return null;if(e.morphTargetInfluences!==void 0&&e.morphTargetInfluences.length>0){const E=[],C=[],P={};if(e.morphTargetDictionary!==void 0)for(const h in e.morphTargetDictionary)P[e.morphTargetDictionary[h]]=h;for(let h=0;h0&&(l.extras={},l.extras.targetNames=C)}const x=Array.isArray(e.material);if(x&&a.groups.length===0)return null;const v=x?e.material:[e.material],k=x?a.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let E=0,C=k.length;E0&&(P.targets=f),a.index!==null){let I=this.getUID(a.index);(k[E].start!==void 0||k[E].count!==void 0)&&(I+=":"+k[E].start+":"+k[E].count),n.attributes.has(I)?P.indices=n.attributes.get(I):(P.indices=this.processAccessor(a.index,a,k[E].start,k[E].count),n.attributes.set(I,P.indices)),P.indices===null&&delete P.indices}const h=this.processMaterial(v[k[E].materialIndex]);h!==null&&(P.material=h),c.push(P)}l.primitives=c,r.meshes||(r.meshes=[]),this._invokeAll(function(E){E.writeMesh&&E.writeMesh(e,l)});const A=r.meshes.push(l)-1;return n.meshes.set(o,A),A}detectMeshQuantization(e,n){if(this.extensionsUsed[ur])return;let r;switch(n.array.constructor){case Int8Array:r="byte";break;case Uint8Array:r="unsigned byte";break;case Int16Array:r="short";break;case Uint16Array:r="unsigned short";break;default:return}n.normalized&&(r+=" normalized");const i=e.split("_",1)[0];Bi[i]&&Bi[i].includes(r)&&(this.extensionsUsed[ur]=!0,this.extensionsRequired[ur]=!0)}processCamera(e){const n=this.json;n.cameras||(n.cameras=[]);const r=e.isOrthographicCamera,i={type:r?"orthographic":"perspective"};return r?i.orthographic={xmag:e.right*2,ymag:e.top*2,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:i.perspective={aspectRatio:e.aspect,yfov:Dt.degToRad(e.fov),zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},e.name!==""&&(i.name=e.type),n.cameras.push(i)-1}processAnimation(e,n){const r=this.json,i=this.nodeMap;r.animations||(r.animations=[]),e=ya.Utils.mergeMorphTargetTracks(e.clone(),n);const o=e.tracks,a=[],s=[];for(let l=0;l0){const s=[];for(let l=0,u=e.children.length;l0&&(o.children=s)}this._invokeAll(function(s){s.writeNode&&s.writeNode(e,o)});const a=n.nodes.push(o)-1;return i.set(e,a),a}processScene(e){const n=this.json,r=this.options;n.scenes||(n.scenes=[],n.scene=0);const i={};e.name!==""&&(i.name=e.name),n.scenes.push(i);const o=[];for(let a=0,s=e.children.length;a0&&(i.nodes=o),this.serializeUserData(e,i)}processObjects(e){const n=new Nr;n.name="AuxScene";for(let r=0;r0&&this.processObjects(r);for(let i=0;i0&&(a.range=e.distance)):e.isSpotLight&&(a.type="spot",e.distance>0&&(a.range=e.distance),a.spot={},a.spot.innerConeAngle=(e.penumbra-1)*e.angle*-1,a.spot.outerConeAngle=e.angle),e.decay!==void 0&&e.decay!==2&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),e.target&&(e.target.parent!==e||e.target.position.x!==0||e.target.position.y!==0||e.target.position.z!==-1)&&console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),o[this.name]||(i.extensions=i.extensions||{},i.extensions[this.name]={lights:[]},o[this.name]=!0);const s=i.extensions[this.name].lights;s.push(a),n.extensions=n.extensions||{},n.extensions[this.name]={light:s.length-1}}}let Iu=class{constructor(t){this.writer=t,this.name="KHR_materials_unlit"}writeMaterial(t,e){if(!t.isMeshBasicMaterial)return;const n=this.writer.extensionsUsed;e.extensions=e.extensions||{},e.extensions[this.name]={},n[this.name]=!0,e.pbrMetallicRoughness.metallicFactor=0,e.pbrMetallicRoughness.roughnessFactor=.9}},Ru=class{constructor(t){this.writer=t,this.name="KHR_materials_clearcoat"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.clearcoat===0)return;const n=this.writer,r=n.extensionsUsed,i={};if(i.clearcoatFactor=t.clearcoat,t.clearcoatMap){const o={index:n.processTexture(t.clearcoatMap),texCoord:t.clearcoatMap.channel};n.applyTextureTransform(o,t.clearcoatMap),i.clearcoatTexture=o}if(i.clearcoatRoughnessFactor=t.clearcoatRoughness,t.clearcoatRoughnessMap){const o={index:n.processTexture(t.clearcoatRoughnessMap),texCoord:t.clearcoatRoughnessMap.channel};n.applyTextureTransform(o,t.clearcoatRoughnessMap),i.clearcoatRoughnessTexture=o}if(t.clearcoatNormalMap){const o={index:n.processTexture(t.clearcoatNormalMap),texCoord:t.clearcoatNormalMap.channel};n.applyTextureTransform(o,t.clearcoatNormalMap),i.clearcoatNormalTexture=o}e.extensions=e.extensions||{},e.extensions[this.name]=i,r[this.name]=!0}},Cu=class{constructor(t){this.writer=t,this.name="KHR_materials_iridescence"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.iridescence===0)return;const n=this.writer,r=n.extensionsUsed,i={};if(i.iridescenceFactor=t.iridescence,t.iridescenceMap){const o={index:n.processTexture(t.iridescenceMap),texCoord:t.iridescenceMap.channel};n.applyTextureTransform(o,t.iridescenceMap),i.iridescenceTexture=o}if(i.iridescenceIor=t.iridescenceIOR,i.iridescenceThicknessMinimum=t.iridescenceThicknessRange[0],i.iridescenceThicknessMaximum=t.iridescenceThicknessRange[1],t.iridescenceThicknessMap){const o={index:n.processTexture(t.iridescenceThicknessMap),texCoord:t.iridescenceThicknessMap.channel};n.applyTextureTransform(o,t.iridescenceThicknessMap),i.iridescenceThicknessTexture=o}e.extensions=e.extensions||{},e.extensions[this.name]=i,r[this.name]=!0}},Nu=class{constructor(t){this.writer=t,this.name="KHR_materials_transmission"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.transmission===0)return;const n=this.writer,r=n.extensionsUsed,i={};if(i.transmissionFactor=t.transmission,t.transmissionMap){const o={index:n.processTexture(t.transmissionMap),texCoord:t.transmissionMap.channel};n.applyTextureTransform(o,t.transmissionMap),i.transmissionTexture=o}e.extensions=e.extensions||{},e.extensions[this.name]=i,r[this.name]=!0}},Lu=class{constructor(t){this.writer=t,this.name="KHR_materials_volume"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.transmission===0)return;const n=this.writer,r=n.extensionsUsed,i={};if(i.thicknessFactor=t.thickness,t.thicknessMap){const o={index:n.processTexture(t.thicknessMap),texCoord:t.thicknessMap.channel};n.applyTextureTransform(o,t.thicknessMap),i.thicknessTexture=o}i.attenuationDistance=t.attenuationDistance,i.attenuationColor=t.attenuationColor.toArray(),e.extensions=e.extensions||{},e.extensions[this.name]=i,r[this.name]=!0}},Pu=class{constructor(t){this.writer=t,this.name="KHR_materials_ior"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.ior===1.5)return;const n=this.writer.extensionsUsed,r={};r.ior=t.ior,e.extensions=e.extensions||{},e.extensions[this.name]=r,n[this.name]=!0}},Du=class{constructor(t){this.writer=t,this.name="KHR_materials_specular"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.specularIntensity===1&&t.specularColor.equals(vu)&&!t.specularIntensityMap&&!t.specularColorTexture)return;const n=this.writer,r=n.extensionsUsed,i={};if(t.specularIntensityMap){const o={index:n.processTexture(t.specularIntensityMap),texCoord:t.specularIntensityMap.channel};n.applyTextureTransform(o,t.specularIntensityMap),i.specularTexture=o}if(t.specularColorMap){const o={index:n.processTexture(t.specularColorMap),texCoord:t.specularColorMap.channel};n.applyTextureTransform(o,t.specularColorMap),i.specularColorTexture=o}i.specularFactor=t.specularIntensity,i.specularColorFactor=t.specularColor.toArray(),e.extensions=e.extensions||{},e.extensions[this.name]=i,r[this.name]=!0}},Ou=class{constructor(t){this.writer=t,this.name="KHR_materials_sheen"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.sheen==0)return;const n=this.writer,r=n.extensionsUsed,i={};if(t.sheenRoughnessMap){const o={index:n.processTexture(t.sheenRoughnessMap),texCoord:t.sheenRoughnessMap.channel};n.applyTextureTransform(o,t.sheenRoughnessMap),i.sheenRoughnessTexture=o}if(t.sheenColorMap){const o={index:n.processTexture(t.sheenColorMap),texCoord:t.sheenColorMap.channel};n.applyTextureTransform(o,t.sheenColorMap),i.sheenColorTexture=o}i.sheenRoughnessFactor=t.sheenRoughness,i.sheenColorFactor=t.sheenColor.toArray(),e.extensions=e.extensions||{},e.extensions[this.name]=i,r[this.name]=!0}},Fu=class{constructor(t){this.writer=t,this.name="KHR_materials_anisotropy"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.anisotropy==0)return;const n=this.writer,r=n.extensionsUsed,i={};if(t.anisotropyMap){const o={index:n.processTexture(t.anisotropyMap)};n.applyTextureTransform(o,t.anisotropyMap),i.anisotropyTexture=o}i.anisotropyStrength=t.anisotropy,i.anisotropyRotation=t.anisotropyRotation,e.extensions=e.extensions||{},e.extensions[this.name]=i,r[this.name]=!0}},Bu=class{constructor(t){this.writer=t,this.name="KHR_materials_emissive_strength"}writeMaterial(t,e){if(!t.isMeshStandardMaterial||t.emissiveIntensity===1)return;const n=this.writer.extensionsUsed,r={};r.emissiveStrength=t.emissiveIntensity,e.extensions=e.extensions||{},e.extensions[this.name]=r,n[this.name]=!0}};var xn=Uint8Array,va=Uint16Array,zu=Uint32Array,Uu=new xn([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),ju=new xn([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),ba=function(t,e){for(var n=new va(31),r=0;r<31;++r)n[r]=e+=1<>>1|(Ne&21845)<<1;wt=(wt&52428)>>>2|(wt&13107)<<2,wt=(wt&61680)>>>4|(wt&3855)<<4,$u[Ne]=((wt&65280)>>>8|(wt&255)<<8)>>>1}var Wn=new xn(288);for(var Ne=0;Ne<144;++Ne)Wn[Ne]=8;for(var Ne=144;Ne<256;++Ne)Wn[Ne]=9;for(var Ne=256;Ne<280;++Ne)Wn[Ne]=7;for(var Ne=280;Ne<288;++Ne)Wn[Ne]=8;var Gu=new xn(32);for(var Ne=0;Ne<32;++Ne)Gu[Ne]=5;var Yu=new xn(0),Ku=typeof TextDecoder<"u"&&new TextDecoder,qu=0;try{Ku.decode(Yu,{stream:!0}),qu=1}catch{}var Wu=Object.defineProperty,Xu=(t,e,n)=>e in t?Wu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Zu=(t,e,n)=>(Xu(t,e+"",n),n);const ka=class extends Pt{constructor(t,e={}){super(t),this.isReflector=!0,this.type="Reflector",this.camera=new Mt;const n=this,r=e.color!==void 0?new ze(e.color):new ze(8355711),i=e.textureWidth||512,o=e.textureHeight||512,a=e.clipBias||0,s=e.shader||ka.ReflectorShader,l=e.multisample!==void 0?e.multisample:4,u=new Ko,c=new ae,f=new ae,p=new ae,d=new xt,y=new ae(0,0,-1),x=new At,v=new ae,k=new ae,A=new At,E=new xt,C=this.camera,P=new Fs(i,o,{samples:l,type:Bs}),h=new yn({uniforms:ni.clone(s.uniforms),fragmentShader:s.fragmentShader,vertexShader:s.vertexShader});h.uniforms.tDiffuse.value=P.texture,h.uniforms.color.value=r,h.uniforms.textureMatrix.value=E,this.material=h,this.onBeforeRender=function(I,b,g){if(f.setFromMatrixPosition(n.matrixWorld),p.setFromMatrixPosition(g.matrixWorld),d.extractRotation(n.matrixWorld),c.set(0,0,1),c.applyMatrix4(d),v.subVectors(f,p),v.dot(c)>0)return;v.reflect(c).negate(),v.add(f),d.extractRotation(g.matrixWorld),y.set(0,0,-1),y.applyMatrix4(d),y.add(p),k.subVectors(f,y),k.reflect(c).negate(),k.add(f),C.position.copy(v),C.up.set(0,1,0),C.up.applyMatrix4(d),C.up.reflect(c),C.lookAt(k),C.far=g.far,C.updateMatrixWorld(),C.projectionMatrix.copy(g.projectionMatrix),E.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),E.multiply(C.projectionMatrix),E.multiply(C.matrixWorldInverse),E.multiply(n.matrixWorld),u.setFromNormalAndCoplanarPoint(c,f),u.applyMatrix4(C.matrixWorldInverse),x.set(u.normal.x,u.normal.y,u.normal.z,u.constant);const m=C.projectionMatrix;A.x=(Math.sign(x.x)+m.elements[8])/m.elements[0],A.y=(Math.sign(x.y)+m.elements[9])/m.elements[5],A.z=-1,A.w=(1+m.elements[10])/m.elements[14],x.multiplyScalar(2/x.dot(A)),m.elements[2]=x.x,m.elements[6]=x.y,m.elements[10]=x.z+1-a,m.elements[14]=x.w,n.visible=!1;const T=I.getRenderTarget(),S=I.xr.enabled,B=I.shadowMap.autoUpdate,D=I.toneMapping;let F=!1;"outputColorSpace"in I?F=I.outputColorSpace==="srgb":F=I.outputEncoding===3001,I.xr.enabled=!1,I.shadowMap.autoUpdate=!1,"outputColorSpace"in I?I.outputColorSpace="srgb-linear":I.outputEncoding=3e3,I.toneMapping=zs,I.setRenderTarget(P),I.state.buffers.depth.setMask(!0),I.autoClear===!1&&I.clear(),I.render(b,C),I.xr.enabled=S,I.shadowMap.autoUpdate=B,I.toneMapping=D,"outputColorSpace"in I?I.outputColorSpace=F?"srgb":"srgb-linear":I.outputEncoding=F?3001:3e3,I.setRenderTarget(T);const j=g.viewport;j!==void 0&&I.state.viewport(j),n.visible=!0},this.getRenderTarget=function(){return P},this.dispose=function(){P.dispose(),n.material.dispose()}}};let Or=ka;Zu(Or,"ReflectorShader",{uniforms:{color:{value:null},tDiffuse:{value:null},textureMatrix:{value:null}},vertexShader:` + `})),Bt.uniforms.blitTexture.value=t,Bt.defines.IS_SRGB="colorSpace"in t?t.colorSpace==="srgb":t.encoding===3001,Bt.needsUpdate=!0,Mn||(Mn=new Pt(sr,Bt),Mn.frustrumCulled=!1);const r=new Mt,i=new Nr;i.add(Mn),n||(n=En=new Hs({antialias:!1})),n.setSize(Math.min(t.image.width,e),Math.min(t.image.height,e)),n.clear(),n.render(i,r);const o=new Bn(n.domElement);return o.minFilter=t.minFilter,o.magFilter=t.magFilter,o.wrapS=t.wrapS,o.wrapT=t.wrapT,o.name=t.name,En&&(En.dispose(),En=null),o}const Bi={POSITION:["byte","byte normalized","unsigned byte","unsigned byte normalized","short","short normalized","unsigned short","unsigned short normalized"],NORMAL:["byte normalized","short normalized"],TANGENT:["byte normalized","short normalized"],TEXCOORD:["byte","byte normalized","unsigned byte","short","short normalized","unsigned short"]};class ya{constructor(){this.pluginCallbacks=[],this.register(function(e){return new Iu(e)}),this.register(function(e){return new Ru(e)}),this.register(function(e){return new Lu(e)}),this.register(function(e){return new Pu(e)}),this.register(function(e){return new Du(e)}),this.register(function(e){return new Ou(e)}),this.register(function(e){return new Cu(e)}),this.register(function(e){return new Nu(e)}),this.register(function(e){return new Fu(e)}),this.register(function(e){return new Bu(e)}),this.register(function(e){return new zu(e)})}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,n,r,i){const o=new Su,a=[];for(let s=0,l=this.pluginCallbacks.length;st.times[t.times.length-1]){if(Math.abs(t.times[t.times.length-1]-e)<.001)return t.times.length-1;r[r.length-1]=e,r.set(t.times,0),i.set(t.values,0),i.set(o.evaluate(e),t.values.length),a=r.length-1}else for(let s=0;se){r.set(t.times.slice(0,s+1),0),r[s+1]=e,r.set(t.times.slice(s+1),s+2),i.set(t.values.slice(0,(s+1)*n),0),i.set(o.evaluate(e),(s+1)*n),i.set(t.values.slice((s+1)*n),(s+2)*n),a=s+1;break}}return t.times=r,t.values=i,a},mergeMorphTargetTracks:function(t,e){const n=[],r={},i=t.tracks;for(let o=0;o4?a=t.array[i*t.itemSize+o]:(o===0?a=t.getX(i):o===1?a=t.getY(i):o===2?a=t.getZ(i):o===3&&(a=t.getW(i)),t.normalized===!0&&(a=Dt.normalize(a,t.array))),r.min[o]=Math.min(r.min[o],a),r.max[o]=Math.max(r.max[o],a)}return r}function xa(t){return Math.ceil(t/4)*4}function cr(t,e=0){const n=xa(t.byteLength);if(n!==t.byteLength){const r=new Uint8Array(n);if(r.set(new Uint8Array(t)),e!==0)for(let i=t.byteLength;i"u"&&typeof OffscreenCanvas<"u"?new OffscreenCanvas(1,1):document.createElement("canvas")}function Hi(t,e){if(t.toBlob!==void 0)return new Promise(r=>t.toBlob(r,e));let n;return e==="image/jpeg"?n=.92:e==="image/webp"&&(n=.8),t.convertToBlob({type:e,quality:n})}class Su{constructor(){this.plugins=[],this.options={},this.pending=[],this.buffers=[],this.byteOffset=0,this.buffers=[],this.nodeMap=new Map,this.skins=[],this.extensionsUsed={},this.extensionsRequired={},this.uids=new Map,this.uid=0,this.json={asset:{version:"2.0",generator:"THREE.GLTFExporter"}},this.cache={meshes:new Map,attributes:new Map,attributesNormalized:new Map,materials:new Map,textures:new Map,images:new Map}}setPlugins(e){this.plugins=e}async write(e,n,r={}){this.options=Object.assign({binary:!1,trs:!1,onlyVisible:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},r),this.options.animations.length>0&&(this.options.trs=!0),this.processInput(e),await Promise.all(this.pending);const i=this,o=i.buffers,a=i.json;r=i.options;const s=i.extensionsUsed,l=i.extensionsRequired,u=new Blob(o,{type:"application/octet-stream"}),c=Object.keys(s),f=Object.keys(l);c.length>0&&(a.extensionsUsed=c),f.length>0&&(a.extensionsRequired=f),a.buffers&&a.buffers.length>0&&(a.buffers[0].byteLength=u.size),r.binary===!0?u.arrayBuffer().then(p=>{const d=cr(p),y=new DataView(new ArrayBuffer(ji));y.setUint32(0,d.byteLength,!0),y.setUint32(4,_u,!0);const x=cr(Eu(JSON.stringify(a)),32),v=new DataView(new ArrayBuffer(ji));v.setUint32(0,x.byteLength,!0),v.setUint32(4,Tu,!0);const k=new ArrayBuffer(Ui),A=new DataView(k);A.setUint32(0,wu,!0),A.setUint32(4,ku,!0);const E=Ui+v.byteLength+x.byteLength+y.byteLength+d.byteLength;A.setUint32(8,E,!0),new Blob([k,v,x,y,d],{type:"application/octet-stream"}).arrayBuffer().then(n)}):a.buffers&&a.buffers.length>0?Fi(u).then(p=>{a.buffers[0].uri=p,n(a)}):n(a)}serializeUserData(e,n){if(Object.keys(e.userData).length===0)return;const r=this.options,i=this.extensionsUsed;try{const o=JSON.parse(JSON.stringify(e.userData));if(r.includeCustomExtensions&&o.gltfExtensions){n.extensions===void 0&&(n.extensions={});for(const a in o.gltfExtensions)n.extensions[a]=o.gltfExtensions[a],i[a]=!0;delete o.gltfExtensions}Object.keys(o).length>0&&(n.extras=o)}catch(o){console.warn("THREE.GLTFExporter: userData of '"+e.name+"' won't be serialized because of JSON.stringify error - "+o.message)}}getUID(e,n=!1){if(this.uids.has(e)===!1){const r=new Map;r.set(!0,this.uid++),r.set(!1,this.uid++),this.uids.set(e,r)}return this.uids.get(e).get(n)}isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;const n=new ae;for(let r=0,i=e.count;r5e-4)return!1;return!0}createNormalizedNormalAttribute(e){const n=this.cache;if(n.attributesNormalized.has(e))return n.attributesNormalized.get(e);const r=e.clone(),i=new ae;for(let o=0,a=r.count;o4?y=e.array[p*e.itemSize+d]:(d===0?y=e.getX(p):d===1?y=e.getY(p):d===2?y=e.getZ(p):d===3&&(y=e.getW(p)),e.normalized===!0&&(y=Dt.normalize(y,e.array))),n===pe.FLOAT?u.setFloat32(c,y,!0):n===pe.INT?u.setInt32(c,y,!0):n===pe.UNSIGNED_INT?u.setUint32(c,y,!0):n===pe.SHORT?u.setInt16(c,y,!0):n===pe.UNSIGNED_SHORT?u.setUint16(c,y,!0):n===pe.BYTE?u.setInt8(c,y):n===pe.UNSIGNED_BYTE&&u.setUint8(c,y),c+=s}const f={buffer:this.processBuffer(u.buffer),byteOffset:this.byteOffset,byteLength:l};return o!==void 0&&(f.target=o),o===pe.ARRAY_BUFFER&&(f.byteStride=e.itemSize*s),this.byteOffset+=l,a.bufferViews.push(f),{id:a.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){const n=this,r=n.json;return r.bufferViews||(r.bufferViews=[]),e.arrayBuffer().then(i=>{const o=cr(i),a={buffer:n.processBuffer(o),byteOffset:n.byteOffset,byteLength:o.byteLength};return n.byteOffset+=o.byteLength,r.bufferViews.push(a)-1})}processAccessor(e,n,r,i){const o=this.json,a={1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",9:"MAT3",16:"MAT4"};let s;if(e.array.constructor===Float32Array)s=pe.FLOAT;else if(e.array.constructor===Int32Array)s=pe.INT;else if(e.array.constructor===Uint32Array)s=pe.UNSIGNED_INT;else if(e.array.constructor===Int16Array)s=pe.SHORT;else if(e.array.constructor===Uint16Array)s=pe.UNSIGNED_SHORT;else if(e.array.constructor===Int8Array)s=pe.BYTE;else if(e.array.constructor===Uint8Array)s=pe.UNSIGNED_BYTE;else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type: "+e.array.constructor.name);if(r===void 0&&(r=0),i===void 0&&(i=e.count),i===0)return null;const l=Au(e,r,i);let u;n!==void 0&&(u=e===n.index?pe.ELEMENT_ARRAY_BUFFER:pe.ARRAY_BUFFER);const c=this.processBufferView(e,s,r,i,u),f={bufferView:c.id,byteOffset:c.byteOffset,componentType:s,count:i,max:l.max,min:l.min,type:a[e.itemSize]};return e.normalized===!0&&(f.normalized=!0),o.accessors||(o.accessors=[]),o.accessors.push(f)-1}processImage(e,n,r,i="image/png"){if(e!==null){const o=this,a=o.cache,s=o.json,l=o.options,u=o.pending;a.images.has(e)||a.images.set(e,{});const c=a.images.get(e),f=i+":flipY/"+r.toString();if(c[f]!==void 0)return c[f];s.images||(s.images=[]);const p={mimeType:i},d=Vi();d.width=Math.min(e.width,l.maxTextureSize),d.height=Math.min(e.height,l.maxTextureSize);const y=d.getContext("2d");if(r===!0&&(y.translate(0,d.height),y.scale(1,-1)),e.data!==void 0){n!==Cr&&console.error("GLTFExporter: Only RGBAFormat is supported.",n),(e.width>l.maxTextureSize||e.height>l.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",e);const v=new Uint8ClampedArray(e.height*e.width*4);for(let k=0;ko.processBufferViewImage(v)).then(v=>{p.bufferView=v})):d.toDataURL!==void 0?p.uri=d.toDataURL(i):u.push(Hi(d,i).then(Fi).then(v=>{p.uri=v}));const x=s.images.push(p)-1;return c[f]=x,x}else throw new Error("THREE.GLTFExporter: No valid image data found. Unable to process texture.")}processSampler(e){const n=this.json;n.samplers||(n.samplers=[]);const r={magFilter:Je[e.magFilter],minFilter:Je[e.minFilter],wrapS:Je[e.wrapS],wrapT:Je[e.wrapT]};return n.samplers.push(r)-1}processTexture(e){const n=this.options,r=this.cache,i=this.json;if(r.textures.has(e))return r.textures.get(e);i.textures||(i.textures=[]),e instanceof er&&(e=lr(e,n.maxTextureSize));let o=e.userData.mimeType;o==="image/webp"&&(o="image/png");const a={sampler:this.processSampler(e),source:this.processImage(e.image,e.format,e.flipY,o)};e.name&&(a.name=e.name),this._invokeAll(function(l){l.writeTexture&&l.writeTexture(e,a)});const s=i.textures.push(a)-1;return r.textures.set(e,s),s}processMaterial(e){const n=this.cache,r=this.json;if(n.materials.has(e))return n.materials.get(e);if(e.isShaderMaterial)return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."),null;r.materials||(r.materials=[]);const i={pbrMetallicRoughness:{}};e.isMeshStandardMaterial!==!0&&e.isMeshBasicMaterial!==!0&&console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");const o=e.color.toArray().concat([e.opacity]);if(un(o,[1,1,1,1])||(i.pbrMetallicRoughness.baseColorFactor=o),e.isMeshStandardMaterial?(i.pbrMetallicRoughness.metallicFactor=e.metalness,i.pbrMetallicRoughness.roughnessFactor=e.roughness):(i.pbrMetallicRoughness.metallicFactor=.5,i.pbrMetallicRoughness.roughnessFactor=.5),e.metalnessMap||e.roughnessMap){const s=this.buildMetalRoughTexture(e.metalnessMap,e.roughnessMap),l={index:this.processTexture(s),channel:s.channel};this.applyTextureTransform(l,s),i.pbrMetallicRoughness.metallicRoughnessTexture=l}if(e.map){const s={index:this.processTexture(e.map),texCoord:e.map.channel};this.applyTextureTransform(s,e.map),i.pbrMetallicRoughness.baseColorTexture=s}if(e.emissive){const s=e.emissive;if(Math.max(s.r,s.g,s.b)>0&&(i.emissiveFactor=e.emissive.toArray()),e.emissiveMap){const l={index:this.processTexture(e.emissiveMap),texCoord:e.emissiveMap.channel};this.applyTextureTransform(l,e.emissiveMap),i.emissiveTexture=l}}if(e.normalMap){const s={index:this.processTexture(e.normalMap),texCoord:e.normalMap.channel};e.normalScale&&e.normalScale.x!==1&&(s.scale=e.normalScale.x),this.applyTextureTransform(s,e.normalMap),i.normalTexture=s}if(e.aoMap){const s={index:this.processTexture(e.aoMap),texCoord:e.aoMap.channel};e.aoMapIntensity!==1&&(s.strength=e.aoMapIntensity),this.applyTextureTransform(s,e.aoMap),i.occlusionTexture=s}e.transparent?i.alphaMode="BLEND":e.alphaTest>0&&(i.alphaMode="MASK",i.alphaCutoff=e.alphaTest),e.side===Kn&&(i.doubleSided=!0),e.name!==""&&(i.name=e.name),this.serializeUserData(e,i),this._invokeAll(function(s){s.writeMaterial&&s.writeMaterial(e,i)});const a=r.materials.push(i)-1;return n.materials.set(e,a),a}processMesh(e){const n=this.cache,r=this.json,i=[e.geometry.uuid];if(Array.isArray(e.material))for(let E=0,C=e.material.length;E=152?{uv:"TEXCOORD_0",uv1:"TEXCOORD_1",uv2:"TEXCOORD_2",uv3:"TEXCOORD_3"}:{uv:"TEXCOORD_0",uv2:"TEXCOORD_1"},color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},d=a.getAttribute("normal");d!==void 0&&!this.isNormalizedNormalAttribute(d)&&(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),a.setAttribute("normal",this.createNormalizedNormalAttribute(d)));let y=null;for(let E in a.attributes){if(E.slice(0,5)==="morph")continue;const C=a.attributes[E];if(E=p[E]||E.toUpperCase(),/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(E)||(E="_"+E),n.attributes.has(this.getUID(C))){u[E]=n.attributes.get(this.getUID(C));continue}y=null;const P=C.array;E==="JOINTS_0"&&!(P instanceof Uint16Array)&&!(P instanceof Uint8Array)&&(console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),y=new Nt(new Uint16Array(P),C.itemSize,C.normalized));const h=this.processAccessor(y||C,a);h!==null&&(E.startsWith("_")||this.detectMeshQuantization(E,C),u[E]=h,n.attributes.set(this.getUID(C),h))}if(d!==void 0&&a.setAttribute("normal",d),Object.keys(u).length===0)return null;if(e.morphTargetInfluences!==void 0&&e.morphTargetInfluences.length>0){const E=[],C=[],P={};if(e.morphTargetDictionary!==void 0)for(const h in e.morphTargetDictionary)P[e.morphTargetDictionary[h]]=h;for(let h=0;h0&&(l.extras={},l.extras.targetNames=C)}const x=Array.isArray(e.material);if(x&&a.groups.length===0)return null;const v=x?e.material:[e.material],k=x?a.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let E=0,C=k.length;E0&&(P.targets=f),a.index!==null){let I=this.getUID(a.index);(k[E].start!==void 0||k[E].count!==void 0)&&(I+=":"+k[E].start+":"+k[E].count),n.attributes.has(I)?P.indices=n.attributes.get(I):(P.indices=this.processAccessor(a.index,a,k[E].start,k[E].count),n.attributes.set(I,P.indices)),P.indices===null&&delete P.indices}const h=this.processMaterial(v[k[E].materialIndex]);h!==null&&(P.material=h),c.push(P)}l.primitives=c,r.meshes||(r.meshes=[]),this._invokeAll(function(E){E.writeMesh&&E.writeMesh(e,l)});const A=r.meshes.push(l)-1;return n.meshes.set(o,A),A}detectMeshQuantization(e,n){if(this.extensionsUsed[ur])return;let r;switch(n.array.constructor){case Int8Array:r="byte";break;case Uint8Array:r="unsigned byte";break;case Int16Array:r="short";break;case Uint16Array:r="unsigned short";break;default:return}n.normalized&&(r+=" normalized");const i=e.split("_",1)[0];Bi[i]&&Bi[i].includes(r)&&(this.extensionsUsed[ur]=!0,this.extensionsRequired[ur]=!0)}processCamera(e){const n=this.json;n.cameras||(n.cameras=[]);const r=e.isOrthographicCamera,i={type:r?"orthographic":"perspective"};return r?i.orthographic={xmag:e.right*2,ymag:e.top*2,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:i.perspective={aspectRatio:e.aspect,yfov:Dt.degToRad(e.fov),zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},e.name!==""&&(i.name=e.type),n.cameras.push(i)-1}processAnimation(e,n){const r=this.json,i=this.nodeMap;r.animations||(r.animations=[]),e=ya.Utils.mergeMorphTargetTracks(e.clone(),n);const o=e.tracks,a=[],s=[];for(let l=0;l0){const s=[];for(let l=0,u=e.children.length;l0&&(o.children=s)}this._invokeAll(function(s){s.writeNode&&s.writeNode(e,o)});const a=n.nodes.push(o)-1;return i.set(e,a),a}processScene(e){const n=this.json,r=this.options;n.scenes||(n.scenes=[],n.scene=0);const i={};e.name!==""&&(i.name=e.name),n.scenes.push(i);const o=[];for(let a=0,s=e.children.length;a0&&(i.nodes=o),this.serializeUserData(e,i)}processObjects(e){const n=new Nr;n.name="AuxScene";for(let r=0;r0&&this.processObjects(r);for(let i=0;i0&&(a.range=e.distance)):e.isSpotLight&&(a.type="spot",e.distance>0&&(a.range=e.distance),a.spot={},a.spot.innerConeAngle=(e.penumbra-1)*e.angle*-1,a.spot.outerConeAngle=e.angle),e.decay!==void 0&&e.decay!==2&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),e.target&&(e.target.parent!==e||e.target.position.x!==0||e.target.position.y!==0||e.target.position.z!==-1)&&console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),o[this.name]||(i.extensions=i.extensions||{},i.extensions[this.name]={lights:[]},o[this.name]=!0);const s=i.extensions[this.name].lights;s.push(a),n.extensions=n.extensions||{},n.extensions[this.name]={light:s.length-1}}}let Ru=class{constructor(t){this.writer=t,this.name="KHR_materials_unlit"}writeMaterial(t,e){if(!t.isMeshBasicMaterial)return;const n=this.writer.extensionsUsed;e.extensions=e.extensions||{},e.extensions[this.name]={},n[this.name]=!0,e.pbrMetallicRoughness.metallicFactor=0,e.pbrMetallicRoughness.roughnessFactor=.9}},Cu=class{constructor(t){this.writer=t,this.name="KHR_materials_clearcoat"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.clearcoat===0)return;const n=this.writer,r=n.extensionsUsed,i={};if(i.clearcoatFactor=t.clearcoat,t.clearcoatMap){const o={index:n.processTexture(t.clearcoatMap),texCoord:t.clearcoatMap.channel};n.applyTextureTransform(o,t.clearcoatMap),i.clearcoatTexture=o}if(i.clearcoatRoughnessFactor=t.clearcoatRoughness,t.clearcoatRoughnessMap){const o={index:n.processTexture(t.clearcoatRoughnessMap),texCoord:t.clearcoatRoughnessMap.channel};n.applyTextureTransform(o,t.clearcoatRoughnessMap),i.clearcoatRoughnessTexture=o}if(t.clearcoatNormalMap){const o={index:n.processTexture(t.clearcoatNormalMap),texCoord:t.clearcoatNormalMap.channel};n.applyTextureTransform(o,t.clearcoatNormalMap),i.clearcoatNormalTexture=o}e.extensions=e.extensions||{},e.extensions[this.name]=i,r[this.name]=!0}},Nu=class{constructor(t){this.writer=t,this.name="KHR_materials_iridescence"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.iridescence===0)return;const n=this.writer,r=n.extensionsUsed,i={};if(i.iridescenceFactor=t.iridescence,t.iridescenceMap){const o={index:n.processTexture(t.iridescenceMap),texCoord:t.iridescenceMap.channel};n.applyTextureTransform(o,t.iridescenceMap),i.iridescenceTexture=o}if(i.iridescenceIor=t.iridescenceIOR,i.iridescenceThicknessMinimum=t.iridescenceThicknessRange[0],i.iridescenceThicknessMaximum=t.iridescenceThicknessRange[1],t.iridescenceThicknessMap){const o={index:n.processTexture(t.iridescenceThicknessMap),texCoord:t.iridescenceThicknessMap.channel};n.applyTextureTransform(o,t.iridescenceThicknessMap),i.iridescenceThicknessTexture=o}e.extensions=e.extensions||{},e.extensions[this.name]=i,r[this.name]=!0}},Lu=class{constructor(t){this.writer=t,this.name="KHR_materials_transmission"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.transmission===0)return;const n=this.writer,r=n.extensionsUsed,i={};if(i.transmissionFactor=t.transmission,t.transmissionMap){const o={index:n.processTexture(t.transmissionMap),texCoord:t.transmissionMap.channel};n.applyTextureTransform(o,t.transmissionMap),i.transmissionTexture=o}e.extensions=e.extensions||{},e.extensions[this.name]=i,r[this.name]=!0}},Pu=class{constructor(t){this.writer=t,this.name="KHR_materials_volume"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.transmission===0)return;const n=this.writer,r=n.extensionsUsed,i={};if(i.thicknessFactor=t.thickness,t.thicknessMap){const o={index:n.processTexture(t.thicknessMap),texCoord:t.thicknessMap.channel};n.applyTextureTransform(o,t.thicknessMap),i.thicknessTexture=o}i.attenuationDistance=t.attenuationDistance,i.attenuationColor=t.attenuationColor.toArray(),e.extensions=e.extensions||{},e.extensions[this.name]=i,r[this.name]=!0}},Du=class{constructor(t){this.writer=t,this.name="KHR_materials_ior"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.ior===1.5)return;const n=this.writer.extensionsUsed,r={};r.ior=t.ior,e.extensions=e.extensions||{},e.extensions[this.name]=r,n[this.name]=!0}},Ou=class{constructor(t){this.writer=t,this.name="KHR_materials_specular"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.specularIntensity===1&&t.specularColor.equals(bu)&&!t.specularIntensityMap&&!t.specularColorTexture)return;const n=this.writer,r=n.extensionsUsed,i={};if(t.specularIntensityMap){const o={index:n.processTexture(t.specularIntensityMap),texCoord:t.specularIntensityMap.channel};n.applyTextureTransform(o,t.specularIntensityMap),i.specularTexture=o}if(t.specularColorMap){const o={index:n.processTexture(t.specularColorMap),texCoord:t.specularColorMap.channel};n.applyTextureTransform(o,t.specularColorMap),i.specularColorTexture=o}i.specularFactor=t.specularIntensity,i.specularColorFactor=t.specularColor.toArray(),e.extensions=e.extensions||{},e.extensions[this.name]=i,r[this.name]=!0}},Fu=class{constructor(t){this.writer=t,this.name="KHR_materials_sheen"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.sheen==0)return;const n=this.writer,r=n.extensionsUsed,i={};if(t.sheenRoughnessMap){const o={index:n.processTexture(t.sheenRoughnessMap),texCoord:t.sheenRoughnessMap.channel};n.applyTextureTransform(o,t.sheenRoughnessMap),i.sheenRoughnessTexture=o}if(t.sheenColorMap){const o={index:n.processTexture(t.sheenColorMap),texCoord:t.sheenColorMap.channel};n.applyTextureTransform(o,t.sheenColorMap),i.sheenColorTexture=o}i.sheenRoughnessFactor=t.sheenRoughness,i.sheenColorFactor=t.sheenColor.toArray(),e.extensions=e.extensions||{},e.extensions[this.name]=i,r[this.name]=!0}},Bu=class{constructor(t){this.writer=t,this.name="KHR_materials_anisotropy"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.anisotropy==0)return;const n=this.writer,r=n.extensionsUsed,i={};if(t.anisotropyMap){const o={index:n.processTexture(t.anisotropyMap)};n.applyTextureTransform(o,t.anisotropyMap),i.anisotropyTexture=o}i.anisotropyStrength=t.anisotropy,i.anisotropyRotation=t.anisotropyRotation,e.extensions=e.extensions||{},e.extensions[this.name]=i,r[this.name]=!0}},zu=class{constructor(t){this.writer=t,this.name="KHR_materials_emissive_strength"}writeMaterial(t,e){if(!t.isMeshStandardMaterial||t.emissiveIntensity===1)return;const n=this.writer.extensionsUsed,r={};r.emissiveStrength=t.emissiveIntensity,e.extensions=e.extensions||{},e.extensions[this.name]=r,n[this.name]=!0}};var xn=Uint8Array,va=Uint16Array,Uu=Uint32Array,ju=new xn([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Vu=new xn([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),ba=function(t,e){for(var n=new va(31),r=0;r<31;++r)n[r]=e+=1<>>1|(Ne&21845)<<1;wt=(wt&52428)>>>2|(wt&13107)<<2,wt=(wt&61680)>>>4|(wt&3855)<<4,Gu[Ne]=((wt&65280)>>>8|(wt&255)<<8)>>>1}var Wn=new xn(288);for(var Ne=0;Ne<144;++Ne)Wn[Ne]=8;for(var Ne=144;Ne<256;++Ne)Wn[Ne]=9;for(var Ne=256;Ne<280;++Ne)Wn[Ne]=7;for(var Ne=280;Ne<288;++Ne)Wn[Ne]=8;var Yu=new xn(32);for(var Ne=0;Ne<32;++Ne)Yu[Ne]=5;var Ku=new xn(0),qu=typeof TextDecoder<"u"&&new TextDecoder,Wu=0;try{qu.decode(Ku,{stream:!0}),Wu=1}catch{}var Xu=Object.defineProperty,Zu=(t,e,n)=>e in t?Xu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Qu=(t,e,n)=>(Zu(t,e+"",n),n);const ka=class extends Pt{constructor(t,e={}){super(t),this.isReflector=!0,this.type="Reflector",this.camera=new Mt;const n=this,r=e.color!==void 0?new ze(e.color):new ze(8355711),i=e.textureWidth||512,o=e.textureHeight||512,a=e.clipBias||0,s=e.shader||ka.ReflectorShader,l=e.multisample!==void 0?e.multisample:4,u=new Ko,c=new ae,f=new ae,p=new ae,d=new xt,y=new ae(0,0,-1),x=new At,v=new ae,k=new ae,A=new At,E=new xt,C=this.camera,P=new Fs(i,o,{samples:l,type:Bs}),h=new yn({uniforms:ni.clone(s.uniforms),fragmentShader:s.fragmentShader,vertexShader:s.vertexShader});h.uniforms.tDiffuse.value=P.texture,h.uniforms.color.value=r,h.uniforms.textureMatrix.value=E,this.material=h,this.onBeforeRender=function(I,b,g){if(f.setFromMatrixPosition(n.matrixWorld),p.setFromMatrixPosition(g.matrixWorld),d.extractRotation(n.matrixWorld),c.set(0,0,1),c.applyMatrix4(d),v.subVectors(f,p),v.dot(c)>0)return;v.reflect(c).negate(),v.add(f),d.extractRotation(g.matrixWorld),y.set(0,0,-1),y.applyMatrix4(d),y.add(p),k.subVectors(f,y),k.reflect(c).negate(),k.add(f),C.position.copy(v),C.up.set(0,1,0),C.up.applyMatrix4(d),C.up.reflect(c),C.lookAt(k),C.far=g.far,C.updateMatrixWorld(),C.projectionMatrix.copy(g.projectionMatrix),E.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),E.multiply(C.projectionMatrix),E.multiply(C.matrixWorldInverse),E.multiply(n.matrixWorld),u.setFromNormalAndCoplanarPoint(c,f),u.applyMatrix4(C.matrixWorldInverse),x.set(u.normal.x,u.normal.y,u.normal.z,u.constant);const m=C.projectionMatrix;A.x=(Math.sign(x.x)+m.elements[8])/m.elements[0],A.y=(Math.sign(x.y)+m.elements[9])/m.elements[5],A.z=-1,A.w=(1+m.elements[10])/m.elements[14],x.multiplyScalar(2/x.dot(A)),m.elements[2]=x.x,m.elements[6]=x.y,m.elements[10]=x.z+1-a,m.elements[14]=x.w,n.visible=!1;const T=I.getRenderTarget(),S=I.xr.enabled,B=I.shadowMap.autoUpdate,D=I.toneMapping;let F=!1;"outputColorSpace"in I?F=I.outputColorSpace==="srgb":F=I.outputEncoding===3001,I.xr.enabled=!1,I.shadowMap.autoUpdate=!1,"outputColorSpace"in I?I.outputColorSpace="srgb-linear":I.outputEncoding=3e3,I.toneMapping=zs,I.setRenderTarget(P),I.state.buffers.depth.setMask(!0),I.autoClear===!1&&I.clear(),I.render(b,C),I.xr.enabled=S,I.shadowMap.autoUpdate=B,I.toneMapping=D,"outputColorSpace"in I?I.outputColorSpace=F?"srgb":"srgb-linear":I.outputEncoding=F?3001:3e3,I.setRenderTarget(T);const j=g.viewport;j!==void 0&&I.state.viewport(j),n.visible=!0},this.getRenderTarget=function(){return P},this.dispose=function(){P.dispose(),n.material.dispose()}}};let Or=ka;Qu(Or,"ReflectorShader",{uniforms:{color:{value:null},tDiffuse:{value:null},textureMatrix:{value:null}},vertexShader:` uniform mat4 textureMatrix; varying vec4 vUv; @@ -116,7 +116,7 @@ import{d as vs}from"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-t8bg #include #include <${ci>=154?"colorspace_fragment":"encodings_fragment"}> - }`});var Qu=Object.defineProperty,Ju=(t,e,n)=>e in t?Qu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Ta=(t,e,n)=>(Ju(t,typeof e!="symbol"?e+"":e,n),n);const Xn=new qo,ec=new Float32Array([-1,-1,0,0,0,1,-1,0,1,0,1,1,0,1,1,-1,1,0,0,1]),_a=new Wo(ec,5);Xn.setIndex([0,1,2,0,2,3]);Xn.setAttribute("position",new ti(_a,3,0,!1));Xn.setAttribute("uv",new ti(_a,2,3,!1));const Fr=class extends Pt{constructor(){super(Fr.Geometry,new Vt({opacity:0,transparent:!0})),this.isLensflare=!0,this.type="Lensflare",this.frustumCulled=!1,this.renderOrder=1/0;const t=new ae,e=new ae,n=new Ai(new Uint8Array(16*16*3),16,16,Cr);n.minFilter=Lt,n.magFilter=Lt,n.wrapS=Ht,n.wrapT=Ht;const r=new Ai(new Uint8Array(16*16*3),16,16,Cr);r.minFilter=Lt,r.magFilter=Lt,r.wrapS=Ht,r.wrapT=Ht;const i=Fr.Geometry,o=new tr({uniforms:{scale:{value:null},screenPosition:{value:null}},vertexShader:` + }`});var Ju=Object.defineProperty,ec=(t,e,n)=>e in t?Ju(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Ta=(t,e,n)=>(ec(t,typeof e!="symbol"?e+"":e,n),n);const Xn=new qo,tc=new Float32Array([-1,-1,0,0,0,1,-1,0,1,0,1,1,0,1,1,-1,1,0,0,1]),_a=new Wo(tc,5);Xn.setIndex([0,1,2,0,2,3]);Xn.setAttribute("position",new ti(_a,3,0,!1));Xn.setAttribute("uv",new ti(_a,2,3,!1));const Fr=class extends Pt{constructor(){super(Fr.Geometry,new Vt({opacity:0,transparent:!0})),this.isLensflare=!0,this.type="Lensflare",this.frustumCulled=!1,this.renderOrder=1/0;const t=new ae,e=new ae,n=new Ai(new Uint8Array(16*16*3),16,16,Cr);n.minFilter=Lt,n.magFilter=Lt,n.wrapS=Ht,n.wrapT=Ht;const r=new Ai(new Uint8Array(16*16*3),16,16,Cr);r.minFilter=Lt,r.magFilter=Lt,r.wrapS=Ht,r.wrapT=Ht;const i=Fr.Geometry,o=new tr({uniforms:{scale:{value:null},screenPosition:{value:null}},vertexShader:` precision highp float; @@ -167,7 +167,7 @@ import{d as vs}from"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-t8bg gl_FragColor = texture2D( map, vUV ); - }`,depthTest:!1,depthWrite:!1,transparent:!1}),s=new Pt(i,o),l=[],u=Ea.Shader,c=new tr({uniforms:{map:{value:null},occlusionMap:{value:r},color:{value:new ze(16777215)},scale:{value:new Pe},screenPosition:{value:new ae}},vertexShader:u.vertexShader,fragmentShader:u.fragmentShader,blending:Us,transparent:!0,depthWrite:!1}),f=new Pt(i,c);this.addElement=function(v){l.push(v)};const p=new Pe,d=new Pe,y=new js,x=new At;this.onBeforeRender=function(v,k,A){v.getCurrentViewport(x);const E=x.w/x.z,C=x.z/2,P=x.w/2;let h=16/x.w;if(p.set(h*E,h),y.min.set(x.x,x.y),y.max.set(x.x+(x.z-16),x.y+(x.w-16)),e.setFromMatrixPosition(this.matrixWorld),e.applyMatrix4(A.matrixWorldInverse),!(e.z>0)&&(t.copy(e).applyMatrix4(A.projectionMatrix),d.x=x.x+t.x*C+C-8,d.y=x.y+t.y*P+P-8,y.containsPoint(d))){v.copyFramebufferToTexture(d,n);let I=o.uniforms;I.scale.value=p,I.screenPosition.value=t,v.renderBufferDirect(A,null,i,o,s,null),v.copyFramebufferToTexture(d,r),I=a.uniforms,I.scale.value=p,I.screenPosition.value=t,v.renderBufferDirect(A,null,i,a,s,null);const b=-t.x*2,g=-t.y*2;for(let m=0,T=l.length;m0)&&(t.copy(e).applyMatrix4(A.projectionMatrix),d.x=x.x+t.x*C+C-8,d.y=x.y+t.y*P+P-8,y.containsPoint(d))){v.copyFramebufferToTexture(d,n);let I=o.uniforms;I.scale.value=p,I.screenPosition.value=t,v.renderBufferDirect(A,null,i,o,s,null),v.copyFramebufferToTexture(d,r),I=a.uniforms,I.scale.value=p,I.screenPosition.value=t,v.renderBufferDirect(A,null,i,a,s,null);const b=-t.x*2,g=-t.y*2;for(let m=0,T=l.length;me in t?nc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Ma=(t,e,n)=>(rc(t,typeof e!="symbol"?e+"":e,n),n);const Pn={uniforms:{turbidity:{value:2},rayleigh:{value:1},mieCoefficient:{value:.005},mieDirectionalG:{value:.8},sunPosition:{value:new ae},up:{value:new ae(0,1,0)}},vertexShader:` + }`});var rc=Object.defineProperty,ic=(t,e,n)=>e in t?rc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Ma=(t,e,n)=>(ic(t,typeof e!="symbol"?e+"":e,n),n);const Pn={uniforms:{turbidity:{value:2},rayleigh:{value:1},mieCoefficient:{value:.005},mieDirectionalG:{value:.8},sunPosition:{value:new ae},up:{value:new ae(0,1,0)}},vertexShader:` uniform vec3 sunPosition; uniform float rayleigh; uniform float turbidity; @@ -378,8 +378,8 @@ import{d as vs}from"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-t8bg #include <${ci>=154?"colorspace_fragment":"encodings_fragment"}> } - `},Aa=new yn({name:"SkyShader",fragmentShader:Pn.fragmentShader,vertexShader:Pn.vertexShader,uniforms:ni.clone(Pn.uniforms),side:Ms,depthWrite:!1});class Sa extends Pt{constructor(){super(new Os(1,1,1),Aa)}}Ma(Sa,"SkyShader",Pn);Ma(Sa,"material",Aa);new As;new ae;new Xo(0,0,0,"YXZ");new ae;var ic=Object.defineProperty,oc=(t,e,n)=>e in t?ic(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ne=(t,e,n)=>(oc(t,typeof e!="symbol"?e+"":e,n),n);const An=new Es,$i=new Ko,ac=Math.cos(70*(Math.PI/180)),Gi=(t,e)=>(t%e+e)%e;class sc extends _s{constructor(e,n){super(),ne(this,"object"),ne(this,"domElement"),ne(this,"enabled",!0),ne(this,"target",new ae),ne(this,"minDistance",0),ne(this,"maxDistance",1/0),ne(this,"minZoom",0),ne(this,"maxZoom",1/0),ne(this,"minPolarAngle",0),ne(this,"maxPolarAngle",Math.PI),ne(this,"minAzimuthAngle",-1/0),ne(this,"maxAzimuthAngle",1/0),ne(this,"enableDamping",!1),ne(this,"dampingFactor",.05),ne(this,"enableZoom",!0),ne(this,"zoomSpeed",1),ne(this,"enableRotate",!0),ne(this,"rotateSpeed",1),ne(this,"enablePan",!0),ne(this,"panSpeed",1),ne(this,"screenSpacePanning",!0),ne(this,"keyPanSpeed",7),ne(this,"zoomToCursor",!1),ne(this,"autoRotate",!1),ne(this,"autoRotateSpeed",2),ne(this,"reverseOrbit",!1),ne(this,"reverseHorizontalOrbit",!1),ne(this,"reverseVerticalOrbit",!1),ne(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),ne(this,"mouseButtons",{LEFT:yt.ROTATE,MIDDLE:yt.DOLLY,RIGHT:yt.PAN}),ne(this,"touches",{ONE:_t.ROTATE,TWO:_t.DOLLY_PAN}),ne(this,"target0"),ne(this,"position0"),ne(this,"zoom0"),ne(this,"_domElementKeyEvents",null),ne(this,"getPolarAngle"),ne(this,"getAzimuthalAngle"),ne(this,"setPolarAngle"),ne(this,"setAzimuthalAngle"),ne(this,"getDistance"),ne(this,"getZoomScale"),ne(this,"listenToKeyEvents"),ne(this,"stopListenToKeyEvents"),ne(this,"saveState"),ne(this,"reset"),ne(this,"update"),ne(this,"connect"),ne(this,"dispose"),ne(this,"dollyIn"),ne(this,"dollyOut"),ne(this,"getScale"),ne(this,"setScale"),this.object=e,this.domElement=n,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=()=>c.phi,this.getAzimuthalAngle=()=>c.theta,this.setPolarAngle=L=>{let Y=Gi(L,2*Math.PI),X=c.phi;X<0&&(X+=2*Math.PI),Y<0&&(Y+=2*Math.PI);let Me=Math.abs(Y-X);2*Math.PI-Me{let Y=Gi(L,2*Math.PI),X=c.theta;X<0&&(X+=2*Math.PI),Y<0&&(Y+=2*Math.PI);let Me=Math.abs(Y-X);2*Math.PI-Mer.object.position.distanceTo(r.target),this.listenToKeyEvents=L=>{L.addEventListener("keydown",ie),this._domElementKeyEvents=L},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener("keydown",ie),this._domElementKeyEvents=null},this.saveState=()=>{r.target0.copy(r.target),r.position0.copy(r.object.position),r.zoom0=r.object.zoom},this.reset=()=>{r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.zoom=r.zoom0,r.object.updateProjectionMatrix(),r.dispatchEvent(i),r.update(),l=s.NONE},this.update=(()=>{const L=new ae,Y=new ae(0,1,0),X=new Fn().setFromUnitVectors(e.up,Y),Me=X.clone().invert(),Ze=new ae,at=new Fn,kn=2*Math.PI;return function(){const Ei=r.object.position;X.setFromUnitVectors(e.up,Y),Me.copy(X).invert(),L.copy(Ei).sub(r.target),L.applyQuaternion(X),c.setFromVector3(L),r.autoRotate&&l===s.NONE&&D(S()),r.enableDamping?(c.theta+=f.theta*r.dampingFactor,c.phi+=f.phi*r.dampingFactor):(c.theta+=f.theta,c.phi+=f.phi);let ht=r.minAzimuthAngle,mt=r.maxAzimuthAngle;isFinite(ht)&&isFinite(mt)&&(ht<-Math.PI?ht+=kn:ht>Math.PI&&(ht-=kn),mt<-Math.PI?mt+=kn:mt>Math.PI&&(mt-=kn),ht<=mt?c.theta=Math.max(ht,Math.min(mt,c.theta)):c.theta=c.theta>(ht+mt)/2?Math.max(ht,c.theta):Math.min(mt,c.theta)),c.phi=Math.max(r.minPolarAngle,Math.min(r.maxPolarAngle,c.phi)),c.makeSafe(),r.enableDamping===!0?r.target.addScaledVector(d,r.dampingFactor):r.target.add(d),r.zoomToCursor&&g||r.object.isOrthographicCamera?c.radius=R(c.radius):c.radius=R(c.radius*p),L.setFromSpherical(c),L.applyQuaternion(Me),Ei.copy(r.target).add(L),r.object.matrixAutoUpdate||r.object.updateMatrix(),r.object.lookAt(r.target),r.enableDamping===!0?(f.theta*=1-r.dampingFactor,f.phi*=1-r.dampingFactor,d.multiplyScalar(1-r.dampingFactor)):(f.set(0,0,0),d.set(0,0,0));let tn=!1;if(r.zoomToCursor&&g){let nn=null;if(r.object instanceof Mt&&r.object.isPerspectiveCamera){const rn=L.length();nn=R(rn*p);const Tn=rn-nn;r.object.position.addScaledVector(I,Tn),r.object.updateMatrixWorld()}else if(r.object.isOrthographicCamera){const rn=new ae(b.x,b.y,0);rn.unproject(r.object),r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom/p)),r.object.updateProjectionMatrix(),tn=!0;const Tn=new ae(b.x,b.y,0);Tn.unproject(r.object),r.object.position.sub(Tn).add(rn),r.object.updateMatrixWorld(),nn=L.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),r.zoomToCursor=!1;nn!==null&&(r.screenSpacePanning?r.target.set(0,0,-1).transformDirection(r.object.matrix).multiplyScalar(nn).add(r.object.position):(An.origin.copy(r.object.position),An.direction.set(0,0,-1).transformDirection(r.object.matrix),Math.abs(r.object.up.dot(An.direction))u||8*(1-at.dot(r.object.quaternion))>u?(r.dispatchEvent(i),Ze.copy(r.object.position),at.copy(r.object.quaternion),tn=!1,!0):!1}})(),this.connect=L=>{r.domElement=L,r.domElement.style.touchAction="none",r.domElement.addEventListener("contextmenu",He),r.domElement.addEventListener("pointerdown",Ae),r.domElement.addEventListener("pointercancel",tt),r.domElement.addEventListener("wheel",q)},this.dispose=()=>{var L,Y,X,Me,Ze,at;r.domElement&&(r.domElement.style.touchAction="auto"),(L=r.domElement)==null||L.removeEventListener("contextmenu",He),(Y=r.domElement)==null||Y.removeEventListener("pointerdown",Ae),(X=r.domElement)==null||X.removeEventListener("pointercancel",tt),(Me=r.domElement)==null||Me.removeEventListener("wheel",q),(Ze=r.domElement)==null||Ze.ownerDocument.removeEventListener("pointermove",Ve),(at=r.domElement)==null||at.ownerDocument.removeEventListener("pointerup",tt),r._domElementKeyEvents!==null&&r._domElementKeyEvents.removeEventListener("keydown",ie)};const r=this,i={type:"change"},o={type:"start"},a={type:"end"},s={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let l=s.NONE;const u=1e-6,c=new Mi,f=new Mi;let p=1;const d=new ae,y=new Pe,x=new Pe,v=new Pe,k=new Pe,A=new Pe,E=new Pe,C=new Pe,P=new Pe,h=new Pe,I=new ae,b=new Pe;let g=!1;const m=[],T={};function S(){return 2*Math.PI/60/60*r.autoRotateSpeed}function B(){return Math.pow(.95,r.zoomSpeed)}function D(L){r.reverseOrbit||r.reverseHorizontalOrbit?f.theta+=L:f.theta-=L}function F(L){r.reverseOrbit||r.reverseVerticalOrbit?f.phi+=L:f.phi-=L}const j=(()=>{const L=new ae;return function(Y,X){L.setFromMatrixColumn(X,0),L.multiplyScalar(-Y),d.add(L)}})(),J=(()=>{const L=new ae;return function(Y,X){r.screenSpacePanning===!0?L.setFromMatrixColumn(X,1):(L.setFromMatrixColumn(X,0),L.crossVectors(r.object.up,L)),L.multiplyScalar(Y),d.add(L)}})(),oe=(()=>{const L=new ae;return function(Y,X){const Me=r.domElement;if(Me&&r.object instanceof Mt&&r.object.isPerspectiveCamera){const Ze=r.object.position;L.copy(Ze).sub(r.target);let at=L.length();at*=Math.tan(r.object.fov/2*Math.PI/180),j(2*Y*at/Me.clientHeight,r.object.matrix),J(2*X*at/Me.clientHeight,r.object.matrix)}else Me&&r.object instanceof $t&&r.object.isOrthographicCamera?(j(Y*(r.object.right-r.object.left)/r.object.zoom/Me.clientWidth,r.object.matrix),J(X*(r.object.top-r.object.bottom)/r.object.zoom/Me.clientHeight,r.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),r.enablePan=!1)}})();function Q(L){r.object instanceof Mt&&r.object.isPerspectiveCamera||r.object instanceof $t&&r.object.isOrthographicCamera?p=L:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function _(L){Q(p/L)}function ee(L){Q(p*L)}function me(L){if(!r.zoomToCursor||!r.domElement)return;g=!0;const Y=r.domElement.getBoundingClientRect(),X=L.clientX-Y.left,Me=L.clientY-Y.top,Ze=Y.width,at=Y.height;b.x=X/Ze*2-1,b.y=-(Me/at)*2+1,I.set(b.x,b.y,1).unproject(r.object).sub(r.object.position).normalize()}function R(L){return Math.max(r.minDistance,Math.min(r.maxDistance,L))}function ge(L){y.set(L.clientX,L.clientY)}function Te(L){me(L),C.set(L.clientX,L.clientY)}function ye(L){k.set(L.clientX,L.clientY)}function Oe(L){x.set(L.clientX,L.clientY),v.subVectors(x,y).multiplyScalar(r.rotateSpeed);const Y=r.domElement;Y&&(D(2*Math.PI*v.x/Y.clientHeight),F(2*Math.PI*v.y/Y.clientHeight)),y.copy(x),r.update()}function $(L){P.set(L.clientX,L.clientY),h.subVectors(P,C),h.y>0?_(B()):h.y<0&&ee(B()),C.copy(P),r.update()}function w(L){A.set(L.clientX,L.clientY),E.subVectors(A,k).multiplyScalar(r.panSpeed),oe(E.x,E.y),k.copy(A),r.update()}function M(L){me(L),L.deltaY<0?ee(B()):L.deltaY>0&&_(B()),r.update()}function N(L){let Y=!1;switch(L.code){case r.keys.UP:oe(0,r.keyPanSpeed),Y=!0;break;case r.keys.BOTTOM:oe(0,-r.keyPanSpeed),Y=!0;break;case r.keys.LEFT:oe(r.keyPanSpeed,0),Y=!0;break;case r.keys.RIGHT:oe(-r.keyPanSpeed,0),Y=!0;break}Y&&(L.preventDefault(),r.update())}function H(){if(m.length==1)y.set(m[0].pageX,m[0].pageY);else{const L=.5*(m[0].pageX+m[1].pageX),Y=.5*(m[0].pageY+m[1].pageY);y.set(L,Y)}}function z(){if(m.length==1)k.set(m[0].pageX,m[0].pageY);else{const L=.5*(m[0].pageX+m[1].pageX),Y=.5*(m[0].pageY+m[1].pageY);k.set(L,Y)}}function K(){const L=m[0].pageX-m[1].pageX,Y=m[0].pageY-m[1].pageY,X=Math.sqrt(L*L+Y*Y);C.set(0,X)}function te(){r.enableZoom&&K(),r.enablePan&&z()}function xe(){r.enableZoom&&K(),r.enableRotate&&H()}function _e(L){if(m.length==1)x.set(L.pageX,L.pageY);else{const X=pt(L),Me=.5*(L.pageX+X.x),Ze=.5*(L.pageY+X.y);x.set(Me,Ze)}v.subVectors(x,y).multiplyScalar(r.rotateSpeed);const Y=r.domElement;Y&&(D(2*Math.PI*v.x/Y.clientHeight),F(2*Math.PI*v.y/Y.clientHeight)),y.copy(x)}function fe(L){if(m.length==1)A.set(L.pageX,L.pageY);else{const Y=pt(L),X=.5*(L.pageX+Y.x),Me=.5*(L.pageY+Y.y);A.set(X,Me)}E.subVectors(A,k).multiplyScalar(r.panSpeed),oe(E.x,E.y),k.copy(A)}function ve(L){const Y=pt(L),X=L.pageX-Y.x,Me=L.pageY-Y.y,Ze=Math.sqrt(X*X+Me*Me);P.set(0,Ze),h.set(0,Math.pow(P.y/C.y,r.zoomSpeed)),_(h.y),C.copy(P)}function Ie(L){r.enableZoom&&ve(L),r.enablePan&&fe(L)}function we(L){r.enableZoom&&ve(L),r.enableRotate&&_e(L)}function Ae(L){var Y,X;r.enabled!==!1&&(m.length===0&&((Y=r.domElement)==null||Y.ownerDocument.addEventListener("pointermove",Ve),(X=r.domElement)==null||X.ownerDocument.addEventListener("pointerup",tt)),dt(L),L.pointerType==="touch"?ue(L):en(L))}function Ve(L){r.enabled!==!1&&(L.pointerType==="touch"?be(L):U(L))}function tt(L){var Y,X,Me;ot(L),m.length===0&&((Y=r.domElement)==null||Y.releasePointerCapture(L.pointerId),(X=r.domElement)==null||X.ownerDocument.removeEventListener("pointermove",Ve),(Me=r.domElement)==null||Me.ownerDocument.removeEventListener("pointerup",tt)),r.dispatchEvent(a),l=s.NONE}function en(L){let Y;switch(L.button){case 0:Y=r.mouseButtons.LEFT;break;case 1:Y=r.mouseButtons.MIDDLE;break;case 2:Y=r.mouseButtons.RIGHT;break;default:Y=-1}switch(Y){case yt.DOLLY:if(r.enableZoom===!1)return;Te(L),l=s.DOLLY;break;case yt.ROTATE:if(L.ctrlKey||L.metaKey||L.shiftKey){if(r.enablePan===!1)return;ye(L),l=s.PAN}else{if(r.enableRotate===!1)return;ge(L),l=s.ROTATE}break;case yt.PAN:if(L.ctrlKey||L.metaKey||L.shiftKey){if(r.enableRotate===!1)return;ge(L),l=s.ROTATE}else{if(r.enablePan===!1)return;ye(L),l=s.PAN}break;default:l=s.NONE}l!==s.NONE&&r.dispatchEvent(o)}function U(L){if(r.enabled!==!1)switch(l){case s.ROTATE:if(r.enableRotate===!1)return;Oe(L);break;case s.DOLLY:if(r.enableZoom===!1)return;$(L);break;case s.PAN:if(r.enablePan===!1)return;w(L);break}}function q(L){r.enabled===!1||r.enableZoom===!1||l!==s.NONE&&l!==s.ROTATE||(L.preventDefault(),r.dispatchEvent(o),M(L),r.dispatchEvent(a))}function ie(L){r.enabled===!1||r.enablePan===!1||N(L)}function ue(L){switch(bt(L),m.length){case 1:switch(r.touches.ONE){case _t.ROTATE:if(r.enableRotate===!1)return;H(),l=s.TOUCH_ROTATE;break;case _t.PAN:if(r.enablePan===!1)return;z(),l=s.TOUCH_PAN;break;default:l=s.NONE}break;case 2:switch(r.touches.TWO){case _t.DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;te(),l=s.TOUCH_DOLLY_PAN;break;case _t.DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;xe(),l=s.TOUCH_DOLLY_ROTATE;break;default:l=s.NONE}break;default:l=s.NONE}l!==s.NONE&&r.dispatchEvent(o)}function be(L){switch(bt(L),l){case s.TOUCH_ROTATE:if(r.enableRotate===!1)return;_e(L),r.update();break;case s.TOUCH_PAN:if(r.enablePan===!1)return;fe(L),r.update();break;case s.TOUCH_DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;Ie(L),r.update();break;case s.TOUCH_DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;we(L),r.update();break;default:l=s.NONE}}function He(L){r.enabled!==!1&&L.preventDefault()}function dt(L){m.push(L)}function ot(L){delete T[L.pointerId];for(let Y=0;Y{ee(L),r.update()},this.dollyOut=(L=B())=>{_(L),r.update()},this.getScale=()=>p,this.setScale=L=>{Q(L),r.update()},this.getZoomScale=()=>B(),n!==void 0&&this.connect(n),this.update()}}new xt;new ae;new Xo;new ae;var lc=Object.defineProperty,uc=(t,e,n)=>e in t?lc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,fi=(t,e,n)=>(uc(t,typeof e!="symbol"?e+"":e,n),n);class Ia{constructor(e){fi(this,"data"),this.data=e}generateShapes(e,n=100,r){const i=[],o={letterSpacing:0,lineHeight:1,...r},a=cc(e,n,this.data,o);for(let s=0,l=a.length;s + `},Aa=new yn({name:"SkyShader",fragmentShader:Pn.fragmentShader,vertexShader:Pn.vertexShader,uniforms:ni.clone(Pn.uniforms),side:Ms,depthWrite:!1});class Sa extends Pt{constructor(){super(new Os(1,1,1),Aa)}}Ma(Sa,"SkyShader",Pn);Ma(Sa,"material",Aa);new As;new ae;new Xo(0,0,0,"YXZ");new ae;var oc=Object.defineProperty,ac=(t,e,n)=>e in t?oc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ne=(t,e,n)=>(ac(t,typeof e!="symbol"?e+"":e,n),n);const An=new Es,$i=new Ko,sc=Math.cos(70*(Math.PI/180)),Gi=(t,e)=>(t%e+e)%e;class lc extends _s{constructor(e,n){super(),ne(this,"object"),ne(this,"domElement"),ne(this,"enabled",!0),ne(this,"target",new ae),ne(this,"minDistance",0),ne(this,"maxDistance",1/0),ne(this,"minZoom",0),ne(this,"maxZoom",1/0),ne(this,"minPolarAngle",0),ne(this,"maxPolarAngle",Math.PI),ne(this,"minAzimuthAngle",-1/0),ne(this,"maxAzimuthAngle",1/0),ne(this,"enableDamping",!1),ne(this,"dampingFactor",.05),ne(this,"enableZoom",!0),ne(this,"zoomSpeed",1),ne(this,"enableRotate",!0),ne(this,"rotateSpeed",1),ne(this,"enablePan",!0),ne(this,"panSpeed",1),ne(this,"screenSpacePanning",!0),ne(this,"keyPanSpeed",7),ne(this,"zoomToCursor",!1),ne(this,"autoRotate",!1),ne(this,"autoRotateSpeed",2),ne(this,"reverseOrbit",!1),ne(this,"reverseHorizontalOrbit",!1),ne(this,"reverseVerticalOrbit",!1),ne(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),ne(this,"mouseButtons",{LEFT:yt.ROTATE,MIDDLE:yt.DOLLY,RIGHT:yt.PAN}),ne(this,"touches",{ONE:_t.ROTATE,TWO:_t.DOLLY_PAN}),ne(this,"target0"),ne(this,"position0"),ne(this,"zoom0"),ne(this,"_domElementKeyEvents",null),ne(this,"getPolarAngle"),ne(this,"getAzimuthalAngle"),ne(this,"setPolarAngle"),ne(this,"setAzimuthalAngle"),ne(this,"getDistance"),ne(this,"getZoomScale"),ne(this,"listenToKeyEvents"),ne(this,"stopListenToKeyEvents"),ne(this,"saveState"),ne(this,"reset"),ne(this,"update"),ne(this,"connect"),ne(this,"dispose"),ne(this,"dollyIn"),ne(this,"dollyOut"),ne(this,"getScale"),ne(this,"setScale"),this.object=e,this.domElement=n,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=()=>c.phi,this.getAzimuthalAngle=()=>c.theta,this.setPolarAngle=L=>{let Y=Gi(L,2*Math.PI),X=c.phi;X<0&&(X+=2*Math.PI),Y<0&&(Y+=2*Math.PI);let Me=Math.abs(Y-X);2*Math.PI-Me{let Y=Gi(L,2*Math.PI),X=c.theta;X<0&&(X+=2*Math.PI),Y<0&&(Y+=2*Math.PI);let Me=Math.abs(Y-X);2*Math.PI-Mer.object.position.distanceTo(r.target),this.listenToKeyEvents=L=>{L.addEventListener("keydown",ie),this._domElementKeyEvents=L},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener("keydown",ie),this._domElementKeyEvents=null},this.saveState=()=>{r.target0.copy(r.target),r.position0.copy(r.object.position),r.zoom0=r.object.zoom},this.reset=()=>{r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.zoom=r.zoom0,r.object.updateProjectionMatrix(),r.dispatchEvent(i),r.update(),l=s.NONE},this.update=(()=>{const L=new ae,Y=new ae(0,1,0),X=new Fn().setFromUnitVectors(e.up,Y),Me=X.clone().invert(),Ze=new ae,at=new Fn,kn=2*Math.PI;return function(){const Ei=r.object.position;X.setFromUnitVectors(e.up,Y),Me.copy(X).invert(),L.copy(Ei).sub(r.target),L.applyQuaternion(X),c.setFromVector3(L),r.autoRotate&&l===s.NONE&&D(S()),r.enableDamping?(c.theta+=f.theta*r.dampingFactor,c.phi+=f.phi*r.dampingFactor):(c.theta+=f.theta,c.phi+=f.phi);let ht=r.minAzimuthAngle,mt=r.maxAzimuthAngle;isFinite(ht)&&isFinite(mt)&&(ht<-Math.PI?ht+=kn:ht>Math.PI&&(ht-=kn),mt<-Math.PI?mt+=kn:mt>Math.PI&&(mt-=kn),ht<=mt?c.theta=Math.max(ht,Math.min(mt,c.theta)):c.theta=c.theta>(ht+mt)/2?Math.max(ht,c.theta):Math.min(mt,c.theta)),c.phi=Math.max(r.minPolarAngle,Math.min(r.maxPolarAngle,c.phi)),c.makeSafe(),r.enableDamping===!0?r.target.addScaledVector(d,r.dampingFactor):r.target.add(d),r.zoomToCursor&&g||r.object.isOrthographicCamera?c.radius=R(c.radius):c.radius=R(c.radius*p),L.setFromSpherical(c),L.applyQuaternion(Me),Ei.copy(r.target).add(L),r.object.matrixAutoUpdate||r.object.updateMatrix(),r.object.lookAt(r.target),r.enableDamping===!0?(f.theta*=1-r.dampingFactor,f.phi*=1-r.dampingFactor,d.multiplyScalar(1-r.dampingFactor)):(f.set(0,0,0),d.set(0,0,0));let tn=!1;if(r.zoomToCursor&&g){let nn=null;if(r.object instanceof Mt&&r.object.isPerspectiveCamera){const rn=L.length();nn=R(rn*p);const Tn=rn-nn;r.object.position.addScaledVector(I,Tn),r.object.updateMatrixWorld()}else if(r.object.isOrthographicCamera){const rn=new ae(b.x,b.y,0);rn.unproject(r.object),r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom/p)),r.object.updateProjectionMatrix(),tn=!0;const Tn=new ae(b.x,b.y,0);Tn.unproject(r.object),r.object.position.sub(Tn).add(rn),r.object.updateMatrixWorld(),nn=L.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),r.zoomToCursor=!1;nn!==null&&(r.screenSpacePanning?r.target.set(0,0,-1).transformDirection(r.object.matrix).multiplyScalar(nn).add(r.object.position):(An.origin.copy(r.object.position),An.direction.set(0,0,-1).transformDirection(r.object.matrix),Math.abs(r.object.up.dot(An.direction))u||8*(1-at.dot(r.object.quaternion))>u?(r.dispatchEvent(i),Ze.copy(r.object.position),at.copy(r.object.quaternion),tn=!1,!0):!1}})(),this.connect=L=>{r.domElement=L,r.domElement.style.touchAction="none",r.domElement.addEventListener("contextmenu",He),r.domElement.addEventListener("pointerdown",Ae),r.domElement.addEventListener("pointercancel",tt),r.domElement.addEventListener("wheel",q)},this.dispose=()=>{var L,Y,X,Me,Ze,at;r.domElement&&(r.domElement.style.touchAction="auto"),(L=r.domElement)==null||L.removeEventListener("contextmenu",He),(Y=r.domElement)==null||Y.removeEventListener("pointerdown",Ae),(X=r.domElement)==null||X.removeEventListener("pointercancel",tt),(Me=r.domElement)==null||Me.removeEventListener("wheel",q),(Ze=r.domElement)==null||Ze.ownerDocument.removeEventListener("pointermove",Ve),(at=r.domElement)==null||at.ownerDocument.removeEventListener("pointerup",tt),r._domElementKeyEvents!==null&&r._domElementKeyEvents.removeEventListener("keydown",ie)};const r=this,i={type:"change"},o={type:"start"},a={type:"end"},s={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let l=s.NONE;const u=1e-6,c=new Mi,f=new Mi;let p=1;const d=new ae,y=new Pe,x=new Pe,v=new Pe,k=new Pe,A=new Pe,E=new Pe,C=new Pe,P=new Pe,h=new Pe,I=new ae,b=new Pe;let g=!1;const m=[],T={};function S(){return 2*Math.PI/60/60*r.autoRotateSpeed}function B(){return Math.pow(.95,r.zoomSpeed)}function D(L){r.reverseOrbit||r.reverseHorizontalOrbit?f.theta+=L:f.theta-=L}function F(L){r.reverseOrbit||r.reverseVerticalOrbit?f.phi+=L:f.phi-=L}const j=(()=>{const L=new ae;return function(Y,X){L.setFromMatrixColumn(X,0),L.multiplyScalar(-Y),d.add(L)}})(),J=(()=>{const L=new ae;return function(Y,X){r.screenSpacePanning===!0?L.setFromMatrixColumn(X,1):(L.setFromMatrixColumn(X,0),L.crossVectors(r.object.up,L)),L.multiplyScalar(Y),d.add(L)}})(),oe=(()=>{const L=new ae;return function(Y,X){const Me=r.domElement;if(Me&&r.object instanceof Mt&&r.object.isPerspectiveCamera){const Ze=r.object.position;L.copy(Ze).sub(r.target);let at=L.length();at*=Math.tan(r.object.fov/2*Math.PI/180),j(2*Y*at/Me.clientHeight,r.object.matrix),J(2*X*at/Me.clientHeight,r.object.matrix)}else Me&&r.object instanceof $t&&r.object.isOrthographicCamera?(j(Y*(r.object.right-r.object.left)/r.object.zoom/Me.clientWidth,r.object.matrix),J(X*(r.object.top-r.object.bottom)/r.object.zoom/Me.clientHeight,r.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),r.enablePan=!1)}})();function Q(L){r.object instanceof Mt&&r.object.isPerspectiveCamera||r.object instanceof $t&&r.object.isOrthographicCamera?p=L:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function _(L){Q(p/L)}function ee(L){Q(p*L)}function me(L){if(!r.zoomToCursor||!r.domElement)return;g=!0;const Y=r.domElement.getBoundingClientRect(),X=L.clientX-Y.left,Me=L.clientY-Y.top,Ze=Y.width,at=Y.height;b.x=X/Ze*2-1,b.y=-(Me/at)*2+1,I.set(b.x,b.y,1).unproject(r.object).sub(r.object.position).normalize()}function R(L){return Math.max(r.minDistance,Math.min(r.maxDistance,L))}function ge(L){y.set(L.clientX,L.clientY)}function Te(L){me(L),C.set(L.clientX,L.clientY)}function ye(L){k.set(L.clientX,L.clientY)}function Oe(L){x.set(L.clientX,L.clientY),v.subVectors(x,y).multiplyScalar(r.rotateSpeed);const Y=r.domElement;Y&&(D(2*Math.PI*v.x/Y.clientHeight),F(2*Math.PI*v.y/Y.clientHeight)),y.copy(x),r.update()}function $(L){P.set(L.clientX,L.clientY),h.subVectors(P,C),h.y>0?_(B()):h.y<0&&ee(B()),C.copy(P),r.update()}function w(L){A.set(L.clientX,L.clientY),E.subVectors(A,k).multiplyScalar(r.panSpeed),oe(E.x,E.y),k.copy(A),r.update()}function M(L){me(L),L.deltaY<0?ee(B()):L.deltaY>0&&_(B()),r.update()}function N(L){let Y=!1;switch(L.code){case r.keys.UP:oe(0,r.keyPanSpeed),Y=!0;break;case r.keys.BOTTOM:oe(0,-r.keyPanSpeed),Y=!0;break;case r.keys.LEFT:oe(r.keyPanSpeed,0),Y=!0;break;case r.keys.RIGHT:oe(-r.keyPanSpeed,0),Y=!0;break}Y&&(L.preventDefault(),r.update())}function H(){if(m.length==1)y.set(m[0].pageX,m[0].pageY);else{const L=.5*(m[0].pageX+m[1].pageX),Y=.5*(m[0].pageY+m[1].pageY);y.set(L,Y)}}function z(){if(m.length==1)k.set(m[0].pageX,m[0].pageY);else{const L=.5*(m[0].pageX+m[1].pageX),Y=.5*(m[0].pageY+m[1].pageY);k.set(L,Y)}}function K(){const L=m[0].pageX-m[1].pageX,Y=m[0].pageY-m[1].pageY,X=Math.sqrt(L*L+Y*Y);C.set(0,X)}function te(){r.enableZoom&&K(),r.enablePan&&z()}function xe(){r.enableZoom&&K(),r.enableRotate&&H()}function _e(L){if(m.length==1)x.set(L.pageX,L.pageY);else{const X=pt(L),Me=.5*(L.pageX+X.x),Ze=.5*(L.pageY+X.y);x.set(Me,Ze)}v.subVectors(x,y).multiplyScalar(r.rotateSpeed);const Y=r.domElement;Y&&(D(2*Math.PI*v.x/Y.clientHeight),F(2*Math.PI*v.y/Y.clientHeight)),y.copy(x)}function fe(L){if(m.length==1)A.set(L.pageX,L.pageY);else{const Y=pt(L),X=.5*(L.pageX+Y.x),Me=.5*(L.pageY+Y.y);A.set(X,Me)}E.subVectors(A,k).multiplyScalar(r.panSpeed),oe(E.x,E.y),k.copy(A)}function ve(L){const Y=pt(L),X=L.pageX-Y.x,Me=L.pageY-Y.y,Ze=Math.sqrt(X*X+Me*Me);P.set(0,Ze),h.set(0,Math.pow(P.y/C.y,r.zoomSpeed)),_(h.y),C.copy(P)}function Ie(L){r.enableZoom&&ve(L),r.enablePan&&fe(L)}function we(L){r.enableZoom&&ve(L),r.enableRotate&&_e(L)}function Ae(L){var Y,X;r.enabled!==!1&&(m.length===0&&((Y=r.domElement)==null||Y.ownerDocument.addEventListener("pointermove",Ve),(X=r.domElement)==null||X.ownerDocument.addEventListener("pointerup",tt)),dt(L),L.pointerType==="touch"?ue(L):en(L))}function Ve(L){r.enabled!==!1&&(L.pointerType==="touch"?be(L):U(L))}function tt(L){var Y,X,Me;ot(L),m.length===0&&((Y=r.domElement)==null||Y.releasePointerCapture(L.pointerId),(X=r.domElement)==null||X.ownerDocument.removeEventListener("pointermove",Ve),(Me=r.domElement)==null||Me.ownerDocument.removeEventListener("pointerup",tt)),r.dispatchEvent(a),l=s.NONE}function en(L){let Y;switch(L.button){case 0:Y=r.mouseButtons.LEFT;break;case 1:Y=r.mouseButtons.MIDDLE;break;case 2:Y=r.mouseButtons.RIGHT;break;default:Y=-1}switch(Y){case yt.DOLLY:if(r.enableZoom===!1)return;Te(L),l=s.DOLLY;break;case yt.ROTATE:if(L.ctrlKey||L.metaKey||L.shiftKey){if(r.enablePan===!1)return;ye(L),l=s.PAN}else{if(r.enableRotate===!1)return;ge(L),l=s.ROTATE}break;case yt.PAN:if(L.ctrlKey||L.metaKey||L.shiftKey){if(r.enableRotate===!1)return;ge(L),l=s.ROTATE}else{if(r.enablePan===!1)return;ye(L),l=s.PAN}break;default:l=s.NONE}l!==s.NONE&&r.dispatchEvent(o)}function U(L){if(r.enabled!==!1)switch(l){case s.ROTATE:if(r.enableRotate===!1)return;Oe(L);break;case s.DOLLY:if(r.enableZoom===!1)return;$(L);break;case s.PAN:if(r.enablePan===!1)return;w(L);break}}function q(L){r.enabled===!1||r.enableZoom===!1||l!==s.NONE&&l!==s.ROTATE||(L.preventDefault(),r.dispatchEvent(o),M(L),r.dispatchEvent(a))}function ie(L){r.enabled===!1||r.enablePan===!1||N(L)}function ue(L){switch(bt(L),m.length){case 1:switch(r.touches.ONE){case _t.ROTATE:if(r.enableRotate===!1)return;H(),l=s.TOUCH_ROTATE;break;case _t.PAN:if(r.enablePan===!1)return;z(),l=s.TOUCH_PAN;break;default:l=s.NONE}break;case 2:switch(r.touches.TWO){case _t.DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;te(),l=s.TOUCH_DOLLY_PAN;break;case _t.DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;xe(),l=s.TOUCH_DOLLY_ROTATE;break;default:l=s.NONE}break;default:l=s.NONE}l!==s.NONE&&r.dispatchEvent(o)}function be(L){switch(bt(L),l){case s.TOUCH_ROTATE:if(r.enableRotate===!1)return;_e(L),r.update();break;case s.TOUCH_PAN:if(r.enablePan===!1)return;fe(L),r.update();break;case s.TOUCH_DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;Ie(L),r.update();break;case s.TOUCH_DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;we(L),r.update();break;default:l=s.NONE}}function He(L){r.enabled!==!1&&L.preventDefault()}function dt(L){m.push(L)}function ot(L){delete T[L.pointerId];for(let Y=0;Y{ee(L),r.update()},this.dollyOut=(L=B())=>{_(L),r.update()},this.getScale=()=>p,this.setScale=L=>{Q(L),r.update()},this.getZoomScale=()=>B(),n!==void 0&&this.connect(n),this.update()}}new xt;new ae;new Xo;new ae;var uc=Object.defineProperty,cc=(t,e,n)=>e in t?uc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,fi=(t,e,n)=>(cc(t,typeof e!="symbol"?e+"":e,n),n);class Ia{constructor(e){fi(this,"data"),this.data=e}generateShapes(e,n=100,r){const i=[],o={letterSpacing:0,lineHeight:1,...r},a=fc(e,n,this.data,o);for(let s=0,l=a.length;s #include #include uniform float thickness; @@ -419,15 +419,15 @@ import{d as vs}from"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-t8bg gl_FragColor = vec4(color, opacity); #include #include - }`);const dc=["args","material-uniforms-color-value"];Or.ReflectorShader;new ae;new ae;new ae;var fr;/Mac/.test((fr=globalThis==null?void 0:globalThis.navigator)===null||fr===void 0?void 0:fr.platform);const pc=["target","auto-rotate","auto-rotate-speed","enable-damping","damping-factor","enable-pan","key-pan-speed","keys","max-azimuth-angle","min-azimuth-angle","max-polar-angle","min-polar-angle","min-distance","max-distance","min-zoom","max-zoom","touches","enable-zoom","zoom-speed","enable-rotate","rotate-speed","mouse-buttons","args"],hc=Fe({__name:"OrbitControls",props:{makeDefault:{type:Boolean,default:!1},camera:{},domElement:{},target:{default:()=>[0,0,0]},enableDamping:{type:Boolean,default:!0},dampingFactor:{default:.05},autoRotate:{type:Boolean,default:!1},autoRotateSpeed:{default:2},enablePan:{type:Boolean,default:!0},keyPanSpeed:{default:7},keys:{},maxAzimuthAngle:{default:Number.POSITIVE_INFINITY},minAzimuthAngle:{default:Number.NEGATIVE_INFINITY},maxPolarAngle:{default:Math.PI},minPolarAngle:{default:0},minDistance:{default:0},maxDistance:{default:Number.POSITIVE_INFINITY},minZoom:{default:0},maxZoom:{default:Number.POSITIVE_INFINITY},touches:{default:()=>({ONE:_t.ROTATE,TWO:_t.DOLLY_PAN})},enableZoom:{type:Boolean,default:!0},zoomSpeed:{default:1},enableRotate:{type:Boolean,default:!0},rotateSpeed:{default:1},mouseButtons:{default:()=>({LEFT:yt.ROTATE,MIDDLE:yt.DOLLY,RIGHT:yt.PAN})}},emits:["change","start","end"],setup(t,{expose:e,emit:n}){const r=t,i=n,{makeDefault:o,autoRotate:a,autoRotateSpeed:s,enableDamping:l,dampingFactor:u,enablePan:c,keyPanSpeed:f,maxAzimuthAngle:p,minAzimuthAngle:d,maxPolarAngle:y,minPolarAngle:x,minDistance:v,maxDistance:k,minZoom:A,maxZoom:E,enableZoom:C,zoomSpeed:P,enableRotate:h,touches:I,rotateSpeed:b,target:g,mouseButtons:m}=Jr(r),{camera:T,renderer:S,extend:B,controls:D,invalidate:F}=Yn(),j=Yo(null);B({OrbitControls:sc}),Be(j,Q=>{J(),Q&&o.value?D.value=Q:D.value=null});function J(){ar(j.value,"change",()=>{i("change",j.value),F()}),ar(j.value,"start",()=>i("start",j.value)),ar(j.value,"end",()=>i("end",j.value))}const{onBeforeRender:oe}=On();return oe(({invalidate:Q})=>{j.value&&(l.value||a.value)&&(j.value.update(),a.value&&Q())}),Ot(()=>{j.value&&j.value.dispose()}),e({instance:j}),(Q,_)=>(Q.camera||V(T))&&(Q.domElement||V(S))?(Z(),re("TresOrbitControls",{key:0,ref_key:"controlsRef",ref:j,target:V(g),"auto-rotate":V(a),"auto-rotate-speed":V(s),"enable-damping":V(l),"damping-factor":V(u),"enable-pan":V(c),"key-pan-speed":V(f),keys:Q.keys,"max-azimuth-angle":V(p),"min-azimuth-angle":V(d),"max-polar-angle":V(y),"min-polar-angle":V(x),"min-distance":V(v),"max-distance":V(k),"min-zoom":V(A),"max-zoom":V(E),touches:V(I),"enable-zoom":V(C),"zoom-speed":V(P),"enable-rotate":V(h),"rotate-speed":V(b),"mouse-buttons":V(m),args:[Q.camera||V(T),Q.domElement||V(S).domElement]},null,8,pc)):it("",!0)}});function Sn(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Yi={exports:{}},Ki;function mc(){return Ki||(Ki=1,function(t,e){(function(n){t.exports=n()})(function(){return function n(r,i,o){function a(u,c){if(!i[u]){if(!r[u]){var f=typeof Sn=="function"&&Sn;if(!c&&f)return f(u,!0);if(s)return s(u,!0);throw new Error("Cannot find module '"+u+"'")}c=i[u]={exports:{}},r[u][0].call(c.exports,function(p){var d=r[u][1][p];return a(d||p)},c,c.exports,n,r,i,o)}return i[u].exports}for(var s=typeof Sn=="function"&&Sn,l=0;l[0,0,0]},enableDamping:{type:Boolean,default:!0},dampingFactor:{default:.05},autoRotate:{type:Boolean,default:!1},autoRotateSpeed:{default:2},enablePan:{type:Boolean,default:!0},keyPanSpeed:{default:7},keys:{},maxAzimuthAngle:{default:Number.POSITIVE_INFINITY},minAzimuthAngle:{default:Number.NEGATIVE_INFINITY},maxPolarAngle:{default:Math.PI},minPolarAngle:{default:0},minDistance:{default:0},maxDistance:{default:Number.POSITIVE_INFINITY},minZoom:{default:0},maxZoom:{default:Number.POSITIVE_INFINITY},touches:{default:()=>({ONE:_t.ROTATE,TWO:_t.DOLLY_PAN})},enableZoom:{type:Boolean,default:!0},zoomSpeed:{default:1},enableRotate:{type:Boolean,default:!0},rotateSpeed:{default:1},mouseButtons:{default:()=>({LEFT:yt.ROTATE,MIDDLE:yt.DOLLY,RIGHT:yt.PAN})}},emits:["change","start","end"],setup(t,{expose:e,emit:n}){const r=t,i=n,{makeDefault:o,autoRotate:a,autoRotateSpeed:s,enableDamping:l,dampingFactor:u,enablePan:c,keyPanSpeed:f,maxAzimuthAngle:p,minAzimuthAngle:d,maxPolarAngle:y,minPolarAngle:x,minDistance:v,maxDistance:k,minZoom:A,maxZoom:E,enableZoom:C,zoomSpeed:P,enableRotate:h,touches:I,rotateSpeed:b,target:g,mouseButtons:m}=Jr(r),{camera:T,renderer:S,extend:B,controls:D,invalidate:F}=Yn(),j=Yo(null);B({OrbitControls:lc}),Be(j,Q=>{J(),Q&&o.value?D.value=Q:D.value=null});function J(){ar(j.value,"change",()=>{i("change",j.value),F()}),ar(j.value,"start",()=>i("start",j.value)),ar(j.value,"end",()=>i("end",j.value))}const{onBeforeRender:oe}=On();return oe(({invalidate:Q})=>{j.value&&(l.value||a.value)&&(j.value.update(),a.value&&Q())}),Ot(()=>{j.value&&j.value.dispose()}),e({instance:j}),(Q,_)=>(Q.camera||V(T))&&(Q.domElement||V(S))?(Z(),re("TresOrbitControls",{key:0,ref_key:"controlsRef",ref:j,target:V(g),"auto-rotate":V(a),"auto-rotate-speed":V(s),"enable-damping":V(l),"damping-factor":V(u),"enable-pan":V(c),"key-pan-speed":V(f),keys:Q.keys,"max-azimuth-angle":V(p),"min-azimuth-angle":V(d),"max-polar-angle":V(y),"min-polar-angle":V(x),"min-distance":V(v),"max-distance":V(k),"min-zoom":V(A),"max-zoom":V(E),touches:V(I),"enable-zoom":V(C),"zoom-speed":V(P),"enable-rotate":V(h),"rotate-speed":V(b),"mouse-buttons":V(m),args:[Q.camera||V(T),Q.domElement||V(S).domElement]},null,8,hc)):it("",!0)}});function Sn(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Yi={exports:{}},Ki;function gc(){return Ki||(Ki=1,function(t,e){(function(n){t.exports=n()})(function(){return function n(r,i,o){function a(u,c){if(!i[u]){if(!r[u]){var f=typeof Sn=="function"&&Sn;if(!c&&f)return f(u,!0);if(s)return s(u,!0);throw new Error("Cannot find module '"+u+"'")}c=i[u]={exports:{}},r[u][0].call(c.exports,function(p){var d=r[u][1][p];return a(d||p)},c,c.exports,n,r,i,o)}return i[u].exports}for(var s=typeof Sn=="function"&&Sn,l=0;l>16),F((65280&m)>>8),F(255&m);return T==2?F(255&(m=I(b.charAt(g))<<2|I(b.charAt(g+1))>>4)):T==1&&(F((m=I(b.charAt(g))<<10|I(b.charAt(g+1))<<4|I(b.charAt(g+2))>>2)>>8&255),F(255&m)),S},y.fromByteArray=function(b){var g,m,T,S,B=b.length%3,D="";function F(j){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(j)}for(g=0,T=b.length-B;g>18&63)+F(S>>12&63)+F(S>>6&63)+F(63&S);switch(B){case 1:D=(D+=F((m=b[b.length-1])>>2))+F(m<<4&63)+"==";break;case 2:D=(D=(D+=F((m=(b[b.length-2]<<8)+b[b.length-1])>>10))+F(m>>4&63))+F(m<<2&63)+"="}return D}})(i===void 0?this.base64js={}:i)}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/base64-js/lib/b64.js","/node_modules/gulp-browserify/node_modules/base64-js/lib")},{buffer:3,lYpoI2:11}],3:[function(n,r,i){(function(o,a,v,l,u,c,f,p,d){var y=n("base64-js"),x=n("ieee754");function v(w,M,N){if(!(this instanceof v))return new v(w,M,N);var H,z,K,te,xe=typeof w;if(M==="base64"&&xe=="string")for(w=(te=w).trim?te.trim():te.replace(/^\s+|\s+$/g,"");w.length%4!=0;)w+="=";if(xe=="number")H=oe(w);else if(xe=="string")H=v.byteLength(w,M);else{if(xe!="object")throw new Error("First argument needs to be a number, array or string.");H=oe(w.length)}if(v._useTypedArrays?z=v._augment(new Uint8Array(H)):((z=this).length=H,z._isBuffer=!0),v._useTypedArrays&&typeof w.byteLength=="number")z._set(w);else if(Q(te=w)||v.isBuffer(te)||te&&typeof te=="object"&&typeof te.length=="number")for(K=0;K>8,te=te%256,xe.push(te),xe.push(K);return xe}(M),w,N,H)}function E(w,M,N){var H="";N=Math.min(w.length,N);for(var z=M;z>>0)):(M+1>>0),z}function h(w,M,N,H){if(H||($(typeof N=="boolean","missing or invalid endian"),$(M!=null,"missing offset"),$(M+1>>8*(H?K:1-K)}function T(w,M,N,H,z){if(z||($(M!=null,"missing value"),$(typeof H=="boolean","missing or invalid endian"),$(N!=null,"missing offset"),$(N+3>>8*(H?K:3-K)&255}function S(w,M,N,H,z){z||($(M!=null,"missing value"),$(typeof H=="boolean","missing or invalid endian"),$(N!=null,"missing offset"),$(N+1this.length&&(H=this.length);var z=(H=w.length-M=this.length))return this[w]},v.prototype.readUInt16LE=function(w,M){return C(this,w,!0,M)},v.prototype.readUInt16BE=function(w,M){return C(this,w,!1,M)},v.prototype.readUInt32LE=function(w,M){return P(this,w,!0,M)},v.prototype.readUInt32BE=function(w,M){return P(this,w,!1,M)},v.prototype.readInt8=function(w,M){if(M||($(w!=null,"missing offset"),$(w=this.length))return 128&this[w]?-1*(255-this[w]+1):this[w]},v.prototype.readInt16LE=function(w,M){return h(this,w,!0,M)},v.prototype.readInt16BE=function(w,M){return h(this,w,!1,M)},v.prototype.readInt32LE=function(w,M){return I(this,w,!0,M)},v.prototype.readInt32BE=function(w,M){return I(this,w,!1,M)},v.prototype.readFloatLE=function(w,M){return b(this,w,!0,M)},v.prototype.readFloatBE=function(w,M){return b(this,w,!1,M)},v.prototype.readDoubleLE=function(w,M){return g(this,w,!0,M)},v.prototype.readDoubleBE=function(w,M){return g(this,w,!1,M)},v.prototype.writeUInt8=function(w,M,N){N||($(w!=null,"missing value"),$(M!=null,"missing offset"),$(M=this.length||(this[M]=w)},v.prototype.writeUInt16LE=function(w,M,N){m(this,w,M,!0,N)},v.prototype.writeUInt16BE=function(w,M,N){m(this,w,M,!1,N)},v.prototype.writeUInt32LE=function(w,M,N){T(this,w,M,!0,N)},v.prototype.writeUInt32BE=function(w,M,N){T(this,w,M,!1,N)},v.prototype.writeInt8=function(w,M,N){N||($(w!=null,"missing value"),$(M!=null,"missing offset"),$(M=this.length||(0<=w?this.writeUInt8(w,M,N):this.writeUInt8(255+w+1,M,N))},v.prototype.writeInt16LE=function(w,M,N){S(this,w,M,!0,N)},v.prototype.writeInt16BE=function(w,M,N){S(this,w,M,!1,N)},v.prototype.writeInt32LE=function(w,M,N){B(this,w,M,!0,N)},v.prototype.writeInt32BE=function(w,M,N){B(this,w,M,!1,N)},v.prototype.writeFloatLE=function(w,M,N){D(this,w,M,!0,N)},v.prototype.writeFloatBE=function(w,M,N){D(this,w,M,!1,N)},v.prototype.writeDoubleLE=function(w,M,N){F(this,w,M,!0,N)},v.prototype.writeDoubleBE=function(w,M,N){F(this,w,M,!1,N)},v.prototype.fill=function(w,M,N){if(M=M||0,N=N||this.length,$(typeof(w=typeof(w=w||0)=="string"?w.charCodeAt(0):w)=="number"&&!isNaN(w),"value is not a number"),$(M<=N,"end < start"),N!==M&&this.length!==0){$(0<=M&&M"},v.prototype.toArrayBuffer=function(){if(typeof Uint8Array>"u")throw new Error("Buffer.toArrayBuffer not supported in this browser");if(v._useTypedArrays)return new v(this).buffer;for(var w=new Uint8Array(this.length),M=0,N=w.length;M=M.length||z>=w.length);z++)M[z+N]=w[z];return z}function ge(w){try{return decodeURIComponent(w)}catch{return"�"}}function Te(w,M){$(typeof w=="number","cannot write a non-number as a number"),$(0<=w,"specified a negative value for writing an unsigned value"),$(w<=M,"value is larger than maximum value for type"),$(Math.floor(w)===w,"value has a fractional component")}function ye(w,M,N){$(typeof w=="number","cannot write a non-number as a number"),$(w<=M,"value larger than maximum allowed value"),$(N<=w,"value smaller than minimum allowed value"),$(Math.floor(w)===w,"value has a fractional component")}function Oe(w,M,N){$(typeof w=="number","cannot write a non-number as a number"),$(w<=M,"value larger than maximum allowed value"),$(N<=w,"value smaller than minimum allowed value")}function $(w,M){if(!w)throw new Error(M||"Failed assertion")}v._augment=function(w){return w._isBuffer=!0,w._get=w.get,w._set=w.set,w.get=j.get,w.set=j.set,w.write=j.write,w.toString=j.toString,w.toLocaleString=j.toString,w.toJSON=j.toJSON,w.copy=j.copy,w.slice=j.slice,w.readUInt8=j.readUInt8,w.readUInt16LE=j.readUInt16LE,w.readUInt16BE=j.readUInt16BE,w.readUInt32LE=j.readUInt32LE,w.readUInt32BE=j.readUInt32BE,w.readInt8=j.readInt8,w.readInt16LE=j.readInt16LE,w.readInt16BE=j.readInt16BE,w.readInt32LE=j.readInt32LE,w.readInt32BE=j.readInt32BE,w.readFloatLE=j.readFloatLE,w.readFloatBE=j.readFloatBE,w.readDoubleLE=j.readDoubleLE,w.readDoubleBE=j.readDoubleBE,w.writeUInt8=j.writeUInt8,w.writeUInt16LE=j.writeUInt16LE,w.writeUInt16BE=j.writeUInt16BE,w.writeUInt32LE=j.writeUInt32LE,w.writeUInt32BE=j.writeUInt32BE,w.writeInt8=j.writeInt8,w.writeInt16LE=j.writeInt16LE,w.writeInt16BE=j.writeInt16BE,w.writeInt32LE=j.writeInt32LE,w.writeInt32BE=j.writeInt32BE,w.writeFloatLE=j.writeFloatLE,w.writeFloatBE=j.writeFloatBE,w.writeDoubleLE=j.writeDoubleLE,w.writeDoubleBE=j.writeDoubleBE,w.fill=j.fill,w.inspect=j.inspect,w.toArrayBuffer=j.toArrayBuffer,w}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/buffer/index.js","/node_modules/gulp-browserify/node_modules/buffer")},{"base64-js":2,buffer:3,ieee754:10,lYpoI2:11}],4:[function(n,r,i){(function(o,a,y,l,u,c,f,p,d){var y=n("buffer").Buffer,x=4,v=new y(x);v.fill(0),r.exports={hash:function(k,A,E,C){for(var P=A(function(m,T){m.length%x!=0&&(S=m.length+(x-m.length%x),m=y.concat([m,v],S));for(var S,B=[],D=T?m.readInt32BE:m.readInt32LE,F=0;FE?J=j(J):J.length>5]|=128<>>9<<4)]=I;for(var b=1732584193,g=-271733879,m=-1732584194,T=271733878,S=0;S>>32-m,b)}function k(h,I,b,g,m,T,S){return v(I&b|~I&g,h,I,m,T,S)}function A(h,I,b,g,m,T,S){return v(I&g|b&~g,h,I,m,T,S)}function E(h,I,b,g,m,T,S){return v(I^b^g,h,I,m,T,S)}function C(h,I,b,g,m,T,S){return v(b^(I|~g),h,I,m,T,S)}function P(h,I){var b=(65535&h)+(65535&I);return(h>>16)+(I>>16)+(b>>16)<<16|65535&b}r.exports=function(h){return y.hash(h,x,16)}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/md5.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],7:[function(n,r,i){(function(o,a,s,l,u,c,f,p,d){r.exports=function(y){for(var x,v=new Array(y),k=0;k>>((3&k)<<3)&255;return v}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/rng.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:11}],8:[function(n,r,i){(function(o,a,s,l,u,c,f,p,d){var y=n("./helpers");function x(A,E){A[E>>5]|=128<<24-E%32,A[15+(E+64>>9<<4)]=E;for(var C,P,h,I=Array(80),b=1732584193,g=-271733879,m=-1732584194,T=271733878,S=-1009589776,B=0;B>16)+(E>>16)+(C>>16)<<16|65535&C}function k(A,E){return A<>>32-E}r.exports=function(A){return y.hash(A,x,20,!0)}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],9:[function(n,r,i){(function(o,a,s,l,u,c,f,p,d){function y(E,C){var P=(65535&E)+(65535&C);return(E>>16)+(C>>16)+(P>>16)<<16|65535&P}function x(E,C){var P,h=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),I=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),b=new Array(64);E[C>>5]|=128<<24-C%32,E[15+(C+64>>9<<4)]=C;for(var g,m,T=0;T>>C|E<<32-C},A=function(E,C){return E>>>C};r.exports=function(E){return v.hash(E,x,32,!0)}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha256.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],10:[function(n,r,i){(function(o,a,s,l,u,c,f,p,d){i.read=function(y,x,v,k,T){var E,C,P=8*T-k-1,h=(1<>1,b=-7,g=v?T-1:0,m=v?-1:1,T=y[x+g];for(g+=m,E=T&(1<<-b)-1,T>>=-b,b+=P;0>=-b,b+=k;0>1,g=A===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=k?0:S-1,T=k?1:-1,S=x<0||x===0&&1/x<0?1:0;for(x=Math.abs(x),isNaN(x)||x===1/0?(P=isNaN(x)?1:0,C=I):(C=Math.floor(Math.log(x)/Math.LN2),x*(k=Math.pow(2,-C))<1&&(C--,k*=2),2<=(x+=1<=C+b?g/k:g*Math.pow(2,1-b))*k&&(C++,k/=2),I<=C+b?(P=0,C=I):1<=C+b?(P=(x*k-1)*Math.pow(2,A),C+=b):(P=x*Math.pow(2,b-1)*Math.pow(2,A),C=0));8<=A;y[v+m]=255&P,m+=T,P/=256,A-=8);for(C=C<>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]),Xi}var Qi,Ji;function Ca(){return Ji||(Ji=1,Qi=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]),Qi}var dr,eo;function yc(){if(eo)return dr;eo=1;var t=Ra();return dr=t.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"]),dr}var pr,to;function xc(){if(to)return pr;to=1;var t=Ca();return t=t.slice().filter(function(e){return!/^(gl\_|texture)/.test(e)}),pr=t.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"]),pr}var hr,no;function vc(){if(no)return hr;no=1,hr=C;var t=Ra(),e=gc(),n=Ca(),r=yc(),i=xc(),o=999,a=9999,s=0,l=1,u=2,c=3,f=4,p=5,d=6,y=7,x=8,v=9,k=10,A=11,E=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"];function C(P){var h=0,I=0,b=o,g,m,T=[],S=[],B=1,D=0,F=0,j=!1,J=!1,oe="",Q;P=P||{};var _=n,ee=t;P.version==="300 es"&&(_=i,ee=r);for(var me={},R={},h=0;h<_.length;h++)me[_[h]]=!0;for(var h=0;h>5]|=128<>>9<<4)]=I;for(var b=1732584193,g=-271733879,m=-1732584194,T=271733878,S=0;S>>32-m,b)}function k(h,I,b,g,m,T,S){return v(I&b|~I&g,h,I,m,T,S)}function A(h,I,b,g,m,T,S){return v(I&g|b&~g,h,I,m,T,S)}function E(h,I,b,g,m,T,S){return v(I^b^g,h,I,m,T,S)}function C(h,I,b,g,m,T,S){return v(b^(I|~g),h,I,m,T,S)}function P(h,I){var b=(65535&h)+(65535&I);return(h>>16)+(I>>16)+(b>>16)<<16|65535&b}r.exports=function(h){return y.hash(h,x,16)}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/md5.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],7:[function(n,r,i){(function(o,a,s,l,u,c,f,p,d){r.exports=function(y){for(var x,v=new Array(y),k=0;k>>((3&k)<<3)&255;return v}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/rng.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:11}],8:[function(n,r,i){(function(o,a,s,l,u,c,f,p,d){var y=n("./helpers");function x(A,E){A[E>>5]|=128<<24-E%32,A[15+(E+64>>9<<4)]=E;for(var C,P,h,I=Array(80),b=1732584193,g=-271733879,m=-1732584194,T=271733878,S=-1009589776,B=0;B>16)+(E>>16)+(C>>16)<<16|65535&C}function k(A,E){return A<>>32-E}r.exports=function(A){return y.hash(A,x,20,!0)}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],9:[function(n,r,i){(function(o,a,s,l,u,c,f,p,d){function y(E,C){var P=(65535&E)+(65535&C);return(E>>16)+(C>>16)+(P>>16)<<16|65535&P}function x(E,C){var P,h=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),I=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),b=new Array(64);E[C>>5]|=128<<24-C%32,E[15+(C+64>>9<<4)]=C;for(var g,m,T=0;T>>C|E<<32-C},A=function(E,C){return E>>>C};r.exports=function(E){return v.hash(E,x,32,!0)}}).call(this,n("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},n("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha256.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],10:[function(n,r,i){(function(o,a,s,l,u,c,f,p,d){i.read=function(y,x,v,k,T){var E,C,P=8*T-k-1,h=(1<>1,b=-7,g=v?T-1:0,m=v?-1:1,T=y[x+g];for(g+=m,E=T&(1<<-b)-1,T>>=-b,b+=P;0>=-b,b+=k;0>1,g=A===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=k?0:S-1,T=k?1:-1,S=x<0||x===0&&1/x<0?1:0;for(x=Math.abs(x),isNaN(x)||x===1/0?(P=isNaN(x)?1:0,C=I):(C=Math.floor(Math.log(x)/Math.LN2),x*(k=Math.pow(2,-C))<1&&(C--,k*=2),2<=(x+=1<=C+b?g/k:g*Math.pow(2,1-b))*k&&(C++,k/=2),I<=C+b?(P=0,C=I):1<=C+b?(P=(x*k-1)*Math.pow(2,A),C+=b):(P=x*Math.pow(2,b-1)*Math.pow(2,A),C=0));8<=A;y[v+m]=255&P,m+=T,P/=256,A-=8);for(C=C<>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]),Xi}var Qi,Ji;function Ca(){return Ji||(Ji=1,Qi=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]),Qi}var dr,eo;function xc(){if(eo)return dr;eo=1;var t=Ra();return dr=t.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"]),dr}var pr,to;function vc(){if(to)return pr;to=1;var t=Ca();return t=t.slice().filter(function(e){return!/^(gl\_|texture)/.test(e)}),pr=t.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"]),pr}var hr,no;function bc(){if(no)return hr;no=1,hr=C;var t=Ra(),e=yc(),n=Ca(),r=xc(),i=vc(),o=999,a=9999,s=0,l=1,u=2,c=3,f=4,p=5,d=6,y=7,x=8,v=9,k=10,A=11,E=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"];function C(P){var h=0,I=0,b=o,g,m,T=[],S=[],B=1,D=0,F=0,j=!1,J=!1,oe="",Q;P=P||{};var _=n,ee=t;P.version==="300 es"&&(_=i,ee=r);for(var me={},R={},h=0;h<_.length;h++)me[_[h]]=!0;for(var h=0;h0)continue;we=fe.slice(0,1).join("")}return ge(we),F+=we.length,T=T.slice(we.length),T.length}while(!0)}function K(){return/[^a-fA-F0-9]/.test(g)?(ge(T.join("")),b=o,h):(T.push(g),m=g,h+1)}function te(){return g==="."||/[eE]/.test(g)?(T.push(g),b=p,m=g,h+1):g==="x"&&T.length===1&&T[0]==="0"?(b=A,T.push(g),m=g,h+1):/[^\d]/.test(g)?(ge(T.join("")),b=o,h):(T.push(g),m=g,h+1)}function xe(){return g==="f"&&(T.push(g),m=g,h+=1),/[eE]/.test(g)||(g==="-"||g==="+")&&/[eE]/.test(m)?(T.push(g),m=g,h+1):/[^\d]/.test(g)?(ge(T.join("")),b=o,h):(T.push(g),m=g,h+1)}function _e(){if(/[^\d\w_]/.test(g)){var fe=T.join("");return R[fe]?b=x:me[fe]?b=y:b=d,ge(T.join("")),b=o,h}return T.push(g),m=g,h+1}}return hr}var mr,ro;function bc(){if(ro)return mr;ro=1;var t=vc();mr=e;function e(n,r){var i=t(r),o=[];return o=o.concat(i(n)),o=o.concat(i(null)),o}return mr}bc();function wc(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function kc(t){var e=wc(t,"string");return typeof e=="symbol"?e:String(e)}function Se(t,e,n){return e=kc(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var le={position:"csm_Position",positionRaw:"csm_PositionRaw",pointSize:"csm_PointSize",fragColor:"csm_FragColor",diffuseColor:"csm_DiffuseColor",normal:"csm_Normal",roughness:"csm_Roughness",metalness:"csm_Metalness",emissive:"csm_Emissive",ao:"csm_AO",bump:"csm_Bump",depthAlpha:"csm_DepthAlpha"},$e,zt;$e={},Se($e,"".concat(le.normal),{"#include ":` +`)&&m!=="\\"?(ge(T.join("")),b=o,h):(T.push(g),m=g,h+1)}function M(){return w()}function N(){return g==="/"&&m==="*"?(T.push(g),ge(T.join("")),b=o,h+1):(T.push(g),m=g,h+1)}function H(){if(m==="."&&/\d/.test(g))return b=p,h;if(m==="/"&&g==="*")return b=s,h;if(m==="/"&&g==="/")return b=l,h;if(g==="."&&T.length){for(;z(T););return b=p,h}if(g===";"||g===")"||g==="("){if(T.length)for(;z(T););return ge(g),b=o,h+1}var fe=T.length===2&&g!=="=";if(/[\w_\d\s]/.test(g)||fe){for(;z(T););return b=o,h}return T.push(g),m=g,h+1}function z(fe){var ve=0,Ie,we;do{if(Ie=e.indexOf(fe.slice(0,fe.length+ve).join("")),we=e[Ie],Ie===-1){if(ve--+fe.length>0)continue;we=fe.slice(0,1).join("")}return ge(we),F+=we.length,T=T.slice(we.length),T.length}while(!0)}function K(){return/[^a-fA-F0-9]/.test(g)?(ge(T.join("")),b=o,h):(T.push(g),m=g,h+1)}function te(){return g==="."||/[eE]/.test(g)?(T.push(g),b=p,m=g,h+1):g==="x"&&T.length===1&&T[0]==="0"?(b=A,T.push(g),m=g,h+1):/[^\d]/.test(g)?(ge(T.join("")),b=o,h):(T.push(g),m=g,h+1)}function xe(){return g==="f"&&(T.push(g),m=g,h+=1),/[eE]/.test(g)||(g==="-"||g==="+")&&/[eE]/.test(m)?(T.push(g),m=g,h+1):/[^\d]/.test(g)?(ge(T.join("")),b=o,h):(T.push(g),m=g,h+1)}function _e(){if(/[^\d\w_]/.test(g)){var fe=T.join("");return R[fe]?b=x:me[fe]?b=y:b=d,ge(T.join("")),b=o,h}return T.push(g),m=g,h+1}}return hr}var mr,ro;function wc(){if(ro)return mr;ro=1;var t=bc();mr=e;function e(n,r){var i=t(r),o=[];return o=o.concat(i(n)),o=o.concat(i(null)),o}return mr}wc();function kc(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function Tc(t){var e=kc(t,"string");return typeof e=="symbol"?e:String(e)}function Se(t,e,n){return e=Tc(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var le={position:"csm_Position",positionRaw:"csm_PositionRaw",pointSize:"csm_PointSize",fragColor:"csm_FragColor",diffuseColor:"csm_DiffuseColor",normal:"csm_Normal",roughness:"csm_Roughness",metalness:"csm_Metalness",emissive:"csm_Emissive",ao:"csm_AO",bump:"csm_Bump",depthAlpha:"csm_DepthAlpha"},$e,zt;$e={},Se($e,"".concat(le.normal),{"#include ":` vec3 objectNormal = `.concat(le.normal,`; #ifdef USE_TANGENT vec3 objectTangent = vec3( tangent.xyz ); @@ -480,9 +480,9 @@ list should be an Array.`),w.length===0)return new v(0);if(w.length===1)return w gl_FragColor = `.concat(le.diffuseColor,`; `)}),Se(zt,"".concat(le.fragColor),{"gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );":` gl_FragColor = `.concat(le.fragColor,`; - `)});var Ge;Ge={},Se(Ge,"".concat(le.position),"*"),Se(Ge,"".concat(le.positionRaw),"*"),Se(Ge,"".concat(le.normal),"*"),Se(Ge,"".concat(le.pointSize),["PointsMaterial"]),Se(Ge,"".concat(le.diffuseColor),"*"),Se(Ge,"".concat(le.fragColor),"*"),Se(Ge,"".concat(le.emissive),["MeshStandardMaterial","MeshPhysicalMaterial"]),Se(Ge,"".concat(le.roughness),["MeshStandardMaterial","MeshPhysicalMaterial"]),Se(Ge,"".concat(le.metalness),["MeshStandardMaterial","MeshPhysicalMaterial"]),Se(Ge,"".concat(le.ao),["MeshStandardMaterial","MeshPhysicalMaterial","MeshBasicMaterial","MeshLambertMaterial","MeshPhongMaterial","MeshToonMaterial"]),Se(Ge,"".concat(le.bump),["MeshLambertMaterial","MeshMatcapMaterial","MeshNormalMaterial","MeshPhongMaterial","MeshPhysicalMaterial","MeshStandardMaterial","MeshToonMaterial","ShadowMaterial"]),Se(Ge,"".concat(le.depthAlpha),"*");var Tc=`void main() { + `)});var Ge;Ge={},Se(Ge,"".concat(le.position),"*"),Se(Ge,"".concat(le.positionRaw),"*"),Se(Ge,"".concat(le.normal),"*"),Se(Ge,"".concat(le.pointSize),["PointsMaterial"]),Se(Ge,"".concat(le.diffuseColor),"*"),Se(Ge,"".concat(le.fragColor),"*"),Se(Ge,"".concat(le.emissive),["MeshStandardMaterial","MeshPhysicalMaterial"]),Se(Ge,"".concat(le.roughness),["MeshStandardMaterial","MeshPhysicalMaterial"]),Se(Ge,"".concat(le.metalness),["MeshStandardMaterial","MeshPhysicalMaterial"]),Se(Ge,"".concat(le.ao),["MeshStandardMaterial","MeshPhysicalMaterial","MeshBasicMaterial","MeshLambertMaterial","MeshPhongMaterial","MeshToonMaterial"]),Se(Ge,"".concat(le.bump),["MeshLambertMaterial","MeshMatcapMaterial","MeshNormalMaterial","MeshPhongMaterial","MeshPhysicalMaterial","MeshStandardMaterial","MeshToonMaterial","ShadowMaterial"]),Se(Ge,"".concat(le.depthAlpha),"*");var _c=`void main() { gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); -}`,_c=`#include +}`,Ec=`#include void main() { vec2 center = vec2(0., 1.); @@ -507,7 +507,7 @@ void main() { mvPosition.xy += rotatedPosition; gl_Position = projectionMatrix * mvPosition; -}`;const vn=new ae(0,0,0),di=new ae(0,0,0),Ec=new ae(0,0,0);function io(t,e,n){const r=vn.setFromMatrixPosition(t.matrixWorld);r.project(e);const i=n.width/2,o=n.height/2;return[(Number.isNaN(r.x)?0:r.x)*i+i,-(r.y*o)+o,r.z]}function Mc(t,e){const n=vn.setFromMatrixPosition(t.matrixWorld),r=di.setFromMatrixPosition(e.matrixWorld),i=n.sub(r),o=e.getWorldDirection(Ec);return i.angleTo(o)>Math.PI/2}function Ac(t,e,n,r){const i=vn.setFromMatrixPosition(t.matrixWorld),o=i.clone();o.project(e),n.setFromCamera(new Pe(o.x,o.y),e);const a=n.intersectObjects(r,!0);if(a.length>0){const s=a[0].distance;return i.distanceTo(n.ray.origin)Math.abs(t)<1e-10?0:t;function Na(t,e,n=""){let r="matrix3d(";for(let i=0;i!==16;i++)r+=Br(e[i]*t.elements[i])+(i!==15?",":")");return n+r}const Rc=(t=>e=>Na(e,t))([1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1]),Cc=(t=>(e,n)=>Na(e,t(n),"translate(-50%,-50%)"))(t=>[1/t,1/t,1/t,1,-1/t,-1/t,-1/t,-1,1/t,1/t,1/t,1,1,1,1,1]),Nc=["geometry","material"];new Qo;var zr={exports:{}},Lc=zr.exports,oo;function Pc(){return oo||(oo=1,function(t,e){(function(n,r){t.exports=r()})(Lc,function(){var n=function(){function r(d){return a.appendChild(d.dom),d}function i(d){for(var y=0;yl+1e3&&(c.update(1e3*u/(d-l),100),l=d,u=0,p)){var y=performance.memory;p.update(y.usedJSHeapSize/1048576,y.jsHeapSizeLimit/1048576)}return d},update:function(){s=this.end()},domElement:a,setMode:i}};return n.Panel=function(r,i,o){var a=1/0,s=0,l=Math.round,u=l(window.devicePixelRatio||1),c=80*u,f=48*u,p=3*u,d=2*u,y=3*u,x=15*u,v=74*u,k=30*u,A=document.createElement("canvas");A.width=c,A.height=f,A.style.cssText="width:80px;height:48px";var E=A.getContext("2d");return E.font="bold "+9*u+"px Helvetica,Arial,sans-serif",E.textBaseline="top",E.fillStyle=o,E.fillRect(0,0,c,f),E.fillStyle=i,E.fillText(r,p,d),E.fillRect(y,x,v,k),E.fillStyle=o,E.globalAlpha=.9,E.fillRect(y,x,v,k),{dom:A,update:function(C,P){a=Math.min(a,C),s=Math.max(s,C),E.fillStyle=o,E.globalAlpha=1,E.fillRect(0,0,c,x),E.fillStyle=i,E.fillText(l(C)+" "+r+" ("+l(a)+"-"+l(s)+")",p,d),E.drawImage(A,y+u,x,v-u,k,y,x,v-u,k),E.fillRect(y+v-u,x,u,k),E.fillStyle=o,E.globalAlpha=.9,E.fillRect(y+v-u,x,u,l((1-C/P)*k))}}},n})}(zr)),zr.exports}Pc();const Dc={key:0,args:[0,1,64]},Oc={key:1,args:[.5,1,64]},Fc={key:2},Bc=["tone-mapped","map","side","color"];new ze(16777215);const Ut=Fe({__name:"Range",props:{modelValue:null,min:{default:0},max:{default:100},step:{default:1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","mousedown"],setup(t,{emit:e}){const n=t,r=e,i=W(null);function o(y,x,v){return Math.min(Math.max(y,x),v)}function a(y){const x=y.toString();return x.includes("e-")?Number.parseInt(x.split("e-")[1],10):x.includes(".")?x.split(".")[1].length:0}function s(y,x){const v=a(x),k=10**(v+3);return Number.parseFloat((y*k/k).toFixed(v))}const l=je(()=>s(o(n.modelValue,n.min,n.max),n.step)),u=je(()=>{const y=(l.value-n.min)/(n.max-n.min)*100;return{width:`${y}%`,backgroundSize:`${y}% 100%`}});function c(y){if(!i.value)return l.value;const x=i.value.getBoundingClientRect(),k=(y.clientX-x.left)/x.width,A=n.max-n.min,E=n.min+A*k,C=Math.round(E/n.step)*n.step;return Math.min(Math.max(C,n.min),n.max)}function f(y){if(n.disabled)return;const x=c(y);r("update:modelValue",x)}function p(y){if(n.disabled)return;y.preventDefault();const x=c(y);r("update:modelValue",x),window.addEventListener("mousemove",f),window.addEventListener("mouseup",d)}function d(y){window.removeEventListener("mousemove",f),window.removeEventListener("mouseup",d)}return Ot(()=>{window.removeEventListener("mousemove",f),window.removeEventListener("mouseup",d)}),(y,x)=>(Z(),re("span",{ref_key:"sliderRef",ref:i,class:st(["range-slider disabled:pointer-events-none disabled:cursor-default disabled:opacity-50",{disabled:t.disabled}]),bg:"[#e6e1fc] dark:[#676085]","touch-action-none":"",relative:"","inline-block":"","w-full":"","cursor-ew-resize":"","rounded-sm":"",onMousedown:p},[O("span",{style:Lr(u.value),bg:"[#cabeff] dark:[#4e34b9]",relative:"",block:"","rounded-sm":"",h:"[14px]"},null,4),O("span",{role:"slider",class:"slider-thumb",style:Lr({left:`${(l.value-t.min)/(t.max-t.min)*100}%`}),absolute:"","rounded-sm":"",w:"[1px]",h:"[14px]",bg:"neutral-100 dark:neutral-400",top:"50%",transform:"translate-x-[50%] translate-y-[-50%]"},null,4)],34))}});function ao(t,e){if(e===Gs)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),t;if(e===Pr||e===oa){let n=t.getIndex();if(n===null){const a=[],s=t.getAttribute("position");if(s!==void 0){for(let l=0;l=2.0 are supported."));return}const u=new vf(o,{path:n||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});u.fileLoader.setRequestHeader(this.requestHeader);for(let c=0;c=0&&s[f]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+f+'".')}}u.setExtensions(a),u.setPlugins(s),u.parse(r,i)}parseAsync(e,n){const r=this;return new Promise(function(i,o){r.parse(e,n,i,o)})}}function Uc(){let t={};return{get:function(e){return t[e]},add:function(e,n){t[e]=n},remove:function(e){delete t[e]},removeAll:function(){t={}}}}const de={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"};class jc{constructor(e){this.parser=e,this.name=de.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,n=this.parser.json.nodes||[];for(let r=0,i=n.length;r=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return n.loadTextureImage(e,o.source,a)}}class tf{constructor(e){this.parser=e,this.name=de.EXT_TEXTURE_WEBP}loadTexture(e){const n=this.name,r=this.parser,i=r.json,o=i.textures[e];if(!o.extensions||!o.extensions[n])return null;const a=o.extensions[n],s=i.images[a.source];let l=r.textureLoader;if(s.uri){const u=r.options.manager.getHandler(s.uri);u!==null&&(l=u)}return r.loadTextureImage(e,a.source,l)}}class nf{constructor(e){this.parser=e,this.name=de.EXT_TEXTURE_AVIF}loadTexture(e){const n=this.name,r=this.parser,i=r.json,o=i.textures[e];if(!o.extensions||!o.extensions[n])return null;const a=o.extensions[n],s=i.images[a.source];let l=r.textureLoader;if(s.uri){const u=r.options.manager.getHandler(s.uri);u!==null&&(l=u)}return r.loadTextureImage(e,a.source,l)}}class rf{constructor(e){this.name=de.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const n=this.parser.json,r=n.bufferViews[e];if(r.extensions&&r.extensions[this.name]){const i=r.extensions[this.name],o=this.parser.getDependency("buffer",i.buffer),a=this.parser.options.meshoptDecoder;if(!a||!a.supported){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return o.then(function(s){const l=i.byteOffset||0,u=i.byteLength||0,c=i.count,f=i.byteStride,p=new Uint8Array(s,l,u);return a.decodeGltfBufferAsync?a.decodeGltfBufferAsync(c,f,p,i.mode,i.filter).then(function(d){return d.buffer}):a.ready.then(function(){const d=new ArrayBuffer(c*f);return a.decodeGltfBuffer(new Uint8Array(d),c,f,p,i.mode,i.filter),d})})}else return null}}class of{constructor(e){this.name=de.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const n=this.parser.json,r=n.nodes[e];if(!r.extensions||!r.extensions[this.name]||r.mesh===void 0)return null;const i=n.meshes[r.mesh];for(const u of i.primitives)if(u.mode!==nt.TRIANGLES&&u.mode!==nt.TRIANGLE_STRIP&&u.mode!==nt.TRIANGLE_FAN&&u.mode!==void 0)return null;const a=r.extensions[this.name].attributes,s=[],l={};for(const u in a)s.push(this.parser.getDependency("accessor",a[u]).then(c=>(l[u]=c,l[u])));return s.length<1?null:(s.push(this.parser.createNodeMesh(e)),Promise.all(s).then(u=>{const c=u.pop(),f=c.isGroup?c.children:[c],p=u[0].count,d=[];for(const y of f){const x=new xt,v=new ae,k=new Fn,A=new ae(1,1,1),E=new Xs(y.geometry,y.material,p);for(let C=0;C0||t.search(/^data\:image\/jpeg/)===0?"image/jpeg":t.search(/\.webp($|\?)/i)>0||t.search(/^data\:image\/webp/)===0?"image/webp":t.search(/\.ktx2($|\?)/i)>0||t.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const xf=new xt;class vf{constructor(e={},n={}){this.json=e,this.extensions={},this.plugins={},this.options=n,this.cache=new Uc,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 r=!1,i=-1,o=!1,a=-1;if(typeof navigator<"u"){const s=navigator.userAgent;r=/^((?!chrome|android).)*safari/i.test(s)===!0;const l=s.match(/Version\/(\d+)/);i=r&&l?parseInt(l[1],10):-1,o=s.indexOf("Firefox")>-1,a=o?s.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||r&&i<17||o&&a<98?this.textureLoader=new Qs(this.options.manager):this.textureLoader=new Js(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new aa(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,n){const r=this,i=this.json,o=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(a){return a._markDefs&&a._markDefs()}),Promise.all(this._invokeAll(function(a){return a.beforeRoot&&a.beforeRoot()})).then(function(){return Promise.all([r.getDependencies("scene"),r.getDependencies("animation"),r.getDependencies("camera")])}).then(function(a){const s={scene:a[0][i.scene||0],scenes:a[0],animations:a[1],cameras:a[2],asset:i.asset,parser:r,userData:{}};return Rt(o,s,i),gt(s,i),Promise.all(r._invokeAll(function(l){return l.afterRoot&&l.afterRoot(s)})).then(function(){for(const l of s.scenes)l.updateMatrixWorld();e(s)})}).catch(n)}_markDefs(){const e=this.json.nodes||[],n=this.json.skins||[],r=this.json.meshes||[];for(let i=0,o=n.length;i{const l=this.associations.get(a);l!=null&&this.associations.set(s,l);for(const[u,c]of a.children.entries())o(c,s.children[u])};return o(r,i),i.name+="_instance_"+e.uses[n]++,i}_invokeOne(e){const n=Object.values(this.plugins);n.push(this);for(let r=0;r=2&&v.setY(g,h[I*l+1]),l>=3&&v.setZ(g,h[I*l+2]),l>=4&&v.setW(g,h[I*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}v.normalized=y}return v})}loadTexture(e){const n=this.json,r=this.options,o=n.textures[e].source,a=n.images[o];let s=this.textureLoader;if(a.uri){const l=r.manager.getHandler(a.uri);l!==null&&(s=l)}return this.loadTextureImage(e,o,s)}loadTextureImage(e,n,r){const i=this,o=this.json,a=o.textures[e],s=o.images[n],l=(s.uri||s.bufferView)+":"+a.sampler;if(this.textureCache[l])return this.textureCache[l];const u=this.loadImageSource(n,r).then(function(c){c.flipY=!1,c.name=a.name||s.name||"",c.name===""&&typeof s.uri=="string"&&s.uri.startsWith("data:image/")===!1&&(c.name=s.uri);const p=(o.samplers||{})[a.sampler]||{};return c.magFilter=lo[p.magFilter]||zn,c.minFilter=lo[p.minFilter]||ii,c.wrapS=uo[p.wrapS]||Un,c.wrapT=uo[p.wrapT]||Un,c.generateMipmaps=!c.isCompressedTexture&&c.minFilter!==Lt&&c.minFilter!==zn,i.associations.set(c,{textures:e}),c}).catch(function(){return null});return this.textureCache[l]=u,u}loadImageSource(e,n){const r=this,i=this.json,o=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(f=>f.clone());const a=i.images[e],s=self.URL||self.webkitURL;let l=a.uri||"",u=!1;if(a.bufferView!==void 0)l=r.getDependency("bufferView",a.bufferView).then(function(f){u=!0;const p=new Blob([f],{type:a.mimeType});return l=s.createObjectURL(p),l});else if(a.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const c=Promise.resolve(l).then(function(f){return new Promise(function(p,d){let y=p;n.isImageBitmapLoader===!0&&(y=function(x){const v=new Bn(x);v.needsUpdate=!0,p(v)}),n.load(cn.resolveURL(f,o.path),y,void 0,d)})}).then(function(f){return u===!0&&s.revokeObjectURL(l),gt(f,a),f.userData.mimeType=a.mimeType||yf(a.uri),f}).catch(function(f){throw console.error("THREE.GLTFLoader: Couldn't load texture",l),f});return this.sourceCache[e]=c,c}assignTexture(e,n,r,i){const o=this;return this.getDependency("texture",r.index).then(function(a){if(!a)return null;if(r.texCoord!==void 0&&r.texCoord>0&&(a=a.clone(),a.channel=r.texCoord),o.extensions[de.KHR_TEXTURE_TRANSFORM]){const s=r.extensions!==void 0?r.extensions[de.KHR_TEXTURE_TRANSFORM]:void 0;if(s){const l=o.associations.get(a);a=o.extensions[de.KHR_TEXTURE_TRANSFORM].extendTexture(a,s),o.associations.set(a,l)}}return i!==void 0&&(a.colorSpace=i),e[n]=a,a})}assignFinalMaterial(e){const n=e.geometry;let r=e.material;const i=n.attributes.tangent===void 0,o=n.attributes.color!==void 0,a=n.attributes.normal===void 0;if(e.isPoints){const s="PointsMaterial:"+r.uuid;let l=this.cache.get(s);l||(l=new el,nr.prototype.copy.call(l,r),l.color.copy(r.color),l.map=r.map,l.sizeAttenuation=!1,this.cache.add(s,l)),r=l}else if(e.isLine){const s="LineBasicMaterial:"+r.uuid;let l=this.cache.get(s);l||(l=new tl,nr.prototype.copy.call(l,r),l.color.copy(r.color),l.map=r.map,this.cache.add(s,l)),r=l}if(i||o||a){let s="ClonedMaterial:"+r.uuid+":";i&&(s+="derivative-tangents:"),o&&(s+="vertex-colors:"),a&&(s+="flat-shading:");let l=this.cache.get(s);l||(l=r.clone(),o&&(l.vertexColors=!0),a&&(l.flatShading=!0),i&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(s,l),this.associations.set(l,this.associations.get(r))),r=l}e.material=r}getMaterialType(){return sa}loadMaterial(e){const n=this,r=this.json,i=this.extensions,o=r.materials[e];let a;const s={},l=o.extensions||{},u=[];if(l[de.KHR_MATERIALS_UNLIT]){const f=i[de.KHR_MATERIALS_UNLIT];a=f.getMaterialType(),u.push(f.extendParams(s,o,n))}else{const f=o.pbrMetallicRoughness||{};if(s.color=new ze(1,1,1),s.opacity=1,Array.isArray(f.baseColorFactor)){const p=f.baseColorFactor;s.color.setRGB(p[0],p[1],p[2],vt),s.opacity=p[3]}f.baseColorTexture!==void 0&&u.push(n.assignTexture(s,"map",f.baseColorTexture,mn)),s.metalness=f.metallicFactor!==void 0?f.metallicFactor:1,s.roughness=f.roughnessFactor!==void 0?f.roughnessFactor:1,f.metallicRoughnessTexture!==void 0&&(u.push(n.assignTexture(s,"metalnessMap",f.metallicRoughnessTexture)),u.push(n.assignTexture(s,"roughnessMap",f.metallicRoughnessTexture))),a=this._invokeOne(function(p){return p.getMaterialType&&p.getMaterialType(e)}),u.push(Promise.all(this._invokeAll(function(p){return p.extendMaterialParams&&p.extendMaterialParams(e,s)})))}o.doubleSided===!0&&(s.side=Kn);const c=o.alphaMode||yr.OPAQUE;if(c===yr.BLEND?(s.transparent=!0,s.depthWrite=!1):(s.transparent=!1,c===yr.MASK&&(s.alphaTest=o.alphaCutoff!==void 0?o.alphaCutoff:.5)),o.normalTexture!==void 0&&a!==Vt&&(u.push(n.assignTexture(s,"normalMap",o.normalTexture)),s.normalScale=new Pe(1,1),o.normalTexture.scale!==void 0)){const f=o.normalTexture.scale;s.normalScale.set(f,f)}if(o.occlusionTexture!==void 0&&a!==Vt&&(u.push(n.assignTexture(s,"aoMap",o.occlusionTexture)),o.occlusionTexture.strength!==void 0&&(s.aoMapIntensity=o.occlusionTexture.strength)),o.emissiveFactor!==void 0&&a!==Vt){const f=o.emissiveFactor;s.emissive=new ze().setRGB(f[0],f[1],f[2],vt)}return o.emissiveTexture!==void 0&&a!==Vt&&u.push(n.assignTexture(s,"emissiveMap",o.emissiveTexture,mn)),Promise.all(u).then(function(){const f=new a(s);return o.name&&(f.name=o.name),gt(f,o),n.associations.set(f,{materials:e}),o.extensions&&Rt(i,f,o),f})}createUniqueName(e){const n=hn.sanitizeNodeName(e||"");return n in this.nodeNamesUsed?n+"_"+ ++this.nodeNamesUsed[n]:(this.nodeNamesUsed[n]=0,n)}loadGeometries(e){const n=this,r=this.extensions,i=this.primitiveCache;function o(s){return r[de.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(s,n).then(function(l){return co(l,s,n)})}const a=[];for(let s=0,l=e.length;s0&&mf(k,o),k.name=n.createUniqueName(o.name||"mesh_"+e),gt(k,o),v.extensions&&Rt(i,k,v),n.assignFinalMaterial(k),f.push(k)}for(let d=0,y=f.length;d1?c=new rr:u.length===1?c=u[0]:c=new oi,c!==u[0])for(let f=0,p=u.length;f{const f=new Map;for(const[p,d]of i.associations)(p instanceof nr||p instanceof Bn)&&f.set(p,d);return c.traverse(p=>{const d=i.associations.get(p);d!=null&&f.set(p,d)}),f};return i.associations=u(o),o})}_createAnimationTracks(e,n,r,i,o){const a=[],s=e.name?e.name:e.uuid,l=[];kt[o.path]===kt.weights?e.traverse(function(p){p.morphTargetInfluences&&l.push(p.name?p.name:p.uuid)}):l.push(s);let u;switch(kt[o.path]){case kt.weights:u=Ii;break;case kt.rotation:u=Ri;break;case kt.translation:case kt.scale:u=Si;break;default:switch(r.itemSize){case 1:u=Ii;break;case 2:case 3:default:u=Si;break}break}const c=i.interpolation!==void 0?df[i.interpolation]:ei,f=this._getArrayFromAccessor(r);for(let p=0,d=l.length;pnew Tl(t)),Ct.register(t=>new _l(t)),Ct)}async function wf(t){const r=(await Da().loadAsync(t)).userData;if(!r.vrmAnimations){console.warn("No VRM animations found in the .vrma file");return}if(r.vrmAnimations.length===0){console.warn("No VRM animations found in the .vrma file");return}return r.vrmAnimations[0]}async function kf(t,e){if(!t){console.warn("No VRM found");return}if(e)return El(e,t)}function Tf(){const t=W(!1),e=W(0),n=W(0),r=.2,i=1,o=6,a=W(Math.random()*(o-i)+i);function s(l,u){if(l!=null&&l.expressionManager&&(n.value+=u,!t.value&&n.value>=a.value&&(t.value=!0,e.value=0),t.value)){e.value+=u/r;const c=Math.sin(Math.PI*e.value);l.expressionManager.setValue("blink",c),e.value>=1&&(t.value=!1,n.value=0,l.expressionManager.setValue("blink",0),a.value=Math.random()*(o-i)+i)}}return{update:s}}function _f(){let t=-1,e,n=0;function r(){e?e.set(on(-.25,.25),on(-.2,.15),-.65):e=new ae(on(-.25,.25),on(-.2,.15),-.65)}function i(o,a){var s;!(o!=null&&o.expressionManager)||!o.lookAt||(n>=t?(r(),n=0,t=Ml()/1e3):e||r(),o.lookAt.target||(o.lookAt.target=new oi),o.lookAt.target.position.lerp(e,on(.2,.5)),(s=o.lookAt)==null||s.update(a),n+=a)}return{update:i}}async function Ef(t,e){const i=(await Da().loadAsync(t,a=>{var s;return(s=e==null?void 0:e.onProgress)==null?void 0:s.call(e,a)})).userData;if(!i.vrm)return;const o=i.vrm;if(Dr.removeUnnecessaryVertices(o.scene),Dr.combineSkeletons(o.scene),o.scene.traverse(a=>{a.frustumCulled=!1}),o.lookAt){const a=new Al(o.lookAt);a.name="lookAtQuaternionProxy",o.scene.add(a)}return e!=null&&e.scene&&e.scene.add(o.scene),e!=null&&e.position&&o.scene.position.set(...e.position),o}function Mf(t){const e=W(null),n=W(!1),r=W(0),i=W(new Map),o=W(new Map),a=W(),s=(k,A,E)=>k+(A-k)*E,l=k=>k<.5?4*k*k*k:1-(-2*k+2)**3/2,u=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}]]),c=()=>{a.value&&(clearTimeout(a.value),a.value=void 0)},f=k=>{var E;if(c(),!u.has(k)){console.warn(`Emotion ${k} not found`);return}const A=u.get(k);if(e.value=k,n.value=!0,r.value=0,t.expressionManager){const C=Object.keys(t.expressionManager.expressionMap);for(const P of C)t.expressionManager.setValue(P,0)}i.value.clear(),o.value.clear();for(const C of A.expression||[]){const P=((E=t.expressionManager)==null?void 0:E.getValue(C.name))||0;i.value.set(C.name,P),o.value.set(C.name,C.value)}};return{currentEmotion:e,isTransitioning:n,setEmotion:f,setEmotionWithResetAfter:(k,A)=>{c(),f(k),a.value=setTimeout(()=>{f("neutral"),a.value=void 0},A)},update:k=>{var C;if(!n.value||!e.value)return;const E=u.get(e.value).blendDuration||.3;r.value+=k/E,r.value>=1&&(r.value=1,n.value=!1);for(const[P,h]of o.value){const I=i.value.get(P)||0,b=s(I,h,l(r.value));(C=t.expressionManager)==null||C.setValue(P,b)}},addEmotionState:(k,A)=>{u.set(k,A)},removeEmotionState:k=>{u.delete(k)},dispose:()=>{c()}}}const Af=Fe({__name:"Model",props:{model:null,idleAnimation:null,loadAnimations:null,position:null,paused:{type:Boolean}},emits:["loadModelProgress","error"],setup(t,{expose:e,emit:n}){const r=t,i=n;let o;const a=W(),s=W(),{scene:l}=Yn(),{onBeforeRender:u}=On(),c=Tf(),f=_f(),p=W();Be(()=>r.position,([x,v,k])=>{a.value&&a.value.scene.position.set(x,v,k)}),pn(async()=>{if(l.value)try{const x=await Ef(r.model,{scene:l.value,lookAt:!0,position:r.position,onProgress:A=>i("loadModelProgress",Number.parseFloat((100*(A.loaded/A.total)).toFixed(2)))});if(!x){console.warn("No VRM model loaded");return}const v=await wf(r.idleAnimation),k=await kf(x,v);if(!k){console.warn("No VRM animation loaded");return}s.value=new dl(x.scene),s.value.clipAction(k).play(),p.value=Mf(x),a.value=x,o=u(({delta:A})=>{var E,C,P;(E=s.value)==null||E.update(A),(C=a.value)==null||C.update(A),c.update(a.value,A),f.update(a.value,A),(P=p.value)==null||P.update(A)}).off}catch(x){i("error",x)}}),Ot(()=>{o==null||o(),a.value&&(a.value.scene.removeFromParent(),Dr.deepDispose(a.value.scene))}),e({setExpression(x){var v;(v=p.value)==null||v.setEmotionWithResetAfter(x,1e3)}});const{pause:d,resume:y}=On();return Be(()=>r.paused,x=>{x?d():y()}),(x,v)=>gn(x.$slots,"default")}}),Sf=["position"],If={absolute:"",bottom:"3",right:"3"},Rf={flex:"~ row","cursor-pointer":""},Cf=["checked","aria-checked"],Nf={key:0,"min-w":"50vw",z:"{var x;(x=p.value)==null||x.setExpression(y)}}),(y,x)=>(Z(),Xt(ha,{relative:""},{default:Ue(({height:v,width:k})=>[ke(V(pl),{alpha:!0,antialias:!0,width:k,height:v},{default:Ue(()=>[ke(V(hc)),O("TresPerspectiveCamera",{position:[a.value,s.value,l.value]},null,8,Sf),x[14]||(x[14]=O("TresDirectionalLight",{color:16777215,intensity:1.2,position:[1,1,1]},null,-1)),x[15]||(x[15]=O("TresAmbientLight",{color:16777215,intensity:1.5},null,-1)),ke(Af,{ref_key:"modelRef",ref:p,model:r.model,"idle-animation":r.idleAnimation,position:[u.value,c.value,f.value],paused:r.paused,onLoadModelProgress:x[0]||(x[0]=A=>i("loadModelProgress",A)),onError:x[1]||(x[1]=A=>i("error",A))},null,8,["model","idle-animation","position","paused"])]),_:2},1032,["width","height"]),O("div",If,[O("div",Rf,[O("label",{class:st([o.value?"bg-neutral-300 dark:bg-neutral-200":"bg-neutral-100 dark:bg-neutral-700"]),transition:"all ease-in-out duration-500",text:"lg neutral-500 dark:neutral-400","m-1":"","h-fit":"","w-fit":"","cursor-pointer":"","appearance-none":"","gap-1":"","rounded-lg":"","rounded-md":"","border-none":"","p-2":"","outline-none":""},[Et(O("input",{"onUpdate:modelValue":x[2]||(x[2]=A=>o.value=A),checked:o.value,"aria-checked":o.value,name:"showLive2DViewerInspector",type:"checkbox",hidden:"","appearance-none":"","outline-none":""},null,8,Cf),[[Qr,o.value]]),x[16]||(x[16]=O("div",{"select-none":""},[O("div",{"i-solar:bug-bold-duotone":""})],-1))],2)]),ke(V(ui),null,{default:Ue(()=>[o.value?(Z(),re("div",Nf,[O("div",Lf,[O("div",Pf,[O("span",null,he(V(d)("stage.viewers.debug-menu.vrm.model.title")),1)]),ke(Pi,{"h-fit":"","w-full":"",flex:"~ col",border:"~ gray/25 rounded-lg",divide:"y dashed gray/25","of-clip":"","shadow-sm":""},{label:Ue(()=>[O("span",Df,he(V(d)("stage.viewers.debug-menu.vrm.camera")),1)]),default:Ue(()=>[O("div",Of,[x[17]||(x[17]=O("div",{text:"neutral-400 dark:neutral-500"},[O("span",null,"X")],-1)),O("label",Ff,[ke(Ut,{modelValue:a.value,"onUpdate:modelValue":x[3]||(x[3]=A=>a.value=A),min:-10,max:10,step:.01},null,8,["modelValue"])]),O("div",Bf,[O("span",null,he(a.value),1)]),x[18]||(x[18]=O("div",{text:"neutral-400 dark:neutral-500"},[O("span",null,"Y")],-1)),O("label",zf,[ke(Ut,{modelValue:s.value,"onUpdate:modelValue":x[4]||(x[4]=A=>s.value=A),min:-10,max:10,step:.01},null,8,["modelValue"])]),O("div",Uf,[O("span",null,he(s.value),1)]),x[19]||(x[19]=O("div",{text:"neutral-400 dark:neutral-500"},[O("span",null,"Z")],-1)),O("label",jf,[ke(Ut,{modelValue:l.value,"onUpdate:modelValue":x[5]||(x[5]=A=>l.value=A),min:-10,max:10,step:.01},null,8,["modelValue"])]),O("div",Vf,[O("span",null,he(l.value),1)])])]),_:1}),ke(Pi,{"h-fit":"","w-full":"",flex:"~ col",border:"~ gray/25 rounded-lg",divide:"y dashed gray/25","of-clip":"","shadow-sm":""},{label:Ue(()=>[O("span",Hf,he(V(d)("stage.viewers.debug-menu.vrm.model.title")),1)]),default:Ue(()=>[O("div",$f,[x[20]||(x[20]=O("div",{text:"neutral-400 dark:neutral-500"},[O("span",null,"X")],-1)),O("label",Gf,[ke(Ut,{modelValue:u.value,"onUpdate:modelValue":x[6]||(x[6]=A=>u.value=A),min:-10,max:10,step:.01},null,8,["modelValue"])]),O("div",Yf,[O("span",null,he(u.value),1)]),x[21]||(x[21]=O("div",{text:"neutral-400 dark:neutral-500"},[O("span",null,"Y")],-1)),O("label",Kf,[ke(Ut,{modelValue:c.value,"onUpdate:modelValue":x[7]||(x[7]=A=>c.value=A),min:-10,max:10,step:.01},null,8,["modelValue"])]),O("div",qf,[O("span",null,he(c.value),1)]),x[22]||(x[22]=O("div",{text:"neutral-400 dark:neutral-500"},[O("span",null,"Z")],-1)),O("label",Wf,[ke(Ut,{modelValue:f.value,"onUpdate:modelValue":x[8]||(x[8]=A=>f.value=A),min:-10,max:10,step:.01},null,8,["modelValue"])]),O("div",Xf,[O("span",null,he(f.value),1)])])]),_:1}),O("div",Zf,[O("span",null,he(V(d)("stage.viewers.debug-menu.emotions")),1)]),O("div",Qf,[O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:x[9]||(x[9]=A=>{var E;return(E=p.value)==null?void 0:E.setExpression("neutral")})},he(V(d)("stage.viewers.debug-menu.emotions-btn.neutral")),1),O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:x[10]||(x[10]=A=>{var E;return(E=p.value)==null?void 0:E.setExpression("surprised")})},he(V(d)("stage.viewers.debug-menu.emotions-btn.surprised")),1),O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:x[11]||(x[11]=A=>{var E;return(E=p.value)==null?void 0:E.setExpression("sad")})},he(V(d)("stage.viewers.debug-menu.emotions-btn.sad")),1),O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:x[12]||(x[12]=A=>{var E;return(E=p.value)==null?void 0:E.setExpression("angry")})},he(V(d)("stage.viewers.debug-menu.emotions-btn.angry")),1),O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:x[13]||(x[13]=A=>{var E;return(E=p.value)==null?void 0:E.setExpression("happy")})},he(V(d)("stage.viewers.debug-menu.emotions-btn.happy")),1)])])])):it("",!0)]),_:1})])]),_:1}))}}),ed=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class bn{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}}bn.prototype.normal={};bn.prototype.property={};bn.prototype.space=void 0;function Oa(t,e){const n={},r={};for(const i of t)Object.assign(n,i.property),Object.assign(r,i.normal);return new bn(n,r,e)}function Vr(t){return t.toLowerCase()}class We{constructor(e,n){this.attribute=n,this.property=e}}We.prototype.attribute="";We.prototype.booleanish=!1;We.prototype.boolean=!1;We.prototype.commaOrSpaceSeparated=!1;We.prototype.commaSeparated=!1;We.prototype.defined=!1;We.prototype.mustUseProperty=!1;We.prototype.number=!1;We.prototype.overloadedBoolean=!1;We.prototype.property="";We.prototype.spaceSeparated=!1;We.prototype.space=void 0;let td=0;const ce=Ft(),Le=Ft(),Fa=Ft(),G=Ft(),Re=Ft(),Kt=Ft(),Qe=Ft();function Ft(){return 2**++td}const Hr=Object.freeze(Object.defineProperty({__proto__:null,boolean:ce,booleanish:Le,commaOrSpaceSeparated:Qe,commaSeparated:Kt,number:G,overloadedBoolean:Fa,spaceSeparated:Re},Symbol.toStringTag,{value:"Module"})),vr=Object.keys(Hr);class pi extends We{constructor(e,n,r,i){let o=-1;if(super(e,n),fo(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&od.test(e)){if(e.charAt(4)==="-"){const o=e.slice(5).replace(po,ld);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=e.slice(4);if(!po.test(o)){let a=o.replace(id,sd);a.charAt(0)!=="-"&&(a="-"+a),e="data"+a}}i=pi}return new i(r,e)}function sd(t){return"-"+t.toLowerCase()}function ld(t){return t.charAt(1).toUpperCase()}const ud=Oa([Ba,nd,ja,Va,Ha],"html"),$a=Oa([Ba,rd,ja,Va,Ha],"svg"),ho={}.hasOwnProperty;function cd(t,e){const n=e||{};function r(i,...o){let a=r.invalid;const s=r.handlers;if(i&&ho.call(i,t)){const l=String(i[t]);a=ho.call(s,l)?s[l]:r.unknown}if(a)return a.call(this,i,...o)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const fd=/^>|^->||--!>|"],pd=["<",">"];function hd(t,e,n,r){return r.settings.bogusComments?"":"";function i(o){return Gt(o,Object.assign({},r.settings.characterReferences,{subset:pd}))}}function md(t,e,n,r){return""}function gd(t,e){const n=e||{};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function yd(t){return t.join(" ").trim()}const xd=/[ \t\n\f\r]/g;function hi(t){return typeof t=="object"?t.type==="text"?mo(t.value):!1:mo(t)}function mo(t){return t.replace(xd,"")===""}const De=Ya(1),Ga=Ya(-1),vd=[];function Ya(t){return e;function e(n,r,i){const o=n?n.children:vd;let a=(r||0)+t,s=o[a];if(!i)for(;s&&hi(s);)a+=t,s=o[a];return s}}const bd={}.hasOwnProperty;function Ka(t){return e;function e(n,r,i){return bd.call(t,n.tagName)&&t[n.tagName](n,r,i)}}const mi=Ka({body:kd,caption:br,colgroup:br,dd:Md,dt:Ed,head:br,html:wd,li:_d,optgroup:Ad,option:Sd,p:Td,rp:go,rt:go,tbody:Rd,td:yo,tfoot:Cd,th:yo,thead:Id,tr:Nd});function br(t,e,n){const r=De(n,e,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&hi(r.value.charAt(0)))}function wd(t,e,n){const r=De(n,e);return!r||r.type!=="comment"}function kd(t,e,n){const r=De(n,e);return!r||r.type!=="comment"}function Td(t,e,n){const r=De(n,e);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 _d(t,e,n){const r=De(n,e);return!r||r.type==="element"&&r.tagName==="li"}function Ed(t,e,n){const r=De(n,e);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function Md(t,e,n){const r=De(n,e);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function go(t,e,n){const r=De(n,e);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function Ad(t,e,n){const r=De(n,e);return!r||r.type==="element"&&r.tagName==="optgroup"}function Sd(t,e,n){const r=De(n,e);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function Id(t,e,n){const r=De(n,e);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function Rd(t,e,n){const r=De(n,e);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function Cd(t,e,n){return!De(n,e)}function Nd(t,e,n){const r=De(n,e);return!r||r.type==="element"&&r.tagName==="tr"}function yo(t,e,n){const r=De(n,e);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const Ld=Ka({body:Od,colgroup:Fd,head:Dd,html:Pd,tbody:Bd});function Pd(t){const e=De(t,-1);return!e||e.type!=="comment"}function Dd(t){const e=new Set;for(const r of t.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(e.has(r.tagName))return!1;e.add(r.tagName)}const n=t.children[0];return!n||n.type==="element"}function Od(t){const e=De(t,-1,!0);return!e||e.type!=="comment"&&!(e.type==="text"&&hi(e.value.charAt(0)))&&!(e.type==="element"&&(e.tagName==="meta"||e.tagName==="link"||e.tagName==="script"||e.tagName==="style"||e.tagName==="template"))}function Fd(t,e,n){const r=Ga(n,e),i=De(t,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&mi(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="col")}function Bd(t,e,n){const r=Ga(n,e),i=De(t,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&mi(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="tr")}const In={name:[[` +}`;const vn=new ae(0,0,0),di=new ae(0,0,0),Mc=new ae(0,0,0);function io(t,e,n){const r=vn.setFromMatrixPosition(t.matrixWorld);r.project(e);const i=n.width/2,o=n.height/2;return[(Number.isNaN(r.x)?0:r.x)*i+i,-(r.y*o)+o,r.z]}function Ac(t,e){const n=vn.setFromMatrixPosition(t.matrixWorld),r=di.setFromMatrixPosition(e.matrixWorld),i=n.sub(r),o=e.getWorldDirection(Mc);return i.angleTo(o)>Math.PI/2}function Sc(t,e,n,r){const i=vn.setFromMatrixPosition(t.matrixWorld),o=i.clone();o.project(e),n.setFromCamera(new Pe(o.x,o.y),e);const a=n.intersectObjects(r,!0);if(a.length>0){const s=a[0].distance;return i.distanceTo(n.ray.origin)Math.abs(t)<1e-10?0:t;function Na(t,e,n=""){let r="matrix3d(";for(let i=0;i!==16;i++)r+=Br(e[i]*t.elements[i])+(i!==15?",":")");return n+r}const Cc=(t=>e=>Na(e,t))([1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1]),Nc=(t=>(e,n)=>Na(e,t(n),"translate(-50%,-50%)"))(t=>[1/t,1/t,1/t,1,-1/t,-1/t,-1/t,-1,1/t,1/t,1/t,1,1,1,1,1]),Lc=["geometry","material"];new Qo;var zr={exports:{}},Pc=zr.exports,oo;function Dc(){return oo||(oo=1,function(t,e){(function(n,r){t.exports=r()})(Pc,function(){var n=function(){function r(d){return a.appendChild(d.dom),d}function i(d){for(var y=0;yl+1e3&&(c.update(1e3*u/(d-l),100),l=d,u=0,p)){var y=performance.memory;p.update(y.usedJSHeapSize/1048576,y.jsHeapSizeLimit/1048576)}return d},update:function(){s=this.end()},domElement:a,setMode:i}};return n.Panel=function(r,i,o){var a=1/0,s=0,l=Math.round,u=l(window.devicePixelRatio||1),c=80*u,f=48*u,p=3*u,d=2*u,y=3*u,x=15*u,v=74*u,k=30*u,A=document.createElement("canvas");A.width=c,A.height=f,A.style.cssText="width:80px;height:48px";var E=A.getContext("2d");return E.font="bold "+9*u+"px Helvetica,Arial,sans-serif",E.textBaseline="top",E.fillStyle=o,E.fillRect(0,0,c,f),E.fillStyle=i,E.fillText(r,p,d),E.fillRect(y,x,v,k),E.fillStyle=o,E.globalAlpha=.9,E.fillRect(y,x,v,k),{dom:A,update:function(C,P){a=Math.min(a,C),s=Math.max(s,C),E.fillStyle=o,E.globalAlpha=1,E.fillRect(0,0,c,x),E.fillStyle=i,E.fillText(l(C)+" "+r+" ("+l(a)+"-"+l(s)+")",p,d),E.drawImage(A,y+u,x,v-u,k,y,x,v-u,k),E.fillRect(y+v-u,x,u,k),E.fillStyle=o,E.globalAlpha=.9,E.fillRect(y+v-u,x,u,l((1-C/P)*k))}}},n})}(zr)),zr.exports}Dc();const Oc={key:0,args:[0,1,64]},Fc={key:1,args:[.5,1,64]},Bc={key:2},zc=["tone-mapped","map","side","color"];new ze(16777215);const Ut=Fe({__name:"Range",props:{modelValue:null,min:{default:0},max:{default:100},step:{default:1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","mousedown"],setup(t,{emit:e}){const n=t,r=e,i=W(null);function o(y,x,v){return Math.min(Math.max(y,x),v)}function a(y){const x=y.toString();return x.includes("e-")?Number.parseInt(x.split("e-")[1],10):x.includes(".")?x.split(".")[1].length:0}function s(y,x){const v=a(x),k=10**(v+3);return Number.parseFloat((y*k/k).toFixed(v))}const l=je(()=>s(o(n.modelValue,n.min,n.max),n.step)),u=je(()=>{const y=(l.value-n.min)/(n.max-n.min)*100;return{width:`${y}%`,backgroundSize:`${y}% 100%`}});function c(y){if(!i.value)return l.value;const x=i.value.getBoundingClientRect(),k=(y.clientX-x.left)/x.width,A=n.max-n.min,E=n.min+A*k,C=Math.round(E/n.step)*n.step;return Math.min(Math.max(C,n.min),n.max)}function f(y){if(n.disabled)return;const x=c(y);r("update:modelValue",x)}function p(y){if(n.disabled)return;y.preventDefault();const x=c(y);r("update:modelValue",x),window.addEventListener("mousemove",f),window.addEventListener("mouseup",d)}function d(y){window.removeEventListener("mousemove",f),window.removeEventListener("mouseup",d)}return Ot(()=>{window.removeEventListener("mousemove",f),window.removeEventListener("mouseup",d)}),(y,x)=>(Z(),re("span",{ref_key:"sliderRef",ref:i,class:st(["range-slider disabled:pointer-events-none disabled:cursor-default disabled:opacity-50",{disabled:t.disabled}]),bg:"[#e6e1fc] dark:[#676085]","touch-action-none":"",relative:"","inline-block":"","w-full":"","cursor-ew-resize":"","rounded-sm":"",onMousedown:p},[O("span",{style:Lr(u.value),bg:"[#cabeff] dark:[#4e34b9]",relative:"",block:"","rounded-sm":"",h:"[14px]"},null,4),O("span",{role:"slider",class:"slider-thumb",style:Lr({left:`${(l.value-t.min)/(t.max-t.min)*100}%`}),absolute:"","rounded-sm":"",w:"[1px]",h:"[14px]",bg:"neutral-100 dark:neutral-400",top:"50%",transform:"translate-x-[50%] translate-y-[-50%]"},null,4)],34))}});function ao(t,e){if(e===Gs)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),t;if(e===Pr||e===oa){let n=t.getIndex();if(n===null){const a=[],s=t.getAttribute("position");if(s!==void 0){for(let l=0;l=2.0 are supported."));return}const u=new bf(o,{path:n||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});u.fileLoader.setRequestHeader(this.requestHeader);for(let c=0;c=0&&s[f]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+f+'".')}}u.setExtensions(a),u.setPlugins(s),u.parse(r,i)}parseAsync(e,n){const r=this;return new Promise(function(i,o){r.parse(e,n,i,o)})}}function jc(){let t={};return{get:function(e){return t[e]},add:function(e,n){t[e]=n},remove:function(e){delete t[e]},removeAll:function(){t={}}}}const de={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"};class Vc{constructor(e){this.parser=e,this.name=de.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,n=this.parser.json.nodes||[];for(let r=0,i=n.length;r=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return n.loadTextureImage(e,o.source,a)}}class nf{constructor(e){this.parser=e,this.name=de.EXT_TEXTURE_WEBP}loadTexture(e){const n=this.name,r=this.parser,i=r.json,o=i.textures[e];if(!o.extensions||!o.extensions[n])return null;const a=o.extensions[n],s=i.images[a.source];let l=r.textureLoader;if(s.uri){const u=r.options.manager.getHandler(s.uri);u!==null&&(l=u)}return r.loadTextureImage(e,a.source,l)}}class rf{constructor(e){this.parser=e,this.name=de.EXT_TEXTURE_AVIF}loadTexture(e){const n=this.name,r=this.parser,i=r.json,o=i.textures[e];if(!o.extensions||!o.extensions[n])return null;const a=o.extensions[n],s=i.images[a.source];let l=r.textureLoader;if(s.uri){const u=r.options.manager.getHandler(s.uri);u!==null&&(l=u)}return r.loadTextureImage(e,a.source,l)}}class of{constructor(e){this.name=de.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const n=this.parser.json,r=n.bufferViews[e];if(r.extensions&&r.extensions[this.name]){const i=r.extensions[this.name],o=this.parser.getDependency("buffer",i.buffer),a=this.parser.options.meshoptDecoder;if(!a||!a.supported){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return o.then(function(s){const l=i.byteOffset||0,u=i.byteLength||0,c=i.count,f=i.byteStride,p=new Uint8Array(s,l,u);return a.decodeGltfBufferAsync?a.decodeGltfBufferAsync(c,f,p,i.mode,i.filter).then(function(d){return d.buffer}):a.ready.then(function(){const d=new ArrayBuffer(c*f);return a.decodeGltfBuffer(new Uint8Array(d),c,f,p,i.mode,i.filter),d})})}else return null}}class af{constructor(e){this.name=de.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const n=this.parser.json,r=n.nodes[e];if(!r.extensions||!r.extensions[this.name]||r.mesh===void 0)return null;const i=n.meshes[r.mesh];for(const u of i.primitives)if(u.mode!==nt.TRIANGLES&&u.mode!==nt.TRIANGLE_STRIP&&u.mode!==nt.TRIANGLE_FAN&&u.mode!==void 0)return null;const a=r.extensions[this.name].attributes,s=[],l={};for(const u in a)s.push(this.parser.getDependency("accessor",a[u]).then(c=>(l[u]=c,l[u])));return s.length<1?null:(s.push(this.parser.createNodeMesh(e)),Promise.all(s).then(u=>{const c=u.pop(),f=c.isGroup?c.children:[c],p=u[0].count,d=[];for(const y of f){const x=new xt,v=new ae,k=new Fn,A=new ae(1,1,1),E=new Xs(y.geometry,y.material,p);for(let C=0;C0||t.search(/^data\:image\/jpeg/)===0?"image/jpeg":t.search(/\.webp($|\?)/i)>0||t.search(/^data\:image\/webp/)===0?"image/webp":t.search(/\.ktx2($|\?)/i)>0||t.search(/^data\:image\/ktx2/)===0?"image/ktx2":"image/png"}const vf=new xt;class bf{constructor(e={},n={}){this.json=e,this.extensions={},this.plugins={},this.options=n,this.cache=new jc,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 r=!1,i=-1,o=!1,a=-1;if(typeof navigator<"u"){const s=navigator.userAgent;r=/^((?!chrome|android).)*safari/i.test(s)===!0;const l=s.match(/Version\/(\d+)/);i=r&&l?parseInt(l[1],10):-1,o=s.indexOf("Firefox")>-1,a=o?s.match(/Firefox\/([0-9]+)\./)[1]:-1}typeof createImageBitmap>"u"||r&&i<17||o&&a<98?this.textureLoader=new Qs(this.options.manager):this.textureLoader=new Js(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new aa(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,n){const r=this,i=this.json,o=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(a){return a._markDefs&&a._markDefs()}),Promise.all(this._invokeAll(function(a){return a.beforeRoot&&a.beforeRoot()})).then(function(){return Promise.all([r.getDependencies("scene"),r.getDependencies("animation"),r.getDependencies("camera")])}).then(function(a){const s={scene:a[0][i.scene||0],scenes:a[0],animations:a[1],cameras:a[2],asset:i.asset,parser:r,userData:{}};return Rt(o,s,i),gt(s,i),Promise.all(r._invokeAll(function(l){return l.afterRoot&&l.afterRoot(s)})).then(function(){for(const l of s.scenes)l.updateMatrixWorld();e(s)})}).catch(n)}_markDefs(){const e=this.json.nodes||[],n=this.json.skins||[],r=this.json.meshes||[];for(let i=0,o=n.length;i{const l=this.associations.get(a);l!=null&&this.associations.set(s,l);for(const[u,c]of a.children.entries())o(c,s.children[u])};return o(r,i),i.name+="_instance_"+e.uses[n]++,i}_invokeOne(e){const n=Object.values(this.plugins);n.push(this);for(let r=0;r=2&&v.setY(g,h[I*l+1]),l>=3&&v.setZ(g,h[I*l+2]),l>=4&&v.setW(g,h[I*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}v.normalized=y}return v})}loadTexture(e){const n=this.json,r=this.options,o=n.textures[e].source,a=n.images[o];let s=this.textureLoader;if(a.uri){const l=r.manager.getHandler(a.uri);l!==null&&(s=l)}return this.loadTextureImage(e,o,s)}loadTextureImage(e,n,r){const i=this,o=this.json,a=o.textures[e],s=o.images[n],l=(s.uri||s.bufferView)+":"+a.sampler;if(this.textureCache[l])return this.textureCache[l];const u=this.loadImageSource(n,r).then(function(c){c.flipY=!1,c.name=a.name||s.name||"",c.name===""&&typeof s.uri=="string"&&s.uri.startsWith("data:image/")===!1&&(c.name=s.uri);const p=(o.samplers||{})[a.sampler]||{};return c.magFilter=lo[p.magFilter]||zn,c.minFilter=lo[p.minFilter]||ii,c.wrapS=uo[p.wrapS]||Un,c.wrapT=uo[p.wrapT]||Un,c.generateMipmaps=!c.isCompressedTexture&&c.minFilter!==Lt&&c.minFilter!==zn,i.associations.set(c,{textures:e}),c}).catch(function(){return null});return this.textureCache[l]=u,u}loadImageSource(e,n){const r=this,i=this.json,o=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(f=>f.clone());const a=i.images[e],s=self.URL||self.webkitURL;let l=a.uri||"",u=!1;if(a.bufferView!==void 0)l=r.getDependency("bufferView",a.bufferView).then(function(f){u=!0;const p=new Blob([f],{type:a.mimeType});return l=s.createObjectURL(p),l});else if(a.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const c=Promise.resolve(l).then(function(f){return new Promise(function(p,d){let y=p;n.isImageBitmapLoader===!0&&(y=function(x){const v=new Bn(x);v.needsUpdate=!0,p(v)}),n.load(cn.resolveURL(f,o.path),y,void 0,d)})}).then(function(f){return u===!0&&s.revokeObjectURL(l),gt(f,a),f.userData.mimeType=a.mimeType||xf(a.uri),f}).catch(function(f){throw console.error("THREE.GLTFLoader: Couldn't load texture",l),f});return this.sourceCache[e]=c,c}assignTexture(e,n,r,i){const o=this;return this.getDependency("texture",r.index).then(function(a){if(!a)return null;if(r.texCoord!==void 0&&r.texCoord>0&&(a=a.clone(),a.channel=r.texCoord),o.extensions[de.KHR_TEXTURE_TRANSFORM]){const s=r.extensions!==void 0?r.extensions[de.KHR_TEXTURE_TRANSFORM]:void 0;if(s){const l=o.associations.get(a);a=o.extensions[de.KHR_TEXTURE_TRANSFORM].extendTexture(a,s),o.associations.set(a,l)}}return i!==void 0&&(a.colorSpace=i),e[n]=a,a})}assignFinalMaterial(e){const n=e.geometry;let r=e.material;const i=n.attributes.tangent===void 0,o=n.attributes.color!==void 0,a=n.attributes.normal===void 0;if(e.isPoints){const s="PointsMaterial:"+r.uuid;let l=this.cache.get(s);l||(l=new el,nr.prototype.copy.call(l,r),l.color.copy(r.color),l.map=r.map,l.sizeAttenuation=!1,this.cache.add(s,l)),r=l}else if(e.isLine){const s="LineBasicMaterial:"+r.uuid;let l=this.cache.get(s);l||(l=new tl,nr.prototype.copy.call(l,r),l.color.copy(r.color),l.map=r.map,this.cache.add(s,l)),r=l}if(i||o||a){let s="ClonedMaterial:"+r.uuid+":";i&&(s+="derivative-tangents:"),o&&(s+="vertex-colors:"),a&&(s+="flat-shading:");let l=this.cache.get(s);l||(l=r.clone(),o&&(l.vertexColors=!0),a&&(l.flatShading=!0),i&&(l.normalScale&&(l.normalScale.y*=-1),l.clearcoatNormalScale&&(l.clearcoatNormalScale.y*=-1)),this.cache.add(s,l),this.associations.set(l,this.associations.get(r))),r=l}e.material=r}getMaterialType(){return sa}loadMaterial(e){const n=this,r=this.json,i=this.extensions,o=r.materials[e];let a;const s={},l=o.extensions||{},u=[];if(l[de.KHR_MATERIALS_UNLIT]){const f=i[de.KHR_MATERIALS_UNLIT];a=f.getMaterialType(),u.push(f.extendParams(s,o,n))}else{const f=o.pbrMetallicRoughness||{};if(s.color=new ze(1,1,1),s.opacity=1,Array.isArray(f.baseColorFactor)){const p=f.baseColorFactor;s.color.setRGB(p[0],p[1],p[2],vt),s.opacity=p[3]}f.baseColorTexture!==void 0&&u.push(n.assignTexture(s,"map",f.baseColorTexture,mn)),s.metalness=f.metallicFactor!==void 0?f.metallicFactor:1,s.roughness=f.roughnessFactor!==void 0?f.roughnessFactor:1,f.metallicRoughnessTexture!==void 0&&(u.push(n.assignTexture(s,"metalnessMap",f.metallicRoughnessTexture)),u.push(n.assignTexture(s,"roughnessMap",f.metallicRoughnessTexture))),a=this._invokeOne(function(p){return p.getMaterialType&&p.getMaterialType(e)}),u.push(Promise.all(this._invokeAll(function(p){return p.extendMaterialParams&&p.extendMaterialParams(e,s)})))}o.doubleSided===!0&&(s.side=Kn);const c=o.alphaMode||yr.OPAQUE;if(c===yr.BLEND?(s.transparent=!0,s.depthWrite=!1):(s.transparent=!1,c===yr.MASK&&(s.alphaTest=o.alphaCutoff!==void 0?o.alphaCutoff:.5)),o.normalTexture!==void 0&&a!==Vt&&(u.push(n.assignTexture(s,"normalMap",o.normalTexture)),s.normalScale=new Pe(1,1),o.normalTexture.scale!==void 0)){const f=o.normalTexture.scale;s.normalScale.set(f,f)}if(o.occlusionTexture!==void 0&&a!==Vt&&(u.push(n.assignTexture(s,"aoMap",o.occlusionTexture)),o.occlusionTexture.strength!==void 0&&(s.aoMapIntensity=o.occlusionTexture.strength)),o.emissiveFactor!==void 0&&a!==Vt){const f=o.emissiveFactor;s.emissive=new ze().setRGB(f[0],f[1],f[2],vt)}return o.emissiveTexture!==void 0&&a!==Vt&&u.push(n.assignTexture(s,"emissiveMap",o.emissiveTexture,mn)),Promise.all(u).then(function(){const f=new a(s);return o.name&&(f.name=o.name),gt(f,o),n.associations.set(f,{materials:e}),o.extensions&&Rt(i,f,o),f})}createUniqueName(e){const n=hn.sanitizeNodeName(e||"");return n in this.nodeNamesUsed?n+"_"+ ++this.nodeNamesUsed[n]:(this.nodeNamesUsed[n]=0,n)}loadGeometries(e){const n=this,r=this.extensions,i=this.primitiveCache;function o(s){return r[de.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(s,n).then(function(l){return co(l,s,n)})}const a=[];for(let s=0,l=e.length;s0&&gf(k,o),k.name=n.createUniqueName(o.name||"mesh_"+e),gt(k,o),v.extensions&&Rt(i,k,v),n.assignFinalMaterial(k),f.push(k)}for(let d=0,y=f.length;d1?c=new rr:u.length===1?c=u[0]:c=new oi,c!==u[0])for(let f=0,p=u.length;f{const f=new Map;for(const[p,d]of i.associations)(p instanceof nr||p instanceof Bn)&&f.set(p,d);return c.traverse(p=>{const d=i.associations.get(p);d!=null&&f.set(p,d)}),f};return i.associations=u(o),o})}_createAnimationTracks(e,n,r,i,o){const a=[],s=e.name?e.name:e.uuid,l=[];kt[o.path]===kt.weights?e.traverse(function(p){p.morphTargetInfluences&&l.push(p.name?p.name:p.uuid)}):l.push(s);let u;switch(kt[o.path]){case kt.weights:u=Ii;break;case kt.rotation:u=Ri;break;case kt.translation:case kt.scale:u=Si;break;default:switch(r.itemSize){case 1:u=Ii;break;case 2:case 3:default:u=Si;break}break}const c=i.interpolation!==void 0?pf[i.interpolation]:ei,f=this._getArrayFromAccessor(r);for(let p=0,d=l.length;pnew Tl(t)),Ct.register(t=>new _l(t)),Ct)}async function kf(t){const r=(await Da().loadAsync(t)).userData;if(!r.vrmAnimations){console.warn("No VRM animations found in the .vrma file");return}if(r.vrmAnimations.length===0){console.warn("No VRM animations found in the .vrma file");return}return r.vrmAnimations[0]}async function Tf(t,e){if(!t){console.warn("No VRM found");return}if(e)return El(e,t)}function _f(){const t=W(!1),e=W(0),n=W(0),r=.2,i=1,o=6,a=W(Math.random()*(o-i)+i);function s(l,u){if(l!=null&&l.expressionManager&&(n.value+=u,!t.value&&n.value>=a.value&&(t.value=!0,e.value=0),t.value)){e.value+=u/r;const c=Math.sin(Math.PI*e.value);l.expressionManager.setValue("blink",c),e.value>=1&&(t.value=!1,n.value=0,l.expressionManager.setValue("blink",0),a.value=Math.random()*(o-i)+i)}}return{update:s}}function Ef(){let t=-1,e,n=0;function r(){e?e.set(on(-.25,.25),on(-.2,.15),-.65):e=new ae(on(-.25,.25),on(-.2,.15),-.65)}function i(o,a){var s;!(o!=null&&o.expressionManager)||!o.lookAt||(n>=t?(r(),n=0,t=Ml()/1e3):e||r(),o.lookAt.target||(o.lookAt.target=new oi),o.lookAt.target.position.lerp(e,on(.2,.5)),(s=o.lookAt)==null||s.update(a),n+=a)}return{update:i}}async function Mf(t,e){const i=(await Da().loadAsync(t,a=>{var s;return(s=e==null?void 0:e.onProgress)==null?void 0:s.call(e,a)})).userData;if(!i.vrm)return;const o=i.vrm;if(Dr.removeUnnecessaryVertices(o.scene),Dr.combineSkeletons(o.scene),o.scene.traverse(a=>{a.frustumCulled=!1}),o.lookAt){const a=new Al(o.lookAt);a.name="lookAtQuaternionProxy",o.scene.add(a)}return e!=null&&e.scene&&e.scene.add(o.scene),e!=null&&e.position&&o.scene.position.set(...e.position),o}function Af(t){const e=W(null),n=W(!1),r=W(0),i=W(new Map),o=W(new Map),a=W(),s=(k,A,E)=>k+(A-k)*E,l=k=>k<.5?4*k*k*k:1-(-2*k+2)**3/2,u=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}]]),c=()=>{a.value&&(clearTimeout(a.value),a.value=void 0)},f=k=>{var E;if(c(),!u.has(k)){console.warn(`Emotion ${k} not found`);return}const A=u.get(k);if(e.value=k,n.value=!0,r.value=0,t.expressionManager){const C=Object.keys(t.expressionManager.expressionMap);for(const P of C)t.expressionManager.setValue(P,0)}i.value.clear(),o.value.clear();for(const C of A.expression||[]){const P=((E=t.expressionManager)==null?void 0:E.getValue(C.name))||0;i.value.set(C.name,P),o.value.set(C.name,C.value)}};return{currentEmotion:e,isTransitioning:n,setEmotion:f,setEmotionWithResetAfter:(k,A)=>{c(),f(k),a.value=setTimeout(()=>{f("neutral"),a.value=void 0},A)},update:k=>{var C;if(!n.value||!e.value)return;const E=u.get(e.value).blendDuration||.3;r.value+=k/E,r.value>=1&&(r.value=1,n.value=!1);for(const[P,h]of o.value){const I=i.value.get(P)||0,b=s(I,h,l(r.value));(C=t.expressionManager)==null||C.setValue(P,b)}},addEmotionState:(k,A)=>{u.set(k,A)},removeEmotionState:k=>{u.delete(k)},dispose:()=>{c()}}}const Sf=Fe({__name:"Model",props:{model:null,idleAnimation:null,loadAnimations:null,position:null,paused:{type:Boolean}},emits:["loadModelProgress","error"],setup(t,{expose:e,emit:n}){const r=t,i=n;let o;const a=W(),s=W(),{scene:l}=Yn(),{onBeforeRender:u}=On(),c=_f(),f=Ef(),p=W();Be(()=>r.position,([x,v,k])=>{a.value&&a.value.scene.position.set(x,v,k)}),pn(async()=>{if(l.value)try{const x=await Mf(r.model,{scene:l.value,lookAt:!0,position:r.position,onProgress:A=>i("loadModelProgress",Number.parseFloat((100*(A.loaded/A.total)).toFixed(2)))});if(!x){console.warn("No VRM model loaded");return}const v=await kf(r.idleAnimation),k=await Tf(x,v);if(!k){console.warn("No VRM animation loaded");return}s.value=new dl(x.scene),s.value.clipAction(k).play(),p.value=Af(x),a.value=x,o=u(({delta:A})=>{var E,C,P;(E=s.value)==null||E.update(A),(C=a.value)==null||C.update(A),c.update(a.value,A),f.update(a.value,A),(P=p.value)==null||P.update(A)}).off}catch(x){i("error",x)}}),Ot(()=>{o==null||o(),a.value&&(a.value.scene.removeFromParent(),Dr.deepDispose(a.value.scene))}),e({setExpression(x){var v;(v=p.value)==null||v.setEmotionWithResetAfter(x,1e3)}});const{pause:d,resume:y}=On();return Be(()=>r.paused,x=>{x?d():y()}),(x,v)=>gn(x.$slots,"default")}}),If=["position"],Rf={absolute:"",bottom:"3",right:"3"},Cf={flex:"~ row","cursor-pointer":""},Nf=["checked","aria-checked"],Lf={key:0,"min-w":"50vw",z:"{var x;(x=p.value)==null||x.setExpression(y)}}),(y,x)=>(Z(),Xt(ha,{relative:""},{default:Ue(({height:v,width:k})=>[ke(V(pl),{alpha:!0,antialias:!0,width:k,height:v},{default:Ue(()=>[ke(V(mc)),O("TresPerspectiveCamera",{position:[a.value,s.value,l.value]},null,8,If),x[14]||(x[14]=O("TresDirectionalLight",{color:16777215,intensity:1.2,position:[1,1,1]},null,-1)),x[15]||(x[15]=O("TresAmbientLight",{color:16777215,intensity:1.5},null,-1)),ke(Sf,{ref_key:"modelRef",ref:p,model:r.model,"idle-animation":r.idleAnimation,position:[u.value,c.value,f.value],paused:r.paused,onLoadModelProgress:x[0]||(x[0]=A=>i("loadModelProgress",A)),onError:x[1]||(x[1]=A=>i("error",A))},null,8,["model","idle-animation","position","paused"])]),_:2},1032,["width","height"]),O("div",Rf,[O("div",Cf,[O("label",{class:st([o.value?"bg-neutral-300 dark:bg-neutral-200":"bg-neutral-100 dark:bg-neutral-700"]),transition:"all ease-in-out duration-500",text:"lg neutral-500 dark:neutral-400","m-1":"","h-fit":"","w-fit":"","cursor-pointer":"","appearance-none":"","gap-1":"","rounded-lg":"","rounded-md":"","border-none":"","p-2":"","outline-none":""},[Et(O("input",{"onUpdate:modelValue":x[2]||(x[2]=A=>o.value=A),checked:o.value,"aria-checked":o.value,name:"showLive2DViewerInspector",type:"checkbox",hidden:"","appearance-none":"","outline-none":""},null,8,Nf),[[Qr,o.value]]),x[16]||(x[16]=O("div",{"select-none":""},[O("div",{"i-solar:bug-bold-duotone":""})],-1))],2)]),ke(V(ui),null,{default:Ue(()=>[o.value?(Z(),re("div",Lf,[O("div",Pf,[O("div",Df,[O("span",null,he(V(d)("stage.viewers.debug-menu.vrm.model.title")),1)]),ke(Pi,{"h-fit":"","w-full":"",flex:"~ col",border:"~ gray/25 rounded-lg",divide:"y dashed gray/25","of-clip":"","shadow-sm":""},{label:Ue(()=>[O("span",Of,he(V(d)("stage.viewers.debug-menu.vrm.camera")),1)]),default:Ue(()=>[O("div",Ff,[x[17]||(x[17]=O("div",{text:"neutral-400 dark:neutral-500"},[O("span",null,"X")],-1)),O("label",Bf,[ke(Ut,{modelValue:a.value,"onUpdate:modelValue":x[3]||(x[3]=A=>a.value=A),min:-10,max:10,step:.01},null,8,["modelValue"])]),O("div",zf,[O("span",null,he(a.value),1)]),x[18]||(x[18]=O("div",{text:"neutral-400 dark:neutral-500"},[O("span",null,"Y")],-1)),O("label",Uf,[ke(Ut,{modelValue:s.value,"onUpdate:modelValue":x[4]||(x[4]=A=>s.value=A),min:-10,max:10,step:.01},null,8,["modelValue"])]),O("div",jf,[O("span",null,he(s.value),1)]),x[19]||(x[19]=O("div",{text:"neutral-400 dark:neutral-500"},[O("span",null,"Z")],-1)),O("label",Vf,[ke(Ut,{modelValue:l.value,"onUpdate:modelValue":x[5]||(x[5]=A=>l.value=A),min:-10,max:10,step:.01},null,8,["modelValue"])]),O("div",Hf,[O("span",null,he(l.value),1)])])]),_:1}),ke(Pi,{"h-fit":"","w-full":"",flex:"~ col",border:"~ gray/25 rounded-lg",divide:"y dashed gray/25","of-clip":"","shadow-sm":""},{label:Ue(()=>[O("span",$f,he(V(d)("stage.viewers.debug-menu.vrm.model.title")),1)]),default:Ue(()=>[O("div",Gf,[x[20]||(x[20]=O("div",{text:"neutral-400 dark:neutral-500"},[O("span",null,"X")],-1)),O("label",Yf,[ke(Ut,{modelValue:u.value,"onUpdate:modelValue":x[6]||(x[6]=A=>u.value=A),min:-10,max:10,step:.01},null,8,["modelValue"])]),O("div",Kf,[O("span",null,he(u.value),1)]),x[21]||(x[21]=O("div",{text:"neutral-400 dark:neutral-500"},[O("span",null,"Y")],-1)),O("label",qf,[ke(Ut,{modelValue:c.value,"onUpdate:modelValue":x[7]||(x[7]=A=>c.value=A),min:-10,max:10,step:.01},null,8,["modelValue"])]),O("div",Wf,[O("span",null,he(c.value),1)]),x[22]||(x[22]=O("div",{text:"neutral-400 dark:neutral-500"},[O("span",null,"Z")],-1)),O("label",Xf,[ke(Ut,{modelValue:f.value,"onUpdate:modelValue":x[8]||(x[8]=A=>f.value=A),min:-10,max:10,step:.01},null,8,["modelValue"])]),O("div",Zf,[O("span",null,he(f.value),1)])])]),_:1}),O("div",Qf,[O("span",null,he(V(d)("stage.viewers.debug-menu.emotions")),1)]),O("div",Jf,[O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:x[9]||(x[9]=A=>{var E;return(E=p.value)==null?void 0:E.setExpression("neutral")})},he(V(d)("stage.viewers.debug-menu.emotions-btn.neutral")),1),O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:x[10]||(x[10]=A=>{var E;return(E=p.value)==null?void 0:E.setExpression("surprised")})},he(V(d)("stage.viewers.debug-menu.emotions-btn.surprised")),1),O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:x[11]||(x[11]=A=>{var E;return(E=p.value)==null?void 0:E.setExpression("sad")})},he(V(d)("stage.viewers.debug-menu.emotions-btn.sad")),1),O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:x[12]||(x[12]=A=>{var E;return(E=p.value)==null?void 0:E.setExpression("angry")})},he(V(d)("stage.viewers.debug-menu.emotions-btn.angry")),1),O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:x[13]||(x[13]=A=>{var E;return(E=p.value)==null?void 0:E.setExpression("happy")})},he(V(d)("stage.viewers.debug-menu.emotions-btn.happy")),1)])])])):it("",!0)]),_:1})])]),_:1}))}}),td=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class bn{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}}bn.prototype.normal={};bn.prototype.property={};bn.prototype.space=void 0;function Oa(t,e){const n={},r={};for(const i of t)Object.assign(n,i.property),Object.assign(r,i.normal);return new bn(n,r,e)}function Vr(t){return t.toLowerCase()}class We{constructor(e,n){this.attribute=n,this.property=e}}We.prototype.attribute="";We.prototype.booleanish=!1;We.prototype.boolean=!1;We.prototype.commaOrSpaceSeparated=!1;We.prototype.commaSeparated=!1;We.prototype.defined=!1;We.prototype.mustUseProperty=!1;We.prototype.number=!1;We.prototype.overloadedBoolean=!1;We.prototype.property="";We.prototype.spaceSeparated=!1;We.prototype.space=void 0;let nd=0;const ce=Ft(),Le=Ft(),Fa=Ft(),G=Ft(),Re=Ft(),Kt=Ft(),Qe=Ft();function Ft(){return 2**++nd}const Hr=Object.freeze(Object.defineProperty({__proto__:null,boolean:ce,booleanish:Le,commaOrSpaceSeparated:Qe,commaSeparated:Kt,number:G,overloadedBoolean:Fa,spaceSeparated:Re},Symbol.toStringTag,{value:"Module"})),vr=Object.keys(Hr);class pi extends We{constructor(e,n,r,i){let o=-1;if(super(e,n),fo(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&ad.test(e)){if(e.charAt(4)==="-"){const o=e.slice(5).replace(po,ud);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=e.slice(4);if(!po.test(o)){let a=o.replace(od,ld);a.charAt(0)!=="-"&&(a="-"+a),e="data"+a}}i=pi}return new i(r,e)}function ld(t){return"-"+t.toLowerCase()}function ud(t){return t.charAt(1).toUpperCase()}const cd=Oa([Ba,rd,ja,Va,Ha],"html"),$a=Oa([Ba,id,ja,Va,Ha],"svg"),ho={}.hasOwnProperty;function fd(t,e){const n=e||{};function r(i,...o){let a=r.invalid;const s=r.handlers;if(i&&ho.call(i,t)){const l=String(i[t]);a=ho.call(s,l)?s[l]:r.unknown}if(a)return a.call(this,i,...o)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const dd=/^>|^->||--!>|"],hd=["<",">"];function md(t,e,n,r){return r.settings.bogusComments?"":"";function i(o){return Gt(o,Object.assign({},r.settings.characterReferences,{subset:hd}))}}function gd(t,e,n,r){return""}function yd(t,e){const n=e||{};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function xd(t){return t.join(" ").trim()}const vd=/[ \t\n\f\r]/g;function hi(t){return typeof t=="object"?t.type==="text"?mo(t.value):!1:mo(t)}function mo(t){return t.replace(vd,"")===""}const De=Ya(1),Ga=Ya(-1),bd=[];function Ya(t){return e;function e(n,r,i){const o=n?n.children:bd;let a=(r||0)+t,s=o[a];if(!i)for(;s&&hi(s);)a+=t,s=o[a];return s}}const wd={}.hasOwnProperty;function Ka(t){return e;function e(n,r,i){return wd.call(t,n.tagName)&&t[n.tagName](n,r,i)}}const mi=Ka({body:Td,caption:br,colgroup:br,dd:Ad,dt:Md,head:br,html:kd,li:Ed,optgroup:Sd,option:Id,p:_d,rp:go,rt:go,tbody:Cd,td:yo,tfoot:Nd,th:yo,thead:Rd,tr:Ld});function br(t,e,n){const r=De(n,e,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&hi(r.value.charAt(0)))}function kd(t,e,n){const r=De(n,e);return!r||r.type!=="comment"}function Td(t,e,n){const r=De(n,e);return!r||r.type!=="comment"}function _d(t,e,n){const r=De(n,e);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 Ed(t,e,n){const r=De(n,e);return!r||r.type==="element"&&r.tagName==="li"}function Md(t,e,n){const r=De(n,e);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function Ad(t,e,n){const r=De(n,e);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function go(t,e,n){const r=De(n,e);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function Sd(t,e,n){const r=De(n,e);return!r||r.type==="element"&&r.tagName==="optgroup"}function Id(t,e,n){const r=De(n,e);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function Rd(t,e,n){const r=De(n,e);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function Cd(t,e,n){const r=De(n,e);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function Nd(t,e,n){return!De(n,e)}function Ld(t,e,n){const r=De(n,e);return!r||r.type==="element"&&r.tagName==="tr"}function yo(t,e,n){const r=De(n,e);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const Pd=Ka({body:Fd,colgroup:Bd,head:Od,html:Dd,tbody:zd});function Dd(t){const e=De(t,-1);return!e||e.type!=="comment"}function Od(t){const e=new Set;for(const r of t.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(e.has(r.tagName))return!1;e.add(r.tagName)}const n=t.children[0];return!n||n.type==="element"}function Fd(t){const e=De(t,-1,!0);return!e||e.type!=="comment"&&!(e.type==="text"&&hi(e.value.charAt(0)))&&!(e.type==="element"&&(e.tagName==="meta"||e.tagName==="link"||e.tagName==="script"||e.tagName==="style"||e.tagName==="template"))}function Bd(t,e,n){const r=Ga(n,e),i=De(t,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&mi(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="col")}function zd(t,e,n){const r=Ga(n,e),i=De(t,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&mi(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="tr")}const In={name:[[` \f\r &/=>`.split(""),` \f\r "&'/=>\``.split("")],[`\0 \f\r "&'/<=>`.split(""),`\0 @@ -515,18 +515,18 @@ void main() { \f\r &>`.split(""),`\0 \f\r "&'<=>\``.split("")],[`\0 \f\r "&'<=>\``.split(""),`\0 -\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function zd(t,e,n,r){const i=r.schema,o=i.space==="svg"?!1:r.settings.omitOptionalTags;let a=i.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(t.tagName.toLowerCase());const s=[];let l;i.space==="html"&&t.tagName==="svg"&&(r.schema=$a);const u=Ud(r,t.properties),c=r.all(i.space==="html"&&t.tagName==="template"?t.content:t);return r.schema=i,c&&(a=!1),(u||!o||!Ld(t,e,n))&&(s.push("<",t.tagName,u?" "+u:""),a&&(i.space==="svg"||r.settings.closeSelfClosing)&&(l=u.charAt(u.length-1),(!r.settings.tightSelfClosing||l==="/"||l&&l!=='"'&&l!=="'")&&s.push(" "),s.push("/")),s.push(">")),s.push(c),!a&&(!o||!mi(t,e,n))&&s.push(""),s.join("")}function Ud(t,e){const n=[];let r=-1,i;if(e){for(i in e)if(e[i]!==null&&e[i]!==void 0){const o=jd(t,i,e[i]);o&&n.push(o)}}for(;++rLi(n,t.alternative)&&(a=t.alternative),s=a+Gt(n,Object.assign({},t.settings.characterReferences,{subset:(a==="'"?In.single:In.double)[i][o],attribute:!0}))+a),l+(s&&"="+s))}const Vd=["<","&"];function qa(t,e,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?t.value:Gt(t.value,Object.assign({},r.settings.characterReferences,{subset:Vd}))}function Hd(t,e,n,r){return r.settings.allowDangerousHtml?t.value:qa(t,e,n,r)}function $d(t,e,n,r){return r.all(t)}const Gd=cd("type",{invalid:Yd,unknown:Kd,handlers:{comment:hd,doctype:md,element:zd,raw:Hd,root:$d,text:qa}});function Yd(t){throw new Error("Expected node, not `"+t+"`")}function Kd(t){const e=t;throw new Error("Cannot compile unknown node `"+e.type+"`")}const qd={},Wd={},Xd=[];function Zd(t,e){const n=e||qd,r=n.quote||'"',i=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:Qd,all:Jd,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||ed,characterReferences:n.characterReferences||Wd,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?$a:ud,quote:r,alternative:i}.one(Array.isArray(t)?{type:"root",children:t}:t,void 0,void 0)}function Qd(t,e,n){return Gd(t,e,n,this)}function Jd(t){const e=[],n=t&&t.children||Xd;let r=-1;for(;++ri?0:i+e:e=e>i?i:e,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(e,n),t.splice(...a);else for(n&&t.splice(e,n);o0?(ct(t,t.length,0,e),t):e}const bo={}.hasOwnProperty;function ip(t){const e={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function qt(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ut=It(/[A-Za-z]/),et=It(/[\dA-Za-z]/),sp=It(/[#-'*+\--9=?A-Z^-~]/);function $r(t){return t!==null&&(t<32||t===127)}const Gr=It(/\d/),lp=It(/[\dA-Fa-f]/),up=It(/[!-/:-@[-`{-~]/);function se(t){return t!==null&&t<-2}function qe(t){return t!==null&&(t<0||t===32)}function Ee(t){return t===-2||t===-1||t===32}const cp=It(new RegExp("\\p{P}|\\p{S}","u")),fp=It(/\s/);function It(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function Jt(t){const e=[];let n=-1,r=0,i=0;for(;++n55295&&o<57344){const s=t.charCodeAt(n+1);o<56320&&s>56319&&s<57344?(a=String.fromCharCode(o,s),i=1):a="�"}else a=String.fromCharCode(o);a&&(e.push(t.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return e.join("")+t.slice(r)}function Ce(t,e,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return a;function a(l){return Ee(l)?(t.enter(n),s(l)):e(l)}function s(l){return Ee(l)&&o++a))return;const I=e.events.length;let b=I,g,m;for(;b--;)if(e.events[b][0]==="exit"&&e.events[b][1].type==="chunkFlow"){if(g){m=e.events[b][1].end;break}g=!0}for(k(r),h=I;hE;){const P=n[C];e.containerState=P[1],P[0].exit.call(e,t)}n.length=E}function A(){i.write([null]),o=void 0,i=void 0,e.containerState._closeFlow=void 0}}function gp(t,e,n){return Ce(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ko(t){if(t===null||qe(t)||fp(t))return 1;if(cp(t))return 2}function yi(t,e,n){const r=[];let i=-1;for(;++i1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const f={...t[r][1].end},p={...t[n][1].start};To(f,-l),To(p,l),a={type:l>1?"strongSequence":"emphasisSequence",start:f,end:{...t[r][1].end}},s={type:l>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:p},o={type:l>1?"strongText":"emphasisText",start:{...t[r][1].end},end:{...t[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...a.start},end:{...s.end}},t[r][1].end={...a.start},t[n][1].start={...s.end},u=[],t[r][1].end.offset-t[r][1].start.offset&&(u=rt(u,[["enter",t[r][1],e],["exit",t[r][1],e]])),u=rt(u,[["enter",i,e],["enter",a,e],["exit",a,e],["enter",o,e]]),u=rt(u,yi(e.parser.constructs.insideSpan.null,t.slice(r+1,n),e)),u=rt(u,[["exit",o,e],["enter",s,e],["exit",s,e],["exit",i,e]]),t[n][1].end.offset-t[n][1].start.offset?(c=2,u=rt(u,[["enter",t[n][1],e],["exit",t[n][1],e]])):c=0,ct(t,r-1,n-r+3,u),n=r+u.length-c-2;break}}for(n=-1;++n0&&Ee(h)?Ce(t,A,"linePrefix",o+1)(h):A(h)}function A(h){return h===null||se(h)?t.check(_o,x,C)(h):(t.enter("codeFlowValue"),E(h))}function E(h){return h===null||se(h)?(t.exit("codeFlowValue"),A(h)):(t.consume(h),E)}function C(h){return t.exit("codeFenced"),e(h)}function P(h,I,b){let g=0;return m;function m(F){return h.enter("lineEnding"),h.consume(F),h.exit("lineEnding"),T}function T(F){return h.enter("codeFencedFence"),Ee(F)?Ce(h,S,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):S(F)}function S(F){return F===s?(h.enter("codeFencedFenceSequence"),B(F)):b(F)}function B(F){return F===s?(g++,h.consume(F),B):g>=a?(h.exit("codeFencedFenceSequence"),Ee(F)?Ce(h,D,"whitespace")(F):D(F)):b(F)}function D(F){return F===null||se(F)?(h.exit("codeFencedFence"),I(F)):b(F)}}}function Sp(t,e,n){const r=this;return i;function i(a){return a===null?n(a):(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),o)}function o(a){return r.parser.lazy[r.now().line]?n(a):e(a)}}const wr={name:"codeIndented",tokenize:Rp},Ip={partial:!0,tokenize:Cp};function Rp(t,e,n){const r=this;return i;function i(u){return t.enter("codeIndented"),Ce(t,o,"linePrefix",5)(u)}function o(u){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?a(u):n(u)}function a(u){return u===null?l(u):se(u)?t.attempt(Ip,a,l)(u):(t.enter("codeFlowValue"),s(u))}function s(u){return u===null||se(u)?(t.exit("codeFlowValue"),a(u)):(t.consume(u),s)}function l(u){return t.exit("codeIndented"),e(u)}}function Cp(t,e,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):se(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),i):Ce(t,o,"linePrefix",5)(a)}function o(a){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?e(a):se(a)?i(a):n(a)}}const Np={name:"codeText",previous:Pp,resolve:Lp,tokenize:Dp};function Lp(t){let e=t.length-4,n=3,r,i;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return ethis.left.length)return this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse();const i=this.left.slice(e);return i.push(...this.right.slice(this.right.length-r+this.left.length).reverse()),i}splice(e,n,r){const i=n||0;this.setCursor(Math.trunc(e));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&sn(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),sn(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),sn(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e=4?e(a):t.interrupt(r.parser.constructs.flow,n,e)(a)}}function ts(t,e,n,r,i,o,a,s,l){const u=l||Number.POSITIVE_INFINITY;let c=0;return f;function f(k){return k===60?(t.enter(r),t.enter(i),t.enter(o),t.consume(k),t.exit(o),p):k===null||k===32||k===41||$r(k)?n(k):(t.enter(r),t.enter(a),t.enter(s),t.enter("chunkString",{contentType:"string"}),x(k))}function p(k){return k===62?(t.enter(o),t.consume(k),t.exit(o),t.exit(i),t.exit(r),e):(t.enter(s),t.enter("chunkString",{contentType:"string"}),d(k))}function d(k){return k===62?(t.exit("chunkString"),t.exit(s),p(k)):k===null||k===60||se(k)?n(k):(t.consume(k),k===92?y:d)}function y(k){return k===60||k===62||k===92?(t.consume(k),d):d(k)}function x(k){return!c&&(k===null||k===41||qe(k))?(t.exit("chunkString"),t.exit(s),t.exit(a),t.exit(r),e(k)):c999||d===null||d===91||d===93&&!l||d===94&&!s&&"_hiddenFootnoteSupport"in a.parser.constructs?n(d):d===93?(t.exit(o),t.enter(i),t.consume(d),t.exit(i),t.exit(r),e):se(d)?(t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),c):(t.enter("chunkString",{contentType:"string"}),f(d))}function f(d){return d===null||d===91||d===93||se(d)||s++>999?(t.exit("chunkString"),c(d)):(t.consume(d),l||(l=!Ee(d)),d===92?p:f)}function p(d){return d===91||d===92||d===93?(t.consume(d),s++,f):f(d)}}function rs(t,e,n,r,i,o){let a;return s;function s(p){return p===34||p===39||p===40?(t.enter(r),t.enter(i),t.consume(p),t.exit(i),a=p===40?41:p,l):n(p)}function l(p){return p===a?(t.enter(i),t.consume(p),t.exit(i),t.exit(r),e):(t.enter(o),u(p))}function u(p){return p===a?(t.exit(o),l(a)):p===null?n(p):se(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),Ce(t,u,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),c(p))}function c(p){return p===a||p===null||se(p)?(t.exit("chunkString"),u(p)):(t.consume(p),p===92?f:c)}function f(p){return p===a||p===92?(t.consume(p),c):c(p)}}function fn(t,e){let n;return r;function r(i){return se(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),n=!0,r):Ee(i)?Ce(t,r,n?"linePrefix":"lineSuffix")(i):e(i)}}const Hp={name:"definition",tokenize:Gp},$p={partial:!0,tokenize:Yp};function Gp(t,e,n){const r=this;let i;return o;function o(d){return t.enter("definition"),a(d)}function a(d){return ns.call(r,t,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(d)}function s(d){return i=qt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),d===58?(t.enter("definitionMarker"),t.consume(d),t.exit("definitionMarker"),l):n(d)}function l(d){return qe(d)?fn(t,u)(d):u(d)}function u(d){return ts(t,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(d)}function c(d){return t.attempt($p,f,f)(d)}function f(d){return Ee(d)?Ce(t,p,"whitespace")(d):p(d)}function p(d){return d===null||se(d)?(t.exit("definition"),r.parser.defined.push(i),e(d)):n(d)}}function Yp(t,e,n){return r;function r(s){return qe(s)?fn(t,i)(s):n(s)}function i(s){return rs(t,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function o(s){return Ee(s)?Ce(t,a,"whitespace")(s):a(s)}function a(s){return s===null||se(s)?e(s):n(s)}}const Kp={name:"hardBreakEscape",tokenize:qp};function qp(t,e,n){return r;function r(o){return t.enter("hardBreakEscape"),t.consume(o),i}function i(o){return se(o)?(t.exit("hardBreakEscape"),e(o)):n(o)}}const Wp={name:"headingAtx",resolve:Xp,tokenize:Zp};function Xp(t,e){let n=t.length-2,r=3,i,o;return t[r][1].type==="whitespace"&&(r+=2),n-2>r&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&t[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:t[r][1].start,end:t[n][1].end},o={type:"chunkText",start:t[r][1].start,end:t[n][1].end,contentType:"text"},ct(t,r,n-r+1,[["enter",i,e],["enter",o,e],["exit",o,e],["exit",i,e]])),t}function Zp(t,e,n){let r=0;return i;function i(c){return t.enter("atxHeading"),o(c)}function o(c){return t.enter("atxHeadingSequence"),a(c)}function a(c){return c===35&&r++<6?(t.consume(c),a):c===null||qe(c)?(t.exit("atxHeadingSequence"),s(c)):n(c)}function s(c){return c===35?(t.enter("atxHeadingSequence"),l(c)):c===null||se(c)?(t.exit("atxHeading"),e(c)):Ee(c)?Ce(t,s,"whitespace")(c):(t.enter("atxHeadingText"),u(c))}function l(c){return c===35?(t.consume(c),l):(t.exit("atxHeadingSequence"),s(c))}function u(c){return c===null||c===35||qe(c)?(t.exit("atxHeadingText"),s(c)):(t.consume(c),u)}}const Qp=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Mo=["pre","script","style","textarea"],Jp={concrete:!0,name:"htmlFlow",resolveTo:nh,tokenize:rh},eh={partial:!0,tokenize:oh},th={partial:!0,tokenize:ih};function nh(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function rh(t,e,n){const r=this;let i,o,a,s,l;return u;function u(R){return c(R)}function c(R){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(R),f}function f(R){return R===33?(t.consume(R),p):R===47?(t.consume(R),o=!0,x):R===63?(t.consume(R),i=3,r.interrupt?e:_):ut(R)?(t.consume(R),a=String.fromCharCode(R),v):n(R)}function p(R){return R===45?(t.consume(R),i=2,d):R===91?(t.consume(R),i=5,s=0,y):ut(R)?(t.consume(R),i=4,r.interrupt?e:_):n(R)}function d(R){return R===45?(t.consume(R),r.interrupt?e:_):n(R)}function y(R){const ge="CDATA[";return R===ge.charCodeAt(s++)?(t.consume(R),s===ge.length?r.interrupt?e:S:y):n(R)}function x(R){return ut(R)?(t.consume(R),a=String.fromCharCode(R),v):n(R)}function v(R){if(R===null||R===47||R===62||qe(R)){const ge=R===47,Te=a.toLowerCase();return!ge&&!o&&Mo.includes(Te)?(i=1,r.interrupt?e(R):S(R)):Qp.includes(a.toLowerCase())?(i=6,ge?(t.consume(R),k):r.interrupt?e(R):S(R)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(R):o?A(R):E(R))}return R===45||et(R)?(t.consume(R),a+=String.fromCharCode(R),v):n(R)}function k(R){return R===62?(t.consume(R),r.interrupt?e:S):n(R)}function A(R){return Ee(R)?(t.consume(R),A):m(R)}function E(R){return R===47?(t.consume(R),m):R===58||R===95||ut(R)?(t.consume(R),C):Ee(R)?(t.consume(R),E):m(R)}function C(R){return R===45||R===46||R===58||R===95||et(R)?(t.consume(R),C):P(R)}function P(R){return R===61?(t.consume(R),h):Ee(R)?(t.consume(R),P):E(R)}function h(R){return R===null||R===60||R===61||R===62||R===96?n(R):R===34||R===39?(t.consume(R),l=R,I):Ee(R)?(t.consume(R),h):b(R)}function I(R){return R===l?(t.consume(R),l=null,g):R===null||se(R)?n(R):(t.consume(R),I)}function b(R){return R===null||R===34||R===39||R===47||R===60||R===61||R===62||R===96||qe(R)?P(R):(t.consume(R),b)}function g(R){return R===47||R===62||Ee(R)?E(R):n(R)}function m(R){return R===62?(t.consume(R),T):n(R)}function T(R){return R===null||se(R)?S(R):Ee(R)?(t.consume(R),T):n(R)}function S(R){return R===45&&i===2?(t.consume(R),j):R===60&&i===1?(t.consume(R),J):R===62&&i===4?(t.consume(R),ee):R===63&&i===3?(t.consume(R),_):R===93&&i===5?(t.consume(R),Q):se(R)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(eh,me,B)(R)):R===null||se(R)?(t.exit("htmlFlowData"),B(R)):(t.consume(R),S)}function B(R){return t.check(th,D,me)(R)}function D(R){return t.enter("lineEnding"),t.consume(R),t.exit("lineEnding"),F}function F(R){return R===null||se(R)?B(R):(t.enter("htmlFlowData"),S(R))}function j(R){return R===45?(t.consume(R),_):S(R)}function J(R){return R===47?(t.consume(R),a="",oe):S(R)}function oe(R){if(R===62){const ge=a.toLowerCase();return Mo.includes(ge)?(t.consume(R),ee):S(R)}return ut(R)&&a.length<8?(t.consume(R),a+=String.fromCharCode(R),oe):S(R)}function Q(R){return R===93?(t.consume(R),_):S(R)}function _(R){return R===62?(t.consume(R),ee):R===45&&i===2?(t.consume(R),_):S(R)}function ee(R){return R===null||se(R)?(t.exit("htmlFlowData"),me(R)):(t.consume(R),ee)}function me(R){return t.exit("htmlFlow"),e(R)}}function ih(t,e,n){const r=this;return i;function i(a){return se(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),o):n(a)}function o(a){return r.parser.lazy[r.now().line]?n(a):e(a)}}function oh(t,e,n){return r;function r(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(Zn,e,n)}}const ah={name:"htmlText",tokenize:sh};function sh(t,e,n){const r=this;let i,o,a;return s;function s(_){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(_),l}function l(_){return _===33?(t.consume(_),u):_===47?(t.consume(_),P):_===63?(t.consume(_),E):ut(_)?(t.consume(_),b):n(_)}function u(_){return _===45?(t.consume(_),c):_===91?(t.consume(_),o=0,y):ut(_)?(t.consume(_),A):n(_)}function c(_){return _===45?(t.consume(_),d):n(_)}function f(_){return _===null?n(_):_===45?(t.consume(_),p):se(_)?(a=f,J(_)):(t.consume(_),f)}function p(_){return _===45?(t.consume(_),d):f(_)}function d(_){return _===62?j(_):_===45?p(_):f(_)}function y(_){const ee="CDATA[";return _===ee.charCodeAt(o++)?(t.consume(_),o===ee.length?x:y):n(_)}function x(_){return _===null?n(_):_===93?(t.consume(_),v):se(_)?(a=x,J(_)):(t.consume(_),x)}function v(_){return _===93?(t.consume(_),k):x(_)}function k(_){return _===62?j(_):_===93?(t.consume(_),k):x(_)}function A(_){return _===null||_===62?j(_):se(_)?(a=A,J(_)):(t.consume(_),A)}function E(_){return _===null?n(_):_===63?(t.consume(_),C):se(_)?(a=E,J(_)):(t.consume(_),E)}function C(_){return _===62?j(_):E(_)}function P(_){return ut(_)?(t.consume(_),h):n(_)}function h(_){return _===45||et(_)?(t.consume(_),h):I(_)}function I(_){return se(_)?(a=I,J(_)):Ee(_)?(t.consume(_),I):j(_)}function b(_){return _===45||et(_)?(t.consume(_),b):_===47||_===62||qe(_)?g(_):n(_)}function g(_){return _===47?(t.consume(_),j):_===58||_===95||ut(_)?(t.consume(_),m):se(_)?(a=g,J(_)):Ee(_)?(t.consume(_),g):j(_)}function m(_){return _===45||_===46||_===58||_===95||et(_)?(t.consume(_),m):T(_)}function T(_){return _===61?(t.consume(_),S):se(_)?(a=T,J(_)):Ee(_)?(t.consume(_),T):g(_)}function S(_){return _===null||_===60||_===61||_===62||_===96?n(_):_===34||_===39?(t.consume(_),i=_,B):se(_)?(a=S,J(_)):Ee(_)?(t.consume(_),S):(t.consume(_),D)}function B(_){return _===i?(t.consume(_),i=void 0,F):_===null?n(_):se(_)?(a=B,J(_)):(t.consume(_),B)}function D(_){return _===null||_===34||_===39||_===60||_===61||_===96?n(_):_===47||_===62||qe(_)?g(_):(t.consume(_),D)}function F(_){return _===47||_===62||qe(_)?g(_):n(_)}function j(_){return _===62?(t.consume(_),t.exit("htmlTextData"),t.exit("htmlText"),e):n(_)}function J(_){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(_),t.exit("lineEnding"),oe}function oe(_){return Ee(_)?Ce(t,Q,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):Q(_)}function Q(_){return t.enter("htmlTextData"),a(_)}}const xi={name:"labelEnd",resolveAll:fh,resolveTo:dh,tokenize:ph},lh={tokenize:hh},uh={tokenize:mh},ch={tokenize:gh};function fh(t){let e=-1;const n=[];for(;++e=3&&(u===null||se(u))?(t.exit("thematicBreak"),e(u)):n(u)}function l(u){return u===i?(t.consume(u),r++,l):(t.exit("thematicBreakSequence"),Ee(u)?Ce(t,s,"whitespace")(u):s(u))}}const Ye={continuation:{tokenize:Mh},exit:Sh,name:"list",tokenize:Eh},Th={partial:!0,tokenize:Ih},_h={partial:!0,tokenize:Ah};function Eh(t,e,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return s;function s(d){const y=r.containerState.type||(d===42||d===43||d===45?"listUnordered":"listOrdered");if(y==="listUnordered"?!r.containerState.marker||d===r.containerState.marker:Gr(d)){if(r.containerState.type||(r.containerState.type=y,t.enter(y,{_container:!0})),y==="listUnordered")return t.enter("listItemPrefix"),d===42||d===45?t.check(Dn,n,u)(d):u(d);if(!r.interrupt||d===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),l(d)}return n(d)}function l(d){return Gr(d)&&++a<10?(t.consume(d),l):(!r.interrupt||a<2)&&(r.containerState.marker?d===r.containerState.marker:d===41||d===46)?(t.exit("listItemValue"),u(d)):n(d)}function u(d){return t.enter("listItemMarker"),t.consume(d),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||d,t.check(Zn,r.interrupt?n:c,t.attempt(Th,p,f))}function c(d){return r.containerState.initialBlankLine=!0,o++,p(d)}function f(d){return Ee(d)?(t.enter("listItemPrefixWhitespace"),t.consume(d),t.exit("listItemPrefixWhitespace"),p):n(d)}function p(d){return r.containerState.size=o+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(d)}}function Mh(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(Zn,i,o);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ce(t,e,"listItemIndent",r.containerState.size+1)(s)}function o(s){return r.containerState.furtherBlankLines||!Ee(s)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(s)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(_h,e,a)(s))}function a(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ce(t,t.attempt(Ye,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function Ah(t,e,n){const r=this;return Ce(t,i,"listItemIndent",r.containerState.size+1);function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?e(o):n(o)}}function Sh(t){t.exit(this.containerState.type)}function Ih(t,e,n){const r=this;return Ce(t,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const a=r.events[r.events.length-1];return!Ee(o)&&a&&a[1].type==="listItemPrefixWhitespace"?e(o):n(o)}}const Ao={name:"setextUnderline",resolveTo:Rh,tokenize:Ch};function Rh(t,e){let n=t.length,r,i,o;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){r=n;break}t[n][1].type==="paragraph"&&(i=n)}else t[n][1].type==="content"&&t.splice(n,1),!o&&t[n][1].type==="definition"&&(o=n);const a={type:"setextHeading",start:{...t[i][1].start},end:{...t[t.length-1][1].end}};return t[i][1].type="setextHeadingText",o?(t.splice(i,0,["enter",a,e]),t.splice(o+1,0,["exit",t[r][1],e]),t[r][1].end={...t[o][1].end}):t[r][1]=a,t.push(["exit",a,e]),t}function Ch(t,e,n){const r=this;let i;return o;function o(u){let c=r.events.length,f;for(;c--;)if(r.events[c][1].type!=="lineEnding"&&r.events[c][1].type!=="linePrefix"&&r.events[c][1].type!=="content"){f=r.events[c][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(t.enter("setextHeadingLine"),i=u,a(u)):n(u)}function a(u){return t.enter("setextHeadingLineSequence"),s(u)}function s(u){return u===i?(t.consume(u),s):(t.exit("setextHeadingLineSequence"),Ee(u)?Ce(t,l,"lineSuffix")(u):l(u))}function l(u){return u===null||se(u)?(t.exit("setextHeadingLine"),e(u)):n(u)}}const Nh={tokenize:Lh};function Lh(t){const e=this,n=t.attempt(Zn,r,t.attempt(this.parser.constructs.flowInitial,i,Ce(t,t.attempt(this.parser.constructs.flow,i,t.attempt(Bp,i)),"linePrefix")));return n;function r(o){if(o===null){t.consume(o);return}return t.enter("lineEndingBlank"),t.consume(o),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function i(o){if(o===null){t.consume(o);return}return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const Ph={resolveAll:os()},Dh=is("string"),Oh=is("text");function is(t){return{resolveAll:os(t==="text"?Fh:void 0),tokenize:e};function e(n){const r=this,i=this.parser.constructs[t],o=n.attempt(i,a,s);return a;function a(c){return u(c)?o(c):s(c)}function s(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),l}function l(c){return u(c)?(n.exit("data"),o(c)):(n.consume(c),l)}function u(c){if(c===null)return!0;const f=i[c];let p=-1;if(f)for(;++p-1){const s=a[0];typeof s=="string"?a[0]=s.slice(r):a.shift()}o>0&&a.push(t[i].slice(0,o))}return a}function Xh(t,e){let n=-1;const r=[];let i;for(;++n\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function Ud(t,e,n,r){const i=r.schema,o=i.space==="svg"?!1:r.settings.omitOptionalTags;let a=i.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(t.tagName.toLowerCase());const s=[];let l;i.space==="html"&&t.tagName==="svg"&&(r.schema=$a);const u=jd(r,t.properties),c=r.all(i.space==="html"&&t.tagName==="template"?t.content:t);return r.schema=i,c&&(a=!1),(u||!o||!Pd(t,e,n))&&(s.push("<",t.tagName,u?" "+u:""),a&&(i.space==="svg"||r.settings.closeSelfClosing)&&(l=u.charAt(u.length-1),(!r.settings.tightSelfClosing||l==="/"||l&&l!=='"'&&l!=="'")&&s.push(" "),s.push("/")),s.push(">")),s.push(c),!a&&(!o||!mi(t,e,n))&&s.push(""),s.join("")}function jd(t,e){const n=[];let r=-1,i;if(e){for(i in e)if(e[i]!==null&&e[i]!==void 0){const o=Vd(t,i,e[i]);o&&n.push(o)}}for(;++rLi(n,t.alternative)&&(a=t.alternative),s=a+Gt(n,Object.assign({},t.settings.characterReferences,{subset:(a==="'"?In.single:In.double)[i][o],attribute:!0}))+a),l+(s&&"="+s))}const Hd=["<","&"];function qa(t,e,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?t.value:Gt(t.value,Object.assign({},r.settings.characterReferences,{subset:Hd}))}function $d(t,e,n,r){return r.settings.allowDangerousHtml?t.value:qa(t,e,n,r)}function Gd(t,e,n,r){return r.all(t)}const Yd=fd("type",{invalid:Kd,unknown:qd,handlers:{comment:md,doctype:gd,element:Ud,raw:$d,root:Gd,text:qa}});function Kd(t){throw new Error("Expected node, not `"+t+"`")}function qd(t){const e=t;throw new Error("Cannot compile unknown node `"+e.type+"`")}const Wd={},Xd={},Zd=[];function Qd(t,e){const n=e||Wd,r=n.quote||'"',i=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:Jd,all:ep,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||td,characterReferences:n.characterReferences||Xd,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?$a:cd,quote:r,alternative:i}.one(Array.isArray(t)?{type:"root",children:t}:t,void 0,void 0)}function Jd(t,e,n){return Yd(t,e,n,this)}function ep(t){const e=[],n=t&&t.children||Zd;let r=-1;for(;++ri?0:i+e:e=e>i?i:e,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(e,n),t.splice(...a);else for(n&&t.splice(e,n);o0?(ct(t,t.length,0,e),t):e}const bo={}.hasOwnProperty;function op(t){const e={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function qt(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ut=It(/[A-Za-z]/),et=It(/[\dA-Za-z]/),lp=It(/[#-'*+\--9=?A-Z^-~]/);function $r(t){return t!==null&&(t<32||t===127)}const Gr=It(/\d/),up=It(/[\dA-Fa-f]/),cp=It(/[!-/:-@[-`{-~]/);function se(t){return t!==null&&t<-2}function qe(t){return t!==null&&(t<0||t===32)}function Ee(t){return t===-2||t===-1||t===32}const fp=It(new RegExp("\\p{P}|\\p{S}","u")),dp=It(/\s/);function It(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function Jt(t){const e=[];let n=-1,r=0,i=0;for(;++n55295&&o<57344){const s=t.charCodeAt(n+1);o<56320&&s>56319&&s<57344?(a=String.fromCharCode(o,s),i=1):a="�"}else a=String.fromCharCode(o);a&&(e.push(t.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return e.join("")+t.slice(r)}function Ce(t,e,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return a;function a(l){return Ee(l)?(t.enter(n),s(l)):e(l)}function s(l){return Ee(l)&&o++a))return;const I=e.events.length;let b=I,g,m;for(;b--;)if(e.events[b][0]==="exit"&&e.events[b][1].type==="chunkFlow"){if(g){m=e.events[b][1].end;break}g=!0}for(k(r),h=I;hE;){const P=n[C];e.containerState=P[1],P[0].exit.call(e,t)}n.length=E}function A(){i.write([null]),o=void 0,i=void 0,e.containerState._closeFlow=void 0}}function yp(t,e,n){return Ce(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ko(t){if(t===null||qe(t)||dp(t))return 1;if(fp(t))return 2}function yi(t,e,n){const r=[];let i=-1;for(;++i1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const f={...t[r][1].end},p={...t[n][1].start};To(f,-l),To(p,l),a={type:l>1?"strongSequence":"emphasisSequence",start:f,end:{...t[r][1].end}},s={type:l>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:p},o={type:l>1?"strongText":"emphasisText",start:{...t[r][1].end},end:{...t[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...a.start},end:{...s.end}},t[r][1].end={...a.start},t[n][1].start={...s.end},u=[],t[r][1].end.offset-t[r][1].start.offset&&(u=rt(u,[["enter",t[r][1],e],["exit",t[r][1],e]])),u=rt(u,[["enter",i,e],["enter",a,e],["exit",a,e],["enter",o,e]]),u=rt(u,yi(e.parser.constructs.insideSpan.null,t.slice(r+1,n),e)),u=rt(u,[["exit",o,e],["enter",s,e],["exit",s,e],["exit",i,e]]),t[n][1].end.offset-t[n][1].start.offset?(c=2,u=rt(u,[["enter",t[n][1],e],["exit",t[n][1],e]])):c=0,ct(t,r-1,n-r+3,u),n=r+u.length-c-2;break}}for(n=-1;++n0&&Ee(h)?Ce(t,A,"linePrefix",o+1)(h):A(h)}function A(h){return h===null||se(h)?t.check(_o,x,C)(h):(t.enter("codeFlowValue"),E(h))}function E(h){return h===null||se(h)?(t.exit("codeFlowValue"),A(h)):(t.consume(h),E)}function C(h){return t.exit("codeFenced"),e(h)}function P(h,I,b){let g=0;return m;function m(F){return h.enter("lineEnding"),h.consume(F),h.exit("lineEnding"),T}function T(F){return h.enter("codeFencedFence"),Ee(F)?Ce(h,S,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):S(F)}function S(F){return F===s?(h.enter("codeFencedFenceSequence"),B(F)):b(F)}function B(F){return F===s?(g++,h.consume(F),B):g>=a?(h.exit("codeFencedFenceSequence"),Ee(F)?Ce(h,D,"whitespace")(F):D(F)):b(F)}function D(F){return F===null||se(F)?(h.exit("codeFencedFence"),I(F)):b(F)}}}function Ip(t,e,n){const r=this;return i;function i(a){return a===null?n(a):(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),o)}function o(a){return r.parser.lazy[r.now().line]?n(a):e(a)}}const wr={name:"codeIndented",tokenize:Cp},Rp={partial:!0,tokenize:Np};function Cp(t,e,n){const r=this;return i;function i(u){return t.enter("codeIndented"),Ce(t,o,"linePrefix",5)(u)}function o(u){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?a(u):n(u)}function a(u){return u===null?l(u):se(u)?t.attempt(Rp,a,l)(u):(t.enter("codeFlowValue"),s(u))}function s(u){return u===null||se(u)?(t.exit("codeFlowValue"),a(u)):(t.consume(u),s)}function l(u){return t.exit("codeIndented"),e(u)}}function Np(t,e,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):se(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),i):Ce(t,o,"linePrefix",5)(a)}function o(a){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?e(a):se(a)?i(a):n(a)}}const Lp={name:"codeText",previous:Dp,resolve:Pp,tokenize:Op};function Pp(t){let e=t.length-4,n=3,r,i;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return ethis.left.length)return this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse();const i=this.left.slice(e);return i.push(...this.right.slice(this.right.length-r+this.left.length).reverse()),i}splice(e,n,r){const i=n||0;this.setCursor(Math.trunc(e));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&sn(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),sn(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),sn(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e=4?e(a):t.interrupt(r.parser.constructs.flow,n,e)(a)}}function ts(t,e,n,r,i,o,a,s,l){const u=l||Number.POSITIVE_INFINITY;let c=0;return f;function f(k){return k===60?(t.enter(r),t.enter(i),t.enter(o),t.consume(k),t.exit(o),p):k===null||k===32||k===41||$r(k)?n(k):(t.enter(r),t.enter(a),t.enter(s),t.enter("chunkString",{contentType:"string"}),x(k))}function p(k){return k===62?(t.enter(o),t.consume(k),t.exit(o),t.exit(i),t.exit(r),e):(t.enter(s),t.enter("chunkString",{contentType:"string"}),d(k))}function d(k){return k===62?(t.exit("chunkString"),t.exit(s),p(k)):k===null||k===60||se(k)?n(k):(t.consume(k),k===92?y:d)}function y(k){return k===60||k===62||k===92?(t.consume(k),d):d(k)}function x(k){return!c&&(k===null||k===41||qe(k))?(t.exit("chunkString"),t.exit(s),t.exit(a),t.exit(r),e(k)):c999||d===null||d===91||d===93&&!l||d===94&&!s&&"_hiddenFootnoteSupport"in a.parser.constructs?n(d):d===93?(t.exit(o),t.enter(i),t.consume(d),t.exit(i),t.exit(r),e):se(d)?(t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),c):(t.enter("chunkString",{contentType:"string"}),f(d))}function f(d){return d===null||d===91||d===93||se(d)||s++>999?(t.exit("chunkString"),c(d)):(t.consume(d),l||(l=!Ee(d)),d===92?p:f)}function p(d){return d===91||d===92||d===93?(t.consume(d),s++,f):f(d)}}function rs(t,e,n,r,i,o){let a;return s;function s(p){return p===34||p===39||p===40?(t.enter(r),t.enter(i),t.consume(p),t.exit(i),a=p===40?41:p,l):n(p)}function l(p){return p===a?(t.enter(i),t.consume(p),t.exit(i),t.exit(r),e):(t.enter(o),u(p))}function u(p){return p===a?(t.exit(o),l(a)):p===null?n(p):se(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),Ce(t,u,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),c(p))}function c(p){return p===a||p===null||se(p)?(t.exit("chunkString"),u(p)):(t.consume(p),p===92?f:c)}function f(p){return p===a||p===92?(t.consume(p),c):c(p)}}function fn(t,e){let n;return r;function r(i){return se(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),n=!0,r):Ee(i)?Ce(t,r,n?"linePrefix":"lineSuffix")(i):e(i)}}const $p={name:"definition",tokenize:Yp},Gp={partial:!0,tokenize:Kp};function Yp(t,e,n){const r=this;let i;return o;function o(d){return t.enter("definition"),a(d)}function a(d){return ns.call(r,t,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(d)}function s(d){return i=qt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),d===58?(t.enter("definitionMarker"),t.consume(d),t.exit("definitionMarker"),l):n(d)}function l(d){return qe(d)?fn(t,u)(d):u(d)}function u(d){return ts(t,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(d)}function c(d){return t.attempt(Gp,f,f)(d)}function f(d){return Ee(d)?Ce(t,p,"whitespace")(d):p(d)}function p(d){return d===null||se(d)?(t.exit("definition"),r.parser.defined.push(i),e(d)):n(d)}}function Kp(t,e,n){return r;function r(s){return qe(s)?fn(t,i)(s):n(s)}function i(s){return rs(t,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function o(s){return Ee(s)?Ce(t,a,"whitespace")(s):a(s)}function a(s){return s===null||se(s)?e(s):n(s)}}const qp={name:"hardBreakEscape",tokenize:Wp};function Wp(t,e,n){return r;function r(o){return t.enter("hardBreakEscape"),t.consume(o),i}function i(o){return se(o)?(t.exit("hardBreakEscape"),e(o)):n(o)}}const Xp={name:"headingAtx",resolve:Zp,tokenize:Qp};function Zp(t,e){let n=t.length-2,r=3,i,o;return t[r][1].type==="whitespace"&&(r+=2),n-2>r&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&t[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:t[r][1].start,end:t[n][1].end},o={type:"chunkText",start:t[r][1].start,end:t[n][1].end,contentType:"text"},ct(t,r,n-r+1,[["enter",i,e],["enter",o,e],["exit",o,e],["exit",i,e]])),t}function Qp(t,e,n){let r=0;return i;function i(c){return t.enter("atxHeading"),o(c)}function o(c){return t.enter("atxHeadingSequence"),a(c)}function a(c){return c===35&&r++<6?(t.consume(c),a):c===null||qe(c)?(t.exit("atxHeadingSequence"),s(c)):n(c)}function s(c){return c===35?(t.enter("atxHeadingSequence"),l(c)):c===null||se(c)?(t.exit("atxHeading"),e(c)):Ee(c)?Ce(t,s,"whitespace")(c):(t.enter("atxHeadingText"),u(c))}function l(c){return c===35?(t.consume(c),l):(t.exit("atxHeadingSequence"),s(c))}function u(c){return c===null||c===35||qe(c)?(t.exit("atxHeadingText"),s(c)):(t.consume(c),u)}}const Jp=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Mo=["pre","script","style","textarea"],eh={concrete:!0,name:"htmlFlow",resolveTo:rh,tokenize:ih},th={partial:!0,tokenize:ah},nh={partial:!0,tokenize:oh};function rh(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function ih(t,e,n){const r=this;let i,o,a,s,l;return u;function u(R){return c(R)}function c(R){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(R),f}function f(R){return R===33?(t.consume(R),p):R===47?(t.consume(R),o=!0,x):R===63?(t.consume(R),i=3,r.interrupt?e:_):ut(R)?(t.consume(R),a=String.fromCharCode(R),v):n(R)}function p(R){return R===45?(t.consume(R),i=2,d):R===91?(t.consume(R),i=5,s=0,y):ut(R)?(t.consume(R),i=4,r.interrupt?e:_):n(R)}function d(R){return R===45?(t.consume(R),r.interrupt?e:_):n(R)}function y(R){const ge="CDATA[";return R===ge.charCodeAt(s++)?(t.consume(R),s===ge.length?r.interrupt?e:S:y):n(R)}function x(R){return ut(R)?(t.consume(R),a=String.fromCharCode(R),v):n(R)}function v(R){if(R===null||R===47||R===62||qe(R)){const ge=R===47,Te=a.toLowerCase();return!ge&&!o&&Mo.includes(Te)?(i=1,r.interrupt?e(R):S(R)):Jp.includes(a.toLowerCase())?(i=6,ge?(t.consume(R),k):r.interrupt?e(R):S(R)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(R):o?A(R):E(R))}return R===45||et(R)?(t.consume(R),a+=String.fromCharCode(R),v):n(R)}function k(R){return R===62?(t.consume(R),r.interrupt?e:S):n(R)}function A(R){return Ee(R)?(t.consume(R),A):m(R)}function E(R){return R===47?(t.consume(R),m):R===58||R===95||ut(R)?(t.consume(R),C):Ee(R)?(t.consume(R),E):m(R)}function C(R){return R===45||R===46||R===58||R===95||et(R)?(t.consume(R),C):P(R)}function P(R){return R===61?(t.consume(R),h):Ee(R)?(t.consume(R),P):E(R)}function h(R){return R===null||R===60||R===61||R===62||R===96?n(R):R===34||R===39?(t.consume(R),l=R,I):Ee(R)?(t.consume(R),h):b(R)}function I(R){return R===l?(t.consume(R),l=null,g):R===null||se(R)?n(R):(t.consume(R),I)}function b(R){return R===null||R===34||R===39||R===47||R===60||R===61||R===62||R===96||qe(R)?P(R):(t.consume(R),b)}function g(R){return R===47||R===62||Ee(R)?E(R):n(R)}function m(R){return R===62?(t.consume(R),T):n(R)}function T(R){return R===null||se(R)?S(R):Ee(R)?(t.consume(R),T):n(R)}function S(R){return R===45&&i===2?(t.consume(R),j):R===60&&i===1?(t.consume(R),J):R===62&&i===4?(t.consume(R),ee):R===63&&i===3?(t.consume(R),_):R===93&&i===5?(t.consume(R),Q):se(R)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(th,me,B)(R)):R===null||se(R)?(t.exit("htmlFlowData"),B(R)):(t.consume(R),S)}function B(R){return t.check(nh,D,me)(R)}function D(R){return t.enter("lineEnding"),t.consume(R),t.exit("lineEnding"),F}function F(R){return R===null||se(R)?B(R):(t.enter("htmlFlowData"),S(R))}function j(R){return R===45?(t.consume(R),_):S(R)}function J(R){return R===47?(t.consume(R),a="",oe):S(R)}function oe(R){if(R===62){const ge=a.toLowerCase();return Mo.includes(ge)?(t.consume(R),ee):S(R)}return ut(R)&&a.length<8?(t.consume(R),a+=String.fromCharCode(R),oe):S(R)}function Q(R){return R===93?(t.consume(R),_):S(R)}function _(R){return R===62?(t.consume(R),ee):R===45&&i===2?(t.consume(R),_):S(R)}function ee(R){return R===null||se(R)?(t.exit("htmlFlowData"),me(R)):(t.consume(R),ee)}function me(R){return t.exit("htmlFlow"),e(R)}}function oh(t,e,n){const r=this;return i;function i(a){return se(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),o):n(a)}function o(a){return r.parser.lazy[r.now().line]?n(a):e(a)}}function ah(t,e,n){return r;function r(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(Zn,e,n)}}const sh={name:"htmlText",tokenize:lh};function lh(t,e,n){const r=this;let i,o,a;return s;function s(_){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(_),l}function l(_){return _===33?(t.consume(_),u):_===47?(t.consume(_),P):_===63?(t.consume(_),E):ut(_)?(t.consume(_),b):n(_)}function u(_){return _===45?(t.consume(_),c):_===91?(t.consume(_),o=0,y):ut(_)?(t.consume(_),A):n(_)}function c(_){return _===45?(t.consume(_),d):n(_)}function f(_){return _===null?n(_):_===45?(t.consume(_),p):se(_)?(a=f,J(_)):(t.consume(_),f)}function p(_){return _===45?(t.consume(_),d):f(_)}function d(_){return _===62?j(_):_===45?p(_):f(_)}function y(_){const ee="CDATA[";return _===ee.charCodeAt(o++)?(t.consume(_),o===ee.length?x:y):n(_)}function x(_){return _===null?n(_):_===93?(t.consume(_),v):se(_)?(a=x,J(_)):(t.consume(_),x)}function v(_){return _===93?(t.consume(_),k):x(_)}function k(_){return _===62?j(_):_===93?(t.consume(_),k):x(_)}function A(_){return _===null||_===62?j(_):se(_)?(a=A,J(_)):(t.consume(_),A)}function E(_){return _===null?n(_):_===63?(t.consume(_),C):se(_)?(a=E,J(_)):(t.consume(_),E)}function C(_){return _===62?j(_):E(_)}function P(_){return ut(_)?(t.consume(_),h):n(_)}function h(_){return _===45||et(_)?(t.consume(_),h):I(_)}function I(_){return se(_)?(a=I,J(_)):Ee(_)?(t.consume(_),I):j(_)}function b(_){return _===45||et(_)?(t.consume(_),b):_===47||_===62||qe(_)?g(_):n(_)}function g(_){return _===47?(t.consume(_),j):_===58||_===95||ut(_)?(t.consume(_),m):se(_)?(a=g,J(_)):Ee(_)?(t.consume(_),g):j(_)}function m(_){return _===45||_===46||_===58||_===95||et(_)?(t.consume(_),m):T(_)}function T(_){return _===61?(t.consume(_),S):se(_)?(a=T,J(_)):Ee(_)?(t.consume(_),T):g(_)}function S(_){return _===null||_===60||_===61||_===62||_===96?n(_):_===34||_===39?(t.consume(_),i=_,B):se(_)?(a=S,J(_)):Ee(_)?(t.consume(_),S):(t.consume(_),D)}function B(_){return _===i?(t.consume(_),i=void 0,F):_===null?n(_):se(_)?(a=B,J(_)):(t.consume(_),B)}function D(_){return _===null||_===34||_===39||_===60||_===61||_===96?n(_):_===47||_===62||qe(_)?g(_):(t.consume(_),D)}function F(_){return _===47||_===62||qe(_)?g(_):n(_)}function j(_){return _===62?(t.consume(_),t.exit("htmlTextData"),t.exit("htmlText"),e):n(_)}function J(_){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(_),t.exit("lineEnding"),oe}function oe(_){return Ee(_)?Ce(t,Q,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):Q(_)}function Q(_){return t.enter("htmlTextData"),a(_)}}const xi={name:"labelEnd",resolveAll:dh,resolveTo:ph,tokenize:hh},uh={tokenize:mh},ch={tokenize:gh},fh={tokenize:yh};function dh(t){let e=-1;const n=[];for(;++e=3&&(u===null||se(u))?(t.exit("thematicBreak"),e(u)):n(u)}function l(u){return u===i?(t.consume(u),r++,l):(t.exit("thematicBreakSequence"),Ee(u)?Ce(t,s,"whitespace")(u):s(u))}}const Ye={continuation:{tokenize:Ah},exit:Ih,name:"list",tokenize:Mh},_h={partial:!0,tokenize:Rh},Eh={partial:!0,tokenize:Sh};function Mh(t,e,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return s;function s(d){const y=r.containerState.type||(d===42||d===43||d===45?"listUnordered":"listOrdered");if(y==="listUnordered"?!r.containerState.marker||d===r.containerState.marker:Gr(d)){if(r.containerState.type||(r.containerState.type=y,t.enter(y,{_container:!0})),y==="listUnordered")return t.enter("listItemPrefix"),d===42||d===45?t.check(Dn,n,u)(d):u(d);if(!r.interrupt||d===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),l(d)}return n(d)}function l(d){return Gr(d)&&++a<10?(t.consume(d),l):(!r.interrupt||a<2)&&(r.containerState.marker?d===r.containerState.marker:d===41||d===46)?(t.exit("listItemValue"),u(d)):n(d)}function u(d){return t.enter("listItemMarker"),t.consume(d),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||d,t.check(Zn,r.interrupt?n:c,t.attempt(_h,p,f))}function c(d){return r.containerState.initialBlankLine=!0,o++,p(d)}function f(d){return Ee(d)?(t.enter("listItemPrefixWhitespace"),t.consume(d),t.exit("listItemPrefixWhitespace"),p):n(d)}function p(d){return r.containerState.size=o+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(d)}}function Ah(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(Zn,i,o);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ce(t,e,"listItemIndent",r.containerState.size+1)(s)}function o(s){return r.containerState.furtherBlankLines||!Ee(s)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(s)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(Eh,e,a)(s))}function a(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ce(t,t.attempt(Ye,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function Sh(t,e,n){const r=this;return Ce(t,i,"listItemIndent",r.containerState.size+1);function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?e(o):n(o)}}function Ih(t){t.exit(this.containerState.type)}function Rh(t,e,n){const r=this;return Ce(t,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const a=r.events[r.events.length-1];return!Ee(o)&&a&&a[1].type==="listItemPrefixWhitespace"?e(o):n(o)}}const Ao={name:"setextUnderline",resolveTo:Ch,tokenize:Nh};function Ch(t,e){let n=t.length,r,i,o;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){r=n;break}t[n][1].type==="paragraph"&&(i=n)}else t[n][1].type==="content"&&t.splice(n,1),!o&&t[n][1].type==="definition"&&(o=n);const a={type:"setextHeading",start:{...t[i][1].start},end:{...t[t.length-1][1].end}};return t[i][1].type="setextHeadingText",o?(t.splice(i,0,["enter",a,e]),t.splice(o+1,0,["exit",t[r][1],e]),t[r][1].end={...t[o][1].end}):t[r][1]=a,t.push(["exit",a,e]),t}function Nh(t,e,n){const r=this;let i;return o;function o(u){let c=r.events.length,f;for(;c--;)if(r.events[c][1].type!=="lineEnding"&&r.events[c][1].type!=="linePrefix"&&r.events[c][1].type!=="content"){f=r.events[c][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(t.enter("setextHeadingLine"),i=u,a(u)):n(u)}function a(u){return t.enter("setextHeadingLineSequence"),s(u)}function s(u){return u===i?(t.consume(u),s):(t.exit("setextHeadingLineSequence"),Ee(u)?Ce(t,l,"lineSuffix")(u):l(u))}function l(u){return u===null||se(u)?(t.exit("setextHeadingLine"),e(u)):n(u)}}const Lh={tokenize:Ph};function Ph(t){const e=this,n=t.attempt(Zn,r,t.attempt(this.parser.constructs.flowInitial,i,Ce(t,t.attempt(this.parser.constructs.flow,i,t.attempt(zp,i)),"linePrefix")));return n;function r(o){if(o===null){t.consume(o);return}return t.enter("lineEndingBlank"),t.consume(o),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function i(o){if(o===null){t.consume(o);return}return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const Dh={resolveAll:os()},Oh=is("string"),Fh=is("text");function is(t){return{resolveAll:os(t==="text"?Bh:void 0),tokenize:e};function e(n){const r=this,i=this.parser.constructs[t],o=n.attempt(i,a,s);return a;function a(c){return u(c)?o(c):s(c)}function s(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),l}function l(c){return u(c)?(n.exit("data"),o(c)):(n.consume(c),l)}function u(c){if(c===null)return!0;const f=i[c];let p=-1;if(f)for(;++p-1){const s=a[0];typeof s=="string"?a[0]=s.slice(r):a.shift()}o>0&&a.push(t[i].slice(0,o))}return a}function Zh(t,e){let n=-1;const r=[];let i;for(;++n0){const He=ie.tokenStack[ie.tokenStack.length-1];(He[1]||Co).call(ie,void 0,He[0])}for(q.position={start:Tt(U.length>0?U[0][1].start:{line:1,column:1,offset:0}),end:Tt(U.length>0?U[U.length-2][1].end:{line:1,column:1,offset:0})},be=-1;++be1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};t.patch(e,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return t.patch(e,u),t.applyData(e,u)}function pm(t,e){const n={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function hm(t,e){if(t.options.allowDangerousHtml){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}}function ls(t,e){const n=e.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+r}];const i=t.all(e),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function mm(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return ls(t,e);const i={src:Jt(r.url||""),alt:e.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return t.patch(e,o),t.applyData(e,o)}function gm(t,e){const n={src:Jt(e.url)};e.alt!==null&&e.alt!==void 0&&(n.alt=e.alt),e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"img",properties:n,children:[]};return t.patch(e,r),t.applyData(e,r)}function ym(t,e){const n={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return t.patch(e,r),t.applyData(e,r)}function xm(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return ls(t,e);const i={href:Jt(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:t.all(e)};return t.patch(e,o),t.applyData(e,o)}function vm(t,e){const n={href:Jt(e.url)};e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"a",properties:n,children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function bm(t,e,n){const r=t.all(e),i=n?wm(n):us(e),o={},a=[];if(typeof e.checked=="boolean"){const c=r[0];let f;c&&c.type==="element"&&c.tagName==="p"?f=c:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let s=-1;for(;++s0){const He=ie.tokenStack[ie.tokenStack.length-1];(He[1]||Co).call(ie,void 0,He[0])}for(q.position={start:Tt(U.length>0?U[0][1].start:{line:1,column:1,offset:0}),end:Tt(U.length>0?U[U.length-2][1].end:{line:1,column:1,offset:0})},be=-1;++be1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};t.patch(e,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return t.patch(e,u),t.applyData(e,u)}function hm(t,e){const n={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function mm(t,e){if(t.options.allowDangerousHtml){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}}function ls(t,e){const n=e.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+r}];const i=t.all(e),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function gm(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return ls(t,e);const i={src:Jt(r.url||""),alt:e.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return t.patch(e,o),t.applyData(e,o)}function ym(t,e){const n={src:Jt(e.url)};e.alt!==null&&e.alt!==void 0&&(n.alt=e.alt),e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"img",properties:n,children:[]};return t.patch(e,r),t.applyData(e,r)}function xm(t,e){const n={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return t.patch(e,r),t.applyData(e,r)}function vm(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return ls(t,e);const i={href:Jt(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:t.all(e)};return t.patch(e,o),t.applyData(e,o)}function bm(t,e){const n={href:Jt(e.url)};e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"a",properties:n,children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function wm(t,e,n){const r=t.all(e),i=n?km(n):us(e),o={},a=[];if(typeof e.checked=="boolean"){const c=r[0];let f;c&&c.type==="element"&&c.tagName==="p"?f=c:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let s=-1;for(;++s1}function km(t,e){const n={},r=t.all(e);let i=-1;for(typeof e.start=="number"&&e.start!==1&&(n.start=e.start);++i0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Mm(t){const e=fs(t),n=cs(t);if(e&&n)return{start:e,end:n}}function Am(t,e){const n=t.all(e),r=n.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:t.wrap([r],!0)};t.patch(e.children[0],a),i.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},s=fs(e.children[1]),l=cs(e.children[e.children.length-1]);s&&l&&(a.position={start:s,end:l}),i.push(a)}const o={type:"element",tagName:"table",properties:{},children:t.wrap(i,!0)};return t.patch(e,o),t.applyData(e,o)}function Sm(t,e,n){const r=n?n.children:void 0,o=(r?r.indexOf(e):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,s=a?a.length:e.children.length;let l=-1;const u=[];for(;++l0,!0),r[0]),i=r.index+r[0].length,r=n.exec(e);return o.push(Po(e.slice(i),i>0,!1)),o.join("")}function Po(t,e,n){let r=0,i=t.length;if(e){let o=t.codePointAt(r);for(;o===No||o===Lo;)r++,o=t.codePointAt(r)}if(n){let o=t.codePointAt(i-1);for(;o===No||o===Lo;)i--,o=t.codePointAt(i-1)}return i>r?t.slice(r,i):""}function Cm(t,e){const n={type:"text",value:Rm(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function Nm(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const Lm={blockquote:sm,break:lm,code:um,delete:cm,emphasis:fm,footnoteReference:dm,heading:pm,html:hm,imageReference:mm,image:gm,inlineCode:ym,linkReference:xm,link:vm,listItem:bm,list:km,paragraph:Tm,root:_m,strong:Em,table:Am,tableCell:Im,tableRow:Sm,text:Cm,thematicBreak:Nm,toml:Rn,yaml:Rn,definition:Rn,footnoteDefinition:Rn};function Rn(){}const ps=-1,Qn=0,Vn=1,Hn=2,vi=3,bi=4,wi=5,ki=6,hs=7,ms=8,Do=typeof self=="object"?self:globalThis,Pm=(t,e)=>{const n=(i,o)=>(t.set(o,i),i),r=i=>{if(t.has(i))return t.get(i);const[o,a]=e[i];switch(o){case Qn:case ps:return n(a,i);case Vn:{const s=n([],i);for(const l of a)s.push(r(l));return s}case Hn:{const s=n({},i);for(const[l,u]of a)s[r(l)]=r(u);return s}case vi:return n(new Date(a),i);case bi:{const{source:s,flags:l}=a;return n(new RegExp(s,l),i)}case wi:{const s=n(new Map,i);for(const[l,u]of a)s.set(r(l),r(u));return s}case ki:{const s=n(new Set,i);for(const l of a)s.add(r(l));return s}case hs:{const{name:s,message:l}=a;return n(new Do[s](l),i)}case ms:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i)}return n(new Do[o](a),i)};return r},Oo=t=>Pm(new Map,t)(0),jt="",{toString:Dm}={},{keys:Om}=Object,ln=t=>{const e=typeof t;if(e!=="object"||!t)return[Qn,e];const n=Dm.call(t).slice(8,-1);switch(n){case"Array":return[Vn,jt];case"Object":return[Hn,jt];case"Date":return[vi,jt];case"RegExp":return[bi,jt];case"Map":return[wi,jt];case"Set":return[ki,jt]}return n.includes("Array")?[Vn,n]:n.includes("Error")?[hs,n]:[Hn,n]},Cn=([t,e])=>t===Qn&&(e==="function"||e==="symbol"),Fm=(t,e,n,r)=>{const i=(a,s)=>{const l=r.push(a)-1;return n.set(s,l),l},o=a=>{if(n.has(a))return n.get(a);let[s,l]=ln(a);switch(s){case Qn:{let c=a;switch(l){case"bigint":s=ms,c=a.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+l);c=null;break;case"undefined":return i([ps],a)}return i([s,c],a)}case Vn:{if(l)return i([l,[...a]],a);const c=[],f=i([s,c],a);for(const p of a)c.push(o(p));return f}case Hn:{if(l)switch(l){case"BigInt":return i([l,a.toString()],a);case"Boolean":case"Number":case"String":return i([l,a.valueOf()],a)}if(e&&"toJSON"in a)return o(a.toJSON());const c=[],f=i([s,c],a);for(const p of Om(a))(t||!Cn(ln(a[p])))&&c.push([o(p),o(a[p])]);return f}case vi:return i([s,a.toISOString()],a);case bi:{const{source:c,flags:f}=a;return i([s,{source:c,flags:f}],a)}case wi:{const c=[],f=i([s,c],a);for(const[p,d]of a)(t||!(Cn(ln(p))||Cn(ln(d))))&&c.push([o(p),o(d)]);return f}case ki:{const c=[],f=i([s,c],a);for(const p of a)(t||!Cn(ln(p)))&&c.push(o(p));return f}}const{message:u}=a;return i([s,{name:l,message:u}],a)};return o},Fo=(t,{json:e,lossy:n}={})=>{const r=[];return Fm(!(e||n),!!e,new Map,r)(t),r},$n=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?Oo(Fo(t,e)):structuredClone(t):(t,e)=>Oo(Fo(t,e));function Bm(t,e){const n=[{type:"text",value:"↩"}];return e>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),n}function zm(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function Um(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=t.options.footnoteBackContent||Bm,r=t.options.footnoteBackLabel||zm,i=t.options.footnoteLabel||"Footnotes",o=t.options.footnoteLabelTagName||"h2",a=t.options.footnoteLabelProperties||{className:["sr-only"]},s=[];let l=-1;for(;++l0&&y.push({type:"text",value:" "});let A=typeof n=="string"?n:n(l,d);typeof A=="string"&&(A={type:"text",value:A}),y.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+p+(d>1?"-"+d:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,d),className:["data-footnote-backref"]},children:Array.isArray(A)?A:[A]})}const v=c[c.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const A=v.children[v.children.length-1];A&&A.type==="text"?A.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...y)}else c.push(...y);const k={type:"element",tagName:"li",properties:{id:e+"fn-"+p},children:t.wrap(c,!0)};t.patch(u,k),s.push(k)}if(s.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...$n(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` +`});const u={type:"element",tagName:"li",properties:o,children:a};return t.patch(e,u),t.applyData(e,u)}function km(t){let e=!1;if(t.type==="list"){e=t.spread||!1;const n=t.children;let r=-1;for(;!e&&++r1}function Tm(t,e){const n={},r=t.all(e);let i=-1;for(typeof e.start=="number"&&e.start!==1&&(n.start=e.start);++i0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Am(t){const e=fs(t),n=cs(t);if(e&&n)return{start:e,end:n}}function Sm(t,e){const n=t.all(e),r=n.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:t.wrap([r],!0)};t.patch(e.children[0],a),i.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},s=fs(e.children[1]),l=cs(e.children[e.children.length-1]);s&&l&&(a.position={start:s,end:l}),i.push(a)}const o={type:"element",tagName:"table",properties:{},children:t.wrap(i,!0)};return t.patch(e,o),t.applyData(e,o)}function Im(t,e,n){const r=n?n.children:void 0,o=(r?r.indexOf(e):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,s=a?a.length:e.children.length;let l=-1;const u=[];for(;++l0,!0),r[0]),i=r.index+r[0].length,r=n.exec(e);return o.push(Po(e.slice(i),i>0,!1)),o.join("")}function Po(t,e,n){let r=0,i=t.length;if(e){let o=t.codePointAt(r);for(;o===No||o===Lo;)r++,o=t.codePointAt(r)}if(n){let o=t.codePointAt(i-1);for(;o===No||o===Lo;)i--,o=t.codePointAt(i-1)}return i>r?t.slice(r,i):""}function Nm(t,e){const n={type:"text",value:Cm(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function Lm(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const Pm={blockquote:lm,break:um,code:cm,delete:fm,emphasis:dm,footnoteReference:pm,heading:hm,html:mm,imageReference:gm,image:ym,inlineCode:xm,linkReference:vm,link:bm,listItem:wm,list:Tm,paragraph:_m,root:Em,strong:Mm,table:Sm,tableCell:Rm,tableRow:Im,text:Nm,thematicBreak:Lm,toml:Rn,yaml:Rn,definition:Rn,footnoteDefinition:Rn};function Rn(){}const ps=-1,Qn=0,Vn=1,Hn=2,vi=3,bi=4,wi=5,ki=6,hs=7,ms=8,Do=typeof self=="object"?self:globalThis,Dm=(t,e)=>{const n=(i,o)=>(t.set(o,i),i),r=i=>{if(t.has(i))return t.get(i);const[o,a]=e[i];switch(o){case Qn:case ps:return n(a,i);case Vn:{const s=n([],i);for(const l of a)s.push(r(l));return s}case Hn:{const s=n({},i);for(const[l,u]of a)s[r(l)]=r(u);return s}case vi:return n(new Date(a),i);case bi:{const{source:s,flags:l}=a;return n(new RegExp(s,l),i)}case wi:{const s=n(new Map,i);for(const[l,u]of a)s.set(r(l),r(u));return s}case ki:{const s=n(new Set,i);for(const l of a)s.add(r(l));return s}case hs:{const{name:s,message:l}=a;return n(new Do[s](l),i)}case ms:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i)}return n(new Do[o](a),i)};return r},Oo=t=>Dm(new Map,t)(0),jt="",{toString:Om}={},{keys:Fm}=Object,ln=t=>{const e=typeof t;if(e!=="object"||!t)return[Qn,e];const n=Om.call(t).slice(8,-1);switch(n){case"Array":return[Vn,jt];case"Object":return[Hn,jt];case"Date":return[vi,jt];case"RegExp":return[bi,jt];case"Map":return[wi,jt];case"Set":return[ki,jt]}return n.includes("Array")?[Vn,n]:n.includes("Error")?[hs,n]:[Hn,n]},Cn=([t,e])=>t===Qn&&(e==="function"||e==="symbol"),Bm=(t,e,n,r)=>{const i=(a,s)=>{const l=r.push(a)-1;return n.set(s,l),l},o=a=>{if(n.has(a))return n.get(a);let[s,l]=ln(a);switch(s){case Qn:{let c=a;switch(l){case"bigint":s=ms,c=a.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+l);c=null;break;case"undefined":return i([ps],a)}return i([s,c],a)}case Vn:{if(l)return i([l,[...a]],a);const c=[],f=i([s,c],a);for(const p of a)c.push(o(p));return f}case Hn:{if(l)switch(l){case"BigInt":return i([l,a.toString()],a);case"Boolean":case"Number":case"String":return i([l,a.valueOf()],a)}if(e&&"toJSON"in a)return o(a.toJSON());const c=[],f=i([s,c],a);for(const p of Fm(a))(t||!Cn(ln(a[p])))&&c.push([o(p),o(a[p])]);return f}case vi:return i([s,a.toISOString()],a);case bi:{const{source:c,flags:f}=a;return i([s,{source:c,flags:f}],a)}case wi:{const c=[],f=i([s,c],a);for(const[p,d]of a)(t||!(Cn(ln(p))||Cn(ln(d))))&&c.push([o(p),o(d)]);return f}case ki:{const c=[],f=i([s,c],a);for(const p of a)(t||!Cn(ln(p)))&&c.push(o(p));return f}}const{message:u}=a;return i([s,{name:l,message:u}],a)};return o},Fo=(t,{json:e,lossy:n}={})=>{const r=[];return Bm(!(e||n),!!e,new Map,r)(t),r},$n=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?Oo(Fo(t,e)):structuredClone(t):(t,e)=>Oo(Fo(t,e));function zm(t,e){const n=[{type:"text",value:"↩"}];return e>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),n}function Um(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function jm(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=t.options.footnoteBackContent||zm,r=t.options.footnoteBackLabel||Um,i=t.options.footnoteLabel||"Footnotes",o=t.options.footnoteLabelTagName||"h2",a=t.options.footnoteLabelProperties||{className:["sr-only"]},s=[];let l=-1;for(;++l0&&y.push({type:"text",value:" "});let A=typeof n=="string"?n:n(l,d);typeof A=="string"&&(A={type:"text",value:A}),y.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+p+(d>1?"-"+d:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,d),className:["data-footnote-backref"]},children:Array.isArray(A)?A:[A]})}const v=c[c.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const A=v.children[v.children.length-1];A&&A.type==="text"?A.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...y)}else c.push(...y);const k={type:"element",tagName:"li",properties:{id:e+"fn-"+p},children:t.wrap(c,!0)};t.patch(u,k),s.push(k)}if(s.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...$n(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` `},{type:"element",tagName:"ol",properties:{},children:t.wrap(s,!0)},{type:"text",value:` -`}]}}const gs=function(t){if(t==null)return $m;if(typeof t=="function")return Jn(t);if(typeof t=="object")return Array.isArray(t)?jm(t):Vm(t);if(typeof t=="string")return Hm(t);throw new Error("Expected function, string, or object as test")};function jm(t){const e=[];let n=-1;for(;++n":""))+")"})}return p;function p(){let d=ys,y,x,v;if((!e||o(l,u,c[c.length-1]||void 0))&&(d=Wm(n(l,c)),d[0]===Bo))return d;if("children"in l&&l.children){const k=l;if(k.children&&d[0]!==Km)for(x=(r?k.children.length:-1)+a,v=c.concat(k);x>-1&&x":""))+")"})}return p;function p(){let d=ys,y,x,v;if((!e||o(l,u,c[c.length-1]||void 0))&&(d=Xm(n(l,c)),d[0]===Bo))return d;if("children"in l&&l.children){const k=l;if(k.children&&d[0]!==qm)for(x=(r?k.children.length:-1)+a,v=c.concat(k);x>-1&&x0&&n.push({type:"text",value:` -`}),n}function zo(t){let e=0,n=t.charCodeAt(e);for(;n===9||n===32;)e++,n=t.charCodeAt(e);return t.slice(e)}function Uo(t,e){const n=Qm(t,e),r=n.one(t,void 0),i=Um(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:` -`},i),o}function rg(t,e){return t&&"run"in t?async function(n,r){const i=Uo(n,{file:r,...e});await t.run(i,r)}:function(n,r){return Uo(n,{file:r,...t||e})}}function jo(t){if(t)throw t}var Tr,Vo;function ig(){if(Vo)return Tr;Vo=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(u){return typeof Array.isArray=="function"?Array.isArray(u):e.call(u)==="[object Array]"},o=function(u){if(!u||e.call(u)!=="[object Object]")return!1;var c=t.call(u,"constructor"),f=u.constructor&&u.constructor.prototype&&t.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!c&&!f)return!1;var p;for(p in u);return typeof p>"u"||t.call(u,p)},a=function(u,c){n&&c.name==="__proto__"?n(u,c.name,{enumerable:!0,configurable:!0,value:c.newValue,writable:!0}):u[c.name]=c.newValue},s=function(u,c){if(c==="__proto__")if(t.call(u,c)){if(r)return r(u,c).value}else return;return u[c]};return Tr=function l(){var u,c,f,p,d,y,x=arguments[0],v=1,k=arguments.length,A=!1;for(typeof x=="boolean"&&(A=x,x=arguments[1]||{},v=2),(x==null||typeof x!="object"&&typeof x!="function")&&(x={});va.length;let l;s&&a.push(i);try{l=t.apply(this,a)}catch(u){const c=u;if(s&&n)throw c;return i(c)}s||(l&&l.then&&typeof l.then=="function"?l.then(o,i):l instanceof Error?i(l):o(l))}function i(a,...s){n||(n=!0,e(a,...s))}function o(a){i(null,a)}}class Xe extends Error{constructor(e,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},a=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof e=="string"?i=e:!o.cause&&e&&(a=!0,i=e.message,o.cause=e),!o.ruleId&&!o.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?o.ruleId=r:(o.source=r.slice(0,l),o.ruleId=r.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){const l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}const s=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=s?s.line:void 0,this.name=dn(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=a&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual,this.expected,this.note,this.url}}Xe.prototype.file="";Xe.prototype.name="";Xe.prototype.reason="";Xe.prototype.message="";Xe.prototype.stack="";Xe.prototype.column=void 0;Xe.prototype.line=void 0;Xe.prototype.ancestors=void 0;Xe.prototype.cause=void 0;Xe.prototype.fatal=void 0;Xe.prototype.place=void 0;Xe.prototype.ruleId=void 0;Xe.prototype.source=void 0;const lt={basename:lg,dirname:ug,extname:cg,join:fg,sep:"/"};function lg(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');wn(t);let n=0,r=-1,i=t.length,o;if(e===void 0||e.length===0||e.length>t.length){for(;i--;)if(t.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":t.slice(n,r)}if(e===t)return"";let a=-1,s=e.length-1;for(;i--;)if(t.codePointAt(i)===47){if(o){n=i+1;break}}else a<0&&(o=!0,a=i+1),s>-1&&(t.codePointAt(i)===e.codePointAt(s--)?s<0&&(r=i):(s=-1,r=a));return n===r?r=a:r<0&&(r=t.length),t.slice(n,r)}function ug(t){if(wn(t),t.length===0)return".";let e=-1,n=t.length,r;for(;--n;)if(t.codePointAt(n)===47){if(r){e=n;break}}else r||(r=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function cg(t){wn(t);let e=t.length,n=-1,r=0,i=-1,o=0,a;for(;e--;){const s=t.codePointAt(e);if(s===47){if(a){r=e+1;break}continue}n<0&&(a=!0,n=e+1),s===46?i<0?i=e:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":t.slice(i,n)}function fg(...t){let e=-1,n;for(;++e0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function pg(t,e){let n="",r=0,i=-1,o=0,a=-1,s,l;for(;++a<=t.length;){if(a2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=a,o=0;continue}}else if(n.length>0){n="",r=0,i=a,o=0;continue}}e&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+t.slice(i+1,a):n=t.slice(i+1,a),r=a-i-1;i=a,o=0}else s===46&&o>-1?o++:o=-1}return n}function wn(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const hg={cwd:mg};function mg(){return"/"}function Xr(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function gg(t){if(typeof t=="string")t=new URL(t);else if(!Xr(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return yg(t)}function yg(t){if(t.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const e=t.pathname;let n=-1;for(;++n0){let[d,...y]=c;const x=r[p][1];Wr(x)&&Wr(d)&&(d=_r(!0,x,d)),r[p]=[u,d,...y]}}}}const kg=new Ti().freeze();function Sr(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function Ir(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function Rr(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function $o(t){if(!Wr(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function Go(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function Nn(t){return Tg(t)?t:new xg(t)}function Tg(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function _g(t){return typeof t=="string"||Eg(t)}function Eg(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}function _i(){const t=kg().use(am).use(rg).use(ep);return{process:e=>t.processSync(e).toString()}}const Mg={relative:""},Ag={"h-full":"","w-full":""},Sg={key:0,class:"animate-stripe",absolute:"",left:"1/2",bottom:"20%",z:"20","rounded-2xl":"",text:"primary-600","px-2":"","py-2":"",transform:"translate-x--1/2"},Ig={bg:"primary-50","rounded-xl":"","px-10":"","py-6":""},Rg=["innerHTML"],Cg=Fe({__name:"Stage",props:{paused:{type:Boolean,default:!1}},setup(t){const e=W(),n=W(),{stageView:r}=Ke(Wt()),{mouthOpenSize:i}=Ke(Wl()),{audioContext:o,calculateVolume:a}=pa(),{onBeforeMessageComposed:s,onBeforeSend:l,onTokenLiteral:u,onTokenSpecial:c,onStreamEnd:f,streamingMessage:p,onAssistantResponseEnd:d}=St(),{process:y}=_i(),x=li(),v=W(),k=W(!1),A=W(!1),E=or({handlers:[_=>new Promise(ee=>{const me=o.createBufferSource();me.buffer=_.data.audioBuffer,me.connect(o.destination),me.connect(v.value),k.value=!0,me.start(0),me.onended=()=>{k.value=!1,ee()}})]}),C=Ll(),{ssmlEnabled:P,activeSpeechProvider:h,activeSpeechModel:I,activeSpeechVoice:b,pitch:g}=Ke(C);async function m(_){try{if(!h.value){console.warn("No active speech provider configured");return}if(!b.value){console.warn("No active speech voice configured");return}const ee=x.getProviderInstance(h.value);if(!ee){console.error("Failed to initialize speech provider");return}const me=x.getProviderConfig(h.value),R=P.value?C.generateSSML(_.data,b.value,{...me,pitch:g.value}):_.data,ge=await Pl({...ee.speech(I.value,me),input:R,voice:b.value.id}),Te=await o.decodeAudioData(ge);await E.add({audioBuffer:Te,text:_.data})}catch(ee){console.error("Speech generation failed:",ee)}}const T=or({handlers:[m]});T.on("add",_=>{console.debug("ttsQueue added",_)});const S=Dl(T),{live2dCurrentMotion:B}=Ke(Wt()),D=or({handlers:[async _=>{if(r.value==="3d"){const ee=Rl[_.data];if(!ee)return;await n.value.setExpression(ee)}else r.value==="2d"&&(B.value={group:Cl[_.data]})}]}),F=Ol(D);F.onHandlerEvent("emotion",_=>{console.debug("emotion detected",_)});const j=Fl();j.onHandlerEvent("delay",_=>{console.debug("delay detected",_)});function J(){requestAnimationFrame(J),k.value&&(i.value=a(v.value,"linear"))}function oe(){A.value||(J(),o.resume(),A.value=!0)}function Q(){v.value||(v.value=o.createAnalyser())}return s(async()=>{Q(),oe()}),l(async()=>{B.value={group:Ni}}),u(async _=>{await S.add(_)}),c(async _=>{await j.add(_),await F.add(_)}),f(async()=>{await j.add(Bl)}),d(async _=>{}),Ot(()=>{var ee,me,R;A.value=!1;const _=window;(ee=_.electron)==null||ee.ipcRenderer.removeAllListeners("before-hide"),(me=_.electron)==null||me.ipcRenderer.removeAllListeners("after-show"),(R=_.electron)==null||R.ipcRenderer.removeAllListeners("before-quit")}),pn(()=>{var ee,me,R;const _=window;(ee=_.electron)==null||ee.ipcRenderer.on("before-hide",()=>{B.value={group:Sl}}),(me=_.electron)==null||me.ipcRenderer.on("after-show",()=>{B.value={group:Il}}),(R=_.electron)==null||R.ipcRenderer.on("before-quit",()=>{B.value={group:Ni}})}),pn(async()=>{e.value=vs({connection:{bundles:Nl()}}),await e.value.execute("CREATE TABLE memory_test (vec FLOAT[768]);")}),(_,ee)=>(Z(),re("div",Mg,[O("div",Ag,[V(r)==="2d"?(Z(),Xt(ou,{key:0,"mouth-open-size":V(i),"min-w":"50% (Z(),re("header",Fg,[O("div",Bg,[ke($l)]),ke(V(ml),{class:"m-1 block max-h-[10lh] min-h-[1lh] rounded-lg bg-neutral-100 p-2 text-lg text-neutral-500 outline-none dark:bg-neutral-800 dark:text-neutral-400",to:"/settings"},{default:Ue(()=>n[0]||(n[0]=[O("div",{"i-solar:settings-minimalistic-bold-duotone":""},null,-1)])),_:1})]))}});function xs(t,e){const n=la(e??{},{...Di.getDefaultRealTimeVADOptions("v5"),preSpeechPadFrames:30,positiveSpeechThreshold:.5,negativeSpeechThreshold:.35,minSpeechFrames:30,auto:!0}),r=W(),i=gl("microphone");async function o(){if(r.value&&(r.value.destroy(),r.value=void 0,console.warn("existing MicVAD destroyed")),!i.value)return;const a=V(t);if(!a)return;const s=await navigator.mediaDevices.getUserMedia({audio:{deviceId:a}});r.value=await Di.MicVAD.new({...n,stream:s}),n.auto&&r.value.start()}return Be(i,o,{immediate:!0}),Be(yl(t),o,{immediate:!0}),xl(o),Ot(()=>{r.value&&(r.value.destroy(),r.value=void 0)}),{destroy:()=>{r.value&&(r.value.destroy(),r.value=void 0)},start:()=>{r.value&&r.value.start()}}}function Ug(t,e){const n=la(e,{onLoading:()=>{},onInitiate:()=>{},onProgress:()=>{},onDone:()=>{},onReady:()=>{},onStart:()=>{},onUpdate:()=>{},onComplete:()=>{}}),{post:r,data:i,terminate:o}=vl(t,{type:"module"}),a=W(null),s=W(""),l=W([]),u=W(!1),c=W(0),f=W("");return Be(i,p=>{var d,y,x,v,k,A,E,C;switch(p.status){case"loading":a.value="loading",s.value=p.data,(d=n.onLoading)==null||d.call(n,p.data);break;case"initiate":l.value.push(p),(y=n.onInitiate)==null||y.call(n,p);break;case"progress":l.value=l.value.map(P=>P.file===p.file?{...P,...p}:P),(x=n.onProgress)==null||x.call(n,p);break;case"done":l.value=l.value.filter(P=>P.file!==p.file),(v=n.onDone)==null||v.call(n,p);break;case"ready":a.value="ready",(k=n.onReady)==null||k.call(n);break;case"start":u.value=!0,(A=n.onStart)==null||A.call(n);break;case"update":c.value=p.tps,(E=n.onUpdate)==null||E.call(n,p.tps);break;case"complete":u.value=!1,f.value=p.output[0]||"",console.debug("Whisper result:",f.value),(C=n.onComplete)==null||C.call(n,p.output[0]);break}}),Ot(()=>{o()}),{transcribe:p=>r(p),status:a,loadingMessage:s,loadingProgress:l,transcribing:u,tps:c,result:f,load:()=>r({type:"load"}),terminate:o}}const jg="/assets/worker-i3yLSyEt.js";async function Vg(t,e){const n=new ArrayBuffer(44+t.length*2),r=new DataView(n);Ln(r,0,"RIFF"),r.setUint32(4,36+t.length*2,!0),Ln(r,8,"WAVE"),Ln(r,12,"fmt "),r.setUint32(16,16,!0),r.setUint16(20,1,!0),r.setUint16(22,1,!0),r.setUint32(24,e,!0),r.setUint32(28,e*2,!0),r.setUint16(32,2,!0),r.setUint16(34,16,!0),Ln(r,36,"data"),r.setUint32(40,t.length*2,!0),Hg(r,44,t);const i=new Blob([r],{type:"audio/wav"});return new Promise((o,a)=>{const s=new FileReader;s.onload=()=>{const l=s.result.split(",")[1];o(l)},s.onerror=a,s.readAsDataURL(i)})}function Ln(t,e,n){for(let r=0;r{jn().then(()=>{i.update(),o.value=i.height.value})}),u(async()=>{jn().then(()=>{i.update(),o.value=i.height.value})}),(c,f)=>{const p=ca("auto-animate");return Z(),re("div",$g,[f[2]||(f[2]=O("div",{"flex-1":""},null,-1)),Et((Z(),re("div",{ref_key:"chatHistoryRef",ref:e,"h-full":"","w-full":"",flex:"~ col","overflow-scroll":""},[f[1]||(f[1]=O("div",{"flex-1":""},null,-1)),(Z(!0),re(ai,null,si(V(n),(d,y)=>(Z(),re("div",{key:y,"mb-2":""},[d.role==="error"?(Z(),re("div",Gg,[O("div",Yg,[O("div",Kg,[O("div",qg,[O("span",Wg,he(V(a)("stage.chat.message.character-name.core-system")),1)]),f[0]||(f[0]=O("div",{"i-solar:danger-triangle-bold-duotone":"","text-violet-500":""},null,-1))]),V(r)&&y===V(n).length-1?(Z(),re("div",Xg)):(Z(),re("div",{key:1,class:"markdown-content break-words text-violet-500",text:"base {if(!B||!B.trim())return;const D=o.getProviderConfig(a.value);await y(B,{chatProvider:o.getProviderInstance(a.value),model:s.value,providerConfig:D})}});async function I(){if(e.value.trim())try{const B=o.getProviderConfig(a.value);await y(e.value,{chatProvider:o.getProviderInstance(a.value),model:s.value,providerConfig:B})}catch(B){v.value.pop(),v.value.push({role:"error",content:B.message})}}const{destroy:b,start:g}=xs(d,{onSpeechStart:()=>{n.value=!0},onVADMisfire:()=>{n.value=!1},onSpeechEnd:B=>{n.value=!1,T(B)},auto:!1});function m(){P.value!=="loading"&&(C(),g())}async function T(B){await k.resume();const D=await Vg(B,k.sampleRate);E({type:"generate",data:{audio:D,language:"en"}})}async function S(B){const D=B.target,F=u.value.find(j=>j.deviceId===D.value);if(!F){f.value=void 0;return}f.value=F}return Be(p,async B=>{B==="false"&&(b(),h())}),Be(i,async B=>{B&&await c()}),x(async()=>{e.value=""}),(B,D)=>(Z(),re("div",uy,[O("fieldset",cy,[O("label",{class:st([r.value==="chat"?"bg-primary-100 dark:bg-primary-900":"bg-white dark:bg-primary-950",r.value==="chat"?"text-primary-500 dark:text-primary-500":"",{"transition-colors-none ":V(l)}]),flex:"~ row",checked:r.value==="chat","aria-checked":r.value==="chat",border:"solid l-2 t-2 b-2 primary-100 dark:primary-900",bg:"hover:primary-100 dark:hover:primary-900",text:"primary-300 hover:primary-500 dark:primary-300/50 dark:hover:primary-500",transition:"all duration-250 ease-in-out","cursor-pointer":"","items-center":"","gap-1":"","rounded-l-lg":"","px-2":""},[Et(O("input",{"onUpdate:modelValue":D[0]||(D[0]=F=>r.value=F),type:"radio",name:"tab",value:"chat",hidden:""},null,512),[[ir,r.value]]),D[5]||(D[5]=O("div",{"i-solar:dialog-2-bold-duotone":"",text:"2xl",transform:"translate-y--2"},null,-1)),O("div",dy,[O("span",py,he(V(A)("stage.chat.tabs.chat")),1)])],10,fy),O("label",{class:st([r.value==="custom"?"bg-primary-100 dark:bg-primary-900":"bg-white dark:bg-primary-950",r.value==="custom"?"text-primary-500 dark:text-primary-500":"",{"transition-colors-none ":V(l)}]),flex:"~ row",checked:r.value==="custom","aria-checked":r.value==="custom",border:"solid t-2 b-2 primary-100 dark:primary-900",bg:"hover:primary-100 dark:hover:primary-900",text:"primary-300 hover:primary-500 dark:primary-300/50 dark:hover:primary-500",transition:"all duration-250 ease-in-out","cursor-pointer":"","items-center":"","gap-1":"","px-2":""},[Et(O("input",{"onUpdate:modelValue":D[1]||(D[1]=F=>r.value=F),type:"radio",name:"tab",value:"custom",hidden:""},null,512),[[ir,r.value]]),D[6]||(D[6]=O("div",{"i-solar:star-fall-2-bold-duotone":"",text:"2xl",transform:"translate-y--2"},null,-1)),O("div",my,[O("span",null,he(V(A)("stage.chat.tabs.custom")),1)])],10,hy),O("label",{class:st([r.value==="clothes"?"bg-primary-100 dark:bg-primary-900":"bg-white dark:bg-primary-950",r.value==="clothes"?"text-primary-500 dark:text-primary-500":"",{"transition-colors-none ":V(l)}]),flex:"~ row",checked:r.value==="clothes","aria-checked":r.value==="clothes",border:"solid r-2 t-2 b-2 primary-100 dark:primary-900",bg:"hover:primary-100 dark:hover:primary-900",text:"primary-300 hover:primary-500 dark:primary-300/50 dark:hover:primary-500",transition:"all duration-250 ease-in-out","cursor-pointer":"","items-center":"","gap-1":"","rounded-r-lg":"","px-2":""},[Et(O("input",{"onUpdate:modelValue":D[2]||(D[2]=F=>r.value=F),type:"radio",name:"tab",value:"clothes",hidden:""},null,512),[[ir,r.value]]),D[7]||(D[7]=O("div",{"i-solar:magic-stick-3-bold-duotone":"",text:"2xl",transform:"translate-y--2"},null,-1)),O("div",yy,[O("span",null,he(V(A)("stage.chat.tabs.clothes")),1)])],10,gy)]),O("div",xy,[O("div",vy,[ke(ly,{"h-full":"","flex-1":"","p-4":"",w:"full","max-h":"e.value=F),placeholder:V(A)("stage.message"),text:"primary-300 hover:primary-500 dark:primary-300/50 dark:hover:primary-500 placeholder:primary-300 placeholder:hover:primary-500 placeholder:dark:primary-300/50 placeholder:dark:hover:primary-500",bg:"primary-100 dark:primary-400/20","min-h":"[100px]","max-h":"[300px]","w-full":"","rounded-t-xl":"","p-4":"","font-medium":"","outline-none":"",transition:"all duration-250 ease-in-out placeholder:all placeholder:duration-250 placeholder:ease-in-out",class:st({"transition-colors-none placeholder:transition-colors-none":V(l)}),onSubmit:I},null,8,["modelValue","placeholder","class"])])])]),O("div",wy,[O("button",{bg:"complementary-100 hover:complementary-200 dark:complementary-800 dark:hover:complementary-700",transition:"all duration-250 ease-in-out",class:st({"transition-colors-none":V(l)}),text:"complementary-400","mb-6":"",flex:"","cursor-pointer":"","items-center":"","justify-center":"","gap-2":"","rounded-full":"","px-4":"","py-2":"",onClick:m},[ke(wl,{mode:"out-in"},{default:Ue(()=>[V(P)===null?(Z(),re("div",ky,he(V(A)("stage.operations.load-models")),1)):V(P)==="loading"?(Z(),re("div",Ty,[D[8]||(D[8]=O("div",{"i-svg-spinners:bouncing-ball":"",class:"text-cyan"},null,-1)),O("span",null,he(V(A)("stage.operations.load-models-status.loading")),1)])):V(P)==="ready"?(Z(),re("div",_y,[D[9]||(D[9]=O("div",{"i-lucide:check":"",class:"text-cyan"},null,-1)),O("span",null,he(V(A)("stage.operations.load-models-status.ready")),1)])):it("",!0)]),_:1})],2),O("div",Ey,[ke(V(ui),null,{default:Ue(()=>[i.value?(Z(),re("fieldset",My,[(Z(!0),re(ai,null,si(V(u),(F,j)=>(Z(),re("label",{key:j,class:"[&_div_span]:dark:hover:bg-cyan-300 [&_div_span]:dark:hover:bg-cyan-900"},[O("input",{type:"radio",name:"audioInput",value:F.deviceId,hidden:"",onChange:S},null,40,Ay),O("div",Sy,[O("div",Iy,[F.deviceId===V(d)?(Z(),re("div",Ry)):it("",!0)]),O("span",{"inline-block":"",class:st([F.deviceId===V(d)?"cyan-400 dark:text-white":"cyan-400/50 dark:text-white/50"]),transition:"all duration-250 ease-in-out"},he(F.label),3)])]))),128))])):it("",!0)]),_:1}),O("label",{bg:"complementary-100 hover:complementary-200 dark:complementary-800 dark:hover:complementary-700",transition:"all duration-250 ease-in-out",class:st({"transition-colors-none":V(l)}),text:"complementary-400","h-fit":"",flex:"","cursor-pointer":"","items-center":"","justify-center":"","gap-2":"","rounded-full":"","px-4":"","py-2":""},[Et(O("input",{"onUpdate:modelValue":D[4]||(D[4]=F=>i.value=F),type:"checkbox",hidden:""},null,512),[[Qr,i.value]]),D[10]||(D[10]=O("div",{"i-solar:microphone-2-bold-duotone":""},null,-1)),O("div",null,[n.value?(Z(),re("span",Ny,"Listening...")):(Z(),re("span",Cy,he(V(A)("settings.microphone")),1))])],2)])])]))}}),Py=qn(Ly,[["__scopeId","data-v-ec42ae04"]]),Dy={py:"1",flex:"~ col",rounded:"lg","overflow-hidden":""},Oy={key:0,flex:"",mr:"12"},Fy={flex:"~ col",border:"4 solid primary-200/50 dark:primary-500/50",shadow:"md primary-200/50 dark:none","min-w-20":"","rounded-lg":"","px-2":"","py-1":"",h:"unset {jn().then(()=>{i.update(),o.value=i.height.value})}),l(async()=>{jn().then(()=>{i.update(),o.value=i.height.value})}),(u,c)=>{const f=ca("auto-animate");return Z(),re("div",Dy,[c[1]||(c[1]=O("div",{"flex-1":""},null,-1)),Et((Z(),re("div",{ref_key:"chatHistoryRef",ref:e,"h-full":"","w-full":"","max-h":"30vh",flex:"~ col","overflow-scroll":""},[c[0]||(c[0]=O("div",{"flex-1":""},null,-1)),(Z(!0),re(ai,null,si(V(r),(p,d)=>(Z(),re("div",{key:d,"mb-2":""},[p.role==="assistant"?(Z(),re("div",Oy,[O("div",Fy,[O("div",null,[O("span",By,he(V(n)("stage.chat.message.character-name.airi")),1)]),p.content?(Z(),re("div",{key:0,class:"markdown-content",text:"base {n.value=!0},onVADMisfire:()=>{n.value=!1},onSpeechEnd:v=>{n.value=!1,x()},auto:!1});function x(v){alert("Transcription is not implemented yet")}return Be(a,async v=>{v==="false"&&d()}),c(async()=>{e.value=""}),pn(()=>{y()}),(v,k)=>(Z(),re("div",null,[O("div",Ky,[ke(Yy,{absolute:"","left-0":"","top-0":"",transform:"translate-y-[-100%]","w-full":""}),O("div",qy,[ke(V(da),{modelValue:e.value,"onUpdate:modelValue":k[0]||(k[0]=A=>e.value=A),placeholder:V(f)("stage.message"),border:"solid 2 primary-100 dark:primary-400/20",text:"primary-300 hover:primary-500 dark:primary-300/50 dark:hover:primary-500 placeholder:primary-300 placeholder:hover:primary-500 placeholder:dark:primary-300/50 placeholder:dark:hover:primary-500",bg:"primary-100 dark:primary-400/20","max-h":"[10lh]","min-h":"[1lh]","w-full":"","resize-none":"","overflow-y-scroll":"","rounded-xl":"","p-2":"","font-medium":"","outline-none":"",transition:"all duration-250 ease-in-out placeholder:all placeholder:duration-250 placeholder:ease-in-out",class:st({"transition-colors-none placeholder:transition-colors-none":V(l)}),onSubmit:p},null,8,["modelValue","placeholder","class"])])])]))}}),Xy={class:"relative"},Zy={absolute:"","left-0":"","right-0":"","top-0":"","w-full":"","overflow-hidden":""},Qy=Fe({__name:"AnimatedWave",props:{height:{default:40},amplitude:{default:14},waveLength:{default:250},fillColor:{default:"oklch(95% 0.10 var(--theme-colors-hue))"},direction:{default:"down"},movementDirection:{default:"left"},animationSpeed:{default:50}},setup(t){const e=t,n=W(e.height),r=W(e.amplitude),i=W(e.waveLength),o=W(e.fillColor),a=W(e.direction),s=W(e.movementDirection);function l(f,p,d,y,x){const v=[],A=Math.ceil(f/y)*y,E=1,C=x==="up"?d:p-d;v.push(`M 0 ${C}`);const P=Math.PI*2/y;for(let I=0;I<=A;I+=E){const b=d*Math.sin(P*I),g=x==="up"?C-b:C+b;v.push(`L ${I} ${g}`)}const h=x==="up"?p:0;return v.push(`L ${A} ${h}`),v.push(`L 0 ${h} Z`),v.join(" ")}const u=je(()=>n.value+r.value*2),c=je(()=>{const f=` +`}),n}function zo(t){let e=0,n=t.charCodeAt(e);for(;n===9||n===32;)e++,n=t.charCodeAt(e);return t.slice(e)}function Uo(t,e){const n=Jm(t,e),r=n.one(t,void 0),i=jm(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:` +`},i),o}function ig(t,e){return t&&"run"in t?async function(n,r){const i=Uo(n,{file:r,...e});await t.run(i,r)}:function(n,r){return Uo(n,{file:r,...t||e})}}function jo(t){if(t)throw t}var Tr,Vo;function og(){if(Vo)return Tr;Vo=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(u){return typeof Array.isArray=="function"?Array.isArray(u):e.call(u)==="[object Array]"},o=function(u){if(!u||e.call(u)!=="[object Object]")return!1;var c=t.call(u,"constructor"),f=u.constructor&&u.constructor.prototype&&t.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!c&&!f)return!1;var p;for(p in u);return typeof p>"u"||t.call(u,p)},a=function(u,c){n&&c.name==="__proto__"?n(u,c.name,{enumerable:!0,configurable:!0,value:c.newValue,writable:!0}):u[c.name]=c.newValue},s=function(u,c){if(c==="__proto__")if(t.call(u,c)){if(r)return r(u,c).value}else return;return u[c]};return Tr=function l(){var u,c,f,p,d,y,x=arguments[0],v=1,k=arguments.length,A=!1;for(typeof x=="boolean"&&(A=x,x=arguments[1]||{},v=2),(x==null||typeof x!="object"&&typeof x!="function")&&(x={});va.length;let l;s&&a.push(i);try{l=t.apply(this,a)}catch(u){const c=u;if(s&&n)throw c;return i(c)}s||(l&&l.then&&typeof l.then=="function"?l.then(o,i):l instanceof Error?i(l):o(l))}function i(a,...s){n||(n=!0,e(a,...s))}function o(a){i(null,a)}}class Xe extends Error{constructor(e,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},a=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof e=="string"?i=e:!o.cause&&e&&(a=!0,i=e.message,o.cause=e),!o.ruleId&&!o.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?o.ruleId=r:(o.source=r.slice(0,l),o.ruleId=r.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){const l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}const s=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=s?s.line:void 0,this.name=dn(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=a&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual,this.expected,this.note,this.url}}Xe.prototype.file="";Xe.prototype.name="";Xe.prototype.reason="";Xe.prototype.message="";Xe.prototype.stack="";Xe.prototype.column=void 0;Xe.prototype.line=void 0;Xe.prototype.ancestors=void 0;Xe.prototype.cause=void 0;Xe.prototype.fatal=void 0;Xe.prototype.place=void 0;Xe.prototype.ruleId=void 0;Xe.prototype.source=void 0;const lt={basename:ug,dirname:cg,extname:fg,join:dg,sep:"/"};function ug(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');wn(t);let n=0,r=-1,i=t.length,o;if(e===void 0||e.length===0||e.length>t.length){for(;i--;)if(t.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":t.slice(n,r)}if(e===t)return"";let a=-1,s=e.length-1;for(;i--;)if(t.codePointAt(i)===47){if(o){n=i+1;break}}else a<0&&(o=!0,a=i+1),s>-1&&(t.codePointAt(i)===e.codePointAt(s--)?s<0&&(r=i):(s=-1,r=a));return n===r?r=a:r<0&&(r=t.length),t.slice(n,r)}function cg(t){if(wn(t),t.length===0)return".";let e=-1,n=t.length,r;for(;--n;)if(t.codePointAt(n)===47){if(r){e=n;break}}else r||(r=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function fg(t){wn(t);let e=t.length,n=-1,r=0,i=-1,o=0,a;for(;e--;){const s=t.codePointAt(e);if(s===47){if(a){r=e+1;break}continue}n<0&&(a=!0,n=e+1),s===46?i<0?i=e:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":t.slice(i,n)}function dg(...t){let e=-1,n;for(;++e0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function hg(t,e){let n="",r=0,i=-1,o=0,a=-1,s,l;for(;++a<=t.length;){if(a2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=a,o=0;continue}}else if(n.length>0){n="",r=0,i=a,o=0;continue}}e&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+t.slice(i+1,a):n=t.slice(i+1,a),r=a-i-1;i=a,o=0}else s===46&&o>-1?o++:o=-1}return n}function wn(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const mg={cwd:gg};function gg(){return"/"}function Xr(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function yg(t){if(typeof t=="string")t=new URL(t);else if(!Xr(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return xg(t)}function xg(t){if(t.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const e=t.pathname;let n=-1;for(;++n0){let[d,...y]=c;const x=r[p][1];Wr(x)&&Wr(d)&&(d=_r(!0,x,d)),r[p]=[u,d,...y]}}}}const Tg=new Ti().freeze();function Sr(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function Ir(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function Rr(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function $o(t){if(!Wr(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function Go(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function Nn(t){return _g(t)?t:new vg(t)}function _g(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function Eg(t){return typeof t=="string"||Mg(t)}function Mg(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}function _i(){const t=Tg().use(sm).use(ig).use(tp);return{process:e=>t.processSync(e).toString()}}const Ag={relative:""},Sg={"h-full":"","w-full":""},Ig={key:0,class:"animate-stripe",absolute:"",left:"1/2",bottom:"20%",z:"20","rounded-2xl":"",text:"primary-600","px-2":"","py-2":"",transform:"translate-x--1/2"},Rg={bg:"primary-50","rounded-xl":"","px-10":"","py-6":""},Cg=["innerHTML"],Ng=Fe({__name:"Stage",props:{paused:{type:Boolean,default:!1}},setup(t){const e=W(),n=W(),{stageView:r}=Ke(Wt()),{mouthOpenSize:i}=Ke(Xl()),{audioContext:o,calculateVolume:a}=pa(),{onBeforeMessageComposed:s,onBeforeSend:l,onTokenLiteral:u,onTokenSpecial:c,onStreamEnd:f,streamingMessage:p,onAssistantResponseEnd:d}=St(),{process:y}=_i(),x=li(),v=W(),k=W(!1),A=W(!1),E=or({handlers:[_=>new Promise(ee=>{const me=o.createBufferSource();me.buffer=_.data.audioBuffer,me.connect(o.destination),me.connect(v.value),k.value=!0,me.start(0),me.onended=()=>{k.value=!1,ee()}})]}),C=Pl(),{ssmlEnabled:P,activeSpeechProvider:h,activeSpeechModel:I,activeSpeechVoice:b,pitch:g}=Ke(C);async function m(_){try{if(!h.value){console.warn("No active speech provider configured");return}if(!b.value){console.warn("No active speech voice configured");return}const ee=x.getProviderInstance(h.value);if(!ee){console.error("Failed to initialize speech provider");return}const me=x.getProviderConfig(h.value),R=P.value?C.generateSSML(_.data,b.value,{...me,pitch:g.value}):_.data,ge=await Dl({...ee.speech(I.value,me),input:R,voice:b.value.id}),Te=await o.decodeAudioData(ge);await E.add({audioBuffer:Te,text:_.data})}catch(ee){console.error("Speech generation failed:",ee)}}const T=or({handlers:[m]});T.on("add",_=>{console.debug("ttsQueue added",_)});const S=Ol(T),{live2dCurrentMotion:B}=Ke(Wt()),D=or({handlers:[async _=>{if(r.value==="3d"){const ee=Cl[_.data];if(!ee)return;await n.value.setExpression(ee)}else r.value==="2d"&&(B.value={group:Nl[_.data]})}]}),F=Fl(D);F.onHandlerEvent("emotion",_=>{console.debug("emotion detected",_)});const j=Bl();j.onHandlerEvent("delay",_=>{console.debug("delay detected",_)});function J(){requestAnimationFrame(J),k.value&&(i.value=a(v.value,"linear"))}function oe(){A.value||(J(),o.resume(),A.value=!0)}function Q(){v.value||(v.value=o.createAnalyser())}return s(async()=>{Q(),oe()}),l(async()=>{B.value={group:Ni}}),u(async _=>{await S.add(_)}),c(async _=>{await j.add(_),await F.add(_)}),f(async()=>{await j.add(zl)}),d(async _=>{}),Ot(()=>{var ee,me,R;A.value=!1;const _=window;(ee=_.electron)==null||ee.ipcRenderer.removeAllListeners("before-hide"),(me=_.electron)==null||me.ipcRenderer.removeAllListeners("after-show"),(R=_.electron)==null||R.ipcRenderer.removeAllListeners("before-quit")}),pn(()=>{var ee,me,R;const _=window;(ee=_.electron)==null||ee.ipcRenderer.on("before-hide",()=>{B.value={group:Il}}),(me=_.electron)==null||me.ipcRenderer.on("after-show",()=>{B.value={group:Rl}}),(R=_.electron)==null||R.ipcRenderer.on("before-quit",()=>{B.value={group:Ni}})}),pn(async()=>{e.value=vs({connection:{bundles:Ll()}}),await e.value.execute("CREATE TABLE memory_test (vec FLOAT[768]);")}),(_,ee)=>(Z(),re("div",Ag,[O("div",Sg,[V(r)==="2d"?(Z(),Xt(au,{key:0,"mouth-open-size":V(i),"min-w":"50% (Z(),re("header",Bg,[O("div",zg,[ke(Gl)]),ke(V(ml),{class:"m-1 block max-h-[10lh] min-h-[1lh] rounded-lg bg-neutral-100 p-2 text-lg text-neutral-500 outline-none dark:bg-neutral-800 dark:text-neutral-400",to:"/settings"},{default:Ue(()=>n[0]||(n[0]=[O("div",{"i-solar:settings-minimalistic-bold-duotone":""},null,-1)])),_:1})]))}});function xs(t,e){const n=la(e??{},{...Di.getDefaultRealTimeVADOptions("v5"),preSpeechPadFrames:30,positiveSpeechThreshold:.5,negativeSpeechThreshold:.35,minSpeechFrames:30,auto:!0}),r=W(),i=gl("microphone");async function o(){if(r.value&&(r.value.destroy(),r.value=void 0,console.warn("existing MicVAD destroyed")),!i.value)return;const a=V(t);if(!a)return;const s=await navigator.mediaDevices.getUserMedia({audio:{deviceId:a}});r.value=await Di.MicVAD.new({...n,stream:s}),n.auto&&r.value.start()}return Be(i,o,{immediate:!0}),Be(yl(t),o,{immediate:!0}),xl(o),Ot(()=>{r.value&&(r.value.destroy(),r.value=void 0)}),{destroy:()=>{r.value&&(r.value.destroy(),r.value=void 0)},start:()=>{r.value&&r.value.start()}}}function jg(t,e){const n=la(e,{onLoading:()=>{},onInitiate:()=>{},onProgress:()=>{},onDone:()=>{},onReady:()=>{},onStart:()=>{},onUpdate:()=>{},onComplete:()=>{}}),{post:r,data:i,terminate:o}=vl(t,{type:"module"}),a=W(null),s=W(""),l=W([]),u=W(!1),c=W(0),f=W("");return Be(i,p=>{var d,y,x,v,k,A,E,C;switch(p.status){case"loading":a.value="loading",s.value=p.data,(d=n.onLoading)==null||d.call(n,p.data);break;case"initiate":l.value.push(p),(y=n.onInitiate)==null||y.call(n,p);break;case"progress":l.value=l.value.map(P=>P.file===p.file?{...P,...p}:P),(x=n.onProgress)==null||x.call(n,p);break;case"done":l.value=l.value.filter(P=>P.file!==p.file),(v=n.onDone)==null||v.call(n,p);break;case"ready":a.value="ready",(k=n.onReady)==null||k.call(n);break;case"start":u.value=!0,(A=n.onStart)==null||A.call(n);break;case"update":c.value=p.tps,(E=n.onUpdate)==null||E.call(n,p.tps);break;case"complete":u.value=!1,f.value=p.output[0]||"",console.debug("Whisper result:",f.value),(C=n.onComplete)==null||C.call(n,p.output[0]);break}}),Ot(()=>{o()}),{transcribe:p=>r(p),status:a,loadingMessage:s,loadingProgress:l,transcribing:u,tps:c,result:f,load:()=>r({type:"load"}),terminate:o}}const Vg="/assets/worker-i3yLSyEt.js";async function Hg(t,e){const n=new ArrayBuffer(44+t.length*2),r=new DataView(n);Ln(r,0,"RIFF"),r.setUint32(4,36+t.length*2,!0),Ln(r,8,"WAVE"),Ln(r,12,"fmt "),r.setUint32(16,16,!0),r.setUint16(20,1,!0),r.setUint16(22,1,!0),r.setUint32(24,e,!0),r.setUint32(28,e*2,!0),r.setUint16(32,2,!0),r.setUint16(34,16,!0),Ln(r,36,"data"),r.setUint32(40,t.length*2,!0),$g(r,44,t);const i=new Blob([r],{type:"audio/wav"});return new Promise((o,a)=>{const s=new FileReader;s.onload=()=>{const l=s.result.split(",")[1];o(l)},s.onerror=a,s.readAsDataURL(i)})}function Ln(t,e,n){for(let r=0;r{jn().then(()=>{i.update(),o.value=i.height.value})}),u(async()=>{jn().then(()=>{i.update(),o.value=i.height.value})}),(c,f)=>{const p=ca("auto-animate");return Z(),re("div",Gg,[f[2]||(f[2]=O("div",{"flex-1":""},null,-1)),Et((Z(),re("div",{ref_key:"chatHistoryRef",ref:e,"h-full":"","w-full":"",flex:"~ col","overflow-scroll":""},[f[1]||(f[1]=O("div",{"flex-1":""},null,-1)),(Z(!0),re(ai,null,si(V(n),(d,y)=>(Z(),re("div",{key:y,"mb-2":""},[d.role==="error"?(Z(),re("div",Yg,[O("div",Kg,[O("div",qg,[O("div",Wg,[O("span",Xg,he(V(a)("stage.chat.message.character-name.core-system")),1)]),f[0]||(f[0]=O("div",{"i-solar:danger-triangle-bold-duotone":"","text-violet-500":""},null,-1))]),V(r)&&y===V(n).length-1?(Z(),re("div",Zg)):(Z(),re("div",{key:1,class:"markdown-content break-words text-violet-500",text:"base {if(!B||!B.trim())return;const D=o.getProviderConfig(a.value);await y(B,{chatProvider:o.getProviderInstance(a.value),model:s.value,providerConfig:D})}});async function I(){if(e.value.trim())try{const B=o.getProviderConfig(a.value);await y(e.value,{chatProvider:o.getProviderInstance(a.value),model:s.value,providerConfig:B})}catch(B){v.value.pop(),v.value.push({role:"error",content:B.message})}}const{destroy:b,start:g}=xs(d,{onSpeechStart:()=>{n.value=!0},onVADMisfire:()=>{n.value=!1},onSpeechEnd:B=>{n.value=!1,T(B)},auto:!1});function m(){P.value!=="loading"&&(C(),g())}async function T(B){await k.resume();const D=await Hg(B,k.sampleRate);E({type:"generate",data:{audio:D,language:"en"}})}async function S(B){const D=B.target,F=u.value.find(j=>j.deviceId===D.value);if(!F){f.value=void 0;return}f.value=F}return Be(p,async B=>{B==="false"&&(b(),h())}),Be(i,async B=>{B&&await c()}),x(async()=>{e.value=""}),(B,D)=>(Z(),re("div",cy,[O("fieldset",fy,[O("label",{class:st([r.value==="chat"?"bg-primary-100 dark:bg-primary-900":"bg-white dark:bg-primary-950",r.value==="chat"?"text-primary-500 dark:text-primary-500":"",{"transition-colors-none ":V(l)}]),flex:"~ row",checked:r.value==="chat","aria-checked":r.value==="chat",border:"solid l-2 t-2 b-2 primary-100 dark:primary-900",bg:"hover:primary-100 dark:hover:primary-900",text:"primary-300 hover:primary-500 dark:primary-300/50 dark:hover:primary-500",transition:"all duration-250 ease-in-out","cursor-pointer":"","items-center":"","gap-1":"","rounded-l-lg":"","px-2":""},[Et(O("input",{"onUpdate:modelValue":D[0]||(D[0]=F=>r.value=F),type:"radio",name:"tab",value:"chat",hidden:""},null,512),[[ir,r.value]]),D[5]||(D[5]=O("div",{"i-solar:dialog-2-bold-duotone":"",text:"2xl",transform:"translate-y--2"},null,-1)),O("div",py,[O("span",hy,he(V(A)("stage.chat.tabs.chat")),1)])],10,dy),O("label",{class:st([r.value==="custom"?"bg-primary-100 dark:bg-primary-900":"bg-white dark:bg-primary-950",r.value==="custom"?"text-primary-500 dark:text-primary-500":"",{"transition-colors-none ":V(l)}]),flex:"~ row",checked:r.value==="custom","aria-checked":r.value==="custom",border:"solid t-2 b-2 primary-100 dark:primary-900",bg:"hover:primary-100 dark:hover:primary-900",text:"primary-300 hover:primary-500 dark:primary-300/50 dark:hover:primary-500",transition:"all duration-250 ease-in-out","cursor-pointer":"","items-center":"","gap-1":"","px-2":""},[Et(O("input",{"onUpdate:modelValue":D[1]||(D[1]=F=>r.value=F),type:"radio",name:"tab",value:"custom",hidden:""},null,512),[[ir,r.value]]),D[6]||(D[6]=O("div",{"i-solar:star-fall-2-bold-duotone":"",text:"2xl",transform:"translate-y--2"},null,-1)),O("div",gy,[O("span",null,he(V(A)("stage.chat.tabs.custom")),1)])],10,my),O("label",{class:st([r.value==="clothes"?"bg-primary-100 dark:bg-primary-900":"bg-white dark:bg-primary-950",r.value==="clothes"?"text-primary-500 dark:text-primary-500":"",{"transition-colors-none ":V(l)}]),flex:"~ row",checked:r.value==="clothes","aria-checked":r.value==="clothes",border:"solid r-2 t-2 b-2 primary-100 dark:primary-900",bg:"hover:primary-100 dark:hover:primary-900",text:"primary-300 hover:primary-500 dark:primary-300/50 dark:hover:primary-500",transition:"all duration-250 ease-in-out","cursor-pointer":"","items-center":"","gap-1":"","rounded-r-lg":"","px-2":""},[Et(O("input",{"onUpdate:modelValue":D[2]||(D[2]=F=>r.value=F),type:"radio",name:"tab",value:"clothes",hidden:""},null,512),[[ir,r.value]]),D[7]||(D[7]=O("div",{"i-solar:magic-stick-3-bold-duotone":"",text:"2xl",transform:"translate-y--2"},null,-1)),O("div",xy,[O("span",null,he(V(A)("stage.chat.tabs.clothes")),1)])],10,yy)]),O("div",vy,[O("div",by,[ke(uy,{"h-full":"","flex-1":"","p-4":"",w:"full","max-h":"e.value=F),placeholder:V(A)("stage.message"),text:"primary-300 hover:primary-500 dark:primary-300/50 dark:hover:primary-500 placeholder:primary-300 placeholder:hover:primary-500 placeholder:dark:primary-300/50 placeholder:dark:hover:primary-500",bg:"primary-100 dark:primary-400/20","min-h":"[100px]","max-h":"[300px]","w-full":"","rounded-t-xl":"","p-4":"","font-medium":"","outline-none":"",transition:"all duration-250 ease-in-out placeholder:all placeholder:duration-250 placeholder:ease-in-out",class:st({"transition-colors-none placeholder:transition-colors-none":V(l)}),onSubmit:I},null,8,["modelValue","placeholder","class"])])])]),O("div",ky,[O("button",{bg:"complementary-100 hover:complementary-200 dark:complementary-800 dark:hover:complementary-700",transition:"all duration-250 ease-in-out",class:st({"transition-colors-none":V(l)}),text:"complementary-400","mb-6":"",flex:"","cursor-pointer":"","items-center":"","justify-center":"","gap-2":"","rounded-full":"","px-4":"","py-2":"",onClick:m},[ke(wl,{mode:"out-in"},{default:Ue(()=>[V(P)===null?(Z(),re("div",Ty,he(V(A)("stage.operations.load-models")),1)):V(P)==="loading"?(Z(),re("div",_y,[D[8]||(D[8]=O("div",{"i-svg-spinners:bouncing-ball":"",class:"text-cyan"},null,-1)),O("span",null,he(V(A)("stage.operations.load-models-status.loading")),1)])):V(P)==="ready"?(Z(),re("div",Ey,[D[9]||(D[9]=O("div",{"i-lucide:check":"",class:"text-cyan"},null,-1)),O("span",null,he(V(A)("stage.operations.load-models-status.ready")),1)])):it("",!0)]),_:1})],2),O("div",My,[ke(V(ui),null,{default:Ue(()=>[i.value?(Z(),re("fieldset",Ay,[(Z(!0),re(ai,null,si(V(u),(F,j)=>(Z(),re("label",{key:j,class:"[&_div_span]:dark:hover:bg-cyan-300 [&_div_span]:dark:hover:bg-cyan-900"},[O("input",{type:"radio",name:"audioInput",value:F.deviceId,hidden:"",onChange:S},null,40,Sy),O("div",Iy,[O("div",Ry,[F.deviceId===V(d)?(Z(),re("div",Cy)):it("",!0)]),O("span",{"inline-block":"",class:st([F.deviceId===V(d)?"cyan-400 dark:text-white":"cyan-400/50 dark:text-white/50"]),transition:"all duration-250 ease-in-out"},he(F.label),3)])]))),128))])):it("",!0)]),_:1}),O("label",{bg:"complementary-100 hover:complementary-200 dark:complementary-800 dark:hover:complementary-700",transition:"all duration-250 ease-in-out",class:st({"transition-colors-none":V(l)}),text:"complementary-400","h-fit":"",flex:"","cursor-pointer":"","items-center":"","justify-center":"","gap-2":"","rounded-full":"","px-4":"","py-2":""},[Et(O("input",{"onUpdate:modelValue":D[4]||(D[4]=F=>i.value=F),type:"checkbox",hidden:""},null,512),[[Qr,i.value]]),D[10]||(D[10]=O("div",{"i-solar:microphone-2-bold-duotone":""},null,-1)),O("div",null,[n.value?(Z(),re("span",Ly,"Listening...")):(Z(),re("span",Ny,he(V(A)("settings.microphone")),1))])],2)])])]))}}),Dy=qn(Py,[["__scopeId","data-v-ec42ae04"]]),Oy={py:"1",flex:"~ col",rounded:"lg","overflow-hidden":""},Fy={key:0,flex:"",mr:"12"},By={flex:"~ col",border:"4 solid primary-200/50 dark:primary-500/50",shadow:"md primary-200/50 dark:none","min-w-20":"","rounded-lg":"","px-2":"","py-1":"",h:"unset {jn().then(()=>{i.update(),o.value=i.height.value})}),l(async()=>{jn().then(()=>{i.update(),o.value=i.height.value})}),(u,c)=>{const f=ca("auto-animate");return Z(),re("div",Oy,[c[1]||(c[1]=O("div",{"flex-1":""},null,-1)),Et((Z(),re("div",{ref_key:"chatHistoryRef",ref:e,"h-full":"","w-full":"","max-h":"30vh",flex:"~ col","overflow-scroll":""},[c[0]||(c[0]=O("div",{"flex-1":""},null,-1)),(Z(!0),re(ai,null,si(V(r),(p,d)=>(Z(),re("div",{key:d,"mb-2":""},[p.role==="assistant"?(Z(),re("div",Fy,[O("div",By,[O("div",null,[O("span",zy,he(V(n)("stage.chat.message.character-name.airi")),1)]),p.content?(Z(),re("div",{key:0,class:"markdown-content",text:"base {n.value=!0},onVADMisfire:()=>{n.value=!1},onSpeechEnd:v=>{n.value=!1,x()},auto:!1});function x(v){alert("Transcription is not implemented yet")}return Be(a,async v=>{v==="false"&&d()}),c(async()=>{e.value=""}),pn(()=>{y()}),(v,k)=>(Z(),re("div",null,[O("div",qy,[ke(Ky,{absolute:"","left-0":"","top-0":"",transform:"translate-y-[-100%]","w-full":""}),O("div",Wy,[ke(V(da),{modelValue:e.value,"onUpdate:modelValue":k[0]||(k[0]=A=>e.value=A),placeholder:V(f)("stage.message"),border:"solid 2 primary-100 dark:primary-400/20",text:"primary-300 hover:primary-500 dark:primary-300/50 dark:hover:primary-500 placeholder:primary-300 placeholder:hover:primary-500 placeholder:dark:primary-300/50 placeholder:dark:hover:primary-500",bg:"primary-100 dark:primary-400/20","max-h":"[10lh]","min-h":"[1lh]","w-full":"","resize-none":"","overflow-y-scroll":"","rounded-xl":"","p-2":"","font-medium":"","outline-none":"",transition:"all duration-250 ease-in-out placeholder:all placeholder:duration-250 placeholder:ease-in-out",class:st({"transition-colors-none placeholder:transition-colors-none":V(l)}),onSubmit:p},null,8,["modelValue","placeholder","class"])])])]))}}),Zy={class:"relative"},Qy={absolute:"","left-0":"","right-0":"","top-0":"","w-full":"","overflow-hidden":""},Jy=Fe({__name:"AnimatedWave",props:{height:{default:40},amplitude:{default:14},waveLength:{default:250},fillColor:{default:"oklch(95% 0.10 var(--theme-colors-hue))"},direction:{default:"down"},movementDirection:{default:"left"},animationSpeed:{default:50}},setup(t){const e=t,n=W(e.height),r=W(e.amplitude),i=W(e.waveLength),o=W(e.fillColor),a=W(e.direction),s=W(e.movementDirection);function l(f,p,d,y,x){const v=[],A=Math.ceil(f/y)*y,E=1,C=x==="up"?d:p-d;v.push(`M 0 ${C}`);const P=Math.PI*2/y;for(let I=0;I<=A;I+=E){const b=d*Math.sin(P*I),g=x==="up"?C-b:C+b;v.push(`L ${I} ${g}`)}const h=x==="up"?p:0;return v.push(`L ${A} ${h}`),v.push(`L 0 ${h} Z`),v.join(" ")}const u=je(()=>n.value+r.value*2),c=je(()=>{const f=` - `;return`url(data:image/svg+xml;base64,${btoa(f)})`});return Be(()=>[e.height,e.amplitude,e.waveLength,e.fillColor,e.direction,e.movementDirection],()=>{n.value=e.height,r.value=e.amplitude,i.value=e.waveLength,o.value=e.fillColor,a.value=e.direction,s.value=e.movementDirection},{immediate:!0}),(f,p)=>(Z(),re("div",Xy,[gn(f.$slots,"default",{},void 0,!0),O("div",Zy,[O("div",{class:"wave",style:Lr({background:o.value,height:`${u.value}px`,maskImage:c.value,WebkitMaskImage:c.value,"--wave-translate":`${-i.value}px`,"--animation-duration":`${i.value/t.animationSpeed}s`,"animation-direction":s.value==="left"?"normal":"reverse"})},null,4)])]))}}),Jy=qn(Qy,[["__scopeId","data-v-d4cf94d8"]]),e0={relative:"",flex:"~ col","z-2":"","h-100dvh":"","w-100vw":"","of-hidden":""},t0={relative:"",flex:"~ 1 row gap-y-0 gap-x-2 (Z(),Xt(Og,null,{default:Ue(()=>[ke(Jy,{"fill-color":V(e)?"oklch(35% calc(var(--theme-colors-chroma) * 0.6) var(--theme-colors-hue))":"color-mix(in srgb, oklch(95% calc(var(--theme-colors-chroma-50) * 0.5) var(--theme-colors-hue)) 80%, oklch(100% 0 360))"},{default:Ue(()=>[O("div",e0,[O("div",null,[ke(zg,{class:"flex",p2:""})]),O("div",t0,[ke(V(Ng),{"flex-1":"","min-w":"1/2",paused:n.value},null,8,["paused"]),ke(Py,{class:"flex `;return`url(data:image/svg+xml;base64,${btoa(f)})`});return Be(()=>[e.height,e.amplitude,e.waveLength,e.fillColor,e.direction,e.movementDirection],()=>{n.value=e.height,r.value=e.amplitude,i.value=e.waveLength,o.value=e.fillColor,a.value=e.direction,s.value=e.movementDirection},{immediate:!0}),(f,p)=>(Z(),re("div",Zy,[gn(f.$slots,"default",{},void 0,!0),O("div",Qy,[O("div",{class:"wave",style:Lr({background:o.value,height:`${u.value}px`,maskImage:c.value,WebkitMaskImage:c.value,"--wave-translate":`${-i.value}px`,"--animation-duration":`${i.value/t.animationSpeed}s`,"animation-direction":s.value==="left"?"normal":"reverse"})},null,4)])]))}}),e0=qn(Jy,[["__scopeId","data-v-d4cf94d8"]]),t0={relative:"",flex:"~ col","z-2":"","h-100dvh":"","w-100vw":"","of-hidden":""},n0={relative:"",flex:"~ 1 row gap-y-0 gap-x-2 (Z(),Xt(Fg,null,{default:Ue(()=>[ke(e0,{"fill-color":V(e)?"oklch(35% calc(var(--theme-colors-chroma) * 0.6) var(--theme-colors-hue))":"color-mix(in srgb, oklch(95% calc(var(--theme-colors-chroma-50) * 0.5) var(--theme-colors-hue)) 80%, oklch(100% 0 360))"},{default:Ue(()=>[O("div",t0,[O("div",null,[ke(Ug,{class:"flex",p2:""})]),O("div",n0,[ke(V(Lg),{"flex-1":"","min-w":"1/2",paused:n.value},null,8,["paused"]),ke(Dy,{class:"flex {const e=s[0];if(e)try{const o=await e.text(),i=JSON.parse(o);_.value=j(i),f.value=!0}catch(o){console.error("Error processing card file:",o)}});const S=C(()=>Array.from(p.value.entries()).map(([s,e])=>({id:s,name:e.name,description:e.description}))),F=C(()=>{if(!v.value)return S.value;const s=v.value.toLowerCase();return S.value.filter(e=>e.name.toLowerCase().includes(s)||e.description&&e.description.toLowerCase().includes(s))}),A=C(()=>{const s=[...F.value];return x.value==="nameAsc"?s.sort((e,o)=>e.name.localeCompare(o.name)):x.value==="nameDesc"?s.sort((e,o)=>o.name.localeCompare(e.name)):x.value==="recent"?s.sort((e,o)=>o.id.localeCompare(e.id)):s}),b=c(!1),u=c(null);function L(){u.value&&(E(u.value),u.value=null,b.value=!1)}function O(s){u.value=s,b.value=!0}function q(s){_.value=s,f.value=!0}function I(s){D.value=s}function J(s){const e=p.value.get(s);return(e==null?void 0:e.version)||"1.0.0"}function $(s,e){var t,g,z,N;const o=p.value.get(s);if(!o||!((g=(t=o.extensions)==null?void 0:t.airi)!=null&&g.modules))return"default";const i=o.extensions.airi.modules;return e==="consciousness"?(z=i.consciousness)!=null&&z.model&&i.consciousness.model.split("-").pop()||"default":e==="voice"&&((N=i.speech)==null?void 0:N.voice_id)||"default"}return(s,e)=>{var i;const o=Q("motion");return d(),m(B,null,[a("div",re,[a("div",oe,[a("div",ne,[e[6]||(e[6]=a("div",{class:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3"},[a("div",{"i-solar:magnifer-line-duotone":"",class:"text-neutral-500 dark:text-neutral-400"})],-1)),w(a("input",{"onUpdate:modelValue":e[0]||(e[0]=t=>v.value=t),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:r(n)("settings.pages.card.search")},null,8,le),[[R,v.value]])]),a("div",ie,[a("div",de,l(r(n)("settings.pages.card.sort_by"))+": ",1),w(a("select",{"onUpdate:modelValue":e[1]||(e[1]=t=>x.value=t),class:"rounded-lg p-1.5 text-sm outline-none",border:"focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800",bg:"white dark:neutral-900"},[a("option",ue,l(r(n)("settings.pages.card.name_asc")),1),a("option",ce,l(r(n)("settings.pages.card.name_desc")),1),a("option",me,l(r(n)("settings.pages.card.recent")),1)],512),[[K,x.value]])])]),a("div",{class:P(["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))]":r(p).size>0}])},[h(r(ee),{modelValue:y.value,"onUpdate:modelValue":e[2]||(e[2]=t=>y.value=t),accept:"*.json"},{default:W(({isDragging:t})=>[t?(d(),m("div",xe,[e[8]||(e[8]=a("div",{"i-solar:upload-minimalistic-bold":"",class:"text-primary-500 dark:text-primary-400 mb-2 text-5xl"},null,-1)),a("p",ge,l(r(n)("settings.pages.card.drop_here")),1)])):(d(),m("div",pe,[e[7]||(e[7]=a("div",{"i-solar:upload-square-line-duotone":"","mb-4":"","text-5xl":"",text:"neutral-400 dark:neutral-500"},null,-1)),a("p",fe,l(r(n)("settings.pages.card.upload")),1),a("p",ve,l(r(n)("settings.pages.card.upload_desc")),1)]))]),_:1},8,["modelValue"]),r(p).size>0?(d(!0),m(B,{key:0},X(A.value,t=>(d(),Y(ae,{id:t.id,key:t.id,name:t.name,description:t.description,"is-active":t.id===r(D),"is-selected":t.id===_.value&&f.value,version:J(t.id),"consciousness-model":$(t.id,"consciousness"),"voice-model":$(t.id,"voice"),onSelect:g=>q(t.id),onActivate:g=>I(t.id),onDelete:g=>O(t.id)},null,8,["id","name","description","is-active","is-selected","version","consciousness-model","voice-model","onSelect","onActivate","onDelete"]))),128)):V("",!0),r(p).size===0?(d(),m("div",_e,[e[9]||(e[9]=a("div",{"i-solar:card-search-broken":"","mx-auto":"","mb-3":"","text-6xl":"","text-neutral-400":""},null,-1)),a("p",null,l(r(n)("settings.pages.card.no_cards")),1)])):V("",!0),v.value&&A.value.length===0?(d(),m("div",be,[e[10]||(e[10]=a("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1)),a("div",ke,[a("span",ye,l(r(n)("settings.pages.card.no_results")),1),a("span",Ce,l(r(n)("settings.pages.card.try_different_search")),1)])])):V("",!0)],2)]),h(se,{modelValue:b.value,"onUpdate:modelValue":e[3]||(e[3]=t=>b.value=t),"card-name":u.value?(i=r(k).getCard(u.value))==null?void 0:i.name:"",onConfirm:L,onCancel:e[4]||(e[4]=t=>u.value=null)},null,8,["modelValue","card-name"]),h(te,{modelValue:f.value,"onUpdate:modelValue":e[5]||(e[5]=t=>f.value=t),"card-id":_.value},null,8,["modelValue","card-id"]),w((d(),m("div",he,e[11]||(e[11]=[a("div",{text:"60","i-solar:emoji-funny-square-bold-duotone":""},null,-1)]))),[[o]])],64)}}});typeof U=="function"&&U(we);export{we as default}; diff --git a/assets/index-DZtNGEmw.js b/assets/index-DZtNGEmw.js new file mode 100644 index 0000000000000000000000000000000000000000..1df10980ec1280ba0c2f210f49cdb4bbf8057c21 --- /dev/null +++ b/assets/index-DZtNGEmw.js @@ -0,0 +1,5 @@ +import{Z as s,a as x}from"./mcp-D2taTyhO.js";import"./index-BNq7Hbz_.js";const M=Symbol("Let zodToJsonSchema decide on which parser to use"),P={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},D=t=>typeof t=="string"?{...P,name:t}:{...P,...t},T=t=>{const e=D(t),a=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return{...e,currentPath:a,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([n,r])=>[r._def,{def:r._def,path:[...e.basePath,e.definitionPath,n],jsonSchema:void 0}]))}};function _(t,e,a,n){n!=null&&n.errorMessages&&a&&(t.errorMessage={...t.errorMessage,[e]:a})}function l(t,e,a,n,r){t[e]=a,_(t,e,n,r)}function N(){return{}}function $(t,e){var n,r,i;const a={type:"array"};return(n=t.type)!=null&&n._def&&((i=(r=t.type)==null?void 0:r._def)==null?void 0:i.typeName)!==s.ZodAny&&(a.items=c(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&l(a,"minItems",t.minLength.value,t.minLength.message,e),t.maxLength&&l(a,"maxItems",t.maxLength.value,t.maxLength.message,e),t.exactLength&&(l(a,"minItems",t.exactLength.value,t.exactLength.message,e),l(a,"maxItems",t.exactLength.value,t.exactLength.message,e)),a}function w(t,e){const a={type:"integer",format:"int64"};if(!t.checks)return a;for(const n of t.checks)switch(n.kind){case"min":e.target==="jsonSchema7"?n.inclusive?l(a,"minimum",n.value,n.message,e):l(a,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(a.exclusiveMinimum=!0),l(a,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?l(a,"maximum",n.value,n.message,e):l(a,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(a.exclusiveMaximum=!0),l(a,"maximum",n.value,n.message,e));break;case"multipleOf":l(a,"multipleOf",n.value,n.message,e);break}return a}function z(){return{type:"boolean"}}function Z(t,e){return c(t.type._def,e)}const L=(t,e)=>c(t.innerType._def,e);function S(t,e,a){const n=a??e.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((r,i)=>S(t,e,r))};switch(n){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return F(t,e)}}const F=(t,e)=>{const a={type:"integer",format:"unix-time"};if(e.target==="openApi3")return a;for(const n of t.checks)switch(n.kind){case"min":l(a,"minimum",n.value,n.message,e);break;case"max":l(a,"maximum",n.value,n.message,e);break}return a};function I(t,e){return{...c(t.innerType._def,e),default:t.defaultValue()}}function E(t,e){return e.effectStrategy==="input"?c(t.schema._def,e):{}}function R(t){return{type:"string",enum:Array.from(t.values)}}const C=t=>"type"in t&&t.type==="string"?!1:"allOf"in t;function U(t,e){const a=[c(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),c(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(i=>!!i);let n=e.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0;const r=[];return a.forEach(i=>{if(C(i))r.push(...i.allOf),i.unevaluatedProperties===void 0&&(n=void 0);else{let o=i;if("additionalProperties"in i&&i.additionalProperties===!1){const{additionalProperties:m,...p}=i;o=p}else n=void 0;r.push(o)}}),r.length?{allOf:r,...n}:void 0}function B(t,e){const a=typeof t.value;return a!=="bigint"&&a!=="number"&&a!=="boolean"&&a!=="string"?{type:Array.isArray(t.value)?"array":"object"}:e.target==="openApi3"?{type:a==="bigint"?"integer":a,enum:[t.value]}:{type:a==="bigint"?"integer":a,const:t.value}}let b;const f={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(b===void 0&&(b=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),b),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function O(t,e){const a={type:"string"};if(t.checks)for(const n of t.checks)switch(n.kind){case"min":l(a,"minLength",typeof a.minLength=="number"?Math.max(a.minLength,n.value):n.value,n.message,e);break;case"max":l(a,"maxLength",typeof a.maxLength=="number"?Math.min(a.maxLength,n.value):n.value,n.message,e);break;case"email":switch(e.emailStrategy){case"format:email":y(a,"email",n.message,e);break;case"format:idn-email":y(a,"idn-email",n.message,e);break;case"pattern:zod":d(a,f.email,n.message,e);break}break;case"url":y(a,"uri",n.message,e);break;case"uuid":y(a,"uuid",n.message,e);break;case"regex":d(a,n.regex,n.message,e);break;case"cuid":d(a,f.cuid,n.message,e);break;case"cuid2":d(a,f.cuid2,n.message,e);break;case"startsWith":d(a,RegExp(`^${v(n.value,e)}`),n.message,e);break;case"endsWith":d(a,RegExp(`${v(n.value,e)}$`),n.message,e);break;case"datetime":y(a,"date-time",n.message,e);break;case"date":y(a,"date",n.message,e);break;case"time":y(a,"time",n.message,e);break;case"duration":y(a,"duration",n.message,e);break;case"length":l(a,"minLength",typeof a.minLength=="number"?Math.max(a.minLength,n.value):n.value,n.message,e),l(a,"maxLength",typeof a.maxLength=="number"?Math.min(a.maxLength,n.value):n.value,n.message,e);break;case"includes":{d(a,RegExp(v(n.value,e)),n.message,e);break}case"ip":{n.version!=="v6"&&y(a,"ipv4",n.message,e),n.version!=="v4"&&y(a,"ipv6",n.message,e);break}case"base64url":d(a,f.base64url,n.message,e);break;case"jwt":d(a,f.jwt,n.message,e);break;case"cidr":{n.version!=="v6"&&d(a,f.ipv4Cidr,n.message,e),n.version!=="v4"&&d(a,f.ipv6Cidr,n.message,e);break}case"emoji":d(a,f.emoji(),n.message,e);break;case"ulid":{d(a,f.ulid,n.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{y(a,"binary",n.message,e);break}case"contentEncoding:base64":{l(a,"contentEncoding","base64",n.message,e);break}case"pattern:zod":{d(a,f.base64,n.message,e);break}}break}case"nanoid":d(a,f.nanoid,n.message,e)}return a}function v(t,e){return e.patternStrategy==="escape"?q(t):t}const V=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function q(t){let e="";for(let a=0;ai.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format,...t.errorMessage&&n.errorMessages&&{errorMessage:{format:t.errorMessage.format}}}),delete t.format,t.errorMessage&&(delete t.errorMessage.format,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.anyOf.push({format:e,...a&&n.errorMessages&&{errorMessage:{format:a}}})):l(t,"format",e,a,n)}function d(t,e,a,n){var r;t.pattern||(r=t.allOf)!=null&&r.some(i=>i.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern,...t.errorMessage&&n.errorMessages&&{errorMessage:{pattern:t.errorMessage.pattern}}}),delete t.pattern,t.errorMessage&&(delete t.errorMessage.pattern,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.allOf.push({pattern:k(e,n),...a&&n.errorMessages&&{errorMessage:{pattern:a}}})):l(t,"pattern",k(e,n),a,n)}function k(t,e){var p;if(!e.applyRegexFlags||!t.flags)return t.source;const a={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},n=a.i?t.source.toLowerCase():t.source;let r="",i=!1,o=!1,m=!1;for(let u=0;u({...u,[g]:c(t.valueType._def,{...e,currentPath:[...e.currentPath,"properties",g]})??{}}),{}),additionalProperties:e.rejectedAdditionalProperties};const a={type:"object",additionalProperties:c(t.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]})??e.allowedAdditionalProperties};if(e.target==="openApi3")return a;if(((r=t.keyType)==null?void 0:r._def.typeName)===s.ZodString&&((i=t.keyType._def.checks)!=null&&i.length)){const{type:u,...g}=O(t.keyType._def,e);return{...a,propertyNames:g}}else{if(((o=t.keyType)==null?void 0:o._def.typeName)===s.ZodEnum)return{...a,propertyNames:{enum:t.keyType._def.values}};if(((m=t.keyType)==null?void 0:m._def.typeName)===s.ZodBranded&&t.keyType._def.type._def.typeName===s.ZodString&&((p=t.keyType._def.type._def.checks)!=null&&p.length)){const{type:u,...g}=Z(t.keyType._def,e);return{...a,propertyNames:g}}}return a}function K(t,e){if(e.mapStrategy==="record")return j(t,e);const a=c(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||{},n=c(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||{};return{type:"array",maxItems:125,items:{type:"array",items:[a,n],minItems:2,maxItems:2}}}function J(t){const e=t.values,n=Object.keys(t.values).filter(i=>typeof e[e[i]]!="number").map(i=>e[i]),r=Array.from(new Set(n.map(i=>typeof i)));return{type:r.length===1?r[0]==="string"?"string":"number":["string","number"],enum:n}}function W(){return{not:{}}}function G(t){return t.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}const h={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function H(t,e){if(e.target==="openApi3")return A(t,e);const a=t.options instanceof Map?Array.from(t.options.values()):t.options;if(a.every(n=>n._def.typeName in h&&(!n._def.checks||!n._def.checks.length))){const n=a.reduce((r,i)=>{const o=h[i._def.typeName];return o&&!r.includes(o)?[...r,o]:r},[]);return{type:n.length>1?n:n[0]}}else if(a.every(n=>n._def.typeName==="ZodLiteral"&&!n.description)){const n=a.reduce((r,i)=>{const o=typeof i._def.value;switch(o){case"string":case"number":case"boolean":return[...r,o];case"bigint":return[...r,"integer"];case"object":if(i._def.value===null)return[...r,"null"];case"symbol":case"undefined":case"function":default:return r}},[]);if(n.length===a.length){const r=n.filter((i,o,m)=>m.indexOf(i)===o);return{type:r.length>1?r:r[0],enum:a.reduce((i,o)=>i.includes(o._def.value)?i:[...i,o._def.value],[])}}}else if(a.every(n=>n._def.typeName==="ZodEnum"))return{type:"string",enum:a.reduce((n,r)=>[...n,...r._def.values.filter(i=>!n.includes(i))],[])};return A(t,e)}const A=(t,e)=>{const a=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((n,r)=>c(n._def,{...e,currentPath:[...e.currentPath,"anyOf",`${r}`]})).filter(n=>!!n&&(!e.strictUnions||typeof n=="object"&&Object.keys(n).length>0));return a.length?{anyOf:a}:void 0};function Q(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return e.target==="openApi3"?{type:h[t.innerType._def.typeName],nullable:!0}:{type:[h[t.innerType._def.typeName],"null"]};if(e.target==="openApi3"){const n=c(t.innerType._def,{...e,currentPath:[...e.currentPath]});return n&&"$ref"in n?{allOf:[n],nullable:!0}:n&&{...n,nullable:!0}}const a=c(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return a&&{anyOf:[a,{type:"null"}]}}function X(t,e){const a={type:"number"};if(!t.checks)return a;for(const n of t.checks)switch(n.kind){case"int":a.type="integer",_(a,"type",n.message,e);break;case"min":e.target==="jsonSchema7"?n.inclusive?l(a,"minimum",n.value,n.message,e):l(a,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(a.exclusiveMinimum=!0),l(a,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?l(a,"maximum",n.value,n.message,e):l(a,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(a.exclusiveMaximum=!0),l(a,"maximum",n.value,n.message,e));break;case"multipleOf":l(a,"multipleOf",n.value,n.message,e);break}return a}function Y(t,e){const a=e.target==="openAi",n={type:"object",properties:{}},r=[],i=t.shape();for(const m in i){let p=i[m];if(p===void 0||p._def===void 0)continue;let u=te(p);u&&a&&(p instanceof x&&(p=p._def.innerType),p.isNullable()||(p=p.nullable()),u=!1);const g=c(p._def,{...e,currentPath:[...e.currentPath,"properties",m],propertyPath:[...e.currentPath,"properties",m]});g!==void 0&&(n.properties[m]=g,u||r.push(m))}r.length&&(n.required=r);const o=ee(t,e);return o!==void 0&&(n.additionalProperties=o),n}function ee(t,e){if(t.catchall._def.typeName!=="ZodNever")return c(t.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]});switch(t.unknownKeys){case"passthrough":return e.allowedAdditionalProperties;case"strict":return e.rejectedAdditionalProperties;case"strip":return e.removeAdditionalStrategy==="strict"?e.allowedAdditionalProperties:e.rejectedAdditionalProperties}}function te(t){try{return t.isOptional()}catch{return!0}}const ne=(t,e)=>{var n;if(e.currentPath.toString()===((n=e.propertyPath)==null?void 0:n.toString()))return c(t.innerType._def,e);const a=c(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return a?{anyOf:[{not:{}},a]}:{}},ae=(t,e)=>{if(e.pipeStrategy==="input")return c(t.in._def,e);if(e.pipeStrategy==="output")return c(t.out._def,e);const a=c(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),n=c(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",a?"1":"0"]});return{allOf:[a,n].filter(r=>r!==void 0)}};function re(t,e){return c(t.type._def,e)}function ie(t,e){const n={type:"array",uniqueItems:!0,items:c(t.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return t.minSize&&l(n,"minItems",t.minSize.value,t.minSize.message,e),t.maxSize&&l(n,"maxItems",t.maxSize.value,t.maxSize.message,e),n}function se(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((a,n)=>c(a._def,{...e,currentPath:[...e.currentPath,"items",`${n}`]})).reduce((a,n)=>n===void 0?a:[...a,n],[]),additionalItems:c(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((a,n)=>c(a._def,{...e,currentPath:[...e.currentPath,"items",`${n}`]})).reduce((a,n)=>n===void 0?a:[...a,n],[])}}function oe(){return{not:{}}}function ue(){return{}}const ce=(t,e)=>c(t.innerType._def,e),le=(t,e,a)=>{switch(e){case s.ZodString:return O(t,a);case s.ZodNumber:return X(t,a);case s.ZodObject:return Y(t,a);case s.ZodBigInt:return w(t,a);case s.ZodBoolean:return z();case s.ZodDate:return S(t,a);case s.ZodUndefined:return oe();case s.ZodNull:return G(a);case s.ZodArray:return $(t,a);case s.ZodUnion:case s.ZodDiscriminatedUnion:return H(t,a);case s.ZodIntersection:return U(t,a);case s.ZodTuple:return se(t,a);case s.ZodRecord:return j(t,a);case s.ZodLiteral:return B(t,a);case s.ZodEnum:return R(t);case s.ZodNativeEnum:return J(t);case s.ZodNullable:return Q(t,a);case s.ZodOptional:return ne(t,a);case s.ZodMap:return K(t,a);case s.ZodSet:return ie(t,a);case s.ZodLazy:return()=>t.getter()._def;case s.ZodPromise:return re(t,a);case s.ZodNaN:case s.ZodNever:return W();case s.ZodEffects:return E(t,a);case s.ZodAny:return N();case s.ZodUnknown:return ue();case s.ZodDefault:return I(t,a);case s.ZodBranded:return Z(t,a);case s.ZodReadonly:return ce(t,a);case s.ZodCatch:return L(t,a);case s.ZodPipeline:return ae(t,a);case s.ZodFunction:case s.ZodVoid:case s.ZodSymbol:return;default:return(n=>{})()}};function c(t,e,a=!1){var m;const n=e.seen.get(t);if(e.override){const p=(m=e.override)==null?void 0:m.call(e,t,e,n,a);if(p!==M)return p}if(n&&!a){const p=pe(n,e);if(p!==void 0)return p}const r={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,r);const i=le(t,t.typeName,e),o=typeof i=="function"?c(i(),e):i;if(o&&de(t,e,o),e.postProcess){const p=e.postProcess(o,t,e);return r.jsonSchema=o,p}return r.jsonSchema=o,o}const pe=(t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:me(e.currentPath,t.path)};case"none":case"seen":return t.path.lengthe.currentPath[n]===a)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),{}):e.$refStrategy==="seen"?{}:void 0}},me=(t,e)=>{let a=0;for(;a(t.description&&(a.description=t.description,e.markdownDescription&&(a.markdownDescription=t.description)),a),ye=(t,e)=>{const a=T(e),n=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((p,[u,g])=>({...p,[u]:c(g._def,{...a,currentPath:[...a.basePath,a.definitionPath,u]},!0)??{}}),{}):void 0,r=typeof e=="string"?e:(e==null?void 0:e.nameStrategy)==="title"||e==null?void 0:e.name,i=c(t._def,r===void 0?a:{...a,currentPath:[...a.basePath,a.definitionPath,r]},!1)??{},o=typeof e=="object"&&e.name!==void 0&&e.nameStrategy==="title"?e.name:void 0;o!==void 0&&(i.title=o);const m=r===void 0?n?{...i,[a.definitionPath]:n}:i:{$ref:[...a.$refStrategy==="relative"?[]:a.basePath,a.definitionPath,r].join("/"),[a.definitionPath]:{...n,[r]:i}};return a.target==="jsonSchema7"?m.$schema="http://json-schema.org/draft-07/schema#":(a.target==="jsonSchema2019-09"||a.target==="openAi")&&(m.$schema="https://json-schema.org/draft/2019-09/schema#"),a.target==="openAi"&&("anyOf"in m||"oneOf"in m||"allOf"in m||"type"in m&&Array.isArray(m.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),m};export{_ as addErrorMessage,ye as default,P as defaultOptions,D as getDefaultOptions,T as getRefs,M as ignoreOverride,N as parseAnyDef,$ as parseArrayDef,w as parseBigintDef,z as parseBooleanDef,Z as parseBrandedDef,L as parseCatchDef,S as parseDateDef,c as parseDef,I as parseDefaultDef,E as parseEffectsDef,R as parseEnumDef,U as parseIntersectionDef,B as parseLiteralDef,K as parseMapDef,J as parseNativeEnumDef,W as parseNeverDef,G as parseNullDef,Q as parseNullableDef,X as parseNumberDef,Y as parseObjectDef,ne as parseOptionalDef,ae as parsePipelineDef,re as parsePromiseDef,ce as parseReadonlyDef,j as parseRecordDef,ie as parseSetDef,O as parseStringDef,se as parseTupleDef,oe as parseUndefinedDef,H as parseUnionDef,ue as parseUnknownDef,h as primitiveMappings,le as selectParser,l as setResponseValueAndErrors,f as zodPatterns,ye as zodToJsonSchema}; diff --git a/assets/index-DdibLJzw.js b/assets/index-DdibLJzw.js new file mode 100644 index 0000000000000000000000000000000000000000..ae7cace2c2e07c9af02bf6a448fbbdfa5dcf954b --- /dev/null +++ b/assets/index-DdibLJzw.js @@ -0,0 +1 @@ +import{_ as Z}from"./IconAnimation.vue_vue_type_script_setup_true_lang-D-TDNw-F.js";import{l as K,J as P}from"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-B6whjTNv.js";import{_ as G,a as W}from"./Model.vue_vue_type_script_setup_true_lang-DPC1qTx5.js";import{d as E,G as D,c as f,o as s,b as t,f as q,g as H,aI as Q,s as X,r as F,v as Y,aJ as ee,i as l,A,j as te,w as c,e as u,x as S,y as oe,k as b,t as $,F as U,l as R,O as ne,_ as ie,aK as ae,K as le}from"./index-BNq7Hbz_.js";/* empty css */import"./mcp-D2taTyhO.js";import{a as V,b as se}from"./mini_xsschema-P_8cZcRg.js";import"./three-vrm-animation.module-BPuMi1if.js";import{V as re}from"./browser-CkchkNbv.js";import{_ as z,a as de}from"./ColorPalette.vue_vue_type_script_setup_true_lang-AiOxL6bj.js";import{u as ce}from"./useIconAnimation-CpaNr068.js";import{b as B}from"./route-block-B_A1xBdJ.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-IiDV8qQX.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BlPB-gCV.js";import"./index-Df6I5b4c.js";const ue=["disabled"],h=E({__name:"Live2DModelControlButton",emits:["click"],setup(j){const m=D();return(r,n)=>(s(),f("button",{disabled:t(m).loadingLive2dModel,bg:"neutral-100 dark:neutral-800",hover:"bg-neutral-200 dark:bg-neutral-700",transition:"all ease-in-out duration-250",rounded:"",onClick:n[0]||(n[0]=p=>r.$emit("click"))},[q(r.$slots,"default")],8,ue))}}),me={flex:"~ col gap-4"},fe={flex:"","items-center":"","gap-2":""},pe=["disabled","placeholder"],ve={"font-medium":""},_e={flex:"","gap-2":""},ge=["onUpdate:modelValue"],be=["href","download"],he=E({__name:"Live2DSettings",props:{palette:null},emits:["extractColorsFromModel"],setup(j){const{t:m}=H(),r=Q({accept:"application/zip"}),n=D(),{live2dModelFile:p,live2dMotionMap:v,live2dLoadSource:y,loadingLive2dModel:k,availableLive2dMotions:L,live2dModelUrl:M}=X(n),_=F(M.value);r.onChange(o=>{o&&o.length>0&&(v.value={},p.value=o[0],y.value="file",k.value=!0)}),Y(()=>n.loadingLive2dModel,o=>{o||y.value==="file"&&L.value.forEach(e=>{e.motionName in V?v.value[e.fileName]=e.motionName:v.value[e.fileName]=se})});async function g(o,e){if(!Object.keys(e).length)return o;const a=await new P().loadAsync(o),d=Object.keys(a.files).find(N=>N.endsWith("model3.json"));if(!d)throw new Error("model3.json not found");const J=await a.file(d).async("string"),I=JSON.parse(J),C={};Object.entries(e).forEach(([N,O])=>{if(C[O]){C[O].push({File:N});return}C[O]=[{File:N}]}),I.FileReferences.Motions=C,a.file(d,JSON.stringify(I,null,2));const T=await a.generateAsync({type:"blob"});return new File([T],o.name,{type:o.type,lastModified:o.lastModified})}async function w(){const o=await K.getItem("live2dModel");if(!o)return;const e=await g(o,v.value);p.value=e,y.value="file",k.value=!0}const x=ee(p);return(o,e)=>(s(),f("div",me,[l(t(z),{title:"settings.live2d.change-model.title",icon:"i-solar:magic-stick-3-bold-duotone","inner-class":"text-sm"},{default:c(()=>[u("div",fe,[S(u("input",{"onUpdate:modelValue":e[0]||(e[0]=i=>_.value=i),disabled:t(n).loadingLive2dModel,class:"form-control flex-1",border:"neutral-300 dark:neutral-800 solid 1 focus:neutral-400 dark:focus:neutral-600",transition:"border duration-250 ease-in-out",placeholder:t(m)("settings.live2d.change-model.from-url-placeholder")},null,8,pe),[[oe,_.value]]),l(h,{class:"form-control",onClick:e[1]||(e[1]=i=>M.value=_.value)},{default:c(()=>[b($(t(m)("settings.live2d.change-model.from-url")),1)]),_:1})]),l(h,{class:"form-control place-self-end",onClick:e[2]||(e[2]=i=>t(r).open())},{default:c(()=>[b($(t(m)("settings.live2d.change-model.from-file"))+"... ",1)]),_:1}),l(h,{class:"form-control",onClick:e[3]||(e[3]=i=>o.$emit("extractColorsFromModel"))},{default:c(()=>e[4]||(e[4]=[b(" Extract colors from model ")])),_:1}),l(de,{colors:j.palette.map(i=>({hex:i,name:i}))},null,8,["colors"])]),_:1}),t(n).live2dLoadSource==="file"?(s(),A(t(z),{key:0,title:"settings.live2d.edit-motion-map.title",icon:"i-solar:face-scan-circle-bold-duotone"},{default:c(()=>{var i;return[(s(!0),f(U,null,R(t(n).availableLive2dMotions,a=>(s(),f("div",{key:a.fileName,flex:"","items-center":"","justify-between":"","text-sm":""},[u("span",ve,$(a.fileName),1),u("div",_e,[S(u("select",{"onUpdate:modelValue":d=>t(n).live2dMotionMap[a.fileName]=d},[(s(!0),f(U,null,R(Object.keys(t(V)),d=>(s(),f("option",{key:d},$(d),1))),128))],8,ge),[[ne,t(n).live2dMotionMap[a.fileName]]]),l(h,{class:"form-control",onClick:d=>t(n).live2dCurrentMotion={group:a.motionName,index:a.motionIndex}},{default:c(()=>e[5]||(e[5]=[b(" Play ")])),_:2},1032,["onClick"])])]))),128)),l(h,{onClick:w},{default:c(()=>e[6]||(e[6]=[b(" Save and patch ")])),_:1}),u("a",{"mt-2":"",block:"",href:t(x),download:`${((i=t(n).live2dModelFile)==null?void 0:i.name)||"live2d"}-motion-edited.zip`},[l(h,{"w-full":""},{default:c(()=>e[7]||(e[7]=[b("Export")])),_:1})],8,be)]}),_:1})):te("",!0)]))}}),ye=ie(he,[["__scopeId","data-v-b2e16668"]]),xe={flex:""},ke={key:1,text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[calc(100dvh-15rem)]","bottom-0":"","right--5":"","z--1":"",initial:{scale:.9,opacity:0,y:15},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":"",flex:"","items-center":"","justify-center":""},Me=E({__name:"index",setup(j){const m=F(),r=F(),{width:n,height:p}=ae(m),v=F([]);async function y(){if(!r.value)return;const _=await r.value.captureFrame();if(!_){console.error("No frame captured");return}const g=URL.createObjectURL(_);try{const x=await new re(g).getPalette();v.value=Object.values(x).map(o=>o==null?void 0:o.hex).filter(o=>typeof o=="string")}finally{URL.revokeObjectURL(g)}}const{iconAnimationStarted:k,showIconAnimation:L,animationIcon:M}=ce("i-solar:people-nearby-bold-duotone");return(_,g)=>{const w=Z,x=le("motion");return s(),f(U,null,[u("div",xe,[u("div",{ref_key:"live2dContainerRef",ref:m,w:"50%",h:"80vh"},[l(t(W),{ref_key:"live2dCanvasRef",ref:r,width:t(n),height:t(p)},{default:c(({app:o})=>[l(t(G),{app:o,"mouth-open-size":0,width:t(n),height:t(p),paused:!1},null,8,["app","width","height"])]),_:1},8,["width","height"])],512),l(ye,{w:"50%",h:"80vh",palette:v.value,onExtractColorsFromModel:y},null,8,["palette"])]),t(L)?(s(),A(w,{key:0,"z-index":-1,icon:t(M),"icon-size":12,duration:1e3,started:t(k),"is-reverse":!0,position:"calc(100dvw - 9.5rem), calc(100dvh - 9.5rem)","text-color":"text-neutral-200/50 dark:text-neutral-600/20"},null,8,["icon","started"])):S((s(),f("div",ke,g[0]||(g[0]=[u("div",{text:"60","i-solar:people-nearby-bold-duotone":""},null,-1)]))),[[x]])],64)}}});typeof B=="function"&&B(Me);export{Me as default}; diff --git a/assets/index-Df6I5b4c.js b/assets/index-Df6I5b4c.js new file mode 100644 index 0000000000000000000000000000000000000000..3285d27c60c0bbd3f75728c7249add01e779512b --- /dev/null +++ b/assets/index-Df6I5b4c.js @@ -0,0 +1,3 @@ +import{h as O,r as E,aE as Mt,v as V,aL as Lt,aM as Ft,aN as xe,b as m,d as D,A as T,o as B,w as A,f as P,C as de,D as fe,E as F,Y as Qe,ax as ge,H as De,aO as lt,j as Nt,i as me,aP as yn,aQ as ye,aR as wn,aS as kt,aT as bn,aU as ke,aV as xn,aW as On,aC as Cn,I as It,F as An,aX as Wt,aY as En,aZ as Ht,a_ as xt,B as K,a$ as Dn,k as Pn,t as _n,c as jt,z as at,b0 as Vt,b1 as Bn,ay as zt,b2 as Tn,b3 as Rn,e as $n,b4 as Sn,b5 as Mn}from"./index-BNq7Hbz_.js";const Ln=["top","right","bottom","left"],se=Math.min,H=Math.max,Ie=Math.round,Me=Math.floor,G=e=>({x:e,y:e}),Fn={left:"right",right:"left",bottom:"top",top:"bottom"},Nn={start:"end",end:"start"};function Ze(e,t,n){return H(e,se(t,n))}function ee(e,t){return typeof e=="function"?e(t):e}function te(e){return e.split("-")[0]}function Pe(e){return e.split("-")[1]}function st(e){return e==="x"?"y":"x"}function ut(e){return e==="y"?"height":"width"}function ue(e){return["top","bottom"].includes(te(e))?"y":"x"}function ct(e){return st(ue(e))}function kn(e,t,n){n===void 0&&(n=!1);const o=Pe(e),i=ct(e),r=ut(i);let l=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(l=We(l)),[l,We(l)]}function In(e){const t=We(e);return[et(e),t,et(t)]}function et(e){return e.replace(/start|end/g,t=>Nn[t])}function Wn(e,t,n){const o=["left","right"],i=["right","left"],r=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:o:t?o:i;case"left":case"right":return t?r:l;default:return[]}}function Hn(e,t,n,o){const i=Pe(e);let r=Wn(te(e),n==="start",o);return i&&(r=r.map(l=>l+"-"+i),t&&(r=r.concat(r.map(et)))),r}function We(e){return e.replace(/left|right|bottom|top/g,t=>Fn[t])}function jn(e){return{top:0,right:0,bottom:0,left:0,...e}}function Kt(e){return typeof e!="number"?jn(e):{top:e,right:e,bottom:e,left:e}}function He(e){const{x:t,y:n,width:o,height:i}=e;return{width:o,height:i,top:n,left:t,right:t+o,bottom:n+i,x:t,y:n}}function Ot(e,t,n){let{reference:o,floating:i}=e;const r=ue(t),l=ct(t),a=ut(l),d=te(t),c=r==="y",s=o.x+o.width/2-i.width/2,u=o.y+o.height/2-i.height/2,p=o[a]/2-i[a]/2;let f;switch(d){case"top":f={x:s,y:o.y-i.height};break;case"bottom":f={x:s,y:o.y+o.height};break;case"right":f={x:o.x+o.width,y:u};break;case"left":f={x:o.x-i.width,y:u};break;default:f={x:o.x,y:o.y}}switch(Pe(t)){case"start":f[l]-=p*(n&&c?-1:1);break;case"end":f[l]+=p*(n&&c?-1:1);break}return f}const Vn=async(e,t,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:l}=n,a=r.filter(Boolean),d=await(l.isRTL==null?void 0:l.isRTL(t));let c=await l.getElementRects({reference:e,floating:t,strategy:i}),{x:s,y:u}=Ot(c,o,d),p=o,f={},v=0;for(let g=0;g({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:i,rects:r,platform:l,elements:a,middlewareData:d}=t,{element:c,padding:s=0}=ee(e,t)||{};if(c==null)return{};const u=Kt(s),p={x:n,y:o},f=ct(i),v=ut(f),g=await l.getDimensions(c),h=f==="y",y=h?"top":"left",b=h?"bottom":"right",w=h?"clientHeight":"clientWidth",C=r.reference[v]+r.reference[f]-p[f]-r.floating[v],x=p[f]-r.reference[f],S=await(l.getOffsetParent==null?void 0:l.getOffsetParent(c));let _=S?S[w]:0;(!_||!await(l.isElement==null?void 0:l.isElement(S)))&&(_=a.floating[w]||r.floating[v]);const M=C/2-x/2,N=_/2-g[v]/2-1,R=se(u[y],N),z=se(u[b],N),k=R,W=_-g[v]-z,L=_/2-g[v]/2+M,oe=Ze(k,L,W),I=!d.arrow&&Pe(i)!=null&&L!==oe&&r.reference[v]/2-(LL<=0)){var z,k;const L=(((z=r.flip)==null?void 0:z.index)||0)+1,oe=_[L];if(oe)return{data:{index:L,overflows:R},reset:{placement:oe}};let I=(k=R.filter(q=>q.overflows[0]<=0).sort((q,ie)=>q.overflows[1]-ie.overflows[1])[0])==null?void 0:k.placement;if(!I)switch(f){case"bestFit":{var W;const q=(W=R.filter(ie=>{if(S){const re=ue(ie.placement);return re===b||re==="y"}return!0}).map(ie=>[ie.placement,ie.overflows.filter(re=>re>0).reduce((re,gn)=>re+gn,0)]).sort((ie,re)=>ie[1]-re[1])[0])==null?void 0:W[0];q&&(I=q);break}case"initialPlacement":I=a;break}if(i!==I)return{reset:{placement:I}}}return{}}}};function Ct(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function At(e){return Ln.some(t=>e[t]>=0)}const Un=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...i}=ee(e,t);switch(o){case"referenceHidden":{const r=await _e(t,{...i,elementContext:"reference"}),l=Ct(r,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:At(l)}}}case"escaped":{const r=await _e(t,{...i,altBoundary:!0}),l=Ct(r,n.floating);return{data:{escapedOffsets:l,escaped:At(l)}}}default:return{}}}}};async function Yn(e,t){const{placement:n,platform:o,elements:i}=e,r=await(o.isRTL==null?void 0:o.isRTL(i.floating)),l=te(n),a=Pe(n),d=ue(n)==="y",c=["left","top"].includes(l)?-1:1,s=r&&d?-1:1,u=ee(t,e);let{mainAxis:p,crossAxis:f,alignmentAxis:v}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&typeof v=="number"&&(f=a==="end"?v*-1:v),d?{x:f*s,y:p*c}:{x:p*c,y:f*s}}const Xn=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:i,y:r,placement:l,middlewareData:a}=t,d=await Yn(t,e);return l===((n=a.offset)==null?void 0:n.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:i+d.x,y:r+d.y,data:{...d,placement:l}}}}},qn=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:i}=t,{mainAxis:r=!0,crossAxis:l=!1,limiter:a={fn:h=>{let{x:y,y:b}=h;return{x:y,y:b}}},...d}=ee(e,t),c={x:n,y:o},s=await _e(t,d),u=ue(te(i)),p=st(u);let f=c[p],v=c[u];if(r){const h=p==="y"?"top":"left",y=p==="y"?"bottom":"right",b=f+s[h],w=f-s[y];f=Ze(b,f,w)}if(l){const h=u==="y"?"top":"left",y=u==="y"?"bottom":"right",b=v+s[h],w=v-s[y];v=Ze(b,v,w)}const g=a.fn({...t,[p]:f,[u]:v});return{...g,data:{x:g.x-n,y:g.y-o,enabled:{[p]:r,[u]:l}}}}}},Gn=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:i,rects:r,middlewareData:l}=t,{offset:a=0,mainAxis:d=!0,crossAxis:c=!0}=ee(e,t),s={x:n,y:o},u=ue(i),p=st(u);let f=s[p],v=s[u];const g=ee(a,t),h=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(d){const w=p==="y"?"height":"width",C=r.reference[p]-r.floating[w]+h.mainAxis,x=r.reference[p]+r.reference[w]-h.mainAxis;fx&&(f=x)}if(c){var y,b;const w=p==="y"?"width":"height",C=["top","left"].includes(te(i)),x=r.reference[u]-r.floating[w]+(C&&((y=l.offset)==null?void 0:y[u])||0)+(C?0:h.crossAxis),S=r.reference[u]+r.reference[w]+(C?0:((b=l.offset)==null?void 0:b[u])||0)-(C?h.crossAxis:0);vS&&(v=S)}return{[p]:f,[u]:v}}}},Jn=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:i,rects:r,platform:l,elements:a}=t,{apply:d=()=>{},...c}=ee(e,t),s=await _e(t,c),u=te(i),p=Pe(i),f=ue(i)==="y",{width:v,height:g}=r.floating;let h,y;u==="top"||u==="bottom"?(h=u,y=p===(await(l.isRTL==null?void 0:l.isRTL(a.floating))?"start":"end")?"left":"right"):(y=u,h=p==="end"?"top":"bottom");const b=g-s.top-s.bottom,w=v-s.left-s.right,C=se(g-s[h],b),x=se(v-s[y],w),S=!t.middlewareData.shift;let _=C,M=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(M=w),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(_=b),S&&!p){const R=H(s.left,0),z=H(s.right,0),k=H(s.top,0),W=H(s.bottom,0);f?M=v-2*(R!==0||z!==0?R+z:H(s.left,s.right)):_=g-2*(k!==0||W!==0?k+W:H(s.top,s.bottom))}await d({...t,availableWidth:M,availableHeight:_});const N=await l.getDimensions(a.floating);return v!==N.width||g!==N.height?{reset:{rects:!0}}:{}}}};function Ve(){return typeof window<"u"}function we(e){return dt(e)?(e.nodeName||"").toLowerCase():"#document"}function j(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Q(e){var t;return(t=(dt(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function dt(e){return Ve()?e instanceof Node||e instanceof j(e).Node:!1}function U(e){return Ve()?e instanceof Element||e instanceof j(e).Element:!1}function J(e){return Ve()?e instanceof HTMLElement||e instanceof j(e).HTMLElement:!1}function Et(e){return!Ve()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof j(e).ShadowRoot}function Te(e){const{overflow:t,overflowX:n,overflowY:o,display:i}=Y(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!["inline","contents"].includes(i)}function Qn(e){return["table","td","th"].includes(we(e))}function ze(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function ft(e){const t=pt(),n=U(e)?Y(e):e;return["transform","translate","scale","rotate","perspective"].some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function Zn(e){let t=ce(e);for(;J(t)&&!Ee(t);){if(ft(t))return t;if(ze(t))return null;t=ce(t)}return null}function pt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ee(e){return["html","body","#document"].includes(we(e))}function Y(e){return j(e).getComputedStyle(e)}function Ke(e){return U(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ce(e){if(we(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Et(e)&&e.host||Q(e);return Et(t)?t.host:t}function Ut(e){const t=ce(e);return Ee(t)?e.ownerDocument?e.ownerDocument.body:e.body:J(t)&&Te(t)?t:Ut(t)}function Be(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Ut(e),r=i===((o=e.ownerDocument)==null?void 0:o.body),l=j(i);if(r){const a=tt(l);return t.concat(l,l.visualViewport||[],Te(i)?i:[],a&&n?Be(a):[])}return t.concat(i,Be(i,[],n))}function tt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Yt(e){const t=Y(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const i=J(e),r=i?e.offsetWidth:n,l=i?e.offsetHeight:o,a=Ie(n)!==r||Ie(o)!==l;return a&&(n=r,o=l),{width:n,height:o,$:a}}function vt(e){return U(e)?e:e.contextElement}function Ae(e){const t=vt(e);if(!J(t))return G(1);const n=t.getBoundingClientRect(),{width:o,height:i,$:r}=Yt(t);let l=(r?Ie(n.width):n.width)/o,a=(r?Ie(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!a||!Number.isFinite(a))&&(a=1),{x:l,y:a}}const eo=G(0);function Xt(e){const t=j(e);return!pt()||!t.visualViewport?eo:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function to(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==j(e)?!1:t}function he(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),r=vt(e);let l=G(1);t&&(o?U(o)&&(l=Ae(o)):l=Ae(e));const a=to(r,n,o)?Xt(r):G(0);let d=(i.left+a.x)/l.x,c=(i.top+a.y)/l.y,s=i.width/l.x,u=i.height/l.y;if(r){const p=j(r),f=o&&U(o)?j(o):o;let v=p,g=tt(v);for(;g&&o&&f!==v;){const h=Ae(g),y=g.getBoundingClientRect(),b=Y(g),w=y.left+(g.clientLeft+parseFloat(b.paddingLeft))*h.x,C=y.top+(g.clientTop+parseFloat(b.paddingTop))*h.y;d*=h.x,c*=h.y,s*=h.x,u*=h.y,d+=w,c+=C,v=j(g),g=tt(v)}}return He({width:s,height:u,x:d,y:c})}function mt(e,t){const n=Ke(e).scrollLeft;return t?t.left+n:he(Q(e)).left+n}function qt(e,t,n){n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=o.left+t.scrollLeft-(n?0:mt(e,o)),r=o.top+t.scrollTop;return{x:i,y:r}}function no(e){let{elements:t,rect:n,offsetParent:o,strategy:i}=e;const r=i==="fixed",l=Q(o),a=t?ze(t.floating):!1;if(o===l||a&&r)return n;let d={scrollLeft:0,scrollTop:0},c=G(1);const s=G(0),u=J(o);if((u||!u&&!r)&&((we(o)!=="body"||Te(l))&&(d=Ke(o)),J(o))){const f=he(o);c=Ae(o),s.x=f.x+o.clientLeft,s.y=f.y+o.clientTop}const p=l&&!u&&!r?qt(l,d,!0):G(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-d.scrollLeft*c.x+s.x+p.x,y:n.y*c.y-d.scrollTop*c.y+s.y+p.y}}function oo(e){return Array.from(e.getClientRects())}function io(e){const t=Q(e),n=Ke(e),o=e.ownerDocument.body,i=H(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),r=H(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let l=-n.scrollLeft+mt(e);const a=-n.scrollTop;return Y(o).direction==="rtl"&&(l+=H(t.clientWidth,o.clientWidth)-i),{width:i,height:r,x:l,y:a}}function ro(e,t){const n=j(e),o=Q(e),i=n.visualViewport;let r=o.clientWidth,l=o.clientHeight,a=0,d=0;if(i){r=i.width,l=i.height;const c=pt();(!c||c&&t==="fixed")&&(a=i.offsetLeft,d=i.offsetTop)}return{width:r,height:l,x:a,y:d}}function lo(e,t){const n=he(e,!0,t==="fixed"),o=n.top+e.clientTop,i=n.left+e.clientLeft,r=J(e)?Ae(e):G(1),l=e.clientWidth*r.x,a=e.clientHeight*r.y,d=i*r.x,c=o*r.y;return{width:l,height:a,x:d,y:c}}function Dt(e,t,n){let o;if(t==="viewport")o=ro(e,n);else if(t==="document")o=io(Q(e));else if(U(t))o=lo(t,n);else{const i=Xt(e);o={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return He(o)}function Gt(e,t){const n=ce(e);return n===t||!U(n)||Ee(n)?!1:Y(n).position==="fixed"||Gt(n,t)}function ao(e,t){const n=t.get(e);if(n)return n;let o=Be(e,[],!1).filter(a=>U(a)&&we(a)!=="body"),i=null;const r=Y(e).position==="fixed";let l=r?ce(e):e;for(;U(l)&&!Ee(l);){const a=Y(l),d=ft(l);!d&&a.position==="fixed"&&(i=null),(r?!d&&!i:!d&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Te(l)&&!d&&Gt(e,l))?o=o.filter(s=>s!==l):i=a,l=ce(l)}return t.set(e,o),o}function so(e){let{element:t,boundary:n,rootBoundary:o,strategy:i}=e;const l=[...n==="clippingAncestors"?ze(t)?[]:ao(t,this._c):[].concat(n),o],a=l[0],d=l.reduce((c,s)=>{const u=Dt(t,s,i);return c.top=H(u.top,c.top),c.right=se(u.right,c.right),c.bottom=se(u.bottom,c.bottom),c.left=H(u.left,c.left),c},Dt(t,a,i));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function uo(e){const{width:t,height:n}=Yt(e);return{width:t,height:n}}function co(e,t,n){const o=J(t),i=Q(t),r=n==="fixed",l=he(e,!0,r,t);let a={scrollLeft:0,scrollTop:0};const d=G(0);if(o||!o&&!r)if((we(t)!=="body"||Te(i))&&(a=Ke(t)),o){const p=he(t,!0,r,t);d.x=p.x+t.clientLeft,d.y=p.y+t.clientTop}else i&&(d.x=mt(i));const c=i&&!o&&!r?qt(i,a):G(0),s=l.left+a.scrollLeft-d.x-c.x,u=l.top+a.scrollTop-d.y-c.y;return{x:s,y:u,width:l.width,height:l.height}}function Ye(e){return Y(e).position==="static"}function Pt(e,t){if(!J(e)||Y(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Q(e)===n&&(n=n.ownerDocument.body),n}function Jt(e,t){const n=j(e);if(ze(e))return n;if(!J(e)){let i=ce(e);for(;i&&!Ee(i);){if(U(i)&&!Ye(i))return i;i=ce(i)}return n}let o=Pt(e,t);for(;o&&Qn(o)&&Ye(o);)o=Pt(o,t);return o&&Ee(o)&&Ye(o)&&!ft(o)?n:o||Zn(e)||n}const fo=async function(e){const t=this.getOffsetParent||Jt,n=this.getDimensions,o=await n(e.floating);return{reference:co(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function po(e){return Y(e).direction==="rtl"}const vo={convertOffsetParentRelativeRectToViewportRelativeRect:no,getDocumentElement:Q,getClippingRect:so,getOffsetParent:Jt,getElementRects:fo,getClientRects:oo,getDimensions:uo,getScale:Ae,isElement:U,isRTL:po};function Qt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function mo(e,t){let n=null,o;const i=Q(e);function r(){var a;clearTimeout(o),(a=n)==null||a.disconnect(),n=null}function l(a,d){a===void 0&&(a=!1),d===void 0&&(d=1),r();const c=e.getBoundingClientRect(),{left:s,top:u,width:p,height:f}=c;if(a||t(),!p||!f)return;const v=Me(u),g=Me(i.clientWidth-(s+p)),h=Me(i.clientHeight-(u+f)),y=Me(s),w={rootMargin:-v+"px "+-g+"px "+-h+"px "+-y+"px",threshold:H(0,se(1,d))||1};let C=!0;function x(S){const _=S[0].intersectionRatio;if(_!==d){if(!C)return l();_?l(!1,_):o=setTimeout(()=>{l(!1,1e-7)},1e3)}_===1&&!Qt(c,e.getBoundingClientRect())&&l(),C=!1}try{n=new IntersectionObserver(x,{...w,root:i.ownerDocument})}catch{n=new IntersectionObserver(x,w)}n.observe(e)}return l(!0),r}function ho(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:d=!1}=o,c=vt(e),s=i||r?[...c?Be(c):[],...Be(t)]:[];s.forEach(y=>{i&&y.addEventListener("scroll",n,{passive:!0}),r&&y.addEventListener("resize",n)});const u=c&&a?mo(c,n):null;let p=-1,f=null;l&&(f=new ResizeObserver(y=>{let[b]=y;b&&b.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var w;(w=f)==null||w.observe(t)})),n()}),c&&!d&&f.observe(c),f.observe(t));let v,g=d?he(e):null;d&&h();function h(){const y=he(e);g&&!Qt(g,y)&&n(),g=y,v=requestAnimationFrame(h)}return n(),()=>{var y;s.forEach(b=>{i&&b.removeEventListener("scroll",n),r&&b.removeEventListener("resize",n)}),u==null||u(),(y=f)==null||y.disconnect(),f=null,d&&cancelAnimationFrame(v)}}const go=Xn,yo=qn,_t=Kn,wo=Jn,bo=Un,xo=zn,Oo=Gn,Co=(e,t,n)=>{const o=new Map,i={platform:vo,...n},r={...i.platform,_c:o};return Vn(e,t,{...i,platform:r})};function Ao(e){return e!=null&&typeof e=="object"&&"$el"in e}function nt(e){if(Ao(e)){const t=e.$el;return dt(t)&&we(t)==="#comment"?null:t}return e}function Ce(e){return typeof e=="function"?e():m(e)}function Eo(e){return{name:"arrow",options:e,fn(t){const n=nt(Ce(e.element));return n==null?{}:xo({element:n,padding:e.padding}).fn(t)}}}function Zt(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Bt(e,t){const n=Zt(e);return Math.round(t*n)/n}function Do(e,t,n){n===void 0&&(n={});const o=n.whileElementsMounted,i=O(()=>{var _;return(_=Ce(n.open))!=null?_:!0}),r=O(()=>Ce(n.middleware)),l=O(()=>{var _;return(_=Ce(n.placement))!=null?_:"bottom"}),a=O(()=>{var _;return(_=Ce(n.strategy))!=null?_:"absolute"}),d=O(()=>{var _;return(_=Ce(n.transform))!=null?_:!0}),c=O(()=>nt(e.value)),s=O(()=>nt(t.value)),u=E(0),p=E(0),f=E(a.value),v=E(l.value),g=Mt({}),h=E(!1),y=O(()=>{const _={position:f.value,left:"0",top:"0"};if(!s.value)return _;const M=Bt(s.value,u.value),N=Bt(s.value,p.value);return d.value?{..._,transform:"translate("+M+"px, "+N+"px)",...Zt(s.value)>=1.5&&{willChange:"transform"}}:{position:f.value,left:M+"px",top:N+"px"}});let b;function w(){if(c.value==null||s.value==null)return;const _=i.value;Co(c.value,s.value,{middleware:r.value,placement:l.value,strategy:a.value}).then(M=>{u.value=M.x,p.value=M.y,f.value=M.strategy,v.value=M.placement,g.value=M.middlewareData,h.value=_!==!1})}function C(){typeof b=="function"&&(b(),b=void 0)}function x(){if(C(),o===void 0){w();return}if(c.value!=null&&s.value!=null){b=o(c.value,s.value,w);return}}function S(){i.value||(h.value=!1)}return V([r,l,a,i],w,{flush:"sync"}),V([c,s],x,{flush:"sync"}),V(i,S,{flush:"sync"}),Lt()&&Ft(C),{x:xe(u),y:xe(p),strategy:xe(f),placement:xe(v),middlewareData:xe(g),isPositioned:xe(h),floatingStyles:y,update:w}}function be(e,t){const n=typeof e=="string"&&!t?`${e}Context`:t,o=Symbol(n);return[i=>{const r=bn(o,i);if(r||r===null)return r;throw new Error(`Injection \`${o.toString()}\` not found. Component must be used within ${Array.isArray(e)?`one of the following components: ${e.join(", ")}`:`\`${e}\``}`)},i=>(Mn(o,i),i)]}function en(e,t,n){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),o.dispatchEvent(i)}function Po(e,t){var n;const o=Mt();return K(()=>{o.value=e()},{...t,flush:(n=void 0)!=null?n:"sync"}),Ht(o)}function Re(e){return Lt()?(Ft(e),!0):!1}function _o(){const e=new Set,t=n=>{e.delete(n)};return{on:n=>{e.add(n);const o=()=>t(n);return Re(o),{off:o}},off:t,trigger:(...n)=>Promise.all(Array.from(e).map(o=>o(...n)))}}function Bo(e){let t=!1,n;const o=Vt(!0);return(...i)=>(t||(n=o.run(()=>e(...i)),t=!0),n)}function To(e){let t=0,n,o;const i=()=>{t-=1,o&&t<=0&&(o.stop(),n=void 0,o=void 0)};return(...r)=>(t+=1,n||(o=Vt(!0),n=o.run(()=>e(...r))),Re(i),n)}function ve(e){return typeof e=="function"?e():m(e)}const pe=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Ro=e=>typeof e<"u",$o=Object.prototype.toString,So=e=>$o.call(e)==="[object Object]",Mo=()=>{},Tt=Lo();function Lo(){var e,t;return pe&&((e=window==null?void 0:window.navigator)==null?void 0:e.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((t=window==null?void 0:window.navigator)==null?void 0:t.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function Fo(e){return ye()}function No(e,t=1e4){return Sn((n,o)=>{let i=ve(e),r;const l=()=>setTimeout(()=>{i=ve(e),o()},ve(t));return Re(()=>{clearTimeout(r)}),{get(){return n(),i},set(a){i=a,o(),clearTimeout(r),r=l()}}})}function ko(e,t){Fo()&&Bn(e,t)}function tn(e,t,n={}){const{immediate:o=!0}=n,i=E(!1);let r=null;function l(){r&&(clearTimeout(r),r=null)}function a(){i.value=!1,l()}function d(...c){l(),i.value=!0,r=setTimeout(()=>{i.value=!1,r=null,e(...c)},ve(t))}return o&&(i.value=!0,pe&&d()),Re(a),{isPending:Ht(i),start:d,stop:a}}function $e(e){var t;const n=ve(e);return(t=n==null?void 0:n.$el)!=null?t:n}const ht=pe?window:void 0;function je(...e){let t,n,o,i;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,o,i]=e,t=ht):[t,n,o,i]=e,!t)return Mo;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const r=[],l=()=>{r.forEach(s=>s()),r.length=0},a=(s,u,p,f)=>(s.addEventListener(u,p,f),()=>s.removeEventListener(u,p,f)),d=V(()=>[$e(t),ve(i)],([s,u])=>{if(l(),!s)return;const p=So(u)?{...u}:u;r.push(...n.flatMap(f=>o.map(v=>a(s,f,v,p))))},{immediate:!0,flush:"post"}),c=()=>{d(),l()};return Re(c),c}function Io(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function Wo(...e){let t,n,o={};e.length===3?(t=e[0],n=e[1],o=e[2]):e.length===2?typeof e[1]=="object"?(t=!0,n=e[0],o=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);const{target:i=ht,eventName:r="keydown",passive:l=!1,dedupe:a=!1}=o,d=Io(t);return je(i,r,c=>{c.repeat&&ve(a)||d(c)&&n(c)},l)}function Ho(){const e=E(!1),t=ye();return t&&De(()=>{e.value=!0},t),e}function jo(e){return JSON.parse(JSON.stringify(e))}function nn(e,t,n,o={}){var i,r,l;const{clone:a=!1,passive:d=!1,eventName:c,deep:s=!1,defaultValue:u,shouldEmit:p}=o,f=ye(),v=n||(f==null?void 0:f.emit)||((i=f==null?void 0:f.$emit)==null?void 0:i.bind(f))||((l=(r=f==null?void 0:f.proxy)==null?void 0:r.$emit)==null?void 0:l.bind(f==null?void 0:f.proxy));let g=c;g=g||`update:${t.toString()}`;const h=w=>a?typeof a=="function"?a(w):jo(w):w,y=()=>Ro(e[t])?h(e[t]):u,b=w=>{p?p(w)&&v(g,w):v(g,w)};if(d){const w=y(),C=E(w);let x=!1;return V(()=>e[t],S=>{x||(x=!0,C.value=h(S),ge(()=>x=!1))}),V(C,S=>{!x&&(S!==e[t]||s)&&b(S)},{deep:s}),C}else return O({get(){return y()},set(w){b(w)}})}function gt(e){return e?e.flatMap(t=>t.type===An?gt(t.children):[t]):[]}function ae(){let e=document.activeElement;if(e==null)return null;for(;e!=null&&e.shadowRoot!=null&&e.shadowRoot.activeElement!=null;)e=e.shadowRoot.activeElement;return e}function Xe(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)==="[object Module]":!0}function ot(e,t,n=".",o){if(!Xe(t))return ot(e,{},n);const i=Object.assign({},t);for(const r in e){if(r==="__proto__"||r==="constructor")continue;const l=e[r];l!=null&&(Array.isArray(l)&&Array.isArray(i[r])?i[r]=[...l,...i[r]]:Xe(l)&&Xe(i[r])?i[r]=ot(l,i[r],(n?`${n}.`:"")+r.toString()):i[r]=l)}return i}function Vo(e){return(...t)=>t.reduce((n,o)=>ot(n,o,""),{})}const zo=Vo(),[on,nr]=be("ConfigProvider");let Ko="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",Uo=(e=21)=>{let t="",n=e;for(;n--;)t+=Ko[Math.random()*64|0];return t};const Yo=To(()=>{const e=E(new Map),t=E(),n=O(()=>{for(const l of e.value.values())if(l)return!0;return!1}),o=on({scrollBody:E(!0)});let i=null;const r=()=>{document.body.style.paddingRight="",document.body.style.marginRight="",document.body.style.pointerEvents="",document.body.style.removeProperty("--scrollbar-width"),document.body.style.overflow=t.value??"",Tt&&(i==null||i()),t.value=void 0};return V(n,(l,a)=>{var d;if(!pe)return;if(!l){a&&r();return}t.value===void 0&&(t.value=document.body.style.overflow);const c=window.innerWidth-document.documentElement.clientWidth,s={padding:c,margin:0},u=(d=o.scrollBody)!=null&&d.value?typeof o.scrollBody.value=="object"?zo({padding:o.scrollBody.value.padding===!0?c:o.scrollBody.value.padding,margin:o.scrollBody.value.margin===!0?c:o.scrollBody.value.margin},s):s:{padding:0,margin:0};c>0&&(document.body.style.paddingRight=typeof u.padding=="number"?`${u.padding}px`:String(u.padding),document.body.style.marginRight=typeof u.margin=="number"?`${u.margin}px`:String(u.margin),document.body.style.setProperty("--scrollbar-width",`${c}px`),document.body.style.overflow="hidden"),Tt&&(i=je(document,"touchmove",p=>qo(p),{passive:!1})),ge(()=>{document.body.style.pointerEvents="none",document.body.style.overflow="hidden"})},{immediate:!0,flush:"sync"}),e});function Xo(e){const t=Uo(6),n=Yo();n.value.set(t,e);const o=O({get:()=>n.value.get(t)??!1,set:i=>n.value.set(t,i)});return ko(()=>{n.value.delete(t)}),o}function rn(e){const t=window.getComputedStyle(e);if(t.overflowX==="scroll"||t.overflowY==="scroll"||t.overflowX==="auto"&&e.clientWidth1?!0:(t.preventDefault&&t.cancelable&&t.preventDefault(),!1)}function Se(e){const t=ye(),n=t==null?void 0:t.type.emits,o={};return n!=null&&n.length||console.warn(`No emitted event found. Please check component: ${t==null?void 0:t.type.__name}`),n==null||n.forEach(i=>{o[wn(kt(i))]=(...r)=>e(i,...r)}),o}function ln(e){const t=ye(),n=Object.keys((t==null?void 0:t.type.props)??{}).reduce((i,r)=>{const l=(t==null?void 0:t.type.props[r]).default;return l!==void 0&&(i[r]=l),i},{}),o=Cn(e);return O(()=>{const i={},r=(t==null?void 0:t.vnode.props)??{};return Object.keys(r).forEach(l=>{i[kt(l)]=r[l]}),Object.keys({...n,...i}).reduce((l,a)=>(o.value[a]!==void 0&&(l[a]=o.value[a]),l),{})})}function an(e,t){const n=ln(e),o=t?Se(t):{};return O(()=>({...n.value,...o}))}function $(){const e=ye(),t=E(),n=O(()=>{var l,a;return["#text","#comment"].includes((l=t.value)==null?void 0:l.$el.nodeName)?(a=t.value)==null?void 0:a.$el.nextElementSibling:$e(t)}),o=Object.assign({},e.exposed),i={};for(const l in e.props)Object.defineProperty(i,l,{enumerable:!0,configurable:!0,get:()=>e.props[l]});if(Object.keys(o).length>0)for(const l in o)Object.defineProperty(i,l,{enumerable:!0,configurable:!0,get:()=>o[l]});Object.defineProperty(i,"$el",{enumerable:!0,configurable:!0,get:()=>e.vnode.el}),e.exposed=i;function r(l){t.value=l,l&&(Object.defineProperty(i,"$el",{enumerable:!0,configurable:!0,get:()=>l instanceof Element?l:l.$el}),e.exposed=i)}return{forwardRef:r,currentRef:t,currentElement:n}}function Go(e,t){const n=No(!1,300),o=E(null),i=_o();function r(){o.value=null,n.value=!1}function l(a,d){const c=a.currentTarget,s={x:a.clientX,y:a.clientY},u=Jo(s,c.getBoundingClientRect()),p=Qo(s,u),f=Zo(d.getBoundingClientRect()),v=ti([...p,...f]);o.value=v,n.value=!0}return K(a=>{if(e.value&&t.value){const d=s=>l(s,t.value),c=s=>l(s,e.value);e.value.addEventListener("pointerleave",d),t.value.addEventListener("pointerleave",c),a(()=>{var s,u;(s=e.value)==null||s.removeEventListener("pointerleave",d),(u=t.value)==null||u.removeEventListener("pointerleave",c)})}}),K(a=>{var d;if(o.value){const c=s=>{var u,p;if(!o.value)return;const f=s.target,v={x:s.clientX,y:s.clientY},g=((u=e.value)==null?void 0:u.contains(f))||((p=t.value)==null?void 0:p.contains(f)),h=!ei(v,o.value),y=!!f.closest("[data-grace-area-trigger]");g?r():(h||y)&&(r(),i.trigger())};(d=e.value)==null||d.ownerDocument.addEventListener("pointermove",c),a(()=>{var s;return(s=e.value)==null?void 0:s.ownerDocument.removeEventListener("pointermove",c)})}}),{isPointerInTransit:n,onPointerExit:i.on}}function Jo(e,t){const n=Math.abs(t.top-e.y),o=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),r=Math.abs(t.left-e.x);switch(Math.min(n,o,i,r)){case r:return"left";case i:return"right";case n:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function Qo(e,t,n=5){const o=[];switch(t){case"top":o.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":o.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":o.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":o.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return o}function Zo(e){const{top:t,right:n,bottom:o,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:o},{x:i,y:o}]}function ei(e,t){const{x:n,y:o}=e;let i=!1;for(let r=0,l=t.length-1;ro!=s>o&&n<(c-a)*(o-d)/(s-d)+a&&(i=!i)}return i}function ti(e){const t=e.slice();return t.sort((n,o)=>n.xo.x?1:n.yo.y?1:0),ni(t)}function ni(e){if(e.length<=1)return e.slice();const t=[];for(let o=0;o=2;){const r=t[t.length-1],l=t[t.length-2];if((r.x-l.x)*(i.y-l.y)>=(r.y-l.y)*(i.x-l.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let o=e.length-1;o>=0;o--){const i=e[o];for(;n.length>=2;){const r=n[n.length-1],l=n[n.length-2];if((r.x-l.x)*(i.y-l.y)>=(r.y-l.y)*(i.x-l.x))n.pop();else break}n.push(i)}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 oi=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Oe=new WeakMap,Le=new WeakMap,Fe={},qe=0,sn=function(e){return e&&(e.host||sn(e.parentNode))},ii=function(e,t){return t.map(function(n){if(e.contains(n))return n;var o=sn(n);return o&&e.contains(o)?o:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},ri=function(e,t,n,o){var i=ii(t,Array.isArray(e)?e:[e]);Fe[n]||(Fe[n]=new WeakMap);var r=Fe[n],l=[],a=new Set,d=new Set(i),c=function(u){!u||a.has(u)||(a.add(u),c(u.parentNode))};i.forEach(c);var s=function(u){!u||d.has(u)||Array.prototype.forEach.call(u.children,function(p){if(a.has(p))s(p);else try{var f=p.getAttribute(o),v=f!==null&&f!=="false",g=(Oe.get(p)||0)+1,h=(r.get(p)||0)+1;Oe.set(p,g),r.set(p,h),l.push(p),g===1&&v&&Le.set(p,!0),h===1&&p.setAttribute(n,"true"),v||p.setAttribute(o,"true")}catch(y){console.error("aria-hidden: cannot operate on ",p,y)}})};return s(t),a.clear(),qe++,function(){l.forEach(function(u){var p=Oe.get(u)-1,f=r.get(u)-1;Oe.set(u,p),r.set(u,f),p||(Le.has(u)||u.removeAttribute(o),Le.delete(u)),f||u.removeAttribute(n)}),qe--,qe||(Oe=new WeakMap,Oe=new WeakMap,Le=new WeakMap,Fe={})}},li=function(e,t,n){n===void 0&&(n="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),i=oi(e);return i?(o.push.apply(o,Array.from(i.querySelectorAll("[aria-live]"))),ri(o,i,n,"aria-hidden")):function(){return null}};function ai(e){let t;V(()=>$e(e),n=>{n?t=li(n):t&&t()}),It(()=>{t&&t()})}let si=0;function it(e,t="radix"){const n=on({useId:void 0});return xt?`${t}-${xt()}`:n.useId?`${t}-${n.useId()}`:`${t}-${++si}`}function ui(e){const t=E(),n=O(()=>{var i;return((i=t.value)==null?void 0:i.width)??0}),o=O(()=>{var i;return((i=t.value)==null?void 0:i.height)??0});return De(()=>{const i=$e(e);if(i){t.value={width:i.offsetWidth,height:i.offsetHeight};const r=new ResizeObserver(l=>{if(!Array.isArray(l)||!l.length)return;const a=l[0];let d,c;if("borderBoxSize"in a){const s=a.borderBoxSize,u=Array.isArray(s)?s[0]:s;d=u.inlineSize,c=u.blockSize}else d=i.offsetWidth,c=i.offsetHeight;t.value={width:d,height:c}});return r.observe(i,{box:"border-box"}),()=>r.unobserve(i)}else t.value=void 0}),{width:n,height:o}}function ci(e,t){const n=E(e);function o(i){return t[n.value][i]??n.value}return{state:n,dispatch:i=>{n.value=o(i)}}}const di=D({name:"PrimitiveSlot",inheritAttrs:!1,setup(e,{attrs:t,slots:n}){return()=>{var o,i;if(!n.default)return null;const r=gt(n.default()),l=r.findIndex(s=>s.type!==Wt);if(l===-1)return r;const a=r[l];(o=a.props)==null||delete o.ref;const d=a.props?F(t,a.props):t;t.class&&(i=a.props)!=null&&i.class&&delete a.props.class;const c=En(a,d);for(const s in d)s.startsWith("on")&&(c.props||(c.props={}),c.props[s]=d[s]);return r.length===1?c:(r[l]=c,r)}}}),X=D({name:"Primitive",inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:"div"}},setup(e,{attrs:t,slots:n}){const o=e.asChild?"template":e.as;return typeof o=="string"&&["area","img","input"].includes(o)?()=>ke(o,t):o!=="template"?()=>ke(e.as,t,{default:n.default}):()=>ke(di,t,{default:n.default})}});function fi(e,t){var n;const o=E({}),i=E("none"),r=E(e),l=e.value?"mounted":"unmounted";let a;const d=((n=t.value)==null?void 0:n.ownerDocument.defaultView)??ht,{state:c,dispatch:s}=ci(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}}),u=h=>{var y;if(pe){const b=new CustomEvent(h,{bubbles:!1,cancelable:!1});(y=t.value)==null||y.dispatchEvent(b)}};V(e,async(h,y)=>{var b;const w=y!==h;if(await ge(),w){const C=i.value,x=Ne(t.value);h?(s("MOUNT"),u("enter"),x==="none"&&u("after-enter")):x==="none"||((b=o.value)==null?void 0:b.display)==="none"?(s("UNMOUNT"),u("leave"),u("after-leave")):y&&C!==x?(s("ANIMATION_OUT"),u("leave")):(s("UNMOUNT"),u("after-leave"))}},{immediate:!0});const p=h=>{const y=Ne(t.value),b=y.includes(h.animationName),w=c.value==="mounted"?"enter":"leave";if(h.target===t.value&&b&&(u(`after-${w}`),s("ANIMATION_END"),!r.value)){const C=t.value.style.animationFillMode;t.value.style.animationFillMode="forwards",a=d==null?void 0:d.setTimeout(()=>{var x;((x=t.value)==null?void 0:x.style.animationFillMode)==="forwards"&&(t.value.style.animationFillMode=C)})}h.target===t.value&&y==="none"&&s("ANIMATION_END")},f=h=>{h.target===t.value&&(i.value=Ne(t.value))},v=V(t,(h,y)=>{h?(o.value=getComputedStyle(h),h.addEventListener("animationstart",f),h.addEventListener("animationcancel",p),h.addEventListener("animationend",p)):(s("ANIMATION_END"),a!==void 0&&(d==null||d.clearTimeout(a)),y==null||y.removeEventListener("animationstart",f),y==null||y.removeEventListener("animationcancel",p),y==null||y.removeEventListener("animationend",p))},{immediate:!0}),g=V(c,()=>{const h=Ne(t.value);i.value=c.value==="mounted"?h:"none"});return It(()=>{v(),g()}),{isPresent:O(()=>["mounted","unmountSuspended"].includes(c.value))}}function Ne(e){return e&&getComputedStyle(e).animationName||"none"}const yt=D({name:"Presence",props:{present:{type:Boolean,required:!0},forceMount:{type:Boolean}},slots:{},setup(e,{slots:t,expose:n}){var o;const{present:i,forceMount:r}=lt(e),l=E(),{isPresent:a}=fi(i,l);n({present:a});let d=t.default({present:a});d=gt(d||[]);const c=ye();if(d&&(d==null?void 0:d.length)>1){const s=(o=c==null?void 0:c.parent)!=null&&o.type.name?`<${c.parent.type.name} />`:"component";throw new Error([`Detected an invalid children for \`${s}\` for \`Presence\` component.`,"","Note: Presence works similarly to `v-if` directly, but it waits for animation/transition to finished before unmounting. So it expect only one direct child of valid VNode type.","You can apply a few solutions:",["Provide a single child element so that `presence` directive attach correctly.","Ensure the first child is an actual element instead of a raw text node or comment node."].map(u=>` - ${u}`).join(` +`)].join(` +`))}return()=>r.value||i.value||a.value?ke(t.default({present:a})[0],{ref:s=>{const u=$e(s);return typeof(u==null?void 0:u.hasAttribute)>"u"||(u!=null&&u.hasAttribute("data-radix-popper-content-wrapper")?l.value=u.firstElementChild:l.value=u),u}}):null}}),[ne,pi]=be("DialogRoot"),vi=D({inheritAttrs:!1,__name:"DialogRoot",props:{open:{type:Boolean,default:void 0},defaultOpen:{type:Boolean,default:!1},modal:{type:Boolean,default:!0}},emits:["update:open"],setup(e,{emit:t}){const n=e,o=nn(n,"open",t,{defaultValue:n.defaultOpen,passive:n.open===void 0}),i=E(),r=E(),{modal:l}=lt(n);return pi({open:o,modal:l,openModal:()=>{o.value=!0},onOpenChange:a=>{o.value=a},onOpenToggle:()=>{o.value=!o.value},contentId:"",titleId:"",descriptionId:"",triggerElement:i,contentElement:r}),(a,d)=>P(a.$slots,"default",{open:m(o)})}}),wt=D({__name:"Teleport",props:{to:{default:"body"},disabled:{type:Boolean},forceMount:{type:Boolean}},setup(e){const t=Ho();return(n,o)=>m(t)||n.forceMount?(B(),T(yn,{key:0,to:n.to,disabled:n.disabled},[P(n.$slots,"default")],8,["to","disabled"])):Nt("",!0)}}),or=D({__name:"DialogPortal",props:{to:{},disabled:{type:Boolean},forceMount:{type:Boolean}},setup(e){const t=e;return(n,o)=>(B(),T(m(wt),de(fe(t)),{default:A(()=>[P(n.$slots,"default")]),_:3},16))}}),mi="dismissableLayer.pointerDownOutside",hi="dismissableLayer.focusOutside";function un(e,t){const n=t.closest("[data-dismissable-layer]"),o=e.dataset.dismissableLayer===""?e:e.querySelector("[data-dismissable-layer]"),i=Array.from(e.ownerDocument.querySelectorAll("[data-dismissable-layer]"));return!!(n&&o===n||i.indexOf(o){});return K(l=>{if(!pe)return;const a=async c=>{const s=c.target;if(t!=null&&t.value){if(un(t.value,s)){i.value=!1;return}if(c.target&&!i.value){let u=function(){en(mi,e,p)};const p={originalEvent:c};c.pointerType==="touch"?(o.removeEventListener("click",r.value),r.value=u,o.addEventListener("click",r.value,{once:!0})):u()}else o.removeEventListener("click",r.value);i.value=!1}},d=window.setTimeout(()=>{o.addEventListener("pointerdown",a)},0);l(()=>{window.clearTimeout(d),o.removeEventListener("pointerdown",a),o.removeEventListener("click",r.value)})}),{onPointerDownCapture:()=>i.value=!0}}function yi(e,t){var n;const o=((n=t==null?void 0:t.value)==null?void 0:n.ownerDocument)??(globalThis==null?void 0:globalThis.document),i=E(!1);return K(r=>{if(!pe)return;const l=async a=>{t!=null&&t.value&&(await ge(),!(!t.value||un(t.value,a.target))&&a.target&&!i.value&&en(hi,e,{originalEvent:a}))};o.addEventListener("focusin",l),r(()=>o.removeEventListener("focusin",l))}),{onFocusCapture:()=>i.value=!0,onBlurCapture:()=>i.value=!1}}const Z=zt({layersRoot:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),cn=D({__name:"DismissableLayer",props:{disableOutsidePointerEvents:{type:Boolean,default:!1},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","dismiss"],setup(e,{emit:t}){const n=e,o=t,{forwardRef:i,currentElement:r}=$(),l=O(()=>{var v;return((v=r.value)==null?void 0:v.ownerDocument)??globalThis.document}),a=O(()=>Z.layersRoot),d=O(()=>r.value?Array.from(a.value).indexOf(r.value):-1),c=O(()=>Z.layersWithOutsidePointerEventsDisabled.size>0),s=O(()=>{const v=Array.from(a.value),[g]=[...Z.layersWithOutsidePointerEventsDisabled].slice(-1),h=v.indexOf(g);return d.value>=h}),u=gi(async v=>{const g=[...Z.branches].some(h=>h==null?void 0:h.contains(v.target));!s.value||g||(o("pointerDownOutside",v),o("interactOutside",v),await ge(),v.defaultPrevented||o("dismiss"))},r),p=yi(v=>{[...Z.branches].some(g=>g==null?void 0:g.contains(v.target))||(o("focusOutside",v),o("interactOutside",v),v.defaultPrevented||o("dismiss"))},r);Wo("Escape",v=>{d.value===a.value.size-1&&(o("escapeKeyDown",v),v.defaultPrevented||o("dismiss"))});let f;return K(v=>{r.value&&(n.disableOutsidePointerEvents&&(Z.layersWithOutsidePointerEventsDisabled.size===0&&(f=l.value.body.style.pointerEvents,l.value.body.style.pointerEvents="none"),Z.layersWithOutsidePointerEventsDisabled.add(r.value)),a.value.add(r.value),v(()=>{n.disableOutsidePointerEvents&&Z.layersWithOutsidePointerEventsDisabled.size===1&&(l.value.body.style.pointerEvents=f)}))}),K(v=>{v(()=>{r.value&&(a.value.delete(r.value),Z.layersWithOutsidePointerEventsDisabled.delete(r.value))})}),(v,g)=>(B(),T(m(X),{ref:m(i),"as-child":v.asChild,as:v.as,"data-dismissable-layer":"",style:at({pointerEvents:c.value?s.value?"auto":"none":void 0}),onFocusCapture:m(p).onFocusCapture,onBlurCapture:m(p).onBlurCapture,onPointerdownCapture:m(u).onPointerDownCapture},{default:A(()=>[P(v.$slots,"default")]),_:3},8,["as-child","as","style","onFocusCapture","onBlurCapture","onPointerdownCapture"]))}}),Ge="focusScope.autoFocusOnMount",Je="focusScope.autoFocusOnUnmount",Rt={bubbles:!1,cancelable:!0};function wi(e,{select:t=!1}={}){const n=ae();for(const o of e)if(le(o,{select:t}),ae()!==n)return!0}function bi(e){const t=dn(e),n=$t(t,e),o=$t(t.reverse(),e);return[n,o]}function dn(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const i=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||i?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function $t(e,t){for(const n of e)if(!xi(n,{upTo:t}))return n}function xi(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Oi(e){return e instanceof HTMLInputElement&&"select"in e}function le(e,{select:t=!1}={}){if(e&&e.focus){const n=ae();e.focus({preventScroll:!0}),e!==n&&Oi(e)&&t&&e.select()}}const Ci=Bo(()=>E([]));function Ai(){const e=Ci();return{add(t){const n=e.value[0];t!==n&&(n==null||n.pause()),e.value=St(e.value,t),e.value.unshift(t)},remove(t){var n;e.value=St(e.value,t),(n=e.value[0])==null||n.resume()}}}function St(e,t){const n=[...e],o=n.indexOf(t);return o!==-1&&n.splice(o,1),n}function Ei(e){return e.filter(t=>t.tagName!=="A")}const Di=D({__name:"FocusScope",props:{loop:{type:Boolean,default:!1},trapped:{type:Boolean,default:!1},asChild:{type:Boolean},as:{}},emits:["mountAutoFocus","unmountAutoFocus"],setup(e,{emit:t}){const n=e,o=t,{currentRef:i,currentElement:r}=$(),l=E(null),a=Ai(),d=zt({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}});K(s=>{if(!pe)return;const u=r.value;if(!n.trapped)return;function p(h){if(d.paused||!u)return;const y=h.target;u.contains(y)?l.value=y:le(l.value,{select:!0})}function f(h){if(d.paused||!u)return;const y=h.relatedTarget;y!==null&&(u.contains(y)||le(l.value,{select:!0}))}function v(h){u.contains(l.value)||le(u)}document.addEventListener("focusin",p),document.addEventListener("focusout",f);const g=new MutationObserver(v);u&&g.observe(u,{childList:!0,subtree:!0}),s(()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",f),g.disconnect()})}),K(async s=>{const u=r.value;if(await ge(),!u)return;a.add(d);const p=ae();if(!u.contains(p)){const f=new CustomEvent(Ge,Rt);u.addEventListener(Ge,v=>o("mountAutoFocus",v)),u.dispatchEvent(f),f.defaultPrevented||(wi(Ei(dn(u)),{select:!0}),ae()===p&&le(u))}s(()=>{u.removeEventListener(Ge,g=>o("mountAutoFocus",g));const f=new CustomEvent(Je,Rt),v=g=>{o("unmountAutoFocus",g)};u.addEventListener(Je,v),u.dispatchEvent(f),setTimeout(()=>{f.defaultPrevented||le(p??document.body,{select:!0}),u.removeEventListener(Je,v),a.remove(d)},0)})});function c(s){if(!n.loop&&!n.trapped||d.paused)return;const u=s.key==="Tab"&&!s.altKey&&!s.ctrlKey&&!s.metaKey,p=ae();if(u&&p){const f=s.currentTarget,[v,g]=bi(f);v&&g?!s.shiftKey&&p===g?(s.preventDefault(),n.loop&&le(v,{select:!0})):s.shiftKey&&p===v&&(s.preventDefault(),n.loop&&le(g,{select:!0})):p===f&&s.preventDefault()}}return(s,u)=>(B(),T(m(X),{ref_key:"currentRef",ref:i,tabindex:"-1","as-child":s.asChild,as:s.as,onKeydown:c},{default:A(()=>[P(s.$slots,"default")]),_:3},8,["as-child","as"]))}});function Pi(e){return e?"open":"closed"}const fn=D({__name:"DialogContentImpl",props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const n=e,o=t,i=ne(),{forwardRef:r,currentElement:l}=$();return i.titleId||(i.titleId=it(void 0,"radix-vue-dialog-title")),i.descriptionId||(i.descriptionId=it(void 0,"radix-vue-dialog-description")),De(()=>{i.contentElement=l,ae()!==document.body&&(i.triggerElement.value=ae())}),(a,d)=>(B(),T(m(Di),{"as-child":"",loop:"",trapped:n.trapFocus,onMountAutoFocus:d[5]||(d[5]=c=>o("openAutoFocus",c)),onUnmountAutoFocus:d[6]||(d[6]=c=>o("closeAutoFocus",c))},{default:A(()=>[me(m(cn),F({id:m(i).contentId,ref:m(r),as:a.as,"as-child":a.asChild,"disable-outside-pointer-events":a.disableOutsidePointerEvents,role:"dialog","aria-describedby":m(i).descriptionId,"aria-labelledby":m(i).titleId,"data-state":m(Pi)(m(i).open.value)},a.$attrs,{onDismiss:d[0]||(d[0]=c=>m(i).onOpenChange(!1)),onEscapeKeyDown:d[1]||(d[1]=c=>o("escapeKeyDown",c)),onFocusOutside:d[2]||(d[2]=c=>o("focusOutside",c)),onInteractOutside:d[3]||(d[3]=c=>o("interactOutside",c)),onPointerDownOutside:d[4]||(d[4]=c=>o("pointerDownOutside",c))}),{default:A(()=>[P(a.$slots,"default")]),_:3},16,["id","as","as-child","disable-outside-pointer-events","aria-describedby","aria-labelledby","data-state"])]),_:3},8,["trapped"]))}}),_i=D({__name:"DialogContentModal",props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const n=e,o=t,i=ne(),r=Se(o),{forwardRef:l,currentElement:a}=$();return ai(a),(d,c)=>(B(),T(fn,F({...n,...m(r)},{ref:m(l),"trap-focus":m(i).open.value,"disable-outside-pointer-events":!0,onCloseAutoFocus:c[0]||(c[0]=s=>{var u;s.defaultPrevented||(s.preventDefault(),(u=m(i).triggerElement.value)==null||u.focus())}),onPointerDownOutside:c[1]||(c[1]=s=>{const u=s.detail.originalEvent,p=u.button===0&&u.ctrlKey===!0;(u.button===2||p)&&s.preventDefault()}),onFocusOutside:c[2]||(c[2]=s=>{s.preventDefault()})}),{default:A(()=>[P(d.$slots,"default")]),_:3},16,["trap-focus"]))}}),Bi=D({__name:"DialogContentNonModal",props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const n=e,o=Se(t);$();const i=ne(),r=E(!1),l=E(!1);return(a,d)=>(B(),T(fn,F({...n,...m(o)},{"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:d[0]||(d[0]=c=>{var s;c.defaultPrevented||(r.value||(s=m(i).triggerElement.value)==null||s.focus(),c.preventDefault()),r.value=!1,l.value=!1}),onInteractOutside:d[1]||(d[1]=c=>{var s;c.defaultPrevented||(r.value=!0,c.detail.originalEvent.type==="pointerdown"&&(l.value=!0));const u=c.target;(s=m(i).triggerElement.value)!=null&&s.contains(u)&&c.preventDefault(),c.detail.originalEvent.type==="focusin"&&l.value&&c.preventDefault()})}),{default:A(()=>[P(a.$slots,"default")]),_:3},16))}}),Ti=D({__name:"DialogContent",props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const n=e,o=t,i=ne(),r=Se(o),{forwardRef:l}=$();return(a,d)=>(B(),T(m(yt),{present:a.forceMount||m(i).open.value},{default:A(()=>[m(i).modal.value?(B(),T(_i,F({key:0,ref:m(l)},{...n,...m(r),...a.$attrs}),{default:A(()=>[P(a.$slots,"default")]),_:3},16)):(B(),T(Bi,F({key:1,ref:m(l)},{...n,...m(r),...a.$attrs}),{default:A(()=>[P(a.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),Ri=D({__name:"DialogOverlayImpl",props:{asChild:{type:Boolean},as:{}},setup(e){const t=ne();return Xo(!0),$(),(n,o)=>(B(),T(m(X),{as:n.as,"as-child":n.asChild,"data-state":m(t).open.value?"open":"closed",style:{"pointer-events":"auto"}},{default:A(()=>[P(n.$slots,"default")]),_:3},8,["as","as-child","data-state"]))}}),$i=D({__name:"DialogOverlay",props:{forceMount:{type:Boolean},asChild:{type:Boolean},as:{}},setup(e){const t=ne(),{forwardRef:n}=$();return(o,i)=>{var r;return(r=m(t))!=null&&r.modal.value?(B(),T(m(yt),{key:0,present:o.forceMount||m(t).open.value},{default:A(()=>[me(Ri,F(o.$attrs,{ref:m(n),as:o.as,"as-child":o.asChild}),{default:A(()=>[P(o.$slots,"default")]),_:3},16,["as","as-child"])]),_:3},8,["present"])):Nt("",!0)}}}),pn=D({__name:"DialogClose",props:{asChild:{type:Boolean},as:{default:"button"}},setup(e){const t=e;$();const n=ne();return(o,i)=>(B(),T(m(X),F(t,{type:o.as==="button"?"button":void 0,onClick:i[0]||(i[0]=r=>m(n).onOpenChange(!1))}),{default:A(()=>[P(o.$slots,"default")]),_:3},16,["type"]))}}),Si=D({__name:"DialogTitle",props:{asChild:{type:Boolean},as:{default:"h2"}},setup(e){const t=e,n=ne();return $(),(o,i)=>(B(),T(m(X),F(t,{id:m(n).titleId}),{default:A(()=>[P(o.$slots,"default")]),_:3},16,["id"]))}}),Mi=D({__name:"DialogDescription",props:{asChild:{type:Boolean},as:{default:"p"}},setup(e){const t=e;$();const n=ne();return(o,i)=>(B(),T(m(X),F(t,{id:m(n).descriptionId}),{default:A(()=>[P(o.$slots,"default")]),_:3},16,["id"]))}}),ir=D({__name:"AlertDialogRoot",props:{open:{type:Boolean},defaultOpen:{type:Boolean}},emits:["update:open"],setup(e,{emit:t}){const n=an(e,t);return $(),(o,i)=>(B(),T(m(vi),F(m(n),{modal:!0}),{default:A(()=>[P(o.$slots,"default")]),_:3},16))}}),rr=D({__name:"AlertDialogPortal",props:{to:{},disabled:{type:Boolean},forceMount:{type:Boolean}},setup(e){const t=e;return(n,o)=>(B(),T(m(wt),de(fe(t)),{default:A(()=>[P(n.$slots,"default")]),_:3},16))}}),[Li,Fi]=be("AlertDialogContent"),lr=D({__name:"AlertDialogContent",props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const n=e,o=Se(t);$();const i=E();return Fi({onCancelElementChange:r=>{i.value=r}}),(r,l)=>(B(),T(m(Ti),F({...n,...m(o)},{role:"alertdialog",onPointerDownOutside:l[0]||(l[0]=Qe(()=>{},["prevent"])),onInteractOutside:l[1]||(l[1]=Qe(()=>{},["prevent"])),onOpenAutoFocus:l[2]||(l[2]=()=>{ge(()=>{var a;(a=i.value)==null||a.focus({preventScroll:!0})})})}),{default:A(()=>[P(r.$slots,"default")]),_:3},16))}}),ar=D({__name:"AlertDialogOverlay",props:{forceMount:{type:Boolean},asChild:{type:Boolean},as:{}},setup(e){const t=e;return $(),(n,o)=>(B(),T(m($i),de(fe(t)),{default:A(()=>[P(n.$slots,"default")]),_:3},16))}}),sr=D({__name:"AlertDialogCancel",props:{asChild:{type:Boolean},as:{default:"button"}},setup(e){const t=e,n=Li(),{forwardRef:o,currentElement:i}=$();return De(()=>{n.onCancelElementChange(i.value)}),(r,l)=>(B(),T(m(pn),F(t,{ref:m(o)}),{default:A(()=>[P(r.$slots,"default")]),_:3},16))}}),ur=D({__name:"AlertDialogTitle",props:{asChild:{type:Boolean},as:{default:"h2"}},setup(e){const t=e;return $(),(n,o)=>(B(),T(m(Si),de(fe(t)),{default:A(()=>[P(n.$slots,"default")]),_:3},16))}}),cr=D({__name:"AlertDialogDescription",props:{asChild:{type:Boolean},as:{default:"p"}},setup(e){const t=e;return $(),(n,o)=>(B(),T(m(Mi),de(fe(t)),{default:A(()=>[P(n.$slots,"default")]),_:3},16))}}),dr=D({__name:"AlertDialogAction",props:{asChild:{type:Boolean},as:{default:"button"}},setup(e){const t=e;return $(),(n,o)=>(B(),T(m(pn),de(fe(t)),{default:A(()=>[P(n.$slots,"default")]),_:3},16))}}),[vn,Ni]=be("PopperRoot"),ki=D({inheritAttrs:!1,__name:"PopperRoot",setup(e){const t=E();return Ni({anchor:t,onAnchorChange:n=>t.value=n}),(n,o)=>P(n.$slots,"default")}}),Ii=D({__name:"PopperAnchor",props:{element:{},asChild:{type:Boolean},as:{}},setup(e){const t=e,{forwardRef:n,currentElement:o}=$(),i=vn();return K(()=>{i.onAnchorChange(t.element??o.value)}),(r,l)=>(B(),T(m(X),{ref:m(n),as:r.as,"as-child":r.asChild},{default:A(()=>[P(r.$slots,"default")]),_:3},8,["as","as-child"]))}});function Wi(e){return e!==null}function Hi(e){return{name:"transformOrigin",options:e,fn(t){var n,o,i;const{placement:r,rects:l,middlewareData:a}=t,d=((n=a.arrow)==null?void 0:n.centerOffset)!==0,c=d?0:e.arrowWidth,s=d?0:e.arrowHeight,[u,p]=rt(r),f={start:"0%",center:"50%",end:"100%"}[p],v=(((o=a.arrow)==null?void 0:o.x)??0)+c/2,g=(((i=a.arrow)==null?void 0:i.y)??0)+s/2;let h="",y="";return u==="bottom"?(h=d?f:`${v}px`,y=`${-s}px`):u==="top"?(h=d?f:`${v}px`,y=`${l.floating.height+s}px`):u==="right"?(h=`${-s}px`,y=d?f:`${g}px`):u==="left"&&(h=`${l.floating.width+s}px`,y=d?f:`${g}px`),{data:{x:h,y}}}}}function rt(e){const[t,n="center"]=e.split("-");return[t,n]}const ji={side:"bottom",sideOffset:0,align:"center",alignOffset:0,arrowPadding:0,avoidCollisions:!0,collisionBoundary:()=>[],collisionPadding:0,sticky:"partial",hideWhenDetached:!1,updatePositionStrategy:"optimized",prioritizePosition:!1},[Vi,zi]=be("PopperContent"),Ki=D({inheritAttrs:!1,__name:"PopperContent",props:Tn({side:{},sideOffset:{},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},updatePositionStrategy:{},prioritizePosition:{type:Boolean},asChild:{type:Boolean},as:{}},{...ji}),emits:["placed"],setup(e,{emit:t}){const n=e,o=t,i=vn(),{forwardRef:r,currentElement:l}=$(),a=E(),d=E(),{width:c,height:s}=ui(d),u=O(()=>n.side+(n.align!=="center"?`-${n.align}`:"")),p=O(()=>typeof n.collisionPadding=="number"?n.collisionPadding:{top:0,right:0,bottom:0,left:0,...n.collisionPadding}),f=O(()=>Array.isArray(n.collisionBoundary)?n.collisionBoundary:[n.collisionBoundary]),v=O(()=>({padding:p.value,boundary:f.value.filter(Wi),altBoundary:f.value.length>0})),g=Po(()=>[go({mainAxis:n.sideOffset+s.value,alignmentAxis:n.alignOffset}),n.prioritizePosition&&n.avoidCollisions&&_t({...v.value}),n.avoidCollisions&&yo({mainAxis:!0,crossAxis:!!n.prioritizePosition,limiter:n.sticky==="partial"?Oo():void 0,...v.value}),!n.prioritizePosition&&n.avoidCollisions&&_t({...v.value}),wo({...v.value,apply:({elements:R,rects:z,availableWidth:k,availableHeight:W})=>{const{width:L,height:oe}=z.reference,I=R.floating.style;I.setProperty("--radix-popper-available-width",`${k}px`),I.setProperty("--radix-popper-available-height",`${W}px`),I.setProperty("--radix-popper-anchor-width",`${L}px`),I.setProperty("--radix-popper-anchor-height",`${oe}px`)}}),d.value&&Eo({element:d.value,padding:n.arrowPadding}),Hi({arrowWidth:c.value,arrowHeight:s.value}),n.hideWhenDetached&&bo({strategy:"referenceHidden",...v.value})]),{floatingStyles:h,placement:y,isPositioned:b,middlewareData:w}=Do(i.anchor,a,{strategy:"fixed",placement:u,whileElementsMounted:(...R)=>ho(...R,{animationFrame:n.updatePositionStrategy==="always"}),middleware:g}),C=O(()=>rt(y.value)[0]),x=O(()=>rt(y.value)[1]);Rn(()=>{b.value&&o("placed")});const S=O(()=>{var R;return((R=w.value.arrow)==null?void 0:R.centerOffset)!==0}),_=E("");K(()=>{l.value&&(_.value=window.getComputedStyle(l.value).zIndex)});const M=O(()=>{var R;return((R=w.value.arrow)==null?void 0:R.x)??0}),N=O(()=>{var R;return((R=w.value.arrow)==null?void 0:R.y)??0});return zi({placedSide:C,onArrowChange:R=>d.value=R,arrowX:M,arrowY:N,shouldHideArrow:S}),(R,z)=>{var k,W,L;return B(),jt("div",{ref_key:"floatingRef",ref:a,"data-radix-popper-content-wrapper":"",style:at({...m(h),transform:m(b)?m(h).transform:"translate(0, -200%)",minWidth:"max-content",zIndex:_.value,"--radix-popper-transform-origin":[(k=m(w).transformOrigin)==null?void 0:k.x,(W=m(w).transformOrigin)==null?void 0:W.y].join(" "),...((L=m(w).hide)==null?void 0:L.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}})},[me(m(X),F({ref:m(r)},R.$attrs,{"as-child":n.asChild,as:R.as,"data-side":C.value,"data-align":x.value,style:{animation:m(b)?void 0:"none"}}),{default:A(()=>[P(R.$slots,"default")]),_:3},16,["as-child","as","data-side","data-align","style"])],4)}}}),Ui=$n("polygon",{points:"0,0 30,0 15,10"},null,-1),Yi=D({__name:"Arrow",props:{width:{default:10},height:{default:5},asChild:{type:Boolean},as:{default:"svg"}},setup(e){const t=e;return $(),(n,o)=>(B(),T(m(X),F(t,{width:n.width,height:n.height,viewBox:n.asChild?void 0:"0 0 30 10",preserveAspectRatio:n.asChild?void 0:"none"}),{default:A(()=>[P(n.$slots,"default",{},()=>[Ui])]),_:3},16,["width","height","viewBox","preserveAspectRatio"]))}}),Xi={top:"bottom",right:"left",bottom:"top",left:"right"},qi=D({inheritAttrs:!1,__name:"PopperArrow",props:{width:{},height:{},asChild:{type:Boolean},as:{default:"svg"}},setup(e){const{forwardRef:t}=$(),n=Vi(),o=O(()=>Xi[n.placedSide.value]);return(i,r)=>{var l,a,d,c;return B(),jt("span",{ref:s=>{m(n).onArrowChange(s)},style:at({position:"absolute",left:(l=m(n).arrowX)!=null&&l.value?`${(a=m(n).arrowX)==null?void 0:a.value}px`:void 0,top:(d=m(n).arrowY)!=null&&d.value?`${(c=m(n).arrowY)==null?void 0:c.value}px`:void 0,[o.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})},[me(Yi,F(i.$attrs,{ref:m(t),style:{display:"block"},as:i.as,"as-child":i.asChild,width:i.width,height:i.height}),{default:A(()=>[P(i.$slots,"default")]),_:3},16,["as","as-child","width","height"])],4)}}}),Gi=D({__name:"VisuallyHidden",props:{asChild:{type:Boolean},as:{default:"span"}},setup(e){return $(),(t,n)=>(B(),T(m(X),{as:t.as,"as-child":t.asChild,style:{position:"absolute",border:0,width:"1px",display:"inline-block",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}},{default:A(()=>[P(t.$slots,"default")]),_:3},8,["as","as-child"]))}});function Ji(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}Ji();const mn="tooltip.open",[bt,Qi]=be("TooltipProvider"),fr=D({inheritAttrs:!1,__name:"TooltipProvider",props:{delayDuration:{default:700},skipDelayDuration:{default:300},disableHoverableContent:{type:Boolean,default:!1},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean,default:!1}},setup(e){const t=e,{delayDuration:n,skipDelayDuration:o,disableHoverableContent:i,disableClosingTrigger:r,ignoreNonKeyboardFocus:l,disabled:a}=lt(t);$();const d=E(!0),c=E(!1),{start:s,stop:u}=tn(()=>{d.value=!0},o,{immediate:!1});return Qi({isOpenDelayed:d,delayDuration:n,onOpen(){u(),d.value=!1},onClose(){s()},isPointerInTransitRef:c,disableHoverableContent:i,disableClosingTrigger:r,disabled:a,ignoreNonKeyboardFocus:l}),(p,f)=>P(p.$slots,"default")}}),[Ue,Zi]=be("TooltipRoot"),pr=D({__name:"TooltipRoot",props:{defaultOpen:{type:Boolean,default:!1},open:{type:Boolean,default:void 0},delayDuration:{default:void 0},disableHoverableContent:{type:Boolean,default:void 0},disableClosingTrigger:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},ignoreNonKeyboardFocus:{type:Boolean,default:void 0}},emits:["update:open"],setup(e,{emit:t}){const n=e,o=t;$();const i=bt(),r=O(()=>n.disableHoverableContent??i.disableHoverableContent.value),l=O(()=>n.disableClosingTrigger??i.disableClosingTrigger.value),a=O(()=>n.disabled??i.disabled.value),d=O(()=>n.delayDuration??i.delayDuration.value),c=O(()=>n.ignoreNonKeyboardFocus??i.ignoreNonKeyboardFocus.value),s=nn(n,"open",o,{defaultValue:n.defaultOpen,passive:n.open===void 0});V(s,w=>{i.onClose&&(w?(i.onOpen(),document.dispatchEvent(new CustomEvent(mn))):i.onClose())});const u=E(!1),p=E(),f=O(()=>s.value?u.value?"delayed-open":"instant-open":"closed"),{start:v,stop:g}=tn(()=>{u.value=!0,s.value=!0},d,{immediate:!1});function h(){g(),u.value=!1,s.value=!0}function y(){g(),s.value=!1}function b(){v()}return Zi({contentId:"",open:s,stateAttribute:f,trigger:p,onTriggerChange(w){p.value=w},onTriggerEnter(){i.isOpenDelayed.value?b():h()},onTriggerLeave(){r.value?y():g()},onOpen:h,onClose:y,disableHoverableContent:r,disableClosingTrigger:l,disabled:a,ignoreNonKeyboardFocus:c}),(w,C)=>(B(),T(m(ki),null,{default:A(()=>[P(w.$slots,"default",{open:m(s)})]),_:3}))}}),vr=D({__name:"TooltipTrigger",props:{asChild:{type:Boolean},as:{default:"button"}},setup(e){const t=e,n=Ue(),o=bt();n.contentId||(n.contentId=it(void 0,"radix-vue-tooltip-content"));const{forwardRef:i,currentElement:r}=$(),l=E(!1),a=E(!1),d=O(()=>n.disabled.value?{}:{click:g,focus:f,pointermove:u,pointerleave:p,pointerdown:s,blur:v});De(()=>{n.onTriggerChange(r.value)});function c(){setTimeout(()=>{l.value=!1},1)}function s(){l.value=!0,document.addEventListener("pointerup",c,{once:!0})}function u(h){h.pointerType!=="touch"&&!a.value&&!o.isPointerInTransitRef.value&&(n.onTriggerEnter(),a.value=!0)}function p(){n.onTriggerLeave(),a.value=!1}function f(h){var y,b;l.value||n.ignoreNonKeyboardFocus.value&&!((b=(y=h.target).matches)!=null&&b.call(y,":focus-visible"))||n.onOpen()}function v(){n.onClose()}function g(){n.disableClosingTrigger.value||n.onClose()}return(h,y)=>(B(),T(m(Ii),{"as-child":""},{default:A(()=>[me(m(X),F({ref:m(i),"aria-describedby":m(n).open.value?m(n).contentId:void 0,"data-state":m(n).stateAttribute.value,as:h.as,"as-child":t.asChild,"data-grace-area-trigger":""},xn(d.value)),{default:A(()=>[P(h.$slots,"default")]),_:3},16,["aria-describedby","data-state","as","as-child"])]),_:3}))}}),hn=D({__name:"TooltipContentImpl",props:{ariaLabel:{},asChild:{type:Boolean},as:{},side:{default:"top"},sideOffset:{default:0},align:{default:"center"},alignOffset:{},avoidCollisions:{type:Boolean,default:!0},collisionBoundary:{default:()=>[]},collisionPadding:{default:0},arrowPadding:{default:0},sticky:{default:"partial"},hideWhenDetached:{type:Boolean,default:!1}},emits:["escapeKeyDown","pointerDownOutside"],setup(e,{emit:t}){const n=e,o=t,i=Ue(),{forwardRef:r}=$(),l=Dn(),a=O(()=>{var s;return(s=l.default)==null?void 0:s.call(l)}),d=O(()=>{var s;if(n.ariaLabel)return n.ariaLabel;let u="";function p(f){typeof f.children=="string"&&f.type!==Wt?u+=f.children:Array.isArray(f.children)&&f.children.forEach(v=>p(v))}return(s=a.value)==null||s.forEach(f=>p(f)),u}),c=O(()=>{const{ariaLabel:s,...u}=n;return u});return De(()=>{je(window,"scroll",s=>{const u=s.target;u!=null&&u.contains(i.trigger.value)&&i.onClose()}),je(window,mn,i.onClose)}),(s,u)=>(B(),T(m(cn),{"as-child":"","disable-outside-pointer-events":!1,onEscapeKeyDown:u[0]||(u[0]=p=>o("escapeKeyDown",p)),onPointerDownOutside:u[1]||(u[1]=p=>{var f;m(i).disableClosingTrigger.value&&(f=m(i).trigger.value)!=null&&f.contains(p.target)&&p.preventDefault(),o("pointerDownOutside",p)}),onFocusOutside:u[2]||(u[2]=Qe(()=>{},["prevent"])),onDismiss:u[3]||(u[3]=p=>m(i).onClose())},{default:A(()=>[me(m(Ki),F({ref:m(r),"data-state":m(i).stateAttribute.value},{...s.$attrs,...c.value},{style:{"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"}}),{default:A(()=>[P(s.$slots,"default"),me(m(Gi),{id:m(i).contentId,role:"tooltip"},{default:A(()=>[Pn(_n(d.value),1)]),_:1},8,["id"])]),_:3},16,["data-state"])]),_:3}))}}),er=D({__name:"TooltipContentHoverable",props:{ariaLabel:{},asChild:{type:Boolean},as:{},side:{},sideOffset:{},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean}},setup(e){const t=ln(e),{forwardRef:n,currentElement:o}=$(),{trigger:i,onClose:r}=Ue(),l=bt(),{isPointerInTransit:a,onPointerExit:d}=Go(i,o);return l.isPointerInTransitRef=a,d(()=>{r()}),(c,s)=>(B(),T(hn,F({ref:m(n)},m(t)),{default:A(()=>[P(c.$slots,"default")]),_:3},16))}}),mr=D({__name:"TooltipContent",props:{forceMount:{type:Boolean},ariaLabel:{},asChild:{type:Boolean},as:{},side:{default:"top"},sideOffset:{},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean}},emits:["escapeKeyDown","pointerDownOutside"],setup(e,{emit:t}){const n=e,o=t,i=Ue(),r=an(n,o),{forwardRef:l}=$();return(a,d)=>(B(),T(m(yt),{present:a.forceMount||m(i).open.value},{default:A(()=>[(B(),T(On(m(i).disableHoverableContent.value?hn:er),F({ref:m(l)},m(r)),{default:A(()=>[P(a.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),hr=D({__name:"TooltipArrow",props:{width:{default:10},height:{default:5},asChild:{type:Boolean},as:{default:"svg"}},setup(e){const t=e;return $(),(n,o)=>(B(),T(m(qi),de(fe(t)),{default:A(()=>[P(n.$slots,"default")]),_:3},16))}}),gr=D({__name:"TooltipPortal",props:{to:{},disabled:{type:Boolean},forceMount:{type:Boolean}},setup(e){const t=e;return(n,o)=>(B(),T(m(wt),de(fe(t)),{default:A(()=>[P(n.$slots,"default")]),_:3},16))}});export{$i as $,rr as A,Si as B,cr as F,hr as G,fr as H,or as I,sr as M,dr as N,lr as O,Ti as P,ir as T,mr as U,ur as V,pr as W,vr as j,ar as k,vi as n,gr as q}; diff --git a/assets/index-DjtWjpVM.js b/assets/index-DjtWjpVM.js new file mode 100644 index 0000000000000000000000000000000000000000..9b2b94f29ed3e1b1b15f5303284f9ee7112c1cee --- /dev/null +++ b/assets/index-DjtWjpVM.js @@ -0,0 +1 @@ +import{d as T,g as J,s as K,r as c,v as Q,h as C,K as R,c as m,o as d,e as a,i as h,x as w,y as G,b as r,t as l,O as H,n as P,j as V,w as W,F as j,l as X,A as Y}from"./index-BNq7Hbz_.js";import"./mcp-D2taTyhO.js";import{u as Z}from"./airi-card-BqbOXX1s.js";/* empty css */import{_ as ee}from"./InputFile.vue_vue_type_script_setup_true_lang-DHNEAW-b.js";import{_ as te}from"./CardDetailDialog.vue_vue_type_script_setup_true_lang-DgSekOLF.js";import{_ as ae}from"./CardListItem.vue_vue_type_script_setup_true_lang-CGSvzeuN.js";import{a as se}from"./DeleteCardDialog.vue_vue_type_script_setup_true_lang-C2ofomcy.js";import{b as O}from"./route-block-B_A1xBdJ.js";import"./mini_xsschema-P_8cZcRg.js";import"./consciousness-BV44f_Xl.js";import"./providers-Ddg6LLwH.js";import"./index-LHmcipjy.js";import"./speech-CKvssz06.js";import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-B6whjTNv.js";import"./three-vrm-animation.module-BPuMi1if.js";import"./index-Df6I5b4c.js";const re={"rounded-xl":"","p-4":"",flex:"~ col gap-4"},oe={flex:"~ row","flex-wrap":"","items-center":"","justify-between":"","gap-4":""},ne={class:"relative min-w-[200px] flex-1","inline-flex":"~","w-full":"","items-center":""},le=["placeholder"],ie={class:"flex items-center gap-2"},de={"text-sm":"","text-neutral-500":"","dark:text-neutral-400":""},ue={value:"nameAsc"},ce={value:"nameDesc"},me={value:"recent"},pe={key:0,flex:"","flex-col":"","items-center":""},fe={"font-medium":"",text:"neutral-600 dark:neutral-300"},ve={text:"neutral-500 dark:neutral-400","mt-2":"","text-sm":""},xe={key:1,flex:"","flex-col":"","items-center":""},ge={"font-medium":"",text:"primary-600 dark:primary-300"},_e={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"},be={key:2,class:"col-span-full flex items-center gap-3 border-2 border-amber-200 rounded-xl bg-amber-50/80 p-4 dark:border-amber-800 dark:bg-amber-900/30"},ye={class:"flex flex-col"},ke={class:"font-medium"},Ce={class:"text-sm text-amber-600 dark:text-amber-400"},he={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":""},we=T({__name:"index",setup(Ve){const{t:n}=J(),y=Z(),{addCard:U,removeCard:B}=y,{cards:p,activeCardId:D}=K(y),_=c(""),f=c(!1),v=c(""),x=c("nameAsc"),k=c([]);Q(k,async s=>{const e=s[0];if(e)try{const o=await e.text(),i=JSON.parse(o);_.value=U(i),f.value=!0}catch(o){console.error("Error processing card file:",o)}});const S=C(()=>Array.from(p.value.entries()).map(([s,e])=>({id:s,name:e.name,description:e.description}))),F=C(()=>{if(!v.value)return S.value;const s=v.value.toLowerCase();return S.value.filter(e=>e.name.toLowerCase().includes(s)||e.description&&e.description.toLowerCase().includes(s))}),A=C(()=>{const s=[...F.value];return x.value==="nameAsc"?s.sort((e,o)=>e.name.localeCompare(o.name)):x.value==="nameDesc"?s.sort((e,o)=>o.name.localeCompare(e.name)):x.value==="recent"?s.sort((e,o)=>o.id.localeCompare(e.id)):s}),b=c(!1),u=c(null);function L(){u.value&&(B(u.value),u.value=null,b.value=!1)}function q(s){u.value=s,b.value=!0}function E(s){_.value=s,f.value=!0}function I(s){D.value=s}function M(s){const e=p.value.get(s);return(e==null?void 0:e.version)||"1.0.0"}function $(s,e){var t,g,N,z;const o=p.value.get(s);if(!o||!((g=(t=o.extensions)==null?void 0:t.airi)!=null&&g.modules))return"default";const i=o.extensions.airi.modules;return e==="consciousness"?(N=i.consciousness)!=null&&N.model&&i.consciousness.model.split("-").pop()||"default":e==="voice"&&((z=i.speech)==null?void 0:z.voice_id)||"default"}return(s,e)=>{var i;const o=R("motion");return d(),m(j,null,[a("div",re,[a("div",oe,[a("div",ne,[e[6]||(e[6]=a("div",{class:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3"},[a("div",{"i-solar:magnifer-line-duotone":"",class:"text-neutral-500 dark:text-neutral-400"})],-1)),w(a("input",{"onUpdate:modelValue":e[0]||(e[0]=t=>v.value=t),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:r(n)("settings.pages.card.search")},null,8,le),[[G,v.value]])]),a("div",ie,[a("div",de,l(r(n)("settings.pages.card.sort_by"))+": ",1),w(a("select",{"onUpdate:modelValue":e[1]||(e[1]=t=>x.value=t),class:"rounded-lg p-1.5 text-sm outline-none",border:"focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800",bg:"white dark:neutral-900"},[a("option",ue,l(r(n)("settings.pages.card.name_asc")),1),a("option",ce,l(r(n)("settings.pages.card.name_desc")),1),a("option",me,l(r(n)("settings.pages.card.recent")),1)],512),[[H,x.value]])])]),a("div",{class:P(["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))]":r(p).size>0}])},[h(r(ee),{modelValue:k.value,"onUpdate:modelValue":e[2]||(e[2]=t=>k.value=t),accept:"*.json"},{default:W(({isDragging:t})=>[t?(d(),m("div",xe,[e[8]||(e[8]=a("div",{"i-solar:upload-minimalistic-bold":"",class:"text-primary-500 dark:text-primary-400 mb-2 text-5xl"},null,-1)),a("p",ge,l(r(n)("settings.pages.card.drop_here")),1)])):(d(),m("div",pe,[e[7]||(e[7]=a("div",{"i-solar:upload-square-line-duotone":"","mb-4":"","text-5xl":"",text:"neutral-400 dark:neutral-500"},null,-1)),a("p",fe,l(r(n)("settings.pages.card.upload")),1),a("p",ve,l(r(n)("settings.pages.card.upload_desc")),1)]))]),_:1},8,["modelValue"]),r(p).size>0?(d(!0),m(j,{key:0},X(A.value,t=>(d(),Y(ae,{id:t.id,key:t.id,name:t.name,description:t.description,"is-active":t.id===r(D),"is-selected":t.id===_.value&&f.value,version:M(t.id),"consciousness-model":$(t.id,"consciousness"),"voice-model":$(t.id,"voice"),onSelect:g=>E(t.id),onActivate:g=>I(t.id),onDelete:g=>q(t.id)},null,8,["id","name","description","is-active","is-selected","version","consciousness-model","voice-model","onSelect","onActivate","onDelete"]))),128)):V("",!0),r(p).size===0?(d(),m("div",_e,[e[9]||(e[9]=a("div",{"i-solar:card-search-broken":"","mx-auto":"","mb-3":"","text-6xl":"","text-neutral-400":""},null,-1)),a("p",null,l(r(n)("settings.pages.card.no_cards")),1)])):V("",!0),v.value&&A.value.length===0?(d(),m("div",be,[e[10]||(e[10]=a("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1)),a("div",ye,[a("span",ke,l(r(n)("settings.pages.card.no_results")),1),a("span",Ce,l(r(n)("settings.pages.card.try_different_search")),1)])])):V("",!0)],2)]),h(se,{modelValue:b.value,"onUpdate:modelValue":e[3]||(e[3]=t=>b.value=t),"card-name":u.value?(i=r(y).getCard(u.value))==null?void 0:i.name:"",onConfirm:L,onCancel:e[4]||(e[4]=t=>u.value=null)},null,8,["modelValue","card-name"]),h(te,{modelValue:f.value,"onUpdate:modelValue":e[5]||(e[5]=t=>f.value=t),"card-id":_.value},null,8,["modelValue","card-id"]),w((d(),m("div",he,e[11]||(e[11]=[a("div",{text:"60","i-solar:emoji-funny-square-bold-duotone":""},null,-1)]))),[[o]])],64)}}});typeof O=="function"&&O(we);export{we as default}; diff --git a/assets/index-DlpcTXeT.js b/assets/index-DlpcTXeT.js new file mode 100644 index 0000000000000000000000000000000000000000..eba37f0b2735c10d41fcaa2be13e37274cc9d548 --- /dev/null +++ b/assets/index-DlpcTXeT.js @@ -0,0 +1 @@ +import{_ as d}from"./IconAnimation.vue_vue_type_script_setup_true_lang-D-TDNw-F.js";import{u}from"./useIconAnimation-CpaNr068.js";import{d as p,K as f,c as n,o as e,e as i,A as _,x as v,b as o,F as x}from"./index-BNq7Hbz_.js";import{b as r}from"./route-block-B_A1xBdJ.js";import"./mcp-D2taTyhO.js";import"./mini_xsschema-P_8cZcRg.js";const k={key:1,text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[calc(100dvh-15rem)]","bottom-0":"","right--5":"","z--1":"",initial:{scale:.9,opacity:0,y:20},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":"",flex:"","items-center":"","justify-center":""},y=p({__name:"index",setup(b){const{iconAnimationStarted:a,showIconAnimation:s,animationIcon:c}=u("i-solar:armchair-2-bold-duotone");return(h,t)=>{const l=d,m=f("motion");return e(),n(x,null,[t[1]||(t[1]=i("div",null," Scene ",-1)),o(s)?(e(),_(l,{key:0,"z-index":-1,icon:o(c),"icon-size":12,duration:1e3,started:o(a),"is-reverse":!0,position:"calc(100dvw - 9.5rem), calc(100dvh - 9.5rem)","text-color":"text-neutral-200/50 dark:text-neutral-600/20"},null,8,["icon","started"])):v((e(),n("div",k,t[0]||(t[0]=[i("div",{text:"60","i-solar:armchair-2-bold-duotone":""},null,-1)]))),[[m]])],64)}}});typeof r=="function"&&r(y);export{y as default}; diff --git a/assets/index-DqB314Ha.js b/assets/index-DqB314Ha.js deleted file mode 100644 index d187ca2df033e58c0cdac492d5cb82693e3e0771..0000000000000000000000000000000000000000 --- a/assets/index-DqB314Ha.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as g}from"./IconAnimation.vue_vue_type_script_setup_true_lang-DtxQmMu9.js";import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-t8bgqiA6.js";import{d as b,s as k,bz as v,c as e,o,a as c,m as s,G as l,bA as m,bB as I,u as i}from"./index-D3pfQUMu.js";import"./three-vrm-animation.module-DLbUhddZ.js";import"./emotions-CAex_2dA.js";import{u as z}from"./providers-CCvie00Z.js";import{I as h}from"./IconStatusItem-Do_zSdCF.js";/* empty css */import{u as A}from"./useIconAnimation-RrGZYl5Z.js";import{b as d}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";const B={grid:"~ cols-2 gap-4"},S={key:1,text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[calc(100dvh-15rem)]","bottom-0":"","right--5":"","z--1":"",initial:{scale:.9,opacity:0,y:20},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":"",flex:"","items-center":"","justify-center":""},w=b({__name:"index",setup(D){const u=z(),{allProvidersMetadata:p}=k(u),{iconAnimationStarted:f,showIconAnimation:_,animationIcon:y}=A("i-solar:box-minimalistic-bold-duotone");return(C,n)=>{const x=g,a=v("motion");return o(),e(m,null,[c("div",B,[(o(!0),e(m,null,I(i(p),(t,r)=>l((o(),s(i(h),{key:t.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+r*10,delay:r*50,title:t.localizedName,description:t.localizedDescription,icon:t.icon,"icon-color":t.iconColor,"icon-image":t.iconImage,to:`/settings/providers/${t.id}`,configured:t.configured},null,8,["duration","delay","title","description","icon","icon-color","icon-image","to","configured"])),[[a]])),128))]),i(_)?(o(),s(x,{key:0,"z-index":-1,icon:i(y),"icon-size":12,duration:1e3,started:i(f),"is-reverse":!0,position:"calc(100dvw - 9.5rem), calc(100dvh - 9.5rem)","text-color":"text-neutral-200/50 dark:text-neutral-600/20"},null,8,["icon","started"])):l((o(),e("div",S,n[0]||(n[0]=[c("div",{text:"60","i-solar:box-minimalistic-bold-duotone":""},null,-1)]))),[[a]])],64)}}});typeof d=="function"&&d(w);export{w as default}; diff --git a/assets/index-G9i1VvgN.js b/assets/index-G9i1VvgN.js new file mode 100644 index 0000000000000000000000000000000000000000..67559c99d2f237035e7e119201bfc0b3418692a1 --- /dev/null +++ b/assets/index-G9i1VvgN.js @@ -0,0 +1 @@ +import{d as i,K as n,x as r,o as a,c as s,e as c}from"./index-BNq7Hbz_.js";import{b as t}from"./route-block-B_A1xBdJ.js";const 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,y:15},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":"",flex:"","items-center":"","justify-center":""},d=i({__name:"index",setup(m){return(p,e)=>{const o=n("motion");return r((a(),s("div",l,e[0]||(e[0]=[c("div",{text:"60","i-solar:leaf-bold-duotone":""},null,-1)]))),[[o]])}}});typeof t=="function"&&t(d);export{d as default}; diff --git a/assets/index-QxR2H6V8.js b/assets/index-QxR2H6V8.js deleted file mode 100644 index 90b23cef608d02caccbf4a291beaeef0caef2902..0000000000000000000000000000000000000000 --- a/assets/index-QxR2H6V8.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as T}from"./IconAnimation.vue_vue_type_script_setup_true_lang-DtxQmMu9.js";import{l as Z,J as q}from"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-t8bgqiA6.js";import{_ as G,a as H}from"./Model.vue_vue_type_script_setup_true_lang-CYzfx59_.js";import{d as E,D as I,c as f,o as s,u as t,B as Q,k as W,bP as K,s as X,r as F,w as Y,bQ as ee,b as l,m as A,i as te,E as c,a as u,G as O,bH as oe,bN as g,t as $,bA as U,bB as B,bJ as ne,bq as ie,A as ae,bz as le}from"./index-D3pfQUMu.js";/* empty css */import{f as R,g as se}from"./emotions-CAex_2dA.js";import"./three-vrm-animation.module-DLbUhddZ.js";import{V as re}from"./browser-CkchkNbv.js";import{_ as V,a as de}from"./ColorPalette.vue_vue_type_script_setup_true_lang-BEcLR9qj.js";import{u as ce}from"./useIconAnimation-RrGZYl5Z.js";import{b as D}from"./route-block-B_A1xBdJ.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-DDNOeGH3.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-D_DUmSTM.js";import"./index-BZFiQ_k-.js";const ue=["disabled"],h=E({__name:"Live2DModelControlButton",emits:["click"],setup(j){const m=I();return(r,n)=>(s(),f("button",{disabled:t(m).loadingLive2dModel,bg:"neutral-100 dark:neutral-800",hover:"bg-neutral-200 dark:bg-neutral-700",transition:"all ease-in-out duration-250",rounded:"",onClick:n[0]||(n[0]=p=>r.$emit("click"))},[Q(r.$slots,"default")],8,ue))}}),me={flex:"~ col gap-4"},fe={flex:"","items-center":"","gap-2":""},pe=["disabled","placeholder"],ve={"font-medium":""},be={flex:"","gap-2":""},_e=["onUpdate:modelValue"],ge=["href","download"],he=E({__name:"Live2DSettings",props:{palette:null},emits:["extractColorsFromModel"],setup(j){const{t:m}=W(),r=K({accept:"application/zip"}),n=I(),{live2dModelFile:p,live2dMotionMap:v,live2dLoadSource:y,loadingLive2dModel:x,availableLive2dMotions:L,live2dModelUrl:M}=X(n),b=F(M.value);r.onChange(o=>{o&&o.length>0&&(v.value={},p.value=o[0],y.value="file",x.value=!0)}),Y(()=>n.loadingLive2dModel,o=>{o||y.value==="file"&&L.value.forEach(e=>{e.motionName in R?v.value[e.fileName]=e.motionName:v.value[e.fileName]=se})});async function _(o,e){if(!Object.keys(e).length)return o;const a=await new q().loadAsync(o),d=Object.keys(a.files).find(N=>N.endsWith("model3.json"));if(!d)throw new Error("model3.json not found");const J=await a.file(d).async("string"),z=JSON.parse(J),C={};Object.entries(e).forEach(([N,S])=>{if(C[S]){C[S].push({File:N});return}C[S]=[{File:N}]}),z.FileReferences.Motions=C,a.file(d,JSON.stringify(z,null,2));const P=await a.generateAsync({type:"blob"});return new File([P],o.name,{type:o.type,lastModified:o.lastModified})}async function w(){const o=await Z.getItem("live2dModel");if(!o)return;const e=await _(o,v.value);p.value=e,y.value="file",x.value=!0}const k=ee(p);return(o,e)=>(s(),f("div",me,[l(t(V),{title:"settings.live2d.change-model.title",icon:"i-solar:magic-stick-3-bold-duotone","inner-class":"text-sm"},{default:c(()=>[u("div",fe,[O(u("input",{"onUpdate:modelValue":e[0]||(e[0]=i=>b.value=i),disabled:t(n).loadingLive2dModel,class:"form-control flex-1",border:"neutral-300 dark:neutral-800 solid 1 focus:neutral-400 dark:focus:neutral-600",transition:"border duration-250 ease-in-out",placeholder:t(m)("settings.live2d.change-model.from-url-placeholder")},null,8,pe),[[oe,b.value]]),l(h,{class:"form-control",onClick:e[1]||(e[1]=i=>M.value=b.value)},{default:c(()=>[g($(t(m)("settings.live2d.change-model.from-url")),1)]),_:1})]),l(h,{class:"form-control place-self-end",onClick:e[2]||(e[2]=i=>t(r).open())},{default:c(()=>[g($(t(m)("settings.live2d.change-model.from-file"))+"... ",1)]),_:1}),l(h,{class:"form-control",onClick:e[3]||(e[3]=i=>o.$emit("extractColorsFromModel"))},{default:c(()=>e[4]||(e[4]=[g(" Extract colors from model ")])),_:1}),l(de,{colors:j.palette.map(i=>({hex:i,name:i}))},null,8,["colors"])]),_:1}),t(n).live2dLoadSource==="file"?(s(),A(t(V),{key:0,title:"settings.live2d.edit-motion-map.title",icon:"i-solar:face-scan-circle-bold-duotone"},{default:c(()=>{var i;return[(s(!0),f(U,null,B(t(n).availableLive2dMotions,a=>(s(),f("div",{key:a.fileName,flex:"","items-center":"","justify-between":"","text-sm":""},[u("span",ve,$(a.fileName),1),u("div",be,[O(u("select",{"onUpdate:modelValue":d=>t(n).live2dMotionMap[a.fileName]=d},[(s(!0),f(U,null,B(Object.keys(t(R)),d=>(s(),f("option",{key:d},$(d),1))),128))],8,_e),[[ne,t(n).live2dMotionMap[a.fileName]]]),l(h,{class:"form-control",onClick:d=>t(n).live2dCurrentMotion={group:a.motionName,index:a.motionIndex}},{default:c(()=>e[5]||(e[5]=[g(" Play ")])),_:2},1032,["onClick"])])]))),128)),l(h,{onClick:w},{default:c(()=>e[6]||(e[6]=[g(" Save and patch ")])),_:1}),u("a",{"mt-2":"",block:"",href:t(k),download:`${((i=t(n).live2dModelFile)==null?void 0:i.name)||"live2d"}-motion-edited.zip`},[l(h,{"w-full":""},{default:c(()=>e[7]||(e[7]=[g("Export")])),_:1})],8,ge)]}),_:1})):te("",!0)]))}}),ye=ie(he,[["__scopeId","data-v-b2e16668"]]),ke={flex:""},xe={key:1,text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[calc(100dvh-15rem)]","bottom-0":"","right--5":"","z--1":"",initial:{scale:.9,opacity:0,y:15},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":"",flex:"","items-center":"","justify-center":""},Me=E({__name:"index",setup(j){const m=F(),r=F(),{width:n,height:p}=ae(m),v=F([]);async function y(){if(!r.value)return;const b=await r.value.captureFrame();if(!b){console.error("No frame captured");return}const _=URL.createObjectURL(b);try{const k=await new re(_).getPalette();v.value=Object.values(k).map(o=>o==null?void 0:o.hex).filter(o=>typeof o=="string")}finally{URL.revokeObjectURL(_)}}const{iconAnimationStarted:x,showIconAnimation:L,animationIcon:M}=ce("i-solar:people-nearby-bold-duotone");return(b,_)=>{const w=T,k=le("motion");return s(),f(U,null,[u("div",ke,[u("div",{ref_key:"live2dContainerRef",ref:m,w:"50%",h:"80vh"},[l(t(H),{ref_key:"live2dCanvasRef",ref:r,width:t(n),height:t(p)},{default:c(({app:o})=>[l(t(G),{app:o,"mouth-open-size":0,width:t(n),height:t(p),paused:!1},null,8,["app","width","height"])]),_:1},8,["width","height"])],512),l(ye,{w:"50%",h:"80vh",palette:v.value,onExtractColorsFromModel:y},null,8,["palette"])]),t(L)?(s(),A(w,{key:0,"z-index":-1,icon:t(M),"icon-size":12,duration:1e3,started:t(x),"is-reverse":!0,position:"calc(100dvw - 9.5rem), calc(100dvh - 9.5rem)","text-color":"text-neutral-200/50 dark:text-neutral-600/20"},null,8,["icon","started"])):O((s(),f("div",xe,_[0]||(_[0]=[u("div",{text:"60","i-solar:people-nearby-bold-duotone":""},null,-1)]))),[[k]])],64)}}});typeof D=="function"&&D(Me);export{Me as default}; diff --git a/assets/index-TkjzwIq7.js b/assets/index-TkjzwIq7.js new file mode 100644 index 0000000000000000000000000000000000000000..12a88c255b33c6639e9960056af3b298f2bd34f8 --- /dev/null +++ b/assets/index-TkjzwIq7.js @@ -0,0 +1 @@ +import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-B6whjTNv.js";import{d as S,N as A,A as x,o as n,w as E,e as s,c as p,j as w,f as D,t as C,n as P,_ as R,U as j,r,g as L,G as N,h as q,K as F,x as _,F as V,l as G,b as y,z as K,ax as O}from"./index-BNq7Hbz_.js";import"./three-vrm-animation.module-BPuMi1if.js";import"./mcp-D2taTyhO.js";import"./mini_xsschema-P_8cZcRg.js";/* empty css */import{_ as U}from"./IconAnimation.vue_vue_type_script_setup_true_lang-D-TDNw-F.js";import{b as I}from"./route-block-B_A1xBdJ.js";const H={"z-1":"","flex-1":""},J={"text-lg":"","font-bold":"",class:"menu-icon-item-title",transition:"all ease-in-out duration-400"},M={text:"sm neutral-500 dark:neutral-400",class:"menu-icon-item-description",transition:"all ease-in-out duration-400"},Q=S({__name:"IconItem",props:{title:null,description:null,icon:null,iconTemplate:{type:Boolean},to:null},setup(o){return(m,g)=>{const f=A("RouterLink");return n(),x(f,{box:"border",flex:"~ row",bg:"neutral-50 dark:neutral-900",border:"neutral-100 dark:neutral-800/25 hover:primary-500/30 dark:hover:primary-400/30 solid 2","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",class:"menu-icon-item",transition:"all ease-in-out duration-400",relative:"","w-full":"","items-center":"","overflow-hidden":"","rounded-lg":"","p-5":"","text-left":"",cursor:"pointer",to:o.to},{default:E(()=>[s("div",H,[s("div",J,C(o.title),1),s("div",M,[s("span",null,C(o.description),1)])]),typeof o.icon=="string"?(n(),p("div",{key:0,class:P(["menu-icon-item-icon",[o.icon]]),transition:"all ease-in-out duration-400",absolute:"","right-0":"","size-24":"","translate-y-4":"",text:"neutral-400/50 dark:neutral-600/50"},null,2)):w("",!0),o.iconTemplate?D(m.$slots,"icon",{key:1},void 0,!0):w("",!0)]),_:3},8,["to"])}}}),W=R(Q,[["__scopeId","data-v-656e0116"]]),X={flex:"~ col gap-4"},Y={flex:"~ col gap-4"},Z={key:1,text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[calc(100dvh-12rem)]","bottom-0":"","right--10":"","z--1":"",initial:{scale:.9,opacity:0,rotate:180},enter:{scale:1,opacity:1,rotate:0},duration:500,"size-60":"",flex:"","items-center":"","justify-center":""},tt={text:"60","i-solar:settings-bold-duotone":""},et=S({__name:"index",setup(o){const m=j(),g=r(!1),f=r(),c=r(),{t}=L(),h=r(""),b=r(""),k=r(!1),d=N();function $(){var a;(a=c.value)==null||a.call(c)}async function z(a,l){const e=a.currentTarget.querySelector(".menu-icon-item-icon");if(!e)return;const u=e.getBoundingClientRect(),v=`${u.left}px, ${u.top}px`;h.value=l.icon,b.value=v,k.value=!0,await O(),g.value=!0}const T=m.beforeEach(async(a,l,i)=>{if(!d.usePageSpecificTransitions||d.disableTransitions){i();return}await new Promise(e=>{c.value=e}),T(),i()}),B=q(()=>[{title:t("settings.pages.card.title"),description:t("settings.pages.card.description"),icon:"i-solar:emoji-funny-square-bold-duotone",to:"/settings/airi-card"},{title:t("settings.pages.modules.title"),description:t("settings.pages.modules.description"),icon:"i-solar:layers-bold-duotone",to:"/settings/modules"},{title:t("settings.pages.scene.title"),description:t("settings.pages.scene.description"),icon:"i-solar:armchair-2-bold-duotone",to:"/settings/scene"},{title:t("settings.pages.models.title"),description:t("settings.pages.models.description"),icon:"i-solar:people-nearby-bold-duotone",to:"/settings/models"},{title:t("settings.pages.memory.title"),description:t("settings.pages.memory.description"),icon:"i-solar:leaf-bold-duotone",to:"/settings/memory"},{title:t("settings.pages.providers.title"),description:t("settings.pages.providers.description"),icon:"i-solar:box-minimalistic-bold-duotone",to:"/settings/providers"},{title:t("settings.pages.themes.title"),description:t("settings.pages.themes.description"),icon:"i-solar:filters-bold-duotone",to:"/settings/appearance"}]);return(a,l)=>{const i=F("motion");return n(),p("div",X,[l[0]||(l[0]=s("div",null,null,-1)),s("div",Y,[(n(!0),p(V,null,G(B.value,(e,u)=>_((n(),x(y(W),{key:e.to,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250,style:K({transitionDelay:`${u*50}ms`}),title:e.title,description:e.description,icon:e.icon,to:e.to,onClick:v=>z(v,e)},null,8,["style","title","description","icon","to","onClick"])),[[i]])),128))]),k.value&&!y(d).disableTransitions&&y(d).usePageSpecificTransitions?(n(),x(U,{key:0,ref_key:"iconAnimation",ref:f,icon:h.value,"icon-size":6*1.2,position:b.value,duration:1e3,"text-color":"text-neutral-400/50 dark:text-neutral-600/20",started:g.value,onAnimationEndedOnce:$},null,8,["icon","position","started"])):_((n(),p("div",Z,[_(s("div",tt,null,512),[[i]])])),[[i]])])}}});typeof I=="function"&&I(et);export{et as default}; diff --git a/assets/index-ZPnS1DDS.js b/assets/index-ZPnS1DDS.js deleted file mode 100644 index 616de27fc9fd7ba89c43b736ef32bdb497be9876..0000000000000000000000000000000000000000 --- a/assets/index-ZPnS1DDS.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as d}from"./IconAnimation.vue_vue_type_script_setup_true_lang-DtxQmMu9.js";import{u}from"./useIconAnimation-RrGZYl5Z.js";import{d as p,bz as f,c as n,o as e,a as i,m as _,G as v,u as o,bA as x}from"./index-D3pfQUMu.js";import{b as r}from"./route-block-B_A1xBdJ.js";import"./emotions-CAex_2dA.js";const k={key:1,text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[calc(100dvh-15rem)]","bottom-0":"","right--5":"","z--1":"",initial:{scale:.9,opacity:0,y:20},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":"",flex:"","items-center":"","justify-center":""},y=p({__name:"index",setup(b){const{iconAnimationStarted:a,showIconAnimation:s,animationIcon:c}=u("i-solar:armchair-2-bold-duotone");return(h,t)=>{const l=d,m=f("motion");return e(),n(x,null,[t[1]||(t[1]=i("div",null," Scene ",-1)),o(s)?(e(),_(l,{key:0,"z-index":-1,icon:o(c),"icon-size":12,duration:1e3,started:o(a),"is-reverse":!0,position:"calc(100dvw - 9.5rem), calc(100dvh - 9.5rem)","text-color":"text-neutral-200/50 dark:text-neutral-600/20"},null,8,["icon","started"])):v((e(),n("div",k,t[0]||(t[0]=[i("div",{text:"60","i-solar:armchair-2-bold-duotone":""},null,-1)]))),[[m]])],64)}}});typeof r=="function"&&r(y);export{y as default}; diff --git a/assets/index-rh9u0eeX.js b/assets/index-rh9u0eeX.js new file mode 100644 index 0000000000000000000000000000000000000000..660f8311fec94a30919aaa062fc360e81f8dddca --- /dev/null +++ b/assets/index-rh9u0eeX.js @@ -0,0 +1 @@ +import{_ as g}from"./IconAnimation.vue_vue_type_script_setup_true_lang-D-TDNw-F.js";import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-B6whjTNv.js";import{d as k,s as v,K as b,c as e,o,e as c,A as s,x as l,F as m,l as I,b as i}from"./index-BNq7Hbz_.js";import"./three-vrm-animation.module-BPuMi1if.js";import"./mcp-D2taTyhO.js";import"./mini_xsschema-P_8cZcRg.js";import{u as h}from"./providers-Ddg6LLwH.js";import{I as z}from"./IconStatusItem-CqRKpLO4.js";/* empty css */import{u as A}from"./useIconAnimation-CpaNr068.js";import{b as d}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";const B={grid:"~ cols-2 gap-4"},S={key:1,text:"neutral-200/50 dark:neutral-600/20","pointer-events-none":"",fixed:"",top:"[calc(100dvh-15rem)]","bottom-0":"","right--5":"","z--1":"",initial:{scale:.9,opacity:0,y:20},enter:{scale:1,opacity:1,y:0},duration:500,"size-60":"",flex:"","items-center":"","justify-center":""},w=k({__name:"index",setup(D){const u=h(),{allProvidersMetadata:p}=v(u),{iconAnimationStarted:f,showIconAnimation:_,animationIcon:y}=A("i-solar:box-minimalistic-bold-duotone");return(C,n)=>{const x=g,a=b("motion");return o(),e(m,null,[c("div",B,[(o(!0),e(m,null,I(i(p),(t,r)=>l((o(),s(i(z),{key:t.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+r*10,delay:r*50,title:t.localizedName,description:t.localizedDescription,icon:t.icon,"icon-color":t.iconColor,"icon-image":t.iconImage,to:`/settings/providers/${t.id}`,configured:t.configured},null,8,["duration","delay","title","description","icon","icon-color","icon-image","to","configured"])),[[a]])),128))]),i(_)?(o(),s(x,{key:0,"z-index":-1,icon:i(y),"icon-size":12,duration:1e3,started:i(f),"is-reverse":!0,position:"calc(100dvw - 9.5rem), calc(100dvh - 9.5rem)","text-color":"text-neutral-200/50 dark:text-neutral-600/20"},null,8,["icon","started"])):l((o(),e("div",S,n[0]||(n[0]=[c("div",{text:"60","i-solar:box-minimalistic-bold-duotone":""},null,-1)]))),[[a]])],64)}}});typeof d=="function"&&d(w);export{w as default}; diff --git a/assets/mcp-D2taTyhO.js b/assets/mcp-D2taTyhO.js new file mode 100644 index 0000000000000000000000000000000000000000..a7d92ff3f4236a28c4be5125d48899ba86e19ca2 --- /dev/null +++ b/assets/mcp-D2taTyhO.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/effect-AvyXEvwH-C1QXj6zT.js","assets/index-BNq7Hbz_.js","assets/index-Bsn4xRdB.css","assets/valibot-BI4iQMg3-AQFxgSlR.js","assets/zod-CxRm5Gac-BRS3ngCs.js"])))=>i.map(i=>d[i]); +import{L as ge}from"./index-BNq7Hbz_.js";const ar=async(r,e)=>{try{return await r}catch{throw new Error(`xsschema: Missing dependencies "${e}".`)}},Nt=async r=>{switch(r){case"arktype":return ge(()=>import("./arktype-C-GObzDh-1xlRyYUo.js"),[]).then(async({getToJsonSchemaFn:e})=>e());case"effect":return ge(()=>import("./effect-AvyXEvwH-C1QXj6zT.js"),__vite__mapDeps([0,1,2])).then(async({getToJsonSchemaFn:e})=>e());case"valibot":return ge(()=>import("./valibot-BI4iQMg3-AQFxgSlR.js"),__vite__mapDeps([3,1,2])).then(async({getToJsonSchemaFn:e})=>e());case"zod":return ge(()=>import("./zod-CxRm5Gac-BRS3ngCs.js"),__vite__mapDeps([4,1,2])).then(async({getToJsonSchemaFn:e})=>e());default:throw new Error(`xsschema: Unsupported schema vendor "${r}"`)}},Pe=async r=>Nt(r["~standard"].vendor).then(async e=>e(r)),xe=async r=>({execute:r.execute,function:{description:r.description,name:r.name,parameters:await Pe(r.parameters),returns:r.returns?await Pe(r.returns):void 0,strict:r.strict},type:"function"});var g;(function(r){r.assertEqual=n=>n;function e(n){}r.assertIs=e;function t(n){throw new Error}r.assertNever=t,r.arrayToEnum=n=>{const a={};for(const i of n)a[i]=i;return a},r.getValidEnumValues=n=>{const a=r.objectKeys(n).filter(o=>typeof n[n[o]]!="number"),i={};for(const o of a)i[o]=n[o];return r.objectValues(i)},r.objectValues=n=>r.objectKeys(n).map(function(a){return n[a]}),r.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{const a=[];for(const i in n)Object.prototype.hasOwnProperty.call(n,i)&&a.push(i);return a},r.find=(n,a)=>{for(const i of n)if(a(i))return i},r.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&isFinite(n)&&Math.floor(n)===n;function s(n,a=" | "){return n.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}r.joinValues=s,r.jsonStringifyReplacer=(n,a)=>typeof a=="bigint"?a.toString():a})(g||(g={}));var be;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(be||(be={}));const f=g.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),N=r=>{switch(typeof r){case"undefined":return f.undefined;case"string":return f.string;case"number":return isNaN(r)?f.nan:f.number;case"boolean":return f.boolean;case"function":return f.function;case"bigint":return f.bigint;case"symbol":return f.symbol;case"object":return Array.isArray(r)?f.array:r===null?f.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?f.promise:typeof Map<"u"&&r instanceof Map?f.map:typeof Set<"u"&&r instanceof Set?f.set:typeof Date<"u"&&r instanceof Date?f.date:f.object;default:return f.unknown}},c=g.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Le=r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:");class Z extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(a){return a.message},s={_errors:[]},n=a=>{for(const i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(n);else if(i.code==="invalid_return_type")n(i.returnTypeError);else if(i.code==="invalid_arguments")n(i.argumentsError);else if(i.path.length===0)s._errors.push(t(i));else{let o=s,l=0;for(;lt.message){const t={},s=[];for(const n of this.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(e(n))):s.push(e(n));return{formErrors:s,fieldErrors:t}}get formErrors(){return this.flatten()}}Z.create=r=>new Z(r);const W=(r,e)=>{let t;switch(r.code){case c.invalid_type:r.received===f.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case c.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,g.jsonStringifyReplacer)}`;break;case c.unrecognized_keys:t=`Unrecognized key(s) in object: ${g.joinValues(r.keys,", ")}`;break;case c.invalid_union:t="Invalid input";break;case c.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${g.joinValues(r.options)}`;break;case c.invalid_enum_value:t=`Invalid enum value. Expected ${g.joinValues(r.options)}, received '${r.received}'`;break;case c.invalid_arguments:t="Invalid function arguments";break;case c.invalid_return_type:t="Invalid function return type";break;case c.invalid_date:t="Invalid date";break;case c.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?t=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?t=`Invalid input: must end with "${r.validation.endsWith}"`:g.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case c.too_small:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:t="Invalid input";break;case c.too_big:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?t=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:t="Invalid input";break;case c.custom:t="Invalid input";break;case c.invalid_intersection_types:t="Intersection results could not be merged";break;case c.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case c.not_finite:t="Number must be finite";break;default:t=e.defaultError,g.assertNever(r)}return{message:t}};let De=W;function ze(r){De=r}function le(){return De}const fe=r=>{const{data:e,path:t,errorMaps:s,issueData:n}=r,a=[...t,...n.path||[]],i={...n,path:a};if(n.message!==void 0)return{...n,path:a,message:n.message};let o="";const l=s.filter(d=>!!d).slice().reverse();for(const d of l)o=d(i,{data:e,defaultError:o}).message;return{...n,path:a,message:o}},Ue=[];function u(r,e){const t=le(),s=fe({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===W?void 0:W].filter(n=>!!n)});r.common.issues.push(s)}class k{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const s=[];for(const n of t){if(n.status==="aborted")return _;n.status==="dirty"&&e.dirty(),s.push(n.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,t){const s=[];for(const n of t){const a=await n.key,i=await n.value;s.push({key:a,value:i})}return k.mergeObjectSync(e,s)}static mergeObjectSync(e,t){const s={};for(const n of t){const{key:a,value:i}=n;if(a.status==="aborted"||i.status==="aborted")return _;a.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||n.alwaysSet)&&(s[a.value]=i.value)}return{status:e.value,value:s}}}const _=Object.freeze({status:"aborted"}),F=r=>({status:"dirty",value:r}),w=r=>({status:"valid",value:r}),ke=r=>r.status==="aborted",we=r=>r.status==="dirty",D=r=>r.status==="valid",H=r=>typeof Promise<"u"&&r instanceof Promise;function Te(r,e,t,s){if(typeof e=="function"?r!==e||!0:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(r)}function Fe(r,e,t,s,n){if(typeof e=="function"?r!==e||!0:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(r,t),t}var h;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(h||(h={}));var de,ue;class R{constructor(e,t,s,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=s,this._key=n}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const $e=(r,e)=>{if(D(e))return{success:!0,data:e.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new Z(r.common.issues);return this._error=t,this._error}}};function v(r){if(!r)return{};const{errorMap:e,invalid_type_error:t,required_error:s,description:n}=r;if(e&&(t||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(i,o)=>{var l,d;const{message:p}=r;return i.code==="invalid_enum_value"?{message:p??o.defaultError}:typeof o.data>"u"?{message:(l=p??s)!==null&&l!==void 0?l:o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:(d=p??t)!==null&&d!==void 0?d:o.defaultError}},description:n}}class y{get description(){return this._def.description}_getType(e){return N(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:N(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new k,ctx:{common:e.parent.common,data:e.data,parsedType:N(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(H(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const s=this.safeParse(e,t);if(s.success)return s.data;throw s.error}safeParse(e,t){var s;const n={common:{issues:[],async:(s=t==null?void 0:t.async)!==null&&s!==void 0?s:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:N(e)},a=this._parseSync({data:e,path:n.path,parent:n});return $e(n,a)}"~validate"(e){var t,s;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:N(e)};if(!this["~standard"].async)try{const a=this._parseSync({data:e,path:[],parent:n});return D(a)?{value:a.value}:{issues:n.common.issues}}catch(a){!((s=(t=a==null?void 0:a.message)===null||t===void 0?void 0:t.toLowerCase())===null||s===void 0)&&s.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(a=>D(a)?{value:a.value}:{issues:n.common.issues})}async parseAsync(e,t){const s=await this.safeParseAsync(e,t);if(s.success)return s.data;throw s.error}async safeParseAsync(e,t){const s={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:N(e)},n=this._parse({data:e,path:s.path,parent:s}),a=await(H(n)?n:Promise.resolve(n));return $e(s,a)}refine(e,t){const s=n=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(n):t;return this._refinement((n,a)=>{const i=e(n),o=()=>a.addIssue({code:c.custom,...s(n)});return typeof Promise<"u"&&i instanceof Promise?i.then(l=>l?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,t){return this._refinement((s,n)=>e(s)?!0:(n.addIssue(typeof t=="function"?t(s,n):t),!1))}_refinement(e){return new S({schema:this,typeName:m.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return O.create(this,this._def)}nullable(){return V.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return E.create(this)}promise(){return J.create(this,this._def)}or(e){return Q.create([this,e],this._def)}and(e){return ee.create(this,e,this._def)}transform(e){return new S({...v(this._def),schema:this,typeName:m.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new ae({...v(this._def),innerType:this,defaultValue:t,typeName:m.ZodDefault})}brand(){return new Se({typeName:m.ZodBranded,type:this,...v(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new ie({...v(this._def),innerType:this,catchValue:t,typeName:m.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return ce.create(this,e)}readonly(){return oe.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Rt=/^c[^\s-]{8,}$/i,jt=/^[0-9a-z]+$/,It=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Mt=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Pt=/^[a-z0-9_-]{21}$/i,$t=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Vt=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Lt=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Dt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Oe;const zt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Ut=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Ft=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Bt=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Wt=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,qt=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Be="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Jt=new RegExp(`^${Be}$`);function We(r){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return r.precision?e=`${e}\\.\\d{${r.precision}}`:r.precision==null&&(e=`${e}(\\.\\d+)?`),e}function Yt(r){return new RegExp(`^${We(r)}$`)}function Ne(r){let e=`${Be}T${We(r)}`;const t=[];return t.push(r.local?"Z?":"Z"),r.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function Ht(r,e){return!!((e==="v4"||!e)&&zt.test(r)||(e==="v6"||!e)&&Ft.test(r))}function Gt(r,e){if(!$t.test(r))return!1;try{const[t]=r.split("."),s=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),n=JSON.parse(atob(s));return!(typeof n!="object"||n===null||!n.typ||!n.alg||e&&n.alg!==e)}catch{return!1}}function Xt(r,e){return!!((e==="v4"||!e)&&Ut.test(r)||(e==="v6"||!e)&&Bt.test(r))}class C extends y{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==f.string){const a=this._getOrReturnCtx(e);return u(a,{code:c.invalid_type,expected:f.string,received:a.parsedType}),_}const s=new k;let n;for(const a of this._def.checks)if(a.kind==="min")e.data.lengtha.value&&(n=this._getOrReturnCtx(e,n),u(n,{code:c.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="length"){const i=e.data.length>a.value,o=e.data.lengthe.test(n),{validation:t,code:c.invalid_string,...h.errToObj(s)})}_addCheck(e){return new C({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...h.errToObj(e)})}url(e){return this._addCheck({kind:"url",...h.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...h.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...h.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...h.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...h.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...h.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...h.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...h.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...h.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...h.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...h.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...h.errToObj(e)})}datetime(e){var t,s;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(t=e==null?void 0:e.offset)!==null&&t!==void 0?t:!1,local:(s=e==null?void 0:e.local)!==null&&s!==void 0?s:!1,...h.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...h.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...h.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...h.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...h.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...h.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...h.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...h.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...h.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...h.errToObj(t)})}nonempty(e){return this.min(1,h.errToObj(e))}trim(){return new C({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new C({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new C({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value{var e;return new C({checks:[],typeName:m.ZodString,coerce:(e=r==null?void 0:r.coerce)!==null&&e!==void 0?e:!1,...v(r)})};function Kt(r,e){const t=(r.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,n=t>s?t:s,a=parseInt(r.toFixed(n).replace(".","")),i=parseInt(e.toFixed(n).replace(".",""));return a%i/Math.pow(10,n)}class M extends y{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==f.number){const a=this._getOrReturnCtx(e);return u(a,{code:c.invalid_type,expected:f.number,received:a.parsedType}),_}let s;const n=new k;for(const a of this._def.checks)a.kind==="int"?g.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),u(s,{code:c.invalid_type,expected:"integer",received:"float",message:a.message}),n.dirty()):a.kind==="min"?(a.inclusive?e.dataa.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),u(s,{code:c.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="multipleOf"?Kt(e.data,a.value)!==0&&(s=this._getOrReturnCtx(e,s),u(s,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),u(s,{code:c.not_finite,message:a.message}),n.dirty()):g.assertNever(a);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,h.toString(t))}gt(e,t){return this.setLimit("min",e,!1,h.toString(t))}lte(e,t){return this.setLimit("max",e,!0,h.toString(t))}lt(e,t){return this.setLimit("max",e,!1,h.toString(t))}setLimit(e,t,s,n){return new M({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:h.toString(n)}]})}_addCheck(e){return new M({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:h.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:h.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:h.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:h.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:h.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuee.kind==="int"||e.kind==="multipleOf"&&g.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(t===null||s.value>t)&&(t=s.value):s.kind==="max"&&(e===null||s.valuenew M({checks:[],typeName:m.ZodNumber,coerce:(r==null?void 0:r.coerce)||!1,...v(r)});class P extends y{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==f.bigint)return this._getInvalidInput(e);let s;const n=new k;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.dataa.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),u(s,{code:c.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(s=this._getOrReturnCtx(e,s),u(s,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):g.assertNever(a);return{status:n.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return u(t,{code:c.invalid_type,expected:f.bigint,received:t.parsedType}),_}gte(e,t){return this.setLimit("min",e,!0,h.toString(t))}gt(e,t){return this.setLimit("min",e,!1,h.toString(t))}lte(e,t){return this.setLimit("max",e,!0,h.toString(t))}lt(e,t){return this.setLimit("max",e,!1,h.toString(t))}setLimit(e,t,s,n){return new P({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:h.toString(n)}]})}_addCheck(e){return new P({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:h.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value{var e;return new P({checks:[],typeName:m.ZodBigInt,coerce:(e=r==null?void 0:r.coerce)!==null&&e!==void 0?e:!1,...v(r)})};class G extends y{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==f.boolean){const s=this._getOrReturnCtx(e);return u(s,{code:c.invalid_type,expected:f.boolean,received:s.parsedType}),_}return w(e.data)}}G.create=r=>new G({typeName:m.ZodBoolean,coerce:(r==null?void 0:r.coerce)||!1,...v(r)});class z extends y{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==f.date){const a=this._getOrReturnCtx(e);return u(a,{code:c.invalid_type,expected:f.date,received:a.parsedType}),_}if(isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return u(a,{code:c.invalid_date}),_}const s=new k;let n;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()a.value&&(n=this._getOrReturnCtx(e,n),u(n,{code:c.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),s.dirty()):g.assertNever(a);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new z({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:h.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:h.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew z({checks:[],coerce:(r==null?void 0:r.coerce)||!1,typeName:m.ZodDate,...v(r)});class he extends y{_parse(e){if(this._getType(e)!==f.symbol){const s=this._getOrReturnCtx(e);return u(s,{code:c.invalid_type,expected:f.symbol,received:s.parsedType}),_}return w(e.data)}}he.create=r=>new he({typeName:m.ZodSymbol,...v(r)});class X extends y{_parse(e){if(this._getType(e)!==f.undefined){const s=this._getOrReturnCtx(e);return u(s,{code:c.invalid_type,expected:f.undefined,received:s.parsedType}),_}return w(e.data)}}X.create=r=>new X({typeName:m.ZodUndefined,...v(r)});class K extends y{_parse(e){if(this._getType(e)!==f.null){const s=this._getOrReturnCtx(e);return u(s,{code:c.invalid_type,expected:f.null,received:s.parsedType}),_}return w(e.data)}}K.create=r=>new K({typeName:m.ZodNull,...v(r)});class q extends y{constructor(){super(...arguments),this._any=!0}_parse(e){return w(e.data)}}q.create=r=>new q({typeName:m.ZodAny,...v(r)});class L extends y{constructor(){super(...arguments),this._unknown=!0}_parse(e){return w(e.data)}}L.create=r=>new L({typeName:m.ZodUnknown,...v(r)});class j extends y{_parse(e){const t=this._getOrReturnCtx(e);return u(t,{code:c.invalid_type,expected:f.never,received:t.parsedType}),_}}j.create=r=>new j({typeName:m.ZodNever,...v(r)});class pe extends y{_parse(e){if(this._getType(e)!==f.undefined){const s=this._getOrReturnCtx(e);return u(s,{code:c.invalid_type,expected:f.void,received:s.parsedType}),_}return w(e.data)}}pe.create=r=>new pe({typeName:m.ZodVoid,...v(r)});class E extends y{_parse(e){const{ctx:t,status:s}=this._processInputParams(e),n=this._def;if(t.parsedType!==f.array)return u(t,{code:c.invalid_type,expected:f.array,received:t.parsedType}),_;if(n.exactLength!==null){const i=t.data.length>n.exactLength.value,o=t.data.lengthn.maxLength.value&&(u(t,{code:c.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),s.dirty()),t.common.async)return Promise.all([...t.data].map((i,o)=>n.type._parseAsync(new R(t,i,t.path,o)))).then(i=>k.mergeArray(s,i));const a=[...t.data].map((i,o)=>n.type._parseSync(new R(t,i,t.path,o)));return k.mergeArray(s,a)}get element(){return this._def.type}min(e,t){return new E({...this._def,minLength:{value:e,message:h.toString(t)}})}max(e,t){return new E({...this._def,maxLength:{value:e,message:h.toString(t)}})}length(e,t){return new E({...this._def,exactLength:{value:e,message:h.toString(t)}})}nonempty(e){return this.min(1,e)}}E.create=(r,e)=>new E({type:r,minLength:null,maxLength:null,exactLength:null,typeName:m.ZodArray,...v(e)});function Y(r){if(r instanceof x){const e={};for(const t in r.shape){const s=r.shape[t];e[t]=O.create(Y(s))}return new x({...r._def,shape:()=>e})}else return r instanceof E?new E({...r._def,type:Y(r.element)}):r instanceof O?O.create(Y(r.unwrap())):r instanceof V?V.create(Y(r.unwrap())):r instanceof A?A.create(r.items.map(e=>Y(e))):r}class x extends y{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=g.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==f.object){const d=this._getOrReturnCtx(e);return u(d,{code:c.invalid_type,expected:f.object,received:d.parsedType}),_}const{status:s,ctx:n}=this._processInputParams(e),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof j&&this._def.unknownKeys==="strip"))for(const d in n.data)i.includes(d)||o.push(d);const l=[];for(const d of i){const p=a[d],T=n.data[d];l.push({key:{status:"valid",value:d},value:p._parse(new R(n,T,n.path,d)),alwaysSet:d in n.data})}if(this._def.catchall instanceof j){const d=this._def.unknownKeys;if(d==="passthrough")for(const p of o)l.push({key:{status:"valid",value:p},value:{status:"valid",value:n.data[p]}});else if(d==="strict")o.length>0&&(u(n,{code:c.unrecognized_keys,keys:o}),s.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const d=this._def.catchall;for(const p of o){const T=n.data[p];l.push({key:{status:"valid",value:p},value:d._parse(new R(n,T,n.path,p)),alwaysSet:p in n.data})}}return n.common.async?Promise.resolve().then(async()=>{const d=[];for(const p of l){const T=await p.key,ve=await p.value;d.push({key:T,value:ve,alwaysSet:p.alwaysSet})}return d}).then(d=>k.mergeObjectSync(s,d)):k.mergeObjectSync(s,l)}get shape(){return this._def.shape()}strict(e){return h.errToObj,new x({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,s)=>{var n,a,i,o;const l=(i=(a=(n=this._def).errorMap)===null||a===void 0?void 0:a.call(n,t,s).message)!==null&&i!==void 0?i:s.defaultError;return t.code==="unrecognized_keys"?{message:(o=h.errToObj(e).message)!==null&&o!==void 0?o:l}:{message:l}}}:{}})}strip(){return new x({...this._def,unknownKeys:"strip"})}passthrough(){return new x({...this._def,unknownKeys:"passthrough"})}extend(e){return new x({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new x({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:m.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new x({...this._def,catchall:e})}pick(e){const t={};return g.objectKeys(e).forEach(s=>{e[s]&&this.shape[s]&&(t[s]=this.shape[s])}),new x({...this._def,shape:()=>t})}omit(e){const t={};return g.objectKeys(this.shape).forEach(s=>{e[s]||(t[s]=this.shape[s])}),new x({...this._def,shape:()=>t})}deepPartial(){return Y(this)}partial(e){const t={};return g.objectKeys(this.shape).forEach(s=>{const n=this.shape[s];e&&!e[s]?t[s]=n:t[s]=n.optional()}),new x({...this._def,shape:()=>t})}required(e){const t={};return g.objectKeys(this.shape).forEach(s=>{if(e&&!e[s])t[s]=this.shape[s];else{let a=this.shape[s];for(;a instanceof O;)a=a._def.innerType;t[s]=a}}),new x({...this._def,shape:()=>t})}keyof(){return qe(g.objectKeys(this.shape))}}x.create=(r,e)=>new x({shape:()=>r,unknownKeys:"strip",catchall:j.create(),typeName:m.ZodObject,...v(e)});x.strictCreate=(r,e)=>new x({shape:()=>r,unknownKeys:"strict",catchall:j.create(),typeName:m.ZodObject,...v(e)});x.lazycreate=(r,e)=>new x({shape:r,unknownKeys:"strip",catchall:j.create(),typeName:m.ZodObject,...v(e)});class Q extends y{_parse(e){const{ctx:t}=this._processInputParams(e),s=this._def.options;function n(a){for(const o of a)if(o.result.status==="valid")return o.result;for(const o of a)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const i=a.map(o=>new Z(o.ctx.common.issues));return u(t,{code:c.invalid_union,unionErrors:i}),_}if(t.common.async)return Promise.all(s.map(async a=>{const i={...t,common:{...t.common,issues:[]},parent:null};return{result:await a._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(n);{let a;const i=[];for(const l of s){const d={...t,common:{...t.common,issues:[]},parent:null},p=l._parseSync({data:t.data,path:t.path,parent:d});if(p.status==="valid")return p;p.status==="dirty"&&!a&&(a={result:p,ctx:d}),d.common.issues.length&&i.push(d.common.issues)}if(a)return t.common.issues.push(...a.ctx.common.issues),a.result;const o=i.map(l=>new Z(l));return u(t,{code:c.invalid_union,unionErrors:o}),_}}get options(){return this._def.options}}Q.create=(r,e)=>new Q({options:r,typeName:m.ZodUnion,...v(e)});const I=r=>r instanceof re?I(r.schema):r instanceof S?I(r.innerType()):r instanceof se?[r.value]:r instanceof $?r.options:r instanceof ne?g.objectValues(r.enum):r instanceof ae?I(r._def.innerType):r instanceof X?[void 0]:r instanceof K?[null]:r instanceof O?[void 0,...I(r.unwrap())]:r instanceof V?[null,...I(r.unwrap())]:r instanceof Se||r instanceof oe?I(r.unwrap()):r instanceof ie?I(r._def.innerType):[];class ye extends y{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.object)return u(t,{code:c.invalid_type,expected:f.object,received:t.parsedType}),_;const s=this.discriminator,n=t.data[s],a=this.optionsMap.get(n);return a?t.common.async?a._parseAsync({data:t.data,path:t.path,parent:t}):a._parseSync({data:t.data,path:t.path,parent:t}):(u(t,{code:c.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),_)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,s){const n=new Map;for(const a of t){const i=I(a.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const o of i){if(n.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);n.set(o,a)}}return new ye({typeName:m.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...v(s)})}}function Ae(r,e){const t=N(r),s=N(e);if(r===e)return{valid:!0,data:r};if(t===f.object&&s===f.object){const n=g.objectKeys(e),a=g.objectKeys(r).filter(o=>n.indexOf(o)!==-1),i={...r,...e};for(const o of a){const l=Ae(r[o],e[o]);if(!l.valid)return{valid:!1};i[o]=l.data}return{valid:!0,data:i}}else if(t===f.array&&s===f.array){if(r.length!==e.length)return{valid:!1};const n=[];for(let a=0;a{if(ke(a)||ke(i))return _;const o=Ae(a.value,i.value);return o.valid?((we(a)||we(i))&&t.dirty(),{status:t.value,value:o.data}):(u(s,{code:c.invalid_intersection_types}),_)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([a,i])=>n(a,i)):n(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}ee.create=(r,e,t)=>new ee({left:r,right:e,typeName:m.ZodIntersection,...v(t)});class A extends y{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.array)return u(s,{code:c.invalid_type,expected:f.array,received:s.parsedType}),_;if(s.data.lengththis._def.items.length&&(u(s,{code:c.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...s.data].map((i,o)=>{const l=this._def.items[o]||this._def.rest;return l?l._parse(new R(s,i,s.path,o)):null}).filter(i=>!!i);return s.common.async?Promise.all(a).then(i=>k.mergeArray(t,i)):k.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new A({...this._def,rest:e})}}A.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new A({items:r,typeName:m.ZodTuple,rest:null,...v(e)})};class te extends y{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.object)return u(s,{code:c.invalid_type,expected:f.object,received:s.parsedType}),_;const n=[],a=this._def.keyType,i=this._def.valueType;for(const o in s.data)n.push({key:a._parse(new R(s,o,s.path,o)),value:i._parse(new R(s,s.data[o],s.path,o)),alwaysSet:o in s.data});return s.common.async?k.mergeObjectAsync(t,n):k.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,s){return t instanceof y?new te({keyType:e,valueType:t,typeName:m.ZodRecord,...v(s)}):new te({keyType:C.create(),valueType:e,typeName:m.ZodRecord,...v(t)})}}class me extends y{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.map)return u(s,{code:c.invalid_type,expected:f.map,received:s.parsedType}),_;const n=this._def.keyType,a=this._def.valueType,i=[...s.data.entries()].map(([o,l],d)=>({key:n._parse(new R(s,o,s.path,[d,"key"])),value:a._parse(new R(s,l,s.path,[d,"value"]))}));if(s.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const l of i){const d=await l.key,p=await l.value;if(d.status==="aborted"||p.status==="aborted")return _;(d.status==="dirty"||p.status==="dirty")&&t.dirty(),o.set(d.value,p.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const l of i){const d=l.key,p=l.value;if(d.status==="aborted"||p.status==="aborted")return _;(d.status==="dirty"||p.status==="dirty")&&t.dirty(),o.set(d.value,p.value)}return{status:t.value,value:o}}}}me.create=(r,e,t)=>new me({valueType:e,keyType:r,typeName:m.ZodMap,...v(t)});class U extends y{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.set)return u(s,{code:c.invalid_type,expected:f.set,received:s.parsedType}),_;const n=this._def;n.minSize!==null&&s.data.sizen.maxSize.value&&(u(s,{code:c.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const a=this._def.valueType;function i(l){const d=new Set;for(const p of l){if(p.status==="aborted")return _;p.status==="dirty"&&t.dirty(),d.add(p.value)}return{status:t.value,value:d}}const o=[...s.data.values()].map((l,d)=>a._parse(new R(s,l,s.path,d)));return s.common.async?Promise.all(o).then(l=>i(l)):i(o)}min(e,t){return new U({...this._def,minSize:{value:e,message:h.toString(t)}})}max(e,t){return new U({...this._def,maxSize:{value:e,message:h.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}U.create=(r,e)=>new U({valueType:r,minSize:null,maxSize:null,typeName:m.ZodSet,...v(e)});class B extends y{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.function)return u(t,{code:c.invalid_type,expected:f.function,received:t.parsedType}),_;function s(o,l){return fe({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,le(),W].filter(d=>!!d),issueData:{code:c.invalid_arguments,argumentsError:l}})}function n(o,l){return fe({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,le(),W].filter(d=>!!d),issueData:{code:c.invalid_return_type,returnTypeError:l}})}const a={errorMap:t.common.contextualErrorMap},i=t.data;if(this._def.returns instanceof J){const o=this;return w(async function(...l){const d=new Z([]),p=await o._def.args.parseAsync(l,a).catch(Ee=>{throw d.addIssue(s(l,Ee)),d}),T=await Reflect.apply(i,this,p);return await o._def.returns._def.type.parseAsync(T,a).catch(Ee=>{throw d.addIssue(n(T,Ee)),d})})}else{const o=this;return w(function(...l){const d=o._def.args.safeParse(l,a);if(!d.success)throw new Z([s(l,d.error)]);const p=Reflect.apply(i,this,d.data),T=o._def.returns.safeParse(p,a);if(!T.success)throw new Z([n(p,T.error)]);return T.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new B({...this._def,args:A.create(e).rest(L.create())})}returns(e){return new B({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,s){return new B({args:e||A.create([]).rest(L.create()),returns:t||L.create(),typeName:m.ZodFunction,...v(s)})}}class re extends y{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}re.create=(r,e)=>new re({getter:r,typeName:m.ZodLazy,...v(e)});class se extends y{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return u(t,{received:t.data,code:c.invalid_literal,expected:this._def.value}),_}return{status:"valid",value:e.data}}get value(){return this._def.value}}se.create=(r,e)=>new se({value:r,typeName:m.ZodLiteral,...v(e)});function qe(r,e){return new $({values:r,typeName:m.ZodEnum,...v(e)})}class $ extends y{constructor(){super(...arguments),de.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),s=this._def.values;return u(t,{expected:g.joinValues(s),received:t.parsedType,code:c.invalid_type}),_}if(Te(this,de)||Fe(this,de,new Set(this._def.values)),!Te(this,de).has(e.data)){const t=this._getOrReturnCtx(e),s=this._def.values;return u(t,{received:t.data,code:c.invalid_enum_value,options:s}),_}return w(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return $.create(e,{...this._def,...t})}exclude(e,t=this._def){return $.create(this.options.filter(s=>!e.includes(s)),{...this._def,...t})}}de=new WeakMap;$.create=qe;class ne extends y{constructor(){super(...arguments),ue.set(this,void 0)}_parse(e){const t=g.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==f.string&&s.parsedType!==f.number){const n=g.objectValues(t);return u(s,{expected:g.joinValues(n),received:s.parsedType,code:c.invalid_type}),_}if(Te(this,ue)||Fe(this,ue,new Set(g.getValidEnumValues(this._def.values))),!Te(this,ue).has(e.data)){const n=g.objectValues(t);return u(s,{received:s.data,code:c.invalid_enum_value,options:n}),_}return w(e.data)}get enum(){return this._def.values}}ue=new WeakMap;ne.create=(r,e)=>new ne({values:r,typeName:m.ZodNativeEnum,...v(e)});class J extends y{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.promise&&t.common.async===!1)return u(t,{code:c.invalid_type,expected:f.promise,received:t.parsedType}),_;const s=t.parsedType===f.promise?t.data:Promise.resolve(t.data);return w(s.then(n=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}}J.create=(r,e)=>new J({type:r,typeName:m.ZodPromise,...v(e)});class S extends y{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===m.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:s}=this._processInputParams(e),n=this._def.effect||null,a={addIssue:i=>{u(s,i),i.fatal?t.abort():t.dirty()},get path(){return s.path}};if(a.addIssue=a.addIssue.bind(a),n.type==="preprocess"){const i=n.transform(s.data,a);if(s.common.async)return Promise.resolve(i).then(async o=>{if(t.value==="aborted")return _;const l=await this._def.schema._parseAsync({data:o,path:s.path,parent:s});return l.status==="aborted"?_:l.status==="dirty"||t.value==="dirty"?F(l.value):l});{if(t.value==="aborted")return _;const o=this._def.schema._parseSync({data:i,path:s.path,parent:s});return o.status==="aborted"?_:o.status==="dirty"||t.value==="dirty"?F(o.value):o}}if(n.type==="refinement"){const i=o=>{const l=n.refinement(o,a);if(s.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(s.common.async===!1){const o=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return o.status==="aborted"?_:(o.status==="dirty"&&t.dirty(),i(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(o=>o.status==="aborted"?_:(o.status==="dirty"&&t.dirty(),i(o.value).then(()=>({status:t.value,value:o.value}))))}if(n.type==="transform")if(s.common.async===!1){const i=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!D(i))return i;const o=n.transform(i.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(i=>D(i)?Promise.resolve(n.transform(i.value,a)).then(o=>({status:t.value,value:o})):i);g.assertNever(n)}}S.create=(r,e,t)=>new S({schema:r,typeName:m.ZodEffects,effect:e,...v(t)});S.createWithPreprocess=(r,e,t)=>new S({schema:e,effect:{type:"preprocess",transform:r},typeName:m.ZodEffects,...v(t)});class O extends y{_parse(e){return this._getType(e)===f.undefined?w(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}O.create=(r,e)=>new O({innerType:r,typeName:m.ZodOptional,...v(e)});class V extends y{_parse(e){return this._getType(e)===f.null?w(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}V.create=(r,e)=>new V({innerType:r,typeName:m.ZodNullable,...v(e)});class ae extends y{_parse(e){const{ctx:t}=this._processInputParams(e);let s=t.data;return t.parsedType===f.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ae.create=(r,e)=>new ae({innerType:r,typeName:m.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...v(e)});class ie extends y{_parse(e){const{ctx:t}=this._processInputParams(e),s={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return H(n)?n.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Z(s.common.issues)},input:s.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new Z(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}ie.create=(r,e)=>new ie({innerType:r,typeName:m.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...v(e)});class _e extends y{_parse(e){if(this._getType(e)!==f.nan){const s=this._getOrReturnCtx(e);return u(s,{code:c.invalid_type,expected:f.nan,received:s.parsedType}),_}return{status:"valid",value:e.data}}}_e.create=r=>new _e({typeName:m.ZodNaN,...v(r)});const Je=Symbol("zod_brand");class Se extends y{_parse(e){const{ctx:t}=this._processInputParams(e),s=t.data;return this._def.type._parse({data:s,path:t.path,parent:t})}unwrap(){return this._def.type}}class ce extends y{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?_:a.status==="dirty"?(t.dirty(),F(a.value)):this._def.out._parseAsync({data:a.value,path:s.path,parent:s})})();{const n=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return n.status==="aborted"?_:n.status==="dirty"?(t.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:s.path,parent:s})}}static create(e,t){return new ce({in:e,out:t,typeName:m.ZodPipeline})}}class oe extends y{_parse(e){const t=this._def.innerType._parse(e),s=n=>(D(n)&&(n.value=Object.freeze(n.value)),n);return H(t)?t.then(n=>s(n)):s(t)}unwrap(){return this._def.innerType}}oe.create=(r,e)=>new oe({innerType:r,typeName:m.ZodReadonly,...v(e)});function Ve(r,e){const t=typeof r=="function"?r(e):typeof r=="string"?{message:r}:r;return typeof t=="string"?{message:t}:t}function Re(r,e={},t){return r?q.create().superRefine((s,n)=>{var a,i;const o=r(s);if(o instanceof Promise)return o.then(l=>{var d,p;if(!l){const T=Ve(e,s),ve=(p=(d=T.fatal)!==null&&d!==void 0?d:t)!==null&&p!==void 0?p:!0;n.addIssue({code:"custom",...T,fatal:ve})}});if(!o){const l=Ve(e,s),d=(i=(a=l.fatal)!==null&&a!==void 0?a:t)!==null&&i!==void 0?i:!0;n.addIssue({code:"custom",...l,fatal:d})}}):q.create()}const Ye={object:x.lazycreate};var m;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(m||(m={}));const He=(r,e={message:`Input not instance of ${r.name}`})=>Re(t=>t instanceof r,e),je=C.create,Ie=M.create,Ge=_e.create,Xe=P.create,Me=G.create,Ke=z.create,Qe=he.create,et=X.create,tt=K.create,rt=q.create,st=L.create,nt=j.create,at=pe.create,it=E.create,ot=x.create,ct=x.strictCreate,dt=Q.create,ut=ye.create,lt=ee.create,ft=A.create,ht=te.create,pt=me.create,mt=U.create,_t=B.create,yt=re.create,vt=se.create,gt=$.create,xt=ne.create,bt=J.create,Ze=S.create,kt=O.create,wt=V.create,Tt=S.createWithPreprocess,Zt=ce.create,St=()=>je().optional(),Ct=()=>Ie().optional(),Et=()=>Me().optional(),Ot={string:r=>C.create({...r,coerce:!0}),number:r=>M.create({...r,coerce:!0}),boolean:r=>G.create({...r,coerce:!0}),bigint:r=>P.create({...r,coerce:!0}),date:r=>z.create({...r,coerce:!0})},At=_;var b=Object.freeze({__proto__:null,defaultErrorMap:W,setErrorMap:ze,getErrorMap:le,makeIssue:fe,EMPTY_PATH:Ue,addIssueToContext:u,ParseStatus:k,INVALID:_,DIRTY:F,OK:w,isAborted:ke,isDirty:we,isValid:D,isAsync:H,get util(){return g},get objectUtil(){return be},ZodParsedType:f,getParsedType:N,ZodType:y,datetimeRegex:Ne,ZodString:C,ZodNumber:M,ZodBigInt:P,ZodBoolean:G,ZodDate:z,ZodSymbol:he,ZodUndefined:X,ZodNull:K,ZodAny:q,ZodUnknown:L,ZodNever:j,ZodVoid:pe,ZodArray:E,ZodObject:x,ZodUnion:Q,ZodDiscriminatedUnion:ye,ZodIntersection:ee,ZodTuple:A,ZodRecord:te,ZodMap:me,ZodSet:U,ZodFunction:B,ZodLazy:re,ZodLiteral:se,ZodEnum:$,ZodNativeEnum:ne,ZodPromise:J,ZodEffects:S,ZodTransformer:S,ZodOptional:O,ZodNullable:V,ZodDefault:ae,ZodCatch:ie,ZodNaN:_e,BRAND:Je,ZodBranded:Se,ZodPipeline:ce,ZodReadonly:oe,custom:Re,Schema:y,ZodSchema:y,late:Ye,get ZodFirstPartyTypeKind(){return m},coerce:Ot,any:rt,array:it,bigint:Xe,boolean:Me,date:Ke,discriminatedUnion:ut,effect:Ze,enum:gt,function:_t,instanceof:He,intersection:lt,lazy:yt,literal:vt,map:pt,nan:Ge,nativeEnum:xt,never:nt,null:tt,nullable:wt,number:Ie,object:ot,oboolean:Et,onumber:Ct,optional:kt,ostring:St,pipeline:Zt,preprocess:Tt,promise:bt,record:ht,set:mt,strictObject:ct,string:je,symbol:Qe,transformer:Ze,tuple:ft,undefined:et,union:dt,unknown:st,void:at,NEVER:At,ZodIssueCode:c,quotelessJson:Le,ZodError:Z});const ir=Object.freeze(Object.defineProperty({__proto__:null,BRAND:Je,DIRTY:F,EMPTY_PATH:Ue,INVALID:_,NEVER:At,OK:w,ParseStatus:k,Schema:y,ZodAny:q,ZodArray:E,ZodBigInt:P,ZodBoolean:G,ZodBranded:Se,ZodCatch:ie,ZodDate:z,ZodDefault:ae,ZodDiscriminatedUnion:ye,ZodEffects:S,ZodEnum:$,ZodError:Z,get ZodFirstPartyTypeKind(){return m},ZodFunction:B,ZodIntersection:ee,ZodIssueCode:c,ZodLazy:re,ZodLiteral:se,ZodMap:me,ZodNaN:_e,ZodNativeEnum:ne,ZodNever:j,ZodNull:K,ZodNullable:V,ZodNumber:M,ZodObject:x,ZodOptional:O,ZodParsedType:f,ZodPipeline:ce,ZodPromise:J,ZodReadonly:oe,ZodRecord:te,ZodSchema:y,ZodSet:U,ZodString:C,ZodSymbol:he,ZodTransformer:S,ZodTuple:A,ZodType:y,ZodUndefined:X,ZodUnion:Q,ZodUnknown:L,ZodVoid:pe,addIssueToContext:u,any:rt,array:it,bigint:Xe,boolean:Me,coerce:Ot,custom:Re,date:Ke,datetimeRegex:Ne,default:b,defaultErrorMap:W,discriminatedUnion:ut,effect:Ze,enum:gt,function:_t,getErrorMap:le,getParsedType:N,instanceof:He,intersection:lt,isAborted:ke,isAsync:H,isDirty:we,isValid:D,late:Ye,lazy:yt,literal:vt,makeIssue:fe,map:pt,nan:Ge,nativeEnum:xt,never:nt,null:tt,nullable:wt,number:Ie,object:ot,get objectUtil(){return be},oboolean:Et,onumber:Ct,optional:kt,ostring:St,pipeline:Zt,preprocess:Tt,promise:bt,quotelessJson:Le,record:ht,set:mt,setErrorMap:ze,strictObject:ct,string:je,symbol:Qe,transformer:Ze,tuple:ft,undefined:et,union:dt,unknown:st,get util(){return g},void:at,z:b},Symbol.toStringTag,{value:"Module"}));async function Ce(r,e={},t){return window.__TAURI_INTERNALS__.invoke(r,e,t)}async function Qt(r,e){await Ce("plugin:mcp|connect_server",{command:r,args:e})}async function er(){await Ce("plugin:mcp|disconnect_server")}async function tr(){return await Ce("plugin:mcp|list_tools")}async function rr(r,e){return await Ce("plugin:mcp|call_tool",{name:r,args:e})}const sr=[xe({name:"mcp_list_tools",description:"List all tools available on the MCP server",execute:async(r,e)=>await tr(),parameters:b.object({}),returns:b.object({})}),xe({name:"mcp_connect_server",description:"Connect to the MCP server",execute:async({command:r,args:e})=>(await Qt(r,e),"success"),parameters:b.object({command:b.string().describe("The command to connect to the MCP server"),args:b.array(b.string()).describe("The arguments to pass to the MCP server")}),returns:b.string().describe('If "success", the connection to the MCP server is successful. Otherwise, the connection fails.')}),xe({name:"mcp_disconnect_server",description:"Disconnect from the MCP server",execute:async()=>(await er(),"success"),parameters:b.object({}),returns:b.string().describe('If "success", the connection to the MCP server is successful. Otherwise, the connection fails.')}),xe({name:"mcp_call_tool",description:"Call a tool on the MCP server",execute:async({name:r,parameters:e})=>{const t=Object.fromEntries(e.map(({name:n,value:a})=>[n,a]));return await rr(r,t)},parameters:b.object({name:b.string().describe("The name of the tool to call"),parameters:b.array(b.object({name:b.string().describe("The name of the parameter"),value:b.any().describe("The value of the parameter")})).describe("The parameters to pass to the tool")}),returns:b.object({content:b.array(b.object({type:b.string().describe("The type of the content"),text:b.string().describe("The text of the content")})).describe("The content of the tool call result"),isError:b.boolean().describe("Whether the tool call is an error")}).describe("The result of the tool call")})],or=async()=>Promise.all(sr);export{m as Z,O as a,ir as i,or as m,ar as t}; diff --git a/assets/memory-long-term-CizHAZiS.js b/assets/memory-long-term-C3AAmu0J.js similarity index 71% rename from assets/memory-long-term-CizHAZiS.js rename to assets/memory-long-term-C3AAmu0J.js index 9bc0d50658a1fbfe0f3a0eb7d9e474fb12159cba..6543011a3f5310ba9cbbb7b77678c2b5c2f4e177 100644 --- a/assets/memory-long-term-CizHAZiS.js +++ b/assets/memory-long-term-C3AAmu0J.js @@ -1 +1 @@ -import{d as o,c as t,o as n}from"./index-D3pfQUMu.js";import{b as e}from"./route-block-B_A1xBdJ.js";const r=o({__name:"memory-long-term",setup(c){return(m,a)=>(n(),t("div"))}});typeof e=="function"&&e(r);export{r as default}; +import{d as o,c as t,o as n}from"./index-BNq7Hbz_.js";import{b as e}from"./route-block-B_A1xBdJ.js";const r=o({__name:"memory-long-term",setup(c){return(m,a)=>(n(),t("div"))}});typeof e=="function"&&e(r);export{r as default}; diff --git a/assets/memory-short-term-C9gGzqJ9.js b/assets/memory-short-term-ma1r-ic1.js similarity index 71% rename from assets/memory-short-term-C9gGzqJ9.js rename to assets/memory-short-term-ma1r-ic1.js index b6c2d9ac7207e7272e8dced72f4bb9542acb2709..e0e5247897e9cb403af674101b3e4709bd03fad5 100644 --- a/assets/memory-short-term-C9gGzqJ9.js +++ b/assets/memory-short-term-ma1r-ic1.js @@ -1 +1 @@ -import{d as o,c as t,o as r}from"./index-D3pfQUMu.js";import{b as e}from"./route-block-B_A1xBdJ.js";const n=o({__name:"memory-short-term",setup(c){return(m,a)=>(r(),t("div"))}});typeof e=="function"&&e(n);export{n as default}; +import{d as o,c as t,o as r}from"./index-BNq7Hbz_.js";import{b as e}from"./route-block-B_A1xBdJ.js";const n=o({__name:"memory-short-term",setup(c){return(m,a)=>(r(),t("div"))}});typeof e=="function"&&e(n);export{n as default}; diff --git a/assets/messages-Co8AZqus.js b/assets/messages-Co8AZqus.js deleted file mode 100644 index d4d1ef93836878e7912f2859cf58269138d30e63..0000000000000000000000000000000000000000 --- a/assets/messages-Co8AZqus.js +++ /dev/null @@ -1 +0,0 @@ -import{u as c}from"./queue-6PX0h0Ry.js";import{u as g,l as _}from"./queues-CCpGc-RL.js";/* empty css */import{_ as v}from"./Textarea.vue_vue_type_script_setup_true_lang-DYk_co3B.js";import{d as b,r as o,c as l,o as u,a as e,b as x,u as k,t as p,bA as h,bB as w}from"./index-D3pfQUMu.js";import"./emotions-CAex_2dA.js";import"./Basic.vue_vue_type_script_setup_true_lang-Sei3qL1b.js";const S={flex:"","flex-col":"","gap-2":"","p-2":""},V={flex:"","flex-row":"","gap-2":""},y={"rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-4":""},B={"w-full":"",flex:"","flex-row":"","gap-4":""},M={"w-full":"","rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-2":""},D=b({__name:"messages",setup(Q){const s=o(""),r=o([]),n=o(!1),m=c({handlers:[async i=>{r.value.push(i.data)}]}),d=g(m);async function f(){n.value=!0,d.add(s.value),d.add(_),s.value="",n.value=!1}return(i,t)=>(u(),l("div",S,[e("div",V,[x(k(v),{modelValue:s.value,"onUpdate:modelValue":t[0]||(t[0]=a=>s.value=a),placeholder:"Message",p:"2",bg:"neutral-100 dark:neutral-700","w-full":"","rounded-lg":"","outline-none":"",onSubmit:f},null,8,["modelValue"]),e("button",y,p(n.value?"Processing...":"Send"),1)]),e("div",B,[e("div",M,[t[1]||(t[1]=e("h3",{"font-semibold":""}," TTS Message ",-1)),(u(!0),l(h,null,w(r.value,a=>(u(),l("div",{key:a},[e("div",null,p(a),1)]))),128))])])]))}});export{D as default}; diff --git a/assets/messages-MQBl8nH2.js b/assets/messages-MQBl8nH2.js new file mode 100644 index 0000000000000000000000000000000000000000..298c4704461203793be3c6716ffe390550858884 --- /dev/null +++ b/assets/messages-MQBl8nH2.js @@ -0,0 +1 @@ +import{u as c}from"./queue-Bkpr_I5o.js";import{b as g,l as _}from"./queues-yzb6LxwZ.js";/* empty css */import{_ as v}from"./Textarea.vue_vue_type_script_setup_true_lang-DVhP8J-8.js";import{d as b,r as o,c as l,o as u,e,i as x,b as k,t as p,F as h,l as w}from"./index-BNq7Hbz_.js";import"./mini_xsschema-P_8cZcRg.js";import"./Basic.vue_vue_type_script_setup_true_lang-DiEujAxb.js";const S={flex:"","flex-col":"","gap-2":"","p-2":""},V={flex:"","flex-row":"","gap-2":""},y={"rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-4":""},M={"w-full":"",flex:"","flex-row":"","gap-4":""},Q={"w-full":"","rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-2":""},D=b({__name:"messages",setup(B){const s=o(""),r=o([]),a=o(!1),m=c({handlers:[async i=>{r.value.push(i.data)}]}),d=g(m);async function f(){a.value=!0,d.add(s.value),d.add(_),s.value="",a.value=!1}return(i,t)=>(u(),l("div",S,[e("div",V,[x(k(v),{modelValue:s.value,"onUpdate:modelValue":t[0]||(t[0]=n=>s.value=n),placeholder:"Message",p:"2",bg:"neutral-100 dark:neutral-700","w-full":"","rounded-lg":"","outline-none":"",onSubmit:f},null,8,["modelValue"]),e("button",y,p(a.value?"Processing...":"Send"),1)]),e("div",M,[e("div",Q,[t[1]||(t[1]=e("h3",{"font-semibold":""}," TTS Message ",-1)),(u(!0),l(h,null,w(r.value,n=>(u(),l("div",{key:n},[e("div",null,p(n),1)]))),128))])])]))}});export{D as default}; diff --git a/assets/microsoft-speech-JS0kPLKG.js b/assets/microsoft-speech-JS0kPLKG.js new file mode 100644 index 0000000000000000000000000000000000000000..15d3f5afc5b39f7f37af4011c40280d8d8d680b4 --- /dev/null +++ b/assets/microsoft-speech-JS0kPLKG.js @@ -0,0 +1 @@ +import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-B6whjTNv.js";import{d as B,g as F,s as M,r as v,h as g,H,v as K,A as N,o as T,w as b,i as n,b as o,e as q}from"./index-BNq7Hbz_.js";import"./three-vrm-animation.module-BPuMi1if.js";import"./mcp-D2taTyhO.js";import"./mini_xsschema-P_8cZcRg.js";import{u as z}from"./providers-Ddg6LLwH.js";import{u as A}from"./speech-CKvssz06.js";import{_ as E}from"./FieldInput.vue_vue_type_script_setup_true_lang-IanARj3w.js";import{_ as h}from"./FieldRange.vue_vue_type_script_setup_true_lang-RRSKRN5w.js";/* empty css */import{_ as G,a as R}from"./SpeechProviderSettings.vue_vue_type_script_setup_true_lang-DQ9q1Mut.js";import{b as k}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./Input.vue_vue_type_script_setup_true_lang-1pgLpBi1.js";import"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DETFnj2t.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-IiDV8qQX.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BlPB-gCV.js";import"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-8yNUgi8_.js";import"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C-W-PZMl.js";const j={flex:"~ col gap-4"},t="microsoft-speech",C="v1",D=B({__name:"microsoft-speech",setup(I){const{t:a}=F(),P={pitch:0,speed:1,volume:0},r=A(),p=z(),{providers:l}=M(p),m=v(0),V=v(1),_=v(0),d=g({get:()=>{var s;return((s=l.value[t])==null?void 0:s.region)||"eastasia"},set:s=>{l.value[t]||(l.value[t]={region:"eastasia"}),l.value[t].region=s}}),y=g(()=>{var s;return!!((s=l.value[t])!=null&&s.apiKey)}),w=g(()=>r.availableVoices[t]||[]);H(async()=>{await r.loadVoicesForProvider(t)}),K([y,d],async()=>{await r.loadVoicesForProvider(t)});async function U(s,i,e){const c=p.getProviderInstance(t);if(!c)throw new Error("Failed to initialize speech provider");const u=p.getProviderConfig(t),x=u.model||C,S={...u,region:d.value,disableSsml:!e};if(!e&&i){const $=w.value.find(f=>f.id===i);if($){const f=r.generateSSML(s,$,{...u,pitch:m.value});return await r.speech(c,x,f,i,S)}}return await r.speech(c,x,s,i,S)}return(s,i)=>(T(),N(o(R),{"provider-id":t,"default-model":C,"additional-settings":P},{"basic-settings":b(()=>[n(o(E),{modelValue:d.value,"onUpdate:modelValue":i[0]||(i[0]=e=>d.value=e),label:o(a)("settings.pages.providers.provider.microsoft-speech.fields.field.region.label"),description:o(a)("settings.pages.providers.provider.microsoft-speech.fields.field.region.description"),placeholder:"eastasia",required:"",type:"text"},null,8,["modelValue","label","description"])]),"voice-settings":b(()=>[q("div",j,[n(o(h),{modelValue:m.value,"onUpdate:modelValue":i[1]||(i[1]=e=>m.value=e),label:o(a)("settings.pages.providers.provider.common.fields.field.pitch.label"),description:o(a)("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"]),n(o(h),{modelValue:V.value,"onUpdate:modelValue":i[2]||(i[2]=e=>V.value=e),label:o(a)("settings.pages.providers.provider.common.fields.field.speed.label"),description:o(a)("settings.pages.providers.provider.common.fields.field.speed.description"),min:.5,max:2,step:.01},null,8,["modelValue","label","description"]),n(o(h),{modelValue:_.value,"onUpdate:modelValue":i[3]||(i[3]=e=>_.value=e),label:o(a)("settings.pages.providers.provider.common.fields.field.volume.label"),description:o(a)("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:b(()=>[n(o(G),{"available-voices":w.value,"generate-speech":U,"api-key-configured":y.value,"default-text":"Hello! This is a test of the Microsoft Speech synthesis."},null,8,["available-voices","api-key-configured"])]),_:1}))}});typeof k=="function"&&k(D);export{D as default}; diff --git a/assets/microsoft-speech-Q7Jza_kf.js b/assets/microsoft-speech-Q7Jza_kf.js deleted file mode 100644 index c335ff2adacebd07f68ac12987e9ae370232c661..0000000000000000000000000000000000000000 --- a/assets/microsoft-speech-Q7Jza_kf.js +++ /dev/null @@ -1 +0,0 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-t8bgqiA6.js";import{d as B,k as F,s as M,r as v,l as g,f as E,w as K,m as N,o as T,E as b,b as n,u as o,a as q}from"./index-D3pfQUMu.js";import"./three-vrm-animation.module-DLbUhddZ.js";import"./emotions-CAex_2dA.js";import{u as z}from"./providers-CCvie00Z.js";import{u as G}from"./speech-CIOuIakE.js";import{_ as H}from"./FieldInput.vue_vue_type_script_setup_true_lang-Brkyubp9.js";import{_ as h}from"./FieldRange.vue_vue_type_script_setup_true_lang-IEKed7Lk.js";/* empty css */import{_ as R,a as j}from"./SpeechProviderSettings.vue_vue_type_script_setup_true_lang-ByvvVpU4.js";import{b as $}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./Input.vue_vue_type_script_setup_true_lang-B223oRg0.js";import"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Qp-g_fu5.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-DDNOeGH3.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-D_DUmSTM.js";import"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-yC-Tsbbb.js";import"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C8wZQWhG.js";const A={flex:"~ col gap-4"},t="microsoft-speech",C="v1",D=B({__name:"microsoft-speech",setup(I){const{t:a}=F(),P={pitch:0,speed:1,volume:0},r=G(),p=z(),{providers:l}=M(p),m=v(0),V=v(1),_=v(0),d=g({get:()=>{var s;return((s=l.value[t])==null?void 0:s.region)||"eastasia"},set:s=>{l.value[t]||(l.value[t]={region:"eastasia"}),l.value[t].region=s}}),y=g(()=>{var s;return!!((s=l.value[t])!=null&&s.apiKey)}),w=g(()=>r.availableVoices[t]||[]);E(async()=>{await r.loadVoicesForProvider(t)}),K([y,d],async()=>{await r.loadVoicesForProvider(t)});async function U(s,i,e){const c=p.getProviderInstance(t);if(!c)throw new Error("Failed to initialize speech provider");const u=p.getProviderConfig(t),x=u.model||C,S={...u,region:d.value,disableSsml:!e};if(!e&&i){const k=w.value.find(f=>f.id===i);if(k){const f=r.generateSSML(s,k,{...u,pitch:m.value});return await r.speech(c,x,f,i,S)}}return await r.speech(c,x,s,i,S)}return(s,i)=>(T(),N(o(j),{"provider-id":t,"default-model":C,"additional-settings":P},{"basic-settings":b(()=>[n(o(H),{modelValue:d.value,"onUpdate:modelValue":i[0]||(i[0]=e=>d.value=e),label:o(a)("settings.pages.providers.provider.microsoft-speech.fields.field.region.label"),description:o(a)("settings.pages.providers.provider.microsoft-speech.fields.field.region.description"),placeholder:"eastasia",required:"",type:"text"},null,8,["modelValue","label","description"])]),"voice-settings":b(()=>[q("div",A,[n(o(h),{modelValue:m.value,"onUpdate:modelValue":i[1]||(i[1]=e=>m.value=e),label:o(a)("settings.pages.providers.provider.common.fields.field.pitch.label"),description:o(a)("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"]),n(o(h),{modelValue:V.value,"onUpdate:modelValue":i[2]||(i[2]=e=>V.value=e),label:o(a)("settings.pages.providers.provider.common.fields.field.speed.label"),description:o(a)("settings.pages.providers.provider.common.fields.field.speed.description"),min:.5,max:2,step:.01},null,8,["modelValue","label","description"]),n(o(h),{modelValue:_.value,"onUpdate:modelValue":i[3]||(i[3]=e=>_.value=e),label:o(a)("settings.pages.providers.provider.common.fields.field.volume.label"),description:o(a)("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:b(()=>[n(o(R),{"available-voices":w.value,"generate-speech":U,"api-key-configured":y.value,"default-text":"Hello! This is a test of the Microsoft Speech synthesis."},null,8,["available-voices","api-key-configured"])]),_:1}))}});typeof $=="function"&&$(D);export{D as default}; diff --git a/assets/mini_xsschema-P_8cZcRg.js b/assets/mini_xsschema-P_8cZcRg.js new file mode 100644 index 0000000000000000000000000000000000000000..8ca771bfc0b7aa5de0b3d36d2da08780de8de5bb --- /dev/null +++ b/assets/mini_xsschema-P_8cZcRg.js @@ -0,0 +1 @@ +var o=(E=>(E.Idle="<|EMOTE_NEUTRAL|>",E.Happy="<|EMOTE_HAPPY|>",E.Sad="<|EMOTE_SAD|>",E.Angry="<|EMOTE_ANGRY|>",E.Think="<|EMOTE_THINK|>",E.Surprise="<|EMOTE_SURPRISE|>",E.Awkward="<|EMOTE_AWKWARD|>",E.Question="<|EMOTE_QUESTION|>",E))(o||{});const _=Object.values(o),a="Happy",T="Sad",e="Angry",n="Awkward",M="Think",t="Surprise",O="Question",s="Idle",i={"<|EMOTE_HAPPY|>":a,"<|EMOTE_SAD|>":T,"<|EMOTE_ANGRY|>":e,"<|EMOTE_THINK|>":M,"<|EMOTE_SURPRISE|>":t,"<|EMOTE_AWKWARD|>":n,"<|EMOTE_QUESTION|>":O,"<|EMOTE_NEUTRAL|>":s},r={"<|EMOTE_HAPPY|>":"happy","<|EMOTE_SAD|>":"sad","<|EMOTE_ANGRY|>":"angry","<|EMOTE_THINK|>":void 0,"<|EMOTE_SURPRISE|>":"surprised","<|EMOTE_AWKWARD|>":void 0,"<|EMOTE_QUESTION|>":void 0,"<|EMOTE_NEUTRAL|>":void 0},N=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));export{_ as E,o as a,s as b,M as c,e as d,a as e,r as f,i as g,N as m}; diff --git a/assets/mistral-ai-BHjEqcAG.js b/assets/mistral-ai-BHjEqcAG.js deleted file mode 100644 index ed1327f121c81f7cfcbdd82f4af40221d058f760..0000000000000000000000000000000000000000 --- a/assets/mistral-ai-BHjEqcAG.js +++ /dev/null @@ -1 +0,0 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-t8bgqiA6.js";import{d as U,k as V,h as y,s as $,l as c,f as K,w as h,m as w,o as x,E as p,b as l,u as t}from"./index-D3pfQUMu.js";import"./three-vrm-animation.module-DLbUhddZ.js";import"./emotions-CAex_2dA.js";import{u as z}from"./providers-CCvie00Z.js";/* empty css */import{_ as C,a as M}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Qp-g_fu5.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-yC-Tsbbb.js";import{_ as P,a as R}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C8wZQWhG.js";import{_ as S}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-CRYYAVy7.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-DDNOeGH3.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-D_DUmSTM.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-Brkyubp9.js";import"./Input.vue_vue_type_script_setup_true_lang-B223oRg0.js";const a="mistral-ai",B=U({__name:"mistral-ai",setup(I){const{t:u}=V(),b=y(),d=z(),{providers:o}=$(d),n=c(()=>d.getProviderMetadata(a)),r=c({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),s=c({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});K(()=>{var e,i;d.initializeProvider(a),r.value=((e=o.value[a])==null?void 0:e.apiKey)||"",s.value=((i=o.value[a])==null?void 0:i.baseUrl)||""}),h([r,s],()=>{o.value[a]={...o.value[a],apiKey:r.value,baseUrl:s.value||""}});function g(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var v,f;return x(),w(t(S),{"provider-name":(v=n.value)==null?void 0:v.localizedName,"provider-icon-color":(f=n.value)==null?void 0:f.iconColor,"on-back":()=>t(b).back()},{default:p(()=>[l(t(P),null,{default:p(()=>[l(t(R),{title:t(u)("settings.pages.providers.common.section.basic.title"),description:t(u)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:p(()=>{var m;return[l(t(N),{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=k=>r.value=k),"provider-name":(m=n.value)==null?void 0:m.localizedName,placeholder:"mis-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(C),{title:t(u)("settings.pages.providers.common.section.advanced.title")},{default:p(()=>[l(t(M),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=m=>s.value=m),placeholder:"https://api.mistral.ai/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon-color","on-back"])}}});typeof _=="function"&&_(B);export{B as default}; diff --git a/assets/mistral-ai-CbulwOqs.js b/assets/mistral-ai-CbulwOqs.js new file mode 100644 index 0000000000000000000000000000000000000000..ab30fddf14c605ee0b52fa479ea894b69d9fe7c6 --- /dev/null +++ b/assets/mistral-ai-CbulwOqs.js @@ -0,0 +1 @@ +import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-B6whjTNv.js";import{d as V,g as k,U as y,s as $,h as c,H as K,v as h,A as w,o as x,w as p,i as l,b as t}from"./index-BNq7Hbz_.js";import"./three-vrm-animation.module-BPuMi1if.js";import"./mcp-D2taTyhO.js";import"./mini_xsschema-P_8cZcRg.js";import{u as z}from"./providers-Ddg6LLwH.js";/* empty css */import{_ as C,a as M}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DETFnj2t.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-8yNUgi8_.js";import{_ as P,a as R}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C-W-PZMl.js";import{_ as S}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-kCkYL1sn.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-IiDV8qQX.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BlPB-gCV.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-IanARj3w.js";import"./Input.vue_vue_type_script_setup_true_lang-1pgLpBi1.js";const a="mistral-ai",B=V({__name:"mistral-ai",setup(I){const{t:u}=k(),b=y(),d=z(),{providers:o}=$(d),n=c(()=>d.getProviderMetadata(a)),r=c({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),s=c({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});K(()=>{var e,i;d.initializeProvider(a),r.value=((e=o.value[a])==null?void 0:e.apiKey)||"",s.value=((i=o.value[a])==null?void 0:i.baseUrl)||""}),h([r,s],()=>{o.value[a]={...o.value[a],apiKey:r.value,baseUrl:s.value||""}});function g(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var v,f;return x(),w(t(S),{"provider-name":(v=n.value)==null?void 0:v.localizedName,"provider-icon-color":(f=n.value)==null?void 0:f.iconColor,"on-back":()=>t(b).back()},{default:p(()=>[l(t(P),null,{default:p(()=>[l(t(R),{title:t(u)("settings.pages.providers.common.section.basic.title"),description:t(u)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:p(()=>{var m;return[l(t(N),{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=U=>r.value=U),"provider-name":(m=n.value)==null?void 0:m.localizedName,placeholder:"mis-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(C),{title:t(u)("settings.pages.providers.common.section.advanced.title")},{default:p(()=>[l(t(M),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=m=>s.value=m),placeholder:"https://api.mistral.ai/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon-color","on-back"])}}});typeof _=="function"&&_(B);export{B as default}; diff --git a/assets/moonshot-ai-CDYGrHyM.js b/assets/moonshot-ai-CDYGrHyM.js deleted file mode 100644 index 1e0772e48a9f6ac6f91f78d990e2f21dc18cc8c5..0000000000000000000000000000000000000000 --- a/assets/moonshot-ai-CDYGrHyM.js +++ /dev/null @@ -1 +0,0 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-t8bgqiA6.js";import{d as k,k as U,h as V,s as y,l as c,f as $,w as K,m as w,o as x,E as p,b as l,u as t}from"./index-D3pfQUMu.js";import"./three-vrm-animation.module-DLbUhddZ.js";import"./emotions-CAex_2dA.js";import{u as z}from"./providers-CCvie00Z.js";/* empty css */import{_ as M,a as N}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Qp-g_fu5.js";import{_ as P}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-yC-Tsbbb.js";import{_ as R,a as S}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C8wZQWhG.js";import{_ as B}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-CRYYAVy7.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-DDNOeGH3.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-D_DUmSTM.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-Brkyubp9.js";import"./Input.vue_vue_type_script_setup_true_lang-B223oRg0.js";const a="moonshot-ai",C=k({__name:"moonshot-ai",setup(I){const{t:u}=U(),b=V(),d=z(),{providers:o}=y(d),n=c(()=>d.getProviderMetadata(a)),s=c({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),r=c({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});$(()=>{var e,i;d.initializeProvider(a),s.value=((e=o.value[a])==null?void 0:e.apiKey)||"",r.value=((i=o.value[a])==null?void 0:i.baseUrl)||""}),K([s,r],()=>{o.value[a]={...o.value[a],apiKey:s.value,baseUrl:r.value||""}});function g(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var v,f;return x(),w(t(B),{"provider-name":(v=n.value)==null?void 0:v.localizedName,"provider-icon":(f=n.value)==null?void 0:f.icon,"on-back":()=>t(b).back()},{default:p(()=>[l(t(R),null,{default:p(()=>[l(t(S),{title:t(u)("settings.pages.providers.common.section.basic.title"),description:t(u)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:p(()=>{var m;return[l(t(P),{modelValue:s.value,"onUpdate:modelValue":i[0]||(i[0]=h=>s.value=h),"provider-name":(m=n.value)==null?void 0:m.localizedName,placeholder:"ms-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(M),{title:t(u)("settings.pages.providers.common.section.advanced.title")},{default:p(()=>[l(t(N),{modelValue:r.value,"onUpdate:modelValue":i[1]||(i[1]=m=>r.value=m),placeholder:"https://api.moonshot.cn/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});typeof _=="function"&&_(C);export{C as default}; diff --git a/assets/moonshot-ai-Cxu00yNw.js b/assets/moonshot-ai-Cxu00yNw.js new file mode 100644 index 0000000000000000000000000000000000000000..213c620ffa1fd957539a6870e71af33d08e953a3 --- /dev/null +++ b/assets/moonshot-ai-Cxu00yNw.js @@ -0,0 +1 @@ +import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-B6whjTNv.js";import{d as h,g as V,U as k,s as y,h as v,H as $,v as K,A as w,o as x,w as p,i as l,b as t}from"./index-BNq7Hbz_.js";import"./three-vrm-animation.module-BPuMi1if.js";import"./mcp-D2taTyhO.js";import"./mini_xsschema-P_8cZcRg.js";import{u as z}from"./providers-Ddg6LLwH.js";/* empty css */import{_ as M,a as N}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DETFnj2t.js";import{_ as P}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-8yNUgi8_.js";import{_ as R,a as S}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C-W-PZMl.js";import{_ as B}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-kCkYL1sn.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-IiDV8qQX.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BlPB-gCV.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-IanARj3w.js";import"./Input.vue_vue_type_script_setup_true_lang-1pgLpBi1.js";const a="moonshot-ai",C=h({__name:"moonshot-ai",setup(I){const{t:u}=V(),b=k(),d=z(),{providers:o}=y(d),n=v(()=>d.getProviderMetadata(a)),s=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),r=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});$(()=>{var e,i;d.initializeProvider(a),s.value=((e=o.value[a])==null?void 0:e.apiKey)||"",r.value=((i=o.value[a])==null?void 0:i.baseUrl)||""}),K([s,r],()=>{o.value[a]={...o.value[a],apiKey:s.value,baseUrl:r.value||""}});function g(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var c,f;return x(),w(t(B),{"provider-name":(c=n.value)==null?void 0:c.localizedName,"provider-icon":(f=n.value)==null?void 0:f.icon,"on-back":()=>t(b).back()},{default:p(()=>[l(t(R),null,{default:p(()=>[l(t(S),{title:t(u)("settings.pages.providers.common.section.basic.title"),description:t(u)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:p(()=>{var m;return[l(t(P),{modelValue:s.value,"onUpdate:modelValue":i[0]||(i[0]=U=>s.value=U),"provider-name":(m=n.value)==null?void 0:m.localizedName,placeholder:"ms-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(M),{title:t(u)("settings.pages.providers.common.section.advanced.title")},{default:p(()=>[l(t(N),{modelValue:r.value,"onUpdate:modelValue":i[1]||(i[1]=m=>r.value=m),placeholder:"https://api.moonshot.cn/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});typeof _=="function"&&_(C);export{C as default}; diff --git a/assets/novita-ai-CuTBCJhw.js b/assets/novita-ai-CuTBCJhw.js new file mode 100644 index 0000000000000000000000000000000000000000..b725ff030777a2316ece0d5db0b5ed0ed668f055 --- /dev/null +++ b/assets/novita-ai-CuTBCJhw.js @@ -0,0 +1 @@ +import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-B6whjTNv.js";import{d as V,g as k,U as y,s as $,h as v,H as K,v as h,A as w,o as x,w as u,i as l,b as t}from"./index-BNq7Hbz_.js";import"./three-vrm-animation.module-BPuMi1if.js";import"./mcp-D2taTyhO.js";import"./mini_xsschema-P_8cZcRg.js";import{u as z}from"./providers-Ddg6LLwH.js";/* empty css */import{_ as C,a as M}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DETFnj2t.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-8yNUgi8_.js";import{_ as P,a as R}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C-W-PZMl.js";import{_ as S}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-kCkYL1sn.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-IiDV8qQX.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BlPB-gCV.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-IanARj3w.js";import"./Input.vue_vue_type_script_setup_true_lang-1pgLpBi1.js";const a="novita-ai",B=V({__name:"novita-ai",setup(I){const{t:m}=k(),b=y(),d=z(),{providers:o}=$(d),n=v(()=>d.getProviderMetadata(a)),r=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),s=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});K(()=>{var e,i;d.initializeProvider(a),r.value=((e=o.value[a])==null?void 0:e.apiKey)||"",s.value=((i=o.value[a])==null?void 0:i.baseUrl)||""}),h([r,s],()=>{o.value[a]={...o.value[a],apiKey:r.value,baseUrl:s.value||""}});function g(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var c,f;return x(),w(t(S),{"provider-name":(c=n.value)==null?void 0:c.localizedName,"provider-icon-color":(f=n.value)==null?void 0:f.iconColor,"on-back":()=>t(b).back()},{default:u(()=>[l(t(P),null,{default:u(()=>[l(t(R),{title:t(m)("settings.pages.providers.common.section.basic.title"),description:t(m)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:u(()=>{var p;return[l(t(N),{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=U=>r.value=U),"provider-name":(p=n.value)==null?void 0:p.localizedName,placeholder:"nvt-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(C),{title:t(m)("settings.pages.providers.common.section.advanced.title")},{default:u(()=>[l(t(M),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=p=>s.value=p),placeholder:"https://api.novita.ai/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon-color","on-back"])}}});typeof _=="function"&&_(B);export{B as default}; diff --git a/assets/novita-ai-DyRbwzhU.js b/assets/novita-ai-DyRbwzhU.js deleted file mode 100644 index 54256c69a0d0ebc1d2a8913667e36cf5d64d7274..0000000000000000000000000000000000000000 --- a/assets/novita-ai-DyRbwzhU.js +++ /dev/null @@ -1 +0,0 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-t8bgqiA6.js";import{d as U,k as V,h as y,s as $,l as v,f as K,w as h,m as w,o as x,E as u,b as l,u as t}from"./index-D3pfQUMu.js";import"./three-vrm-animation.module-DLbUhddZ.js";import"./emotions-CAex_2dA.js";import{u as z}from"./providers-CCvie00Z.js";/* empty css */import{_ as C,a as M}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Qp-g_fu5.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-yC-Tsbbb.js";import{_ as P,a as R}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C8wZQWhG.js";import{_ as S}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-CRYYAVy7.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-DDNOeGH3.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-D_DUmSTM.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-Brkyubp9.js";import"./Input.vue_vue_type_script_setup_true_lang-B223oRg0.js";const a="novita-ai",B=U({__name:"novita-ai",setup(I){const{t:m}=V(),b=y(),d=z(),{providers:o}=$(d),n=v(()=>d.getProviderMetadata(a)),r=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),s=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});K(()=>{var e,i;d.initializeProvider(a),r.value=((e=o.value[a])==null?void 0:e.apiKey)||"",s.value=((i=o.value[a])==null?void 0:i.baseUrl)||""}),h([r,s],()=>{o.value[a]={...o.value[a],apiKey:r.value,baseUrl:s.value||""}});function g(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var c,f;return x(),w(t(S),{"provider-name":(c=n.value)==null?void 0:c.localizedName,"provider-icon-color":(f=n.value)==null?void 0:f.iconColor,"on-back":()=>t(b).back()},{default:u(()=>[l(t(P),null,{default:u(()=>[l(t(R),{title:t(m)("settings.pages.providers.common.section.basic.title"),description:t(m)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:u(()=>{var p;return[l(t(N),{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=k=>r.value=k),"provider-name":(p=n.value)==null?void 0:p.localizedName,placeholder:"nvt-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(C),{title:t(m)("settings.pages.providers.common.section.advanced.title")},{default:u(()=>[l(t(M),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=p=>s.value=p),placeholder:"https://api.novita.ai/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon-color","on-back"])}}});typeof _=="function"&&_(B);export{B as default}; diff --git a/assets/ollama-C5hsqtdz.js b/assets/ollama-C5hsqtdz.js new file mode 100644 index 0000000000000000000000000000000000000000..ae1ddb31bf2a9b62a2ccf0bd20cbb707be350d96 --- /dev/null +++ b/assets/ollama-C5hsqtdz.js @@ -0,0 +1 @@ +import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-B6whjTNv.js";import{d as K,m as x,u as U,c as g,o as f,i as m,r as w,v as B,K as O,e as _,x as R,k as S,j as z,t as $,F as D,l as F,g as I,U as A,s as T,h as M,H as j,ay as E,A as H,w as V,b as o}from"./index-BNq7Hbz_.js";import"./three-vrm-animation.module-BPuMi1if.js";import"./mcp-D2taTyhO.js";import"./mini_xsschema-P_8cZcRg.js";import{u as L}from"./providers-Ddg6LLwH.js";import{_ as q}from"./Input.vue_vue_type_script_setup_true_lang-1pgLpBi1.js";/* empty css */import{a as G,_ as J}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DETFnj2t.js";import{_ as Q,a as W}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C-W-PZMl.js";import{_ as X}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-kCkYL1sn.js";import{b as C}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-IiDV8qQX.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BlPB-gCV.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-IanARj3w.js";const Y={flex:"~ gap-2"},Z=K({__name:"InputKeyValue",props:x({name:null,keyPlaceholder:null,valuePlaceholder:null},{propertyKey:{required:!0},propertyKeyModifiers:{},propertyValue:{required:!0},propertyValueModifiers:{}}),emits:["update:propertyKey","update:propertyValue"],setup(v){const a=v,s=U(v,"propertyKey"),u=U(v,"propertyValue");return(r,t)=>(f(),g("div",Y,[m(q,{modelValue:s.value,"onUpdate:modelValue":t[0]||(t[0]=i=>s.value=i),placeholder:a.keyPlaceholder,class:"w-1/2"},null,8,["modelValue","placeholder"]),m(q,{modelValue:u.value,"onUpdate:modelValue":t[1]||(t[1]=i=>u.value=i),placeholder:a.valuePlaceholder,class:"w-1/2"},null,8,["modelValue","placeholder"])]))}}),ee={"max-w-full":""},le={flex:"~ col gap-2"},te={class:"flex items-center gap-1 text-sm font-medium"},oe={key:0,class:"text-red-500"},ae={class:"text-xs text-neutral-500 dark:text-neutral-400","text-nowrap":""},re={flex:"~ col gap-2"},se=["onClick"],ie=K({__name:"FieldKeyValues",props:x({label:null,description:null,name:null,keyPlaceholder:null,valuePlaceholder:null,required:{type:Boolean},inputClass:null},{modelValue:{required:!0},modelModifiers:{}}),emits:x(["remove","add"],["update:modelValue"]),setup(v,{emit:a}){const s=v,u=a,r=U(v,"modelValue"),t=w(""),i=w("");return B([t,i],()=>{u("add",t.value,i.value)}),(P,p)=>{const b=O("auto-animate");return f(),g("div",ee,[_("label",le,[_("div",null,[_("div",te,[S($(s.label)+" ",1),s.required!==!1?(f(),g("span",oe,"*")):z("",!0)]),_("div",ae,$(s.description),1)]),R((f(),g("div",re,[(f(!0),g(D,null,F(r.value,(y,l)=>(f(),g("div",{key:l,"w-full":"",flex:"","items-center":"","gap-2":""},[m(Z,{"property-key":y.key,"onUpdate:propertyKey":e=>y.key=e,"property-value":y.value,"onUpdate:propertyValue":e=>y.value=e,"key-placeholder":s.keyPlaceholder,"value-placeholder":s.valuePlaceholder,"w-full":""},null,8,["property-key","onUpdate:propertyKey","property-value","onUpdate:propertyValue","key-placeholder","value-placeholder"]),_("button",{onClick:e=>u("remove",l)},p[0]||(p[0]=[_("div",{"i-solar:minus-circle-line-duotone":"",size:"6"},null,-1)]),8,se)]))),128))])),[[b]])])])}}}),d="ollama",ne=K({__name:"ollama",setup(v){const{t:a}=I(),s=A(),u=L(),{providers:r}=T(u),t=M(()=>u.getProviderMetadata(d)),i=M({get:()=>{var l,e,n;return((l=r.value[d])==null?void 0:l.baseUrl)||((n=(e=t.value)==null?void 0:e.defaultOptions)==null?void 0:n.baseUrl)||""},set:l=>{r.value[d]||(r.value[d]={}),r.value[d].baseUrl=l}});j(()=>{var l,e,n,h;u.initializeProvider(d),i.value=((l=r.value[d])==null?void 0:l.baseUrl)||((n=(e=t.value)==null?void 0:e.defaultOptions)==null?void 0:n.baseUrl)||"",(h=r.value[d])!=null&&h.headers||(r.value[d].headers={})});function P(){var l;r.value[d]={...(l=t.value)==null?void 0:l.defaultOptions}}const p=E([{key:"",value:""}]);function b(l,e,n){l&&l.push({key:e,value:n})}function y(l,e){e&&(e.length===1?(e[0].key="",e[0].value=""):e.splice(l,1))}return B(p,l=>{l.length>0&&(l[l.length-1].key!==""||l[l.length-1].value!=="")&&l.push({key:"",value:""})},{deep:!0,immediate:!0}),(l,e)=>{var n,h;return f(),H(o(X),{"provider-name":(n=t.value)==null?void 0:n.localizedName,"provider-icon":(h=t.value)==null?void 0:h.icon,"on-back":()=>o(s).back()},{default:V(()=>[m(o(Q),null,{default:V(()=>[m(o(W),{title:o(a)("settings.pages.providers.common.section.basic.title"),description:o(a)("settings.pages.providers.common.section.basic.description"),"on-reset":P},{default:V(()=>{var c,k;return[m(o(G),{modelValue:i.value,"onUpdate:modelValue":e[0]||(e[0]=N=>i.value=N),placeholder:((k=(c=t.value)==null?void 0:c.defaultOptions)==null?void 0:k.baseUrl)||"",required:""},null,8,["modelValue","placeholder"])]}),_:1},8,["title","description"]),m(o(J),{title:o(a)("settings.pages.providers.common.section.advanced.title")},{default:V(()=>[m(o(ie),{modelValue:p,"onUpdate:modelValue":e[1]||(e[1]=c=>p=c),label:o(a)("settings.pages.providers.common.section.advanced.fields.field.headers.label"),description:o(a)("settings.pages.providers.common.section.advanced.fields.field.headers.description"),"key-placeholder":o(a)("settings.pages.providers.common.section.advanced.fields.field.headers.key.placeholder"),"value-placeholder":o(a)("settings.pages.providers.common.section.advanced.fields.field.headers.value.placeholder"),onAdd:e[2]||(e[2]=(c,k)=>b(p,c,k)),onRemove:e[3]||(e[3]=c=>y(c,p))},null,8,["modelValue","label","description","key-placeholder","value-placeholder"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});typeof C=="function"&&C(ne);export{ne as default}; diff --git a/assets/ollama-x64Z6--K.js b/assets/ollama-x64Z6--K.js deleted file mode 100644 index b50d8db98f9f7f6239ae66d70261d1b40bc3ee8a..0000000000000000000000000000000000000000 --- a/assets/ollama-x64Z6--K.js +++ /dev/null @@ -1 +0,0 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-t8bgqiA6.js";import{d as K,bK as x,bL as U,c as b,o as f,b as m,r as w,w as C,bz as z,a as _,G as O,bN as R,i as S,t as $,bA as D,bB as I,k as A,h as E,s as F,l as M,f as L,cb as T,m as G,E as k,u as a}from"./index-D3pfQUMu.js";import"./three-vrm-animation.module-DLbUhddZ.js";import"./emotions-CAex_2dA.js";import{u as j}from"./providers-CCvie00Z.js";import{_ as q}from"./Input.vue_vue_type_script_setup_true_lang-B223oRg0.js";/* empty css */import{a as H,_ as J}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Qp-g_fu5.js";import{_ as Q,a as W}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C8wZQWhG.js";import{_ as X}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-CRYYAVy7.js";import{b as B}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-DDNOeGH3.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-D_DUmSTM.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-Brkyubp9.js";const Y={flex:"~ gap-2"},Z=K({__name:"InputKeyValue",props:x({name:null,keyPlaceholder:null,valuePlaceholder:null},{propertyKey:{required:!0},propertyKeyModifiers:{},propertyValue:{required:!0},propertyValueModifiers:{}}),emits:["update:propertyKey","update:propertyValue"],setup(v){const o=v,s=U(v,"propertyKey"),u=U(v,"propertyValue");return(r,t)=>(f(),b("div",Y,[m(q,{modelValue:s.value,"onUpdate:modelValue":t[0]||(t[0]=i=>s.value=i),placeholder:o.keyPlaceholder,class:"w-1/2"},null,8,["modelValue","placeholder"]),m(q,{modelValue:u.value,"onUpdate:modelValue":t[1]||(t[1]=i=>u.value=i),placeholder:o.valuePlaceholder,class:"w-1/2"},null,8,["modelValue","placeholder"])]))}}),ee={"max-w-full":""},le={flex:"~ col gap-2"},te={class:"flex items-center gap-1 text-sm font-medium"},ae={key:0,class:"text-red-500"},oe={class:"text-xs text-neutral-500 dark:text-neutral-400","text-nowrap":""},re={flex:"~ col gap-2"},se=["onClick"],ie=K({__name:"FieldKeyValues",props:x({label:null,description:null,name:null,keyPlaceholder:null,valuePlaceholder:null,required:{type:Boolean},inputClass:null},{modelValue:{required:!0},modelModifiers:{}}),emits:x(["remove","add"],["update:modelValue"]),setup(v,{emit:o}){const s=v,u=o,r=U(v,"modelValue"),t=w(""),i=w("");return C([t,i],()=>{u("add",t.value,i.value)}),(P,p)=>{const V=z("auto-animate");return f(),b("div",ee,[_("label",le,[_("div",null,[_("div",te,[R($(s.label)+" ",1),s.required!==!1?(f(),b("span",ae,"*")):S("",!0)]),_("div",oe,$(s.description),1)]),O((f(),b("div",re,[(f(!0),b(D,null,I(r.value,(y,l)=>(f(),b("div",{key:l,"w-full":"",flex:"","items-center":"","gap-2":""},[m(Z,{"property-key":y.key,"onUpdate:propertyKey":e=>y.key=e,"property-value":y.value,"onUpdate:propertyValue":e=>y.value=e,"key-placeholder":s.keyPlaceholder,"value-placeholder":s.valuePlaceholder,"w-full":""},null,8,["property-key","onUpdate:propertyKey","property-value","onUpdate:propertyValue","key-placeholder","value-placeholder"]),_("button",{onClick:e=>u("remove",l)},p[0]||(p[0]=[_("div",{"i-solar:minus-circle-line-duotone":"",size:"6"},null,-1)]),8,se)]))),128))])),[[V]])])])}}}),d="ollama",ne=K({__name:"ollama",setup(v){const{t:o}=A(),s=E(),u=j(),{providers:r}=F(u),t=M(()=>u.getProviderMetadata(d)),i=M({get:()=>{var l,e,n;return((l=r.value[d])==null?void 0:l.baseUrl)||((n=(e=t.value)==null?void 0:e.defaultOptions)==null?void 0:n.baseUrl)||""},set:l=>{r.value[d]||(r.value[d]={}),r.value[d].baseUrl=l}});L(()=>{var l,e,n,g;u.initializeProvider(d),i.value=((l=r.value[d])==null?void 0:l.baseUrl)||((n=(e=t.value)==null?void 0:e.defaultOptions)==null?void 0:n.baseUrl)||"",(g=r.value[d])!=null&&g.headers||(r.value[d].headers={})});function P(){var l;r.value[d]={...(l=t.value)==null?void 0:l.defaultOptions}}const p=T([{key:"",value:""}]);function V(l,e,n){l&&l.push({key:e,value:n})}function y(l,e){e&&(e.length===1?(e[0].key="",e[0].value=""):e.splice(l,1))}return C(p,l=>{l.length>0&&(l[l.length-1].key!==""||l[l.length-1].value!=="")&&l.push({key:"",value:""})},{deep:!0,immediate:!0}),(l,e)=>{var n,g;return f(),G(a(X),{"provider-name":(n=t.value)==null?void 0:n.localizedName,"provider-icon":(g=t.value)==null?void 0:g.icon,"on-back":()=>a(s).back()},{default:k(()=>[m(a(Q),null,{default:k(()=>[m(a(W),{title:a(o)("settings.pages.providers.common.section.basic.title"),description:a(o)("settings.pages.providers.common.section.basic.description"),"on-reset":P},{default:k(()=>{var c,h;return[m(a(H),{modelValue:i.value,"onUpdate:modelValue":e[0]||(e[0]=N=>i.value=N),placeholder:((h=(c=t.value)==null?void 0:c.defaultOptions)==null?void 0:h.baseUrl)||"",required:""},null,8,["modelValue","placeholder"])]}),_:1},8,["title","description"]),m(a(J),{title:a(o)("settings.pages.providers.common.section.advanced.title")},{default:k(()=>[m(a(ie),{modelValue:p,"onUpdate:modelValue":e[1]||(e[1]=c=>p=c),label:a(o)("settings.pages.providers.common.section.advanced.fields.field.headers.label"),description:a(o)("settings.pages.providers.common.section.advanced.fields.field.headers.description"),"key-placeholder":a(o)("settings.pages.providers.common.section.advanced.fields.field.headers.key.placeholder"),"value-placeholder":a(o)("settings.pages.providers.common.section.advanced.fields.field.headers.value.placeholder"),onAdd:e[2]||(e[2]=(c,h)=>V(p,c,h)),onRemove:e[3]||(e[3]=c=>y(c,p))},null,8,["modelValue","label","description","key-placeholder","value-placeholder"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});typeof B=="function"&&B(ne);export{ne as default}; diff --git a/assets/openai-C8A-hPqI.js b/assets/openai-C8A-hPqI.js new file mode 100644 index 0000000000000000000000000000000000000000..6d62da155f9db4f41000a6311c9d280f0c26453c --- /dev/null +++ b/assets/openai-C8A-hPqI.js @@ -0,0 +1 @@ +import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-B6whjTNv.js";import{d as h,g as k,U as V,s as y,h as v,H as $,v as K,A as I,o as w,w as n,i as p,b as t}from"./index-BNq7Hbz_.js";import"./three-vrm-animation.module-BPuMi1if.js";import"./mcp-D2taTyhO.js";import"./mini_xsschema-P_8cZcRg.js";import{u as x}from"./providers-Ddg6LLwH.js";/* empty css */import{_ as A,a as M}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DETFnj2t.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-8yNUgi8_.js";import{_ as R,a as S}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C-W-PZMl.js";import{_ as z}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-kCkYL1sn.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-IiDV8qQX.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BlPB-gCV.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-IanARj3w.js";import"./Input.vue_vue_type_script_setup_true_lang-1pgLpBi1.js";const e="openai",B=h({__name:"openai",setup(C){const{t:m}=k(),b=V(),c=x(),{providers:a}=y(c),u=v(()=>c.getProviderMetadata(e)),s=v({get:()=>{var o;return((o=a.value[e])==null?void 0:o.apiKey)||""},set:o=>{a.value[e]||(a.value[e]={}),a.value[e].apiKey=o}}),r=v({get:()=>{var o;return((o=a.value[e])==null?void 0:o.baseUrl)||"https://api.openai.com/v1/"},set:o=>{a.value[e]||(a.value[e]={}),a.value[e].baseUrl=o}});$(()=>{var o,i;a.value[e]||(a.value[e]={baseUrl:"https://api.openai.com/v1/"}),s.value=((o=a.value[e])==null?void 0:o.apiKey)||"",r.value=((i=a.value[e])==null?void 0:i.baseUrl)||"https://api.openai.com/v1/"}),K([s,r],()=>{a.value[e]={...a.value[e],apiKey:s.value,baseUrl:r.value||"https://api.openai.com/v1/"}});function g(){a.value[e]={baseUrl:"https://api.openai.com/v1/"}}return(o,i)=>{var d,f;return w(),I(t(z),{"provider-name":((d=u.value)==null?void 0:d.localizedName)||"OpenAI","provider-icon":(f=u.value)==null?void 0:f.icon,"on-back":()=>t(b).back()},{default:n(()=>[p(t(R),null,{default:n(()=>[p(t(S),{title:t(m)("settings.pages.providers.common.section.basic.title"),description:t(m)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:n(()=>{var l;return[p(t(N),{modelValue:s.value,"onUpdate:modelValue":i[0]||(i[0]=U=>s.value=U),"provider-name":((l=u.value)==null?void 0:l.localizedName)||"OpenAI",placeholder:"sk-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),p(t(A),{title:t(m)("settings.pages.providers.common.section.advanced.title")},{default:n(()=>[p(t(M),{modelValue:r.value,"onUpdate:modelValue":i[1]||(i[1]=l=>r.value=l),placeholder:"https://api.openai.com/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});typeof _=="function"&&_(B);export{B as default}; diff --git a/assets/openai-Dt0OWE1-.js b/assets/openai-Dt0OWE1-.js deleted file mode 100644 index e60ecdfa63ab6db1d39150b90bac40fc356a0555..0000000000000000000000000000000000000000 --- a/assets/openai-Dt0OWE1-.js +++ /dev/null @@ -1 +0,0 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-t8bgqiA6.js";import{d as U,k,h as V,s as y,l as c,f as $,w as K,m as I,o as w,E as n,b as l,u as t}from"./index-D3pfQUMu.js";import"./three-vrm-animation.module-DLbUhddZ.js";import"./emotions-CAex_2dA.js";import{u as x}from"./providers-CCvie00Z.js";/* empty css */import{_ as M,a as N}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Qp-g_fu5.js";import{_ as R}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-yC-Tsbbb.js";import{_ as S,a as z}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C8wZQWhG.js";import{_ as A}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-CRYYAVy7.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-DDNOeGH3.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-D_DUmSTM.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-Brkyubp9.js";import"./Input.vue_vue_type_script_setup_true_lang-B223oRg0.js";const e="openai",B=U({__name:"openai",setup(C){const{t:m}=k(),b=V(),v=x(),{providers:a}=y(v),u=c(()=>v.getProviderMetadata(e)),s=c({get:()=>{var o;return((o=a.value[e])==null?void 0:o.apiKey)||""},set:o=>{a.value[e]||(a.value[e]={}),a.value[e].apiKey=o}}),r=c({get:()=>{var o;return((o=a.value[e])==null?void 0:o.baseUrl)||"https://api.openai.com/v1/"},set:o=>{a.value[e]||(a.value[e]={}),a.value[e].baseUrl=o}});$(()=>{var o,i;a.value[e]||(a.value[e]={baseUrl:"https://api.openai.com/v1/"}),s.value=((o=a.value[e])==null?void 0:o.apiKey)||"",r.value=((i=a.value[e])==null?void 0:i.baseUrl)||"https://api.openai.com/v1/"}),K([s,r],()=>{a.value[e]={...a.value[e],apiKey:s.value,baseUrl:r.value||"https://api.openai.com/v1/"}});function g(){a.value[e]={baseUrl:"https://api.openai.com/v1/"}}return(o,i)=>{var d,f;return w(),I(t(A),{"provider-name":((d=u.value)==null?void 0:d.localizedName)||"OpenAI","provider-icon":(f=u.value)==null?void 0:f.icon,"on-back":()=>t(b).back()},{default:n(()=>[l(t(S),null,{default:n(()=>[l(t(z),{title:t(m)("settings.pages.providers.common.section.basic.title"),description:t(m)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:n(()=>{var p;return[l(t(R),{modelValue:s.value,"onUpdate:modelValue":i[0]||(i[0]=h=>s.value=h),"provider-name":((p=u.value)==null?void 0:p.localizedName)||"OpenAI",placeholder:"sk-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(M),{title:t(m)("settings.pages.providers.common.section.advanced.title")},{default:n(()=>[l(t(N),{modelValue:r.value,"onUpdate:modelValue":i[1]||(i[1]=p=>r.value=p),placeholder:"https://api.openai.com/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});typeof _=="function"&&_(B);export{B as default}; diff --git a/assets/openrouter-ai-CSDlnHSe.js b/assets/openrouter-ai-CSDlnHSe.js new file mode 100644 index 0000000000000000000000000000000000000000..73cc282cc7d5eff761589739dc33fde773304e54 --- /dev/null +++ b/assets/openrouter-ai-CSDlnHSe.js @@ -0,0 +1 @@ +import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-B6whjTNv.js";import{d as V,g as y,U as $,s as K,h as _,H as O,v as h,A as w,o as x,w as v,i as d,b as r}from"./index-BNq7Hbz_.js";import"./three-vrm-animation.module-BPuMi1if.js";import"./mcp-D2taTyhO.js";import"./mini_xsschema-P_8cZcRg.js";import{u as z}from"./providers-Ddg6LLwH.js";/* empty css */import{_ as M,a as N}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DETFnj2t.js";import{_ as P}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-8yNUgi8_.js";import{_ as R,a as S}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C-W-PZMl.js";import{_ as B}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-kCkYL1sn.js";import{b}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-IiDV8qQX.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BlPB-gCV.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-IanARj3w.js";import"./Input.vue_vue_type_script_setup_true_lang-1pgLpBi1.js";const a="openrouter-ai",C=V({__name:"openrouter-ai",setup(I){const{t:c}=y(),U=$(),f=z(),{providers:o}=K(f),i=_(()=>f.getProviderMetadata(a)),l=_({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),n=_({get:()=>{var e,t,s;return((e=o.value[a])==null?void 0:e.baseUrl)||((s=(t=i.value)==null?void 0:t.defaultOptions)==null?void 0:s.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});O(()=>{var e,t,s,u;f.initializeProvider(a),l.value=((e=o.value[a])==null?void 0:e.apiKey)||"",n.value=((t=o.value[a])==null?void 0:t.baseUrl)||((u=(s=i.value)==null?void 0:s.defaultOptions)==null?void 0:u.baseUrl)||""}),h([l,n],()=>{var e,t;o.value[a]={...o.value[a],apiKey:l.value,baseUrl:n.value||((t=(e=i.value)==null?void 0:e.defaultOptions)==null?void 0:t.baseUrl)||""}});function g(){var e;o.value[a]={...(e=i.value)==null?void 0:e.defaultOptions}}return(e,t)=>{var s,u;return x(),w(r(B),{"provider-name":(s=i.value)==null?void 0:s.localizedName,"provider-icon":(u=i.value)==null?void 0:u.icon,"on-back":()=>r(U).back()},{default:v(()=>[d(r(R),null,{default:v(()=>[d(r(S),{title:r(c)("settings.pages.providers.common.section.basic.title"),description:r(c)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:v(()=>{var p;return[d(r(P),{modelValue:l.value,"onUpdate:modelValue":t[0]||(t[0]=m=>l.value=m),"provider-name":(p=i.value)==null?void 0:p.localizedName,placeholder:"sk-or-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),d(r(M),{title:r(c)("settings.pages.providers.common.section.advanced.title")},{default:v(()=>{var p,m;return[d(r(N),{modelValue:n.value,"onUpdate:modelValue":t[1]||(t[1]=k=>n.value=k),placeholder:((m=(p=i.value)==null?void 0:p.defaultOptions)==null?void 0:m.baseUrl)||""},null,8,["modelValue","placeholder"])]}),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});typeof b=="function"&&b(C);export{C as default}; diff --git a/assets/openrouter-ai-DEt-Ma_F.js b/assets/openrouter-ai-DEt-Ma_F.js deleted file mode 100644 index 4e03e6485b142c8307e8b8cb67e9082f1b193be8..0000000000000000000000000000000000000000 --- a/assets/openrouter-ai-DEt-Ma_F.js +++ /dev/null @@ -1 +0,0 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-t8bgqiA6.js";import{d as V,k as y,h as $,s as K,l as _,f as O,w as h,m as w,o as x,E as v,b as d,u as r}from"./index-D3pfQUMu.js";import"./three-vrm-animation.module-DLbUhddZ.js";import"./emotions-CAex_2dA.js";import{u as z}from"./providers-CCvie00Z.js";/* empty css */import{_ as M,a as N}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Qp-g_fu5.js";import{_ as P}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-yC-Tsbbb.js";import{_ as R,a as S}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C8wZQWhG.js";import{_ as B}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-CRYYAVy7.js";import{b}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-DDNOeGH3.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-D_DUmSTM.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-Brkyubp9.js";import"./Input.vue_vue_type_script_setup_true_lang-B223oRg0.js";const a="openrouter-ai",C=V({__name:"openrouter-ai",setup(I){const{t:c}=y(),U=$(),f=z(),{providers:o}=K(f),i=_(()=>f.getProviderMetadata(a)),s=_({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),n=_({get:()=>{var e,t,l;return((e=o.value[a])==null?void 0:e.baseUrl)||((l=(t=i.value)==null?void 0:t.defaultOptions)==null?void 0:l.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});O(()=>{var e,t,l,u;f.initializeProvider(a),s.value=((e=o.value[a])==null?void 0:e.apiKey)||"",n.value=((t=o.value[a])==null?void 0:t.baseUrl)||((u=(l=i.value)==null?void 0:l.defaultOptions)==null?void 0:u.baseUrl)||""}),h([s,n],()=>{var e,t;o.value[a]={...o.value[a],apiKey:s.value,baseUrl:n.value||((t=(e=i.value)==null?void 0:e.defaultOptions)==null?void 0:t.baseUrl)||""}});function g(){var e;o.value[a]={...(e=i.value)==null?void 0:e.defaultOptions}}return(e,t)=>{var l,u;return x(),w(r(B),{"provider-name":(l=i.value)==null?void 0:l.localizedName,"provider-icon":(u=i.value)==null?void 0:u.icon,"on-back":()=>r(U).back()},{default:v(()=>[d(r(R),null,{default:v(()=>[d(r(S),{title:r(c)("settings.pages.providers.common.section.basic.title"),description:r(c)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:v(()=>{var p;return[d(r(P),{modelValue:s.value,"onUpdate:modelValue":t[0]||(t[0]=m=>s.value=m),"provider-name":(p=i.value)==null?void 0:p.localizedName,placeholder:"sk-or-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),d(r(M),{title:r(c)("settings.pages.providers.common.section.advanced.title")},{default:v(()=>{var p,m;return[d(r(N),{modelValue:n.value,"onUpdate:modelValue":t[1]||(t[1]=k=>n.value=k),placeholder:((m=(p=i.value)==null?void 0:p.defaultOptions)==null?void 0:m.baseUrl)||""},null,8,["modelValue","placeholder"])]}),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});typeof b=="function"&&b(C);export{C as default}; diff --git a/assets/providers-CCvie00Z.js b/assets/providers-CCvie00Z.js deleted file mode 100644 index 22e3af6030fdb8ba5a39f49d68cc66c4858bbad4..0000000000000000000000000000000000000000 --- a/assets/providers-CCvie00Z.js +++ /dev/null @@ -1 +0,0 @@ -var le=Object.defineProperty;var de=(a,i,n)=>i in a?le(a,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):a[i]=n;var G=(a,i,n)=>de(a,typeof i!="symbol"?i+"":i,n);import{v as ce,bG as pe,k as ue,r as U,w as ge,l as k}from"./index-D3pfQUMu.js";import{r as me,a as ve,e as _e,o as N}from"./index-LHmcipjy.js";const b=async a=>(a.fetch??globalThis.fetch)(me("models",a.baseURL),{headers:ve(a.headers,a.apiKey),signal:a.abortSignal}).then(_e).then(({data:i})=>i),_=a=>({chat:i=>Object.assign(a,{model:i})}),w=a=>({embed:i=>Object.assign(a,{model:i})}),f=a=>({model:()=>a}),he=a=>({speech:i=>Object.assign(a,{model:i})}),fe=a=>({transcription:i=>Object.assign(a,{model:i})}),g=(a,i)=>({metadata:{id:a,...i}}),m=(...a)=>Object.assign(a[0],...a.slice(1)),be=(a,i="https://api.anthropic.com/v1/")=>m(g("anthropic"),_({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),D=(a,i="https://api.deepseek.com/")=>m(g("deepseek"),_({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),V=(a,i="https://api.fireworks.ai/inference/v1/")=>m(g("fireworks"),_({apiKey:a,baseURL:i}),w({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),W=(a,i="https://generativelanguage.googleapis.com/v1beta/openai/")=>m(g("google-generative-ai"),_({apiKey:a,baseURL:i}),w({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),H=(a,i="https://api.mistral.ai/v1/")=>m(g("mistral"),_({apiKey:a,baseURL:i}),w({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),J=(a,i="https://api.moonshot.cn/v1/")=>m(g("moonshot"),_({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),X=(a,i="https://api.novita.ai/v3/openai/")=>m(g("novita"),_({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),E=(a,i="https://api.openai.com/v1/")=>m(g("openai"),_({apiKey:a,baseURL:i}),w({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i}),he({apiKey:a,baseURL:i}),fe({apiKey:a,baseURL:i})),ye=(a,i="")=>m(g("openrouter"),{chat:(n,l)=>{const h={apiKey:a,baseURL:i,model:n};return{...l?(({extraHeaders:s,models:v,provider:u})=>{s!=null&&(h.headers??(h.headers={}),Object.assign(h.headers,s));let c;return u!=null&&(c=N(u)),N({models:v,provider:c})})(l):{},...h}}},f({apiKey:a,baseURL:i})),xe=(a,i="https://api.perplexity.ai/")=>m(g("perplexity"),_({apiKey:a,baseURL:i})),Z=(a,i="https://api.together.xyz/v1/")=>m(g("together-ai"),_({apiKey:a,baseURL:i}),w({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i,fetch:async(...n)=>globalThis.fetch(...n).then(async l=>l.json()).then(l=>Response.json({data:l,object:"list"}))})),Pe=(a,i)=>{const n=`https://api.cloudflare.com/client/v4/accounts/${i}/ai/v1/`;return m(g("workers-ai"),_({apiKey:a,baseURL:n}),w({apiKey:a,baseURL:n}))},Q=(a,i="https://api.x.ai/v1/")=>m(g("xai"),_({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),T=(a="http://localhost:11434/v1/")=>m(g("ollama"),_({baseURL:a}),w({baseURL:a}),f({baseURL:a})),A=(...a)=>Object.assign(a[0],...a.slice(1));class j extends Error{constructor(n,l){super(n);G(this,"response");this.name="XSAIError",this.response=l}}const ke=a=>a.replace(/[A-Z]/g,i=>`_${i.toLowerCase()}`),K=a=>Object.fromEntries(Object.entries(a).map(([i,n])=>[ke(i),n])),we=a=>Object.fromEntries(Object.entries(a).filter(([,i])=>i!==void 0)),Ke=(a,i)=>we({Authorization:i!==void 0?`Bearer ${i}`:void 0,...a}),Me=(a,i)=>{const n=i.toString();return new URL(a,n.endsWith("/")?n:`${n}/`)},Ce=async a=>{if(!a.ok)throw new j(`Remote sent ${a.status} response: ${await a.text()}`,a);if(!a.body)throw new j("Response body is empty from remote server",a);if(!(a.body instanceof ReadableStream))throw new j(`Expected Response body to be a ReadableStream, but got ${String(a.body)}; Content Type is ${a.headers.get("Content-Type")}`,a);return a},Oe=async a=>Ce(a).then(async i=>{const n=await i.text();try{return JSON.parse(n)}catch{throw new Error(`Failed to parse response, response body: ${n}`)}});var Y=(a,i="http://localhost:5933/v1/")=>{const n=({applyTextNormalization:t,languageCode:s,nextRequestIds:v,nextText:u,previousRequestIds:c,previousText:y,pronunciationDictionaryLocators:x,seed:M,voiceSettings:C})=>({extraBody:K({applyTextNormalization:t,languageCode:s,nextRequestIds:v,nextText:u,previousRequestIds:c,previousText:y,pronunciationDictionaryLocators:x?x.map(B=>K(B)):void 0,seed:M,voiceSettings:K(C??{similarityBoost:.75,stability:.5})})});return A({speech:(t,s)=>({...s?n(s):{},apiKey:a,baseURL:i,model:`elevenlabs/${t}`})},{voice:t=>(i.endsWith("v1/")?i=i.slice(0,-3):i.endsWith("v1")&&(i=i.slice(0,-2)),{query:"provider=elevenlabs",...t?n(t):{},apiKey:a,baseURL:i})})},R=(a,i="http://localhost:5933/v1/")=>{const n=t=>{const{deploymentId:s,region:v,sampleRate:u}=t,c={deploymentId:s,region:v,sampleRate:u};return"disableSsml"in t?c.disableSsml=t.disableSsml:"lang"in t&&(c.lang=t.lang,c.gender=t.gender,c.voice=t.voice),{extraBody:K(c)}};return A({speech:(t,s)=>({...s?n(s):{},apiKey:a,baseURL:i,model:`microsoft/${t}`})},{voice:t=>(i.endsWith("v1/")?i=i.slice(0,-3):i.endsWith("v1")&&(i=i.slice(0,-2)),{query:`region=${t==null?void 0:t.region}&provider=microsoft`,...t?n(t):{},apiKey:a,baseURL:i})})},ee=(a,i="http://localhost:5933/v1/")=>{const n=t=>{var v,u;const s={app:{appid:(v=t.app)==null?void 0:v.appId,token:a}};return typeof t.app<"u"&&(s.app={...t.app,appid:(u=t.app)==null?void 0:u.appId,token:a}),typeof t.user<"u"&&(s.user=t.user),typeof t.audio<"u"&&(s.audio=t.audio),{extraBody:K(s)}};return A({speech:(t,s)=>({...s?n(s):{},apiKey:a,baseURL:i,model:`volcengine/${t}`})},{voice:t=>(i.endsWith("v1/")?i=i.slice(0,-3):i.endsWith("v1")&&(i=i.slice(0,-2)),{query:"provider=volcengine",...t?n(t):{},apiKey:a,baseURL:i})})},ae=(a,i="http://localhost:5933/v1/")=>{const n=t=>{const{sampleRate:s,volume:v,rate:u,pitch:c}=t,y={sampleRate:s,volume:v,rate:u,pitch:c};return Object.keys(y).forEach(x=>y[x]===void 0&&delete y[x]),{extraBody:K(y)}};return A({speech:(t,s)=>({...s?n(s):{},apiKey:a,baseURL:i,model:`alibaba/${t}`})},{voice:t=>{let s=i;return s.endsWith("v1/")?s=s.slice(0,-3):s.endsWith("v1")&&(s=s.slice(0,-2)),{query:"provider=alibaba",...t?n(t):{},apiKey:a,baseURL:s}}})},q=async a=>(a.fetch??globalThis.fetch)(Me(a.query?`api/voices?${a.query}`:"api/voices",a.baseURL),{headers:Ke({...a.headers},a.apiKey),method:"GET",signal:a.abortSignal}).then(Oe).then(({voices:i})=>i);const Se=[{model_id:"eleven_multilingual_v2",name:"Eleven Multilingual v2",can_be_finetuned:!0,can_do_text_to_speech:!0,can_do_voice_conversion:!1,can_use_style:!0,can_use_speaker_boost:!0,serves_pro_voices:!1,token_cost_factor:1,description:"Our most life-like, emotionally rich mode in 29 languages. Best for voice overs, audiobooks, post-production, or any other content creation needs.",requires_alpha_access:!1,max_characters_request_free_user:1e4,max_characters_request_subscribed_user:1e4,maximum_text_length_per_request:1e4,languages:[{language_id:"en",name:"English"},{language_id:"ja",name:"Japanese"},{language_id:"zh",name:"Chinese"},{language_id:"de",name:"German"},{language_id:"hi",name:"Hindi"},{language_id:"fr",name:"French"},{language_id:"ko",name:"Korean"},{language_id:"pt",name:"Portuguese"},{language_id:"it",name:"Italian"},{language_id:"es",name:"Spanish"},{language_id:"id",name:"Indonesian"},{language_id:"nl",name:"Dutch"},{language_id:"tr",name:"Turkish"},{language_id:"fil",name:"Filipino"},{language_id:"pl",name:"Polish"},{language_id:"sv",name:"Swedish"},{language_id:"bg",name:"Bulgarian"},{language_id:"ro",name:"Romanian"},{language_id:"ar",name:"Arabic"},{language_id:"cs",name:"Czech"},{language_id:"el",name:"Greek"},{language_id:"fi",name:"Finnish"},{language_id:"hr",name:"Croatian"},{language_id:"ms",name:"Malay"},{language_id:"sk",name:"Slovak"},{language_id:"da",name:"Danish"},{language_id:"ta",name:"Tamil"},{language_id:"uk",name:"Ukrainian"},{language_id:"ru",name:"Russian"}],model_rates:{character_cost_multiplier:1},concurrency_group:"standard"},{model_id:"eleven_flash_v2_5",name:"Eleven Flash v2.5",can_be_finetuned:!0,can_do_text_to_speech:!0,can_do_voice_conversion:!1,can_use_style:!1,can_use_speaker_boost:!1,serves_pro_voices:!1,token_cost_factor:1,description:"Our ultra low latency model in 32 languages. Ideal for conversational use cases.",requires_alpha_access:!1,max_characters_request_free_user:4e4,max_characters_request_subscribed_user:4e4,maximum_text_length_per_request:4e4,languages:[{language_id:"en",name:"English"},{language_id:"ja",name:"Japanese"},{language_id:"zh",name:"Chinese"},{language_id:"de",name:"German"},{language_id:"hi",name:"Hindi"},{language_id:"fr",name:"French"},{language_id:"ko",name:"Korean"},{language_id:"pt",name:"Portuguese"},{language_id:"it",name:"Italian"},{language_id:"es",name:"Spanish"},{language_id:"ru",name:"Russian"},{language_id:"id",name:"Indonesian"},{language_id:"nl",name:"Dutch"},{language_id:"tr",name:"Turkish"},{language_id:"fil",name:"Filipino"},{language_id:"pl",name:"Polish"},{language_id:"sv",name:"Swedish"},{language_id:"bg",name:"Bulgarian"},{language_id:"ro",name:"Romanian"},{language_id:"ar",name:"Arabic"},{language_id:"cs",name:"Czech"},{language_id:"el",name:"Greek"},{language_id:"fi",name:"Finnish"},{language_id:"hr",name:"Croatian"},{language_id:"ms",name:"Malay"},{language_id:"sk",name:"Slovak"},{language_id:"da",name:"Danish"},{language_id:"ta",name:"Tamil"},{language_id:"uk",name:"Ukrainian"},{language_id:"hu",name:"Hungarian"},{language_id:"no",name:"Norwegian"},{language_id:"vi",name:"Vietnamese"}],model_rates:{character_cost_multiplier:.5},concurrency_group:"turbo"},{model_id:"eleven_turbo_v2_5",name:"Eleven Turbo v2.5",can_be_finetuned:!0,can_do_text_to_speech:!0,can_do_voice_conversion:!1,can_use_style:!1,can_use_speaker_boost:!1,serves_pro_voices:!1,token_cost_factor:1,description:"Our high quality, low latency model in 32 languages. Best for developer use cases where speed matters and you need non-English languages.",requires_alpha_access:!1,max_characters_request_free_user:4e4,max_characters_request_subscribed_user:4e4,maximum_text_length_per_request:4e4,languages:[{language_id:"en",name:"English"},{language_id:"ja",name:"Japanese"},{language_id:"zh",name:"Chinese"},{language_id:"de",name:"German"},{language_id:"hi",name:"Hindi"},{language_id:"fr",name:"French"},{language_id:"ko",name:"Korean"},{language_id:"pt",name:"Portuguese"},{language_id:"it",name:"Italian"},{language_id:"es",name:"Spanish"},{language_id:"ru",name:"Russian"},{language_id:"id",name:"Indonesian"},{language_id:"nl",name:"Dutch"},{language_id:"tr",name:"Turkish"},{language_id:"fil",name:"Filipino"},{language_id:"pl",name:"Polish"},{language_id:"sv",name:"Swedish"},{language_id:"bg",name:"Bulgarian"},{language_id:"ro",name:"Romanian"},{language_id:"ar",name:"Arabic"},{language_id:"cs",name:"Czech"},{language_id:"el",name:"Greek"},{language_id:"fi",name:"Finnish"},{language_id:"hr",name:"Croatian"},{language_id:"ms",name:"Malay"},{language_id:"sk",name:"Slovak"},{language_id:"da",name:"Danish"},{language_id:"ta",name:"Tamil"},{language_id:"uk",name:"Ukrainian"},{language_id:"vi",name:"Vietnamese"},{language_id:"no",name:"Norwegian"},{language_id:"hu",name:"Hungarian"}],model_rates:{character_cost_multiplier:.5},concurrency_group:"turbo"},{model_id:"eleven_turbo_v2",name:"Eleven Turbo v2",can_be_finetuned:!0,can_do_text_to_speech:!0,can_do_voice_conversion:!1,can_use_style:!1,can_use_speaker_boost:!1,serves_pro_voices:!1,token_cost_factor:1,description:"Our English-only, low latency model. Best for developer use cases where speed matters and you only need English. Performance is on par with Turbo v2.5.",requires_alpha_access:!1,max_characters_request_free_user:3e4,max_characters_request_subscribed_user:3e4,maximum_text_length_per_request:3e4,languages:[{language_id:"en",name:"English"}],model_rates:{character_cost_multiplier:.5},concurrency_group:"turbo"},{model_id:"eleven_flash_v2",name:"Eleven Flash v2",can_be_finetuned:!0,can_do_text_to_speech:!0,can_do_voice_conversion:!1,can_use_style:!1,can_use_speaker_boost:!1,serves_pro_voices:!1,token_cost_factor:1,description:"Our ultra low latency model in english. Ideal for conversational use cases.",requires_alpha_access:!1,max_characters_request_free_user:3e4,max_characters_request_subscribed_user:3e4,maximum_text_length_per_request:3e4,languages:[{language_id:"en",name:"English"}],model_rates:{character_cost_multiplier:.5},concurrency_group:"turbo"},{model_id:"eleven_english_sts_v2",name:"Eleven English v2",can_be_finetuned:!1,can_do_text_to_speech:!1,can_do_voice_conversion:!0,can_use_style:!0,can_use_speaker_boost:!0,serves_pro_voices:!1,token_cost_factor:1,description:"Our state-of-the-art speech to speech model suitable for scenarios where you need maximum control over the content and prosody of your generations.",requires_alpha_access:!1,max_characters_request_free_user:5e3,max_characters_request_subscribed_user:5e3,maximum_text_length_per_request:5e3,languages:[{language_id:"en",name:"English"}],model_rates:{character_cost_multiplier:1},concurrency_group:"standard"},{model_id:"eleven_multilingual_v1",name:"Eleven Multilingual v1",can_be_finetuned:!1,can_do_text_to_speech:!0,can_do_voice_conversion:!1,can_use_style:!1,can_use_speaker_boost:!1,serves_pro_voices:!1,token_cost_factor:1,description:"Our first Multilingual model, capability of generating speech in 10 languages. Now outclassed by Multilingual v2 (for content creation) and Turbo v2.5 (for low latency use cases).",requires_alpha_access:!1,max_characters_request_free_user:1e4,max_characters_request_subscribed_user:1e4,maximum_text_length_per_request:1e4,languages:[{language_id:"en",name:"English"},{language_id:"de",name:"German"},{language_id:"pl",name:"Polish"},{language_id:"es",name:"Spanish"},{language_id:"it",name:"Italian"},{language_id:"fr",name:"French"},{language_id:"pt",name:"Portuguese"},{language_id:"hi",name:"Hindi"},{language_id:"ar",name:"Arabic"}],model_rates:{character_cost_multiplier:1},concurrency_group:"standard"},{model_id:"eleven_multilingual_sts_v2",name:"Eleven Multilingual v2",can_be_finetuned:!0,can_do_text_to_speech:!1,can_do_voice_conversion:!0,can_use_style:!0,can_use_speaker_boost:!0,serves_pro_voices:!1,token_cost_factor:1,description:"Our cutting-edge, multilingual speech-to-speech model is designed for situations that demand unparalleled control over both the content and the prosody of the generated speech across various languages.",requires_alpha_access:!1,max_characters_request_free_user:1e4,max_characters_request_subscribed_user:1e4,maximum_text_length_per_request:1e4,languages:[{language_id:"en",name:"English"},{language_id:"ja",name:"Japanese"},{language_id:"zh",name:"Chinese"},{language_id:"de",name:"German"},{language_id:"hi",name:"Hindi"},{language_id:"fr",name:"French"},{language_id:"ko",name:"Korean"},{language_id:"pt",name:"Portuguese"},{language_id:"it",name:"Italian"},{language_id:"es",name:"Spanish"},{language_id:"ru",name:"Russian"},{language_id:"id",name:"Indonesian"},{language_id:"nl",name:"Dutch"},{language_id:"tr",name:"Turkish"},{language_id:"fil",name:"Filipino"},{language_id:"pl",name:"Polish"},{language_id:"sv",name:"Swedish"},{language_id:"bg",name:"Bulgarian"},{language_id:"ro",name:"Romanian"},{language_id:"ar",name:"Arabic"},{language_id:"cs",name:"Czech"},{language_id:"el",name:"Greek"},{language_id:"fi",name:"Finnish"},{language_id:"hr",name:"Croatian"},{language_id:"ms",name:"Malay"},{language_id:"sk",name:"Slovak"},{language_id:"da",name:"Danish"},{language_id:"ta",name:"Tamil"},{language_id:"uk",name:"Ukrainian"}],model_rates:{character_cost_multiplier:1},concurrency_group:"standard"},{model_id:"eleven_monolingual_v1",name:"Eleven English v1",can_be_finetuned:!1,can_do_text_to_speech:!0,can_do_voice_conversion:!1,can_use_style:!1,can_use_speaker_boost:!1,serves_pro_voices:!1,token_cost_factor:1,description:"Our first ever text to speech model. Now outclassed by Multilingual v2 (for content creation) and Turbo v2.5 (for low latency use cases).",requires_alpha_access:!1,max_characters_request_free_user:1e4,max_characters_request_subscribed_user:1e4,maximum_text_length_per_request:1e4,languages:[{language_id:"en",name:"English"}],model_rates:{character_cost_multiplier:1},concurrency_group:"standard"}],Be=ce("providers",()=>{const a=pe("settings/credentials/providers",{}),{t:i}=ue();async function n(e){try{const r=await fetch("https://openrouter.ai/api/v1/models",{headers:{Authorization:`Bearer ${e.apiKey.trim()}`,"Content-Type":"application/json"}});if(!r.ok)throw new Error(`Failed to fetch OpenRouter models: ${r.statusText}`);return(await r.json()).data.map(o=>({id:o.id,name:o.name||o.id,provider:"openrouter-ai",description:o.description||"",contextLength:o.context_length,deprecated:!1}))}catch(r){throw console.error("Error fetching OpenRouter models:",r),r}}const l={"openrouter-ai":{id:"openrouter-ai",nameKey:"settings.pages.providers.provider.openrouter.title",name:"OpenRouter",descriptionKey:"settings.pages.providers.provider.openrouter.description",description:"openrouter.ai",icon:"i-lobe-icons:openrouter",defaultOptions:{baseUrl:"https://openrouter.ai/api/v1/"},createProvider:e=>ye(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>n(e)},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},ollama:{id:"ollama",nameKey:"settings.pages.providers.provider.ollama.title",name:"Ollama",descriptionKey:"settings.pages.providers.provider.ollama.description",description:"ollama.com",icon:"i-lobe-icons:ollama",defaultOptions:{baseUrl:"http://localhost:11434/v1/"},createProvider:e=>T(e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...T(e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"ollama",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.baseUrl}},vllm:{id:"vllm",nameKey:"settings.pages.providers.provider.vllm.title",name:"vLLM",descriptionKey:"settings.pages.providers.provider.vllm.description",description:"vllm.ai",iconColor:"i-lobe-icons:vllm",createProvider:e=>T(e.baseUrl.trim()),capabilities:{listModels:async()=>[{id:"llama-2-7b",name:"Llama 2 (7B)",provider:"vllm",description:"Meta's Llama 2 7B parameter model",contextLength:4096},{id:"llama-2-13b",name:"Llama 2 (13B)",provider:"vllm",description:"Meta's Llama 2 13B parameter model",contextLength:4096},{id:"llama-2-70b",name:"Llama 2 (70B)",provider:"vllm",description:"Meta's Llama 2 70B parameter model",contextLength:4096},{id:"mistral-7b",name:"Mistral (7B)",provider:"vllm",description:"Mistral AI's 7B parameter model",contextLength:8192},{id:"mixtral-8x7b",name:"Mixtral (8x7B)",provider:"vllm",description:"Mistral AI's Mixtral 8x7B MoE model",contextLength:32768},{id:"custom",name:"Custom Model",provider:"vllm",description:"Specify a custom model name",contextLength:0}]},validators:{validateProviderConfig:e=>!!e.baseUrl}},openai:{id:"openai",nameKey:"settings.pages.providers.provider.openai.title",name:"OpenAI",descriptionKey:"settings.pages.providers.provider.openai.description",description:"openai.com",icon:"i-lobe-icons:openai",defaultOptions:{baseUrl:"https://api.openai.com/v1/"},createProvider:e=>E(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...E(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"openai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},anthropic:{id:"anthropic",nameKey:"settings.pages.providers.provider.anthropic.title",name:"Anthropic",descriptionKey:"settings.pages.providers.provider.anthropic.description",description:"anthropic.com",icon:"i-lobe-icons:anthropic",defaultOptions:{baseUrl:"https://api.anthropic.com/v1/"},createProvider:e=>be(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async()=>[{id:"claude-3-7-sonnet-20250219",name:"Claude 3.7 Sonnet",provider:"anthropic",description:"",contextLength:0,deprecated:!1},{id:"claude-3-5-sonnet-20241022",name:"Claude 3.5 Sonnet (New)",provider:"anthropic",description:"",contextLength:0,deprecated:!1},{id:"claude-3-5-haiku-20241022",name:"Claude 3.5 Haiku",provider:"anthropic",description:"",contextLength:0,deprecated:!1},{id:"claude-3-5-sonnet-20240620",name:"Claude 3.5 Sonnet (Old)",provider:"anthropic",description:"",contextLength:0,deprecated:!1},{id:"claude-3-haiku-20240307",name:"Claude 3 Haiku",provider:"anthropic",description:"",contextLength:0,deprecated:!1},{id:"claude-3-opus-20240229",name:"Claude 3 Opus",provider:"anthropic",description:"",contextLength:0,deprecated:!1}]},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"google-generative-ai":{id:"google-generative-ai",nameKey:"settings.pages.providers.provider.google-generative-ai.title",name:"Google Gemini",descriptionKey:"settings.pages.providers.provider.google-generative-ai.description",description:"ai.google.dev",icon:"i-lobe-icons:gemini",defaultOptions:{baseUrl:"https://generativelanguage.googleapis.com/v1beta/openai/"},createProvider:e=>W(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...W(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"google-generative-ai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},xai:{id:"xai",nameKey:"settings.pages.providers.provider.xai.title",name:"xAI",descriptionKey:"settings.pages.providers.provider.xai.description",description:"x.ai",icon:"i-lobe-icons:xai",createProvider:e=>Q(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...Q(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"xai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},deepseek:{id:"deepseek",nameKey:"settings.pages.providers.provider.deepseek.title",name:"DeepSeek",descriptionKey:"settings.pages.providers.provider.deepseek.description",description:"deepseek.com",iconColor:"i-lobe-icons:deepseek",createProvider:e=>D(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...D(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"deepseek",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},elevenlabs:{id:"elevenlabs",nameKey:"settings.pages.providers.provider.elevenlabs.title",name:"ElevenLabs",descriptionKey:"settings.pages.providers.provider.elevenlabs.description",description:"elevenlabs.io",icon:"i-simple-icons:elevenlabs",defaultOptions:{baseUrl:"https://unspeech.hyp3r.link/v1/",voiceSettings:{similarityBoost:.75,stability:.5}},createProvider:e=>Y(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async()=>Se.map(e=>({id:e.model_id,name:e.name,provider:"elevenlabs",description:e.description,contextLength:0,deprecated:!1})),listVoices:async e=>{const r=Y(e.apiKey.trim(),e.baseUrl.trim()),d=await q({...r.voice()}),o=d.findIndex(P=>P.name.includes("Aria")),p=d.findIndex(P=>P.name.includes("Bill")),I=o!==-1?o:0,F=p!==-1?p:d.length-1,z=Math.min(I,F),L=Math.max(I,F);return[...d.slice(0,z),...d.slice(L+1),...d.slice(z,L+1)].map(P=>({id:P.id,name:P.name,provider:"elevenlabs",previewURL:P.preview_audio_url,languages:P.languages}))}},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"microsoft-speech":{id:"microsoft-speech",nameKey:"settings.pages.providers.provider.microsoft-speech.title",name:"Microsoft / Azure Speech",descriptionKey:"settings.pages.providers.provider.microsoft-speech.description",description:"speech.microsoft.com",iconColor:"i-lobe-icons:microsoft",defaultOptions:{baseUrl:"https://unspeech.hyp3r.link/v1/"},createProvider:e=>R(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async()=>[{id:"v1",name:"v1",provider:"microsoft-speech",description:"",contextLength:0,deprecated:!1}],listVoices:async e=>{const r=R(e.apiKey.trim(),e.baseUrl.trim());return(await q({...r.voice({region:e.region})})).map(o=>{var p;return{id:o.id,name:o.name,provider:"microsoft-speech",previewURL:o.preview_audio_url,languages:o.languages,gender:(p=o.labels)==null?void 0:p.gender}})}},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"alibaba-cloud-model-studio":{id:"alibaba-cloud-model-studio",nameKey:"settings.pages.providers.provider.alibaba-cloud-model-studio.title",name:"Alibaba Cloud Model Studio",descriptionKey:"settings.pages.providers.provider.alibaba-cloud-model-studio.description",description:"bailian.console.aliyun.com",iconColor:"i-lobe-icons:alibabacloud",defaultOptions:{baseUrl:"https://unspeech.hyp3r.link/v1/"},createProvider:e=>ae(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listVoices:async e=>{const r=ae(e.apiKey.trim(),e.baseUrl.trim());return(await q({...r.voice()})).map(o=>{var p;return{id:o.id,name:o.name,provider:"alibaba-cloud-model-studio",previewURL:o.preview_audio_url,languages:o.languages,gender:(p=o.labels)==null?void 0:p.gender}})},listModels:async()=>[{id:"cozyvoice-v1",name:"CozyVoice",provider:"alibaba-cloud-model-studio",description:"",contextLength:0,deprecated:!1},{id:"cozyvoice-v2",name:"CozyVoice (New)",provider:"alibaba-cloud-model-studio",description:"",contextLength:0,deprecated:!1}]},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},volcengine:{id:"volcengine",nameKey:"settings.pages.providers.provider.volcengine.title",name:"settings.pages.providers.provider.volcengine.title",descriptionKey:"settings.pages.providers.provider.volcengine.description",description:"volcengine.com",iconColor:"i-lobe-icons:volcengine",defaultOptions:{baseUrl:"https://unspeech.hyp3r.link/v1/"},createProvider:e=>ee(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listVoices:async e=>{const r=ee(e.apiKey.trim(),e.baseUrl.trim());return(await q({...r.voice()})).map(o=>{var p;return{id:o.id,name:o.name,provider:"volcano-engine",previewURL:o.preview_audio_url,languages:o.languages,gender:(p=o.labels)==null?void 0:p.gender}})},listModels:async()=>[{id:"v1",name:"v1",provider:"volcano-engine",description:"",contextLength:0,deprecated:!1}]},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl&&!!e.app&&!!e.app.appId}},"together-ai":{id:"together-ai",nameKey:"settings.pages.providers.provider.together.title",name:"Together.ai",descriptionKey:"settings.pages.providers.provider.together.description",description:"together.ai",iconColor:"i-lobe-icons:together",createProvider:e=>Z(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...Z(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"together-ai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"novita-ai":{id:"novita-ai",nameKey:"settings.pages.providers.provider.novita.title",name:"Novita",descriptionKey:"settings.pages.providers.provider.novita.description",description:"novita.ai",iconColor:"i-lobe-icons:novita",createProvider:e=>X(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...X(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"novita-ai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"fireworks-ai":{id:"fireworks-ai",nameKey:"settings.pages.providers.provider.fireworks.title",name:"Fireworks.ai",descriptionKey:"settings.pages.providers.provider.fireworks.description",description:"fireworks.ai",icon:"i-lobe-icons:fireworks",createProvider:e=>V(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...V(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"fireworks-ai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"featherless-ai":{id:"featherless-ai",nameKey:"settings.pages.providers.provider.featherless.title",name:"Featherless.ai",descriptionKey:"settings.pages.providers.provider.featherless.description",description:"featherless.ai",icon:"i-lobe-icons:featherless-ai",defaultOptions:{baseUrl:"https://api.featherless.ai/v1/"},createProvider:e=>E(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...E(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"featherless-ai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"cloudflare-workers-ai":{id:"cloudflare-workers-ai",nameKey:"settings.pages.providers.provider.cloudflare-workers-ai.title",name:"Cloudflare Workers AI",descriptionKey:"settings.pages.providers.provider.cloudflare-workers-ai.description",description:"cloudflare.com",iconColor:"i-lobe-icons:cloudflare",createProvider:e=>Pe(e.apiKey.trim(),e.accountId),capabilities:{listModels:async()=>[]},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.accountId}},"perplexity-ai":{id:"perplexity-ai",nameKey:"settings.pages.providers.provider.perplexity.title",name:"Perplexity",descriptionKey:"settings.pages.providers.provider.perplexity.description",description:"perplexity.ai",icon:"i-lobe-icons:perplexity",defaultOptions:{baseUrl:"https://api.perplexity.ai"},createProvider:e=>xe(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async()=>[{id:"sonar-small-online",name:"Sonar Small (Online)",provider:"perplexity-ai",description:"Efficient model with online search capabilities",contextLength:12e3},{id:"sonar-medium-online",name:"Sonar Medium (Online)",provider:"perplexity-ai",description:"Balanced model with online search capabilities",contextLength:12e3},{id:"sonar-large-online",name:"Sonar Large (Online)",provider:"perplexity-ai",description:"Powerful model with online search capabilities",contextLength:12e3},{id:"codey-small",name:"Codey Small",provider:"perplexity-ai",description:"Specialized for code generation and understanding",contextLength:12e3},{id:"codey-large",name:"Codey Large",provider:"perplexity-ai",description:"Advanced code generation and understanding",contextLength:12e3}]},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"mistral-ai":{id:"mistral-ai",nameKey:"settings.pages.providers.provider.mistral.title",name:"Mistral",descriptionKey:"settings.pages.providers.provider.mistral.description",description:"mistral.ai",iconColor:"i-lobe-icons:mistral",createProvider:e=>H(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...H(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"mistral-ai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"moonshot-ai":{id:"moonshot-ai",nameKey:"settings.pages.providers.provider.moonshot.title",name:"Moonshot AI",descriptionKey:"settings.pages.providers.provider.moonshot.description",description:"moonshot.ai",icon:"i-lobe-icons:moonshot",createProvider:e=>J(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...J(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"moonshot-ai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}}};async function h(e){const r=a.value[e];if(!r)return!1;const d=l[e];return d?await d.validators.validateProviderConfig(r):!1}const t=U({});function s(e){var r;if(!a.value[e]){const d=l[e];a.value[e]={baseUrl:((r=d.defaultOptions)==null?void 0:r.baseUrl)||""}}}Object.keys(l).forEach(s);async function v(){await Promise.all(Object.keys(l).map(async e=>{t.value[e]=await h(e)}))}v(),ge(a,v,{deep:!0});const u=k(()=>Object.keys(l).filter(e=>t.value[e])),c=U({}),y=U({}),x=U({});async function M(e){const r=a.value[e];if(!r)return[];const d=l[e];if(!d)return[];y.value[e]=!0,x.value[e]=null;try{const o=d.capabilities.listModels?await d.capabilities.listModels(r):[];return c.value[e]=o.map(p=>({id:p.id,name:p.name,description:p.description,contextLength:p.contextLength,deprecated:p.deprecated,provider:e})),c.value[e]}catch(o){return console.error(`Error fetching models for ${e}:`,o),x.value[e]=o instanceof Error?o.message:"Unknown error",[]}finally{y.value[e]=!1}}function C(e){return c.value[e]||[]}const B=k(()=>{const e=[];for(const r of u.value)e.push(...c.value[r]||[]);return e});async function ie(){for(const e of u.value)l[e].capabilities.listModels&&await M(e)}function $(e){const r=l[e];if(!r)throw new Error(`Provider metadata for ${e} not found`);return{...r,localizedName:i(r.nameKey,r.name),localizedDescription:i(r.descriptionKey,r.description)}}const re=k(()=>Object.values(l).map(e=>({...e,localizedName:i(e.nameKey,e.name),localizedDescription:i(e.descriptionKey,e.description),configured:t.value[e.id]||!1})));function O(e){const r=a.value[e];if(!r)throw new Error(`Provider credentials for ${e} not found`);const d=l[e];if(!d)throw new Error(`Provider metadata for ${e} not found`);try{return d.createProvider(r)}catch(o){throw console.error(`Error creating provider instance for ${e}:`,o),o}}const S=k(()=>u.value.map(e=>$(e))),te=k(()=>S.value.filter(e=>{const r=O(e.id);return"chat"in r&&typeof r.chat=="function"})),ne=k(()=>S.value.filter(e=>{const r=O(e.id);return"transcription"in r&&typeof r.transcription=="function"})),se=k(()=>S.value.filter(e=>{const r=O(e.id);return"speech"in r&&typeof r.speech=="function"}));function oe(e){return a.value[e]}return{providers:a,getProviderConfig:oe,availableProviders:u,configuredProviders:t,providerMetadata:l,getProviderMetadata:$,allProvidersMetadata:re,initializeProvider:s,validateProvider:h,availableModels:c,isLoadingModels:y,modelLoadError:x,fetchModelsForProvider:M,getModelsForProvider:C,allAvailableModels:B,loadModelsForConfiguredProviders:ie,getProviderInstance:O,availableProvidersMetadata:S,availableTextGenerationsProvidersMetadata:te,availableAudioSpeechProvidersMetadata:se,availableAudioTranscriptionProvidersMetadata:ne}});export{b as l,Be as u}; diff --git a/assets/providers-Ddg6LLwH.js b/assets/providers-Ddg6LLwH.js new file mode 100644 index 0000000000000000000000000000000000000000..f203f4efc8d1b958d5298a0a2fdbe4d90bc68ebb --- /dev/null +++ b/assets/providers-Ddg6LLwH.js @@ -0,0 +1 @@ +var le=Object.defineProperty;var de=(a,i,n)=>i in a?le(a,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):a[i]=n;var G=(a,i,n)=>de(a,typeof i!="symbol"?i+"":i,n);import{p as ce,q as pe,g as ue,r as U,v as ge,h as k}from"./index-BNq7Hbz_.js";import{r as me,a as ve,e as _e,o as N}from"./index-LHmcipjy.js";const b=async a=>(a.fetch??globalThis.fetch)(me("models",a.baseURL),{headers:ve(a.headers,a.apiKey),signal:a.abortSignal}).then(_e).then(({data:i})=>i),_=a=>({chat:i=>Object.assign(a,{model:i})}),w=a=>({embed:i=>Object.assign(a,{model:i})}),f=a=>({model:()=>a}),he=a=>({speech:i=>Object.assign(a,{model:i})}),fe=a=>({transcription:i=>Object.assign(a,{model:i})}),g=(a,i)=>({metadata:{id:a,...i}}),m=(...a)=>Object.assign(a[0],...a.slice(1)),be=(a,i="https://api.anthropic.com/v1/")=>m(g("anthropic"),_({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),D=(a,i="https://api.deepseek.com/")=>m(g("deepseek"),_({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),V=(a,i="https://api.fireworks.ai/inference/v1/")=>m(g("fireworks"),_({apiKey:a,baseURL:i}),w({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),W=(a,i="https://generativelanguage.googleapis.com/v1beta/openai/")=>m(g("google-generative-ai"),_({apiKey:a,baseURL:i}),w({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),H=(a,i="https://api.mistral.ai/v1/")=>m(g("mistral"),_({apiKey:a,baseURL:i}),w({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),J=(a,i="https://api.moonshot.cn/v1/")=>m(g("moonshot"),_({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),X=(a,i="https://api.novita.ai/v3/openai/")=>m(g("novita"),_({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),q=(a,i="https://api.openai.com/v1/")=>m(g("openai"),_({apiKey:a,baseURL:i}),w({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i}),he({apiKey:a,baseURL:i}),fe({apiKey:a,baseURL:i})),ye=(a,i="")=>m(g("openrouter"),{chat:(n,l)=>{const h={apiKey:a,baseURL:i,model:n};return{...l?(({extraHeaders:s,models:v,provider:u})=>{s!=null&&(h.headers??(h.headers={}),Object.assign(h.headers,s));let c;return u!=null&&(c=N(u)),N({models:v,provider:c})})(l):{},...h}}},f({apiKey:a,baseURL:i})),xe=(a,i="https://api.perplexity.ai/")=>m(g("perplexity"),_({apiKey:a,baseURL:i})),Z=(a,i="https://api.together.xyz/v1/")=>m(g("together-ai"),_({apiKey:a,baseURL:i}),w({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i,fetch:async(...n)=>globalThis.fetch(...n).then(async l=>l.json()).then(l=>Response.json({data:l,object:"list"}))})),Pe=(a,i)=>{const n=`https://api.cloudflare.com/client/v4/accounts/${i}/ai/v1/`;return m(g("workers-ai"),_({apiKey:a,baseURL:n}),w({apiKey:a,baseURL:n}))},Q=(a,i="https://api.x.ai/v1/")=>m(g("xai"),_({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),T=(a="http://localhost:11434/v1/")=>m(g("ollama"),_({baseURL:a}),w({baseURL:a}),f({baseURL:a})),A=(...a)=>Object.assign(a[0],...a.slice(1));class j extends Error{constructor(n,l){super(n);G(this,"response");this.name="XSAIError",this.response=l}}const ke=a=>a.replace(/[A-Z]/g,i=>`_${i.toLowerCase()}`),K=a=>Object.fromEntries(Object.entries(a).map(([i,n])=>[ke(i),n])),we=a=>Object.fromEntries(Object.entries(a).filter(([,i])=>i!==void 0)),Ke=(a,i)=>we({Authorization:i!==void 0?`Bearer ${i}`:void 0,...a}),Me=(a,i)=>{const n=i.toString();return new URL(a,n.endsWith("/")?n:`${n}/`)},Ce=async a=>{if(!a.ok)throw new j(`Remote sent ${a.status} response: ${await a.text()}`,a);if(!a.body)throw new j("Response body is empty from remote server",a);if(!(a.body instanceof ReadableStream))throw new j(`Expected Response body to be a ReadableStream, but got ${String(a.body)}; Content Type is ${a.headers.get("Content-Type")}`,a);return a},Oe=async a=>Ce(a).then(async i=>{const n=await i.text();try{return JSON.parse(n)}catch{throw new Error(`Failed to parse response, response body: ${n}`)}});var Y=(a,i="http://localhost:5933/v1/")=>{const n=({applyTextNormalization:t,languageCode:s,nextRequestIds:v,nextText:u,previousRequestIds:c,previousText:y,pronunciationDictionaryLocators:x,seed:M,voiceSettings:C})=>({extraBody:K({applyTextNormalization:t,languageCode:s,nextRequestIds:v,nextText:u,previousRequestIds:c,previousText:y,pronunciationDictionaryLocators:x?x.map(B=>K(B)):void 0,seed:M,voiceSettings:K(C??{similarityBoost:.75,stability:.5})})});return A({speech:(t,s)=>({...s?n(s):{},apiKey:a,baseURL:i,model:`elevenlabs/${t}`})},{voice:t=>(i.endsWith("v1/")?i=i.slice(0,-3):i.endsWith("v1")&&(i=i.slice(0,-2)),{query:"provider=elevenlabs",...t?n(t):{},apiKey:a,baseURL:i})})},R=(a,i="http://localhost:5933/v1/")=>{const n=t=>{const{deploymentId:s,region:v,sampleRate:u}=t,c={deploymentId:s,region:v,sampleRate:u};return"disableSsml"in t?c.disableSsml=t.disableSsml:"lang"in t&&(c.lang=t.lang,c.gender=t.gender,c.voice=t.voice),{extraBody:K(c)}};return A({speech:(t,s)=>({...s?n(s):{},apiKey:a,baseURL:i,model:`microsoft/${t}`})},{voice:t=>(i.endsWith("v1/")?i=i.slice(0,-3):i.endsWith("v1")&&(i=i.slice(0,-2)),{query:`region=${t==null?void 0:t.region}&provider=microsoft`,...t?n(t):{},apiKey:a,baseURL:i})})},ee=(a,i="http://localhost:5933/v1/")=>{const n=t=>{var v,u;const s={app:{appid:(v=t.app)==null?void 0:v.appId,token:a}};return typeof t.app<"u"&&(s.app={...t.app,appid:(u=t.app)==null?void 0:u.appId,token:a}),typeof t.user<"u"&&(s.user=t.user),typeof t.audio<"u"&&(s.audio=t.audio),{extraBody:K(s)}};return A({speech:(t,s)=>({...s?n(s):{},apiKey:a,baseURL:i,model:`volcengine/${t}`})},{voice:t=>(i.endsWith("v1/")?i=i.slice(0,-3):i.endsWith("v1")&&(i=i.slice(0,-2)),{query:"provider=volcengine",...t?n(t):{},apiKey:a,baseURL:i})})},ae=(a,i="http://localhost:5933/v1/")=>{const n=t=>{const{sampleRate:s,volume:v,rate:u,pitch:c}=t,y={sampleRate:s,volume:v,rate:u,pitch:c};return Object.keys(y).forEach(x=>y[x]===void 0&&delete y[x]),{extraBody:K(y)}};return A({speech:(t,s)=>({...s?n(s):{},apiKey:a,baseURL:i,model:`alibaba/${t}`})},{voice:t=>{let s=i;return s.endsWith("v1/")?s=s.slice(0,-3):s.endsWith("v1")&&(s=s.slice(0,-2)),{query:"provider=alibaba",...t?n(t):{},apiKey:a,baseURL:s}}})},E=async a=>(a.fetch??globalThis.fetch)(Me(a.query?`api/voices?${a.query}`:"api/voices",a.baseURL),{headers:Ke({...a.headers},a.apiKey),method:"GET",signal:a.abortSignal}).then(Oe).then(({voices:i})=>i);const Se=[{model_id:"eleven_multilingual_v2",name:"Eleven Multilingual v2",can_be_finetuned:!0,can_do_text_to_speech:!0,can_do_voice_conversion:!1,can_use_style:!0,can_use_speaker_boost:!0,serves_pro_voices:!1,token_cost_factor:1,description:"Our most life-like, emotionally rich mode in 29 languages. Best for voice overs, audiobooks, post-production, or any other content creation needs.",requires_alpha_access:!1,max_characters_request_free_user:1e4,max_characters_request_subscribed_user:1e4,maximum_text_length_per_request:1e4,languages:[{language_id:"en",name:"English"},{language_id:"ja",name:"Japanese"},{language_id:"zh",name:"Chinese"},{language_id:"de",name:"German"},{language_id:"hi",name:"Hindi"},{language_id:"fr",name:"French"},{language_id:"ko",name:"Korean"},{language_id:"pt",name:"Portuguese"},{language_id:"it",name:"Italian"},{language_id:"es",name:"Spanish"},{language_id:"id",name:"Indonesian"},{language_id:"nl",name:"Dutch"},{language_id:"tr",name:"Turkish"},{language_id:"fil",name:"Filipino"},{language_id:"pl",name:"Polish"},{language_id:"sv",name:"Swedish"},{language_id:"bg",name:"Bulgarian"},{language_id:"ro",name:"Romanian"},{language_id:"ar",name:"Arabic"},{language_id:"cs",name:"Czech"},{language_id:"el",name:"Greek"},{language_id:"fi",name:"Finnish"},{language_id:"hr",name:"Croatian"},{language_id:"ms",name:"Malay"},{language_id:"sk",name:"Slovak"},{language_id:"da",name:"Danish"},{language_id:"ta",name:"Tamil"},{language_id:"uk",name:"Ukrainian"},{language_id:"ru",name:"Russian"}],model_rates:{character_cost_multiplier:1},concurrency_group:"standard"},{model_id:"eleven_flash_v2_5",name:"Eleven Flash v2.5",can_be_finetuned:!0,can_do_text_to_speech:!0,can_do_voice_conversion:!1,can_use_style:!1,can_use_speaker_boost:!1,serves_pro_voices:!1,token_cost_factor:1,description:"Our ultra low latency model in 32 languages. Ideal for conversational use cases.",requires_alpha_access:!1,max_characters_request_free_user:4e4,max_characters_request_subscribed_user:4e4,maximum_text_length_per_request:4e4,languages:[{language_id:"en",name:"English"},{language_id:"ja",name:"Japanese"},{language_id:"zh",name:"Chinese"},{language_id:"de",name:"German"},{language_id:"hi",name:"Hindi"},{language_id:"fr",name:"French"},{language_id:"ko",name:"Korean"},{language_id:"pt",name:"Portuguese"},{language_id:"it",name:"Italian"},{language_id:"es",name:"Spanish"},{language_id:"ru",name:"Russian"},{language_id:"id",name:"Indonesian"},{language_id:"nl",name:"Dutch"},{language_id:"tr",name:"Turkish"},{language_id:"fil",name:"Filipino"},{language_id:"pl",name:"Polish"},{language_id:"sv",name:"Swedish"},{language_id:"bg",name:"Bulgarian"},{language_id:"ro",name:"Romanian"},{language_id:"ar",name:"Arabic"},{language_id:"cs",name:"Czech"},{language_id:"el",name:"Greek"},{language_id:"fi",name:"Finnish"},{language_id:"hr",name:"Croatian"},{language_id:"ms",name:"Malay"},{language_id:"sk",name:"Slovak"},{language_id:"da",name:"Danish"},{language_id:"ta",name:"Tamil"},{language_id:"uk",name:"Ukrainian"},{language_id:"hu",name:"Hungarian"},{language_id:"no",name:"Norwegian"},{language_id:"vi",name:"Vietnamese"}],model_rates:{character_cost_multiplier:.5},concurrency_group:"turbo"},{model_id:"eleven_turbo_v2_5",name:"Eleven Turbo v2.5",can_be_finetuned:!0,can_do_text_to_speech:!0,can_do_voice_conversion:!1,can_use_style:!1,can_use_speaker_boost:!1,serves_pro_voices:!1,token_cost_factor:1,description:"Our high quality, low latency model in 32 languages. Best for developer use cases where speed matters and you need non-English languages.",requires_alpha_access:!1,max_characters_request_free_user:4e4,max_characters_request_subscribed_user:4e4,maximum_text_length_per_request:4e4,languages:[{language_id:"en",name:"English"},{language_id:"ja",name:"Japanese"},{language_id:"zh",name:"Chinese"},{language_id:"de",name:"German"},{language_id:"hi",name:"Hindi"},{language_id:"fr",name:"French"},{language_id:"ko",name:"Korean"},{language_id:"pt",name:"Portuguese"},{language_id:"it",name:"Italian"},{language_id:"es",name:"Spanish"},{language_id:"ru",name:"Russian"},{language_id:"id",name:"Indonesian"},{language_id:"nl",name:"Dutch"},{language_id:"tr",name:"Turkish"},{language_id:"fil",name:"Filipino"},{language_id:"pl",name:"Polish"},{language_id:"sv",name:"Swedish"},{language_id:"bg",name:"Bulgarian"},{language_id:"ro",name:"Romanian"},{language_id:"ar",name:"Arabic"},{language_id:"cs",name:"Czech"},{language_id:"el",name:"Greek"},{language_id:"fi",name:"Finnish"},{language_id:"hr",name:"Croatian"},{language_id:"ms",name:"Malay"},{language_id:"sk",name:"Slovak"},{language_id:"da",name:"Danish"},{language_id:"ta",name:"Tamil"},{language_id:"uk",name:"Ukrainian"},{language_id:"vi",name:"Vietnamese"},{language_id:"no",name:"Norwegian"},{language_id:"hu",name:"Hungarian"}],model_rates:{character_cost_multiplier:.5},concurrency_group:"turbo"},{model_id:"eleven_turbo_v2",name:"Eleven Turbo v2",can_be_finetuned:!0,can_do_text_to_speech:!0,can_do_voice_conversion:!1,can_use_style:!1,can_use_speaker_boost:!1,serves_pro_voices:!1,token_cost_factor:1,description:"Our English-only, low latency model. Best for developer use cases where speed matters and you only need English. Performance is on par with Turbo v2.5.",requires_alpha_access:!1,max_characters_request_free_user:3e4,max_characters_request_subscribed_user:3e4,maximum_text_length_per_request:3e4,languages:[{language_id:"en",name:"English"}],model_rates:{character_cost_multiplier:.5},concurrency_group:"turbo"},{model_id:"eleven_flash_v2",name:"Eleven Flash v2",can_be_finetuned:!0,can_do_text_to_speech:!0,can_do_voice_conversion:!1,can_use_style:!1,can_use_speaker_boost:!1,serves_pro_voices:!1,token_cost_factor:1,description:"Our ultra low latency model in english. Ideal for conversational use cases.",requires_alpha_access:!1,max_characters_request_free_user:3e4,max_characters_request_subscribed_user:3e4,maximum_text_length_per_request:3e4,languages:[{language_id:"en",name:"English"}],model_rates:{character_cost_multiplier:.5},concurrency_group:"turbo"},{model_id:"eleven_english_sts_v2",name:"Eleven English v2",can_be_finetuned:!1,can_do_text_to_speech:!1,can_do_voice_conversion:!0,can_use_style:!0,can_use_speaker_boost:!0,serves_pro_voices:!1,token_cost_factor:1,description:"Our state-of-the-art speech to speech model suitable for scenarios where you need maximum control over the content and prosody of your generations.",requires_alpha_access:!1,max_characters_request_free_user:5e3,max_characters_request_subscribed_user:5e3,maximum_text_length_per_request:5e3,languages:[{language_id:"en",name:"English"}],model_rates:{character_cost_multiplier:1},concurrency_group:"standard"},{model_id:"eleven_multilingual_v1",name:"Eleven Multilingual v1",can_be_finetuned:!1,can_do_text_to_speech:!0,can_do_voice_conversion:!1,can_use_style:!1,can_use_speaker_boost:!1,serves_pro_voices:!1,token_cost_factor:1,description:"Our first Multilingual model, capability of generating speech in 10 languages. Now outclassed by Multilingual v2 (for content creation) and Turbo v2.5 (for low latency use cases).",requires_alpha_access:!1,max_characters_request_free_user:1e4,max_characters_request_subscribed_user:1e4,maximum_text_length_per_request:1e4,languages:[{language_id:"en",name:"English"},{language_id:"de",name:"German"},{language_id:"pl",name:"Polish"},{language_id:"es",name:"Spanish"},{language_id:"it",name:"Italian"},{language_id:"fr",name:"French"},{language_id:"pt",name:"Portuguese"},{language_id:"hi",name:"Hindi"},{language_id:"ar",name:"Arabic"}],model_rates:{character_cost_multiplier:1},concurrency_group:"standard"},{model_id:"eleven_multilingual_sts_v2",name:"Eleven Multilingual v2",can_be_finetuned:!0,can_do_text_to_speech:!1,can_do_voice_conversion:!0,can_use_style:!0,can_use_speaker_boost:!0,serves_pro_voices:!1,token_cost_factor:1,description:"Our cutting-edge, multilingual speech-to-speech model is designed for situations that demand unparalleled control over both the content and the prosody of the generated speech across various languages.",requires_alpha_access:!1,max_characters_request_free_user:1e4,max_characters_request_subscribed_user:1e4,maximum_text_length_per_request:1e4,languages:[{language_id:"en",name:"English"},{language_id:"ja",name:"Japanese"},{language_id:"zh",name:"Chinese"},{language_id:"de",name:"German"},{language_id:"hi",name:"Hindi"},{language_id:"fr",name:"French"},{language_id:"ko",name:"Korean"},{language_id:"pt",name:"Portuguese"},{language_id:"it",name:"Italian"},{language_id:"es",name:"Spanish"},{language_id:"ru",name:"Russian"},{language_id:"id",name:"Indonesian"},{language_id:"nl",name:"Dutch"},{language_id:"tr",name:"Turkish"},{language_id:"fil",name:"Filipino"},{language_id:"pl",name:"Polish"},{language_id:"sv",name:"Swedish"},{language_id:"bg",name:"Bulgarian"},{language_id:"ro",name:"Romanian"},{language_id:"ar",name:"Arabic"},{language_id:"cs",name:"Czech"},{language_id:"el",name:"Greek"},{language_id:"fi",name:"Finnish"},{language_id:"hr",name:"Croatian"},{language_id:"ms",name:"Malay"},{language_id:"sk",name:"Slovak"},{language_id:"da",name:"Danish"},{language_id:"ta",name:"Tamil"},{language_id:"uk",name:"Ukrainian"}],model_rates:{character_cost_multiplier:1},concurrency_group:"standard"},{model_id:"eleven_monolingual_v1",name:"Eleven English v1",can_be_finetuned:!1,can_do_text_to_speech:!0,can_do_voice_conversion:!1,can_use_style:!1,can_use_speaker_boost:!1,serves_pro_voices:!1,token_cost_factor:1,description:"Our first ever text to speech model. Now outclassed by Multilingual v2 (for content creation) and Turbo v2.5 (for low latency use cases).",requires_alpha_access:!1,max_characters_request_free_user:1e4,max_characters_request_subscribed_user:1e4,maximum_text_length_per_request:1e4,languages:[{language_id:"en",name:"English"}],model_rates:{character_cost_multiplier:1},concurrency_group:"standard"}],Be=ce("providers",()=>{const a=pe("settings/credentials/providers",{}),{t:i}=ue();async function n(e){try{const r=await fetch("https://openrouter.ai/api/v1/models",{headers:{Authorization:`Bearer ${e.apiKey.trim()}`,"Content-Type":"application/json"}});if(!r.ok)throw new Error(`Failed to fetch OpenRouter models: ${r.statusText}`);return(await r.json()).data.map(o=>({id:o.id,name:o.name||o.id,provider:"openrouter-ai",description:o.description||"",contextLength:o.context_length,deprecated:!1}))}catch(r){throw console.error("Error fetching OpenRouter models:",r),r}}const l={"openrouter-ai":{id:"openrouter-ai",nameKey:"settings.pages.providers.provider.openrouter.title",name:"OpenRouter",descriptionKey:"settings.pages.providers.provider.openrouter.description",description:"openrouter.ai",icon:"i-lobe-icons:openrouter",defaultOptions:{baseUrl:"https://openrouter.ai/api/v1/"},createProvider:e=>ye(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>n(e)},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},ollama:{id:"ollama",nameKey:"settings.pages.providers.provider.ollama.title",name:"Ollama",descriptionKey:"settings.pages.providers.provider.ollama.description",description:"ollama.com",icon:"i-lobe-icons:ollama",defaultOptions:{baseUrl:"http://localhost:11434/v1/"},createProvider:e=>T(e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...T(e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"ollama",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.baseUrl}},vllm:{id:"vllm",nameKey:"settings.pages.providers.provider.vllm.title",name:"vLLM",descriptionKey:"settings.pages.providers.provider.vllm.description",description:"vllm.ai",iconColor:"i-lobe-icons:vllm",createProvider:e=>T(e.baseUrl.trim()),capabilities:{listModels:async()=>[{id:"llama-2-7b",name:"Llama 2 (7B)",provider:"vllm",description:"Meta's Llama 2 7B parameter model",contextLength:4096},{id:"llama-2-13b",name:"Llama 2 (13B)",provider:"vllm",description:"Meta's Llama 2 13B parameter model",contextLength:4096},{id:"llama-2-70b",name:"Llama 2 (70B)",provider:"vllm",description:"Meta's Llama 2 70B parameter model",contextLength:4096},{id:"mistral-7b",name:"Mistral (7B)",provider:"vllm",description:"Mistral AI's 7B parameter model",contextLength:8192},{id:"mixtral-8x7b",name:"Mixtral (8x7B)",provider:"vllm",description:"Mistral AI's Mixtral 8x7B MoE model",contextLength:32768},{id:"custom",name:"Custom Model",provider:"vllm",description:"Specify a custom model name",contextLength:0}]},validators:{validateProviderConfig:e=>!!e.baseUrl}},openai:{id:"openai",nameKey:"settings.pages.providers.provider.openai.title",name:"OpenAI",descriptionKey:"settings.pages.providers.provider.openai.description",description:"openai.com",icon:"i-lobe-icons:openai",defaultOptions:{baseUrl:"https://api.openai.com/v1/"},createProvider:e=>q(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...q(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"openai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},anthropic:{id:"anthropic",nameKey:"settings.pages.providers.provider.anthropic.title",name:"Anthropic",descriptionKey:"settings.pages.providers.provider.anthropic.description",description:"anthropic.com",icon:"i-lobe-icons:anthropic",defaultOptions:{baseUrl:"https://api.anthropic.com/v1/"},createProvider:e=>be(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async()=>[{id:"claude-3-7-sonnet-20250219",name:"Claude 3.7 Sonnet",provider:"anthropic",description:"",contextLength:0,deprecated:!1},{id:"claude-3-5-sonnet-20241022",name:"Claude 3.5 Sonnet (New)",provider:"anthropic",description:"",contextLength:0,deprecated:!1},{id:"claude-3-5-haiku-20241022",name:"Claude 3.5 Haiku",provider:"anthropic",description:"",contextLength:0,deprecated:!1},{id:"claude-3-5-sonnet-20240620",name:"Claude 3.5 Sonnet (Old)",provider:"anthropic",description:"",contextLength:0,deprecated:!1},{id:"claude-3-haiku-20240307",name:"Claude 3 Haiku",provider:"anthropic",description:"",contextLength:0,deprecated:!1},{id:"claude-3-opus-20240229",name:"Claude 3 Opus",provider:"anthropic",description:"",contextLength:0,deprecated:!1}]},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"google-generative-ai":{id:"google-generative-ai",nameKey:"settings.pages.providers.provider.google-generative-ai.title",name:"Google Gemini",descriptionKey:"settings.pages.providers.provider.google-generative-ai.description",description:"ai.google.dev",icon:"i-lobe-icons:gemini",defaultOptions:{baseUrl:"https://generativelanguage.googleapis.com/v1beta/openai/"},createProvider:e=>W(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...W(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"google-generative-ai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},xai:{id:"xai",nameKey:"settings.pages.providers.provider.xai.title",name:"xAI",descriptionKey:"settings.pages.providers.provider.xai.description",description:"x.ai",icon:"i-lobe-icons:xai",createProvider:e=>Q(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...Q(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"xai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},deepseek:{id:"deepseek",nameKey:"settings.pages.providers.provider.deepseek.title",name:"DeepSeek",descriptionKey:"settings.pages.providers.provider.deepseek.description",description:"deepseek.com",iconColor:"i-lobe-icons:deepseek",createProvider:e=>D(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...D(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"deepseek",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},elevenlabs:{id:"elevenlabs",nameKey:"settings.pages.providers.provider.elevenlabs.title",name:"ElevenLabs",descriptionKey:"settings.pages.providers.provider.elevenlabs.description",description:"elevenlabs.io",icon:"i-simple-icons:elevenlabs",defaultOptions:{baseUrl:"https://unspeech.hyp3r.link/v1/",voiceSettings:{similarityBoost:.75,stability:.5}},createProvider:e=>Y(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async()=>Se.map(e=>({id:e.model_id,name:e.name,provider:"elevenlabs",description:e.description,contextLength:0,deprecated:!1})),listVoices:async e=>{const r=Y(e.apiKey.trim(),e.baseUrl.trim()),d=await E({...r.voice()}),o=d.findIndex(P=>P.name.includes("Aria")),p=d.findIndex(P=>P.name.includes("Bill")),I=o!==-1?o:0,F=p!==-1?p:d.length-1,z=Math.min(I,F),L=Math.max(I,F);return[...d.slice(0,z),...d.slice(L+1),...d.slice(z,L+1)].map(P=>({id:P.id,name:P.name,provider:"elevenlabs",previewURL:P.preview_audio_url,languages:P.languages}))}},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"microsoft-speech":{id:"microsoft-speech",nameKey:"settings.pages.providers.provider.microsoft-speech.title",name:"Microsoft / Azure Speech",descriptionKey:"settings.pages.providers.provider.microsoft-speech.description",description:"speech.microsoft.com",iconColor:"i-lobe-icons:microsoft",defaultOptions:{baseUrl:"https://unspeech.hyp3r.link/v1/"},createProvider:e=>R(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async()=>[{id:"v1",name:"v1",provider:"microsoft-speech",description:"",contextLength:0,deprecated:!1}],listVoices:async e=>{const r=R(e.apiKey.trim(),e.baseUrl.trim());return(await E({...r.voice({region:e.region})})).map(o=>{var p;return{id:o.id,name:o.name,provider:"microsoft-speech",previewURL:o.preview_audio_url,languages:o.languages,gender:(p=o.labels)==null?void 0:p.gender}})}},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"alibaba-cloud-model-studio":{id:"alibaba-cloud-model-studio",nameKey:"settings.pages.providers.provider.alibaba-cloud-model-studio.title",name:"Alibaba Cloud Model Studio",descriptionKey:"settings.pages.providers.provider.alibaba-cloud-model-studio.description",description:"bailian.console.aliyun.com",iconColor:"i-lobe-icons:alibabacloud",defaultOptions:{baseUrl:"https://unspeech.hyp3r.link/v1/"},createProvider:e=>ae(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listVoices:async e=>{const r=ae(e.apiKey.trim(),e.baseUrl.trim());return(await E({...r.voice()})).map(o=>{var p;return{id:o.id,name:o.name,provider:"alibaba-cloud-model-studio",previewURL:o.preview_audio_url,languages:o.languages,gender:(p=o.labels)==null?void 0:p.gender}})},listModels:async()=>[{id:"cozyvoice-v1",name:"CozyVoice",provider:"alibaba-cloud-model-studio",description:"",contextLength:0,deprecated:!1},{id:"cozyvoice-v2",name:"CozyVoice (New)",provider:"alibaba-cloud-model-studio",description:"",contextLength:0,deprecated:!1}]},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},volcengine:{id:"volcengine",nameKey:"settings.pages.providers.provider.volcengine.title",name:"settings.pages.providers.provider.volcengine.title",descriptionKey:"settings.pages.providers.provider.volcengine.description",description:"volcengine.com",iconColor:"i-lobe-icons:volcengine",defaultOptions:{baseUrl:"https://unspeech.hyp3r.link/v1/"},createProvider:e=>ee(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listVoices:async e=>{const r=ee(e.apiKey.trim(),e.baseUrl.trim());return(await E({...r.voice()})).map(o=>{var p;return{id:o.id,name:o.name,provider:"volcano-engine",previewURL:o.preview_audio_url,languages:o.languages,gender:(p=o.labels)==null?void 0:p.gender}})},listModels:async()=>[{id:"v1",name:"v1",provider:"volcano-engine",description:"",contextLength:0,deprecated:!1}]},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl&&!!e.app&&!!e.app.appId}},"together-ai":{id:"together-ai",nameKey:"settings.pages.providers.provider.together.title",name:"Together.ai",descriptionKey:"settings.pages.providers.provider.together.description",description:"together.ai",iconColor:"i-lobe-icons:together",createProvider:e=>Z(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...Z(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"together-ai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"novita-ai":{id:"novita-ai",nameKey:"settings.pages.providers.provider.novita.title",name:"Novita",descriptionKey:"settings.pages.providers.provider.novita.description",description:"novita.ai",iconColor:"i-lobe-icons:novita",createProvider:e=>X(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...X(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"novita-ai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"fireworks-ai":{id:"fireworks-ai",nameKey:"settings.pages.providers.provider.fireworks.title",name:"Fireworks.ai",descriptionKey:"settings.pages.providers.provider.fireworks.description",description:"fireworks.ai",icon:"i-lobe-icons:fireworks",createProvider:e=>V(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...V(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"fireworks-ai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"featherless-ai":{id:"featherless-ai",nameKey:"settings.pages.providers.provider.featherless.title",name:"Featherless.ai",descriptionKey:"settings.pages.providers.provider.featherless.description",description:"featherless.ai",icon:"i-lobe-icons:featherless-ai",defaultOptions:{baseUrl:"https://api.featherless.ai/v1/"},createProvider:e=>q(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...q(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"featherless-ai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"cloudflare-workers-ai":{id:"cloudflare-workers-ai",nameKey:"settings.pages.providers.provider.cloudflare-workers-ai.title",name:"Cloudflare Workers AI",descriptionKey:"settings.pages.providers.provider.cloudflare-workers-ai.description",description:"cloudflare.com",iconColor:"i-lobe-icons:cloudflare",createProvider:e=>Pe(e.apiKey.trim(),e.accountId),capabilities:{listModels:async()=>[]},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.accountId}},"perplexity-ai":{id:"perplexity-ai",nameKey:"settings.pages.providers.provider.perplexity.title",name:"Perplexity",descriptionKey:"settings.pages.providers.provider.perplexity.description",description:"perplexity.ai",icon:"i-lobe-icons:perplexity",defaultOptions:{baseUrl:"https://api.perplexity.ai"},createProvider:e=>xe(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async()=>[{id:"sonar-small-online",name:"Sonar Small (Online)",provider:"perplexity-ai",description:"Efficient model with online search capabilities",contextLength:12e3},{id:"sonar-medium-online",name:"Sonar Medium (Online)",provider:"perplexity-ai",description:"Balanced model with online search capabilities",contextLength:12e3},{id:"sonar-large-online",name:"Sonar Large (Online)",provider:"perplexity-ai",description:"Powerful model with online search capabilities",contextLength:12e3},{id:"codey-small",name:"Codey Small",provider:"perplexity-ai",description:"Specialized for code generation and understanding",contextLength:12e3},{id:"codey-large",name:"Codey Large",provider:"perplexity-ai",description:"Advanced code generation and understanding",contextLength:12e3}]},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"mistral-ai":{id:"mistral-ai",nameKey:"settings.pages.providers.provider.mistral.title",name:"Mistral",descriptionKey:"settings.pages.providers.provider.mistral.description",description:"mistral.ai",iconColor:"i-lobe-icons:mistral",createProvider:e=>H(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...H(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"mistral-ai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}},"moonshot-ai":{id:"moonshot-ai",nameKey:"settings.pages.providers.provider.moonshot.title",name:"Moonshot AI",descriptionKey:"settings.pages.providers.provider.moonshot.description",description:"moonshot.ai",icon:"i-lobe-icons:moonshot",createProvider:e=>J(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...J(e.apiKey.trim(),e.baseUrl.trim()).model()})).map(r=>({id:r.id,name:r.id,provider:"moonshot-ai",description:"",contextLength:0,deprecated:!1}))},validators:{validateProviderConfig:e=>!!e.apiKey&&!!e.baseUrl}}};async function h(e){const r=a.value[e];if(!r)return!1;const d=l[e];return d?await d.validators.validateProviderConfig(r):!1}const t=U({});function s(e){var r;if(!a.value[e]){const d=l[e];a.value[e]={baseUrl:((r=d.defaultOptions)==null?void 0:r.baseUrl)||""}}}Object.keys(l).forEach(s);async function v(){await Promise.all(Object.keys(l).map(async e=>{t.value[e]=await h(e)}))}v(),ge(a,v,{deep:!0});const u=k(()=>Object.keys(l).filter(e=>t.value[e])),c=U({}),y=U({}),x=U({});async function M(e){const r=a.value[e];if(!r)return[];const d=l[e];if(!d)return[];y.value[e]=!0,x.value[e]=null;try{const o=d.capabilities.listModels?await d.capabilities.listModels(r):[];return c.value[e]=o.map(p=>({id:p.id,name:p.name,description:p.description,contextLength:p.contextLength,deprecated:p.deprecated,provider:e})),c.value[e]}catch(o){return console.error(`Error fetching models for ${e}:`,o),x.value[e]=o instanceof Error?o.message:"Unknown error",[]}finally{y.value[e]=!1}}function C(e){return c.value[e]||[]}const B=k(()=>{const e=[];for(const r of u.value)e.push(...c.value[r]||[]);return e});async function ie(){for(const e of u.value)l[e].capabilities.listModels&&await M(e)}function $(e){const r=l[e];if(!r)throw new Error(`Provider metadata for ${e} not found`);return{...r,localizedName:i(r.nameKey,r.name),localizedDescription:i(r.descriptionKey,r.description)}}const re=k(()=>Object.values(l).map(e=>({...e,localizedName:i(e.nameKey,e.name),localizedDescription:i(e.descriptionKey,e.description),configured:t.value[e.id]||!1})));function O(e){const r=a.value[e];if(!r)throw new Error(`Provider credentials for ${e} not found`);const d=l[e];if(!d)throw new Error(`Provider metadata for ${e} not found`);try{return d.createProvider(r)}catch(o){throw console.error(`Error creating provider instance for ${e}:`,o),o}}const S=k(()=>u.value.map(e=>$(e))),te=k(()=>S.value.filter(e=>{const r=O(e.id);return"chat"in r&&typeof r.chat=="function"})),ne=k(()=>S.value.filter(e=>{const r=O(e.id);return"transcription"in r&&typeof r.transcription=="function"})),se=k(()=>S.value.filter(e=>{const r=O(e.id);return"speech"in r&&typeof r.speech=="function"}));function oe(e){return a.value[e]}return{providers:a,getProviderConfig:oe,availableProviders:u,configuredProviders:t,providerMetadata:l,getProviderMetadata:$,allProvidersMetadata:re,initializeProvider:s,validateProvider:h,availableModels:c,isLoadingModels:y,modelLoadError:x,fetchModelsForProvider:M,getModelsForProvider:C,allAvailableModels:B,loadModelsForConfiguredProviders:ie,getProviderInstance:O,availableProvidersMetadata:S,availableTextGenerationsProvidersMetadata:te,availableAudioSpeechProvidersMetadata:se,availableAudioTranscriptionProvidersMetadata:ne}});export{b as l,Be as u}; diff --git a/assets/queue-6PX0h0Ry.js b/assets/queue-Bkpr_I5o.js similarity index 91% rename from assets/queue-6PX0h0Ry.js rename to assets/queue-Bkpr_I5o.js index 77a7456023c5aff16a3a5a35e5e3f746f9bbef4f..f5150b44b86548a6896fff1341603153264dea9b 100644 --- a/assets/queue-6PX0h0Ry.js +++ b/assets/queue-Bkpr_I5o.js @@ -1 +1 @@ -import{r as l}from"./index-D3pfQUMu.js";function m(f){const t=l([]),a=l(!1),d={add:[],pick:[],processing:[],error:[],processed:[],done:[]},s={};function c(n,e){d[n].push(e)}function r(n,...e){d[n].forEach(i=>{i(...e)})}function h(n,e){s[n]=s[n]||[],s[n].push(e)}function p(n,...e){(s[n]||[]).forEach(i=>{i(...e)})}async function v(n){t.value.push(n),r("add",n)}function E(){const n=t.value.shift();if(n)return r("pick",n),n}async function u(){if(a.value)return;const n=E();if(n){a.value=!0;for(const e of f.handlers){r("processing",n,e);try{const o=await e({data:n,itemsToBeProcessed:()=>t.value.length,emit:p});r("processed",n,o,e)}catch(o){r("error",n,o,e);continue}}a.value=!1,r("done",n),t.value.length>0&&u()}}return c("add",u),c("done",u),{add:v,on:c,onHandlerEvent:h,queue:t}}export{m as u}; +import{r as l}from"./index-BNq7Hbz_.js";function m(f){const t=l([]),a=l(!1),d={add:[],pick:[],processing:[],error:[],processed:[],done:[]},s={};function c(n,e){d[n].push(e)}function r(n,...e){d[n].forEach(i=>{i(...e)})}function h(n,e){s[n]=s[n]||[],s[n].push(e)}function p(n,...e){(s[n]||[]).forEach(i=>{i(...e)})}async function v(n){t.value.push(n),r("add",n)}function E(){const n=t.value.shift();if(n)return r("pick",n),n}async function u(){if(a.value)return;const n=E();if(n){a.value=!0;for(const e of f.handlers){r("processing",n,e);try{const o=await e({data:n,itemsToBeProcessed:()=>t.value.length,emit:p});r("processed",n,o,e)}catch(o){r("error",n,o,e);continue}}a.value=!1,r("done",n),t.value.length>0&&u()}}return c("add",u),c("done",u),{add:v,on:c,onHandlerEvent:h,queue:t}}export{m as u}; diff --git a/assets/queue-Dr_7aGBJ.js b/assets/queue-CPjEEqUV.js similarity index 86% rename from assets/queue-Dr_7aGBJ.js rename to assets/queue-CPjEEqUV.js index 5d0f23ba8086add87af72de137c6c0352efc250f..61d831ad1aa6fe7231e500180838912cd80c2c86 100644 --- a/assets/queue-Dr_7aGBJ.js +++ b/assets/queue-CPjEEqUV.js @@ -1 +1 @@ -import{u as o}from"./queue-6PX0h0Ry.js";import{d as v,r as h,f as k,c as w,o as g,a as I}from"./index-D3pfQUMu.js";const Q=v({__name:"queue",setup(P){function i(e){return new Promise(a=>setTimeout(a,e))}const n=h(""),d=o({handlers:[async e=>{console.log("ready to play speech audio for",e)}]}),u=o({handlers:[async e=>{console.log("ready to stream speech audio for",e),d.add(e.data)}]}),c=o({handlers:[async e=>{const a=[".","?","!"];let s=!1;for(const t of a){if(!e.data.includes(t))continue;const r=e.data.indexOf(t),p=e.data.slice(0,r+1),y=e.data.slice(r+1);n.value+=p,u.add(n.value.trim()),n.value=y,s=!0}s||(n.value+=e.data)}]}),l=["Hello"," N","eko","! I"," am"," an"," AI"," assistant"," trained"," to"," help"," with"," a"," variety"," of"," tasks"," such"," as"," answering"," questions",","," providing"," information",","," giving"," recommendations",","," and"," more",". How"," can"," I"," assist"," you"," today","?","Hello"," N","eko",","," I"," am"," an"," AI"," assistant","."," I"," can"," help"," answer"," questions",","," provide"," information",","," assist"," with"," tasks",","," and"," engage"," in"," conversation","."," How"," can"," I"," assist"," you"," today","?"];async function f(){for(const e of l)await i(100),c.add(e)}async function m(){f()}return k(()=>{m()}),(e,a)=>(g(),w("div",null,a[0]||(a[0]=[I("div",null,null,-1)])))}});export{Q as default}; +import{u as o}from"./queue-Bkpr_I5o.js";import{d as v,r as h,H as k,c as w,o as g,e as I}from"./index-BNq7Hbz_.js";const Q=v({__name:"queue",setup(H){function i(e){return new Promise(a=>setTimeout(a,e))}const n=h(""),d=o({handlers:[async e=>{console.log("ready to play speech audio for",e)}]}),u=o({handlers:[async e=>{console.log("ready to stream speech audio for",e),d.add(e.data)}]}),c=o({handlers:[async e=>{const a=[".","?","!"];let s=!1;for(const t of a){if(!e.data.includes(t))continue;const r=e.data.indexOf(t),p=e.data.slice(0,r+1),y=e.data.slice(r+1);n.value+=p,u.add(n.value.trim()),n.value=y,s=!0}s||(n.value+=e.data)}]}),l=["Hello"," N","eko","! I"," am"," an"," AI"," assistant"," trained"," to"," help"," with"," a"," variety"," of"," tasks"," such"," as"," answering"," questions",","," providing"," information",","," giving"," recommendations",","," and"," more",". How"," can"," I"," assist"," you"," today","?","Hello"," N","eko",","," I"," am"," an"," AI"," assistant","."," I"," can"," help"," answer"," questions",","," provide"," information",","," assist"," with"," tasks",","," and"," engage"," in"," conversation","."," How"," can"," I"," assist"," you"," today","?"];async function f(){for(const e of l)await i(100),c.add(e)}async function m(){f()}return k(()=>{m()}),(e,a)=>(g(),w("div",null,a[0]||(a[0]=[I("div",null,null,-1)])))}});export{Q as default}; diff --git a/assets/queues-CCpGc-RL.js b/assets/queues-CCpGc-RL.js deleted file mode 100644 index f35e89ed3ac4bc929c118d26495d531b759aa2a7..0000000000000000000000000000000000000000 --- a/assets/queues-CCpGc-RL.js +++ /dev/null @@ -1 +0,0 @@ -import{e as i}from"./emotions-CAex_2dA.js";import{u as s}from"./queue-6PX0h0Ry.js";import{r as d}from"./index-D3pfQUMu.js";const l="<|llm_inference_end|>";function y(o){function t(e){for(const n of i)if(e.includes(n))return{ok:!0,emotion:n};return{ok:!1,emotion:""}}return s({handlers:[async e=>{if(i.includes(e.data)){e.emit("emotion",e.data),await o.add(e.data);return}{const{ok:n,emotion:a}=t(e.data);n&&(e.emit("emotion",a),await o.add(a))}}]})}function k(){function o(e){if(!/<\|DELAY:\d+\|>/i.test(e))return{ok:!1,delay:0};const n=/<\|DELAY:(\d+)\|>/i.exec(e),a=n==null?void 0:n[1];if(!a)return{ok:!1,delay:0};const r=Number.parseFloat(a);return r<=0||Number.isNaN(r)?{ok:!0,delay:0}:{ok:!0,delay:r}}function t(e){return new Promise(n=>setTimeout(n,e))}return s({handlers:[async e=>{const{ok:n,delay:a}=o(e.data);n&&(e.emit("delay",a),await t(a*1e3))}]})}function p(o){const t=d("");return s({handlers:[async e=>{if(e.data===l){const a=t.value.trim();a&&await o.add(a),t.value="";return}const n=/[.?!]/;for(t.value+=e.data;t.value;){const a=n.exec(t.value);if(!a||typeof a.index>"u")break;const r=t.value.slice(0,a.index+1),u=t.value.slice(a.index+1);await o.add(r),t.value=u}}]})}export{y as a,k as b,l,p as u}; diff --git a/assets/queues-yzb6LxwZ.js b/assets/queues-yzb6LxwZ.js new file mode 100644 index 0000000000000000000000000000000000000000..352334c9c31c8c7c436d48a37b8527b7a908adcb --- /dev/null +++ b/assets/queues-yzb6LxwZ.js @@ -0,0 +1 @@ +import{E as i}from"./mini_xsschema-P_8cZcRg.js";import{u as s}from"./queue-Bkpr_I5o.js";import{r as d}from"./index-BNq7Hbz_.js";const l="<|llm_inference_end|>";function y(o){function t(e){for(const n of i)if(e.includes(n))return{ok:!0,emotion:n};return{ok:!1,emotion:""}}return s({handlers:[async e=>{if(i.includes(e.data)){e.emit("emotion",e.data),await o.add(e.data);return}{const{ok:n,emotion:a}=t(e.data);n&&(e.emit("emotion",a),await o.add(a))}}]})}function k(){function o(e){if(!/<\|DELAY:\d+\|>/i.test(e))return{ok:!1,delay:0};const n=/<\|DELAY:(\d+)\|>/i.exec(e),a=n==null?void 0:n[1];if(!a)return{ok:!1,delay:0};const r=Number.parseFloat(a);return r<=0||Number.isNaN(r)?{ok:!0,delay:0}:{ok:!0,delay:r}}function t(e){return new Promise(n=>setTimeout(n,e))}return s({handlers:[async e=>{const{ok:n,delay:a}=o(e.data);n&&(e.emit("delay",a),await t(a*1e3))}]})}function p(o){const t=d("");return s({handlers:[async e=>{if(e.data===l){const a=t.value.trim();a&&await o.add(a),t.value="";return}const n=/[.?!]/;for(t.value+=e.data;t.value;){const a=n.exec(t.value);if(!a||typeof a.index>"u")break;const r=t.value.slice(0,a.index+1),u=t.value.slice(a.index+1);await o.add(r),t.value=u}}]})}export{y as a,p as b,l,k as u}; diff --git a/assets/settings-DddKw7XJ.js b/assets/settings-DddKw7XJ.js new file mode 100644 index 0000000000000000000000000000000000000000..9a8192d0d9c7599ef782cb72571e5267218b90df --- /dev/null +++ b/assets/settings-DddKw7XJ.js @@ -0,0 +1 @@ +import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-B6whjTNv.js";import{d as x,r as p,V as h,H as w,I as k,v as H,c as d,e as n,b as m,U as R,j as y,t as f,o as g,W as _,g as $,s as M,h as v,i as b,A as B,R as V}from"./index-BNq7Hbz_.js";import"./three-vrm-animation.module-BPuMi1if.js";import"./mcp-D2taTyhO.js";import"./mini_xsschema-P_8cZcRg.js";import{u as C}from"./providers-Ddg6LLwH.js";/* empty css */import{H as N}from"./HeaderLink-nC9K3Z33.js";import"./index-LHmcipjy.js";const P={relative:""},S={key:0,absolute:"","left-0":"","top-0":"","translate-y":"[-80%]"},I={text:"neutral-300 dark:neutral-500","text-nowrap":""},L={"text-nowrap":"","text-3xl":"","font-semibold":""},T=x({__name:"PageHeader",props:{title:null,subtitle:null},setup(c){const s=c,t=R(),u=_(),l=p(),o=p(s.title),i=p(s.subtitle),{apply:e}=h(l,{initial:{opacity:0,x:10,transition:{duration:250}},enter:{opacity:1,x:0,transition:{duration:250}},leave:{opacity:0,x:-5,transition:{duration:100}}});return w(async()=>{await e("initial"),await e("enter")}),k(async()=>{await e("leave")}),H([()=>s.title,()=>s.subtitle,u],async()=>{await e("leave"),o.value=s.title,i.value=s.subtitle,await e("initial"),await e("enter")}),(r,a)=>(g(),d("div",{ref_key:"pageHeaderRef",ref:l,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"},[n("button",{onClick:a[0]||(a[0]=A=>m(t).back())},a[1]||(a[1]=[n("div",{"i-solar:alt-arrow-left-line-duotone":"","text-2xl":""},null,-1)])),n("h1",P,[i.value?(g(),d("div",S,[n("span",I,f(i.value),1)])):y("",!0),n("div",L,f(o.value),1)])],512))}}),U={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)"}},j={class:"px-0 py-1 md:px-3 md:py-3","w-full":"","gap-2":"",bg:"$bg-color"},z={class:"px-3 py-2 md:px-5 md:py-5",flex:"~ col","mx-auto":"","max-w-screen-xl":""},Q=x({__name:"settings",setup(c){const s=_(),{t}=$(),u=C(),{allProvidersMetadata:l}=M(u),o=v(()=>{var r;const e={"/settings/airi-card":{subtitle:t("settings.title"),title:t("settings.pages.card.title")},"/settings/appearance":{subtitle:t("settings.title"),title:t("settings.pages.themes.title")},"/settings/memory":{subtitle:t("settings.title"),title:t("settings.pages.memory.title")},"/settings/models":{subtitle:t("settings.title"),title:t("settings.pages.models.title")},"/settings/modules":{subtitle:t("settings.title"),title:t("settings.pages.modules.title")},"/settings/modules/consciousness":{subtitle:t("settings.title"),title:t("settings.pages.modules.consciousness.title")},"/settings/modules/speech":{subtitle:t("settings.title"),title:t("settings.pages.modules.speech.title")},"/settings/modules/hearing":{subtitle:t("settings.title"),title:t("settings.pages.modules.hearing.title")},"/settings/modules/memory-short-term":{subtitle:t("settings.title"),title:t("settings.pages.modules.memory-short-term.title")},"/settings/modules/memory-long-term":{subtitle:t("settings.title"),title:t("settings.pages.modules.memory-long-term.title")},"/settings/modules/messaging-discord":{subtitle:t("settings.title"),title:t("settings.pages.modules.messaging-discord.title")},"/settings/modules/x":{subtitle:t("settings.title"),title:t("settings.pages.modules.x.title")},"/settings/modules/gaming-minecraft":{subtitle:t("settings.title"),title:t("settings.pages.modules.gaming-minecraft.title")},"/settings/modules/gaming-factorio":{subtitle:t("settings.title"),title:t("settings.pages.modules.gaming-factorio.title")},"/settings/providers":{subtitle:t("settings.title"),title:t("settings.pages.providers.title")},"/settings/scene":{subtitle:t("settings.title"),title:t("settings.pages.scene.title")},"/settings":{title:t("settings.title")}};for(const a in l.value)e[`/settings/providers/${a}`]={subtitle:t("settings.title"),title:t((r=l.value[a])==null?void 0:r.nameKey)};return e}),i=v(()=>o.value[s.path]);return(e,r)=>(g(),d("div",U,[n("div",j,[b(N)]),n("div",z,[i.value?(g(),B(m(T),{key:0,title:i.value.title,subtitle:i.value.subtitle},null,8,["title","subtitle"])):y("",!0),b(m(V))])]))}});export{Q as default}; diff --git a/assets/settings-jO-GKHXW.js b/assets/settings-jO-GKHXW.js deleted file mode 100644 index 313ea1bca5653d7a7e19a4e2a48b805b91a821c6..0000000000000000000000000000000000000000 --- a/assets/settings-jO-GKHXW.js +++ /dev/null @@ -1 +0,0 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-t8bgqiA6.js";import{d as x,r as p,e as h,f as w,g as k,w as R,c as d,a as n,u as m,h as $,i as y,t as f,o as g,j as _,k as H,s as M,l as b,b as v,m as B,R as V}from"./index-D3pfQUMu.js";import"./three-vrm-animation.module-DLbUhddZ.js";import"./emotions-CAex_2dA.js";import{u as C}from"./providers-CCvie00Z.js";/* empty css */import{H as N}from"./HeaderLink-SBXLiv0n.js";import"./index-LHmcipjy.js";const P={relative:""},S={key:0,absolute:"","left-0":"","top-0":"","translate-y":"[-80%]"},L={text:"neutral-300 dark:neutral-500","text-nowrap":""},T={"text-nowrap":"","text-3xl":"","font-semibold":""},j=x({__name:"PageHeader",props:{title:null,subtitle:null},setup(c){const s=c,t=$(),u=_(),l=p(),o=p(s.title),i=p(s.subtitle),{apply:e}=h(l,{initial:{opacity:0,x:10,transition:{duration:250}},enter:{opacity:1,x:0,transition:{duration:250}},leave:{opacity:0,x:-5,transition:{duration:100}}});return w(async()=>{await e("initial"),await e("enter")}),k(async()=>{await e("leave")}),R([()=>s.title,()=>s.subtitle,u],async()=>{await e("leave"),o.value=s.title,i.value=s.subtitle,await e("initial"),await e("enter")}),(r,a)=>(g(),d("div",{ref_key:"pageHeaderRef",ref:l,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"},[n("button",{onClick:a[0]||(a[0]=I=>m(t).back())},a[1]||(a[1]=[n("div",{"i-solar:alt-arrow-left-line-duotone":"","text-2xl":""},null,-1)])),n("h1",P,[i.value?(g(),d("div",S,[n("span",L,f(i.value),1)])):y("",!0),n("div",T,f(o.value),1)])],512))}}),z={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)"}},D={class:"px-0 py-1 md:px-3 md:py-3","w-full":"","gap-2":"",bg:"$bg-color"},E={class:"px-3 py-2 md:px-5 md:py-5",flex:"~ col","mx-auto":"","max-w-screen-xl":""},Q=x({__name:"settings",setup(c){const s=_(),{t}=H(),u=C(),{allProvidersMetadata:l}=M(u),o=b(()=>{var r;const e={"/settings/airi-card":{subtitle:t("settings.title"),title:t("settings.pages.card.title")},"/settings/appearance":{subtitle:t("settings.title"),title:t("settings.pages.themes.title")},"/settings/memory":{subtitle:t("settings.title"),title:t("settings.pages.memory.title")},"/settings/models":{subtitle:t("settings.title"),title:t("settings.pages.models.title")},"/settings/modules":{subtitle:t("settings.title"),title:t("settings.pages.modules.title")},"/settings/modules/consciousness":{subtitle:t("settings.title"),title:t("settings.pages.modules.consciousness.title")},"/settings/modules/speech":{subtitle:t("settings.title"),title:t("settings.pages.modules.speech.title")},"/settings/modules/hearing":{subtitle:t("settings.title"),title:t("settings.pages.modules.hearing.title")},"/settings/modules/memory-short-term":{subtitle:t("settings.title"),title:t("settings.pages.modules.memory-short-term.title")},"/settings/modules/memory-long-term":{subtitle:t("settings.title"),title:t("settings.pages.modules.memory-long-term.title")},"/settings/modules/messaging-discord":{subtitle:t("settings.title"),title:t("settings.pages.modules.messaging-discord.title")},"/settings/modules/x":{subtitle:t("settings.title"),title:t("settings.pages.modules.x.title")},"/settings/modules/gaming-minecraft":{subtitle:t("settings.title"),title:t("settings.pages.modules.gaming-minecraft.title")},"/settings/modules/gaming-factorio":{subtitle:t("settings.title"),title:t("settings.pages.modules.gaming-factorio.title")},"/settings/providers":{subtitle:t("settings.title"),title:t("settings.pages.providers.title")},"/settings/scene":{subtitle:t("settings.title"),title:t("settings.pages.scene.title")},"/settings":{title:t("settings.title")}};for(const a in l.value)e[`/settings/providers/${a}`]={subtitle:t("settings.title"),title:t((r=l.value[a])==null?void 0:r.nameKey)};return e}),i=b(()=>o.value[s.path]);return(e,r)=>(g(),d("div",z,[n("div",D,[v(N)]),n("div",E,[i.value?(g(),B(m(j),{key:0,title:i.value.title,subtitle:i.value.subtitle},null,8,["title","subtitle"])):y("",!0),v(m(V))])]))}});export{Q as default}; diff --git a/assets/speech-CIOuIakE.js b/assets/speech-CIOuIakE.js deleted file mode 100644 index 5ca99f3137b5a46d731fc8d2a227d46d5c1787f5..0000000000000000000000000000000000000000 --- a/assets/speech-CIOuIakE.js +++ /dev/null @@ -1,2 +0,0 @@ -import{v as te,bG as g,r as b,l as p,w as P,f as re}from"./index-D3pfQUMu.js";import{r as ne,a as ae,b as oe,d as se}from"./index-LHmcipjy.js";import{u as ce}from"./providers-CCvie00Z.js";const ie=async e=>(e.fetch??globalThis.fetch)(ne("audio/speech",e.baseURL),{body:oe(e),headers:ae({"Content-Type":"application/json",...e.headers},e.apiKey),method:"POST",signal:e.abortSignal}).then(se).then(async t=>t.arrayBuffer()),ue=/["&'<>`]/g,le=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,de=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,me=/[|\\{}()[\]^$+*?.]/g,U=new WeakMap;function D(e,t){if(e=e.replace(t.subset?fe(t.subset):ue,n),t.subset||t.escapeOnly)return e;return e.replace(le,r).replace(de,n);function r(a,s,l){return t.format((a.charCodeAt(0)-55296)*1024+a.charCodeAt(1)-56320+65536,l.charCodeAt(s+2),t)}function n(a,s,l){return t.format(a.charCodeAt(0),l.charCodeAt(s+1),t)}}function fe(e){let t=U.get(e);return t||(t=ge(e),U.set(e,t)),t}function ge(e){const t=[];let r=-1;for(;++r",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},Se=["cent","copy","divide","gt","lt","not","para","times"],j={}.hasOwnProperty,L={};let S;for(S in C)j.call(C,S)&&(L[C[S]]=S);const xe=/[^\dA-Za-z]/;function Ee(e,t,r,n){const a=String.fromCharCode(e);if(j.call(L,a)){const s=L[a],l="&"+s;return r&&be.includes(s)&&!Se.includes(s)&&(!n||t&&t!==61&&xe.test(String.fromCharCode(t)))?l:l+";"}return""}function we(e,t,r){let n=he(e,t,r.omitOptionalSemicolons),a;if((r.useNamedReferences||r.useShortestReferences)&&(a=Ee(e,t,r.omitOptionalSemicolons,r.attribute)),(r.useShortestReferences||!a)&&r.useShortestReferences){const s=ye(e,t,r.omitOptionalSemicolons);s.length/g,Te=[">"];function Le(e){return""+y(e.value,Te,Ce)+""}function Me(e){return""}const Re=[" ",` -`," ",'"',"&","'","/","<","=",">"];function x(e){return y(e,Re)}function F(e,t){const r=String(e);if(typeof t!="string")throw new TypeError("Expected character");let n=0,a=r.indexOf(t);for(;a!==-1;)n++,a=r.indexOf(t,a+t.length);return n}function M(e,t){const r=String(e);let n=t.options.quote||'"';if(t.options.quoteSmart){const a=n==='"'?"'":'"';F(r,n)>F(r,a)&&(n=a)}return n+y(r,["<","&",n])+n}function $e(e,t){const r=x(e.name),n=e.public,a=e.system;let s=""}const Ue={}.hasOwnProperty;function Fe(e,t){const r=x(e.name),n=k(e,t),a=e.attributes||{},s=n?!1:t.options.closeEmptyElements,l=[];let h;for(h in a)if(Ue.call(a,h)){const f=a[h];f!=null&&l.push(x(h)+"="+M(f,t))}return"<"+r+(l.length===0?"":" "+l.join(" "))+(s?(t.options.tightClose?"":" ")+"/":"")+">"+n+(s?"":"")}const Ne=/\?>/g,De=[">"];function je(e){const t=x(e.name)||"x",r=y(e.value,De,Ne);return""}const Ie=["&","<"];function I(e){return y(e.value,Ie)}function ze(e,t){return t.options.allowDangerousXml?e.value:I(e)}const ke={}.hasOwnProperty,N={cdata:Le,comment:Me,doctype:$e,element:Fe,instruction:je,raw:ze,root:k,text:I};function z(e,t){const r=e&&e.type;if(!r)throw new Error("Expected node, not `"+e+"`");if(!ke.call(N,r))throw new Error("Cannot compile unknown node `"+r+"`");const n=N[r];return n(e,t)}function k(e,t){const r=e&&e.children||[];let n=-1;const a=[];for(;++n{const e=ce(),t=g("settings/speech/active-provider",""),r=g("settings/speech/active-model","eleven_multilingual_v2"),n=g("settings/speech/voice",""),a=b(),s=g("settings/speech/pitch",0),l=g("settings/speech/rate",1),h=g("settings/speech/ssml-enabled",!1),f=b(!1),E=b(null),v=b({}),B=g("settings/speech/language","en-US"),w=b(""),H=p(()=>e.availableProviders.filter(o=>O(o)).map(o=>e.getProviderMetadata(o))),V=p(()=>{var o;return((o=e.getProviderMetadata(t.value))==null?void 0:o.capabilities.listModels)!==void 0}),A=p(()=>e.getModelsForProvider(t.value)),Y=p(()=>e.isLoadingModels[t.value]||!1),G=p(()=>e.modelLoadError[t.value]||null),X=p(()=>{if(!w.value.trim())return A.value;const o=w.value.toLowerCase().trim();return A.value.filter(c=>c.name.toLowerCase().includes(o)||c.id.toLowerCase().includes(o)||c.description&&c.description.toLowerCase().includes(o))}),_=p(()=>["elevenlabs","microsoft-speech","azure-speech","google","alibaba-cloud-model-studio","volcengine"].includes(t.value));function O(o){return["elevenlabs","microsoft-speech","azure-speech","google","amazon","alibaba-cloud-model-studio","volcengine"].includes(o)}async function q(o){var c,i;if(!o||!O(o))return[];f.value=!0,E.value=null;try{const u=await((i=(c=e.getProviderMetadata(o).capabilities).listVoices)==null?void 0:i.call(c,e.getProviderConfig(o)))||[];return v.value[o]=u,u}catch(u){return console.error(`Error fetching voices for ${o}:`,u),E.value=u instanceof Error?u.message:"Unknown error",[]}finally{f.value=!1}}function K(o){return v.value[o]||[]}P(t,async o=>{o&&await q(o)}),re(()=>{q(t.value).then(()=>{var o;n.value&&(a.value=(o=v.value[t.value])==null?void 0:o.find(c=>c.id===n.value))})}),P(n,o=>{var c;o&&(a.value=(c=v.value[t.value])==null?void 0:c.find(i=>i.id===o))},{immediate:!0}),P(v,o=>{var c;n.value&&(a.value=(c=o[t.value])==null?void 0:c.find(i=>i.id===n.value))},{immediate:!0});async function Q(o,c,i,u,m={}){return await ie({...o.speech(c,{...m}),input:i,voice:u})}function Z(o,c,i){var $;const u=i==null?void 0:i.pitch,m=i==null?void 0:i.speed,d=i==null?void 0:i.volume,W={pitch:u!=null?u>0?`+${u}%`:`-${u}%`:void 0,rate:m!=null?m!==1?`${m}`:"1":void 0,volume:d!=null?d>0?`+${d}%`:`${d}%`:void 0},J=T("speak",{version:"1.0",xmlns:"http://www.w3.org/2001/10/synthesis","xml:lang":(($=c.languages[0])==null?void 0:$.code)||"en-US"},[T("voice",{name:c.id,gender:c.gender||"neutral"},[Object.entries(W).filter(([Ve,ee])=>ee!=null).length>0?T("prosody",{pitch:u!=null?u>0?`+${u}%`:`-${u}%`:void 0,rate:m!=null?m!==1?`${m}`:"1":void 0,volume:d!=null?d>0?`+${d}%`:`${d}%`:void 0},[o]):o])]);return Be(J)}return{activeSpeechProvider:t,activeSpeechModel:r,activeSpeechVoice:a,activeSpeechVoiceId:n,pitch:s,rate:l,ssmlEnabled:h,selectedLanguage:B,isLoadingSpeechProviderVoices:f,speechProviderError:E,availableVoices:v,modelSearchQuery:w,availableSpeechProvidersMetadata:H,supportsSSML:_,supportsModelListing:V,providerModels:A,isLoadingActiveProviderModels:Y,activeProviderModelError:G,filteredModels:X,speech:Q,loadVoicesForProvider:q,getVoicesForProvider:K,generateSSML:Z,isSpeechProvider:O}});export{F as c,ie as g,_e as s,Ke as u}; diff --git a/assets/speech-CKvssz06.js b/assets/speech-CKvssz06.js new file mode 100644 index 0000000000000000000000000000000000000000..7a3a34b198e55305c2cda95390e7df7087e4648e --- /dev/null +++ b/assets/speech-CKvssz06.js @@ -0,0 +1,2 @@ +import{p as te,q as p,r as b,h as f,v as P,H as re}from"./index-BNq7Hbz_.js";import{r as ne,a as ae,b as oe,d as se}from"./index-LHmcipjy.js";import{u as ce}from"./providers-Ddg6LLwH.js";const ie=async e=>(e.fetch??globalThis.fetch)(ne("audio/speech",e.baseURL),{body:oe(e),headers:ae({"Content-Type":"application/json",...e.headers},e.apiKey),method:"POST",signal:e.abortSignal}).then(se).then(async t=>t.arrayBuffer()),ue=/["&'<>`]/g,le=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,de=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,me=/[|\\{}()[\]^$+*?.]/g,U=new WeakMap;function D(e,t){if(e=e.replace(t.subset?ge(t.subset):ue,n),t.subset||t.escapeOnly)return e;return e.replace(le,r).replace(de,n);function r(a,s,l){return t.format((a.charCodeAt(0)-55296)*1024+a.charCodeAt(1)-56320+65536,l.charCodeAt(s+2),t)}function n(a,s,l){return t.format(a.charCodeAt(0),l.charCodeAt(s+1),t)}}function ge(e){let t=U.get(e);return t||(t=pe(e),U.set(e,t)),t}function pe(e){const t=[];let r=-1;for(;++r",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},Se=["cent","copy","divide","gt","lt","not","para","times"],j={}.hasOwnProperty,L={};let S;for(S in C)j.call(C,S)&&(L[C[S]]=S);const xe=/[^\dA-Za-z]/;function Ee(e,t,r,n){const a=String.fromCharCode(e);if(j.call(L,a)){const s=L[a],l="&"+s;return r&&be.includes(s)&&!Se.includes(s)&&(!n||t&&t!==61&&xe.test(String.fromCharCode(t)))?l:l+";"}return""}function we(e,t,r){let n=he(e,t,r.omitOptionalSemicolons),a;if((r.useNamedReferences||r.useShortestReferences)&&(a=Ee(e,t,r.omitOptionalSemicolons,r.attribute)),(r.useShortestReferences||!a)&&r.useShortestReferences){const s=ye(e,t,r.omitOptionalSemicolons);s.length/g,Te=[">"];function Le(e){return""+y(e.value,Te,Ce)+""}function Me(e){return""}const Re=[" ",` +`," ",'"',"&","'","/","<","=",">"];function x(e){return y(e,Re)}function F(e,t){const r=String(e);if(typeof t!="string")throw new TypeError("Expected character");let n=0,a=r.indexOf(t);for(;a!==-1;)n++,a=r.indexOf(t,a+t.length);return n}function M(e,t){const r=String(e);let n=t.options.quote||'"';if(t.options.quoteSmart){const a=n==='"'?"'":'"';F(r,n)>F(r,a)&&(n=a)}return n+y(r,["<","&",n])+n}function $e(e,t){const r=x(e.name),n=e.public,a=e.system;let s=""}const Ue={}.hasOwnProperty;function Fe(e,t){const r=x(e.name),n=k(e,t),a=e.attributes||{},s=n?!1:t.options.closeEmptyElements,l=[];let h;for(h in a)if(Ue.call(a,h)){const g=a[h];g!=null&&l.push(x(h)+"="+M(g,t))}return"<"+r+(l.length===0?"":" "+l.join(" "))+(s?(t.options.tightClose?"":" ")+"/":"")+">"+n+(s?"":"")}const Ne=/\?>/g,De=[">"];function je(e){const t=x(e.name)||"x",r=y(e.value,De,Ne);return""}const Ie=["&","<"];function I(e){return y(e.value,Ie)}function ze(e,t){return t.options.allowDangerousXml?e.value:I(e)}const ke={}.hasOwnProperty,N={cdata:Le,comment:Me,doctype:$e,element:Fe,instruction:je,raw:ze,root:k,text:I};function z(e,t){const r=e&&e.type;if(!r)throw new Error("Expected node, not `"+e+"`");if(!ke.call(N,r))throw new Error("Cannot compile unknown node `"+r+"`");const n=N[r];return n(e,t)}function k(e,t){const r=e&&e.children||[];let n=-1;const a=[];for(;++n{const e=ce(),t=p("settings/speech/active-provider",""),r=p("settings/speech/active-model","eleven_multilingual_v2"),n=p("settings/speech/voice",""),a=b(),s=p("settings/speech/pitch",0),l=p("settings/speech/rate",1),h=p("settings/speech/ssml-enabled",!1),g=b(!1),E=b(null),v=b({}),H=p("settings/speech/language","en-US"),w=b(""),B=f(()=>e.availableProviders.filter(o=>O(o)).map(o=>e.getProviderMetadata(o))),V=f(()=>{var o;return((o=e.getProviderMetadata(t.value))==null?void 0:o.capabilities.listModels)!==void 0}),A=f(()=>e.getModelsForProvider(t.value)),Y=f(()=>e.isLoadingModels[t.value]||!1),X=f(()=>e.modelLoadError[t.value]||null),G=f(()=>{if(!w.value.trim())return A.value;const o=w.value.toLowerCase().trim();return A.value.filter(c=>c.name.toLowerCase().includes(o)||c.id.toLowerCase().includes(o)||c.description&&c.description.toLowerCase().includes(o))}),_=f(()=>["elevenlabs","microsoft-speech","azure-speech","google","alibaba-cloud-model-studio","volcengine"].includes(t.value));function O(o){return["elevenlabs","microsoft-speech","azure-speech","google","amazon","alibaba-cloud-model-studio","volcengine"].includes(o)}async function q(o){var c,i;if(!o||!O(o))return[];g.value=!0,E.value=null;try{const u=await((i=(c=e.getProviderMetadata(o).capabilities).listVoices)==null?void 0:i.call(c,e.getProviderConfig(o)))||[];return v.value[o]=u,u}catch(u){return console.error(`Error fetching voices for ${o}:`,u),E.value=u instanceof Error?u.message:"Unknown error",[]}finally{g.value=!1}}function K(o){return v.value[o]||[]}P(t,async o=>{o&&await q(o)}),re(()=>{q(t.value).then(()=>{var o;n.value&&(a.value=(o=v.value[t.value])==null?void 0:o.find(c=>c.id===n.value))})}),P(n,o=>{var c;o&&(a.value=(c=v.value[t.value])==null?void 0:c.find(i=>i.id===o))},{immediate:!0}),P(v,o=>{var c;n.value&&(a.value=(c=o[t.value])==null?void 0:c.find(i=>i.id===n.value))},{immediate:!0});async function Q(o,c,i,u,m={}){return await ie({...o.speech(c,{...m}),input:i,voice:u})}function Z(o,c,i){var $;const u=i==null?void 0:i.pitch,m=i==null?void 0:i.speed,d=i==null?void 0:i.volume,W={pitch:u!=null?u>0?`+${u}%`:`-${u}%`:void 0,rate:m!=null?m!==1?`${m}`:"1":void 0,volume:d!=null?d>0?`+${d}%`:`${d}%`:void 0},J=T("speak",{version:"1.0",xmlns:"http://www.w3.org/2001/10/synthesis","xml:lang":(($=c.languages[0])==null?void 0:$.code)||"en-US"},[T("voice",{name:c.id,gender:c.gender||"neutral"},[Object.entries(W).filter(([Ve,ee])=>ee!=null).length>0?T("prosody",{pitch:u!=null?u>0?`+${u}%`:`-${u}%`:void 0,rate:m!=null?m!==1?`${m}`:"1":void 0,volume:d!=null?d>0?`+${d}%`:`${d}%`:void 0},[o]):o])]);return He(J)}return{activeSpeechProvider:t,activeSpeechModel:r,activeSpeechVoice:a,activeSpeechVoiceId:n,pitch:s,rate:l,ssmlEnabled:h,selectedLanguage:H,isLoadingSpeechProviderVoices:g,speechProviderError:E,availableVoices:v,modelSearchQuery:w,availableSpeechProvidersMetadata:B,supportsSSML:_,supportsModelListing:V,providerModels:A,isLoadingActiveProviderModels:Y,activeProviderModelError:X,filteredModels:G,speech:Q,loadVoicesForProvider:q,getVoicesForProvider:K,generateSSML:Z,isSpeechProvider:O}});export{F as c,ie as g,_e as s,Ke as u}; diff --git a/assets/speech-CskFWSHK.js b/assets/speech-CskFWSHK.js deleted file mode 100644 index b6dee0f659f2817c167d088bf9d731c378d289ff..0000000000000000000000000000000000000000 --- a/assets/speech-CskFWSHK.js +++ /dev/null @@ -1 +0,0 @@ -import{d as D,r as V,f as ae,w as X,B as re,c as u,o as i,bA as H,bB as Y,a as e,q as ve,F as $,bK as W,bL as K,G as Q,bD as me,i as P,t as y,b as S,u as t,E as N,bq as Z,l as pe,ca as fe,bH as ne,m as J,k as ge,s as te,g as xe,bz as be,br as he,ag as F,bJ as ye}from"./index-D3pfQUMu.js";import{_ as se,a as le,b as ke}from"./FieldRange.vue_vue_type_script_setup_true_lang-IEKed7Lk.js";import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-t8bgqiA6.js";import"./three-vrm-animation.module-DLbUhddZ.js";import"./emotions-CAex_2dA.js";import{u as we}from"./providers-CCvie00Z.js";import{u as _e,g as Se}from"./speech-CIOuIakE.js";import{_ as Ve}from"./FieldInput.vue_vue_type_script_setup_true_lang-Brkyubp9.js";/* empty css */import{_ as Me}from"./Textarea.vue_vue_type_script_setup_true_lang-DYk_co3B.js";import{R as Ce,a as $e}from"./RadioCardSimple-DtKqsojA.js";import{_ as Pe}from"./TransitionVertical.vue_vue_type_script_setup_true_lang-D_DUmSTM.js";import{_ as Ue}from"./Input.vue_vue_type_script_setup_true_lang-B223oRg0.js";import{b as oe}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./Basic.vue_vue_type_script_setup_true_lang-Sei3qL1b.js";const Le=D({__name:"AudioSpectrum",props:{stream:null,bars:{default:32},minFreq:{default:60},maxFreq:{default:4e3}},setup(l){const o=l,g=V(Array.from({length:o.bars}).fill(0));ae(()=>{m()}),X(()=>o.stream,()=>{m()});function m(){if(!o.stream)return;const c=new(window.AudioContext||window.webkitAudioContext),f=c.createMediaStreamSource(o.stream),v=c.createAnalyser();v.fftSize=2048,f.connect(v);const b=v.frequencyBinCount,M=new Uint8Array(b),p=c.sampleRate/v.fftSize,k=Math.floor(o.minFreq/p),U=Math.floor(o.maxFreq/p),q=U-k,E=Math.floor(q/o.bars),T=()=>{try{requestAnimationFrame(T),v.getByteFrequencyData(M);const A=Array.from({length:o.bars}).fill(0);for(let z=0;zre(c.$slots,"default",{frequencies:g.value})}}),qe={"h-full":"",flex:"","items-center":"","gap-1":""},Ae=5,Ee=D({__name:"AudioSpectrumVisualizer",props:{frequencies:null,barsClass:null},setup(l){const o=l;function g(c,f){return .1+(1-.1)*(c/f)}function m(c,f){const v=g(f,o.frequencies.length);return Math.min(100,Math.max(10,c*100*Ae*v))}return(c,f)=>(i(),u("div",qe,[(i(!0),u(H,null,Y(l.frequencies,(v,b)=>(i(),u("div",{key:b,"h-full":"",flex:"","flex-1":"","items-end":""},[e("div",{transition:"all 100 ease-in-out","mx-auto":"","my-0":"","w-full":"","rounded-full":"",class:$(l.barsClass),style:ve({height:`${m(v,b)}%`})},null,6)]))),128))]))}}),Re={class:"p-3"},Te={class:"flex items-start"},ze=["checked","name","value"],Be={class:"relative mr-3 mt-0.5 flex-shrink-0"},Fe={key:0,class:"i-solar:pause-circle-bold-duotone text-xl text-neutral-400 dark:text-neutral-500"},Ne={key:1,class:"i-solar:play-circle-bold-duotone text-xl text-neutral-400 dark:text-neutral-500"},Ie={key:1,class:"mt-auto w-full flex items-center justify-center bg-neutral-50 py-3 text-xs text-neutral-400 italic dark:bg-neutral-800/50 dark:text-neutral-600"},De={class:"flex-1 cursor-pointer"},je={class:"flex items-center"},Oe={key:0,class:"mt-1 flex flex-wrap gap-1"},Qe={key:1,class:"mt-3"},He={relative:""},Ge={key:0,class:"h-16 px-3 pb-2"},Je=D({__name:"VoiceCard",props:W({name:null,voice:null,currentlyPlayingId:null,customInputPlaceholder:{default:"Enter custom voice name"},showVisualizer:{type:Boolean,default:!0},audioStream:{default:null}},{"voice-id":{required:!1,default:""},"voice-idModifiers":{},"custom-voice-name":{required:!1,default:""},"custom-voice-nameModifiers":{}}),emits:W(["togglePlayback"],["update:voice-id","update:custom-voice-name"]),setup(l,{emit:o}){const g=l,m=o,c=K(l,"voice-id"),f=K(l,"custom-voice-name");function v(h){return h.previewURL||h.preview_audio_url}function b(h){var k,U,q;const p=[];if((k=h.labels)!=null&&k.gender&&p.push(h.labels.gender),(U=h.labels)!=null&&U.age&&p.push(h.labels.age),(q=h.labels)!=null&&q.accent&&p.push(h.labels.accent),h.languages&&h.languages.length>0){const E=h.languages.map(T=>T.name).join(", ");p.push(E)}return p}function M(){m("togglePlayback",g.voice)}return(h,p)=>(i(),u("label",{border:"2px solid",class:$(["scroll-snap-align-start form_voice-card relative flex flex-col overflow-hidden rounded-xl",[c.value===g.voice.id?"bg-primary-50 dark:bg-primary-900/20 border-primary-100 dark:border-primary-900 hover:border-primary-500/30 dark:hover:border-primary-400/30":"bg-white dark:bg-neutral-900/20 border-neutral-100 dark:border-neutral-900 hover:border-primary-500/30 dark:hover:border-primary-400/30",c.value===g.voice.id?"form_voice-card-active":""]]),transition:"all duration-200 ease-in-out"},[e("div",Re,[e("div",Te,[Q(e("input",{"onUpdate:modelValue":p[0]||(p[0]=k=>c.value=k),checked:c.value===g.voice.id,type:"radio",name:l.name,value:g.voice.id,class:"absolute cursor-pointer opacity-0"},null,8,ze),[[me,c.value]]),e("div",Be,[e("div",{class:$(["size-5 border-2 rounded-full transition-colors duration-200",[c.value===g.voice.id?"border-primary-500 dark:border-primary-400":"border-neutral-300 dark:border-neutral-600"]])},[e("div",{class:$(["absolute left-1/2 top-1/2 size-3 rounded-full transition-opacity duration-200 -translate-x-1/2 -translate-y-1/2",[c.value===g.voice.id?"opacity-100 bg-primary-500 dark:bg-primary-400":"opacity-0"]])},null,2)],2)]),v(l.voice)?(i(),u("button",{key:0,absolute:"","right-0":"",top:"0","z-3":"",class:$(["translate-x-[-50%] translate-y-[50%]",[l.currentlyPlayingId===l.voice.id?"text-white dark:text-white":""]]),onClick:M},[l.currentlyPlayingId===l.voice.id?(i(),u("div",Fe)):(i(),u("div",Ne))],2)):(i(),u("div",Ie," No preview available ")),e("div",De,[e("div",je,[e("span",{class:$(["line-clamp-1 font-medium",[c.value===l.voice.id?"text-neutral-700 dark:text-neutral-300":"text-neutral-700 dark:text-neutral-400"]])},y(l.voice.name),3)]),b(l.voice).length>0?(i(),u("div",Oe,[(i(!0),u(H,null,Y(b(l.voice),(k,U)=>(i(),u("span",{key:U,class:$(["inline-flex items-center rounded-md px-1.5 py-0.5 text-xs",[c.value===l.voice.id?"bg-primary-100 text-primary-700 dark:bg-primary-900/30 dark:text-primary-400":"bg-neutral-100 text-neutral-700 dark:bg-neutral-800 dark:text-neutral-300"]])},y(k),3))),128))])):P("",!0),l.voice.customizable&&c.value===l.voice.id?(i(),u("div",Qe,[S(t(Ue),{modelValue:f.value,"onUpdate:modelValue":p[1]||(p[1]=k=>f.value=k),type:"text",class:"w-full border border-neutral-300 rounded bg-white px-2 py-1 text-sm dark:border-neutral-700 dark:bg-neutral-900",placeholder:l.customInputPlaceholder},null,8,["modelValue","placeholder"])])):P("",!0),l.voice.description?(i(),u("div",{key:2,class:$(["line-clamp-2 mt-1 text-xs",[c.value===l.voice.id?"text-neutral-600 dark:text-neutral-400":"text-neutral-500 dark:text-neutral-500"]])},y(l.voice.description),3)):P("",!0)])])]),e("div",He,[S(t(Pe),null,{default:N(()=>[l.showVisualizer&&l.currentlyPlayingId===l.voice.id&&l.audioStream?(i(),u("div",Ge,[S(t(Le),{stream:l.audioStream,bars:24,"min-freq":60,"max-freq":4e3},{default:N(({frequencies:k})=>[S(t(Ee),{frequencies:k,"bars-class":c.value===l.voice.id?"bg-primary-500 dark:bg-primary-400":"bg-neutral-400 dark:bg-neutral-600"},null,8,["frequencies","bars-class"])]),_:1},8,["stream"])])):P("",!0)]),_:1})])],2))}}),Ke=Z(Je,[["__scopeId","data-v-a5ae8da9"]]),Ye={class:"voice-preview-player"},We={key:0,class:"relative","inline-flex":"~","w-full":"","items-center":""},Xe=["placeholder"],Ze={class:"mt-4 space-y-2"},et={key:0,class:"text-sm text-neutral-500 dark:text-neutral-400"},tt={key:1,class:"flex items-center gap-3 border border-2 border-amber-200 rounded-xl bg-amber-50 p-4 dark:border-amber-800 dark:bg-amber-900/20"},st={class:"flex flex-col"},lt={class:"font-medium"},ot={class:"text-sm text-amber-600 dark:text-amber-400"},at={class:"relative"},rt=D({__name:"VoiceCardManySelect",props:W({voices:null,searchable:{type:Boolean,default:!0},searchPlaceholder:{default:"Search voices..."},searchNoResultsTitle:{default:"No voices found"},searchNoResultsDescription:{default:"Try a different search term"},searchResultsText:{default:"{count} of {total} voices"},customInputPlaceholder:{default:"Enter custom voice name"},expandButtonText:{default:"Show more"},collapseButtonText:{default:"Show less"},playButtonText:{default:"Play sample"},pauseButtonText:{default:"Pause"},showVisualizer:{type:Boolean,default:!0}},{"search-query":{required:!1,default:""},"search-queryModifiers":{},"voice-id":{required:!1,default:""},"voice-idModifiers":{}}),emits:["update:search-query","update:voice-id"],setup(l){const o=l,g=V(!1),m=V(),c=V(new Map),f=V(new Map),v=V(new Map),b=V(new Map),M=V(null);function h(){return M.value||(M.value=new(window.AudioContext||window.webkitAudioContext)),M.value}const p=K(l,"search-query"),k=K(l,"voice-id"),U=pe(()=>{if(!p.value)return o.voices;const a=p.value.toLowerCase();return o.voices.filter(r=>{const n=r.name.toLowerCase().includes(a),x=r.description&&r.description.toLowerCase().includes(a),w=r.tags&&r.tags.some(_=>_.toLowerCase().includes(a)),L=r.labels&&Object.values(r.labels).some(_=>typeof _=="string"&&_.toLowerCase().includes(a)),C=r.languages&&r.languages.some(_=>_.name.toLowerCase().includes(a)||_.code.toLowerCase().includes(a));return n||x||w||L||C})});function q(a){return a.previewURL||a.preview_audio_url}function E(a){const r=q(a);if(!r)return null;if(c.value.has(a.id))return c.value.get(a.id)||null;const n=new Audio(r);return n.crossOrigin="anonymous",n.preload="auto",n.addEventListener("ended",()=>{if(m.value===a.id){m.value=void 0;const x=f.value.get(a.id);x&&(x.getTracks().forEach(w=>w.stop()),f.value.delete(a.id))}}),c.value.set(a.id,n),n}function T(a,r){try{if(f.value.has(r))return f.value.get(r)||null;const n=h();if(b.value.has(r)){const C=b.value.get(r),_=n.createMediaStreamDestination();C.connect(_);const j=_.stream;return f.value.set(r,j),j}const x=n.createMediaElementSource(a);b.value.set(r,x),x.connect(n.destination);const w=n.createMediaStreamDestination();x.connect(w);const L=w.stream;return f.value.set(r,L),L}catch(n){return console.error("Failed to create audio stream for visualizer:",n),null}}function A(a){try{if(!q(a))return;const n=E(a);if(!n)return;if(m.value===a.id){n.pause(),m.value=void 0;const x=f.value.get(a.id);x&&(x.getTracks().forEach(w=>w.stop()),f.value.delete(a.id));return}if(m.value){const x=c.value.get(m.value);x&&x.pause();const w=f.value.get(m.value);w&&(w.getTracks().forEach(L=>L.stop()),f.value.delete(m.value))}o.showVisualizer&&!f.value.has(a.id)&&T(n,a.id),n.currentTime=0,n.play().catch(x=>{console.error("Failed to play audio:",x)}),m.value=a.id}catch(r){console.error(r),m.value=void 0}}function z(){c.value.forEach(a=>{a.pause(),a.src=""}),c.value.clear(),f.value.forEach(a=>{a.getTracks().forEach(r=>r.stop())}),f.value.clear(),v.value.forEach(a=>{a.state!=="closed"&&a.close()}),v.value.clear(),b.value.clear(),m.value=void 0}X(p,()=>{if(m.value){const a=c.value.get(m.value);a&&a.pause();const r=f.value.get(m.value);r&&(r.getTracks().forEach(n=>n.stop()),f.value.delete(m.value)),m.value=void 0}}),fe(z);const B=V("");return(a,r)=>(i(),u("div",Ye,[l.searchable?(i(),u("div",We,[r[4]||(r[4]=e("div",{class:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3"},[e("div",{"i-solar:magnifer-line-duotone":"",class:"text-neutral-500 dark:text-neutral-400"})],-1)),Q(e("input",{"onUpdate:modelValue":r[0]||(r[0]=n=>p.value=n),type:"search",class:"w-full rounded-xl p-2.5 pl-10 text-sm outline-none",border:"focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800",transition:"all duration-200 ease-in-out",bg:"white dark:neutral-900",placeholder:l.searchPlaceholder},null,8,Xe),[[ne,p.value]])])):P("",!0),e("div",Ze,[p.value?(i(),u("div",et,y(l.searchResultsText.replace("{count}",U.value.length.toString()).replace("{total}",l.voices.length.toString())),1)):P("",!0),p.value&&U.value.length===0?(i(),u("div",tt,[r[5]||(r[5]=e("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1)),e("div",st,[e("span",lt,y(l.searchNoResultsTitle),1),e("span",ot,y(l.searchNoResultsDescription.replace("{query}",p.value)),1)])])):P("",!0),e("div",at,[e("div",{class:$(["grid auto-cols-[350px] grid-flow-col max-h-[calc(100dvh-7lh)] gap-4 overflow-x-auto scrollbar-none",[g.value?"grid-cols-1 md:grid-cols-2 grid-flow-row auto-cols-auto":""]]),transition:"all duration-200 ease-in-out",style:{"scroll-snap-type":"x mandatory"}},[(i(!0),u(H,null,Y(U.value,n=>(i(),J(Ke,{key:n.id,"voice-id":k.value,"onUpdate:voiceId":r[1]||(r[1]=x=>k.value=x),"custom-voice-name":B.value,"onUpdate:customVoiceName":r[2]||(r[2]=x=>B.value=x),name:"voice",voice:n,"currently-playing-id":m.value,"custom-input-placeholder":l.customInputPlaceholder,"show-visualizer":l.showVisualizer,"audio-stream":f.value.get(n.id),onTogglePlayback:A},null,8,["voice-id","custom-voice-name","voice","currently-playing-id","custom-input-placeholder","show-visualizer","audio-stream"]))),128))],2),e("div",{bg:"neutral-100 dark:[rgba(0,0,0,0.3)]","rounded-xl":"",class:$([g.value?"w-full":"mt-4 w-full rounded-lg"])},[e("button",{"w-full":"",flex:"","items-center":"","justify-center":"","gap-2":"","rounded-lg":"","py-2":"",transition:"all duration-200 ease-in-out",class:$([g.value?"bg-primary-500 hover:bg-primary-600 text-white":"bg-white dark:bg-neutral-900 hover:bg-neutral-100 dark:hover:bg-neutral-800"]),onClick:r[3]||(r[3]=n=>g.value=!g.value)},[e("span",null,y(g.value?l.collapseButtonText:l.expandButtonText),1),e("div",{class:$([g.value?"rotate-180":"","text-lg"]),"i-solar:alt-arrow-down-bold-duotone":"",transition:"transform duration-200 ease-in-out"},null,2)],2)],2)])])]))}}),nt=Z(rt,[["__scopeId","data-v-4dd3b9e2"]]),it=D({__name:"Skeleton",props:{animation:{default:"pulse"}},setup(l){const o=l;return(g,m)=>(i(),u("div",{class:$(["skeleton",o.animation!=="none"?`skeleton-${o.animation}`:""]),bg:"neutral-200 dark:neutral-800",overflow:"hidden"},[re(g.$slots,"default",{},void 0,!0)],2))}}),O=Z(it,[["__scopeId","data-v-f404da2a"]]),ut={flex:"~ col md:row gap-6"},dt={bg:"neutral-100 dark:[rgba(0,0,0,0.3)]","rounded-xl":"","p-4":"",flex:"~ col gap-4",class:"w-full md:w-[40%]"},ct={flex:"~ col gap-4"},vt={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},mt={text:"neutral-400 dark:neutral-500"},pt={"max-w-full":""},ft={key:0,flex:"~ row gap-4",style:{"scrollbar-width":"none"},"min-w-0":"","of-x-scroll":"","scroll-smooth":"",role:"radiogroup"},gt={key:1},xt={key:0},bt={flex:"~ col gap-4"},ht={class:"text-lg md:text-2xl"},yt={text:"neutral-400 dark:neutral-400"},kt={key:0,class:"flex items-center justify-center py-4"},wt={key:1,class:"flex items-center gap-3 border border-red-200 rounded-lg bg-red-50 p-4 dark:border-red-800 dark:bg-red-900/20"},_t={class:"flex flex-col"},St={class:"font-medium"},Vt={class:"text-sm text-red-600 dark:text-red-400"},Mt={key:2,class:"flex items-center gap-3 border border-amber-200 rounded-lg bg-amber-50 p-4 dark:border-amber-800 dark:bg-amber-900/20"},Ct={class:"flex flex-col"},$t={class:"font-medium"},Pt={class:"text-sm text-amber-600 dark:text-amber-400"},Ut={key:0},Lt={flex:"~ col gap-4"},qt={key:0},At={class:"flex flex-col gap-4"},Et={flex:"~ row gap-4"},Rt={key:1,class:"space-y-6"},Tt={key:2,class:"flex items-center gap-3 border border-2 border-red-200 rounded-lg bg-red-50 p-4 dark:border-red-800 dark:bg-red-900/20"},zt={class:"flex flex-col"},Bt={class:"text-sm text-red-600 dark:text-red-400"},Ft={key:3,class:"flex items-center gap-3 border border-2 border-amber-200 rounded-lg bg-amber-50 p-4 dark:border-amber-800 dark:bg-amber-900/20"},Nt={flex:"~ col gap-4"},It={key:4,class:"mt-2 space-y-6"},Dt={key:0},jt={flex:"~ col gap-4"},Ot={flex:"~ col gap-6",class:"w-full md:w-[60%]"},Qt={"w-full":"","rounded-xl":""},Ht={class:"mb-4 text-lg text-neutral-500 md:text-2xl dark:text-neutral-400","w-full":""},Gt={class:"inline-flex items-center gap-4"},Jt={flex:"~ col gap-4"},Kt={flex:"~ row","gap-4":""},Yt=["disabled"],Wt={flex:"~ row","items-center":"","gap-2":""},Xt=["src"],Zt={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":""},es=D({__name:"speech",setup(l){const{t:o}=ge(),g=we(),m=_e(),{availableProviders:c,availableAudioSpeechProvidersMetadata:f}=te(g),{activeSpeechProvider:v,activeSpeechModel:b,activeSpeechVoice:M,activeSpeechVoiceId:h,pitch:p,isLoadingSpeechProviderVoices:k,supportsModelListing:U,providerModels:q,isLoadingActiveProviderModels:E,activeProviderModelError:T,modelSearchQuery:A,speechProviderError:z,ssmlEnabled:B,availableVoices:a}=te(m),r=V(""),n=V(!1),x=V("Hello, my name is AI Assistant"),w=V(""),L=V(!1),C=V(""),_=V(null),j=V("");ae(async()=>{await g.loadModelsForConfiguredProviders(),await m.loadVoicesForProvider(v.value)}),X(v,async()=>{await g.loadModelsForConfiguredProviders(),await m.loadVoicesForProvider(v.value)});async function ie(){if(!x.value.trim()&&!n.value||n.value&&!w.value.trim())return;if(!b.value){console.error("No model selected");return}if(!M.value){console.error("No voice selected");return}const R=g.getProviderInstance(v.value);if(!R){console.error("Failed to initialize speech provider");return}const s=g.getProviderConfig(v.value);L.value=!0,j.value="";try{C.value&&ee();const I=n.value?w.value:m.generateSSML(x.value,M.value,{...s,pitch:p.value}),G=await Se({...R.speech(b.value,s),input:I,voice:M.value.id});C.value=URL.createObjectURL(new Blob([G])),setTimeout(()=>{_.value&&_.value.play()},100)}catch(I){console.error("Error generating speech:",I),j.value=I instanceof Error?I.message:"An unknown error occurred"}finally{L.value=!1}}function ee(){_.value&&(_.value.pause(),_.value.currentTime=0),C.value&&(URL.revokeObjectURL(C.value),C.value="")}xe(()=>{C.value&&URL.revokeObjectURL(C.value)});function ue(R){M.value={id:R,name:R,description:R,previewURL:R,languages:[{code:"en",title:"English"}],provider:v.value,gender:"male"}}function de(R){b.value=R}return(R,s)=>{var G;const I=be("motion");return i(),u(H,null,[e("div",ut,[e("div",dt,[e("div",null,[e("div",ct,[e("div",null,[e("h2",vt,y(t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.title")),1),e("div",mt,[e("span",null,y(t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.description")),1)])]),e("div",pt,[t(c).length>0?(i(),u("fieldset",ft,[(i(!0),u(H,null,Y(t(f),d=>(i(),J(t($e),{id:d.id,key:d.id,modelValue:t(v),"onUpdate:modelValue":s[0]||(s[0]=ce=>F(v)?v.value=ce:null),name:"speech-provider",value:d.id,title:d.localizedName,description:d.localizedDescription},null,8,["id","modelValue","value","title","description"]))),128))])):(i(),u("div",gt,[S(t(he),{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:N(()=>s[13]||(s[13]=[e("div",{"i-solar:warning-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1),e("div",{class:"flex flex-col"},[e("span",{class:"font-medium"},"No Speech Providers Configured"),e("span",{class:"text-sm text-neutral-400 dark:text-neutral-500"},"Click here to set up your speech providers")],-1),e("div",{"i-solar:arrow-right-line-duotone":"",class:"ml-auto text-xl text-neutral-400 dark:text-neutral-500"},null,-1)])),_:1})]))])]),e("div",null,[t(v)&&t(U)?(i(),u("div",xt,[e("div",bt,[e("div",null,[e("h2",ht,y(t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.title")),1),e("div",yt,[e("span",null,y(t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle")),1)])]),t(E)?(i(),u("div",kt,[s[14]||(s[14]=e("div",{class:"mr-2 animate-spin"},[e("div",{"i-solar:spinner-line-duotone":"","text-xl":""})],-1)),e("span",null,y(t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.loading")),1)])):t(T)?(i(),u("div",wt,[s[15]||(s[15]=e("div",{"i-solar:close-circle-line-duotone":"",class:"text-2xl text-red-500 dark:text-red-400"},null,-1)),e("div",_t,[e("span",St,y(t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.error")),1),e("span",Vt,y(t(T)),1)])])):t(q).length===0&&!t(E)?(i(),u("div",Mt,[s[16]||(s[16]=e("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1)),e("div",Ct,[e("span",$t,y(t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models")),1),e("span",Pt,y(t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models_description")),1)])])):t(q).length>0?(i(),J(t(Ce),{key:3,modelValue:t(b),"onUpdate:modelValue":s[1]||(s[1]=d=>F(b)?b.value=d:null),"search-query":t(A),"onUpdate:searchQuery":s[2]||(s[2]=d=>F(A)?A.value=d:null),items:t(q),searchable:!0,"search-placeholder":t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.search_placeholder"),"search-no-results-title":t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results"),"search-no-results-description":t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results_description",{query:t(A)}),"search-results-text":t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.search_results",{count:"{count}",total:"{total}"}),"custom-input-placeholder":t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.custom_model_placeholder"),"expand-button-text":t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.expand"),"collapse-button-text":t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.collapse"),"onUpdate:customValue":de},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"])):P("",!0)])])):P("",!0)])]),t(v)?(i(),u("div",Ut,[e("div",Lt,[s[27]||(s[27]=e("div",null,[e("h2",{class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"}," Voice Configuration "),e("div",{text:"neutral-400 dark:neutral-500"},[e("span",null,"Customize how your AI assistant speaks")])],-1)),t(k)?(i(),u("div",qt,[e("div",At,[S(t(O),{class:"w-full rounded-lg p-2.5 text-sm"},{default:N(()=>s[17]||(s[17]=[e("div",{class:"h-1lh"},null,-1)])),_:1}),e("div",Et,[S(t(O),{class:"w-full rounded-lg p-4 text-sm"},{default:N(()=>s[18]||(s[18]=[e("div",{class:"h-1lh"},null,-1)])),_:1}),S(t(O),{class:"w-full rounded-lg p-4 text-sm"},{default:N(()=>s[19]||(s[19]=[e("div",{class:"h-1lh"},null,-1)])),_:1}),S(t(O),{class:"w-full rounded-lg p-4 text-sm"},{default:N(()=>s[20]||(s[20]=[e("div",{class:"h-1lh"},null,-1)])),_:1})]),S(t(O),{class:"w-full rounded-lg p-3 text-sm"},{default:N(()=>s[21]||(s[21]=[e("div",{class:"h-1lh"},null,-1)])),_:1})])])):t(a)[t(v)]&&t(a)[t(v)].length>0?(i(),u("div",Rt,[S(t(nt),{"search-query":r.value,"onUpdate:searchQuery":s[3]||(s[3]=d=>r.value=d),"voice-id":t(h),"onUpdate:voiceId":s[4]||(s[4]=d=>F(h)?h.value=d:null),voices:(G=t(a)[t(v)])==null?void 0:G.map(d=>({id:d.id,name:d.name,description:d.description,previewURL:d.previewURL,customizable:!1})),searchable:!0,"search-placeholder":t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.search_voices_placeholder"),"search-no-results-title":t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.no_voices"),"search-no-results-description":t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.no_voices_description"),"search-results-text":t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.search_voices_results",{count:0,total:0}),"custom-input-placeholder":t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.custom_voice_placeholder"),"expand-button-text":t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.show_more"),"collapse-button-text":t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.show_less"),"play-button-text":t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.play_sample"),"pause-button-text":t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.pause"),"onUpdate:customValue":ue},null,8,["search-query","voice-id","voices","search-placeholder","search-no-results-title","search-no-results-description","search-results-text","custom-input-placeholder","expand-button-text","collapse-button-text","play-button-text","pause-button-text"])])):t(z)?(i(),u("div",Tt,[s[23]||(s[23]=e("div",{"i-solar:close-circle-line-duotone":"",class:"text-2xl text-red-500 dark:text-red-400"},null,-1)),e("div",zt,[s[22]||(s[22]=e("span",{class:"font-medium"},"Error loading voices",-1)),e("span",Bt,y(t(z)),1)])])):(i(),u("div",Ft,s[24]||(s[24]=[e("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1),e("div",{class:"flex flex-col"},[e("span",{class:"font-medium"},"No voices available"),e("span",{class:"text-sm text-amber-600 dark:text-amber-400"}," No voices were found for this provider. You can enter a custom voice name below. ")],-1)]))),e("div",Nt,[S(t(se),{modelValue:t(p),"onUpdate:modelValue":s[5]||(s[5]=d=>F(p)?p.value=d:null),label:"Pitch",description:"Tune the pitch of the voice",min:-100,max:100,step:1,"format-value":d=>`${d}%`},null,8,["modelValue","format-value"]),S(t(le),{modelValue:t(B),"onUpdate:modelValue":s[6]||(s[6]=d=>F(B)?B.value=d:null),label:"Enable SSML",description:"Enable Speech Synthesis Markup Language for more control over speech output"},null,8,["modelValue"])]),!t(a)[t(v)]||t(a)[t(v)].length===0?(i(),u("div",It,[S(t(Ve),{modelValue:t(h),"onUpdate:modelValue":s[7]||(s[7]=d=>F(h)?h.value=d:null),type:"text",label:"Voice ID",description:"Enter the voice ID for your custom voice",placeholder:"Enter voice name (e.g., 'Rachel', 'Josh')"},null,8,["modelValue"]),t(v)==="elevenlabs"?(i(),u("div",Dt,[s[26]||(s[26]=e("label",{class:"mb-1 block text-sm font-medium"}," Model ",-1)),Q(e("select",{"onUpdate:modelValue":s[8]||(s[8]=d=>F(b)?b.value=d:null),class:"w-full border border-neutral-300 rounded bg-white px-3 py-2 dark:border-neutral-700 dark:bg-neutral-900"},s[25]||(s[25]=[e("option",{value:"eleven_monolingual_v1"}," Monolingual v1 ",-1),e("option",{value:"eleven_multilingual_v1"}," Multilingual v1 ",-1),e("option",{value:"eleven_multilingual_v2"}," Multilingual v2 ",-1)]),512),[[ye,t(b)]])])):P("",!0),e("div",jt,[S(t(se),{modelValue:t(p),"onUpdate:modelValue":s[9]||(s[9]=d=>F(p)?p.value=d:null),label:"Pitch",description:"Tune the pitch of the voice",min:-100,max:100,step:1,"format-value":d=>`${d}%`},null,8,["modelValue","format-value"])])])):P("",!0)])])):P("",!0)]),e("div",Ot,[e("div",Qt,[e("h2",Ht,[e("div",Gt,[S(t(ke)),e("div",null,y(t(o)("settings.pages.providers.provider.elevenlabs.playground.title")),1)])]),e("div",Jt,[S(t(le),{modelValue:n.value,"onUpdate:modelValue":s[10]||(s[10]=d=>n.value=d),label:"Use Custom SSML",description:"Enable to input raw SSML instead of plain text"},null,8,["modelValue"]),n.value?Q((i(),u("textarea",{key:1,"onUpdate:modelValue":s[12]||(s[12]=d=>w.value=d),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)),[[ne,w.value]]):(i(),J(t(Me),{key:0,modelValue:x.value,"onUpdate:modelValue":s[11]||(s[11]=d=>x.value=d),"h-24":"","w-full":"",placeholder:t(o)("settings.pages.providers.provider.elevenlabs.playground.fields.field.input.placeholder")},null,8,["modelValue","placeholder"])),e("div",Kt,[e("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:L.value||!x.value.trim()&&!n.value||n.value&&!w.value.trim()||!t(M),class:$({"opacity-50 cursor-not-allowed":L.value||!x.value.trim()&&!n.value||n.value&&!w.value.trim()||!t(M)}),bg:"neutral-700 dark:neutral-300",onClick:ie},[e("div",Wt,[s[28]||(s[28]=e("div",{"i-solar:play-circle-bold-duotone":""},null,-1)),e("span",null,y(L.value?t(o)("settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.generating"):t(o)("settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.label")),1)])],10,Yt),C.value?(i(),u("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:ee},s[29]||(s[29]=[e("div",{flex:"~ row","items-center":"","gap-2":""},[e("div",{"i-solar:stop-circle-bold-duotone":""}),e("span",null,"Stop")],-1)]))):P("",!0)]),C.value?(i(),u("audio",{key:2,ref_key:"audioPlayer",ref:_,src:C.value,controls:"",class:"mt-2 w-full"},null,8,Xt)):P("",!0)])])])]),Q((i(),u("div",Zt,s[30]||(s[30]=[e("div",{text:"60","i-solar:user-speak-rounded-bold-duotone":""},null,-1)]))),[[I]])],64)}}});typeof oe=="function"&&oe(es);export{es as default}; diff --git a/assets/speech-Pn8felHV.js b/assets/speech-Pn8felHV.js new file mode 100644 index 0000000000000000000000000000000000000000..2ff93331bcf07f3c532566df6aa5411726fc750d --- /dev/null +++ b/assets/speech-Pn8felHV.js @@ -0,0 +1 @@ +import{d as j,r as V,H as ae,v as X,f as re,c as u,o as i,F as H,l as Y,e,z as ve,n as $,m as W,u as K,x as Q,b6 as me,j as P,t as y,i as S,b as t,w as I,_ as Z,h as pe,b1 as fe,y as ne,A as J,g as ge,s as te,I as xe,K as he,Q as be,S as F,O as ye}from"./index-BNq7Hbz_.js";import{_ as se,a as le,b as ke}from"./FieldRange.vue_vue_type_script_setup_true_lang-RRSKRN5w.js";import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-B6whjTNv.js";import"./three-vrm-animation.module-BPuMi1if.js";import"./mcp-D2taTyhO.js";import"./mini_xsschema-P_8cZcRg.js";import{u as we}from"./providers-Ddg6LLwH.js";import{u as _e,g as Se}from"./speech-CKvssz06.js";import{_ as Ve}from"./FieldInput.vue_vue_type_script_setup_true_lang-IanARj3w.js";/* empty css */import{_ as Me}from"./Textarea.vue_vue_type_script_setup_true_lang-DVhP8J-8.js";import{R as Ce,a as $e}from"./RadioCardSimple-DTOaU_HK.js";import{_ as Pe}from"./TransitionVertical.vue_vue_type_script_setup_true_lang-BlPB-gCV.js";import{_ as Ue}from"./Input.vue_vue_type_script_setup_true_lang-1pgLpBi1.js";import{b as oe}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./Basic.vue_vue_type_script_setup_true_lang-DiEujAxb.js";const Le=j({__name:"AudioSpectrum",props:{stream:null,bars:{default:32},minFreq:{default:60},maxFreq:{default:4e3}},setup(l){const o=l,g=V(Array.from({length:o.bars}).fill(0));ae(()=>{m()}),X(()=>o.stream,()=>{m()});function m(){if(!o.stream)return;const c=new(window.AudioContext||window.webkitAudioContext),f=c.createMediaStreamSource(o.stream),v=c.createAnalyser();v.fftSize=2048,f.connect(v);const h=v.frequencyBinCount,M=new Uint8Array(h),p=c.sampleRate/v.fftSize,k=Math.floor(o.minFreq/p),U=Math.floor(o.maxFreq/p),q=U-k,R=Math.floor(q/o.bars),T=()=>{try{requestAnimationFrame(T),v.getByteFrequencyData(M);const A=Array.from({length:o.bars}).fill(0);for(let z=0;zre(c.$slots,"default",{frequencies:g.value})}}),qe={"h-full":"",flex:"","items-center":"","gap-1":""},Ae=5,Re=j({__name:"AudioSpectrumVisualizer",props:{frequencies:null,barsClass:null},setup(l){const o=l;function g(c,f){return .1+(1-.1)*(c/f)}function m(c,f){const v=g(f,o.frequencies.length);return Math.min(100,Math.max(10,c*100*Ae*v))}return(c,f)=>(i(),u("div",qe,[(i(!0),u(H,null,Y(l.frequencies,(v,h)=>(i(),u("div",{key:h,"h-full":"",flex:"","flex-1":"","items-end":""},[e("div",{transition:"all 100 ease-in-out","mx-auto":"","my-0":"","w-full":"","rounded-full":"",class:$(l.barsClass),style:ve({height:`${m(v,h)}%`})},null,6)]))),128))]))}}),Ee={class:"p-3"},Te={class:"flex items-start"},ze=["checked","name","value"],Be={class:"relative mr-3 mt-0.5 flex-shrink-0"},Fe={key:0,class:"i-solar:pause-circle-bold-duotone text-xl text-neutral-400 dark:text-neutral-500"},Ie={key:1,class:"i-solar:play-circle-bold-duotone text-xl text-neutral-400 dark:text-neutral-500"},Ne={key:1,class:"mt-auto w-full flex items-center justify-center bg-neutral-50 py-3 text-xs text-neutral-400 italic dark:bg-neutral-800/50 dark:text-neutral-600"},je={class:"flex-1 cursor-pointer"},De={class:"flex items-center"},Oe={key:0,class:"mt-1 flex flex-wrap gap-1"},Qe={key:1,class:"mt-3"},He={relative:""},Ge={key:0,class:"h-16 px-3 pb-2"},Je=j({__name:"VoiceCard",props:W({name:null,voice:null,currentlyPlayingId:null,customInputPlaceholder:{default:"Enter custom voice name"},showVisualizer:{type:Boolean,default:!0},audioStream:{default:null}},{"voice-id":{required:!1,default:""},"voice-idModifiers":{},"custom-voice-name":{required:!1,default:""},"custom-voice-nameModifiers":{}}),emits:W(["togglePlayback"],["update:voice-id","update:custom-voice-name"]),setup(l,{emit:o}){const g=l,m=o,c=K(l,"voice-id"),f=K(l,"custom-voice-name");function v(b){return b.previewURL||b.preview_audio_url}function h(b){var k,U,q;const p=[];if((k=b.labels)!=null&&k.gender&&p.push(b.labels.gender),(U=b.labels)!=null&&U.age&&p.push(b.labels.age),(q=b.labels)!=null&&q.accent&&p.push(b.labels.accent),b.languages&&b.languages.length>0){const R=b.languages.map(T=>T.name).join(", ");p.push(R)}return p}function M(){m("togglePlayback",g.voice)}return(b,p)=>(i(),u("label",{border:"2px solid",class:$(["scroll-snap-align-start form_voice-card relative flex flex-col overflow-hidden rounded-xl",[c.value===g.voice.id?"bg-primary-50 dark:bg-primary-900/20 border-primary-100 dark:border-primary-900 hover:border-primary-500/30 dark:hover:border-primary-400/30":"bg-white dark:bg-neutral-900/20 border-neutral-100 dark:border-neutral-900 hover:border-primary-500/30 dark:hover:border-primary-400/30",c.value===g.voice.id?"form_voice-card-active":""]]),transition:"all duration-200 ease-in-out"},[e("div",Ee,[e("div",Te,[Q(e("input",{"onUpdate:modelValue":p[0]||(p[0]=k=>c.value=k),checked:c.value===g.voice.id,type:"radio",name:l.name,value:g.voice.id,class:"absolute cursor-pointer opacity-0"},null,8,ze),[[me,c.value]]),e("div",Be,[e("div",{class:$(["size-5 border-2 rounded-full transition-colors duration-200",[c.value===g.voice.id?"border-primary-500 dark:border-primary-400":"border-neutral-300 dark:border-neutral-600"]])},[e("div",{class:$(["absolute left-1/2 top-1/2 size-3 rounded-full transition-opacity duration-200 -translate-x-1/2 -translate-y-1/2",[c.value===g.voice.id?"opacity-100 bg-primary-500 dark:bg-primary-400":"opacity-0"]])},null,2)],2)]),v(l.voice)?(i(),u("button",{key:0,absolute:"","right-0":"",top:"0","z-3":"",class:$(["translate-x-[-50%] translate-y-[50%]",[l.currentlyPlayingId===l.voice.id?"text-white dark:text-white":""]]),onClick:M},[l.currentlyPlayingId===l.voice.id?(i(),u("div",Fe)):(i(),u("div",Ie))],2)):(i(),u("div",Ne," No preview available ")),e("div",je,[e("div",De,[e("span",{class:$(["line-clamp-1 font-medium",[c.value===l.voice.id?"text-neutral-700 dark:text-neutral-300":"text-neutral-700 dark:text-neutral-400"]])},y(l.voice.name),3)]),h(l.voice).length>0?(i(),u("div",Oe,[(i(!0),u(H,null,Y(h(l.voice),(k,U)=>(i(),u("span",{key:U,class:$(["inline-flex items-center rounded-md px-1.5 py-0.5 text-xs",[c.value===l.voice.id?"bg-primary-100 text-primary-700 dark:bg-primary-900/30 dark:text-primary-400":"bg-neutral-100 text-neutral-700 dark:bg-neutral-800 dark:text-neutral-300"]])},y(k),3))),128))])):P("",!0),l.voice.customizable&&c.value===l.voice.id?(i(),u("div",Qe,[S(t(Ue),{modelValue:f.value,"onUpdate:modelValue":p[1]||(p[1]=k=>f.value=k),type:"text",class:"w-full border border-neutral-300 rounded bg-white px-2 py-1 text-sm dark:border-neutral-700 dark:bg-neutral-900",placeholder:l.customInputPlaceholder},null,8,["modelValue","placeholder"])])):P("",!0),l.voice.description?(i(),u("div",{key:2,class:$(["line-clamp-2 mt-1 text-xs",[c.value===l.voice.id?"text-neutral-600 dark:text-neutral-400":"text-neutral-500 dark:text-neutral-500"]])},y(l.voice.description),3)):P("",!0)])])]),e("div",He,[S(t(Pe),null,{default:I(()=>[l.showVisualizer&&l.currentlyPlayingId===l.voice.id&&l.audioStream?(i(),u("div",Ge,[S(t(Le),{stream:l.audioStream,bars:24,"min-freq":60,"max-freq":4e3},{default:I(({frequencies:k})=>[S(t(Re),{frequencies:k,"bars-class":c.value===l.voice.id?"bg-primary-500 dark:bg-primary-400":"bg-neutral-400 dark:bg-neutral-600"},null,8,["frequencies","bars-class"])]),_:1},8,["stream"])])):P("",!0)]),_:1})])],2))}}),Ke=Z(Je,[["__scopeId","data-v-a5ae8da9"]]),Ye={class:"voice-preview-player"},We={key:0,class:"relative","inline-flex":"~","w-full":"","items-center":""},Xe=["placeholder"],Ze={class:"mt-4 space-y-2"},et={key:0,class:"text-sm text-neutral-500 dark:text-neutral-400"},tt={key:1,class:"flex items-center gap-3 border border-2 border-amber-200 rounded-xl bg-amber-50 p-4 dark:border-amber-800 dark:bg-amber-900/20"},st={class:"flex flex-col"},lt={class:"font-medium"},ot={class:"text-sm text-amber-600 dark:text-amber-400"},at={class:"relative"},rt=j({__name:"VoiceCardManySelect",props:W({voices:null,searchable:{type:Boolean,default:!0},searchPlaceholder:{default:"Search voices..."},searchNoResultsTitle:{default:"No voices found"},searchNoResultsDescription:{default:"Try a different search term"},searchResultsText:{default:"{count} of {total} voices"},customInputPlaceholder:{default:"Enter custom voice name"},expandButtonText:{default:"Show more"},collapseButtonText:{default:"Show less"},playButtonText:{default:"Play sample"},pauseButtonText:{default:"Pause"},showVisualizer:{type:Boolean,default:!0}},{"search-query":{required:!1,default:""},"search-queryModifiers":{},"voice-id":{required:!1,default:""},"voice-idModifiers":{}}),emits:["update:search-query","update:voice-id"],setup(l){const o=l,g=V(!1),m=V(),c=V(new Map),f=V(new Map),v=V(new Map),h=V(new Map),M=V(null);function b(){return M.value||(M.value=new(window.AudioContext||window.webkitAudioContext)),M.value}const p=K(l,"search-query"),k=K(l,"voice-id"),U=pe(()=>{if(!p.value)return o.voices;const a=p.value.toLowerCase();return o.voices.filter(r=>{const n=r.name.toLowerCase().includes(a),x=r.description&&r.description.toLowerCase().includes(a),w=r.tags&&r.tags.some(_=>_.toLowerCase().includes(a)),L=r.labels&&Object.values(r.labels).some(_=>typeof _=="string"&&_.toLowerCase().includes(a)),C=r.languages&&r.languages.some(_=>_.name.toLowerCase().includes(a)||_.code.toLowerCase().includes(a));return n||x||w||L||C})});function q(a){return a.previewURL||a.preview_audio_url}function R(a){const r=q(a);if(!r)return null;if(c.value.has(a.id))return c.value.get(a.id)||null;const n=new Audio(r);return n.crossOrigin="anonymous",n.preload="auto",n.addEventListener("ended",()=>{if(m.value===a.id){m.value=void 0;const x=f.value.get(a.id);x&&(x.getTracks().forEach(w=>w.stop()),f.value.delete(a.id))}}),c.value.set(a.id,n),n}function T(a,r){try{if(f.value.has(r))return f.value.get(r)||null;const n=b();if(h.value.has(r)){const C=h.value.get(r),_=n.createMediaStreamDestination();C.connect(_);const D=_.stream;return f.value.set(r,D),D}const x=n.createMediaElementSource(a);h.value.set(r,x),x.connect(n.destination);const w=n.createMediaStreamDestination();x.connect(w);const L=w.stream;return f.value.set(r,L),L}catch(n){return console.error("Failed to create audio stream for visualizer:",n),null}}function A(a){try{if(!q(a))return;const n=R(a);if(!n)return;if(m.value===a.id){n.pause(),m.value=void 0;const x=f.value.get(a.id);x&&(x.getTracks().forEach(w=>w.stop()),f.value.delete(a.id));return}if(m.value){const x=c.value.get(m.value);x&&x.pause();const w=f.value.get(m.value);w&&(w.getTracks().forEach(L=>L.stop()),f.value.delete(m.value))}o.showVisualizer&&!f.value.has(a.id)&&T(n,a.id),n.currentTime=0,n.play().catch(x=>{console.error("Failed to play audio:",x)}),m.value=a.id}catch(r){console.error(r),m.value=void 0}}function z(){c.value.forEach(a=>{a.pause(),a.src=""}),c.value.clear(),f.value.forEach(a=>{a.getTracks().forEach(r=>r.stop())}),f.value.clear(),v.value.forEach(a=>{a.state!=="closed"&&a.close()}),v.value.clear(),h.value.clear(),m.value=void 0}X(p,()=>{if(m.value){const a=c.value.get(m.value);a&&a.pause();const r=f.value.get(m.value);r&&(r.getTracks().forEach(n=>n.stop()),f.value.delete(m.value)),m.value=void 0}}),fe(z);const B=V("");return(a,r)=>(i(),u("div",Ye,[l.searchable?(i(),u("div",We,[r[4]||(r[4]=e("div",{class:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3"},[e("div",{"i-solar:magnifer-line-duotone":"",class:"text-neutral-500 dark:text-neutral-400"})],-1)),Q(e("input",{"onUpdate:modelValue":r[0]||(r[0]=n=>p.value=n),type:"search",class:"w-full rounded-xl p-2.5 pl-10 text-sm outline-none",border:"focus:primary-100 dark:focus:primary-400/50 2 solid neutral-200 dark:neutral-800",transition:"all duration-200 ease-in-out",bg:"white dark:neutral-900",placeholder:l.searchPlaceholder},null,8,Xe),[[ne,p.value]])])):P("",!0),e("div",Ze,[p.value?(i(),u("div",et,y(l.searchResultsText.replace("{count}",U.value.length.toString()).replace("{total}",l.voices.length.toString())),1)):P("",!0),p.value&&U.value.length===0?(i(),u("div",tt,[r[5]||(r[5]=e("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1)),e("div",st,[e("span",lt,y(l.searchNoResultsTitle),1),e("span",ot,y(l.searchNoResultsDescription.replace("{query}",p.value)),1)])])):P("",!0),e("div",at,[e("div",{class:$(["grid auto-cols-[350px] grid-flow-col max-h-[calc(100dvh-7lh)] gap-4 overflow-x-auto scrollbar-none",[g.value?"grid-cols-1 md:grid-cols-2 grid-flow-row auto-cols-auto":""]]),transition:"all duration-200 ease-in-out",style:{"scroll-snap-type":"x mandatory"}},[(i(!0),u(H,null,Y(U.value,n=>(i(),J(Ke,{key:n.id,"voice-id":k.value,"onUpdate:voiceId":r[1]||(r[1]=x=>k.value=x),"custom-voice-name":B.value,"onUpdate:customVoiceName":r[2]||(r[2]=x=>B.value=x),name:"voice",voice:n,"currently-playing-id":m.value,"custom-input-placeholder":l.customInputPlaceholder,"show-visualizer":l.showVisualizer,"audio-stream":f.value.get(n.id),onTogglePlayback:A},null,8,["voice-id","custom-voice-name","voice","currently-playing-id","custom-input-placeholder","show-visualizer","audio-stream"]))),128))],2),e("div",{bg:"neutral-100 dark:[rgba(0,0,0,0.3)]","rounded-xl":"",class:$([g.value?"w-full":"mt-4 w-full rounded-lg"])},[e("button",{"w-full":"",flex:"","items-center":"","justify-center":"","gap-2":"","rounded-lg":"","py-2":"",transition:"all duration-200 ease-in-out",class:$([g.value?"bg-primary-500 hover:bg-primary-600 text-white":"bg-white dark:bg-neutral-900 hover:bg-neutral-100 dark:hover:bg-neutral-800"]),onClick:r[3]||(r[3]=n=>g.value=!g.value)},[e("span",null,y(g.value?l.collapseButtonText:l.expandButtonText),1),e("div",{class:$([g.value?"rotate-180":"","text-lg"]),"i-solar:alt-arrow-down-bold-duotone":"",transition:"transform duration-200 ease-in-out"},null,2)],2)],2)])])]))}}),nt=Z(rt,[["__scopeId","data-v-4dd3b9e2"]]),it=j({__name:"Skeleton",props:{animation:{default:"pulse"}},setup(l){const o=l;return(g,m)=>(i(),u("div",{class:$(["skeleton",o.animation!=="none"?`skeleton-${o.animation}`:""]),bg:"neutral-200 dark:neutral-800",overflow:"hidden"},[re(g.$slots,"default",{},void 0,!0)],2))}}),O=Z(it,[["__scopeId","data-v-f404da2a"]]),ut={flex:"~ col md:row gap-6"},dt={bg:"neutral-100 dark:[rgba(0,0,0,0.3)]","rounded-xl":"","p-4":"",flex:"~ col gap-4",class:"w-full md:w-[40%]"},ct={flex:"~ col gap-4"},vt={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},mt={text:"neutral-400 dark:neutral-500"},pt={"max-w-full":""},ft={key:0,flex:"~ row gap-4",style:{"scrollbar-width":"none"},"min-w-0":"","of-x-scroll":"","scroll-smooth":"",role:"radiogroup"},gt={key:1},xt={key:0},ht={flex:"~ col gap-4"},bt={class:"text-lg md:text-2xl"},yt={text:"neutral-400 dark:neutral-400"},kt={key:0,class:"flex items-center justify-center py-4"},wt={key:1,class:"flex items-center gap-3 border border-red-200 rounded-lg bg-red-50 p-4 dark:border-red-800 dark:bg-red-900/20"},_t={class:"flex flex-col"},St={class:"font-medium"},Vt={class:"text-sm text-red-600 dark:text-red-400"},Mt={key:2,class:"flex items-center gap-3 border border-amber-200 rounded-lg bg-amber-50 p-4 dark:border-amber-800 dark:bg-amber-900/20"},Ct={class:"flex flex-col"},$t={class:"font-medium"},Pt={class:"text-sm text-amber-600 dark:text-amber-400"},Ut={key:0},Lt={flex:"~ col gap-4"},qt={key:0},At={class:"flex flex-col gap-4"},Rt={flex:"~ row gap-4"},Et={key:1,class:"space-y-6"},Tt={key:2,class:"flex items-center gap-3 border border-2 border-red-200 rounded-lg bg-red-50 p-4 dark:border-red-800 dark:bg-red-900/20"},zt={class:"flex flex-col"},Bt={class:"text-sm text-red-600 dark:text-red-400"},Ft={key:3,class:"flex items-center gap-3 border border-2 border-amber-200 rounded-lg bg-amber-50 p-4 dark:border-amber-800 dark:bg-amber-900/20"},It={flex:"~ col gap-4"},Nt={key:4,class:"mt-2 space-y-6"},jt={key:0},Dt={flex:"~ col gap-4"},Ot={flex:"~ col gap-6",class:"w-full md:w-[60%]"},Qt={"w-full":"","rounded-xl":""},Ht={class:"mb-4 text-lg text-neutral-500 md:text-2xl dark:text-neutral-400","w-full":""},Gt={class:"inline-flex items-center gap-4"},Jt={flex:"~ col gap-4"},Kt={flex:"~ row","gap-4":""},Yt=["disabled"],Wt={flex:"~ row","items-center":"","gap-2":""},Xt=["src"],Zt={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":""},es=j({__name:"speech",setup(l){const{t:o}=ge(),g=we(),m=_e(),{availableProviders:c,availableAudioSpeechProvidersMetadata:f}=te(g),{activeSpeechProvider:v,activeSpeechModel:h,activeSpeechVoice:M,activeSpeechVoiceId:b,pitch:p,isLoadingSpeechProviderVoices:k,supportsModelListing:U,providerModels:q,isLoadingActiveProviderModels:R,activeProviderModelError:T,modelSearchQuery:A,speechProviderError:z,ssmlEnabled:B,availableVoices:a}=te(m),r=V(""),n=V(!1),x=V("Hello, my name is AI Assistant"),w=V(""),L=V(!1),C=V(""),_=V(null),D=V("");ae(async()=>{await g.loadModelsForConfiguredProviders(),await m.loadVoicesForProvider(v.value)}),X(v,async()=>{await g.loadModelsForConfiguredProviders(),await m.loadVoicesForProvider(v.value)});async function ie(){if(!x.value.trim()&&!n.value||n.value&&!w.value.trim())return;if(!h.value){console.error("No model selected");return}if(!M.value){console.error("No voice selected");return}const E=g.getProviderInstance(v.value);if(!E){console.error("Failed to initialize speech provider");return}const s=g.getProviderConfig(v.value);L.value=!0,D.value="";try{C.value&&ee();const N=n.value?w.value:m.generateSSML(x.value,M.value,{...s,pitch:p.value}),G=await Se({...E.speech(h.value,s),input:N,voice:M.value.id});C.value=URL.createObjectURL(new Blob([G])),setTimeout(()=>{_.value&&_.value.play()},100)}catch(N){console.error("Error generating speech:",N),D.value=N instanceof Error?N.message:"An unknown error occurred"}finally{L.value=!1}}function ee(){_.value&&(_.value.pause(),_.value.currentTime=0),C.value&&(URL.revokeObjectURL(C.value),C.value="")}xe(()=>{C.value&&URL.revokeObjectURL(C.value)});function ue(E){M.value={id:E,name:E,description:E,previewURL:E,languages:[{code:"en",title:"English"}],provider:v.value,gender:"male"}}function de(E){h.value=E}return(E,s)=>{var G;const N=he("motion");return i(),u(H,null,[e("div",ut,[e("div",dt,[e("div",null,[e("div",ct,[e("div",null,[e("h2",vt,y(t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.title")),1),e("div",mt,[e("span",null,y(t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.description")),1)])]),e("div",pt,[t(c).length>0?(i(),u("fieldset",ft,[(i(!0),u(H,null,Y(t(f),d=>(i(),J(t($e),{id:d.id,key:d.id,modelValue:t(v),"onUpdate:modelValue":s[0]||(s[0]=ce=>F(v)?v.value=ce:null),name:"speech-provider",value:d.id,title:d.localizedName,description:d.localizedDescription},null,8,["id","modelValue","value","title","description"]))),128))])):(i(),u("div",gt,[S(t(be),{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:I(()=>s[13]||(s[13]=[e("div",{"i-solar:warning-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1),e("div",{class:"flex flex-col"},[e("span",{class:"font-medium"},"No Speech Providers Configured"),e("span",{class:"text-sm text-neutral-400 dark:text-neutral-500"},"Click here to set up your speech providers")],-1),e("div",{"i-solar:arrow-right-line-duotone":"",class:"ml-auto text-xl text-neutral-400 dark:text-neutral-500"},null,-1)])),_:1})]))])]),e("div",null,[t(v)&&t(U)?(i(),u("div",xt,[e("div",ht,[e("div",null,[e("h2",bt,y(t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.title")),1),e("div",yt,[e("span",null,y(t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle")),1)])]),t(R)?(i(),u("div",kt,[s[14]||(s[14]=e("div",{class:"mr-2 animate-spin"},[e("div",{"i-solar:spinner-line-duotone":"","text-xl":""})],-1)),e("span",null,y(t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.loading")),1)])):t(T)?(i(),u("div",wt,[s[15]||(s[15]=e("div",{"i-solar:close-circle-line-duotone":"",class:"text-2xl text-red-500 dark:text-red-400"},null,-1)),e("div",_t,[e("span",St,y(t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.error")),1),e("span",Vt,y(t(T)),1)])])):t(q).length===0&&!t(R)?(i(),u("div",Mt,[s[16]||(s[16]=e("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1)),e("div",Ct,[e("span",$t,y(t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models")),1),e("span",Pt,y(t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models_description")),1)])])):t(q).length>0?(i(),J(t(Ce),{key:3,modelValue:t(h),"onUpdate:modelValue":s[1]||(s[1]=d=>F(h)?h.value=d:null),"search-query":t(A),"onUpdate:searchQuery":s[2]||(s[2]=d=>F(A)?A.value=d:null),items:t(q),searchable:!0,"search-placeholder":t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.search_placeholder"),"search-no-results-title":t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results"),"search-no-results-description":t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results_description",{query:t(A)}),"search-results-text":t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.search_results",{count:"{count}",total:"{total}"}),"custom-input-placeholder":t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.custom_model_placeholder"),"expand-button-text":t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.expand"),"collapse-button-text":t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.collapse"),"onUpdate:customValue":de},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"])):P("",!0)])])):P("",!0)])]),t(v)?(i(),u("div",Ut,[e("div",Lt,[s[27]||(s[27]=e("div",null,[e("h2",{class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"}," Voice Configuration "),e("div",{text:"neutral-400 dark:neutral-500"},[e("span",null,"Customize how your AI assistant speaks")])],-1)),t(k)?(i(),u("div",qt,[e("div",At,[S(t(O),{class:"w-full rounded-lg p-2.5 text-sm"},{default:I(()=>s[17]||(s[17]=[e("div",{class:"h-1lh"},null,-1)])),_:1}),e("div",Rt,[S(t(O),{class:"w-full rounded-lg p-4 text-sm"},{default:I(()=>s[18]||(s[18]=[e("div",{class:"h-1lh"},null,-1)])),_:1}),S(t(O),{class:"w-full rounded-lg p-4 text-sm"},{default:I(()=>s[19]||(s[19]=[e("div",{class:"h-1lh"},null,-1)])),_:1}),S(t(O),{class:"w-full rounded-lg p-4 text-sm"},{default:I(()=>s[20]||(s[20]=[e("div",{class:"h-1lh"},null,-1)])),_:1})]),S(t(O),{class:"w-full rounded-lg p-3 text-sm"},{default:I(()=>s[21]||(s[21]=[e("div",{class:"h-1lh"},null,-1)])),_:1})])])):t(a)[t(v)]&&t(a)[t(v)].length>0?(i(),u("div",Et,[S(t(nt),{"search-query":r.value,"onUpdate:searchQuery":s[3]||(s[3]=d=>r.value=d),"voice-id":t(b),"onUpdate:voiceId":s[4]||(s[4]=d=>F(b)?b.value=d:null),voices:(G=t(a)[t(v)])==null?void 0:G.map(d=>({id:d.id,name:d.name,description:d.description,previewURL:d.previewURL,customizable:!1})),searchable:!0,"search-placeholder":t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.search_voices_placeholder"),"search-no-results-title":t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.no_voices"),"search-no-results-description":t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.no_voices_description"),"search-results-text":t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.search_voices_results",{count:0,total:0}),"custom-input-placeholder":t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.custom_voice_placeholder"),"expand-button-text":t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.show_more"),"collapse-button-text":t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.show_less"),"play-button-text":t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.play_sample"),"pause-button-text":t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.pause"),"onUpdate:customValue":ue},null,8,["search-query","voice-id","voices","search-placeholder","search-no-results-title","search-no-results-description","search-results-text","custom-input-placeholder","expand-button-text","collapse-button-text","play-button-text","pause-button-text"])])):t(z)?(i(),u("div",Tt,[s[23]||(s[23]=e("div",{"i-solar:close-circle-line-duotone":"",class:"text-2xl text-red-500 dark:text-red-400"},null,-1)),e("div",zt,[s[22]||(s[22]=e("span",{class:"font-medium"},"Error loading voices",-1)),e("span",Bt,y(t(z)),1)])])):(i(),u("div",Ft,s[24]||(s[24]=[e("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1),e("div",{class:"flex flex-col"},[e("span",{class:"font-medium"},"No voices available"),e("span",{class:"text-sm text-amber-600 dark:text-amber-400"}," No voices were found for this provider. You can enter a custom voice name below. ")],-1)]))),e("div",It,[S(t(se),{modelValue:t(p),"onUpdate:modelValue":s[5]||(s[5]=d=>F(p)?p.value=d:null),label:"Pitch",description:"Tune the pitch of the voice",min:-100,max:100,step:1,"format-value":d=>`${d}%`},null,8,["modelValue","format-value"]),S(t(le),{modelValue:t(B),"onUpdate:modelValue":s[6]||(s[6]=d=>F(B)?B.value=d:null),label:"Enable SSML",description:"Enable Speech Synthesis Markup Language for more control over speech output"},null,8,["modelValue"])]),!t(a)[t(v)]||t(a)[t(v)].length===0?(i(),u("div",Nt,[S(t(Ve),{modelValue:t(b),"onUpdate:modelValue":s[7]||(s[7]=d=>F(b)?b.value=d:null),type:"text",label:"Voice ID",description:"Enter the voice ID for your custom voice",placeholder:"Enter voice name (e.g., 'Rachel', 'Josh')"},null,8,["modelValue"]),t(v)==="elevenlabs"?(i(),u("div",jt,[s[26]||(s[26]=e("label",{class:"mb-1 block text-sm font-medium"}," Model ",-1)),Q(e("select",{"onUpdate:modelValue":s[8]||(s[8]=d=>F(h)?h.value=d:null),class:"w-full border border-neutral-300 rounded bg-white px-3 py-2 dark:border-neutral-700 dark:bg-neutral-900"},s[25]||(s[25]=[e("option",{value:"eleven_monolingual_v1"}," Monolingual v1 ",-1),e("option",{value:"eleven_multilingual_v1"}," Multilingual v1 ",-1),e("option",{value:"eleven_multilingual_v2"}," Multilingual v2 ",-1)]),512),[[ye,t(h)]])])):P("",!0),e("div",Dt,[S(t(se),{modelValue:t(p),"onUpdate:modelValue":s[9]||(s[9]=d=>F(p)?p.value=d:null),label:"Pitch",description:"Tune the pitch of the voice",min:-100,max:100,step:1,"format-value":d=>`${d}%`},null,8,["modelValue","format-value"])])])):P("",!0)])])):P("",!0)]),e("div",Ot,[e("div",Qt,[e("h2",Ht,[e("div",Gt,[S(t(ke)),e("div",null,y(t(o)("settings.pages.providers.provider.elevenlabs.playground.title")),1)])]),e("div",Jt,[S(t(le),{modelValue:n.value,"onUpdate:modelValue":s[10]||(s[10]=d=>n.value=d),label:"Use Custom SSML",description:"Enable to input raw SSML instead of plain text"},null,8,["modelValue"]),n.value?Q((i(),u("textarea",{key:1,"onUpdate:modelValue":s[12]||(s[12]=d=>w.value=d),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)),[[ne,w.value]]):(i(),J(t(Me),{key:0,modelValue:x.value,"onUpdate:modelValue":s[11]||(s[11]=d=>x.value=d),"h-24":"","w-full":"",placeholder:t(o)("settings.pages.providers.provider.elevenlabs.playground.fields.field.input.placeholder")},null,8,["modelValue","placeholder"])),e("div",Kt,[e("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:L.value||!x.value.trim()&&!n.value||n.value&&!w.value.trim()||!t(M),class:$({"opacity-50 cursor-not-allowed":L.value||!x.value.trim()&&!n.value||n.value&&!w.value.trim()||!t(M)}),bg:"neutral-700 dark:neutral-300",onClick:ie},[e("div",Wt,[s[28]||(s[28]=e("div",{"i-solar:play-circle-bold-duotone":""},null,-1)),e("span",null,y(L.value?t(o)("settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.generating"):t(o)("settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.label")),1)])],10,Yt),C.value?(i(),u("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:ee},s[29]||(s[29]=[e("div",{flex:"~ row","items-center":"","gap-2":""},[e("div",{"i-solar:stop-circle-bold-duotone":""}),e("span",null,"Stop")],-1)]))):P("",!0)]),C.value?(i(),u("audio",{key:2,ref_key:"audioPlayer",ref:_,src:C.value,controls:"",class:"mt-2 w-full"},null,8,Xt)):P("",!0)])])])]),Q((i(),u("div",Zt,s[30]||(s[30]=[e("div",{text:"60","i-solar:user-speak-rounded-bold-duotone":""},null,-1)]))),[[N]])],64)}}});typeof oe=="function"&&oe(es);export{es as default}; diff --git a/assets/stage-D2VVUTOX.js b/assets/stage-D2VVUTOX.js new file mode 100644 index 0000000000000000000000000000000000000000..965e9da59dc24d60750c7e01dcd9c08a1692b3f2 --- /dev/null +++ b/assets/stage-D2VVUTOX.js @@ -0,0 +1 @@ +import{d as p,M as s,c,i,N as d,z as m,b as e,o as l}from"./index-BNq7Hbz_.js";const x=p({__name:"stage",setup(f){const{top:t,right:o,bottom:a,left:n}=s();return(u,_)=>{const r=d("RouterView");return l(),c("main",{text:"gray-700 dark:gray-200","h-full":"","font-cuteen":"",style:m({paddingTop:`${e(t)}px`,paddingRight:`${e(o)}px`,paddingBottom:`${e(a)}px`,paddingLeft:`${e(n)}px`})},[i(r)],4)}}});export{x as default}; diff --git a/assets/stage-DyJiUv5T.js b/assets/stage-DyJiUv5T.js deleted file mode 100644 index c6118bd8246c2495fce4446efbfbef4875228fe4..0000000000000000000000000000000000000000 --- a/assets/stage-DyJiUv5T.js +++ /dev/null @@ -1 +0,0 @@ -import{d as p,n as s,c,b as d,p as i,q as m,u as e,o as l}from"./index-D3pfQUMu.js";const x=p({__name:"stage",setup(u){const{top:t,right:o,bottom:a,left:n}=s();return(f,_)=>{const r=i("RouterView");return l(),c("main",{text:"gray-700 dark:gray-200","h-full":"","font-cuteen":"",style:m({paddingTop:`${e(t)}px`,paddingRight:`${e(o)}px`,paddingBottom:`${e(a)}px`,paddingLeft:`${e(n)}px`})},[d(r)],4)}}});export{x as default}; diff --git a/assets/three-vrm-animation.module-DLbUhddZ.js b/assets/three-vrm-animation.module-BPuMi1if.js similarity index 97% rename from assets/three-vrm-animation.module-DLbUhddZ.js rename to assets/three-vrm-animation.module-BPuMi1if.js index 345535523a39aea356e390620e41d9a5b2719ce6..b2495109aaf06cb44dc429d8a7edf410dd113e80 100644 --- a/assets/three-vrm-animation.module-DLbUhddZ.js +++ b/assets/three-vrm-animation.module-BPuMi1if.js @@ -1,11 +1,11 @@ -import{_ as N,N as ae,V as _,ci as z,a7 as X,b5 as Bi,a3 as ki,ac as C,Q as T,a6 as ee,bd as le,ay as zt,aj as jt,an as Xt,b6 as Oe,b9 as at,cj as Fi,a2 as Hi,ck as Wi,a4 as zi,cl as ce,b1 as xe,av as U,cm as ji,$ as Y,ba as Xi,b8 as qi,cn as qt,be as lt,co as Yi,am as Ie,bf as Gi,bi as Qi,bj as $i}from"./index-D3pfQUMu.js";const et=400,j=[[.075,800],[.11,0],[.125,0],[.14,0],[.125,0],[.05,0],[.04,0],[.03,0],[.02,0],[1,0]];for(let e=1;enew Promise((i,r)=>{var o=s=>{try{l(n.next(s))}catch(u){r(u)}},a=s=>{try{l(n.throw(s))}catch(u){r(u)}},l=s=>s.done?i(s.value):Promise.resolve(s.value).then(o,a);l((n=n.apply(e,t)).next())}),A=(e,t,n)=>new Promise((i,r)=>{var o=s=>{try{l(n.next(s))}catch(u){r(u)}},a=s=>{try{l(n.throw(s))}catch(u){r(u)}},l=s=>s.done?i(s.value):Promise.resolve(s.value).then(o,a);l((n=n.apply(e,t)).next())}),Yt=class extends xe{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){const t=this._binds.indexOf(e);t>=0&&this._binds.splice(t,1)}applyWeight(e){var t;let n=this.outputWeight;n*=(t=e==null?void 0:e.multiplier)!=null?t:1,this.isBinary&&n<1&&(n=0),this._binds.forEach(i=>i.applyWeight(n))}clearAppliedWeight(){this._binds.forEach(e=>e.clearAppliedWeight())}};function kn(e,t,n){var i,r;const o=e.parser.json,a=(i=o.nodes)==null?void 0:i[t];if(a==null)return console.warn(`extractPrimitivesInternal: Attempt to use nodes[${t}] of glTF but the node doesn't exist`),null;const l=a.mesh;if(l==null)return null;const s=(r=o.meshes)==null?void 0:r[l];if(s==null)return console.warn(`extractPrimitivesInternal: Attempt to use meshes[${l}] of glTF but the mesh doesn't exist`),null;const u=s.primitives.length,h=[];return n.traverse(d=>{h.length{const o=kn(e,r,i);o!=null&&n.set(r,o)}),n})}var tt={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 Fn(e){return Math.max(Math.min(e,1),0)}var $t=class Hn{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(){const t={},n=new Set(Object.values(tt));return Object.entries(this._expressionMap).forEach(([i,r])=>{n.has(i)&&(t[i]=r)}),t}get customExpressionMap(){const t={},n=new Set(Object.values(tt));return Object.entries(this._expressionMap).forEach(([i,r])=>{n.has(i)||(t[i]=r)}),t}copy(t){return this._expressions.concat().forEach(i=>{this.unregisterExpression(i)}),t._expressions.forEach(i=>{this.registerExpression(i)}),this.blinkExpressionNames=t.blinkExpressionNames.concat(),this.lookAtExpressionNames=t.lookAtExpressionNames.concat(),this.mouthExpressionNames=t.mouthExpressionNames.concat(),this}clone(){return new Hn().copy(this)}getExpression(t){var n;return(n=this._expressionMap[t])!=null?n:null}registerExpression(t){this._expressions.push(t),this._expressionMap[t.expressionName]=t}unregisterExpression(t){const n=this._expressions.indexOf(t);n===-1&&console.warn("VRMExpressionManager: The specified expressions is not registered"),this._expressions.splice(n,1),delete this._expressionMap[t.expressionName]}getValue(t){var n;const i=this.getExpression(t);return(n=i==null?void 0:i.weight)!=null?n:null}setValue(t,n){const i=this.getExpression(t);i&&(i.weight=Fn(n))}resetValues(){this._expressions.forEach(t=>{t.weight=0})}getExpressionTrackName(t){const n=this.getExpression(t);return n?`${n.name}.weight`:null}update(){const t=this._calculateWeightMultipliers();this._expressions.forEach(n=>{n.clearAppliedWeight()}),this._expressions.forEach(n=>{let i=1;const r=n.expressionName;this.blinkExpressionNames.indexOf(r)!==-1&&(i*=t.blink),this.lookAtExpressionNames.indexOf(r)!==-1&&(i*=t.lookAt),this.mouthExpressionNames.indexOf(r)!==-1&&(i*=t.mouth),n.applyWeight({multiplier:i})})}_calculateWeightMultipliers(){let t=1,n=1,i=1;return this._expressions.forEach(r=>{t-=r.overrideBlinkAmount,n-=r.overrideLookAtAmount,i-=r.overrideMouthAmount}),t=Math.max(0,t),n=Math.max(0,n),i=Math.max(0,i),{blink:t,lookAt:n,mouth:i}}},pe={Color:"color",EmissionColor:"emissionColor",ShadeColor:"shadeColor",RimColor:"rimColor",OutlineColor:"outlineColor"},Zi={_Color:pe.Color,_EmissionColor:pe.EmissionColor,_ShadeColor:pe.ShadeColor,_RimColor:pe.RimColor,_OutlineColor:pe.OutlineColor},Ji=new N,Wn=class zn{constructor({material:t,type:n,targetValue:i,targetAlpha:r}){this.material=t,this.type=n,this.targetValue=i,this.targetAlpha=r??1;const o=this._initColorBindState(),a=this._initAlphaBindState();this._state={color:o,alpha:a}}applyWeight(t){const{color:n,alpha:i}=this._state;if(n!=null){const{propertyName:r,deltaValue:o}=n,a=this.material[r];a!=null&&a.add(Ji.copy(o).multiplyScalar(t))}if(i!=null){const{propertyName:r,deltaValue:o}=i;this.material[r]!=null&&(this.material[r]+=o*t)}}clearAppliedWeight(){const{color:t,alpha:n}=this._state;if(t!=null){const{propertyName:i,initialValue:r}=t,o=this.material[i];o!=null&&o.copy(r)}if(n!=null){const{propertyName:i,initialValue:r}=n;this.material[i]!=null&&(this.material[i]=r)}}_initColorBindState(){var t,n,i;const{material:r,type:o,targetValue:a}=this,l=this._getPropertyNameMap(),s=(n=(t=l==null?void 0:l[o])==null?void 0:t[0])!=null?n:null;if(s==null)return console.warn(`Tried to add a material color bind to the material ${(i=r.name)!=null?i:"(no name)"}, the type ${o} but the material or the type is not supported.`),null;const h=r[s].clone(),d=new N(a.r-h.r,a.g-h.g,a.b-h.b);return{propertyName:s,initialValue:h,deltaValue:d}}_initAlphaBindState(){var t,n,i;const{material:r,type:o,targetAlpha:a}=this,l=this._getPropertyNameMap(),s=(n=(t=l==null?void 0:l[o])==null?void 0:t[1])!=null?n:null;if(s==null&&a!==1)return console.warn(`Tried to add a material alpha bind to the material ${(i=r.name)!=null?i:"(no name)"}, the type ${o} but the material or the type does not support alpha.`),null;if(s==null)return null;const u=r[s],h=a-u;return{propertyName:s,initialValue:u,deltaValue:h}}_getPropertyNameMap(){var t,n;return(n=(t=Object.entries(zn._propertyNameMapMap).find(([i])=>this.material[i]===!0))==null?void 0:t[1])!=null?n:null}};Wn._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 Zt=Wn,Ce=class{constructor({primitives:e,index:t,weight:n}){this.primitives=e,this.index=t,this.weight=n}applyWeight(e){this.primitives.forEach(t=>{var n;((n=t.morphTargetInfluences)==null?void 0:n[this.index])!=null&&(t.morphTargetInfluences[this.index]+=this.weight*e)})}clearAppliedWeight(){this.primitives.forEach(e=>{var t;((t=e.morphTargetInfluences)==null?void 0:t[this.index])!=null&&(e.morphTargetInfluences[this.index]=0)})}},Jt=new ae,jn=class Xn{constructor({material:t,scale:n,offset:i}){var r,o;this.material=t,this.scale=n,this.offset=i;const a=(r=Object.entries(Xn._propertyNamesMap).find(([l])=>t[l]===!0))==null?void 0:r[1];a==null?(console.warn(`Tried to add a texture transform bind to the material ${(o=t.name)!=null?o:"(no name)"} but the material is not supported.`),this._properties=[]):(this._properties=[],a.forEach(l=>{var s;const u=(s=t[l])==null?void 0:s.clone();if(!u)return null;t[l]=u;const h=u.offset.clone(),d=u.repeat.clone(),c=i.clone().sub(h),p=n.clone().sub(d);this._properties.push({name:l,initialOffset:h,deltaOffset:c,initialScale:d,deltaScale:p})}))}applyWeight(t){this._properties.forEach(n=>{const i=this.material[n.name];i!==void 0&&(i.offset.add(Jt.copy(n.deltaOffset).multiplyScalar(t)),i.repeat.add(Jt.copy(n.deltaScale).multiplyScalar(t)))})}clearAppliedWeight(){this._properties.forEach(t=>{const n=this.material[t.name];n!==void 0&&(n.offset.copy(t.initialOffset),n.repeat.copy(t.initialScale))})}};jn._propertyNamesMap={isMeshStandardMaterial:["map","emissiveMap","bumpMap","normalMap","displacementMap","roughnessMap","metalnessMap","alphaMap"],isMeshBasicMaterial:["map","specularMap","alphaMap"],isMToonMaterial:["map","normalMap","emissiveMap","shadeMultiplyTexture","rimMultiplyTexture","outlineWidthMultiplyTexture","uvAnimationMaskTexture"]};var Kt=jn,Ki=new Set(["1.0","1.0-beta"]),qn=class Yn{get name(){return"VRMExpressionLoaderPlugin"}constructor(t){this.parser=t}afterRoot(t){return A(this,null,function*(){t.userData.vrmExpressionManager=yield this._import(t)})}_import(t){return A(this,null,function*(){const n=yield this._v1Import(t);if(n)return n;const i=yield this._v0Import(t);return i||null})}_v1Import(t){return A(this,null,function*(){var n,i;const r=this.parser.json;if(!(((n=r.extensionsUsed)==null?void 0:n.indexOf("VRMC_vrm"))!==-1))return null;const a=(i=r.extensions)==null?void 0:i.VRMC_vrm;if(!a)return null;const l=a.specVersion;if(!Ki.has(l))return console.warn(`VRMExpressionLoaderPlugin: Unknown VRMC_vrm specVersion "${l}"`),null;const s=a.expressions;if(!s)return null;const u=new Set(Object.values(tt)),h=new Map;s.preset!=null&&Object.entries(s.preset).forEach(([c,p])=>{if(p!=null){if(!u.has(c)){console.warn(`VRMExpressionLoaderPlugin: Unknown preset name "${c}" detected. Ignoring the expression`);return}h.set(c,p)}}),s.custom!=null&&Object.entries(s.custom).forEach(([c,p])=>{if(u.has(c)){console.warn(`VRMExpressionLoaderPlugin: Custom expression cannot have preset name "${c}". Ignoring the expression`);return}h.set(c,p)});const d=new $t;return yield Promise.all(Array.from(h.entries()).map(c=>A(this,[c],function*([p,m]){var f,g,v,y,E,M,x;const w=new Yt(p);if(t.scene.add(w),w.isBinary=(f=m.isBinary)!=null?f:!1,w.overrideBlink=(g=m.overrideBlink)!=null?g:"none",w.overrideLookAt=(v=m.overrideLookAt)!=null?v:"none",w.overrideMouth=(y=m.overrideMouth)!=null?y:"none",(E=m.morphTargetBinds)==null||E.forEach(R=>A(this,null,function*(){var S;if(R.node===void 0||R.index===void 0)return;const L=yield Gt(t,R.node),b=R.index;if(!L.every(P=>Array.isArray(P.morphTargetInfluences)&&b{const L=S.material;L&&(Array.isArray(L)?R.push(...L):R.push(L))}),(M=m.materialColorBinds)==null||M.forEach(S=>A(this,null,function*(){R.filter(b=>{var P;const I=(P=this.parser.associations.get(b))==null?void 0:P.materials;return S.material===I}).forEach(b=>{w.addBind(new Zt({material:b,type:S.type,targetValue:new N().fromArray(S.targetValue),targetAlpha:S.targetValue[3]}))})})),(x=m.textureTransformBinds)==null||x.forEach(S=>A(this,null,function*(){R.filter(b=>{var P;const I=(P=this.parser.associations.get(b))==null?void 0:P.materials;return S.material===I}).forEach(b=>{var P,I;w.addBind(new Kt({material:b,offset:new ae().fromArray((P=S.offset)!=null?P:[0,0]),scale:new ae().fromArray((I=S.scale)!=null?I:[1,1])}))})}))}d.registerExpression(w)}))),d})}_v0Import(t){return A(this,null,function*(){var n;const i=this.parser.json,r=(n=i.extensions)==null?void 0:n.VRM;if(!r)return null;const o=r.blendShapeMaster;if(!o)return null;const a=new $t,l=o.blendShapeGroups;if(!l)return a;const s=new Set;return yield Promise.all(l.map(u=>A(this,null,function*(){var h;const d=u.presetName,c=d!=null&&Yn.v0v1PresetNameMap[d]||null,p=c??u.name;if(p==null){console.warn("VRMExpressionLoaderPlugin: One of custom expressions has no name. Ignoring the expression");return}if(s.has(p)){console.warn(`VRMExpressionLoaderPlugin: An expression preset ${d} has duplicated entries. Ignoring the expression`);return}s.add(p);const m=new Yt(p);t.scene.add(m),m.isBinary=(h=u.isBinary)!=null?h:!1,u.binds&&u.binds.forEach(g=>A(this,null,function*(){var v;if(g.mesh===void 0||g.index===void 0)return;const y=[];(v=i.nodes)==null||v.forEach((M,x)=>{M.mesh===g.mesh&&y.push(x)});const E=g.index;yield Promise.all(y.map(M=>A(this,null,function*(){var x;const w=yield Gt(t,M);if(!w.every(R=>Array.isArray(R.morphTargetInfluences)&&E{if(g.materialName===void 0||g.propertyName===void 0||g.targetValue===void 0)return;const v=[];t.scene.traverse(E=>{if(E.material){const M=E.material;Array.isArray(M)?v.push(...M.filter(x=>(x.name===g.materialName||x.name===g.materialName+" (Outline)")&&v.indexOf(x)===-1)):M.name===g.materialName&&v.indexOf(M)===-1&&v.push(M)}});const y=g.propertyName;v.forEach(E=>{if(y==="_MainTex_ST"){const x=new ae(g.targetValue[0],g.targetValue[1]),w=new ae(g.targetValue[2],g.targetValue[3]);w.y=1-w.y-x.y,m.addBind(new Kt({material:E,scale:x,offset:w}));return}const M=Zi[y];if(M){m.addBind(new Zt({material:E,type:M,targetValue:new N().fromArray(g.targetValue),targetAlpha:g.targetValue[3]}));return}console.warn(y+" is not supported")})}),a.registerExpression(m)}))),a})}};qn.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 er=qn,ut=class oe{constructor(t,n){this._firstPersonOnlyLayer=oe.DEFAULT_FIRSTPERSON_ONLY_LAYER,this._thirdPersonOnlyLayer=oe.DEFAULT_THIRDPERSON_ONLY_LAYER,this._initializedLayers=!1,this.humanoid=t,this.meshAnnotations=n}copy(t){if(this.humanoid!==t.humanoid)throw new Error("VRMFirstPerson: humanoid must be same in order to copy");return this.meshAnnotations=t.meshAnnotations.map(n=>({meshes:n.meshes.concat(),type:n.type})),this}clone(){return new oe(this.humanoid,this.meshAnnotations).copy(this)}get firstPersonOnlyLayer(){return this._firstPersonOnlyLayer}get thirdPersonOnlyLayer(){return this._thirdPersonOnlyLayer}setup({firstPersonOnlyLayer:t=oe.DEFAULT_FIRSTPERSON_ONLY_LAYER,thirdPersonOnlyLayer:n=oe.DEFAULT_THIRDPERSON_ONLY_LAYER}={}){this._initializedLayers||(this._firstPersonOnlyLayer=t,this._thirdPersonOnlyLayer=n,this.meshAnnotations.forEach(i=>{i.meshes.forEach(r=>{i.type==="firstPersonOnly"?(r.layers.set(this._firstPersonOnlyLayer),r.traverse(o=>o.layers.set(this._firstPersonOnlyLayer))):i.type==="thirdPersonOnly"?(r.layers.set(this._thirdPersonOnlyLayer),r.traverse(o=>o.layers.set(this._thirdPersonOnlyLayer))):i.type==="auto"&&this._createHeadlessModel(r)})}),this._initializedLayers=!0)}_excludeTriangles(t,n,i,r){let o=0;if(n!=null&&n.length>0)for(let a=0;a0&&r.includes(d[0])||h[1]>0&&r.includes(d[1])||h[2]>0&&r.includes(d[2])||h[3]>0&&r.includes(d[3]))continue;const c=n[s],p=i[s];if(c[0]>0&&r.includes(p[0])||c[1]>0&&r.includes(p[1])||c[2]>0&&r.includes(p[2])||c[3]>0&&r.includes(p[3]))continue;const m=n[u],f=i[u];m[0]>0&&r.includes(f[0])||m[1]>0&&r.includes(f[1])||m[2]>0&&r.includes(f[2])||m[3]>0&&r.includes(f[3])||(t[o++]=l,t[o++]=s,t[o++]=u)}return o}_createErasedMesh(t,n){const i=new qi(t.geometry.clone(),t.material);i.name=`${t.name}(erase)`,i.frustumCulled=t.frustumCulled,i.layers.set(this._firstPersonOnlyLayer);const r=i.geometry,o=r.getAttribute("skinIndex"),a=o instanceof qt?[]:o.array,l=[];for(let f=0;f{this._isEraseTarget(o)&&i.push(a)}),!i.length){n.layers.enable(this._thirdPersonOnlyLayer),n.layers.enable(this._firstPersonOnlyLayer);return}n.layers.set(this._thirdPersonOnlyLayer);const r=this._createErasedMesh(n,i);t.add(r)}_createHeadlessModel(t){if(t.type==="Group")if(t.layers.set(this._thirdPersonOnlyLayer),this._isEraseTarget(t))t.traverse(n=>n.layers.set(this._thirdPersonOnlyLayer));else{const n=new le;n.name=`_headless_${t.name}`,n.layers.set(this._firstPersonOnlyLayer),t.parent.add(n),t.children.filter(i=>i.type==="SkinnedMesh").forEach(i=>{const r=i;this._createHeadlessModelForSkinnedMesh(n,r)})}else if(t.type==="SkinnedMesh"){const n=t;this._createHeadlessModelForSkinnedMesh(t.parent,n)}else this._isEraseTarget(t)&&(t.layers.set(this._thirdPersonOnlyLayer),t.traverse(n=>n.layers.set(this._thirdPersonOnlyLayer)))}_isEraseTarget(t){return t===this.humanoid.getRawBoneNode("head")?!0:t.parent?this._isEraseTarget(t.parent):!1}};ut.DEFAULT_FIRSTPERSON_ONLY_LAYER=9;ut.DEFAULT_THIRDPERSON_ONLY_LAYER=10;var en=ut,tr=new Set(["1.0","1.0-beta"]),nr=class{get name(){return"VRMFirstPersonLoaderPlugin"}constructor(e){this.parser=e}afterRoot(e){return A(this,null,function*(){const t=e.userData.vrmHumanoid;if(t!==null){if(t===void 0)throw new Error("VRMFirstPersonLoaderPlugin: vrmHumanoid is undefined. VRMHumanoidLoaderPlugin have to be used first");e.userData.vrmFirstPerson=yield this._import(e,t)}})}_import(e,t){return A(this,null,function*(){if(t==null)return null;const n=yield this._v1Import(e,t);if(n)return n;const i=yield this._v0Import(e,t);return i||null})}_v1Import(e,t){return A(this,null,function*(){var n,i;const r=this.parser.json;if(!(((n=r.extensionsUsed)==null?void 0:n.indexOf("VRMC_vrm"))!==-1))return null;const a=(i=r.extensions)==null?void 0:i.VRMC_vrm;if(!a)return null;const l=a.specVersion;if(!tr.has(l))return console.warn(`VRMFirstPersonLoaderPlugin: Unknown VRMC_vrm specVersion "${l}"`),null;const s=a.firstPerson,u=[],h=yield Qt(e);return Array.from(h.entries()).forEach(([d,c])=>{var p,m;const f=(p=s==null?void 0:s.meshAnnotations)==null?void 0:p.find(g=>g.node===d);u.push({meshes:c,type:(m=f==null?void 0:f.type)!=null?m:"auto"})}),new en(t,u)})}_v0Import(e,t){return A(this,null,function*(){var n;const i=this.parser.json,r=(n=i.extensions)==null?void 0:n.VRM;if(!r)return null;const o=r.firstPerson;if(!o)return null;const a=[],l=yield Qt(e);return Array.from(l.entries()).forEach(([s,u])=>{const h=i.nodes[s],d=o.meshAnnotations?o.meshAnnotations.find(c=>c.mesh===h.mesh):void 0;a.push({meshes:u,type:this._convertV0FlagToV1Type(d==null?void 0:d.firstPersonFlag)})}),new en(t,a)})}_convertV0FlagToV1Type(e){return e==="FirstPersonOnly"?"firstPersonOnly":e==="ThirdPersonOnly"?"thirdPersonOnly":e==="Both"?"both":"auto"}},tn=new _,nn=new _,ir=new T,rn=class extends le{constructor(e){super(),this.vrmHumanoid=e,this._boneAxesMap=new Map,Object.values(e.humanBones).forEach(t=>{const n=new Yi(1);n.matrixAutoUpdate=!1,n.material.depthTest=!1,n.material.depthWrite=!1,this.add(n),this._boneAxesMap.set(t,n)})}dispose(){Array.from(this._boneAxesMap.values()).forEach(e=>{e.geometry.dispose(),e.material.dispose()})}updateMatrixWorld(e){Array.from(this._boneAxesMap.entries()).forEach(([t,n])=>{t.node.updateWorldMatrix(!0,!1),t.node.matrixWorld.decompose(tn,ir,nn);const i=tn.set(.1,.1,.1).divide(nn);n.matrix.copy(t.node.matrixWorld).scale(i)}),super.updateMatrixWorld(e)}},De=["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"],rr={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 Gn(e){return e.invert?e.invert():e.inverse(),e}var $=new _,Z=new T,nt=class{constructor(e){this.humanBones=e,this.restPose=this.getAbsolutePose()}getAbsolutePose(){const e={};return Object.keys(this.humanBones).forEach(t=>{const n=t,i=this.getBoneNode(n);i&&($.copy(i.position),Z.copy(i.quaternion),e[n]={position:$.toArray(),rotation:Z.toArray()})}),e}getPose(){const e={};return Object.keys(this.humanBones).forEach(t=>{const n=t,i=this.getBoneNode(n);if(!i)return;$.set(0,0,0),Z.identity();const r=this.restPose[n];r!=null&&r.position&&$.fromArray(r.position).negate(),r!=null&&r.rotation&&Gn(Z.fromArray(r.rotation)),$.add(i.position),Z.premultiply(i.quaternion),e[n]={position:$.toArray(),rotation:Z.toArray()}}),e}setPose(e){Object.entries(e).forEach(([t,n])=>{const i=t,r=this.getBoneNode(i);if(!r)return;const o=this.restPose[i];o&&(n!=null&&n.position&&(r.position.fromArray(n.position),o.position&&r.position.add($.fromArray(o.position))),n!=null&&n.rotation&&(r.quaternion.fromArray(n.rotation),o.rotation&&r.quaternion.multiply(Z.fromArray(o.rotation))))})}resetPose(){Object.entries(this.restPose).forEach(([e,t])=>{const n=this.getBoneNode(e);n&&(t!=null&&t.position&&n.position.fromArray(t.position),t!=null&&t.rotation&&n.quaternion.fromArray(t.rotation))})}getBone(e){var t;return(t=this.humanBones[e])!=null?t:void 0}getBoneNode(e){var t,n;return(n=(t=this.humanBones[e])==null?void 0:t.node)!=null?n:null}},Be=new _,or=new T,sr=new _,on=class Qn extends nt{static _setupTransforms(t){const n=new xe;n.name="VRMHumanoidRig";const i={},r={},o={};De.forEach(l=>{var s;const u=t.getBoneNode(l);if(u){const h=new _,d=new T;u.updateWorldMatrix(!0,!1),u.matrixWorld.decompose(h,d,Be),i[l]=h,r[l]=u.quaternion.clone();const c=new T;(s=u.parent)==null||s.matrixWorld.decompose(Be,c,Be),o[l]=c}});const a={};return De.forEach(l=>{var s;const u=t.getBoneNode(l);if(u){const h=i[l];let d=l,c;for(;c==null&&(d=rr[d],d!=null);)c=i[d];const p=new xe;p.name="Normalized_"+u.name,(d?(s=a[d])==null?void 0:s.node:n).add(p),p.position.copy(h),c&&p.position.sub(c),a[l]={node:p}}}),{rigBones:a,root:n,parentWorldRotations:o,boneRotations:r}}constructor(t){const{rigBones:n,root:i,parentWorldRotations:r,boneRotations:o}=Qn._setupTransforms(t);super(n),this.original=t,this.root=i,this._parentWorldRotations=r,this._boneRotations=o}update(){De.forEach(t=>{const n=this.original.getBoneNode(t);if(n!=null){const i=this.getBoneNode(t),r=this._parentWorldRotations[t],o=or.copy(r).invert(),a=this._boneRotations[t];if(n.quaternion.copy(i.quaternion).multiply(r).premultiply(o).multiply(a),t==="hips"){const l=i.getWorldPosition(sr);n.parent.updateWorldMatrix(!0,!1);const s=n.parent.matrixWorld,u=l.applyMatrix4(s.invert());n.position.copy(u)}}})}},sn=class $n{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(t,n){var i;this.autoUpdateHumanBones=(i=n==null?void 0:n.autoUpdateHumanBones)!=null?i:!0,this._rawHumanBones=new nt(t),this._normalizedHumanBones=new on(this._rawHumanBones)}copy(t){return this.autoUpdateHumanBones=t.autoUpdateHumanBones,this._rawHumanBones=new nt(t.humanBones),this._normalizedHumanBones=new on(this._rawHumanBones),this}clone(){return new $n(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(t){return console.warn("VRMHumanoid: setPose() is deprecated. Use either setRawPose() or setNormalizedPose() instead."),this.setRawPose(t)}setRawPose(t){return this._rawHumanBones.setPose(t)}setNormalizedPose(t){return this._normalizedHumanBones.setPose(t)}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(t){return console.warn("VRMHumanoid: getBone() is deprecated. Use either getRawBone() or getNormalizedBone() instead."),this.getRawBone(t)}getRawBone(t){return this._rawHumanBones.getBone(t)}getNormalizedBone(t){return this._normalizedHumanBones.getBone(t)}getBoneNode(t){return console.warn("VRMHumanoid: getBoneNode() is deprecated. Use either getRawBoneNode() or getNormalizedBoneNode() instead."),this.getRawBoneNode(t)}getRawBoneNode(t){return this._rawHumanBones.getBoneNode(t)}getNormalizedBoneNode(t){return this._normalizedHumanBones.getBoneNode(t)}update(){this.autoUpdateHumanBones&&this._normalizedHumanBones.update()}},ar={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"},lr=new Set(["1.0","1.0-beta"]),an={leftThumbProximal:"leftThumbMetacarpal",leftThumbIntermediate:"leftThumbProximal",rightThumbProximal:"rightThumbMetacarpal",rightThumbIntermediate:"rightThumbProximal"},ur=class{get name(){return"VRMHumanoidLoaderPlugin"}constructor(e,t){this.parser=e,this.helperRoot=t==null?void 0:t.helperRoot,this.autoUpdateHumanBones=t==null?void 0:t.autoUpdateHumanBones}afterRoot(e){return A(this,null,function*(){e.userData.vrmHumanoid=yield this._import(e)})}_import(e){return A(this,null,function*(){const t=yield this._v1Import(e);if(t)return t;const n=yield this._v0Import(e);return n||null})}_v1Import(e){return A(this,null,function*(){var t,n;const i=this.parser.json;if(!(((t=i.extensionsUsed)==null?void 0:t.indexOf("VRMC_vrm"))!==-1))return null;const o=(n=i.extensions)==null?void 0:n.VRMC_vrm;if(!o)return null;const a=o.specVersion;if(!lr.has(a))return console.warn(`VRMHumanoidLoaderPlugin: Unknown VRMC_vrm specVersion "${a}"`),null;const l=o.humanoid;if(!l)return null;const s=l.humanBones.leftThumbIntermediate!=null||l.humanBones.rightThumbIntermediate!=null,u={};l.humanBones!=null&&(yield Promise.all(Object.entries(l.humanBones).map(d=>A(this,[d],function*([c,p]){let m=c;const f=p.node;if(s){const v=an[m];v!=null&&(m=v)}const g=yield this.parser.getDependency("node",f);if(g==null){console.warn(`A glTF node bound to the humanoid bone ${m} (index = ${f}) does not exist`);return}u[m]={node:g}}))));const h=new sn(this._ensureRequiredBonesExist(u),{autoUpdateHumanBones:this.autoUpdateHumanBones});if(e.scene.add(h.normalizedHumanBonesRoot),this.helperRoot){const d=new rn(h);this.helperRoot.add(d),d.renderOrder=this.helperRoot.renderOrder}return h})}_v0Import(e){return A(this,null,function*(){var t;const i=(t=this.parser.json.extensions)==null?void 0:t.VRM;if(!i)return null;const r=i.humanoid;if(!r)return null;const o={};r.humanBones!=null&&(yield Promise.all(r.humanBones.map(l=>A(this,null,function*(){const s=l.bone,u=l.node;if(s==null||u==null)return;const h=yield this.parser.getDependency("node",u);if(h==null){console.warn(`A glTF node bound to the humanoid bone ${s} (index = ${u}) does not exist`);return}const d=an[s],c=d??s;if(o[c]!=null){console.warn(`Multiple bone entries for ${c} detected (index = ${u}), ignoring duplicated entries.`);return}o[c]={node:h}}))));const a=new sn(this._ensureRequiredBonesExist(o),{autoUpdateHumanBones:this.autoUpdateHumanBones});if(e.scene.add(a.normalizedHumanBonesRoot),this.helperRoot){const l=new rn(a);this.helperRoot.add(l),l.renderOrder=this.helperRoot.renderOrder}return a})}_ensureRequiredBonesExist(e){const t=Object.values(ar).filter(n=>e[n]==null);if(t.length>0)throw new Error(`VRMHumanoidLoaderPlugin: These humanoid bones are required but not exist: ${t.join(", ")}`);return e}},ln=class extends Y{constructor(){super(),this._currentTheta=0,this._currentRadius=0,this.theta=0,this.radius=0,this._currentTheta=0,this._currentRadius=0,this._attrPos=new U(new Float32Array(65*3),3),this.setAttribute("position",this._attrPos),this._attrIndex=new U(new Uint16Array(3*63),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++){const 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}},dr=class extends Y{constructor(){super(),this.radius=0,this._currentRadius=0,this.tail=new _,this._currentTail=new _,this._attrPos=new U(new Float32Array(294),3),this.setAttribute("position",this._attrPos),this._attrIndex=new U(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++){const 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++){const 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}},Ee=new T,un=new T,me=new _,dn=new _,hn=Math.sqrt(2)/2,hr=new T(0,0,-hn,hn),cr=new _(0,1,0),pr=class extends le{constructor(e){super(),this.matrixAutoUpdate=!1,this.vrmLookAt=e;{const t=new ln;t.radius=.5;const n=new zt({color:65280,transparent:!0,opacity:.5,side:jt,depthTest:!1,depthWrite:!1});this._meshPitch=new Xt(t,n),this.add(this._meshPitch)}{const t=new ln;t.radius=.5;const n=new zt({color:16711680,transparent:!0,opacity:.5,side:jt,depthTest:!1,depthWrite:!1});this._meshYaw=new Xt(t,n),this.add(this._meshYaw)}{const t=new dr;t.radius=.1;const n=new Oe({color:16777215,depthTest:!1,depthWrite:!1});this._lineTarget=new at(t,n),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){const t=C.DEG2RAD*this.vrmLookAt.yaw;this._meshYaw.geometry.theta=t,this._meshYaw.geometry.update();const n=C.DEG2RAD*this.vrmLookAt.pitch;this._meshPitch.geometry.theta=n,this._meshPitch.geometry.update(),this.vrmLookAt.getLookAtWorldPosition(me),this.vrmLookAt.getLookAtWorldQuaternion(Ee),Ee.multiply(this.vrmLookAt.getFaceFrontQuaternion(un)),this._meshYaw.position.copy(me),this._meshYaw.quaternion.copy(Ee),this._meshPitch.position.copy(me),this._meshPitch.quaternion.copy(Ee),this._meshPitch.quaternion.multiply(un.setFromAxisAngle(cr,t)),this._meshPitch.quaternion.multiply(hr);const{target:i,autoUpdate:r}=this.vrmLookAt;i!=null&&r&&(i.getWorldPosition(dn).sub(me),this._lineTarget.geometry.tail.copy(dn),this._lineTarget.geometry.update(),this._lineTarget.position.copy(me)),super.updateMatrixWorld(e)}},mr=new _,fr=new _;function it(e,t){return e.matrixWorld.decompose(mr,t,fr),t}function Pe(e){return[Math.atan2(-e.z,e.x),Math.atan2(e.y,Math.sqrt(e.x*e.x+e.z*e.z))]}function cn(e){const t=Math.round(e/2/Math.PI);return e-2*Math.PI*t}var pn=new _(0,0,1),_r=new _,gr=new _,vr=new _,Mr=new T,ke=new T,mn=new T,xr=new T,Fe=new ee,Zn=class Jn{constructor(t,n){this.offsetFromHeadBone=new _,this.autoUpdate=!0,this.faceFront=new _(0,0,1),this.humanoid=t,this.applier=n,this._yaw=0,this._pitch=0,this._needsUpdate=!0,this._restHeadWorldQuaternion=this.getLookAtWorldQuaternion(new T)}get yaw(){return this._yaw}set yaw(t){this._yaw=t,this._needsUpdate=!0}get pitch(){return this._pitch}set pitch(t){this._pitch=t,this._needsUpdate=!0}get euler(){return console.warn("VRMLookAt: euler is deprecated. use getEuler() instead."),this.getEuler(new ee)}getEuler(t){return t.set(C.DEG2RAD*this._pitch,C.DEG2RAD*this._yaw,0,"YXZ")}copy(t){if(this.humanoid!==t.humanoid)throw new Error("VRMLookAt: humanoid must be same in order to copy");return this.offsetFromHeadBone.copy(t.offsetFromHeadBone),this.applier=t.applier,this.autoUpdate=t.autoUpdate,this.target=t.target,this.faceFront.copy(t.faceFront),this}clone(){return new Jn(this.humanoid,this.applier).copy(this)}reset(){this._yaw=0,this._pitch=0,this._needsUpdate=!0}getLookAtWorldPosition(t){const n=this.humanoid.getRawBoneNode("head");return t.copy(this.offsetFromHeadBone).applyMatrix4(n.matrixWorld)}getLookAtWorldQuaternion(t){const n=this.humanoid.getRawBoneNode("head");return it(n,t)}getFaceFrontQuaternion(t){if(this.faceFront.distanceToSquared(pn)<.01)return t.copy(this._restHeadWorldQuaternion).invert();const[n,i]=Pe(this.faceFront);return Fe.set(0,.5*Math.PI+n,i,"YZX"),t.setFromEuler(Fe).premultiply(xr.copy(this._restHeadWorldQuaternion).invert())}getLookAtWorldDirection(t){return this.getLookAtWorldQuaternion(ke),this.getFaceFrontQuaternion(mn),t.copy(pn).applyQuaternion(ke).applyQuaternion(mn).applyEuler(this.getEuler(Fe))}lookAt(t){const n=Mr.copy(this._restHeadWorldQuaternion).multiply(Gn(this.getLookAtWorldQuaternion(ke))),i=this.getLookAtWorldPosition(gr),r=vr.copy(t).sub(i).applyQuaternion(n).normalize(),[o,a]=Pe(this.faceFront),[l,s]=Pe(r),u=cn(l-o),h=cn(a-s);this._yaw=C.RAD2DEG*u,this._pitch=C.RAD2DEG*h,this._needsUpdate=!0}update(t){this.target!=null&&this.autoUpdate&&this.lookAt(this.target.getWorldPosition(_r)),this._needsUpdate&&(this._needsUpdate=!1,this.applier.applyYawPitch(this._yaw,this._pitch))}};Zn.EULER_ORDER="YXZ";var yr=Zn,wr=new _(0,0,1),F=new T,ne=new T,V=new ee(0,0,0,"YXZ"),Le=class{constructor(e,t,n,i,r){this.humanoid=e,this.rangeMapHorizontalInner=t,this.rangeMapHorizontalOuter=n,this.rangeMapVerticalDown=i,this.rangeMapVerticalUp=r,this.faceFront=new _(0,0,1),this._restQuatLeftEye=new T,this._restQuatRightEye=new T,this._restLeftEyeParentWorldQuat=new T,this._restRightEyeParentWorldQuat=new T;const o=this.humanoid.getRawBoneNode("leftEye"),a=this.humanoid.getRawBoneNode("rightEye");o&&(this._restQuatLeftEye.copy(o.quaternion),it(o.parent,this._restLeftEyeParentWorldQuat)),a&&(this._restQuatRightEye.copy(a.quaternion),it(a.parent,this._restRightEyeParentWorldQuat))}applyYawPitch(e,t){const n=this.humanoid.getRawBoneNode("leftEye"),i=this.humanoid.getRawBoneNode("rightEye"),r=this.humanoid.getNormalizedBoneNode("leftEye"),o=this.humanoid.getNormalizedBoneNode("rightEye");n&&(t<0?V.x=-C.DEG2RAD*this.rangeMapVerticalDown.map(-t):V.x=C.DEG2RAD*this.rangeMapVerticalUp.map(t),e<0?V.y=-C.DEG2RAD*this.rangeMapHorizontalInner.map(-e):V.y=C.DEG2RAD*this.rangeMapHorizontalOuter.map(e),F.setFromEuler(V),this._getWorldFaceFrontQuat(ne),r.quaternion.copy(ne).multiply(F).multiply(ne.invert()),F.copy(this._restLeftEyeParentWorldQuat),n.quaternion.copy(r.quaternion).multiply(F).premultiply(F.invert()).multiply(this._restQuatLeftEye)),i&&(t<0?V.x=-C.DEG2RAD*this.rangeMapVerticalDown.map(-t):V.x=C.DEG2RAD*this.rangeMapVerticalUp.map(t),e<0?V.y=-C.DEG2RAD*this.rangeMapHorizontalOuter.map(-e):V.y=C.DEG2RAD*this.rangeMapHorizontalInner.map(e),F.setFromEuler(V),this._getWorldFaceFrontQuat(ne),o.quaternion.copy(ne).multiply(F).multiply(ne.invert()),F.copy(this._restRightEyeParentWorldQuat),i.quaternion.copy(o.quaternion).multiply(F).premultiply(F.invert()).multiply(this._restQuatRightEye))}lookAt(e){console.warn("VRMLookAtBoneApplier: lookAt() is deprecated. use apply() instead.");const t=C.RAD2DEG*e.y,n=C.RAD2DEG*e.x;this.applyYawPitch(t,n)}_getWorldFaceFrontQuat(e){if(this.faceFront.distanceToSquared(wr)<.01)return e.identity();const[t,n]=Pe(this.faceFront);return V.set(0,.5*Math.PI+t,n,"YZX"),e.setFromEuler(V)}};Le.type="bone";var rt=class{constructor(e,t,n,i,r){this.expressions=e,this.rangeMapHorizontalInner=t,this.rangeMapHorizontalOuter=n,this.rangeMapVerticalDown=i,this.rangeMapVerticalUp=r}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.");const t=C.RAD2DEG*e.y,n=C.RAD2DEG*e.x;this.applyYawPitch(t,n)}};rt.type="expression";var fn=class{constructor(e,t){this.inputMaxValue=e,this.outputScale=t}map(e){return this.outputScale*Fn(e/this.inputMaxValue)}},Rr=new Set(["1.0","1.0-beta"]),Se=.01,Tr=class{get name(){return"VRMLookAtLoaderPlugin"}constructor(e,t){this.parser=e,this.helperRoot=t==null?void 0:t.helperRoot}afterRoot(e){return A(this,null,function*(){const t=e.userData.vrmHumanoid;if(t===null)return;if(t===void 0)throw new Error("VRMLookAtLoaderPlugin: vrmHumanoid is undefined. VRMHumanoidLoaderPlugin have to be used first");const n=e.userData.vrmExpressionManager;if(n!==null){if(n===void 0)throw new 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 A(this,null,function*(){if(t==null||n==null)return null;const i=yield this._v1Import(e,t,n);if(i)return i;const r=yield this._v0Import(e,t,n);return r||null})}_v1Import(e,t,n){return A(this,null,function*(){var i,r,o;const a=this.parser.json;if(!(((i=a.extensionsUsed)==null?void 0:i.indexOf("VRMC_vrm"))!==-1))return null;const s=(r=a.extensions)==null?void 0:r.VRMC_vrm;if(!s)return null;const u=s.specVersion;if(!Rr.has(u))return console.warn(`VRMLookAtLoaderPlugin: Unknown VRMC_vrm specVersion "${u}"`),null;const h=s.lookAt;if(!h)return null;const d=h.type==="expression"?1:10,c=this._v1ImportRangeMap(h.rangeMapHorizontalInner,d),p=this._v1ImportRangeMap(h.rangeMapHorizontalOuter,d),m=this._v1ImportRangeMap(h.rangeMapVerticalDown,d),f=this._v1ImportRangeMap(h.rangeMapVerticalUp,d);let g;h.type==="expression"?g=new rt(n,c,p,m,f):g=new Le(t,c,p,m,f);const v=this._importLookAt(t,g);return v.offsetFromHeadBone.fromArray((o=h.offsetFromHeadBone)!=null?o:[0,.06,0]),v})}_v1ImportRangeMap(e,t){var n,i;let r=(n=e==null?void 0:e.inputMaxValue)!=null?n:90;const o=(i=e==null?void 0:e.outputScale)!=null?i:t;return r(console.error(a),console.warn("VRMMetaLoaderPlugin: Failed to load a thumbnail image"),null))})}},Pr=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()}},Lr=class extends Pr{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)})}},br=Object.defineProperty,_n=Object.getOwnPropertySymbols,Ir=Object.prototype.hasOwnProperty,Cr=Object.prototype.propertyIsEnumerable,gn=(e,t,n)=>t in e?br(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,vn=(e,t)=>{for(var n in t||(t={}))Ir.call(t,n)&&gn(e,n,t[n]);if(_n)for(var n of _n(t))Cr.call(t,n)&&gn(e,n,t[n]);return e},K=(e,t,n)=>new Promise((i,r)=>{var o=s=>{try{l(n.next(s))}catch(u){r(u)}},a=s=>{try{l(n.throw(s))}catch(u){r(u)}},l=s=>s.done?i(s.value):Promise.resolve(s.value).then(o,a);l((n=n.apply(e,t)).next())}),Ur={"":3e3,srgb:3001};function Or(e,t){parseInt(Ie,10)>=152?e.colorSpace=t:e.encoding=Ur[t]}var Vr=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){t!=null&&(this._materialParams[e]=new N().fromArray(t),n&&this._materialParams[e].convertSRGBToLinear())}assignTexture(e,t,n){return K(this,null,function*(){const i=K(this,null,function*(){t!=null&&(yield this._parser.assignTexture(this._materialParams,e,t),n&&Or(this._materialParams[e],"srgb"))});return this._pendings.push(i),i})}assignTextureByIndex(e,t,n){return K(this,null,function*(){return this.assignTexture(e,t!=null?{index:t}:void 0,n)})}},Nr=`// #define PHONG + */var Te=(e,t,n)=>new Promise((i,r)=>{var o=s=>{try{l(n.next(s))}catch(u){r(u)}},a=s=>{try{l(n.throw(s))}catch(u){r(u)}},l=s=>s.done?i(s.value):Promise.resolve(s.value).then(o,a);l((n=n.apply(e,t)).next())}),A=(e,t,n)=>new Promise((i,r)=>{var o=s=>{try{l(n.next(s))}catch(u){r(u)}},a=s=>{try{l(n.throw(s))}catch(u){r(u)}},l=s=>s.done?i(s.value):Promise.resolve(s.value).then(o,a);l((n=n.apply(e,t)).next())}),Yt=class extends xe{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){const t=this._binds.indexOf(e);t>=0&&this._binds.splice(t,1)}applyWeight(e){var t;let n=this.outputWeight;n*=(t=e==null?void 0:e.multiplier)!=null?t:1,this.isBinary&&n<1&&(n=0),this._binds.forEach(i=>i.applyWeight(n))}clearAppliedWeight(){this._binds.forEach(e=>e.clearAppliedWeight())}};function kn(e,t,n){var i,r;const o=e.parser.json,a=(i=o.nodes)==null?void 0:i[t];if(a==null)return console.warn(`extractPrimitivesInternal: Attempt to use nodes[${t}] of glTF but the node doesn't exist`),null;const l=a.mesh;if(l==null)return null;const s=(r=o.meshes)==null?void 0:r[l];if(s==null)return console.warn(`extractPrimitivesInternal: Attempt to use meshes[${l}] of glTF but the mesh doesn't exist`),null;const u=s.primitives.length,h=[];return n.traverse(d=>{h.length{const o=kn(e,r,i);o!=null&&n.set(r,o)}),n})}var tt={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 Fn(e){return Math.max(Math.min(e,1),0)}var $t=class Hn{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(){const t={},n=new Set(Object.values(tt));return Object.entries(this._expressionMap).forEach(([i,r])=>{n.has(i)&&(t[i]=r)}),t}get customExpressionMap(){const t={},n=new Set(Object.values(tt));return Object.entries(this._expressionMap).forEach(([i,r])=>{n.has(i)||(t[i]=r)}),t}copy(t){return this._expressions.concat().forEach(i=>{this.unregisterExpression(i)}),t._expressions.forEach(i=>{this.registerExpression(i)}),this.blinkExpressionNames=t.blinkExpressionNames.concat(),this.lookAtExpressionNames=t.lookAtExpressionNames.concat(),this.mouthExpressionNames=t.mouthExpressionNames.concat(),this}clone(){return new Hn().copy(this)}getExpression(t){var n;return(n=this._expressionMap[t])!=null?n:null}registerExpression(t){this._expressions.push(t),this._expressionMap[t.expressionName]=t}unregisterExpression(t){const n=this._expressions.indexOf(t);n===-1&&console.warn("VRMExpressionManager: The specified expressions is not registered"),this._expressions.splice(n,1),delete this._expressionMap[t.expressionName]}getValue(t){var n;const i=this.getExpression(t);return(n=i==null?void 0:i.weight)!=null?n:null}setValue(t,n){const i=this.getExpression(t);i&&(i.weight=Fn(n))}resetValues(){this._expressions.forEach(t=>{t.weight=0})}getExpressionTrackName(t){const n=this.getExpression(t);return n?`${n.name}.weight`:null}update(){const t=this._calculateWeightMultipliers();this._expressions.forEach(n=>{n.clearAppliedWeight()}),this._expressions.forEach(n=>{let i=1;const r=n.expressionName;this.blinkExpressionNames.indexOf(r)!==-1&&(i*=t.blink),this.lookAtExpressionNames.indexOf(r)!==-1&&(i*=t.lookAt),this.mouthExpressionNames.indexOf(r)!==-1&&(i*=t.mouth),n.applyWeight({multiplier:i})})}_calculateWeightMultipliers(){let t=1,n=1,i=1;return this._expressions.forEach(r=>{t-=r.overrideBlinkAmount,n-=r.overrideLookAtAmount,i-=r.overrideMouthAmount}),t=Math.max(0,t),n=Math.max(0,n),i=Math.max(0,i),{blink:t,lookAt:n,mouth:i}}},pe={Color:"color",EmissionColor:"emissionColor",ShadeColor:"shadeColor",RimColor:"rimColor",OutlineColor:"outlineColor"},Zi={_Color:pe.Color,_EmissionColor:pe.EmissionColor,_ShadeColor:pe.ShadeColor,_RimColor:pe.RimColor,_OutlineColor:pe.OutlineColor},Ji=new N,Wn=class zn{constructor({material:t,type:n,targetValue:i,targetAlpha:r}){this.material=t,this.type=n,this.targetValue=i,this.targetAlpha=r??1;const o=this._initColorBindState(),a=this._initAlphaBindState();this._state={color:o,alpha:a}}applyWeight(t){const{color:n,alpha:i}=this._state;if(n!=null){const{propertyName:r,deltaValue:o}=n,a=this.material[r];a!=null&&a.add(Ji.copy(o).multiplyScalar(t))}if(i!=null){const{propertyName:r,deltaValue:o}=i;this.material[r]!=null&&(this.material[r]+=o*t)}}clearAppliedWeight(){const{color:t,alpha:n}=this._state;if(t!=null){const{propertyName:i,initialValue:r}=t,o=this.material[i];o!=null&&o.copy(r)}if(n!=null){const{propertyName:i,initialValue:r}=n;this.material[i]!=null&&(this.material[i]=r)}}_initColorBindState(){var t,n,i;const{material:r,type:o,targetValue:a}=this,l=this._getPropertyNameMap(),s=(n=(t=l==null?void 0:l[o])==null?void 0:t[0])!=null?n:null;if(s==null)return console.warn(`Tried to add a material color bind to the material ${(i=r.name)!=null?i:"(no name)"}, the type ${o} but the material or the type is not supported.`),null;const h=r[s].clone(),d=new N(a.r-h.r,a.g-h.g,a.b-h.b);return{propertyName:s,initialValue:h,deltaValue:d}}_initAlphaBindState(){var t,n,i;const{material:r,type:o,targetAlpha:a}=this,l=this._getPropertyNameMap(),s=(n=(t=l==null?void 0:l[o])==null?void 0:t[1])!=null?n:null;if(s==null&&a!==1)return console.warn(`Tried to add a material alpha bind to the material ${(i=r.name)!=null?i:"(no name)"}, the type ${o} but the material or the type does not support alpha.`),null;if(s==null)return null;const u=r[s],h=a-u;return{propertyName:s,initialValue:u,deltaValue:h}}_getPropertyNameMap(){var t,n;return(n=(t=Object.entries(zn._propertyNameMapMap).find(([i])=>this.material[i]===!0))==null?void 0:t[1])!=null?n:null}};Wn._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 Zt=Wn,Ce=class{constructor({primitives:e,index:t,weight:n}){this.primitives=e,this.index=t,this.weight=n}applyWeight(e){this.primitives.forEach(t=>{var n;((n=t.morphTargetInfluences)==null?void 0:n[this.index])!=null&&(t.morphTargetInfluences[this.index]+=this.weight*e)})}clearAppliedWeight(){this.primitives.forEach(e=>{var t;((t=e.morphTargetInfluences)==null?void 0:t[this.index])!=null&&(e.morphTargetInfluences[this.index]=0)})}},Jt=new ae,jn=class Xn{constructor({material:t,scale:n,offset:i}){var r,o;this.material=t,this.scale=n,this.offset=i;const a=(r=Object.entries(Xn._propertyNamesMap).find(([l])=>t[l]===!0))==null?void 0:r[1];a==null?(console.warn(`Tried to add a texture transform bind to the material ${(o=t.name)!=null?o:"(no name)"} but the material is not supported.`),this._properties=[]):(this._properties=[],a.forEach(l=>{var s;const u=(s=t[l])==null?void 0:s.clone();if(!u)return null;t[l]=u;const h=u.offset.clone(),d=u.repeat.clone(),c=i.clone().sub(h),p=n.clone().sub(d);this._properties.push({name:l,initialOffset:h,deltaOffset:c,initialScale:d,deltaScale:p})}))}applyWeight(t){this._properties.forEach(n=>{const i=this.material[n.name];i!==void 0&&(i.offset.add(Jt.copy(n.deltaOffset).multiplyScalar(t)),i.repeat.add(Jt.copy(n.deltaScale).multiplyScalar(t)))})}clearAppliedWeight(){this._properties.forEach(t=>{const n=this.material[t.name];n!==void 0&&(n.offset.copy(t.initialOffset),n.repeat.copy(t.initialScale))})}};jn._propertyNamesMap={isMeshStandardMaterial:["map","emissiveMap","bumpMap","normalMap","displacementMap","roughnessMap","metalnessMap","alphaMap"],isMeshBasicMaterial:["map","specularMap","alphaMap"],isMToonMaterial:["map","normalMap","emissiveMap","shadeMultiplyTexture","rimMultiplyTexture","outlineWidthMultiplyTexture","uvAnimationMaskTexture"]};var Kt=jn,Ki=new Set(["1.0","1.0-beta"]),qn=class Yn{get name(){return"VRMExpressionLoaderPlugin"}constructor(t){this.parser=t}afterRoot(t){return A(this,null,function*(){t.userData.vrmExpressionManager=yield this._import(t)})}_import(t){return A(this,null,function*(){const n=yield this._v1Import(t);if(n)return n;const i=yield this._v0Import(t);return i||null})}_v1Import(t){return A(this,null,function*(){var n,i;const r=this.parser.json;if(!(((n=r.extensionsUsed)==null?void 0:n.indexOf("VRMC_vrm"))!==-1))return null;const a=(i=r.extensions)==null?void 0:i.VRMC_vrm;if(!a)return null;const l=a.specVersion;if(!Ki.has(l))return console.warn(`VRMExpressionLoaderPlugin: Unknown VRMC_vrm specVersion "${l}"`),null;const s=a.expressions;if(!s)return null;const u=new Set(Object.values(tt)),h=new Map;s.preset!=null&&Object.entries(s.preset).forEach(([c,p])=>{if(p!=null){if(!u.has(c)){console.warn(`VRMExpressionLoaderPlugin: Unknown preset name "${c}" detected. Ignoring the expression`);return}h.set(c,p)}}),s.custom!=null&&Object.entries(s.custom).forEach(([c,p])=>{if(u.has(c)){console.warn(`VRMExpressionLoaderPlugin: Custom expression cannot have preset name "${c}". Ignoring the expression`);return}h.set(c,p)});const d=new $t;return yield Promise.all(Array.from(h.entries()).map(c=>A(this,[c],function*([p,m]){var f,g,v,y,E,M,x;const w=new Yt(p);if(t.scene.add(w),w.isBinary=(f=m.isBinary)!=null?f:!1,w.overrideBlink=(g=m.overrideBlink)!=null?g:"none",w.overrideLookAt=(v=m.overrideLookAt)!=null?v:"none",w.overrideMouth=(y=m.overrideMouth)!=null?y:"none",(E=m.morphTargetBinds)==null||E.forEach(R=>A(this,null,function*(){var S;if(R.node===void 0||R.index===void 0)return;const L=yield Gt(t,R.node),I=R.index;if(!L.every(P=>Array.isArray(P.morphTargetInfluences)&&I{const L=S.material;L&&(Array.isArray(L)?R.push(...L):R.push(L))}),(M=m.materialColorBinds)==null||M.forEach(S=>A(this,null,function*(){R.filter(I=>{var P;const b=(P=this.parser.associations.get(I))==null?void 0:P.materials;return S.material===b}).forEach(I=>{w.addBind(new Zt({material:I,type:S.type,targetValue:new N().fromArray(S.targetValue),targetAlpha:S.targetValue[3]}))})})),(x=m.textureTransformBinds)==null||x.forEach(S=>A(this,null,function*(){R.filter(I=>{var P;const b=(P=this.parser.associations.get(I))==null?void 0:P.materials;return S.material===b}).forEach(I=>{var P,b;w.addBind(new Kt({material:I,offset:new ae().fromArray((P=S.offset)!=null?P:[0,0]),scale:new ae().fromArray((b=S.scale)!=null?b:[1,1])}))})}))}d.registerExpression(w)}))),d})}_v0Import(t){return A(this,null,function*(){var n;const i=this.parser.json,r=(n=i.extensions)==null?void 0:n.VRM;if(!r)return null;const o=r.blendShapeMaster;if(!o)return null;const a=new $t,l=o.blendShapeGroups;if(!l)return a;const s=new Set;return yield Promise.all(l.map(u=>A(this,null,function*(){var h;const d=u.presetName,c=d!=null&&Yn.v0v1PresetNameMap[d]||null,p=c??u.name;if(p==null){console.warn("VRMExpressionLoaderPlugin: One of custom expressions has no name. Ignoring the expression");return}if(s.has(p)){console.warn(`VRMExpressionLoaderPlugin: An expression preset ${d} has duplicated entries. Ignoring the expression`);return}s.add(p);const m=new Yt(p);t.scene.add(m),m.isBinary=(h=u.isBinary)!=null?h:!1,u.binds&&u.binds.forEach(g=>A(this,null,function*(){var v;if(g.mesh===void 0||g.index===void 0)return;const y=[];(v=i.nodes)==null||v.forEach((M,x)=>{M.mesh===g.mesh&&y.push(x)});const E=g.index;yield Promise.all(y.map(M=>A(this,null,function*(){var x;const w=yield Gt(t,M);if(!w.every(R=>Array.isArray(R.morphTargetInfluences)&&E{if(g.materialName===void 0||g.propertyName===void 0||g.targetValue===void 0)return;const v=[];t.scene.traverse(E=>{if(E.material){const M=E.material;Array.isArray(M)?v.push(...M.filter(x=>(x.name===g.materialName||x.name===g.materialName+" (Outline)")&&v.indexOf(x)===-1)):M.name===g.materialName&&v.indexOf(M)===-1&&v.push(M)}});const y=g.propertyName;v.forEach(E=>{if(y==="_MainTex_ST"){const x=new ae(g.targetValue[0],g.targetValue[1]),w=new ae(g.targetValue[2],g.targetValue[3]);w.y=1-w.y-x.y,m.addBind(new Kt({material:E,scale:x,offset:w}));return}const M=Zi[y];if(M){m.addBind(new Zt({material:E,type:M,targetValue:new N().fromArray(g.targetValue),targetAlpha:g.targetValue[3]}));return}console.warn(y+" is not supported")})}),a.registerExpression(m)}))),a})}};qn.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 er=qn,ut=class oe{constructor(t,n){this._firstPersonOnlyLayer=oe.DEFAULT_FIRSTPERSON_ONLY_LAYER,this._thirdPersonOnlyLayer=oe.DEFAULT_THIRDPERSON_ONLY_LAYER,this._initializedLayers=!1,this.humanoid=t,this.meshAnnotations=n}copy(t){if(this.humanoid!==t.humanoid)throw new Error("VRMFirstPerson: humanoid must be same in order to copy");return this.meshAnnotations=t.meshAnnotations.map(n=>({meshes:n.meshes.concat(),type:n.type})),this}clone(){return new oe(this.humanoid,this.meshAnnotations).copy(this)}get firstPersonOnlyLayer(){return this._firstPersonOnlyLayer}get thirdPersonOnlyLayer(){return this._thirdPersonOnlyLayer}setup({firstPersonOnlyLayer:t=oe.DEFAULT_FIRSTPERSON_ONLY_LAYER,thirdPersonOnlyLayer:n=oe.DEFAULT_THIRDPERSON_ONLY_LAYER}={}){this._initializedLayers||(this._firstPersonOnlyLayer=t,this._thirdPersonOnlyLayer=n,this.meshAnnotations.forEach(i=>{i.meshes.forEach(r=>{i.type==="firstPersonOnly"?(r.layers.set(this._firstPersonOnlyLayer),r.traverse(o=>o.layers.set(this._firstPersonOnlyLayer))):i.type==="thirdPersonOnly"?(r.layers.set(this._thirdPersonOnlyLayer),r.traverse(o=>o.layers.set(this._thirdPersonOnlyLayer))):i.type==="auto"&&this._createHeadlessModel(r)})}),this._initializedLayers=!0)}_excludeTriangles(t,n,i,r){let o=0;if(n!=null&&n.length>0)for(let a=0;a0&&r.includes(d[0])||h[1]>0&&r.includes(d[1])||h[2]>0&&r.includes(d[2])||h[3]>0&&r.includes(d[3]))continue;const c=n[s],p=i[s];if(c[0]>0&&r.includes(p[0])||c[1]>0&&r.includes(p[1])||c[2]>0&&r.includes(p[2])||c[3]>0&&r.includes(p[3]))continue;const m=n[u],f=i[u];m[0]>0&&r.includes(f[0])||m[1]>0&&r.includes(f[1])||m[2]>0&&r.includes(f[2])||m[3]>0&&r.includes(f[3])||(t[o++]=l,t[o++]=s,t[o++]=u)}return o}_createErasedMesh(t,n){const i=new qi(t.geometry.clone(),t.material);i.name=`${t.name}(erase)`,i.frustumCulled=t.frustumCulled,i.layers.set(this._firstPersonOnlyLayer);const r=i.geometry,o=r.getAttribute("skinIndex"),a=o instanceof qt?[]:o.array,l=[];for(let f=0;f{this._isEraseTarget(o)&&i.push(a)}),!i.length){n.layers.enable(this._thirdPersonOnlyLayer),n.layers.enable(this._firstPersonOnlyLayer);return}n.layers.set(this._thirdPersonOnlyLayer);const r=this._createErasedMesh(n,i);t.add(r)}_createHeadlessModel(t){if(t.type==="Group")if(t.layers.set(this._thirdPersonOnlyLayer),this._isEraseTarget(t))t.traverse(n=>n.layers.set(this._thirdPersonOnlyLayer));else{const n=new le;n.name=`_headless_${t.name}`,n.layers.set(this._firstPersonOnlyLayer),t.parent.add(n),t.children.filter(i=>i.type==="SkinnedMesh").forEach(i=>{const r=i;this._createHeadlessModelForSkinnedMesh(n,r)})}else if(t.type==="SkinnedMesh"){const n=t;this._createHeadlessModelForSkinnedMesh(t.parent,n)}else this._isEraseTarget(t)&&(t.layers.set(this._thirdPersonOnlyLayer),t.traverse(n=>n.layers.set(this._thirdPersonOnlyLayer)))}_isEraseTarget(t){return t===this.humanoid.getRawBoneNode("head")?!0:t.parent?this._isEraseTarget(t.parent):!1}};ut.DEFAULT_FIRSTPERSON_ONLY_LAYER=9;ut.DEFAULT_THIRDPERSON_ONLY_LAYER=10;var en=ut,tr=new Set(["1.0","1.0-beta"]),nr=class{get name(){return"VRMFirstPersonLoaderPlugin"}constructor(e){this.parser=e}afterRoot(e){return A(this,null,function*(){const t=e.userData.vrmHumanoid;if(t!==null){if(t===void 0)throw new Error("VRMFirstPersonLoaderPlugin: vrmHumanoid is undefined. VRMHumanoidLoaderPlugin have to be used first");e.userData.vrmFirstPerson=yield this._import(e,t)}})}_import(e,t){return A(this,null,function*(){if(t==null)return null;const n=yield this._v1Import(e,t);if(n)return n;const i=yield this._v0Import(e,t);return i||null})}_v1Import(e,t){return A(this,null,function*(){var n,i;const r=this.parser.json;if(!(((n=r.extensionsUsed)==null?void 0:n.indexOf("VRMC_vrm"))!==-1))return null;const a=(i=r.extensions)==null?void 0:i.VRMC_vrm;if(!a)return null;const l=a.specVersion;if(!tr.has(l))return console.warn(`VRMFirstPersonLoaderPlugin: Unknown VRMC_vrm specVersion "${l}"`),null;const s=a.firstPerson,u=[],h=yield Qt(e);return Array.from(h.entries()).forEach(([d,c])=>{var p,m;const f=(p=s==null?void 0:s.meshAnnotations)==null?void 0:p.find(g=>g.node===d);u.push({meshes:c,type:(m=f==null?void 0:f.type)!=null?m:"auto"})}),new en(t,u)})}_v0Import(e,t){return A(this,null,function*(){var n;const i=this.parser.json,r=(n=i.extensions)==null?void 0:n.VRM;if(!r)return null;const o=r.firstPerson;if(!o)return null;const a=[],l=yield Qt(e);return Array.from(l.entries()).forEach(([s,u])=>{const h=i.nodes[s],d=o.meshAnnotations?o.meshAnnotations.find(c=>c.mesh===h.mesh):void 0;a.push({meshes:u,type:this._convertV0FlagToV1Type(d==null?void 0:d.firstPersonFlag)})}),new en(t,a)})}_convertV0FlagToV1Type(e){return e==="FirstPersonOnly"?"firstPersonOnly":e==="ThirdPersonOnly"?"thirdPersonOnly":e==="Both"?"both":"auto"}},tn=new _,nn=new _,ir=new T,rn=class extends le{constructor(e){super(),this.vrmHumanoid=e,this._boneAxesMap=new Map,Object.values(e.humanBones).forEach(t=>{const n=new Yi(1);n.matrixAutoUpdate=!1,n.material.depthTest=!1,n.material.depthWrite=!1,this.add(n),this._boneAxesMap.set(t,n)})}dispose(){Array.from(this._boneAxesMap.values()).forEach(e=>{e.geometry.dispose(),e.material.dispose()})}updateMatrixWorld(e){Array.from(this._boneAxesMap.entries()).forEach(([t,n])=>{t.node.updateWorldMatrix(!0,!1),t.node.matrixWorld.decompose(tn,ir,nn);const i=tn.set(.1,.1,.1).divide(nn);n.matrix.copy(t.node.matrixWorld).scale(i)}),super.updateMatrixWorld(e)}},De=["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"],rr={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 Gn(e){return e.invert?e.invert():e.inverse(),e}var $=new _,Z=new T,nt=class{constructor(e){this.humanBones=e,this.restPose=this.getAbsolutePose()}getAbsolutePose(){const e={};return Object.keys(this.humanBones).forEach(t=>{const n=t,i=this.getBoneNode(n);i&&($.copy(i.position),Z.copy(i.quaternion),e[n]={position:$.toArray(),rotation:Z.toArray()})}),e}getPose(){const e={};return Object.keys(this.humanBones).forEach(t=>{const n=t,i=this.getBoneNode(n);if(!i)return;$.set(0,0,0),Z.identity();const r=this.restPose[n];r!=null&&r.position&&$.fromArray(r.position).negate(),r!=null&&r.rotation&&Gn(Z.fromArray(r.rotation)),$.add(i.position),Z.premultiply(i.quaternion),e[n]={position:$.toArray(),rotation:Z.toArray()}}),e}setPose(e){Object.entries(e).forEach(([t,n])=>{const i=t,r=this.getBoneNode(i);if(!r)return;const o=this.restPose[i];o&&(n!=null&&n.position&&(r.position.fromArray(n.position),o.position&&r.position.add($.fromArray(o.position))),n!=null&&n.rotation&&(r.quaternion.fromArray(n.rotation),o.rotation&&r.quaternion.multiply(Z.fromArray(o.rotation))))})}resetPose(){Object.entries(this.restPose).forEach(([e,t])=>{const n=this.getBoneNode(e);n&&(t!=null&&t.position&&n.position.fromArray(t.position),t!=null&&t.rotation&&n.quaternion.fromArray(t.rotation))})}getBone(e){var t;return(t=this.humanBones[e])!=null?t:void 0}getBoneNode(e){var t,n;return(n=(t=this.humanBones[e])==null?void 0:t.node)!=null?n:null}},Be=new _,or=new T,sr=new _,on=class Qn extends nt{static _setupTransforms(t){const n=new xe;n.name="VRMHumanoidRig";const i={},r={},o={};De.forEach(l=>{var s;const u=t.getBoneNode(l);if(u){const h=new _,d=new T;u.updateWorldMatrix(!0,!1),u.matrixWorld.decompose(h,d,Be),i[l]=h,r[l]=u.quaternion.clone();const c=new T;(s=u.parent)==null||s.matrixWorld.decompose(Be,c,Be),o[l]=c}});const a={};return De.forEach(l=>{var s;const u=t.getBoneNode(l);if(u){const h=i[l];let d=l,c;for(;c==null&&(d=rr[d],d!=null);)c=i[d];const p=new xe;p.name="Normalized_"+u.name,(d?(s=a[d])==null?void 0:s.node:n).add(p),p.position.copy(h),c&&p.position.sub(c),a[l]={node:p}}}),{rigBones:a,root:n,parentWorldRotations:o,boneRotations:r}}constructor(t){const{rigBones:n,root:i,parentWorldRotations:r,boneRotations:o}=Qn._setupTransforms(t);super(n),this.original=t,this.root=i,this._parentWorldRotations=r,this._boneRotations=o}update(){De.forEach(t=>{const n=this.original.getBoneNode(t);if(n!=null){const i=this.getBoneNode(t),r=this._parentWorldRotations[t],o=or.copy(r).invert(),a=this._boneRotations[t];if(n.quaternion.copy(i.quaternion).multiply(r).premultiply(o).multiply(a),t==="hips"){const l=i.getWorldPosition(sr);n.parent.updateWorldMatrix(!0,!1);const s=n.parent.matrixWorld,u=l.applyMatrix4(s.invert());n.position.copy(u)}}})}},sn=class $n{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(t,n){var i;this.autoUpdateHumanBones=(i=n==null?void 0:n.autoUpdateHumanBones)!=null?i:!0,this._rawHumanBones=new nt(t),this._normalizedHumanBones=new on(this._rawHumanBones)}copy(t){return this.autoUpdateHumanBones=t.autoUpdateHumanBones,this._rawHumanBones=new nt(t.humanBones),this._normalizedHumanBones=new on(this._rawHumanBones),this}clone(){return new $n(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(t){return console.warn("VRMHumanoid: setPose() is deprecated. Use either setRawPose() or setNormalizedPose() instead."),this.setRawPose(t)}setRawPose(t){return this._rawHumanBones.setPose(t)}setNormalizedPose(t){return this._normalizedHumanBones.setPose(t)}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(t){return console.warn("VRMHumanoid: getBone() is deprecated. Use either getRawBone() or getNormalizedBone() instead."),this.getRawBone(t)}getRawBone(t){return this._rawHumanBones.getBone(t)}getNormalizedBone(t){return this._normalizedHumanBones.getBone(t)}getBoneNode(t){return console.warn("VRMHumanoid: getBoneNode() is deprecated. Use either getRawBoneNode() or getNormalizedBoneNode() instead."),this.getRawBoneNode(t)}getRawBoneNode(t){return this._rawHumanBones.getBoneNode(t)}getNormalizedBoneNode(t){return this._normalizedHumanBones.getBoneNode(t)}update(){this.autoUpdateHumanBones&&this._normalizedHumanBones.update()}},ar={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"},lr=new Set(["1.0","1.0-beta"]),an={leftThumbProximal:"leftThumbMetacarpal",leftThumbIntermediate:"leftThumbProximal",rightThumbProximal:"rightThumbMetacarpal",rightThumbIntermediate:"rightThumbProximal"},ur=class{get name(){return"VRMHumanoidLoaderPlugin"}constructor(e,t){this.parser=e,this.helperRoot=t==null?void 0:t.helperRoot,this.autoUpdateHumanBones=t==null?void 0:t.autoUpdateHumanBones}afterRoot(e){return A(this,null,function*(){e.userData.vrmHumanoid=yield this._import(e)})}_import(e){return A(this,null,function*(){const t=yield this._v1Import(e);if(t)return t;const n=yield this._v0Import(e);return n||null})}_v1Import(e){return A(this,null,function*(){var t,n;const i=this.parser.json;if(!(((t=i.extensionsUsed)==null?void 0:t.indexOf("VRMC_vrm"))!==-1))return null;const o=(n=i.extensions)==null?void 0:n.VRMC_vrm;if(!o)return null;const a=o.specVersion;if(!lr.has(a))return console.warn(`VRMHumanoidLoaderPlugin: Unknown VRMC_vrm specVersion "${a}"`),null;const l=o.humanoid;if(!l)return null;const s=l.humanBones.leftThumbIntermediate!=null||l.humanBones.rightThumbIntermediate!=null,u={};l.humanBones!=null&&(yield Promise.all(Object.entries(l.humanBones).map(d=>A(this,[d],function*([c,p]){let m=c;const f=p.node;if(s){const v=an[m];v!=null&&(m=v)}const g=yield this.parser.getDependency("node",f);if(g==null){console.warn(`A glTF node bound to the humanoid bone ${m} (index = ${f}) does not exist`);return}u[m]={node:g}}))));const h=new sn(this._ensureRequiredBonesExist(u),{autoUpdateHumanBones:this.autoUpdateHumanBones});if(e.scene.add(h.normalizedHumanBonesRoot),this.helperRoot){const d=new rn(h);this.helperRoot.add(d),d.renderOrder=this.helperRoot.renderOrder}return h})}_v0Import(e){return A(this,null,function*(){var t;const i=(t=this.parser.json.extensions)==null?void 0:t.VRM;if(!i)return null;const r=i.humanoid;if(!r)return null;const o={};r.humanBones!=null&&(yield Promise.all(r.humanBones.map(l=>A(this,null,function*(){const s=l.bone,u=l.node;if(s==null||u==null)return;const h=yield this.parser.getDependency("node",u);if(h==null){console.warn(`A glTF node bound to the humanoid bone ${s} (index = ${u}) does not exist`);return}const d=an[s],c=d??s;if(o[c]!=null){console.warn(`Multiple bone entries for ${c} detected (index = ${u}), ignoring duplicated entries.`);return}o[c]={node:h}}))));const a=new sn(this._ensureRequiredBonesExist(o),{autoUpdateHumanBones:this.autoUpdateHumanBones});if(e.scene.add(a.normalizedHumanBonesRoot),this.helperRoot){const l=new rn(a);this.helperRoot.add(l),l.renderOrder=this.helperRoot.renderOrder}return a})}_ensureRequiredBonesExist(e){const t=Object.values(ar).filter(n=>e[n]==null);if(t.length>0)throw new Error(`VRMHumanoidLoaderPlugin: These humanoid bones are required but not exist: ${t.join(", ")}`);return e}},ln=class extends Y{constructor(){super(),this._currentTheta=0,this._currentRadius=0,this.theta=0,this.radius=0,this._currentTheta=0,this._currentRadius=0,this._attrPos=new U(new Float32Array(65*3),3),this.setAttribute("position",this._attrPos),this._attrIndex=new U(new Uint16Array(3*63),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++){const 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}},dr=class extends Y{constructor(){super(),this.radius=0,this._currentRadius=0,this.tail=new _,this._currentTail=new _,this._attrPos=new U(new Float32Array(294),3),this.setAttribute("position",this._attrPos),this._attrIndex=new U(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++){const 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++){const 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}},Ee=new T,un=new T,me=new _,dn=new _,hn=Math.sqrt(2)/2,hr=new T(0,0,-hn,hn),cr=new _(0,1,0),pr=class extends le{constructor(e){super(),this.matrixAutoUpdate=!1,this.vrmLookAt=e;{const t=new ln;t.radius=.5;const n=new zt({color:65280,transparent:!0,opacity:.5,side:jt,depthTest:!1,depthWrite:!1});this._meshPitch=new Xt(t,n),this.add(this._meshPitch)}{const t=new ln;t.radius=.5;const n=new zt({color:16711680,transparent:!0,opacity:.5,side:jt,depthTest:!1,depthWrite:!1});this._meshYaw=new Xt(t,n),this.add(this._meshYaw)}{const t=new dr;t.radius=.1;const n=new Oe({color:16777215,depthTest:!1,depthWrite:!1});this._lineTarget=new at(t,n),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){const t=C.DEG2RAD*this.vrmLookAt.yaw;this._meshYaw.geometry.theta=t,this._meshYaw.geometry.update();const n=C.DEG2RAD*this.vrmLookAt.pitch;this._meshPitch.geometry.theta=n,this._meshPitch.geometry.update(),this.vrmLookAt.getLookAtWorldPosition(me),this.vrmLookAt.getLookAtWorldQuaternion(Ee),Ee.multiply(this.vrmLookAt.getFaceFrontQuaternion(un)),this._meshYaw.position.copy(me),this._meshYaw.quaternion.copy(Ee),this._meshPitch.position.copy(me),this._meshPitch.quaternion.copy(Ee),this._meshPitch.quaternion.multiply(un.setFromAxisAngle(cr,t)),this._meshPitch.quaternion.multiply(hr);const{target:i,autoUpdate:r}=this.vrmLookAt;i!=null&&r&&(i.getWorldPosition(dn).sub(me),this._lineTarget.geometry.tail.copy(dn),this._lineTarget.geometry.update(),this._lineTarget.position.copy(me)),super.updateMatrixWorld(e)}},mr=new _,fr=new _;function it(e,t){return e.matrixWorld.decompose(mr,t,fr),t}function Pe(e){return[Math.atan2(-e.z,e.x),Math.atan2(e.y,Math.sqrt(e.x*e.x+e.z*e.z))]}function cn(e){const t=Math.round(e/2/Math.PI);return e-2*Math.PI*t}var pn=new _(0,0,1),_r=new _,gr=new _,vr=new _,Mr=new T,ke=new T,mn=new T,xr=new T,Fe=new ee,Zn=class Jn{constructor(t,n){this.offsetFromHeadBone=new _,this.autoUpdate=!0,this.faceFront=new _(0,0,1),this.humanoid=t,this.applier=n,this._yaw=0,this._pitch=0,this._needsUpdate=!0,this._restHeadWorldQuaternion=this.getLookAtWorldQuaternion(new T)}get yaw(){return this._yaw}set yaw(t){this._yaw=t,this._needsUpdate=!0}get pitch(){return this._pitch}set pitch(t){this._pitch=t,this._needsUpdate=!0}get euler(){return console.warn("VRMLookAt: euler is deprecated. use getEuler() instead."),this.getEuler(new ee)}getEuler(t){return t.set(C.DEG2RAD*this._pitch,C.DEG2RAD*this._yaw,0,"YXZ")}copy(t){if(this.humanoid!==t.humanoid)throw new Error("VRMLookAt: humanoid must be same in order to copy");return this.offsetFromHeadBone.copy(t.offsetFromHeadBone),this.applier=t.applier,this.autoUpdate=t.autoUpdate,this.target=t.target,this.faceFront.copy(t.faceFront),this}clone(){return new Jn(this.humanoid,this.applier).copy(this)}reset(){this._yaw=0,this._pitch=0,this._needsUpdate=!0}getLookAtWorldPosition(t){const n=this.humanoid.getRawBoneNode("head");return t.copy(this.offsetFromHeadBone).applyMatrix4(n.matrixWorld)}getLookAtWorldQuaternion(t){const n=this.humanoid.getRawBoneNode("head");return it(n,t)}getFaceFrontQuaternion(t){if(this.faceFront.distanceToSquared(pn)<.01)return t.copy(this._restHeadWorldQuaternion).invert();const[n,i]=Pe(this.faceFront);return Fe.set(0,.5*Math.PI+n,i,"YZX"),t.setFromEuler(Fe).premultiply(xr.copy(this._restHeadWorldQuaternion).invert())}getLookAtWorldDirection(t){return this.getLookAtWorldQuaternion(ke),this.getFaceFrontQuaternion(mn),t.copy(pn).applyQuaternion(ke).applyQuaternion(mn).applyEuler(this.getEuler(Fe))}lookAt(t){const n=Mr.copy(this._restHeadWorldQuaternion).multiply(Gn(this.getLookAtWorldQuaternion(ke))),i=this.getLookAtWorldPosition(gr),r=vr.copy(t).sub(i).applyQuaternion(n).normalize(),[o,a]=Pe(this.faceFront),[l,s]=Pe(r),u=cn(l-o),h=cn(a-s);this._yaw=C.RAD2DEG*u,this._pitch=C.RAD2DEG*h,this._needsUpdate=!0}update(t){this.target!=null&&this.autoUpdate&&this.lookAt(this.target.getWorldPosition(_r)),this._needsUpdate&&(this._needsUpdate=!1,this.applier.applyYawPitch(this._yaw,this._pitch))}};Zn.EULER_ORDER="YXZ";var yr=Zn,wr=new _(0,0,1),F=new T,ne=new T,V=new ee(0,0,0,"YXZ"),Le=class{constructor(e,t,n,i,r){this.humanoid=e,this.rangeMapHorizontalInner=t,this.rangeMapHorizontalOuter=n,this.rangeMapVerticalDown=i,this.rangeMapVerticalUp=r,this.faceFront=new _(0,0,1),this._restQuatLeftEye=new T,this._restQuatRightEye=new T,this._restLeftEyeParentWorldQuat=new T,this._restRightEyeParentWorldQuat=new T;const o=this.humanoid.getRawBoneNode("leftEye"),a=this.humanoid.getRawBoneNode("rightEye");o&&(this._restQuatLeftEye.copy(o.quaternion),it(o.parent,this._restLeftEyeParentWorldQuat)),a&&(this._restQuatRightEye.copy(a.quaternion),it(a.parent,this._restRightEyeParentWorldQuat))}applyYawPitch(e,t){const n=this.humanoid.getRawBoneNode("leftEye"),i=this.humanoid.getRawBoneNode("rightEye"),r=this.humanoid.getNormalizedBoneNode("leftEye"),o=this.humanoid.getNormalizedBoneNode("rightEye");n&&(t<0?V.x=-C.DEG2RAD*this.rangeMapVerticalDown.map(-t):V.x=C.DEG2RAD*this.rangeMapVerticalUp.map(t),e<0?V.y=-C.DEG2RAD*this.rangeMapHorizontalInner.map(-e):V.y=C.DEG2RAD*this.rangeMapHorizontalOuter.map(e),F.setFromEuler(V),this._getWorldFaceFrontQuat(ne),r.quaternion.copy(ne).multiply(F).multiply(ne.invert()),F.copy(this._restLeftEyeParentWorldQuat),n.quaternion.copy(r.quaternion).multiply(F).premultiply(F.invert()).multiply(this._restQuatLeftEye)),i&&(t<0?V.x=-C.DEG2RAD*this.rangeMapVerticalDown.map(-t):V.x=C.DEG2RAD*this.rangeMapVerticalUp.map(t),e<0?V.y=-C.DEG2RAD*this.rangeMapHorizontalOuter.map(-e):V.y=C.DEG2RAD*this.rangeMapHorizontalInner.map(e),F.setFromEuler(V),this._getWorldFaceFrontQuat(ne),o.quaternion.copy(ne).multiply(F).multiply(ne.invert()),F.copy(this._restRightEyeParentWorldQuat),i.quaternion.copy(o.quaternion).multiply(F).premultiply(F.invert()).multiply(this._restQuatRightEye))}lookAt(e){console.warn("VRMLookAtBoneApplier: lookAt() is deprecated. use apply() instead.");const t=C.RAD2DEG*e.y,n=C.RAD2DEG*e.x;this.applyYawPitch(t,n)}_getWorldFaceFrontQuat(e){if(this.faceFront.distanceToSquared(wr)<.01)return e.identity();const[t,n]=Pe(this.faceFront);return V.set(0,.5*Math.PI+t,n,"YZX"),e.setFromEuler(V)}};Le.type="bone";var rt=class{constructor(e,t,n,i,r){this.expressions=e,this.rangeMapHorizontalInner=t,this.rangeMapHorizontalOuter=n,this.rangeMapVerticalDown=i,this.rangeMapVerticalUp=r}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.");const t=C.RAD2DEG*e.y,n=C.RAD2DEG*e.x;this.applyYawPitch(t,n)}};rt.type="expression";var fn=class{constructor(e,t){this.inputMaxValue=e,this.outputScale=t}map(e){return this.outputScale*Fn(e/this.inputMaxValue)}},Rr=new Set(["1.0","1.0-beta"]),Se=.01,Tr=class{get name(){return"VRMLookAtLoaderPlugin"}constructor(e,t){this.parser=e,this.helperRoot=t==null?void 0:t.helperRoot}afterRoot(e){return A(this,null,function*(){const t=e.userData.vrmHumanoid;if(t===null)return;if(t===void 0)throw new Error("VRMLookAtLoaderPlugin: vrmHumanoid is undefined. VRMHumanoidLoaderPlugin have to be used first");const n=e.userData.vrmExpressionManager;if(n!==null){if(n===void 0)throw new 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 A(this,null,function*(){if(t==null||n==null)return null;const i=yield this._v1Import(e,t,n);if(i)return i;const r=yield this._v0Import(e,t,n);return r||null})}_v1Import(e,t,n){return A(this,null,function*(){var i,r,o;const a=this.parser.json;if(!(((i=a.extensionsUsed)==null?void 0:i.indexOf("VRMC_vrm"))!==-1))return null;const s=(r=a.extensions)==null?void 0:r.VRMC_vrm;if(!s)return null;const u=s.specVersion;if(!Rr.has(u))return console.warn(`VRMLookAtLoaderPlugin: Unknown VRMC_vrm specVersion "${u}"`),null;const h=s.lookAt;if(!h)return null;const d=h.type==="expression"?1:10,c=this._v1ImportRangeMap(h.rangeMapHorizontalInner,d),p=this._v1ImportRangeMap(h.rangeMapHorizontalOuter,d),m=this._v1ImportRangeMap(h.rangeMapVerticalDown,d),f=this._v1ImportRangeMap(h.rangeMapVerticalUp,d);let g;h.type==="expression"?g=new rt(n,c,p,m,f):g=new Le(t,c,p,m,f);const v=this._importLookAt(t,g);return v.offsetFromHeadBone.fromArray((o=h.offsetFromHeadBone)!=null?o:[0,.06,0]),v})}_v1ImportRangeMap(e,t){var n,i;let r=(n=e==null?void 0:e.inputMaxValue)!=null?n:90;const o=(i=e==null?void 0:e.outputScale)!=null?i:t;return r(console.error(a),console.warn("VRMMetaLoaderPlugin: Failed to load a thumbnail image"),null))})}},Pr=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()}},Lr=class extends Pr{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)})}},Ir=Object.defineProperty,_n=Object.getOwnPropertySymbols,br=Object.prototype.hasOwnProperty,Cr=Object.prototype.propertyIsEnumerable,gn=(e,t,n)=>t in e?Ir(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,vn=(e,t)=>{for(var n in t||(t={}))br.call(t,n)&&gn(e,n,t[n]);if(_n)for(var n of _n(t))Cr.call(t,n)&&gn(e,n,t[n]);return e},K=(e,t,n)=>new Promise((i,r)=>{var o=s=>{try{l(n.next(s))}catch(u){r(u)}},a=s=>{try{l(n.throw(s))}catch(u){r(u)}},l=s=>s.done?i(s.value):Promise.resolve(s.value).then(o,a);l((n=n.apply(e,t)).next())}),Ur={"":3e3,srgb:3001};function Or(e,t){parseInt(be,10)>=152?e.colorSpace=t:e.encoding=Ur[t]}var Vr=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){t!=null&&(this._materialParams[e]=new N().fromArray(t),n&&this._materialParams[e].convertSRGBToLinear())}assignTexture(e,t,n){return K(this,null,function*(){const i=K(this,null,function*(){t!=null&&(yield this._parser.assignTexture(this._materialParams,e,t),n&&Or(this._materialParams[e],"srgb"))});return this._pendings.push(i),i})}assignTextureByIndex(e,t,n){return K(this,null,function*(){return this.assignTexture(e,t!=null?{index:t}:void 0,n)})}},Nr=`// #define PHONG varying vec3 vViewPosition; @@ -925,9 +925,9 @@ void main() { gl_FragColor = vec4( col, diffuseColor.a ); postCorrection(); } -`,Br={None:"none"},Mn={None:"none",ScreenCoordinates:"screenCoordinates"},kr={3e3:"",3001:"srgb"};function He(e){return parseInt(Ie,10)>=152?e.colorSpace:kr[e.encoding]}var Fr=class extends Hi{constructor(e={}){var t;super({vertexShader:Nr,fragmentShader:Dr}),this.uvAnimationScrollXSpeedFactor=0,this.uvAnimationScrollYSpeedFactor=0,this.uvAnimationRotationSpeedFactor=0,this.fog=!0,this.normalMapType=Wi,this._ignoreVertexColor=!0,this._v0CompatShade=!1,this._debugMode=Br.None,this._outlineWidthMode=Mn.None,this._isOutline=!1,e.transparentWithZWrite&&(e.depthWrite=!0),delete e.transparentWithZWrite,e.fog=!0,e.lights=!0,e.clipping=!0,this.uniforms=zi.merge([ce.common,ce.normalmap,ce.emissivemap,ce.fog,ce.lights,{litFactor:{value:new N(1,1,1)},mapUvTransform:{value:new z},colorAlpha:{value:1},normalMapUvTransform:{value:new z},shadeColorFactor:{value:new N(0,0,0)},shadeMultiplyTexture:{value:null},shadeMultiplyTextureUvTransform:{value:new z},shadingShiftFactor:{value:0},shadingShiftTexture:{value:null},shadingShiftTextureUvTransform:{value:new z},shadingShiftTextureScale:{value:1},shadingToonyFactor:{value:.9},giEqualizationFactor:{value:.9},matcapFactor:{value:new N(1,1,1)},matcapTexture:{value:null},matcapTextureUvTransform:{value:new z},parametricRimColorFactor:{value:new N(0,0,0)},rimMultiplyTexture:{value:null},rimMultiplyTextureUvTransform:{value:new z},rimLightingMixFactor:{value:1},parametricRimFresnelPowerFactor:{value:5},parametricRimLiftFactor:{value:0},emissive:{value:new N(0,0,0)},emissiveIntensity:{value:1},emissiveMapUvTransform:{value:new z},outlineWidthMultiplyTexture:{value:null},outlineWidthMultiplyTextureUvTransform:{value:new z},outlineWidthFactor:{value:0},outlineColorFactor:{value:new N(0,0,0)},outlineLightingMixFactor:{value:1},uvAnimationMaskTexture:{value:null},uvAnimationMaskTextureUvTransform:{value:new z},uvAnimationScrollXOffset:{value:0},uvAnimationScrollYOffset:{value:0},uvAnimationRotationPhase:{value:0}},(t=e.uniforms)!=null?t:{}]),this.setValues(e),this._uploadUniformsWorkaround(),this.customProgramCacheKey=()=>[...Object.entries(this._generateDefines()).map(([n,i])=>`${n}:${i}`),this.matcapTexture?`matcapTextureColorSpace:${He(this.matcapTexture)}`:"",this.shadeMultiplyTexture?`shadeMultiplyTextureColorSpace:${He(this.shadeMultiplyTexture)}`:"",this.rimMultiplyTexture?`rimMultiplyTextureColorSpace:${He(this.rimMultiplyTexture)}`:""].join(","),this.onBeforeCompile=n=>{const i=parseInt(Ie,10),r=Object.entries(vn(vn({},this._generateDefines()),this.defines)).filter(([o,a])=>!!a).map(([o,a])=>`#define ${o} ${a}`).join(` +`,Br={None:"none"},Mn={None:"none",ScreenCoordinates:"screenCoordinates"},kr={3e3:"",3001:"srgb"};function He(e){return parseInt(be,10)>=152?e.colorSpace:kr[e.encoding]}var Fr=class extends Hi{constructor(e={}){var t;super({vertexShader:Nr,fragmentShader:Dr}),this.uvAnimationScrollXSpeedFactor=0,this.uvAnimationScrollYSpeedFactor=0,this.uvAnimationRotationSpeedFactor=0,this.fog=!0,this.normalMapType=Wi,this._ignoreVertexColor=!0,this._v0CompatShade=!1,this._debugMode=Br.None,this._outlineWidthMode=Mn.None,this._isOutline=!1,e.transparentWithZWrite&&(e.depthWrite=!0),delete e.transparentWithZWrite,e.fog=!0,e.lights=!0,e.clipping=!0,this.uniforms=zi.merge([ce.common,ce.normalmap,ce.emissivemap,ce.fog,ce.lights,{litFactor:{value:new N(1,1,1)},mapUvTransform:{value:new z},colorAlpha:{value:1},normalMapUvTransform:{value:new z},shadeColorFactor:{value:new N(0,0,0)},shadeMultiplyTexture:{value:null},shadeMultiplyTextureUvTransform:{value:new z},shadingShiftFactor:{value:0},shadingShiftTexture:{value:null},shadingShiftTextureUvTransform:{value:new z},shadingShiftTextureScale:{value:1},shadingToonyFactor:{value:.9},giEqualizationFactor:{value:.9},matcapFactor:{value:new N(1,1,1)},matcapTexture:{value:null},matcapTextureUvTransform:{value:new z},parametricRimColorFactor:{value:new N(0,0,0)},rimMultiplyTexture:{value:null},rimMultiplyTextureUvTransform:{value:new z},rimLightingMixFactor:{value:1},parametricRimFresnelPowerFactor:{value:5},parametricRimLiftFactor:{value:0},emissive:{value:new N(0,0,0)},emissiveIntensity:{value:1},emissiveMapUvTransform:{value:new z},outlineWidthMultiplyTexture:{value:null},outlineWidthMultiplyTextureUvTransform:{value:new z},outlineWidthFactor:{value:0},outlineColorFactor:{value:new N(0,0,0)},outlineLightingMixFactor:{value:1},uvAnimationMaskTexture:{value:null},uvAnimationMaskTextureUvTransform:{value:new z},uvAnimationScrollXOffset:{value:0},uvAnimationScrollYOffset:{value:0},uvAnimationRotationPhase:{value:0}},(t=e.uniforms)!=null?t:{}]),this.setValues(e),this._uploadUniformsWorkaround(),this.customProgramCacheKey=()=>[...Object.entries(this._generateDefines()).map(([n,i])=>`${n}:${i}`),this.matcapTexture?`matcapTextureColorSpace:${He(this.matcapTexture)}`:"",this.shadeMultiplyTexture?`shadeMultiplyTextureColorSpace:${He(this.shadeMultiplyTexture)}`:"",this.rimMultiplyTexture?`rimMultiplyTextureColorSpace:${He(this.rimMultiplyTexture)}`:""].join(","),this.onBeforeCompile=n=>{const i=parseInt(be,10),r=Object.entries(vn(vn({},this._generateDefines()),this.defines)).filter(([o,a])=>!!a).map(([o,a])=>`#define ${o} ${a}`).join(` `)+` -`;n.vertexShader=r+n.vertexShader,n.fragmentShader=r+n.fragmentShader,i<154&&(n.fragmentShader=n.fragmentShader.replace("#include ","#include "))}}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(){const e=parseInt(Ie,10),t=this.outlineWidthMultiplyTexture!==null,n=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:e,OUTLINE:this._isOutline,MTOON_USE_UV:t||n,MTOON_UVS_VERTEX_ONLY:t&&!n,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===Mn.ScreenCoordinates}}_updateTextureMatrix(e,t){e.value&&(e.value.matrixAutoUpdate&&e.value.updateMatrix(),t.value.copy(e.value.matrix))}},Hr=new Set(["1.0","1.0-beta"]),Kn=class be{get name(){return be.EXTENSION_NAME}constructor(t,n={}){var i,r,o,a;this.parser=t,this.materialType=(i=n.materialType)!=null?i:Fr,this.renderOrderOffset=(r=n.renderOrderOffset)!=null?r:0,this.v0CompatShade=(o=n.v0CompatShade)!=null?o:!1,this.debugMode=(a=n.debugMode)!=null?a:"none",this._mToonMaterialSet=new Set}beforeRoot(){return K(this,null,function*(){this._removeUnlitExtensionIfMToonExists()})}afterRoot(t){return K(this,null,function*(){t.userData.vrmMToonMaterials=Array.from(this._mToonMaterialSet)})}getMaterialType(t){return this._getMToonExtension(t)?this.materialType:null}extendMaterialParams(t,n){const i=this._getMToonExtension(t);return i?this._extendMaterialParams(i,n):null}loadMesh(t){return K(this,null,function*(){var n;const i=this.parser,o=(n=i.json.meshes)==null?void 0:n[t];if(o==null)throw new Error(`MToonMaterialLoaderPlugin: Attempt to use meshes[${t}] of glTF but the mesh doesn't exist`);const a=o.primitives,l=yield i.loadMesh(t);if(a.length===1){const s=l,u=a[0].material;u!=null&&this._setupPrimitive(s,u)}else{const s=l;for(let u=0;u{var a;this._getMToonExtension(o)&&((a=r.extensions)!=null&&a.KHR_materials_unlit)&&delete r.extensions.KHR_materials_unlit})}_getMToonExtension(t){var n,i;const a=(n=this.parser.json.materials)==null?void 0:n[t];if(a==null){console.warn(`MToonMaterialLoaderPlugin: Attempt to use materials[${t}] of glTF but the material doesn't exist`);return}const l=(i=a.extensions)==null?void 0:i[be.EXTENSION_NAME];if(l==null)return;const s=l.specVersion;if(!Hr.has(s)){console.warn(`MToonMaterialLoaderPlugin: Unknown ${be.EXTENSION_NAME} specVersion "${s}"`);return}return l}_extendMaterialParams(t,n){return K(this,null,function*(){var i;delete n.metalness,delete n.roughness;const r=new Vr(this.parser,n);r.assignPrimitive("transparentWithZWrite",t.transparentWithZWrite),r.assignColor("shadeColorFactor",t.shadeColorFactor),r.assignTexture("shadeMultiplyTexture",t.shadeMultiplyTexture,!0),r.assignPrimitive("shadingShiftFactor",t.shadingShiftFactor),r.assignTexture("shadingShiftTexture",t.shadingShiftTexture,!0),r.assignPrimitive("shadingShiftTextureScale",(i=t.shadingShiftTexture)==null?void 0:i.scale),r.assignPrimitive("shadingToonyFactor",t.shadingToonyFactor),r.assignPrimitive("giEqualizationFactor",t.giEqualizationFactor),r.assignColor("matcapFactor",t.matcapFactor),r.assignTexture("matcapTexture",t.matcapTexture,!0),r.assignColor("parametricRimColorFactor",t.parametricRimColorFactor),r.assignTexture("rimMultiplyTexture",t.rimMultiplyTexture,!0),r.assignPrimitive("rimLightingMixFactor",t.rimLightingMixFactor),r.assignPrimitive("parametricRimFresnelPowerFactor",t.parametricRimFresnelPowerFactor),r.assignPrimitive("parametricRimLiftFactor",t.parametricRimLiftFactor),r.assignPrimitive("outlineWidthMode",t.outlineWidthMode),r.assignPrimitive("outlineWidthFactor",t.outlineWidthFactor),r.assignTexture("outlineWidthMultiplyTexture",t.outlineWidthMultiplyTexture,!1),r.assignColor("outlineColorFactor",t.outlineColorFactor),r.assignPrimitive("outlineLightingMixFactor",t.outlineLightingMixFactor),r.assignTexture("uvAnimationMaskTexture",t.uvAnimationMaskTexture,!1),r.assignPrimitive("uvAnimationScrollXSpeedFactor",t.uvAnimationScrollXSpeedFactor),r.assignPrimitive("uvAnimationScrollYSpeedFactor",t.uvAnimationScrollYSpeedFactor),r.assignPrimitive("uvAnimationRotationSpeedFactor",t.uvAnimationRotationSpeedFactor),r.assignPrimitive("v0CompatShade",this.v0CompatShade),r.assignPrimitive("debugMode",this.debugMode),yield r.pending})}_setupPrimitive(t,n){const i=this._getMToonExtension(n);if(i){const r=this._parseRenderOrder(i);t.renderOrder=r+this.renderOrderOffset,this._generateOutline(t),this._addToMaterialSet(t);return}}_shouldGenerateOutline(t){return typeof t.outlineWidthMode=="string"&&t.outlineWidthMode!=="none"&&typeof t.outlineWidthFactor=="number"&&t.outlineWidthFactor>0}_generateOutline(t){const n=t.material;if(!(n instanceof Bi)||!this._shouldGenerateOutline(n))return;t.material=[n];const i=n.clone();i.name+=" (Outline)",i.isOutline=!0,i.side=ki,t.material.push(i);const r=t.geometry,o=r.index?r.index.count:r.attributes.position.count/3;r.addGroup(0,o,0),r.addGroup(0,o,1)}_addToMaterialSet(t){const n=t.material,i=new Set;Array.isArray(n)?n.forEach(r=>i.add(r)):i.add(n);for(const r of i)this._mToonMaterialSet.add(r)}_parseRenderOrder(t){var n;return(t.transparentWithZWrite?0:19)+((n=t.renderQueueOffsetNumber)!=null?n:0)}};Kn.EXTENSION_NAME="VRMC_materials_mtoon";var Wr=Kn,zr=(e,t,n)=>new Promise((i,r)=>{var o=s=>{try{l(n.next(s))}catch(u){r(u)}},a=s=>{try{l(n.throw(s))}catch(u){r(u)}},l=s=>s.done?i(s.value):Promise.resolve(s.value).then(o,a);l((n=n.apply(e,t)).next())}),ei=class ot{get name(){return ot.EXTENSION_NAME}constructor(t){this.parser=t}extendMaterialParams(t,n){return zr(this,null,function*(){const i=this._getHDREmissiveMultiplierExtension(t);if(i==null)return;console.warn("VRMMaterialsHDREmissiveMultiplierLoaderPlugin: `VRMC_materials_hdr_emissiveMultiplier` is archived. Use `KHR_materials_emissive_strength` instead.");const r=i.emissiveMultiplier;n.emissiveIntensity=r})}_getHDREmissiveMultiplierExtension(t){var n,i;const a=(n=this.parser.json.materials)==null?void 0:n[t];if(a==null){console.warn(`VRMMaterialsHDREmissiveMultiplierLoaderPlugin: Attempt to use materials[${t}] of glTF but the material doesn't exist`);return}const l=(i=a.extensions)==null?void 0:i[ot.EXTENSION_NAME];if(l!=null)return l}};ei.EXTENSION_NAME="VRMC_materials_hdr_emissiveMultiplier";var jr=ei,Xr=Object.defineProperty,qr=Object.defineProperties,Yr=Object.getOwnPropertyDescriptors,xn=Object.getOwnPropertySymbols,Gr=Object.prototype.hasOwnProperty,Qr=Object.prototype.propertyIsEnumerable,yn=(e,t,n)=>t in e?Xr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,H=(e,t)=>{for(var n in t||(t={}))Gr.call(t,n)&&yn(e,n,t[n]);if(xn)for(var n of xn(t))Qr.call(t,n)&&yn(e,n,t[n]);return e},wn=(e,t)=>qr(e,Yr(t)),$r=(e,t,n)=>new Promise((i,r)=>{var o=s=>{try{l(n.next(s))}catch(u){r(u)}},a=s=>{try{l(n.throw(s))}catch(u){r(u)}},l=s=>s.done?i(s.value):Promise.resolve(s.value).then(o,a);l((n=n.apply(e,t)).next())});function ie(e){return Math.pow(e,2.2)}var Zr=class{get name(){return"VRMMaterialsV0CompatPlugin"}constructor(e){var t;this.parser=e,this._renderQueueMapTransparent=new Map,this._renderQueueMapTransparentZWrite=new Map;const n=this.parser.json;n.extensionsUsed=(t=n.extensionsUsed)!=null?t:[],n.extensionsUsed.indexOf("KHR_texture_transform")===-1&&n.extensionsUsed.push("KHR_texture_transform")}beforeRoot(){return $r(this,null,function*(){var e;const t=this.parser.json,n=(e=t.extensions)==null?void 0:e.VRM,i=n==null?void 0:n.materialProperties;i&&(this._populateRenderQueueMap(i),i.forEach((r,o)=>{var a,l;const s=(a=t.materials)==null?void 0:a[o];if(s==null){console.warn(`VRMMaterialsV0CompatPlugin: Attempt to use materials[${o}] of glTF but the material doesn't exist`);return}if(r.shader==="VRM/MToon"){const u=this._parseV0MToonProperties(r,s);t.materials[o]=u}else if((l=r.shader)!=null&&l.startsWith("VRM/Unlit")){const u=this._parseV0UnlitProperties(r,s);t.materials[o]=u}else r.shader==="VRM_USE_GLTFSHADER"||console.warn(`VRMMaterialsV0CompatPlugin: Unknown shader: ${r.shader}`)}))})}_parseV0MToonProperties(e,t){var n,i,r,o,a,l,s,u,h,d,c,p,m,f,g,v,y,E,M,x,w,R,S,L,b,P,I,D,B,de,q,k,te,he,O,ct,pt,mt,ft,_t,gt,vt,Mt,xt,yt,wt,Rt,Tt,Et,St,At,Pt,Lt,bt,It;const Ct=(i=(n=e.keywordMap)==null?void 0:n._ALPHABLEND_ON)!=null?i:!1,li=((r=e.floatProperties)==null?void 0:r._ZWrite)===1&&Ct,ui=this._v0ParseRenderQueue(e),Ut=(a=(o=e.keywordMap)==null?void 0:o._ALPHATEST_ON)!=null?a:!1,di=Ct?"BLEND":Ut?"MASK":"OPAQUE",hi=Ut?(s=(l=e.floatProperties)==null?void 0:l._Cutoff)!=null?s:.5:void 0,ci=((h=(u=e.floatProperties)==null?void 0:u._CullMode)!=null?h:2)===0,Q=this._portTextureTransform(e),pi=((c=(d=e.vectorProperties)==null?void 0:d._Color)!=null?c:[1,1,1,1]).map((Wt,Di)=>Di===3?Wt:ie(Wt)),Ot=(p=e.textureProperties)==null?void 0:p._MainTex,mi=Ot!=null?{index:Ot,extensions:H({},Q)}:void 0,fi=(f=(m=e.floatProperties)==null?void 0:m._BumpScale)!=null?f:1,Vt=(g=e.textureProperties)==null?void 0:g._BumpMap,_i=Vt!=null?{index:Vt,scale:fi,extensions:H({},Q)}:void 0,gi=((y=(v=e.vectorProperties)==null?void 0:v._EmissionColor)!=null?y:[0,0,0,1]).map(ie),Nt=(E=e.textureProperties)==null?void 0:E._EmissionMap,vi=Nt!=null?{index:Nt,extensions:H({},Q)}:void 0,Mi=((x=(M=e.vectorProperties)==null?void 0:M._ShadeColor)!=null?x:[.97,.81,.86,1]).map(ie),Dt=(w=e.textureProperties)==null?void 0:w._ShadeTexture,xi=Dt!=null?{index:Dt,extensions:H({},Q)}:void 0;let ye=(S=(R=e.floatProperties)==null?void 0:R._ShadeShift)!=null?S:0,we=(b=(L=e.floatProperties)==null?void 0:L._ShadeToony)!=null?b:.9;we=C.lerp(we,1,.5+.5*ye),ye=-ye-(1-we);const Bt=(I=(P=e.floatProperties)==null?void 0:P._IndirectLightIntensity)!=null?I:.1,yi=Bt?1-Bt:void 0,Ve=(D=e.textureProperties)==null?void 0:D._SphereAdd,wi=Ve!=null?[1,1,1]:void 0,Ri=Ve!=null?{index:Ve}:void 0,Ti=(de=(B=e.floatProperties)==null?void 0:B._RimLightingMix)!=null?de:0,kt=(q=e.textureProperties)==null?void 0:q._RimTexture,Ei=kt!=null?{index:kt,extensions:H({},Q)}:void 0,Si=((te=(k=e.vectorProperties)==null?void 0:k._RimColor)!=null?te:[0,0,0,1]).map(ie),Ai=(O=(he=e.floatProperties)==null?void 0:he._RimFresnelPower)!=null?O:1,Pi=(pt=(ct=e.floatProperties)==null?void 0:ct._RimLift)!=null?pt:0,Li=["none","worldCoordinates","screenCoordinates"][(ft=(mt=e.floatProperties)==null?void 0:mt._OutlineWidthMode)!=null?ft:0];let Ne=(gt=(_t=e.floatProperties)==null?void 0:_t._OutlineWidth)!=null?gt:0;Ne=.01*Ne;const Ft=(vt=e.textureProperties)==null?void 0:vt._OutlineWidthTexture,bi=Ft!=null?{index:Ft,extensions:H({},Q)}:void 0,Ii=((xt=(Mt=e.vectorProperties)==null?void 0:Mt._OutlineColor)!=null?xt:[0,0,0]).map(ie),Ci=((wt=(yt=e.floatProperties)==null?void 0:yt._OutlineColorMode)!=null?wt:0)===1?(Tt=(Rt=e.floatProperties)==null?void 0:Rt._OutlineLightingMix)!=null?Tt:1:0,Ht=(Et=e.textureProperties)==null?void 0:Et._UvAnimMaskTexture,Ui=Ht!=null?{index:Ht,extensions:H({},Q)}:void 0,Oi=(At=(St=e.floatProperties)==null?void 0:St._UvAnimScrollX)!=null?At:0;let Re=(Lt=(Pt=e.floatProperties)==null?void 0:Pt._UvAnimScrollY)!=null?Lt:0;Re!=null&&(Re=-Re);const Vi=(It=(bt=e.floatProperties)==null?void 0:bt._UvAnimRotation)!=null?It:0,Ni={specVersion:"1.0",transparentWithZWrite:li,renderQueueOffsetNumber:ui,shadeColorFactor:Mi,shadeMultiplyTexture:xi,shadingShiftFactor:ye,shadingToonyFactor:we,giEqualizationFactor:yi,matcapFactor:wi,matcapTexture:Ri,rimLightingMixFactor:Ti,rimMultiplyTexture:Ei,parametricRimColorFactor:Si,parametricRimFresnelPowerFactor:Ai,parametricRimLiftFactor:Pi,outlineWidthMode:Li,outlineWidthFactor:Ne,outlineWidthMultiplyTexture:bi,outlineColorFactor:Ii,outlineLightingMixFactor:Ci,uvAnimationMaskTexture:Ui,uvAnimationScrollXSpeedFactor:Oi,uvAnimationScrollYSpeedFactor:Re,uvAnimationRotationSpeedFactor:Vi};return wn(H({},t),{pbrMetallicRoughness:{baseColorFactor:pi,baseColorTexture:mi},normalTexture:_i,emissiveTexture:vi,emissiveFactor:gi,alphaMode:di,alphaCutoff:hi,doubleSided:ci,extensions:{VRMC_materials_mtoon:Ni}})}_parseV0UnlitProperties(e,t){var n,i,r,o,a;const l=e.shader==="VRM/UnlitTransparentZWrite",s=e.shader==="VRM/UnlitTransparent"||l,u=this._v0ParseRenderQueue(e),h=e.shader==="VRM/UnlitCutout",d=s?"BLEND":h?"MASK":"OPAQUE",c=h?(i=(n=e.floatProperties)==null?void 0:n._Cutoff)!=null?i:.5:void 0,p=this._portTextureTransform(e),m=((o=(r=e.vectorProperties)==null?void 0:r._Color)!=null?o:[1,1,1,1]).map(ie),f=(a=e.textureProperties)==null?void 0:a._MainTex,g=f!=null?{index:f,extensions:H({},p)}:void 0,v={specVersion:"1.0",transparentWithZWrite:l,renderQueueOffsetNumber:u,shadeColorFactor:m,shadeMultiplyTexture:g};return wn(H({},t),{pbrMetallicRoughness:{baseColorFactor:m,baseColorTexture:g},alphaMode:d,alphaCutoff:c,extensions:{VRMC_materials_mtoon:v}})}_portTextureTransform(e){var t,n,i,r,o;const a=(t=e.vectorProperties)==null?void 0:t._MainTex;if(a==null)return{};const l=[(n=a==null?void 0:a[0])!=null?n:0,(i=a==null?void 0:a[1])!=null?i:0],s=[(r=a==null?void 0:a[2])!=null?r:1,(o=a==null?void 0:a[3])!=null?o:1];return l[1]=1-s[1]-l[1],{KHR_texture_transform:{offset:l,scale:s}}}_v0ParseRenderQueue(e){var t,n;const i=e.shader==="VRM/UnlitTransparentZWrite",r=((t=e.keywordMap)==null?void 0:t._ALPHABLEND_ON)!=null||e.shader==="VRM/UnlitTransparent"||i,o=((n=e.floatProperties)==null?void 0:n._ZWrite)===1||i;let a=0;if(r){const l=e.renderQueue;l!=null&&(o?a=this._renderQueueMapTransparentZWrite.get(l):a=this._renderQueueMapTransparent.get(l))}return a}_populateRenderQueueMap(e){const t=new Set,n=new Set;e.forEach(i=>{var r,o;const a=i.shader==="VRM/UnlitTransparentZWrite",l=((r=i.keywordMap)==null?void 0:r._ALPHABLEND_ON)!=null||i.shader==="VRM/UnlitTransparent"||a,s=((o=i.floatProperties)==null?void 0:o._ZWrite)===1||a;if(l){const u=i.renderQueue;u!=null&&(s?n.add(u):t.add(u))}}),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((i,r)=>{const o=Math.min(Math.max(r-t.size+1,-9),0);this._renderQueueMapTransparent.set(i,o)}),Array.from(n).sort().forEach((i,r)=>{const o=Math.min(Math.max(r,0),9);this._renderQueueMapTransparentZWrite.set(i,o)})}},Rn=(e,t,n)=>new Promise((i,r)=>{var o=s=>{try{l(n.next(s))}catch(u){r(u)}},a=s=>{try{l(n.throw(s))}catch(u){r(u)}},l=s=>s.done?i(s.value):Promise.resolve(s.value).then(o,a);l((n=n.apply(e,t)).next())}),G=new _,We=class extends le{constructor(e){super(),this._attrPosition=new U(new Float32Array([0,0,0,0,0,0]),3),this._attrPosition.setUsage(ji);const t=new Y;t.setAttribute("position",this._attrPosition);const n=new Oe({color:16711935,depthTest:!1,depthWrite:!1});this._line=new Xi(t,n),this.add(this._line),this.constraint=e}updateMatrixWorld(e){G.setFromMatrixPosition(this.constraint.destination.matrixWorld),this._attrPosition.setXYZ(0,G.x,G.y,G.z),this.constraint.source&&G.setFromMatrixPosition(this.constraint.source.matrixWorld),this._attrPosition.setXYZ(1,G.x,G.y,G.z),this._attrPosition.needsUpdate=!0,super.updateMatrixWorld(e)}};function Tn(e,t){return t.set(e.elements[12],e.elements[13],e.elements[14])}var Jr=new _,Kr=new _;function eo(e,t){return e.decompose(Jr,t,Kr),t}function Ue(e){return e.invert?e.invert():e.inverse(),e}var dt=class{constructor(e,t){this.destination=e,this.source=t,this.weight=1}},to=new _,no=new _,io=new _,ro=new T,oo=new T,so=new T,ao=class extends dt{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(){const 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 _(1,0,0),this._dstRestQuat=new T}setInitState(){this._dstRestQuat.copy(this.destination.quaternion)}update(){this.destination.updateWorldMatrix(!0,!1),this.source.updateWorldMatrix(!0,!1);const e=ro.identity(),t=oo.identity();this.destination.parent&&(eo(this.destination.parent.matrixWorld,e),Ue(t.copy(e)));const n=to.copy(this._v3AimAxis).applyQuaternion(this._dstRestQuat).applyQuaternion(e),i=Tn(this.source.matrixWorld,no).sub(Tn(this.destination.matrixWorld,io)).normalize(),r=so.setFromUnitVectors(n,i).premultiply(t).multiply(e).multiply(this._dstRestQuat);this.destination.quaternion.copy(this._dstRestQuat).slerp(r,this.weight)}};function lo(e,t){const n=[e];let i=e.parent;for(;i!==null;)n.unshift(i),i=i.parent;n.forEach(r=>{t(r)})}var uo=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==null&&(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(){const e=new Set,t=new Set;for(const n of this._constraints)this._processConstraint(n,e,t,i=>i.setInitState())}update(){const e=new Set,t=new Set;for(const n of this._constraints)this._processConstraint(n,e,t,i=>i.update())}_processConstraint(e,t,n,i){if(n.has(e))return;if(t.has(e))throw new Error("VRMNodeConstraintManager: Circular dependency detected while updating constraints");t.add(e);const r=e.dependencies;for(const o of r)lo(o,a=>{const l=this._objectConstraintsMap.get(a);if(l)for(const s of l)this._processConstraint(s,t,n,i)});i(e),n.add(e)}},ho=new T,co=new T,po=class extends dt{get dependencies(){return new Set([this.source])}constructor(e,t){super(e,t),this._dstRestQuat=new T,this._invSrcRestQuat=new T}setInitState(){this._dstRestQuat.copy(this.destination.quaternion),Ue(this._invSrcRestQuat.copy(this.source.quaternion))}update(){const e=ho.copy(this._invSrcRestQuat).multiply(this.source.quaternion),t=co.copy(this._dstRestQuat).multiply(e);this.destination.quaternion.copy(this._dstRestQuat).slerp(t,this.weight)}},mo=new _,fo=new T,_o=new T,go=class extends dt{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 _(1,0,0),this._dstRestQuat=new T,this._invDstRestQuat=new T,this._invSrcRestQuatMulDstRestQuat=new T}setInitState(){this._dstRestQuat.copy(this.destination.quaternion),Ue(this._invDstRestQuat.copy(this._dstRestQuat)),Ue(this._invSrcRestQuatMulDstRestQuat.copy(this.source.quaternion)).multiply(this._dstRestQuat)}update(){const e=fo.copy(this._invDstRestQuat).multiply(this.source.quaternion).multiply(this._invSrcRestQuatMulDstRestQuat),t=mo.copy(this._v3RollAxis).applyQuaternion(e),i=_o.setFromUnitVectors(t,this._v3RollAxis).premultiply(this._dstRestQuat).multiply(e);this.destination.quaternion.copy(this._dstRestQuat).slerp(i,this.weight)}},vo=new Set(["1.0","1.0-beta"]),ti=class Me{get name(){return Me.EXTENSION_NAME}constructor(t,n){this.parser=t,this.helperRoot=n==null?void 0:n.helperRoot}afterRoot(t){return Rn(this,null,function*(){t.userData.vrmNodeConstraintManager=yield this._import(t)})}_import(t){return Rn(this,null,function*(){var n;const i=this.parser.json;if(!(((n=i.extensionsUsed)==null?void 0:n.indexOf(Me.EXTENSION_NAME))!==-1))return null;const o=new uo,a=yield this.parser.getDependencies("node");return a.forEach((l,s)=>{var u;const h=i.nodes[s],d=(u=h==null?void 0:h.extensions)==null?void 0:u[Me.EXTENSION_NAME];if(d==null)return;const c=d.specVersion;if(!vo.has(c)){console.warn(`VRMNodeConstraintLoaderPlugin: Unknown ${Me.EXTENSION_NAME} specVersion "${c}"`);return}const p=d.constraint;if(p.roll!=null){const m=this._importRollConstraint(l,a,p.roll);o.addConstraint(m)}else if(p.aim!=null){const m=this._importAimConstraint(l,a,p.aim);o.addConstraint(m)}else if(p.rotation!=null){const m=this._importRotationConstraint(l,a,p.rotation);o.addConstraint(m)}}),t.scene.updateMatrixWorld(),o.setInitState(),o})}_importRollConstraint(t,n,i){const{source:r,rollAxis:o,weight:a}=i,l=n[r],s=new go(t,l);if(o!=null&&(s.rollAxis=o),a!=null&&(s.weight=a),this.helperRoot){const u=new We(s);this.helperRoot.add(u)}return s}_importAimConstraint(t,n,i){const{source:r,aimAxis:o,weight:a}=i,l=n[r],s=new ao(t,l);if(o!=null&&(s.aimAxis=o),a!=null&&(s.weight=a),this.helperRoot){const u=new We(s);this.helperRoot.add(u)}return s}_importRotationConstraint(t,n,i){const{source:r,weight:o}=i,a=n[r],l=new po(t,a);if(o!=null&&(l.weight=o),this.helperRoot){const s=new We(l);this.helperRoot.add(s)}return l}};ti.EXTENSION_NAME="VRMC_node_constraint";var Mo=ti,Ae=(e,t,n)=>new Promise((i,r)=>{var o=s=>{try{l(n.next(s))}catch(u){r(u)}},a=s=>{try{l(n.throw(s))}catch(u){r(u)}},l=s=>s.done?i(s.value):Promise.resolve(s.value).then(o,a);l((n=n.apply(e,t)).next())}),ht=class{},ze=new _,J=new _,ni=class extends ht{get type(){return"capsule"}constructor(e){var t,n,i,r;super(),this.offset=(t=e==null?void 0:e.offset)!=null?t:new _(0,0,0),this.tail=(n=e==null?void 0:e.tail)!=null?n:new _(0,0,0),this.radius=(i=e==null?void 0:e.radius)!=null?i:0,this.inside=(r=e==null?void 0:e.inside)!=null?r:!1}calculateCollision(e,t,n,i){ze.setFromMatrixPosition(e),J.subVectors(this.tail,this.offset).applyMatrix4(e),J.sub(ze);const r=J.lengthSq();i.copy(t).sub(ze);const o=J.dot(i);o<=0||(r<=o||J.multiplyScalar(o/r),i.sub(J));const a=i.length(),l=this.inside?this.radius-n-a:a-n-this.radius;return l<0&&(i.multiplyScalar(1/a),this.inside&&i.negate()),l}},je=new _,En=new z,ii=class extends ht{get type(){return"plane"}constructor(e){var t,n;super(),this.offset=(t=e==null?void 0:e.offset)!=null?t:new _(0,0,0),this.normal=(n=e==null?void 0:e.normal)!=null?n:new _(0,0,1)}calculateCollision(e,t,n,i){i.setFromMatrixPosition(e),i.negate().add(t),En.getNormalMatrix(e),je.copy(this.normal).applyNormalMatrix(En).normalize();const r=i.dot(je)-n;return i.copy(je),r}},xo=new _,ri=class extends ht{get type(){return"sphere"}constructor(e){var t,n,i;super(),this.offset=(t=e==null?void 0:e.offset)!=null?t:new _(0,0,0),this.radius=(n=e==null?void 0:e.radius)!=null?n:0,this.inside=(i=e==null?void 0:e.inside)!=null?i:!1}calculateCollision(e,t,n,i){i.subVectors(t,xo.setFromMatrixPosition(e));const r=i.length(),o=this.inside?this.radius-n-r:r-n-this.radius;return o<0&&(i.multiplyScalar(1/r),this.inside&&i.negate()),o}},W=new _,yo=class extends Y{constructor(e){super(),this.worldScale=1,this._currentRadius=0,this._currentOffset=new _,this._currentTail=new _,this._shape=e,this._attrPos=new U(new Float32Array(396),3),this.setAttribute("position",this._attrPos),this._attrIndex=new U(new Uint16Array(264),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let e=!1;const 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);const n=W.copy(this._shape.tail).divideScalar(this.worldScale);this._currentTail.distanceToSquared(n)>1e-10&&(this._currentTail.copy(n),e=!0),e&&this._buildPosition()}_buildPosition(){W.copy(this._currentTail).sub(this._currentOffset);const e=W.length()/this._currentRadius;for(let i=0;i<=16;i++){const r=i/16*Math.PI;this._attrPos.setXYZ(i,-Math.sin(r),-Math.cos(r),0),this._attrPos.setXYZ(17+i,e+Math.sin(r),Math.cos(r),0),this._attrPos.setXYZ(34+i,-Math.sin(r),0,-Math.cos(r)),this._attrPos.setXYZ(51+i,e+Math.sin(r),0,Math.cos(r))}for(let i=0;i<32;i++){const r=i/16*Math.PI;this._attrPos.setXYZ(68+i,0,Math.sin(r),Math.cos(r)),this._attrPos.setXYZ(100+i,e,Math.sin(r),Math.cos(r))}const t=Math.atan2(W.y,Math.sqrt(W.x*W.x+W.z*W.z)),n=-Math.atan2(W.z,W.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++){const 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++){const 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}},wo=class extends Y{constructor(e){super(),this.worldScale=1,this._currentOffset=new _,this._currentNormal=new _,this._shape=e,this._attrPos=new U(new Float32Array(6*3),3),this.setAttribute("position",this._attrPos),this._attrIndex=new U(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}},Ro=class extends Y{constructor(e){super(),this.worldScale=1,this._currentRadius=0,this._currentOffset=new _,this._shape=e,this._attrPos=new U(new Float32Array(32*3*3),3),this.setAttribute("position",this._attrPos),this._attrIndex=new U(new Uint16Array(64*3),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let e=!1;const 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++){const 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++){const 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}},To=new _,Xe=class extends le{constructor(e){if(super(),this.matrixAutoUpdate=!1,this.collider=e,this.collider.shape instanceof ri)this._geometry=new Ro(this.collider.shape);else if(this.collider.shape instanceof ni)this._geometry=new yo(this.collider.shape);else if(this.collider.shape instanceof ii)this._geometry=new wo(this.collider.shape);else throw new Error("VRMSpringBoneColliderHelper: Unknown collider shape type detected");const t=new Oe({color:16711935,depthTest:!1,depthWrite:!1});this._line=new at(this._geometry,t),this.add(this._line)}dispose(){this._geometry.dispose()}updateMatrixWorld(e){this.collider.updateWorldMatrix(!0,!1),this.matrix.copy(this.collider.matrixWorld);const t=this.matrix.elements;this._geometry.worldScale=To.set(t[0],t[1],t[2]).length(),this._geometry.update(),super.updateMatrixWorld(e)}},Eo=class extends Y{constructor(e){super(),this.worldScale=1,this._currentRadius=0,this._currentTail=new _,this._springBone=e,this._attrPos=new U(new Float32Array(294),3),this.setAttribute("position",this._attrPos),this._attrIndex=new U(new Uint16Array(194),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let e=!1;const 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++){const 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++){const 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}},So=new _,Ao=class extends le{constructor(e){super(),this.matrixAutoUpdate=!1,this.springBone=e,this._geometry=new Eo(this.springBone);const t=new Oe({color:16776960,depthTest:!1,depthWrite:!1});this._line=new at(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);const t=this.matrix.elements;this._geometry.worldScale=So.set(t[0],t[1],t[2]).length(),this._geometry.update(),super.updateMatrixWorld(e)}},qe=class extends xe{constructor(e){super(),this.colliderMatrix=new X,this.shape=e}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),Po(this.colliderMatrix,this.matrixWorld,this.shape.offset)}};function Po(e,t,n){const i=t.elements;e.copy(t),n&&(e.elements[12]=i[0]*n.x+i[4]*n.y+i[8]*n.z+i[12],e.elements[13]=i[1]*n.x+i[5]*n.y+i[9]*n.z+i[13],e.elements[14]=i[2]*n.x+i[6]*n.y+i[10]*n.z+i[14])}var Lo=new X;function bo(e){return e.invert?e.invert():e.getInverse(Lo.copy(e)),e}var Io=class{constructor(e){this._inverseCache=new X,this._shouldUpdateInverse=!0,this.matrix=e;const t={set:(n,i,r)=>(this._shouldUpdateInverse=!0,n[i]=r,!0)};this._originalElements=e.elements,e.elements=new Proxy(e.elements,t)}get inverse(){return this._shouldUpdateInverse&&(bo(this._inverseCache.copy(this.matrix)),this._shouldUpdateInverse=!1),this._inverseCache}revert(){this.matrix.elements=this._originalElements}},Ye=new X,re=new _,fe=new _,_e=new _,ge=new _,Co=new X,Uo=class{constructor(e,t,n={},i=[]){this._currentTail=new _,this._prevTail=new _,this._boneAxis=new _,this._worldSpaceBoneLength=0,this._center=null,this._initialLocalMatrix=new X,this._initialLocalRotation=new T,this._initialLocalChildPosition=new _;var r,o,a,l,s,u;this.bone=e,this.bone.matrixAutoUpdate=!1,this.child=t,this.settings={hitRadius:(r=n.hitRadius)!=null?r:0,stiffness:(o=n.stiffness)!=null?o:1,gravityPower:(a=n.gravityPower)!=null?a:0,gravityDir:(s=(l=n.gravityDir)==null?void 0:l.clone())!=null?s:new _(0,-1,0),dragForce:(u=n.dragForce)!=null?u:.4},this.colliderGroups=i}get dependencies(){const e=new Set,t=this.bone.parent;t&&e.add(t);for(let n=0;n{t(r)})}function st(e,t){e.children.forEach(n=>{t(n)||st(n,t)})}function Vo(e){var t;const n=new Map;for(const i of e){let r=i;do{const o=((t=n.get(r))!=null?t:0)+1;if(o===e.size)return r;n.set(r,o),r=r.parent}while(r!==null)}return null}var Sn=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(){const e=new Set;return this._joints.forEach(t=>{t.colliderGroups.forEach(n=>{e.add(n)})}),Array.from(e)}get colliders(){const e=new Set;return this.colliderGroups.forEach(t=>{t.colliders.forEach(n=>{e.add(n)})}),Array.from(e)}addJoint(e){this._joints.add(e);let t=this._objectSpringBonesMap.get(e.bone);t==null&&(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{var a,l;return((l=(a=this._objectSpringBonesMap.get(o))==null?void 0:a.size)!=null?l:0)>0?!0:(this._ancestors.push(o),!1)})),this._isSortedJointsDirty=!1}_insertJointSort(e,t,n,i,r){if(n.has(e))return;if(t.has(e)){this._hasWarnedCircularDependency||(console.warn("VRMSpringBoneManager: Circular dependency detected"),this._hasWarnedCircularDependency=!0);return}t.add(e);const o=e.dependencies;for(const a of o){let l=!1,s=null;Oo(a,u=>{const h=this._objectSpringBonesMap.get(u);if(h)for(const d of h)l=!0,this._insertJointSort(d,t,n,i,r);else l||(s=u)}),s&&r.add(s)}i.push(e),n.add(e)}_relevantChildrenUpdated(e){var t,n;return((n=(t=this._objectSpringBonesMap.get(e))==null?void 0:t.size)!=null?n:0)>0?!0:(e.updateWorldMatrix(!1,!1),!1)}},An="VRMC_springBone_extended_collider",No=new Set(["1.0","1.0-beta"]),Do=new Set(["1.0"]),oi=class se{get name(){return se.EXTENSION_NAME}constructor(t,n){var i;this.parser=t,this.jointHelperRoot=n==null?void 0:n.jointHelperRoot,this.colliderHelperRoot=n==null?void 0:n.colliderHelperRoot,this.useExtendedColliders=(i=n==null?void 0:n.useExtendedColliders)!=null?i:!0}afterRoot(t){return Ae(this,null,function*(){t.userData.vrmSpringBoneManager=yield this._import(t)})}_import(t){return Ae(this,null,function*(){const n=yield this._v1Import(t);if(n!=null)return n;const i=yield this._v0Import(t);return i??null})}_v1Import(t){return Ae(this,null,function*(){var n,i,r,o,a;const l=t.parser.json;if(!(((n=l.extensionsUsed)==null?void 0:n.indexOf(se.EXTENSION_NAME))!==-1))return null;const u=new Sn,h=yield t.parser.getDependencies("node"),d=(i=l.extensions)==null?void 0:i[se.EXTENSION_NAME];if(!d)return null;const c=d.specVersion;if(!No.has(c))return console.warn(`VRMSpringBoneLoaderPlugin: Unknown ${se.EXTENSION_NAME} specVersion "${c}"`),null;const p=(r=d.colliders)==null?void 0:r.map((f,g)=>{var v,y,E,M,x,w,R,S,L,b,P,I,D,B,de;const q=h[f.node];if(q==null)return console.warn(`VRMSpringBoneLoaderPlugin: The collider #${g} attempted to use the node #${f.node} but not found`),null;const k=f.shape,te=(v=f.extensions)==null?void 0:v[An];if(this.useExtendedColliders&&te!=null){const he=te.specVersion;if(!Do.has(he))console.warn(`VRMSpringBoneLoaderPlugin: Unknown ${An} specVersion "${he}". Fallbacking to the ${se.EXTENSION_NAME} definition`);else{const O=te.shape;if(O.sphere)return this._importSphereCollider(q,{offset:new _().fromArray((y=O.sphere.offset)!=null?y:[0,0,0]),radius:(E=O.sphere.radius)!=null?E:0,inside:(M=O.sphere.inside)!=null?M:!1});if(O.capsule)return this._importCapsuleCollider(q,{offset:new _().fromArray((x=O.capsule.offset)!=null?x:[0,0,0]),radius:(w=O.capsule.radius)!=null?w:0,tail:new _().fromArray((R=O.capsule.tail)!=null?R:[0,0,0]),inside:(S=O.capsule.inside)!=null?S:!1});if(O.plane)return this._importPlaneCollider(q,{offset:new _().fromArray((L=O.plane.offset)!=null?L:[0,0,0]),normal:new _().fromArray((b=O.plane.normal)!=null?b:[0,0,1])})}}if(k.sphere)return this._importSphereCollider(q,{offset:new _().fromArray((P=k.sphere.offset)!=null?P:[0,0,0]),radius:(I=k.sphere.radius)!=null?I:0,inside:!1});if(k.capsule)return this._importCapsuleCollider(q,{offset:new _().fromArray((D=k.capsule.offset)!=null?D:[0,0,0]),radius:(B=k.capsule.radius)!=null?B:0,tail:new _().fromArray((de=k.capsule.tail)!=null?de:[0,0,0]),inside:!1});throw new Error(`VRMSpringBoneLoaderPlugin: The collider #${g} has no valid shape`)}),m=(o=d.colliderGroups)==null?void 0:o.map((f,g)=>{var v;return{colliders:((v=f.colliders)!=null?v:[]).flatMap(E=>{const M=p==null?void 0:p[E];return M??(console.warn(`VRMSpringBoneLoaderPlugin: The colliderGroup #${g} attempted to use a collider #${E} but not found`),[])}),name:f.name}});return(a=d.springs)==null||a.forEach((f,g)=>{var v;const y=f.joints,E=(v=f.colliderGroups)==null?void 0:v.map(w=>{const R=m==null?void 0:m[w];if(R==null)throw new Error(`VRMSpringBoneLoaderPlugin: The spring #${g} attempted to use a colliderGroup ${w} but not found`);return R}),M=f.center!=null?h[f.center]:void 0;let x;y.forEach(w=>{if(x){const R=x.node,S=h[R],L=w.node,b=h[L],P={hitRadius:x.hitRadius,dragForce:x.dragForce,gravityPower:x.gravityPower,stiffness:x.stiffness,gravityDir:x.gravityDir!=null?new _().fromArray(x.gravityDir):void 0},I=this._importJoint(S,b,P,E);M&&(I.center=M),u.addJoint(I)}x=w})}),u.setInitState(),u})}_v0Import(t){return Ae(this,null,function*(){var n,i,r;const o=t.parser.json;if(!(((n=o.extensionsUsed)==null?void 0:n.indexOf("VRM"))!==-1))return null;const l=(i=o.extensions)==null?void 0:i.VRM,s=l==null?void 0:l.secondaryAnimation;if(!s)return null;const u=s==null?void 0:s.boneGroups;if(!u)return null;const h=new Sn,d=yield t.parser.getDependencies("node"),c=(r=s.colliderGroups)==null?void 0:r.map(p=>{var m;const f=d[p.node];return{colliders:((m=p.colliders)!=null?m:[]).map((v,y)=>{var E,M,x;const w=new _(0,0,0);return v.offset&&w.set((E=v.offset.x)!=null?E:0,(M=v.offset.y)!=null?M:0,v.offset.z?-v.offset.z:0),this._importSphereCollider(f,{offset:w,radius:(x=v.radius)!=null?x:0,inside:!1})})}});return u==null||u.forEach((p,m)=>{const f=p.bones;f&&f.forEach(g=>{var v,y,E,M;const x=d[g],w=new _;p.gravityDir?w.set((v=p.gravityDir.x)!=null?v:0,(y=p.gravityDir.y)!=null?y:0,(E=p.gravityDir.z)!=null?E:0):w.set(0,-1,0);const R=p.center!=null?d[p.center]:void 0,S={hitRadius:p.hitRadius,dragForce:p.dragForce,gravityPower:p.gravityPower,stiffness:p.stiffiness,gravityDir:w},L=(M=p.colliderGroups)==null?void 0:M.map(b=>{const P=c==null?void 0:c[b];if(P==null)throw new Error(`VRMSpringBoneLoaderPlugin: The spring #${m} attempted to use a colliderGroup ${b} but not found`);return P});x.traverse(b=>{var P;const I=(P=b.children[0])!=null?P:null,D=this._importJoint(b,I,S,L);R&&(D.center=R),h.addJoint(D)})})}),t.scene.updateMatrixWorld(),h.setInitState(),h})}_importJoint(t,n,i,r){const o=new Uo(t,n,i,r);if(this.jointHelperRoot){const a=new Ao(o);this.jointHelperRoot.add(a),a.renderOrder=this.jointHelperRoot.renderOrder}return o}_importSphereCollider(t,n){const i=new ri(n),r=new qe(i);if(t.add(r),this.colliderHelperRoot){const o=new Xe(r);this.colliderHelperRoot.add(o),o.renderOrder=this.colliderHelperRoot.renderOrder}return r}_importCapsuleCollider(t,n){const i=new ni(n),r=new qe(i);if(t.add(r),this.colliderHelperRoot){const o=new Xe(r);this.colliderHelperRoot.add(o),o.renderOrder=this.colliderHelperRoot.renderOrder}return r}_importPlaneCollider(t,n){const i=new ii(n),r=new qe(i);if(t.add(r),this.colliderHelperRoot){const o=new Xe(r);this.colliderHelperRoot.add(o),o.renderOrder=this.colliderHelperRoot.renderOrder}return r}};oi.EXTENSION_NAME="VRMC_springBone";var Bo=oi,Ts=class{get name(){return"VRMLoaderPlugin"}constructor(e,t){var n,i,r,o,a,l,s,u,h,d;this.parser=e;const c=t==null?void 0:t.helperRoot,p=t==null?void 0:t.autoUpdateHumanBones;this.expressionPlugin=(n=t==null?void 0:t.expressionPlugin)!=null?n:new er(e),this.firstPersonPlugin=(i=t==null?void 0:t.firstPersonPlugin)!=null?i:new nr(e),this.humanoidPlugin=(r=t==null?void 0:t.humanoidPlugin)!=null?r:new ur(e,{helperRoot:c,autoUpdateHumanBones:p}),this.lookAtPlugin=(o=t==null?void 0:t.lookAtPlugin)!=null?o:new Tr(e,{helperRoot:c}),this.metaPlugin=(a=t==null?void 0:t.metaPlugin)!=null?a:new Ar(e),this.mtoonMaterialPlugin=(l=t==null?void 0:t.mtoonMaterialPlugin)!=null?l:new Wr(e),this.materialsHDREmissiveMultiplierPlugin=(s=t==null?void 0:t.materialsHDREmissiveMultiplierPlugin)!=null?s:new jr(e),this.materialsV0CompatPlugin=(u=t==null?void 0:t.materialsV0CompatPlugin)!=null?u:new Zr(e),this.springBonePlugin=(h=t==null?void 0:t.springBonePlugin)!=null?h:new Bo(e,{colliderHelperRoot:c,jointHelperRoot:c}),this.nodeConstraintPlugin=(d=t==null?void 0:t.nodeConstraintPlugin)!=null?d:new Mo(e,{helperRoot:c})}beforeRoot(){return Te(this,null,function*(){yield this.materialsV0CompatPlugin.beforeRoot(),yield this.mtoonMaterialPlugin.beforeRoot()})}loadMesh(e){return Te(this,null,function*(){return yield this.mtoonMaterialPlugin.loadMesh(e)})}getMaterialType(e){const t=this.mtoonMaterialPlugin.getMaterialType(e);return t??null}extendMaterialParams(e,t){return Te(this,null,function*(){yield this.materialsHDREmissiveMultiplierPlugin.extendMaterialParams(e,t),yield this.mtoonMaterialPlugin.extendMaterialParams(e,t)})}afterRoot(e){return Te(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);const t=e.userData.vrmMeta,n=e.userData.vrmHumanoid;if(t&&n){const i=new Lr({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=i}})}};function ko(e){const t=new Set;return e.traverse(n=>{if(!n.isMesh)return;const i=n;t.add(i)}),t}function Pn(e,t,n){if(t.size===1){const a=t.values().next().value;if(a.weight===1)return e[a.index]}const i=new Float32Array(e[0].count*3);let r=0;if(n)r=1;else for(const a of t)r+=a.weight;for(const a of t){const l=e[a.index],s=a.weight/r;for(let u=0;uh.getOrCreate(L)).join(","),R=`${M};${v};${w}`;let S=l.get(R);S==null&&(S=E.clone(),qo(S,x,m),l.set(R,S)),y.geometry.setAttribute("skinIndex",S)}for(const y of p)y.bind(g,new X)}}function Wo(e){const t=new Set;return e.traverse(n=>{if(!n.isSkinnedMesh)return;const i=n;t.add(i)}),t}function zo(e,t){const n=new Set;for(let i=0;in)return!1;return!0}var Ge=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==null&&(t=this._index,this._objectIndexMap.set(e,t),this._index++),t}};function Go(e){var t,n,i,r;const o=new Y;o.name=e.name,o.setIndex(e.index);for(const[a,l]of Object.entries(e.attributes))o.setAttribute(a,l);for(const[a,l]of Object.entries(e.morphAttributes))o.morphAttributes[a]=l.concat();o.morphTargetsRelative=e.morphTargetsRelative,o.groups=[];for(const a of e.groups)o.addGroup(a.start,a.count,a.materialIndex);return o.boundingSphere=(n=(t=e.boundingSphere)==null?void 0:t.clone())!=null?n:null,o.boundingBox=(r=(i=e.boundingBox)==null?void 0:i.clone())!=null?r:null,o.drawRange.start=e.drawRange.start,o.drawRange.count=e.drawRange.count,o.userData=e.userData,o}function Ln(e){if(Object.values(e).forEach(t=>{t!=null&&t.isTexture&&t.dispose()}),e.isShaderMaterial){const t=e.uniforms;t&&Object.values(t).forEach(n=>{const i=n.value;i!=null&&i.isTexture&&i.dispose()})}e.dispose()}function Qo(e){const t=e.geometry;t&&t.dispose();const n=e.skeleton;n&&n.dispose();const i=e.material;i&&(Array.isArray(i)?i.forEach(r=>Ln(r)):i&&Ln(i))}function $o(e){e.traverse(Qo)}function Zo(e,t){var n,i;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.");const r=(n=t==null?void 0:t.experimentalSameBoneCounts)!=null?n:!1,o=[];e.traverse(s=>{s.type==="SkinnedMesh"&&o.push(s)});const a=new Map;let l=0;for(const s of o){const h=s.geometry.getAttribute("skinIndex");if(a.has(h))continue;const d=new Map,c=new Map;for(let p=0;p{var i,r,o,a;if(!n.isMesh)return;const l=n,s=l.geometry,u=s.index;if(u==null)return;const h=t.get(s);if(h!=null){l.geometry=h;return}const d=Object.values(s.attributes)[0].count,c=new Array(d);let p=0;const m=u.array;for(let M=0;M{y.addGroup(M.start,M.count,M.materialIndex)}),y.boundingBox=(r=(i=s.boundingBox)==null?void 0:i.clone())!=null?r:null,y.boundingSphere=(a=(o=s.boundingSphere)==null?void 0:o.clone())!=null?a:null,y.setDrawRange(s.drawRange.start,s.drawRange.count),y.userData=s.userData,t.set(s,y);{const M=u.array,x=new M.constructor(M.length);for(let w=0;w{const x=s.attributes[M];if(x.isInterleavedBufferAttribute)throw new Error("removeUnnecessaryVertices: InterleavedBufferAttribute is not supported");const w=x.array,{itemSize:R,normalized:S}=x,L=new w.constructor(g.length*R);g.forEach((b,P)=>{for(let I=0;I{y.morphAttributes[M]=[];const x=s.morphAttributes[M];for(let w=0;w{for(let B=0;BI===0),y.morphAttributes[M][w]=new U(P,L,b)}}),E&&(y.morphAttributes={}),l.geometry=y}),Array.from(t.keys()).forEach(n=>{n.dispose()})}function Ko(e){var t;((t=e.meta)==null?void 0:t.metaVersion)==="0"&&(e.scene.rotation.y=Math.PI)}var ue=class{constructor(){}};ue.combineMorphs=Fo;ue.combineSkeletons=Ho;ue.deepDispose=$o;ue.removeUnnecessaryJoints=Zo;ue.removeUnnecessaryVertices=Jo;ue.rotateVRM0=Ko;/*! +`;n.vertexShader=r+n.vertexShader,n.fragmentShader=r+n.fragmentShader,i<154&&(n.fragmentShader=n.fragmentShader.replace("#include ","#include "))}}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(){const e=parseInt(be,10),t=this.outlineWidthMultiplyTexture!==null,n=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:e,OUTLINE:this._isOutline,MTOON_USE_UV:t||n,MTOON_UVS_VERTEX_ONLY:t&&!n,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===Mn.ScreenCoordinates}}_updateTextureMatrix(e,t){e.value&&(e.value.matrixAutoUpdate&&e.value.updateMatrix(),t.value.copy(e.value.matrix))}},Hr=new Set(["1.0","1.0-beta"]),Kn=class Ie{get name(){return Ie.EXTENSION_NAME}constructor(t,n={}){var i,r,o,a;this.parser=t,this.materialType=(i=n.materialType)!=null?i:Fr,this.renderOrderOffset=(r=n.renderOrderOffset)!=null?r:0,this.v0CompatShade=(o=n.v0CompatShade)!=null?o:!1,this.debugMode=(a=n.debugMode)!=null?a:"none",this._mToonMaterialSet=new Set}beforeRoot(){return K(this,null,function*(){this._removeUnlitExtensionIfMToonExists()})}afterRoot(t){return K(this,null,function*(){t.userData.vrmMToonMaterials=Array.from(this._mToonMaterialSet)})}getMaterialType(t){return this._getMToonExtension(t)?this.materialType:null}extendMaterialParams(t,n){const i=this._getMToonExtension(t);return i?this._extendMaterialParams(i,n):null}loadMesh(t){return K(this,null,function*(){var n;const i=this.parser,o=(n=i.json.meshes)==null?void 0:n[t];if(o==null)throw new Error(`MToonMaterialLoaderPlugin: Attempt to use meshes[${t}] of glTF but the mesh doesn't exist`);const a=o.primitives,l=yield i.loadMesh(t);if(a.length===1){const s=l,u=a[0].material;u!=null&&this._setupPrimitive(s,u)}else{const s=l;for(let u=0;u{var a;this._getMToonExtension(o)&&((a=r.extensions)!=null&&a.KHR_materials_unlit)&&delete r.extensions.KHR_materials_unlit})}_getMToonExtension(t){var n,i;const a=(n=this.parser.json.materials)==null?void 0:n[t];if(a==null){console.warn(`MToonMaterialLoaderPlugin: Attempt to use materials[${t}] of glTF but the material doesn't exist`);return}const l=(i=a.extensions)==null?void 0:i[Ie.EXTENSION_NAME];if(l==null)return;const s=l.specVersion;if(!Hr.has(s)){console.warn(`MToonMaterialLoaderPlugin: Unknown ${Ie.EXTENSION_NAME} specVersion "${s}"`);return}return l}_extendMaterialParams(t,n){return K(this,null,function*(){var i;delete n.metalness,delete n.roughness;const r=new Vr(this.parser,n);r.assignPrimitive("transparentWithZWrite",t.transparentWithZWrite),r.assignColor("shadeColorFactor",t.shadeColorFactor),r.assignTexture("shadeMultiplyTexture",t.shadeMultiplyTexture,!0),r.assignPrimitive("shadingShiftFactor",t.shadingShiftFactor),r.assignTexture("shadingShiftTexture",t.shadingShiftTexture,!0),r.assignPrimitive("shadingShiftTextureScale",(i=t.shadingShiftTexture)==null?void 0:i.scale),r.assignPrimitive("shadingToonyFactor",t.shadingToonyFactor),r.assignPrimitive("giEqualizationFactor",t.giEqualizationFactor),r.assignColor("matcapFactor",t.matcapFactor),r.assignTexture("matcapTexture",t.matcapTexture,!0),r.assignColor("parametricRimColorFactor",t.parametricRimColorFactor),r.assignTexture("rimMultiplyTexture",t.rimMultiplyTexture,!0),r.assignPrimitive("rimLightingMixFactor",t.rimLightingMixFactor),r.assignPrimitive("parametricRimFresnelPowerFactor",t.parametricRimFresnelPowerFactor),r.assignPrimitive("parametricRimLiftFactor",t.parametricRimLiftFactor),r.assignPrimitive("outlineWidthMode",t.outlineWidthMode),r.assignPrimitive("outlineWidthFactor",t.outlineWidthFactor),r.assignTexture("outlineWidthMultiplyTexture",t.outlineWidthMultiplyTexture,!1),r.assignColor("outlineColorFactor",t.outlineColorFactor),r.assignPrimitive("outlineLightingMixFactor",t.outlineLightingMixFactor),r.assignTexture("uvAnimationMaskTexture",t.uvAnimationMaskTexture,!1),r.assignPrimitive("uvAnimationScrollXSpeedFactor",t.uvAnimationScrollXSpeedFactor),r.assignPrimitive("uvAnimationScrollYSpeedFactor",t.uvAnimationScrollYSpeedFactor),r.assignPrimitive("uvAnimationRotationSpeedFactor",t.uvAnimationRotationSpeedFactor),r.assignPrimitive("v0CompatShade",this.v0CompatShade),r.assignPrimitive("debugMode",this.debugMode),yield r.pending})}_setupPrimitive(t,n){const i=this._getMToonExtension(n);if(i){const r=this._parseRenderOrder(i);t.renderOrder=r+this.renderOrderOffset,this._generateOutline(t),this._addToMaterialSet(t);return}}_shouldGenerateOutline(t){return typeof t.outlineWidthMode=="string"&&t.outlineWidthMode!=="none"&&typeof t.outlineWidthFactor=="number"&&t.outlineWidthFactor>0}_generateOutline(t){const n=t.material;if(!(n instanceof Bi)||!this._shouldGenerateOutline(n))return;t.material=[n];const i=n.clone();i.name+=" (Outline)",i.isOutline=!0,i.side=ki,t.material.push(i);const r=t.geometry,o=r.index?r.index.count:r.attributes.position.count/3;r.addGroup(0,o,0),r.addGroup(0,o,1)}_addToMaterialSet(t){const n=t.material,i=new Set;Array.isArray(n)?n.forEach(r=>i.add(r)):i.add(n);for(const r of i)this._mToonMaterialSet.add(r)}_parseRenderOrder(t){var n;return(t.transparentWithZWrite?0:19)+((n=t.renderQueueOffsetNumber)!=null?n:0)}};Kn.EXTENSION_NAME="VRMC_materials_mtoon";var Wr=Kn,zr=(e,t,n)=>new Promise((i,r)=>{var o=s=>{try{l(n.next(s))}catch(u){r(u)}},a=s=>{try{l(n.throw(s))}catch(u){r(u)}},l=s=>s.done?i(s.value):Promise.resolve(s.value).then(o,a);l((n=n.apply(e,t)).next())}),ei=class ot{get name(){return ot.EXTENSION_NAME}constructor(t){this.parser=t}extendMaterialParams(t,n){return zr(this,null,function*(){const i=this._getHDREmissiveMultiplierExtension(t);if(i==null)return;console.warn("VRMMaterialsHDREmissiveMultiplierLoaderPlugin: `VRMC_materials_hdr_emissiveMultiplier` is archived. Use `KHR_materials_emissive_strength` instead.");const r=i.emissiveMultiplier;n.emissiveIntensity=r})}_getHDREmissiveMultiplierExtension(t){var n,i;const a=(n=this.parser.json.materials)==null?void 0:n[t];if(a==null){console.warn(`VRMMaterialsHDREmissiveMultiplierLoaderPlugin: Attempt to use materials[${t}] of glTF but the material doesn't exist`);return}const l=(i=a.extensions)==null?void 0:i[ot.EXTENSION_NAME];if(l!=null)return l}};ei.EXTENSION_NAME="VRMC_materials_hdr_emissiveMultiplier";var jr=ei,Xr=Object.defineProperty,qr=Object.defineProperties,Yr=Object.getOwnPropertyDescriptors,xn=Object.getOwnPropertySymbols,Gr=Object.prototype.hasOwnProperty,Qr=Object.prototype.propertyIsEnumerable,yn=(e,t,n)=>t in e?Xr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,H=(e,t)=>{for(var n in t||(t={}))Gr.call(t,n)&&yn(e,n,t[n]);if(xn)for(var n of xn(t))Qr.call(t,n)&&yn(e,n,t[n]);return e},wn=(e,t)=>qr(e,Yr(t)),$r=(e,t,n)=>new Promise((i,r)=>{var o=s=>{try{l(n.next(s))}catch(u){r(u)}},a=s=>{try{l(n.throw(s))}catch(u){r(u)}},l=s=>s.done?i(s.value):Promise.resolve(s.value).then(o,a);l((n=n.apply(e,t)).next())});function ie(e){return Math.pow(e,2.2)}var Zr=class{get name(){return"VRMMaterialsV0CompatPlugin"}constructor(e){var t;this.parser=e,this._renderQueueMapTransparent=new Map,this._renderQueueMapTransparentZWrite=new Map;const n=this.parser.json;n.extensionsUsed=(t=n.extensionsUsed)!=null?t:[],n.extensionsUsed.indexOf("KHR_texture_transform")===-1&&n.extensionsUsed.push("KHR_texture_transform")}beforeRoot(){return $r(this,null,function*(){var e;const t=this.parser.json,n=(e=t.extensions)==null?void 0:e.VRM,i=n==null?void 0:n.materialProperties;i&&(this._populateRenderQueueMap(i),i.forEach((r,o)=>{var a,l;const s=(a=t.materials)==null?void 0:a[o];if(s==null){console.warn(`VRMMaterialsV0CompatPlugin: Attempt to use materials[${o}] of glTF but the material doesn't exist`);return}if(r.shader==="VRM/MToon"){const u=this._parseV0MToonProperties(r,s);t.materials[o]=u}else if((l=r.shader)!=null&&l.startsWith("VRM/Unlit")){const u=this._parseV0UnlitProperties(r,s);t.materials[o]=u}else r.shader==="VRM_USE_GLTFSHADER"||console.warn(`VRMMaterialsV0CompatPlugin: Unknown shader: ${r.shader}`)}))})}_parseV0MToonProperties(e,t){var n,i,r,o,a,l,s,u,h,d,c,p,m,f,g,v,y,E,M,x,w,R,S,L,I,P,b,D,B,de,q,k,te,he,O,ct,pt,mt,ft,_t,gt,vt,Mt,xt,yt,wt,Rt,Tt,Et,St,At,Pt,Lt,It,bt;const Ct=(i=(n=e.keywordMap)==null?void 0:n._ALPHABLEND_ON)!=null?i:!1,li=((r=e.floatProperties)==null?void 0:r._ZWrite)===1&&Ct,ui=this._v0ParseRenderQueue(e),Ut=(a=(o=e.keywordMap)==null?void 0:o._ALPHATEST_ON)!=null?a:!1,di=Ct?"BLEND":Ut?"MASK":"OPAQUE",hi=Ut?(s=(l=e.floatProperties)==null?void 0:l._Cutoff)!=null?s:.5:void 0,ci=((h=(u=e.floatProperties)==null?void 0:u._CullMode)!=null?h:2)===0,Q=this._portTextureTransform(e),pi=((c=(d=e.vectorProperties)==null?void 0:d._Color)!=null?c:[1,1,1,1]).map((Wt,Di)=>Di===3?Wt:ie(Wt)),Ot=(p=e.textureProperties)==null?void 0:p._MainTex,mi=Ot!=null?{index:Ot,extensions:H({},Q)}:void 0,fi=(f=(m=e.floatProperties)==null?void 0:m._BumpScale)!=null?f:1,Vt=(g=e.textureProperties)==null?void 0:g._BumpMap,_i=Vt!=null?{index:Vt,scale:fi,extensions:H({},Q)}:void 0,gi=((y=(v=e.vectorProperties)==null?void 0:v._EmissionColor)!=null?y:[0,0,0,1]).map(ie),Nt=(E=e.textureProperties)==null?void 0:E._EmissionMap,vi=Nt!=null?{index:Nt,extensions:H({},Q)}:void 0,Mi=((x=(M=e.vectorProperties)==null?void 0:M._ShadeColor)!=null?x:[.97,.81,.86,1]).map(ie),Dt=(w=e.textureProperties)==null?void 0:w._ShadeTexture,xi=Dt!=null?{index:Dt,extensions:H({},Q)}:void 0;let ye=(S=(R=e.floatProperties)==null?void 0:R._ShadeShift)!=null?S:0,we=(I=(L=e.floatProperties)==null?void 0:L._ShadeToony)!=null?I:.9;we=C.lerp(we,1,.5+.5*ye),ye=-ye-(1-we);const Bt=(b=(P=e.floatProperties)==null?void 0:P._IndirectLightIntensity)!=null?b:.1,yi=Bt?1-Bt:void 0,Ve=(D=e.textureProperties)==null?void 0:D._SphereAdd,wi=Ve!=null?[1,1,1]:void 0,Ri=Ve!=null?{index:Ve}:void 0,Ti=(de=(B=e.floatProperties)==null?void 0:B._RimLightingMix)!=null?de:0,kt=(q=e.textureProperties)==null?void 0:q._RimTexture,Ei=kt!=null?{index:kt,extensions:H({},Q)}:void 0,Si=((te=(k=e.vectorProperties)==null?void 0:k._RimColor)!=null?te:[0,0,0,1]).map(ie),Ai=(O=(he=e.floatProperties)==null?void 0:he._RimFresnelPower)!=null?O:1,Pi=(pt=(ct=e.floatProperties)==null?void 0:ct._RimLift)!=null?pt:0,Li=["none","worldCoordinates","screenCoordinates"][(ft=(mt=e.floatProperties)==null?void 0:mt._OutlineWidthMode)!=null?ft:0];let Ne=(gt=(_t=e.floatProperties)==null?void 0:_t._OutlineWidth)!=null?gt:0;Ne=.01*Ne;const Ft=(vt=e.textureProperties)==null?void 0:vt._OutlineWidthTexture,Ii=Ft!=null?{index:Ft,extensions:H({},Q)}:void 0,bi=((xt=(Mt=e.vectorProperties)==null?void 0:Mt._OutlineColor)!=null?xt:[0,0,0]).map(ie),Ci=((wt=(yt=e.floatProperties)==null?void 0:yt._OutlineColorMode)!=null?wt:0)===1?(Tt=(Rt=e.floatProperties)==null?void 0:Rt._OutlineLightingMix)!=null?Tt:1:0,Ht=(Et=e.textureProperties)==null?void 0:Et._UvAnimMaskTexture,Ui=Ht!=null?{index:Ht,extensions:H({},Q)}:void 0,Oi=(At=(St=e.floatProperties)==null?void 0:St._UvAnimScrollX)!=null?At:0;let Re=(Lt=(Pt=e.floatProperties)==null?void 0:Pt._UvAnimScrollY)!=null?Lt:0;Re!=null&&(Re=-Re);const Vi=(bt=(It=e.floatProperties)==null?void 0:It._UvAnimRotation)!=null?bt:0,Ni={specVersion:"1.0",transparentWithZWrite:li,renderQueueOffsetNumber:ui,shadeColorFactor:Mi,shadeMultiplyTexture:xi,shadingShiftFactor:ye,shadingToonyFactor:we,giEqualizationFactor:yi,matcapFactor:wi,matcapTexture:Ri,rimLightingMixFactor:Ti,rimMultiplyTexture:Ei,parametricRimColorFactor:Si,parametricRimFresnelPowerFactor:Ai,parametricRimLiftFactor:Pi,outlineWidthMode:Li,outlineWidthFactor:Ne,outlineWidthMultiplyTexture:Ii,outlineColorFactor:bi,outlineLightingMixFactor:Ci,uvAnimationMaskTexture:Ui,uvAnimationScrollXSpeedFactor:Oi,uvAnimationScrollYSpeedFactor:Re,uvAnimationRotationSpeedFactor:Vi};return wn(H({},t),{pbrMetallicRoughness:{baseColorFactor:pi,baseColorTexture:mi},normalTexture:_i,emissiveTexture:vi,emissiveFactor:gi,alphaMode:di,alphaCutoff:hi,doubleSided:ci,extensions:{VRMC_materials_mtoon:Ni}})}_parseV0UnlitProperties(e,t){var n,i,r,o,a;const l=e.shader==="VRM/UnlitTransparentZWrite",s=e.shader==="VRM/UnlitTransparent"||l,u=this._v0ParseRenderQueue(e),h=e.shader==="VRM/UnlitCutout",d=s?"BLEND":h?"MASK":"OPAQUE",c=h?(i=(n=e.floatProperties)==null?void 0:n._Cutoff)!=null?i:.5:void 0,p=this._portTextureTransform(e),m=((o=(r=e.vectorProperties)==null?void 0:r._Color)!=null?o:[1,1,1,1]).map(ie),f=(a=e.textureProperties)==null?void 0:a._MainTex,g=f!=null?{index:f,extensions:H({},p)}:void 0,v={specVersion:"1.0",transparentWithZWrite:l,renderQueueOffsetNumber:u,shadeColorFactor:m,shadeMultiplyTexture:g};return wn(H({},t),{pbrMetallicRoughness:{baseColorFactor:m,baseColorTexture:g},alphaMode:d,alphaCutoff:c,extensions:{VRMC_materials_mtoon:v}})}_portTextureTransform(e){var t,n,i,r,o;const a=(t=e.vectorProperties)==null?void 0:t._MainTex;if(a==null)return{};const l=[(n=a==null?void 0:a[0])!=null?n:0,(i=a==null?void 0:a[1])!=null?i:0],s=[(r=a==null?void 0:a[2])!=null?r:1,(o=a==null?void 0:a[3])!=null?o:1];return l[1]=1-s[1]-l[1],{KHR_texture_transform:{offset:l,scale:s}}}_v0ParseRenderQueue(e){var t,n;const i=e.shader==="VRM/UnlitTransparentZWrite",r=((t=e.keywordMap)==null?void 0:t._ALPHABLEND_ON)!=null||e.shader==="VRM/UnlitTransparent"||i,o=((n=e.floatProperties)==null?void 0:n._ZWrite)===1||i;let a=0;if(r){const l=e.renderQueue;l!=null&&(o?a=this._renderQueueMapTransparentZWrite.get(l):a=this._renderQueueMapTransparent.get(l))}return a}_populateRenderQueueMap(e){const t=new Set,n=new Set;e.forEach(i=>{var r,o;const a=i.shader==="VRM/UnlitTransparentZWrite",l=((r=i.keywordMap)==null?void 0:r._ALPHABLEND_ON)!=null||i.shader==="VRM/UnlitTransparent"||a,s=((o=i.floatProperties)==null?void 0:o._ZWrite)===1||a;if(l){const u=i.renderQueue;u!=null&&(s?n.add(u):t.add(u))}}),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((i,r)=>{const o=Math.min(Math.max(r-t.size+1,-9),0);this._renderQueueMapTransparent.set(i,o)}),Array.from(n).sort().forEach((i,r)=>{const o=Math.min(Math.max(r,0),9);this._renderQueueMapTransparentZWrite.set(i,o)})}},Rn=(e,t,n)=>new Promise((i,r)=>{var o=s=>{try{l(n.next(s))}catch(u){r(u)}},a=s=>{try{l(n.throw(s))}catch(u){r(u)}},l=s=>s.done?i(s.value):Promise.resolve(s.value).then(o,a);l((n=n.apply(e,t)).next())}),G=new _,We=class extends le{constructor(e){super(),this._attrPosition=new U(new Float32Array([0,0,0,0,0,0]),3),this._attrPosition.setUsage(ji);const t=new Y;t.setAttribute("position",this._attrPosition);const n=new Oe({color:16711935,depthTest:!1,depthWrite:!1});this._line=new Xi(t,n),this.add(this._line),this.constraint=e}updateMatrixWorld(e){G.setFromMatrixPosition(this.constraint.destination.matrixWorld),this._attrPosition.setXYZ(0,G.x,G.y,G.z),this.constraint.source&&G.setFromMatrixPosition(this.constraint.source.matrixWorld),this._attrPosition.setXYZ(1,G.x,G.y,G.z),this._attrPosition.needsUpdate=!0,super.updateMatrixWorld(e)}};function Tn(e,t){return t.set(e.elements[12],e.elements[13],e.elements[14])}var Jr=new _,Kr=new _;function eo(e,t){return e.decompose(Jr,t,Kr),t}function Ue(e){return e.invert?e.invert():e.inverse(),e}var dt=class{constructor(e,t){this.destination=e,this.source=t,this.weight=1}},to=new _,no=new _,io=new _,ro=new T,oo=new T,so=new T,ao=class extends dt{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(){const 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 _(1,0,0),this._dstRestQuat=new T}setInitState(){this._dstRestQuat.copy(this.destination.quaternion)}update(){this.destination.updateWorldMatrix(!0,!1),this.source.updateWorldMatrix(!0,!1);const e=ro.identity(),t=oo.identity();this.destination.parent&&(eo(this.destination.parent.matrixWorld,e),Ue(t.copy(e)));const n=to.copy(this._v3AimAxis).applyQuaternion(this._dstRestQuat).applyQuaternion(e),i=Tn(this.source.matrixWorld,no).sub(Tn(this.destination.matrixWorld,io)).normalize(),r=so.setFromUnitVectors(n,i).premultiply(t).multiply(e).multiply(this._dstRestQuat);this.destination.quaternion.copy(this._dstRestQuat).slerp(r,this.weight)}};function lo(e,t){const n=[e];let i=e.parent;for(;i!==null;)n.unshift(i),i=i.parent;n.forEach(r=>{t(r)})}var uo=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==null&&(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(){const e=new Set,t=new Set;for(const n of this._constraints)this._processConstraint(n,e,t,i=>i.setInitState())}update(){const e=new Set,t=new Set;for(const n of this._constraints)this._processConstraint(n,e,t,i=>i.update())}_processConstraint(e,t,n,i){if(n.has(e))return;if(t.has(e))throw new Error("VRMNodeConstraintManager: Circular dependency detected while updating constraints");t.add(e);const r=e.dependencies;for(const o of r)lo(o,a=>{const l=this._objectConstraintsMap.get(a);if(l)for(const s of l)this._processConstraint(s,t,n,i)});i(e),n.add(e)}},ho=new T,co=new T,po=class extends dt{get dependencies(){return new Set([this.source])}constructor(e,t){super(e,t),this._dstRestQuat=new T,this._invSrcRestQuat=new T}setInitState(){this._dstRestQuat.copy(this.destination.quaternion),Ue(this._invSrcRestQuat.copy(this.source.quaternion))}update(){const e=ho.copy(this._invSrcRestQuat).multiply(this.source.quaternion),t=co.copy(this._dstRestQuat).multiply(e);this.destination.quaternion.copy(this._dstRestQuat).slerp(t,this.weight)}},mo=new _,fo=new T,_o=new T,go=class extends dt{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 _(1,0,0),this._dstRestQuat=new T,this._invDstRestQuat=new T,this._invSrcRestQuatMulDstRestQuat=new T}setInitState(){this._dstRestQuat.copy(this.destination.quaternion),Ue(this._invDstRestQuat.copy(this._dstRestQuat)),Ue(this._invSrcRestQuatMulDstRestQuat.copy(this.source.quaternion)).multiply(this._dstRestQuat)}update(){const e=fo.copy(this._invDstRestQuat).multiply(this.source.quaternion).multiply(this._invSrcRestQuatMulDstRestQuat),t=mo.copy(this._v3RollAxis).applyQuaternion(e),i=_o.setFromUnitVectors(t,this._v3RollAxis).premultiply(this._dstRestQuat).multiply(e);this.destination.quaternion.copy(this._dstRestQuat).slerp(i,this.weight)}},vo=new Set(["1.0","1.0-beta"]),ti=class Me{get name(){return Me.EXTENSION_NAME}constructor(t,n){this.parser=t,this.helperRoot=n==null?void 0:n.helperRoot}afterRoot(t){return Rn(this,null,function*(){t.userData.vrmNodeConstraintManager=yield this._import(t)})}_import(t){return Rn(this,null,function*(){var n;const i=this.parser.json;if(!(((n=i.extensionsUsed)==null?void 0:n.indexOf(Me.EXTENSION_NAME))!==-1))return null;const o=new uo,a=yield this.parser.getDependencies("node");return a.forEach((l,s)=>{var u;const h=i.nodes[s],d=(u=h==null?void 0:h.extensions)==null?void 0:u[Me.EXTENSION_NAME];if(d==null)return;const c=d.specVersion;if(!vo.has(c)){console.warn(`VRMNodeConstraintLoaderPlugin: Unknown ${Me.EXTENSION_NAME} specVersion "${c}"`);return}const p=d.constraint;if(p.roll!=null){const m=this._importRollConstraint(l,a,p.roll);o.addConstraint(m)}else if(p.aim!=null){const m=this._importAimConstraint(l,a,p.aim);o.addConstraint(m)}else if(p.rotation!=null){const m=this._importRotationConstraint(l,a,p.rotation);o.addConstraint(m)}}),t.scene.updateMatrixWorld(),o.setInitState(),o})}_importRollConstraint(t,n,i){const{source:r,rollAxis:o,weight:a}=i,l=n[r],s=new go(t,l);if(o!=null&&(s.rollAxis=o),a!=null&&(s.weight=a),this.helperRoot){const u=new We(s);this.helperRoot.add(u)}return s}_importAimConstraint(t,n,i){const{source:r,aimAxis:o,weight:a}=i,l=n[r],s=new ao(t,l);if(o!=null&&(s.aimAxis=o),a!=null&&(s.weight=a),this.helperRoot){const u=new We(s);this.helperRoot.add(u)}return s}_importRotationConstraint(t,n,i){const{source:r,weight:o}=i,a=n[r],l=new po(t,a);if(o!=null&&(l.weight=o),this.helperRoot){const s=new We(l);this.helperRoot.add(s)}return l}};ti.EXTENSION_NAME="VRMC_node_constraint";var Mo=ti,Ae=(e,t,n)=>new Promise((i,r)=>{var o=s=>{try{l(n.next(s))}catch(u){r(u)}},a=s=>{try{l(n.throw(s))}catch(u){r(u)}},l=s=>s.done?i(s.value):Promise.resolve(s.value).then(o,a);l((n=n.apply(e,t)).next())}),ht=class{},ze=new _,J=new _,ni=class extends ht{get type(){return"capsule"}constructor(e){var t,n,i,r;super(),this.offset=(t=e==null?void 0:e.offset)!=null?t:new _(0,0,0),this.tail=(n=e==null?void 0:e.tail)!=null?n:new _(0,0,0),this.radius=(i=e==null?void 0:e.radius)!=null?i:0,this.inside=(r=e==null?void 0:e.inside)!=null?r:!1}calculateCollision(e,t,n,i){ze.setFromMatrixPosition(e),J.subVectors(this.tail,this.offset).applyMatrix4(e),J.sub(ze);const r=J.lengthSq();i.copy(t).sub(ze);const o=J.dot(i);o<=0||(r<=o||J.multiplyScalar(o/r),i.sub(J));const a=i.length(),l=this.inside?this.radius-n-a:a-n-this.radius;return l<0&&(i.multiplyScalar(1/a),this.inside&&i.negate()),l}},je=new _,En=new z,ii=class extends ht{get type(){return"plane"}constructor(e){var t,n;super(),this.offset=(t=e==null?void 0:e.offset)!=null?t:new _(0,0,0),this.normal=(n=e==null?void 0:e.normal)!=null?n:new _(0,0,1)}calculateCollision(e,t,n,i){i.setFromMatrixPosition(e),i.negate().add(t),En.getNormalMatrix(e),je.copy(this.normal).applyNormalMatrix(En).normalize();const r=i.dot(je)-n;return i.copy(je),r}},xo=new _,ri=class extends ht{get type(){return"sphere"}constructor(e){var t,n,i;super(),this.offset=(t=e==null?void 0:e.offset)!=null?t:new _(0,0,0),this.radius=(n=e==null?void 0:e.radius)!=null?n:0,this.inside=(i=e==null?void 0:e.inside)!=null?i:!1}calculateCollision(e,t,n,i){i.subVectors(t,xo.setFromMatrixPosition(e));const r=i.length(),o=this.inside?this.radius-n-r:r-n-this.radius;return o<0&&(i.multiplyScalar(1/r),this.inside&&i.negate()),o}},W=new _,yo=class extends Y{constructor(e){super(),this.worldScale=1,this._currentRadius=0,this._currentOffset=new _,this._currentTail=new _,this._shape=e,this._attrPos=new U(new Float32Array(396),3),this.setAttribute("position",this._attrPos),this._attrIndex=new U(new Uint16Array(264),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let e=!1;const 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);const n=W.copy(this._shape.tail).divideScalar(this.worldScale);this._currentTail.distanceToSquared(n)>1e-10&&(this._currentTail.copy(n),e=!0),e&&this._buildPosition()}_buildPosition(){W.copy(this._currentTail).sub(this._currentOffset);const e=W.length()/this._currentRadius;for(let i=0;i<=16;i++){const r=i/16*Math.PI;this._attrPos.setXYZ(i,-Math.sin(r),-Math.cos(r),0),this._attrPos.setXYZ(17+i,e+Math.sin(r),Math.cos(r),0),this._attrPos.setXYZ(34+i,-Math.sin(r),0,-Math.cos(r)),this._attrPos.setXYZ(51+i,e+Math.sin(r),0,Math.cos(r))}for(let i=0;i<32;i++){const r=i/16*Math.PI;this._attrPos.setXYZ(68+i,0,Math.sin(r),Math.cos(r)),this._attrPos.setXYZ(100+i,e,Math.sin(r),Math.cos(r))}const t=Math.atan2(W.y,Math.sqrt(W.x*W.x+W.z*W.z)),n=-Math.atan2(W.z,W.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++){const 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++){const 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}},wo=class extends Y{constructor(e){super(),this.worldScale=1,this._currentOffset=new _,this._currentNormal=new _,this._shape=e,this._attrPos=new U(new Float32Array(6*3),3),this.setAttribute("position",this._attrPos),this._attrIndex=new U(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}},Ro=class extends Y{constructor(e){super(),this.worldScale=1,this._currentRadius=0,this._currentOffset=new _,this._shape=e,this._attrPos=new U(new Float32Array(32*3*3),3),this.setAttribute("position",this._attrPos),this._attrIndex=new U(new Uint16Array(64*3),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let e=!1;const 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++){const 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++){const 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}},To=new _,Xe=class extends le{constructor(e){if(super(),this.matrixAutoUpdate=!1,this.collider=e,this.collider.shape instanceof ri)this._geometry=new Ro(this.collider.shape);else if(this.collider.shape instanceof ni)this._geometry=new yo(this.collider.shape);else if(this.collider.shape instanceof ii)this._geometry=new wo(this.collider.shape);else throw new Error("VRMSpringBoneColliderHelper: Unknown collider shape type detected");const t=new Oe({color:16711935,depthTest:!1,depthWrite:!1});this._line=new at(this._geometry,t),this.add(this._line)}dispose(){this._geometry.dispose()}updateMatrixWorld(e){this.collider.updateWorldMatrix(!0,!1),this.matrix.copy(this.collider.matrixWorld);const t=this.matrix.elements;this._geometry.worldScale=To.set(t[0],t[1],t[2]).length(),this._geometry.update(),super.updateMatrixWorld(e)}},Eo=class extends Y{constructor(e){super(),this.worldScale=1,this._currentRadius=0,this._currentTail=new _,this._springBone=e,this._attrPos=new U(new Float32Array(294),3),this.setAttribute("position",this._attrPos),this._attrIndex=new U(new Uint16Array(194),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let e=!1;const 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++){const 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++){const 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}},So=new _,Ao=class extends le{constructor(e){super(),this.matrixAutoUpdate=!1,this.springBone=e,this._geometry=new Eo(this.springBone);const t=new Oe({color:16776960,depthTest:!1,depthWrite:!1});this._line=new at(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);const t=this.matrix.elements;this._geometry.worldScale=So.set(t[0],t[1],t[2]).length(),this._geometry.update(),super.updateMatrixWorld(e)}},qe=class extends xe{constructor(e){super(),this.colliderMatrix=new X,this.shape=e}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),Po(this.colliderMatrix,this.matrixWorld,this.shape.offset)}};function Po(e,t,n){const i=t.elements;e.copy(t),n&&(e.elements[12]=i[0]*n.x+i[4]*n.y+i[8]*n.z+i[12],e.elements[13]=i[1]*n.x+i[5]*n.y+i[9]*n.z+i[13],e.elements[14]=i[2]*n.x+i[6]*n.y+i[10]*n.z+i[14])}var Lo=new X;function Io(e){return e.invert?e.invert():e.getInverse(Lo.copy(e)),e}var bo=class{constructor(e){this._inverseCache=new X,this._shouldUpdateInverse=!0,this.matrix=e;const t={set:(n,i,r)=>(this._shouldUpdateInverse=!0,n[i]=r,!0)};this._originalElements=e.elements,e.elements=new Proxy(e.elements,t)}get inverse(){return this._shouldUpdateInverse&&(Io(this._inverseCache.copy(this.matrix)),this._shouldUpdateInverse=!1),this._inverseCache}revert(){this.matrix.elements=this._originalElements}},Ye=new X,re=new _,fe=new _,_e=new _,ge=new _,Co=new X,Uo=class{constructor(e,t,n={},i=[]){this._currentTail=new _,this._prevTail=new _,this._boneAxis=new _,this._worldSpaceBoneLength=0,this._center=null,this._initialLocalMatrix=new X,this._initialLocalRotation=new T,this._initialLocalChildPosition=new _;var r,o,a,l,s,u;this.bone=e,this.bone.matrixAutoUpdate=!1,this.child=t,this.settings={hitRadius:(r=n.hitRadius)!=null?r:0,stiffness:(o=n.stiffness)!=null?o:1,gravityPower:(a=n.gravityPower)!=null?a:0,gravityDir:(s=(l=n.gravityDir)==null?void 0:l.clone())!=null?s:new _(0,-1,0),dragForce:(u=n.dragForce)!=null?u:.4},this.colliderGroups=i}get dependencies(){const e=new Set,t=this.bone.parent;t&&e.add(t);for(let n=0;n{t(r)})}function st(e,t){e.children.forEach(n=>{t(n)||st(n,t)})}function Vo(e){var t;const n=new Map;for(const i of e){let r=i;do{const o=((t=n.get(r))!=null?t:0)+1;if(o===e.size)return r;n.set(r,o),r=r.parent}while(r!==null)}return null}var Sn=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(){const e=new Set;return this._joints.forEach(t=>{t.colliderGroups.forEach(n=>{e.add(n)})}),Array.from(e)}get colliders(){const e=new Set;return this.colliderGroups.forEach(t=>{t.colliders.forEach(n=>{e.add(n)})}),Array.from(e)}addJoint(e){this._joints.add(e);let t=this._objectSpringBonesMap.get(e.bone);t==null&&(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{var a,l;return((l=(a=this._objectSpringBonesMap.get(o))==null?void 0:a.size)!=null?l:0)>0?!0:(this._ancestors.push(o),!1)})),this._isSortedJointsDirty=!1}_insertJointSort(e,t,n,i,r){if(n.has(e))return;if(t.has(e)){this._hasWarnedCircularDependency||(console.warn("VRMSpringBoneManager: Circular dependency detected"),this._hasWarnedCircularDependency=!0);return}t.add(e);const o=e.dependencies;for(const a of o){let l=!1,s=null;Oo(a,u=>{const h=this._objectSpringBonesMap.get(u);if(h)for(const d of h)l=!0,this._insertJointSort(d,t,n,i,r);else l||(s=u)}),s&&r.add(s)}i.push(e),n.add(e)}_relevantChildrenUpdated(e){var t,n;return((n=(t=this._objectSpringBonesMap.get(e))==null?void 0:t.size)!=null?n:0)>0?!0:(e.updateWorldMatrix(!1,!1),!1)}},An="VRMC_springBone_extended_collider",No=new Set(["1.0","1.0-beta"]),Do=new Set(["1.0"]),oi=class se{get name(){return se.EXTENSION_NAME}constructor(t,n){var i;this.parser=t,this.jointHelperRoot=n==null?void 0:n.jointHelperRoot,this.colliderHelperRoot=n==null?void 0:n.colliderHelperRoot,this.useExtendedColliders=(i=n==null?void 0:n.useExtendedColliders)!=null?i:!0}afterRoot(t){return Ae(this,null,function*(){t.userData.vrmSpringBoneManager=yield this._import(t)})}_import(t){return Ae(this,null,function*(){const n=yield this._v1Import(t);if(n!=null)return n;const i=yield this._v0Import(t);return i??null})}_v1Import(t){return Ae(this,null,function*(){var n,i,r,o,a;const l=t.parser.json;if(!(((n=l.extensionsUsed)==null?void 0:n.indexOf(se.EXTENSION_NAME))!==-1))return null;const u=new Sn,h=yield t.parser.getDependencies("node"),d=(i=l.extensions)==null?void 0:i[se.EXTENSION_NAME];if(!d)return null;const c=d.specVersion;if(!No.has(c))return console.warn(`VRMSpringBoneLoaderPlugin: Unknown ${se.EXTENSION_NAME} specVersion "${c}"`),null;const p=(r=d.colliders)==null?void 0:r.map((f,g)=>{var v,y,E,M,x,w,R,S,L,I,P,b,D,B,de;const q=h[f.node];if(q==null)return console.warn(`VRMSpringBoneLoaderPlugin: The collider #${g} attempted to use the node #${f.node} but not found`),null;const k=f.shape,te=(v=f.extensions)==null?void 0:v[An];if(this.useExtendedColliders&&te!=null){const he=te.specVersion;if(!Do.has(he))console.warn(`VRMSpringBoneLoaderPlugin: Unknown ${An} specVersion "${he}". Fallbacking to the ${se.EXTENSION_NAME} definition`);else{const O=te.shape;if(O.sphere)return this._importSphereCollider(q,{offset:new _().fromArray((y=O.sphere.offset)!=null?y:[0,0,0]),radius:(E=O.sphere.radius)!=null?E:0,inside:(M=O.sphere.inside)!=null?M:!1});if(O.capsule)return this._importCapsuleCollider(q,{offset:new _().fromArray((x=O.capsule.offset)!=null?x:[0,0,0]),radius:(w=O.capsule.radius)!=null?w:0,tail:new _().fromArray((R=O.capsule.tail)!=null?R:[0,0,0]),inside:(S=O.capsule.inside)!=null?S:!1});if(O.plane)return this._importPlaneCollider(q,{offset:new _().fromArray((L=O.plane.offset)!=null?L:[0,0,0]),normal:new _().fromArray((I=O.plane.normal)!=null?I:[0,0,1])})}}if(k.sphere)return this._importSphereCollider(q,{offset:new _().fromArray((P=k.sphere.offset)!=null?P:[0,0,0]),radius:(b=k.sphere.radius)!=null?b:0,inside:!1});if(k.capsule)return this._importCapsuleCollider(q,{offset:new _().fromArray((D=k.capsule.offset)!=null?D:[0,0,0]),radius:(B=k.capsule.radius)!=null?B:0,tail:new _().fromArray((de=k.capsule.tail)!=null?de:[0,0,0]),inside:!1});throw new Error(`VRMSpringBoneLoaderPlugin: The collider #${g} has no valid shape`)}),m=(o=d.colliderGroups)==null?void 0:o.map((f,g)=>{var v;return{colliders:((v=f.colliders)!=null?v:[]).flatMap(E=>{const M=p==null?void 0:p[E];return M??(console.warn(`VRMSpringBoneLoaderPlugin: The colliderGroup #${g} attempted to use a collider #${E} but not found`),[])}),name:f.name}});return(a=d.springs)==null||a.forEach((f,g)=>{var v;const y=f.joints,E=(v=f.colliderGroups)==null?void 0:v.map(w=>{const R=m==null?void 0:m[w];if(R==null)throw new Error(`VRMSpringBoneLoaderPlugin: The spring #${g} attempted to use a colliderGroup ${w} but not found`);return R}),M=f.center!=null?h[f.center]:void 0;let x;y.forEach(w=>{if(x){const R=x.node,S=h[R],L=w.node,I=h[L],P={hitRadius:x.hitRadius,dragForce:x.dragForce,gravityPower:x.gravityPower,stiffness:x.stiffness,gravityDir:x.gravityDir!=null?new _().fromArray(x.gravityDir):void 0},b=this._importJoint(S,I,P,E);M&&(b.center=M),u.addJoint(b)}x=w})}),u.setInitState(),u})}_v0Import(t){return Ae(this,null,function*(){var n,i,r;const o=t.parser.json;if(!(((n=o.extensionsUsed)==null?void 0:n.indexOf("VRM"))!==-1))return null;const l=(i=o.extensions)==null?void 0:i.VRM,s=l==null?void 0:l.secondaryAnimation;if(!s)return null;const u=s==null?void 0:s.boneGroups;if(!u)return null;const h=new Sn,d=yield t.parser.getDependencies("node"),c=(r=s.colliderGroups)==null?void 0:r.map(p=>{var m;const f=d[p.node];return{colliders:((m=p.colliders)!=null?m:[]).map((v,y)=>{var E,M,x;const w=new _(0,0,0);return v.offset&&w.set((E=v.offset.x)!=null?E:0,(M=v.offset.y)!=null?M:0,v.offset.z?-v.offset.z:0),this._importSphereCollider(f,{offset:w,radius:(x=v.radius)!=null?x:0,inside:!1})})}});return u==null||u.forEach((p,m)=>{const f=p.bones;f&&f.forEach(g=>{var v,y,E,M;const x=d[g],w=new _;p.gravityDir?w.set((v=p.gravityDir.x)!=null?v:0,(y=p.gravityDir.y)!=null?y:0,(E=p.gravityDir.z)!=null?E:0):w.set(0,-1,0);const R=p.center!=null?d[p.center]:void 0,S={hitRadius:p.hitRadius,dragForce:p.dragForce,gravityPower:p.gravityPower,stiffness:p.stiffiness,gravityDir:w},L=(M=p.colliderGroups)==null?void 0:M.map(I=>{const P=c==null?void 0:c[I];if(P==null)throw new Error(`VRMSpringBoneLoaderPlugin: The spring #${m} attempted to use a colliderGroup ${I} but not found`);return P});x.traverse(I=>{var P;const b=(P=I.children[0])!=null?P:null,D=this._importJoint(I,b,S,L);R&&(D.center=R),h.addJoint(D)})})}),t.scene.updateMatrixWorld(),h.setInitState(),h})}_importJoint(t,n,i,r){const o=new Uo(t,n,i,r);if(this.jointHelperRoot){const a=new Ao(o);this.jointHelperRoot.add(a),a.renderOrder=this.jointHelperRoot.renderOrder}return o}_importSphereCollider(t,n){const i=new ri(n),r=new qe(i);if(t.add(r),this.colliderHelperRoot){const o=new Xe(r);this.colliderHelperRoot.add(o),o.renderOrder=this.colliderHelperRoot.renderOrder}return r}_importCapsuleCollider(t,n){const i=new ni(n),r=new qe(i);if(t.add(r),this.colliderHelperRoot){const o=new Xe(r);this.colliderHelperRoot.add(o),o.renderOrder=this.colliderHelperRoot.renderOrder}return r}_importPlaneCollider(t,n){const i=new ii(n),r=new qe(i);if(t.add(r),this.colliderHelperRoot){const o=new Xe(r);this.colliderHelperRoot.add(o),o.renderOrder=this.colliderHelperRoot.renderOrder}return r}};oi.EXTENSION_NAME="VRMC_springBone";var Bo=oi,Ts=class{get name(){return"VRMLoaderPlugin"}constructor(e,t){var n,i,r,o,a,l,s,u,h,d;this.parser=e;const c=t==null?void 0:t.helperRoot,p=t==null?void 0:t.autoUpdateHumanBones;this.expressionPlugin=(n=t==null?void 0:t.expressionPlugin)!=null?n:new er(e),this.firstPersonPlugin=(i=t==null?void 0:t.firstPersonPlugin)!=null?i:new nr(e),this.humanoidPlugin=(r=t==null?void 0:t.humanoidPlugin)!=null?r:new ur(e,{helperRoot:c,autoUpdateHumanBones:p}),this.lookAtPlugin=(o=t==null?void 0:t.lookAtPlugin)!=null?o:new Tr(e,{helperRoot:c}),this.metaPlugin=(a=t==null?void 0:t.metaPlugin)!=null?a:new Ar(e),this.mtoonMaterialPlugin=(l=t==null?void 0:t.mtoonMaterialPlugin)!=null?l:new Wr(e),this.materialsHDREmissiveMultiplierPlugin=(s=t==null?void 0:t.materialsHDREmissiveMultiplierPlugin)!=null?s:new jr(e),this.materialsV0CompatPlugin=(u=t==null?void 0:t.materialsV0CompatPlugin)!=null?u:new Zr(e),this.springBonePlugin=(h=t==null?void 0:t.springBonePlugin)!=null?h:new Bo(e,{colliderHelperRoot:c,jointHelperRoot:c}),this.nodeConstraintPlugin=(d=t==null?void 0:t.nodeConstraintPlugin)!=null?d:new Mo(e,{helperRoot:c})}beforeRoot(){return Te(this,null,function*(){yield this.materialsV0CompatPlugin.beforeRoot(),yield this.mtoonMaterialPlugin.beforeRoot()})}loadMesh(e){return Te(this,null,function*(){return yield this.mtoonMaterialPlugin.loadMesh(e)})}getMaterialType(e){const t=this.mtoonMaterialPlugin.getMaterialType(e);return t??null}extendMaterialParams(e,t){return Te(this,null,function*(){yield this.materialsHDREmissiveMultiplierPlugin.extendMaterialParams(e,t),yield this.mtoonMaterialPlugin.extendMaterialParams(e,t)})}afterRoot(e){return Te(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);const t=e.userData.vrmMeta,n=e.userData.vrmHumanoid;if(t&&n){const i=new Lr({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=i}})}};function ko(e){const t=new Set;return e.traverse(n=>{if(!n.isMesh)return;const i=n;t.add(i)}),t}function Pn(e,t,n){if(t.size===1){const a=t.values().next().value;if(a.weight===1)return e[a.index]}const i=new Float32Array(e[0].count*3);let r=0;if(n)r=1;else for(const a of t)r+=a.weight;for(const a of t){const l=e[a.index],s=a.weight/r;for(let u=0;uh.getOrCreate(L)).join(","),R=`${M};${v};${w}`;let S=l.get(R);S==null&&(S=E.clone(),qo(S,x,m),l.set(R,S)),y.geometry.setAttribute("skinIndex",S)}for(const y of p)y.bind(g,new X)}}function Wo(e){const t=new Set;return e.traverse(n=>{if(!n.isSkinnedMesh)return;const i=n;t.add(i)}),t}function zo(e,t){const n=new Set;for(let i=0;in)return!1;return!0}var Ge=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==null&&(t=this._index,this._objectIndexMap.set(e,t),this._index++),t}};function Go(e){var t,n,i,r;const o=new Y;o.name=e.name,o.setIndex(e.index);for(const[a,l]of Object.entries(e.attributes))o.setAttribute(a,l);for(const[a,l]of Object.entries(e.morphAttributes))o.morphAttributes[a]=l.concat();o.morphTargetsRelative=e.morphTargetsRelative,o.groups=[];for(const a of e.groups)o.addGroup(a.start,a.count,a.materialIndex);return o.boundingSphere=(n=(t=e.boundingSphere)==null?void 0:t.clone())!=null?n:null,o.boundingBox=(r=(i=e.boundingBox)==null?void 0:i.clone())!=null?r:null,o.drawRange.start=e.drawRange.start,o.drawRange.count=e.drawRange.count,o.userData=e.userData,o}function Ln(e){if(Object.values(e).forEach(t=>{t!=null&&t.isTexture&&t.dispose()}),e.isShaderMaterial){const t=e.uniforms;t&&Object.values(t).forEach(n=>{const i=n.value;i!=null&&i.isTexture&&i.dispose()})}e.dispose()}function Qo(e){const t=e.geometry;t&&t.dispose();const n=e.skeleton;n&&n.dispose();const i=e.material;i&&(Array.isArray(i)?i.forEach(r=>Ln(r)):i&&Ln(i))}function $o(e){e.traverse(Qo)}function Zo(e,t){var n,i;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.");const r=(n=t==null?void 0:t.experimentalSameBoneCounts)!=null?n:!1,o=[];e.traverse(s=>{s.type==="SkinnedMesh"&&o.push(s)});const a=new Map;let l=0;for(const s of o){const h=s.geometry.getAttribute("skinIndex");if(a.has(h))continue;const d=new Map,c=new Map;for(let p=0;p{var i,r,o,a;if(!n.isMesh)return;const l=n,s=l.geometry,u=s.index;if(u==null)return;const h=t.get(s);if(h!=null){l.geometry=h;return}const d=Object.values(s.attributes)[0].count,c=new Array(d);let p=0;const m=u.array;for(let M=0;M{y.addGroup(M.start,M.count,M.materialIndex)}),y.boundingBox=(r=(i=s.boundingBox)==null?void 0:i.clone())!=null?r:null,y.boundingSphere=(a=(o=s.boundingSphere)==null?void 0:o.clone())!=null?a:null,y.setDrawRange(s.drawRange.start,s.drawRange.count),y.userData=s.userData,t.set(s,y);{const M=u.array,x=new M.constructor(M.length);for(let w=0;w{const x=s.attributes[M];if(x.isInterleavedBufferAttribute)throw new Error("removeUnnecessaryVertices: InterleavedBufferAttribute is not supported");const w=x.array,{itemSize:R,normalized:S}=x,L=new w.constructor(g.length*R);g.forEach((I,P)=>{for(let b=0;b{y.morphAttributes[M]=[];const x=s.morphAttributes[M];for(let w=0;w{for(let B=0;Bb===0),y.morphAttributes[M][w]=new U(P,L,I)}}),E&&(y.morphAttributes={}),l.geometry=y}),Array.from(t.keys()).forEach(n=>{n.dispose()})}function Ko(e){var t;((t=e.meta)==null?void 0:t.metaVersion)==="0"&&(e.scene.rotation.y=Math.PI)}var ue=class{constructor(){}};ue.combineMorphs=Fo;ue.combineSkeletons=Ho;ue.deepDispose=$o;ue.removeUnnecessaryJoints=Zo;ue.removeUnnecessaryVertices=Jo;ue.rotateVRM0=Ko;/*! * @pixiv/three-vrm-core v3.4.0 * The implementation of core features of VRM, for @pixiv/three-vrm * @@ -976,7 +976,7 @@ void main() { * Copyright (c) 2019-2025 pixiv Inc. * @pixiv/three-vrm-animation is distributed under MIT License * https://github.com/pixiv/three-vrm/blob/release/LICENSE - */var bn=(e,t,n)=>new Promise((i,r)=>{var o=s=>{try{l(n.next(s))}catch(u){r(u)}},a=s=>{try{l(n.throw(s))}catch(u){r(u)}},l=s=>s.done?i(s.value):Promise.resolve(s.value).then(o,a);l((n=n.apply(e,t)).next())}),es={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"};new N;new ae;new _;new _;var In={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 ts(e){return e.invert?e.invert():e.inverse(),e}new _;new _;new _;new _;new _;new _(0,1,0);var ns=new _,is=new _;function rs(e,t){return e.matrixWorld.decompose(ns,t,is),t}function Qe(e){return[Math.atan2(-e.z,e.x),Math.atan2(e.y,Math.sqrt(e.x*e.x+e.z*e.z))]}function Cn(e){const t=Math.round(e/2/Math.PI);return e-2*Math.PI*t}var Un=new _(0,0,1),os=new _,ss=new _,as=new _,ls=new T,$e=new T,On=new T,us=new T,Ze=new ee,si=class ai{constructor(t,n){this.offsetFromHeadBone=new _,this.autoUpdate=!0,this.faceFront=new _(0,0,1),this.humanoid=t,this.applier=n,this._yaw=0,this._pitch=0,this._needsUpdate=!0,this._restHeadWorldQuaternion=this.getLookAtWorldQuaternion(new T)}get yaw(){return this._yaw}set yaw(t){this._yaw=t,this._needsUpdate=!0}get pitch(){return this._pitch}set pitch(t){this._pitch=t,this._needsUpdate=!0}get euler(){return console.warn("VRMLookAt: euler is deprecated. use getEuler() instead."),this.getEuler(new ee)}getEuler(t){return t.set(C.DEG2RAD*this._pitch,C.DEG2RAD*this._yaw,0,"YXZ")}copy(t){if(this.humanoid!==t.humanoid)throw new Error("VRMLookAt: humanoid must be same in order to copy");return this.offsetFromHeadBone.copy(t.offsetFromHeadBone),this.applier=t.applier,this.autoUpdate=t.autoUpdate,this.target=t.target,this.faceFront.copy(t.faceFront),this}clone(){return new ai(this.humanoid,this.applier).copy(this)}reset(){this._yaw=0,this._pitch=0,this._needsUpdate=!0}getLookAtWorldPosition(t){const n=this.humanoid.getRawBoneNode("head");return t.copy(this.offsetFromHeadBone).applyMatrix4(n.matrixWorld)}getLookAtWorldQuaternion(t){const n=this.humanoid.getRawBoneNode("head");return rs(n,t)}getFaceFrontQuaternion(t){if(this.faceFront.distanceToSquared(Un)<.01)return t.copy(this._restHeadWorldQuaternion).invert();const[n,i]=Qe(this.faceFront);return Ze.set(0,.5*Math.PI+n,i,"YZX"),t.setFromEuler(Ze).premultiply(us.copy(this._restHeadWorldQuaternion).invert())}getLookAtWorldDirection(t){return this.getLookAtWorldQuaternion($e),this.getFaceFrontQuaternion(On),t.copy(Un).applyQuaternion($e).applyQuaternion(On).applyEuler(this.getEuler(Ze))}lookAt(t){const n=ls.copy(this._restHeadWorldQuaternion).multiply(ts(this.getLookAtWorldQuaternion($e))),i=this.getLookAtWorldPosition(ss),r=as.copy(t).sub(i).applyQuaternion(n).normalize(),[o,a]=Qe(this.faceFront),[l,s]=Qe(r),u=Cn(l-o),h=Cn(a-s);this._yaw=C.RAD2DEG*u,this._pitch=C.RAD2DEG*h,this._needsUpdate=!0}update(t){this.target!=null&&this.autoUpdate&&this.lookAt(this.target.getWorldPosition(os)),this._needsUpdate&&(this._needsUpdate=!1,this.applier.applyYawPitch(this._yaw,this._pitch))}};si.EULER_ORDER="YXZ";var ds=si;new _(0,0,1);new ee(0,0,0,"YXZ");var Vn=180/Math.PI,Je=new ee,Nn=class extends xe{constructor(e){super(),this.vrmLookAt=e,this.type="VRMLookAtQuaternionProxy";const t=this.rotation._onChangeCallback;this.rotation._onChange(()=>{t(),this._applyToLookAt()});const n=this.quaternion._onChangeCallback;this.quaternion._onChange(()=>{n(),this._applyToLookAt()})}_applyToLookAt(){Je.setFromQuaternion(this.quaternion,ds.EULER_ORDER),this.vrmLookAt.yaw=Vn*Je.y,this.vrmLookAt.pitch=Vn*Je.x}};function hs(e,t,n){var i,r;const o=new Map,a=new Map;for(const[l,s]of e.humanoidTracks.rotation.entries()){const u=(i=t.getNormalizedBoneNode(l))==null?void 0:i.name;if(u!=null){const h=new $i(`${u}.quaternion`,s.times,s.values.map((d,c)=>n==="0"&&c%2===0?-d:d));a.set(l,h)}}for(const[l,s]of e.humanoidTracks.translation.entries()){const u=(r=t.getNormalizedBoneNode(l))==null?void 0:r.name;if(u!=null){const h=e.restHipsPosition.y,c=t.normalizedRestPose.hips.position[1]/h,p=s.clone();p.values=p.values.map((m,f)=>(n==="0"&&f%3!==1?-m:m)*c),p.name=`${u}.position`,o.set(l,p)}}return{translation:o,rotation:a}}function cs(e,t){const n=new Map,i=new Map;for(const[r,o]of e.expressionTracks.preset.entries()){const a=t.getExpressionTrackName(r);if(a!=null){const l=o.clone();l.name=a,n.set(r,l)}}for(const[r,o]of e.expressionTracks.custom.entries()){const a=t.getExpressionTrackName(r);if(a!=null){const l=o.clone();l.name=a,i.set(r,l)}}return{preset:n,custom:i}}function ps(e,t){if(e.lookAtTrack==null)return null;const n=e.lookAtTrack.clone();return n.name=t,n}function Es(e,t){const n=[],i=hs(e,t.humanoid,t.meta.metaVersion);if(n.push(...i.translation.values()),n.push(...i.rotation.values()),t.expressionManager!=null){const r=cs(e,t.expressionManager);n.push(...r.preset.values()),n.push(...r.custom.values())}if(t.lookAt!=null){let r=t.scene.children.find(a=>a instanceof Nn);r==null?(console.warn("createVRMAnimationClip: VRMLookAtQuaternionProxy is not found. Creating a new one automatically. To suppress this warning, create a VRMLookAtQuaternionProxy manually"),r=new Nn(t.lookAt),r.name="VRMLookAtQuaternionProxy",t.scene.add(r)):r.name==null&&(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");const o=ps(e,`${r.name}.quaternion`);o!=null&&n.push(o)}return new Gi("Clip",e.duration,n)}var ms=class{constructor(){this.duration=0,this.restHipsPosition=new _,this.humanoidTracks={translation:new Map,rotation:new Map},this.expressionTracks={preset:new Map,custom:new Map},this.lookAtTrack=null}};function Dn(e,t){const n=e.length,i=[];let r=[],o=0;for(let a=0;a{const v=r.animations[g],y=this._parseAnimation(f,v,s,u);return y.restHipsPosition=c,y});e.userData.vrmAnimations=m})}_createNodeMap(e){var t,n,i,r,o;const a=new Map,l=new Map,s=(t=e.humanoid)==null?void 0:t.humanBones;s&&Object.entries(s).forEach(([c,p])=>{const m=p==null?void 0:p.node;m!=null&&a.set(m,c)});const u=(n=e.expressions)==null?void 0:n.preset;u&&Object.entries(u).forEach(([c,p])=>{const m=p==null?void 0:p.node;m!=null&&l.set(m,c)});const h=(i=e.expressions)==null?void 0:i.custom;h&&Object.entries(h).forEach(([c,p])=>{const{node:m}=p;l.set(m,c)});const d=(o=(r=e.lookAt)==null?void 0:r.node)!=null?o:null;return{humanoidIndexToName:a,expressionsIndexToName:l,lookAtIndex:d}}_createBoneWorldMatrixMap(e,t){return bn(this,null,function*(){var n,i;e.scene.updateWorldMatrix(!1,!0);const r=yield e.parser.getDependencies("node"),o=new Map;if(t.humanoid==null)return o;for(const[a,l]of Object.entries(t.humanoid.humanBones)){const s=l==null?void 0:l.node;if(s!=null){const u=r[s];o.set(a,u.matrixWorld),a==="hips"&&o.set("hipsParent",(i=(n=u.parent)==null?void 0:n.matrixWorld)!=null?i:fs)}}return o})}_parseAnimation(e,t,n,i){const r=e.tracks,o=t.channels,a=new ms;return a.duration=e.duration,o.forEach((l,s)=>{const{node:u,path:h}=l.target,d=r[s];if(u==null)return;const c=n.humanoidIndexToName.get(u);if(c!=null){let m=In[c];for(;m!=null&&i.get(m)==null;)m=In[m];if(m==null&&(m="hipsParent"),h==="translation")if(c!=="hips")console.warn(`The loading animation contains a translation track for ${c}, which is not permitted in the VRMC_vrm_animation spec. ignoring the track`);else{const f=i.get("hipsParent"),g=Dn(d.values,3).flatMap(y=>ve.fromArray(y).applyMatrix4(f).toArray()),v=d.clone();v.values=new Float32Array(g),a.humanoidTracks.translation.set(c,v)}else if(h==="rotation"){const f=i.get(c),g=i.get(m);f.decompose(ve,Ke,ve),Ke.invert(),g.decompose(ve,Bn,ve);const v=Dn(d.values,4).flatMap(E=>_s.fromArray(E).premultiply(Bn).multiply(Ke).toArray()),y=d.clone();y.values=new Float32Array(v),a.humanoidTracks.rotation.set(c,y)}else throw new Error(`Invalid path "${h}"`);return}const p=n.expressionsIndexToName.get(u);if(p!=null){if(h==="translation"){const m=d.times,f=new Float32Array(d.values.length/3);for(let v=0;vnew Promise((i,r)=>{var o=s=>{try{l(n.next(s))}catch(u){r(u)}},a=s=>{try{l(n.throw(s))}catch(u){r(u)}},l=s=>s.done?i(s.value):Promise.resolve(s.value).then(o,a);l((n=n.apply(e,t)).next())}),es={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"};new N;new ae;new _;new _;var bn={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 ts(e){return e.invert?e.invert():e.inverse(),e}new _;new _;new _;new _;new _;new _(0,1,0);var ns=new _,is=new _;function rs(e,t){return e.matrixWorld.decompose(ns,t,is),t}function Qe(e){return[Math.atan2(-e.z,e.x),Math.atan2(e.y,Math.sqrt(e.x*e.x+e.z*e.z))]}function Cn(e){const t=Math.round(e/2/Math.PI);return e-2*Math.PI*t}var Un=new _(0,0,1),os=new _,ss=new _,as=new _,ls=new T,$e=new T,On=new T,us=new T,Ze=new ee,si=class ai{constructor(t,n){this.offsetFromHeadBone=new _,this.autoUpdate=!0,this.faceFront=new _(0,0,1),this.humanoid=t,this.applier=n,this._yaw=0,this._pitch=0,this._needsUpdate=!0,this._restHeadWorldQuaternion=this.getLookAtWorldQuaternion(new T)}get yaw(){return this._yaw}set yaw(t){this._yaw=t,this._needsUpdate=!0}get pitch(){return this._pitch}set pitch(t){this._pitch=t,this._needsUpdate=!0}get euler(){return console.warn("VRMLookAt: euler is deprecated. use getEuler() instead."),this.getEuler(new ee)}getEuler(t){return t.set(C.DEG2RAD*this._pitch,C.DEG2RAD*this._yaw,0,"YXZ")}copy(t){if(this.humanoid!==t.humanoid)throw new Error("VRMLookAt: humanoid must be same in order to copy");return this.offsetFromHeadBone.copy(t.offsetFromHeadBone),this.applier=t.applier,this.autoUpdate=t.autoUpdate,this.target=t.target,this.faceFront.copy(t.faceFront),this}clone(){return new ai(this.humanoid,this.applier).copy(this)}reset(){this._yaw=0,this._pitch=0,this._needsUpdate=!0}getLookAtWorldPosition(t){const n=this.humanoid.getRawBoneNode("head");return t.copy(this.offsetFromHeadBone).applyMatrix4(n.matrixWorld)}getLookAtWorldQuaternion(t){const n=this.humanoid.getRawBoneNode("head");return rs(n,t)}getFaceFrontQuaternion(t){if(this.faceFront.distanceToSquared(Un)<.01)return t.copy(this._restHeadWorldQuaternion).invert();const[n,i]=Qe(this.faceFront);return Ze.set(0,.5*Math.PI+n,i,"YZX"),t.setFromEuler(Ze).premultiply(us.copy(this._restHeadWorldQuaternion).invert())}getLookAtWorldDirection(t){return this.getLookAtWorldQuaternion($e),this.getFaceFrontQuaternion(On),t.copy(Un).applyQuaternion($e).applyQuaternion(On).applyEuler(this.getEuler(Ze))}lookAt(t){const n=ls.copy(this._restHeadWorldQuaternion).multiply(ts(this.getLookAtWorldQuaternion($e))),i=this.getLookAtWorldPosition(ss),r=as.copy(t).sub(i).applyQuaternion(n).normalize(),[o,a]=Qe(this.faceFront),[l,s]=Qe(r),u=Cn(l-o),h=Cn(a-s);this._yaw=C.RAD2DEG*u,this._pitch=C.RAD2DEG*h,this._needsUpdate=!0}update(t){this.target!=null&&this.autoUpdate&&this.lookAt(this.target.getWorldPosition(os)),this._needsUpdate&&(this._needsUpdate=!1,this.applier.applyYawPitch(this._yaw,this._pitch))}};si.EULER_ORDER="YXZ";var ds=si;new _(0,0,1);new ee(0,0,0,"YXZ");var Vn=180/Math.PI,Je=new ee,Nn=class extends xe{constructor(e){super(),this.vrmLookAt=e,this.type="VRMLookAtQuaternionProxy";const t=this.rotation._onChangeCallback;this.rotation._onChange(()=>{t(),this._applyToLookAt()});const n=this.quaternion._onChangeCallback;this.quaternion._onChange(()=>{n(),this._applyToLookAt()})}_applyToLookAt(){Je.setFromQuaternion(this.quaternion,ds.EULER_ORDER),this.vrmLookAt.yaw=Vn*Je.y,this.vrmLookAt.pitch=Vn*Je.x}};function hs(e,t,n){var i,r;const o=new Map,a=new Map;for(const[l,s]of e.humanoidTracks.rotation.entries()){const u=(i=t.getNormalizedBoneNode(l))==null?void 0:i.name;if(u!=null){const h=new $i(`${u}.quaternion`,s.times,s.values.map((d,c)=>n==="0"&&c%2===0?-d:d));a.set(l,h)}}for(const[l,s]of e.humanoidTracks.translation.entries()){const u=(r=t.getNormalizedBoneNode(l))==null?void 0:r.name;if(u!=null){const h=e.restHipsPosition.y,c=t.normalizedRestPose.hips.position[1]/h,p=s.clone();p.values=p.values.map((m,f)=>(n==="0"&&f%3!==1?-m:m)*c),p.name=`${u}.position`,o.set(l,p)}}return{translation:o,rotation:a}}function cs(e,t){const n=new Map,i=new Map;for(const[r,o]of e.expressionTracks.preset.entries()){const a=t.getExpressionTrackName(r);if(a!=null){const l=o.clone();l.name=a,n.set(r,l)}}for(const[r,o]of e.expressionTracks.custom.entries()){const a=t.getExpressionTrackName(r);if(a!=null){const l=o.clone();l.name=a,i.set(r,l)}}return{preset:n,custom:i}}function ps(e,t){if(e.lookAtTrack==null)return null;const n=e.lookAtTrack.clone();return n.name=t,n}function Es(e,t){const n=[],i=hs(e,t.humanoid,t.meta.metaVersion);if(n.push(...i.translation.values()),n.push(...i.rotation.values()),t.expressionManager!=null){const r=cs(e,t.expressionManager);n.push(...r.preset.values()),n.push(...r.custom.values())}if(t.lookAt!=null){let r=t.scene.children.find(a=>a instanceof Nn);r==null?(console.warn("createVRMAnimationClip: VRMLookAtQuaternionProxy is not found. Creating a new one automatically. To suppress this warning, create a VRMLookAtQuaternionProxy manually"),r=new Nn(t.lookAt),r.name="VRMLookAtQuaternionProxy",t.scene.add(r)):r.name==null&&(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");const o=ps(e,`${r.name}.quaternion`);o!=null&&n.push(o)}return new Gi("Clip",e.duration,n)}var ms=class{constructor(){this.duration=0,this.restHipsPosition=new _,this.humanoidTracks={translation:new Map,rotation:new Map},this.expressionTracks={preset:new Map,custom:new Map},this.lookAtTrack=null}};function Dn(e,t){const n=e.length,i=[];let r=[],o=0;for(let a=0;a{const v=r.animations[g],y=this._parseAnimation(f,v,s,u);return y.restHipsPosition=c,y});e.userData.vrmAnimations=m})}_createNodeMap(e){var t,n,i,r,o;const a=new Map,l=new Map,s=(t=e.humanoid)==null?void 0:t.humanBones;s&&Object.entries(s).forEach(([c,p])=>{const m=p==null?void 0:p.node;m!=null&&a.set(m,c)});const u=(n=e.expressions)==null?void 0:n.preset;u&&Object.entries(u).forEach(([c,p])=>{const m=p==null?void 0:p.node;m!=null&&l.set(m,c)});const h=(i=e.expressions)==null?void 0:i.custom;h&&Object.entries(h).forEach(([c,p])=>{const{node:m}=p;l.set(m,c)});const d=(o=(r=e.lookAt)==null?void 0:r.node)!=null?o:null;return{humanoidIndexToName:a,expressionsIndexToName:l,lookAtIndex:d}}_createBoneWorldMatrixMap(e,t){return In(this,null,function*(){var n,i;e.scene.updateWorldMatrix(!1,!0);const r=yield e.parser.getDependencies("node"),o=new Map;if(t.humanoid==null)return o;for(const[a,l]of Object.entries(t.humanoid.humanBones)){const s=l==null?void 0:l.node;if(s!=null){const u=r[s];o.set(a,u.matrixWorld),a==="hips"&&o.set("hipsParent",(i=(n=u.parent)==null?void 0:n.matrixWorld)!=null?i:fs)}}return o})}_parseAnimation(e,t,n,i){const r=e.tracks,o=t.channels,a=new ms;return a.duration=e.duration,o.forEach((l,s)=>{const{node:u,path:h}=l.target,d=r[s];if(u==null)return;const c=n.humanoidIndexToName.get(u);if(c!=null){let m=bn[c];for(;m!=null&&i.get(m)==null;)m=bn[m];if(m==null&&(m="hipsParent"),h==="translation")if(c!=="hips")console.warn(`The loading animation contains a translation track for ${c}, which is not permitted in the VRMC_vrm_animation spec. ignoring the track`);else{const f=i.get("hipsParent"),g=Dn(d.values,3).flatMap(y=>ve.fromArray(y).applyMatrix4(f).toArray()),v=d.clone();v.values=new Float32Array(g),a.humanoidTracks.translation.set(c,v)}else if(h==="rotation"){const f=i.get(c),g=i.get(m);f.decompose(ve,Ke,ve),Ke.invert(),g.decompose(ve,Bn,ve);const v=Dn(d.values,4).flatMap(E=>_s.fromArray(E).premultiply(Bn).multiply(Ke).toArray()),y=d.clone();y.values=new Float32Array(v),a.humanoidTracks.rotation.set(c,y)}else throw new Error(`Invalid path "${h}"`);return}const p=n.expressionsIndexToName.get(u);if(p!=null){if(h==="translation"){const m=d.times,f=new Float32Array(d.values.length/3);for(let v=0;vd.getProviderMetadata(a)),i=c({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),s=c({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});$(()=>{var e,r;d.initializeProvider(a),i.value=((e=o.value[a])==null?void 0:e.apiKey)||"",s.value=((r=o.value[a])==null?void 0:r.baseUrl)||""}),K([i,s],()=>{o.value[a]={...o.value[a],apiKey:i.value,baseUrl:s.value||""}});function b(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,r)=>{var v,f;return z(),x(t(S),{"provider-name":(v=n.value)==null?void 0:v.localizedName,"provider-icon-color":(f=n.value)==null?void 0:f.iconColor,"on-back":()=>t(g).back()},{default:u(()=>[l(t(P),null,{default:u(()=>[l(t(R),{title:t(m)("settings.pages.providers.common.section.basic.title"),description:t(m)("settings.pages.providers.common.section.basic.description"),"on-reset":b},{default:u(()=>{var p;return[l(t(N),{modelValue:i.value,"onUpdate:modelValue":r[0]||(r[0]=h=>i.value=h),"provider-name":(p=n.value)==null?void 0:p.localizedName,placeholder:"togetherapi-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(C),{title:t(m)("settings.pages.providers.common.section.advanced.title")},{default:u(()=>[l(t(M),{modelValue:s.value,"onUpdate:modelValue":r[1]||(r[1]=p=>s.value=p),placeholder:"https://api.together.xyz/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon-color","on-back"])}}});typeof _=="function"&&_(B);export{B as default}; diff --git a/assets/together-ai-DYtDSEI-.js b/assets/together-ai-DYtDSEI-.js new file mode 100644 index 0000000000000000000000000000000000000000..0420d128fb95017ffc9a1056aa890ca42a6d975d --- /dev/null +++ b/assets/together-ai-DYtDSEI-.js @@ -0,0 +1 @@ +import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-B6whjTNv.js";import{d as U,g as y,U as V,s as k,h as c,H as $,v as K,A as x,o as z,w as u,i as l,b as t}from"./index-BNq7Hbz_.js";import"./three-vrm-animation.module-BPuMi1if.js";import"./mcp-D2taTyhO.js";import"./mini_xsschema-P_8cZcRg.js";import{u as w}from"./providers-Ddg6LLwH.js";/* empty css */import{_ as C,a as M}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DETFnj2t.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-8yNUgi8_.js";import{_ as P,a as R}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C-W-PZMl.js";import{_ as S}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-kCkYL1sn.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-IiDV8qQX.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BlPB-gCV.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-IanARj3w.js";import"./Input.vue_vue_type_script_setup_true_lang-1pgLpBi1.js";const a="together-ai",B=U({__name:"together-ai",setup(I){const{t:m}=y(),g=V(),d=w(),{providers:o}=k(d),n=c(()=>d.getProviderMetadata(a)),i=c({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),s=c({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});$(()=>{var e,r;d.initializeProvider(a),i.value=((e=o.value[a])==null?void 0:e.apiKey)||"",s.value=((r=o.value[a])==null?void 0:r.baseUrl)||""}),K([i,s],()=>{o.value[a]={...o.value[a],apiKey:i.value,baseUrl:s.value||""}});function b(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,r)=>{var v,f;return z(),x(t(S),{"provider-name":(v=n.value)==null?void 0:v.localizedName,"provider-icon-color":(f=n.value)==null?void 0:f.iconColor,"on-back":()=>t(g).back()},{default:u(()=>[l(t(P),null,{default:u(()=>[l(t(R),{title:t(m)("settings.pages.providers.common.section.basic.title"),description:t(m)("settings.pages.providers.common.section.basic.description"),"on-reset":b},{default:u(()=>{var p;return[l(t(N),{modelValue:i.value,"onUpdate:modelValue":r[0]||(r[0]=h=>i.value=h),"provider-name":(p=n.value)==null?void 0:p.localizedName,placeholder:"togetherapi-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(C),{title:t(m)("settings.pages.providers.common.section.advanced.title")},{default:u(()=>[l(t(M),{modelValue:s.value,"onUpdate:modelValue":r[1]||(r[1]=p=>s.value=p),placeholder:"https://api.together.xyz/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon-color","on-back"])}}});typeof _=="function"&&_(B);export{B as default}; diff --git a/assets/useIconAnimation-CpaNr068.js b/assets/useIconAnimation-CpaNr068.js new file mode 100644 index 0000000000000000000000000000000000000000..d54e974d3c14ef20f9e3d5b9bbe985c3f4c9435b --- /dev/null +++ b/assets/useIconAnimation-CpaNr068.js @@ -0,0 +1 @@ +import"./mcp-D2taTyhO.js";import"./mini_xsschema-P_8cZcRg.js";import{r as t,G as r,h as u,H as m,I as c}from"./index-BNq7Hbz_.js";function d(s){const n=t(!1),o=t(!1),a=t(s),e=r(),i=u(()=>o.value&&!e.disableTransitions&&e.usePageSpecificTransitions);return m(()=>{o.value=!0,requestAnimationFrame(()=>{n.value=!0})}),c(()=>{n.value=!1,o.value=!1}),{iconAnimationStarted:n,showIconAnimation:i,animationIcon:a}}export{d as u}; diff --git a/assets/useIconAnimation-RrGZYl5Z.js b/assets/useIconAnimation-RrGZYl5Z.js deleted file mode 100644 index 721ea8bc13b0c6edc963cac2076af7521f27043e..0000000000000000000000000000000000000000 --- a/assets/useIconAnimation-RrGZYl5Z.js +++ /dev/null @@ -1 +0,0 @@ -import"./emotions-CAex_2dA.js";import{r as t,D as u,l as r,f as c,g as m}from"./index-D3pfQUMu.js";function p(s){const n=t(!1),o=t(!1),a=t(s),e=u(),i=r(()=>o.value&&!e.disableTransitions&&e.usePageSpecificTransitions);return c(()=>{o.value=!0,requestAnimationFrame(()=>{n.value=!0})}),m(()=>{n.value=!1,o.value=!1}),{iconAnimationStarted:n,showIconAnimation:i,animationIcon:a}}export{p as u}; diff --git a/assets/valibot-BI4iQMg3-AQFxgSlR.js b/assets/valibot-BI4iQMg3-AQFxgSlR.js new file mode 100644 index 0000000000000000000000000000000000000000..8209531bfbf15809772d39b5129c83ea65849d99 --- /dev/null +++ b/assets/valibot-BI4iQMg3-AQFxgSlR.js @@ -0,0 +1 @@ +import{L as r}from"./index-BNq7Hbz_.js";import{t as a}from"./mcp-D2taTyhO.js";const s=async()=>{const{toJsonSchema:o}=await a(r(()=>import("./index-CShXCEpO.js"),[]),"@valibot/to-json-schema");return t=>o(t)};export{s as getToJsonSchemaFn}; diff --git a/assets/vibrant-B-3LuKiX.js b/assets/vibrant-B-3LuKiX.js deleted file mode 100644 index b483ea59a57a1faa6394e5d505e1c1c43b577fc4..0000000000000000000000000000000000000000 --- a/assets/vibrant-B-3LuKiX.js +++ /dev/null @@ -1 +0,0 @@ -/* empty css */import{_ as g}from"./InputFile.vue_vue_type_script_setup_true_lang-BFgYfCCt.js";import{V as p}from"./browser-CkchkNbv.js";import{d as v,r as n,w as _,c as r,o,a as s,bA as b,bB as h,t as k,b as w,u as x,i as y,q as V}from"./index-D3pfQUMu.js";const j={flex:"","flex-col":"","gap-4":""},B={border:"2 solid neutral-200 dark:neutral-800",bg:"neutral-50 dark:neutral-900","w-full":"",flex:"","gap-2":"","rounded-lg":"","p-4":""},C={border:"2 solid neutral-200 dark:neutral-800",bg:"neutral-50 dark:neutral-900","w-full":"",flex:"","gap-2":"","rounded-lg":"","p-4":""},L={flex:"","gap-2":""},N={"h-60":"",border:"2 solid neutral-200 dark:neutral-800",bg:"neutral-50 dark:neutral-900","rounded-lg":""},O=["src"],I=v({__name:"vibrant",setup(S){const u=n([]),t=n(),d=n([]),i=n([]);function c(l){const a=new Image;a.src=URL.createObjectURL(l),a.onload=f,t.value=a}async function f(){if(!t.value)return;const a=await new p(t.value).getPalette();d.value=Object.values(a).map(e=>e==null?void 0:e.hex).filter(e=>typeof e=="string"),i.value=Object.values(a).map(e=>JSON.stringify(e))}return _(u,l=>{c(l[0])},{deep:!0}),(l,a)=>(o(),r("div",j,[s("div",B,[(o(!0),r(b,null,h(d.value,(e,m)=>(o(),r("div",{key:m,style:V({backgroundColor:e}),"size-20":"","rounded-full":""},null,4))),128))]),s("div",C,k(i.value),1),s("div",L,[w(x(g),{modelValue:u.value,"onUpdate:modelValue":a[0]||(a[0]=e=>u.value=e),"h-60":"","w-full":""},null,8,["modelValue"])]),s("div",N,[t.value?(o(),r("img",{key:0,src:t.value.src,"h-full":"","w-full":"","object-contain":""},null,8,O)):y("",!0)])]))}});export{I as default}; diff --git a/assets/vibrant-BjWjzLe_.js b/assets/vibrant-BjWjzLe_.js new file mode 100644 index 0000000000000000000000000000000000000000..b072cc7396e62f6e2d6e73c18b81dccb96a16c66 --- /dev/null +++ b/assets/vibrant-BjWjzLe_.js @@ -0,0 +1 @@ +/* empty css */import{_ as g}from"./InputFile.vue_vue_type_script_setup_true_lang-DHNEAW-b.js";import{V as p}from"./browser-CkchkNbv.js";import{d as v,r as n,v as _,c as r,o,e as s,F as b,l as h,t as k,i as w,b as x,j as y,z as V}from"./index-BNq7Hbz_.js";const j={flex:"","flex-col":"","gap-4":""},C={border:"2 solid neutral-200 dark:neutral-800",bg:"neutral-50 dark:neutral-900","w-full":"",flex:"","gap-2":"","rounded-lg":"","p-4":""},L={border:"2 solid neutral-200 dark:neutral-800",bg:"neutral-50 dark:neutral-900","w-full":"",flex:"","gap-2":"","rounded-lg":"","p-4":""},N={flex:"","gap-2":""},O={"h-60":"",border:"2 solid neutral-200 dark:neutral-800",bg:"neutral-50 dark:neutral-900","rounded-lg":""},z=["src"],I=v({__name:"vibrant",setup(B){const u=n([]),t=n(),d=n([]),i=n([]);function c(l){const a=new Image;a.src=URL.createObjectURL(l),a.onload=f,t.value=a}async function f(){if(!t.value)return;const a=await new p(t.value).getPalette();d.value=Object.values(a).map(e=>e==null?void 0:e.hex).filter(e=>typeof e=="string"),i.value=Object.values(a).map(e=>JSON.stringify(e))}return _(u,l=>{c(l[0])},{deep:!0}),(l,a)=>(o(),r("div",j,[s("div",C,[(o(!0),r(b,null,h(d.value,(e,m)=>(o(),r("div",{key:m,style:V({backgroundColor:e}),"size-20":"","rounded-full":""},null,4))),128))]),s("div",L,k(i.value),1),s("div",N,[w(x(g),{modelValue:u.value,"onUpdate:modelValue":a[0]||(a[0]=e=>u.value=e),"h-60":"","w-full":""},null,8,["modelValue"])]),s("div",O,[t.value?(o(),r("img",{key:0,src:t.value.src,"h-full":"","w-full":"","object-contain":""},null,8,z)):y("",!0)])]))}});export{I as default}; diff --git a/assets/volcengine-byeJ4X8x.js b/assets/volcengine-byeJ4X8x.js new file mode 100644 index 0000000000000000000000000000000000000000..77a1c9e516b47ca71ca0c8a47d62170c9556a63c --- /dev/null +++ b/assets/volcengine-byeJ4X8x.js @@ -0,0 +1 @@ +import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-B6whjTNv.js";import{d as y,r as w,s as M,g as I,h as v,H as S,v as g,A as x,o as k,w as c,i as f,b as r,e as F}from"./index-BNq7Hbz_.js";import"./three-vrm-animation.module-BPuMi1if.js";import"./mcp-D2taTyhO.js";import"./mini_xsschema-P_8cZcRg.js";import{u as $}from"./providers-Ddg6LLwH.js";import{u as B}from"./speech-CKvssz06.js";import{_ as R}from"./FieldInput.vue_vue_type_script_setup_true_lang-IanARj3w.js";import{_ as E}from"./FieldRange.vue_vue_type_script_setup_true_lang-RRSKRN5w.js";/* empty css */import{_ as H,a as K}from"./SpeechProviderSettings.vue_vue_type_script_setup_true_lang-DQ9q1Mut.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./Input.vue_vue_type_script_setup_true_lang-1pgLpBi1.js";import"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DETFnj2t.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-IiDV8qQX.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BlPB-gCV.js";import"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-8yNUgi8_.js";import"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C-W-PZMl.js";const L={flex:"~ col gap-4"},o="volcengine",b="v1",N=y({__name:"volcengine",setup(T){const s=w(1),d=B(),a=$(),{providers:t}=M(a),{t:n}=I(),p=v({get:()=>{var e,i;return((i=(e=t.value[o])==null?void 0:e.app)==null?void 0:i.appId)||""},set:e=>{t.value[o]||(t.value[o]={}),t.value[o].app={appId:e}}}),C=v(()=>{var e;return!!((e=t.value[o])!=null&&e.apiKey)}),h=v(()=>d.availableVoices[o]||[]);async function P(e,i,l){const m=a.getProviderInstance(o);if(!m)throw new Error("Failed to initialize speech provider");const u=a.getProviderConfig(o),V=u.model||b;return await d.speech(m,V,e,i,{...u})}return S(async()=>{const e=a.getProviderConfig(o);await a.getProviderMetadata(o).validators.validateProviderConfig(e)?await d.loadVoicesForProvider(o):console.error("Failed to validate provider config",e)}),g(s,async()=>{const e=a.getProviderConfig(o);e.audio||(e.audio={}),e.audio.speedRatio=s.value}),g([t,p],async()=>{const e=a.getProviderConfig(o);await a.getProviderMetadata(o).validators.validateProviderConfig(e)?await d.loadVoicesForProvider(o):console.error("Failed to validate provider config",e)},{immediate:!0}),(e,i)=>(k(),x(r(K),{"provider-id":o,"default-model":b},{"basic-settings":c(()=>[F("div",L,[f(r(R),{modelValue:p.value,"onUpdate:modelValue":i[0]||(i[0]=l=>p.value=l),label:r(n)("settings.pages.providers.provider.volcengine.fields.field.appId.label"),description:r(n)("settings.pages.providers.provider.volcengine.fields.field.appId.description"),required:""},null,8,["modelValue","label","description"])])]),"voice-settings":c(()=>[f(r(E),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=l=>s.value=l),label:r(n)("settings.pages.providers.provider.common.fields.field.speed.label"),description:r(n)("settings.pages.providers.provider.common.fields.field.speed.description"),min:.5,max:2,step:.01},null,8,["modelValue","label","description"])]),playground:c(()=>[f(r(H),{"available-voices":h.value,"generate-speech":P,"api-key-configured":C.value,"default-text":"Hello! This is a test of the ElevenLabs voice synthesis."},null,8,["available-voices","api-key-configured"])]),_:1}))}});typeof _=="function"&&_(N);export{N as default}; diff --git a/assets/volcengine-hdss6LC5.js b/assets/volcengine-hdss6LC5.js deleted file mode 100644 index ea0d8b3f440d050f66bb8068a664460ecd645168..0000000000000000000000000000000000000000 --- a/assets/volcengine-hdss6LC5.js +++ /dev/null @@ -1 +0,0 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-t8bgqiA6.js";import{d as y,r as w,s as M,k as I,l as c,f as S,w as g,m as k,o as x,E as v,b as f,u as r,a as F}from"./index-D3pfQUMu.js";import"./three-vrm-animation.module-DLbUhddZ.js";import"./emotions-CAex_2dA.js";import{u as $}from"./providers-CCvie00Z.js";import{u as B}from"./speech-CIOuIakE.js";import{_ as E}from"./FieldInput.vue_vue_type_script_setup_true_lang-Brkyubp9.js";import{_ as R}from"./FieldRange.vue_vue_type_script_setup_true_lang-IEKed7Lk.js";/* empty css */import{_ as K,a as L}from"./SpeechProviderSettings.vue_vue_type_script_setup_true_lang-ByvvVpU4.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./Input.vue_vue_type_script_setup_true_lang-B223oRg0.js";import"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Qp-g_fu5.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-DDNOeGH3.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-D_DUmSTM.js";import"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-yC-Tsbbb.js";import"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C8wZQWhG.js";const N={flex:"~ col gap-4"},o="volcengine",b="v1",T=y({__name:"volcengine",setup(U){const s=w(1),d=B(),a=$(),{providers:t}=M(a),{t:n}=I(),p=c({get:()=>{var e,i;return((i=(e=t.value[o])==null?void 0:e.app)==null?void 0:i.appId)||""},set:e=>{t.value[o]||(t.value[o]={}),t.value[o].app={appId:e}}}),C=c(()=>{var e;return!!((e=t.value[o])!=null&&e.apiKey)}),P=c(()=>d.availableVoices[o]||[]);async function V(e,i,l){const m=a.getProviderInstance(o);if(!m)throw new Error("Failed to initialize speech provider");const u=a.getProviderConfig(o),h=u.model||b;return await d.speech(m,h,e,i,{...u})}return S(async()=>{const e=a.getProviderConfig(o);await a.getProviderMetadata(o).validators.validateProviderConfig(e)?await d.loadVoicesForProvider(o):console.error("Failed to validate provider config",e)}),g(s,async()=>{const e=a.getProviderConfig(o);e.audio||(e.audio={}),e.audio.speedRatio=s.value}),g([t,p],async()=>{const e=a.getProviderConfig(o);await a.getProviderMetadata(o).validators.validateProviderConfig(e)?await d.loadVoicesForProvider(o):console.error("Failed to validate provider config",e)},{immediate:!0}),(e,i)=>(x(),k(r(L),{"provider-id":o,"default-model":b},{"basic-settings":v(()=>[F("div",N,[f(r(E),{modelValue:p.value,"onUpdate:modelValue":i[0]||(i[0]=l=>p.value=l),label:r(n)("settings.pages.providers.provider.volcengine.fields.field.appId.label"),description:r(n)("settings.pages.providers.provider.volcengine.fields.field.appId.description"),required:""},null,8,["modelValue","label","description"])])]),"voice-settings":v(()=>[f(r(R),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=l=>s.value=l),label:r(n)("settings.pages.providers.provider.common.fields.field.speed.label"),description:r(n)("settings.pages.providers.provider.common.fields.field.speed.description"),min:.5,max:2,step:.01},null,8,["modelValue","label","description"])]),playground:v(()=>[f(r(K),{"available-voices":P.value,"generate-speech":V,"api-key-configured":C.value,"default-text":"Hello! This is a test of the ElevenLabs voice synthesis."},null,8,["available-voices","api-key-configured"])]),_:1}))}});typeof _=="function"&&_(T);export{T as default}; diff --git a/assets/xai-DGMMhjzA.js b/assets/xai-DGMMhjzA.js deleted file mode 100644 index c5c40adc4e78add4552f51990dce97aa01b13d55..0000000000000000000000000000000000000000 --- a/assets/xai-DGMMhjzA.js +++ /dev/null @@ -1 +0,0 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-t8bgqiA6.js";import{d as x,k as U,h as V,s as y,l as v,f as $,w as K,m as h,o as w,E as u,b as l,u as t}from"./index-D3pfQUMu.js";import"./three-vrm-animation.module-DLbUhddZ.js";import"./emotions-CAex_2dA.js";import{u as z}from"./providers-CCvie00Z.js";/* empty css */import{_ as M,a as N}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-Qp-g_fu5.js";import{_ as P}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-yC-Tsbbb.js";import{_ as R,a as S}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C8wZQWhG.js";import{_ as B}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-CRYYAVy7.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-DDNOeGH3.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-D_DUmSTM.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-Brkyubp9.js";import"./Input.vue_vue_type_script_setup_true_lang-B223oRg0.js";const a="xai",C=x({__name:"xai",setup(I){const{t:m}=U(),b=V(),d=z(),{providers:o}=y(d),n=v(()=>d.getProviderMetadata(a)),r=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),s=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});$(()=>{var e,i;d.initializeProvider(a),r.value=((e=o.value[a])==null?void 0:e.apiKey)||"",s.value=((i=o.value[a])==null?void 0:i.baseUrl)||""}),K([r,s],()=>{o.value[a]={...o.value[a],apiKey:r.value,baseUrl:s.value||""}});function g(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var c,f;return w(),h(t(B),{"provider-name":(c=n.value)==null?void 0:c.localizedName,"provider-icon":(f=n.value)==null?void 0:f.icon,"on-back":()=>t(b).back()},{default:u(()=>[l(t(R),null,{default:u(()=>[l(t(S),{title:t(m)("settings.pages.providers.common.section.basic.title"),description:t(m)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:u(()=>{var p;return[l(t(P),{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=k=>r.value=k),"provider-name":(p=n.value)==null?void 0:p.localizedName,placeholder:"xai-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(M),{title:t(m)("settings.pages.providers.common.section.advanced.title")},{default:u(()=>[l(t(N),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=p=>s.value=p),placeholder:"https://api.x.ai/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});typeof _=="function"&&_(C);export{C as default}; diff --git a/assets/xai-Dhgty11s.js b/assets/xai-Dhgty11s.js new file mode 100644 index 0000000000000000000000000000000000000000..59b727c9f87a3a1ecada1556c62ab507faf578c0 --- /dev/null +++ b/assets/xai-Dhgty11s.js @@ -0,0 +1 @@ +import"./Stage.vue_vue_type_style_index_0_scoped_e41b35dc_lang-B6whjTNv.js";import{d as x,g as V,U as k,s as y,h as v,H as $,v as K,A as h,o as w,w as u,i as l,b as t}from"./index-BNq7Hbz_.js";import"./three-vrm-animation.module-BPuMi1if.js";import"./mcp-D2taTyhO.js";import"./mini_xsschema-P_8cZcRg.js";import{u as z}from"./providers-Ddg6LLwH.js";/* empty css */import{_ as M,a as N}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-DETFnj2t.js";import{_ as P}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-8yNUgi8_.js";import{_ as R,a as S}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-C-W-PZMl.js";import{_ as B}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-kCkYL1sn.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-IiDV8qQX.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-BlPB-gCV.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-IanARj3w.js";import"./Input.vue_vue_type_script_setup_true_lang-1pgLpBi1.js";const a="xai",C=x({__name:"xai",setup(I){const{t:m}=V(),b=k(),d=z(),{providers:o}=y(d),n=v(()=>d.getProviderMetadata(a)),r=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.apiKey)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].apiKey=e}}),s=v({get:()=>{var e;return((e=o.value[a])==null?void 0:e.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});$(()=>{var e,i;d.initializeProvider(a),r.value=((e=o.value[a])==null?void 0:e.apiKey)||"",s.value=((i=o.value[a])==null?void 0:i.baseUrl)||""}),K([r,s],()=>{o.value[a]={...o.value[a],apiKey:r.value,baseUrl:s.value||""}});function g(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var c,f;return w(),h(t(B),{"provider-name":(c=n.value)==null?void 0:c.localizedName,"provider-icon":(f=n.value)==null?void 0:f.icon,"on-back":()=>t(b).back()},{default:u(()=>[l(t(R),null,{default:u(()=>[l(t(S),{title:t(m)("settings.pages.providers.common.section.basic.title"),description:t(m)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:u(()=>{var p;return[l(t(P),{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=U=>r.value=U),"provider-name":(p=n.value)==null?void 0:p.localizedName,placeholder:"xai-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(M),{title:t(m)("settings.pages.providers.common.section.advanced.title")},{default:u(()=>[l(t(N),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=p=>s.value=p),placeholder:"https://api.x.ai/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});typeof _=="function"&&_(C);export{C as default}; diff --git a/assets/zod-CxRm5Gac-BRS3ngCs.js b/assets/zod-CxRm5Gac-BRS3ngCs.js new file mode 100644 index 0000000000000000000000000000000000000000..928dae6d84c13d08b9e9d025a65a72e3561a9149 --- /dev/null +++ b/assets/zod-CxRm5Gac-BRS3ngCs.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mcp-D2taTyhO.js","assets/index-BNq7Hbz_.js","assets/index-Bsn4xRdB.css","assets/index-DZtNGEmw.js"])))=>i.map(i=>d[i]); +import{L as n}from"./index-BNq7Hbz_.js";const c=async()=>{let r=e=>{throw new Error('xsschema: Missing dependencies "zod" or "@zod/mini".')},a=e=>{throw new Error('xsschema: Missing dependencies "zod-to-json-schema".')};try{const{z:e}=await n(async()=>{const{z:o}=await import("./mini_xsschema-P_8cZcRg.js").then(t=>t.m);return{z:o}},[]);r=e.toJSONSchema}catch{}try{const{z:e}=await n(async()=>{const{z:o}=await import("./mcp-D2taTyhO.js").then(t=>t.i);return{z:o}},__vite__mapDeps([0,1,2]));"toJSONSchema"in e&&(r=e.toJSONSchema)}catch(e){e instanceof Error&&console.error(e.message)}try{const{zodToJsonSchema:e}=await n(async()=>{const{zodToJsonSchema:o}=await import("./index-DZtNGEmw.js");return{zodToJsonSchema:o}},__vite__mapDeps([3,0,1,2]));a=e}catch(e){e instanceof Error&&console.error(e.message)}return async e=>"_zod"in e?r(e):a(e)};export{c as getToJsonSchemaFn}; diff --git a/index.html b/index.html index 9dfe6a0d73aa8445bbe567c8dda1cd0c290f30f8..7cc3ad589daaf7a4971e08596cbb4de6660f6027 100644 --- a/index.html +++ b/index.html @@ -23,7 +23,7 @@ src="/remote-assets/page-external-data/js/script.js" > - +